Commands

Node

rmaker_cmd.node.add_user_to_share_nodes(nodes=None, user=None)

Add user to share nodes

Parameters:
  • vars (str) – nodes as key - Node Id of the node(s)

  • varsuser as key - User name

Raises:

Exception – If there is an issue while adding user to share nodes

Returns:

API response

Return type:

dict

rmaker_cmd.node.claim_node(vars=None)

Claim the node connected to the given serial port (Get cloud credentials)

Parameters:

vars (str | None) – port as key - Serial Port, defaults to None

Raises:

Exception – If there is an HTTP issue while claiming

Returns:

None on Success

Return type:

None

rmaker_cmd.node.get_mqtt_host(vars=None)

Returns MQTT Host endpoint

Parameters:

vars (dict | None) – No Parameters passed, defaults to None

Raises:
  • NetworkError – If there is a network connection issue while getting MQTT Host endpoint

  • Exception – If there is an HTTP issue while getting MQTT Host endpoint or JSON format issue in HTTP response

Returns:

MQTT Host endpoint

Return type:

str

rmaker_cmd.node.get_node_config(vars=None)

Shows the configuration of the node.

Parameters:

vars (dict | None) – nodeid as key - Node ID for the node, defaults to None

Raises:

Exception – If there is an HTTP issue while getting node config

Returns:

None on Success

Return type:

None

rmaker_cmd.node.get_node_status(vars=None)

Shows the online/offline status of the node.

Parameters:

vars (dict | None) – nodeid as key - Node ID for the node, defaults to None

Raises:

Exception – If there is an HTTP issue while getting node status

Returns:

None on Success

Return type:

None

rmaker_cmd.node.get_nodes(vars=None)

List all nodes associated with the user.

Parameters:

vars (dict | None) – No Parameters passed, defaults to None

Raises:

Exception – If there is an HTTP issue while getting nodes

Returns:

None on Success

Return type:

None

rmaker_cmd.node.get_params(vars=None)

Get parameters of the node.

Parameters:

vars (dict | None) – nodeid as key - Node ID for the node, defaults to None

Raises:

Exception – If there is an HTTP issue while getting params or JSON format issue in HTTP response

Returns:

None on Success

Return type:

None

rmaker_cmd.node.list_sharing_details(node_id=None, primary_user=False, request_id=None, list_requests=False)

List sharing details of all nodes associated with user or List pending requests

Parameters:
  • vars (bool) – node_id as key - Node Id of the node(s) (if not provided, is set to all nodes associated with user)

  • varsprimary_user as key - User is primary or secondary (if provided, user is primary user)

  • varsrequest_id as key - Id of sharing request

  • varslist_requests as key - If True, list pending requests If False, list sharing details of nodes

Raises:

Exception – If there is an issue while listing details

Returns:

API response

Return type:

dict

rmaker_cmd.node.ota_upgrade(vars=None)

Upload OTA Firmware Image and Set image url returned in response as node params

rmaker_cmd.node.remove_node(vars=None)

Removes the user node mapping.

Parameters:

vars (dict | None) – nodeid as key - Node ID for the node, defaults to None

Raises:
  • NetworkError – If there is a network connection issue during HTTP request for removing node

  • Exception – If there is an HTTP issue while removing node or JSON format issue in HTTP response

Returns:

None on Success

Return type:

None

rmaker_cmd.node.remove_sharing(nodes=None, user=None, request_id=None)

Remove user from shared nodes or Remove sharing request

Parameters:
  • vars (str) – nodes as key - Node Id for the node

  • varsuser as key - User name

  • varsrequest_id as key - Id of sharing request

Raises:

Exception – If there is an issue while remove operation

Returns:

API response

Return type:

dict

rmaker_cmd.node.set_params(vars=None)

Set parameters of the node.

Parameters:

vars (dict | None) –

nodeid as key - Node ID for the node,

data as key - JSON data containing parameters to be set or

filepath as key - Path of the JSON file containing parameters

to be set,

defaults to None

Raises:

Exception – If there is an HTTP issue while setting params or JSON format issue in HTTP response

Returns:

None on Success

Return type:

None

rmaker_cmd.node.sharing_request_op(accept_request=False, request_id=None)

Accept or decline sharing request

Parameters:
  • vars (str) – accept_request as key If true, accept sharing request If false, decline sharing request

  • varsrequest_id as key - Id of sharing request

Raises:

Exception – If there is an issue accepting or declining request

Returns:

API response

Return type:

dict

User

rmaker_cmd.user.forgot_password(vars=None)

Forgot password request to reset the password.

Parameters:

vars (dict) – user_name as key - Email address/ phone number of the user, defaults to None

Raises:

Exception – If there is an HTTP issue while changing password for user

Returns:

None on Success and Failure

Return type:

None

rmaker_cmd.user.get_password()

Get Password as input and perform basic password validation checks.

Raises:

SystemExit – If there is an issue in getting password

Returns:

Password for User on Success

Return type:

str

rmaker_cmd.user.get_user_details(vars=None)

Get details of current logged-in user

rmaker_cmd.user.login(vars=None)

First time login of the user.

Parameters:

vars (dict) – email as key - Email address of the user, defaults to None

Raises:

Exception – If there is any issue in login for user

Returns:

None on Success and Failure

Return type:

None

rmaker_cmd.user.logout(vars=None)

Logout of the current session.

Raises:

Exception – If there is any issue in logout for user

Returns:

None on Success and Failure

Return type:

None

rmaker_cmd.user.signup(vars=None)

User signup to the ESP Rainmaker.

Parameters:

vars (dict) – user_name as key - Email address/Phone number of the user, defaults to None

Raises:

Exception – If there is any issue in signup for user

Returns:

None on Success

Return type:

None

Provision

rmaker_cmd.provision.provision(vars=None)

Provisioning of the node.

Raises:
  • NetworkError – If there is a network connection issue during provisioning

  • Exception – If there is an HTTP issue during provisioning

Parameters:

vars (dict) – pop - Proof of Possession of the node, defaults to None

Returns:

None on Success and Failure

Return type:

None

Browser Login

rmaker_cmd.browserlogin.browser_login()

Opens browser with login url using Httpd Server.

Raises:

Exception – If there is an HTTP issue while logging in through browser

Returns:

None on Success and Failure

Return type:

None