QuantaStor Developers Guide

From OSNEXUS Wiki
Jump to: navigation, search

QuantaStor REST API

QuantaStor was designed from the start with REST APIs to enable development of applications and extensions to remotely manage QuantaStor storage systems.

Supported Languages

You can use just about any programming language you like to communicate with QuantaStor via our RESTful API. Recommended tools:

Browser Tools

We highly recommend installing a tool like JSONView or other similar browser tool so that you can view the JSON output from the various API calls in an easy to read format. When experimenting with various APIs you can then use your browser to call the API, see the results, and plan for how to integrate it into your script or application.

Examples

Here's are some examples of how to enumerate various objects using the RESTful API and the curl utility:

curl -u admin:password https://192.168.0.116:8153/qstorapi/hostEnum -k
curl -u admin:password https://192.168.0.116:8153/qstorapi/storageVolumeEnum -k
curl -u admin:password https://192.168.0.116:8153/qstorapi/storageSystemGet -k
curl -u admin:password https://192.168.0.116:8153/qstorapi/storagePoolEnum -k
curl -u admin:password https://192.168.0.116:8153/qstorapi/userEnum -k
curl -u admin:password https://192.168.0.116:8153/qstorapi/networkShareEnum -k

One quick way to test is to just enter one of these URLs (https://192.168.0.116:8153/qstorapi/hostEnum) into your web browser which will work as long as your system admin account is still using the default password. Pretty much every known language has a curl type library/module for it so the above technique will work everywhere, you just need to get up to speed with your preferred language's curl API mechanism.

Note you can even access APIs using wget which in this example will store the results into a file called hostEnum:

wget --no-check-certificate https://192.168.0.135:8153/qstorapi/hostEnum

Passing Args as a File

You can also call one of our RESTful APIs by passing a file instead of command line arguments. To do this your command will look something like this:

curl -k -u admin:password -d @file.json  https://192.168.0.116:8153/qstorapi/jsonrpc

An example of how the file should be formatted looks like this:

{
    "method": "echo",
    "params": {
        "inputMessage": "Message"
    }
}

The format being used is JSON. You specify the command you would like to call using the key "method". Then the parameters are passed in using the key "params". If more than one parameter is specified, separate them with a comma.

{
    "method": "command",
    "params": {
        "param1": "<value1>",
        "param2": "<value2>",
        "param3": "<value3>"
    }
}

Reflection

The RESTful API has basic support for reflection, meaning that you can learn about all the arguments for a given API just by calling it with the 'help' parameter like so:

curl -k -u admin:password https://192.168.0.116:8153/qstorapi/hostAdd?help

Calling APIs with Parameters

To call an API with parameters you'll need to add a & between each parameter you specify and a ? between the API name and the start of the parameters like so:

curl -k -u admin:password "https://192.168.0.116:8153/qstorapi/hostAdd?iqn=iqn.1991-05.com.microsoft:osn-mediaserver3&hostname=mediaserver3&flags=0"

Which will return JSON output like this (note the quotes so that the ampersand is not interpreted by the shell). Also note that sometimes it can be hard to read the JSON output so we recommend using a JSON Formatter when you're developing your integration code.

{
   "task":{
      "i18nDescription":{
         "messageText":null,
         "messageId":null
      },
      "operation":"add",
      "id":"ca54a531-6386-a4f7-b9de-30f505329bb1",
      "objectType":"Host",
      "finishTimeStamp":"1969-12-31 16:00:00",
      "isRemote":false,
      "createdTimeStamp":"2012-08-23 21:53:40",
      "state":0,
      "acls":[
         {
            "reserved":0,
            "objectId":"ca54a531-6386-a4f7-b9de-30f505329bb1",
            "ownerType":23,
            "ownerId":"252d4786-b19f-ae43-1ff6-453bee8a652e",
            "accessLevel":2,
            "objectType":16
         }
      ],
      "clientIpAddress":"127.0.0.1",
      "parentId":null,
      "modifiedByUserId":null,
      "progress":0,
      "customId":null,
      "type":16,
      "description":"Adding host 'mediaserver3' to service with iSCSI initiator IQN 'iqn.1991-05.com.microsoft:osn-mediaserver3'.",
      "errorMessage":{
         "function":null,
         "severity":0,
         "errorCode":0,
         "file":null,
         "message":{
            "messageText":null,
            "messageId":null
         },
         "line":0
      },
      "modifiedTimeStamp":"1969-12-31 16:00:00",
      "storageSystemId":"50ce62e6-6846-c5b3-d8a1-27061a696604",
      "createdByUserId":"252d4786-b19f-ae43-1ff6-453bee8a652e",
      "name":"Add Host",
      "startTimeStamp":"2012-08-23 21:53:40",
      "taskState":2
   },
   "obj":{
      "username":null,
      "storageSystemId":"50ce62e6-6846-c5b3-d8a1-27061a696604",
      "isRemote":false,
      "hostGroupId":null,
      "name":"mediaserver3",
      "ipAddress":null,
      "createdByUserId":"252d4786-b19f-ae43-1ff6-453bee8a652e",
      "modifiedTimeStamp":"1969-12-31 16:00:00",
      "createdTimeStamp":"2012-08-23 21:53:40",
      "state":0,
      "hostOsType":0,
      "initiatorPortList":[
         {
            "storageSystemId":"50ce62e6-6846-c5b3-d8a1-27061a696604",
            "isRemote":false,
            "hostId":"4fb8c2da-235a-18f9-2620-1d8aa5da89c5",
            "name":"iqn.1991-05.com.microsoft:osn-mediaserver3",
            "ipAddress":null,
            "createdByUserId":"252d4786-b19f-ae43-1ff6-453bee8a652e",
            "modifiedTimeStamp":"1969-12-31 16:00:00",
            "createdTimeStamp":"2012-08-23 21:53:40",
            "wwpn":null,
            "state":0,
            "iqn":"iqn.1991-05.com.microsoft:osn-mediaserver3",
            "initiatorType":0,
            "modifiedByUserId":null,
            "customId":null,
            "type":13,
            "id":"535abed2-830a-a437-d6fd-5af7c5b5c263"
         }
      ],
      "modifiedByUserId":null,
      "customId":null,
      "password":"********",
      "type":11,
      "id":"4fb8c2da-235a-18f9-2620-1d8aa5da89c5",
      "description":"None"
   }
}

Async vs. Sync (blocking vs non-blocking) API calls

All of the APIs for QuantaStor that modify the configuration in any way will start a task in the system. If you call any API with the flags parameter set to 0 it'll be treated as a blocking call which wait for the task to complete before returning. If you want to call the function and have it return immediately you can pass a 1 as the flags parameter which indicates to the server that the caller wants this to be an asynchronous non-blocking call. With asynchronous calls you'll get the task object back so that you can use the taskGet API to monitor the progress of the operation. When the task completes it will populate the customId property of the task to contain the ID(s) of the objects which were created/deleted/modified by the task.

Task Monitoring

As indicated above, sometimes you'll want to call an API asynchronously so that you can monitor the progress of the task and/or because you want to queue up multiple operations to run simultaneously. In such cases where you call an API asynchronously (flags=1) you can monitor the progress of the task using the tastGet API or the tastEnum API if you want to see all running tasks. When the task is completed you can check the customId property to see the ID(s) of the objects created/modified.

API Error Code Definitions

For all APIs a 0 is returned for SUCCESS and a non-zero error code is returned if there is a command failure along with a description of the error. Full list of error codes are available here.

Security

QuantaStor REST interface always uses SSL via HTTPS. You can change the pem keys on your system by replacing the qstorapi_server.pem file located in /opt/osnexus/quantastor/restsrv/ with your own. If you want to use plain HTTP without SSL you can rename or remove the qstorapi_server.pem and the RESTful service will automatically fall back to using HTTP. After removing the file just restart the RESTful service interface with:

service restsrv restart

If you want to block access to the restful interface you can stop the service and/or you can remove access to port 8153 by removing the entry associated with that port number from the /etc/init.d/iptables configuration file and then restart iptables like so:

service iptables restart

In a similar manner you can block access to the web management interface on port 80/8080.

Supported SOAP / WebServices Implementations

  • gSOAP (C++, all platforms)
  • Apache Axis (Java, all platforms)
  • .NET (C# & Visual Basic, Windows)

API List

The following represents the full API list for every API in QuantaStor. Nothing is left out, if you can do it from the web management interface or the CLI, it's here.

Examples

 
curl -u username:password -k https://hostname:8153/qstorapi/aclAdd?objectId=<id>&ownerType=<int>&ownerId=<id>&accessLevel=<int>&objectType=<int> 

curl -u username:password -k https://hostname:8153/userAdd?username=tiger&password=passWORD1&firstName=Tiger&lastName=Woods&role=Administrator

curl -u username:password -k -d @data.json https://hostname:8153/qstorapi/jsonrpc

Example Script

Here is an example script in python. To use this example replace the ip address with your QuantaStor boxes ip.


import json
import subprocess

print "I am getting the storage system info..."
#To get the data make an http request (such as a curl call)

proc = subprocess.Popen(["curl", "-k", "-u", "admin:password",
         "https://192.168.0.142:8153/qstorapi/storageSystemGet?"], stdout=subprocess.PIPE)

(out, err) = proc.communicate()

print
print "Here is what the returned data looks like when I get it:"
print
print str(out)
print

#call json.loads to turn it into a python dictionary
out = json.loads(out)
print "Here is how to get a single field from the output:"
print
storageSystemId = out["id"]
print storageSystemId

QuantaStor REST API Versions

All efforts are made to keep existing REST API from changing but on rare occasions API changes to existing APIs and objects may change. As such the following sections document the APIs as per a specific released version of QuantaStor. New versions of QuantaStor generally introduce some new APIs and object types but these are added in a backwards compatible fashion.

QuantaStor REST API Reference v4.2, v4.1

Notes: QS v4.1 and newer maintains compatibility with the previous versions of the REST API with some minor changes to optimize the storageVolume and networkShare objects to contain a snapshot ID list rather than the complete set of all snapshot objects with all their properties. Scripts using the old mode will need to be updated to use the snapshot ID to query for additional share/volume snapshot information if required.

QuantaStor REST API Reference v4.0 and earlier

Enumeration Types

The enumeration types listed below are used with APIs noted above. Many of the enumerations have assigned values like "OSN_CMN_FLAG_ASYNC = 0x0001" but for those that do not have assigned values note that they are 0 indexed. For example, OSN_CMN_ACCESSTYPE_READWRITE should be specified as 0 and OSN_CMN_ACCESSTYPE_READONLY specified as a 1 to the storageVolumeModify API as the accessMode for changing the configuration of a storage volume.

Enumeration Definitions

typedef enum osn__flags
{
    OSN_CMN_FLAG_NONE             = 0x0000,
    OSN_CMN_FLAG_ASYNC            = 0x0001,
    OSN_CMN_FLAG_FORCE            = 0x0002,
    OSN_CMN_FLAG_ASYNC_FORCE      = 0x0003,
    OSN_CMN_FLAG_RESCAN           = 0x0004,
    OSN_CMN_FLAG_ASYNC_RESCAN     = 0x0005, 
    OSN_CMN_FLAG_FORCE_RESCAN     = 0x0006, 
    OSN_CMN_FLAG_FORCE_ASYNC_RESCAN = 0x0007, 
    OSN_CMN_FLAG_GENERATE_NAME    = 0x0008, 
    OSN_CMN_FLAG_SYNC_PRIMARY     = 0x0010,
    OSN_CMN_FLAG_SYNC_SECONDARY   = 0x0020,
    OSN_CMN_FLAG_REDIRECT         = 0x0040,
    OSN_CMN_FLAG_SUPPRESS_ALARMS  = 0x0080,
    OSN_CMN_FLAG_STOP_VERIFY      = 0x0100,
    OSN_CMN_FLAG_USE_GUID_IQN     = 0x0200, 
    OSN_CMN_FLAG_EXPORT           = 0x0400,
    OSN_CMN_FLAG_RESCUE_MODE      = 0x0800,
    OSN_CMN_FLAG_START_REPAIR     = 0x1000,
    OSN_CMN_FLAG_SPARES_ONLY      = 0x2000,
    OSN_CMN_FLAG_LAZY             = 0x4000,
    OSN_CMN_FLAG_MAX              = 0x8000
} osn__flags_t;

//--spares-only   args.hasArg("spares-only") ? flags | OSN_CMN_FLAG_SPARES_ONLY : flags

typedef enum osn__modifyType
{
    OSN_CMN_MOD_OP_ADD = 0,
    OSN_CMN_MOD_OP_REMOVE = 1,
    OSN_CMN_MOD_OP_SET = 2
} osn__modifyType_t;

typedef enum osn__nfsServiceMode
{
    OSN_CMN_NFS_MODE_V3 = 0,
    OSN_CMN_NFS_MODE_V4 = 1,
    OSN_CMN_NFS_MODE_GLUSTER = 2
} osn__nfsServiceMode_t;

typedef enum osn__accessType
{
    OSN_CMN_ACCESSTYPE_READWRITE,
    OSN_CMN_ACCESSTYPE_READONLY,
    OSN_CMN_ACCESSTYPE_NONE
} osn__accessType_t;

typedef enum osn__cifsUserAccessMode
{
    OSN_CMN_CIFS_USER_ACCESS_NONE,
    OSN_CMN_CIFS_USER_ACCESS_VALID,
    OSN_CMN_CIFS_USER_ACCESS_ADMIN,
    OSN_CMN_CIFS_USER_ACCESS_INVALID
} osn__cifsUserAccessMode_t;

typedef enum osn__cacheType
{
    OSN_CMN_ACCESSTYPE_WRITETHRU,
    OSN_CMN_ACCESSTYPE_WRITEBACK
} osn__cacheType_t;

typedef enum osn__syncPolicy
{
    OSN_CMN_SYNCTYPE_STANDARD,
    OSN_CMN_SYNCTYPE_ALWAYS,
    OSN_CMN_SYNCTYPE_DISABLED,
    OSN_CMN_SYNCTYPE_AUTO
} osn__syncPolicy_t;

typedef enum osn__chapPolicy
{
    OSN_CHAP_DISABLED=0,
    OSN_CHAP_USE_TARGET_CHAP=1,
    OSN_CHAP_USE_USER_CHAP_DEFAULTS=2,
    OSN_CHAP_USE_TARGET_AND_USER_CHAP=3,
    OSN_CHAP_USE_STORAGE_CLOUD_CHAP_DEFAULTS=4
} osn__chapPolicy_t;

typedef enum osn__alertTriggerDataType
{
    OSN_CMN_ALERT_DATATYPE_UNKNOWN,
    OSN_CMN_ALERT_DATATYPE_DURATION_IN_SEC,
    OSN_CMN_ALERT_DATATYPE_PERCENTAGE,
    OSN_CMN_ALERT_DATATYPE_BOOL_ON_OFF,
    OSN_CMN_ALERT_DATATYPE_COUNT,
    OSN_CMN_ALERT_DATATYPE_MAX
} osn__alertTriggerDataType_t;

typedef enum osn__quotaPolicy
{
    OSN_CMN_QUOTA_POLICY_SOFT,
    OSN_CMN_QUOTA_POLICY_HARD
} osn__quotaPolicy_t;

typedef enum osn__initiatorType
{
    OSN_CMN_INITIATOR_ISCSI=0,
    OSN_CMN_INITIATOR_FCP=1,
    OSN_CMN_INITIATOR_IB=2
} osn__initiatorType_t;

typedef enum osn__linkState
{
    OSN_CMN_LINKSTATE_UP,
    OSN_CMN_LINKSTATE_DOWN,
    OSN_CMN_LINKSTATE_UNKNOWN
} osn__linkState_t;

typedef enum osn__objectState
{
    OSN_CMN_OBJSTATE_NORMAL,
    OSN_CMN_OBJSTATE_WARNING,
    OSN_CMN_OBJSTATE_BUSY,
    OSN_CMN_OBJSTATE_ERROR,
    OSN_CMN_OBJSTATE_INITIALIZING,
    OSN_CMN_OBJSTATE_MISSING,
    OSN_CMN_OBJSTATE_OFFLINE,
    OSN_CMN_OBJSTATE_DISCONNECTED
} osn__objectState_t;

typedef enum osn__dataType
{
    OSN_CMN_DATATYPE_STRING,
    OSN_CMN_DATATYPE_INT,
    OSN_CMN_DATATYPE_TIME,
    OSN_CMN_DATATYPE_FLOAT
} osn__dataType_t;

typedef enum osn__eventType
{
    OSN_CMN_EVENTTYPE_ADD,
    OSN_CMN_EVENTTYPE_REMOVE,
    OSN_CMN_EVENTTYPE_MODIFY
} osn__eventType_t;

typedef enum osn__eventListenerType
{
    OSN_CMN_LISTENERTYPE_OBSERVER=0,
    OSN_CMN_LISTENERTYPE_SECONDARY=1,
    OSN_CMN_LISTENERTYPE_PRIMARY=2
} osn__eventListenerType_t;

typedef enum osn__eventListenerMode
{
    OSN_CMN_LISTENERMODE_ENQUEUE=0,
    OSN_CMN_LISTENERMODE_PROCESS=1,
    OSN_CMN_LISTENERMODE_FLUSH=2
} osn__eventListenerMode_t;

typedef enum osn__replicaAssocType
{
    OSN_CMN_REPLICA_CHILD,
    OSN_CMN_REPLICA_HEAD
} osn__replicaAssocType_t;

typedef enum osn__replicationActionType
{
    OSN_CMN_REPLICATION_SETUP,
    OSN_CMN_REPLICATION_CONNECT,
    OSN_CMN_REPLICATION_DISCONNECT,
    OSN_CMN_REPLICATION_RECONNECT,
    OSN_CMN_REPLICATION_ADJUST
} osn__replicationActionType_t;

typedef enum osn__replicationCongestionPolicy
{
    OSN_CMN_REPLICATION_CONGESTION_POLICY_SYNC,
    OSN_CMN_REPLICATION_CONGESTION_POLICY_PULL_AHEAD
} osn__replicationCongestionPolicy_t;

typedef enum osn__initPriorityType
{
    OSN_INITPRIORITY_DEFAULT,
    OSN_INITPRIORITY_LOW,
    OSN_INITPRIORITY_MEDIUM,
    OSN_INITPRIORITY_HIGH
} osn__initPriorityType_t;

typedef enum osn__objectType
{
    OSN_CMN_OBJECTTYPE_UNKNOWN,
    OSN_CMN_OBJECTTYPE_SNAPSHOT_SCHEDULE,
    OSN_CMN_OBJECTTYPE_SNAPSHOT_SCHEDULE_ASSOC,
    OSN_CMN_OBJECTTYPE_STORAGE_VOLUME,
    OSN_CMN_OBJECTTYPE_STORAGE_VOLUME_UTILIZATION,
    OSN_CMN_OBJECTTYPE_STORAGE_VOLUME_GROUP,
    OSN_CMN_OBJECTTYPE_STORAGE_VOLUME_GROUP_ASSOC,
    OSN_CMN_OBJECTTYPE_STORAGE_POOL,
    OSN_CMN_OBJECTTYPE_STORAGE_POOL_DEVICE,
    OSN_CMN_OBJECTTYPE_STORAGE_SYSTEM,
    OSN_CMN_OBJECTTYPE_STORAGE_VOLUME_ACL,
    OSN_CMN_OBJECTTYPE_HOST,
    OSN_CMN_OBJECTTYPE_HOST_GROUP,
    OSN_CMN_OBJECTTYPE_INITIATOR_PORT,
    OSN_CMN_OBJECTTYPE_TARGET_PORT,
    OSN_CMN_OBJECTTYPE_PHYSICAL_DISK,
    OSN_CMN_OBJECTTYPE_TASK,
    OSN_CMN_OBJECTTYPE_AUDIT_ENTRY,
    OSN_CMN_OBJECTTYPE_AUDIT_SETTINGS,
    OSN_CMN_OBJECTTYPE_ALERT,
    OSN_CMN_OBJECTTYPE_ALERT_CONFIG_SETTINGS,
    OSN_CMN_OBJECTTYPE_LICENSE,
    OSN_CMN_OBJECTTYPE_LICENSE_ACTIVATION,
    OSN_CMN_OBJECTTYPE_USER,
    OSN_CMN_OBJECTTYPE_USER_PERMISSION_ASSIGNMENT,
    OSN_CMN_OBJECTTYPE_USER_GROUP,
    OSN_CMN_OBJECTTYPE_USER_GROUP_ASSOC,
    OSN_CMN_OBJECTTYPE_ROLE,
    OSN_CMN_OBJECTTYPE_ROLE_PERMISSION_ASSIGNMENT,
    OSN_CMN_OBJECTTYPE_ROLE_SUBJECT_ASSOC,
    OSN_CMN_OBJECTTYPE_PERMISSION_DEFINITION,
    OSN_CMN_OBJECTTYPE_STORAGE_CLOUD,
    OSN_CMN_OBJECTTYPE_STORAGE_CLOUD_ASSOC,
    OSN_CMN_OBJECTTYPE_STORAGE_CLOUD_SUBJECT_ASSOC,
    OSN_CMN_OBJECTTYPE_SESSION,
    OSN_CMN_OBJECTTYPE_STORAGE_TIER,
    OSN_CMN_OBJECTTYPE_STORAGE_TIER_ASSOC,
    OSN_CMN_OBJECTTYPE_STORAGE_QUOTA,
    OSN_CMN_OBJECTTYPE_STORAGE_QUOTA_ASSOC,
    OSN_CMN_OBJECTTYPE_ACL,
    OSN_CMN_OBJECTTYPE_OBJECT_PROPERTY,
    OSN_CMN_OBJECTTYPE_STORAGE_SYSTEM_LINK,
    OSN_CMN_OBJECTTYPE_STORAGE_SYSTEM_GROUP,
    OSN_CMN_OBJECTTYPE_STORAGE_SYSTEM_GROUP_ASSOC,
    OSN_CMN_OBJECTTYPE_REPLICA_ASSOC,
    OSN_CMN_OBJECTTYPE_PHYSICAL_DISK_PATH_ASSOC,
    OSN_CMN_OBJECTTYPE_HW_ALARM,
    OSN_CMN_OBJECTTYPE_HW_BBU,
    OSN_CMN_OBJECTTYPE_HW_DISK,
    OSN_CMN_OBJECTTYPE_HW_UNIT,
    OSN_CMN_OBJECTTYPE_HW_ENCLOSURE,
    OSN_CMN_OBJECTTYPE_HW_CONTROLLER,
    OSN_CMN_OBJECTTYPE_HW_CONTROLLER_GROUP,
    OSN_CMN_OBJECTTYPE_NETWORK_SHARE,
    OSN_CMN_OBJECTTYPE_NETWORK_SHARE_CLIENT,
    OSN_CMN_OBJECTTYPE_REPLICATION_SCHEDULE,
    OSN_CMN_OBJECTTYPE_REPLICATION_SCHEDULE_ASSOC,
    OSN_CMN_OBJECTTYPE_HW_LOGICAL_DRIVE,
    OSN_CMN_OBJECTTYPE_STORAGE_SYSTEM_RECOVERY_POINT,
    OSN_CMN_OBJECTTYPE_CLOUD_CONTAINER,
    OSN_CMN_OBJECTTYPE_CLOUD_PROVIDER,
    OSN_CMN_OBJECTTYPE_CLOUD_PROVIDER_CREDENTIALS,
    OSN_CMN_OBJECTTYPE_CLOUD_BACKUP_SCHEDULE,
    OSN_CMN_OBJECTTYPE_CLOUD_BACKUP_SCHEDULE_ASSOC,
    OSN_CMN_OBJECTTYPE_CLOUD_PROVIDER_LOCATION,
    OSN_CMN_OBJECTTYPE_STORAGE_SYSTEM_CLUSTER,
    OSN_CMN_OBJECTTYPE_STORAGE_SYSTEM_CLUSTER_ASSOC,
    OSN_CMN_OBJECTTYPE_CLUSTER_FAILOVER_GROUP,
    OSN_CMN_OBJECTTYPE_FC_TARGET_PORT,
    OSN_CMN_OBJECTTYPE_NETWORK_SHARE_SERVICE_CONFIG,
    OSN_CMN_OBJECTTYPE_WIDGET,
    OSN_CMN_OBJECTTYPE_STORAGE_SYSTEM_LINK_KEY,
    OSN_CMN_OBJECTTYPE_STORAGE_POOL_PROFILE,
    OSN_CMN_OBJECTTYPE_STORAGE_QUOTA_SHARE_ASSOC,
    OSN_CMN_OBJECTTYPE_SITE,
    OSN_CMN_OBJECTTYPE_SITE_ASSOC,
    OSN_CMN_OBJECTTYPE_VIRTUAL_INTERFACE_ASSOC,
    OSN_CMN_OBJECTTYPE_IB_TARGET_PORT,
    OSN_CMN_OBJECTTYPE_HW_SWITCH_CREDENTIALS,
    OSN_CMN_OBJECTTYPE_HW_SWITCH,
    OSN_CMN_OBJECTTYPE_HW_SWITCH_ZONESET,
    OSN_CMN_OBJECTTYPE_HW_SWITCH_ADAPTER,
    OSN_CMN_OBJECTTYPE_HW_SWITCH_FAILOVER_GROUP,
    OSN_CMN_OBJECTTYPE_HW_SWITCH_FAILOVER_GROUP_POOL_ASSOC,
    OSN_CMN_OBJECTTYPE_HW_SWITCH_FAILOVER_GROUP_SYSTEM_ASSOC,
    OSN_CMN_OBJECTTYPE_HW_SWITCH_CREDENTIALS_SYSTEM_ASSOC,
    OSN_CMN_OBJECTTYPE_LIBRATO_METRICS_CONFIG,
    OSN_CMN_OBJECTTYPE_STORAGE_POOL_REPLICATION_CONFIG,
    OSN_CMN_OBJECTTYPE_GLUSTER_VOLUME,
    OSN_CMN_OBJECTTYPE_GLUSTER_BRICK,
    OSN_CMN_OBJECTTYPE_GLUSTER_PEER,
    OSN_CMN_OBJECTTYPE_NETWORK_SHARE_USER_ACCESS,
    OSN_CMN_OBJECTTYPE_NETWORK_SHARE_CIFS_OPTION,
    OSN_CMN_OBJECTTYPE_ALERT_TRIGGER,
    OSN_CMN_OBJECTTYPE_HW_ENCLOSURE_LAYOUT,
    OSN_CMN_OBJECTTYPE_HW_UNIT_DISK_ASSOC,
    OSN_CMN_OBJECTTYPE_STORAGE_POOL_HA_FAILOVER_GROUP,
    OSN_CMN_OBJECTTYPE_STORAGE_POOL_HA_FAILOVER_INTERFACE,
    OSN_CMN_OBJECTTYPE_STORAGE_POOL_HA_FAILOVER_MODULE,
    OSN_CMN_OBJECTTYPE_BACKUP_POLICY,
    OSN_CMN_OBJECTTYPE_BACKUP_JOB,
    OSN_CMN_OBJECTTYPE_GLUSTER_HA_FAILOVER_INTERFACE,
    OSN_CMN_OBJECTTYPE_CEPH_POOL,
    OSN_CMN_OBJECTTYPE_CEPH_OSD,
    OSN_CMN_OBJECTTYPE_CEPH_POOL_OSD_ASSOC,
    OSN_CMN_OBJECTTYPE_CEPH_CLUSTER,
    OSN_CMN_OBJECTTYPE_CEPH_MONITOR,
    OSN_CMN_OBJECTTYPE_CEPH_HA_FAILOVER_INTERFACE,
    OSN_CMN_OBJECTTYPE_CEPH_BLOCK_DEVICE,
    OSN_CMN_OBJECTTYPE_PHYSICAL_DISK_HOTSPARE_MARKER,
    OSN_CMN_OBJECTTYPE_MAX
} osn__objectType_t;

typedef enum osn__backupJobStage {
    OSN_CMN_BACKUP_STAGE_INITIALIZING = 0x0000,
    OSN_CMN_BACKUP_STAGE_SCANNING = 0x0001,
    OSN_CMN_BACKUP_STAGE_COPYING = 0x0002,
    OSN_CMN_BACKUP_STAGE_PURGING = 0x0003,
    OSN_CMN_BACKUP_STAGE_COMPLETED = 0x0004,
    OSN_CMN_BACKUP_STAGE_FAILED = 0x0005,
} osn__backupJobStage_t;

typedef enum osn__backupPurgePolicy {
    OSN_CMN_BACKUP_PURGE_POLICY_NEVER = 0x0000,
    OSN_CMN_BACKUP_PURGE_POLICY_AFTER_BACKUP = 0x0001,
    OSN_CMN_BACKUP_PURGE_POLICY_DAILY = 0x0002,
    OSN_CMN_BACKUP_PURGE_POLICY_WEEKLY = 0x0003,
} osn__backupPurgePolicy_t;

typedef enum osn__backupPolicyType {
    OSN_CMN_BACKUP_POLICY_TYPE_INBOUND = 0x0000,
    OSN_CMN_BACKUP_POLICY_TYPE_OUTBOUND = 0x0001,
} osn__backupPolicyType_t;

typedef enum osn__backupPolicyMountType {
    OSN_CMN_BACKUP_POLICY_MOUNT_NFS = 0x0000,
    OSN_CMN_BACKUP_POLICY_MOUNT_GLUSTER = 0x0001,
    OSN_CMN_BACKUP_POLICY_MOUNT_OCFS2 = 0x0002,
    OSN_CMN_BACKUP_POLICY_MOUNT_CIFS = 0x0003,
} osn__backupPolicyMountType_t;

typedef enum osn__backupPolicyRetentionCriteria {
    OSN_CMN_BACKUP_POLICY_RETENTION_ACCESS_TIME = 0x0001,
    OSN_CMN_BACKUP_POLICY_RETENTION_MODIFY_TIME = 0x0002,
    OSN_CMN_BACKUP_POLICY_RETENTION_CREATE_TIME = 0x0004,
} osn__backupPolicyRetentionCriteria_t;

typedef enum osn__alertSubscription
{
    OSN_CMN_ALERT_SUBSCRIPTION_NONE       = 0,
    OSN_CMN_ALERT_SUBSCRIPTION_CRITICAL   = 1,
    OSN_CMN_ALERT_SUBSCRIPTION_ERROR      = 2,
    OSN_CMN_ALERT_SUBSCRIPTION_WARNING    = 4,
    OSN_CMN_ALERT_SUBSCRIPTION_INFO       = 8
} osn__alertSubscription_t;

typedef enum osn__errorLevel
{
    OSN_CMN_SEVERITY_ALWAYS   = 0,
    OSN_CMN_SEVERITY_CRITICAL = 1,
    OSN_CMN_SEVERITY_ERROR    = 2,
    OSN_CMN_SEVERITY_WARNING  = 3,
    OSN_CMN_SEVERITY_INFO     = 4,
    OSN_CMN_SEVERITY_DEBUG    = 5,
    OSN_CMN_SEVERITY_VERBOSE  = 6,
    OSN_CMN_SEVERITY_DEBUG2   = 7
} osn__errorLevel_t;

typedef enum osn__taskState
{
    OSN_TASKSTATE_INITIALIZING,
    OSN_TASKSTATE_QUEUED,
    OSN_TASKSTATE_RUNNING,
    OSN_TASKSTATE_FAILED,
    OSN_TASKSTATE_CANCELLED,
    OSN_TASKSTATE_COMPLETED
} osn__taskState_t;

typedef enum osn__hostType
{
    OSN_HOSTTYPE_UNKNOWN,
    OSN_HOSTTYPE_AIX,
    OSN_HOSTTYPE_HPUX,
    OSN_HOSTTYPE_LINUX,
    OSN_HOSTTYPE_SOLARIS,
    OSN_HOSTTYPE_VMWARE,
    OSN_HOSTTYPE_WINDOWS,
    OSN_HOSTTYPE_XENSERVER,
    OSN_HOSTTYPE_OTHER,
    OSN_HOSTTYPE_MAC,
    OSN_HOSTTYPE_MAX
} osn__hostType_t;

typedef enum osn__retentionTag
{
    OSN_RETENTIONTAG_NONE=0,
    OSN_RETENTIONTAG_DAY=1,
    OSN_RETENTIONTAG_WEEK=2,
    OSN_RETENTIONTAG_MONTH=4,
    OSN_RETENTIONTAG_YEARLY=8,
    OSN_RETENTIONTAG_MAX=9
} osn__retentionTag_t;

typedef enum osn__networkShareType
{
    OSN_NETWORKSHARETYPE_STANDARD,
    OSN_NETWORKSHARETYPE_SUBVOL_BTRFS,
    OSN_NETWORKSHARETYPE_S3QL,
    OSN_NETWORKSHARETYPE_SUBVOL_ZFS,
    OSN_NETWORKSHARETYPE_GLUSTER_VOLUME
} osn__networkShareType_t;

typedef enum osn__storageVolumeType
{
    OSN_STORAGEVOLUMETYPE_FILE,
    OSN_STORAGEVOLUMETYPE_FILE_BTRFS,
    OSN_STORAGEVOLUMETYPE_FILE_EXT3,
    OSN_STORAGEVOLUMETYPE_FILE_EXT4,
    OSN_STORAGEVOLUMETYPE_RAW_DEVICE,
    OSN_STORAGEVOLUMETYPE_FILE_ZFS,
    OSN_STORAGEVOLUMETYPE_FILE_XFS,
    OSN_STORAGEVOLUMETYPE_FILE_S3QL,
    OSN_STORAGEVOLUMETYPE_FILE_JFS,
    OSN_STORAGEVOLUMETYPE_CEPH_RBD
} osn__storageVolumeType_t;

typedef enum osn__hwEnclosureLayoutFlow
{
    OSN_ENCLOSURELAYOUT_FLOW_T2B_L2R,
    OSN_ENCLOSURELAYOUT_FLOW_T2B_R2L,
    OSN_ENCLOSURELAYOUT_FLOW_B2T_L2R,
    OSN_ENCLOSURELAYOUT_FLOW_B2T_R2L,
    OSN_ENCLOSURELAYOUT_FLOW_R2L_T2B,
    OSN_ENCLOSURELAYOUT_FLOW_R2L_B2T,
    OSN_ENCLOSURELAYOUT_FLOW_L2R_T2B,
    OSN_ENCLOSURELAYOUT_FLOW_L2R_B2T
} osn__hwEnclosureLayoutFlow_t;

typedef enum osn__replicationState
{
    OSN_CMN_REPLICATION_STATE_PREPARING,
    OSN_CMN_REPLICATION_STATE_INITIALIZING,
    OSN_CMN_REPLICATION_STATE_SYNCHRONIZING,
    OSN_CMN_REPLICATION_STATE_SYNCHRONIZED,
    OSN_CMN_REPLICATION_STATE_RESYNCHRONIZING,
    OSN_CMN_REPLICATION_STATE_PAUSED,
    OSN_CMN_REPLICATION_STATE_INIT_FAILED,
    OSN_CMN_REPLICATION_STATE_SYNC_FAILED,
    OSN_CMN_REPLICATION_STATE_RESYNC_FAILED
} osn__replicationState_t;

typedef enum osn__remoteReplicaFlags
{
    OSN_CMN_REPLICA_FLAG_NONE,
    OSN_CMN_REPLICA_FLAG_SOURCE,
    OSN_CMN_REPLICA_FLAG_TARGET,
    OSN_CMN_REPLICA_FLAG_SOURCE_AND_TARGET
} osn__remoteReplicaFlags_t;

typedef enum osn__raidType
{
    OSN_RAIDTYPE_RAID0=0,
    OSN_RAIDTYPE_RAID1=1,
    OSN_RAIDTYPE_RAID2=2,
    OSN_RAIDTYPE_RAID3=3,
    OSN_RAIDTYPE_RAID4=4,
    OSN_RAIDTYPE_RAID5=5,
    OSN_RAIDTYPE_RAID6=6,
    OSN_RAIDTYPE_RAID7=7,
    OSN_RAIDTYPE_RAID8=8,
    OSN_RAIDTYPE_RAID9=9,
    OSN_RAIDTYPE_RAID10=10,
    OSN_RAIDTYPE_RAID_AUTO=11,
    OSN_RAIDTYPE_SINGLE=12,
    OSN_RAIDTYPE_JBOD=13,
    OSN_RAIDTYPE_RAID50=14,
    OSN_RAIDTYPE_RAID60=15,
    OSN_RAIDTYPE_RAID70=16,
    OSN_RAIDTYPE_MAX=17
} osn__raidType_t;

typedef enum osn__storagePoolType
{
    OSN_STORAGEPOOLTYPE_BTRFS,
    OSN_STORAGEPOOLTYPE_EXT3,
    OSN_STORAGEPOOLTYPE_EXT4,
    OSN_STORAGEPOOLTYPE_XFS,
    OSN_STORAGEPOOLTYPE_S3QL,
    OSN_STORAGEPOOLTYPE_JFS,
    OSN_STORAGEPOOLTYPE_ZFS,
    OSN_STORAGEPOOLTYPE_CEPH
} osn__storagePoolType_t;

typedef enum osn__hotsparePoolRepairPolicy {
    OSN_HOTSPARE_POOL_REPAIR_POLICY_USE_ASSIGNED_AND_GLOBAL = 0,
    OSN_HOTSPARE_POOL_REPAIR_POLICY_USE_ASSIGNED_ONLY = 1,
    OSN_HOTSPARE_POOL_REPAIR_POLICY_USE_EXACTMATCH = 2,
    OSN_HOTSPARE_POOL_REPAIR_POLICY_USE_ASSIGNED_ONLY_EXACTMATCH = 3,
    OSN_HOTSPARE_POOL_REPAIR_POLICY_MANUAL_REPAIR = 4,
    OSN_HOTSPARE_POOL_REPAIR_POLICY_MAX = 5
} osn__hotsparePoolRepairPolicy_t;

typedef enum osn__hotsparePoolRepairState {
    OSN_HOTSPARE_POOL_REPAIR_STATE_HEALTHY = 0,
    OSN_HOTSPARE_POOL_REPAIR_STATE_REPAIR_NEEDED = 1,
    OSN_HOTSPARE_POOL_REPAIR_STATE_REPAIR_NEEDED_OPERATOR_APPROVAL_REQUIRED = 2,
    OSN_HOTSPARE_POOL_REPAIR_STATE_AUTO_REPAIR_IN_PROGRESS = 3,
    OSN_HOTSPARE_POOL_REPAIR_STATE_MAX = 4
} osn__hotsparePoolRepairState_t;

typedef enum osn__arpFilterStatus
{
    OSN_ARP_FILTERING_ENABLED,
    OSN_ARP_FILTERING_DISABLED
} osn__arpFilterStatus_t;

typedef enum osn__arpFilterMode
{
    OSN_ARP_FILTER_MODE_AUTO,
    OSN_ARP_FILTER_MODE_ENABLED,
    OSN_ARP_FILTER_MODE_DISABLED
} osn__arpFilterMode_t;

typedef enum osn__bondMode
{
    OSN_BOND_MODE_ROUND_ROBIN=0,
    OSN_BOND_MODE_ACTIVE_BACKUP=1,
    OSN_BOND_MODE_BALANCE_XOR=2,
    OSN_BOND_MODE_BROADCAST=3,
    OSN_BOND_MODE_LACP=4,
    OSN_BOND_MODE_BALANCE_TLB=5,
    OSN_BOND_MODE_BALANCE_TRLB=6
} osn__bondMode_t;

typedef enum osn__permissionScope
{
    OSN_SCOPE_NONE=0,
    OSN_SCOPE_USER=1,
    OSN_SCOPE_STORAGE_CLOUD=2,
    OSN_SCOPE_SYSTEM=3,
    OSN_SCOPE_GRID=4
} osn__permissionScope_t;

typedef enum osn__resourceAccessRequestType
{
    OSN_CMN_REQUEST_VIEW,
    OSN_CMN_REQUEST_UTILIZE,
    OSN_CMN_REQUEST_MODIFY
} osn__resourceRequestType_t;

//todo: needs to be refactored
typedef enum osn__resourceAccessMode
{
    OSN_CMN_RESOURCEACCESS_AUTO                         =0x0000,
    OSN_CMN_RESOURCEACCESS_MULTIGROUP_SHARED            =0x0001,
    OSN_CMN_RESOURCEACCESS_GROUP_EXCLUSIVE              =0x0002,
    OSN_CMN_RESOURCEACCESS_IMMUTABLE                    =0x0004,
    OSN_CMN_RESOURCEACCESS_MULTIGROUP_SHARED_IMMUTABLE  =0x0005,
    OSN_CMN_RESOURCEACCESS_GROUP_EXCLUSIVE_IMMUTABLE    =0x0006,
} osn__resourceAccessMode_t;

typedef enum osn__diskType 
{
    OSN_DISKTYPE_UNKNOWN=0,
    OSN_DISKTYPE_IDE=1,
    OSN_DISKTYPE_SATA=2,
    OSN_DISKTYPE_SCSI=3,
    OSN_DISKTYPE_SSD=4,
    OSN_DISKTYPE_SSHD=5,
    OSN_DISKTYPE_AOE=6,
    OSN_DISKTYPE_MULTI=7,
} osn__diskType_t;

typedef enum osn__licenseEdition
{
    OSN_LICENSE_EDITION_FREE,
    OSN_LICENSE_EDITION_TRIAL,
    OSN_LICENSE_EDITION_STANDARD,
    OSN_LICENSE_EDITION_ENTERPRISE,
    OSN_LICENSE_EDITION_PLATINUM,
    OSN_LICENSE_EDITION_CLOUD
} osn__licenseEdition_t;

typedef enum osn__licenseDuration
{
    OSN_LICENSE_DURATION_PERPETUAL,
    OSN_LICENSE_DURATION_TIMELIMITED
} osn__licenseDuration_t;

typedef enum osn__licenseCategory
{
    OSN_LICENSE_CATEGORY_SYSTEM,
    OSN_LICENSE_CATEGORY_FEATURE,
    OSN_LICENSE_CATEGORY_FEATURE_TERABYTES,
    OSN_LICENSE_CATEGORY_FEATURE_VOLUMES,
    OSN_LICENSE_CATEGORY_FEATURE_SNAPSHOTS,
    OSN_LICENSE_CATEGORY_FEATURE_CLOUDS,
    OSN_LICENSE_CATEGORY_FEATURE_NODES,
    OSN_LICENSE_CATEGORY_FEATURE_USERS,
    OSN_LICENSE_CATEGORY_FEATURE_SSD,
    OSN_LICENSE_CATEGORY_FEATURE_REPLICATION
} osn__licenseCategory_t;

typedef enum osn__licenseType
{
    OSN_LICENSE_TYPE_NODE,
    OSN_LICENSE_TYPE_VOLUME,
    OSN_LICENSE_TYPE_SITE
} osn__licenseType_t;

typedef enum osn__lockType
{
    OSN_LOCK_SHARED,
    OSN_LOCK_PROTECTED,
    OSN_LOCK_EXCLUSIVE
} osn__lockType_t;

typedef enum osn__cloudProviderType
{
    OSN_CLOUD_PROVIDER_AMAZON_S3,
    OSN_CLOUD_PROVIDER_SFTP,
    OSN_CLOUD_PROVIDER_GOOGLE,
    OSN_CLOUD_PROVIDER_MICROSOFT_AZURE,
    OSN_CLOUD_PROVIDER_OPENSTACK_SWIFT
} osn__cloudProviderType_t;

typedef enum osn__hwControllerCapabilities
{
    HW_CONTROLLER_API_NONE=0,
    HW_CONTROLLER_API_RESCAN=1,
    HW_CONTROLLER_API_CREATE_UNIT=2,
    HW_CONTROLLER_API_NA3=3,
    HW_CONTROLLER_API_GROW_UNIT=4,
    HW_CONTROLLER_API_NA5=5,
    HW_CONTROLLER_API_NA6=6,
    HW_CONTROLLER_API_NA7=7,
    HW_CONTROLLER_API_GROW_UNIT_ADV_STRIPE=8,
    HW_CONTROLLER_API_NA9=9,
    HW_CONTROLLER_API_NA10=10,
    HW_CONTROLLER_API_NA11=11,
    HW_CONTROLLER_API_NA12=12,
    HW_CONTROLLER_API_NA13=13,
    HW_CONTROLLER_API_NA14=14,
    HW_CONTROLLER_API_NA15=15,
    HW_CONTROLLER_API_GROW_UNIT_ADV_PRIORITY=16,
    HW_CONTROLLER_API_NA17=17,
    HW_CONTROLLER_API_NA18=18,
    HW_CONTROLLER_API_NA19=19,
    HW_CONTROLLER_API_NA20=20,
    HW_CONTROLLER_API_NA21=21,
    HW_CONTROLLER_API_NA22=22,
    HW_CONTROLLER_API_NA23=23,
    HW_CONTROLLER_API_NA24=24,
    HW_CONTROLLER_API_NA25=25,
    HW_CONTROLLER_API_NA26=26,
    HW_CONTROLLER_API_NA27=27,
    HW_CONTROLLER_API_NA28=28,
    HW_CONTROLLER_API_NA29=29,
    HW_CONTROLLER_API_NA30=30,
    HW_CONTROLLER_API_NA31=31,
    HW_CONTROLLER_API_CREATE_SSD_CACHE=32,
    HW_CONTROLLER_API_SUPPORTS_SSD_CACHE_RAID=64,
    HW_CONTROLLER_API_SUPPORTS_UNIT_DISK_CORRELATION=128,
    HW_CONTROLLER_API_SUPPORTS_ENCRYPTION=256
} osn__hwControllerCapabilities_t;

typedef enum osn__hwDiskCapabilities
{
    HW_DISK_API_NONE=0,
    HW_DISK_API_MARK_HOT_SPARE=1,
    HW_DISK_API_IDENTIFY=2,
    HW_DISK_API_NA3=3,
    HW_DISK_API_REMOVE_DISK=4,
    HW_DISK_API_NA5=5,
    HW_DISK_API_NA6=6,
    HW_DISK_API_NA7=7,
    HW_DISK_API_SUPPORTS_ENCRYPTION=8
} osn__hwDiskCapabilities_t;

typedef enum osn__hwUnitCapabilities
{
    HW_UNIT_API_NONE=0,
    HW_UNIT_API_IDENTIFY=1,
    HW_UNIT_API_DELETE=2,
    HW_UNIT_API_NA3=3,
    HW_UNIT_API_NA4=4,
    HW_UNIT_API_NA5=5,
    HW_UNIT_API_NA6=6,
    HW_UNIT_API_NA7=7,
    HW_UNIT_API_SUPPORTS_ENCRYPTION=8
} osn__hwUnitCapabilities_t;