Scalable File System
A Scalable File System is a virtual machine. To perform actions and store information, you shall send requests to the Scalable file system endpoint.
List of Plans
To get the list of available plans, send a GET request to the Scalable File System Endpoint
https://api.e2enetworks.com/myaccount/api/v1/efs/plans/?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/efs/plans/?apikey={{api_key}}&project_id={{project_id}}&location={{location}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
curl --location 'https://api.e2enetworks.com/myaccount/api/v1/efs/plans/?apikey={{api_key}}&project_id={{project_id}}&location={{location}}' \
--header 'Authorization: Bearer {{AUTH_TOKEN}}' \
--header 'Content-Type: application/json' \
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
content-type: application/json; charset=utf-8
status: 202 Accepted
ratelimit-limit: 1200
ratelimit-remaining: 965
ratelimit-reset: 1415984218
{
"code": 200,
"data": [
{
"name": "250 GB",
"bs_size": 0.25,
"price_per_hour": 4.175,
"price_per_month": 3000.0,
"location": "Delhi",
"iops": 3750,
"is_active": true,
"currency": "INR",
"available_inventory_status": true
},
{
"name": "500 GB",
"bs_size": 0.5,
"price_per_hour": 8.35,
"price_per_month": 6000.0,
"location": "Delhi",
"iops": 7500,
"is_active": true,
"currency": "INR",
"available_inventory_status": true
},
{
"name": "1 TB",
"bs_size": 1.0,
"price_per_hour": 16.7,
"price_per_month": 12000.0,
"location": "Delhi",
"iops": 15000,
"is_active": true,
"currency": "INR",
"available_inventory_status": true
},
{
"name": "2 TB",
"bs_size": 2.0,
"price_per_hour": 33.4,
"price_per_month": 24000.0,
"location": "Delhi",
"iops": 30000,
"is_active": true,
"currency": "INR",
"available_inventory_status": true
},
{
"name": "4 TB",
"bs_size": 4.0,
"price_per_hour": 66.8,
"price_per_month": 48000.0,
"location": "Delhi",
"iops": 60000,
"is_active": true,
"currency": "INR",
"available_inventory_status": true
},
{
"name": "8 TB",
"bs_size": 8.0,
"price_per_hour": 133.6,
"price_per_month": 96000.0,
"location": "Delhi",
"iops": 120000,
"is_active": true,
"currency": "INR",
"available_inventory_status": true
},
{
"name": "16 TB",
"bs_size": 16.0,
"price_per_hour": 267.2,
"price_per_month": 192000.0,
"location": "Delhi",
"iops": 240000,
"is_active": true,
"currency": "INR",
"available_inventory_status": true
}
],
"errors": {},
"message": "Success"
}
List of Scalable File Systems
To get the list of SFS, send a GET request to the Scalable File System Endpoint
https://api.e2enetworks.com/myaccount/api/v1/efs/page=1&page_size=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/efs/?page=1&page_size=5&apikey={{api_key}}&project_id={{project_id}}&location={{location}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
curl --location 'https://api.e2enetworks.com/myaccount/api/v1/efs/?page=1&page_size=5&apikey={{api_key}}&project_id={{project_id}}&location={{location}}' \
--header 'Authorization: Bearer {{AUTH_TOKEN}}' \
--header 'Content-Type: application/json'
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
content-type: application/json; charset=utf-8
status: 202 Accepted
ratelimit-limit: 1200
ratelimit-remaining: 965
ratelimit-reset: 1415984218
{
"code": 200,
"data": [
{
"id": 469,
"name": "sfs-828",
"efs_disk_size": "250 GB",
"private_endpoint": "10.12.138.8",
"iops": 3750,
"status": "Available",
"plan_name": "250 GB",
"is_backup_enabled": false,
"backup_state": "",
"vpc_id": 3170,
"vpc_name": "VPC-600",
"is_all_vpc_resources_allowed": false,
"vpc_node_id": 184231
},
{
"id": 468,
"name": "sfs-828",
"efs_disk_size": "250 GB",
"private_endpoint": "10.12.138.7",
"iops": 3750,
"status": "Available",
"plan_name": "250 GB",
"is_backup_enabled": false,
"backup_state": "",
"vpc_id": 3170,
"vpc_name": "VPC-600",
"is_all_vpc_resources_allowed": false,
"vpc_node_id": 184231
},
{
"id": 467,
"name": "sfs-828",
"efs_disk_size": "250 GB",
"private_endpoint": "10.12.138.6",
"iops": 3750,
"status": "Available",
"plan_name": "250 GB",
"is_backup_enabled": false,
"backup_state": "",
"vpc_id": 3170,
"vpc_name": "VPC-600",
"is_all_vpc_resources_allowed": false,
"vpc_node_id": 184231
}
],
"errors": {},
"message": "Success"
}
Create Scalable File System
To create a scalable file system, send a POST request to the Scalable File System endpoint
https://api.e2enetworks.com/myaccount/api/v1/efs/create/?apikey={{api_key}}&location={{location}}&project_id={{project_id}}
import http.client
import json
conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"efs_name": "sfs-828",
"efs_disk_size": 250,
"efs_disk_iops": 3750,
"vpc_id": "23509",
"efs_plan_name": "250 GB"
})
headers = {
'Authorization': 'Bearer {{AUTH_TOKEN}}',
'Content-Type': 'application/json',
}
conn.request("POST", "/myaccount/api/v1/efs/create/?apikey={{api_key}}&location={{location}}&project_id={{project_id}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
curl --location 'https://api.e2enetworks.com/myaccount/api/v1/efs/create/?apikey={{api_key}}&location={{location}}&project_id={{project_id}}' \
--header 'Authorization: Bearer {{AUTH_TOKEN}}' \
--header 'Content-Type: application/json' \
--data '{
"efs_name":"sfs-828",
"efs_disk_size":250,
"efs_disk_iops":3750,
"vpc_id":"23509",
"efs_plan_name":"250 GB"
}'
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
content-type: application/json; charset=utf-8
status: 202 Accepted
ratelimit-limit: 1200
ratelimit-remaining: 965
ratelimit-reset: 1415984218
{
"efs_name":{{sfs_name}},
"efs_disk_size":{{efs_disk_size}},
"efs_disk_iops":{{sfs_iops}},
"vpc_id":{{network_id}},
"efs_plan_name":{{efs_plan_name}}
}
{
"code": 200,
"data": {
"efs_id": 471,
"name": "sfs-828",
"private_ip": "10.12.138.10"
},
"errors": {},
"message": "Setting Up your SFS will take 2-3 minutes."
}
Activating Backup for a Scalable File system
To activate backup for a Scalable File System, send a PUT request to the SFS endpoint
https://api.e2enetworks.com/myaccount/api/v1/nodes/?apikey={{api_key}}&project_id={{project_id}}
Attributes and respective values required to send this POST request are:
Name |
Type |
Description |
Required |
---|---|---|---|
name |
String |
A string used as name for the node. |
TRUE |
region |
String |
Identifier of the region you wish to create node in. (Currently, only ncr region is available.) |
TRUE |
plan |
String |
Unique identifier that specifies the plan name of the node. |
TRUE |
image |
integer (if using an image ID), or String (if using a public image slug) |
Unique image ID of public or private image, or identifier of the public image; which would be the base image for the node. |
TRUE |
ssh_keys |
Array |
An array of SSH Key fingerprints or IDs that you wish to include in the root account after the node’s creation. |
FALSE |
backups |
Boolean |
A boolean indicating to enable or to disable automated backups. Enabling automated backups is possible only when creating the node. |
FALSE |
tags |
Array |
An array of tag names in string format to be associated with node after its creation. Tag names can be new or existing names. |
FALSE |
is_saved_image |
Boolean |
A boolean indicating image is saved or base image. |
|
saved_image_template_id |
Integer |
Template Id of saved image. |
|
cn_id |
Integer |
committed_sku_id of plan |
FALSE |
number_of_instances |
Integer |
Number of nodes you want to launch together and default value is taken as 1. |
FALSE |
curl 'https://api.e2enetworks.com/myaccount/api/v1/nodes/?apikey={{api_key}}&project_id={{project_id}}&location={{location}}' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Accept-Language: en-gb' \
-H 'Authorization: Bearer {{token}}' \
-H 'Content-Type: application/json' \
-H 'Origin: https://myaccount.e2enetworks.com' \
-H 'Pragma: no-cache' \
-H 'Referer: https://myaccount.e2enetworks.com/' \
-H 'x-api-key: {{api_key}}' \
--data-raw '{"label":"Default","name":"C3-8GB-102","region":"ncr","plan":"C3-4vCPU-8RAM-100DISK-C3.250GB-CentOS-Stream8-Delhi-NCR-2","image":"CentOS-Stream-Distro","ssh_keys":[""],"start_scripts":[],"backups":false,"enable_bitninja":false,"disable_password":true,"is_saved_image":false,"saved_image_template_id":null,"reserve_ip":"","reserve_ip_pool":"","is_ipv6_availed":false,"vpc_id":"","default_public_ip":false,"ngc_container_id":null,"security_group_id":50830,"is_encryption_required":false}'
--compressed
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
content-type: application/json; charset=utf-8
status: 202 Accepted
ratelimit-limit: 1200
ratelimit-remaining: 965
ratelimit-reset: 1415984218
{
"label": "Default",
"name": "C2-12GB",
"region": "ncr",
"plan":"{{Plan_name}}",
"image": "{{image_name}}",
"ssh_keys": [],
"backups": False,
"enable_bitninja": False,
"disable_password": False,
"is_saved_image": False,
"saved_image_template_id": None,
"reserve_ip": "",
"is_ipv6_availed": False,
"vpc_id": "",
"default_public_ip": False,
"ngc_container_id": None,
"security_group_id": 3482,
"start_scripts": []
}
{
"message": "Success",
"code": 200,
"data": {
"id": 14962,
"name": "centos-test",
"created_at": "2019-06-04T12:07:13.436504Z",
"public_ip_address": "101.53.157.223",
"private_ip_address": "172.16.107.121",
"backup": false,
"disk": "115 GB",
"status": "Create",
"vcpus": "2",
"memory": "8.00 GB",
"plan": "B-2VCPU-8RAM-115DISK",
"region": "ncr",
"is_locked": false
},
"errors": {}
}
Deactivating Backup for the SFS
To deactivate the backup from a SFS system, send a PUT request to the endpoint
https://api.e2enetworks.com/myaccount/api/v1/efs/{{efs_id}}/backup/deactivate/?apikey={{api_key}}&project_id={{project_id}}&location={{location}}
import http.client
import json
conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({})
headers = {
'Authorization': 'Bearer {{AUTH_TOKEN}}',
'Content-Type': 'application/json',
}
conn.request("PUT", "/myaccount/api/v1/efs/{{efs_id}}/backup/deactivate/?apikey={{api_key}}&project_id={{project_id}}&location={{location}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
curl --location --request PUT 'https://api.e2enetworks.com/myaccount/api/v1/efs/{{efs_id}}/backup/deactivate/?apikey={{api_key}}&project_id={{project_id}}&location={{location}}' \
--header 'Authorization: Bearer {{AUTH_TOKEN}}' \
--header 'Content-Type: application/json'
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
content-type: application/json; charset=utf-8
status: 202 Accepted
ratelimit-limit: 1200
ratelimit-remaining: 965
ratelimit-reset: 1415984218
{
"code": 200,
"data": {
"sfs_id": 467,
"sfs_name": "sfs-828"
},
"errors": {},
"message": "Your SFS backup was disabled successfully."
}
Grant Access for SFS
To grant access for the SFS, send a PUT request to the endpoint
https://api.e2enetworks.com/myaccount/api/v1/efs/allow-vpc-cidr/?apikey={{api_key}}&project_id={{project_id}}&location={{location}}
import http.client
import json
conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"efs_id": 467,
"vpc_id": 3170,
"permissions": "rw"
})
headers = {
'Authorization': 'Bearer {{AUTH_TOKEN}}',
'Content-Type': 'application/json',
}
conn.request("PUT", "/myaccount/api/v1/efs/allow-vpc-cidr/?apikey={{api_key}}&project_id={{project_id}}&location={{location}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
curl --location --request PUT 'https://api.e2enetworks.com/myaccount/api/v1/efs/allow-vpc-cidr/?apikey={{api_key}}&project_id={{project_id}}&location={{location}}' \
--header 'Authorization: Bearer {{AUTH_TOKEN}}' \
--header 'Content-Type: application/json'\
--data '{
"efs_id":467,
"vpc_id":3170,
"permissions":"rw"
}'
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
content-type: application/json; charset=utf-8
status: 202 Accepted
ratelimit-limit: 1200
ratelimit-remaining: 965
ratelimit-reset: 1415984218
{
"efs_id":{{efs_id}},
"vpc_id":{{vpc_id}},
"permissions":"rw"
}
{
"code": 200,
"data": {
"efs_id": 467
},
"errors": {},
"message": " Network Configuration Initiated. Expected completion within 2-3 minutes."
}
Disable all access for SFS
To disable access for the SFS, send a DELETE request to the endpoint
https://api.e2enetworks.com/myaccount/api/v1/efs/{{efs_id}}/node/{{vpc_node_id}}/prohibit/?connection_type=VPC&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/efs/{{efs_id}}/node/{{vpc_node_id}}/prohibit/?connection_type=VPC&apikey={{api_key}}&project_id={{project_id}}&location={{location}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
curl --location --request DELETE 'https://api.e2enetworks.com/myaccount/api/v1/efs/{{efs_id}}/node/{{vpc_node_id}}/prohibit/?connection_type=VPC&apikey={{api_key}}&project_id={{project_id}}&location={{location}}' \
--header 'Authorization: Bearer {{AUTH_TOKEN}}' \
--header 'Content-Type: application/json'
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
content-type: application/json; charset=utf-8
status: 202 Accepted
ratelimit-limit: 1200
ratelimit-remaining: 965
ratelimit-reset: 1415984218
{
"code": 200,
"data": {
"efs_id": "467"
},
"errors": {},
"message": " Network De-configuration Initiated. Expected completion within 2-3 minutes."
}
Delete SFS
To delete the Scalable File System, send a DELETE request to the endpoint
https://api.e2enetworks.com/myaccount/api/v1/efs/delete/{{efs_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/efs/delete/{{efs_id}}/?apikey={{api_key}}&project_id={{project_id}}&location={{location}}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
curl --location --request DELETE 'https://api.e2enetworks.com/myaccount/api/v1/efs/delete/{{efs_id}}/?apikey={{api_key}}&project_id={{project_id}}&location={{location}}' \
--header 'Authorization: Bearer {{AUTH_TOKEN}}' \
--header 'Content-Type: application/json'
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
content-type: application/json; charset=utf-8
status: 202 Accepted
ratelimit-limit: 1200
ratelimit-remaining: 965
ratelimit-reset: 1415984218
{
"code": 200,
"data": {},
"errors": {},
"message": "We have initiated your SFS deletion request you will be notified using email in a short while"
}