API: Private networks
Create private networks and manage their members.
Changes to networks and memberships are asynchronous. The response already carries the in-progress status; poll the list until it settles.
List private networks
GET /private-networks
Returns your private networks, each with its members.
Authentication: Send your API key or token as a bearer token.
Responses
200OK. Returns:data(list ofPrivateNetwork).
Example
curl -X GET https://veneshcloud.ir/api/private-networks \
-H "Authorization: Bearer $VENESH_API_KEY" \
-H "Accept: application/json"
Create a private network
POST /private-networks
Creates a network on a provider and region. It starts as pending.
Authentication: Send your API key or token as a bearer token.
Request body (application/json)
| Field | Type | Required | Values |
|---|---|---|---|
provider |
string | Yes | aws, ovh, alibaba |
region |
string | Yes | |
name |
string | No |
Responses
202Accepted, work continues in the background. ReturnsPrivateNetwork.422Validation error, or not allowed in the current state
Example
curl -X POST https://veneshcloud.ir/api/private-networks \
-H "Authorization: Bearer $VENESH_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"provider":"aws","region":"REGION"}'
Get a private network
GET /private-networks/{privateNetwork}
Returns one network with its members.
Authentication: Send your API key or token as a bearer token.
Path parameters
| Field | Type |
|---|---|
privateNetwork |
integer |
Responses
200OK. ReturnsPrivateNetwork.403Not allowed, the resource is not yours
Example
curl -X GET https://veneshcloud.ir/api/private-networks/NETWORK_ID \
-H "Authorization: Bearer $VENESH_API_KEY" \
-H "Accept: application/json"
Delete a private network
DELETE /private-networks/{privateNetwork}
Deletes an active network that has no members.
Authentication: Send your API key or token as a bearer token.
Path parameters
| Field | Type |
|---|---|
privateNetwork |
integer |
Responses
202Accepted, work continues in the background. ReturnsPrivateNetwork.403Not allowed, the resource is not yours422Validation error, or not allowed in the current state
Example
curl -X DELETE https://veneshcloud.ir/api/private-networks/NETWORK_ID \
-H "Authorization: Bearer $VENESH_API_KEY" \
-H "Accept: application/json"
Add a VM to a network
POST /private-networks/{privateNetwork}/members
Joins a running VM on the same provider to the network.
Authentication: Send your API key or token as a bearer token.
Path parameters
| Field | Type |
|---|---|
privateNetwork |
integer |
Request body (application/json)
| Field | Type | Required | Values |
|---|---|---|---|
order_id |
integer | Yes |
Responses
202Accepted, work continues in the background. ReturnsPrivateNetworkMembership.403Not allowed, the resource is not yours422Validation error, or not allowed in the current state
Example
curl -X POST https://veneshcloud.ir/api/private-networks/NETWORK_ID/members \
-H "Authorization: Bearer $VENESH_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"order_id":1}'
Remove a VM from a network
DELETE /private-networks/{privateNetwork}/members/{membership}
Removes a joined VM from the network.
Authentication: Send your API key or token as a bearer token.
Path parameters
| Field | Type |
|---|---|
privateNetwork |
integer |
membership |
integer |
Responses
202Accepted, work continues in the background. ReturnsPrivateNetworkMembership.403Not allowed, the resource is not yours404Not found422Validation error, or not allowed in the current state
Example
curl -X DELETE https://veneshcloud.ir/api/private-networks/NETWORK_ID/members/MEMBERSHIP_ID \
-H "Authorization: Bearer $VENESH_API_KEY" \
-H "Accept: application/json"
Objects
Field lists for the objects returned above.
PrivateNetwork
| Field | Type | Values |
|---|---|---|
id |
integer | |
provider |
string | aws, ovh, alibaba |
region |
string | |
name |
string | |
external_network_id |
string | |
status |
string | pending, active, failed, deleting, deleted |
failure_reason |
string | |
members |
list of PrivateNetworkMembership |
|
created_at |
string |
PrivateNetworkMembership
| Field | Type | Values |
|---|---|---|
id |
integer | |
private_network_id |
integer | |
order_id |
integer | |
hostname |
string | |
status |
string | pending, joined, leaving, left, failed |
failure_reason |
string | |
joined_at |
string |