Rake tasks for creating and deleting nodes in Shares

IN THIS ARTICLE:

Rake tasks are scripts that allow you to retrieve, delete or update information on your Shares server using the command line. Rake tasks can perform actions on user accounts, shares and nodes. This article describes the rake tasks available for creating and deleting nodes. For more information on running Shares rake tasks see this article (Shares rake tasks).

Creating a node

The syntax for this rake task is the following:

Rake tasks must be run from within the appropriate location in the shares folder:
  • Linux Shares 1.8 and later: /opt/aspera/shares/u/shares/bin
  • Linux Shares earlier than 1.8: /opt/aspera/shares/u/shares
  • Windows: C:\Shares\www
Windows
rake data:node:create -- [options]

Shares 1.8+
./run rake data:node:create -- [options]

Shares earlier than 1.8
bundle exec rake data:node:create -- [options]

The available options are the following:

option description                                                                                      
--name name The name of the node (required).
--host host
The node computer's hostname or IP address (required).
--api_username The Node API username (required).
--api_password The Node API password (required).
--port port The port on which the node service is running (default: 9092).
--ssl true|false Whether to encrypt the connection to the node using SSL (default: true).
--verify_ssl true|false Whether to verify the SSL certificate (default: true).
--timeout time The number of seconds Shares will wait for this node to respond to a request (default: 30).
--open_timeout time The number of seconds Shares will wait for connection to this node to open (default: 10).

 

Note that you must have Node API user and password credentials in order to create a new node. For more information on creating a Node API user, see Setting up a Node User on Windows or Setting up a Node User on Linux

Example

To create a node named aspera on the localhost with the Node API user janedoe and password secret, you would use the following:

rake data:node:create -- --name aspera --host localhost --api_username janedoe --api_password secret

Deleting a node

The syntax for this rake task is the following:

Rake tasks must be run from within the appropriate location in the shares folder:
  • Linux Shares 1.8 and later: /opt/aspera/shares/u/shares/bin
  • Linux Shares earlier than 1.8: /opt/aspera/shares/u/shares
  • Windows: C:\Shares\www
Windows
rake data:node:delete -- [options]

Shares 1.8+
./run rake data:node:delete -- [options]

Shares earlier than 1.8
bundle exec rake data:node:delete -- [options]

The available options are the following:

option description                                                                                      
--name The name of the node (required).

 

Example

To delete the node aspera, you would use the following:

rake data:node:delete -- --name aspera
Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk