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"))
import requests5MT2NvNE52WmtVQ0lVbWZZQ3FvcXRPUWVNZmJoTmxFIn0.eyJleHAiOjE3NDAxMzI1NzAsImlhdCI6MTcwODU5
import json
url = "https://api.e2enetworks.com/myaccount/api/v1/nodes/{{Node_id}}/actions/?apikey=API_Key&project_id={{id}}"
payload = json.dumps({
"type": "enable_recovery_mode"
})
headers = {
'Authorization': 'API_Token ',
'Content-Type': 'application/json',
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
curl --location --request PUT 'https://api.e2enetworks.com/myaccount/api/v1/nodes/{{node_id}}/actions/?apikey={{api_key}}&project_id={{project_id}}&location=Delhi' \
--header 'Accept: application/json, text/plain, */*' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwimhhbS5jaGF0dXJ2ZWRpQGUyZW5ldHdvcmtzLmNvbSJ9.QCW9zUYn7usXmhLp3Y-Y_wtHCSlzwv3HNR4RUV4pgj2Qdp8wkhs4ZWBDd568Y0vydLGvU18SPWHHzbzAgI-id-Ew6ZQdekcf08X1qrOKhVj-066N-skAEwrQcGKuv0aCrfm2-YC_bhbp2O5IX2XAkJjqlqleyGpiwyUGfCq1y1M' \
--header 'x-api-key: {{api_key}}' \
--data '{
"type": "enable_recovery_mode"
}'
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
content-type: application/json; charset=utf-8
status: 202 Accepted
{
"type": "enable_recovery_mode"
}
{
"code": 200,
"data": {
"id": 121787,
"created_at": "2022-06-14T09:35:44.475103Z",
"status": "in_progress",
"action_type": "enable_recovery_mode",
"resource_id": "96707"
},
"errors": {},
"message": "Success"
}
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"))
import requests
import json
url = "https://api.e2enetworks.com/myaccount/api/v1/nodes/{{node_id}}/actions/?apikey=API_Key&project_id={{project_id}}"
payload = json.dumps({
"type": "disable_recovery_mode"
})
headers = {
'Authorization': 'API_Token',
'Content-Type': 'application/json',
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
curl --location --request PUT 'https://api.e2enetworks.com/myaccount/api/v1/nodes/{{node_id}}/actions/?apikey={{api_key}}&project_id={{project_id}}&location=Delhi' \
--header 'Accept: application/json, text/plain, */*' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJSUBDd568Y0vydLGvU18SPWHHzbzAgI-id-Ew6ZQdekcf08X1qrOKhVj-066N-skAEwrQcGKuv0aCrfm2-YC_bhbp2O5IX2XAkJjqlqleyGpiwyUGfCq1y1M' \
--header 'x-api-key: {{api_key}}' \
--data '{
"type": "disable_recovery_mode"
}'
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
content-type: application/json; charset=utf-8
status: 202 Accepted
{
"type": "disable_recovery_mode"
}
{
"code": 200,
"data": {
"id": 121793,
"created_at": "2022-06-14T09:51:25.873300Z",
"status": "done",
"action_type": "disable_recovery_mode",
"resource_id": "96707"
},
"errors": {},
"message": "Success"
}
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"))
import requests import json url = "https://api.e2enetworks.com/myaccount/api/v1/nodes/{{Node_id}}/actions/?apikey=API_Key&project_id={{id}}" payload = json.dumps({ "type": "reinstall" }) headers = { 'Authorization': 'API_Token ', 'Content-Type': 'application/json', } response = requests.request("PUT", url, headers=headers, data=payload) print(response.text)
curl --location --request PUT 'https://api.e2enetworks.com/myaccount/api/v1/nodes/{{node_id}}/actions/?apikey={{api_key}}&project_id={{project_id}}&location=Delhi' \
--header 'Accept: application/json, text/plain, */*' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwimhhbS5jaGF0dXJ2ZWRpQGUyZWqrOKhVj-066N-skAEwrQcGKuv0aCrfm2-YC_bhbp2O5IX2XAkJjqlqleyGpiwyUGfCq1y1M' \
--header 'x-api-key: {{api_key}}' \
--data '{
"type": "reinstall"
}'
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
content-type: application/json; charset=utf-8
status: 202 Accepted
{
"type": "reinstall"
}
{
"code": 200,
"data": {
"id": 121798,
"created_at": "2022-06-14T09:57:22.651810Z",
"status": "done",
"action_type": "reinstall",
"resource_id": "96707"
},
"errors": {},
"message": "Success"
}
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"))
import requests
import json
url = "https://api.e2enetworks.com/myaccount/api/v1/nodes/{{Node_id}}/actions/?apikey=API_Key"
payload = json.dumps({
"type": "reboot"
})
headers = {
'Authorization': 'API_Token ',
'Content-Type': 'application/json',
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
curl 'https://api.e2enetworks.com/myaccount/api/v1/nodes/{{node_id}}/actions/?apikey={{api_key}}&project_id={{project_id}}&location=Delhi' \
--header 'Accept: application/json, text/plain, */*' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJGSjg2R2NGM2pUYkNjU3MCwianRpIjoiOGQ1MzcyNDgtZDE2Ny00NWM2LWIyYWYtNzY3YzlhZDc4ZmNkIiwiaXNzIjoiaHR0cDovL2dhdGV3YXkuu8TFe-ANJ2Q' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {{api_key}}' \
--data '{
"type":"reboot"
}'
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
content-type: application/json; charset=utf-8
status: 202 Accepted
{
"type": "reboot"
}
{
"message": "Success",
"code": 200,
"data": {
"id": 195,
"created_at": "2019-04-23T13:17:30.365025Z",
"status": "done",
"action_type": "reboot",
"resource_id": "169"
},
"errors": {}
}
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"))
import requests
import json
url = "https://api.e2enetworks.com/myaccount/api/v1/nodes/{{node_id}}/actions/?apikey=API_Key"
payload = json.dumps({
"type": "power_off"
})
headers = {
'Authorization': 'API_Token',
'Content-Type': 'application/json',
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
curl --location --request PUT 'https://api.e2enetworks.com/myaccount/api/v1/nodes/{{node_id}}/actions/?apikey={{api_key}}&project_id={{project_id}}&location=Delhi' \
--header 'Accept: application/json, text/plain, */*' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJGSjSdUTPEInnQdjuztYN0IcoJHhc4yWy13T0Jtz_b9p4e7Pi3lP1S_rUgcnm3xEbPA-h1xo9sNu8TFe-ANJ2Q' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {{api_key}}' \
--data '{
"type":"power_off"
}'
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
content-type: application/json; charset=utf-8
status: 202 AcceptedCurl
{
"type": "power_off"
}
{
"message": "Success",
"code": 200,
"data": {
"id": 191,
"created_at": "2019-04-23T13:17:30.365025Z",
"status": "done",
"action_type": "power_off",
"resource_id": "169"
},
"errors": {}
}
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"))
import requests
import json
url = "https://api.e2enetworks.com/myaccount/api/v1/nodes/{{node_id}}/actions/?apikey=API_Key&project_id={{id}}"
payload = json.dumps({
"type": "power_on"
})
headers = {
'Authorization': 'API_Token',
'Content-Type': 'application/json',
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
curl --location --request PUT 'https://api.e2enetworks.com/myaccount/api/v1/nodes/{{node_id}}/actions/?apikey={{api_key}}&project_id={{project_id}}&location=Delhi' \
--header 'Accept: application/json, text/plain, */*' \
--header 'Authorization: Bearer eyMqk2WW5eWdEycXUyKhUQAlEpp6I6ya4tr2AkEVEXamAE4RS6lrRbuiXZUGTEw70qsMFhMhHdSdUTPEInnQdjuztYN0IcoJHhc4yWy13T0Jtz_b9p4e7Pi3lP1S_rUgcnm3xEbPA-h1xo9sNu8TFe-ANJ2Q' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {{api_key}}' \
--data '{
"type":"power_on"
}'
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
content-type: application/json; charset=utf-8
status: 202 Accepted
{
"type": "power_on"
}
{
"message": "Success",
"code": 200,
"data": {
"id": 195,
"created_at": "2019-04-23T13:17:30.365025Z",
"status": "done",
"action_type": "power_on",
"resource_id": "169"
},
"errors": {}
}
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"))
import requests
import json
url = "https://api.e2enetworks.com/myaccount/api/v1/nodes/{{Node_id}}/actions/?apikey=API_Key&location=Delhi&project_id={{id}}"
payload = json.dumps({
"name": "C2-12-set1",
"type": "rename"
})
headers = {
'Authorization': 'API_Token',
'Content-Type': 'application/json',
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
curl --location --request PUT 'https://api.e2enetworks.com/myaccount/api/v1/nodes/{{node_id}}/actions/?apikey={{api_key}}&project_id={{project_id}}&location=Delhi' \
--header 'Accept: application/json, text/plain, */*' \
--header 'Authorization: Bearer eyJhbGci3MuY29tL2F1dGgvcmVhbG1zL2FwaW1hbiIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiIzYTBkNzRjMS0yYzlhLTQxZWItYWJjOS01OTQzMGNkZGY3N2QiLCJ0eXAiOiJCZWFyZXIiLCJhi3lP1S_rUgcnm3xEbPA-h1xo9sNu8TFe-ANJ2Q' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {{api_key}}' \
--data '{
"name": "C2-12-set1",
"type":"rename"
}'
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
content-type: application/json; charset=utf-8
status: 202 Accepted
{
"type": "rename",
"name": "nifty-new-name"
}
{
"message": "Success",
"code": 200,
"data": {
"id": 193,
"created_at": "2019-04-23T13:14:11.150168Z",
"status": "done",
"action_type": "rename",
"resource_id": "169"
},
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"))
import requests
import json
url = "https://api.e2enetworks.com/myaccount/api/v1/nodes/{{node_id}}/actions/?apikey=API_key&project_id={{id}}"
payload = json.dumps({
"type": "lock_vm"
})
headers = {
'Authorization': 'API_Token',
'Content-Type': 'application/json',
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
curl --location --request PUT 'https://api.e2enetworks.com/myaccount/api/v1/nodes/{{node_id}}/actions/?apikey={{api_key}}&project_id={{project_id}}&location=Delhi' \
--header 'Accept: application/json, text/plain, */*' \
--header 'Authorization: Bearer eyJhbGjuztYN0IcoJHhc4yWy13T0Jtz_b9p4e7Pi3lP1S_rUgcnm3xEbPA-h1xo9sNu8TFe-ANJ2Q' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {{api_key}}' \
--data '{
"type":"lock_vm"
}'
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
content-type: application/json; charset=utf-8
status: 202 Accepted
{
"type": "lock_vm"
}
{
"message": "Success",
"code": 200,
"data": {
"id": 195,
"created_at": "2019-04-23T13:17:30.365025Z",
"status": "done",
"action_type": "lock_vm",
"resource_id": "169"
},
"errors": {}
}
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"))
import requests
import json
url = "https://api.e2enetworks.com/myaccount/api/v1/nodes/{{node_id}}/actions/?apikey=API_Key&project_id={{id}}"
payload = json.dumps({
"type": "unlock_vm"
})
headers = {
'Authorization': 'API_Token',
'Content-Type': 'application/json',
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
curl --location --request PUT 'https://api.e2enetworks.com/myaccount/api/v1/nodes/{{node_id}}/actions/?apikey={{api_key}}&project_id={{project_id}}&location=Delhi' \
--header 'Accept: application/json, text/plain, */*' \
--header 'Authorization: Bearer eyJhbGciOiJSUzIAkEVEXamAE4RS6lrRbuiXZUGTEw70qsMFhMhHdSdUTPEInnQdjuztYN0IcoJHhc4yWy13T0Jtz_b9p4e7Pi3lP1S_rUgcnm3xEbPA-h1xo9sNu8TFe-ANJ2Q' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {{api_key}}' \
--data '{
"type":"unlock_vm"
}'
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
content-type: application/json; charset=utf-8
status: 202 Accepted
{
"type": "unlock_vm"
}
{
"message": "Success",
"code": 200,
"data": {
"id": 195,
"created_at": "2019-04-23T13:17:30.365025Z",
"status": "done",
"action_type": "unlock_vm",
"resource_id": "169"
},
"errors": {}
}