From c78aafbe7896c8ee87dcd1d9d619bacc425b4739 Mon Sep 17 00:00:00 2001 From: Lei Lei Date: Mon, 29 Jun 2015 16:54:21 -0700 Subject: [PATCH] Update api.raml Change-Id: I71efbf5ce96ba16eea1dc929311bd52d4ab2515a --- compass/api/api.raml | 1942 +++++++++++++++++++++++++++--------------- 1 file changed, 1276 insertions(+), 666 deletions(-) diff --git a/compass/api/api.raml b/compass/api/api.raml index 8e42a6fc..961c8324 100644 --- a/compass/api/api.raml +++ b/compass/api/api.raml @@ -1,9 +1,14 @@ #%RAML 0.8 title: Compass version: v1 -baseUri: http://compass.com +baseUri: http://10.145.89.151/api +mediaType: application/json + + /permissions: get: + body: + application/json: responses: 200: body: @@ -18,6 +23,10 @@ baseUri: http://compass.com }, ] description: List all permissions + headers: + X-Auth-Header: + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /{permission_id}: get: responses: @@ -41,6 +50,11 @@ baseUri: http://compass.com message: "Cannot find the record in table Permission: {'id': ''}" } description: List a specific permission info + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /users: get: responses: @@ -62,11 +76,24 @@ baseUri: http://compass.com ] description: Lists information for all users + headers: + X-Auth-Header: + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 queryParameters: email: is_admin: active: post: + body: + application/json: + schema: | + { + "email": "admin@someemail.com", + "password": "admin", + "firstname": "First", + "lastname": "Last" + } responses: 201: body: @@ -103,18 +130,11 @@ baseUri: http://compass.com { "message": "The user already exists!" } - queryParameters: - email: - example: "user3@someemail.com" - required: true - password: - example: "123456" - required: true - first_name: - required: false - last_name: - required: false description: Creates a user(admin only) + headers: + X-Auth-Header: + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /{user_id}: get: responses: @@ -137,10 +157,18 @@ baseUri: http://compass.com application/json: example: | { - "message": "The user with id ‘some--id--’ cannot be found!" + "message": "The user with id 'some--id--' cannot be found!" } description: Lists information for a specific user + headers: + X-Auth-Header: + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 put: + body: + application/json: + schema: | + {"password": 123} responses: 201: body: @@ -159,12 +187,13 @@ baseUri: http://compass.com application/json: example: | { - "message": "The user with id ‘some--id--’ cannot be found!" + "message": "The user with id 'some--id--' cannot be found!" } - queryParameters: - password: - example: "78910" description: Updates user’s information + headers: + X-Auth-Header: + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 delete: responses: 200: @@ -187,6 +216,10 @@ baseUri: http://compass.com "message": "The user cannot be found!" } description: Deletes a user(admin only) + headers: + X-Auth-Header: + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /permissions: get: responses: @@ -212,11 +245,26 @@ baseUri: http://compass.com example: | { "type": "itemNotFound", - "message": "The user with id ‘some--id--’ cannot be found!" + "message": "The user with id 'some--id--' cannot be found!" } description: Lists permissions for a specified user + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /action: post: + body: + application/json: + schema: | + { + "add_permissions": [1,2,3], + "remove_permissions": [1], + "set_permissions": [1], + "disable_user": [1], + "enable_user": [1] + } responses: 200: body: @@ -296,22 +344,21 @@ baseUri: http://compass.com "type": "itemNotFound", "message": "The user cannot be found!" } - queryParameters: - add_permissions: - example: "[1,2,3]" - remove_permissions: - example: "{ - “permissions” : [1] - }" - set_permissions: - example: '{"permissions" : "all"}' - enable_user: - example: null - disable_user: - example: null description: Adds/Removes permissions, Enable/Disable a user (admin only) + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /token: post: + body: + application/json: + schema: | + { + "email": "admin@huawei.com", + "password": "admin" + } responses: 200: body: @@ -331,14 +378,16 @@ baseUri: http://compass.com "type": "unauthorized", "message": "Either email or password is wrong!" } - queryParameters: - email: - example: someone@someemail.com - password: - example: 123456 description: Authenticates and generates a token /login: post: + body: + application/json: + schema: | + { + "email": "admin@huawei.com", + "password": "admin" + } responses: 200: body: @@ -366,11 +415,6 @@ baseUri: http://compass.com "type": "userDisabled", "message”: "User is disabled !" } - queryParameters: - email: - example: someone@someemail.com - password: - example: 123456 description: Login /logout: post: @@ -395,11 +439,11 @@ baseUri: http://compass.com "message": "invalid user token: $1$AFqIS5Kn$1ASgOkPv.G1a7pkRRHKY.0", } description: Logout - - - - - + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /switches: get: responses: @@ -422,7 +466,23 @@ baseUri: http://compass.com } ] description: Lists switches + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 post: + body: + application/json: + schema: | + { + "ip": "172.29.8.40", + "credentials": + { + "version": "2c", + "community": "public" + } + } responses: 200: body: @@ -445,19 +505,14 @@ baseUri: http://compass.com application/json: example: | { - "message": "IP address ‘192.168.1.1’ already exists" + "message": "IP address '192.168.1.1' already exists" } - queryParameters: - ip: - example: 172.29.8.40 - credentials: - example: | - { - "version": "2c", - "community": "public" - } - description: Creates a switch + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /{switch_id}: get: responses: @@ -482,10 +537,26 @@ baseUri: http://compass.com application/json: example: | { - "message": "Cannot find the switch which id is ‘1’." + "message": "Cannot find the switch which id is '1'." } description: Lists a switch + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 put: + body: + application/json: + schema: | + { + "ip": "172.29.8.40", + "credentials": + { + "version": "2c", + "community": "private" + } + } responses: 200: body: @@ -508,21 +579,26 @@ baseUri: http://compass.com application/json: example: | { - "message": "Cannot update the switch which id is ‘1’! The switch does not exists." + "message": "Cannot update the switch which id is '1'! The switch does not exists." } - queryParameters: - ip: - credentials: - example: '{ - "version": "2c", - "community": "private" - }' - vendor: - state: - err_msg: - filters: description: Set the switch properties + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 patch: + body: + application/json: + schema: | + { + "ip": "172.29.8.40", + "credentials": + { + "version": "3", + "community": "public" + } + } responses: 200: body: @@ -545,16 +621,14 @@ baseUri: http://compass.com application/json: example: | { - "message": "Cannot update the switch which id is ‘1’! The switch does not exists." + "message": "Cannot update the switch which id is '1'! The switch does not exists." } - queryParameters: - ip: - credentials: - example: '{ - "version": "3" - }' - filters: description: Updates the switch properties + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 delete: responses: 200: @@ -581,6 +655,11 @@ baseUri: http://compass.com "message": "Cannot find the record in table Switch: {'id': 4}" } description: Delete switch + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /machines: get: responses: @@ -618,7 +697,31 @@ baseUri: http://compass.com tag: location: description: Lists machines for a specified switch + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 post: + body: + application/json: + schema: | + { + "mac": "28:6e:d4:46:c4:25", + "port": "1", + "vlans": "88", + "ipmi_credentials": { + "ip": "1.2.3.4", + "username": "test", + "password": "test" + }, + "tag": "tag", + "location": { + "column": "1", + "row": "1", + "unit": "1" + } + } responses: 200: body: @@ -637,33 +740,22 @@ baseUri: http://compass.com { "message": "The switch does not exists." } - queryParameters: - mac: - example: "28:6e:d4:47:c8:6c" + description: Manually add a machine + headers: + Access-token: + displayName: X-Auth-Header required: true - port: - example: "10" - required: true - vlans: - example: 1 - ipmi_credentials: - example: '{ - "ip": "---some--ip---", - "username": "--some--username--", - "password": "---some---password---" - }' - tag: - location: - example: '{ - "column": "xxx", - "row”: "xxx", - "unit”: "xxx", - "building”: "xxx", - "city”: "xxx" - }' - description: Manually add a machine + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /machines: post: + body: + application/json: + schema: | + { + "mac": "28:6e:d4:46:c4:25", + "port": "1", + "vlans": "88" + } responses: 200: body: @@ -734,18 +826,12 @@ baseUri: http://compass.com } ] } - queryParameters: - switch_ip: - example: "172.29.8.40" - description: Make sure this switch ip has been added first. - required: true - mac: - example: "70:7b:e8:e2:72:21" - required: true - port: - example: "100" - required: true description: Batch switch machines. If the machine is connected to other switch or switch does not exist, it will be added to fail_switches_machines and return. If machine is already existed, it will be added to duplicate_switches_machines. + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /{id}/machines/{machine_id}: get: @@ -779,7 +865,23 @@ baseUri: http://compass.com "message": "Cannot find the record in table SwitchMachine: {'machine_id': 1000, 'switch_id': 2}" } description: Get machine of a specified switch + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 put: + body: + application/json: + schema: | + { + "port": "80", + "vlans": "88", + "pmi_credentials": "pmi_credentials here", + "tag": "tag here", + "location": + {"building": "E5"} + } responses: 200: body: @@ -811,16 +913,24 @@ baseUri: http://compass.com { "message": "Cannot find the record in table SwitchMachine: {'machine_id': 1000, 'switch_id': 2}" } - queryParameters: - port: - vlans: - ipmi_credentials: - tag: - location: - example: - '{"building": "E5"}' description: set machine property of a specified switch + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 patch: + body: + application/json: + schema: | + { + "port": "80", + "vlans": "88", + "pmi_credentials": "pmi_credentials here", + "tag": "tag here", + "location": + {"city": "Beijing"} + } responses: 200: body: @@ -853,13 +963,12 @@ baseUri: http://compass.com { "message": "Cannot find the record in table SwitchMachine: {'machine_id': 1000, 'switch_id': 2}" } - queryParameters: - vlans: - ipmi_credentials: - tag: - location: - example: '{"city": "beijing"}' description: update machine property of a specified switch + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 delete: responses: 200: @@ -894,16 +1003,28 @@ baseUri: http://compass.com "message": "Cannot find the record in table SwitchMachine: {'machine_id': 1000, 'switch_id': 2}" } description: Delete a machine from a switch + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /{switch_id}/action: post: + body: + application/json: + schema: | + { + "find_machines": 1, + "add_macheins": [{"machine_id":1,"port":"10"}], + "rermove_machines": 1, + "set_machines": [{"machine_id": 1, "port": "10"}] + } responses: 202: body: application/json: example: | find_machines: - - { "status": "action {'find_machines': None} sent", "details": {} @@ -912,9 +1033,7 @@ baseUri: http://compass.com body: application/json: example: | - add_machines: - - + add_machines: [ { "vlans": [], @@ -934,12 +1053,8 @@ baseUri: http://compass.com ] remove_machines: - - [] - - set_machines: - - + [] + set_machines: [ { "vlans": [], @@ -962,20 +1077,26 @@ baseUri: http://compass.com application/json: example: | { - "message": "Cannot update the switch which id is ‘1’! The switch does not exists." + "message": "Cannot update the switch which id is '1'! The switch does not exists." } - queryParameters: - find_machines: - example: "null" - add_machines: - example: '[{"machine_id": 1, "port": "10"}]' - remove_machines: - example: "[1]" - set_machines: - example: '[{"machine_id": 1, "port": "10"}]' - description: switch action like Polls a switch’s machines + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /switchbatch: post: + body: + application/json: + schema: | + [{ + "switch_ip": "127.0.0.1": + "credentials":{ + "version": "2c", + "community": "public" + },{ + "switch_ip": "127.0.0.2" + }] responses: 200: body: @@ -1012,20 +1133,12 @@ baseUri: http://compass.com } ] } - queryParameters: - ip: - description: switch ip - required: true - vendor: - description: Currently supports Huawei, HP, Arista and PICA8 switches. - required: false - version: - example: 2c - required: true - community: - example: public - required: true description: Batch switches. If switch ip already existed, switch data will be added in fail_switches list and return. + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /machines: get: responses: @@ -1053,6 +1166,11 @@ baseUri: http://compass.com tag: location: description: Lists machines + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /{machine_id}: get: responses: @@ -1078,10 +1196,23 @@ baseUri: http://compass.com application/json: example: | { - "message": "The machine witch ID “$machine_id” cannot be found!" + "message": "The machine witch ID '$machine_id' cannot be found!" } description: Lists machines of a specific machine + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 put: + body: + application/json: + schema: | + { + "ipmi_credentials": { + "builder": "huawei" + } + } responses: 200: body: @@ -1109,13 +1240,24 @@ baseUri: http://compass.com { "message": "The machine witch ID “$machine_id” cannot be found!" } - queryParameters: - ipmi_credentials: - tag: - example: '{"builder": "huawei"} ' - location: description: set machine properties + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 patch: + body: + application/json: + schema: | + { + "ipmi_credentials": { + "builder": "huawei" + }, + "tag": { + "type": "ES200" + } + } responses: 200: body: @@ -1141,14 +1283,14 @@ baseUri: http://compass.com application/json: example: | { - "message": "The machine witch ID “$machine_id” cannot be found!" + "message": "The machine witch ID '$machine_id' cannot be found!" } - queryParameters: - ipmi_credentials: - tag: - example: '{"type": "ES200"}' - location: description: updatge machine properties + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 delete: responses: 200: @@ -1175,11 +1317,20 @@ baseUri: http://compass.com application/json: example: | { - "message": "The machine witch ID “$machine_id” cannot be found!" + "message": "The machine witch ID '$machine_id' cannot be found!" } description: Delete a machine (admin only) /action: post: + body: + application/json: + schema: | + { + "tag": {"builder": "huawei"}, + "poweron": "true", + "poweroff": "true", + "reset": "true" + } responses: 200: body: @@ -1223,22 +1374,21 @@ baseUri: http://compass.com application/json: example: | { - "message": "The machine witch ID “$machine_id” cannot be found!" + "message": "The machine witch ID '$machine_id' cannot be found!" } 400: body: application/json: example: | { - "message": "The machine haven’t set IPMI info!" + "message": "The machine haven't set IPMI info!" } - queryParameters: - tag: - example: '{"builder": "huawei"}' - poweron: - poweroff: - reset: description: machine actions + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /flavors: /{flavor_id}/metadata: get: @@ -1248,11 +1398,11 @@ baseUri: http://compass.com application/json: example: | { - "flavor_config“: { - "neutron_config": {……}, - "security”: {……}, - "ha_proxy": {……}, - "network_mapping": {……} + "flavor_config": { + "neutron_config": {...}, + "security": {...}, + "ha_proxy": {...}, + "network_mapping": {...} } } @@ -1262,6 +1412,11 @@ baseUri: http://compass.com example: | {message: "flavor does not exist"} description: List specific flavor metadata. + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /{flavor_id}/ui_metadata: get: responses: @@ -1296,6 +1451,11 @@ baseUri: http://compass.com example: | {message: "flavor does not exist"} description: List specific flavor ui metadata. + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /adapters: get: responses: @@ -1371,6 +1531,11 @@ baseUri: http://compass.com name: distributed_system_name: description: Lists information for all adapters + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /{id}: get: responses: @@ -1412,9 +1577,14 @@ baseUri: http://compass.com application/json: example: | { - "message": "The adapter with id ‘some_id’ cannot be found!" + "message": "The adapter with id 'some_id' cannot be found!" } description: Lists information for a specified adapter + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /oses/{os_id}/metadata: get: responses: @@ -1477,9 +1647,14 @@ baseUri: http://compass.com application/json: example: | { - "message": "The adapter with id ‘some_id’ cannot be found!" + "message": "The adapter with id 'some_id' cannot be found!" } description: Lists config formats for a specified adapter and os + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /oses/{os_id}/ui_metadata: get: responses: @@ -1532,6 +1707,11 @@ baseUri: http://compass.com "message": "os does not exist" } description: List specified os ui metadata. + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /subnets: get: @@ -1549,6 +1729,13 @@ baseUri: http://compass.com }] description: Gets all subnetworks information post: + body: + application/json: + schema: | + { + "subnet": "10.172.20.0/24", + "name": "test_subnet" + } responses: 200: body: @@ -1566,7 +1753,7 @@ baseUri: http://compass.com application/json: example: | { - "message": "Keyword ‘$somekey’ cannot be recognized!" + "message": "Keyword '$somekey' cannot be recognized!" } 409: body: @@ -1575,10 +1762,12 @@ baseUri: http://compass.com { "message": "Subnet already exists!" } - queryParameters: - subnet: - example: "10.145.88.0/23" description: Creates one subnetwork + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /{subnet_id}: get: responses: @@ -1598,10 +1787,22 @@ baseUri: http://compass.com application/json: example: | { - "message": "Subnetwork with id ‘some_id’ cannot be found!" + "message": "Subnetwork with id 'some_id' cannot be found!" } description: Gets one subnetwork info + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 put: + body: + application/json: + schema: | + { + "subnet": "10.172.20.0/24", + "name": "update_subnet" + } responses: 200: body: @@ -1619,7 +1820,7 @@ baseUri: http://compass.com application/json: example: | { - "message": "Subnetwork with id ‘some_id’ cannot be found!" + "message": "Subnetwork with id 'some_id' cannot be found!" } 409: body: @@ -1628,11 +1829,12 @@ baseUri: http://compass.com { "message": "Subnet name already exists!" } - queryParameters: - name: - subnet: - example: "10.145.86.0/23" description: set subnet properties + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 delete: responses: 403: @@ -1652,9 +1854,14 @@ baseUri: http://compass.com application/json: example: | { - "message": "Subnetwork with id ‘some_id’ cannot be found!" + "message": "Subnetwork with id 'some_id' cannot be found!" } description: Deletes a subnetwork (owner, admin only) + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /clusters: get: responses: @@ -1663,39 +1870,39 @@ baseUri: http://compass.com application/json: example: | [ - { - "created_at": "2014-10-18 23:01:23", - "os_name": "CentOS-6.5-x86_64", - "name": "cluster1", - "reinstall_distributed_system": true, - "distributed_system_id": 1, - "adapter_id": 3, - "updated_at": "2014-10-18 23:01:23", - "owner": "admin@huawei.com", - "os_id": 2, - "distributed_system_name": "openstack", - "distributed_system_installed": false, - "flavor": { - "display_name": "All-In-One", - "name": "allinone", - "roles": [ - { - "display_name": "all in one compute", - "description": "all in one compute", - "adapter_id": 3, - "role_id": 35, - "flavor_id": 4, - "optional": true, - "id": 35, - "name": "allinone-compute" - } - ], - "adapter_id": 3, - "template": "allinone.tmpl", - "id": 4 - }, - "id": 1 - } + { + "created_at": "2014-10-18 23:01:23", + "os_name": "CentOS-6.5-x86_64", + "name": "cluster1", + "reinstall_distributed_system": true, + "distributed_system_id": 1, + "adapter_id": 3, + "updated_at": "2014-10-18 23:01:23", + "owner": "admin@huawei.com", + "os_id": 2, + "distributed_system_name": "openstack", + "distributed_system_installed": false, + "flavor": { + "display_name": "All-In-One", + "name": "allinone", + "roles": [ + { + "display_name": "all in one compute", + "description": "all in one compute", + "adapter_id": 3, + "role_id": 35, + "flavor_id": 4, + "optional": true, + "id": 35, + "name": "allinone-compute" + } + ], + "adapter_id": 3, + "template": "allinone.tmpl", + "id": 4 + }, + "id": 1 + } ] queryParameters: name: @@ -1705,7 +1912,21 @@ baseUri: http://compass.com adapter_name: flavor_name: description: Lists all information for all clusters + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 post: + body: + application/json: + schema: | + { + "adapter_id": 3, + "name": "add_cluster", + "os_id": 1, + "flavor_id": 1 + } responses: 201: body: @@ -1724,23 +1945,23 @@ baseUri: http://compass.com "distributed_system_name": "openstack", "distributed_system_installed": false, "flavor": { - "display_name": "All-In-One", - "name": "allinone", - "roles": [ - { - "display_name": "all in one compute", - "description": "all in one compute", - "adapter_id": 3, - "role_id": 35, - "flavor_id": 4, - "optional": true, - "id": 35, - "name": "allinone-compute" - } - ], - "adapter_id": 3, - "template": "allinone.tmpl", - "id": 4 + "display_name": "All-In-One", + "name": "allinone", + "roles": [ + { + "display_name": "all in one compute", + "description": "all in one compute", + "adapter_id": 3, + "role_id": 35, + "flavor_id": 4, + "optional": true, + "id": 35, + "name": "allinone-compute" + } + ], + "adapter_id": 3, + "template": "allinone.tmpl", + "id": 4 }, "id": 1 } @@ -1749,22 +1970,14 @@ baseUri: http://compass.com application/json: example: | { - "message": "Cluster with name ‘cluster_01’ already exists!" + "message": "Cluster with name 'cluster_01' already exists!" } - queryParameters: - adapter_id: - example: 3 - required: true - os_id: - example: 2 - required: true - name: - example: "cluster1" - required: true - flavor_id: - example: 4 - required: false description: Creates a new cluster + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /{cluster_id}: get: responses: @@ -1810,10 +2023,21 @@ baseUri: http://compass.com application/json: example: | { - "message": "Cluster with id ‘some_id’ cannot be found!" + "message": "Cluster with id 'some_id' cannot be found!" } description: Lists information for a specified cluster + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 put: + body: + application/json: + schema: | + { + "name": "update_cluster" + } responses: 200: body: @@ -1832,23 +2056,23 @@ baseUri: http://compass.com "distributed_system_name": "openstack", "distributed_system_installed": false, "flavor": { - "display_name": "All-In-One", - "name": "allinone", - "roles": [ - { - "display_name": "all in one compute", - "description": "all in one compute", - "adapter_id": 3, - "role_id": 35, - "flavor_id": 4, - "optional": true, - "id": 35, - "name": "allinone-compute" - } - ], - "adapter_id": 3, - "template": "allinone.tmpl", - "id": 4 + "display_name": "All-In-One", + "name": "allinone", + "roles": [ + { + "display_name": "all in one compute", + "description": "all in one compute", + "adapter_id": 3, + "role_id": 35, + "flavor_id": 4, + "optional": true, + "id": 35, + "name": "allinone-compute" + } + ], + "adapter_id": 3, + "template": "allinone.tmpl", + "id": 4 }, "id": 2 } @@ -1860,6 +2084,11 @@ baseUri: http://compass.com "message": "Cluster not found" } description: set properties of cluster + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 delete: responses: 200: @@ -1906,7 +2135,12 @@ baseUri: http://compass.com { "message": "Cluster has been deployed or is being installed. Not allowed to delete it now!" } - description: Deletes a specific cluster before deploy (admin, owner only). Hosts will be still kept even cluster(s) is deleted + description: Deletes a specific cluster before deploy (admin, owner only). Hosts will be still kept even cluster(s) is deleted. + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /config: get: responses: @@ -1925,10 +2159,55 @@ baseUri: http://compass.com application/json: example: | { - "message": "Cluster with id ‘some_id’ cannot be found!" + "message": "Cluster with id 'some_id' cannot be found!" } description: Gets config information for a specified cluster + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 put: + body: + application/json: + schema: | + { + "os_config":{ + "general": { + "language": "EN", + "timezone": "PDT", + "domain": "xxx", + "default_gateway": "10.0.0.1" + }, + "server_credentials": { + "username": "admin", + "password": "admin" + }, + "partition": { + "/var" : { + "_type": "$path", + "max_size": "20", + "size_percentage": "20" + } + } + }, + "package_config":{ + "network_mapping": { + "management": { + "interface": "eth0" + }, + "tenant": { + "interface": "eth1" + }, + "storage": { + "interface":" eth2" + }, + "public": { + "interface": "eth3" + } + } + } + } responses: 200: body: @@ -1977,48 +2256,27 @@ baseUri: http://compass.com application/json: example: | { - "message": "Cluster with id ‘some_id’ cannot be found!" + "message": "Cluster with id 'some_id' cannot be found!" } - queryParameters: - os_config: - example: '{ - "general": { - "language": "EN", - "timezone": "PDT", - "domain": "xxx", - "default_gateway": "10.0.0.1" - }, - "server_credentials": { - "username": "admin", - "password": "admin" - }, - "partition": { - "/var" : { - “_type": "$path", - "max_size": "20", - "size_percentage": "20", - } - } - }' - package_config: - example: '{ - "network_mapping": { - "management": { - "interface": "eth0" - }, - "tenant": { - "interface": "eth1" - }, - "storage": { - "interface":" eth2" - }, - "public": { - "interface": "eth3" - } - } - }' description: set properties in cluster config + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 patch: + body: + application/json: + schema: | + { + "package_config": { + "security": { + "dashboard_credentials": { + "username": "root" + } + } + } + } responses: 200: body: @@ -2032,7 +2290,7 @@ baseUri: http://compass.com "username": "admin", "password": "admin" }, - …….. + ... }, "dashboard_credentials":{ "username": "root", @@ -2046,21 +2304,14 @@ baseUri: http://compass.com application/json: example: | { - "message": "Cluster with id ‘some_id’ cannot be found!" + "message": "Cluster with id 'some_id' cannot be found!" } - queryParameters: - os_config: - example: '{ - "package_config": { - "security": { - "dashboard_credentials": { - "username": "root" - } - } - } - }' - package_config: description: update properties in cluster config + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 delete: responses: 200: @@ -2068,26 +2319,31 @@ baseUri: http://compass.com application/json: example: | { - "package_config":{ - "security": { - "service_crendentials": { - "image": { - "username": "admin", - "password": "admin" - }, - …….. - } - } - } + "package_config":{ + "security": { + "service_crendentials": { + "image": { + "username": "admin", + "password": "admin" + }, + ... + } + } + } } 404: body: application/json: example: | { - "message": "Cluster with id ‘some_id’ cannot be found!" + "message": "Cluster with id 'some_id' cannot be found!" } description: delete cluster config + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /state: get: responses: @@ -2106,9 +2362,14 @@ baseUri: http://compass.com application/json: example: | { - "message": "Cluster with id ‘some_id’ cannot be found!" + "message": "Cluster with id 'some_id' cannot be found!" } description: get cluster state + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /hosts: get: responses: @@ -2133,10 +2394,24 @@ baseUri: http://compass.com application/json: example: | { - "message": "Cluster with id ‘some_id’ cannot be found!" + "message": "Cluster with id 'some_id' cannot be found!" } description: Gets the information of the hosts belonging to this cluster + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 post: + body: + application/json: + schema: | + { + "machine_id": 1, + "name": "cluster_host", + "reinstall_os": "True", + "roles": ["allinone-compute"] + } responses: 200: body: @@ -2198,14 +2473,12 @@ baseUri: http://compass.com { "message": "host already exists" } - queryParameters: - machine_id: - example: 2 - required: true - name: - reinstall_os: - roles: description: add host to a cluster + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /{host_id}: get: responses: @@ -2237,10 +2510,23 @@ baseUri: http://compass.com application/json: example: | { - "message": " Host with id ‘some_id’ cannot be found!" + "message": " Host with id 'some_id' cannot be found!" } description: get host of a cluster + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 put: + body: + application/json: + schema: | + { + "name": "update_cluster_host", + "reinstall_os": "False", + "roles": ["ha-proxy"] + } responses: 200: body: @@ -2308,14 +2594,21 @@ baseUri: http://compass.com application/json: example: | { - "message": " Host with id ‘some_id’ cannot be found!" + "message": " Host with id 'some_id' cannot be found!" } - queryParameters: - roles: - example: - '["allinone-compute"]' description: set host properties of a cluster + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 patch: + body: + application/json: + schema: | + { + "roles": "os-controller" + } responses: 200: body: @@ -2387,13 +2680,14 @@ baseUri: http://compass.com application/json: example: | { - "message": " Host with id ‘some_id’ cannot be found!" + "message": " Host with id 'some_id' cannot be found!" } - queryParameters: - roles: - example: - '["new-role"]' description: update host properties of a cluster + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 delete: description: delete host from a cluster /config: @@ -2405,10 +2699,10 @@ baseUri: http://compass.com example: | { "os_config": { - …... + ... }, "package_config": { - …... + ... } } 404: @@ -2416,10 +2710,78 @@ baseUri: http://compass.com application/json: example: | { - "message": " Host with id ‘some_id’ cannot be found!" + "message": " Host with id 'some_id' cannot be found!" } description: get config of a host + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 put: + body: + application/json: + schema: | + { + "os_config": { + "general": { + "language": "EN", + "timezone": "UTC", + "http_proxy": "http://127.0.0.1:3128", + "https_proxy": "http://127.0.0.1:3128", + "no_proxy": [ + "127.0.0.1", + "compass" + ], + "ntp_server": "127.0.0.1", + "dns_servers": [ + "127.0.0.1" + ], + "domain": "ods.com", + "search_path": [ + "ods.com" + ], + "default_gateway": "127.0.0.1" + }, + "server_credentials": { + "username": "root", + "password": "root" + }, + "partition": { + "/var": { + "max_size": "100G", + "percentage": 10, + "size": "1G" + } + } + }, + "package_config": { + "network_mapping": { + "management": { + "interface": "eth0" + }, + "tenant": { + "interface": "eth1" + }, + "storage": { + "interface":"eth2" + }, + "public": { + "interface": "eth3" + } + }, + "services_credentials": { + "image": { + "username": "xxx", + "password": "xxx" + }, + "metering": { + "username": "xxx", + "password": "xxx" + } + } + } + } responses: 200: body: @@ -2433,41 +2795,78 @@ baseUri: http://compass.com application/json: example: | { - "message": " Host with id ‘some_id’ cannot be found!" + "message": " Host with id 'some_id' cannot be found!" } - queryParameters: - JSON: - example: '{ - "package_config": { - "network_mapping": { - "management": { - "interface": "eth0" - }, - "tenant": { - "interface": “eth1" - }, - "storage": { - "interface":"eth2" - }, - "public": { - "interface": "eth3" - } - } - "services_credentials": { - "image": { - "username": "xxx", - "password": "xxx" - }, - "metering": { - "username": "xxx", - "password": "xxx" - }, - ……. - } - } - }' description: set host config + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 patch: + body: + application/json: + schema: | + { + "os_config": { + "general": { + "language": "EN", + "timezone": "UTC", + "http_proxy": "http://127.0.0.1:3128", + "https_proxy": "http://127.0.0.1:3128", + "no_proxy": [ + "127.0.0.1", + "compass" + ], + "ntp_server": "127.0.0.1", + "dns_servers": [ + "127.0.0.1" + ], + "domain": "ods.com", + "search_path": [ + "ods.com" + ], + "default_gateway": "127.0.0.1" + }, + "server_credentials": { + "username": "root", + "password": "root" + }, + "partition": { + "/var": { + "max_size": "100G", + "percentage": 10, + "size": "1G" + } + } + }, + "package_config": { + "network_mapping": { + "management": { + "interface": "eth0" + }, + "tenant": { + "interface": "eth1" + }, + "storage": { + "interface":"eth2" + }, + "public": { + "interface": "eth3" + } + }, + "services_credentials": { + "image": { + "username": "xxx", + "password": "xxx" + }, + "metering": { + "username": "xxx", + "password": "xxx" + } + } + } + } responses: 200: body: @@ -2475,7 +2874,7 @@ baseUri: http://compass.com example: | { "os_config": { - …..//the same as PATCH cluster config + ...//the same as PATCH cluster config } } 404: @@ -2483,17 +2882,14 @@ baseUri: http://compass.com application/json: example: | { - "message": " Host with id ‘some_id’ cannot be found!" + "message": " Host with id 'some_id' cannot be found!" } - queryParameters: - JSON: - example: - '{ - "os_config": { - …..//the same as PATCH cluster config - } - }' description: update host config + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 delete: responses: 200: @@ -2502,7 +2898,7 @@ baseUri: http://compass.com example: | { "os_config": { - …..//the same as PATCH cluster config + ...//the same as PATCH cluster config } } 404: @@ -2510,9 +2906,14 @@ baseUri: http://compass.com application/json: example: | { - "message": " Host with id ‘some_id’ cannot be found!" + "message": " Host with id 'some_id' cannot be found!" } description: delete host config + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /state: get: responses: @@ -2534,10 +2935,21 @@ baseUri: http://compass.com application/json: example: | { - "message": " Host with id ‘some_id’ cannot be found!" + "message": " Host with id 'some_id' cannot be found!" } description: get host state of a cluster + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 put: + body: + application/json: + schema: | + { + "state": "INSTALLING" + } responses: 200: body: @@ -2567,177 +2979,152 @@ baseUri: http://compass.com application/json: example: | { - "message": " Host with id ‘some_id’ cannot be found!" + "message": " Host with id 'some_id' cannot be found!" } - queryParameters: - state: - example: “SUCCESSFUL” / “ERROR” - percentage: - message: - example: '“The installation is completed!” / “---some-error-message---”' - severity: - example: “INFO” / “ERROR” description: set host state properties of a cluster + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /action: post: + body: + application/json: + schema: | + { + "add_hosts": { + "machines": [{ + "machine_id": 1, + "host_id": 1, + "reinstall_os": "True" + },{ + "machine_id": 2, + "host_id": 2 + }] + }, + "set_hosts": { + "machines": [{ + "machine_id": 3 + },{ + "machine_id": 4 + }] + }, + "remove_hosts": { + "hosts": [1] + }, + "review": { + "hosts": [1,2,3] + }, + "deploy": { + "hosts": [1,2,3] + } + } responses: - 200: - body: - application/json: - example: | - { - "hosts": [ - { - "id" : 5, - "machine_id": 10 - }, - { - "id" : 6, - "machine_id": 11 - }, - { - "id" : 7, - "machine_id": 12 - } - ] + 200: + body: + application/json: + example: | + { + "hosts": [ + { + "id" : 5, + "machine_id": 10 + }, + { + "id" : 6, + "machine_id": 11 + }, + { + "id" : 7, + "machine_id": 12 } - - OR - - { - "hosts": [ - { - "id" : 1, - "machine_id": 13 - }, - { - "id" : 2, - "machine_id": 14 - }, - { - "id" : 3, - "machine_id": 15 - } - ] + ] + } + + OR + + { + "hosts": [ + { + "id" : 1, + "machine_id": 13 + }, + { + "id" : 2, + "machine_id": 14 + }, + { + "id" : 3, + "machine_id": 15 } - - OR - - { - "hosts": [ - { - "id" : 1, - "machine_id": 13 - } - ] - } - - OR - { - "hosts": [ - { - "id" : 1, - "machine_id": 10 - }, - { - "id" : 2, - "machine_id": 11 - }, - { - "id" : 3, - "machine_id": 12 - } - ] - } - - OR - - { - "cluster": {"id": 1}, - "hosts": [{"id": 1}, {"id": 2}, {"id": 3}] - } - - OR - - { - "status": "deploy action sent", - "cluster": { - "id": 1, - }, - "hosts": [ - { - "id": 3 - } - ] - } - - - 404: - body: - application/json: - example: | - { - "message": "Cluster with id ‘some_id’ cannot be found!" - } - queryParameters: - JSON 1: - example: '{ - "add_hosts": { - "machines" : [ - { - "machine_id": 10, //"host_id": 5, - "reinstall_os": true - }, - { - "machine_id": 11 // "host_id": 6 - }, - { - "machine_id": 12 - } - ] + ] + } + + OR + + { + "hosts": [ + { + "id" : 1, + "machine_id": 13 + } + ] + } + + OR + { + "hosts": [ + { + "id" : 1, + "machine_id": 10 + }, + { + "id" : 2, + "machine_id": 11 + }, + { + "id" : 3, + "machine_id": 12 } - }' - JSON 2: - example: '{ - "set_hosts": { - "machines" : [ - { - "machine_id": 13 - }, - { - "machine_id": 14 - }, - { - "machine_id": 15 - } - ] + ] + } + + OR + + { + "cluster": {"id": 1}, + "hosts": [{"id": 1}, {"id": 2}, {"id": 3}] + } + + OR + + { + "status": "deploy action sent", + "cluster": { + "id": 1, + }, + "hosts": [ + { + "id": 3 } - }' - JSON 3: - example: '{ - "remove_hosts": { - "hosts" : [1] - } - }' - JSON 4: - example: '{ - "remove_hosts": { - "hosts" : "all" - } - }' - JSON 5: - example: '{ - "review" : { - "hosts": [1, 2, 3] - } - }' - JSON 6: - example: '{ - "deploy" : { - "hosts" : [3] - } - }' + ] + } + + + 404: + body: + application/json: + example: | + { + "message": "Cluster with id 'some_id' cannot be found!" + } description: Takes an action for a specific cluster + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /metadata: get: responses: @@ -2756,9 +3143,14 @@ baseUri: http://compass.com application/json: example: | { - "message": "Cluster with id ‘some_id’ cannot be found!" + "message": "Cluster with id 'some_id' cannot be found!" } description: Get metadata of a specific cluster + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /hosts: get: @@ -2787,7 +3179,7 @@ baseUri: http://compass.com } ] }, - …… + ... ] queryParameters: name: @@ -2795,6 +3187,11 @@ baseUri: http://compass.com owner: mac: description: Lists information for all hosts + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /{host_id}: get: responses: @@ -2821,10 +3218,21 @@ baseUri: http://compass.com application/json: example: | { - "message": " Host with id ‘some_id’ cannot be found!" + "message": " Host with id 'some_id' cannot be found!" } description: Lists information for a specified host + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 put: + body: + application/json: + schema: | + { + "name": "update_host_name" + } responses: 200: body: @@ -2839,13 +3247,14 @@ baseUri: http://compass.com application/json: example: | { - "message": " Host with id ‘some_id’ cannot be found!" + "message": " Host with id 'some_id' cannot be found!" } - queryParameters: - name: - example: "host1" - reinstall_os: description: set host properties. + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 delete: responses: 200: @@ -2865,11 +3274,24 @@ baseUri: http://compass.com example: | { "type": "itemNotFound", - "message": " Host with id ‘some_id’ cannot be found!" + "message": " Host with id 'some_id' cannot be found!" } description: Deletes a host (admin only). The host must be not in any cluster. + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /action: post: + body: + application/json: + schema: | + { + "poweron": [1], + "poweroff": [1], + "reset": [1] + } responses: 200: body: @@ -2884,7 +3306,7 @@ baseUri: http://compass.com application/json: example: | { - "message": "The host witch ID “$host_id” cannot be found!" + "message": "The host witch ID '$host_id' cannot be found!" } 400: body: @@ -2893,20 +3315,12 @@ baseUri: http://compass.com { "message": "The host didnot set IPMI info!" } - queryParameters: - JSON 1: - example: '{ - "poweron": null - }' - JSON 2: - example: '{ - "poweroff": null - }' - JSON 3: - example: '{ - "reset": null - }' description: Poweron, poweroff, reset this host by IPMI + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /clusters: get: responses: @@ -2933,9 +3347,14 @@ baseUri: http://compass.com application/json: example: | { - "message": " Host with id ‘some_id’ cannot be found!" + "message": " Host with id 'some_id' cannot be found!" } description: Lists clusters which the host belongs to + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /config: get: responses: @@ -2966,10 +3385,52 @@ baseUri: http://compass.com application/json: example: | { - "message": " Host with id ‘some_id’ cannot be found!" + "message": " Host with id 'some_id' cannot be found!" } description: Lists config information for a specified host + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 put: + body: + application/json: + schema: | + { + "os_config": { + "general": { + "language": "EN", + "timezone": "UTC", + "http_proxy": "http://127.0.0.1:3128", + "https_proxy": "http://127.0.0.1:3128", + "no_proxy": [ + "127.0.0.1", + "compass" + ], + "ntp_server": "127.0.0.1", + "dns_servers": [ + "127.0.0.1" + ], + "domain": "ods.com", + "search_path": [ + "ods.com" + ], + "default_gateway": "127.0.0.1" + }, + "server_credentials": { + "username": "root", + "password": "root" + }, + "partition": { + "/var": { + "max_size": "100G", + "percentage": 10, + "size": "1G" + } + } + } + } responses: 200: body: @@ -2985,12 +3446,52 @@ baseUri: http://compass.com application/json: example: | { - "message": " Host with id ‘some_id’ cannot be found!" + "message": " Host with id 'some_id' cannot be found!" } - queryParameters: - os_config: description: set config properties for a specified host + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 patch: + body: + application/json: + schema: | + { + "os_config": { + "general": { + "language": "EN", + "timezone": "UTC", + "http_proxy": "http://127.0.0.1:3128", + "https_proxy": "http://127.0.0.1:3128", + "no_proxy": [ + "127.0.0.1", + "compass" + ], + "ntp_server": "127.0.0.1", + "dns_servers": [ + "127.0.0.1" + ], + "domain": "ods.com", + "search_path": [ + "ods.com" + ], + "default_gateway": "127.0.0.1" + }, + "server_credentials": { + "username": "root", + "password": "root" + }, + "partition": { + "/var": { + "max_size": "100G", + "percentage": 10, + "size": "1G" + } + } + } + } responses: 200: body: @@ -3004,11 +3505,14 @@ baseUri: http://compass.com application/json: example: | { - "message": " Host with id ‘some_id’ cannot be found!" + "message": " Host with id 'some_id' cannot be found!" } - queryParameters: - os_config: description: update host config properties + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 delete: responses: 200: @@ -3017,7 +3521,7 @@ baseUri: http://compass.com example: | { "os_config": { - … + ... } } 404: @@ -3025,9 +3529,14 @@ baseUri: http://compass.com application/json: example: | { - "message": " Host with id ‘some_id’ cannot be found!" + "message": " Host with id 'some_id' cannot be found!" } description: delete host config + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /state: get: responses: @@ -3047,10 +3556,21 @@ baseUri: http://compass.com application/json: example: | { - "message": " Host with id ‘some_id’ cannot be found!" + "message": " Host with id 'some_id' cannot be found!" } description: get host state + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 put: + body: + application/json: + schema: | + { + "state": "INSTALLING" + } responses: 200: body: @@ -3077,25 +3597,40 @@ baseUri: http://compass.com "message": "---some-error-message---", "updated_at": "---timestamp---" } - 404: body: application/json: example: | { - "message": " Host with id ‘some_id’ cannot be found!" + "message": " Host with id 'some_id' cannot be found!" } - queryParameters: - state: - example: “SUCCESSFUL” / “ERROR” - percentage: - message: - example: “The installation is completed!” / “---some-error-message---” - severity: - example: “INFO” / “ERROR” description: set host state properties + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /network: get: + body: + application/json: + schema: | + [ + { + "interface": "eth0", + "ip": "10.172.20.91", + "subnet_id": 1, + "is_mgmt": "False", + "is_promiscuous": "False" + }, + { + "interface": "eth1", + "ip": "10.172.20.110", + "subnet_id": 1, + "is_mgmt": "False", + "is_promiscuous": "False" + } + ] responses: 200: body: @@ -3124,15 +3659,25 @@ baseUri: http://compass.com application/json: example: | { - "message": " Host with id ‘some_id’ cannot be found!" + "message": " Host with id 'some_id' cannot be found!" } - queryParameters: - interface: - ip: - is_mgmt: - is_promiscuous: description: Lists network info for a specified host + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 post: + body: + application/json: + schema: | + { + "interface": "eth0", + "ip": "10.145.89.152", + "subnet_id": 1, + "is_mgmt": "True", + "is_promiscuous": "False" + } responses: 200: body: @@ -3153,25 +3698,31 @@ baseUri: http://compass.com { "message": " Host with id ‘some_id’ cannot be found!" } - queryParameters: - interface: - example: "eth3" - required: true - ip: - example: "12.140.10.1" - required: true - subnet_id: - example: 3 - required: true - is_mgmt: - example: false - is_promiscuous: - example: true description: Creates an interface config entry + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /{interface}: get: description: list host network information + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 put: + body: + application/json: + schema: | + { + "interface": "eth1", + "ip": "10.145.89.155", + "subnet_id": 1, + "is_mgmt": "True", + "is_promiscuous": "False" + } responses: 200: body: @@ -3190,17 +3741,14 @@ baseUri: http://compass.com application/json: example: | { - "message": " Host with id ‘some_id’ cannot be found!" + "message": " Host with id 'some_id' cannot be found!" } - queryParameters: - interface: - ip: - example: "12.140.10.2" - subnet_id: - example: 4 - is_mgmt: - is_promiscuous: description: set host network properties + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 delete: responses: 200: @@ -3220,9 +3768,14 @@ baseUri: http://compass.com application/json: example: | { - "message": " Host with id ‘some_id’ cannot be found!" + "message": " Host with id 'some_id' cannot be found!" } description: delete a host network + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /proxy/{path}: get: responses: @@ -3244,7 +3797,18 @@ baseUri: http://compass.com URL: example: http://10.145.88.211/api/proxy/users description: proxy get request + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 post: + body: + application/json: + schema: | + { + "url": "http://10.145.88.211/api/proxy/subnets" + } responses: 200: body: @@ -3257,11 +3821,19 @@ baseUri: http://compass.com "name": "10.145.86.0/23", "id": 3 } - queryParameters: - URL: - example: http://10.145.88.211/api/proxy/subnets description: proxy post request + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 put: + body: + application/json: + schema: | + { + "url": "http://10.145.88.211/api/proxy/subnets/3" + } responses: 200: body: @@ -3274,11 +3846,19 @@ baseUri: http://compass.com "name": "10.145.84.0/23", "id": 3 } - queryParameters: - URL: - example: http://10.145.88.211/api/proxy/subnets/3 description: proxy put request + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 patch: + body: + application/json: + schema: | + { + "url": "http://10.145.88.211/api/proxy/subnets/3" + } responses: 200: body: @@ -3296,10 +3876,12 @@ baseUri: http://compass.com }, "id": 3 } - queryParameters: - URL: - example: http://10.145.88.211/api/proxy/switches/3 description: proxy patch request + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 delete: responses: 200: @@ -3322,6 +3904,11 @@ baseUri: http://compass.com URL: example: http://10.145.88.211/api/proxy/switches/3 description: proxy delete request + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /host/networks: get: responses: @@ -3352,6 +3939,11 @@ baseUri: http://compass.com } } description: List all host networks + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /{host_network_id}: get: responses: @@ -3377,8 +3969,20 @@ baseUri: http://compass.com "message": "Cannot find the record in table HostNetwork: {'id': }", } description: List specifig host network info + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 /host-networks/{host_network_id}: put: + body: + application/json: + schema: | + { + "interface": "eth0", + "ip": "10.145.88.10" + } responses: 200: body: @@ -3401,11 +4005,12 @@ baseUri: http://compass.com { message: "Cannot find the record in table HostNetwork: {'id': }" } - queryParameters: - interface: - ip: - example: "10.145.89.159" description: Update a specific host network info. + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0 delete: responses: 200: @@ -3430,6 +4035,11 @@ baseUri: http://compass.com message: "Cannot find the record in table HostNetwork: {'id': }" } description: Delete a host network. + headers: + Access-token: + displayName: X-Auth-Header + required: true + example: $1$fCD2zLIa$hikkNkqDe0qAXgKHDzw0E0