Queue Service

A Queue Service lets you send,store and receive messages between parts of application or components

List of available Plans

To get the list of available plans, send a GET request to the wndpoint

https://api.e2enetworks.com/myaccount/api/v1/eqs/eqs/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/eqs/plans?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": [
        {
            "ram": "32",
            "eqs_slug_name": "EQS-4vCPU-32RAM-100DISK-M3.32GB-EQS-Delhi",
            "eqs_template_id": 17082,
            "category_type": "eqs_node",
            "cpu": "4",
            "price_per_month": "3723",
            "price_per_hour": "5.1",
            "disk_space": 100,
            "available_inventory_status": true
        }
    ],
    "errors": {},
    "message": "Success"
}

List of EQS Services

To get the list of EQS Services, send a GET request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/eqs/?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/eqs/?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": [
        {
            "eqs_id": 452,
            "eqs_name": "eqs_node-241",
            "eqs_plan_id": 17082,
            "eqs_plan_name": "EQS-4vCPU-32RAM-100DISK-M3.32GB-EQS-Delhi",
            "status": "Creating",
            "endpoint": "216.48.177.140",
            "private_endpoint": "172.16.104.65",
            "eqs_details_line_items": [],
            "created_at": "Jun 17, 2024 06:06:59 PM"
        }
    ],
    "errors": {},
    "message": "Success",
    "total_page_number": 1,
    "total_count": 1
}

Creation of EQS Service

To create a EQS Service, send a POST request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/eqs/?apikey={{api_key}}&project_id={{project_id}}&location={{location}}
import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"eqs_plan_name": "EQS-4vCPU-32RAM-100DISK-M3.32GB-EQS-Delhi",
"eqs_plan_id": 17082,
"eqs_name": "eqs_node-435",
"vpc_id": "",
"security_group_id": None
})
headers = {
'Authorization': 'Bearer {{AUTH_TOKEN}}',
'Content-Type': 'application/json'
}
conn.request("POST", "/myaccount/api/v1/eqs/?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...
{
    "eqs_plan_name":"EQS-4vCPU-32RAM-100DISK-M3.32GB-EQS-Delhi",
    "eqs_plan_id":17082,
    "eqs_name":"eqs_node-435",
    "vpc_id":"",
    "security_group_id":null
}

Add a Queue to the EQS Service

To add a queue to the EQS Service, send a POST request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/eqs/queue/{{eqs_id}}?apikey={{api_key}}&project_id={{project_id}}&location={{location}}
import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"queue_name": "EQS-Queue-165",
"eqs_details_id": 452
})
headers = {
'Authorization': 'Bearer {{AUTH_TOKEN}}',
'Content-Type': 'application/json',
}
conn.request("POST", "/myaccount/api/v1/eqs/queue/{{eqs_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...
{
    "queue_name":{{queue_name}},
    "eqs_details_id":{{eqs_id}}
}

Showing of Credentials

To show the credentials of a EQS, send a GET request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/eqs/creds/{{eqs_id}}/?endpoint={{endpoint}}&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/eqs/creds/{{eqs_id}}/?endpoint={{endpoint}}&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": {
        "access_key": {{access_key}},
        "secret_key": {{secret_key}},
        "host_endpoint": {{host_endpoint}}
    },
    "errors": {},
    "message": "Success"
}

Test Send Message

To test send message in a queue, send a POST request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/eqs/queue/operations/{{eqs_id}}/{{queue_id}}/?apikey={{api_key}}&project_id={{project_id}}&location={{location}}
import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"queue_name": "EQS-Default-Queue",
"action_type": "send_message",
"eqs_details_id": 454,
"eqs_queue_id": 629,
"msg_body": "asdfghjkl;'",
"delayseconds": 0
})
headers = {
'Authorization': 'Bearer {{AUTH_TOKEN}}',
'Content-Type': 'application/json',
}
conn.request("POST", "/myaccount/api/v1/eqs/queue/operations/{{eqs_id}}/{{queue_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...
{
    "queue_name":{{queue_name}},
    "action_type":"send_message",
    "eqs_details_id":{{eqs_id}},
    "eqs_queue_id":{{queue_id}},
    "msg_body":"asdfghjkl;'",
    "delayseconds":{{delayseconds}}
}

Purge

To purge in a queue, send a POST request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/eqs/queue/operations/{{eqs_id}}/{{queue_id}}/?apikey={{api_key}}&project_id={{project_id}}&location={{location}}
import http.client
import json

conn = http.client.HTTPSConnection("api.e2enetworks.com")
payload = json.dumps({
"queue_name": "EQS-Default-Queue",
"action_type": "purge",
"eqs_details_id": 454,
"eqs_queue_id": 629
})
headers = {
'Authorization': 'Bearer {{AUTH_TOKEN}}',
'Content-Type': 'application/json',
}
conn.request("POST", "/myaccount/api/v1/eqs/queue/operations/{{eqs_id}}/{{queue_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...
{
    "queue_name":{{queue_name}},
    "action_type":"purge",
    "eqs_details_id":{{eqs_id}},
    "eqs_queue_id":{{queue_id}}
}

Delete a queue from a EQS

To delete queue from a EQS, send a DELETE request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/eqs/queue/{{eqs_id}}/{{queue_id}}/{{queue_name}}?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/eqs/queue/{{eqs_id}}/{{queue_id}}/{{queue_name}}?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 an Queue Service

To delete queue service, send a DELETE request to the endpoint

https://api.e2enetworks.com/myaccount/api/v1/eqs/{{eqs_id}}/{{eqs_name}}?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/eqs/{{eqs_id}}/{{eqs_name}}?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...