NAV
shell ruby

NODEUM version 1.6

This document describes NODEUM version 1.6

Other versions

Introduction

This document outlines the methods available for administrating NODEUM. This is a REST API that supports form-encoded JSON requests and return JSON responses.

Authentication

Example of request:

require 'rest-client'

url = "http://example.com/api/stats"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [:username],
                                        password: [:password])
# With shell, you can use curl like this
curl -X GET http://[username]:[password]@10.3.1.165/api/stats
#or
curl -X GET http://[username]:[password]@nodeum.mt-c.com/api/stats

Requests need a user-password authentication. These information can be managed at section 5. An external authentification server can be used.

The base URL for the requests is the based on the URL or the IP address of the appliance and all will be prefixed with /api.

Search

Catalog advanced research.

You can specify files parameters to set filters on a search request.

Advanced research

This command allow you to find files from advanced research parameters

Example of search request:

require 'rest-client'

url = "http://example.com//api/search/?have=&not_have=&path_have=&path_not_have=&size=&size_mode=0&size_unit=0&creation_date_start=&creation_date_end=&modification_date_start=&modification_date_end=&cache=false&tape=false&cloud=false&share=false&in_share_select=all&in_tape_select=all&in_pool_select=all&in_bucket_select=all"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/search/?have=&not_have=&path_have=&path_not_have=&size=&size_mode=0&size_unit=0&creation_date_start=&creation_date_end=&modification_date_start=&modification_date_end=&cache=false&tape=false&cloud=false&share=false&in_share_select=all&in_tape_select=all&in_pool_select=all&in_bucket_select=all

> The above command returns JSON structured like this:

```json
{  
   "result":[  
      {  
         "id":101,
         "name":"A000000.docx",
         "cdate":"2016-08-25T12:02:27Z",
         "mdate":"2016-08-25T12:02:27Z",
         "in_cache":1,
         "modified":1,
         "offline":0,
         "path":"/Documentations/2016/A000000.docx",
         "size":51812,
         "type":"file",
         "in_tape": 0,
         "in_cloud": 0,
         "barcode": null,
         "bucket": null,
         "metadata": {}
      },
      {  
         "id":102,
         "name":"A000001.docx",
         "cdate":"2016-08-25T12:02:27Z",
         "mdate":"2016-08-25T12:02:27Z",
         "in_cache":1,
         "modified":1,
         "offline":0,
         "path":"/Documentations/2016/A000001.docx",
         "size":1229394,
         "type":"file",
         "in_tape":0,
         "in_tape": 0,
         "in_cloud": 0,
         "barcode": null,
         "bucket": null,
         "metadata": {
            "meta1":["value1"]
         }
      }
   ],
   "recordsTotal":21998,
   "recordsFiltered":21998,
   "status":"OK",
   "code":200
}

HTTP Request

GET http://example.com/api/search?have={have}&not_have={not_have}&size={size}&size_mode={size_mode}&size_unit={size_unit}&creation_date_start={creation_date_start}&creation_date_end={creation_date_end}&modification_date_start={modification_date_start}&modification_date_end={modification_date_end}&share={share}&in_cache={in_cache}&in_tape={in_tape}

Key name Type Description
have String Key strings included in the files name.
Multiple key string can be specified separated by a comma.
not_have String Key strings that must not be included in the files name.
Multiple key string can be specified separated by a comma.
path_have String Key strings included in the files path.
Multiple key string can be specified separated by a comma.
path_not_have String Key strings that must not be included in the files path.
Multiple key string can be specified separated by a comma.
creation_date_start Date Start range date on the file creation
creation_date_end Date End range date on the file creation
modification_date_start Date Start range date on the file modification
modification_date_end Date End range date on the file modification
size Number Reference size for the parameters below.
size_unit Number Size unit:
  • 0: KB,
  • 1: MB,
  • 2: GB,
  • 3: TB.
size_mode Number Search mode on the reference size:
  • 0: Greater than the reference size,
  • 1: Smaller then the reference size.
length Number Pagination purpose. The maximum number of elements wanted in the result response.
start Number Pagination purpose. The number of elements to skip in the result response.
cache Boolean File presence in cache.
tape Boolean File presence in a Tape.
cloud Boolean File presence in a Cloud.
share Boolean File presence in a Share.
in_share_select String It is possible to search in all shares or in a specified one:
  • all: Search in all shares,
  • Number (share_id): Search only in the specified share id.
in_tape_select String It is possible to search in all tapes or in a specified one:
  • all: Search in all tapes,
  • Number (tape_id): Search only in the specified tape id.
in_pool_select String It is possible to search in all pools or in a specified one:
  • all: Search in all pools,
  • Number (tape_id): Search only in the specified pool id.
in_bucket_select String It is possible to search in all buckets or in a specified one:
  • all: Search in all buckets,
  • String (bucket_name): Search only in the specified bucket name.

Request response

Key name Type Description
id Number File id.
name String File name.
cdate Date Creation date.
mdate Date Modification date.
in_cache Boolean In cache status.
in_tape Boolean On tape status.
in_cloud Boolean On cloud status.
barcode String Tape list if the file is found on tape.
offline Boolean Offline status. True if the file is on a archive tape outside the system.
path String Full path.
size Number Size in byte.
file_extern Boolean Extern status. True if the file is on an external file storage (Mount Point).
type String File type:
  • file,
  • share,
  • folder.
bucket String Bucket list if the file is found on cloud.
metadata Object Array Metadata structure.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Shares

Operations involving shared folders.

List shared folders

This command allow you to list all the share on the system

Example of list shares:

require 'rest-client'

url = "http://example.com/api/frontend/shares"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/frontend/shares

The above command returns JSON structured like this:

{  
   "shares":[
      {
         "name":"Software",
         "id":2,
         "quota":0,
         "cache-usage":0,
         "guest-right":0,
         "size":530365625060,
         "cache-size":530834259968,
         "last-update":"2015-10-19T13:43:37.000Z",
         "comment":""
      },
      {
         "name":"Guest",
         "id":13,
         "quota":5000000000000,
         "cache-usage":50,
         "guest-right":7,
         "size":404674375292,
         "cache-size":8192,
         "last-update":"2015-10-19T13:44:16.000Z",
         "comment":""
      }
   ],
   "status":"OK"
}

HTTP Request

GET http://example.com/api/frontend/shares

Request response

Key name Type Description
name String Share name.
comment String User comment.
id Number Share id.
quota Number Maximum size of share in byte.
cache-usage Number Maximum cache resource available in %.
guest-right Number Guest access:
  • 0: no access,
  • 5: read only,
  • 7: read/write.
size Number Total share size in byte.
cache-size Number Current size on cache in byte.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Create a Share

This command allow you to create new shares. The name of the new share must be unique on the system.

Example of create share:

require 'rest-client'

#JSON describing the new share
share_json = {
     "share" => {
        "name" => "myShare",
        "comment" => "New example share",
        "quota" => 10000000,
        "cache-usage" => 50
     }
  }

url = "http://example.com/api/frontend/shares"
response = RestClient::Request.execute( method: :post, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: share_json)
curl -H "Content-Type: application/json" 
     -X POST 
     -d '{
            "share":{
            "name":"myShare",
            "comment":"New example share",
            "quota":10000000,
            "cache-usage":50}
        }' 
    http://[username]:[password]@example.com/api/frontend/shares

The above command returns JSON structured like this:

{  
   "message": "Share myShare added",
   "status": "OK"
}

HTTP Request

POST http://example.com/api/frontend/shares

Request parameter

Key name Type Description
name String Share name.
comment String User comment.
quota Number Quota size in bytes.
cache-usage Number Cache resource limitation in %.

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Update a Share

This command allow you to update an existing shares. The share name is used as the unique key to identify the share concerned by the update.

Updating a share :

require 'rest-client'

#JSON describing the new value for myShare
share_json = {
     "share" => {
        "name" => "myShare",
        "comment" => "New example share",
        "quota" => 10000000,
        "cache-usage" => 50
     }
  }

url = "http://example.com/api/frontend/shares"
response = RestClient::Request.execute( method: :put, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: share_json)
curl -H "Content-Type: application/json" 
     -X PUT 
     -d '{
            "share":{
            "name":"myShare",
            "comment":"New example share",
            "quota":10000000,
            "cache-usage":50}
        }' 
    http://[username]:[password]@example.com/api/frontend/shares

The above command returns JSON structured like this:

{  
   "message": "Share myShare edited",
   "status": "OK"
}

HTTP Request

PUT http://example.com/api/frontend/shares

Request parameter

Key name Type Description
name String Share name.
comment String New user comment.
quota Number New quota size in bytes.
cache-usage Number New cache resource limitation in %.

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Delete a Share

This command allow you to delete a share by it’s name.

Delete share “myShare”:

require 'rest-client'

url = "http://example.com/api/frontend/shares/myShare"
response = RestClient::Request.execute( method: :delete, 
                                        url: url, 
                                        user: [username],
                                        password: [password]")
curl -X DELETE 
 http://[username]:[password]@example.com/api/frontend/shares/myShare

The above command returns JSON structured like this:

{  
   "message": "Share myShare deleted",
   "status": "OK"
}

HTTP Request

DELETE http://example.com/api/frontend/shares/{share_name}

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Mount points

Operations involving external mount points

List mount points

This command allow you to list all the mount point on the system.

Example of request:

require 'rest-client'

url = "http://example.com/api/frontend/mount_points"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/frontend/mount_points

The above command returns JSON structured like this:

{  
   "mount_points":[  
      {  
         "name":"name01",
         "id":1,
         "type":0,
         "target":"//cifs.mt-c.com/share1",
         "options": ""
         "username":"user",
         "password":"password",
         "comment":"cifs mount point",
         "mounted":true
      },
      {  
         "name":"name02",
         "id":4,
         "type":1,
         "target":"nfs.mt-c.com:/share2",
         "options": ""
         "username":"",
         "password":"",
         "comment":"NFS mount point",
         "mounted":true
      }
   ],
   "message":"2 mount points found."
}

HTTP Request

GET http://example.com/api/frontend/mount_points

Request response

An array of JSON representing a mount point.

Key name Type Description
name String Mount point name.
id Number Mount point id.
type Number Mount point type :
  • 0: CIFS,
  • 1: NFS version 3,
  • 2: StorNext 4.
target String Target address of the external mount point.
options String Optional Linux mount options depending type.
username String Optional Username authentication.
password String Optional Password authentication.
comment String User comment.
mounted Boolean Current mount point status:
  • True: mounted,
  • False: not mounted.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Create a mount point

This command allow you to create a new mounting point. The name of the mount point must be unique on the system.

Example. Creation of a mount point called “myMP”

require 'rest-client'

#JSON describing the new mount point
MP_json = {
     "mount_point" => {
        "name" => "myMP",
        "comment" => "New mounting point",
        "target" => "//cifs.mt-c.com/myShare",
        "type" => 0
        "username" => "user1",
        "password" => "password"
     }
  }

url = "http://example.com/api/frontend/mount_points"
response = RestClient::Request.execute( method: :post, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: MP_json)
curl -H "Content-Type: application/json" 
     -X POST 
     -d '{
            "mount_point":{
            "name":"myMP",
            "comment":"New mounting point",
            "target":"//cifs.mt-c.com/myShare",
            "type":0,
            "username":"user1",
            "password":"password"}
        }' 
    http://[username]:[password]@example.com/api/frontend/mount_points

The above command returns JSON structured like this:

{  
   "message": "Mount point myMP added",
   "status": "OK"
}

HTTP Request

POST http://example.com/api/frontend/mount_points

Request parameter

Key name Type Description
name String Mount point name.
comment String User comment.
target String Target address of the external mount point.
type Number Mount point type :
  • 0: CIFS,
  • 1: NFS version 3,
  • 2: StorNext 4.
options String Optional Linux mount options depending type.
username String Optional Username authentication.
password String Optional Password authentication.

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Update a mount point

This command allow you to update an existing mount point. The mount point name is used as the unique key to identify the mount point concerned by the update.

Example. Updating a mount point called “myMP”

require 'rest-client'

#JSON with the new values for the mount point myMP
MP_json = {
     "mount_point" => {
        "name" => "myMP",
        "comment" => "New mounting point",
        "target" => "//cifs.mt-c.com/myShare",
        "type" => 0
        "username" => "user1",
        "password" => "password"
     }
  }

url = "http://example.com/api/frontend/mount_points"
response = RestClient::Request.execute( method: :put, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: MP_json)
curl -H "Content-Type: application/json" 
     -X PUT 
     -d '{
            "mount_point":{
            "name":"myMP",
            "comment":"New mounting point",
            "target":"//cifs.mt-c.com/myShare",
            "type":0,
            "username":"user1",
            "password":"password"}
        }' 
   http://[username]:[password]@example.com/api/frontend/mount_points

The above command returns JSON structured like this:

{  
   "message": "Mount point myMP modified",
   "status": "OK"
}

HTTP Request

POST http://example.com/api/frontend/mount_points

Request parameter

Key name Type Description
name String Mount point name.
comment String User comment.
target String Target address of the external mount point.
type Number Mount point type :
  • 0: CIFS,
  • 1: NFS version 3,
  • 2: StorNext 4.
options String Optional Linux mount options depending type.
username String Optional Username authentication.
password String Optional Password authentication.

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Delete a mount point

This command allow you to delete a mount point by it’s name.

Delete mount point “myMP”:

require 'rest-client'

url = "http://example.com/api/frontend/mount_points/myMP"
response = RestClient::Request.execute( method: :delete, 
                                        url: url, 
                                        user: [username],
                                        password: [password]")
curl -X DELETE 
http://[username]:[password]@example.com/api/frontend/mount_points/myMP

The above command returns JSON structured like this:

{  
   "message": "myMP deleted",
   "status": "OK"
}

HTTP Request

DELETE http://example.com/api/frontend/mount_points/{mount_point_name}

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Users

There are two category of users. The local users are the users created on the system. The domains users are all the users retrieved from an external server (ex: ldap server).

With these commands you are able to administrate local users.

The users retrieved from external servers cannot be set as adminitrator.

List users

This command allow you to list all the users on the system.

Example of request:

require 'rest-client'

url = "http://example.com/api/frontend/users"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/frontend/users

The above command returns JSON structured like this:

{  
   "code": 200,
   "message": "4 users found.",
   "users":{  
      "local":[  
         {  
            "username":"user1",
            "admin":0
         },
         {  
            "username":"user2",
            "admin":0
         },
         {  
            "username":"admin",
            "admin":1
         }
      ],
      "domain":[  
         {  
            "username":"ldap_user1",
            "admin":0
         }
      ]
   },
   "status":"OK"
}

HTTP Request

GET http://example.com/api/frontend/users

Request response

An array of JSON representing all the users.

Key name Type Description
message String Describe the number of users
local Array Array containing all the local users.
domain Array Array containing all the domain users.
username String Username of the user.
admin Number Access to the web administration:
  • 1 = access,
  • 0 = no access.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Create a local user

This command allow you to create a new local user. The users are identified by there username. Thus the username must be unique on the system

Adding user “Alan”

require 'rest-client'

#JSON describing the new user
user_json = {
     "user" => {
        "name" => "Alan",
        "password" => "IamThe007",
        "admin" => 1,
        "groups" => ["Dev", "Acc", "Tech"]
     }
  }

url = "http://example.com/api/frontend/users"
response = RestClient::Request.execute( method: :post, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: user_json)
curl -H "Content-Type: application/json" 
     -X POST 
     -d '{
            "user":{
            "name":"Alan",
            "password":"IamThe007",
            "admin":1,
            "groups":["Dev", "Acc", "Tech"]}
        }' 
    http://[username]:[password]@example.com/api/frontend/users

The above command returns JSON structured like this:

{  
   "message": "User added",
   "status": "OK"
}

HTTP Request

POST http://example.com/api/frontend/users

Request parameter

Key name Type Description
name String Username.
password String User password.
admin Number Access to the web administration:
  • 1 = access,
  • 0 = no access.
groups String array Array containing the name of all the groups desired for the new user

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Update a local user

This command allow you to update local user.

Updating user “Alan”

require 'rest-client'

#JSON describing the new user
user_json = {
     "user" => {
        "name" => "Alan",
        "password" => "IamThe007",
        "admin" => 1,
        "groups" => ["Dev", "Acc", "Tech", "Test"]
     }
  }

url = "http://example.com/api/frontend/users"
response = RestClient::Request.execute( method: :put, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: user_json)
curl -H "Content-Type: application/json" 
     -X PUT 
     -d '{
            "user":{
            "name":"Alan",
            "password":"IamThe007",
            "admin":1,
            "groups":["Dev", "Acc", "Tech", "Test"]}
        }' 
    http://[username]:[password]@example.com/api/frontend/users

The above command returns JSON structured like this:

{  
   "message": "User edited",
   "status": "OK"
}

HTTP Request

PUT http://example.com/api/frontend/users

Request parameter

Key name Type Description
name String Username of the user to update.
password String User password.
admin Number Access to the web administration:
    1 = access,
  • 0 = no access.
groups String array Array containing the name of all the groups desired for the new user

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Delete a local user

This command allow you to delete a user by it’s username

Delete user “Alan”:

require 'rest-client'

url = "http://example.com/api/frontend/users/Alan"
response = RestClient::Request.execute( method: :delete, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X DELETE 
http://[username]:[password]@example.com/api/frontend/users/Alan

The above command returns JSON structured like this:

{  
   "message": "User deleted",
   "status": "OK"
}

HTTP Request

DELETE http://example.com/api/frontend/users/{username}

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

List user groups (Deprecated)

This command allow you to list all the groups for one user

Example of request:

require 'rest-client'

url = "http://example.com/api/frontend/usergroups/Alan"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
http://[username]:[password]@example.com/api/frontend/usergroups/Alan

The above command returns JSON structured like this:

{  
   "groups":["Dev","Tech","Acc","Test"],
   "status":"OK"
}

HTTP Request

GET http://example.com/api/frontend/usergroups/{username} (Deprecated)

Request response

Key name Type Description
groups String array Array containing all the groups name.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

List user groups

This command allow you to list all the groups for one user

Example of request:

require 'rest-client'

url = "http://example.com/api/frontend/users/Alan"
response = RestClient::Request.execute( method: :get, 
                    url: url, 
                    user: [username],
                    password: [password])
curl -X GET 
http://[username]:[password]@example.com/api/frontend/users/Alan

The above command returns JSON structured like this:

{  
   "groups":["Dev","Tech","Acc","Test"],
   "status":"OK"
}

HTTP Request

GET http://example.com/api/frontend/users/{username} (Deprecated)

Request response

Key name Type Description
groups String array Array containing all the groups name.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

List users connected

This command allow you to list all the users connected when the command was executed.

Example of request:

require 'rest-client'

url = "http://example.com/api/frontend/stats/users"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
http://[username]:[password]@example.com/api/frontend/stats/users

The above command returns JSON structured like this:

{  
   "users":[  
      {  
         "username":"clambert",
         "ip":"10.3.1.169",
         "service":"CIFS",
         "share":"testchl3",
         "connected_at":"2015-12-02T08:24:30.000Z"
      },
      {  
         "username":"admin",
         "ip":"10.3.1.119",
         "service":"WEB",
         "share":"",
         "connected_at":"2015-12-02T08:04:38.000Z"
      }
   ],
   "status":"OK",
   "message":"Frontend users connected."
}

HTTP Request

GET http://example.com/api/frontend/stats/users

Request response

Array containing informations about the users currently connected

Key name Type Description
username String User username.
ip String User IP or hostname.
service String service name. Value possible: WEB or CIFS.
share String Shared folder accessed by user. Only applied for CIFS users.
connected_at String Connection date.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

List details about users

This command allow you to list many details about the registered users.

Example of request:

require 'rest-client'

url = "http://example.com/api/frontend/users_detailed"
response = RestClient::Request.execute( method: :get, 
                    url: url, 
                    user: [username],
                    password: [password])
curl -X GET 
http://[username]:[password]@example.com/api/frontend/users_detailed

The above command returns JSON structured like this:

{
  "code": 200,
  "message": "10 users found.",
  "users": [
    {
      "current_sign_in_at": "2017-08-02T06:57:39Z",
      "sign_in_count": 498,
      "vector": "",
      "encrypted_password": "",
      "active": 1,
      "admin": 1,
      "created_at": "2005-05-15T08:56:15Z",
      "email": "",
      "updated_at": "2017-08-02T06:57:39Z",
      "last_sign_in_at": "2017-08-01T15:04:46Z",
      "key_id": 0,
      "username": "admin",
      "current_sign_in_ip": "10.3.1.118",
      "remember_created_at": null,
      "id": 2,
      "last_sign_in_ip": "10.3.1.118"
    },
    {
      "current_sign_in_at": null,
      "sign_in_count": 0,
      "vector": "no-cipher",
      "encrypted_password": "",
      "active": 1,
      "admin": 0,
      "created_at": "2017-08-02T09:04:11Z",
      "email": "",
      "updated_at": "2017-08-02T09:04:11Z",
      "last_sign_in_at": null,
      "key_id": 0,
      "username": "test_user",
      "current_sign_in_ip": null,
      "remember_created_at": null,
      "id": 1360,
      "last_sign_in_ip": null
    }
  ],
  "status": "OK"
}

HTTP Request

GET http://example.com/api/frontend/users_detailed

Request response

Key name Type Description
current_sign_in_at DateTime Start time of the active session.
sign_in_count Number Number of unique sessions.
vector String Details about login methods.
encrypted_password String Password.
active Number ‘1’ if the user is active, '0’ if not.
admin Number '1’ if the user is admin, '0’ if not.
created_at DateTime Date of creation.
email String Email of the user.
updated_at DateTime Date of update.
last_sign_in_at DateTime Date of last sign in.
key_id Number ID of the creator user.
username String Name of the user.
current_sign_in_ip String IP of the client for the active session.
remember_created_at DateTime Date of the last 'Remember me’ selection.
id Number ID of the user
last_sign_in_ip String Date of last sign in.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

User groups

There are two category of groups. The local groups are the groups created on the system. The domain groups are all the groups retrieved from an external server (ex: ldap server).

With these commands you are able to administrate local groups.

List groups (Deprecated)

This command allow you to list all the groups on the system.

Example of request:

require 'rest-client'

url = "http://example.com/api/frontend/groups2"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/frontend/groups2

The above command returns JSON structured like this:

{  
   "groups":{  
      "local":[  
         "group1",
         "group2"
      ],
      "domain":[  
         "extern_group1"
      ]
   },
   "status":"OK"

}

HTTP Request

GET http://example.com/api/frontend/groups2 (Deprecated)

Request response

An array of JSON representing all the groups

Key name Type Description
local String array Array containing the name of all local groups
domain String array Array containing all the name of all domain groups.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

List groups

This command allow you to list all the groups on the system.

Example of request:

require 'rest-client'

url = "http://example.com/api/frontend/group_names"
response = RestClient::Request.execute( method: :get, 
                    url: url, 
                    user: [username],
                    password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/frontend/group_names

The above command returns JSON structured like this:

{  
   "groups":{  
      "local":[  
         "group1",
         "group2"
      ],
      "domain":[  
         "extern_group1"
      ]
   },
   "status":"OK"

}

HTTP Request

GET http://example.com/api/frontend/group_names

Request response

An array of JSON representing all the groups

Key name Type Description
local String array Array containing the name of all local groups
domain String array Array containing all the name of all domain groups.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

List groups and users within

This command allow you to list all the groups on the system and the members of them.

Example of request:

require 'rest-client'

url = "http://example.com/api/frontend/groups"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/frontend/groups

The above command returns JSON structured like this:

{
  "groups": [
    {
      "type": "local",
      "name": "grpgn1",
      "users": [
        "test_user"
      ]
    },
    {
      "type": "local",
      "name": "man_group",
      "users": [
        "man_user",
        "man_user_no_admin",
        "man_user2"
      ]
    }
  ],
  "status": "OK"
}

HTTP Request

GET http://example.com/api/frontend/groups

Request response

An array of JSON representing all the groups and users

Key name Type Description
local String array Array containing the name of all local groups
domain String array Array containing all the name of all domain groups.
users String array Array containing all the users that are meber of the group.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Create a local group

This command allow you to create a new local group. The groups are identified by there name. Thus the name must be unique on the system

Creating group “dev_group”

require 'rest-client'

#JSON describing the new group
group_json = {
     "group" => {
        "name" => "Dev",
        "users" => ["Alan", "Boris"]
     }
  }

url = "http://example.com/api/frontend/groups"
response = RestClient::Request.execute( method: :post, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: group_json)
curl -H "Content-Type: application/json" 
     -X POST 
     -d '{
            "group":{
            "name":"dev_group",
            "users":["Alan", "Boris"]}
        }' 
    http://[username]:[password]@example.com/api/frontend/groups

The above command returns JSON structured like this:

{  
   "message": "group added",
   "status": "OK"
}

HTTP Request

POST http://example.com/api/frontend/groups

Request parameter

Key name Type Description
name String Name of the group.
users String array Array of existing users to include in the new group.

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Update a local group

This command allow you to update an existing group.

Updating group “dev_group”

require 'rest-client'

#JSON describing the new values for the group
group_json = {
     "group" => {
        "name" => "dev_group",
        "users" => ["Carol"]
     }
  }

url = "http://example.com/api/frontend/groups"
response = RestClient::Request.execute( method: :put, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: group_json)
curl -H "Content-Type: application/json" 
     -X PUT 
     -d '{
            "group":{
            "name":"dev_group",
            "users":["Carol"]}
        }' 
    http://[username]:[password]@example.com/api/frontend/groups

The above command returns JSON structured like this:

{  
   "message": "group edited",
   "status": "OK"
}

HTTP Request

PUT http://example.com/api/frontend/groups

Request parameter

Key name Type Description
name String Name of the group.
users String array Array of existing users to include in the new group.

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Delete a local group

This command allow you to delete a group by it’s name

Delete user “dev_group”:

require 'rest-client'

url = "http://example.com/api/frontend/groups/dev_group"
response = RestClient::Request.execute( method: :delete, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X DELETE 
http://[username]:[password]@example.com/api/frontend/groups/dev_group

The above command returns JSON structured like this:

{  
   "message": "Group deleted",
   "status": "OK"
}

HTTP Request

DELETE http://example.com/api/frontend/groups/{groupname}

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

List all users for a group (Deprecated)

This command allow you to list all the users member of a given group

Example of request:

require 'rest-client'

url = "http://example.com/api/frontend/groupusers/dev_group"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
http://[username]:[password]@example.com/api/frontend/groupusers/dev_group

The above command returns JSON structured like this:

{  
   "users":["Alan","Boris","Carol"],
   "status":"OK"
}

HTTP Request

GET http://example.com/api/frontend/groupusers/dev_group (Deprecated)

Request response

Key name Type Description
users String array Array containing all the users name.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

List all users for a group

This command allow you to list all the users member of a given group

Example of request:

require 'rest-client'

url = "http://example.com/api/frontend/groups/dev_group"
response = RestClient::Request.execute( method: :get, 
                    url: url, 
                    user: [username],
                    password: [password])
curl -X GET 
http://[username]:[password]@example.com/api/frontend/groups/dev_group

The above command returns JSON structured like this:

{  
   "users":["Alan","Boris","Carol"],
   "status":"OK"
}

HTTP Request

GET http://example.com/api/frontend/groups/dev_group

Request response

Key name Type Description
users String array Array containing all the users name.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

User privileges

List all user’s privileges on a share

This command allow you to list all the user’s privilege on a share.

Example of request:

require 'rest-client'

url = "http://example.com/api/frontend/shares/myShare/privileges"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/frontend/shares/myShare/privileges

The above command returns JSON structured like this:

{  
   "privileges":[  
      {  
         "type":"user",
         "name":"clambert",
         "perms":7
      },
      {  
         "type":"user",
         "name":"clambert",
         "perms":5
      },
      {  
         "type":"group",
         "name":"nobody",
         "perms":0
      }
   ],
   "status":"OK"
}

HTTP Request

GET http://example.com/api/frontend/shares/{share_name}/privileges

Request response

An array of user and group and their associated privilege on the share

Key name Type Description
type String Group or user.
name String Group or user name.
perms Number Define the access on a share. Values:
  • 0: No Access,
  • 5: Read only,
  • 7: Read/Write.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Create and update users privileges on a share

This command allow you to give or update the permissions of multiple users or groups on a share.

Creating or updating perms on “myShare”

require 'rest-client'

#JSON describing the new permissions
perms_json = {
     "privileges" => {
        "guest-right" => 0,
        "users" => [
            {
                "perms" => 7,
                "name" => "user1",
                "type" => "user"
            },
            {
                "perms" => 5,
                "name" => "group1",
                "type" => "group"
            }
        ]
     }
  }

url = "http://example.com/api/frontend/shares/myShare/privileges"
response = RestClient::Request.execute( method: :post, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: perms_json)
curl -H "Content-Type: application/json" 
     -X POST 
     -d '{
            "privileges":{
            "guest-right":0,
            "users":[
                {
                    "perms":7,
                    "name":"user1",
                    "type":"user"
                },
                {
                    "perms":5,
                    "name":"group1",
                    "type":"group"
                }
            ]
         }
        }' 
    http://[username]:[password]@example.com/api/frontend/shares/myShare/privileges

The above command returns JSON structured like this:

{  
   "message": "privileges correctly set",
   "status": "OK"
}

HTTP Request

POST http://example.com/api/frontend/shares/{share_name}/privileges

Request parameter

Key name Type Description
guest-right Number Guest access on the share.
users Array Array of users or group definition. .
perms Number Define the access on a share. Values:
  • 0: No Access,
  • 5: Read only,
  • 7: Read/Write.
type String Group or user.
name String Group or user name.

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Authentication servers

Get current configuration

This command allow you to retrieve all the config informations of the authentication server.

Example of request:

require 'rest-client'

url = "http://example.com/api/frontend/authentication"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/frontend/authentication

The above command returns JSON structured like this:

{  
   "authentication":{  
      "type":0
   },
   "status":"OK"
}
{  
   "authentication":{  
      "type":1,
      "server":"ad.server.com",
      "domain":"mt-c.com",
      "netbios":"MT-C",
      "username":"Administrator",
      "dn":"dc=mt-c,dc=com",
      "bind":"cn=admin,dc=mt-c,dc=com"
   },
   "status":"OK"
}
{  
   "authentication":{  
      "type":2,
      "netbios":"LDAP01_SERVER",
      "server":"ldap01.server.com",
      "dn":"dc=mt-c,dc=com",
      "bind":"cn=admin,dc=mt-c,dc=com"
   },
   "status":"OK"
}

HTTP Request

GET http://example.com/api/frontend/authentication

Request response

Key name Type Description
type Number Define the authentification method:
  • 0: Local,
  • 1: Active Directory,
  • 2: LDAP.
server String Server address (for active directory and ldap methods).
domain String Domain name (for the active directory method).
netbios String Netbios name (for the active directory and ldap methods).
username String User name (for the active directory method).
dn String LDAP base distinguished name (for the ldap method).
bind String bind user name (for the ldap method).

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Update the authentication server configuration

This command allow you to update the configuration of the authentication server.

Updating authentication server

require 'rest-client'

#JSON describing the authentication options
authentication_json = {
     "authentication" => {  
      "type" => 0
   }
  }

authentication_json = {
     "authentication" => {  
      "type" => 1,
      "server" => "ad.server.com",
      "domain" => "mt-c.com",
      "netbios" => "MT-C",
      "username" => "Administrator",
      "password" => "password",
      "dn" => "dc=mt-c,dc=com",
      "bind" => "cn=admin,dc=mt-c,dc=com"
   }
  }
authentication_json = {
     "authentication" => {  
      "type" => 2,
      "netbios" => "LDAP001_SERVER",
      "server" => "ldap01.server.com",
      "password" => "password",
      "dn" => "dc=mt-c,dc=com",
      "bind" => "cn=admin,dc=mt-c,dc=com"
   }
  }

url = "http://example.com/api/frontend/authentication"
response = RestClient::Request.execute( method: :put, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: authentication_json)
curl -H "Content-Type: application/json" 
     -X PUT 
     -d '{
            "authentication":{  
              "type":0
           }
        }' 
    http://[username]:[password]@example.com/api/frontend/authentication

curl -H "Content-Type: application/json" 
     -X PUT 
     -d '{
            "authentication":{  
              "type":1,
              "server":"ad.server.com",
              "domain":"mt-c.com",
              "netbios":"MT-C",
              "username":"Administrator",
              "password":"password",
              "dn":"dc=mt-c,dc=com",
              "bind":"cn=admin,dc=mt-c,dc=com"
           }
        }' 
    http://[username]:[password]@example.com/api/frontend/authentication

curl -H "Content-Type: application/json" 
     -X PUT 
     -d '{
            "authentication":{  
              "type":2,
              "netbios":"LDAP01_SERVER",
              "server":"ldap01.server.com",
              "dn":"dc=mt-c,dc=com",
              "bind":"cn=admin,dc=mt-c,dc=com",
              "password":"password"
           }
        }' 
    http://[username]:[password]@example.com/api/frontend/authentication

The above command returns JSON structured like this:

{  
   "message": "Server edited",
   "status": "OK"
}

HTTP Request

PUT http://example.com/api/frontend/authentication

Request parameter

Key name Type Description
type Number Define the authentification method:
  • 0: Local,
  • 1: Active Directory,
  • 2: LDAP.
server String Server address (for active directory and ldap methods).
domain String Domain name (for the active directory method).
netbios String Netbios name (for the active directory and ldap methods).
username String User name (for the active directory method).
dn String LDAP base distinguished name (for the ldap method).
bind String bind user name (for the ldap method).
password String AD or LDAP Password (for active directory and ldap methods).

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Libraries

List all libraries

This command allow you to list all the properties of all libraries on the system.

Example of request:

require 'rest-client'

url = "http://example.com/api/backend/libraries"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/backend/libraries

The above command returns JSON structured like this:

{
  "libraries": [
    {
      "id": 2,
      "serial": "464970G+1606SY9842",
      "name": "Oracle",
      "comment": "Oracle SL150",
      "ready": true,
      "online": true,
      "configured": true,
      "vendor": "STK",
      "product": "SL150",
      "firmware": "0250",
      "dev": "sg3",
      "storage_slots": 29,
      "storage_slots_address": 1000,
      "io_slots": 4,
      "io_slots_address": 10,
      "emulation": {
        "vendor": "stk",
        "product": "sl150"
      }
    },
    {  
         "id":3,
         "serial": "C60C825138DB4378B3874521",
         "name":"IBM",
         "comment":"IBM 3100",
         "ready":true,
         "online":true,
         "configured":true,
         "vendor":"IBM",
         "product":"3573-TL",
         "firmware":"C.20",
         "dev":"sg5",
         "storage_slots":23,
         "storage_slots_address":4096,
         "io_slots":1,
         "io_slots_address":16,
         "emulation": {
            "vendor": "ibm",
            "product": "3573-tl"
         }
      }
  ],
  "status": "OK",
  "code": 200
}

HTTP Request

GET http://example.com/api/backend/libraries

Request response

Key name Type Description
serial String Library serial number.
id Number Library id. -1 for not configured library.
name String Library name set by user.
comment String User comment about the library.
ready Boolean Physically accessible. Values:
  • true: SCSI accessible,
  • false: SCSI not accessible.
online Boolean Software accessible. Can be disable for maintenance purpose.
  • true: Accessible,
  • false: Not accessible.
configured Boolean
  • true: configured,
  • false: Not configured.
vendor String Vendor name.
product String Product name.
firmware String Firmware code.
dev String Linux SCSI generic device. E.G. : sg0
storage_slots Number Number of storage slots.
storage_slots_address Number First storage slot SCSI address.
io_slots Number Number of I/O station.
io_slots_address Number First I/O station SCSI address.
emulation Hash SCSI communication emulation.
vendor String Vendor emulation.
product String Product emulation.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Get library information

This command allow you to retrieve all information of on library

Example of request:

require 'rest-client'

url = "http://example.com/api/backend/library/C60C825138DB4378B3870040"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/backend/library/C60C825138DB4378B3874521

The above command returns JSON structured like this:

{  
   "libraries": [
    {  
         "id":3,
         "serial": "C60C825138DB4378B3874521",
         "name":"IBM",
         "comment":"IBM 3100",
         "ready":true,
         "online":true,
         "configured":true,
         "vendor":"IBM",
         "product":"3573-TL",
         "firmware":"C.20",
         "dev":"sg5",
         "storage_slots":23,
         "storage_slots_address":4096,
         "io_slots":1,
         "io_slots_address":16,
         "emulation": {
            "vendor": "ibm",
            "product": "3573-tl"
         }
      }
   ],
  "status": "OK",
  "code": 200
}

HTTP Request

GET http://example.com/api/backend/library/{library_serial}

Request response

Key name Type Description
serial String Library serial number.
id Number Library id. -1 for not configured library.
name String Library name set by user.
comment String User comment about the library.
ready Boolean Physically accessible. Values:
  • true: SCSI accessible,
  • false: SCSI not accessible.
online Boolean Software accessible. Can be disable for maintenance purpose.
  • true: Accessible,
  • false: Not accessible.
configured Boolean
  • true: configured,
  • false: Not configured.
vendor String Vendor name.
product String Product name.
firmware String Firmware code.
dev String Linux SCSI generic device. E.G. : sg0
storage_slots Number Number of storage slots.
storage_slots_address Number First storage slot SCSI address.
io_slots Number Number of I/O station.
io_slots_address Number First I/O station SCSI address.
emulation Hash SCSI communication emulation.
vendor String Vendor emulation.
product String Product emulation.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Get supported products

This command allow you to retrieve all the supported products and vendors

Example of request:

require 'rest-client'

url = "http://example.com/api/backend/libraries/emulations"
response = RestClient::Request.execute( method: :get, 
                    url: url, 
                    user: [username],
                    password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/backend/libraries/emulations

The above command returns JSON structured like this:

{
    "emulations": [
        {
            "product": "scalari6000",
            "vendor": "quantum"
        },
        {
            "product": "tseries",
            "vendor": "spectra"
        },
        {
            "product": "scalari500",
            "vendor": "quantum"
        },
        {
            "product": "t950",
            "vendor": "hp"
        },
        {
            "product": "Generic",
            "vendor": "MT-C"
        },
        {
            "product": "neoseries",
            "vendor": "overland"
        },
        {
            "product": "sl150",
            "vendor": "stk"
        },
        {
            "product": "3573-tl",
            "vendor": "ibm"
        },
        {
            "product": "tl4000",
            "vendor": "dell"
        },
        {
            "product": "tl2000",
            "vendor": "dell"
        },
        {
            "product": "mslg3series",
            "vendor": "hp"
        },
        {
            "product": "msl6480",
            "vendor": "hp"
        },
        {
            "product": "eslg3series",
            "vendor": "hp"
        },
        {
            "product": "dxi4700",
            "vendor": "quantum"
        }
    ],
    "code": 200,
    "status": "OK"
}

HTTP Request

GET http://example.com/api/backend/libraries/emulations

Request response

Key name Type Description
emulation Hash SCSI communication emulation.
vendor String Vendor emulation.
product String Product emulation.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

List drives

This command allow you to retrieve information for all the drives of on library.

Example of request:

require 'rest-client'

url = "http://example.com/api/backend/drives"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/backend/drives

The above command returns JSON structured like this:

{
  "drives": [
    {
      "serial": "HUJ5515CYK",
      "configured": true,
      "scsi_address": 500,
      "online": true,
      "comment": "",
      "vendor": "HP",
      "product": "Ultrium 6-SCSI",
      "firmware": "25FS",
      "dev": "st0",
      "gdev": "sg2",
      "mount_count": 4,
      "barcode": "MTC504L5",
      "full": 1,
      "current_task": "Idle",
      "current_action": "Idle",
      "bandwidth": 0
    },
    {
      "serial": "HUJ5515CER",
      "configured": true,
      "scsi_address": 501,
      "online": true,
      "comment": "",
      "vendor": "HP",
      "product": "Ultrium 6-SCSI",
      "firmware": "25FS",
      "dev": "st1",
      "gdev": "sg4",
      "mount_count": 6,
      "barcode": "MTC603L6",
      "full": 1,
      "current_task": "Idle",
      "current_action": "Idle",
      "bandwidth": 0
    }
  ],
  "status": "OK",
  "code": 200
}

HTTP Request

GET http://example.com/api/backend/drives/{library_serial}

Request response

Key name Type Description
library_serial String Optional, If specified, return the drives attached to this Library serial number.
serial String Drive’s Serial Number.
vendor String Vendor name.
product String Product name.
firmware String Firmware code.
scsi_address Number Physical SCSI address.
configured Number
  • true: Configured,
  • false: Not configured.
online Number Software accessible. Can be disable for maintenance purpose.
  • true: Accessible,
  • false: Not accessible.
dev String Linux SCSI tape device. E.G. : st0.
gdev String Linux SCSI generic device. E.G. : sg0.
mount_count Number Drives mount count.
full Number
  • 1: Mounted drive,
  • 0: Empty drive.
barcode String Media barcode if the drive is mounted.
current_action String Current action. Values:
  • Idle,
  • Reading,
  • Writing,
  • Umounting LTFS FileSystem,
  • Dismounting Tape,
  • Mounting Tape,
  • Mounting LTFS FileSystem,
  • Formatting LTFS FileSystem.
current_task String Current handled task.
bandwidth Number Writing or reading bandwidth in Bytes/Second depending of the current action.
comment String User comments about the drive.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Configure a library

This command allow you to configure a library on the system

Example of library configuration.

require 'rest-client'

#JSON describing the library
library_json = {
         "backend" => {  
          "name" => "LTFS-TEST2",
          "serial" => "C60C825138DB4378B3870030",
          "dev" => "sg5",
          "vendor" => "QUANTUM",
          "product" => "Scalar i6000",
          "firmware" => 6.24,
          "storage_slots" => 20,
          "storage_slots_address" => 1024,
          "io_slots" => 4,
          "io_slots_address" => 768,
          "comment" => "",
          "emulation" => {  
             "vendor"=>"stk",
             "product"=>"sl150"
          },
          "drives" => [  
             {  
                "serial" => "C60C800301",
                "dev" => "st2",
                "scsi_address" => 256,
                "vendor" => "IBM",
                "product" => "ULT3580-TD5",
                "firmware" => "D711",
                "comment" => ""
             },
             {  
                "serial" => "C60C800302",
                "dev" => "st3",
                "scsi_address" => 257,
                "vendor" => "IBM",
                "product" => "ULT3580-TD5",
                "firmware" => "D711",
                "comment" => ""
             }
          ]
       }
    }

url = "http://example.com/api/backend/configuration"
response = RestClient::Request.execute( method: :post, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: library_json)
curl -H "Content-Type: application/json" 
     -X POST 
     -d '{  
   "backend":{  
      "name":"Oracle",
      "serial":"464970G+1606SY5421",
      "dev":"sg3",
      "vendor":"STK",
      "product":"SL150",
      "firmware":"0250",
      "storage_slots":"29",
      "storage_slots_address":"1000",
      "io_slots":"4",
      "io_slots_address":"10",
      "comment":"Oracle StorageTek SL150",
      "emulation":{  
         "vendor":"stk",
         "product":"sl150"
      },
      "drives":[  
         {  
            "serial":"HUJ5515CEY",
            "dev":"st0",
            "gdev":"sg2",
            "scsi_address":"500",
            "vendor":"HP",
            "product":"Ultrium 6-SCSI",
            "firmware":"25FS",
            "comment":""
         },
         {  
            "serial":"HUJ5515CEH",
            "dev":"st1",
            "gdev":"sg4",
            "scsi_address":"501",
            "vendor":"HP",
            "product":"Ultrium 6-SCSI",
            "firmware":"25FS",
            "comment":""
         }
      ]
   }
}' 
    http://[username]:[password]@example.com/api/backend/configuration

The above command returns JSON structured like this:

{  
   "message": "Library C60C825138DB4378B3870030 configured",
   "status": "OK"
}

HTTP Request

POST http://example.com/api/backend/configuration

Request parameter

Key name Type Description
name String Library name set by user.
serial String Library serial number.
dev String Linux SCSI generic device. E.G. : sg0.
vendor String Vendor name.
product String Product name.
firmware String Firmware code.
storage_slots Number Number of storage slots.
storage_slots_address Number First storage slot SCSI address.
io_slots Number Number of I/O station.
io_slots_address Number First I/O station SCSI address.
comment String User comment about the library.
emulation Hash Object describing the supported SCSI communication emulation. Possible vendor-product pair:
  • quantum - scalari500
  • quantum - scalari6000
  • quantum - dxi4700
  • stk - sl150
  • ibm - 3573-tl
The possible emulation pairs can be retrieve by Communication Emulation request.
drives Array Array of drives element.
serial String Drive serial number.
dev String Drive device.
scsi_address Number SCSI address of the drive.
vendor String Drive vendor name.
product String Drive product name.
firmware String Firmware code.
comment String User comment for the drive.

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Update library

This command allow you to update the information of a library

Updating library configuration.

require 'rest-client'

#JSON describing the library
library_json = {
         "backend" => {  
          "name" => "LTFS-TEST2",
          "serial" => "C60C825138DB4378B3870030",
          "dev" => "sg5",
          "vendor" => "QUANTUM",
          "product" => "Scalar i6000",
          "firmware" => 6.24,
          "comment" => "",
          "emulation" => {  
             "vendor"=>"stk",
             "product"=>"sl150"
          },
          "drives" => [  
             {  
                "serial" => "C60C800301",
                "dev" => "st2",
                "scsi_address" => 256,
                "vendor" => "IBM",
                "product" => "ULT3580-TD5",
                "firmware" => "D711",
                "comment" => ""
             },
             {  
                "serial" => "C60C800302",
                "dev" => "st3",
                "scsi_address" => 257,
                "vendor" => "IBM",
                "product" => "ULT3580-TD5",
                "firmware" => "D711",
                "comment" => ""
             }
          ]
       }
    }

url = "http://example.com/api/backend/configuration"
response = RestClient::Request.execute( method: :put, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: library_json)
curl -H "Content-Type: application/json" 
     -X PUT 
     -d '{  
   "backend":{  
      "name":"Oracle",
      "serial":"464970G+1606SY5421",
      "dev":"sg3",
      "vendor":"STK",
      "product":"SL150",
      "firmware":"0250",
      "comment":"Oracle StorageTek SL150",
      "emulation":{  
         "vendor":"stk",
         "product":"sl150"
      },
      "drives":[  
         {  
            "serial":"HUJ5515CEY",
            "dev":"st0",
            "gdev":"sg2",
            "scsi_address":"500",
            "vendor":"HP",
            "product":"Ultrium 6-SCSI",
            "firmware":"25FS",
            "comment":""
         },
         {  
            "serial":"HUJ5515CEH",
            "dev":"st1",
            "gdev":"sg4",
            "scsi_address":"501",
            "vendor":"HP",
            "product":"Ultrium 6-SCSI",
            "firmware":"25FS",
            "comment":""
         }
      ]
   }
}' 
    http://[username]:[password]@example.com/api/backend/configuration

The above command returns JSON structured like this:

{  
   "message": "Library C60C825138DB4378B3870030 configured",
   "status": "OK"
}

HTTP Request

PUT http://example.com/api/backend/configuration

Request parameter

Key name Type Description
name String Library name set by user.
serial String Library serial number.
dev String Linux SCSI generic device. E.G. : sg0.
vendor String Vendor name.
product String Product name.
firmware String Firmware code.
comment String User comment about the library.
emulation Hash Object describing the supported SCSI communication emulation. Possible vendor-product pair:
  • quantum - scalari500
  • quantum - scalari6000
  • quantum - dxi4700
  • stk - sl150
  • ibm - 3573-tl
The possible emulation pairs can be retrieve by Communication Emulation request.
drives Array Array of drives element.
serial String Drive serial number.
dev String Drive device.
scsi_address Number SCSI address of the drive.
vendor String Drive vendor name.
product String Drive product name.
firmware String Firmware code.
comment String User comment for the drive.

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Delete a library

This command allow you to remove a library from the system

Delete library C60C825138DB4378B3870030:

require 'rest-client'

url = "http://example.com/api/backend/library/C60C825138DB4378B3875478"
response = RestClient::Request.execute( method: :delete, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X DELETE 
http://[username]:[password]@example.com/api/backend/library/C60C825138DB4378B3875485

The above command returns JSON structured like this:

{  
   "message": "Library deleted",
   "status": "OK"
}

HTTP Request

DELETE http://example.com/api/backend/library/{serial_number}

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Library maintenance mode

Put library and his drives to maintenance mode. The communications will be disable.

Set library 00L2U78AW009_LL0 in maintenance

require 'rest-client'

url = "http://example.com/api/backend/library/00L2U78AW009_LL0/maintenance/1"
response = RestClient::Request.execute( method: :post, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X POST 
http://[username]:[password]@example.com/api/backend/library/00L2U78AW009_LL0/maintenance/1

The above command returns JSON structured like this:

{  
   "message": "Maintenance mode activated.",
   "status": "OK"
}

HTTP Request

POST http://example.com/api/backend/library/{library_serial}/maintenance/{mode}

mode = 1 : Maintenance mode enable

mode = 0 : Maintenance mode disable

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Drive maintenance mode

Put a drive to maintenance mode. The communications will be disable.

Set drive 10WT024187 in maintenance

require 'rest-client'

url = "http://example.com/api/backend/drive/10WT024187/maintenance/1"
response = RestClient::Request.execute( method: :post, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X POST 
http://[username]:[password]@example.com/api/backend/drive/10WT024187/maintenance/1

The above command returns JSON structured like this:

{  
   "message": "Maintenance mode activated.",
   "status": "OK"
}

HTTP Request

POST http://example.com/api/backend/drive/{drive_serial}/maintenance/{mode}

mode = 1 : Maintenance mode enable

mode = 0 : Maintenance mode disable

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Communication Emulation

This command allows you to retrieve the supported SCSI communication emulation

Example of request:

require 'rest-client'

url = "http://example.com/api/backend/libraries/emulations"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/backend/libraries/emulations

The above command returns JSON structured like this:

{
  "emulations": [
    {
      "vendor": "quantum",
      "product": "scalari500"
    },
    {
      "vendor": "quantum",
      "product": "scalari6000"
    },
    {
      "vendor": "quantum",
      "product": "dxi4700"
    },
    {
      "vendor": "stk",
      "product": "sl150"
    },
    {
      "vendor": "ibm",
      "product": "3573-tl"
    }
  ],
  "status": "OK",
  "code": 200
}

HTTP Request

GET http://example.com/api/backend/libraries/emulations

Request response

Key name Type Description
emulation Array Object containing all supported emulation.
vendor String Vendor emulation.
product String Product emulation.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Media

Types definition

Volume definition

Key name Type Description
id Number
barcode String

List all media

This command allow you to get all the information about all the media on the system.

Example of request:

require 'rest-client'

url = "http://example.com/api/backend/media"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/backend/media

The above command returns JSON structured like this:

{  
   "media":[  
      {  
         "id":4,
         "barcode":"MTC500L5",
         "location":"Slot 3",
         "ejected":false,
         "mounted":false,
         "pool":{  
            "id":2,
            "name":"Import",
            "type":2,
            "comment":""
         },
         "library":{  
            "id":2,
            "name":"IBM 3100",
            "serial":"00L2U78AW009_LL0"
         },
         "total":1424997482496,
         "free":1421253017600,
         "date_in":"2015-12-18T14:04:09.000Z",
         "date_move":"2016-01-27T14:42:26.000Z",
         "known": false,
         "scratch": true,
         "write_protect": false
      },
      {  
         "id":5,
         "barcode":"MTC511L5",
         "location":"Out",
         "ejected":true,
         "mounted":false,
         "pool":{  
            "id":2,
            "name":"Default Pool",
            "type":0,
            "comment":""
         },
         "library":{  
            "id":2,
            "name":"IBM 3100",
            "serial":"00L2U78AW009_LL0"
         },
         "total":1424997482496,
         "free":1339705262080,
         "date_in":"2016-01-29T14:55:22.000Z",
         "date_move":"2016-02-01T10:46:30.000Z",
         "known":true,
         "scratch": true,
         "write_protect": false
      }
   ],
   "status":"OK"
}

HTTP Request

GET http://example.com/api/backend/media

Request response

Key name Type Description
barcode String Media barcode.
location String Media location. Possible values:
  • Slot X : located in the library storage slot,
  • Drive X: location in a tape drive,
  • Imp X: located in the library I/O station in Import mode,
  • Exp X: located in the library I/O station in Export mode,
  • Out: Exported from the library.
X = number of the type location. Start to 0.
mounted Boolean
  • false : not mounted,
  • true : mounted in a tape drive.
ejected Boolean
  • false : media in library,
  • true : out the library.
total Number Total size in byte.
free Number Free size in byte.
date_in String Insert date of the media in the appliance configuration.
date_move String Date of the last move.
known Boolean
  • false : The appliance don’t know this media,
  • true : the media is known.
write_protect Boolean
  • false : The appliance is able to write on the media,
  • true : The appliance is unable to write on the media.
library JSON Some information about the library of the media.
id Number Library id.
name String Library name.
serial String Library serial number.
pool JSON Information about the pool containing the media.
id Number Pool id.
name String Pool name.
type Number Pool type :
  • 0 : Storage pool,
  • 1 : Export pool,
  • 2 : Import pool,
  • 3 : Scratch pool

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Get media information

This command allow you to get information of one media.

Example of request:

require 'rest-client'

url = "http://example.com/api/backend/media/MTC500L5"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/backend/media/MTC500L5

The above command returns JSON structured like this:

{  
   "media":[  
      {  
         "id":4,
         "barcode":"MTC500L5",
         "location":"Slot 3",
         "ejected":false,
         "mounted":false,
         "pool":{  
            "id":2,
            "name":"Import",
            "type":2,
            "comment":""
         },
         "library":{  
            "id":2,
            "name":"IBM 3100",
            "serial":"00L2U78AW009_LL0"
         },
         "total":1424997482496,
         "free":1421253017600,
         "date_in":"2015-12-18T14:04:09.000Z",
         "date_move":"2016-01-27T14:42:26.000Z",
         "known": false,
         "scratch": true,
         "write_protect": false
      }
   ],
   "status":"OK"
}

HTTP Request

GET http://example.com/api/backend/media/{media_barcode}

Request response

Key name Type Description
barcode String Media barcode.
location String Media location. Possible values:
  • Slot X : located in the library storage slot,
  • Drive X: location in a tape drive,
  • Imp X: located in the library I/O station in Import mode,
  • Exp X: located in the library I/O station in Export mode,
  • Out: Exported from the library.
X = number of the type location. Start to 0.
mounted Boolean
  • false : not mounted,
  • true : mounted in a tape drive.
ejected Boolean
  • false : media in library,
  • true : out the library.
total Number Total size in byte.
free Number Free size in byte.
date_in String Insert date of the media in the appliance configuration.
date_move String Date of the last move.
known Boolean
  • false : The appliance don’t know this media,
  • true : the media is known.
write_protect Boolean
  • false : The appliance is able to write on the media,
  • true : The appliance is unable to write on the media.
library JSON Some information about the library of the media.
id Number Library id.
name String Library name.
serial String Library serial number.
pool JSON Information about the pool containing the media.
id Number Pool id.
name String Pool name.
type Number Pool type :
  • 0 : Storage pool,
  • 1 : Export pool,
  • 2 : Import pool,
  • 3 : Scratch pool

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Format a media

This command allow you to erase and format a media content

Request format for the media MTC513L5 located on library C60C825138DB4378B3870030

require 'rest-client'

url = "http://example.com/api/backend/library/C60C825138DB4378B3870030/format/MTC513L5"
response = RestClient::Request.execute( method: :post, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X POST 
http://[username]:[password]@example.com/api/backend/library/C60C825138DB4378B3870030/format/MTC513L5

The above command returns JSON structured like this:

{  
   "message": "Format MTC513L5 will be performed.",
   "status": "OK"
}

HTTP Request

POST http://example.com/api/backend/library/{library_serial}/format/{media_barcode}

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Scratch and format media

This command allow you to erase, format and add to scratch pool a media

Request format for the media MTC513L5 located on library C60C825138DB4378B3870030

require 'rest-client'

url = "http://example.com/api/backend/library/C60C825138DB4378B3870030/scratch/MTC513L5"
response = RestClient::Request.execute( method: :post, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X POST 
http://[username]:[password]@example.com/api/backend/library/C60C825138DB4378B3870030/scratch/MTC513L5

The above command returns JSON structured like this:

{  
   "message": "Format MTC513L5 will be performed.",
   "status": "OK"
}

HTTP Request

POST http://example.com/api/backend/library/{library_serial}/scratch/{media_barcode}

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Scratch media

This command allow you to add to scratch pool a media

Request scratch for the media MTC513L5 located on library C60C825138DB4378B3870030

require 'rest-client'

url = "http://example.com/api/backend/library/C60C825138DB4378B3870030/scratch/MTC513L5"
response = RestClient::Request.execute( method: :put, 
                              url: url, 
                              user: [username],
                              password: [password])
curl -X PUT 
http://[username]:[password]@example.com/api/backend/library/C60C825138DB4378B3870030/scratch/MTC513L5

The above command returns JSON structured like this:

{  
   "message": "Scratch performed.",
   "status": "OK"
}

HTTP Request

PUT http://example.com/api/backend/library/{library_serial}/scratch/{media_barcode}

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Cache

List all available drives

This command allows you to list all the drives that can be used for the cache.

Example of request:

require 'rest-client'

url = "http://example.com/api/system/cache/configuration"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/system/cache/configuration

The above command returns JSON structured like this:

{
  "drives": [
    {
       "id": "sdb",
       "name": "DELL H710P",
       "capacity": 322122547200,
       "ready": 1,
       "configured": 1,
       "in_progress" : 0
    },
    {
       "id": "sdc",
       "name": "DELL H710P",
       "capacity": 322122547200,
       "ready": 1,
       "configured": 0,
       "in_progress" : 0
    }
  ],
  "status": "OK",
  "code": 200
}

HTTP Request

GET http://example.com/api/system/cache/configuration

Request response

Key name Type Description
id String Drive identifier on the system (sdb, hda, …).
name String Drive model name.
capacity Number Total storage capacity.
ready Number Physically accessible and recognized filesystem. Values:
  • 1: Ready,
  • 0: Not accessible, unrecognized or errors.
configured Number
  • 1: Used as cache,
  • 0: Not used as cache.
in_progress Number
  • 1: Operation in progress,
  • 0: No operations in progress.

Error response

Key name Type Description
message String Describes the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

List partitions of a drive

This command allows you to get detailed information about the existing partitions of a drive (the drive must be accessible)

Example of request:

require 'rest-client'

url = "http://example.com/api/system/cache/drive_partitions/sdb"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/system/cache/drive_partitions/sdb

The above command returns JSON structured like this:

{  
   "partitions": [
      {  
         "id":"sdb1",
         "type":"ext4",
         "capacity": 316932096000,
         "volume_used": 1736708096,
         "volume_free": 299089367040,
         "volume_used_percent": 0.005479748242349048,
         "configured":1
      }
  ],
  "status": "OK",
  "code": 200
}

HTTP Request

GET http://example.com/api/system/drive_partitions/{id}

Request response

Key name Type Description
id String Drive partition identifier on the system (sdb1, sdb2, sdc1, …).
type String Type of the filesystem (ext3, ext4, …).
capacity number Total storage capacity.
volume_used number Used disk space (size, in bytes).
volume_free number Available disk space (size, in bytes).
volume_used_percent number Used disk space (percentage of the capacity, from 0 to 1).
configured Number
  • 1: Used as cache,
  • 0: Not used as cache.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Change configuration of cache drives

This command allows you to configure the cache (choose cache drive, initialize drive, …)

Example of request:

require 'rest-client'

#JSON describing the task
task_json = {  
   "action"=>1
}

url = "http://example.com/api/system/cache/configuration/sdb"
response = RestClient::Request.execute( method: :put, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: task_json)
curl -X PUT 
    -d '{  
       "cache":{
          "action":1
       }
    }'
   http://[username]:[password]@example.com/api/system/cache/configuration/sdb

The above command returns JSON structured like this:

{  
  "message": "Drive sdb configured.",
  "status": "OK",
  "code": 200
}

HTTP Request

PUT http://example.com/api/system/cache_configuration/{id}

Request parameters

Key name Type Description
id String Drive identifier on the system (sdb, hda, sdc, …).
action Number
  • 1: Initialize a drive that’s not ready (Formating drives ! ALL Data will be lost on the drive !!!!!),
  • 2: Use a drive as the cache drive (the drive must be ready).

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Pools of tapes

Types definition

Tape pool definition

Key name Type Description
id Number
name String
type Pool type

Pool type definition

Id Description
0 Online storage
1 Offline archive
2 Data exchange
3 Scratch
4 Migration

List pools

This command allow you to list all the pools on the system.

Example of request:

require 'rest-client'

url = "http://example.com/api/backend/pools"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/backend/pools

The above command returns JSON structured like this:

{  
   "pools":[  
      {  
         "id":3,
         "name":"Scratch pool",
         "type":3,
         "library":"",
         "comment":"",
         "media":[  
            {  
               "barcode":"DEV001L5",
               "id":9,
               "location":"Imp 1",
               "total":0,
               "free":0,
               "library":{  
                  "id":3,
                  "name":"DEV",
                  "serial":"C60C82510020_LL3"
               }
            }
         ],
         "used":false,
         "default":false
      },
      {  
         "id":9,
         "name":"Storage Pool 1",
         "type":0,
         "library":"DEV",
         "comment":"",
         "media":[  
            {  
               "barcode":"DEV002L5",
               "id":5,
               "location":"Drive 0",
               "total":1518606483456,
               "free":1518605434880,
               "library":{  
                  "id":3,
                  "name":"DEV",
                  "serial":"C60C82510020_LL3"
               }
            }
         ],
         "used":true,
         "default":true
      },
   ],
   "status":"OK",
   "message":"2 pools found.",
   "code":200
}

HTTP Request

GET http://example.com/api/backend/pools

Request response

An array of JSON representing all the pools.

Key name Type Description
id Number Pool id.
name String Pool name.
comment String User comment.
type Number Pool type :
  • -1 : Unknown tapes,
  • 0 : Storage,
  • 1 : Offline archive,
  • 2 : Exchange,
  • 3 : Scratch,
  • 4 : Data Migration.
library String Library name of the pool. Empty for scratch pool.
used Boolean
  • true : used by a task,
  • false : not configured to a task.
default Boolean
  • true : default pool,
  • false : normal pool.
Only available for storage pool.
media Array List of all media incuded.
barcode String Media barcode.
id Number Media id.
location String Media location. Possible values:
  • Slot X : located in the library storage slot,
  • Drive X: location in a tape drive,
  • Imp X: located in the library I/O station in Import mode,
  • Exp X: located in the library I/O station in Export mode,
  • Out: Exported from the library.
X = number of the type location. Start to 0.
total Number Total size in byte.
free Number Free size in byte.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Add a pool

This command allow you to create a new pools

Adding a pool

require 'rest-client'

#JSON describing the new pool
pool_json = {
        "pools" => {  
          "name" => "myPool",
          "comment" => "new test pool",
          "library" => "00L2U78AW009_LL0",
          "default" => false,
          "type" => 0,
          "media" => [  
             "MTC500L5",
             "MTC501L5"
          ]
        }
    }

url = "http://example.com/api/backend/pools"
response = RestClient::Request.execute( method: :post, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: pool_json)
curl -H "Content-Type: application/json" 
     -X POST 
     -d '{
            "pools":{  
              "name":"myPool",
              "comment":"user comment",
              "library":"00L2U78AW009_LL0",
              "default":false,
              "type":"0",
              "media":[  
                 "MTC500L5",
                 "MTC501L5"
              ]
           }
        }' 
    http://[username]:[password]@example.com/api/backend/pools

The above command returns JSON structured like this:

{  
   "message": "Pool myPool created",
   "status": "OK"
}

HTTP Request

POST http://example.com/api/backend/pools

Request parameter

Key name Type Description
id Number Pool id.
name String Pool name with non-accented letters, digits, dashes, underscores (A-Z, a-z, 0-9, -, _).
comment String User comment.
type Number Pool type :
  • -1 : Unknown tapes,
  • 0 : Storage,
  • 1 : Offline archive,
  • 2 : Exchange,
  • 3 : Scratch (only one scratch pool can be created),
  • 4 : Data Migration.
default Boolean
  • true : default pool,
  • false : normal pool.
Only available for storage pool.
media String Array Array of existing media barcode to include in the new pool.

Request response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Update a pool

This command allow you to update pool information

udpate a pool

require 'rest-client'

#JSON describing the new pool
pool_json = {
        "pools" => {  
          "name" => "myPool",
          "comment" => "new test pool",
          "library" => "00L2U78AW009_LL0",
          "default" => false,
          "type" => 0,
          "media" => [  
             "MTC500L5",
             "MTC501L5"
          ]
        }
    }

url = "http://example.com/api/backend/pools/myPool"
response = RestClient::Request.execute( method: :put, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: pool_json)
curl -H "Content-Type: application/json" 
     -X PUT 
     -d '{
            "pools":{  
              "name":"myPool",
              "comment":"user comment",
              "library":"00L2U78AW009_LL0",
              "default":false,
              "type":"0",
              "media":[  
                 "MTC500L5",
                 "MTC501L5"
              ]
           }
        }' 
    http://[username]:[password]@example.com/api/backend/pools/myPool

The above command returns JSON structured like this:

{  
   "message": "Pool myPool updated",
   "status": "OK"
}

HTTP Request

PUT http://example.com/api/backend/pools/{pool_name}

Request parameter

Key name Type Description
id Number Pool id.
name String Pool name.
comment String User comment.
type Number Pool type :
  • -1 : Unknown tapes,
  • 0 : Storage,
  • 1 : Offline archive,
  • 2 : Exchange,
  • 3 : Scratch,
  • 4 : Data Migration.
default Boolean
  • true : default pool,
  • false : normal pool.
Only available for storage pool.
media String Array Array of existing media barcode to include in the new pool.

Request response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Delete a configured pool

This command allow you to delete pool

Delete pool “myPool”:

require 'rest-client'

url = "http://example.com/api/backend/pools/myPool"
response = RestClient::Request.execute( method: :delete, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X DELETE 
http://[username]:[password]@example.com/api/backend/pools/myPool

The above command returns JSON structured like this:

{  
   "message": "Pool myPool deleted",
   "status": "OK"
}

HTTP Request

DELETE http://example.com/api/backend/pools/{pool_name}

Request response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Pools of buckets

Types definition

Cloud pool definition

Key name Type Description
id Number
name String
type Pool type

List pools

This command allow you to list all the pools on the system.

Example of request:

require 'rest-client'

url = "http://example.com/api/backend/clouds/pools"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/backend/clouds/pools

The above command returns JSON structured like this:

{  
    "pools": [
        {
            "id": 2,
            "name": "T_on_pool1",
            "comment": "",
            "type": 0,
            "buckets": [
                {
                    "id": 2,
                    "name": "bucket1.test.local",
                    "files_count": 4397,
                    "files_size": 1244035714,
                    "location": "eu-local-1",
                    "cloud": {
                        "id": 1,
                        "name": "T_provider",
                        "provider": 1,
                        "region": "eu-local-1"
                    }
                }
            ]
        },
        {
            "id": 9,
            "name": "T_on_empty",
            "comment": null,
            "type": 0,
            "buckets": []
        }
   ],
   "status":"OK",
   "message":"2 pools found.",
   "code":200
}

HTTP Request

GET http://example.com/api/backend/clouds/pools

Request response

An array of JSON representing all the pools.

Key name Type Description
id Number Pool id.
name String Pool name.
comment String User comment.
type Number Pool type :
  • 0 : Storage,
  • 1 : Offline archive
buckets Array of Objects Array of Cloud Bucket objects

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Add a pool

This command allow you to create a new pools

Adding a pool

require 'rest-client'

#JSON describing the new pool
pool_json = {
        "pool" => {  
          "name" => "myPool",
          "type" => 0,
          "buckets" => [  
             "28"
          ]
        }
    }

url = "http://example.com/api/backend/clouds/pools"
response = RestClient::Request.execute( method: :post, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: pool_json)
curl -H "Content-Type: application/json" 
     -X POST 
     -d '{
            "pool":{  
              "name":"myPool",
              "comment":"user comment",
              "type":"0",
              "buckets":[  
                 "28"
              ]
           }
        }' 
    http://[username]:[password]@example.com/api/backend/clouds/pools

The above command returns JSON structured like this:

{
    "status":"SUCCESS",
    "code":200,
    "pool":{
        "id":24,
        "name":"myPool",
        "comment":"user comment",
        "type":0
    }
}

HTTP Request

POST http://example.com/api/backend/clouds/pools

Request parameter

Key name Type Description
id Number Pool id.
name String Pool name with non-accented letters, digits, dashes, underscores (A-Z, a-z, 0-9, -, _).
comment String User comment.
type Number Pool type :
  • 0 : Storage,
  • 1 : Offline archive
buckets Number Array Array of existing buckets ID to include in the new pool.

Request response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Update a pool

This command allow you to update pool information

udpate a pool

require 'rest-client'

#JSON describing the new pool
pool_json = {
        "pool" => {  
          "name" => "myPool",
          "type" => 0,
          "buckets" => [  
             "28"
          ]
        }
    }

url = "http://example.com/api/backend/clouds/pools/myPool"
response = RestClient::Request.execute( method: :put, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: pool_json)
curl -H "Content-Type: application/json" 
     -X PUT 
     -d '{
            "pool":{  
              "name":"myPool",
              "comment":"user comment",
              "type":"0",
              "buckets":[  
                 "28"
              ]
           }
        }' 
    http://[username]:[password]@example.com/api/backend/clouds/pools/myPool

The above command returns JSON structured like this:

{  
   "message": "Pool myPool updated",
   "status": "OK"
}

HTTP Request

PUT http://example.com/api/backend/clouds/pools/{pool_name}

Request parameter

Key name Type Description
id Number Pool id.
name String Pool name with non-accented letters, digits, dashes, underscores (A-Z, a-z, 0-9, -, _).
comment String User comment.
type Number Pool type :
  • 0 : Storage,
  • 1 : Offline archive
buckets Number Array Array of existing buckets ID to include in the new pool.

Request response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Delete a configured pool

This command allow you to delete pool

Delete pool “myPool”:

require 'rest-client'

url = "http://example.com/api/backend/clouds/pools/myPool"
response = RestClient::Request.execute( method: :delete, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X DELETE 
http://[username]:[password]@example.com/api/backend/clouds/pools/myPool

The above command returns JSON structured like this:

{  
   "message": "Pool myPool deleted",
   "status": "OK"
}

HTTP Request

DELETE http://example.com/api/backend/clouds/pools/{pool_name}

Request response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Files

Types definition

File definition

Key name Type Description
id Number
name String
type String ‘share’, 'folder’ or 'file’
path String Full path
extern Boolean Whether file is on mount point
share Number Share id
in_cache Number
was_modified Number
offline Number

List Shared Folders and Mount Points

This command allow you to retrieve information of the shared folders and mount points

Example of request:

require 'rest-client'

url = "http://example.com/api/frontend/folder_content"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/frontend/folder_content

The above command returns JSON structured like this:

{  
   "files":[  
      {  
         "id":3,
         "name":"Share01",
         "offline":0,
         "extern":0,
         "type":"share",
         "parent":"#",
         "size":502043648
      },
      {  
         "id":4,
         "name":"Mounted_Extern_Folder01",
         "offline":0,
         "extern":0,
         "type":"mount",
         "parent":"#",
         "size":51232
      }
   ],
   "status":"OK",
   "code":200
}

HTTP Request

GET http://example.com/api/frontend/folder_content

Request response

Descriptor of the shared folder or mount point

Key name Type Description
id Number Folder id.
name String Folder name.
offline number
  • 0 : Accessible,
  • 1 : Exported. Out aplliance,
  • 2 : Import mode. Not visible in filesystem yet.
extern number
  • 0 : Folder on filesystem,
  • 1 : Folder on Mount Point
type String Possible values:
  • share,
  • mount.
parent String parent ID (# if parent_id is not defined).
size Number File size in byte.

Request response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

List files

This command allow you to get a list of all the files in a given container (Share, Mount Point or Folder).

List all the files and folders within the parent having ID 15:

require 'rest-client'

url = "http://example.com/api/frontend/folder_content/15"
response = RestClient::Request.execute( method: :get, 
                              url: url, 
                              user: [username],
                              password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/frontend/folder_content/15

The above command returns JSON structured like this:

{  
   "files":[  
      {  
         "id":1554,
         "name":"File01.pdf",
         "offline":0,
         "extern":0,
         "type":"file",
         "parent":"15",
         "size":502043648
      },
      {  
         "id":1548,
         "name":"File02.docx",
         "offline":0,
         "extern":0,
         "type":"file",
         "parent":"15",
         "size":45451545
      }
   ],
   "status":"OK",
   "code":200
}

HTTP Request

GET http://example.com/api/frontend/folder_content/{parent_id}

Request response

Descriptor of the folder content

Key name Type Description
id Number File id.
name String File name.
offline number
  • 0 : Accessible,
  • 1 : Exported. Out aplliance,
  • 2 : Import mode. Not visible in filesystem yet.
extern number
  • 0 : File on filesystem,
  • 1 : File on Mount Point
type String Possible values:
  • file,
  • folder.
parent String parent ID.
size Number File/folder size in byte.

Request response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

List file details

This command allow you to get a list of all the metadata configured on a file.

List all the metadata configured for file with ID 604208:

require 'rest-client'

url = "http://example.com/api/frontend/files/604208"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/frontend/files/604208

The above command returns JSON structured like this:

{  
   "file":{  
      "id":604208,
      "name":"ls",
      "parent_id":9900,
      "share_id":9900,
      "type":1,
      "size":517817,
      "creation_date":"2016-08-30T08:49:13.000Z",
      "modification_date":"2016-08-30T08:49:13.000Z",
      "access_date":"2016-08-30T09:51:07.000Z",
      "in_cache":1,
      "offline":0,
      "extern":0
   },
   "status":"OK",
   "code":200
}
{  
   "file":{  
      "id":604212,
      "name":"test",
      "parent_id":9900,
      "share_id":9900,
      "type":1,
      "size":1280,
      "creation_date":"2016-09-30T08:40:10.000Z",
      "modification_date":"2016-09-30T08:40:10.000Z",
      "access_date":"2016-09-30T09:20:00.000Z",
      "in_cache":1,
      "offline":0,
      "extern":0,
      "custom_fields":{
         "my_field1":"my_value",
         "my_check":"check1",
         "my_multicheck":"check1#check2"
      }
   },
   "status":"OK",
   "code":200
}

HTTP Request

GET http://example.com/api/frontend/files/{file_id}

Request response

Descriptor of the shared folder

Key name Type Description
id Number File id.
name String File name.
offline number
  • 0 : Accessible,
  • 1 : Exported. Out aplliance,
  • 2 : Import mode. Not visible in filesystem yet.
extern number
  • 0 : File on filesystem,
  • 1 : File on Mount Point
type String Possible values:
  • file,
  • folder.
parent String parent ID.
size Number File/folder size in byte.
share_id Number Id of parent share.
creation_date Date Creation date.
modification_date Date Modification date.
access_date Date Access date.
custom_fields Date Contains custom defined metadata. This key won’t appear at all if there’s no custom metadata.

Request response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

List extern files

This command return the extern files by level. The command without “extern_path” will return the mount points folders.

List all the files and foler in extern path “/Mounted_Extern_Folder01/Folder02” :

require 'rest-client'

url = "http://example.com/api/frontend/files_extern_new?path=/nfs1/reloadc"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/frontend/files_extern_new?path=/nfs1/reloadc

The above command returns JSON structured like this:

{
  "code": 200,
  "files": [
    {
      "size": 2048,
      "offline": 0,
      "type": "folder",
      "name": "data_gen2",
      "id": "\/nfs1\/reloadc\/data_gen2",
      "parent": "\/nfs1\/reloadc",
      "extern": 1
    },
    {
      "size": 2048,
      "offline": 0,
      "type": "folder",
      "name": "data_gen1",
      "id": "\/nfs1\/reloadc\/data_gen1",
      "parent": "\/nfs1\/reloadc",
      "extern": 1
    }
  ],
  "status": "OK"
}

HTTP Request

GET http://example.com/api/frontend/files_extern_new?path={path}

Request response

Descriptor of the shared folder

Key name Type Description
id String Full path of the file.
name String File name.
offline number
  • 0 : Accessible,
  • 1 : Exported. Out aplliance,
  • 2 : Import mode. Not visible in filesystem yet.
extern number
  • 0 : File on filesystem,
  • 1 : File on Mount Point
type String Possible values:
  • file,
  • folder.
parent String parent ID.
size Number File/folder size in byte.
parent String Full path of the parent folder.

Request response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Business File Metadata

List Business File Metadata fields

This command allow you to retrieve all configured Business File Metadata fields

Example of request:

require 'rest-client'

url = "http://example.com/api/tasks_configuration/business_files_metadata"
response = RestClient::Request.execute( method: :get, 
                              url: url, 
                              user: [username],
                              password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/tasks_configuration/business_files_metadata

The above command returns JSON structured like this:

{  
   "business_files_metadata":[  
      {  
         "name":"checkboxMandatory",
         "key":"checkboxMandatory",
         "mandatory":1,
         "type_of_field":2,
         "comment":"",
         "type_value":[  
            "test1",
            " test2",
            " test3"
         ]
      },
      {  
         "name":"mandatory",
         "key":"mandatory",
         "mandatory":1,
         "type_of_field":0,
         "comment":""
      },
      {  
         "name":"radioMandatory",
         "key":"radioMandatory",
         "mandatory":1,
         "type_of_field":3,
         "comment":"",
         "type_value":[  
            "bleh",
            " blah",
            " beh"
         ]
      }
   ],
   "status":"OK",
   "code":200
}

HTTP Request

GET http://example.com/api/tasks_configuration/business_files_metadata

Request response

Descriptor of the Business File Metadata field

Key name Type Description
name String Custom field name.
key String Key value of the custom field.
mandatory Boolean Set mandatory fields
type_of_fields Number Field type:
  • 0 : Characters,
  • 1 : Characters multi line,
  • 2: Checkbox,
  • 3: Radio.
type_value Array List of predifined values (in case of checkbox or radio buttons).

Request response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Add a Business File Metadata field

This command allow you to create a new Business File Metadata field

Adding a Business File Metadata field

require 'rest-client'

#JSON describing the new custom field
v_json = {
   "custom_fields" => {  
      "name" => "checkboxMandatory",
      "key" => "checkboxMandatory",
      "mandatory" => 1,
      "type_of_field" => 2,
      "comment" => "",
      "type_value" => [  
         "test1",
         " test2",
         " test3"
      ]
   }
}

url = "http://example.com/api/tasks_configuration/business_files_metadata"
response = RestClient::Request.execute( method: :post, 
                              url: url, 
                              user: [username],
                              password: [password],
                              payload: v_json)
curl -H "Content-Type: application/json" 
    -X POST 
    -d '{
         "custom_fields":{  
            "name":"checkboxMandatory",
            "key":"checkboxMandatory",
            "mandatory":1,
            "type_of_field":2,
            "comment":"",
            "type_value":[  
               "test1",
               " test2",
               " test3"
            ]
         }
      }' 
   http://[username]:[password]@example.com/api/tasks_configuration/business_files_metadata

HTTP Request

POST http://example.com/api/tasks_configuration/business_files_metadata

Request parameter

Key name Type Description
name String Custom field name.
key String Key value of the custom field.
mandatory Boolean Set mandatory fields
type_of_fields Number Field type:
  • 0 : Characters,
  • 1 : Characters multi line,
  • 2: Checkbox,
  • 3: Radio.
type_value Array List of predifined values in case of checkbox or radio buttons.

Request response

Key name Type Description
message String Describe the result of the operation.
status String OK if everything goes well. ERROR if the operation failed.

Update a Business File Metadata field

This command allow you to update an existing Business File Metadata field

Update a Business File Metadata field with name = “cf1”:

require 'rest-client'

#JSON describing the new Business File Metadata field
v_json = {
   "custom_fields" => {  
      "name" => "checkboxMandatory",
      "key" => "checkboxMandatory",
      "mandatory" => 1,
      "type_of_field" => 2,
      "comment" => "",
      "type_value" => [  
         "test1",
         " test2",
         " test3"
      ]
   }
}

url = "http://example.com/api/tasks_configuration/business_files_metadata/cf1"
response = RestClient::Request.execute( method: :put, 
                              url: url, 
                              user: [username],
                              password: [password],
                              payload: v_json)
curl -H "Content-Type: application/json" 
    -X PUT 
    -d '{
         "custom_fields":{  
            "name":"checkboxMandatory",
            "key":"checkboxMandatory",
            "mandatory":1,
            "type_of_field":2,
            "comment":"",
            "type_value":[  
               "test1",
               " test2",
               " test3"
            ]
         }
      }' 
   http://[username]:[password]@example.com/api/tasks_configuration/business_files_metadata/cf1

HTTP Request

PUT http://example.com/api/tasks_configuration/business_files_metadata/{name}

Request parameter

Key name Type Description
name String Custom field name.
key String Key value of the custom field.
mandatory Boolean Set mandatory fields
type_of_fields Number Field type:
  • 0 : Characters,
  • 1 : Characters multi line,
  • 2: Checkbox,
  • 3: Radio.
type_value Array List of predifined values in case of checkbox or radio buttons.

Request response

Key name Type Description
message String Describe the result of the operation.
status String OK if everything goes well. ERROR if the operation failed.

Delete a Business File Metadata field

This command allow you to delete an existing Business File Metadata field

Delete Business File Metadata field with name = “cf1”:

require 'rest-client'

url = "http://example.com/api/tasks_configuration/business_files_metadata/cf1"
response = RestClient::Request.execute( method: :delete4, 
                              url: url, 
                              user: [username],
                              password: [password])
curl -X DELETE 
http://[username]:[password]@example.com/api/tasks_configuration/business_files_metadata/cf1

HTTP Request

DELETE http://example.com/api/tasks_configuration/business_files_metadata/{name}

Request response

Key name Type Description
message String Describe the result of the operation.
status String OK if everything goes well. ERROR if the operation failed.

Tasks

List all tasks

This command allow you to list all the tasks on the system.

Example of request:

require 'rest-client'

url = "http://example.com/api/tasks"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/tasks

The above command returns JSON structured like this:

{  
   "tasks":[
      {  
         "id":20,
         "activate":1,
         "status_code":1,
         "priority":7,
         "name":"Task Repo2",
         "type":2,
         "creation_date":"2016/01/25 - 10:32:50:000000 UTC+0000",
         "creation_username":"admin",
         "modification_date":"2016/01/25 - 10:32:50:000000 UTC+0000",
         "modification_username":"admin",
         "last_check":"never",
         "job_started":"2016/01/25 - 10:32:51:000000 UTC+0000",
         "job_finished":"never",
         "comment":"Move share Repo2 to storage pool 'Pool1'",
         "processed_size":0,
         "total_size":6291456000,
         "progress":0,
         "drives_current_action":[
             {
                 "serial":"HUJ5515C2R",
                 "current_action":"Unload Tape",
                 "bandwidth":0
             }
         ],
         "schedule":{
             "type":0,
             "frequency":7,
             "start_hour":"12:41:00",
             "end_hour":"00:00:00",
             "dmonth":1,
             "dweek":1,
             "month":1,
             "year":1,
             "mode":0,
             "windowed":0,
             "date":"2016/06/02"
         }
      }
    ],
   "status":"OK"
}

HTTP Request

GET http://example.com/api/tasks (Deprecated)

Request response

Array of all the tasks on the system.

Key name Type Description
id Number Task id number.
name String Task name set by user.
activate Bool Scheduling activation. Values:
  • 1 : scheduling enabled,
  • 0 : scheduling disabled.
status_code Number Task current status:
  • 0 : Wait for execution,
  • 1 : Finish with success,
  • 2 : Running,
  • 3 : Error,
  • 4 : not implemented yet,
  • 5 : Paused by user,
  • 6 : Stopped by user,
  • 7 : In queue. The task wait a resource,
  • 8 : Finish with errors,
  • 9 : Calculating data to process.
priority Number Priority level of the task. from 0 (highest priority) to 12 (lowest priority).
type Number Define the task type:
  • 0 : COPY to online storage,
  • 1 : IMPORT online storage data,
  • 2 : MOVE to online storage,
  • 3 : REHYDRATION,
  • 4 : not implemented yet,
  • 5 : Format/Scratch tape,
  • 6 : not implemented yet,
  • 7 : GET data event,
  • 8 : PUSH data event,
  • 9 : CACHE cleaning,
  • 10 : CACHE cleaning for a share,
  • 11 : MOVE to offline archive by date (deprecated, use options),
  • 12 : MOVE to offline archive,
  • 13 : COPY to offline archive by date (deprecated, use options),
  • 14 : COPY to offline archive,
  • 15 : MOVE data exchange,
  • 16 : COPY data exchange,
  • 17 : IMPORT offline archiving data,
  • 18 : IMPORT data exchange data,
  • 19 : SCAN a data exchange tape,
  • 20 : Data migration type 2 Storage to Storage,
  • 21 : Data migration type 3 New LTFS to Storage,
  • 22 : Data migration type 4 New LTFS to new LTFS,
  • 23 : Data migration type 5 New LTFS to Offline archiving.
  • 24 : Reload COPY.
  • 25 : Reload MOVE.
  • 26 : COPY to cloud Online.
  • 27 : MOVE to cloud Online.
  • 28 : COPY from cloud Online.
  • 29 : COPY to cloud Offline.
  • 30 : MOVE to cloud Offline.
  • 31 : COPY from cloud Offline.
creation_date Date Creation date of the task.
creation_username String Username of the creator of the task.
modification_date Date Last modification date of the task.
modification_username String Username of the last user that edited the task.
last_check String Date of the last check on the task.
job_started String Last time the task started.
job_finished String Last time the task finished.
comment String User comment.
processed_size Number Current processed size if the task is running in byte.
total_size Number Total size to process in byte.
progress Number Current progress (in %) if the task is running.
drives_current_action Array If the rule task is running, contain the state of the current drives handling the task.
serial String Drive serial.
current_action String Drive current action:
  • Idle,
  • Reading,
  • Umounting LTFS FileSystem,
  • Dismounting Tape,
  • Mounting Tape,
  • Mounting LTFS FileSystem,
  • Writing,
  • Formatting LTFS FileSystem.
bandwidth Number Drive current write/read bandwidth.
schedule JSON Schedule configuration. Empty if no schedule configured.
frequency Number
  • 0: Periodically. Need start_hour,
  • 1: Daily. Need start_hour,
  • 2: Weekly. Need start_hour and days,
  • 3: not implemented,
  • 4: monthly “pick a day”. Need start_hour and days,
  • 5: monthly “X day week”. Need start_hour, mode and day,
  • 6: monthly “last day of the month”. Need start_hour,
  • 7: Once. Need start_hour and date.
start_hour String If the frequency is 0 (periodically), the value is a period in minutes (ex: “00:10” = every 10 minutes) or in hour (ex: “02:00” = every 2 hours). For the others, the value is the time (ex: “12:12” = the task start after 12h12).
dweek Number Day of the week.
dmonth Number Day of the month.
mode Number Only available for frequency 5 (monthly “X day week”).
  • 0 : first day week of the month,
  • 1 : second day week of the month,
  • 2 : third day week of the month,
  • 3 : fourth day week of the month,
  • 4 : last day week of the month.
date String Full date string (format yyyy/mm/dd). Only available for frequency 7 (Once).
source_pool Number ID of source pool (import tasks only).
import_default_action Number Type of action if file name already exists (import tasks only) :
  • 0 : new name,
  • 1 : overwrite existing file,
  • 2 : ignore

Request response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Get a task

This command allow you to get one task by its id.

Example of request:

require 'rest-client'

url = "http://example.com/api/task/10"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/task/10

The above command returns JSON structured like this:

{  
   "tasks":[
      {  
         "id":20,
         "activate":1,
         "status_code":1,
         "priority":7,
         "name":"Task Repo2",
         "type":2,
         "creation_date":"2016/01/25 - 10:32:50:000000 UTC+0000",
         "creation_username":"admin",
         "modification_date":"2016/01/25 - 10:32:50:000000 UTC+0000",
         "modification_username":"admin",
         "last_check":"never",
         "job_started":"2016/01/25 - 10:32:51:000000 UTC+0000",
         "job_finished":"never",
         "comment":"Move share Repo2 to storage pool 'Pool1'",
         "processed_size":0,
         "total_size":6291456000,
         "progress":0,
         "media":[
             {
                 "id":"15",
                 "name":"my_file",
                 "size":282564403,
                 "type":"share",
                 "path":"/my_file",
                 "extern":0
             }
         ],
         "destination":[
             {
                 "id":"25",
                 "name":"Migration_Stor_01092016_122448",
                 "comment":"Storage Pool for Migration",
                 "type":"pool"
             }
         ],
         "options":[
             {
                 "type":"0",
                 "value":"*.store"
             }
         ],
         "drives_current_action":[
             {
                 "serial":"HUJ5515C2R",
                 "current_action":"Unload Tape",
                 "bandwidth":0
             }
         ],
         "schedule":{
             "type":0,
             "frequency":7,
             "start_hour":"12:41:00",
             "end_hour":"00:00:00",
             "dmonth":1,
             "dweek":1,
             "month":1,
             "year":1,
             "mode":0,
             "windowed":0,
             "date":"2016/06/02"
         }
      }
    ],
   "status":"OK"
}

HTTP Request

GET http://example.com/api/task/{id} (Deprecated)

Request response

Array of all the tasks on the system.

Key name Type Description
id Number Task id number.
name String Task name set by user.
activate Bool Scheduling activation. Values:
  • 1 : scheduling enabled,
  • 0 : scheduling disabled.
status_code Number Task current status:
  • 0 : Wait for execution,
  • 1 : Finish with success,
  • 2 : Running,
  • 3 : Error,
  • 4 : not implemented yet,
  • 5 : Paused by user,
  • 6 : Stopped by user,
  • 7 : In queue. The task wait a resource,
  • 8 : Finish with errors,
  • 9 : Calculating data to process.
priority Number Priority level of the task. from 0 (highest priority) to 12 (lowest priority).
type Number Define the task type:
  • 0 : COPY to online storage,
  • 1 : IMPORT online storage data,
  • 2 : MOVE to online storage,
  • 3 : REHYDRATION,
  • 4 : not implemented yet,
  • 5 : Format/Scratch tape,
  • 6 : not implemented yet,
  • 7 : GET data event,
  • 8 : PUSH data event,
  • 9 : CACHE cleaning,
  • 10 : CACHE cleaning for a share,
  • 11 : MOVE to offline archive by date (deprecated, use options),
  • 12 : MOVE to offline archive,
  • 13 : COPY to offline archive by date (deprecated, use options),
  • 14 : COPY to offline archive,
  • 15 : MOVE data exchange,
  • 16 : COPY data exchange,
  • 17 : IMPORT offline archiving data,
  • 18 : IMPORT data exchange data,
  • 19 : SCAN a data exchange tape,
  • 20 : Data migration type 2 Storage to Storage,
  • 21 : Data migration type 3 New LTFS to Storage,
  • 22 : Data migration type 4 New LTFS to new LTFS,
  • 23 : Data migration type 5 New LTFS to Offline archiving.
  • 24 : Reload COPY.
  • 25 : Reload MOVE.
  • 26 : COPY to cloud Online.
  • 27 : MOVE to cloud Online.
  • 28 : COPY from cloud Online.
  • 29 : COPY to cloud Offline.
  • 30 : MOVE to cloud Offline.
  • 31 : COPY from cloud Offline.
creation_date Date Creation date of the task.
creation_username String Username of the creator of the task.
modification_date Date Last modification date of the task.
modification_username String Username of the last user that edited the task.
last_check String Date of the last check on the task.
job_started String Last time the task started.
job_finished String Last time the task finished.
comment String User comment.
processed_size Number Current processed size if the task is running in byte.
total_size Number Total size to process in byte.
progress Number Current progress (in %) if the task is running.
media Array Media elements.
name String Media name.
id Number Media id.
size Number Media size.
type Number Media type.
  • “share” : Root directory,
  • “folder” : Directory,
  • “file” : File media.
Be aware of the task type because they don’t support every media types.
path String Media path if type 0/3.
extern Number Media comes from mount point (1) or local shares (0).
destination Array Destination elements (not for import tasks).
name String Destination name (not for import tasks).
id Number Destination id (not for import tasks).
type String Destination type (not for import tasks).
  • “pool” : Pool
Be aware of the task type because they don’t support every media types.
comment String User comment.
options Array Special settings (filters, …).
type Number Option type:
  • 0 : ignore files/folders by name (filter),
  • 1 : require files/folders by name (filter),
  • 2 : ignore files by name (filter),
  • 3 : require files by name (filter),
  • 4 : older than (date filter)
  • 5 : newer than (date filter)
  • 100 : checksum type {0, 1, 2}
  • 200 : reset file date {0, 1}
  • 201 : reset folder date {0, 1}
  • 202 : rename to {String}
  • 203 : unique rule id {Number}
  • 204 : selected drive {Array of strings}
  • 205 : parallel processing {0, 1}
  • 206 : update permission {0, 1}
  • 207 : update owner {0, 1}
  • 208 : rule id { Number, only if task type : reload}
.
value String Option value:
  • Filters : string value, with * as a wildcard (for example, “*.docx” or “myprefix_*”)
  • Date filters : “YYYY/MM/DD HH:MM”
  • Checksum : “0” (none), “1” (crc), “2” (md5)
drives_current_action Array If the rule task is running, contain the state of the current drives handling the task.
serial String Drive serial.
current_action String Drive current action:
  • Idle,
  • Reading,
  • Umounting LTFS FileSystem,
  • Dismounting Tape,
  • Mounting Tape,
  • Mounting LTFS FileSystem,
  • Writing,
  • Formatting LTFS FileSystem.
bandwidth Number Drive current write/read bandwidth.
schedule JSON Schedule configuration. Empty if no schedule configured.
frequency Number
  • 0: Periodically. Need start_hour,
  • 1: Daily. Need start_hour,
  • 2: Weekly. Need start_hour and days,
  • 3: not implemented,
  • 4: monthly “pick a day”. Need start_hour and days,
  • 5: monthly “X day week”. Need start_hour, mode and day,
  • 6: monthly “last day of the month”. Need start_hour,
  • 7: Once. Need start_hour and date.
start_hour String If the frequency is 0 (periodically), the value is a period in minutes (ex: “00:10” = every 10 minutes) or in hour (ex: “02:00” = every 2 hours). For the others, the value is the time (ex: “12:12” = the task start after 12h12).
dweek Number Day of the week.
dmonth Number Day of the month.
mode Number Only available for frequency 5 (monthly “X day week”).
  • 0 : first day week of the month,
  • 1 : second day week of the month,
  • 2 : third day week of the month,
  • 3 : fourth day week of the month,
  • 4 : last day week of the month.
date String Full date string (format yyyy/mm/dd). Only available for frequency 7 (Once).
source_pool Number ID of source pool (import tasks only: see the “Import Tasks” section).
import_default_action Number Type of action if file name already exists (import tasks only: see the “Import Tasks” section) :
  • 0 : new name,
  • 1 : overwrite existing file,
  • 2 : ignore
import_destination_folder Hash Information about import destination folder (import tasks only: see the “Import Tasks” section).
id Number Import destination folder ID (import tasks only).
extern Number 0 : internal cache/share folder ; 1 : external mount point (import tasks only).
path String Import destination folder path, such as /myFolder/mySubFolder/ (import tasks only).

Request response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Add a task

This command allow you to create a new task

Adding a task

require 'rest-client'

#JSON describing the new task
task_json = {  
   "task"=>{  
      "name"=>"Task 1",
      "comment"=>"",
      "priority"=>7,
      "type"=>0,
      "media"=>[  
         {  
            "id"=>"3",
            "name"=>"share_AP1",
            "path"=>"/share_AP1/",
            "type"=>0
         }
      ],
      "destination"=>[  
         {  
            "id"=>"9",
            "name"=>"Pool Storage 1",
            "path"=>"",
            "type"=>1
         }
      ],
      "options"=>[  
         {  
            "type"=>"0",
            "value"=>"*.tmp"
         }
      ],
      "activate"=>1,
      "schedule"=>{  
         "start_hour"=>"13:0",
         "frequency"=>2,
         "day"=>"3"
      }
   }
}

url = "http://example.com/api/task"
response = RestClient::Request.execute( method: :post, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: task_json)
curl -H "Content-Type: application/json" 
     -X POST 
     -d '{  
   "task":{  
      "name":"Task 1",
      "comment":"",
      "priority":7,
      "type":0,
      "media":[  
         {  
            "id":"3",
            "name":"share_AP1",
            "path":"/share_AP1/",
            "type":0
         }
      ],
      "destination":[  
         {  
            "id":"9",
            "name":"Pool Storage 1",
            "path":"",
            "type":1
         }
      ],
      "options":[  
         {  
            "type":"0",
            "value":"my_*"
         }
      ],
      "activate":1,
      "schedule":{  
         "start_hour":"13:0",
         "frequency":2,
         "day":"3"
      }
   }
}' 
    http://[username]:[password]@example.com/api/task

The above command returns JSON structured like this:

{  
   "message": "Task created",
   "status": "OK"
}

HTTP Request

POST http://example.com/api/task (Deprecated)

Request parameter

Key name Type Description
name String Task name set by user.
comment String User comment.
priority Number Priority level of the task. from 0 (highest priority) to 12 (lowest priority).
type Number Define the task type:
  • 0 : COPY to online storage,
  • 1 : IMPORT online storage data,
  • 2 : MOVE to online storage,
  • 3 : REHYDRATION,
  • 4 : not implemented yet,
  • 5 : Format/Scratch tape,
  • 6 : not implemented yet,
  • 7 : GET data event,
  • 8 : PUSH data event,
  • 9 : CACHE cleaning,
  • 10 : CACHE cleaning for a share,
  • 11 : MOVE to offline archive by date (deprecated, use options),
  • 12 : MOVE to offline archive,
  • 13 : COPY to offline archive by date (deprecated, use options),
  • 14 : COPY to offline archive,
  • 15 : MOVE data exchange,
  • 16 : COPY data exchange,
  • 17 : IMPORT offline archiving data,
  • 18 : IMPORT data exchange data,
  • 19 : SCAN a data exchange tape,
  • 20 : Data migration type 2 Storage to Storage,
  • 21 : Data migration type 3 New LTFS to Storage,
  • 22 : Data migration type 4 New LTFS to new LTFS,
  • 23 : Data migration type 5 New LTFS to Offline archiving.
  • 24 : Reload COPY.
  • 25 : Reload MOVE.
  • 26 : COPY to cloud Online.
  • 27 : MOVE to cloud Online.
  • 28 : COPY from cloud Online.
  • 29 : COPY to cloud Offline.
  • 30 : MOVE to cloud Offline.
  • 31 : COPY from cloud Offline.
media Array Media elements.
name String Media name.
id Number Media id.
type Number Media type.
  • 0 : Catalog file/folders,
  • 1 : Pool,
  • 2 : Tape media,
  • 3 : Extern file/folder. (Mount Point).
Be aware of the task type because they don’t support every media types.
path String Media path if type 0/3.
destination Array Destination elements (not for import tasks).
name String Destination name (not for import tasks).
id Number Destination id (not for import tasks).
type Number Destination type (not for import tasks).
  • 1 : Pool,
  • 2 : Tape media.
Be aware of the task type because they don’t support every media types.
path String Destination path if type 0/3 (not for import tasks).
source_pool Number Name of source pool (import tasks only: see the “Import Tasks” section).
import_default_action Number Type of action if file name already exists (import tasks only: see the “Import Tasks” section) :
  • 0 : new name,
  • 1 : overwrite existing file,
  • 2 : ignore
import_destination_folder Hash Information about import destination folder (import tasks only: see the “Import Tasks” section).
id Number Import destination folder ID (import tasks only).
extern Number 0 : internal cache/share folder ; 1 : external mount point (import tasks only).
path String Import destination folder path, such as /myFolder/mySubFolder/ (import tasks only)
options Array Special settings (filters, …).
type Number Option type:
  • 0 : ignore files/folders by name (filter),
  • 1 : require files/folders by name (filter),
  • 2 : ignore files by name (filter),
  • 3 : require files by name (filter),
  • 4 : older than (date filter)
  • 5 : newer than (date filter)
  • 100 : checksum type {0, 1, 2}
  • 200 : reset file date {0, 1}
  • 201 : reset folder date {0, 1}
  • 202 : rename to {String}
  • 203 : unique rule id {Number}
  • 204 : selected drive {Array of strings}
  • 205 : parallel processing {0, 1}
  • 206 : update permission {0, 1}
  • 207 : update owner {0, 1}
  • 208 : rule id { Number, only if task type : reload}
  • 209 : complete report {0, 1}
  • 210 : sort files { {empty, asc, dsc}, only if source : Mount Point}
value String Option value:
  • Filters : string value, with * as a wildcard (for example, “*.docx” or “myprefix_*”)
  • Date filters : “YYYY/MM/DD HH:MM”
  • Checksum : “0” (none), “1” (crc), “2” (md5)
activate Bool Scheduling activation. Values:
  • 1 : scheduling enabled,
  • 0 : scheduling disabled.
schedule JSON Schedule configuration. Empty if no schedule configured.
frequency Number
  • 0: Periodically. Requires ‘start_hour’,
  • 1: Daily. Requires 'start_hour’,
  • 2: Weekly. Requires 'start_hour’ and 'days’,
  • 3: (not implemented),
  • 4: monthly “pick a day”. Requires 'start_hour’ and 'days’,
  • 5: monthly “X day week”. Requires 'start_hour’, 'mode’ and 'day’,
  • 6: monthly “last day of the month”. Requires 'start_hour’,
  • 7: Once. Requires 'start_hour’ and 'date’.
start_hour String If the frequency is 0 (periodically), the value is a period in minutes (ex: “00:10” = every 10 minutes) or in hour (ex: “02:00” = every 2 hours). For the others, the value is the time (ex: “12:12” = the task start after 12h12).
days Array List of days for scheduling. If frequency is 2 (weekly), use numbers between 0 (monday) and 6 (sunday). If frequency is 4 (monthly “pick a day”), numbers are days of the month.
day Number Day of the week, between 0 (monday) and 6 (sunday). Only use if frequency is 5 (monthly “X day week”).
mode Number Only available for frequency 5.
  • 0 : first day week of the month,
  • 1 : second day week of the month,
  • 2 : third day week of the month,
  • 3 : fourth day week of the month,
  • 4 : last day week of the month.
date String Full date string (format yyyy/mm/dd). Only available for frequency 7.

Request response

Key name Type Description
message String Describe the result of the operation.
status String OK if everything goes well. ERROR if the operation failed.

Update a task

This command allow you to update an existing task

Updating a task

require 'rest-client'

#JSON describing the task
task_json = {  
   "task"=>{  
      "name"=>"Task 1",
      "comment"=>"",
      "priority"=>7,
      "type"=>0,
      "media"=>[  
         {  
            "id"=>"3",
            "name"=>"share_AP1",
            "path"=>"/share_AP1/",
            "type"=>0
         }
      ],
      "destination"=>[  
         {  
            "id"=>"9",
            "name"=>"Pool Storage 1",
            "path"=>"",
            "type"=>1
         }
      ],
      "options"=>[  
         {  
            "type"=>"0",
            "value"=>"*.tmp"
         }
      ],
      "activate"=>1,
      "schedule"=>{  
         "start_hour"=>"13:0",
         "frequency"=>2,
         "day"=>"3"
      }
   }
}

url = "http://example.com/api/task/10"
response = RestClient::Request.execute( method: :put, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: task_json)
curl -H "Content-Type: application/json" 
     -X PUT 
     -d '{  
   "task":{  
      "name":"Task 1",
      "comment":"",
      "priority":7,
      "type":0,
      "media":[  
         {  
            "id":"3",
            "name":"share_AP1",
            "path":"/share_AP1/",
            "type":0
         }
      ],
      "destination":[  
         {  
            "id":"9",
            "name":"Pool Storage 1",
            "path":"",
            "type":1
         }
      ],
      "options":[  
         {  
            "type":"0",
            "value":"*.tmp"
         }
      ],
      "activate":1,
      "schedule":{  
         "start_hour":"13:0",
         "frequency":2,
         "day":"3"
      }
   }
}' 
    http://[username]:[password]@example.com/api/task/10

The above command returns JSON structured like this:

{  
   "message": "Task updated",
   "status": "OK"
}

HTTP Request

PUT http://example.com/api/task/{task_id} (Deprecated)

Request parameter

Key name Type Description
name String Task name set by user.
comment String User comment.
priority Number Priority level of the task. from 0 (highest priority) to 12 (lowest priority).
type Number Define the task type:
  • 0 : COPY to online storage,
  • 1 : IMPORT online storage data,
  • 2 : MOVE to online storage,
  • 3 : REHYDRATION,
  • 4 : not implemented yet,
  • 5 : Format/Scratch tape,
  • 6 : not implemented yet,
  • 7 : GET data event,
  • 8 : PUSH data event,
  • 9 : CACHE cleaning,
  • 10 : CACHE cleaning for a share,
  • 11 : MOVE to offline archive by date (deprecated, use options),
  • 12 : MOVE to offline archive,
  • 13 : COPY to offline archive by date (deprecated, use options),
  • 14 : COPY to offline archive,
  • 15 : MOVE data exchange,
  • 16 : COPY data exchange,
  • 17 : IMPORT offline archiving data,
  • 18 : IMPORT data exchange data,
  • 19 : SCAN a data exchange tape,
  • 20 : Data migration type 2 Storage to Storage,
  • 21 : Data migration type 3 New LTFS to Storage,
  • 22 : Data migration type 4 New LTFS to new LTFS,
  • 23 : Data migration type 5 New LTFS to Offline archiving.
  • 24 : Reload COPY.
  • 25 : Reload MOVE.
  • 26 : COPY to cloud Online.
  • 27 : MOVE to cloud Online.
  • 28 : COPY from cloud Online.
  • 29 : COPY to cloud Offline.
  • 30 : MOVE to cloud Offline.
  • 31 : COPY from cloud Offline.
media Array Media elements.
name String Media name.
id Number Media id.
type Number Media type.
  • 0 : Catalog file/folders,
  • 1 : Pool,
  • 2 : Tape media,
  • 3 : Extern file/folder. (Mount Point).
Be aware of the task type because they don’t support every media types.
path String Media path if type 0/3.
destination Array Destination elements (not for import tasks);
name String Destination name (not for import tasks).
id Number Destination id (not for import tasks).
type Number Destination type (not for import tasks).
  • 1 : Pool,
  • 2 : Tape media.
Be aware of the task type because they don’t support every media types.
path String Destination path if type 0/3 (not for import tasks).
source_pool Number Name of source pool (import tasks only: see the “Import Tasks” section).
import_default_action Number Type of action if file name already exists (import tasks only: see the “Import Tasks” section) :
  • 0 : new name,
  • 1 : overwrite existing file,
  • 2 : ignore
import_destination_folder Hash Information about import destination folder (import tasks only: see the “Import Tasks” section).
id Number Import destination folder ID (import tasks only).
extern Number 0 : internal cache/share folder ; 1 : external mount point (import tasks only).
path String Import destination folder path, such as /myFolder/mySubFolder/ (import tasks only).
options Array Special settings (filters, …).
type Number Option type:
  • 0 : ignore files/folders by name (filter),
  • 1 : require files/folders by name (filter),
  • 2 : ignore files by name (filter),
  • 3 : require files by name (filter),
  • 4 : older than (date filter)
  • 5 : newer than (date filter)
  • 100 : checksum type {0, 1, 2}
  • 200 : reset file date {0, 1}
  • 201 : reset folder date {0, 1}
  • 202 : rename to {String}
  • 203 : unique rule id {Number}
  • 204 : selected drive {Array of strings}
  • 205 : parallel processing {0, 1}
  • 206 : update permission {0, 1}
  • 207 : update owner {0, 1}
  • 208 : rule id { Number, only if task type : reload}
  • 209 : complete report {0, 1}
  • 210 : sort files { {empty, asc, dsc}, only if source : Mount Point}
value String Option value:
  • Filters : string value, with * as a wildcard (for example, “*.docx” or “myprefix_*”)
  • Date filters : “YYYY/MM/DD HH:MM”
  • Checksum : “0” (none), “1” (crc), “2” (md5)
activate Bool Scheduling activation. Values:
  • 1 : scheduling enabled,
  • 0 : scheduling disabled.
schedule JSON Schedule configuration. Empty if no schedule configured.
frequency Number
  • 0: Periodically. Requires 'start_hour’,
  • 1: Daily. Requires 'start_hour’,
  • 2: Weekly. Requires 'start_hour’ and 'days’,
  • 3: (not implemented),
  • 4: monthly “pick a day”. Requires 'start_hour’ and 'days’,
  • 5: monthly “X day week”. Requires 'start_hour’, 'mode’ and 'day’,
  • 6: monthly “last day of the month”. Requires 'start_hour’,
  • 7: Once. Requires 'start_hour’ and 'date’.
start_hour String If the frequency is 0 (periodically), the value is a period in minutes (ex: “00:10” = every 10 minutes) or in hour (ex: “02:00” = every 2 hours). For the others, the value is the time (ex: “12:12” = the task start after 12h12).
days Array List of days for scheduling. If frequency is 2 (weekly), use numbers between 0 (monday) and 6 (sunday). If frequency is 4 (monthly “pick a day”), numbers are days of the month.
day Number Day of the week, between 0 (monday) and 6 (sunday). Only use if frequency is 5 (monthly “X day week”).
mode Number Only available for frequency 5.
  • 0 : first day week of the month,
  • 1 : second day week of the month,
  • 2 : third day week of the month,
  • 3 : fourth day week of the month,
  • 4 : last day week of the month.
date String Full date string (format yyyy/mm/dd). Only available for frequency 7.

Request response

Key name Type Description
message String Describe the result of the operation.
status String OK if everything goes well. ERROR if the operation failed.

Delete a task

This command allow you to delete an existing task

Delete task id = 5:

require 'rest-client'

url = "http://example.com/api/task/{task_id}"
response = RestClient::Request.execute( method: :delete, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X DELETE 
http://[username]:[password]@example.com/api/task/5

The above command returns JSON structured like this:

{  
   "message": "Task deleted",
   "status": "OK"
}

HTTP Request

DELETE http://example.com/api/task/5 (Deprecated)

Request response

Key name Type Description
message String Describe the result of the operation.
status String OK if everything goes well. ERROR if the operation failed.

Action on task

This command allow you to start, stop, pause or resume a task

Start task id = 5

require 'rest-client'

#JSON describing the desired action
action_json = {
                "operation" : "run"
            }

url = "http://example.com/api/tasks/5"
response = RestClient::Request.execute( method: :post, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: action_json)
curl -H "Content-Type: application/json" 
     -X POST 
     -d '{
            "operation" : "run"
        }' 
    http://[username]:[password]@example.com/api/tasks/5

The above command returns JSON structured like this:

{  
   "message": "Tasks updated to operation: run",
   "status": "OK"
}

HTTP Request

POST http://example.com/api/tasks/{task_id} (Deprecated)

Key name Type Description
operation String Operation type:
  • run: force task to run,
  • stop: stop task,
  • pause: pause task,
  • resume: resume a paused task.

Request response

Key name Type Description
message String Describe the result of the operation.
status String OK if everything goes well. ERROR if the operation failed.

Rules

Types definition

Rule definition

Key name Type Description
id Number Rule id
activate Boolean Whether schedule is activated
priority Number From 0, highest priority, to 12, lowest
name String Rule name
type Type Type of rule
comment String User comment
file_action Number
status_code Status code Status code of last or current execution
creation_date DateTime Date of creation, in ISO-8601 format
creation_username String Username of creator
modification_date DateTime Date of last modification, or creation if irrelevant, in ISO-8601 format
modification_username String Username of last editor, or creator if irrelevant
last_check DateTime Date of the last check
processed_size Number Current processed size if the task is running in byte
total_size Number Total size to process in byte
metadata Object Custom rules value
schedule Schedule Define an automatic execution of the rule
options Array<Rule option> Additional options
sources Array<Rule source> Sources of the rule
destinations Array<Rule destination> Destinations of the rule

Exec rule definition

Key name Type Description
id String Id of the execution. The value will be larger than an 32b-integer, so it will be returned as a string instead
name String Rule name
type Type Type of rule
status_code Status code Current status code
job_started DateTime When the rule was started, in ISO 8601 format
job_finished DateTime When the rule was finished, if relevant, in ISO 8601 format
estimation_time Number Estimated remaining time, in seconds
processed_size Number Processed size in byte
total_size Number Total size to process in byte
bandwidth Number Average bandwidth, in byte/sec
processed_files Number Number of file processed
total_files Number Total number of file to process
rule Rule

Schedule definition

Key name Type Description Relevant when frequency = ?
frequency Number
  • 0: Periodically
  • 1: Daily
  • 2: Weekly
  • 4: monthly “pick a day”
  • 5: monthly “X day week”
  • 6: monthly “last day of the month”
  • 7: Once
date Date Format yyyy-mm-dd 7
start_hour DateTime Time of start, format ISO-8601, but only time is relevant.
For periodically (0), specify the time interval
0, 1, 2, 4, 5, 6, 7
dweek Number Day of the week, from 0 (Monday) to 6 (Sunday) 2, 5
dmonth Number Day of the month, from 1 to 31 4
mode Number Whether it’s the 1st (0), 2nd (1), 3rd (2), 4th (3) or last (4) specific week day of the month 5

Rule option definition

Key name Type
type Rule option type
value String

Rule option type definition

Id Description
0 Filter, exclude
1 Filter, require
2 Filter, exclude files
3 Filter, require files
100 Check integrity, CRC-32 (1) or MD5 (2)
200 Reset file datestamp
201 Reset folder datestamp
202 Rename destination folder
203 For reload rules, exec rule id
204 Selected drive
205 Parallel processing (0-1)
208 For reload rules, use global rule (0-1)
209 Complete report (0-1)
210 Processing order, ‘asc’ or 'dsc’

Rule source definition

Key name Type
file File
tape Volume
tape_pool Tape Pool
cloud_pool Cloud Pool

Rule destination definition

Key name Type
folder File
tape Volume
tape_pool Tape Pool
cloud_pool Cloud Pool

Types definition

Id Label Type
0 Copy to Tape Online storage
1 Copy to Cache Online storage
2 Move to Tape Online storage
3 Tape Rehydration Maintenance
4 Tape Optimization
5 Format Media Maintenance
6 LTFS Integrity Verification Maintenance
7 Get Data
8 Push Data
9 Cache Cleaning
10 Cache Cleaning Share
11 Offline Archive Move by Date
12 Offline Archive Move Offline archive
13 Offline Archive Copy by Date
14 Offline Archive Copy Offline archive
15 Data Exchange Move Data exchange
16 Data Exchange Copy Data exchange
17 Import Offline Archive Offline archive
18 Import Data Exchange Data exchange
19 Scan Media Data exchange
20 Tape Duplication Storage Pool
21 Tape Duplication + Online Catalog Importation
22 Tape Duplication Unknown Tape Maintenance
23 Tape Duplication + Offline Catalog Importation
24 Reload Task Reload
25 Reload Task Move Reload
26 Copy to cloud Online storage
27 Move to cloud Online storage
28 Import from cloud Online storage
29 Offline archive copy to cloud Offline archive
30 Offline archive move to cloud Offline archive
31 Offline archive import from cloud Offline archive
100 Ext to cache Online storage

Status codes definition

Id Label
0 Not activated / To execute
1 Done
2 In progress
3 Error
4 Out window
5 Paused
6 Stopped by system
7 In queue
8 Finished with warnings
9 Calculating…
10 Stopped by user

List all rules

This command allow you to list all the rules on the system.

Example of request:

require 'rest-client'

url = "http://example.com/api/rules"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET \
   http://[username]:[password]@example.com/api/rules

The above command returns JSON structured like this:

{
  "status": "SUCCESS",
  "code": 200,
  "rules": [
    {
      "id": 17,
      "activate": 0,
      "priority": 7,
      "name": "Task number 17",
      "type": 14,
      "comment": "",
      "file_action": 0,
      "status_code": 1,
      "creation_date": "2018-01-10T13:10:50Z",
      "creation_username": "admin",
      "modification_date": "2018-01-10T13:10:50Z",
      "modification_username": "admin",
      "last_check": "2018-01-10T15:00:20Z",
      "processed_size": 102400000,
      "total_size": 102400000,
      "metadata": {
        "custom": "val",
        "custom_multi": "val1;val2"
      },
      "schedule": {
        "frequency": 7,
        "date": "2018-01-26",
        "start_hour": "2000-01-01T10:40:00Z",
        "dweek": 1,
        "dmonth": 1,
        "mode": 0
      }
    }
  ]
}

HTTP request

GET http://example.com/api/rules

Request response

Key name Type Description
rules Array<Rule> Array of all rules on the system.
Returned keys: id, activate, priority, name, type, comment, file_action, status_code, creation_date, creation_username, modification_date, modification_username, processed_size, total_size, metadata, schedule

Get a rule

This command allow you to list all the rules on the system.

Example of request:

require 'rest-client'

url = "http://example.com/api/rules/17"
response = RestClient::Request.execute( method: :get,
                                        url: url,
                                        user: [username],
                                        password: [password])
curl -X GET \
   http://[username]:[password]@example.com/api/rules/17

The above command returns JSON structured like this:

{
  "status": "SUCCESS",
  "code": 200,
  "rules": {
    "id": 17,
    "activate": 0,
    "priority": 7,
    "name": "Task number 17",
    "type": 14,
    "comment": "",
    "file_action": 0,
    "status_code": 1,
    "creation_date": "2018-01-10T13:10:50Z",
    "creation_username": "admin",
    "modification_date": "2018-01-10T13:10:50Z",
    "modification_username": "admin",
    "last_check": "2018-01-10T15:00:20Z",
    "processed_size": 102400000,
    "total_size": 102400000,
    "metadata": {
      "custom": "val",
      "custom_multi": "val1;val2"
    },
    "schedule": {
      "frequency": 7,
      "date": "2018-01-26",
      "start_hour": "2000-01-01T10:40:00Z",
      "dweek": 1,
      "dmonth": 1,
      "mode": 0
    },
    "options": [
      {
        "type": 205,
        "value": "1"
      },
      {
        "type": 209,
        "value": "1"
      }
    ],
    "sources": [
      {
        "file": {
          "id": 4,
          "name": "T_reload",
          "type": "share",
          "path": "/T_reload",
          "extern": 0,
          "share": 4,
          "in_cache": 1,
          "was_modified": 1,
          "offline": 0
        }
      }
    ],
    "destinations": [
      {
        "tape_pool": {
          "id": 4,
          "name": "Pool_reload",
          "type": 1
        }
      }
    ]
  }
}

HTTP request

GET http://example.com/api/rules

Request response

Key name Type Description
rule Rule Requested rule.
Returned keys: id, activate, priority, name, type, comment, file_action, status_code, creation_date, creation_username, modification_date, modification_username, processed_size, total_size, metadata, schedule, options, sources, destinations

Error

code error error_parameters message
404 not_found Rule id Rule id doesn’t exist

Add a rule

This command allow you to create a new rule

Adding a rule

require 'rest-client'

rule = {
  "rule": {
    "activate": true,
    "priority": 7,
    "name": "New task name",
    "type": 14,
    "comment": "",
    "file_action": 0,
    "status_code": 1,
    "metadata": {
      "custom": "val",
      "custom_multi": "val1;val2"
    },
    "schedule": {
      "frequency": 7,
      "date": "2018-01-26",
      "start_hour": "2000-01-01T10:40:00Z"
    },
    "options": [
      {
        "type": 205,
        "value": "1"
      },
      {
        "type": 209,
        "value": "1"
      }
    ],
    "sources": [
      {
        "file": {
          "id": 4
        }
      }
    ],
    "destinations": [
      {
        "tape_pool": {
          "id": 4
        }
      }
    ]
  }
}

url = "http://example.com/api/rules"
response = RestClient::Request.execute( method: :post,
                                        url: url,
                                        user: [username],
                                        password: [password],
                                        payload: rule)
curl -H "Content-Type: application/json" \
  -X POST \
  -d '{
  "rule": {
    "activate": true,
    "priority": 7,
    "name": "New task name",
    "type": 14,
    "comment": "",
    "file_action": 0,
    "status_code": 1,
    "metadata": {
      "custom": "val",
      "custom_multi": "val1;val2"
    },
    "schedule": {
      "frequency": 7,
      "date": "2018-01-26",
      "start_hour": "2000-01-01T10:40:00Z"
    },
    "options": [
      {
        "type": 205,
        "value": "1"
      },
      {
        "type": 209,
        "value": "1"
      }
    ],
    "sources": [
      {
        "file": {
          "id": 4
        }
      }
    ],
    "destinations": [
      {
        "tape_pool": {
          "id": 4
        }
      }
    ]
  }
}' \
  http://[username]:[password]@example.com/api/rules

The above command returns JSON structured like this:

{
  "status": "SUCCESS",
  "code": 200,
  "rules": {
    "id": 18,
    "activate": 0,
    "priority": 7,
    "name": "New task name",
    "type": 14,
    "comment": "",
    "file_action": 0,
    "status_code": 1,
    "creation_date": "2018-01-10T13:10:50Z",
    "creation_username": "admin",
    "modification_date": "2018-01-10T13:10:50Z",
    "modification_username": "admin",
    "last_check": null,
    "processed_size": 102400000,
    "total_size": 102400000,
    "metadata": {
      "custom": "val",
      "custom_multi": "val1;val2"
    }
  }
}

HTTP Request

POST http://example.com/api/rules

Request body

Key name Type Description
rule Rule New rule to add.
Required keys: activate, priority, name, type, comment, file_action, metadata, schedule, options, sources, destinations

Request response

Key name Type Description
rule Rule Added rule.
Returned keys: id, activate, priority, name, type, comment, file_action, status_code, creation_date, creation_username, modification_date, modification_username, processed_size, total_size, metadata

Update a rule

This command allow you to update an existing rule

Updating a rule

require 'rest-client'

rule = {
  "rule": {
    "activate": true,
    "priority": 7,
    "name": "New task name",
    "type": 14,
    "comment": "",
    "file_action": 0,
    "status_code": 1,
    "metadata": {
      "custom": "val",
      "custom_multi": "val1;val2"
    },
    "schedule": {
      "frequency": 7,
      "date": "2018-01-26",
      "start_hour": "2000-01-01T10:40:00Z"
    },
    "options": [
      {
        "type": 205,
        "value": "1"
      },
      {
        "type": 209,
        "value": "1"
      }
    ],
    "sources": [
      {
        "file": {
          "id": 4
        }
      }
    ],
    "destinations": [
      {
        "tape_pool": {
          "id": 4
        }
      }
    ]
  }
}

url = "http://example.com/api/rules/17"
response = RestClient::Request.execute( method: :put,
                                        url: url,
                                        user: [username],
                                        password: [password],
                                        payload: rule)
curl -H "Content-Type: application/json" \
  -X PUT \
  -d '{
  "rule": {
    "activate": true,
    "priority": 7,
    "name": "New task name",
    "type": 14,
    "comment": "",
    "file_action": 0,
    "status_code": 1,
    "metadata": {
      "custom": "val",
      "custom_multi": "val1;val2"
    },
    "schedule": {
      "frequency": 7,
      "date": "2018-01-26",
      "start_hour": "2000-01-01T10:40:00Z"
    },
    "options": [
      {
        "type": 205,
        "value": "1"
      },
      {
        "type": 209,
        "value": "1"
      }
    ],
    "sources": [
      {
        "file": {
          "id": 4
        }
      }
    ],
    "destinations": [
      {
        "tape_pool": {
          "id": 4
        }
      }
    ]
  }
}' \
  http://[username]:[password]@example.com/api/rules/17

The above command returns JSON structured like this:

{
  "status": "SUCCESS",
  "code": 200,
  "rules": {
    "id": 18,
    "activate": 0,
    "priority": 7,
    "name": "New task name",
    "type": 14,
    "comment": "",
    "file_action": 0,
    "status_code": 1,
    "creation_date": "2018-01-10T13:10:50Z",
    "creation_username": "admin",
    "modification_date": "2018-01-10T13:10:50Z",
    "modification_username": "admin",
    "last_check": "2018-01-10T15:00:20Z",
    "processed_size": 102400000,
    "total_size": 102400000,
    "metadata": {
      "custom": "val",
      "custom_multi": "val1;val2"
    }
  }
}

HTTP Request

PUT http://example.com/api/rules/{rule_id}

Request body

Key name Type Description
rule Rule New rule to update.
Required keys: activate, priority, name, type, comment, file_action, metadata, schedule, options, sources, destinations

Request response

Key name Type Description
rule Rule Updated rule.
Returned keys: id, activate, priority, name, type, comment, file_action, status_code, creation_date, creation_username, modification_date, modification_username, processed_size, total_size, metadata

Delete a rule

This command allow you to delete an existing rule

Delete rule id 17

require 'rest-client'

url = "http://example.com/api/rules/17"
response = RestClient::Request.execute( method: :delete,
                                        url: url,
                                        user: [username],
                                        password: [password],
                                        payload: rule)
curl -X DELETE http://[username]:[password]@example.com/api/rules/17

The above command returns JSON structured like this:

{
  "status": "SUCCESS",
  "code": 200,
  "rules": {
    "id": 18,
    "activate": 0,
    "priority": 7,
    "name": "New task name",
    "type": 14,
    "comment": "",
    "file_action": 0,
    "status_code": 1,
    "creation_date": "2018-01-10T13:10:50Z",
    "creation_username": "admin",
    "modification_date": "2018-01-10T13:10:50Z",
    "modification_username": "admin",
    "last_check": "2018-01-10T15:00:20Z",
    "processed_size": 102400000,
    "total_size": 102400000,
    "metadata": {
      "custom": "val",
      "custom_multi": "val1;val2"
    }
  }
}

HTTP Request

DELETE http://example.com/api/rules/{task_id}

Request response

Key name Type Description
rule Rule Deleted rule.
Returned keys: id, activate, priority, name, type, comment, file_action, status_code, creation_date, creation_username, modification_date, modification_username, processed_size, total_size, metadata

Action on rule

This command allow you to start, stop, pause or resume a rule

Start rule id 17

require 'rest-client'

url = "http://example.com/api/rules/17/run"
response = RestClient::Request.execute( method: :post,
                                        url: url,
                                        user: [username],
                                        password: [password],
                                        payload: rule)
curl -X POST http://[username]:[password]@example.com/api/rules/17/run

The above command returns JSON structured like this:

{
  "status": "SUCCESS",
  "code": 200,
  "message": "Action run successfully applied to rule 17"
}

HTTP Request

POST http://example.com/api/rules/{task_id}/run
POST http://example.com/api/rules/{task_id}/pause
POST http://example.com/api/rules/{task_id}/stop
POST http://example.com/api/rules/{task_id}/resume

Error

code error error_parameters message
404 not_found Rule id Rule id doesn’t exist

List filtered exec rules

This command allow you to list a subset of the execution of rules

Example of request:

require 'rest-client'

url = "http://example.com/api/rules/exec?types=12,14&limit=10&offset=20&order=>job_finished"
response = RestClient::Request.execute( method: :get,
                                        url: url,
                                        user: [username],
                                        password: [password])
curl -X GET \
   "http://[username]:[password]@example.com/api/rules/exec?types=12,14&limit=10&offset=20&order=>job_finished"

The above command returns JSON structured like this:

{
  "status": "SUCCESS",
  "code": 200,
  "rules": [
    {
      "id": "1515589856540888920",
      "name": "Task number 17",
      "type": 14,
      "status_code": 10,
      "job_started": "2018-01-10T14:10:56Z",
      "job_finished": "2018-01-10T14:12:46Z",
      "estimation_time": 0,
      "processed_size": 0,
      "total_size": 102400000,
      "bandwidth": 4551,
      "processed_files": 0,
      "total_files": 100000,
      "rule": {
        "id": 17
      }
    }
  ],
  "length": 21
}

HTTP request

GET http://example.com/api/rules/exec

Key name Type Description
rule_id Number Filter on rule id
have String Filter on rule name
not_have String Negative filter on rule name
status Array<Status code> Filter on status code, separated by comma
types Array<Type> Filter on rule type, separated by comma
complete_list Boolean If false, only includes the last correct execution of a rule. Default to true
media String Filter on rules using a specific tape
pool String Filter on rules using a specific tape pool
mount_point String Filter on rules using a specific mount point
execution_date_start DateTime Filter on minimum date of execution, in ISO-8601 format
execution_date_end DateTime Filter on maximum date of execution, in ISO-8601 format
creation_date_start DateTime Filter on minimum date of creation of the rule, in ISO-8601 format
creation_date_end DateTime Filter on maximum date of creation of the rule, in ISO-8601 format
modification_date_start DateTime Filter on minimum date of modification of the rule, in ISO-8601 format
modification_date_end DateTime Filter on maximum date of modification of the rule, in ISO-8601 format
limit Number Maximum number of items to return
offset Number When a limit is set, number of items to skip
order String Name of the column to order on, prefixed by ’<’ (ascending) or ’>’ (descending)

Request response

Key name Type Description
rules Array<Exec Rule> Array of a subset of the execution of the rules
length Number Number of result, ignoring limit and offset parameters

Get an exec rule

This command allow you to get an executed rule

Example of request:

require 'rest-client'

url = "http://example.com/api/rules/exec/1515589856540888920"
response = RestClient::Request.execute( method: :get,
                                        url: url,
                                        user: [username],
                                        password: [password])
curl -X GET \
   "http://[username]:[password]@example.com/api/rules/exec/1515589856540888920"

The above command returns JSON structured like this:

{
  "status": "SUCCESS",
  "code": 200,
  "rule": {
    "id": "1515589856540888920",
    "name": "Task number 17",
    "type": 14,
    "status_code": 10,
    "job_started": "2018-01-10T14:10:56Z",
    "job_finished": "2018-01-10T14:12:46Z",
    "estimation_time": 0,
    "processed_size": 0,
    "total_size": 102400000,
    "bandwidth": 4551,
    "processed_files": 0,
    "total_files": 100000
  }
}

HTTP request

GET http://example.com/api/rules/exec/{exec_rule_id}

Request response

Key name Type Description
rule Exec Rule

Error

code error error_parameters message
404 not_found Exec rule id Exec rule id doesn’t exist

List files from rule or exec-rule

This command allow you to list file copied or moved by a rule

Example of request:

require 'rest-client'

url = "http://example.com/api/rules/exec/1515589856540888920/files_table"
response = RestClient::Request.execute( method: :get,
                                        url: url,
                                        user: [username],
                                        password: [password])
curl -X GET \
   "http://[username]:[password]@example.com/api/rules/exec/1515589856540888920/files_table"

The above command returns JSON structured like this:

{
  "status": "SUCCESS",
  "code": 200,
  "files": [
    {
      "media": [
        "NOD101L6"
      ],
      "id": 4,
      "name": "T_reload",
      "type": "share",
      "path": "/T_reload",
      "extern": 0,
      "share": 4,
      "in_cache": 1,
      "was_modified": 1,
      "offline": 0
    }
  ]
}

HTTP request

GET http://example.com/api/rules/exec/{exec_rule_id}/files_table
GET http://example.com/api/rules/{rule_id}/files_table

Key name Type Description
path String Folder path to return. Default to ’/’

Request response

Key name Type Description
files Array<File> Array of files

Custom Rule fields

List Custom Rule fields

This command allow you to retrieve all configured Custom Rule fields

Example of request:

require 'rest-client'

url = "http://example.com/api/tasks_configuration/custom_fields"
response = RestClient::Request.execute( method: :get, 
                              url: url, 
                              user: [username],
                              password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/tasks_configuration/custom_fields

The above command returns JSON structured like this:

{  
   "custom_fields":[  
      {  
         "name":"checkboxMandatory",
         "key":"checkboxMandatory",
         "mandatory":1,
         "apply_on_tasks": {
                "archiving_import": 0,
                "storage": 1,
                "maintenance": 0,
                "archiving_export": 1,
                "exchange_export": 1,
                "exchange_import": 0,
                "reload": 0
            },        
         "type_of_field":2,
         "comment":"",
         "type_value":[  
            "test1",
            " test2",
            " test3"
         ]
      },
      {  
         "name":"mandatory",
         "key":"mandatory",
         "mandatory":1,
         "apply_on_tasks": {
                "archiving_import": 0,
                "storage": 1,
                "maintenance": 0,
                "archiving_export": 1,
                "exchange_export": 1,
                "exchange_import": 0,
                "reload": 0
            },              
         "type_of_field":0,
         "comment":""
      },
      {  
         "name":"radioMandatory",
         "key":"radioMandatory",
         "mandatory":1,
         "apply_on_tasks": {
                "archiving_import": 0,
                "storage": 1,
                "maintenance": 0,
                "archiving_export": 1,
                "exchange_export": 1,
                "exchange_import": 0,
                "reload": 0
            },                 
         "type_of_field":3,
         "comment":"",
         "type_value":[  
            "bleh",
            " blah",
            " beh"
         ]
      }
   ],
   "status":"OK",
   "code":200
}

HTTP Request

GET http://example.com/api/tasks_configuration/custom_fields

Request response

Descriptor of the Custom Rule field

Key name Type Description
name String Custom field name.
key String Key value of the custom field.
mandatory Boolean Set mandatory fields
apply_on_tasks String array Array of type of task to apply custom field
storage Boolean Rule type storage
archiving_export Boolean Rule type archiving_export
archiving_import Boolean Rule type archiving_import
exchange_export Boolean Rule type exchange_export
exchange_import Boolean Rule type exchange_import
maintenance Boolean Rule type maintenance
reload Boolean Rule type reload
type_of_fields Number Field type:
  • 0 : Characters,
  • 1 : Characters multi line,
  • 2: Checkbox,
  • 3: Radio.
type_value Array List of predifined values (in case of checkbox or radio buttons).

Request response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Add a Custom Rule field

This command allow you to create a new Custom Rule field

Adding a Custom Rule field

require 'rest-client'

#JSON describing the new custom field
v_json = {
   "custom_fields" => {  
      "name" => "checkboxMandatory",
      "key" => "checkboxMandatory",
      "mandatory" => 1,
      "apply_on_tasks": {
                "archiving_import": 0,
                "storage": 1,
                "maintenance": 0,
                "archiving_export": 1,
                "exchange_export": 1,
                "exchange_import": 0,
                "reload": 0
            },            
      "type_of_field" => 2,
      "comment" => "",
      "type_value" => [  
         "test1",
         " test2",
         " test3"
      ]
   }
}

url = "http://example.com/api/tasks_configuration/custom_fields"
response = RestClient::Request.execute( method: :post, 
                              url: url, 
                              user: [username],
                              password: [password],
                              payload: v_json)
curl -H "Content-Type: application/json" 
    -X POST 
    -d '{
         "custom_fields":{  
            "name":"checkboxMandatory",
            "key":"checkboxMandatory",
            "mandatory":1,
            "apply_on_tasks": {
                "archiving_import": 0,
                "storage": 1,
                "maintenance": 0,
                "archiving_export": 1,
                "exchange_export": 1,
                "exchange_import": 0,
                "reload": 0
            },             
            "type_of_field":2,
            "comment":"",
            "type_value":[  
               "test1",
               " test2",
               " test3"
            ]
         }
      }' 
   http://[username]:[password]@example.com/api/tasks_configuration/custom_fields

HTTP Request

POST http://example.com/api/tasks_configuration/custom_fields

Request parameter

Key name Type Description
name String Custom field name.
key String Key value of the custom field.
mandatory Boolean Set mandatory fields
apply_on_tasks String array Array of type of task to apply custom field
storage Boolean Rule type storage
archiving_export Boolean Rule type archiving_export
archiving_import Boolean Rule type archiving_import
exchange_export Boolean Rule type exchange_export
exchange_import Boolean Rule type exchange_import
maintenance Boolean Rule type maintenance
reload Boolean Rule type reload
type_of_fields Number Field type:
  • 0 : Characters,
  • 1 : Characters multi line,
  • 2: Checkbox,
  • 3: Radio.
type_value Array List of predifined values in case of checkbox or radio buttons.

Request response

Key name Type Description
message String Describe the result of the operation.
status String OK if everything goes well. ERROR if the operation failed.

Update a Custom Rule field

This command allow you to update an existing Custom Rule field

Update a Custom Rule field with name = “cf1”:

require 'rest-client'

#JSON describing the new Custom Rule field
v_json = {
   "custom_fields" => {  
      "name" => "checkboxMandatory",
      "key" => "checkboxMandatory",
      "mandatory" => 1,
      "apply_on_tasks": {
                "archiving_import": 0,
                "storage": 1,
                "maintenance": 0,
                "archiving_export": 1,
                "exchange_export": 1,
                "exchange_import": 0,
                "reload": 0
            },                   
      "type_of_field" => 2,
      "comment" => "",
      "type_value" => [  
         "test1",
         " test2",
         " test3"
      ]
   }
}

url = "http://example.com/api/tasks_configuration/custom_fields/cf1"
response = RestClient::Request.execute( method: :put, 
                              url: url, 
                              user: [username],
                              password: [password],
                              payload: v_json)
curl -H "Content-Type: application/json" 
    -X PUT 
    -d '{
         "custom_fields":{  
            "name":"checkboxMandatory",
            "key":"checkboxMandatory",
            "mandatory":1,
            "apply_on_tasks": {
                "archiving_import": 0,
                "storage": 1,
                "maintenance": 0,
                "archiving_export": 1,
                "exchange_export": 1,
                "exchange_import": 0,
                "reload": 0
            },                              
            "type_of_field":2,
            "comment":"",
            "type_value":[  
               "test1",
               " test2",
               " test3"
            ]
         }
      }' 
   http://[username]:[password]@example.com/api/tasks_configuration/custom_fields/cf1

HTTP Request

PUT http://example.com/api/tasks_configuration/custom_fields/{name}

Request parameter

Key name Type Description
name String Custom field name.
key String Key value of the custom field.
mandatory Boolean Set mandatory fields
apply_on_tasks String array Array of type of task to apply custom field
storage Boolean Rule type storage
archiving_export Boolean Rule type archiving_export
archiving_import Boolean Rule type archiving_import
exchange_export Boolean Rule type exchange_export
exchange_import Boolean Rule type exchange_import
maintenance Boolean Rule type maintenance
reload Boolean Rule type reload
type_of_fields Number Field type:
  • 0 : Characters,
  • 1 : Characters multi line,
  • 2: Checkbox,
  • 3: Radio.
type_value Array List of predifined values in case of checkbox or radio buttons.

Request response

Key name Type Description
message String Describe the result of the operation.
status String OK if everything goes well. ERROR if the operation failed.

Delete a Custom Rule field

This command allow you to delete an existing Custom Rule field

Delete Custom Rule field with name = “cf1”:

require 'rest-client'

url = "http://example.com/api/tasks_configuration/custom_fields/cf1"
response = RestClient::Request.execute( method: :delete4, 
                              url: url, 
                              user: [username],
                              password: [password])
curl -X DELETE 
http://[username]:[password]@example.com/api/tasks_configuration/custom_fields/cf1

HTTP Request

DELETE http://example.com/api/tasks_configuration/custom_fields/{name}

Request response

Key name Type Description
message String Describe the result of the operation.
status String OK if everything goes well. ERROR if the operation failed.

Import tasks (Exemple section)

Import data from archive tape

List files from archive pool

List files from archive pool named POOL_ARCHIVE_01:

require 'rest-client'

url = "http://example.com/api/backend/pool/POOL_ARCHIVE_01/files"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/backend/pool/T_OFF_BASE_POOL/files

The above command returns JSON structured like this:

{  
   "status":"OK",
   "code":200,
   "message":"2 files found.",
   "data":[  
      {  
         "id":22212157,
         "size":44874096,
         "name":"Document01.pdf",
         "parent":491,
         "type":"file"
      },
      {  
         "id":22212161,
         "size":4096,
         "value":"Exp01",
         "parent":491,
         "type":"folder"
      }
   ]
}

HTTP Request

GET http://example.com/api/backend/pool/{pool_name}/files (Deprecated)

parent_id : Optional, list files from this folder id.

Request response

An array of JSON representing all files from parent (root if no parent).

Key name Type Description
id Number File/folder id.
name String File/folder name.
type String File/Folder type:
  • share: shared folder,
  • folder,
  • file.
parent String File/folder parent id (# if shared folder).
size Number File/folder size in bytes.

Request response

Key name Type Description
message String Describe the result of the operation.
status String OK if everything goes well. ERROR if the operation failed.

Create a task to import archived data (Deprecated)

Import files from pool into the appliance cache or a mount point.

Importing file from archive pool

require 'rest-client'

task_json = {  
   "task":{  
      "name":"Import Offline Archive",
      "comment":"",
      "priority":7,
      "type":17,
      "media":[  
         {  
            "id":"3",
            "name":"share_AP1",
            "path":"/share_AP1/",
            "type":0
         }
      ],
      "import_destination_folder"=>{"id"=>"498", "extern"=>0, "path"=>"/AP_SHARE01/"},
       "import_default_action"=>"0", 
       "source_pool"=>"POOL_ARCHIVE_01",
      "activate":1,
      "schedule":{  
         "start_hour":"13:00",
         "frequency":7,
         "date":"2016/06/30"
      }
   }
}

url = "http://example.com/api/task"
response = RestClient::Request.execute( method: :post, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: import_json)
curl -H "Content-Type: application/json" 
     -X POST 
     -d '{  
   "task":{  
      "name":"Import Offline Archive",
      "comment":"",
      "priority":7,
      "type":17,
      "media":[  
         {  
            "id":"3",
            "name":"share_AP1",
            "path":"/share_AP1/",
            "type":0
         }
      ],
      "import_destination_folder"=>{"id"=>"498", "extern"=>0, "path"=>"/AP_SHARE01/"},
       "import_default_action"=>"0", 
       "source_pool"=>"POOL_ARCHIVE_01",
      "activate":1,
      "schedule":{  
         "start_hour":"13:00",
         "frequency":7,
         "date":"2016/06/30"
      }
   }
}' 
    http://[username]:[password]@example.com/api/task

HTTP Request

POST http://example.com/api/task (Deprecated)

Request parameter

Key name Type Description
name String Task name set by user.
priority Number Priority level of the task. from 0 (highest priority) to 12 (lowest priority).
type Number Define the task type:
  • 1 : IMPORT online storage data,
  • 17 : IMPORT offline archiving data,
  • 18 : IMPORT data exchange data
.
media Array Media elements.
name String Media name.
id Number Media id.
type Number Media type. 0 in this case.
path String Media path.
comment String User comment.
import_default_action Number The behavior to perform if a filename already exist in the destination folder.
  • 0: New name,
  • 1: Override,
  • 2: Ignore the file.
import_destination_folder Object Define the import destination location.
id Number id of the destination folder.
extern Boolean Set true if the destination is a folder of an external Mount point. False if local catalogue.
path String Full path of the destination folder.
source_pool String Pool name of the source pool where the files to copy are located.
activate Bool Scheduling activation. Values:
  • 1 : scheduling enabled,
  • 0 : scheduling disabled.
schedule JSON Schedule configuration. Empty if no schedule configured.
frequency Number
  • 0: Periodically. Need start_hour,
  • 1: Daily. Need start_hour,
  • 2: Weekly. Need start_hour and days,
  • 3: not implemented,
  • 4: monthly “pick a day”. Need start_hour and days,
  • 5: monthly “X day week”. Need start_hour, mode and day,
  • 6: not implemented,
  • 7: Once. Need start_hour and date.
start_hour String If the frequency is 0 (periodically), the value is a period in minutes (ex: “00:10” = every 10 minutes) or in hour (ex: “02:00” = every 2 hours). For the others, the value is the time (ex: “12:12” = the task start after 12h12).
dweek Number Day of the week.
dmonth Number Day of the month.
mode Number Only available for frequency 5.
  • 0 : first day week of the month,
  • 1 : second day week of the month,
  • 2 : third day week of the month,
  • 3 : fourth day week of the month,
  • 4 : last day week of the month.
date String Full date string (format yyyy/mm/dd). Only available for frequency 7.

Request response

Key name Type Description
message String Describe the result of the operation.
status String OK if everything goes well. ERROR if the operation failed.

Update a task to import archived data (Deprecated)

Import files from pool into the appliance cache or a mount point.

Importing file from archive pool

require 'rest-client'

task_json = {  
   "task":{  
      "name":"Import Offline Archive",
      "comment":"",
      "priority":7,
      "type":17,
      "media":[  
         {  
            "id":"3",
            "name":"share_AP1",
            "path":"/share_AP1/",
            "type":0
         }
      ],
      "import_destination_folder"=>{"id"=>"498", "extern"=>0, "path"=>"/AP_SHARE01/"},
       "import_default_action"=>"0", 
       "source_pool"=>"POOL_ARCHIVE_01",
      "activate":1,
      "schedule":{  
         "start_hour":"13:00",
         "frequency":7,
         "date":"2016/06/30"
      }
   }
}

url = "http://example.com/api/task/12"
response = RestClient::Request.execute( method: :put, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: import_json)
curl -H "Content-Type: application/json" 
     -X PUT 
     -d '{  
   "task":{  
      "name":"Import Offline Archive",
      "comment":"",
      "priority":7,
      "type":17,
      "media":[  
         {  
            "id":"3",
            "name":"share_AP1",
            "path":"/share_AP1/",
            "type":0
         }
      ],
      "import_destination_folder"=>{"id"=>"498", "extern"=>0, "path"=>"/AP_SHARE01/"},
       "import_default_action"=>"0", 
       "source_pool"=>"POOL_ARCHIVE_01",
      "activate":1,
      "schedule":{  
         "start_hour":"13:00",
         "frequency":7,
         "date":"2016/06/30"
      }
   }
}' 
    http://[username]:[password]@example.com/api/task/12

HTTP Request

PUT http://example.com/api/task/{id} (Deprecated)

Request parameter

Key name Type Description
name String Task name set by user.
priority Number Priority level of the task. from 0 (highest priority) to 12 (lowest priority).
type Number Define the task type:
  • 1 : IMPORT online storage data,
  • 17 : IMPORT offline archiving data,
  • 18 : IMPORT data exchange data
.
media Array Media elements.
name String Media name.
id Number Media id.
type Number Media type. 0 in this case.
path String Media path.
comment String User comment.
import_default_action Number The behavior to perform if a filename already exist in the destination folder.
  • 0: New name,
  • 1: Override,
  • 2: Ignore the file.
import_destination_folder Object Define the import destination location.
id Number id of the destination folder.
extern Boolean Set true if the destination is a folder of an external Mount point. False if local catalogue.
path String Full path of the destination folder.
source_pool String Pool name of the source pool where the files to copy are located.
activate Bool Scheduling activation. Values:
  • 1 : scheduling enabled,
  • 0 : scheduling disabled.
schedule JSON Schedule configuration. Empty if no schedule configured.
frequency Number
  • 0: Periodically. Need start_hour,
  • 1: Daily. Need start_hour,
  • 2: Weekly. Need start_hour and days,
  • 3: not implemented,
  • 4: monthly “pick a day”. Need start_hour and days,
  • 5: monthly “X day week”. Need start_hour, mode and day,
  • 6: not implemented,
  • 7: Once. Need start_hour and date.
start_hour String If the frequency is 0 (periodically), the value is a period in minutes (ex: “00:10” = every 10 minutes) or in hour (ex: “02:00” = every 2 hours). For the others, the value is the time (ex: “12:12” = the task start after 12h12).
dweek Number Day of the week.
dmonth Number Day of the month.
mode Number Only available for frequency 5.
  • 0 : first day week of the month,
  • 1 : second day week of the month,
  • 2 : third day week of the month,
  • 3 : fourth day week of the month,
  • 4 : last day week of the month.
date String Full date string (format yyyy/mm/dd). Only available for frequency 7.

Request response

Key name Type Description
message String Describe the result of the operation.
status String OK if everything goes well. ERROR if the operation failed.

Export archive tasks (Exemple section)

Export files on a offline archive pool flow

Here is a quick overview of the flow of Export files to media tape :

Retrieving files

require 'rest-client'

url = "http://example.com/api/frontend/files/15"
files = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/frontend/files/15

Retrieving all pool and choose an archive pool type 1.

require 'rest-client'

url = "http://example.com/api/backend/pools"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/backend/pools

JSON used to create the archive task

{  
   "rule":{  
      "name":"Offline archive document files",
      "comment":"Archive PDF to pool Export1 with tape MTC500L5",
      "type":14,
      "priority":10,
      "media":[
        {  
            "id":"1252",
            "name":"Document1.pdf",
            "path":"/Documents/pdf/Document1.pdf",
            "type":0
        },
        {  
            "id":"125456",
            "name":"Document14.pdf",
            "path":"/Documents/pdf/Document14.pdf",
            "type":0
        }
      ],
      "destination":[  
         "254"
      ],
      "activate":1,
      "schedule":{  
            "frequency":7,
            "start_hour":"20:00",
            "date":"2015/09/20"   
      }
   }
}

1) Get the list of files you want to export. (see chapter Files => List files)

2) Chose a destination pool type export. (see chapter Pools => List pools)

3) Create a new task type Offline archive. (see chapter Tasks => Add task pools)

Trends

Fetch various utilisation trends

This command allow you to list the tasks trends.

Example of request:

require 'rest-client'

url = "http://example.com/api/trends/rules_history"
response = RestClient::Request.execute( method: :get, 
                    url: url, 
                    user: [username],
                    password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/trends/rules_history

The above command returns JSON structured like this:

{  
   "rules_history":[
      {  
         "start":"2016-08-11T10:30:29.000Z",
         "end":"2016-08-11T10:32:08.000Z",
         "time_between":99000,
         "rule_id":17,
         "bigger_file_size":10000000000,
         "smaller_file_size":999999488,
         "files_size_average":3999999658,
         "total_size":11999998976,
         "number_of_files":3
      }
    ],
   "status":"OK"
}

HTTP Request

GET http://example.com/api/trends/rules_history

Request response

Key name Type Description
rule_id Number Task id.
start Date Task start date.
end Date Task end date.
time_between Number Elapsed time in seconds.
bigger_file_size Number Size of the biggest file processed by the task in bytes.
smaller_file_sie Number Size of the smaller file processed by the task in bytes.
files_size_average Number Average size in bytes.
total_size Number Total size to process in byte.
number_of_files Number Number of files processed.

Request response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Files time

Show some time files statistics

Example of request:

require 'rest-client'

url = "http://example.com/api/trends/files_time"
response = RestClient::Request.execute( method: :get, 
                    url: url, 
                    user: [username],
                    password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/trends/files_time

The above command returns JSON structured like this:

{  
   "access_time":{  
      "less_1_week":{  
         "nb_files":530935,
         "nb_files_percentage":89.33,
         "nb_files_in_cache":530930,
         "nb_files_in_cache_percentage":89.84,
         "size":423461257423,
         "size_percentage":16.79,
         "size_in_cache":423461236943,
         "size_in_cache_percentage":16.0
      },
      "less_1_month":{  
         "nb_files":62807,
         "nb_files_percentage":10.57,
         "nb_files_in_cache":59440,
         "nb_files_in_cache_percentage":10.06,
         "size":10298541364,
         "size_percentage":0.41,
         "size_in_cache":10284750132,
         "size_in_cache_percentage":0.0
      }
   },
   "creation_time":{  
      "less_1_week":{  
         "nb_files":530935,
         "nb_files_percentage":89.33,
         "nb_files_in_cache":530930,
         "nb_files_in_cache_percentage":89.84,
         "size":423461261519,
         "size_percentage":16.79,
         "size_in_cache":423461241039,
         "size_in_cache_percentage":16.0
      },
      "less_1_month":{  
         "nb_files":62806,
         "nb_files_percentage":10.57,
         "nb_files_in_cache":59439,
         "nb_files_in_cache_percentage":10.06,
         "size":10298537268,
         "size_percentage":0.41,
         "size_in_cache":10284746036,
         "size_in_cache_percentage":0.0
      }
   },
   "trends_log_time":"2017-01-01T11:11:11Z",
   "status":"OK",
   "code":200
}

HTTP Request

GET http://example.com/api/trends/files_time

Request response

Key name Type Description
nb_files Number Number of files accessed or created in the time lapsed.
nb_files_percentage Number Percentage against total appliance files.
nb_files_in_cache Number Same as nb_files but only on cached files.
nb_files_in_cache_percentage Number Same as nb_files_percentage but only on cached files.
size Number Total files size accessed or created in the time lapsed.
size_percentage Number Total files size percentage.
size_in_cache Number Total cached files size.
size_in_cache_percentage Number Total cached files size percentage.

Request response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

File users

Show some statistics on users files access

Example of request:

require 'rest-client'

url = "http://example.com/api/trends/files_user"
response = RestClient::Request.execute( method: :get, 
                    url: url, 
                    user: [username],
                    password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/trends/files_user

The above command returns JSON structured like this:

{  
   "access_user_size":{  
      "user1":{  
         "less_1_week":{  
            "nb_files":530907,
            "nb_files_percentage":89.33,
            "nb_files_in_cache":530907,
            "nb_files_in_cache_percentage":89.84,
            "size":423299534966,
            "size_percentage":16.79,
            "size_in_cache":423299534966,
            "size_in_cache_percentage":16.79
         },
         "less_1_month":{  
            "nb_files":62807,
            "nb_files_percentage":10.57,
            "nb_files_in_cache":59440,
            "nb_files_in_cache_percentage":10.06,
            "size":10298541364,
            "size_percentage":0.41,
            "size_in_cache":10284750132,
            "size_in_cache_percentage":0.41
         },
         "less_3_months":{  
            "nb_files":115,
            "nb_files_percentage":0.02,
            "nb_files_in_cache":115,
            "nb_files_in_cache_percentage":0.02,
            "size":455330958588,
            "size_percentage":18.06,
            "size_in_cache":455330958588,
            "size_in_cache_percentage":18.06
         },
         "nb_files":594308,
         "nb_files_percentage":100.0,
         "nb_files_in_cache":590941,
         "nb_files_in_cache_percentage":100.0,
         "size":2521585859238,
         "size_percentage":99.99,
         "size_in_cache":2521572068006,
         "size_in_cache_percentage":99.99
      }
   },
   "creation_user_size":{  
      "user1":{  
         "less_1_week":{  
            "nb_files":530907,
            "nb_files_percentage":89.33,
            "nb_files_in_cache":530907,
            "nb_files_in_cache_percentage":89.84,
            "size":423299539062,
            "size_percentage":16.79,
            "size_in_cache":423299539062,
            "size_in_cache_percentage":16.79
         },
         "less_1_month":{  
            "nb_files":62806,
            "nb_files_percentage":10.57,
            "nb_files_in_cache":59439,
            "nb_files_in_cache_percentage":10.06,
            "size":10298537268,
            "size_percentage":0.41,
            "size_in_cache":10284746036,
            "size_in_cache_percentage":0.41
         },
         "less_3_months":{  
            "nb_files":595,
            "nb_files_percentage":0.1,
            "nb_files_in_cache":595,
            "nb_files_in_cache_percentage":0.1,
            "size":2087987782908,
            "size_percentage":82.8,
            "size_in_cache":2087987782908,
            "size_in_cache_percentage":82.8
         },
         "nb_files":594308,
         "nb_files_percentage":100.0,
         "nb_files_in_cache":590941,
         "nb_files_in_cache_percentage":100.0,
         "size":2521585859238,
         "size_percentage":99.99,
         "size_in_cache":2521572068006,
         "size_in_cache_percentage":99.99
      }
   },
   "trends_log_time":"2017-01-01T11:11:11Z",
   "status":"OK",
   "code":200
}

HTTP Request

GET http://example.com/api/trends/files_user

Request response

Key name Type Description
nb_files Number Number of files accessed or created in the time lapsed.
nb_files_percentage Number Percentage against total appliance files.
nb_files_in_cache Number Same as nb_files but only on cached files.
nb_files_in_cache_percentage Number Same as nb_files_percentage but only on cached files.
size Number Total files size accessed or created in the time lapsed.
size_percentage Number Total files size percentage.
size_in_cache Number Total cached files size.
size_in_cache_percentage Number Total cached files size percentage.
trends_log_time String Date of Statistics. Last update.

Request response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

File groups

Show some statistics on groups files access

Example of request:

require 'rest-client'

url = "http://example.com/api/trends/files_group"
response = RestClient::Request.execute( method: :get, 
                    url: url, 
                    user: [username],
                    password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/trends/files_group

The above command returns JSON structured like this:

{  
   "access_group_size":{  
      "group1":{  
         "less_1_week":{  
            "nb_files":530907,
            "nb_files_percentage":89.33,
            "nb_files_in_cache":530907,
            "nb_files_in_cache_percentage":89.84,
            "size":423299534966,
            "size_percentage":16.79,
            "size_in_cache":423299534966,
            "size_in_cache_percentage":16.79
         },
         "less_1_month":{  
            "nb_files":62807,
            "nb_files_percentage":10.57,
            "nb_files_in_cache":59440,
            "nb_files_in_cache_percentage":10.06,
            "size":10298541364,
            "size_percentage":0.41,
            "size_in_cache":10284750132,
            "size_in_cache_percentage":0.41
         },
         "less_3_months":{  
            "nb_files":115,
            "nb_files_percentage":0.02,
            "nb_files_in_cache":115,
            "nb_files_in_cache_percentage":0.02,
            "size":455330958588,
            "size_percentage":18.06,
            "size_in_cache":455330958588,
            "size_in_cache_percentage":18.06
         },
         "nb_files":594308,
         "nb_files_percentage":100.0,
         "nb_files_in_cache":590941,
         "nb_files_in_cache_percentage":100.0,
         "size":2521585859238,
         "size_percentage":99.99,
         "size_in_cache":2521572068006,
         "size_in_cache_percentage":99.99
      }
   },
   "creation_group_size":{  
      "group1":{  
         "less_1_week":{  
            "nb_files":530907,
            "nb_files_percentage":89.33,
            "nb_files_in_cache":530907,
            "nb_files_in_cache_percentage":89.84,
            "size":423299539062,
            "size_percentage":16.79,
            "size_in_cache":423299539062,
            "size_in_cache_percentage":16.79
         },
         "less_1_month":{  
            "nb_files":62806,
            "nb_files_percentage":10.57,
            "nb_files_in_cache":59439,
            "nb_files_in_cache_percentage":10.06,
            "size":10298537268,
            "size_percentage":0.41,
            "size_in_cache":10284746036,
            "size_in_cache_percentage":0.41
         },
         "less_3_months":{  
            "nb_files":595,
            "nb_files_percentage":0.1,
            "nb_files_in_cache":595,
            "nb_files_in_cache_percentage":0.1,
            "size":2087987782908,
            "size_percentage":82.8,
            "size_in_cache":2087987782908,
            "size_in_cache_percentage":82.8
         },
         "nb_files":594308,
         "nb_files_percentage":100.0,
         "nb_files_in_cache":590941,
         "nb_files_in_cache_percentage":100.0,
         "size":2521585859238,
         "size_percentage":99.99,
         "size_in_cache":2521572068006,
         "size_in_cache_percentage":99.99
      }
   },
   "trends_log_time":"2017-01-01T11:11:11Z",
   "status":"OK",
   "code":200
}

HTTP Request

GET http://example.com/api/trends/files_group

Request response

Key name Type Description
nb_files Number Number of files accessed or created in the time lapsed.
nb_files_percentage Number Percentage against total appliance files.
nb_files_in_cache Number Same as nb_files but only on cached files.
nb_files_in_cache_percentage Number Same as nb_files_percentage but only on cached files.
size Number Total files size accessed or created in the time lapsed.
size_percentage Number Total files size percentage.
size_in_cache Number Total cached files size.
size_in_cache_percentage Number Total cached files size percentage.
trends_log_time String Date of Statistics. Last update.

Request response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

File shares

Show some statistics on files classified by shares

Example of request:

require 'rest-client'

url = "http://example.com/api/trends/files_share"
response = RestClient::Request.execute( method: :get, 
                    url: url, 
                    user: [username],
                    password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/trends/files_share

The above command returns JSON structured like this:

{  
   "access_share_size":{  
      "ShareABC":{  
         "less_1_week":{  
            "nb_files":530907,
            "nb_files_percentage":89.33,
            "nb_files_in_cache":530907,
            "nb_files_in_cache_percentage":89.84,
            "size":423299534966,
            "size_percentage":16.79,
            "size_in_cache":423299534966,
            "size_in_cache_percentage":16.79
         },
         "less_1_month":{  
            "nb_files":62807,
            "nb_files_percentage":10.57,
            "nb_files_in_cache":59440,
            "nb_files_in_cache_percentage":10.06,
            "size":10298541364,
            "size_percentage":0.41,
            "size_in_cache":10284750132,
            "size_in_cache_percentage":0.41
         },
         "less_3_months":{  
            "nb_files":115,
            "nb_files_percentage":0.02,
            "nb_files_in_cache":115,
            "nb_files_in_cache_percentage":0.02,
            "size":455330958588,
            "size_percentage":18.06,
            "size_in_cache":455330958588,
            "size_in_cache_percentage":18.06
         },
         "nb_files":594308,
         "nb_files_percentage":100.0,
         "nb_files_in_cache":590941,
         "nb_files_in_cache_percentage":100.0,
         "size":2521585859238,
         "size_percentage":99.99,
         "size_in_cache":2521572068006,
         "size_in_cache_percentage":99.99
      }
   },
   "creation_user_size":{  
      "ShareABC":{  
         "less_1_week":{  
            "nb_files":530907,
            "nb_files_percentage":89.33,
            "nb_files_in_cache":530907,
            "nb_files_in_cache_percentage":89.84,
            "size":423299539062,
            "size_percentage":16.79,
            "size_in_cache":423299539062,
            "size_in_cache_percentage":16.79
         },
         "less_1_month":{  
            "nb_files":62806,
            "nb_files_percentage":10.57,
            "nb_files_in_cache":59439,
            "nb_files_in_cache_percentage":10.06,
            "size":10298537268,
            "size_percentage":0.41,
            "size_in_cache":10284746036,
            "size_in_cache_percentage":0.41
         },
         "less_3_months":{  
            "nb_files":595,
            "nb_files_percentage":0.1,
            "nb_files_in_cache":595,
            "nb_files_in_cache_percentage":0.1,
            "size":2087987782908,
            "size_percentage":82.8,
            "size_in_cache":2087987782908,
            "size_in_cache_percentage":82.8
         },
         "nb_files":594308,
         "nb_files_percentage":100.0,
         "nb_files_in_cache":590941,
         "nb_files_in_cache_percentage":100.0,
         "size":2521585859238,
         "size_percentage":99.99,
         "size_in_cache":2521572068006,
         "size_in_cache_percentage":99.99
      }
   },
   "trends_log_time":"2017-01-01T11:11:11Z",
   "status":"OK",
   "code":200
}

HTTP Request

GET http://example.com/api/trends/files_share

Request response

Key name Type Description
nb_files Number Number of files accessed or created in the time lapsed.
nb_files_percentage Number Percentage against total appliance files.
nb_files_in_cache Number Same as nb_files but only on cached files.
nb_files_in_cache_percentage Number Same as nb_files_percentage but only on cached files.
size Number Total files size accessed or created in the time lapsed.
size_percentage Number Total files size percentage.
size_in_cache Number Total cached files size.
size_in_cache_percentage Number Total cached files size percentage.
trends_log_time String Date of Statistics. Last update.

Request response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

File Extension Categories

Show some statistics on files classified by personnalized group of extension

Example of request:

require 'rest-client'

url = "http://example.com/api/trends/files_category"
response = RestClient::Request.execute( method: :get, 
                    url: url, 
                    user: [username],
                    password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/trends/files_category

The above command returns JSON structured like this:

{  
   "access_share_size":{  
      "Movies":{  
         "less_1_week":{  
            "nb_files":530907,
            "nb_files_percentage":89.33,
            "nb_files_in_cache":530907,
            "nb_files_in_cache_percentage":89.84,
            "size":423299534966,
            "size_percentage":16.79,
            "size_in_cache":423299534966,
            "size_in_cache_percentage":16.79
         },
         "less_1_month":{  
            "nb_files":62807,
            "nb_files_percentage":10.57,
            "nb_files_in_cache":59440,
            "nb_files_in_cache_percentage":10.06,
            "size":10298541364,
            "size_percentage":0.41,
            "size_in_cache":10284750132,
            "size_in_cache_percentage":0.41
         },
         "less_3_months":{  
            "nb_files":115,
            "nb_files_percentage":0.02,
            "nb_files_in_cache":115,
            "nb_files_in_cache_percentage":0.02,
            "size":455330958588,
            "size_percentage":18.06,
            "size_in_cache":455330958588,
            "size_in_cache_percentage":18.06
         },
         "nb_files":594308,
         "nb_files_percentage":100.0,
         "nb_files_in_cache":590941,
         "nb_files_in_cache_percentage":100.0,
         "size":2521585859238,
         "size_percentage":99.99,
         "size_in_cache":2521572068006,
         "size_in_cache_percentage":99.99
      }
   },
   "creation_user_size":{  
      "Movies":{  
         "less_1_week":{  
            "nb_files":530907,
            "nb_files_percentage":89.33,
            "nb_files_in_cache":530907,
            "nb_files_in_cache_percentage":89.84,
            "size":423299539062,
            "size_percentage":16.79,
            "size_in_cache":423299539062,
            "size_in_cache_percentage":16.79
         },
         "less_1_month":{  
            "nb_files":62806,
            "nb_files_percentage":10.57,
            "nb_files_in_cache":59439,
            "nb_files_in_cache_percentage":10.06,
            "size":10298537268,
            "size_percentage":0.41,
            "size_in_cache":10284746036,
            "size_in_cache_percentage":0.41
         },
         "less_3_months":{  
            "nb_files":595,
            "nb_files_percentage":0.1,
            "nb_files_in_cache":595,
            "nb_files_in_cache_percentage":0.1,
            "size":2087987782908,
            "size_percentage":82.8,
            "size_in_cache":2087987782908,
            "size_in_cache_percentage":82.8
         },
         "nb_files":594308,
         "nb_files_percentage":100.0,
         "nb_files_in_cache":590941,
         "nb_files_in_cache_percentage":100.0,
         "size":2521585859238,
         "size_percentage":99.99,
         "size_in_cache":2521572068006,
         "size_in_cache_percentage":99.99
      }
   },
   "trends_log_time":"2017-01-01T11:11:11Z",
   "status":"OK",
   "code":200
}

HTTP Request

GET http://example.com/api/trends/files_category

Request response

Key name Type Description
nb_files Number Number of files accessed or created in the time lapsed.
nb_files_percentage Number Percentage against total appliance files.
nb_files_in_cache Number Same as nb_files but only on cached files.
nb_files_in_cache_percentage Number Same as nb_files_percentage but only on cached files.
size Number Total files size accessed or created in the time lapsed.
size_percentage Number Total files size percentage.
size_in_cache Number Total cached files size.
size_in_cache_percentage Number Total cached files size percentage.
trends_log_time String Date of Statistics. Last update.

Request response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

File Sizes

Show some statistics on files classified by file sizes.

Key name Description
less_100_kb files < 100 KB
less_1_mb files > 100 KB & < 1 MB
less_10_mb files > 1 MB & < 10 MB
less_100_mb files > 10 MB & < 100 MB
less_1_go files > 100 MB & < 1 GB
less_10_gb files > 1 GB & < 10 GB
less_100_gb files > 10 GB & < 100 GB
more_100_gb files > 100 GB

Example of request:

require 'rest-client'

url = "http://example.com/api/trends/files_size"
response = RestClient::Request.execute( method: :get, 
                    url: url, 
                    user: [username],
                    password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/trends/files_size

The above command returns JSON structured like this:

{  
   "access_size":{  
      "more_100_gb":{  
         "less_1_week":{  
            "nb_files":530907,
            "nb_files_percentage":89.33,
            "nb_files_in_cache":530907,
            "nb_files_in_cache_percentage":89.84,
            "size":423299539062,
            "size_percentage":16.79,
            "size_in_cache":423299539062,
            "size_in_cache_percentage":16.79
         },
         "less_1_month":{  
            "nb_files":62806,
            "nb_files_percentage":10.57,
            "nb_files_in_cache":59439,
            "nb_files_in_cache_percentage":10.06,
            "size":10298537268,
            "size_percentage":0.41,
            "size_in_cache":10284746036,
            "size_in_cache_percentage":0.41
         },
         "less_3_months":{  
            "nb_files":595,
            "nb_files_percentage":0.1,
            "nb_files_in_cache":595,
            "nb_files_in_cache_percentage":0.1,
            "size":2087987782908,
            "size_percentage":82.8,
            "size_in_cache":2087987782908,
            "size_in_cache_percentage":82.8
         },
         "nb_files":594308,
         "nb_files_percentage":100.0,
         "nb_files_in_cache":590941,
         "nb_files_in_cache_percentage":100.0,
         "size":2521585859238,
         "size_percentage":99.99,
         "size_in_cache":2521572068006,
         "size_in_cache_percentage":99.99
      },
      "less_10_gb":{
         "less_1_week":{  
            "nb_files":530907,
            "nb_files_percentage":89.33,
            "nb_files_in_cache":530907,
            "nb_files_in_cache_percentage":89.84,
            "size":423299539062,
            "size_percentage":16.79,
            "size_in_cache":423299539062,
            "size_in_cache_percentage":16.79
         },
         "less_1_month":{  
            "nb_files":62806,
            "nb_files_percentage":10.57,
            "nb_files_in_cache":59439,
            "nb_files_in_cache_percentage":10.06,
            "size":10298537268,
            "size_percentage":0.41,
            "size_in_cache":10284746036,
            "size_in_cache_percentage":0.41
         },
         "less_3_months":{  
            "nb_files":595,
            "nb_files_percentage":0.1,
            "nb_files_in_cache":595,
            "nb_files_in_cache_percentage":0.1,
            "size":2087987782908,
            "size_percentage":82.8,
            "size_in_cache":2087987782908,
            "size_in_cache_percentage":82.8
         },
         "nb_files":594308,
         "nb_files_percentage":100.0,
         "nb_files_in_cache":590941,
         "nb_files_in_cache_percentage":100.0,
         "size":2521585859238,
         "size_percentage":99.99,
         "size_in_cache":2521572068006,
         "size_in_cache_percentage":99.99
      },
      "less_10_mb":{ ... },
      "less_1_gb":{ ... },
      "less_100_kb":{ ... },
      "less_100_mb":{ ... },
      "less_100_gb":{ ... },
      "less_1_mb":{ ... }
   },
   "creation_size":{  
      "more_100_gb":{ ... },
      "less_10_gb":{ ... },
      "less_10_mb":{ ... },
      "less_1_gb":{ ... },
      "less_100_kb":{ ... },
      "less_100_mb":{ ... },
      "less_100_gb":{ ... },
      "less_1_mb":{ ... }
   },
   "trends_log_time":"2017-01-01T11:11:11Z",
   "status":"OK",
   "code":200
}

HTTP Request

GET http://example.com/api/trends/files_size

Request response

Key name Type Description
nb_files Number Number of files accessed or created in the time lapsed.
nb_files_percentage Number Percentage against total appliance files.
nb_files_in_cache Number Same as nb_files but only on cached files.
nb_files_in_cache_percentage Number Same as nb_files_percentage but only on cached files.
size Number Total files size accessed or created in the time lapsed.
size_percentage Number Total files size percentage.
size_in_cache Number Total cached files size.
size_in_cache_percentage Number Total cached files size percentage.
trends_log_time String Date of Statistics. Last update.

Request response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Trends extensions

The users can add custom extension to generate statistics with filtered files

List custom extension

This command allow you to list all the custom extension configured.

Example of request:

require 'rest-client'

url = "http://example.com/api/trends/extensions"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/trends/extensions

The above command returns JSON structured like this:

{  
   "extensions":{  
      "Documents":[  
         "doc",
         "docx",
         "pdf"
      ],
      "video":[  
         "avi",
         "mkv",
         "mp4"
      ]
   }
}

HTTP Request

GET http://example.com/api/trends/extensions

Request response

Request response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Add custom extension

This command allow you to create a new custom extension watch.

Adding an extension

require 'rest-client'

#JSON describing the new extension
var_json = {  
   "extension" => {  
      "category" => "Documents",
      "extensions" => [  
         "doc",
         "docx",
         "pdf"
      ]
   }
}

url = "http://example.com/api/trends/extensions"
response = RestClient::Request.execute( method: :post, 
                    url: url, 
                    user: [username],
                    password: [password],
                    payload: var_json)
curl -H "Content-Type: application/json" 
   -X POST 
   -d '{  
   "extension":{  
      "category":"Documents",
      "extensions":[  
         "doc",
         "docx",
         "pdf"
      ]
   }
}' 
  http://[username]:[password]@example.com/api/trends/extensions

The above command returns JSON structured like this:

{  
   "message": "Task created",
   "status": "OK"
}

HTTP Request

POST http://example.com/api/trends/extensions

Request parameter

Key name Type Description
category String Category name of the new extension watch.
extensions Array The list of the files extensions to watch.

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Update custom extension

This command allow you to create a new custom extension watch.

Adding an extension

require 'rest-client'

#JSON describing the extension
var_json = {  
   "extension" => {  
      "category" => "Documents",
      "extensions" => [  
         "doc",
         "docx",
         "pdf"
      ],
      "cur_category" => "Documents_old_name",
      "old_ext" => [  
         "doc",
         "pdf"
      ]
   }
}

url = "http://example.com/api/trends/extensions"
response = RestClient::Request.execute( method: :put, 
                    url: url, 
                    user: [username],
                    password: [password],
                    payload: var_json)
curl -H "Content-Type: application/json" 
   -X PUT 
   -d '{  
   "extension":{  
      "category":"Documents",
      "extensions":[  
         "doc",
         "docx",
         "pdf"
      ],
      "cur_category":"Documents_old_name",
      "old_ext":[  
         "doc",
         "pdf"
      ]
   }
}' 
  http://[username]:[password]@example.com/api/trends/extensions

The above command returns JSON structured like this:

{  
   "message": "Task created",
   "status": "OK"
}

HTTP Request

PUT http://example.com/api/trends/extensions

Request parameter

Key name Type Description
category String Category name of the new extension watch.
cur_category String Old category name of the extension watch.
extensions Array The list of the files extensions to watch.
old_ext Array The old list of the files extensions.

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Delete custom extension

This command allow you to delete custom extension watch.

Delete an extension

require 'rest-client'

#JSON describing the new task
var_json = {"category":"Docs"}

url = "http://example.com/api/trends/extensions"
response = RestClient::Request.execute( method: :delete, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: var_json)
curl -H "Content-Type: application/json" 
     -X DELETE 
     -d '{"category":"Docs"}'
    http://[username]:[password]@example.com/api/trends/extensions

The above command returns JSON structured like this:

HTTP Request

DELETE http://example.com/api/trends/extensions

Request parameter

Key name Type Description
category String Category name of the extension watch.

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Stats

Stats files

Retrieve statistics about files on the system.

Example of request:

require 'rest-client'

url = "http://example.com/api/frontend/stats/files"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/frontend/stats/files

The above command returns JSON structured like this:

{  
   "stats":{  
      "top":{  
         "dcm":42127,
         "tst":14236,
         "svn-base":7230,
         "jpg":6193,
         "c":4919,
         "dll":4443,
         "h":4401,
         "gif":3192,
         "htm":2568,
         "sql":2483
      },
      "files":141354,
      "size":15376977578448
   },
   "status":"OK"
}

HTTP Request

GET http://example.com/api/frontend/stats/files

Request response

Key name Type Description
top Hash Top 10 of files extension. key: Extension file, value: Number of elements.
files Number Number of files in catalog.
size Number Total file size in catalog in byte.

Error response

Key name Type Description
message String Describe the error.
status String value = ERROR

Stats cache

Retrieve statistics about the cache

Example of request:

require 'rest-client'

url = "http://example.com/api/frontend/stats/cache"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/frontend/stats/cache

The above command returns JSON structured like this:

{  
   "stats":{  
      "total":9920300187648,
      "available":5030325358592
   },
   "status":"OK"
}

HTTP Request

GET http://example.com/api/frontend/stats/cache

Request response

Key name Type Description
total Number Total cache size in byte.
available Number Free cache size in byte.

Error response

Key name Type Description
message String Describe the error.
status String value = ERROR

Stats libraries

Retrieve statistics about the libraries

Example of request:

require 'rest-client'

url = "http://example.com/api/backend/stats/C60C825138DB4378B3870030"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/backend/stats/C60C825138DB4378B3870030

The above command returns JSON structured like this:

{  
   "status":"OK",
   "stats":{  
      "00L2U78AW009_LL0":{  
         "name":"IBM 3100",
         "id":2,
         "storage_slots":23,
         "storage_slots_address":4096,
         "io_slots":1,
         "io_slots_address":16,
         "ready":true,
         "online":true,
         "vendor":"IBM",
         "product":"3573-TL",
         "firmware":"C.20",
         "device":"sg5",
         "comment":"",
         "volumes":{  
            "CLNU04L1":{  },
            "MTC512L5":{  },
            "MTC500L5":{  },
            "MTC511L5":{  
               "id":5,
               "locked":0,
               "location":"Slot 20",
               "scratch":0,
               "cleaning":0,
               "write_protect":0,
               "mounted":0,
               "ejected":0,
               "mount_count":14,
               "date_in":"2016-02-01T14:28:43.000Z",
               "date_move":"2016-02-02T10:04:59.000Z",
               "total":1424997482496,
               "free":1329415585792,
               "pool":"Import",
               "pool_type":2
            },
            "MTC501L5":{  
               "id":16,
               "locked":1,
               "location":"Drive 0",
               "scratch":0,
               "cleaning":0,
               "write_protect":0,
               "mounted":1,
               "ejected":0,
               "mount_count":9,
               "date_in":"2016-02-02T16:36:05.000Z",
               "date_move":"2016-02-02T21:13:12.000Z",
               "total":1424997482496,
               "free":816639901696,
               "pool":"Export1",
               "pool_type":1
            }
         },
         "drives":{  
            "10WT024187":{  
               "number":0,
               "access":0,
               "full":1,
               "barcode":"MTC501L5",
               "mount_count":191,
               "current_action":"Idle",
               "online":true
            }
         }
      }
   }
}

HTTP Request

GET http://example.com/api/backend/stats/{library_serial}

library_serial : If not set return stats for all the libraries.

Request response

Hash containing the libraries stats

Key name Type Description
name String Library name set by user.
id Number Library id.
comment String User comment.
ready Boolean Physically accessible. Values: True: SCSI accessible, False: SCSI not accessible
online Boolean Software accessible. Can be disable for maintenance purpose. True: Accessible, False: Not accessible.
configured Number 0: Not configured, 1: configured.
vendor String Vendor name.
product String Product name.
firmware String Firmware code.
device String Linux SCSI generic device. E.G.: sg0
storage_slots Number Number of storage slots.
storage_slots_address Number First storage slot SCSI address.
io_slots Number Number of I/O station.
io_slots_address Number First I/O station SCSI address.
volumes Hash Media tape elements. Keys are media barcode.
id Hash Media id.
locked Number deprecated
location String Media location. Possible values: Slot X : located in the library storage slot, Drive X: location in a tape drive, Imp X: located in the library I/O station in Import mode, Exp X: located in the library I/O station in Export mode, Out: Exported from the library. X = number of the type location. Start to 0.
mounted Number 0: not mounted, 1: mounted in a tape drive.
ejected Number 0: media in library, 1: out the library.
mount_count Number Number of times the media was mount in a drive.
total Number Total size in byte.
free Number Free size in byte.
date_in String Insert date of the media in the appliance configuration.
date_move String Last of the last move.
pool String Pool name.
pool_type Number Pool type: 0 : Storage pool, 1 : Export pool, 2 : Import pool.
drives Hash Configured tape drives elements. Keys are drives serial.
number Number Drive position. Deprecated.
scsi_address Number Physical drive SCSI address.
mount_count Number Drive mount count.
full Number 0: Empty drive, 1: Mounted drive.
barcode String Media barcode if the drive is mounted.
online Boolean Software accessible. Can be disable for maintenance purpose. True: Accessible, False: Not accessible.
current_action String Current action. Values: Idle, Reading, Writing, Umounting LTFS FileSystem, Dismounting Tape, Mounting Tape, Mounting LTFS FileSystem, Formatting LTFS FileSystem.
current_task String Current handled task.
bandwidth Number Writing or reading bandwidth in Bytes/Second depending of the current action.

Error response

Key name Type Description
message String Describe the error.
status String value = ERROR

Full stats

Retrieve statistics and limitation of all system

Example of request:

require 'rest-client'

url = "http://example.com/api/stats"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/stats

The above command returns JSON structured like this:

{  
   "stats":{  
      "appliance":{  
         "files":122316,
         "total":39845247320064,
         "free":25189623325791,
         "used":14655623994273
      },
      "frontend":{  
         "total":9920300187648,
         "free":6852829855744,
         "used":3067470331904,
         "shares":[  
            {  
               "name":"Test-share-phd",
               "id":13,
               "quota":4991782790103,
               "cache-usage":47,
               "guest-right":0,
               "size":404674375292,
               "cache-size":8192,
               "last-update":"2016-02-03T09:53:52.000Z",
               "comment":"Test share from script2"
            }
         ]
      },
      "backend":{
         "total":29924947132416,
         "free":17012938506240,
         "used":12912008626176,
         "libraries":[
            {
               "id":2,
               "name":"IBM 3100",
               "serial":"00L2U78AW009_LL0",
               "vendor":"IBM",
               "product":"3573-TL",
               "firmware":"C.20",
               "device":"sg5",
               "comment":"",
               "storage_slots":23,
               "storage_slots_address":4096,
               "io_slots":1,
               "io_slots_address":16,
               "ready":true,
               "online":true,
               "drives":[  
                  {  
                     "scsi_address":256,
                     "online":true,
                     "comment":"",
                     "vendor":"IBM",
                     "product":"ULT3580-HH6",
                     "firmware":"D8E5",
                     "dev":"st1",
                     "mount_count":193,
                     "volume":"MTC510L5",
                     "full":1
                  }
               ],
               "media":[
                  {  
                     "barcode":"MTC510L5",
                     "id":1,
                     "location":"Drive 0",
                     "mounted":1,
                     "ejected":0,
                     "pool":"Import",
                     "date_in":"2016-02-02T16:38:57.000Z",
                     "date_move":"2016-02-03T09:21:58.000Z",
                     "date_last_maintenance":"2015-12-18T09:53:16.000Z",
                     "date_last_repack":"2015-12-18T09:53:16.000Z",
                     "repack_status":0,
                     "size_total":1424997482496,
                     "size_free":19273351168
                  }
               ]
            }
         ]
      }
   },
   "status":"OK"
}

HTTP Request

GET http://example.com/api/stats

Request response

Hash containing all the stats

Key name Type Description
appliance Hash Appliance catalog status.
files Number Number of files in catalog.
total Number Total appliance size in byte.
free Number Appliance free space.
used Number Appliance used space.
frontend Hash Shared folders and cache status.
total Number Total cache size in byte.
free Number Free cache size in byte.
used Number Used cache size in byte.
shares Array Shared folders elements.
name String Share name.
id Number Share id.
quota Number Maximum size of share in byte.
cache-usage Number Maximum cache resource available in %.
guest-right Number Guest access: 0: no access, 5: read only, 7: read/write.
size Number Total share size.
cache-size Number Current size on cache in byte.
last-update Datetime Last time that the stats were updated.
comment String User comment.
backend Hash Libraries elements.
total Number Total size on libraries in byte.
free Number Free size on libraries in byte.
used Number Used size on libraries in byte.
libraries Array List of configured libraries elements.
id Number Library id.
name String Library name set by user.
comment String User comment.
ready Boolean Physically accessible. Values: True: SCSI accessible, False: SCSI not accessible.
online Boolean Software accessible. Can be disable for maintenance purpose. True: Accessible, False: Not accessible.
vendor String Vendor name.
product String Product name.
firmware String Firmware code.
dev String Linux SCSI generic device. E.G. : sg0
storage_slots Number Number of storage slots.
storage_slots_address Number First storage slot SCSI address.
io_slots Number Number of I/O station.
io_slots_address Number First I/O station SCSI address.
drives Array List of libraries tape drive elements.
scsi_address Number Physical drive SCSI address.
online Boolean Software accessible. Can be disable for maintenance purpose. True: Accessible, False: Not accessible.
mount_count Number Drive’s mount count.
full Number 0: Empty drive, 1: Mounted drive.
volume String Media barcode if the drive is mounted.
current_action String Current action. Values: Idle, Reading, Writing, Umounting LTFS FileSystem, Dismounting Tape, Mounting Tape, Mounting LTFS FileSystem, Formatting LTFS FileSystem.
current_task String Current handled task.
bandwidth Number Writing or reading bandwidth in Bytes/Second depending of the current action.
media Array List of tape media elements.
id Number Media id.
barcode String Media barcode.
location String Media location. Possible values: Slot X : located in the library storage slot, Drive X: location in a tape drive, Imp X: located in the library I/O station in Import mode, Exp X: located in the library I/O station in Export mode, Out: Exported from the library. X = number of the type location. Start to 0.
mounted Number 0: not mounted, 1: mounted in a tape drive.
ejected Number 0: media in library, 1: out the library.
mount_count Number Number of times the media was mount in a drive.
total Number Total size in byte.
free Number Free size in byte.
date_in String Insert date of the media in the appliance configuration.
date_move String Last of the last move.
pool String Pool name.

Error response

Key name Type Description
message String Describe the error.
status String value = ERROR

Logs

Retrieve event logs

Retrieve all the logs

Example of request:

require 'rest-client'

url = "http://example.com/api/system/logs"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/system/logs

The above command returns JSON structured like this:

{
    "code": 200,
    "logs": [
        {
            "date": "2017/08/01 - 11:43:48:   %6N UTC+0000",
            "message": "Storage Node Tape Service is Stopped Normaly",
            "degree": 0
        },
        {
            "date": "2017/08/01 - 11:43:43:   %6N UTC+0000",
            "message": "Workflow Manager Service is Stopped Normaly",
            "degree": 0
        }
    ],

HTTP Request

GET http://example.com/api/system/logs

Request response

An array of JSON representing all the logs.

Key name Type Description
date Datetime Log time.
degree Number Message severity level.
message String Text message.

Error response

Key name Type Description
message String Describe the error.
status String value = ERROR

Message severity level

Alerts

Email alerts

Get Email alerts configuration :

require 'rest-client'

url = "http://example.com/api/system/emails"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/system/emails

The above command returns JSON structured like this:

{  
   "emails":{  
      "server":"relay.server.be",
      "from":"ltfs@mail.com",
      "user":"username",
      "password":"password",
      "mails":[  
         {  
            "id":1,
            "activate":1,
            "email":"alan@mail.com",
            "notifications":[ 1, 10 ]
         },
         {  
            "id":2,
            "activate":1,
            "email":"boris@mail.com",
            "notifications":[ 9, 10 ]
         }
      ]
   },
   "status":"OK"
}

Set Email alerts configuration :

require 'rest-client'

mail_json = {
     "emails" => {  
      "server" => "relay.server.be",
      "from" => "ltfs@mail.com",
      "user" => "username",
      "password" => "password",
      "mails" => [  
         {  
            "id" => 1,
            "activate" => 1,
            "email" => "alan@mail.com",
            "notifications" => [ 1, 10 ]
         },
         {  
            "id" => 2,
            "activate" => 1,
            "email" => "boris@mail.com",
            "notifications" => [ 9, 10 ]
         }
      ]
   }
  }

url = "http://example.com/api/system/emails"
response = RestClient::Request.execute( method: :post, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: mail_json)
curl -H "Content-Type: application/json" 
     -X POST 
     -d '{
            "emails":{  
              "server":"relay.server.be",
              "from":"ltfs@mail.com",
              "user":"username",
              "password":"password",
              "mails":[  
                 {  
                    "id":1,
                    "activate":1,
                    "email":"alan@mail.com",
                    "notifications":[ 1, 10 ]
                 },
                 {  
                    "id":2,
                    "activate":1,
                    "email":"boris@mail.com",
                    "notifications":[ 9, 10 ]
                 }
              ]
           }
        }' 
    http://[username]:[password]@example.com/api/system/emails

Get current configuration

GET http://example.com/api/system/emails

response :

Key name Type Description
server String URL to the email server.
from String Name that appear in the email.
user String Authentication to the email server. Empty if not used.
password String Authentication to the email server. Empty if not used.
mails Array Emails details.
activate Boolean Enable this email.
email String Email address of the recipient.
notification Array Define the range of event level to send to this email.

Configure Email alerts

POST http://example.com/api/system/emails

parameters :

Key name Type Description
server String URL to the email server.
from String Name that appear in the email.
user String Authentication to the email server. Empty if not used.
password String Authentication to the email server. Empty if not used.
mails Array Emails details.
activate Boolean Enable this email.
email String Email address of the recipient.
notification Array Define the range of event level to send to this email.

SNMP alerts

Get SNMP alerts configuration :

require 'rest-client'

url = "http://example.com/api/system/snmp"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/system/snmp

The above command returns JSON structured like this:

{  
   "snmp":{  
      "server-version":"1",
      "server-community":"mtclab",
      "server-location":"LIEGE",
      "server-contact":"support@mail.com",
      "traps":[  
         {  
            "activate":true,
            "manager":"mon01.server.com",
            "notifications": [ 9, 10 ],
            "community":"public",
            "version":"1"
         }
      ]
   }
}

Set SNMP alerts configuration :

require 'rest-client'

snmp_json = {
         "snmp" => {  
          "server-version" => "1",
          "server-community" => "mtclab",
          "server-location" => "LIEGE",
          "server-contact" => "support@mail.com",
          "traps" => [  
             {  
                "activate" => true,
                "manager" => "mon01.server.com",
                "notifications" => [ 9, 10 ],
                "community" => "public",
                "version" => "1"
             }
          ]
       }
  }

url = "http://example.com/api/system/snmp"
response = RestClient::Request.execute( method: :post, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: snmp_json)
curl -H "Content-Type: application/json" 
     -X POST 
     -d '{
            "snmp":{  
              "server-version":"1",
              "server-community":"mtclab",
              "server-location":"LIEGE",
              "server-contact":"support@mail.com",
              "traps":[  
                 {  
                    "activate":true,
                    "manager":"mon01.server.com",
                    "notifications": [ 9, 10 ],
                    "community":"public",
                    "version":"1"
                 }
              ]
           }
        }' 
    http://[username]:[password]@example.com/api/system/snmp

Get current configuration

GET http://example.com/api/system/snmp

response :

Key name Type Description
server-version Integet SNMP version.
server-community String SNMP community.
server-location String Location phrase.
server-contact String SNMP contact.
traps Array Array of manager.
activate Boolean Enable this email.
manager String URL or IP of the recipient.
community String SNMP community of the recipient.
version Number SNMP version.

Configure Email alerts

POST http://example.com/api/system/snmp

parameters :

Key name Type Description
server-version Integet SNMP version.
server-community String SNMP community.
server-location String Location phrase.
server-contact String SNMP contact.
traps Array Array of manager.
activate Boolean Enable this email.
manager String URL or IP of the recipient.
community String SNMP community of the recipient.
version Number SNMP version.

Services

Services status

This command allow you to show some services status

Example of request:

require 'rest-client'

url = "http://example.com/api/system/services"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/system/services

The above command returns JSON structured like this:

{  
   "mtc_services":{  
      "supervisor":true,
      "manager":true,
      "watchdog":true,
      "catalog":true
   },
   "system_services":{  
      "web":true,
      "nfs":true,
      "cifs":true,
      "snmp":true
   },
   "cors":"true",
   "status":"OK"
}

HTTP Request

GET http://example.com/api/system/services

Request response

Key name Type Description
mtc_services Object MT-C services.
system_services Object Show some system services status like web, nfs and cifs.
cors String CORS activation status

Request response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Indexation Services status

This command allow you to show some indexation services status

Example of request:

require 'rest-client'

url = "http://example.com/api/system/services/indexation"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/system/services/indexation

The above command returns JSON structured like this:

{
   "indexation_services":{
      "index engine":true,
      "status":"idle",
      "importResponse":"",
      "statusMessages":{
         "Total Requests made to DataSource":"2",
         "Total Rows Fetched":"0",
         "Total Documents Processed":"0",
         "Total Documents Skipped":"0",
         "Delta Dump started":"2016-10-12 09:37:00",
         "Identifying Delta":"2016-10-12 09:37:00",
         "Deltas Obtained":"2016-10-12 09:37:13",
         "Building documents":"2016-10-12 09:37:13",
          "Total Changed Documents":"0",
         "Time taken":"0:0:13.653"
      }
   },
   "status":"OK"
}

HTTP Request

GET http://example.com/api/system/services/indexation

Request response

Key name Type Description
indexation_services Object Indexation services information.

Request response

Key name Type Description
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Manage services

This command allow you to manage services

Manage a service

require 'rest-client'

#JSON describing the new task
var_json = {  
   "service" => {  
      "name" => "web",
      "action" => "restart"
   }
}

url = "http://example.com/api/system/services"
response = RestClient::Request.execute( method: :post, 
                              url: url, 
                              user: [username],
                              password: [password],
                              payload: var_json)
curl -H "Content-Type: application/json" 
    -X POST 
    -d '{  
      "service":{  
         "name":"web",
         "action":"restart"
      }
}' 
   http://[username]:[password]@example.com/api/system/services

The above command returns JSON structured like this:

{  
   "message": "Task created",
   "status": "OK"
}

HTTP Request

POST http://example.com/api/system/services

Request parameter

Key name Type Description
name String Service name:
  • web,
  • nfs,
  • cifs,
  • all_services: All MT-C services,
  • core_superv: Monitoring service,
  • core_watchdog: Watchdog service,
  • core_ltfs: Manager service,
  • core_fuse: Catalog service.
action String Action to execute:
  • start,
  • stop,
  • restart.
Note: Only restart action is allow on MT-C services.

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Manage CORS

This command allow you to manage CORS, can be used with service management commands.

Manage a service

require 'rest-client'

#JSON describing the new task
var_json = {  
   "cors" => "true"
}

url = "http://example.com/api/system/services"
response = RestClient::Request.execute( method: :post, 
                              url: url, 
                              user: [username],
                              password: [password],
                              payload: var_json)
curl -H "Content-Type: application/json" 
    -X POST 
    -d '{  
      "cors":"true"
}' 
   http://[username]:[password]@example.com/api/system/services

The above command returns JSON structured like this:

{  
   "status": "OK"
}

HTTP Request

POST http://example.com/api/system/services

Request parameter

Key name Type Description
cors String Set CORS as active (true) or inactive (false)

Request response

Key name Type Description
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

File System status

This command allow you to show some file system status

Example of request:

require 'rest-client'

url = "http://example.com/api/system/services/filesystems"
response = RestClient::Request.execute( method: :get, 
                              url: url, 
                              user: [username],
                              password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/system/services/filesystems

The above command returns JSON structured like this:

{
    "filesystems": {
        "0": {
            "used": 485693768,
            "blocks": 861948712,
            "mount_point": "/",
            "available": 332463840,
            "attributes": "(rw)",
            "use_percent": 0.60,
            "name": "/dev/sda2",
            "type": "ext4"
        },
        "1": {
            "used": 66364,
            "blocks": 499656,
            "mount_point": "/boot",
            "available": 407080,
            "attributes": "(rw)",
            "use_percent": 0.15,
            "name": "/dev/sda1",
            "type": "ext4"
        },
        "2": {
            "used": 5371543948,
            "blocks": 11535378272,
            "mount_point": "/mnt/CACHE",
            "available": 5577863944,
            "attributes": "(rw,user_xattr)",
            "use_percent": 0.50,
            "name": "/dev/sdb1",
            "type": "ext4"
        },
        "3": {
            "mount_point": "/proc/sys/fs/binfmt_misc",
            "attributes": "(rw)",
            "name": "none",
            "type": "binfmt_misc"
        },
        "4": {
            "mount_point": "/var/lib/nfs/rpc_pipefs",
            "attributes": "(rw)",
            "name": "sunrpc",
            "type": "rpc_pipefs"
        },
        "5": {
            "used": null,
            "blocks": null,
            "mount_point": "/mnt/MOUNT_POINTS/nfs1",
            "available": null,
            "attributes": "(rw,vers=3,rsize=8192,wsize=8192,timeo=14,intr,retrans=1,addr=10.3.1.80)",
            "use_percent": null,
            "name": "10.3.1.80:/Q/shares/LTFS_NFS3",
            "type": "nfs"
        },
        "6": {
            "used": 215065600,
            "blocks": 1391601152,
            "mount_point": "/mnt/LTFS/MTC506L5",
            "available": 1176535552,
            "attributes": "(rw,nosuid,nodev,default_permissions,allow_other)",
            "use_percent": 0.16,
            "name": "ltfs:/dev/sg2",
            "type": "fuse"
        }
    },
    "status": "OK"
}

HTTP Request

GET http://example.com/api/system/services/filesystems

Request response

Key name Type Description
filesystems Hash Contains all the filesystems.
used Number Bytes used
blocks number Blocks used
mount_point String Path of the mount point
available Number Bytes available
attributes String list of the attributes
use_percent number percentage of size used
name String name of the filesystem
type String type of the filesystem {fuse, nfs, ext4, …}

Request response

Key name Type Description
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

System settings

Get network configuration (Deprecated)

Get network configuration :

require 'rest-client'

url = "http://example.com/api/system/network"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/system/network

The above command returns JSON structured like this:

{
    "network": {
        "bond0": {
            "netmask": null,
            "onboot": 0,
            "interfaces": {
                "em3": null,
                "em4": null,
                "em1": null,
                "em2": null
            },
            "mode": 0,
            "gateway": null,
            "ip": null
        },
        "hostname": "LTFS-APP",
        "interfaces": {
            "em3": {
                "netmask": null,
                "bond": 0,
                "onboot": 0,
                "speed": "unknown",
                "dhcp": 1,
                "defaultroute": 0,
                "gateway": null,
                "mac": "C8:1F:66:22:11:00",
                "ip": null,
                "gwInUse": 0,
                "status": "unavailable"
            },
            "em4": {
                "netmask": "255.255.255.0",
                "bond": 0,
                "onboot": 1,
                "speed": "1000 Mb/s",
                "dhcp": 0,
                "defaultroute": 1,
                "gateway": "192.168.1.10",
                "mac": "C8:1F:66:22:11:00",
                "ip": "10.3.1.187",
                "gwInUse": 1,
                "status": "connected"
            },
            "em1": {
                "netmask": null,
                "bond": 0,
                "onboot": 0,
                "speed": "1000 Mb/s",
                "dhcp": 0,
                "defaultroute": 1,
                "gateway": null,
                "mac": "C8:1F:66:22:11:00",
                "ip": null,
                "gwInUse": 0,
                "status": "disconnected"
            },
            "em2": {
                "netmask": null,
                "bond": 0,
                "onboot": 0,
                "speed": "1000 Mb/s",
                "dhcp": 0,
                "defaultroute": 0,
                "gateway": null,
                "mac": "C8:1F:66:22:11:00",
                "ip": null,
                "gwInUse": 0,
                "status": "disconnected"
            }
        },
        "gateway": "192.168.1.1",
        "dns": {
            "secondary": null,
            "primary": "192.168.1.200"
        }
    },
    "status": "OK"
}

HTTP Request

GET http://example.com/api/system/network

Request response

Key name Type Description
hostname String Appliance Hostname.
interfaces JSON Some information about the network interfaces.
onboot Number
  • 0 : not loaded on boot,
  • 1 : loaded on boot.
defaultroute Number
  • 0 : not the default route,
  • 1 : is the default route.
dhcp Number
  • 0 : static configuration,
  • 1 : DHCP (automatic).
ip String IP address (if static configuration).
netmask String Sub-network mask of the IP (if static configuration).
gateway String Default gateway (if static configuration).
gwInUse Number
  • 0 : no default gateway (or bypassed),
  • 1 : default gateway in use.
bond Number
  • 0 : not used in bonding,
  • 1 : used in bonding.
mac String device MAC address.
status String Some information about the status of the interface.
speed String Interface link speed.
bond0 JSON Some information about the bonding.
onboot Number
  • 0 : not loaded on boot,
  • 1 : loaded on boot.
ip String IP address.
netmask String Sub-network mask of the IP.
gateway String Default gateway.
mode Number Bonding mode :
  • 0 : Round robin,
  • 1 : Active backup,
  • 4 : LACP.
interfaces JSON List of interfaces : if they’re part of the bonding, their mac address is the value identified by their name. Otherwise, it contains a null value.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Get interface configuration (Deprecated)

Get interface configuration :

require 'rest-client'

url = "http://example.com/api/system/network/eth0"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/system/network/eth0

The above command returns JSON structured like this:

{
    "network": {
        "netmask": "255.255.255.0",
        "onboot": 0,
        "dhcp": 0,
        "defaultroute": 0,
        "mac": "",
        "gateway": 192.168.1.1,
        "ip": "192.168.1.123",
        "gwInUse": 0
    },
    "status": "OK"
}

HTTP Request

GET http://example.com/api/system/network/{dev_name}

Request response

Key name Type Description
onboot Number
  • 0 : not loaded on boot,
  • 1 : loaded on boot.
defaultroute Number
  • 0 : not the default route,
  • 1 : is the default route.
dhcp Number
  • 0 : static configuration,
  • 1 : DHCP (automatic).
ip String Manually configured IP address.
netmask String Manually configured sub-network mask of the IP.
gateway String Manually configured gateway.
gwInUse Number
  • 0 : no default gateway (or bypassed),
  • 1 : default gateway in use.
mac String device MAC address.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Configure network (Deprecated)

Set network configuration :

require 'rest-client'

network_json_base = {
   "network" => {  
      "hostname" => "LTFS-App1",
      "primary" => "10.3.1.254",
      "secondary" => null
   }
}
network_json_eth0 = {
   "ethernet" => {
      "interface" => "eth0",
      "onboot" => 1,
      "defaultroute" => 1,
      "dhcp" => 0,
      "ip" => "10.3.1.189",
      "netmask" => "255.0.0.0",
      "gateway" => "10.3.1.1"
   }
}
network_json_em1 = {
   "ethernet" => {
      "interface" => "em1",
      "onboot" => 0,
      "defaultroute" => 0,
      "dhcp" => 1
   }
}
network_json_bond0 = {
   "bonding" => {
      "bondingInterface" => "bond0",
      "interfaces" => {
         "eth0" => null,
         "eth1" => null
      },
      "mode" => 1,
      "ip" => "222.1.3.130",
      "netmask" => "255.255.255.0",
      "gateway" => "222.1.3.1"
   }
}

url = "http://example.com/api/system/network"
response1 = RestClient::Request.execute( method: :post, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: network_json_base)
response2 = RestClient::Request.execute( method: :post, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: network_json_eth0)
response3 = RestClient::Request.execute( method: :post, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: network_json_eth1)
responseN = RestClient::Request.execute( method: :post, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: network_json_bond0)
curl -H "Content-Type: application/json" 
     -X POST 
     -d '{
           "network":{  
              "hostname":"LTFS-App1",
              "primary":"10.3.1.254",
              "secondary":null
           }
        }' 
    http://[username]:[password]@example.com/api/system/network
curl -H "Content-Type: application/json" 
     -X POST 
     -d '{
           "ethernet":{  
              "interface":"eth0",
              "onboot":1,
              "defaultroute" => 1,
              "dhcp":0,
              "ip":"10.3.1.189",
              "netmask":"255.0.0.0",
              "gateway":"10.3.1.1"
           }
        }' 
    http://[username]:[password]@example.com/api/system/network
curl -H "Content-Type: application/json" 
     -X POST 
     -d '{
           "ethernet":{  
              "interface":"em1",
              "defaultroute" => 0,
              "onboot":0,
              "dhcp":1
           }
        }' 
    http://[username]:[password]@example.com/api/system/network
curl -H "Content-Type: application/json" 
     -X POST 
     -d '{
           "bonding":{  
              "bondingInterface":"bond0",
              "interfaces":{  
                 "eth0":"on",
                 "eth1":"on",
                 "em1":null
              },
              "mode":"1",
              "ip":"222.1.3.130",
              "netmask":"255.255.255.0",
              "gateway":"222.1.3.1"
           }
        }' 
    http://[username]:[password]@example.com/api/system/network

HTTP Request

POST http://example.com/api/system/network

parameters :

Key name Type Description
hostname String Appliance Hostname
primary String Primary DNS IP address
secondary String Secondary DNS IP address
interface String Name of network interface to configure.
onboot Number
  • 0 : not loaded on boot,
  • 1 : loaded on boot.
defaultroute Number
  • 0 : not the default route,
  • 1 : is the default route.
ip String IP address.
netmask String Sub-network mask of the IP.
gateway String Default gateway.
bondingInterface String Name of bonding interface.
interfaces Number List of interfaces : if they’re part of the bonding, their value must be not null. Otherwise, use a null value.
mode Number Bonding mode :
  • 0 : Round robin,
  • 1 : Active backup,
  • 4 : LACP.

Date

Get current system date :

require 'rest-client'

url = "http://example.com/api/system/date"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/system/date

The above command returns JSON structured like this:

{
  "date": {
    "ntp": true,
    "ntp_server": [
      "0.rhel.pool.ntp.org iburst",
      "1.rhel.pool.ntp.org iburst"
    ],
    "system_date": "08\/02\/17",
    "system_time": "08:54:53",
    "system_timezone": "Europe\/Brussels"
  }
}

Set system date :

require 'rest-client'

date_json = {
         "date" => {  
          "ntp" => true,
          "ntp_server" => ["0.rhel.pool.ntp.org", "1.rhel.pool.ntp.org"],
          "system_date" => "10/19/15",
          "system_time" => "13:23:51",
          "system_timezone" => "Europe/Brussels"
       }
  }

url = "http://example.com/api/system/date"
response = RestClient::Request.execute( method: :post, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: date_json)
curl -H "Content-Type: application/json" 
     -X POST 
     -d '{
  "date": {
    "ntp": true,
    "ntp_server": [
      "0.rhel.pool.ntp.org iburst",
      "1.rhel.pool.ntp.org iburst"
    ],
    "system_date": "08\/02\/17",
    "system_time": "08:54:53",
    "system_timezone": "Europe\/Brussels"
  }
}' 
    http://[username]:[password]@example.com/api/system/date

Get current system date

GET http://example.com/api/system/date

response :

Key name Type Description
ntp Boolean
  • True: Enable ntp,
  • False: Disable.
system_date Date System date.
system_time Time System time.
system_timezone String Timezone.
ntp_server Array of String NTP servers if service is enable.

Configure system date

POST http://example.com/api/system/date

parameters :

Key name Type Description
ntp Boolean
  • True: Enable ntp,
  • False: Disable.
system_date Date System date.
system_time Time System time.
system_timezone String Timezone.
ntp_server Array of String NTP servers if service is enable.

System backup

List connected USB keys

This command allows you to list all the USB keys connected on the system.

Example of request:

require 'rest-client'

url = "http://example.com/api/system/backup_usb"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/system/backup_usb

The above command returns JSON structured like this:

{
   "usb":[
      {
         "vendor":"Sandisk",
         "product":"hf500",
         "device":"/dev/sdd",
         "size":"500000"
      }
   ],
   "status":"OK",
   "code":200
}

HTTP Request

GET http://example.com/api/system/backup_usb

Request response

Key name Type Description
vendor String Product builder name.
product String Full product name.
device String Device path.
size Number Total size in byte.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

List mounted USB keys

This command allows you to get all the information about all the mounted USB keys on the system.

Example of request:

require 'rest-client'

url = "http://example.com/api/system/backup_usb_mounted"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/system/backup_usb_mounted

The above command returns JSON structured like this:

{
   "backupusb":[
      {
         "id":2,
         "name":"backup_test",
         "type":0,
         "target":"/home",
         "device":"/dev/sdd",
         "size":"500000",
         "schedule":""
      }
   ],
   "status":"OK",
   "message":"1 backup found.",
   "code":200
}

HTTP Request

GET http://example.com/api/system/backup_usb_mounted

Request response

Key name Type Description
id Number Backup identifier.
name String Backup configuration name.
type Number Backup configuration type:
  • 0 = USB device
  • 1 = remote (SSH)
target String Backup target path.
device String Destination device path.
size Number Total size in byte.
schedule String Scheduling mode (cron): “minute hour day month week-day” (e.g.: “0 13 31 1 *”)
  • minute: 0-59
  • hour: 0-23
  • day: 1-31
  • month: 1-12, or names (first 3 letters)
  • week-day: 0-6 (0 is Sunday), or names (first 3 letters)
  • You can define ranges in the form begin-end (e.g.: 3-5 means 3, 4 and 5)
  • You can use an asterisk (*) for a first-last range.
.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Get a mounted USB key

This command allows you to get all the information about one mounted USB key.

Example of request:

require 'rest-client'

url = "http://example.com/api/system/backup_usb_mounted/backup_test"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/system/backup_usb_mounted/backup_test

The above command returns JSON structured like this:

{
   "backupusb":[
      {
         "id":2,
         "name":"backup_test",
         "type":0,
         "target":"/home",
         "device":"/dev/sdd",
         "size":"500000",
         "schedule":""
      }
   ],
   "status":"OK",
   "message":"1 backup found.",
   "code":200
}

HTTP Request

GET http://example.com/api/system/backup_usb_mounted/{backup_name}

Request response

Key name Type Description
id Number Backup identifier.
name String Backup configuration name.
type Number Backup configuration type:
  • 0 = USB device
  • 1 = remote (SSH)
target String Backup target path.
device String Destination device path.
size Number Total size in byte.
schedule String Scheduling mode (fcron): “minute hour day month week-day” (e.g.: “0 13 31 1 *”)
  • minute: 0-59
  • hour: 0-23
  • day: 1-31
  • month: 1-12, or names (first 3 letters)
  • week-day: 0-6 (0 is Sunday), or names (first 3 letters)
  • You can define ranges in the form begin-end (e.g.: 3-5 means 3, 4 and 5)
  • You can use an asterisk (*) for a first-last range.
.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Configure a USB backup

This command allows you to configure a new USB backup.

Adding USB backup “MyBackup”

require 'rest-client'

#JSON describing the new backup
backup_json = {
     "backupusb" => {
        "name" => "MyBackup",
        "product" => "hf500",
        "device" => "/dev/sdd",
        "size" => "500000",
        "schedule" => "* * * * *"
     }
  }

url = "http://example.com/api/system/backup_usb"
response = RestClient::Request.execute( method: :post, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: backup_json)
curl -H "Content-Type: application/json" 
     -X POST 
     -d '{
            "backupusb":{
               "name":"MyBackup",
               "product":"hf500",
               "device":"/dev/sdd",
               "size":"500000",
               "schedule":"* * * * *"
            }
        }' 
    http://[username]:[password]@example.com/api/system/backup_usb

The above command returns JSON structured like this:

{  
   "message": "USB key MyBackup added",
   "status": "OK"
}

HTTP Request

POST http://example.com/api/system/backup_usb

Request parameter

Key name Type Description
name String Backup configuration name.
product String Full product name.
device String Destination device path.
size Number Total size in byte.
schedule String Scheduling mode (fcron): “minute hour day month week-day” (e.g.: “0 13 31 1 *”)
  • minute: 0-59
  • hour: 0-23
  • day: 1-31
  • month: 1-12, or names (first 3 letters)
  • week-day: 0-6 (0 is Sunday), or names (first 3 letters)
  • You can define ranges in the form begin-end (e.g.: 3-5 means 3, 4 and 5)
  • You can use an asterisk (*) for a first-last range.
.

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Update USB backup configuration

This command allows you to update an existing USB backup configuration.

Updating USB backup “MyBackup”

require 'rest-client'

#JSON describing the backup
backup_json = {
     "backupusb" => {
        "name" => "MyBackup",
        "product" => "hf500",
        "device" => "/dev/sdd",
        "size" => "500000",
        "schedule" => "* * * * *"
     }
  }

url = "http://example.com/api/system/backup_usb/MyBackup"
response = RestClient::Request.execute( method: :put, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: backup_json)
curl -H "Content-Type: application/json" 
     -X PUT 
     -d '{
            "backupusb":{
               "name":"MyBackup",
               "product":"hf500",
               "device":"/dev/sdd",
               "size":"500000",
               "schedule":"* * * * *"
            }
        }' 
    http://[username]:[password]@example.com/system/backup_usb/MyBackup

The above command returns JSON structured like this:

{  
   "message": "USB key MyBackup edited",
   "status": "OK"
}

HTTP Request

PUT http://example.com/api/system/backup_usb/{backup_name}

Request parameter

Key name Type Description
name String Backup configuration name.
product String Full product name.
device String Destination device path.
size Number Total size in byte.
schedule String Scheduling mode (fcron): “minute hour day month week-day” (e.g.: “0 13 31 1 *”)
  • minute: 0-59
  • hour: 0-23
  • day: 1-31
  • month: 1-12, or names (first 3 letters)
  • week-day: 0-6 (0 is Sunday), or names (first 3 letters)
  • You can define ranges in the form begin-end (e.g.: 3-5 means 3, 4 and 5)
  • You can use an asterisk (*) for a first-last range.
.

Request response

Key name Type Description
message String Describes the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Remove USB backup configuration

This command allows you to remove an existing USB backup configuration.

Delete backup “MyBackup”:

require 'rest-client'

url = "http://example.com/api/system/backup_usb/MyBackup"
response = RestClient::Request.execute( method: :delete, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X DELETE 
http://[username]:[password]@example.com/api/system/backup_usb/MyBackup

The above command returns JSON structured like this:

{  
   "message": "USB key MyBackup deleted",
   "status": "OK"
}

HTTP Request

DELETE http://example.com/api/system/backup_usb/{backup_name}

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

List mounted SSH/SCP

This command allows you to get all the information about all the mounted SSH/SCP accesses on the system.

Example of request:

require 'rest-client'

url = "http://example.com/api/system/backup_remote_mounted"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/system/backup_remote_mounted

The above command returns JSON structured like this:

{
   "backupremote":[
      {
         "id":1,
         "name":"backup_test_ssh",
         "type":1,
         "target":"/home",
         "ip":"10.3.1.150",
         "user":"root",
         "password":"admin",
         "schedule":"* * * * *"
      },
      {
         "id":3,
         "name":"backup_test3",
         "type":1,
         "target":"/home",
         "ip":"10.3.1.150",
         "user":"root",
         "password":"admin",
         "schedule":"* * * * *"
      }
   ],
   "status":"OK",
   "message":"2 backup found.",
   "code":200
}

HTTP Request

GET http://example.com/api/system/backup_remote_mounted

Request response

Key name Type Description
id Number Backup identifier.
name String Backup configuration name.
type Number Backup configuration type:
  • 0 = USB device
  • 1 = remote (SSH)
target String Backup target path.
ip String Destination ip address.
user String SSH user name.
password String SSH password.
schedule String Scheduling mode (fcron): “minute hour day month week-day” (e.g.: “0 13 31 1 *”)
  • minute: 0-59
  • hour: 0-23
  • day: 1-31
  • month: 1-12, or names (first 3 letters)
  • week-day: 0-6 (0 is Sunday), or names (first 3 letters)
  • You can define ranges in the form begin-end (e.g.: 3-5 means 3, 4 and 5)
  • You can use an asterisk (*) for a first-last range.
.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Get a mounted SSH/SCP

This command allows you to get all the information about one SSH/SCP remote access.

Example of request:

require 'rest-client'

url = "http://example.com/api/system/backup_remote_mounted/backup_test_ssh"
response = RestClient::Request.execute( method: :get, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X GET 
   http://[username]:[password]@example.com/api/system/backup_remote_mounted/backup_test_ssh

The above command returns JSON structured like this:

{
   "backupremote":[
      {
         "id":1,
         "name":"backup_test_ssh",
         "type":1,
         "target":"/home",
         "ip":"10.3.1.150",
         "user":"root",
         "password":"admin",
         "schedule":"* * * * *"
      }
   ],
   "status":"OK",
   "message":"1 backup found.",
   "code":200
}

HTTP Request

GET http://example.com/api/system/backup_remote_mounted/{backup_name}

Request response

Key name Type Description
id Number Backup identifier.
name String Backup configuration name.
type Number Backup configuration type:
  • 0 = USB device
  • 1 = remote (SSH)
target String Backup target path.
ip String Destination ip address.
user String SSH user name.
password String SSH password.
schedule String Scheduling mode (fcron): “minute hour day month week-day” (e.g.: “0 13 31 1 *”)
  • minute: 0-59
  • hour: 0-23
  • day: 1-31
  • month: 1-12, or names (first 3 letters)
  • week-day: 0-6 (0 is Sunday), or names (first 3 letters)
  • You can define ranges in the form begin-end (e.g.: 3-5 means 3, 4 and 5)
  • You can use an asterisk (*) for a first-last range.
.

Error response

Key name Type Description
message String Describe the error.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Configure a remote backup

This command allows you to configure a new remote backup.

Adding SSH backup “MyBackup”

require 'rest-client'

#JSON describing the new backup
backup_json = {
     "backupremote" => {
        "name" => "MyBackup",
        "target" => "/home",
        "ip" => "10.3.1.150",
        "user" => "root",
        "password" => "admin",
        "schedule" => "* * * * *"
     }
  }

url = "http://example.com/api/system/backup_remote"
response = RestClient::Request.execute( method: :post, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: backup_json)
curl -H "Content-Type: application/json" 
     -X POST 
     -d '{
            "backupremote":{
               "name":"MyBackup",
               "target":"/home",
               "ip":"10.3.1.150",
               "user":"root",
               "password":"admin",
               "schedule":"* * * * *"
            }
        }' 
    http://[username]:[password]@example.com/api/system/backup_remote

The above command returns JSON structured like this:

{  
   "message": "SSH MyBackup added",
   "status": "OK"
}

HTTP Request

POST http://example.com/api/system/backup_remote

Request parameter

Key name Type Description
name String Backup configuration name.
target String Backup target path.
ip String Destination ip address.
user String SSH user name.
password String SSH password.
schedule String Scheduling mode (fcron): “minute hour day month week-day” (e.g.: “0 13 31 1 *”)
  • minute: 0-59
  • hour: 0-23
  • day: 1-31
  • month: 1-12, or names (first 3 letters)
  • week-day: 0-6 (0 is Sunday), or names (first 3 letters)
  • You can define ranges in the form begin-end (e.g.: 3-5 means 3, 4 and 5)
  • You can use an asterisk (*) for a first-last range.
.

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Update remote backup configuration

This command allows you to update a remote backup configuration.

Updating SSH backup “MyBackup”

require 'rest-client'

#JSON describing the backup
backup_json = {
     "backupremote" => {
        "name" => "MyBackup",
        "target" => "/home",
        "ip" => "10.3.1.150",
        "user" => "root",
        "password" => "admin",
        "schedule" => "* * * * *"
     }
  }

url = "http://example.com/api/system/backup_remote/MyBackup"
response = RestClient::Request.execute( method: :put, 
                                        url: url, 
                                        user: [username],
                                        password: [password],
                                        payload: backup_json)
curl -H "Content-Type: application/json" 
     -X PUT 
     -d '{
            "backupremote":{
               "name":"MyBackup",
               "target":"/home",
               "ip":"10.3.1.150",
               "user":"root",
               "password":"admin",
               "schedule":"* * * * *"
            }
        }' 
    http://[username]:[password]@example.com/system/backup_remote/MyBackup

The above command returns JSON structured like this:

{  
   "message": "SSH MyBackup edited",
   "status": "OK"
}

HTTP Request

PUT http://example.com/api/system/backup_remote/{backup_name}

Request parameter

Key name Type Description
name String Backup configuration name.
target String Backup target path.
ip String Destination ip address.
user String SSH user name.
password String SSH password.
schedule String Scheduling mode (fcron): “minute hour day month week-day” (e.g.: “0 13 31 1 *”)
  • minute: 0-59
  • hour: 0-23
  • day: 1-31
  • month: 1-12, or names (first 3 letters)
  • week-day: 0-6 (0 is Sunday), or names (first 3 letters)
  • You can define ranges in the form begin-end (e.g.: 3-5 means 3, 4 and 5)
  • You can use an asterisk (*) for a first-last range.
.

Request response

Key name Type Description
message String Describes the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.

Remove remote backup configuration

This command allows you to remove a remote backup configuration.

Delete backup “MyBackup”:

require 'rest-client'

url = "http://example.com/api/system/backup_remote/MyBackup"
response = RestClient::Request.execute( method: :delete, 
                                        url: url, 
                                        user: [username],
                                        password: [password])
curl -X DELETE 
http://[username]:[password]@example.com/api/system/backup_remote/MyBackup

The above command returns JSON structured like this:

{  
   "message": "SSH MyBackup deleted",
   "status": "OK"
}

HTTP Request

DELETE http://example.com/api/system/backup_remote/{backup_name}

Request response

Key name Type Description
message String Describe the result of the operation.
status String
  • OK if everything goes well.
  • ERROR if the operation failed.