cURL Python

Introduction

The VNS3:ms API provides a programmable interface on top of your network edge. This allows you to automate your network infrastructure deployment and program reactive behavior to real time events.

Getting started

Cohesive Networks will share the image with you for your environment of choice. Request access by opening a support request. We'll respond within minutes.

SDKs and Clients

Currently we support a python SDK for VNS3:ms and VNS3.

We have a zero-dependency CLI and Ruby CLI in the roadmap! Let us know what you'd like to use to build your networks.

Topology starters

We provide some topology starters to get going with fully automating the build of your network here:

We'll be continually updating and revising this, with user input.

Don't see your use case there? Looking to use cloudformation or Azure Resource Templates? Get in touch. We'd be happy to help you get going with your automation of choice.

Some cloud quickstarts:

module "aws_vpc" {
  source              = "git@github.com:cohesive/vns3-infra-templates.git//modules/aws-vpc"

  vpc_name            = "${var.topology_name}-vpc"
  vpc_dns_hostnames   = true
  vpc_cidr            = var.vpc_cidr
  aws_region          = var.vpc_region
  subnets_cidrs       = var.vpc_subnets
  region_azs          = var.vpc_region_azs
  common_tags         = var.common_tags
}

# Spin up VNS3 controller mesh
module "vns3_mesh" {
  source              = "github.com/cohesive/vns3-infra-templates.git//modules/aws-vns3-public"
  topology_name       = "${var.topology_name}"
  vns3_version        = "${var.vns3_version}"       # searches for latest AMI of version
  vns3_license_type   = "byol"
  vns3_instance_type  = "${var.vns3_instance_type}"
  vns3_account_owner  = "${var.vns3_account_owner}"
  vpc_id              = "${module.aws_vpc.vpc_id}"
  vpc_route_table_id  = "${module.aws_vpc.route_table_id}"
  access_cidr         = "${var.access_cidr}"
  client_cidrs        = ["${var.client_cidrs}"]
  subnet_ids          = "${length(module.aws_vpc.subnet_ids) == 0 ? [] : slice(module.aws_vpc.subnet_ids, 0, var.vns3_instance_count)}"
  common_tags         = var.common_tags
}

module "vns3ms" {
  source                = "git@github.com:cohesive/vns3-infra-templates.git//modules/aws-vns3ms-public"

  topology_name         = "${var.topology_name}"
  vns3ms_account_owner  = var.vns3_account_owner
  vns3ms_version        = var.vns3ms_version
  vns3ms_instance_type  = var.vns3ms_instance_type
  security_group_ids    = module.vns3.vns3_sg   # launch in VNS3 SG
  public_subnet_id      = element(module.aws_vpc.subnet_ids, 0)
  common_tags           = var.common_tags
}

VNS3:ms API v2.3.3

The VNS3 Management System is a single dashboard for full visibility into your Cloud Area Network. Manage, monitor and automate your firewall policies, network access, backups and more.

Download spec

Base URLs:

Terms of service Email: Cohesive Networks Support team Web: Cohesive Networks Support team

Authentication

# Create an access token for use with the API
curl -X POST -H "application/json" \
    -d '{"username": "admin", "api_key": "yourapikeystring"}' \
    https://55.55.55.55/api/auth/

> {"api_token":"bdfac681b375e4306b8cd3280b4387700cc3ee5"}

# GET request with API token returned above
curl -X GET -H "api-token:bdfac681b375e4306b8cd3280b4387700cc3ee5" \
    https://55.55.55.55/api/system/status
from cohesivenet import MSClient, Configuration

ms_client = MSClient(
    configuration=Configuration(
        host="55.55.55.55",
        username="admin",
        api_key="yourapikeystring",
        verify_ssl=False,   # if SSL Certs installed, set to True
    )
)

# Set token on client
ms_client.refresh_token()
response = ms_client.system.get_system_status()

Access

Provision API keys or short-lived access URLs for providing temporary access to any VNS3 controller in your topology

Create API Token

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/auth \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

from cohesivenet import VNS3Client

api_response = vns3_client.access.post_create_token(
    username=username,
    api_key=api_key)

print(api_response.json())

POST /auth

API login method. Accept API-key as password, return API-token to be used for all other calls

Body parameter

{
  "username": "string",
  "api_key": "string"
}

Parameters

Name In Type Required Description
username body string true Username for API key
api_key body string true Enabled User API key to generate token with

Example responses

201 Response

{
  "api_token": "bdfac681b375e4306b8cd3280b440890d82378147c41fcc8e"
}

Responses

Status Meaning Description Schema
201 Created Created Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 201

ApiTokenResponse

Name Type Required Constraints Description
  api_token string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Activate API key

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/auth/activate \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

from cohesivenet import VNS3Client

api_response = vns3_client.access.put_activate_api_key(
    username=username,
    api_key=api_key)

print(api_response.json())

PUT /auth/activate

Activate the default API key

Body parameter

{
  "username": "string",
  "api_key": "string"
}

Parameters

Name In Type Required Description
username body string true Username for default API Key
api_key body string true -

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "message": "Key activated",
    "name": "Admin Key",
    "api_key": "1802fb5283e35e65b4cf7d4dfa5a115917",
    "id": 10,
    "enabled": true,
    "active_tokens": 0
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   message string false - -
   id integer false - -
   name string false - -
   api_key string false - -
   active_tokens integer false - -
   enabled boolean false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Expire current token

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/auth/expire_token \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.access.put_expire_token()

print(api_response.json())

PUT /auth/expire_token

Expire current token to log out of API session

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "message": "Successfully expired token"
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

SimpleObjectMessageResponse

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   message string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Invalidate API Key tokens

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/auth/invalidate_tokens \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.access.put_invalidate_api_key_tokens(
    api_key_id=api_key_id)

print(api_response.json())

PUT /auth/invalidate_tokens

Invalidate API key Tokens

Body parameter

{
  "api_key_id": 0
}

Parameters

Name In Type Required Description
api_key_id body integer true API Key id

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "message": "Invalidated 4 tokens",
    "id": 2,
    "enabled": true,
    "active_tokens": 0,
    "name": "API Key"
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   message string false - -
   name string false - -
   id integer false - -
   active_tokens integer false - -
   enabled boolean false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get API keys

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/auth/api_keys \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.access.get_api_keys()

print(api_response.json())

GET /auth/api_keys

Get API keys

Example responses

200 Response

{
  "response_type": "success",
  "response": [
    {
      "id": 3,
      "name": "AdminKey",
      "enabled": true,
      "created_at": "2019-01-06T19:02:40.000Z",
      "default_key": false,
      "active_tokens": 1,
      "expired_tokens": 10,
      "last_access_time": "2020-03-06T12:02:14.000Z",
      "last_access_ip": "34.89.10.21"
    }
  ]
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response [object] false - -
   id integer false - -
   name string false - -
   enabled boolean false - -
   created_at string(date-time) false - -
   default_key boolean false - -
   active_tokens integer false - Number of valid tokens in use
   expired_tokens integer false - Number of expired tokens
   last_access_time string(date-time) false - The last time a token for this API key was used
   last_access_ip string false - The last IP address to use this API key or an API token for this api key

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Create API Key

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/auth/api_key \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.access.post_create_api_key(
    key_name=key_name)

print(api_response.json())

POST /auth/api_key

Create new API Key

Body parameter

{
  "key_name": "string"
}

Parameters

Name In Type Required Description
key_name body string true Name or description of API key

Example responses

201 Response

{
  "response_type": "success",
  "response": {
    "message": "Key created",
    "name": "Jenkins API Key",
    "api_key": "a7df7d7fbd0eae80e537382aabf",
    "id": 4,
    "active_tokens": 0,
    "enabled": true
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
201 Created Created Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 201

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   message string false - -
   id integer false - -
   name string false - -
   api_key string false - -
   active_tokens integer false - -
   enabled boolean false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Update API Key

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/auth/api_key/{key_id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.access.put_update_api_key(key_id,
    key_name=key_name,
    enabled=enabled)

print(api_response.json())

PUT /auth/api_key/{key_id}

Update Existing API Key

Body parameter

{
  "key_name": "string",
  "enabled": true
}

Parameters

Name In Type Required Description
key_id path integer true API Key ID
key_name body string true New name for API key
enabled body boolean true Enable/Disable API Key

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "message": "Key updated",
    "name": "My New Name",
    "id": 4,
    "enabled": true,
    "active_tokens": 0
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   message string false - -
   id integer false - -
   name string false - -
   active_tokens integer false - -
   enabled boolean false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Delete API Key

Code samples

# You can also use wget

curl -X DELETE https://vns3ms-host:8000/api/auth/api_key/{key_id} \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.access.delete_api_key(key_id)

print(api_response.json())

DELETE /auth/api_key/{key_id}

Delete API Key

Parameters

Name In Type Required Description
key_id path integer true API Key ID

Example responses

200 Response

{
  "response_type": "success",
  "response": "Deleted key"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not Found Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Administration

Configure VNS3:ms administration settings such as LDAP integration

Enable/Disable LDAP

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/admin/ldap \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.admin.put_enable_ldap(
    enabled=enabled)

print(api_response.json())

PUT /admin/ldap

Enable/Disable LDAP

Body parameter

{
  "enabled": true
}

Parameters

Name In Type Required Description
enabled body boolean true -

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "ldap_enabled": true
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   ldap_enabled boolean false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get LDAP Settings

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/admin/ldap/settings \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.admin.get_ldap_settings()

print(api_response.json())

GET /admin/ldap/settings

Get LDAP Settings

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "ldap_host": "4.4.4.4",
    "ldap_port": 389,
    "ldap_ssl": false,
    "ldap_binddn": "abcdef",
    "ldap_bindpw": "ghijklmn"
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   ldap_host string¦null false - -
   ldap_port integer¦null false - -
   ldap_ssl boolean¦null false - -
   ldap_binddn string¦null false - -
   ldap_bindpw string¦null false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Update LDAP settings

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/admin/ldap/settings \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.admin.put_ldap_settings(
    ldap_host=ldap_host,
    ldap_port=ldap_port,
    ldap_ssl=ldap_ssl,
    ldap_binddn=ldap_binddn,
    ldap_bindpw=ldap_bindpw)

print(api_response.json())

PUT /admin/ldap/settings

Update LDAP connection configuration settings

Body parameter

{
  "ldap_host": "string",
  "ldap_port": 389,
  "ldap_ssl": true,
  "ldap_binddn": "string",
  "ldap_bindpw": "string"
}

Parameters

Name In Type Required Description
ldap_host body string true Host for LDAP server, IP or DNS
ldap_port body integer false Port for LDAP server
ldap_ssl body boolean false Use SSL?
ldap_binddn body string false Bind Username
ldap_bindpw body string false Bind password

Example responses

200 Response

{
  "response_type": "success",
  "response": "Settings updated"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Validate LDAP settings

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/admin/ldap/settings \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.admin.post_validate_ldap_settings(
    ldap_host=ldap_host,
    ldap_port=ldap_port,
    ldap_ssl=ldap_ssl,
    ldap_binddn=ldap_binddn,
    ldap_bindpw=ldap_bindpw)

print(api_response.json())

POST /admin/ldap/settings

Validate LDAP connection settings

Body parameter

{
  "ldap_host": "string",
  "ldap_port": 389,
  "ldap_ssl": true,
  "ldap_binddn": "string",
  "ldap_bindpw": "string"
}

Parameters

Name In Type Required Description
ldap_host body string true Host for LDAP server, IP or DNS
ldap_port body integer false Port for LDAP server
ldap_ssl body boolean false Use SSL?
ldap_binddn body string false Bind Username
ldap_bindpw body string false Bind password

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "connect_success": true
  }
}

400 Response

{
  "response_type": "error",
  "response": {
    "connect_success": false,
    "message": "Failed to bind with username"
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request Error Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   connect_success boolean false - -
   message string false - -

Status Code 400

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   connect_success boolean false - -
   message string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get LDAP user schema

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/admin/ldap/user_schema \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.admin.get_ldap_user_schema()

print(api_response.json())

GET /admin/ldap/user_schema

Get LDAP user schema Settings

Example responses

200 Response

{
  "response_type": "string",
  "response": {
    "ldap_user_base": "string",
    "ldap_user_id_attribute": "string",
    "ldap_user_list_filter": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   ldap_user_base string false - Base DN from which to search for Users
   ldap_user_id_attribute string false - Attribute type for the Users
   ldap_user_list_filter string¦null false - Search filter for Users

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Set LDAP user schema settings

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/admin/ldap/user_schema \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.admin.put_ldap_user_schema(
    ldap_user_base=ldap_user_base,
    ldap_user_id_attribute=ldap_user_id_attribute,
    ldap_user_list_filter=ldap_user_list_filter)

print(api_response.json())

PUT /admin/ldap/user_schema

Set LDAP user schema settings

Body parameter

{
  "ldap_user_base": "string",
  "ldap_user_id_attribute": "string",
  "ldap_user_list_filter": "string"
}

Parameters

Name In Type Required Description
ldap_user_base body string true Base DN from which to search for Users
ldap_user_id_attribute body string true Attribute type for the Users
ldap_user_list_filter body string false Search filter for Users

Example responses

200 Response

{
  "response_type": "success",
  "response": "LDAP user schema settings updated"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Validate LDAP user schema

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/admin/ldap/user_schema \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.admin.post_validate_ldap_user_schema(
    ldap_user_base=ldap_user_base,
    ldap_user_id_attribute=ldap_user_id_attribute,
    ldap_user_list_filter=ldap_user_list_filter,
    limit=limit)

print(api_response.json())

POST /admin/ldap/user_schema

Validate LDAP user schema settings by retrieving data

Body parameter

{
  "ldap_user_base": "string",
  "ldap_user_id_attribute": "string",
  "ldap_user_list_filter": "string",
  "limit": 100
}

Parameters

Name In Type Required Description
ldap_user_base body string false Base DN from which to search for Users
ldap_user_id_attribute body string false Attribute type for the Users
ldap_user_list_filter body string false Search filter for Users
limit body integer false Number of records to return. Default = 100

Example responses

200 Response

{
  "response_type": "string",
  "response": [
    "string"
  ]
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

SimpleStringListResponse

Name Type Required Constraints Description
  response_type string false - -
  response [string] false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get LDAP group schema

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/admin/ldap/group_schema \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.admin.get_ldap_group_schema()

print(api_response.json())

GET /admin/ldap/group_schema

Get LDAP group schema Settings

Example responses

200 Response

{
  "response_type": "string",
  "response": {
    "ldap_group_required": true,
    "ldap_group_base": "string",
    "ldap_group_id_attribute": "string",
    "ldap_group_list_filter": "string",
    "ldap_group_member_attribute": "string",
    "ldap_group_member_attr_format": "UserDN",
    "ldap_search_scope": "subtree"
  }
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   ldap_group_required boolean false - -
   ldap_group_base string false - Base DN from which to search for Groups
   ldap_group_id_attribute string false - Attribute type for the Groups
   ldap_group_list_filter string¦null false - Search filter for Groups
   ldap_group_member_attribute string false - Attribute used to search for a user within the Group
   ldap_group_member_attr_format string false - Format of the Group Member attribute
   ldap_search_scope string false - Scope for search filter

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Set LDAP group schema settings

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/admin/ldap/group_schema \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.admin.put_ldap_group_schema(
    ldap_group_required=ldap_group_required,
    ldap_group_base=ldap_group_base,
    ldap_group_id_attribute=ldap_group_id_attribute,
    ldap_group_list_filter=ldap_group_list_filter,
    ldap_group_member_attribute=ldap_group_member_attribute,
    ldap_group_member_attr_format=ldap_group_member_attr_format,
    ldap_search_scope=ldap_search_scope)

print(api_response.json())

PUT /admin/ldap/group_schema

Set LDAP group schema settings

Body parameter

{
  "ldap_group_required": true,
  "ldap_group_base": "string",
  "ldap_group_id_attribute": "string",
  "ldap_group_list_filter": "string",
  "ldap_group_member_attribute": "string",
  "ldap_group_member_attr_format": "UserDN",
  "ldap_search_scope": "subtree"
}

Parameters

Name In Type Required Description
ldap_group_required body boolean true Require use of LDAP groups
ldap_group_base body string true Base DN from which to search for Groups
ldap_group_id_attribute body string true Attribute type for the Groups
ldap_group_list_filter body string false Search filter for Groups
ldap_group_member_attribute body string true Attribute used to search for a user within the Group
ldap_group_member_attr_format body string false Format of the Group Member attribute
ldap_search_scope body string false Search filter for Groups

Example responses

200 Response

{
  "response_type": "success",
  "response": "LDAP group schema settings updated"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Validate LDAP group schema

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/admin/ldap/group_schema \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.admin.post_validate_ldap_group_schema(
    ldap_group_base=ldap_group_base,
    ldap_group_id_attribute=ldap_group_id_attribute,
    ldap_group_list_filter=ldap_group_list_filter,
    ldap_group_member_attribute=ldap_group_member_attribute,
    ldap_group_member_attr_format=ldap_group_member_attr_format,
    ldap_search_scope=ldap_search_scope,
    limit=limit)

print(api_response.json())

POST /admin/ldap/group_schema

Validate LDAP group schema settings by retrieving data

Body parameter

{
  "ldap_group_base": "string",
  "ldap_group_id_attribute": "string",
  "ldap_group_list_filter": "string",
  "ldap_group_member_attribute": "string",
  "ldap_group_member_attr_format": "UserDN",
  "ldap_search_scope": "subtree",
  "limit": 100
}

Parameters

Name In Type Required Description
ldap_group_base body string true Base DN from which to search for Groups
ldap_group_id_attribute body string true Attribute type for the Groups
ldap_group_list_filter body string false Search filter for Groups
ldap_group_member_attribute body string true Attribute used to search for a user within the Group
ldap_group_member_attr_format body string false Format of the Group Member attribute
ldap_search_scope body string false Scope for search
limit body integer false Number of records to return. Default = 100

Example responses

200 Response

{
  "response_type": "string",
  "response": [
    "string"
  ]
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

SimpleStringListResponse

Name Type Required Constraints Description
  response_type string false - -
  response [string] false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

VNS3 Management

Manage VNS3 controllers in your network topology, automating snapshots, HA and more

Get VNS3 Snapshots

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/snapshots \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.vns3_management.get_vns3_snapshots(
    vns3_controller_id=vns3_controller_id,
    vns3_topology_id=vns3_topology_id,
    snapshot_id=snapshot_id)

print(api_response.json())

GET /snapshots

Return a list of available snapshot files grouped by VNS3 controller (optionally filtered by VNS3 controller)

Parameters

Name In Type Required Description
vns3_controller_id query integer false VNS3 controller ID
vns3_topology_id query integer false VNS3:ms Topology ID
snapshot_id query integer false Snapshot ID

Example responses

200 Response

{
  "response": {
    "failed_snapshots": [],
    "snapshots": [
      {
        "snapshot_id": 1,
        "created_at": "2020-05-15T17:42:41.000Z",
        "snapshot_name": "snapshot_20200515_1589564561_52.72.51.23",
        "snapshot_size": 2072122,
        "sha1_checksum": "c9cbcaca7d0e1996ae2411fde50f74881eeac542",
        "available": true,
        "status": "Stored locally",
        "vns3_controller_id": 1,
        "vns3_controller_name": "test-vns3-bp"
      }
    ]
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "Missing Snapshot with ID 7"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response object false - -
   snapshots [#/paths/~1snapshots/get/responses/200/content/application~1json/schema/properties/response/properties/snapshots/items] false - Available snapshots
    snapshot_id integer false - -
    created_at string(date-time) false - -
    snapshot_name string false - -
    snapshot_size integer false - -
    sha1_checksum string false - -
    available boolean false - -
    status string false - -
    vns3_controller_id integer false - -
    vns3_controller_name string false - -
   failed_snapshots [#/paths/~1snapshots/get/responses/200/content/application~1json/schema/properties/response/properties/snapshots/items] false - Failed snapshots

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Create VNS3 Snapshot

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/snapshots \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.vns3_management.post_create_vns3_snapshot(
    vns3_controller_id=vns3_controller_id)

print(api_response.json())

POST /snapshots

Create a snapshot for a particular VNS3 Controller

Body parameter

{
  "vns3_controller_id": 0
}

Parameters

Name In Type Required Description
vns3_controller_id body integer true ID for VNS3 controller

Example responses

202 Response

{
  "response_type": "success",
  "response": "Snapshot created"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "Missing VNS3 Controller with ID 9"
}

Responses

Status Meaning Description Schema
202 Accepted Accepted Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 202

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Delete VNS3 Snapshots

Code samples

# You can also use wget

curl -X DELETE https://vns3ms-host:8000/api/snapshots \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.vns3_management.delete_vns3_snapshots(
    snapshot_ids=snapshot_ids)

print(api_response.json())

DELETE /snapshots

Delete one or more snapshot files

Body parameter

{
  "snapshot_ids": [
    0
  ]
}

Parameters

Name In Type Required Description
snapshot_ids body [integer] true List of snapshot ids to delete

Example responses

200 Response

{
  "response_type": "success",
  "response": "Accessible snapshots deleted"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Download VNS3 snapshot

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/snapshots/download?snapshot_id=0 \
  -H 'Accept: application/octet-stream' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.vns3_management.get_download_vns3_snapshot(
    snapshot_id=snapshot_id)

print(api_response.file_download)   # path to downloaded file

GET /snapshots/download

Download a specific snapshot file

Parameters

Name In Type Required Description
snapshot_id query integer true Snapshot ID

Example responses

200 Response

"string"

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "Missing snapshot file"
}

Responses

Status Meaning Description Schema
200 OK File string
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get controller report

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/system/controller_report \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.vns3_management.get_controller_report(
    report_date=report_date)

print(api_response.json())

GET /system/controller_report

Get controller report

Parameters

Name In Type Required Description
report_date query string(date-time) false Date of report

Example responses

200 Response

{
  "response_type": "string",
  "response": {
    "snapshot_date": "2020-06-01T20:46:23Z",
    "snapshot": [
      {
        "controller_id": 0,
        "controller_name": "string",
        "controller_version": "string",
        "active": true,
        "created_date": "2020-06-01T20:46:23Z",
        "topology_id": 0,
        "topology_name": "string",
        "virtual_network_id": 0,
        "virtual_network_name": "string",
        "ha_backup_enabled": true
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   snapshot_date string(date-time) false - -
   snapshot [object] false - -
    controller_id integer false - -
    controller_name string false - -
    controller_version string false - -
    active boolean false - -
    created_date string(date-time) false - -
    topology_id integer false - -
    topology_name string false - -
    virtual_network_id integer false - -
    virtual_network_name string false - -
    ha_backup_enabled boolean false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get VNS3 Controllers

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/vns3_controllers \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.vns3_management.get_vns3_controllers(
    vns3_controller_id=vns3_controller_id,
    vns3_topology_id=vns3_topology_id)

print(api_response.json())

GET /vns3_controllers

Return list of all (accessible) VNS3 Controllers

Parameters

Name In Type Required Description
vns3_controller_id query integer false Filter by VNS3 controller
vns3_topology_id query integer false Filter by topology

Example responses

200 Response

{
  "response": [
    {
      "id": 0,
      "name": "string",
      "owner": "string",
      "virtual_network_id": 0,
      "virtual_network": "string",
      "vns3_topology_id": 0,
      "vns3_topology": "string",
      "vns3_address": "string",
      "private_ip_address": "string",
      "vns3_version": "string",
      "licensed": true,
      "active": true,
      "peered": true,
      "description": "string",
      "alerts_enabled": true,
      "controller_status": {
        "last_contact_time": "2020-06-01T20:46:23Z",
        "last_successful_contact_time": "2020-06-01T20:46:23Z",
        "last_contact_code": 0,
        "last_contact_result": "string",
        "failed_contact_count": 0,
        "alerts_enabled": true
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response [object] false - -
   id integer false - -
   name string false - -
   owner string false - -
   virtual_network_id integer false - -
   virtual_network string false - -
   vns3_topology_id integer false - -
   vns3_topology string false - -
   vns3_address string false - -
   private_ip_address string¦null false - -
   vns3_version string false - -
   licensed boolean¦null false - -
   active boolean false - -
   peered boolean¦null false - -
   description string¦null false - -
   alerts_enabled boolean false - -
   controller_status object false - -
    last_contact_time string(date-time) false - -
    last_successful_contact_time string(date-time) false - -
    last_contact_code integer false - -
    last_contact_result string false - -
    failed_contact_count integer false - -
    alerts_enabled boolean false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Add VNS3 Controller

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/vns3_controllers \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.vns3_management.post_add_vns3_controller(
    name=name,
    vns3_topology_id=vns3_topology_id,
    address=address,
    active=active,
    api_v1_key=api_v1_key,
    description=description)

print(api_response.json())

POST /vns3_controllers

Add VNS3 Controller to a VNS3 topology for management

Body parameter

{
  "name": "string",
  "vns3_topology_id": 0,
  "address": "string",
  "active": true,
  "api_v1_key": "string",
  "description": "string"
}

Parameters

Name In Type Required Description
name body string true VNS3 Controller name
vns3_topology_id body integer true Parent VNS3 Topology ID
address body string true VNS3 Controller IP address
active body boolean false Active state
api_v1_key body string false Controller's APIv1 key
description body string false Controller description

Example responses

201 Response

{
  "response_type": "success",
  "response": {
    "msg": "VNS3 Controller created",
    "id": 17
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
201 Created Created Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 201

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   msg string false - -
   id integer false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get VNS3 Controller

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/vns3_controllers/{vns3_controller_id} \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.vns3_management.get_vns3_controller(vns3_controller_id)

print(api_response.json())

GET /vns3_controllers/{vns3_controller_id}

Return specific VNS3 Controller details

Parameters

Name In Type Required Description
vns3_controller_id path integer true VNS3 Controller ID

Example responses

200 Response

{
  "response": {
    "id": 1,
    "name": "test-vns3-bp",
    "owner": "admin",
    "virtual_network_id": 1,
    "virtual_network": "dev-env-network",
    "vns3_topology_id": 1,
    "vns3_topology": "Test VNS3 Topology",
    "vns3_address": "10.0.1.34",
    "private_ip_address": null,
    "vns3_version": "3.5-default",
    "licensed": true,
    "active": true,
    "peered": null,
    "description": null,
    "alerts_enabled": false,
    "controller_status": {
      "last_contact_time": "2020-05-15T17:47:25.000Z",
      "last_successful_contact_time": "2020-05-15T17:47:25.000Z",
      "last_contact_code": 200,
      "last_contact_result": "OK",
      "failed_contact_count": 0,
      "alerts_enabled": false
    }
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "VNS3 Controller with ID 19 does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response object false - -
   id integer false - -
   name string false - -
   owner string false - -
   virtual_network_id integer false - -
   virtual_network string false - -
   vns3_topology_id integer false - -
   vns3_topology string false - -
   vns3_address string false - -
   private_ip_address string¦null false - -
   vns3_version string false - -
   licensed boolean¦null false - -
   active boolean false - -
   peered boolean¦null false - -
   description string¦null false - -
   alerts_enabled boolean false - -
   controller_status object false - -
    last_contact_time string(date-time) false - -
    last_successful_contact_time string(date-time) false - -
    last_contact_code integer false - -
    last_contact_result string false - -
    failed_contact_count integer false - -
    alerts_enabled boolean false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Update VNS3 Controller

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/vns3_controllers/{vns3_controller_id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.vns3_management.put_update_vns3_controller(vns3_controller_id,
    name=name,
    vns3_topology_id=vns3_topology_id,
    address=address,
    active=active,
    api_v1_key=api_v1_key,
    description=description)

print(api_response.json())

PUT /vns3_controllers/{vns3_controller_id}

Update specified VNS3 Controller

Body parameter

{
  "name": "string",
  "vns3_topology_id": 0,
  "address": "string",
  "active": true,
  "api_v1_key": "string",
  "description": "string"
}

Parameters

Name In Type Required Description
vns3_controller_id path integer true VNS3 Controller ID
name body string false VNS3 Controller name
vns3_topology_id body integer false Parent VNS3 Topology ID
address body string false VNS3 Controller IP address
active body boolean false Active state
api_v1_key body string false Controller's APIv1 key
description body string false Controller description

Example responses

200 Response

{
  "response_type": "success",
  "response": "Updated VNS3 controller"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "VNS3 Controller with ID 19 does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Delete VNS3 Controller

Code samples

# You can also use wget

curl -X DELETE https://vns3ms-host:8000/api/vns3_controllers/{vns3_controller_id} \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.vns3_management.delete_vns3_controller(vns3_controller_id)

print(api_response.json())

DELETE /vns3_controllers/{vns3_controller_id}

Delete VNS3 Controller

Parameters

Name In Type Required Description
vns3_controller_id path integer true VNS3 Controller ID

Example responses

200 Response

{
  "response_type": "success",
  "response": "Deleted VNS3 Controller 12"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "VNS3 Controller with ID 19 does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get Controller Status

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/vns3_controllers/{vns3_controller_id}/status \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.vns3_management.get_vns3_controller_status(vns3_controller_id)

print(api_response.json())

GET /vns3_controllers/{vns3_controller_id}/status

Retrieve the status and live details of the selected controller

Parameters

Name In Type Required Description
vns3_controller_id path integer true VNS3 Controller ID

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "manager_accessible": true,
    "controller_status": {
      "last_contact_time": "2020-05-15T18:00:27.472+00:00",
      "last_successful_contact_time": "2020-05-15T18:00:27.472+00:00",
      "last_contact_code": 200,
      "last_contact_result": "OK",
      "failed_contact_count": 0,
      "alerts_enabled": null
    },
    "status": {
      "system_config": {
        "topology_checksum": "c95ae5b12c54f3f14d232dbb4fa3aa718953ebf5",
        "vns3_version": "4.9.2-20200325",
        "topology_name": "test",
        "ntp_hosts": "0.ubuntu.pool.ntp.org 1.ubuntu.pool.ntp.org 2.ubuntu.pool.ntp.org 3.ubuntu.pool.ntp.org ntp.ubuntu.com time.apple.com",
        "licensed": true,
        "peered": false,
        "private_ip": "10.0.1.34",
        "public_ip": "52.72.51.23"
      },
      "system_status": {
        "mem_info": {
          "mem_total": 2009276,
          "mem_used": 1914080,
          "mem_free": 95196,
          "shmem": 44908,
          "buffers": 134804,
          "cached": 1251788,
          "swap_total": 1048572,
          "swap_used": 0,
          "swap_free": 1048572,
          "swap_cached": 0
        },
        "disk_info": [
          {
            "filesystem": "/dev/nvme0n1p1",
            "type": "",
            "bytes_total": "31571570688",
            "bytes_used": "4348542976",
            "bytes_available": "25612476416",
            "percent_used": "15%",
            "mount_point": "/"
          }
        ],
        "system_info": {
          "uptime": 161568,
          "clean_uptime": {
            "days": 1,
            "hours": 20,
            "minutes": 52,
            "seconds": 48
          },
          "kernel": "4.4.0-154-generic",
          "loadavg": {
            "current": "0.03",
            "last_5min": "0.04",
            "last_15min": "0.00",
            "threads": "1/245",
            "last_pid": "32767"
          }
        },
        "cpu_info": {}
      },
      "connection_status": null,
      "container_status": {
        "running": true,
        "network": "198.51.100.0/28",
        "image_limit": 50,
        "images_stored": 0,
        "container_limit": 4,
        "containers_stored": null,
        "containers_running": 0
      },
      "peering_details": {
        "peered": false
      },
      "cloud_details": {
        "cloud_type": "ec2",
        "cloud_data": {
          "accountId": "947761958079",
          "architecture": "x86_64",
          "availabilityZone": "us-east-1a",
          "billingProducts": null,
          "devpayProductCodes": null,
          "marketplaceProductCodes": null,
          "imageId": "ami-075660543a425327f",
          "instanceId": "i-05aea17762c173034",
          "instanceType": "t3.small",
          "kernelId": null,
          "pendingTime": "2020-05-13T19:52:15Z",
          "privateIp": "10.0.1.34",
          "ramdiskId": null,
          "region": "us-east-1",
          "version": "2017-09-30"
        }
      }
    }
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "VNS3 Controller with ID 19 does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   manager_accessible boolean false - -
   controller_status object false - -
    last_contact_time string(date-time) false - -
    last_successful_contact_time string(date-time) false - -
    last_contact_code integer false - -
    last_contact_result string false - -
    failed_contact_count integer false - -
    alerts_enabled boolean¦null false - -
   status object false - -
    system_config object false - -
     topology_checksum string false - -
     vns3_version string false - -
     topology_name string false - -
     ntp_hosts string false - -
     licensed boolean¦null false - -
     peered boolean false - -
     private_ip string false - -
     public_ip string false - -
    system_status object false - -
     mem_info object false - -
      mem_total number false - -
      mem_used number false - -
      mem_free number false - -
      shmem number false - -
      buffers number false - -
      cached number false - -
      swap_total number false - -
      swap_used number false - -
      swap_free number false - -
      swap_cached number false - -
     disk_info [object] false - -
     system_info object false - -
     cpu_info object false - -
    connection_status string¦null false - -
    container_status object false - -
     running boolean false - -
     network string false - -
     image_limit integer false - -
     images_stored integer false - -
     container_limit integer false - -
     containers_stored integer¦null false - -
     containers_running integer false - -
    peering_details object false - -
     peered boolean false - -
    cloud_details object false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Update Controller API Password

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/vns3_controllers/{vns3_controller_id}/update_api_password \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.vns3_management.put_vns3_controller_api_password(vns3_controller_id,
    api_password=api_password)

print(api_response.json())

PUT /vns3_controllers/{vns3_controller_id}/update_api_password

Update specified VNS3 Controller API password

Body parameter

{
  "api_password": "string"
}

Parameters

Name In Type Required Description
vns3_controller_id path integer true VNS3 Controller ID
api_password body string true New API password

Example responses

200 Response

{
  "response_type": "success",
  "response": "API password updated"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "VNS3 Controller with ID 19 does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Update Controller UI

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/vns3_controllers/{vns3_controller_id}/update_ui \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.vns3_management.put_vns3_controller_ui(vns3_controller_id,
    username=username,
    password=password,
    ui_enabled=ui_enabled)

print(api_response.json())

PUT /vns3_controllers/{vns3_controller_id}/update_ui

Update specified VNS3 Controller UI

Body parameter

{
  "username": "string",
  "password": "string",
  "ui_enabled": true
}

Parameters

Name In Type Required Description
vns3_controller_id path integer true VNS3 Controller ID
username body string false UI username
password body string false VNS3 Controller GUI password
ui_enabled body boolean false Enable/Disable UI

Example responses

200 Response

{
  "response_type": "success",
  "response": "UI details updated"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "VNS3 Controller with ID 19 does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get Controller HA details

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/vns3_controllers/{vns3_controller_id}/ha \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.vns3_management.get_vns3_controller_ha_details(vns3_controller_id)

print(api_response.json())

GET /vns3_controllers/{vns3_controller_id}/ha

Get HA details for specified VNS3 controller

Parameters

Name In Type Required Description
vns3_controller_id path integer true VNS3 Controller ID

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "ha_enabled": true,
    "ha_initialised": false,
    "ha_cloud_validated": true,
    "ms_sync_state": "Available",
    "ms_sync_fail_count": 0,
    "backup_active": false,
    "backup_sync_fail_count": 0,
    "ha_cloud_cred_id": 0,
    "primary_server_available": true,
    "backup_server_available": false,
    "ha_type": "cold",
    "ha_sync_processing": false,
    "ha_instance_id": "",
    "ha_image_id": "ami-abcdefgh"
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "VNS3 Controller with ID 19 does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   ha_enabled boolean false - -
   ha_initialised boolean false - -
   ha_cloud_validated boolean false - -
   ha_uuid string false - -
   ha_backup_ip_address string false - -
   primary_sync_state string false - -
   primary_sync_code string false - -
   ms_sync_state string false - -
   ms_sync_fail_count integer false - -
   backup_active boolean false - -
   backup_sync_state string false - -
   backup_sync_code string false - -
   backup_sync_fail_count integer false - -
   activation_state string false - -
   ha_cloud_cred_id integer false - -
   primary_server_available boolean false - -
   backup_server_available boolean false - -
   ha_type string false - -
   ha_sync_processing boolean false - -
   ha_api_v2_username string false - -
   stop_old_primary boolean false - -
   ha_instance_id string false - -
   ha_image_id string false - -
   primary_sync_updated_at string(date-time) false - -
   ms_sync_updated_at string(date-time) false - -
   backup_sync_updated_at string(date-time) false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Update VNS3 Controller HA

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/vns3_controllers/{vns3_controller_id}/ha \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.vns3_management.put_update_vns3_controller_ha(vns3_controller_id,
    ha_enabled=ha_enabled,
    ha_type=ha_type,
    ha_api_v1_key=ha_api_v1_key,
    ha_cloud_cred_id=ha_cloud_cred_id,
    stop_old_primary=stop_old_primary,
    ha_instance_type=ha_instance_type,
    ha_availability_zone=ha_availability_zone,
    ha_subnet=ha_subnet)

print(api_response.json())

PUT /vns3_controllers/{vns3_controller_id}/ha

Update HA details for specified VNS3 controller

Body parameter

{
    "ha_enabled": "string",
    "ha_type": 1,
    "ha_uuid": "string",
    "ha_backup_ip_address": "string",
    "ha_api_v1_key": "string",
    "ha_instance_id": "string",
    "ha_image_id": "string",
    "ha_cloud_cred_id": 1,
    "stop_old_primary": true,
    "ha_instance_type": "string",
    "ha_availability_zone": "string",
    "ha_subnet": "string"
}

Parameters

Name In Type Required Description
vns3_controller_id path integer true VNS3 Controller ID
ha_enabled body string true Enable/Disable HA
ha_type body integer false HA type, can be hot, warm or cold
ha_uuid body string false HA UUID of the VNS3 failover box for hot HA. Required for hot HA.
ha_backup_ip_address body string false HA Backup server IP address. Required for hot HA.
ha_api_v1_key body string false Controller's APIv1 key
ha_instance_id body string false VNS3 standby instance for warm HA. Required for warm HA.
ha_image_id body string false VNS3 image ID for Cold HA. Required for cold HA.
ha_cloud_cred_id body integer false Cloud Credential ID
stop_old_primary body boolean false Shutdown old primary on activation
ha_instance_type body string false Instance type to use when launching new controller for cold HA
ha_availability_zone body string false AZ to use when launching new controller for cold HA
ha_subnet body string false Subnet to use when launching new controller for cold HA

One of the following param combinations are required:

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "msg": "HA details updated",
    "ha_enabled": true
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "VNS3 Controller with ID 19 does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   msg string false - -
   ha_enabled boolean false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Validate Controller HA details

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/vns3_controllers/{vns3_controller_id}/ha/validate \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.vns3_management.put_validate_vns3_controller_ha(vns3_controller_id)

print(api_response.json())

PUT /vns3_controllers/{vns3_controller_id}/ha/validate

Validate HA details

Parameters

Name In Type Required Description
vns3_controller_id path integer true VNS3 Controller ID

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "msg": "HHA not enabled; details not validated",
    "ha_enabled": false,
    "ha_cloud_validated": true
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "VNS3 Controller with ID 19 does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   msg string false - -
   ha_enabled boolean false - -
   ha_cloud_validated boolean false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Initialise Controller HA

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/vns3_controllers/{vns3_controller_id}/ha/initialise \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.vns3_management.put_init_vns3_controller_ha(vns3_controller_id)

print(api_response.json())

PUT /vns3_controllers/{vns3_controller_id}/ha/initialise

Initialise HA for specified VNS3 controller and its backup device, set up pairing and configuration

Parameters

Name In Type Required Description
vns3_controller_id path integer true VNS3 Controller ID

Example responses

200 Response

{
  "response_type": "success",
  "response": "HA configuration initialised"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "VNS3 Controller with ID 19 does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Trigger HA sync

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/vns3_controllers/{vns3_controller_id}/ha/sync \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.vns3_management.put_sync_vns3_controller_ha(vns3_controller_id,
    sync_type=sync_type)

print(api_response.json())

PUT /vns3_controllers/{vns3_controller_id}/ha/sync

Trigger HA sync (via the queueing mechanism)

Body parameter

{
  "sync_type": "string"
}

Parameters

Name In Type Required Description
vns3_controller_id path integer true VNS3 Controller ID
sync_type body string true Type of sync to perform: full, pull or push

Example responses

200 Response

{
  "response_type": "success",
  "response": "HA sync request queued"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "VNS3 Controller with ID 19 does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get HA status

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/vns3_controllers/{vns3_controller_id}/ha/activate \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.vns3_management.get_vns3_controller_ha_status(vns3_controller_id)

print(api_response.json())

GET /vns3_controllers/{vns3_controller_id}/ha/activate

Get current status of HA switchover activation

Parameters

Name In Type Required Description
vns3_controller_id path integer true VNS3 Controller ID

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "status": "Running",
    "timestamp": "2020-05-06T16:06:56.510Z",
    "log_msgs": [
      {
        "status": "success",
        "status_message": "Activating",
        "timestamp": "2020-05-06T16:06:56.510Z"
      }
    ]
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "VNS3 Controller with ID 19 does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   status string false - -
   message string false - -
   timestamp string(date-time) false - -
   log_msgs [object] false - -
    status string false - -
    status_message string false - -
    timestamp string(date-time) false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Trigger HA

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/vns3_controllers/{vns3_controller_id}/ha/activate \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.vns3_management.put_activate_vns3_controller_ha(vns3_controller_id)

print(api_response.json())

PUT /vns3_controllers/{vns3_controller_id}/ha/activate

Trigger the HA switchover activation

Parameters

Name In Type Required Description
vns3_controller_id path integer true VNS3 Controller ID

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "status": "Running",
    "message": "HA activation request queued",
    "timestamp": "2020-05-06T16:06:56.510Z",
    "log_msgs": [
      {
        "status": "success",
        "status_message": "Activating",
        "timestamp": "2020-05-06T16:06:56.510Z"
      }
    ]
  }
}

400 Response

{
  "response_type": "error",
  "response": {
    "status": "Failed",
    "message": "Unable to activate: Failed to launch instance",
    "timestamp": "2020-05-06T16:06:56.510Z"
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "VNS3 Controller with ID 19 does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request Error Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   status string false - -
   message string false - -
   timestamp string(date-time) false - -
   log_msgs [object] false - -
    status string false - -
    status_message string false - -
    timestamp string(date-time) false - -

Status Code 400

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   status string false - -
   message string false - -
   timestamp string(date-time) false - -
   log_msgs [object] false - -
    status string false - -
    status_message string false - -
    timestamp string(date-time) false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Cloud Monitoring

Configure and monitor your cloud by tracking cloud VPCs and virtual networks

Get VLAN Components

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/cloud_vlan_components \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.get_cloud_vlan_components(
    cloud_vlan_component_id=cloud_vlan_component_id)

print(api_response.json())

GET /cloud_vlan_components

Return list of all (accessible) Cloud VLAN Components

Parameters

Name In Type Required Description
cloud_vlan_component_id query integer false Cloud VLAN Component ID for filtering

Example responses

200 Response

{
  "response": [
    {
      "id": 0,
      "name": "string",
      "cloud_vlan_id": 0,
      "cloud_vlan": "string",
      "cloud_cred_id": 0,
      "cloud_type": "string",
      "region": "string",
      "description": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response [object] false - -
   id integer false - -
   name string false - -
   cloud_vlan_id integer false - -
   cloud_vlan string false - -
   cloud_cred_id integer false - -
   cloud_type string false - -
   region string false - -
   description string¦null false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Create VLAN component

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/cloud_vlan_components \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.post_create_vlan_component(
    name=name,
    cloud_vlan_id=cloud_vlan_id,
    user_cred_id=user_cred_id,
    vlan_component_id=vlan_component_id,
    region=region,
    description=description)

print(api_response.json())

POST /cloud_vlan_components

Create new Cloud VLAN Component

Body parameter

{
  "name": "string",
  "cloud_vlan_id": 0,
  "user_cred_id": 0,
  "vlan_component_id": "string",
  "region": "string",
  "description": "string"
}

Parameters

Name In Type Required Description
name body string true Cloud VLAN Component name
cloud_vlan_id body integer true Parent Cloud VLAN ID
user_cred_id body integer true User credential ID
vlan_component_id body string false Component ID defined by cloud associated with user credential
region body string false Cloud VLAN component region (EC2)
description body string false Component description

Example responses

201 Response

{
  "response_type": "success",
  "response": {
    "msg": "Cloud VLAN Component created",
    "id": 4
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "Cloud VLAN with ID 2 does not exist"
}

Responses

Status Meaning Description Schema
201 Created Created Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 201

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   msg string false - -
   id integer false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get VLAN Component

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/cloud_vlan_components/{component_id} \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.get_cloud_vlan_component(component_id)

print(api_response.json())

GET /cloud_vlan_components/{component_id}

Return specific Cloud VLAN Components details

Parameters

Name In Type Required Description
component_id path integer true VLAN component Id

Example responses

200 Response

{
  "response": {
    "id": 0,
    "name": "string",
    "cloud_vlan_id": 0,
    "cloud_vlan": "string",
    "cloud_cred_id": 0,
    "cloud_type": "string",
    "region": "string",
    "description": "string"
  }
}

404 Response

{
  "response_type": "error",
  "response": "Cloud VLAN Component with ID 4 does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response object false - -
   id integer false - -
   name string false - -
   cloud_vlan_id integer false - -
   cloud_vlan string false - -
   cloud_cred_id integer false - -
   cloud_type string false - -
   region string false - -
   description string¦null false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Update VLAN component

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/cloud_vlan_components/{component_id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.put_update_vlan_component(component_id,
    name=name,
    cloud_vlan_id=cloud_vlan_id,
    user_cred_id=user_cred_id,
    region=region,
    description=description)

print(api_response.json())

PUT /cloud_vlan_components/{component_id}

Update specified Cloud VLAN Component

Body parameter

{
  "name": "string",
  "cloud_vlan_id": 0,
  "user_cred_id": 0,
  "region": "string",
  "description": "string"
}

Parameters

Name In Type Required Description
component_id path integer true VLAN component Id
name body string false Cloud VLAN Component name
cloud_vlan_id body integer false Parent Cloud VLAN ID
user_cred_id body integer false User credential ID
region body string false Cloud VLAN component region (EC2)
description body string false Component description

Example responses

200 Response

{
  "response_type": "success",
  "response": "Updated Cloud VLAN component"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "Cloud VLAN Component with ID 4 does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Delete VLAN component

Code samples

# You can also use wget

curl -X DELETE https://vns3ms-host:8000/api/cloud_vlan_components/{component_id} \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.delete_vlan_component(component_id)

print(api_response.json())

DELETE /cloud_vlan_components/{component_id}

Delete specified cloud VLAN Component

Parameters

Name In Type Required Description
component_id path integer true VLAN component Id

Example responses

200 Response

{
  "response_type": "success",
  "response": "Deleted Cloud VLAN Component 5"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "Cloud VLAN Component with ID 4 does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get VLANs

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/cloud_vlans \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.get_cloud_vlans(
    cloud_vlan_id=cloud_vlan_id)

print(api_response.json())

GET /cloud_vlans

Return list of all (accessible) Cloud VLANs

Parameters

Name In Type Required Description
cloud_vlan_id query integer false Cloud VLAN ID for filtering

Example responses

200 Response

{
  "response": [
    {
      "id": 0,
      "name": "string",
      "virtual_network_name": "string",
      "virtual_network_id": 0,
      "description": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response [object] false - -
   id integer false - -
   name string false - -
   virtual_network_name string false - -
   virtual_network_id integer false - -
   description string¦null false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Create VLAN

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/cloud_vlans \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.post_create_cloud_vlan(
    name=name,
    virtual_network_id=virtual_network_id,
    description=description)

print(api_response.json())

POST /cloud_vlans

Create new Cloud VLAN

Body parameter

{
  "name": "string",
  "virtual_network_id": 0,
  "description": "string"
}

Parameters

Name In Type Required Description
name body string true Cloud VLAN name
virtual_network_id body integer true Parent Virtual Network ID
description body string false Component description

Example responses

201 Response

{
  "response_type": "success",
  "response": {
    "msg": "Cloud VLAN created",
    "id": 2
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "Virtual Network with ID 3 does not exist"
}

Responses

Status Meaning Description Schema
201 Created Created Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 201

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   msg string false - -
   id integer false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get VLAN

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/cloud_vlans/{vlan_id} \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.get_cloud_vlan(vlan_id)

print(api_response.json())

GET /cloud_vlans/{vlan_id}

Return specific Cloud VLAN details

Parameters

Name In Type Required Description
vlan_id path integer true VLAN ID

Example responses

200 Response

{
  "response": {
    "id": 0,
    "name": "string",
    "virtual_network_name": "string",
    "virtual_network_id": 0,
    "description": "string"
  }
}

404 Response

{
  "response_type": "error",
  "response": "Cloud VLAN with ID 4 does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response object false - -
   id integer false - -
   name string false - -
   virtual_network_name string false - -
   virtual_network_id integer false - -
   description string¦null false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Update VLAN

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/cloud_vlans/{vlan_id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.put_update_cloud_vlan(vlan_id,
    name=name,
    virtual_network_id=virtual_network_id,
    description=description)

print(api_response.json())

PUT /cloud_vlans/{vlan_id}

Update specified Cloud VLAN

Body parameter

{
  "name": "string",
  "virtual_network_id": 0,
  "description": "string"
}

Parameters

Name In Type Required Description
vlan_id path integer true VLAN ID
name body string false Cloud VLAN name
virtual_network_id body integer false Parent Virtual Network ID
description body string false Component description

Example responses

200 Response

{
  "response_type": "success",
  "response": "Updated Cloud VLAN"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "Cloud VLAN with ID 2 does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Delete VLAN

Code samples

# You can also use wget

curl -X DELETE https://vns3ms-host:8000/api/cloud_vlans/{vlan_id} \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.delete_cloud_vlan(vlan_id)

print(api_response.json())

DELETE /cloud_vlans/{vlan_id}

Delete specified cloud VLAN

Parameters

Name In Type Required Description
vlan_id path integer true VLAN ID

Example responses

200 Response

{
  "response_type": "success",
  "response": "Deleted Cloud VLAN 5"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "Cloud VLAN with ID 5 does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get Virtual Networks

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/virtual_networks \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.get_virtual_networks(
    virtual_network_id=virtual_network_id)

print(api_response.json())

GET /virtual_networks

Return list of all (accessible) Virtual Networks

Parameters

Name In Type Required Description
virtual_network_id query integer false Virtual network ID for filtering

Example responses

200 Response

{
  "response": [
    {
      "id": 0,
      "name": "string",
      "description": "string",
      "created_at": "2020-06-01T20:46:23Z"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response [object] false - -
   id integer false - -
   name string false - -
   description string¦null false - -
   created_at string(date-time) false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Create virtual network

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/virtual_networks \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.post_create_virtual_network(
    name=name,
    description=description)

print(api_response.json())

POST /virtual_networks

Create a new virtual network

Body parameter

{
  "name": "string",
  "description": "string"
}

Parameters

Name In Type Required Description
name body string true Virtual Network name
description body string false Network description

Example responses

201 Response

{
  "response_type": "success",
  "response": {
    "msg": "Virtual Network created",
    "id": 2
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
201 Created Created Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 201

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   msg string false - -
   id integer false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get Virtual Network

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/virtual_networks/{virtual_network_id} \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.get_virtual_network(virtual_network_id)

print(api_response.json())

GET /virtual_networks/{virtual_network_id}

Return specific Virtual Network details

Parameters

Name In Type Required Description
virtual_network_id path integer true Virtual Network ID

Example responses

200 Response

{
  "response": {
    "id": 0,
    "name": "string",
    "description": "string",
    "created_at": "2020-06-01T20:46:23Z"
  }
}

404 Response

{
  "response_type": "error",
  "response": "Missing Virtual Network with ID 10"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response object false - -
   id integer false - -
   name string false - -
   description string¦null false - -
   created_at string(date-time) false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Update Virtual Network

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/virtual_networks/{virtual_network_id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.put_update_virtual_network(virtual_network_id,
    name=name,
    description=description)

print(api_response.json())

PUT /virtual_networks/{virtual_network_id}

Update specified Virtual Network

Body parameter

{
  "name": "string",
  "description": "string"
}

Parameters

Name In Type Required Description
virtual_network_id path integer true Virtual Network ID
name body string false Virtual Network name
description body string false Network description

Example responses

200 Response

{
  "response_type": "success",
  "response": "Updated Virtual Network"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "Missing Virtual Network with ID 23"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Delete virtual network

Code samples

# You can also use wget

curl -X DELETE https://vns3ms-host:8000/api/virtual_networks/{virtual_network_id} \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.delete_virtual_network(virtual_network_id)

print(api_response.json())

DELETE /virtual_networks/{virtual_network_id}

Delete virtual network

Parameters

Name In Type Required Description
virtual_network_id path integer true Virtual Network ID

Example responses

200 Response

{
  "response_type": "success",
  "response": "Deleted Virtual Network 12"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "Missing Virtual Network with ID 99"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Export virtual networks

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/virtual_networks/export \
  -H 'Accept: application/octet-stream' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.get_export_virtual_networks()

print(api_response.file_download)   # path to downloaded file

GET /virtual_networks/export

Export virtual networks

Example responses

200 Response

"string"

400 Response

{
  "response_type": "error",
  "response": "No virtual networks to export"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK File vns3_network_export.csv string
400 Bad Request Bad request Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 400

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Import virtual networks

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/virtual_networks/import \
  -H 'Content-Type: text/plain' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.post_import_virtual_networks()

print(api_response.json())

POST /virtual_networks/import

Import virtual networks from CSV file

Body parameter

string

Example responses

201 Response

{
  "response_type": "success",
  "response": "Import succeeded"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
201 Created OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 201

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get VNS3 Topologies Networks

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/vns3_topologies \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.get_vns3_topologies(
    vns3_topology_id=vns3_topology_id)

print(api_response.json())

GET /vns3_topologies

Return list of all (accessible) VNS3 Topologies

Parameters

Name In Type Required Description
vns3_topology_id query integer false VNS3 Topology ID for filtering

Example responses

200 Response

{
  "response": [
    {
      "id": 0,
      "name": "string",
      "virtual_network_name": "string",
      "virtual_network_id": 0,
      "description": "string",
      "vns3_controllers": [
        {
          "id": 0,
          "name": "string"
        }
      ]
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response [object] false - -
   id integer false - -
   name string false - -
   virtual_network_name string false - -
   virtual_network_id integer false - -
   description string¦null false - -
   vns3_controllers [object] false - -
    id integer false - -
    name string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Create VNS3 topology

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/vns3_topologies \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.post_create_vns3_topology(
    name=name,
    virtual_network_id=virtual_network_id,
    description=description)

print(api_response.json())

POST /vns3_topologies

Create a new VNS3 topology

Body parameter

{
  "name": "string",
  "virtual_network_id": 0,
  "description": "string"
}

Parameters

Name In Type Required Description
name body string true VNS3 Topology name
virtual_network_id body integer true Parent Virtual Network ID
description body string false Topology description

Example responses

201 Response

{
  "response_type": "success",
  "response": {
    "msg": "VNS3 Topology created",
    "id": 29
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
201 Created Created Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 201

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   msg string false - -
   id integer false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get VNS3 Topology

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/vns3_topologies/{vns3_topology_id} \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.get_vns3_topology(vns3_topology_id)

print(api_response.json())

GET /vns3_topologies/{vns3_topology_id}

Return specific VNS3 Topology details

Parameters

Name In Type Required Description
vns3_topology_id path integer true VNS3 Topology ID

Example responses

200 Response

{
  "response": {
    "id": 0,
    "name": "string",
    "virtual_network_name": "string",
    "virtual_network_id": 0,
    "description": "string",
    "vns3_controllers": [
      {
        "id": 0,
        "name": "string"
      }
    ]
  }
}

404 Response

{
  "response_type": "error",
  "response": "Missing VNS3 Topology with ID 2"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response object false - -
   id integer false - -
   name string false - -
   virtual_network_name string false - -
   virtual_network_id integer false - -
   description string¦null false - -
   vns3_controllers [object] false - -
    id integer false - -
    name string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Update VNS3 Topology

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/vns3_topologies/{vns3_topology_id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.put_update_vns3_topology(vns3_topology_id,
    name=name,
    virtual_network_id=virtual_network_id,
    description=description)

print(api_response.json())

PUT /vns3_topologies/{vns3_topology_id}

Update specified VNS3 Topology

Body parameter

{
  "name": "string",
  "virtual_network_id": 0,
  "description": "string"
}

Parameters

Name In Type Required Description
vns3_topology_id path integer true VNS3 Topology ID
name body string false VNS3 Topology name
virtual_network_id body integer false Parent Virtual Network ID
description body string false Topology description

Example responses

200 Response

{
  "response_type": "success",
  "response": "Updated VNS3 topology"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "Missing VNS3 Topology with ID 2"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Delete VNS3 Topology

Code samples

# You can also use wget

curl -X DELETE https://vns3ms-host:8000/api/vns3_topologies/{vns3_topology_id} \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.delete_vns3_topology(vns3_topology_id)

print(api_response.json())

DELETE /vns3_topologies/{vns3_topology_id}

Delete VNS3 Topology

Parameters

Name In Type Required Description
vns3_topology_id path integer true VNS3 Topology ID

Example responses

200 Response

{
  "response_type": "success",
  "response": "Deleted VNS3 Topology 12"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "Missing VNS3 Topology with ID 2"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get webhooks

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/webhooks \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.get_webhooks()

print(api_response.json())

GET /webhooks

Return list of all configured webhooks

Example responses

200 Response

{
  "response_type": "string",
  "response": [
    {
      "id": 0,
      "name": "string",
      "url": "string",
      "validate_cert": true,
      "created_at": "2020-06-01T20:46:23Z",
      "updated_at": "2020-06-01T20:46:23Z",
      "body": "string",
      "events": [
        "string"
      ],
      "headers": [
        {
          "name": "string",
          "value": "string"
        }
      ],
      "parameters": [
        {
          "name": "string",
          "value": "string"
        }
      ],
      "custom_properties": [
        {
          "name": "string",
          "value": "string"
        }
      ]
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response [object] false - -
   id integer false - -
   name string false - -
   url string¦null false - -
   validate_cert boolean false - -
   created_at string(date-time) false - -
   updated_at string(date-time) false - -
   body string false - -
   events [string] false - -
   headers [object] false - -
    name string false - -
    value string false - -
   parameters [object] false - -
    name string false - -
    value string false - -
   custom_properties [object] false - -
    name string false - -
    value string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Create webhook

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/webhook \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.post_create_webhook(
    name=name,
    url=url,
    events=events,
    body=body,
    validate_cert=validate_cert,
    custom_properties=custom_properties,
      name=  name,
      value=  value,
      description=  description,
    headers=headers,
      name=  name,
      value=  value,
    parameters=parameters,
      name=  name,
      value=  value)

print(api_response.json())

POST /webhook

Create new webhook endpoint

Body parameter

{
  "name": "string",
  "url": "string",
  "events": [
    "string"
  ],
  "body": "string",
  "validate_cert": false,
  "custom_properties": [],
  "headers": [],
  "parameters": []
}

Parameters

Name In Type Required Description
name body string true Alert name
url body string false -
events body [string] false -
body body string false Payload for POST call
validate_cert body boolean false -
custom_properties body [object] false -
  name body string false -
  value body string false -
  description body string false -
headers body [object] false -
  name body string false -
  value body string false -
parameters body [object] false -
  name body string false -
  value body string false -

Example responses

201 Response

{
  "response_type": "string",
  "response": {
    "id": 0,
    "name": "string",
    "url": "string",
    "validate_cert": true,
    "created_at": "2020-06-01T20:46:23Z",
    "updated_at": "2020-06-01T20:46:23Z",
    "body": "string",
    "events": [
      "string"
    ],
    "headers": [
      {
        "name": "string",
        "value": "string"
      }
    ],
    "parameters": [
      {
        "name": "string",
        "value": "string"
      }
    ],
    "custom_properties": [
      {
        "name": "string",
        "value": "string"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
201 Created Created Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 201

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   id integer false - -
   name string false - -
   url string¦null false - -
   validate_cert boolean false - -
   created_at string(date-time) false - -
   updated_at string(date-time) false - -
   body string false - -
   events [string] false - -
   headers [object] false - -
    name string false - -
    value string false - -
   parameters [object] false - -
    name string false - -
    value string false - -
   custom_properties [object] false - -
    name string false - -
    value string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get webhook details

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/webhook/{webhook_id} \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.get_webhook(webhook_id)

print(api_response.json())

GET /webhook/{webhook_id}

Retrieve details for single webhook integration

Parameters

Name In Type Required Description
webhook_id path integer true ID for webhook integration

Example responses

200 Response

{
  "response_type": "string",
  "response": {
    "id": 0,
    "name": "string",
    "url": "string",
    "validate_cert": true,
    "created_at": "2020-06-01T20:46:23Z",
    "updated_at": "2020-06-01T20:46:23Z",
    "body": "string",
    "events": [
      "string"
    ],
    "headers": [
      {
        "name": "string",
        "value": "string"
      }
    ],
    "parameters": [
      {
        "name": "string",
        "value": "string"
      }
    ],
    "custom_properties": [
      {
        "name": "string",
        "value": "string"
      }
    ]
  }
}

404 Response

{
  "response_type": "error",
  "response": "Requested webhook does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   id integer false - -
   name string false - -
   url string¦null false - -
   validate_cert boolean false - -
   created_at string(date-time) false - -
   updated_at string(date-time) false - -
   body string false - -
   events [string] false - -
   headers [object] false - -
    name string false - -
    value string false - -
   parameters [object] false - -
    name string false - -
    value string false - -
   custom_properties [object] false - -
    name string false - -
    value string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Update webhook configuration

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/webhook/{webhook_id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.put_update_webhook(webhook_id,
    name=name,
    url=url,
    events=events,
    body=body,
    validate_cert=validate_cert,
    custom_properties=custom_properties,
      name=  name,
      value=  value,
      description=  description,
    headers=headers,
      name=  name,
      value=  value,
    parameters=parameters,
      name=  name,
      value=  value)

print(api_response.json())

PUT /webhook/{webhook_id}

Edit defined webhook integration

Body parameter

{
  "name": "string",
  "url": "string",
  "events": [
    "string"
  ],
  "body": "string",
  "validate_cert": true,
  "custom_properties": [
    {
      "name": "string",
      "value": "string",
      "description": "string"
    }
  ],
  "headers": [
    {
      "name": "string",
      "value": "string"
    }
  ],
  "parameters": [
    {
      "name": "string",
      "value": "string"
    }
  ]
}

Parameters

Name In Type Required Description
webhook_id path integer true ID for webhook integration
name body string false -
url body string false -
events body [string] false -
body body string false Serialized HTTP Post request body
validate_cert body boolean false -
custom_properties body [object] false -
  name body string true -
  value body string false -
  description body string false -
headers body [object] false -
  name body string true -
  value body string true -
parameters body [object] false -
  name body string true -
  value body string true -

Example responses

200 Response

{
  "response_type": "string",
  "response": {
    "id": 0,
    "name": "string",
    "url": "string",
    "validate_cert": true,
    "created_at": "2020-06-01T20:46:23Z",
    "updated_at": "2020-06-01T20:46:23Z",
    "body": "string",
    "events": [
      "string"
    ],
    "headers": [
      {
        "name": "string",
        "value": "string"
      }
    ],
    "parameters": [
      {
        "name": "string",
        "value": "string"
      }
    ],
    "custom_properties": [
      {
        "name": "string",
        "value": "string"
      }
    ]
  }
}

404 Response

{
  "response_type": "error",
  "response": "Requested webhook does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request Bad request Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   id integer false - -
   name string false - -
   url string¦null false - -
   validate_cert boolean false - -
   created_at string(date-time) false - -
   updated_at string(date-time) false - -
   body string false - -
   events [string] false - -
   headers [object] false - -
    name string false - -
    value string false - -
   parameters [object] false - -
    name string false - -
    value string false - -
   custom_properties [object] false - -
    name string false - -
    value string false - -

Status Code 400

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Delete webhook

Code samples

# You can also use wget

curl -X DELETE https://vns3ms-host:8000/api/webhook/{webhook_id} \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.delete_webhook(webhook_id)

print(api_response.json())

DELETE /webhook/{webhook_id}

Delete defined webhook integration.

Parameters

Name In Type Required Description
webhook_id path integer true ID for webhook integration

Example responses

200 Response

{
  "response_type": "string",
  "response": {
    "id": 0,
    "name": "string",
    "url": "string",
    "validate_cert": true,
    "created_at": "2020-06-01T20:46:23Z",
    "updated_at": "2020-06-01T20:46:23Z",
    "body": "string",
    "events": [
      "string"
    ],
    "headers": [
      {
        "name": "string",
        "value": "string"
      }
    ],
    "parameters": [
      {
        "name": "string",
        "value": "string"
      }
    ],
    "custom_properties": [
      {
        "name": "string",
        "value": "string"
      }
    ]
  }
}

404 Response

{
  "response_type": "error",
  "response": "Requested webhook does not exist"
}

Responses

Status Meaning Description Schema
200 OK Accepted Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   id integer false - -
   name string false - -
   url string¦null false - -
   validate_cert boolean false - -
   created_at string(date-time) false - -
   updated_at string(date-time) false - -
   body string false - -
   events [string] false - -
   headers [object] false - -
    name string false - -
    value string false - -
   parameters [object] false - -
    name string false - -
    value string false - -
   custom_properties [object] false - -
    name string false - -
    value string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get alerts

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/alerts \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.get_alerts()

print(api_response.json())

GET /alerts

Get list of all topology alerts

Example responses

200 Response

{
  "response_type": "string",
  "response": [
    {
      "id": 0,
      "name": "string",
      "created_at": "2020-06-01T20:46:23Z",
      "updated_at": "2020-06-01T20:46:23Z",
      "url": "string",
      "enabled": true,
      "events": [
        "string"
      ],
      "custom_properties": [
        {
          "name": "string",
          "value": "string"
        }
      ],
      "webhook_id": 0,
      "template_id": 0
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response [object] false - -
   id integer false - -
   name string false - -
   created_at string(date-time) false - -
   updated_at string(date-time) false - -
   url string false - -
   enabled boolean false - -
   events [string] false - -
   custom_properties [object] false - -
    name string false - -
    value string false - -
   webhook_id integer false - -
   template_id integer false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Create alert

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/alert \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.post_create_alert(
    name=name,
    url=url,
    enabled=enabled,
    events=events,
    custom_properties=custom_properties,
      name=  name,
      value=  value,
    webhook_id=webhook_id)

print(api_response.json())

POST /alert

Create new network alert

Body parameter

{
    "name": "string",
    "url": "string",
    "enabled": true,
    "events": ,
    "custom_properties": ,
    "webhook_id": 1,
    "template_id": 1
}

Parameters

Name In Type Required Description
name body string false Alert name
url body string false -
enabled body boolean false -
events body [string] false -
custom_properties body [object] false -
  name body string false -
  value body string false -
webhook_id body integer false -
template_id body integer false -

One of the following param combinations are required:

Example responses

201 Response

{
  "response_type": "string",
  "response": {
    "id": 0,
    "name": "string",
    "created_at": "2020-06-01T20:46:23Z",
    "updated_at": "2020-06-01T20:46:23Z",
    "url": "string",
    "enabled": true,
    "events": [
      "string"
    ],
    "custom_properties": [
      {
        "name": "string",
        "value": "string"
      }
    ],
    "webhook_id": 0,
    "template_id": 0
  }
}

404 Response

{
  "response_type": "error",
  "response": "webhook_id does not have a valid value"
}

Responses

Status Meaning Description Schema
201 Created Created Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 201

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   id integer false - -
   name string false - -
   created_at string(date-time) false - -
   updated_at string(date-time) false - -
   url string false - -
   enabled boolean false - -
   events [string] false - -
   custom_properties [object] false - -
    name string false - -
    value string false - -
   webhook_id integer false - -
   template_id integer false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get alert details

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/alert/{alert_id} \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.get_alert_details(alert_id)

print(api_response.json())

GET /alert/{alert_id}

Retrieve details for single alert definition

Parameters

Name In Type Required Description
alert_id path integer true ID for Alert definition

Example responses

200 Response

{
  "response_type": "string",
  "response": {
    "id": 0,
    "name": "string",
    "created_at": "2020-06-01T20:46:23Z",
    "updated_at": "2020-06-01T20:46:23Z",
    "url": "string",
    "enabled": true,
    "events": [
      "string"
    ],
    "custom_properties": [
      {
        "name": "string",
        "value": "string"
      }
    ],
    "webhook_id": 0,
    "template_id": 0
  }
}

404 Response

{
  "response_type": "error",
  "response": "Requested alert does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   id integer false - -
   name string false - -
   created_at string(date-time) false - -
   updated_at string(date-time) false - -
   url string false - -
   enabled boolean false - -
   events [string] false - -
   custom_properties [object] false - -
    name string false - -
    value string false - -
   webhook_id integer false - -
   template_id integer false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Edit alert definition

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/alert/{alert_id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.put_update_alert(alert_id,
    name=name,
    url=url,
    webhook_id=webhook_id,
    events=events,
    custom_properties=custom_properties,
      name=  name,
      value=  value,
    enabled=enabled)

print(api_response.json())

PUT /alert/{alert_id}

Edit defined alert

Body parameter

{
  "name": "string",
  "url": "string",
  "webhook_id": 0,
  "events": [
    "string"
  ],
  "custom_properties": [
    {
      "name": "string",
      "value": "string"
    }
  ],
  "enabled": true
}

Parameters

Name In Type Required Description
alert_id path integer true ID for Alert definition
name body string false -
url body string false -
webhook_id body integer false -
events body [string] false -
custom_properties body [object] false -
  name body string true -
  value body string true -
enabled body boolean false -

Example responses

200 Response

{
  "response_type": "string",
  "response": {
    "id": 0,
    "name": "string",
    "created_at": "2020-06-01T20:46:23Z",
    "updated_at": "2020-06-01T20:46:23Z",
    "url": "string",
    "enabled": true,
    "events": [
      "string"
    ],
    "custom_properties": [
      {
        "name": "string",
        "value": "string"
      }
    ],
    "webhook_id": 0,
    "template_id": 0
  }
}

404 Response

{
  "response_type": "error",
  "response": "Requested alert does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request Bad request Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   id integer false - -
   name string false - -
   created_at string(date-time) false - -
   updated_at string(date-time) false - -
   url string false - -
   enabled boolean false - -
   events [string] false - -
   custom_properties [object] false - -
    name string false - -
    value string false - -
   webhook_id integer false - -
   template_id integer false - -

Status Code 400

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Delete alert

Code samples

# You can also use wget

curl -X DELETE https://vns3ms-host:8000/api/alert/{alert_id} \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.delete_alert(alert_id)

print(api_response.json())

DELETE /alert/{alert_id}

Delete defined alert

Parameters

Name In Type Required Description
alert_id path integer true ID for Alert definition

Example responses

200 Response

{
  "response_type": "string",
  "response": {
    "id": 0,
    "name": "string",
    "created_at": "2020-06-01T20:46:23Z",
    "updated_at": "2020-06-01T20:46:23Z",
    "url": "string",
    "enabled": true,
    "events": [
      "string"
    ],
    "custom_properties": [
      {
        "name": "string",
        "value": "string"
      }
    ],
    "webhook_id": 0,
    "template_id": 0
  }
}

404 Response

{
  "response_type": "error",
  "response": "Requested alert does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   id integer false - -
   name string false - -
   created_at string(date-time) false - -
   updated_at string(date-time) false - -
   url string false - -
   enabled boolean false - -
   events [string] false - -
   custom_properties [object] false - -
    name string false - -
    value string false - -
   webhook_id integer false - -
   template_id integer false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Send test alert

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/alert/{alert_id}/test \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.post_test_alert(alert_id)

print(api_response.json())

POST /alert/{alert_id}/test

Send test alert for this defined alert to configured webhook endpoint

Parameters

Name In Type Required Description
alert_id path integer true ID for Alert definition

Example responses

200 Response

{
  "response_type": "success",
  "response": "Alert sent successfully."
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "Requested alert does not exist"
}

Responses

Status Meaning Description Schema
200 OK Accepted Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Enable alert

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/alert/{alert_id}/toggle_enabled \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.cloud_monitoring.post_toggle_enable_alert(alert_id)

print(api_response.json())

POST /alert/{alert_id}/toggle_enabled

Enable this alert. Associated events will trigger alerts sent to configured webhook.

Parameters

Name In Type Required Description
alert_id path integer true ID for Alert definition

Example responses

200 Response

{
  "response_type": "string",
  "response": {
    "id": 0,
    "name": "string",
    "created_at": "2020-06-01T20:46:23Z",
    "updated_at": "2020-06-01T20:46:23Z",
    "url": "string",
    "enabled": true,
    "events": [
      "string"
    ],
    "custom_properties": [
      {
        "name": "string",
        "value": "string"
      }
    ],
    "webhook_id": 0,
    "template_id": 0
  }
}

404 Response

{
  "response_type": "error",
  "response": "Requested alert does not exist"
}

Responses

Status Meaning Description Schema
200 OK Accepted Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   id integer false - -
   name string false - -
   created_at string(date-time) false - -
   updated_at string(date-time) false - -
   url string false - -
   enabled boolean false - -
   events [string] false - -
   custom_properties [object] false - -
    name string false - -
    value string false - -
   webhook_id integer false - -
   template_id integer false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Backups

Configure backups for VNS3:ms and your controller snapshots

Get backups

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/backups \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.backups.get_backups()

print(api_response.json())

GET /backups

Return a list of available database backup files

Example responses

200 Response

{
  "response_type": "string",
  "response": {
    "backup_files": [
      {
        "backup_name": "string",
        "create_time": "2020-06-01T20:46:23Z",
        "size": 0
      }
    ],
    "failed_backups": [
      {
        "backup_name": "string",
        "create_time": "2020-06-01T20:46:23Z",
        "size": 0
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   backup_files [#/paths/~1backups/get/responses/200/content/application~1json/schema/properties/response/properties/backup_files/items] false - -
    backup_name string false - -
    create_time string(date-time) false - -
    size integer false - -
   failed_backups [#/paths/~1backups/get/responses/200/content/application~1json/schema/properties/response/properties/backup_files/items] false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Delete Backup

Code samples

# You can also use wget

curl -X DELETE https://vns3ms-host:8000/api/backups \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.backups.delete_backup(
    backup_name=backup_name)

print(api_response.json())

DELETE /backups

Delete a backup file

Body parameter

{
  "backup_name": "string"
}

Parameters

Name In Type Required Description
backup_name body string true Backup filename

Example responses

200 Response

{
  "response_type": "success",
  "response": "Backup file 'backup.file' deleted"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "Missing backup file backup.file"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Download backup

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/backups/download \
  -H 'Accept: application/octet-stream' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.backups.get_download_backup(
    backup_name=backup_name)

print(api_response.file_download)   # path to downloaded file

GET /backups/download

Download a named backup file

Parameters

Name In Type Required Description
backup_name query string false Backup filename. Defaults to latest.

Example responses

200 Response

"string"

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK File string
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Upload Backup

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/backups/upload \
  -H 'Content-Type: text/plain' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.backups.post_upload_backup()

print(api_response.json())

POST /backups/upload

Upload a backup file

Body parameter

string

Example responses

201 Response

{
  "response_type": "success",
  "response": "Backup file 'backup.file' uploaded"
}

400 Response

{
  "response_type": "error",
  "response": "File exists"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
201 Created Created Inline
400 Bad Request Bad request Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 201

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 400

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Create Backup

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/backups/create_backup \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.backups.post_create_backup()

print(api_response.json())

POST /backups/create_backup

Schedule a backup creation job

Example responses

202 Response

{
  "response_type": "success",
  "response": {
    "status": "Backup process queued",
    "uuid": "abcasoidjf0q92039fnq039rfv0q93mv038"
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
202 Accepted Accepted Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 202

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   uuid string false - -
   status string false - -
   filename string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get Backup status

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/backups/create_backup/{uuid} \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.backups.get_backup_job(uuid)

print(api_response.json())

GET /backups/create_backup/{uuid}

Retrieve backup job status (DEPRECATED)

Parameters

Name In Type Required Description
uuid path string true Job UUID

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "status": "finished",
    "uuid": "abcasoidjf0q92039fnq039r",
    "filename": "backup.gz"
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "Unknown job UUID: abcasoidjf0q92039fnq039r"
}

Responses

Status Meaning Description Schema
200 OK Accepted Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   uuid string false - -
   status string false - -
   filename string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Restore Backup

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/backups/restore_backup \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.backups.post_restore_backup(
    backup_name=backup_name)

print(api_response.json())

POST /backups/restore_backup

Restore a backup file, resetting the state of VNS3:ms

Body parameter

{
  "backup_name": "string"
}

Parameters

Name In Type Required Description
backup_name body string true Backup filename

Example responses

201 Response

{
  "response_type": "success",
  "response": "Backup restored"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "Missing backup file backup.file"
}

Responses

Status Meaning Description Schema
201 Created Accepted Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 201

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get snapshots backup

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/snapshots_backup \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.backups.get_snapshots_backup()

print(api_response.json())

GET /snapshots_backup

Return details of snapshots backup

Example responses

200 Response

{
  "response_type": "string",
  "response": {
    "snapshot_backup_file": {
      "backup_name": "string",
      "create_time": "2020-06-01T20:46:23Z",
      "size": 0
    }
  }
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   snapshot_backup_file object false - -
    backup_name string false - -
    create_time string(date-time) false - -
    size integer false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Delete Snapshot Backup

Code samples

# You can also use wget

curl -X DELETE https://vns3ms-host:8000/api/snapshots_backup \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.backups.delete_snapshots_backup()

print(api_response.json())

DELETE /snapshots_backup

Delete the snapshot backup file

Example responses

200 Response

{
  "response_type": "success",
  "response": "Backup file 'backup.snapshots' deleted"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "No backup file"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Download snapshots backup

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/snapshots_backup/download \
  -H 'Accept: application/octet-stream' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.backups.get_download_snapshots_backup()

print(api_response.file_download)   # path to downloaded file

GET /snapshots_backup/download

Download the snapshots backup file

Example responses

200 Response

"string"

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "No backup file"
}

Responses

Status Meaning Description Schema
200 OK File string
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Upload Snapshot Backup

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/snapshots_backup/upload_backup \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.backups.post_upload_snapshots_backup(
    url=url)

print(api_response.json())

POST /snapshots_backup/upload_backup

Schedule a "pull" to retrieve a snapshots backup file from a specified URI

Body parameter

{
  "url": "string"
}

Parameters

Name In Type Required Description
url body string true URL to download snapshot backup from

Example responses

202 Response

{
  "response_type": "success",
  "response": {
    "status": "Snapshots file retrieval queued",
    "uuid": "abcasoidjf0q92039fnq039rfv0q93mv038"
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
202 Accepted Accepted Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 202

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   uuid string false - -
   status string false - -
   filename string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get Snapshot Upload status

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/snapshots_backup/upload_backup/{uuid} \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.backups.get_snapshots_upload_status(uuid)

print(api_response.json())

GET /snapshots_backup/upload_backup/{uuid}

Retrieve snapshots backup retrieval job status (DEPRECATED)

Parameters

Name In Type Required Description
uuid path string true Job UUID

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "status": "in progress",
    "uuid": "abcasoidjf0q92039fnq039r",
    "filename": "backup.gz"
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "Unknown job UUID: abcasoidjf0q92039fnq039r"
}

Responses

Status Meaning Description Schema
200 OK Accepted Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   uuid string false - -
   status string false - -
   filename string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Create Snapshot Backup

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/snapshots_backup/create_backup \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.backups.post_create_snapshots_backup()

print(api_response.json())

POST /snapshots_backup/create_backup

Schedule a snapshot backup creation

Example responses

202 Response

{
  "response_type": "success",
  "response": {
    "status": "Backup process queued",
    "uuid": "abcasoidjf0q92039fnq039rfv0q93mv038"
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
202 Accepted Accepted Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 202

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   uuid string false - -
   status string false - -
   filename string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get Snapshot backup status

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/snapshots_backup/create_backup/{uuid} \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.backups.get_snapshots_backup_status(uuid)

print(api_response.json())

GET /snapshots_backup/create_backup/{uuid}

Retrieve snapshot backup job status (DEPRECATED)

Parameters

Name In Type Required Description
uuid path string true Job UUID

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "status": "in progress",
    "uuid": "abcasoidjf0q92039fnq039r",
    "filename": "backup.snapshots"
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "Unknown job UUID: abcasoidjf0q92039fnq039r"
}

Responses

Status Meaning Description Schema
200 OK Accepted Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   uuid string false - -
   status string false - -
   filename string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Restore Snapshots Backup

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/snapshots_backup/restore_backup \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.backups.post_restore_snapshots_backup(
    backup_name=backup_name)

print(api_response.json())

POST /snapshots_backup/restore_backup

Restore a snapshots backup file

Body parameter

{
  "backup_name": "string"
}

Parameters

Name In Type Required Description
backup_name body string true Backup filename

Example responses

201 Response

{
  "response_type": "success",
  "response": "Backup restored"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "Missing backup file backup.snapshots"
}

Responses

Status Meaning Description Schema
201 Created Accepted Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 201

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

System

System configuration such as SSL, NTP hosts and remote support

Get Remote Support

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/system/remote_support \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.system.get_remote_support_details()

print(api_response.json())

GET /system/remote_support

Is remote support enabled/disabled?

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "remote_support_enabled": false
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   remote_support_enabled boolean false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Enable remote support

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/system/remote_support \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.system.put_remote_support(
    enable=enable)

print(api_response.json())

PUT /system/remote_support

Enable/Disable remote support

Body parameter

{
  "enable": true
}

Parameters

Name In Type Required Description
enable body boolean true Enable/Disable remote support

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "remote_support_enabled": false
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   remote_support_enabled boolean false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get Remote Support Keypair

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/system/remote_support/keypair \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.system.get_remote_support_keypair_details()

print(api_response.json())

GET /system/remote_support/keypair

Check if remote support keypair is installed

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "keypair_installed": true
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   keypair_installed boolean false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Regenerate support keypair

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/system/remote_support/keypair \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.system.post_generate_remote_support_keypair(
    encrypted_passphrase=encrypted_passphrase)

print(api_response.json())

POST /system/remote_support/keypair

Regenerate support keypair

Body parameter

{
  "encrypted_passphrase": "string"
}

Parameters

Name In Type Required Description
encrypted_passphrase body string true Encrypted passphrase provided by Cohesive Networks used to generate keypair

Example responses

201 Response

{
  "response_type": "success",
  "response": {
    "keypair_installed": true,
    "private_key": "-----BEGIN RSA PRIVATE KEY-----..."
  }
}

400 Response

{
  "response_type": "error",
  "response": "Invalid passphrase"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
201 Created Created Inline
400 Bad Request Bad request Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 201

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   keypair_installed boolean false - -
   private_key string false - -

Status Code 400

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Delete support keypair

Code samples

# You can also use wget

curl -X DELETE https://vns3ms-host:8000/api/system/remote_support/keypair \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.system.delete_remote_support_keypair()

print(api_response.json())

DELETE /system/remote_support/keypair

Delete support keypair, revoking access

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "keypair_installed": false
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK Created Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   keypair_installed boolean false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get system status

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/system/status \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.system.get_system_status()

print(api_response.json())

GET /system/status

Get system status

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "system_disk": {
      "type": null,
      "block_size": 4096,
      "free_blocks": 6026619,
      "available_blocks": 5633418,
      "total_blocks": 7707903
    },
    "data_disk": {
      "type": "ext4",
      "block_size": 4096,
      "free_blocks": 6026619,
      "available_blocks": 5633418,
      "total_blocks": 7707903
    },
    "cpus": [
      {
        "num": 0,
        "user": 39504,
        "system": 23405,
        "nice": 1104,
        "idle": 16188202
      },
      {
        "num": 1,
        "user": 43161,
        "system": 25687,
        "nice": 1091,
        "idle": 16172235
      }
    ],
    "load_average": {
      "one_minute": 0,
      "five_minutes": 0,
      "fifteen_minutes": 0
    },
    "memory": {
      "pagesize": 4096,
      "wired": 72275,
      "active": 299461,
      "inactive": 108891,
      "free": 21716,
      "pageins": 1443217,
      "pageouts": 6557828
    },
    "boot_time": "2020-05-13T19:52:48.004Z",
    "system_time": "2020-05-15T17:18:38.464Z",
    "uptime": 163550.459937419,
    "virtual_networks": 1,
    "vns3_topologies": 1,
    "vns3_controllers": 1,
    "cloud_vlans": 1,
    "cloud_vlan_components": 1,
    "ha_snapshot_file_count": 0,
    "configuration_snapshot_file_count": 0,
    "configuration_snapshot_failed_count": 0,
    "system_backup_file_count": 0,
    "system_snapshots_backup_file_count": 0
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   system_disk object false - -
   data_disk object false - -
   cpus [object] false - -
   load_average object false - -
   memory object false - -
   boot_time string(date-time) false - -
   system_time string(date-time) false - -
   uptime number false - -
   virtual_networks integer false - -
   vns3_topologies integer false - -
   vns3_controllers integer false - -
   cloud_vlans integer false - -
   cloud_vlan_components integer false - -
   ha_snapshot_file_count integer false - -
   configuration_snapshot_file_count integer false - -
   configuration_snapshot_failed_count integer false - -
   system_backup_file_count integer false - -
   system_snapshots_backup_file_count integer false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get credential types

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/system/credential_types \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.system.get_credential_types()

print(api_response.json())

GET /system/credential_types

Get system credential types

Example responses

200 Response

{
  "response_type": "string",
  "response": [
    {
      "name": "string",
      "code": "string",
      "description": "string",
      "fields": [
        {
          "name": "string",
          "required": true,
          "type": "string",
          "description": "string"
        }
      ]
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response [object] false - -
   name string false - -
   code string false - -
   description string false - -
   fields [object] false - -
    name string false - -
    required boolean false - -
    type string false - -
    description string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get credential type

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/system/credential_types/{code} \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.system.get_credential_type_details(code)

print(api_response.json())

GET /system/credential_types/{code}

Get credential type details

Parameters

Name In Type Required Description
code path string true Credential type code

Example responses

200 Response

{
  "name": "string",
  "code": "string",
  "fields": [
    {
      "name": "string",
      "required": true,
      "type": "string",
      "description": "string"
    }
  ]
}

404 Response

{
  "response_type": "error",
  "response": "Invalid credential type code xyz"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  name string false - -
  code string false - -
  fields [object] false - -
   name string false - -
   required boolean false - -
   type string false - -
   description string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get NTP hosts

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/system/ntp_hosts \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.system.get_system_ntp_hosts()

print(api_response.json())

GET /system/ntp_hosts

Get list of NTP hosts

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "0": "0.ubuntu.pool.ntp.org",
    "1": "1.ubuntu.pool.ntp.org",
    "2": "2.ubuntu.pool.ntp.org",
    "3": "3.ubuntu.pool.ntp.org",
    "4": "ntp.ubuntu.com"
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - Object of NTP hosts keyed by index in list
   additionalProperties string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Add new NTP host

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/system/ntp_hosts \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.system.post_add_ntp_host(
    host=host)

print(api_response.json())

POST /system/ntp_hosts

Add host to NTP list

Body parameter

{
  "host": "string"
}

Parameters

Name In Type Required Description
host body string true New NTP hostname

Example responses

201 Response

{
  "response_type": "success",
  "response": {
    "5": "ntp.ubuntu.com"
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
201 Created OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 201

Name Type Required Constraints Description
  response_type string false - -
  response object false - Object of NTP hosts keyed by index in list
   additionalProperties string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Delete NTP Host

Code samples

# You can also use wget

curl -X DELETE https://vns3ms-host:8000/api/system/ntp_hosts/{host_id} \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.system.delete_ntp_host(host_id)

print(api_response.json())

DELETE /system/ntp_hosts/{host_id}

Delete NTP host

Parameters

Name In Type Required Description
host_id path integer true NTP host index in list

Example responses

200 Response

{
  "response_type": "success",
  "response": "Deleted NTP host ntp.host.com"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "Missing NTP host with ID 6"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Revoke SSL

Code samples

# You can also use wget

curl -X DELETE https://vns3ms-host:8000/api/system/ssl \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.system.delete_ssl_install()

print(api_response.json())

DELETE /system/ssl

Revoke and reset SSL cert and key pair

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "status": "SSL Cert revocation queued",
    "uuid": "61246db30c51c3fe46779bcfc01eb6b3d2de"
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   uuid string false - -
   status string false - -
   filename string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Upload SSL certs

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/system/ssl/keypair \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.system.put_upload_ssl_certs(
    cert=cert,
    key=key)

print(api_response.json())

PUT /system/ssl/keypair

Upload new SSL key/cert pair

Body parameter

{
  "cert": "string",
  "key": "string"
}

Parameters

Name In Type Required Description
cert body string true New SSL cert
key body string true New SSL key

Example responses

200 Response

{
  "response_type": "success",
  "response": "Valid key/cert files uploaded"
}

400 Response

{
  "response_type": "error",
  "response": "Invalid data"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request Bad request Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 400

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Install SSL certs

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/system/ssl/install \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.system.put_install_ssl_certs()

print(api_response.json())

PUT /system/ssl/install

Install new SSL key/cert pair

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "status": "SSL Cert installation queued",
    "uuid": "61246db30c51c3fe46779bcfc01eb6b3d2de"
  }
}

400 Response

{
  "response_type": "error",
  "response": "Missing key/cert files"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request Bad request Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   uuid string false - -
   status string false - -
   filename string false - -

Status Code 400

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get SSL install status

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/system/ssl/install/{uuid} \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.system.get_ssl_install_status(uuid)

print(api_response.json())

GET /system/ssl/install/{uuid}

Get new key/cert pair installation status (DEPRECATED)

Parameters

Name In Type Required Description
uuid path string true Job UUID

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "status": "finished",
    "uuid": "abcasoidjf0q92039fnq039r"
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "Unknown job UUID: abcasoidjf0q92039fnq039r"
}

Responses

Status Meaning Description Schema
200 OK Accepted Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   uuid string false - -
   status string false - -
   filename string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get job status

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/system/jobs/{uuid} \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.system.get_job_status(uuid)

print(api_response.json())

GET /system/jobs/{uuid}

Get system job status

Parameters

Name In Type Required Description
uuid path string true Job UUID

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "status": "finished",
    "uuid": "abd37534c7d9a2efb9465de931"
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "Unknown job UUID: abd37534c7d9a2efb9465de931"
}

Responses

Status Meaning Description Schema
200 OK Accepted Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   uuid string false - -
   status string false - -
   filename string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Users

User management endpoints for configuring credentials

Update user password

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/user/password \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.users.put_user_password(
    password=password,
    force_refresh=force_refresh)

print(api_response.json())

PUT /user/password

Update current user password

Body parameter

{
  "password": "string",
  "force_refresh": true
}

Parameters

Name In Type Required Description
password body string true New user password
force_refresh body boolean false Force session refresh

Example responses

200 Response

{
  "response_type": "success",
  "response": "Password updated"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
200 OK Accepted Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Get user credentials

Code samples

# You can also use wget

curl -X GET https://vns3ms-host:8000/api/user/credentials \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.users.get_user_credentials(
    cred_id=cred_id,
    fields=fields)

print(api_response.json())

GET /user/credentials

Get user credentials

Parameters

Name In Type Required Description
cred_id query string false Credential ID to filter by
fields query boolean false Return credential field values

Example responses

200 Response

{
  "response_type": "string",
  "response": [
    {
      "id": 0,
      "name": "string",
      "code": "string",
      "verified": true,
      "verification_message": "string",
      "fields": [
        {
          "key": "string",
          "value": "string"
        }
      ]
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response [object] false - -
   id integer false - -
   name string false - -
   code string false - -
   verified boolean false - -
   verification_message string false - -
   fields [object] false - -
    key string false - -
    value string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Create user credential

Code samples

# You can also use wget

curl -X POST https://vns3ms-host:8000/api/user/credentials \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.users.post_create_user_credential(
    name=name,
    code=code,
    fields=fields,
      key=  key,
      value=  value)

print(api_response.json())

POST /user/credentials

Create user credential

Body parameter

{
  "name": "string",
  "code": "string",
  "fields": [
    {
      "key": "string",
      "value": "string"
    }
  ]
}

Parameters

Name In Type Required Description
name body string true Credential name
code body string true Credential type code
fields body [object] true -
  key body string false -
  value body string false -

Example responses

201 Response

{
  "response_type": "success",
  "response": {
    "message": "User credentials saved. Validating.",
    "id": 10
  }
}

400 Response

{
  "response_type": "error",
  "response": "Missing required field code"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

Responses

Status Meaning Description Schema
201 Created OK Inline
400 Bad Request Bad request Inline
401 Unauthorized Authentication information missing or invalid Inline

Response Schema

Status Code 201

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   message string false - -
   id integer false - -

Status Code 400

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Update user credential

Code samples

# You can also use wget

curl -X PUT https://vns3ms-host:8000/api/user/credentials/{credential_id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.users.put_update_user_credential(credential_id,
    name=name,
    code=code,
    fields=fields,
      key=  key,
      value=  value)

print(api_response.json())

PUT /user/credentials/{credential_id}

Update user credential

Body parameter

{
  "name": "string",
  "code": "string",
  "fields": [
    {
      "key": "string",
      "value": "string"
    }
  ]
}

Parameters

Name In Type Required Description
credential_id path integer true Credential Id
name body string false Credential name
code body string false Credential type code
fields body [object] false -
  key body string false -
  value body string false -

Example responses

200 Response

{
  "response_type": "success",
  "response": {
    "message": "User credentials saved. Validating.",
    "id": 10
  }
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "User Credential ID 10 does not exist"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

Name Type Required Constraints Description
  response_type string false - -
  response object false - -
   message string false - -
   id integer false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Delete user credential

Code samples

# You can also use wget

curl -X DELETE https://vns3ms-host:8000/api/user/credentials/{credential_id} \
  -H 'Accept: application/json' \
  -H 'api-token: API-TOKEN'

from cohesivenet import VNS3Client

api_response = vns3_client.users.delete_user_credential(credential_id)

print(api_response.json())

DELETE /user/credentials/{credential_id}

Delete user credential

Parameters

Name In Type Required Description
credential_id path integer true Credential Id

Example responses

200 Response

{
  "response_type": "success",
  "response": "Credentials deleted"
}

401 Response

{
  "response_type": "error",
  "response": "401 Unauthorised. Invalid or expired token"
}

404 Response

{
  "response_type": "error",
  "response": "Missing or undefined credentials."
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Authentication information missing or invalid Inline
404 Not Found Not found Inline

Response Schema

Status Code 200

SimpleStringResponse

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 401

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Status Code 404

Error

Name Type Required Constraints Description
  response_type string false - -
  response string false - -

Errors

Cohesive Networks APIs use the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API token or basic credentials are invalid.
403 Forbidden -- API endpoint requires elevated permissions for access. OR pre-condition that elevates permissions has not been met such as VNS3 not being licensed yet.
404 Not Found -- Endpoint or resource does not exist
405 Method Not Allowed -- HTTP Method is not supported for endpoint
406 Not Acceptable -- You requested a format unsupported by this endpoint
500 Internal Server Error -- We had a problem with our server. Try again later. Contact us @ support@cohesive.net.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.