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.

action_type

string

Action performed in this request

resource_id

Integer

resources

errors

string

Any error while enabling recovery mode.

message

string

Request status - success or fail

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"type": "enable_recovery_mode"
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {{API_KEY}}
}
conn.request("PUT", "/myaccount/api/v1/nodes/{{node_id}}/actions/?apikey={{api_key}}&project_id={{project_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={{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.

action_type

string

Action performed in this request

resource_id

Integer

resources

errors

string

Any error while enabling recovery mode.

message

string

Request status - success or fail

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"type": "disable_recovery_mode"
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {{API_KEY}}
}
conn.request("PUT", "/myaccount/api/v1/nodes/{{node_id}}/actions/?apikey={{api_key}}&project_id={{project_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 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 = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {{AUTH_TOKEN}}',

}
conn.request("PUT", "/myaccount/api/v1/nodes/{{node_id}}/actions/?apikey={{api_key}}&project_id={{project_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

value

Required

type

string

reboot

TRUE

import http.client
import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"type": "reboot"
})
headers = {

'Authorization': 'Bearer {{AUTH_TOKEN}}',
'Content-Type': 'application/json',

}
conn.request("PUT", "/myaccount/api/v1/nodes/{{NODE_ID}}/actions/?apikey={{API_KEY}}&project_id={{PROJECT_ID}}&location={{Location}}", 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

Send a PUT request to the endpoint to Power Off the node from your MyAccount.

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

Name

Type

Value

Required

type

string

power_off

TRUE

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"type": "power_off"
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {{API_KEY}}',
}
conn.request("PUT", "/myaccount/api/v1/nodes/{{node_id}}/actions/?apikey={{api_key}}&project_id={{project_id&location={{location}}", 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

Value

Required

type

string

power_on

TRUE

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"type": "power_on"
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {{AUTH_TOKEN}}',
}
conn.request("PUT", "/myaccount/api/v1/nodes/{{NODE_ID}}/actions/?apikey={{API_KEY}}&project_id={{PROJECT_ID}}&location={{Location}}", 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={{API_KEY}}&project_id={{PROJECT_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 = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {{AUTH_TOKEN}}',
}
conn.request("PUT", "/myaccount/api/v1/nodes/{{NODE_ID}}/actions/?apikey={{API_KEY}}&project_id={{PROJECT_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 = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {{AUTH_TOKEN}}',
}
conn.request("PUT", "/myaccount/api/v1/nodes/{{NODE_ID}}/actions/?apikey={{API_KEY}}&project_id={{PROJECT_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

https://api.e2enetworks.com/myaccount/api/v1/nodes/{{NODE_ID}}/actions/?apikey={{API_KEY}}&project_id={{PROJECT_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 = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {{AUTH_TOKEN}}',
}
conn.request("PUT", "/myaccount/api/v1/nodes/{{NODE_ID}}/actions/?apikey={{API_KEY}}&project_id={{PROJECT_ID}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
"type": "unlock_vm"
}

Save Image

To save image for 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={{project_id}}&location={{location}}

Name

Type

Description

Required

type

String

Must be save_images

TRUE

name

string

The name of the save image.

TRUE

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"type": "save_images",
"name": "C2-3GB-CentOS7-241-18"
})
headers = {
'Accept': 'application/json, text/plain, */*',
'Content-Type': 'application/json',
'Authorization': 'Bearer {{AUTH_TOKEN}}',
}
conn.request("PUT", "/myaccount/api/v1/nodes/{{NODE_ID}}/actions/?apikey={{API_KEY}}&project_id={{PROJECT_ID}}&location={{Location}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
    "type": "save_images",
    "name": "C2-3GB-CentOS7-241-18"
}

Enable Accidential Protection

To enable accidential protection for 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={{PROJECT_ID}}&location={{LOCATION}}

Name

Type

Description

Required

type

String

Must be enable_accidental_protection

TRUE

import http.client
import json

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

Disable Accidential Protection

To disable accidential protection for 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={{PROJECT_ID}}&location={{LOCATION}}

Name

Type

Description

Required

type

String

Must be disable_accidental_protection

TRUE

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"type": "disable_accidental_protection"
})
headers = {
'Authorization': 'Bearer {{AUTH_TOKEN}}',
'Content-Type': 'application/json',
}
conn.request("PUT", "/myaccount/api/v1/nodes/{{NODE_ID}}/actions/?apikey={{API_KEY}}&project_id={{PROJECT_ID}}&location={{Location}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
    "type":"enable_accidental_protection"
}

Enable Security Compliance

To enable security compliance for 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={{PROJECT_ID}}&location={{LOCATION}}

Name

Type

Description

Required

type

String

Must be “enable_node_compliance”

TRUE

import http.client
import json

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

Disable Security Compliance

To disable security compliance for 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={{PROJECT_ID}}&location={{LOCATION}}

Name

Type

Description

Required

type

String

Must be “disable_node_compliance”

TRUE

import http.client
import json

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

Snapshot

Manual Snapshot

To take manual snapshot for an existing Node send a POST request to the endpoint

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

Name

Type

Description

Required

name

String

Snapshot name

TRUE

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"name": "temp4"
})
headers = {
'Authorization': 'Bearer {{AUTH_TOKEN}}',
'Content-Type': 'application/json',
}
conn.request("POST", "/myaccount/api/v1/nodes/{{NODE_ID}}/snapshots/?apikey={{API_KEY}}&project_id={{PROJECT_ID}}&location={{Location}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
    "name":"temp4"
}

Schedule Snapshot

To Schedule snapshot for an existing Node send a POST request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/schedule-snapshot/?apikey={{api_key}}&project_id={{project_id}}&location={{location}}

Name

Type

Description

Required

resource_id

Integer

Must be save_images

TRUE

resource_type

string

Type of resource

TRUE

time_line

Integer

1(Between 12AM - 1AM)|| 2(Between 8AM - 9AM) || 3(Between 6PM-7PM)

True

create_after

Integer

Daily - 1 || Weekely - 7 || Monthly - 30

TRUE

delete_after

Integer

Null

TRUE

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"resource_id": 182412,
"resource_type": "node",
"time_line": 1,
"create_after": "7",
"delete_after": None
})
headers = {
'Authorization': 'Bearer {{AUTH_TOKEN}}',
'Content-Type': 'application/json',
}
conn.request("POST", "/myaccount/api/v1/schedule-snapshot/?apikey={{API_KEY}}&project_id={{PROJECT_ID}}&location={{Location}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
    "resource_id":182412,
    "resource_type":"node",
    "time_line":1,
    "create_after":"7",
    "delete_after":null
}

Delete scheduled Snapshot

To Schedule snapshot for an existing Node send a DELETE request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/schedule-snapshot/?resource_id={{NODE_ID}}&resource_type=node&service_type=schedule&apikey={{API_KEY}}&project_id={{PROJECT_ID}}&location={{Location}}
import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = ''
headers = {
'Authorization': 'Bearer {{AUTH_TOKEN}}',
'Content-Type': 'application/json',
}
conn.request("DELETE", "/myaccount/api/v1/schedule-snapshot/?resource_id={{RESOURCE_ID}}&resource_type=node&service_type=schedule&apikey={{API_KEY}}&project_id={{PROJECT_ID}}&location={{Location}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
// DELETE Request never expect body

Create Snapshot Lifecycle

To create snapshot Lifecycle for an existing Node send a POST request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/schedule-snapshot/?apikey={{api_key}}&project_id={{project_id}}&location={{location}}

Name

Type

Description

Required

resource_id

Integer

Must be save_images

TRUE

resource_type

string

Type of resource

TRUE

time_line

Integer

Null

True

create_after

Integer

Null

True

delete_after

Integer

Number of days after which snapshot deleted automatically

True

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"resource_id": 182412,
"resource_type": "node",
"time_line": None,
"create_after": None,
"delete_after": "365"
})
headers = {

'Authorization': 'Bearer {{AUTH_TOKEN}}',
'Content-Type': 'application/json',
}
conn.request("POST", "/myaccount/api/v1/schedule-snapshot/?apikey={{API_KEY}}&project_id={{PROJECT_ID}}&location={{Location}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
"resource_id":182412,
"resource_type":"node",
"time_line":None,
"create_after":None,
"delete_after":"365"
}

Edit Lifecycle Settings

To create snapshot Lifecycle for an existing Node send a POST request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/schedule-snapshot/?apikey={{api_key}}&project_id={{project_id}}&location={{location}}

Name

Type

Description

Required

resource_id

Integer

Must be save_images

TRUE

resource_type

string

Type of resource

TRUE

time_line

Integer

Null

True

create_after

Integer

Null

True

delete_after

Integer

Number of days after which snapshot deleted automatically

True

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"resource_id": 182412,
"resource_type": "node",
"time_line": None,
"create_after": None,
"delete_after": "365"
})
headers = {

'Authorization': 'Bearer {{AUTH_TOKEN}}',
'Content-Type': 'application/json',
}
conn.request("POST", "/myaccount/api/v1/schedule-snapshot/?apikey={{API_KEY}}&project_id={{PROJECT_ID}}&location={{Location}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
"resource_id":182412,
"resource_type":"node",
"time_line":None,
"create_after":None,
"delete_after":"365"
}

Lock Snapshot

To Lock snapshot for an existing Node send a PUT request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/nodes/{{node_id}}/snapshot/{{snapshot__uuid}}?apikey={{api_key}}&project_id={{project_id}}&location={{location}}

Name

Type

Description

Required

locked_status

Boolean

Must be true to lock snapshot

TRUE

resource_type

string

Type of resource

TRUE

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"locked_status": True,
"resource_type": "node"
})
headers = {
'Authorization': 'Bearer {{AUTH_TOKEN}}',
'Content-Type': 'application/json',
}
conn.request("PUT", "/myaccount/api/v1/nodes/{{NODE_ID}}/snapshot/{{SNAPSHOT_UUID}}?apikey={{API_KEY}}&project_id={{PROJECT_ID}}&location={{Location}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
    "locked_status": True,
    "resource_type": "node"
}

Unlock Snapshot

To Lock snapshot for an existing Node send a PUT request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/nodes/{{node_id}}/snapshot/{{snapshot__uuid}}?apikey={{api_key}}&project_id={{project_id}}&location={{location}}

Name

Type

Description

Required

locked_status

Boolean

Must be true to lock snapshot

TRUE

resource_type

string

Type of resource

TRUE

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"locked_status": False,
"resource_type": "node"
})
headers = {
'Authorization': 'Bearer {{AUTH_TOKEN}}',
'Content-Type': 'application/json',
}
conn.request("PUT", "/myaccount/api/v1/nodes/{{NODE_ID}}/snapshot/{{SNAPSHOT_UUID}}?apikey={{API_KEY}}&project_id={{PROJECT_ID}}&location={{Location}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
    "locked_status": False,
    "resource_type": "node"
}

Security Group

Attach Security Group

To Attach Security Group to an existing Node send a POST request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/security_group/{{VM_ID}}/attach/?apikey={{API_KEY}}&project_id={{PROJECT_ID}}&location={{Location}}

Name

Type

Description

Required

security_group_ids

Array

Security Group IDs to attach

TRUE

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"security_group_ids": [
    53393
]
})
headers = {
'Authorization': 'Bearer {{AUTH_TOKEN}}',
'Content-Type': 'application/json',
}
conn.request("POST", "/myaccount/api/v1/security_group/{{VM_ID}}/attach/?apikey={{API_KEY}}&project_id={{PROJECT_ID}}&location={{Location}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
    "security_group_ids": [
        53393
    ]
}

Detach Security Group

To detach Security Group to an existing Node send a POST request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/security_group/{{vm_id}}/detach/?apikey={{api_key}}&project_id={{project_id}}&location={{location}}

Name

Type

Description

Required

security_group_ids

Array

Security Group IDs to Detach

TRUE

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"security_group_ids": [
    53932
]
})
headers = {
'Authorization': 'Bearer {{AUTH_TOKEN}}',
'Content-Type': 'application/json',
}
conn.request("POST", "/myaccount/api/v1/security_group/{{VM_ID}}/detach/?apikey={{API_KEY}}&project_id={{PROJECT_ID}}&location={{Location}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
    "security_group_ids": [
        53393
    ]
}

Logs

Action Logs

To get Action Logs for an existing Node use a GET request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/nodes/nodeactionlog/{{vm_id}}?page_no=1&per_page=20&apikey={{api_key}}&project_id={{project_id}}&location={{location}}
import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = ''
headers = {
'Authorization': 'Bearer {{AUTH_TOKEN}}',
'Content-Type': 'application/json',
}
conn.request("GET", "/myaccount/api/v1/nodes/nodeactionlog/{{VM_ID}}?page_no=1&per_page=20&apikey={{API_KEY}}&project_id={{PROJECT_ID}}&location={{Location}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
    "code": 200,
    "data": [
        {
            "timestamp": "Jun 03, 2024 12:22:35 PM",
            "event": "SECURITY GROUP DETACHED",
            "client_ip": "64.227.21.251",
            "details": "sg_name = allow_all_traffic_delhi_23827_{{PROJECT_ID}}"
        },
        {
            "timestamp": "May 31, 2024 11:18:04 AM",
            "event": "DELETED_SCHEDULED_ACTION",
            "client_ip": "106.215.89.91",
            "details": "action_type = reboot"
        }
    ],
    "errors": {},
    "message": "Success",
    "total_page_number": 4,
    "total_count": 67
}

Audit Logs

To get Audit Logs for an existing Node use a GET request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/nodes/nodebillinglog/{{VM_ID}}?page_no=1&per_page=5&apikey={{API_KEY}}&project_id={{PROJECT_ID}}&location={{Location}}
import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = ''
headers = {
'Authorization': 'Bearer {{AUTH_TOKEN}}',
'Content-Type': 'application/json',
}
conn.request("GET", "/myaccount/api/v1/nodes/nodebillinglog/{{VM_ID}}?page_no=1&per_page=5&apikey={{API_KEY}}&project_id={{PROJECT_ID}}&location={{Location}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
    "code": 200,
    "data": [],
    "errors": {},
    "message": "Success",
    "total_page_number": 1,
    "total_count": 0
}

Alerts

Create Alert

To create Alerts for an existing Node use a POST request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/nodes/{{node_id}}/monitoring/triggers/?apikey={{api_key}}&project_id={{project_id}}&location={{location}}

Name

Type

Description

Required

trigger_type

string

Alert on Processor Load | Consumed Memory | Free Disk space | webcheck

True

trigger_operator

Operator

> || < || = || !=

True

trigger_threshold

Integer

Threshold between 0 to 100

True

url

null

Null

False

webcheck_interval

Integer

Fixed to 60

True

required_string

user can pass committed_plan”

True

alert_emails

String Array

Email Array

True

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"trigger_data": {
    "trigger_type": "memory",
    "trigger_operator": ">",
    "trigger_threshold": 11,
    "url": None,
    "webcheck_interval": 60,
    "required_string": None,
    "alert_emails": "testing@gmail.com"
}
})
headers = {
'Authorization': 'Bearer {{AUTH_TOKEN}}',
'Content-Type': 'application/json',
}
conn.request("POST", "/myaccount/api/v1/nodes/{{NODE_ID}}/monitoring/triggers/?apikey={{API_KEY}}&project_id={{PROJECT_ID}}&location={{Location}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
    "code": 200,
    "data": {
        "alert_default_state": true,
        "emails": [
            {
                "email": "testing@gmail.com",
                "timestamp": "2024-06-05 05:27 AM"
            }
        ]
    },
    "errors": "",
    "message": "Emails retrieved successfully"
}

Configure Alert

To Configure Alerts for an existing Node use a PUT request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/nodes/{{node_id}}/monitoring/triggers/?apikey={{api_key}}&project_id={{project_id}}&location={{location}}

Name

Type

Description

Required

email

String array

Email Id Array

True

host_ip

string

Host Ip Address

True

monitoring_status

Boolean

Must Be True

True

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"email": [
    "testing@gmail.com"
],
"host_ip": "172.16.120.142",
"monitoring_status": True
})
headers = {
'Authorization': 'Bearer {{AUTH_TOKEN}}',
'Content-Type': 'application/json',
}
conn.request("PUT", "/myaccount/api/v1/nodes/{{NODE_ID}}/monitoring/alerts/?apikey={{API_KEY}}&project_id={{PROJECT_ID}}&location={{Location}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
    "code": 200,
    "data": true,
    "errors": "",
    "message": "Alert configured successfully"
}

Delete Alert

To Delete Alert for an existing Node use a DELETE request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/nodes/{{node_id}}/monitoring/triggers/?id={{TRIGGER_ID}}&type=trigger&zabbix_id={{ZABBIX_ID}}&apikey={{api_key}}&project_id={{project_id}}&location={{location}}
import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = ''
headers = {
'Authorization': 'Bearer {{AUTH_TOKEN}}',
'Content-Type': 'application/json',
}
conn.request("DELETE", "/myaccount/api/v1/nodes/{{NODE_ID}}/monitoring/triggers/?id={{TRIGGER_ID}}&type=trigger&zabbix_id={{ZABBIX_ID}}&apikey={{API_KEY}}&project_id={{PROJECT_ID}}&location={{Location}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
    "code":200,
    "data":{},
    "errors":"",
    "message":"Trigger was deleted successfully"
}

Network

Detach VPC

To detach VPC for an existing Node use a POST request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/nodes/{{node_id}}/monitoring/triggers/?apikey={{api_key}}&project_id={{project_id}}&location={{location}}

Name

Type

Description

Required

vpc_name

String

VPC_name

True

dns

string

DNS

True

cidr

string

CIDR

True

node_id

string

Node ID

True

action

string

Must be “detach”

True

network_id

Integer

Network ID

True

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"vpc_name": "VPC-11",
"dns": "8.8.8.8 8.8.4.4",
"cidr": "10.13.40.0/23",
"node_id": {{NODE_ID}},
"action": "detach",
"network_id": 15425
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {{AUTH_TOKEN}}',
}
conn.request("POST", "/myaccount/api/v1/vpc/node/detach/?apikey={{API_KEY}}&project_id={{PROJECT_ID}}&location={{Location}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
    "code": 200,
    "data": {
        "vpc_id": 3084,
        "vpc_name": "VPC-234",
        "project_id": "{{PROJECT_ID}}"
    },
    "errors": {},
    "message": "VPC detach operation successfully done"
}

Attach VPC

To attach VPC for an existing Node use a POST request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/vpc/node/attach/?apikey={{api_key}}&project_id={{project_id}}&location={{location}}

Name

Type

Description

Required

network_id

Integer

Network ID

True

vpc_name

String

VPC_name

True

current_ip_address

string

Node Current IP Address

True

node_id

string

Node ID

True

action

string

Must be “attach”

True

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"network_id": "23082",
"vpc_name": "VPC-234",
"current_private_ip": "172.16.107.116",
"node_id": 182412,
"action": "attach"
})
headers = {
'Authorization': 'Bearer {{AUTH_TOKEN}}',
'Content-Type': 'application/json',
}
conn.request("POST", "/myaccount/api/v1/vpc/node/attach/?apikey={{API_KEY}}&project_id={{PROJECT_ID}}&location={{Location}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
    "code": 200,
    "data": {
        "vpc_id": 3084,
        "vpc_name": "VPC-234",
        "project_id": "{{PROJECT_ID}}"
    },
    "errors": {},
    "message": "VPC Attach operation successfully done"
}

CDP Backup

Enable CDP Backup

To enable CDP Backup for an existing Node use a PUT request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/cdpbackup/activate/{{node_id}}/?apikey={{api_key}}&location={{location}}&project_id={{project_id}}

Name

Type

Description

Required

backup_now

Boolean

Must be True

True

exclude_file_folder

List

Folder list

True

hoursOfDay

string

backup hours separted by commas

True

plan_id

Integer

Plan ID

True

startingMinute

Integer

Minute at which backup start

True

import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"backup_now": True,
"exclude_file_folder": "",
"hoursOfDay": "0,6,12,18",
"plan_id": 1,
"startingMinute": 49,
"type": "HOURLY"
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {{AUTH_TOKEN}}',
}
conn.request("PUT", "/myaccount/api/v1/cdpbackup/activate/{{NODE_ID}}/?apikey={{API_KEY}}&location={{Location}}&project_id={{PROJECT_ID}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
    "code": 200,
    "data": {},
    "errors": {},
    "message": "Your backups will begin shortly."
}