swagger: "2.0" info: description: "Subutai P2P operations" version: "6.3.0" title: "Subutai P2P" termsOfService: "https://subutai.io" contact: email: "msavochkin@optimal-dynamics.com" license: name: "GPLv3" url: "https://www.gnu.org/licenses/gpl-3.0.en.html" host: "localhost" basePath: "/v1" schemes: - "http" - "https" tags: - name: "instances" description: "P2P Instances manipulation" - name: "swarm" description: "Manipulate single swarms" - name: "daemon" description: "Modify daemon behaviour" paths: /instance: post: tags: - "instances" summary: "Create new P2P instance" description: "" operationId: "CreateInstance" consumes: - "application/json" - "application/xml" produces: - "application/json" - "application/xml" parameters: - in: "body" name: "body" description: "Instance configuration" required: true schema: $ref: "#/definitions/Instance" responses: 200: description: "Sucessfully created" 400: description: "Bad request" 503: description: "Service unavailable" get: tags: - "instances" summary: "List P2P instances" description: "List all p2p instances" operationId: "ListInstances" produces: - "application/json" - "application/xml" responses: 200: description: "Sucessful operation" schema: $ref: "#/definitions/Instances" 503: description: "Service unavailable" delete: tags: - "instances" summary: "Destroy P2P instance" description: "This command will shutdown P2P instance" operationId: "CloseInstance" consumes: - "application/json" - "application/xml" produces: - "application/json" - "application/xml" parameters: - in: "query" name: "hash" description: "Instance configuration" required: true schema: $ref: "#/definitions/Instance" responses: 200: description: "Sucessfully created" 400: description: "Bad request" 503: description: "Service unavailable" /swarm: get: tags: - "swarm" summary: "Display instance information" description: "Display detailed information about specified instance" operationId: "SwarmStatus" produces: - "application/json" - "application/xml" parameters: - in: "query" name: "hash" description: "Instance hash" required: true type: "string" responses: 200: description: "Sucessful operation" schema: $ref: "#/definitions/InstanceDetails" 404: description: "Hash not found" 503: description: "Service unavailable" post: tags: - "swarm" summary: "Update swarm keys" description: "Add new crypto keys to an existing swarm" operationId: "SwarmOptions" consumes: - "application/json" - "application/xml" produces: - "application/json" - "application/xml" parameters: - in: "body" name: "body" description: "Instance configuration" required: true schema: $ref: "#/definitions/Key" - in: "query" name: "hash" description: "Instance hash" required: true type: "string" responses: 200: description: "Sucessful operation" 400: description: "Bad request" 503: description: "Service unavailable" /daemon: get: tags: - "daemon" summary: "Get daemon information" description: "Returns information about P2P daemon" operationId: "DaemonInfo" consumes: - "application/json" - "application/xml" produces: - "application/json" - "application/xml" responses: 200: description: "Sucessful operation" schema: $ref: "#/definitions/Daemon" 503: description: "Service unavailable" post: tags: - "daemon" summary: "Modify daemon" description: "Modify daemon options on runtime" operationId: "DaemonOptions" consumes: - "application/json" - "application/xml" produces: - "application/json" - "application/xml" parameters: - in: "body" name: "body" description: "Instance configuration" required: true schema: $ref: "#/definitions/Log" responses: 200: description: "Sucessful operation" 503: description: "Service unavailable" definitions: Instance: type: object properties: hash: type: "string" required: true interface: $ref: "#/definitions/Interface" port: type: "string" description: "Specific UDP port or port range [from-to]" key: $ref: "#/definitions/Key" xml: name: "Instance" Instances: type: array items: $ref: "#/definitions/Instance" InstanceDetails: type: object properties: id: type: "string" hash: type: "string" interface: $ref: "#/definitions/Interface" port: type: "integer" proxies: type: "array" items: $ref: "#/definitions/Proxy" peers: type: "array" items: $ref: "#/definitions/Peer" Key: type: object properties: key: type: "string" keyfile: type: "string" until: type: "string" xml: name: "Key" Log: type: object properties: level: type: "string" default: "info" required: true Daemon: type: object properties: version: type: "string" build: type: "string" os: type: "string" dht: type: array items: $ref: "#/definitions/DHT" uptime: type: "string" DHT: type: object properties: endpoint: type: "string" rx: type: "string" tx: type: "string" Interface: type: object properties: name: type: "string" ip: type: "string" mac: type: "string" Proxy: type: object properties: addr: type: "string" description: "UDP address of proxy this instance is connected to" endpoint: type: "string" description: "UDP address of proxy that was binded for current instance" Peer: type: object properties: id: type: "string" description: "Unique ID of this peer" state: type: "string" description: "State of the peer on our end" rstate: type: "string" description: "State of our peer on remote end" interface: $ref: "#/definitions/Interface" endpoint: type: "string" description: "Active endpoint" endpoint_pool: type: "array" items: type: "string" endpoint_list: type: "array" items: type: "string"