POST
/api/v1/security_group/
curl --request POST \ --url 'https://api.e2enetworks.com/myaccount/api/v1/security_group/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '{ "name": "security_group_rule", "description": "", "rules": [ { "network": "any", "rule_type": "Inbound", "protocol_name": "Custom_TCP", "port_range": "21,22", "network_cidr": "--", "network_size": 1, "vpc_id": null } ], "default": false}'import requests
response = requests.post( "https://api.e2enetworks.com/myaccount/api/v1/security_group/", params={"project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "name": "security_group_rule", "description": "", "rules": [ { "network": "any", "rule_type": "Inbound", "protocol_name": "Custom_TCP", "port_range": "21,22", "network_cidr": "--", "network_size": 1, "vpc_id": None, }, ], "default": False, },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/security_group/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", location: "<LOCATION>", apikey: "<API_KEY>" });
const response = await fetch(url, { method: "POST", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "name": "security_group_rule", "description": "", "rules": [ { "network": "any", "rule_type": "Inbound", "protocol_name": "Custom_TCP", "port_range": "21,22", "network_cidr": "--", "network_size": 1, "vpc_id": null } ], "default": false }),});console.log(await response.json());Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”project_id
required
integer
Project ID Find your project id here
location
required
string
Deployment region for the resource. Accepted values: Delhi, Chennai.
Mumbai region has been discontinued. Delhi and Chennai are the only supported regions.
Request Body
Section titled “Request Body”Media typeapplication/json
object
name
string
Example
security_group_ruledescription
string
Example
rules
Array<object>
object
network
string
Example
anyrule_type
string
Example
Inboundprotocol_name
string
Example
Custom_TCPport_range
string
Example
21,22network_cidr
string
Example
--network_size
integer
Example
1vpc_id
integer
Example
nulldefault
boolean
Example
falseResponses
Section titled “Responses”Successful response when a security group is created.
Media typeapplication/json
object
code
integer
data
object
resource_type
string
label_id
string
errors
object
message
string
Example
{ "code": 200, "data": { "resource_type": null, "label_id": null }, "errors": {}, "message": "Security Group created successfully."}