Action On Node

To perform an action, such as Power On, Power Off, Reboot, reinstall and enable recovery mode/disable recovery mode on a node.

Enable Recovery mode

To enable recovery mode on an existing Node send a PUT request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/nodes/{{node_id}}/actions/?
apikey={{apikey}}&project_id={{project_id}}

Attributes and respective values required to send this POST request are:

Name

Type

Description

Required

type

string

A string denotes the type of the node its enable recovery mode or disable recovery mode .

True

The request returns a JSON object that contains the following attributes:

Name

Type

Description

id

Integer

Information regarding the node.

created_at

integer

A string represents both the date and time when the recovery mode is created.

state

string

A string that denotes the state of the node.

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
            "type": "enable_recovery_mode"
    })
headers = {
        'Authorization': 'API_Token ',
        'Content-Type': 'application/json',
        }
conn.request("PUT", "/myaccount/api/v1/nodes/{{Node_id}}/actions/?apikey=API_Key&project_id={{id}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
"type": "enable_recovery_mode"
}

Disable Recovery mode

To Disable recovery mode on an existing Node send a PUT request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/nodes/{{Node_id}}/
actions/?apikey={{apikey}}&project_id={{id}}

Attributes and respective values required to send this POST request are:

Curl
    • Name

    • Type

    • Description

    • Required

    • type

    • string

    • A string denotes the type of the node its enable recovery mode or disable recovery mode .

    • True

The request returns a JSON object that contains the following attributes:

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
            "type": "disable_recovery_mode"
        })
headers = {
            'Authorization5MT2NvNE52WmtVQ0lVbWZZQ3FvcXRPUWVNZmJoTmxFIn0.eyJleHAiOjE3NDAxMzI1NzAsImlhdCI6MTcwODU5': 'API_Token',
            'Content-Type': 'application/json',

            }
conn.request("PUT", "/myaccount/api/v1/nodes/{{node_id}}/actions/?apikey=API_Key&project_id={{id}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
"type": "disable_recovery_mode"
}

Reinstall Node

To Reinstall ** on an existing Node send a **PUT request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/nodes/{{Node_id}}/
actions/?apikey={{apikey}}&project_id={{id}}

Attributes and respective values required to send this POST request are:

Name

Type

Description

Required

type

string

A string denotes the type of the node its reinstall .

True

The request returns a JSON object that contains the following attributes:

Name

Type

Description

id

Integer

Information regarding the node.

created_at

integer

A string represents both the date and time when the recovery mode is created.

state

string

A string that denotes the state of the node.

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
                "type": "reinstall"
            })
headers = {
            'Authorization': 'API_Token ',
            'Content-Type': 'application/json',
        }
conn.request("PUT", "/myaccount/api/v1/nodes/{{Node_id}}/actions/?apikey=API_Key&project_id={{id}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
"type": "reinstall"
}

Reboot Node

To reboot on an existing Node send a PUT request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/nodes/<$NODE_ID>/
actions/?apikey={{API_Key}}&project_id={{id}}

Set the “type” attribute to reboot.

Name

Type

Description

Required

type

string

Must be reboot

TRUE

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
                "type": "reboot"
        })
headers = {
            'Authorization': 'API_Token ',
            'Content-Type': 'application/json',
        }
conn.request("PUT", "/myaccount/api/v1/nodes/{{Node_id}}/actions/?apikey=API_Key", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
"type": "reboot"
}

Power-Off Node

To Power-Off on an existing Node send a PUT request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/nodes/<$NODE_ID>/
actions/?apikey={{Api_key}}&project_id={{id}}

Name

Type

Description

Required

type

string

Must be power_off

TRUE

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
                "type": "power_off"
            })
headers = {
        'Authorization': 'API_Token',
        'Content-Type': 'application/json',

        }
conn.request("PUT", "/myaccount/api/v1/nodes/{{node_id}}/actions/?apikey=API_Key", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
"type": "power_off"
}

Power-On Node

To Power on an existing Node send a PUT request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/nodes/<$NODE_ID>/
actions/?apikey={{api_key}}&project_id={{id}}

Name

Type

Description

Required

type

string

Must be power_on

TRUE

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
                "type": "power_on"
            })
headers = {
            'Authorization': 'API_Token',
            'Content-Type': 'application/json',

        }
conn.request("PUT", "/myaccount/api/v1/nodes/{{node_id}}/actions/?apikey=API_Key&project_id={{id}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
"type": "power_on"
}

Rename Node

To Rename on an existing Node send a PUT request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/nodes/<$NODE_ID>/
actions/?apikey={{apikey}}&project_id={{id}}

Name

Type

Description

Required

type

string

Must be rename

TRUE

name

string

The new name for the node.

TRUE

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
                "name": "C2-12-set1",
                "type": "rename"
        })
headers = {
        'Authorization': 'API_Token',
        'Content-Type': 'application/json',

    }
conn.request("PUT", "/myaccount/api/v1/nodes/{{Node_id}}/actions/?apikey=API_Key&location=Delhi&project_id={{id}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
"type": "rename",
"name": "nifty-new-name"
}

Lock VM

To lock an existing Node send a PUT request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/nodes/<$NODE_ID>/
actions/?apikey={{api_key}}&project_id={{id}}

Name

Type

Description

Required

type

string

Must be lock_vm

TRUE

name

string

The new name for the node.

TRUE

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
                    "type": "lock_vm"
                })
headers = {
        'Authorization': 'API_Token',
        'Content-Type': 'application/json',
    }
conn.request("PUT", "/myaccount/api/v1/nodes/<<node_id>>/actions/?apikey=API_key&project_id={{id}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
"type": "lock_vm"
}

Unlock VM

To unlock an existing Node send a PUT request to the endpoint .. code-block:: bash

https://api.e2enetworks.com/myaccount/api/v1/nodes/<$NODE_ID>/ actions/?apikey={{api_key}}&project_id={{id}}

Name

Type

Description

Required

type

string

Must be lock_vm

TRUE

name

string

The new name for the node.

TRUE

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
                "type": "unlock_vm"
            })
headers = {
            'Authorization': 'API_Token',
            'Content-Type': 'application/json',

        }
conn.request("PUT", "/myaccount/api/v1/nodes/{{node_id}}/actions/?apikey=API_key&project_id={{id}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
"type": "unlock_vm"
}