Skip to content

Instantly share code, notes, and snippets.

@slankdev
Last active November 12, 2017 05:10
Show Gist options
  • Save slankdev/0bb4b00c9e4d251255a549ce6acc2242 to your computer and use it in GitHub Desktop.
Save slankdev/0bb4b00c9e4d251255a549ce6acc2242 to your computer and use it in GitHub Desktop.
---
swagger: "2.0"
info:
version: "0.0.0"
title: "Susanow Control API"
license:
name: "MIT License"
url: "https://opensource.org/licenses/MIT"
host: "virtserver.swaggerhub.com"
basePath: "/susanow/ssnctl/0.0.0"
schemes:
- "https"
- "http"
paths:
/vnfs:
get:
summary: "Get list of VNFs"
parameters: []
responses:
200:
description: "successful"
schema:
$ref: "#/definitions/inline_response_200"
/vnfs/{vnfName}:
get:
summary: "Get state of VNF"
parameters:
- name: "vnfName"
in: "path"
required: true
type: "string"
responses:
200:
description: "successful"
schema:
$ref: "#/definitions/vnf"
400:
description: "nof found vnf"
schema:
$ref: "#/definitions/unsuccess"
post:
summary: "Allocate new VNF"
parameters:
- name: "vnfName"
in: "path"
required: true
type: "string"
- in: "body"
name: "body"
required: false
schema:
$ref: "#/definitions/body"
responses:
200:
description: "successful"
schema:
$ref: "#/definitions/success"
400:
description: "vnf already exist or not found cname"
schema:
$ref: "#/definitions/unsuccess"
delete:
summary: "Delete VNF"
parameters:
- name: "vnfName"
in: "path"
required: true
type: "string"
responses:
200:
description: "successful"
schema:
$ref: "#/definitions/success"
400:
description: "not found vnf"
schema:
$ref: "#/definitions/unsuccess"
/vnfs/{vnfName}/deploy:
put:
summary: "Deploy VNF"
parameters:
- name: "vnfName"
in: "path"
required: true
type: "string"
responses:
200:
description: "successful"
schema:
$ref: "#/definitions/success"
400:
description: "not found vnf or coremask is invalid or already running"
schema:
$ref: "#/definitions/unsuccess"
/vnfs/{vnfName}/undeploy:
put:
summary: "Undeploy VNF"
parameters:
- name: "vnfName"
in: "path"
required: true
type: "string"
responses:
200:
description: "successful"
schema:
$ref: "#/definitions/success"
400:
description: "not found vnf or coremask is invalid or already running"
schema:
$ref: "#/definitions/unsuccess"
/vnfs/{vnfName}/coremask/{blockId}:
put:
summary: "Set coremask"
parameters:
- name: "vnfName"
in: "path"
required: true
type: "string"
- name: "blockId"
in: "path"
required: true
type: "string"
- in: "body"
name: "body"
required: false
schema:
$ref: "#/definitions/body_1"
responses:
200:
description: "successful"
schema:
$ref: "#/definitions/success"
400:
description: "not found vnf or coremask is invalid or already running"
schema:
$ref: "#/definitions/unsuccess"
/vnfs/{vnfName}/reset:
put:
summary: "Reset coremask (0 clear)"
parameters:
- name: "vnfName"
in: "path"
required: true
type: "string"
responses:
200:
description: "successful"
schema:
$ref: "#/definitions/success"
400:
description: "not found vnf or coremask is invalid or already running"
schema:
$ref: "#/definitions/unsuccess"
/vnfs/{vnfName}/ports/{portId}:
put:
summary: "Attach port to VNF"
parameters:
- name: "vnfName"
in: "path"
required: true
type: "string"
- name: "portId"
in: "path"
required: true
type: "integer"
- in: "body"
name: "body"
required: false
schema:
$ref: "#/definitions/body_2"
responses:
200:
description: "successful"
schema:
$ref: "#/definitions/success"
400:
description: "vnf or port not found. or vnf already have attached port"
schema:
$ref: "#/definitions/unsuccess"
delete:
summary: "Dettach port to VNF"
parameters:
- name: "vnfName"
in: "path"
required: true
type: "string"
- name: "portId"
in: "path"
required: true
type: "integer"
responses:
200:
description: "successful"
schema:
$ref: "#/definitions/success"
400:
description: "vnf or port not found. or no port attached"
schema:
$ref: "#/definitions/unsuccess"
/ports:
get:
summary: "Get list of Ports"
parameters: []
responses:
200:
description: "successful"
schema:
$ref: "#/definitions/inline_response_200_1"
/ports/{portName}:
get:
summary: "Get state of Port"
parameters:
- name: "portName"
in: "path"
required: true
type: "string"
responses:
200:
description: "successful"
post:
summary: "Alloc new Port"
parameters:
- name: "portName"
in: "path"
required: true
type: "string"
- in: "body"
name: "body"
required: false
schema:
$ref: "#/definitions/body_3"
responses:
200:
description: "successful"
schema:
$ref: "#/definitions/success"
400:
description: "port already exist or not found cname"
schema:
$ref: "#/definitions/unsuccess"
delete:
summary: "Delete Port"
parameters:
- name: "portName"
in: "path"
required: true
type: "string"
responses:
200:
description: "successful"
schema:
$ref: "#/definitions/success"
400:
description: "port not found"
schema:
$ref: "#/definitions/unsuccess"
definitions:
vnf:
type: "object"
properties:
name:
type: "string"
example: "vnf0"
n_port:
type: "integer"
format: "uint64"
example: 2
n_block:
type: "integer"
format: "uint64"
example: 1
blocks:
$ref: "#/definitions/vnf_blocks"
ports:
$ref: "#/definitions/vnf_ports"
block:
type: "object"
properties:
name:
type: "string"
example: "vnf0block0"
cmask:
type: "integer"
format: "uint64"
example: 2
port:
type: "object"
properties:
name:
type: "string"
example: "pci0"
n_rxq:
type: "integer"
format: "uint64"
example: 4
n_txq:
type: "integer"
format: "uint64"
example: 4
n_rxa:
type: "integer"
format: "uint64"
example: 2
n_txa:
type: "integer"
format: "uint64"
example: 2
perfred:
type: "number"
format: "double"
example: 0.6999999999999999555910790149937383830547332763671875
success:
type: "object"
properties:
result:
type: "boolean"
example: true
msg:
type: "string"
example: "successed"
unsuccess:
type: "object"
properties:
result:
type: "boolean"
example: false
msg:
type: "string"
example: "error message"
inline_response_200:
properties:
0:
$ref: "#/definitions/vnf"
1:
$ref: "#/definitions/vnf"
n_vnfs:
type: "integer"
format: "uint64"
example: 2
body:
type: "object"
properties:
cname:
type: "string"
example: "l2fwd1b"
body_1:
type: "object"
properties:
cmask:
type: "integer"
format: "uint64"
example: 4
body_2:
type: "object"
properties:
pname:
type: "string"
example: "pci0"
inline_response_200_1:
properties:
0:
$ref: "#/definitions/port"
1:
$ref: "#/definitions/port"
n_ports:
type: "integer"
format: "uint64"
example: 2
body_3:
type: "object"
properties:
cname:
type: "string"
example: "pci"
vnf_blocks:
properties:
0:
$ref: "#/definitions/block"
vnf_ports:
properties:
0:
$ref: "#/definitions/port"
1:
$ref: "#/definitions/port"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment