NAV
shell ruby

Nodeum API documentation

This document describes the API versions :

- Nodeum API v1, where documentation is described in this website.

- Nodeum API v2 is hosted in SwaggerHub. SDK are available in GitHub Nodeum repository

If you are looking for any information about the product itself, reach the product website https://www.nodeum.io. You can also contact us at this email address : info@nodeum.io

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.

Catalog

Search a file or a folder

To execute a quick search in the catalog.

Will return 20 results, sorted by score, then by name. For next page of results, pass the last next_cursor_mark as the new cursor_mark parameter.

Example of request:

require 'rest-client'

url = "http://example.com/api/catalog/search?q=search+parmeters&facet_storages=true&"
response = RestClient::Request.execute( method: :get,
                                        url: url,
                                        user: [username],
                                        password: [password])
curl -X GET \
   http://[username]:[password]@example.com/api/catalog/search?q=search+parameter&facet_storages=true&

The above command returns JSON structured like this:

{
  "status": "SUCCESS",
  "code": 200,
  "results": [
    {
      "file_path": "nodeum/main_cache/folder/search.txt",
      "type": "files",
      "file_creation_date": "2019-01-25T10:45:04Z",
      "file_type": 1,
      "file_parent_path": "nodeum/main_cache/folder",
      "parent_paths": [
        "nodeum/main_cache/folder",
        "MTC001L6/main_cache/folder",
        "MTC002L6/main_cache/folder"
      ],
      "parent_descendent_paths": [
        "nodeum/main_cache/folder",
        "MTC001L6/main_cache/folder",
        "MTC002L6/main_cache/folder"
      ],
      "id": "files_91625",
      "file_modification_date": "2019-01-25T10:45:05Z",
      "file_name": "search.txt",
      "name": "search.txt",
      "file_size": 1760,
      "container_p_name": "main_cache",
      "primary_name": "main_cache",
      "file_base_name": "search",
      "file_extension": ".txt",
      "file_in_cache": true,
      "file_in_cache_date": "2019-01-25T10:45:04Z",
      "tape_pool_s_names": [
        "act_pool",
        "off_pool"
      ],
      "volume_s_rule_types": [
        0,
        1
      ],
      "library_s_names": [
        "lib01",
        "lib01"
      ],
      "volume_s_rule_names": [
        "Copy folder to active",
        "Backup to tape"
      ],
      "volume_s_parent_paths": [
        "MTC001L6/main_cache/folder",
        "MTC002L6/main_cache/folder"
      ],
      "volume_s_execrule_ids": [
        "1548413420380491243",
        "1548926158491061561"
      ],
      "volume_s_dates": [
        "2019-01-25T10:50:20Z",
        "2019-01-31T09:15:58Z"
      ],
      "volume_s_rule_ids": [
        153,
        160
      ],
      "volume_s_paths": [
        "MTC001L6/main_cache/folder/search.txt",
        "MTC002L6/main_cache/folder/search.txt"
      ],
      "volume_s_names": [
        "MTC001L6",
        "MTC002L6"
      ]
    },
  ],
  "next_cursor_mark": "AoQIP4AAAD8HMDBmZjUwM2QzZTEyN2E0M2RmNTQ1MWQwMWViOGQ0YzNkYTRmOGEHFowoTHlQAAAsZmlsZXNfMTA1MjAw",
  "results_count": 265,
  "did_you_mean": [
    {
      "query": "search parameters",
      "terms": [
        ["search", "search"],
        ["parmeters", "parameters"]
      ]
    }
  ],
  "facet": {
    "primary_name": [
      ["main_cache", 240],
      ["nfs_storage", 25],
      [null, 0]
    ],
    "volume_s_names": [
      ["MTC001L6", 10],
      ["MTC002L6", 10],
      [null, 255]
    ],
    "library_s_names": [
      ["lib01", 10],
      [null, 255]
    ],
    "tape_pool_s_names": [
      ["act_pool", 10],
      ["off_pool", 10],
      [null, 255]
    ],
    "bucket_s_names": [
      [null, 265]
    ],
    "cloud_s_names": [
      [null, 265]
    ],
    "cloud_pool_s_names": [
      [null, 265]
    ],
    "nas_share_s_names": [
      [null, 265]
    ],
    "nas_s_names": [
      [null, 265]
    ],
    "nas_pool_s_names": [
      [null, 265]
    ]
  }
}

HTTP request

GET http://example.com/api/catalog/search

Key name Type Description
q String General search query. Accept Lucene syntax
path String Search inside specific path
path_descendent Boolean If true, path parameter will also include all great-children. Default to false
primary_name String Primary name. Container or NAS share
container_p_name String Container name
nas_share_p_name String Primary NAS share name
volume_s_ids Numbers Volume ids, comma separated
volume_s_names Strings Volume barcodes, comma separated
library_s_ids Numbers Library ids, comma separated
library_s_names Strings Library names, comma separated
tape_pool_s_ids Numbers Tape pool ids, comma separated
tape_pool_s_names Strings Tape pool names, comma separated
bucket_s_ids Numbers Cloud bucket ids, comma separated
bucket_s_names Strings Cloud bucket names, comma separated
cloud_s_ids Numbers Cloud connector ids, comma separated
cloud_s_names Strings Cloud connector names, comma separated
cloud_pool_s_ids Numbers Cloud pool ids, comma separated
cloud_pool_s_names Strings Cloud pool names, comma separated
nas_share_s_ids Numbers NAS share ids, comma separated
nas_share_s_names Strings NAS share names, comma separated
nas_s_ids Numbers NAS ids, comma separated
nas_s_names Strings NAS names, comma separated
nas_pool_s_ids Numbers NAS pool ids, comma separated
nas_pool_s_names Strings NAS pool names, comma separated
file_rule_ids Numbers Rule ids, comma separated
file_rule_names Strings Rule names, comma separated
file_execrule_ids Numbers Executed rule ids, comma separated
file_size_start Number File size minimum, in bytes
file_size_end Number File size maximum, in bytes
file_creation_date_start DateTime Creation date minimum, in ISO-8601 format
file_creation_date_end DateTime Creation date maximum, in ISO-8601 format
file_modification_date_start DateTime Modification date minimum, in ISO-8601 format
file_modification_date_end DateTime Modification date maximum, in ISO-8601 format
fl String Limit the attribute names returns. See Catalog document fields description. Default to “type id name file_type file_extension file_size file_in_cache *_name *_names *_path *_paths *_date *_dates *_rule_ids *_execrule_ids *_rule_types md_text_* md_date_* md_source_* md_texts_* md_dates_* md_sources_*”
cursor_mark String Cursor mark for pagination, default to * (first page). May include + characters that needs to be encoded as %2B.
results Boolean Return results, default to true
facet_storages Boolean Return faceting for storages, default to false

Catalog document fields

Key name Type Description
id String Unique id, composed of type and file id, separated by an underscore
type String files or files_ext
name String File name (reserved for future use)
file_id Number File id if type = files
file_ext_id Number File id if type = files_ext
file_name String File name
file_base_name String File name without extension
file_extension String File extension, dot included
file_type Number 0 for folder, or 1 for file
file_size Number
file_extern Boolean
file_was_modified Boolean
file_path String Full path, if on active storage
file_parent_path String Full path of parent, if on active storage
file_parent Number Id of parent
parent_paths Strings List of all full path of parent, on any storages
parent_descendent_paths Strings List of all full path of parent, on any storages. When searched on this, will include all parents
file_creation_date Datetime
file_modification_date Datetime
file_in_cache Boolean
file_in_cache_date Datetime
file_out_cache_date Datetime
file_share_id Number
primary_name String Primary name. Container or NAS share
container_p_name String Container name
nas_share_p_name String Primary NAS share name
library_s_ids Number
library_s_names Strings
tape_pool_s_ids Numbers
tape_pool_s_names Strings
tape_pool_s_types Number
volume_s_ids Numbers
volume_s_names Strings
volume_s_dates Datetimes
volume_s_paths Strings
volume_s_parent_paths Strings
volume_s_rule_ids Numbers
volume_s_rule_names Strings
volume_s_rule_types Number
volume_s_execrule_ids Numbers
cloud_s_ids Numbers
cloud_s_names Strings
cloud_pool_s_ids Numbers
cloud_pool_s_names Strings
cloud_pool_s_types Number
bucket_s_ids Numbers
bucket_s_names Strings
bucket_s_dates Datetimes
bucket_s_paths Strings
bucket_s_parent_paths Strings
bucket_s_rule_ids Numbers
bucket_s_rule_names Strings
bucket_s_rule_types Number
bucket_s_execrule_ids Numbers
nas_s_ids Numbers
nas_s_names Strings
nas_pool_s_ids Numbers
nas_pool_s_names Strings
nas_pool_s_types Number
nas_share_s_ids Numbers
nas_share_s_names Strings
nas_share_s_dates Datetimes
nas_share_s_paths Strings
nas_share_s_parent_paths Strings
nas_share_s_rule_ids Numbers
nas_share_s_rule_names Strings
nas_share_s_rule_types Number
nas_share_s_execrule_ids Number
file_rule_ids Numbers
file_rule_names Strings
file_rule_types Number
file_execrule_ids Number
user_id Number User id of owner
group_id Number Group id of owner
user_can_read Boolean Can user read according to file mode bits
group_can_read Boolean Can group read according to file mode bits
other_can_read Boolean Can other read according to file mode bits
md_text_* String Metadata value, property name suffixed by metadata key
md_date_* Datetime Metadata date, property name suffixed by metadata key
md_source_* String Metadata source, property name suffixed by metadata key
md_texts_* Strings Metadata multiple values, property name suffixed by metadata key
md_dates_* Datetimes Metadata dates, index related to its value in md_texts_*, property name suffixed by metadata key
md_sources_* Strings Metadata sources, index related to its value in md_texts_*, property name suffixed by metadata key

Request response

Key name Type Description
results Array List of results. See Catalog document fields
next_cursor_mark String Re-execute same query with cursor_mark=next_cursor_mark for more results
results_count Number Total number of results
did_you_mean Array Suggestions (see example)
facet Object Group results by storages (see example)

Get service status

Get solr service status

require 'rest-client'

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

The above command returns JSON structured like this:

{
  "status": "SUCCESS",
  "code": 200,
  "running": true
}

HTTP request

GET http://example.com/api/catalog/service

Set service status

Start, stop or restart solr service

require 'rest-client'

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

The above command returns JSON structured like this:

{
  "status": "SUCCESS",
  "code": 200,
  "running": true
}

HTTP request

POST http://example.com/api/catalog/service

Request parameter

Key name Type Description
action String start, stop or restart

Get configuration

Get catalog related configuration

require 'rest-client'

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

The above command returns JSON structured like this:

{
  "status": "SUCCESS",
  "code": 200,
  "configuration": {
    "admin_sees_everything": true,
    "appends_fq": "-file_name:(.*)"
  }
}

HTTP request

GET http://example.com/api/catalog/configuration

Request response

Key name Type Description
configuration.admin_sees_everything Boolean User with admin privileges can query on any containers and primary storages
configuration.appends_fq String Filter that will be applied for all query

Update configuration

Update catalog related configuration

require 'rest-client'

url = "http://example.com/api/catalog/configuration"
response = RestClient::Request.execute( method: :put,
                                        url: url,
                                        user: [username],
                                        password: [password],
                                        payload: {
                                          "configuration" => {
                                            "admin_sees_everything" => true,
                                            "appends_fq" => "-file_name:(.*)"
                                          }
                                        })
curl -H "Content-Type: application/json" \
  -X PUT \
  -d '{"configuration":{
    "admin_sees_everything": true,
    "appends_fq": "-file_name:(.*)"
  }}' \
   http://[username]:[password]@example.com/api/catalog/configuration

The above command returns JSON structured like this:

{
  "status": "SUCCESS",
  "code": 200,
  "configuration": {
    "admin_sees_everything": true,
    "appends_fq": "-file_name:(.*)"
  }
}

HTTP request

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

Request response

Key name Type Description
configuration.admin_sees_everything Boolean User with admin privileges can query on any containers and primary storages
configuration.appends_fq String Filter that will be applied for all query

Execute delta import

Initiate a delta import. Will synchronize the solr index with the database.

require 'rest-client'

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

The above command returns JSON structured like this:

{
  "status": "SUCCESS",
  "code": 200,
  "message": "Delta import initiated"
}

HTTP request

POST http://example.com/api/catalog/delta_import

Execute full import

Initiate a full import. Will recreate the solr index from the database

require 'rest-client'

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

The above command returns JSON structured like this:

{
  "status": "SUCCESS",
  "code": 200,
  "message": "Full import initiated"
}

HTTP request

POST http://example.com/api/catalog/full_import

Abort import

Abort an import

require 'rest-client'

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

The above command returns JSON structured like this:

{
  "status": "SUCCESS",
  "code": 200,
  "message": "Abortion succeed"
}

HTTP request

POST http://example.com/api/catalog/abort_import

Get import status

Get catalog import status

require 'rest-client'

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

The above command returns JSON structured like this:

{
  "status": "SUCCESS",
  "code": 200,
  "info": {
    "status": "busy",
    "type": "full",
    "started": "2019-02-06T12:43:05.000Z",
    "finished": null,
    "time_taken": 83142,
    "requests": "5038",
    "fetched": "6961",
    "skipped": "0",
    "processed": "2518",
    "updated": null,
    "deleted": null
  }
}

HTTP request

GET http://example.com/api/catalog/import_status

Request response

Key name Type Description
info.status String idle or busy
info.type String full or delta
info.started Datetime Import start datetime
info.finished Datetime After import, end datetime
info.time_taken Number Time in milliseconds
info.requests Number Number of SQL requests
info.fetched Number Number of SQL row fetched
info.processed Number Number of documents processed
info.updated Number After import, number of added/updated documents
info.deleted Number After delta import, number of deleted documents

Container

Operations involving container.

List Container

This command allows to list all the container on the system

Example of list of Container :

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 Container name.
comment String User comment.
id Number Container id.
quota Number Maximum size of container 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 Container

This command allows to create new container. The name of the new container must be unique on the system.

Example of create container :

require 'rest-client'

#JSON describing the new container
share_json = {
     "share" => {
        "name" => "myShare",
        "comment" => "New example container",
        "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 Container 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 Container

This command allows to update an existing container. The container name is used as the unique key to identify the container concerned by the update.

Updating a container

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 Name of Container.
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 Container

This command allows to delete a container 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.

Users

There are two category of users:

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 allows 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 allows to create a new local user. The users are identified by their username. 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 allows 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 allows 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 allows 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 allows 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 allows 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 Container 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 allows 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:

With these commands you can administrate local groups.

List groups (Deprecated)

This command allows 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 allows 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 allows 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 allows to create a new local group. The groups are identified by their name. The name must be unique on the system

Creating group “dev_group”

require 'rest-client'

#JSON describing the new group
group_json = {
     "group" => {
        "name" => "Nodeum",
        "users" => ["user_1", "user_2"]
     }
  }

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":"nodeum_group",
            "users":["user_1", "user_2"]}
        }' 
    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 allows to update an existing group.

Updating group “dev_group”

require 'rest-client'

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

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":"nodeum_group",
            "users":["user_3"]}
        }' 
    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 allows 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 allows 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":["user_1","user_2","user_3"],
   "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 allows to list all the users member of one 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":["user_1","user_2","user_3"],
   "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 container

This command allowd to list all the user’s privilege on a container.

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":"user_1",
         "perms":7
      },
      {  
         "type":"user",
         "name":"user_1",
         "perms":5
      },
      {  
         "type":"group",
         "name":"nodeum",
         "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 Container

Key name Type Description
type String Group or user.
name String Group or user name.
perms Number Define the access on a Container. 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 Container

This command allows to give or update the permissions of multiple users or groups on a Container.

Creating or updating perms on “myShare”

require 'rest-client'

#JSON describing the new permissions
perms_json = {
     "privileges" => {
        "guest-right" => 0,
        "users" => [
            {
                "perms" => 7,
                "name" => "user_1",
                "type" => "user"
            },
            {
                "perms" => 5,
                "name" => "group_1",
                "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":"user_1",
                    "type":"user"
                },
                {
                    "perms":5,
                    "name":"group_1",
                    "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 container.
users Array Array of users or group definition. .
perms Number Define the access on a container. 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 allows to retrieve all the configuration information 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":"nodeum.io",
      "netbios":"nodeum",
      "username":"Administrator",
      "dn":"dc=nodeum,dc=io",
      "bind":"cn=admin,dc=nodeum,dc=io"
   },
   "status":"OK"
}
{  
   "authentication":{  
      "type":2,
      "netbios":"LDAP_SERVER",
      "server":"ldap.server.com",
      "dn":"dc=nodeum,dc=io",
      "bind":"cn=admin,dc=nodeum,dc=io"
   },
   "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 allows 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" => "nodeum.io",
      "netbios" => "nodeum",
      "username" => "Administrator",
      "password" => "password",
      "dn" => "dc=nodeum,dc=io",
      "bind" => "cn=admin,dc=nodeum,dc=io"
   }
  }
authentication_json = {
     "authentication" => {  
      "type" => 2,
      "netbios" => "LDAP_SERVER",
      "server" => "ldap.server.com",
      "password" => "password",
      "dn" => "dc=nodeum,dc=io",
      "bind" => "cn=admin,dc=nodeum,dc=io"
   }
  }

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 POST 
     -d '{
            "authentication":{  
              "type":0
           }
        }' 
    http://[username]:[password]@example.com/api/frontend/authentication

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

curl -H "Content-Type: application/json" 
     -X POST 
     -d '{
            "authentication":{  
              "type":2,
              "netbios":"LDAP_SERVER",
              "server":"ldap.server.com",
              "dn":"dc=nodeum,dc=io",
              "bind":"cn=admin,dc=nodeum,dc=io",
              "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

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

Tape Library

List all Tape Library

This command allows to list all the properties of all Tape Library 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": "example_oracle",
      "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": "example_ibm",
         "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 Tape Library serial number.
id Number Tape Library id. -1 for not configured Tape library.
name String Tape Library name set by user.
comment String User comment about the Tape 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 Tape library information

This command allows to retrieve all information of a Tape 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": "Example_IBM",
         "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 Tape Library serial number.
id Number Tape Library id. -1 for not configured Tape Library.
name String Tape Library name set by user.
comment String User comment about the Tape 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 allows 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": "Nodeum"
        },
        {
            "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 Tape Drive

This command allows to retrieve information for all the Tape drive on Tape 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": "Example_drive_1",
      "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": "Example_drive_2",
      "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 tape drive attached to the Tape Library serial number.
serial String Tape 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 Tape Library

This command allows to configure a Tape Library on the system

Example of Tape Library configuration.

require 'rest-client'

#JSON describing the Tape Library
library_json = {
         "backend" => {  
          "name" => "Nodeum",
          "serial" => "Example",
          "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" => "Example_drive_1",
                "dev" => "st2",
                "scsi_address" => 256,
                "vendor" => "IBM",
                "product" => "ULT3580-TD5",
                "firmware" => "D711",
                "comment" => "nodeum"
             },
             {  
                "serial" => "Example_drive_2",
                "dev" => "st3",
                "scsi_address" => 257,
                "vendor" => "IBM",
                "product" => "ULT3580-TD5",
                "firmware" => "D711",
                "comment" => "nodeum"
             }
          ]
       }
    }

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":"Example",
      "dev":"sg3",
      "vendor":"STK",
      "product":"SL150",
      "firmware":"0250",
      "storage_slots":"29",
      "storage_slots_address":"1000",
      "io_slots":"4",
      "io_slots_address":"10",
      "comment":"Nodeum",
      "emulation":{  
         "vendor":"stk",
         "product":"sl150"
      },
      "drives":[  
         {  
            "serial":"Example_drive_1",
            "dev":"st0",
            "gdev":"sg2",
            "scsi_address":"500",
            "vendor":"HP",
            "product":"Ultrium 6-SCSI",
            "firmware":"25FS",
            "comment":""
         },
         {  
            "serial":"Example_drive_2",
            "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 Example configured",
   "status": "OK"
}

HTTP Request

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

Request parameter

Key name Type Description
name String Tape Library name set by user.
serial String Tape 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 Tape 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 Tape Library

This command allows to update the information of a Tape Library

Updating Tape Library configuration.

require 'rest-client'

#JSON describing the Tape Library
library_json = {
         "backend" => {  
          "name" => "Nodeum",
          "serial" => "Example",
          "dev" => "sg5",
          "vendor" => "QUANTUM",
          "product" => "Scalar i6000",
          "firmware" => 6.24,
          "comment" => "",
          "emulation" => {  
             "vendor"=>"stk",
             "product"=>"sl150"
          },
          "drives" => [  
             {  
                "serial" => "Example_drive_1",
                "dev" => "st2",
                "scsi_address" => 256,
                "vendor" => "IBM",
                "product" => "ULT3580-TD5",
                "firmware" => "D711",
                "comment" => ""
             },
             {  
                "serial" => "Example_drive_2",
                "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":"Example",
      "dev":"sg3",
      "vendor":"STK",
      "product":"SL150",
      "firmware":"0250",
      "comment":"Oracle StorageTek SL150",
      "emulation":{  
         "vendor":"stk",
         "product":"sl150"
      },
      "drives":[  
         {  
            "serial":"Example_drive_1",
            "dev":"st0",
            "gdev":"sg2",
            "scsi_address":"500",
            "vendor":"HP",
            "product":"Ultrium 6-SCSI",
            "firmware":"25FS",
            "comment":""
         },
         {  
            "serial":"Example_drive_2",
            "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 Example configured",
   "status": "OK"
}

HTTP Request

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

Request parameter

Key name Type Description
name String Tape Library name set by user.
serial String Tape 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 Tape 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 Tape Library

This command allows to remove a Tape Library from the system

Delete Tape Library Example:

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.

Tape Library maintenance mode

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

Set Tape 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.

Tape Drive maintenance mode

Put a Tape 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 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.

Tape

Types definition

Volume definition

Key name Type Description
id Number
barcode String

List all Tapes

This command allows to get information about all Tapes 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":"nodeum",
            "type":2,
            "comment":""
         },
         "library":{  
            "id":2,
            "name":"IBM 3100",
            "serial":"Example"
         },
         "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":"Example_1"
         },
         "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 Tape Library of the media.
id Number Tape Library id.
name String Tape Library name.
serial String Tape 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 Tape information

This command allows to get information of one Tape.

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":"Nodeum",
            "type":2,
            "comment":""
         },
         "library":{  
            "id":2,
            "name":"IBM 3100",
            "serial":"Exampla_1"
         },
         "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 Tape 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 Tape Library,
  • true : out the Tape 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 Tape Library id.
name String Tape Library name.
serial String Tape Library serial number.
pool JSON Information about the pool containing the barcode.
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 list of files on at Tape Media

This command allows to get the list of files stored into a specific Tape. The result is a file tree you can browser through sequences of API call.

Example of request:

require 'rest-client'

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

The above command returns JSON structured like this:

{  
   "media":[  
      {  
        array (
        'status' => 'OK',
        'code' => 200,
        'message' => '2 files found.',
        'files' => 
        array (
        0 => 
            array (
              'id' => 34187,
              'name' => '.',
              'type' => 'file',
              'size' => 4096,
              'parent' => 34031,
              'path' => '-',
            ),
            1 => 
            array (
              'id' => 34083,
              'name' => 'image1.jpg',
              'type' => 'file',
              'size' => 998338,
              'parent' => 34031,
              'path' => '-',
            ),
        ),
        )
      }
   ],
   "status":"OK"
}

HTTP Request

To list files on tape : GET http://example.com/api/backend/media/{media_barcode}/files

To list folder on tape : GET http://example.com/api/backend/media/{media_barcode}/files/id

Request response

Key name Type Description
id Number File ID
name String File name
type String
  • file
  • folder
mount
parent Number Parent ID
path String -

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 Tape

This command allows to erase and format a Tape content

Request format for the media MTC513L5 located on Tape Library Example

require 'rest-client'

url = "http://example.com/api/backend/library/Example/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/Example/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 a Tape

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

Request format for the Tape MTC513L5 located on Tape Library Example_1

require 'rest-client'

url = "http://example.com/api/backend/library/Example_1/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/Example_1/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 barcode

This command allow to add to scratch pool a Tape

Request scratch for the media MTC513L5 located on Tape Library Example_1

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 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 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 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 Active archive
1 Offline archive
2 Data exchange
3 Scratch
4 Migration

List pools

This command allows 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":"Nodeum",
                  "serial":"Example_1"
               }
            }
         ],
         "used":false,
         "default":false
      },
      {  
         "id":9,
         "name":"Storage Pool 1",
         "type":0,
         "library":"Nodeum",
         "comment":"",
         "media":[  
            {  
               "barcode":"DEV002L5",
               "id":5,
               "location":"Drive 0",
               "total":1518606483456,
               "free":1518605434880,
               "library":{  
                  "id":3,
                  "name":"Nodeum",
                  "serial":"Example_2"
               }
            }
         ],
         "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 Tape 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 barcode included.
barcode String Media barcode.
id Number Media id.
location String Media location. Possible values:
  • Slot X : located in the Tape 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 Tape 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 allows to create a new pool.

Adding a pool

require 'rest-client'

#JSON describing the new pool
pool_json = {
        "pools" => {  
          "name" => "NodeumPool",
          "comment" => "Nodeum_Test_pool",
          "library" => "Example_1",
          "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":"Nodeumpool",
              "comment":"Nodeum",
              "library":"Example_1",
              "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 Nodeumpool 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 allows to update pool information

udpate a pool

require 'rest-client'

#JSON describing the new pool
pool_json = {
        "pools" => {  
          "name" => "NodeumPool",
          "comment" => "Nodeum_testpool",
          "library" => "Example_1",
          "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":"NodeumPool",
              "comment":"user comment",
              "library":"Example_1",
              "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 NodeumPool 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 allows to delete pool

Delete pool “myPool”:

require 'rest-client'

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

The above command returns JSON structured like this:

{  
   "message": "Pool NodeumPool 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.

List files on a pool, per folder

This command allows to list files on a on a pool, per folder

Example of request:

require 'rest-client'

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

The above command returns JSON structured like this:

{
   "status":"SUCCESS",
   "code":200,
   "files":[
      {
         "id":278788,
         "name":"sub_folder",
         "type":"folder",
         "size":638
      },
      {
         "id":278789,
         "name":"file1",
         "type":"file",
         "size":25000
      }
   ],
   "length":2
}

HTTP request

GET http://example.com/api/backend/pool/{pool_name}/paginated_files/{folder_id}
GET http://example.com/api/backend/pool/{pool_name}/paginated_files/
The second request will return folders at the root of the pool

Key name Type Description
id Number Folder id.
name String Folder name.
type String Possible values:
  • folder,
  • file.
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.

Pools of Cloud

Types definition

Cloud pool definition

Key name Type Description
id Number
name String
type Pool type

List pools

This command allows 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 allows to create a new pools

Adding a pool

require 'rest-client'

#JSON describing the new pool
pool_json = {
        "pool" => {  
          "name" => "NodeumPool",
          "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":"NodeumPool",
              "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":"NodeumPool",
        "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 allows to update pool information

udpate a pool

require 'rest-client'

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

url = "http://example.com/api/backend/clouds/pools/NodeumPool"
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":"NodeumPool",
              "comment":"user comment",
              "type":"0",
              "buckets":[  
                 "28"
              ]
           }
        }' 
    http://[username]:[password]@example.com/api/backend/clouds/pools/NodeumPool

The above command returns JSON structured like this:

{  
   "message": "Pool NodeumPool 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 allows to delete pool

Delete pool “NodeumPool”:

require 'rest-client'

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

The above command returns JSON structured like this:

{  
   "message": "Pool NodeumPool 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.

Pools of NAS

Types definition

NAS pool definition

Key name Type Description
id Number
name String
type Pool type

List pools

This command allows to list all the NAS pools on the system.

Example of request:

require 'rest-client'

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

The above command returns JSON structured like this:

{  
    "pools": [
        {
          "files_count": 0,
          "files_size": null,
          "id": 2,
          "name": "nfs-active",
          "comment": "",
          "type": 0,
          "shares": [
            {
              "id": 3,
              "path": "content/active",
              "nas": {
                "id": 2,
                "name": "nfs-sec",
                "host": "10.3.1.238",
                "type": 1,
                "comment": null,
                "price": "120.0"
              }
            }
          ]
        }
   ],
   "status":"SUCCESS",
   "code":200
}

HTTP Request

GET http://example.com/api/backend/nas/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 Pool type
shares Array of Objects Array of NAS Shares objects

Error response

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

Add a pool

This command allows to create a new pools

Adding a pool

require 'rest-client'

#JSON describing the new pool
pool_json = {
        "pool" => {  
          "name" => "nfs-active",
          "type" => 0,
          "shares" => [
             {
               "id" => 2
             }
          ]
        }
    }

url = "http://example.com/api/backend/nas/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":"nfs-active",
              "type":"0",
              "shares":[  
                {
                  "id": 2
                }
              ]
           }
        }' 
    http://[username]:[password]@example.com/api/backend/nas/pools

The above command returns JSON structured like this:

{
    "status":"SUCCESS",
    "code":200,
    "pool":{
      "files_count": 0,
      "files_size": null,
      "id": 2,
      "name": "nfs-active",
      "comment": "",
      "type": 0,
      "shares": [
        {
          "id": 3,
          "path": "content/active",
          "nas": {
            "id": 2,
            "name": "nfs-sec",
            "host": "10.3.1.238",
            "type": 1,
            "comment": null,
            "price": "120.0"
          }
        }
      ]
    }
}

HTTP Request

POST http://example.com/api/backend/nas/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 Pool type
shares Array Array of partial NAS Share. Only id is required

Request response

Key name Type Description
pool NAS Pool The created pool
message String Describe the error.
status String
  • SUCCESS if everything goes well.
  • ERROR if the operation failed.

Update a pool

This command allows to update pool information

Update a pool

require 'rest-client'

#JSON describing the new pool
pool_json = {
        "pool" => {  
          "name" => "nfs-active",
          "type" => 0,
          "shares" => [
             {
               "id" => 2
             }
          ]
        }
    }

url = "http://example.com/api/backend/nas/pools/2"
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":"nfs-active",
              "type":"0",
              "shares":[  
                {
                  "id": 2
                }
              ]
           }
        }' 
    http://[username]:[password]@example.com/api/backend/nas/pools/2

The above command returns JSON structured like this:

{
    "status":"SUCCESS",
    "code":200,
    "pool":{
      "files_count": 0,
      "files_size": null,
      "id": 2,
      "name": "nfs-active",
      "comment": "",
      "type": 0,
      "shares": [
        {
          "id": 3,
          "path": "content/active",
          "nas": {
            "id": 2,
            "name": "nfs-sec",
            "host": "10.3.1.238",
            "type": 1,
            "comment": null,
            "price": "120.0"
          }
        }
      ]
    }
}

HTTP Request

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

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 Pool type
shares Array Array of partial NAS Share. Only id is required

Request response

Key name Type Description
pool NAS Pool The updated pool
message String Describe the error.
status String
  • SUCCESS if everything goes well.
  • ERROR if the operation failed.

Delete a configured pool

This command allows to delete pool

Delete pool “nfs-active”:

require 'rest-client'

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

The above command returns JSON structured like this:

{
    "status":"SUCCESS",
    "code":200,
    "pool":{
      "files_count": 0,
      "files_size": null,
      "id": 2,
      "name": "nfs-active",
      "comment": "",
      "type": 0,
      "shares": [
        {
          "id": 3,
          "path": "content/active",
          "nas": {
            "id": 2,
            "name": "nfs-sec",
            "host": "10.3.1.238",
            "type": 1,
            "comment": null,
            "price": "120.0"
          }
        }
      ]
    }
}

HTTP Request

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

Request response

Key name Type Description
pool NAS Pool The deleted pool
message String Describe the error.
status String
  • SUCCESS 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 Container and Primary Storage

This command allows to retrieve information of the Containers and the Primary Storage

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

Key name Type Description
limit Number Limit number of results. Optional
offset Number Offset of the first result. Optional
search String Filter on name. Optional

Request response

Descriptor of the Container or Primary Storage

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 allows to get a list of all the files in a given container (Share, Primary Storage 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",
         "size":502043648
      },
      {  
         "id":1548,
         "name":"File02.docx",
         "offline":0,
         "extern":0,
         "type":"file",
         "size":45451545
      }
   ],
   "length":2,
   "status":"SUCCESS",
   "code":200
}

HTTP Request

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

Key name Type Description
limit Number Limit number of results. Optional
offset Number Offset of the first result. Optional
search String Filter on name. Optional

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.
size Number File/folder size in byte.

Request response

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

List file ID

This command allows to get the file_id of a file.

List the file ID of the file with the path ’/scenario/folder1/file’:

require 'rest-client'

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

The above command returns JSON structured like this:

{  
   "file_id": 240482,
   "status":"OK",
   "code":200
}

HTTP Request

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

Request response

Descriptor of the Container

Key name Type Description
file_id Number File id.

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 allows 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 Container

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 returns the extern files by level. The command without “extern_path” will returns the Primary Storage 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 Container

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

This command allows to retrieve all configured Business File Metadata

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":[  
            "test_1",
            "test_2",
            "test_3"
         ]
      },
      {  
         "name":"mandatory",
         "key":"mandatory",
         "mandatory":1,
         "type_of_field":0,
         "comment":""
      },
      {  
         "name":"radioMandatory",
         "key":"radioMandatory",
         "mandatory":1,
         "type_of_field":3,
         "comment":"",
         "type_value":[  
            "example_1",
            "example_2",
            "example_3"
         ]
      }
   ],
   "status":"OK",
   "code":200
}

HTTP Request

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

Request response

Descriptor of the Business File Metadata

Key name Type Description
name String Business File Metadata name.
key String Key value of the Business File Metadata.
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

This command allows to create a new Business File Metadata

Adding a Business File Metadata

require 'rest-client'

#JSON describing the new Business Files Metadata
v_json = {
   "custom_fields" => {  
      "name" => "checkboxMandatory",
      "key" => "checkboxMandatory",
      "mandatory" => 1,
      "type_of_field" => 2,
      "comment" => "",
      "type_value" => [  
         "test_1",
         "test_2",
         "test_3"
      ]
   }
}

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":[  
               "example_1",
               "example_2",
               "example_3"
            ]
         }
      }' 
   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 Business File Metadata name.
key String Key value of the Business File Metadata.
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

This command allows to update an existing Business File Metadata

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

require 'rest-client'

#JSON describing the new Business File Metadata
v_json = {
   "custom_fields" => {  
      "name" => "checkboxMandatory",
      "key" => "checkboxMandatory",
      "mandatory" => 1,
      "type_of_field" => 2,
      "comment" => "",
      "type_value" => [  
         "example_1",
         "example_2",
         "example_3"
      ]
   }
}

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":[  
               "example_1",
               "example_2",
               "example_3"
            ]
         }
      }' 
   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 Business File Metadata name.
key String Key value of the Business Files Metadata.
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

This command allows to delete an existing Business File Metadata

Delete Business File Metadata 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.

Task

Types definition

Task definition

Key name Type Description
id Number Task id
activate Boolean Whether schedule is activated
priority Number From 0, highest priority, to 12, lowest
name String Task name
type Type Type of Task
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 Task Metadata
schedule Schedule Define an automatic execution of the Task
options Array<Rule option> Additional options
sources Array<Rule source> Sources of the task
destinations Array<Rule destination> Destinations of the task

Exec task 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 task name
type Type Type of task
status_code Status code Current status code
job_started DateTime When the task was started, in ISO 8601 format
job_finished DateTime When the task 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
rrule String See RFC-5545 Recurrence Rule spec.

Task option definition

Key name Type
type Rule option type
value String

Task option type definition

Id Description
0 Filter, exclude
1 Filter, require
2 Filter, exclude files
3 Filter, require files
4 Filter on absolute date
5 Filter on relative date
6 Filter on size
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’
211 Usage threshold (0-100)
212 Deleted files threshold (0-100)
213 Type of data enrichment
214 LearningThreshold (unused)
215 Move tape to Scratch pool (0-1)
216 Eject tape after task execution (0-1)
300 Task template id

Task source definition

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

Task destination definition

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

Task Types definition

Id Label
0 Active copy to tape
1 Active copy from tape
2 Active move to tape
3 Tape rehydration
4 Tape optimization
5 Tape format
6 LTFS integrity verification
7 Get Data
8 Push Data
9 Cache Cleaning
10 Cache Cleaning Share
11 Offline Archive Move by Date
12 Offline move to tape
13 Offline Archive Copy by Date
14 Offline copy to tape
15 Exchange move to tape
16 Exchange copy to tape
17 Offline copy from tape
18 Exchange copy from tape
19 Exchange scan
20 Tape Duplication Storage Pool
21 Tape Duplication + Online Catalog Importation
22 Tape Duplication Unknown Tape
23 Tape Duplication + Offline Catalog Importation
24 Reload task
25 Reload task move
26 Active copy to cloud
27 Active move to cloud
28 Active copy from cloud
29 Offline copy to cloud
30 Offline move to cloud
31 Offline copy from cloud
32 Offline scan
33 Active copy to NAS
34 Active move to NAS
35 Active copy from NAS
36 Offline copy to NAS
37 Offline move to NAS
38 Offline copy from NAS
39 Active copy from primary storage
40 Active copy to primary storage
41 Active move from NAS to NAS
42 Active move from cloud to cloud
43 Get Index
44 Active move from NAS to cloud
45 Active move from cloud to NAS
46 Active move from NAS
47 Active move from cloud
48 Data enrichment with Google Cloud Vision
49 Offline copy from NAS to NAS
50 Offline move from NAS to NAS
51 Offline copy from cloud to cloud
52 Offline move from cloud to cloud
53 Active move from primary storage
54 Data enrichment with depthen ai
57 Full backup
58 Incremental backup
59 Offline move from NAS
60 Offline move from cloud

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 Task

This command allows to list all the task 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": {
        "rrule": "DTSTART;TZID=Europe/Brussels:20190620T000000\nRRULE:FREQ=WEEKLY"
      }
    }
  ]
}

HTTP request

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

Request response

Key name Type Description
rules Array<Rule> Array of all Task 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 allows to list all the task 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,
  "rule": {
    "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": {
      "rrule": "DTSTART;TZID=Europe/Brussels:20190620T000000\nRRULE:FREQ=WEEKLY"
    },
    "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 task

This command allow you to create a new task

Adding a task

require 'rest-client'

rule = {
  "rule": {
    "priority": 7,
    "name": "New task name",
    "type": 14,
    "comment": "",
    "file_action": 0,
    "metadata": {
      "custom": "val",
      "custom_multi": "val1;val2"
    },
    "schedule": {
      "rrule": "DTSTART;TZID=Europe/Brussels:20190620T000000\nRRULE:FREQ=WEEKLY"
    },
    "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": {
      "rrule": "DTSTART;TZID=Europe/Brussels:20190620T000000\nRRULE:FREQ=WEEKLY"
    },
    "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,
  "rule": {
    "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 task 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 task

This command allows to update an existing task.

Updating a task

require 'rest-client'

rule = {
  "rule": {
    "priority": 7,
    "name": "New task name",
    "type": 14,
    "comment": "",
    "file_action": 0,
    "metadata": {
      "custom": "val",
      "custom_multi": "val1;val2"
    },
    "schedule": {
      "rrule": "DTSTART;TZID=Europe/Brussels:20190620T000000\nRRULE:FREQ=WEEKLY"
    },
    "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": {
      "rrule": "DTSTART;TZID=Europe/Brussels:20190620T000000\nRRULE:FREQ=WEEKLY"
    },
    "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,
  "rule": {
    "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 task 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 task

This command allows to delete an existing task.

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,
  "rule": {
    "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 allows to start, stop, pause or resume a task

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 task

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

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 task id
have / search String Filter on task name
not_have String Negative filter on task name
status Array<Status code> Filter on status code, separated by comma
types Array<Type> Filter on task type, separated by comma
complete_list Boolean If false, only includes the last correct execution of a task. Default to true
media String Filter on task using a specific tape
pool String Filter on task using a specific tape pool
mount_point String Filter on task 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 task, in ISO-8601 format
creation_date_end DateTime Filter on maximum date of creation of the task, in ISO-8601 format
modification_date_start DateTime Filter on minimum date of modification of the task, in ISO-8601 format
modification_date_end DateTime Filter on maximum date of modification of the task, 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)
exact_match Boolean If true, the following keys must match exactly if they are defined [have/search/not_have/pool/mount_point]. Default to false

Request response

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

Get an exec task

This command allows to get an executed task

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

Get file table of an executed task or exec-task

This command allows to list file copied or moved by a task. If the exec-task is not the most recent, it may not list all the files.

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,
  "length": 1,
  "files": [
    {
      "media": [
        "NOD101L6"
      ],
      "id": 4,
      "name": "T_reload",
      "type": "share",
      "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 ’/’
limit Number Limit number of results. Optional
offset Number Offset of the first result. Optional
search String Filter on name. Optional

Request response

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

Get the list of files processed by a task or exec-task

This command lists files copied or moved by a task, with a paging method. If the exec-task is not the most recent, it may not list all the files.

Example of request:

require 'rest-client'

url = "http://example.com/api/rules/exec/1515589856540888920/files"
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"

The above command returns JSON structured like this:

{
  "status": "SUCCESS",
  "code": 200,
  "length": 1,
"files": [
    {
      "status": "OK",
      "name": "/images/collection/._.DS_Store",
      "checksum": null,
      "barcode": "MTC611",
      "id": "181345"
    },
    {
      "status": "OK",
      "name": "/images/collection/.DS_Store",
      "checksum": null,
      "barcode": "MTC611",
      "id": "181344"
    },
    {
      "status": "OK",
      "name": "/images/collection/images/._.DS_Store",
      "checksum": null,
      "barcode": "MTC611",
      "id": "175513"
    },
    {
      "status": "OK",
      "name": "/images/collection/images/.DS_Store",
      "checksum": null,
      "barcode": "MTC611",
      "id": "175512"
    },
    {
      "status": "OK",
      "name": "/images/collection/images/collection images/._standard_test_images",
      "checksum": null,
      "barcode": "MTC611",
      "id": "175881"
    },
    {
      "status": "OK",
      "name": "/images/collection/images/collection images/standard_test_images/._woman_darkhair.tif",
      "checksum": null,
      "barcode": "MTC611",
      "id": "175915"
    },
    {
      "status": "OK",
      "name": "/images/collection/images/collection images/standard_test_images/._woman_blonde.tif",
      "checksum": null,
      "barcode": "MTC611",
      "id": "175913"
    },
    {
      "status": "OK",
      "name": "/images/collection/images/collection images/standard_test_images/._walkbridge.tif",
      "checksum": null,
      "barcode": "MTC611",
      "id": "175911"
    },
    {
      "status": "OK",
      "name": "/images/collection/images/collection images/standard_test_images/._pirate.tif",
      "checksum": null,
      "barcode": "MTC611",
      "id": "175909"
    },
    {
      "status": "OK",
      "name": "/images/collection/images/collection images/standard_test_images/._peppers_gray.tif",
      "checksum": null,
      "barcode": "MTC611",
      "id": "175907"
    }
  ],
  "length": 1112
}

HTTP request

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

Request response

Key name Type Description
name String Folder path and file name.
checksum String Checksum calculated if requested. Optional
barcode String Tape barcode label. Optional
id Number ID of the file or the folder.

Tasks Metadata

List Tasks Metadata

This command allows to retrieve all configured Task Metadata

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

Description of the Task Metadata

Key name Type Description
name String Task Metadata name.
key String Key value of the task metadata.
mandatory Boolean Set mandatory fields
apply_on_tasks String array Array of type of task to apply Task Metadata
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 Task Metadata

This command allows to create a new Task Metada

Adding a Task Metadata

require 'rest-client'

#JSON describing the new Task Metadata
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 Task Metadata name.
key String Key value of the Task Metadata.
mandatory Boolean Set mandatory fields
apply_on_tasks String array Array of type of task to apply Task Metadata
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 Task Metadata

This command allows to update an existing Task Metadata

Update a Task Metadata with name = “example”:

require 'rest-client'

#JSON describing the new Task Metadata
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" => "example",
      "type_value" => [  
         "example_1",
         "example_2",
         "example_3"
      ]
   }
}

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":"example",
            "type_value":[  
               "example_1",
               "example_2",
               "example_3"
            ]
         }
      }' 
   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 Task Metadata name.
key String Key value of the Task Metadata.
mandatory Boolean Set mandatory fields
apply_on_tasks String array Array of type of task to apply to the Task Metadata
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 Task Metadata

This command allows to delete an existing Task Metadata

Delete Task Metadata 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 (Example section)

Import data from archive tape

List files from pool

List files from pool named POOL_ARCHIVE_01:

require 'rest-client'

url = "http://example.com/api/backend/pool/POOL_ARCHIVE_01/paginated_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/paginated_files

The above command returns JSON structured like this:

{  
   "status":"SUCCESS",
   "code":200,
   "length": 2,
   "files":[
      {  
         "id":22212157,
         "size":44874096,
         "name":"Document01.pdf",
         "type":"file"
      },
      {  
         "id":22212161,
         "size":4096,
         "value":"Exp01",
         "type":"folder"
      }
   ]
}

HTTP Request

GET http://example.com/api/backend/pool/{pool_name}/paginated_files/{parent_id}

parent_id : Optional, list files from this folder id.

Key name Type Description
limit Number Limit number of results. Optional
offset Number Offset of the first result. Optional
search String Filter on name. Optional

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.
size Number File/folder size in bytes.

Request response

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

Export archive tasks (Example 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)

Reference file handling

This command allows to upload a reference file and return a list of mapped files.

These files formats are accepted:

Upload a file

Upload an xml file. It will be analyzed asynchronously.

require 'rest-client'

payload = {
  xml: File.new('/tmp/catdv/reference-1.fcpxml', 'rb')
}

url = "http://example.com/api/frontend/xml"
files = RestClient::Request.execute( method: :get,
                    url: url,
                    user: [username],
                    password: [password],
                    payload: file)
curl -X POST \
    -F 'xml=@/tmp/catdv/reference-1.fcpxml' \
    'http://[username]:[password]@example.com/api/frontend/xml'

The above command returns JSON structured like this:

{
  "status": "SUCCESS",
  "code": 200,
  "data": {
    "id": "59315481CE1F4C99C491EE91F990BD8E",
    "name": "reference-1.fcpxml"
  }
}

HTTP request

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

Key name Type Description
xml Multipart data File to upload

List files

List files that have been analyzed

require 'rest-client'

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

The above command returns JSON structured like this:

{
  "status": "SUCCESS",
  "code": 200,
  "data": [
    {
      "id": "59315481CE1F4C99C491EE91F990BD8E",
      "name": "reference-1.fcpxml"
    }
  ]
}

HTTP request

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

Get a file

Get mapped file from analyzed reference file.

Also list for each files the pools it’s stored in.

require 'rest-client'

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

The above command returns JSON structured like this:

{
  "status": "SUCCESS",
  "code": 200,
  "files": [
    {
      "id": 157503,
      "name": "file.txt",
      "type": "file",
      "path": "/main/path/to/file.txt",
      "extern": 0,
      "share": 100,
      "in_cache": 1,
      "was_modified": 0,
      "offline": 0,
      "size": 9551124,
      "tape_pool": [
        {
          "id": 4,
          "name": "pool_name",
          "type": 0
        }
      ],
      "cloud_pool": [],
      "nas_pool": []
    }
  ],
  "errors": [
    "/main/path/to/missing-file.txt"
  ]
}

HTTP request

GET http://example.com/api/frontend/xml/{id}

Delete a file

require 'rest-client'

url = "http://example.com/api/frontend/xml/59315481CE1F4C99C491EE91F990BD8E"
files = RestClient::Request.execute( method: :delete,
                    url: url,
                    user: [username],
                    password: [password])
curl -X DELETE \
    'http://[username]:[password]@example.com/api/frontend/xml/59315481CE1F4C99C491EE91F990BD8E'

The above command returns JSON structured like this:

{
  "status": "SUCCESS",
  "code": 200,
  "data": {
    "hash": "59315481CE1F4C99C491EE91F990BD8E"
  }
}

HTTP request

DELETE http://example.com/api/frontend/xml/{id}

Trends

Fetch various utilisation trends

This command allows 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 Container

Show some statistics on files classified by Container

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 allows 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 allows 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 allows 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 allows 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 Containers 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 Containers elements.
name String Container name.
id Number Container 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

Services

Services status

This command allows 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,
      "solr":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.

Manage services

This command allows 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,
  • solr,
  • 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 allows 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 allows 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.
shell ruby