├── Makefile ├── contents ├── metadata.md ├── ip.md ├── volume.md ├── snapshot.md ├── api_general.md ├── image.md ├── account.md ├── security.md └── server.md ├── README.md ├── swagger.json └── apiary.apib /Makefile: -------------------------------------------------------------------------------- 1 | swagger.json: apiary.apib 2 | npm install -g apib2swagger 3 | apib2swagger -i apiary.apib -o swagger.json 4 | -------------------------------------------------------------------------------- /contents/metadata.md: -------------------------------------------------------------------------------- 1 | ### group Metadata 2 | 3 | Resources related to server Metadata available from your C1 servers at `http://169.254.42.42` 4 | 5 | #### C1 server metadata [/conf{?format}] 6 | 7 | + Parameters 8 | + format (optional, string, `json`)... Rendering format 9 | 10 | ##### Serves pimouss metadata [GET] 11 | Serves instance metadata using its own IP address as authentication token. 12 | 13 | + Response 200 (application/json) 14 | 15 | { 16 | "id": "9fc9a037-5eaa-4073-9919-63adbe400ab9", 17 | "name": "Server 2", 18 | "organization": "11111111-1111-4111-8111-111111111111", 19 | "private_ip": "10.42.1.2", 20 | "public_ip": "42.1.2.3", 21 | "ssh_public_keys": [ 22 | "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjHvTHk5QY+JZdCvAep6APwOhZvIimlC4aybrXkGSBxpNeZI1f+AexDuFFWGZPb1y135pgTAc7VXpKD2FU2xd4EwsSTHaBcaBIs1HkhpFScTwN15IfLiefIHgjgveP/8U8AKQvCK7oecz3egjvqNtBDDj9cHySpQ6w5Zq/rtF7Ku8xAfBa78NEQrwaYvdfHqI/1APeoo61MJse+xZH2LVHX1EZp79jRbHny/0WkZifVXudDCmM9aqI3G1ZgWTWvFxHW/HTkSLz1v8OHD1ZPOEjIIKLxCoYE4kukK2eVZVUWFb+iU+u6GunwqWUa6W/g+0NzpEoSHVcasIC88d3tBZD", 23 | "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAutWtCIFyrtcpxBevMyDrNlYabV6cCVPjfWwfuKABofuWwCSX8gP2gSnmjQCdtTwYnz/vAuAXbKxn8pxtUy4c24oRvtwqHpEsFDMpzzMzWtghQFOHEd7NWzda3yDGCaJ8OFD1IkiFad5QNKmOt8nlERBUK9cwbPjzhTnP/o2Odn5nJJ8WySn0/TWwMaHH6hpZTtKMSrIn06Fo5MviPfeZ9Loe8IfgV7llB7ITMFTUKP5vPVvMlPJi8MYeo0AYmhFhbTO5wWj8hK8AJELF9RwMCehcsxjDRxKKbxiv9RL3yIdBH0dftlaNX5rYazRp4zB2BYvfPNjhpTqrY2RdPYAvTw==" 24 | ], 25 | "tags": [], 26 | "volumes": [] 27 | } 28 | 29 | + Response 200 (plain/text) 30 | 31 | NAME='Server 2' 32 | TAGS=0 33 | PUBLIC_IP=42.1.2.3 34 | SSH_PUBLIC_KEYS=2 35 | SSH_PUBLIC_KEYS_0='ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjHvTHk5QY+JZdCvAep6APwOhZvIimlC4aybrXkGSBxpNeZI1f+AexDuFFWGZPb1y135pgTAc7VXpKD2FU2xd4EwsSTHaBcaBIs1HkhpFScTwN15IfLiefIHgjgveP/8U8AKQvCK7oecz3egjvqNtBDDj9cHySpQ6w5Zq/rtF7Ku8xAfBa78NEQrwaYvdfHqI/1APeoo61MJse+xZH2LVHX1EZp79jRbHny/0WkZifVXudDCmM9aqI3G1ZgWTWvFxHW/HTkSLz1v8OHD1ZPOEjIIKLxCoYE4kukK2eVZVUWFb+iU+u6GunwqWUa6W/g+0NzpEoSHVcasIC88d3tBZD' 36 | SSH_PUBLIC_KEYS_1='ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAutWtCIFyrtcpxBevMyDrNlYabV6cCVPjfWwfuKABofuWwCSX8gP2gSnmjQCdtTwYnz/vAuAXbKxn8pxtUy4c24oRvtwqHpEsFDMpzzMzWtghQFOHEd7NWzda3yDGCaJ8OFD1IkiFad5QNKmOt8nlERBUK9cwbPjzhTnP/o2Odn5nJJ8WySn0/TWwMaHH6hpZTtKMSrIn06Fo5MviPfeZ9Loe8IfgV7llB7ITMFTUKP5vPVvMlPJi8MYeo0AYmhFhbTO5wWj8hK8AJELF9RwMCehcsxjDRxKKbxiv9RL3yIdBH0dftlaNX5rYazRp4zB2BYvfPNjhpTqrY2RdPYAvTw==' 37 | PRIVATE_IP=10.42.1.2 38 | VOLUMES=0 39 | ORGANIZATION=11111111-1111-4111-8111-111111111111 40 | ID=9fc9a037-5eaa-4073-9919-63adbe400ab9 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # api.scaleway.com :pencil: 2 | 3 | * Scaleway API documentation on Apiary :new:: http://docs.scaleway.apiary.io/ 4 | * Scaleway API documentation: https://developer.scaleway.com 5 | * API Issues: https://github.com/scaleway/api.scaleway.com/issues 6 | 7 | ## Clients / Libraries 8 | 9 | Type | Language | Author(s) | URL 10 | ----------------------------|--------------------|--------------------------------------------------|--------------- 11 | API client + **CLI** | Golang | [@scaleway](https://github.com/scaleway) | https://github.com/scaleway/scaleway-cli 12 | API client | Python | [@scaleway](https://github.com/scaleway) | https://github.com/scaleway/python-scaleway 13 | API client | Ruby | [@bchatelard](https://github.com/bchatelard) | https://github.com/bchatelard/scaleway-ruby 14 | API client (+ browser) | Node.js/Javascript | [@moul](https://github.com/moul) | https://github.com/moul/node-scaleway 15 | API client + CLI | Golang | [@lalyos](https://github.com/lalyos) | https://github.com/lalyos/onlabs 16 | Vagrant packer + API client | Golang | [@meatballhat](https://github.com/meatballhat) | https://github.com/meatballhat/packer-builder-onlinelabs/ 17 | CLI | Golang | [@nlamirault](https://github.com/nlamirault) | https://github.com/nlamirault/go-scaleway 18 | CLI | Node.js | [@moul](https://github.com/moul) | https://github.com/moul/scaleway-cli-node 19 | Cloudformation plugin | Node.js | [@resin-io](https://github.com/resin-io) | https://github.com/resin-io/onlinelabs-cloudformation 20 | Juju plugin | Python | [@scaleway](https://github.com/scaleway) | https://github.com/scaleway/juju-scaleway 21 | API client | Python | [@adebarbara](https://github.com/adebarbara) | https://github.com/adebarbara/olpy 22 | API client | PHP | [@indigophp](https://github.com/indigophp) | https://github.com/indigophp/scaleway 23 | API client | Perl | [@mgv](https://github.com/mgv) | https://metacpan.org/pod/WebService::Scaleway 24 | Kitchen driver | Ruby | [@rhass](https://github.com/rhass) | https://github.com/rhass/kitchen-scaleway 25 | Docker machine driver | Golang | [@nlamirault](https://github.com/nlamirault) | https://github.com/nlamirault/docker-machine-scaleway 26 | React-native iOS app | Javascript/iOS | [@42am](https://github.com/42am) | https://github.com/42am/scaleway-ios 27 | Terraform plugin | Golang | [@hex-sh](https://github.com/hex-sh) | https://github.com/hex-sh/terraform-provider-scaleway 28 | API client | C | [@QuentinPerez](https://github.com/QuentinPerez) | https://github.com/QuentinPerez/C-Scaleway 29 | -------------------------------------------------------------------------------- /contents/ip.md: -------------------------------------------------------------------------------- 1 | ### group IPs 2 | 3 | A reserved IP address is a static IP address designed for cloud computing. 4 | Reserved IPs address allow you to mask the failure of a server rapidly reallocating the IPs address to another server in your account. 5 | 6 | #### IPs [/ips] 7 | 8 | ##### Create a new IP [POST] 9 | 10 | Create a new reserved IP address 11 | 12 | The response is an object that has a key called `ip`. This key contain a standard `ip` object. 13 | 14 | + Parameters 15 | + organization (required, string, `000a115d-2852-4b0a-9ce8-47f1134ba95a`)... Organization unique identifier 16 | 17 | + Request (application/json) 18 | 19 | + Body 20 | 21 | { 22 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a" 23 | } 24 | 25 | + Response 201 (application/json) 26 | 27 | { 28 | "ip": { 29 | "address": "212.47.226.88", 30 | "id": "b50cd740-892d-47d3-8cbf-88510ef626e7", 31 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 32 | "server": null 33 | } 34 | } 35 | 36 | ##### Retrieves all IPs addresses [GET] 37 | 38 | List all IPs associate with your account 39 | 40 | The response is an object that has a key called `ips`. This key contain an array of ip objects each of which contain the standard `ip` attributes. 41 | 42 | + Response 200 (application/json) 43 | 44 | { 45 | "ips": [ 46 | { 47 | "address": "212.47.226.88", 48 | "id": "b50cd740-892d-47d3-8cbf-88510ef626e7", 49 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 50 | "server": null 51 | } 52 | ] 53 | } 54 | 55 | #### IP [/ips/{ip_id}] 56 | 57 | + Parameters 58 | + ip_id (required, string, `b50cd740-892d-47d3-8cbf-88510ef626e7`)... Ip unique identifier 59 | 60 | ##### Retrieve an IP address [GET] 61 | 62 | List an individual IP address 63 | 64 | The response is an object that has a key called `ip`. This key contain a standard `ip` object. 65 | 66 | + Response 200 (application/json) 67 | 68 | { 69 | "ip": { 70 | "address": "212.47.226.88", 71 | "id": "b50cd740-892d-47d3-8cbf-88510ef626e7", 72 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 73 | "server": null 74 | } 75 | } 76 | 77 | ##### Attach an IP address [PUT] 78 | 79 | Allow you to remap an IP address to another server 80 | 81 | The response is an object that has a key called `ip`. This key contain a standard `ip` object. 82 | 83 | + Request (application/json) 84 | 85 | + Body 86 | 87 | { 88 | "address": "212.47.226.88", 89 | "id": "b50cd740-892d-47d3-8cbf-88510ef626e7", 90 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 91 | "server": "c2d8994f-1582-413e-8d48-c53076db06cc" 92 | } 93 | 94 | 95 | + Response 200 (application/json) 96 | 97 | { 98 | "ip": { 99 | "address": "212.47.226.88", 100 | "id": "b50cd740-892d-47d3-8cbf-88510ef626e7", 101 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 102 | "server": { 103 | "id": "c2d8994f-1582-413e-8d48-c53076db06cc", 104 | "name": "default_server_name - acfb51" 105 | } 106 | } 107 | } 108 | 109 | 110 | ##### Remove an IP address [DELETE] 111 | 112 | Delete a server 113 | 114 | The response code is a 204, which means that the action was successful with no returned body data. 115 | 116 | + Response 204 117 | 118 | 119 | -------------------------------------------------------------------------------- /contents/volume.md: -------------------------------------------------------------------------------- 1 | ### group Volumes 2 | 3 | A Volume abstracts data storage operations for your servers in a flexible manner. `volumes` endpoint allow you to create, list or delete your volumes. 4 | 5 | #### Volumes [/volumes] 6 | 7 | ##### Create a new volume [POST] 8 | 9 | Create a new volume 10 | 11 | The response is an object that has a key called `volume`. This key contain a standard `volume` object. 12 | 13 | + Parameters 14 | + name (required, string, `volume-0-3`)... The volume name 15 | + organization (required, string, `000a115d-2852-4b0a-9ce8-47f1134ba95a`)... Unique organization identifier 16 | + volume_type (required, string, `l_ssd`)... The volume type l_ssd 17 | + size (required, integer, `10000000000`)... The volume size 18 | 19 | + Request (application/json) 20 | 21 | + Body 22 | { 23 | "name": "volume-0-3", 24 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 25 | "size": 10000000000, 26 | "volume_type": "l_ssd" 27 | } 28 | 29 | + Response 201 30 | 31 | + Headers (application/json) 32 | 33 | https://api.cloud.online.net/volumes/c675f420-cfeb-48ff-ba2a-9d2a4dbe3fcd 34 | 35 | + Body 36 | 37 | { 38 | "volume": { 39 | "export_uri": null, 40 | "id": "c675f420-cfeb-48ff-ba2a-9d2a4dbe3fcd", 41 | "name": "volume-0-3", 42 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 43 | "server": null, 44 | "size": 10000000000, 45 | "volume_type": "l_ssd" 46 | } 47 | } 48 | 49 | 50 | ##### Retrieves all volumes [GET] 51 | 52 | List all volumes associate with your account 53 | 54 | The response is an object that has a key called `volumes`. This key contain an array of volume objects each of which contain the standard `volume` attributes. 55 | 56 | + Response 200 (application/json) 57 | 58 | { 59 | "volumes": [ 60 | { 61 | "export_uri": null, 62 | "id": "f929fe39-63f8-4be8-a80e-1e9c8ae22a76", 63 | "name": "volume-0-1", 64 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 65 | "server": null, 66 | "size": 10000000000, 67 | "volume_type": "l_ssd" 68 | }, 69 | { 70 | "export_uri": null, 71 | "id": "0facb6b5-b117-441a-81c1-f28b1d723779", 72 | "name": "volume-0-2", 73 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 74 | "server": null, 75 | "size": 20000000000, 76 | "volume_type": "l_ssd" 77 | } 78 | ] 79 | } 80 | 81 | 82 | #### Volume [/volumes/{volume_id}] 83 | 84 | + Parameters 85 | + volume_id (required, string, `f929fe39-63f8-4be8-a80e-1e9c8ae22a76`)... Volume unique identifier 86 | 87 | ##### Retrieves informations about a volume [GET] 88 | 89 | List an individual volume 90 | 91 | The response is an object that has a key called `volume`. This key contain a standard `volume` object. 92 | 93 | + Response 200 (application/json) 94 | 95 | { 96 | "volume": { 97 | "export_uri": null, 98 | "id": "f929fe39-63f8-4be8-a80e-1e9c8ae22a76", 99 | "name": "volume-0-1", 100 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 101 | "server": null, 102 | "size": 10000000000, 103 | "volume_type": "l_ssd" 104 | } 105 | } 106 | 107 | 108 | ##### Delete a volume [DELETE] 109 | 110 | Delete a volume 111 | 112 | The response code is a 204, which means that the action was successful with no returned body data. 113 | 114 | + Response 204 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /contents/snapshot.md: -------------------------------------------------------------------------------- 1 | ### group Snapshots 2 | 3 | A snapshot is a full-volume copy stored in our secure data centers. 4 | 5 | #### Snapshots [/snapshots] 6 | 7 | ##### Create a snapshot [POST] 8 | 9 | Create a new server 10 | 11 | The response is an object that has a key called `snapshot`. This key contain a standard `snapshot` object. 12 | 13 | + Parameters 14 | + name (required, string, ``)... Human readable snapshot name 15 | + organization (required, string, `000a115d-2852-4b0a-9ce8-47f1134ba95a`)... Unique organization identifier 16 | + volume_id (required, string, `701a8946-ff9d-4579-95e3-1c2c2d0f892d`)... Unique volume identifier 17 | 18 | + Request (application/json) 19 | 20 | + Body 21 | 22 | { 23 | "name": "snapshot-0-1", 24 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 25 | "volume_id": "701a8946-ff9d-4579-95e3-1c2c2d0f892d" 26 | } 27 | 28 | + Response 200 (application/json) 29 | 30 | { 31 | "snapshot": { 32 | "base_volume": { 33 | "id": "701a8946-ff9d-4579-95e3-1c2c2d0f892d", 34 | "name": "vol simple snapshot" 35 | }, 36 | "creation_date": "2014-05-22T12:10:05.596769+00:00", 37 | "id": "f0361e7b-cbe4-4882-a999-945192b7171b", 38 | "name": "snapshot-0-1", 39 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 40 | "size": 10000000000, 41 | "state": "snapshotting", 42 | "volume_type": "l_ssd" 43 | } 44 | } 45 | 46 | 47 | ##### List all snapshots [GET] 48 | 49 | List all snapshots associate with your account 50 | 51 | The response is an object that has a key called `snapshots`. This key contain an array of snapshot objects each of which contain the standard `snapshot` attributes. 52 | 53 | + Response 200 (application/json) 54 | 55 | { 56 | "snapshots": [ 57 | { 58 | "base_volume": { 59 | "id": "09a4184c-733b-43c8-99c3-f1dde30536fe", 60 | "name": "vol simple snapshot" 61 | }, 62 | "creation_date": "2014-05-22T12:11:06.055998+00:00", 63 | "id": "6f418e5f-b42d-4423-a0b5-349c74c454a4", 64 | "name": "snapshot-0-1", 65 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 66 | "size": 10000000000, 67 | "state": "snapshotting", 68 | "volume_type": "l_ssd" 69 | }, 70 | { 71 | "base_volume": { 72 | "id": "09a4184c-733b-43c8-99c3-f1dde30536fe", 73 | "name": "vol simple snapshot" 74 | }, 75 | "creation_date": "2014-05-22T12:13:09.877961+00:00", 76 | "id": "c6ff5501-eb35-44b8-aa01-8777211a830b", 77 | "name": "snapshot-0-2", 78 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 79 | "size": 10000000000, 80 | "state": "snapshotting", 81 | "volume_type": "l_ssd" 82 | } 83 | ] 84 | } 85 | 86 | #### Snapshot [/snapshots/{snapshot_id}] 87 | 88 | + Parameters 89 | + snapshot_id (required, string, `6f418e5f-b42d-4423-a0b5-349c74c454a4`)... Snapshot unique identifier 90 | 91 | ##### Retrieve a snapshot [GET] 92 | 93 | List an individual snapshot 94 | 95 | The response is an object that has a key called `snapshot`. This key contain a standard `snapshot` object. 96 | 97 | + Response 200 (application/json) 98 | 99 | { 100 | "snapshot": { 101 | "base_volume": { 102 | "id": "09a4184c-733b-43c8-99c3-f1dde30536fe", 103 | "name": "vol simple snapshot" 104 | }, 105 | "creation_date": "2014-05-22T12:11:06.055998+00:00", 106 | "id": "6f418e5f-b42d-4423-a0b5-349c74c454a4", 107 | "name": "snapshot-0-1", 108 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 109 | "size": 10000000000, 110 | "state": "snapshotting", 111 | "volume_type": "l_ssd" 112 | } 113 | } 114 | 115 | ##### Update a snapshot [PUT] 116 | 117 | Update details about a snapshot 118 | 119 | The response is an object that has a key called `snapshot`. This key contain a standard `snapshot` object. 120 | 121 | + Parameters 122 | + snapshot_id (required, string, `6f418e5f-b42d-4423-a0b5-349c74c454a4`)... Snapshot unique identifier 123 | + organization (required, string, `000a115d-2852-4b0a-9ce8-47f1134ba95a`)... Organization unique identifier 124 | 125 | + Request (application/json) 126 | 127 | + Body 128 | 129 | { 130 | "organization": "f1350c5d-f1d8-4f9d-b114-6053905578e1" 131 | } 132 | 133 | 134 | + Response 200 (application/json) 135 | 136 | { 137 | "snapshot": { 138 | "base_volume": { 139 | "id": "09a4184c-733b-43c8-99c3-f1dde30536fe", 140 | "name": "vol simple snapshot" 141 | }, 142 | "creation_date": "2014-05-22T12:11:06.055998+00:00", 143 | "id": "6f418e5f-b42d-4423-a0b5-349c74c454a4", 144 | "name": "snapshot-0-1", 145 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 146 | "size": 10000000000, 147 | "state": "snapshotting", 148 | "volume_type": "l_ssd" 149 | } 150 | } 151 | 152 | ##### Remove a snapshot [DELETE] 153 | 154 | Delete a snapshot 155 | 156 | The response code is a 204, which means that the action was successful with no returned body data. 157 | 158 | + Response 204 159 | 160 | -------------------------------------------------------------------------------- /contents/api_general.md: -------------------------------------------------------------------------------- 1 | FORMAT: 1A 2 | 3 | # Scaleway API documentation. 4 | 5 | The Scaleway API allows you to manage servers and resources in a simple, programmatic way using conventional HTTP requests. 6 | All features you will find in the web control panel are also available through the API. 7 | 8 | ## Request and response 9 | 10 | Our api works over https and is accessed from two endpoint: 11 | 12 | - `account.scaleway.com` domain related to account actions 13 | - `api.scaleway.com` domain related to compute actions 14 | 15 | All data is sent and received as json. 16 | 17 | ## Constructing Requests 18 | 19 | Requests are made of two components: 20 | 21 | - Base URL: `https://api.scaleway.com` 22 | - Resource path: `servers` 23 | 24 | To construct a proper request, you need to format the URL as follows: 25 | 26 | `https://api.scaleway.com/{resource}` 27 | 28 | Example: `https://api.scaleway.com/volumes/f929fe39-63f8-4be8-a80e-1e9c8ae22a76` 29 | 30 | The following code is an example request to retrieve detailed informations about a volume 31 | 32 | ``` 33 | % curl -H 'X-Auth-Token: 017ce0ce-20ec-4d4ez-b44c-e561a23481d2c' -H 'Content-Type: application/json' https://api.scaleway.com/volumes/f929fe39-63f8-4be8-a80e-1e9c8ae22a76 -i 34 | 35 | HTTP/1.1 200 OK 36 | Server: nginx 37 | Date: Thu, 22 May 2014 07:55:00 GMT 38 | Content-Type: application/json 39 | Content-Length: 1345 40 | Connection: keep-alive 41 | X-Sentry-ID: None 42 | Strict-Transport-Security: max-age=86400 43 | 44 | { 45 | "volumes": [ 46 | { 47 | "export_uri": null, 48 | "id": "f929fe39-63f8-4be8-a80e-1e9c8ae22a76", 49 | "name": "volume-0-1", 50 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 51 | "server": null, 52 | "size": 10000000000, 53 | "volume_type": "l_ssd" 54 | }, 55 | { 56 | "export_uri": null, 57 | "id": "0facb6b5-b117-441a-81c1-f28b1d723779", 58 | "name": "volume-0-2", 59 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 60 | "server": null, 61 | "size": 20000000000, 62 | "volume_type": "l_ssd" 63 | } 64 | ] 65 | } 66 | ``` 67 | 68 | ## Basic Authentication 69 | 70 | You authenticate to the API by requesting a token. You can create a token from the `account.scaleway.com` domain related to account actions with a POST request on the /tokens HTTP resource. 71 | 72 | Basic Authentication process: 73 | 74 | - Query via POST request the /tokens resource [see here how to](https://developer.scaleway.com/#tokens-tokens-post) 75 | 76 | - Supply an "X-Auth-Token" header followed by the token you get previously, e.g. "4e0b46e4-7c1d-44d4-8ba6-dc5f80694397" 77 | 78 | ``` 79 | curl -X GET -H "X-Auth-Token: 4e0b46e4-7c1d-44d4-8ba6-dc5f80694397" -H "Content-Type: application/json" https://account.scaleway.com/{resources} 80 | ``` 81 | 82 | ## Errors 83 | 84 | We use conventional HTTP response codes to indicate success or failure of an API request. 85 | 86 | In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that resulted from the provided information (e.g., a required parameter is missing), and codes in the 5xx range indicate an error with our servers. 87 | 88 | ### HTTP Status Code Summary 89 | 90 | - `200 OK` - Everything worked as expected. 91 | - `400 Bad Request` - Often missing a required parameter. 92 | - `401 Unauthorized` - No valid API key provided. 93 | - `402 Request Failed` - Parameters were valid but request failed. 94 | - `403 Forbidden` - Insufficient privileges to access requested resource. 95 | - `404 Not Found` - The requested item doesn't exist. 96 | - `50x` Server errors - something went wrong on api domain's end. 97 | 98 | Input and output data must be valid JSON with appropriate Content-Type header set. 99 | 100 | ### Attributes 101 | 102 | - type: 103 | 104 | - `invalid_request_error`: Occur when your request has invalid parameters. 105 | - `invitalid_auth`: Arise when there is a problem of authentication. 106 | - `uknown_resource`: Occur when the resource doesn't exist. 107 | - `authorization_required`: You don't have sufficient right to access the resource. 108 | - `api_error`: API errors use in case of problem with api domain's servers 109 | 110 | - message: 111 | 112 | - A human readable error giving more details about the error 113 | 114 | - fields (Optional): 115 | 116 | - An array of parameters with an human readable message giving more details about the error. 117 | 118 | ### Errors responses example 119 | 120 | + Response 400 (application/json) 121 | 122 | { 123 | "fields": { 124 | "email": [ 125 | "incorrect email address", 126 | "required key not provided" 127 | ], 128 | "firstname": [ 129 | "length of value must be at least 2", 130 | "required key not provided" 131 | ], 132 | "lastname": [ 133 | "length of value must be at least 2", 134 | "required key not provided" 135 | ] 136 | }, 137 | "message": "Validation Error", 138 | "type": "invalid_request_error" 139 | } 140 | 141 | + Response 401 (application/json) 142 | 143 | { 144 | "message": "The header 'X-Auth-Token' is missing", 145 | "type": "invalid_auth" 146 | } 147 | 148 | + Response 403 (application/json) 149 | 150 | { 151 | "message": "The token provided doesn't have the requested permission.", 152 | "type": "authorization_required" 153 | } 154 | 155 | + Response 404 (application/json) 156 | 157 | { 158 | "message": "User not found", 159 | "type": "unknown_resource" 160 | } -------------------------------------------------------------------------------- /contents/image.md: -------------------------------------------------------------------------------- 1 | ### group Images 2 | 3 | Images allow you to create series of servers with predefined configuration. 4 | For instance, you can prepare to scale your serving capacity with a frontend image for an Apache server. 5 | 6 | #### Images [/images] 7 | 8 | ##### Create a new image [POST] 9 | 10 | Create a new image 11 | 12 | The response is an object that has a key called `image`. This key contain a standard `image` object. 13 | 14 | + Parameters 15 | + organization (required, string, `000a115d-2852-4b0a-9ce8-47f1134ba95a`)... Organization unique identifier 16 | + name (required, string, `my_image`)... The image name 17 | + arch (required, string, `arm`)... The architecture type 18 | + root_volume (required, string, `f0361e7b-cbe4-4882-a999-945192b7171b`)... The root volume unique identifier 19 | 20 | + Request (application/json) 21 | 22 | + Body 23 | 24 | { 25 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 26 | "arch": "arm", 27 | "name": "my_image", 28 | "root_volume": "f0361e7b-cbe4-4882-a999-945192b7171b" 29 | } 30 | 31 | + Response 201 (application/json) 32 | 33 | { 34 | "image": { 35 | "arch": "arm", 36 | "creation_date": "2014-05-22T12:56:56.984011+00:00", 37 | "extra_volumes": "[]", 38 | "from_image": null, 39 | "from_server": null, 40 | "id": "98bf3ac2-a1f5-471d-8c8f-1b706ab57ef0", 41 | "marketplace_key": null, 42 | "modification_date": "2014-05-22T12:56:56.984011+00:00", 43 | "name": "my_image", 44 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 45 | "public": false, 46 | "root_volume": { 47 | "id": "f0361e7b-cbe4-4882-a999-945192b7171b", 48 | "name": "vol-0-1" 49 | } 50 | } 51 | } 52 | 53 | ##### List all images [GET] 54 | 55 | List all images associate with your account 56 | 57 | The response is an object that has a key called `images`. This key contain an array of image objects each of which contain the standard `images` attributes. 58 | 59 | + Response 200 (application/json) 60 | 61 | { 62 | "images": [ 63 | { 64 | "arch": "arm", 65 | "creation_date": "2014-05-22T12:56:56.984011+00:00", 66 | "extra_volumes": "[]", 67 | "from_image": null, 68 | "from_server": null, 69 | "id": "98bf3ac2-a1f5-471d-8c8f-1b706ab57ef0", 70 | "marketplace_key": null, 71 | "modification_date": "2014-05-22T12:56:56.984011+00:00", 72 | "name": "my_image", 73 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 74 | "public": false, 75 | "root_volume": { 76 | "id": "f0361e7b-cbe4-4882-a999-945192b7171b", 77 | "name": "vol-0-1" 78 | } 79 | }, 80 | { 81 | "arch": "arm", 82 | "creation_date": "2014-05-22T12:57:22.514299+00:00", 83 | "extra_volumes": "[]", 84 | "from_image": null, 85 | "from_server": null, 86 | "id": "1f73d975-35fc-4365-9ead-8dab7e54152f", 87 | "marketplace_key": null, 88 | "modification_date": "2014-05-22T12:57:22.514299+00:00", 89 | "name": "my_image_1", 90 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 91 | "public": false, 92 | "root_volume": { 93 | "id": "f0361e7b-cbe4-4882-a999-945192b7171b", 94 | "name": "vol-0-2" 95 | } 96 | } 97 | ] 98 | } 99 | 100 | #### Operation on a single image [/images/{image_id}] 101 | 102 | + Parameters 103 | + image_id (required, string, `98bf3ac2-a1f5-471d-8c8f-1b706ab57ef0`)... Image unique identifier 104 | 105 | ##### Retrieves an image [GET] 106 | 107 | List an individual image 108 | 109 | The response is an object that has a key called `image`. This key contain a standard `image` object. 110 | 111 | + Response 200 (application/json) 112 | 113 | { 114 | "image": { 115 | "arch": "arm", 116 | "creation_date": "2014-05-22T12:56:56.984011+00:00", 117 | "extra_volumes": "[]", 118 | "from_image": null, 119 | "from_server": null, 120 | "id": "98bf3ac2-a1f5-471d-8c8f-1b706ab57ef0", 121 | "marketplace_key": null, 122 | "modification_date": "2014-05-22T12:56:56.984011+00:00", 123 | "name": "my_image", 124 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 125 | "public": false, 126 | "root_volume": { 127 | "id": "f0361e7b-cbe4-4882-a999-945192b7171b", 128 | "name": "vol-0-1" 129 | } 130 | } 131 | } 132 | 133 | ##### Update an image [PUT] 134 | 135 | Update details about a image 136 | 137 | The response is an object that has a key called `image`. This key contain a standard `image` object. 138 | 139 | + Request (application/json) 140 | 141 | + Body 142 | 143 | { 144 | "arch": "arm", 145 | "creation_date": "2014-05-22T12:57:22.514299+00:00", 146 | "extra_volumes": "[]", 147 | "from_image": null, 148 | "from_server": null, 149 | "id": "1f73d975-35fc-4365-9ead-8dab7e54152f", 150 | "marketplace_key": null, 151 | "modification_date": "2014-05-22T12:58:42.511040+00:00", 152 | "name": "my_image_old", 153 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 154 | "public": false, 155 | "root_volume": { 156 | "id": "f0361e7b-cbe4-4882-a999-945192b7171b", 157 | "name": "vol-0-1" 158 | } 159 | } 160 | 161 | 162 | + Response 200 (application/json) 163 | 164 | { 165 | "image": { 166 | "arch": "arm", 167 | "creation_date": "2014-05-22T12:56:56.984011+00:00", 168 | "extra_volumes": "[]", 169 | "from_image": null, 170 | "from_server": null, 171 | "id": "98bf3ac2-a1f5-471d-8c8f-1b706ab57ef0", 172 | "marketplace_key": null, 173 | "modification_date": "2014-05-22T13:00:15.462764+00:00", 174 | "name": "my_image_old", 175 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 176 | "public": false, 177 | "root_volume": { 178 | "id": "f0361e7b-cbe4-4882-a999-945192b7171b", 179 | "name": "TOTO" 180 | } 181 | } 182 | } 183 | 184 | 185 | ##### Delete an image [DELETE] 186 | 187 | Delete an image 188 | 189 | The response code is a 204, which means that the action was successful with no returned body data. 190 | 191 | + Response 204 192 | 193 | -------------------------------------------------------------------------------- /contents/account.md: -------------------------------------------------------------------------------- 1 | ### group Tokens 2 | 3 | A Token is an identifier associated with your account. We use this token to authenticate commands in our APIs. 4 | 5 | #### Tokens [/tokens] 6 | 7 | ##### Create a token [POST] 8 | 9 | Authenticates a user against their username, password, and then returns a new Token, which can be used until it expires. 10 | 11 | The response is an object that has a key called `token`. This key contain a standard `token` object. 12 | 13 | + Parameters 14 | + email (required, string, `jsnow@got.com`)... User email 15 | + password (required, string, `winteriscoming`)... User password 16 | + expires (optional, boolean, `false`)... Set if you want a Token wich doesn't expire (default: true) 17 | 18 | + Request (application/json) 19 | 20 | + Body 21 | 22 | { 23 | "email": "jsnow@got.com", 24 | "password": "winteriscoming", 25 | "expires": false 26 | } 27 | 28 | + Response 201 29 | 30 | + Headers (application/json) 31 | 32 | location: https://account.cloud.online.net/tokens/9de8f869-c58e-4aa3-9208-2d4eaff5fa20 33 | 34 | + Body 35 | 36 | { 37 | "token": { 38 | "creation_date": "2014-05-22T08:05:57.556385+00:00", 39 | "expires": null, 40 | "id": "9de8f869-c58e-4aa3-9208-2d4eaff5fa20", 41 | "inherits_user_perms": true, 42 | "permissions": [], 43 | "roles": { 44 | "organization": null, 45 | "role": null 46 | }, 47 | "user_id": "5bea0358-db40-429e-bd82-914686a7e7b9" 48 | } 49 | } 50 | 51 | ##### List all tokens [GET] 52 | 53 | List all Tokens associate with your account 54 | 55 | The response is an object that has a key called `tokens`. This key contain an array of token objects each of which contain the standard `token` attributes. 56 | 57 | + Response 200 (application/json) 58 | 59 | { 60 | { 61 | "tokens": [ 62 | { 63 | "creation_date": "2014-03-13T10:53:11.456319+00:00", 64 | "expires": null, 65 | "id": "4e5570fb-c854-5349-979f-9f51d608d34z", 66 | "inherits_user_perms": true, 67 | "permissions": [], 68 | "roles": { 69 | "organization": null, 70 | "role": null 71 | }, 72 | "user_id": "5bea0358-db40-429e-bd82-953016a7e2s7" 73 | }, 74 | { 75 | "creation_date": "2014-05-19T18:05:47.304433+00:00", 76 | "expires": "2014-05-20T14:05:06.393875+00:00", 77 | "id": "654c95b0-2cf5-41a3-b3cc-733ffba4b4b7", 78 | "inherits_user_perms": true, 79 | "permissions": [], 80 | "roles": { 81 | "organization": null, 82 | "role": null 83 | }, 84 | "user_id": "5bea0358-db40-429e-bd82-953016a7e2s7" 85 | } 86 | ] 87 | } 88 | } 89 | 90 | 91 | #### Token [/tokens/{token_id}] 92 | 93 | + Parameters 94 | + token_id (required, string, `654c95b0-2cf5-41a3-b3cc-733ffba4b4b7`)... Token unique identifier 95 | 96 | ##### Retrieve a token [GET] 97 | 98 | List an individual Token 99 | 100 | The response is an object that has a key called `token`. This key contain a standard `token` object. 101 | 102 | + Response 200 (application/json) 103 | 104 | { 105 | "token": { 106 | "creation_date": "2014-05-22T08:06:51.742826+00:00", 107 | "expires": "2014-05-20T14:05:06.393875+00:00", 108 | "id": "654c95b0-2cf5-41a3-b3cc-733ffba4b4b7", 109 | "inherits_user_perms": true, 110 | "permissions": [], 111 | "roles": { 112 | "organization": null, 113 | "role": null 114 | }, 115 | "user_id": "5bea0358-db40-429e-bd82-953016a7e2s7" 116 | } 117 | } 118 | 119 | 120 | ##### Update a token [PATCH] 121 | 122 | Increase Token expiration time of 30 minutes 123 | 124 | The response is an object that has a key called `token`. This key contain a standard `token` object. 125 | 126 | + Response 200 (application/json) 127 | 128 | { 129 | "token": { 130 | creation_date": "2014-05-22T08:06:51.742826+00:00", 131 | "expires": "2014-05-22T11:18:07.786841+00:00", 132 | "id": "654c95b0-2cf5-41a3-b3cc-733ffba4b4b7", 133 | "inherits_user_perms": true, 134 | "permissions": [], 135 | "roles": { 136 | "organization": null, 137 | "role": null 138 | }, 139 | "user_id": "5bea0358-db40-429e-bd82-953016a7e2s7" 140 | } 141 | } 142 | 143 | 144 | 145 | ##### Remove a token [DELETE] 146 | 147 | Delete an individual token 148 | 149 | The response code is a 204, which means that the action was successful with no returned body data. 150 | 151 | + Response 204 152 | 153 | ### group Organizations 154 | 155 | This resources of API methods allows you to get your Organizations informations 156 | 157 | #### Organizations [/organizations] 158 | 159 | ##### List all organizations [GET] 160 | 161 | List all Organizations associate with your account 162 | 163 | The response is an object that has a key called `organizations`. This key contain an array of organization objects each of which contain the standard `organization` attributes. 164 | 165 | + Response 200 (application/json) 166 | 167 | { 168 | "organizations": [ 169 | { 170 | "id": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 171 | "name": "jsnow@got.com", 172 | "users": [ 173 | { 174 | "email": "jsnow@got.com", 175 | "firstname": "John", 176 | "fullname": "John Snow", 177 | "id": "59a98700-8622-4495-a11a-e1efbfac5972", 178 | "lastname": "Snow", 179 | "organizations": [ 180 | { 181 | "id": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 182 | "name": "jsnow@got.com" 183 | } 184 | ], 185 | "roles": [ 186 | { 187 | "organization": { 188 | "id": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 189 | "name": "jsnow@got.com" 190 | }, 191 | "role": "manager" 192 | } 193 | ], 194 | "ssh_public_keys": [] 195 | } 196 | ] 197 | } 198 | ] 199 | } 200 | 201 | 202 | ### group Users 203 | 204 | #### User [/users/{user_id}] 205 | 206 | + Parameter 207 | + user_id (required, string, `5bea0358-db40-429e-bd82-953016a7e2s7`)... User unique identifier 208 | 209 | ##### Retrieve a user [GET] 210 | 211 | List informations about your user account 212 | 213 | The response is an object that has a key called `user`. This key contain a standard `user` object. 214 | 215 | + Response 200 (application/json) 216 | 217 | 218 | "user": { 219 | "email": "jsnow@got.com", 220 | "firstname": "John", 221 | "fullname": "John Snow", 222 | "id": "5bea0358-db40-429e-bd82-953016a7e2s7", 223 | "lastname": "Snow", 224 | "organizations": null, 225 | "roles": null, 226 | "ssh_public_keys": null 227 | } 228 | 229 | -------------------------------------------------------------------------------- /contents/security.md: -------------------------------------------------------------------------------- 1 | ### group Security groups 2 | 3 | Security groups are like a virtual firewall. With security groups, you can define rules that restrict network access to your servers. 4 | 5 | #### Security Groups [/security_groups] 6 | 7 | ##### Create a security group [POST] 8 | 9 | Create a new security group 10 | 11 | The response is an object that has a key called `security_group`. This key contain a standard `security_group` object. 12 | 13 | + Parameters 14 | + organization (required, string, `000a115d-2852-4b0a-9ce8-47f1134ba95a`)... Organization unique identifier 15 | + name (required, string, `security-group-01`)... The security group name 16 | + description (required, string, `arm`)... The security group description 17 | 18 | + Request (application/json) 19 | 20 | + Body 21 | 22 | { 23 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 24 | "name": "security-group-01", 25 | "description": "Security group 01" 26 | } 27 | 28 | + Response 201 (application/json) 29 | 30 | { 31 | "security_group": { 32 | "description": "Security group 01", 33 | "enable_default_security": true, 34 | "id": "adb5887b-5ab5-445a-ae70-276df95a9852", 35 | "name": "security-group-01", 36 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 37 | "organization_default": false, 38 | "servers": [] 39 | } 40 | } 41 | 42 | ##### List all security groups [GET] 43 | 44 | List all security groups associate with your account 45 | 46 | The response is an object that has a key called `security_groups`. This key contain an array of security group objects each of which contain the standard `security_groups` attributes. 47 | 48 | + Response 200 (application/json) 49 | 50 | { 51 | "security_groups": [ 52 | { 53 | "description": "Base security group", 54 | "enable_default_security": true, 55 | "id": "000a115d-2852-4b1a-9ce8-47f1134ba95a", 56 | "name": "Base group", 57 | "organization": "ecc1c86a-eabb-43a7-9c0a-77e371753c0a", 58 | "organization_default": true, 59 | "servers": [ 60 | { 61 | "id": "b5614869-1967-9ce8-8cd2-801febf9a3f9", 62 | "name": "scw-9b0823" 63 | }, 64 | { 65 | "id": "4167bf23-9ce8-4790-2852-d7c5b86934df", 66 | "name": "scw-9b088e" 67 | } 68 | ] 69 | } 70 | ] 71 | } 72 | 73 | #### Operation on a security groups [/security_groups/{group_id}] 74 | 75 | + Parameters 76 | + group_id (required, string, `000a115d-2852-4b1a-9ce8-47f1134ba95a`)... Security group id unique identifier 77 | 78 | ##### Retrieves a security group [GET] 79 | 80 | List an individual security group 81 | 82 | The response is an object that has a key called `security_group`. This key contain a standard `security_group` object. 83 | 84 | + Response 200 (application/json) 85 | 86 | { 87 | "security_group": { 88 | "description": "Base security group", 89 | "enable_default_security": true, 90 | "id": "000a115d-2852-4b1a-9ce8-47f1134ba95a", 91 | "name": "Base group", 92 | "organization": "ecc1c86a-eabb-43a7-9c0a-77e371753c0a", 93 | "organization_default": true, 94 | "servers": [ 95 | { 96 | "id": "b5614869-1967-9ce8-8cd2-801febf9a3f9", 97 | "name": "scw-9b0823" 98 | }, 99 | { 100 | "id": "4167bf23-9ce8-4790-2852-d7c5b86934df", 101 | "name": "scw-9b088e" 102 | } 103 | ] 104 | } 105 | } 106 | 107 | ##### Update a security group [PUT] 108 | 109 | Update a security group details 110 | 111 | The response is an object that has a key called `security_group`. This key contain a standard `security_group` object. 112 | 113 | + Request (application/json) 114 | 115 | + Body 116 | 117 | { 118 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 119 | "name": "security-group-02", 120 | "description": "Security group 02" 121 | } 122 | 123 | 124 | + Response 200 (application/json) 125 | 126 | { 127 | "security_group": { 128 | "description": "Security group 02", 129 | "enable_default_security": true, 130 | "id": "000a115d-2852-4b1a-9ce8-47f1134ba95a", 131 | "name": "security-group-02", 132 | "organization": "ecc1c86a-eabb-43a7-9c0a-77e371753c0a", 133 | "organization_default": true, 134 | "servers": [ 135 | { 136 | "id": "b5614869-1967-9ce8-8cd2-801febf9a3f9", 137 | "name": "scw-9b0823" 138 | }, 139 | { 140 | "id": "4167bf23-9ce8-4790-2852-d7c5b86934df", 141 | "name": "scw-9b088e" 142 | } 143 | ] 144 | } 145 | } 146 | 147 | 148 | ##### Delete a security group [DELETE] 149 | 150 | Delete a security group 151 | 152 | The response code is a 204, which means that the action was successful with no returned body data. 153 | 154 | + Response 204 155 | 156 | #### Manage rules [/security_groups/{group_id}/rules] 157 | 158 | ##### Create a new rule [POST] 159 | 160 | Create a new rule 161 | 162 | The response is an object that has a key called `rule`. This key contain a standard `rule` object. 163 | 164 | action: "accept" 165 | direction: "outbound" 166 | ip_range: "0.0.0.0/0" 167 | protocol: "ICMP" 168 | 169 | + Parameters 170 | + organization (required, string, `000a115d-2852-4b0a-9ce8-47f1134ba95a`)... Organization unique identifier 171 | + action (required, string, `accept, drop`)... The rule action 172 | + direction (required, string, `outbound, inbound`)... The rule direction 173 | + ip_range (required, string, `0.0.0.0/0`). The IPs range, must be an IPv4 range 174 | + protocol (required, string, `TCP, UDP, ICMP`)... The rule protocol 175 | + dest_port_from (optional, string, `25`)... The port between 1 and 65535 176 | 177 | + Request (application/json) 178 | 179 | + Body 180 | 181 | { 182 | "action": "drop", 183 | "direction": "inbound", 184 | "ip_range": "0.0.0.0/0", 185 | "protocol": "TCP" 186 | } 187 | 188 | + Response 201 (application/json) 189 | 190 | { 191 | "rule": { 192 | "direction": "inbound", 193 | "protocol": "TCP", 194 | "ip_range": "0.0.0.0/0", 195 | "dest_port_from": null, 196 | "action": "drop", 197 | "position": 2, 198 | "dest_port_to": null, 199 | "editable": null, 200 | "id": "ef2136c9-6c21-491a-b238-b38de24726a7" 201 | } 202 | } 203 | 204 | ##### List all rules [GET] 205 | 206 | List all rules for a security group 207 | 208 | The response is an object that has a key called `rules`. This key contain an array of rules for a security group each of which contain the standard `rule` attributes. 209 | 210 | + Response 200 (application/json) 211 | 212 | { 213 | "rules": [ 214 | { 215 | "direction": "outbound", 216 | "protocol": "TCP", 217 | "ip_range": "0.0.0.0/0", 218 | "dest_port_from": 25, 219 | "action": "drop", 220 | "position": 1, 221 | "dest_port_to": null, 222 | "editable": false, 223 | "id": "58909be7-d17c-4ac8-9eb3-23d5fc58abc5" 224 | }, { 225 | "direction": "outbound", 226 | "protocol": "TCP", 227 | "ip_range": "0.0.0.0/0", 228 | "dest_port_from": 465, 229 | "action": "drop", 230 | "position": 2, 231 | "dest_port_to": null, 232 | "editable": false, 233 | "id": "25680235-108b-4bbc-8e25-114303d950bd" 234 | }, { 235 | "direction": "outbound", 236 | "protocol": "TCP", 237 | "ip_range": "0.0.0.0/0", 238 | "dest_port_from": 587, 239 | "action": "drop", 240 | "position": 3, 241 | "dest_port_to": null, 242 | "editable": false, 243 | "id": "4a31b633-118e-4900-bd52-facf1085fc8d" 244 | } 245 | ] 246 | } 247 | 248 | #### Operation on a security rule [/security_groups/{group_id}/rules/{rule_id}] 249 | 250 | 251 | ##### Update a security rule [PUT] 252 | 253 | Update a security rule 254 | 255 | The response is an object that has a key called `rule`. This key contain a standard `rule` object. 256 | 257 | + Request (application/json) 258 | 259 | + Body 260 | 261 | { 262 | "action": "drop", 263 | "direction": "outbound", 264 | "ip_range": "0.0.0.0/0", 265 | "protocol": "TCP" 266 | } 267 | 268 | 269 | + Response 200 (application/json) 270 | 271 | { 272 | "rule": { 273 | "direction": "outbound", 274 | "protocol": "TCP", 275 | "ip_range": "0.0.0.0/0", 276 | "dest_port_from": null, 277 | "action": "drop", 278 | "position": 2, 279 | "dest_port_to": null, 280 | "editable": null, 281 | "id": "ef2136c9-6c21-491a-b238-b38de24726a7" 282 | } 283 | } 284 | 285 | ##### Retrieves a security rule [GET] 286 | 287 | List an individual security rule 288 | 289 | The response is an object that has a key called `rule`. This key contain a standard `rule` object. 290 | 291 | + Response 200 (application/json) 292 | 293 | { 294 | "rule": { 295 | "direction": "outbound", 296 | "protocol": "TCP", 297 | "ip_range": "0.0.0.0/0", 298 | "dest_port_from": null, 299 | "action": "drop", 300 | "position": 2, 301 | "dest_port_to": null, 302 | "editable": null, 303 | "id": "ef2136c9-6c21-491a-b238-b38de24726a7" 304 | } 305 | } 306 | 307 | ##### Delete a security rule [DELETE] 308 | 309 | Delete and deactivate a security rule 310 | 311 | The response code is a 204, which means that the action was successful with no returned body data. 312 | 313 | + Response 204 314 | 315 | -------------------------------------------------------------------------------- /contents/server.md: -------------------------------------------------------------------------------- 1 | ### group Servers 2 | 3 | A Server is a dedicated machine for your own use. `servers` endpoint allow you to create, list or delete your servers. 4 | 5 | #### Servers [/servers] 6 | 7 | ##### Create a new server [POST] 8 | 9 | Create a new server 10 | 11 | The response is an object that has a key called `server`. This key contain a standard `server` object. 12 | 13 | + Parameters 14 | 15 | + name (required, string, `my_server`)... The server name 16 | + organization (required, string, `000a115d-2852-4b0a-9ce8-47f1134ba95a`)... Organization unique identifier 17 | + image (required, string, `85917034-46b0-4cc5-8b48-f0a2245e357e`)... Image unique identifier 18 | + volumes (required, list, `volumes: {1: {name: "vol_demo", organization: "ecc1c86a-eabb-43a7-9c0a-77e371753c0a", size: 10000000000, volume_type: "l_sdd"`)... A list of volumes identifier to be attached to the server 19 | + tags (optional, list, `[test, www]`)... A list of tags 20 | 21 | + Request 22 | 23 | + Body 24 | 25 | { 26 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 27 | "name": "my_server", 28 | "image": "85917034-46b0-4cc5-8b48-f0a2245e357e", 29 | "tags": ["test", "www"] 30 | } 31 | 32 | + Response 201 (application/json) 33 | 34 | + Header 35 | 36 | location: https://api.cloud.online.net/servers/3cb18e2d-f4f7-48f7-b452-59b88ae8fc8c 37 | 38 | + Body 39 | 40 | { 41 | "server": { 42 | "bootscript": null, 43 | "dynamic_public_ip": false, 44 | "id": "3cb18e2d-f4f7-48f7-b452-59b88ae8fc8c", 45 | "image": { 46 | "id": "85917034-46b0-4cc5-8b48-f0a2245e357e", 47 | "name": "ubuntu working" 48 | }, 49 | "name": "my_server", 50 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 51 | "private_ip": null, 52 | "public_ip": null, 53 | "state": "running", 54 | "tags": [ 55 | "test", 56 | "www" 57 | ], 58 | "volumes": { 59 | "0": { 60 | "export_uri": null, 61 | "id": "d9257116-6919-49b4-a420-dcfdff51fcb1", 62 | "name": "vol simple snapshot", 63 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 64 | "server": { 65 | "id": "3cb18e2d-f4f7-48f7-b452-59b88ae8fc8c", 66 | "name": "my_server" 67 | }, 68 | "size": 10000000000, 69 | "volume_type": "l_ssd" 70 | } 71 | } 72 | } 73 | } 74 | 75 | ##### List all servers [GET] 76 | 77 | List all servers associate with your account 78 | 79 | The response is an object that has a key called `servers`. This key contain an array of server objects each of which contain the standard `server` attributes. 80 | 81 | + Response 200 (application/json) 82 | 83 | { 84 | "servers": [ 85 | { 86 | "bootscript": null, 87 | "dynamic_public_ip": false, 88 | "id": "741db378-6b87-46d4-a8c5-4e46a09ab1f8", 89 | "image": { 90 | "id": "85917034-46b0-4cc5-8b48-f0a2245e357e", 91 | "name": "ubuntu working" 92 | }, 93 | "name": "my_server", 94 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 95 | "private_ip": null, 96 | "public_ip": null, 97 | "state": "running", 98 | "tags": [ 99 | "test", 100 | "www" 101 | ], 102 | "volumes": { 103 | "0": { 104 | "export_uri": null, 105 | "id": "c1eb8f3a-4f0b-4b95-a71c-93223e457f5a", 106 | "name": "vol simple snapshot", 107 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 108 | "server": { 109 | "id": "741db378-6b87-46d4-a8c5-4e46a09ab1f8", 110 | "name": "my_server" 111 | }, 112 | "size": 10000000000, 113 | "volume_type": "l_ssd" 114 | } 115 | } 116 | }, 117 | { 118 | "bootscript": null, 119 | "dynamic_public_ip": false, 120 | "id": "0e9f85af-b6aa-401e-a00d-484f832c5024", 121 | "image": { 122 | "id": "85917034-46b0-4cc5-8b48-f0a2245e357e", 123 | "name": "ubuntu working" 124 | }, 125 | "name": "my_server", 126 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 127 | "private_ip": null, 128 | "public_ip": null, 129 | "state": "running", 130 | "tags": [ 131 | "test", 132 | "www" 133 | ], 134 | "volumes": { 135 | "0": { 136 | "export_uri": null, 137 | "id": "fb09bb31-ecd9-4dff-8b55-b6e45715199d", 138 | "name": "vol simple snapshot", 139 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 140 | "server": { 141 | "id": "0e9f85af-b6aa-401e-a00d-484f832c5024", 142 | "name": "my_server" 143 | }, 144 | "size": 10000000000, 145 | "volume_type": "l_ssd" 146 | } 147 | } 148 | } 149 | ] 150 | } 151 | 152 | 153 | #### Server [/servers/{server_id}] 154 | 155 | + Parameters 156 | 157 | + server_id (required, string, `741db378-6b87-46d4-a8c5-4e46a09ab1f8`)... Server unique identifier 158 | 159 | ##### Retrieve a server [GET] 160 | 161 | List an individual server 162 | 163 | The response is an object that has a key called `server`. This key contain a standard `server` object. 164 | 165 | + Response 200 (application/json) 166 | 167 | { 168 | "server": { 169 | "bootscript": null, 170 | "dynamic_public_ip": false, 171 | "id": "741db378-6b87-46d4-a8c5-4e46a09ab1f8", 172 | "image": { 173 | "id": "85917034-46b0-4cc5-8b48-f0a2245e357e", 174 | "name": "ubuntu working" 175 | }, 176 | "name": "my_server", 177 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 178 | "private_ip": null, 179 | "public_ip": null, 180 | "state": "running", 181 | "tags": [ 182 | "test", 183 | "www" 184 | ], 185 | "volumes": { 186 | "0": { 187 | "export_uri": null, 188 | "id": "c1eb8f3a-4f0b-4b95-a71c-93223e457f5a", 189 | "name": "vol simple snapshot", 190 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 191 | "server": { 192 | "id": "741db378-6b87-46d4-a8c5-4e46a09ab1f8", 193 | "name": "my_server" 194 | }, 195 | "size": 10000000000, 196 | "volume_type": "l_ssd" 197 | } 198 | } 199 | } 200 | } 201 | 202 | ##### Update a server [PUT] 203 | 204 | Update details about a server 205 | 206 | The response is an object that has a key called `server`. This key contain a standard `server` object. 207 | 208 | + Request 209 | 210 | + Body 211 | 212 | { 213 | "bootscript": null, 214 | "dynamic_public_ip": false, 215 | "id": "741db378-6b87-46d4-a8c5-4e46a09ab1f8", 216 | "image": { 217 | "id": "85917034-46b0-4cc5-8b48-f0a2245e357e", 218 | "name": "ubuntu working" 219 | }, 220 | "name": "my_server", 221 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 222 | "private_ip": null, 223 | "public_ip": null, 224 | "state": "running", 225 | "tags": [ 226 | "test", 227 | "www", 228 | "new" 229 | ], 230 | "volumes": { 231 | "0": { 232 | "export_uri": null, 233 | "id": "c39b49f4-1804-4d03-96b4-952896b0918e", 234 | "name": "vol simple snapshot", 235 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 236 | "server": { 237 | "id": "345b862b-9198-4633-94a5-3f0307702652", 238 | "name": "my_server" 239 | }, 240 | "size": 10000000000, 241 | "volume_type": "l_ssd" 242 | } 243 | } 244 | } 245 | 246 | 247 | + Response 200 (application/json) 248 | 249 | { 250 | "server": { 251 | "bootscript": null, 252 | "dynamic_public_ip": false, 253 | "id": "741db378-6b87-46d4-a8c5-4e46a09ab1f8", 254 | "image": { 255 | "id": "85917034-46b0-4cc5-8b48-f0a2245e357e", 256 | "name": "ubuntu working" 257 | }, 258 | "name": "my_server", 259 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 260 | "private_ip": null, 261 | "public_ip": null, 262 | "state": "running", 263 | "tags": [ 264 | "prod", 265 | "www", 266 | "new" 267 | ], 268 | "volumes": { 269 | "0": { 270 | "export_uri": null, 271 | "id": "c1eb8f3a-4f0b-4b95-a71c-93223e457f5a", 272 | "name": "vol simple snapshot", 273 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 274 | "server": { 275 | "id": "741db378-6b87-46d4-a8c5-4e46a09ab1f8", 276 | "name": "my_server" 277 | }, 278 | "size": 10000000000, 279 | "volume_type": "l_ssd" 280 | } 281 | } 282 | } 283 | } 284 | 285 | ##### Remove a server [DELETE] 286 | 287 | Delete a server 288 | 289 | The response code is a 204, which means that the action was successful with no returned body data. 290 | 291 | + Response 204 292 | 293 | 294 | #### Actions [/servers/{server_id}/action] 295 | 296 | A collection of actions to be applied on a server 297 | 298 | + Parameters 299 | 300 | + server_id (required, string, `741db378-6b87-46d4-a8c5-4e46a09ab1f8`)... Server unique identifier 301 | 302 | ##### List all actions [GET] 303 | 304 | List all actions available for the secified server 305 | 306 | The response is an object that has a key called `actions`. This key contain an array of action 307 | 308 | + Response 200 (application/json) 309 | 310 | { 311 | "actions": [ 312 | "poweron", 313 | "poweroff", 314 | "reboot" 315 | ] 316 | } 317 | 318 | ##### Execute an action [POST] 319 | 320 | Execute an action on a server 321 | 322 | The response is an object that has a key called `task`. This key contain a standard `task` object. 323 | 324 | + Parameters 325 | 326 | + server_id (required, string, `741db378-6b87-46d4-a8c5-4e46a09ab1f8`)... Server unique identifier 327 | + action (required, string, `poweron`)... Action to execute 328 | 329 | + Request 330 | 331 | + Body 332 | 333 | { 334 | "action": "poweroff" 335 | } 336 | 337 | + Response 202 (application/json) 338 | 339 | + Header 340 | 341 | location: https://api.cloud.online.net/tasks/a8a1775c-0dda-4f52-87b2-4e8101d68d6e 342 | 343 | + Body 344 | 345 | { 346 | "task": { 347 | "description": "server_poweroff", 348 | "href_from": "/servers/741db378-6b87-46d4-a8c5-4e46a09ab1f8/action", 349 | "id": "a8a1775c-0dda-4f52-87b2-4e8101d68d6e", 350 | "progress": "0", 351 | "status": "pending" 352 | } 353 | } 354 | 355 | -------------------------------------------------------------------------------- /swagger.json: -------------------------------------------------------------------------------- 1 | { 2 | "swagger": "2.0", 3 | "info": { 4 | "title": "Scaleway API", 5 | "version": "", 6 | "description": "The Scaleway API allows you to manage servers and resources in a simple, programmatic way using conventional HTTP requests. \nAll features you will find in the web control panel are also available through the API.\n\n## Request and response\n\nOur api works over https and is accessed from two endpoint:\n\n- `account.scaleway.com` domain related to account actions\n\n- `api.scaleway.com` domain related to compute actions\n\nAll data is sent and received as json.\n\n## Constructing Requests\n\nRequests are made of two components:\n\n- Base URL: `https://api.scaleway.com`\n\n- Resource path: `servers`\n\nTo construct a proper request, you need to format the URL as follows:\n\n`https://api.scaleway.com/{resource}`\n\nExample: `https://api.scaleway.com/volumes/f929fe39-63f8-4be8-a80e-1e9c8ae22a76`\n\nThe following code is an example request to retrieve detailed informations about a volume\n\n```\n% curl -H 'X-Auth-Token: 017ce0ce-20ec-4d4ez-b44c-e561a23481d2c' -H 'Content-Type: application/json' https://api.scaleway.com/volumes/f929fe39-63f8-4be8-a80e-1e9c8ae22a76 -i\n\nHTTP/1.1 200 OK\nServer: nginx\nDate: Thu, 22 May 2014 07:55:00 GMT\nContent-Type: application/json\nContent-Length: 1345\nConnection: keep-alive\nX-Sentry-ID: None\nStrict-Transport-Security: max-age=86400\n\n{\n \"volumes\": [\n {\n \"export_uri\": null,\n \"id\": \"f929fe39-63f8-4be8-a80e-1e9c8ae22a76\",\n \"name\": \"volume-0-1\",\n \"organization\": \"000a115d-2852-4b0a-9ce8-47f1134ba95a\",\n \"server\": null,\n \"size\": 10000000000,\n \"volume_type\": \"l_ssd\"\n },\n {\n \"export_uri\": null,\n \"id\": \"0facb6b5-b117-441a-81c1-f28b1d723779\",\n \"name\": \"volume-0-2\",\n \"organization\": \"000a115d-2852-4b0a-9ce8-47f1134ba95a\",\n \"server\": null,\n \"size\": 20000000000,\n \"volume_type\": \"l_ssd\"\n }\n ]\n}\n```\n\n## Basic Authentication\n\nYou authenticate to the API by requesting a token. You can create a token from the `account.scaleway.com` domain related to account actions with a POST request on the /tokens HTTP resource.\n\nBasic Authentication process:\n\n- Query via POST request the /tokens resource [see here how to](https://developer.scaleway.com/#tokens-tokens-post)\n\n- Supply an \"X-Auth-Token\" header followed by the token you get previously, e.g. \"4e0b46e4-7c1d-44d4-8ba6-dc5f80694397\"\n\n```\ncurl -X GET -H \"X-Auth-Token: 4e0b46e4-7c1d-44d4-8ba6-dc5f80694397\" -H \"Content-Type: application/json\" https://account.scaleway.com/{resources}\n```\n\n## Errors\n\nWe use conventional HTTP response codes to indicate success or failure of an API request.\n\nIn general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that resulted from the provided information (e.g., a required parameter is missing), and codes in the 5xx range indicate an error with our servers.\n\n### HTTP Status Code Summary\n\n- `200 OK` - Everything worked as expected.\n\n- `400 Bad Request` - Often missing a required parameter.\n\n- `401 Unauthorized` - No valid API key provided.\n\n- `402 Request Failed` - Parameters were valid but request failed.\n\n- `403 Forbidden` - Insufficient privileges to access requested resource.\n\n- `404 Not Found` - The requested item doesn't exist.\n\n- `50x` Server errors - something went wrong on api domain's end.\n\nInput and output data must be valid JSON with appropriate Content-Type header set.\n\n### Attributes\n\n- type:\n \n - `invalid_request_error`: Occur when your request has invalid parameters.\n - `invitalid_auth`: Arise when there is a problem of authentication.\n - `uknown_resource`: Occur when the resource doesn't exist.\n - `authorization_required`: You don't have sufficient right to access the resource.\n - `api_error`: API errors use in case of problem with api domain's servers\n\n- message:\n \n - A human readable error giving more details about the error\n\n- fields (Optional):\n\n - An array of parameters with an human readable message giving more details about the error.\n\n### Errors responses example \n\n+ Response 400 (application/json)\n\n {\n \"fields\": {\n \"email\": [\n \"incorrect email address\",\n \"required key not provided\"\n ],\n \"firstname\": [\n \"length of value must be at least 2\",\n \"required key not provided\"\n ],\n \"lastname\": [\n \"length of value must be at least 2\",\n \"required key not provided\"\n ]\n },\n \"message\": \"Validation Error\",\n \"type\": \"invalid_request_error\"\n }\n\n+ Response 401 (application/json)\n\n {\n \"message\": \"The header 'X-Auth-Token' is missing\",\n \"type\": \"invalid_auth\"\n }\n\n+ Response 403 (application/json)\n\n {\n \"message\": \"The token provided doesn't have the requested permission.\",\n \"type\": \"authorization_required\"\n }\n\n+ Response 404 (application/json)\n\n {\n \"message\": \"User not found\",\n \"type\": \"unknown_resource\"\n }\n \n \n" 7 | }, 8 | "host": "api.scaleway.com", 9 | "basePath": "/", 10 | "schemes": [ 11 | "https" 12 | ], 13 | "paths": { 14 | "/tokens": { 15 | "post": { 16 | "responses": { 17 | "201": { 18 | "description": "Created", 19 | "headers": {}, 20 | "examples": {} 21 | } 22 | }, 23 | "summary": "Create a token", 24 | "description": "Authenticates a user against their username, password, and then returns a new Token, which can be used until it expires.\n\nThe response is an object that has a key called `token`. This key contain a standard `token` object.\n\n", 25 | "tags": [ 26 | "Tokens" 27 | ], 28 | "parameters": [ 29 | { 30 | "name": "body", 31 | "in": "body", 32 | "schema": { 33 | "type": "object", 34 | "required": [], 35 | "properties": { 36 | "email": { 37 | "type": "string" 38 | }, 39 | "password": { 40 | "type": "string" 41 | }, 42 | "expires": { 43 | "type": "" 44 | } 45 | } 46 | } 47 | } 48 | ] 49 | }, 50 | "get": { 51 | "responses": { 52 | "200": { 53 | "description": "OK", 54 | "headers": {}, 55 | "examples": {} 56 | } 57 | }, 58 | "summary": "List all tokens", 59 | "description": "List all Tokens associate with your account\n\nThe response is an object that has a key called `tokens`. This key contain an array of token objects each of which contain the standard `token` attributes.\n\n", 60 | "tags": [ 61 | "Tokens" 62 | ], 63 | "parameters": [] 64 | } 65 | }, 66 | "/tokens/{token_id}": { 67 | "get": { 68 | "responses": { 69 | "200": { 70 | "description": "OK", 71 | "headers": {}, 72 | "examples": {} 73 | } 74 | }, 75 | "summary": "Retrieve a token", 76 | "description": "List an individual Token\n\nThe response is an object that has a key called `token`. This key contain a standard `token` object.\n\n", 77 | "tags": [ 78 | "Tokens" 79 | ], 80 | "parameters": [ 81 | { 82 | "name": "token_id", 83 | "in": "path", 84 | "description": "Token unique identifier", 85 | "required": true, 86 | "type": "string" 87 | } 88 | ] 89 | }, 90 | "patch": { 91 | "responses": { 92 | "200": { 93 | "description": "OK", 94 | "headers": {}, 95 | "examples": {} 96 | } 97 | }, 98 | "summary": "Update a token", 99 | "description": "Increase Token expiration time of 30 minutes\n\nThe response is an object that has a key called `token`. This key contain a standard `token` object.\n\n", 100 | "tags": [ 101 | "Tokens" 102 | ], 103 | "parameters": [ 104 | { 105 | "name": "token_id", 106 | "in": "path", 107 | "description": "Token unique identifier", 108 | "required": true, 109 | "type": "string" 110 | }, 111 | { 112 | "name": "body", 113 | "in": "body", 114 | "schema": { 115 | "type": "object", 116 | "required": [], 117 | "properties": { 118 | "expires": { 119 | "type": "" 120 | }, 121 | "description": { 122 | "type": "string" 123 | } 124 | } 125 | } 126 | } 127 | ] 128 | }, 129 | "delete": { 130 | "responses": { 131 | "204": { 132 | "description": "No Content", 133 | "headers": {}, 134 | "examples": {} 135 | } 136 | }, 137 | "summary": "Remove a token", 138 | "description": "Delete an individual token\n\nThe response code is a 204, which means that the action was successful with no returned body data.\n\n", 139 | "tags": [ 140 | "Tokens" 141 | ], 142 | "parameters": [ 143 | { 144 | "name": "token_id", 145 | "in": "path", 146 | "description": "Token unique identifier", 147 | "required": true, 148 | "type": "string" 149 | } 150 | ] 151 | } 152 | }, 153 | "/organizations": { 154 | "get": { 155 | "responses": { 156 | "200": { 157 | "description": "OK", 158 | "headers": {}, 159 | "examples": {} 160 | } 161 | }, 162 | "summary": "List all organizations", 163 | "description": "List all Organizations associate with your account\n\nThe response is an object that has a key called `organizations`. This key contain an array of organization objects each of which contain the standard `organization` attributes.\n\n", 164 | "tags": [ 165 | "Organizations" 166 | ], 167 | "parameters": [] 168 | } 169 | }, 170 | "/users/{user_id}": { 171 | "get": { 172 | "responses": { 173 | "200": { 174 | "description": "OK", 175 | "headers": {}, 176 | "examples": {} 177 | } 178 | }, 179 | "summary": "Retrieve a user", 180 | "description": "List informations about your user account\n\nThe response is an object that has a key called `user`. This key contain a standard `user` object.\n\n", 181 | "tags": [ 182 | "Users" 183 | ], 184 | "parameters": [ 185 | { 186 | "name": "user_id", 187 | "in": "path", 188 | "description": "User unique identifier", 189 | "required": true, 190 | "type": "string" 191 | } 192 | ] 193 | } 194 | }, 195 | "/servers": { 196 | "post": { 197 | "responses": { 198 | "201": { 199 | "description": "Created", 200 | "headers": {}, 201 | "examples": {} 202 | } 203 | }, 204 | "summary": "Create a new server", 205 | "description": "Create a new server\n\nThe response is an object that has a key called `server`. This key contain a standard `server` object.\n\n", 206 | "tags": [ 207 | "Servers" 208 | ], 209 | "parameters": [ 210 | { 211 | "name": "body", 212 | "in": "body", 213 | "schema": { 214 | "type": "object", 215 | "required": [], 216 | "properties": { 217 | "name": { 218 | "type": "string" 219 | }, 220 | "organization": { 221 | "type": "string" 222 | }, 223 | "image": { 224 | "type": "string" 225 | }, 226 | "volumes": { 227 | "type": "array" 228 | }, 229 | "tags": { 230 | "type": "array" 231 | } 232 | } 233 | } 234 | } 235 | ] 236 | }, 237 | "get": { 238 | "responses": { 239 | "200": { 240 | "description": "OK", 241 | "headers": {}, 242 | "examples": {} 243 | } 244 | }, 245 | "summary": "List all servers", 246 | "description": "List all servers associate with your account\n\nThe response is an object that has a key called `servers`. This key contain an array of server objects each of which contain the standard `server` attributes.\n\n", 247 | "tags": [ 248 | "Servers" 249 | ], 250 | "parameters": [] 251 | } 252 | }, 253 | "/servers/{server_id}": { 254 | "get": { 255 | "responses": { 256 | "200": { 257 | "description": "OK", 258 | "headers": {}, 259 | "examples": {} 260 | } 261 | }, 262 | "summary": "Retrieve a server", 263 | "description": "List an individual server\n\nThe response is an object that has a key called `server`. This key contain a standard `server` object.\n\n", 264 | "tags": [ 265 | "Servers" 266 | ], 267 | "parameters": [ 268 | { 269 | "name": "server_id", 270 | "in": "path", 271 | "description": "Server unique identifier", 272 | "required": true, 273 | "type": "string" 274 | } 275 | ] 276 | }, 277 | "put": { 278 | "responses": { 279 | "200": { 280 | "description": "OK", 281 | "headers": {}, 282 | "examples": {} 283 | } 284 | }, 285 | "summary": "Update a server", 286 | "description": "Update details about a server\n\nThe response is an object that has a key called `server`. This key contain a standard `server` object.\n\n", 287 | "tags": [ 288 | "Servers" 289 | ], 290 | "parameters": [ 291 | { 292 | "name": "server_id", 293 | "in": "path", 294 | "description": "Server unique identifier", 295 | "required": true, 296 | "type": "string" 297 | } 298 | ] 299 | }, 300 | "delete": { 301 | "responses": { 302 | "204": { 303 | "description": "No Content", 304 | "headers": {}, 305 | "examples": {} 306 | } 307 | }, 308 | "summary": "Remove a server", 309 | "description": "Delete a server\n\nThe response code is a 204, which means that the action was successful with no returned body data.\n\n", 310 | "tags": [ 311 | "Servers" 312 | ], 313 | "parameters": [ 314 | { 315 | "name": "server_id", 316 | "in": "path", 317 | "description": "Server unique identifier", 318 | "required": true, 319 | "type": "string" 320 | } 321 | ] 322 | } 323 | }, 324 | "/servers/{server_id}/action": { 325 | "get": { 326 | "responses": { 327 | "200": { 328 | "description": "OK", 329 | "headers": {}, 330 | "examples": {} 331 | } 332 | }, 333 | "summary": "List all actions", 334 | "description": "List all actions available for the secified server\n\nThe response is an object that has a key called `actions`. This key contain an array of action\n\n", 335 | "tags": [ 336 | "Servers" 337 | ], 338 | "parameters": [ 339 | { 340 | "name": "server_id", 341 | "in": "path", 342 | "description": "Server unique identifier", 343 | "required": true, 344 | "type": "string" 345 | } 346 | ] 347 | }, 348 | "post": { 349 | "responses": { 350 | "202": { 351 | "description": "Accepted", 352 | "headers": {}, 353 | "examples": {} 354 | } 355 | }, 356 | "summary": "Execute an action", 357 | "description": "Execute an action on a server\n\nThe response is an object that has a key called `task`. This key contain a standard `task` object.\n\n", 358 | "tags": [ 359 | "Servers" 360 | ], 361 | "parameters": [ 362 | { 363 | "name": "server_id", 364 | "in": "path", 365 | "description": "Server unique identifier", 366 | "required": true, 367 | "type": "string" 368 | }, 369 | { 370 | "name": "server_id", 371 | "in": "path", 372 | "description": "Server unique identifier", 373 | "required": true, 374 | "type": "string" 375 | }, 376 | { 377 | "name": "action", 378 | "in": "body", 379 | "description": "Action to execute", 380 | "required": true, 381 | "type": "string" 382 | } 383 | ] 384 | } 385 | }, 386 | "/volumes": { 387 | "post": { 388 | "responses": { 389 | "201": { 390 | "description": "Created", 391 | "headers": {}, 392 | "examples": {} 393 | } 394 | }, 395 | "summary": "Create a new volume", 396 | "description": "Create a new volume\n\nThe response is an object that has a key called `volume`. This key contain a standard `volume` object.\n\n", 397 | "tags": [ 398 | "Volumes" 399 | ], 400 | "parameters": [ 401 | { 402 | "name": "body", 403 | "in": "body", 404 | "schema": { 405 | "type": "object", 406 | "required": [], 407 | "properties": { 408 | "name": { 409 | "type": "string" 410 | }, 411 | "organization": { 412 | "type": "string" 413 | }, 414 | "volume_type: `l_ssd`": { 415 | "type": "string" 416 | }, 417 | "size": { 418 | "type": "number" 419 | } 420 | } 421 | } 422 | } 423 | ] 424 | }, 425 | "get": { 426 | "responses": { 427 | "200": { 428 | "description": "OK", 429 | "headers": {}, 430 | "examples": {} 431 | } 432 | }, 433 | "summary": "Retrieves all volumes", 434 | "description": "List all volumes associate with your account\n\nThe response is an object that has a key called `volumes`. This key contain an array of volume objects each of which contain the standard `volume` attributes.\n\n", 435 | "tags": [ 436 | "Volumes" 437 | ], 438 | "parameters": [] 439 | } 440 | }, 441 | "/volumes/{volume_id}": { 442 | "get": { 443 | "responses": { 444 | "200": { 445 | "description": "OK", 446 | "headers": {}, 447 | "examples": {} 448 | } 449 | }, 450 | "summary": "Retrieves informations about a volume", 451 | "description": "List an individual volume\n\nThe response is an object that has a key called `volume`. This key contain a standard `volume` object.\n\n", 452 | "tags": [ 453 | "Volumes" 454 | ], 455 | "parameters": [ 456 | { 457 | "name": "volume_id", 458 | "in": "path", 459 | "description": "Volume unique identifier", 460 | "required": true, 461 | "type": "string" 462 | } 463 | ] 464 | }, 465 | "delete": { 466 | "responses": { 467 | "204": { 468 | "description": "No Content", 469 | "headers": {}, 470 | "examples": {} 471 | } 472 | }, 473 | "summary": "Delete a volume", 474 | "description": "Delete a volume\n\nThe response code is a 204, which means that the action was successful with no returned body data.\n\n", 475 | "tags": [ 476 | "Volumes" 477 | ], 478 | "parameters": [ 479 | { 480 | "name": "volume_id", 481 | "in": "path", 482 | "description": "Volume unique identifier", 483 | "required": true, 484 | "type": "string" 485 | } 486 | ] 487 | } 488 | }, 489 | "/snapshots": { 490 | "post": { 491 | "responses": { 492 | "200": { 493 | "description": "OK", 494 | "headers": {}, 495 | "examples": {} 496 | } 497 | }, 498 | "summary": "Create a snapshot", 499 | "description": "Create a new server\n\nThe response is an object that has a key called `snapshot`. This key contain a standard `snapshot` object.\n\n", 500 | "tags": [ 501 | "Snapshots" 502 | ], 503 | "parameters": [ 504 | { 505 | "name": "body", 506 | "in": "body", 507 | "schema": { 508 | "type": "object", 509 | "required": [], 510 | "properties": { 511 | "name": { 512 | "type": "string" 513 | }, 514 | "organization": { 515 | "type": "string" 516 | }, 517 | "volume_id": { 518 | "type": "string" 519 | } 520 | } 521 | } 522 | } 523 | ] 524 | }, 525 | "get": { 526 | "responses": { 527 | "200": { 528 | "description": "OK", 529 | "headers": {}, 530 | "examples": {} 531 | } 532 | }, 533 | "summary": "List all snapshots", 534 | "description": "List all snapshots associate with your account\n\nThe response is an object that has a key called `snapshots`. This key contain an array of snapshot objects each of which contain the standard `snapshot` attributes.\n\n", 535 | "tags": [ 536 | "Snapshots" 537 | ], 538 | "parameters": [] 539 | } 540 | }, 541 | "/snapshots/{snapshot_id}": { 542 | "get": { 543 | "responses": { 544 | "200": { 545 | "description": "OK", 546 | "headers": {}, 547 | "examples": {} 548 | } 549 | }, 550 | "summary": "Retrieve a snapshot", 551 | "description": "List an individual snapshot\n\nThe response is an object that has a key called `snapshot`. This key contain a standard `snapshot` object.\n\n", 552 | "tags": [ 553 | "Snapshots" 554 | ], 555 | "parameters": [ 556 | { 557 | "name": "snapshot_id", 558 | "in": "path", 559 | "description": "Snapshot unique identifier", 560 | "required": true, 561 | "type": "string" 562 | } 563 | ] 564 | }, 565 | "put": { 566 | "responses": { 567 | "200": { 568 | "description": "OK", 569 | "headers": {}, 570 | "examples": {} 571 | } 572 | }, 573 | "summary": "Update a snapshot", 574 | "description": "Update details about a snapshot\n\nThe response is an object that has a key called `snapshot`. This key contain a standard `snapshot` object.\n\n", 575 | "tags": [ 576 | "Snapshots" 577 | ], 578 | "parameters": [ 579 | { 580 | "name": "snapshot_id", 581 | "in": "path", 582 | "description": "Snapshot unique identifier", 583 | "required": true, 584 | "type": "string" 585 | }, 586 | { 587 | "name": "body", 588 | "in": "body", 589 | "schema": { 590 | "type": "object", 591 | "required": [], 592 | "properties": { 593 | "organization": { 594 | "type": "string" 595 | } 596 | } 597 | } 598 | } 599 | ] 600 | }, 601 | "delete": { 602 | "responses": { 603 | "204": { 604 | "description": "No Content", 605 | "headers": {}, 606 | "examples": {} 607 | } 608 | }, 609 | "summary": "Remove a snapshot", 610 | "description": "Delete a snapshot\n\nThe response code is a 204, which means that the action was successful with no returned body data.\n\n", 611 | "tags": [ 612 | "Snapshots" 613 | ], 614 | "parameters": [ 615 | { 616 | "name": "snapshot_id", 617 | "in": "path", 618 | "description": "Snapshot unique identifier", 619 | "required": true, 620 | "type": "string" 621 | } 622 | ] 623 | } 624 | }, 625 | "/images": { 626 | "post": { 627 | "responses": { 628 | "201": { 629 | "description": "Created", 630 | "headers": {}, 631 | "examples": {} 632 | } 633 | }, 634 | "summary": "Create a new image", 635 | "description": "Create a new image\n\nThe response is an object that has a key called `image`. This key contain a standard `image` object.\n\n", 636 | "tags": [ 637 | "Images" 638 | ], 639 | "parameters": [ 640 | { 641 | "name": "body", 642 | "in": "body", 643 | "schema": { 644 | "type": "object", 645 | "required": [], 646 | "properties": { 647 | "organization": { 648 | "type": "string" 649 | }, 650 | "name": { 651 | "type": "string" 652 | }, 653 | "arch": { 654 | "type": "string" 655 | }, 656 | "root_volume": { 657 | "type": "string" 658 | } 659 | } 660 | } 661 | } 662 | ] 663 | }, 664 | "get": { 665 | "responses": { 666 | "200": { 667 | "description": "OK", 668 | "headers": {}, 669 | "examples": {} 670 | } 671 | }, 672 | "summary": "List all images", 673 | "description": "List all images associate with your account\n\nThe response is an object that has a key called `images`. This key contain an array of image objects each of which contain the standard `images` attributes.\n\n", 674 | "tags": [ 675 | "Images" 676 | ], 677 | "parameters": [] 678 | } 679 | }, 680 | "/images/{image_id}": { 681 | "get": { 682 | "responses": { 683 | "200": { 684 | "description": "OK", 685 | "headers": {}, 686 | "examples": {} 687 | } 688 | }, 689 | "summary": "Retrieves an image", 690 | "description": "List an individual image\n\nThe response is an object that has a key called `image`. This key contain a standard `image` object.\n\n", 691 | "tags": [ 692 | "Images" 693 | ], 694 | "parameters": [ 695 | { 696 | "name": "image_id", 697 | "in": "path", 698 | "description": "Image unique identifier", 699 | "required": true, 700 | "type": "string" 701 | } 702 | ] 703 | }, 704 | "put": { 705 | "responses": { 706 | "200": { 707 | "description": "OK", 708 | "headers": {}, 709 | "examples": {} 710 | } 711 | }, 712 | "summary": "Update an image", 713 | "description": "Update details about a image\n\nThe response is an object that has a key called `image`. This key contain a standard `image` object.\n\n", 714 | "tags": [ 715 | "Images" 716 | ], 717 | "parameters": [ 718 | { 719 | "name": "image_id", 720 | "in": "path", 721 | "description": "Image unique identifier", 722 | "required": true, 723 | "type": "string" 724 | } 725 | ] 726 | }, 727 | "delete": { 728 | "responses": { 729 | "204": { 730 | "description": "No Content", 731 | "headers": {}, 732 | "examples": {} 733 | } 734 | }, 735 | "summary": "Delete an image", 736 | "description": "Delete an image\n\nThe response code is a 204, which means that the action was successful with no returned body data.\n\n", 737 | "tags": [ 738 | "Images" 739 | ], 740 | "parameters": [ 741 | { 742 | "name": "image_id", 743 | "in": "path", 744 | "description": "Image unique identifier", 745 | "required": true, 746 | "type": "string" 747 | } 748 | ] 749 | } 750 | }, 751 | "/ips": { 752 | "post": { 753 | "responses": { 754 | "201": { 755 | "description": "Created", 756 | "headers": {}, 757 | "examples": {} 758 | } 759 | }, 760 | "summary": "Create a new IP", 761 | "description": "Create a new reserved IP address\n\nThe response is an object that has a key called `ip`. This key contain a standard `ip` object.\n\n", 762 | "tags": [ 763 | "IPs" 764 | ], 765 | "parameters": [ 766 | { 767 | "name": "body", 768 | "in": "body", 769 | "schema": { 770 | "type": "object", 771 | "required": [], 772 | "properties": { 773 | "organization": { 774 | "type": "string" 775 | } 776 | } 777 | } 778 | } 779 | ] 780 | }, 781 | "get": { 782 | "responses": { 783 | "200": { 784 | "description": "OK", 785 | "headers": {}, 786 | "examples": {} 787 | } 788 | }, 789 | "summary": "Retrieves all IPs addresses", 790 | "description": "List all IPs associate with your account\n\nThe response is an object that has a key called `ips`. This key contain an array of ip objects each of which contain the standard `ip` attributes.\n\n", 791 | "tags": [ 792 | "IPs" 793 | ], 794 | "parameters": [] 795 | } 796 | }, 797 | "/ips/{ip_id}": { 798 | "get": { 799 | "responses": { 800 | "200": { 801 | "description": "OK", 802 | "headers": {}, 803 | "examples": {} 804 | } 805 | }, 806 | "summary": "Retrieve an IP address", 807 | "description": "List an individual IP address\n\nThe response is an object that has a key called `ip`. This key contain a standard `ip` object.\n\n", 808 | "tags": [ 809 | "IPs" 810 | ], 811 | "parameters": [ 812 | { 813 | "name": "ip_id", 814 | "in": "path", 815 | "description": "Ip unique identifier", 816 | "required": true, 817 | "type": "string" 818 | } 819 | ] 820 | }, 821 | "put": { 822 | "responses": { 823 | "200": { 824 | "description": "OK", 825 | "headers": {}, 826 | "examples": {} 827 | } 828 | }, 829 | "summary": "Attach an IP address", 830 | "description": "Allow you to remap an IP address to another server\n\nThe response is an object that has a key called `ip`. This key contain a standard `ip` object.\n\n", 831 | "tags": [ 832 | "IPs" 833 | ], 834 | "parameters": [ 835 | { 836 | "name": "ip_id", 837 | "in": "path", 838 | "description": "Ip unique identifier", 839 | "required": true, 840 | "type": "string" 841 | } 842 | ] 843 | }, 844 | "delete": { 845 | "responses": { 846 | "204": { 847 | "description": "No Content", 848 | "headers": {}, 849 | "examples": {} 850 | } 851 | }, 852 | "summary": "Remove an IP address", 853 | "description": "Delete a server\n\nThe response code is a 204, which means that the action was successful with no returned body data.\n\n", 854 | "tags": [ 855 | "IPs" 856 | ], 857 | "parameters": [ 858 | { 859 | "name": "ip_id", 860 | "in": "path", 861 | "description": "Ip unique identifier", 862 | "required": true, 863 | "type": "string" 864 | } 865 | ] 866 | } 867 | }, 868 | "/security_groups": { 869 | "post": { 870 | "responses": { 871 | "201": { 872 | "description": "Created", 873 | "headers": {}, 874 | "examples": {} 875 | } 876 | }, 877 | "summary": "Create a security group", 878 | "description": "Create a new security group\n\nThe response is an object that has a key called `security_group`. This key contain a standard `security_group` object.\n\n", 879 | "tags": [ 880 | "Security groups" 881 | ], 882 | "parameters": [ 883 | { 884 | "name": "body", 885 | "in": "body", 886 | "schema": { 887 | "type": "object", 888 | "required": [], 889 | "properties": { 890 | "organization": { 891 | "type": "string" 892 | }, 893 | "name": { 894 | "type": "string" 895 | }, 896 | "description": { 897 | "type": "string" 898 | } 899 | } 900 | } 901 | } 902 | ] 903 | }, 904 | "get": { 905 | "responses": { 906 | "200": { 907 | "description": "OK", 908 | "headers": {}, 909 | "examples": {} 910 | } 911 | }, 912 | "summary": "List all security groups", 913 | "description": "List all security groups associate with your account\n\nThe response is an object that has a key called `security_groups`. This key contain an array of security group objects each of which contain the standard `security_groups` attributes.\n\n", 914 | "tags": [ 915 | "Security groups" 916 | ], 917 | "parameters": [] 918 | } 919 | }, 920 | "/security_groups/{group_id}": { 921 | "get": { 922 | "responses": { 923 | "200": { 924 | "description": "OK", 925 | "headers": {}, 926 | "examples": {} 927 | } 928 | }, 929 | "summary": "Retrieves a security group", 930 | "description": "List an individual security group\n\nThe response is an object that has a key called `security_group`. This key contain a standard `security_group` object.\n\n", 931 | "tags": [ 932 | "Security groups" 933 | ], 934 | "parameters": [ 935 | { 936 | "name": "group_id", 937 | "in": "path", 938 | "description": "Security group id unique identifier", 939 | "required": true, 940 | "type": "string" 941 | } 942 | ] 943 | }, 944 | "put": { 945 | "responses": { 946 | "200": { 947 | "description": "OK", 948 | "headers": {}, 949 | "examples": {} 950 | } 951 | }, 952 | "summary": "Update a security group", 953 | "description": "Update a security group details\n\nThe response is an object that has a key called `security_group`. This key contain a standard `security_group` object.\n\n", 954 | "tags": [ 955 | "Security groups" 956 | ], 957 | "parameters": [ 958 | { 959 | "name": "group_id", 960 | "in": "path", 961 | "description": "Security group id unique identifier", 962 | "required": true, 963 | "type": "string" 964 | } 965 | ] 966 | }, 967 | "delete": { 968 | "responses": { 969 | "204": { 970 | "description": "No Content", 971 | "headers": {}, 972 | "examples": {} 973 | } 974 | }, 975 | "summary": "Delete a security group", 976 | "description": "Delete a security group\n\nThe response code is a 204, which means that the action was successful with no returned body data.\n\n", 977 | "tags": [ 978 | "Security groups" 979 | ], 980 | "parameters": [ 981 | { 982 | "name": "group_id", 983 | "in": "path", 984 | "description": "Security group id unique identifier", 985 | "required": true, 986 | "type": "string" 987 | } 988 | ] 989 | } 990 | }, 991 | "/security_groups/{group_id}/rules": { 992 | "post": { 993 | "responses": { 994 | "201": { 995 | "description": "Created", 996 | "headers": {}, 997 | "examples": {} 998 | } 999 | }, 1000 | "summary": "Create a new rule", 1001 | "description": "Create a new rule\n\nThe response is an object that has a key called `rule`. This key contain a standard `rule` object.\n\naction: \"accept\"\ndirection: \"outbound\"\nip_range: \"0.0.0.0/0\"\nprotocol: \"ICMP\"\n\n", 1002 | "tags": [ 1003 | "Security groups" 1004 | ], 1005 | "parameters": [ 1006 | { 1007 | "name": "group_id", 1008 | "in": "path", 1009 | "description": "Security group unique identifier", 1010 | "required": true, 1011 | "type": "string" 1012 | }, 1013 | { 1014 | "name": "body", 1015 | "in": "body", 1016 | "schema": { 1017 | "type": "object", 1018 | "required": [], 1019 | "properties": { 1020 | "organization": { 1021 | "type": "string" 1022 | }, 1023 | "action": { 1024 | "type": "string" 1025 | }, 1026 | "direction": { 1027 | "type": "string" 1028 | }, 1029 | "ip_range": { 1030 | "type": "string" 1031 | }, 1032 | "protocol": { 1033 | "type": "string" 1034 | }, 1035 | "dest_port_from": { 1036 | "type": "string" 1037 | } 1038 | } 1039 | } 1040 | } 1041 | ] 1042 | }, 1043 | "get": { 1044 | "responses": { 1045 | "200": { 1046 | "description": "OK", 1047 | "headers": {}, 1048 | "examples": {} 1049 | } 1050 | }, 1051 | "summary": "List all rules", 1052 | "description": "List all rules for a security group\n\nThe response is an object that has a key called `rules`. This key contain an array of rules for a security group each of which contain the standard `rule` attributes.\n\n", 1053 | "tags": [ 1054 | "Security groups" 1055 | ], 1056 | "parameters": [ 1057 | { 1058 | "name": "group_id", 1059 | "in": "path", 1060 | "description": "Security group unique identifier", 1061 | "required": true, 1062 | "type": "string" 1063 | } 1064 | ] 1065 | } 1066 | }, 1067 | "/security_groups/{group_id}/rules/{rule_id}": { 1068 | "put": { 1069 | "responses": { 1070 | "200": { 1071 | "description": "OK", 1072 | "headers": {}, 1073 | "examples": {} 1074 | } 1075 | }, 1076 | "summary": "Update a security rule", 1077 | "description": "Update a security rule\n\nThe response is an object that has a key called `rule`. This key contain a standard `rule` object.\n\n", 1078 | "tags": [ 1079 | "Security groups" 1080 | ], 1081 | "parameters": [ 1082 | { 1083 | "name": "group_id", 1084 | "in": "path", 1085 | "description": "Security group unique identifier", 1086 | "required": true, 1087 | "type": "string" 1088 | }, 1089 | { 1090 | "name": "rule_id", 1091 | "in": "path", 1092 | "description": "Security rule unique identifier", 1093 | "required": true, 1094 | "type": "string" 1095 | } 1096 | ] 1097 | }, 1098 | "get": { 1099 | "responses": { 1100 | "200": { 1101 | "description": "OK", 1102 | "headers": {}, 1103 | "examples": {} 1104 | } 1105 | }, 1106 | "summary": "Retrieves a security rule", 1107 | "description": "List an individual security rule\n\nThe response is an object that has a key called `rule`. This key contain a standard `rule` object.\n\n", 1108 | "tags": [ 1109 | "Security groups" 1110 | ], 1111 | "parameters": [ 1112 | { 1113 | "name": "group_id", 1114 | "in": "path", 1115 | "description": "Security group unique identifier", 1116 | "required": true, 1117 | "type": "string" 1118 | }, 1119 | { 1120 | "name": "rule_id", 1121 | "in": "path", 1122 | "description": "Security rule unique identifier", 1123 | "required": true, 1124 | "type": "string" 1125 | } 1126 | ] 1127 | }, 1128 | "delete": { 1129 | "responses": { 1130 | "204": { 1131 | "description": "No Content", 1132 | "headers": {}, 1133 | "examples": {} 1134 | } 1135 | }, 1136 | "summary": "Delete a security rule", 1137 | "description": "Delete and deactivate a security rule\n\nThe response code is a 204, which means that the action was successful with no returned body data.\n\n", 1138 | "tags": [ 1139 | "Security groups" 1140 | ], 1141 | "parameters": [ 1142 | { 1143 | "name": "group_id", 1144 | "in": "path", 1145 | "description": "Security group unique identifier", 1146 | "required": true, 1147 | "type": "string" 1148 | }, 1149 | { 1150 | "name": "rule_id", 1151 | "in": "path", 1152 | "description": "Security rule unique identifier", 1153 | "required": true, 1154 | "type": "string" 1155 | } 1156 | ] 1157 | } 1158 | }, 1159 | "/conf": { 1160 | "get": { 1161 | "responses": { 1162 | "200": { 1163 | "description": "OK", 1164 | "headers": {}, 1165 | "examples": {} 1166 | } 1167 | }, 1168 | "summary": "Serves pimouss metadata", 1169 | "description": "Serves instance metadata using its own IP address as authentication token.\n\n", 1170 | "tags": [ 1171 | "Metadata" 1172 | ], 1173 | "parameters": [ 1174 | { 1175 | "name": "format", 1176 | "in": "query", 1177 | "description": "Rendering format", 1178 | "required": false, 1179 | "type": "string" 1180 | } 1181 | ] 1182 | } 1183 | } 1184 | }, 1185 | "definitions": {} 1186 | } -------------------------------------------------------------------------------- /apiary.apib: -------------------------------------------------------------------------------- 1 | FORMAT: 1A 2 | HOST: https://api.scaleway.com/ 3 | 4 | # Scaleway API 5 | 6 | The Scaleway API allows you to manage servers and resources in a simple, programmatic way using conventional HTTP requests. 7 | All features you will find in the web control panel are also available through the API. 8 | 9 | ## Request and response 10 | 11 | Our api works over https and is accessed from two endpoint: 12 | 13 | - `account.scaleway.com` domain related to account actions 14 | - `api.scaleway.com` domain related to compute actions 15 | 16 | All data is sent and received as json. 17 | 18 | ## Constructing Requests 19 | 20 | Requests are made of two components: 21 | 22 | - Base URL: `https://api.scaleway.com` 23 | - Resource path: `servers` 24 | 25 | To construct a proper request, you need to format the URL as follows: 26 | 27 | `https://api.scaleway.com/{resource}` 28 | 29 | Example: `https://api.scaleway.com/volumes/f929fe39-63f8-4be8-a80e-1e9c8ae22a76` 30 | 31 | The following code is an example request to retrieve detailed informations about a volume 32 | 33 | ``` 34 | % curl -H 'X-Auth-Token: 017ce0ce-20ec-4d4ez-b44c-e561a23481d2c' -H 'Content-Type: application/json' https://api.scaleway.com/volumes/f929fe39-63f8-4be8-a80e-1e9c8ae22a76 -i 35 | 36 | HTTP/1.1 200 OK 37 | Server: nginx 38 | Date: Thu, 22 May 2014 07:55:00 GMT 39 | Content-Type: application/json 40 | Content-Length: 1345 41 | Connection: keep-alive 42 | X-Sentry-ID: None 43 | Strict-Transport-Security: max-age=86400 44 | 45 | { 46 | "volumes": [ 47 | { 48 | "export_uri": null, 49 | "id": "f929fe39-63f8-4be8-a80e-1e9c8ae22a76", 50 | "name": "volume-0-1", 51 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 52 | "server": null, 53 | "size": 10000000000, 54 | "volume_type": "l_ssd" 55 | }, 56 | { 57 | "export_uri": null, 58 | "id": "0facb6b5-b117-441a-81c1-f28b1d723779", 59 | "name": "volume-0-2", 60 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 61 | "server": null, 62 | "size": 20000000000, 63 | "volume_type": "l_ssd" 64 | } 65 | ] 66 | } 67 | ``` 68 | 69 | ## Basic Authentication 70 | 71 | You authenticate to the API by requesting a token. You can create a token from the `account.scaleway.com` domain related to account actions with a POST request on the /tokens HTTP resource. 72 | 73 | Basic Authentication process: 74 | 75 | - Query via POST request the /tokens resource [see here how to](https://developer.scaleway.com/#tokens-tokens-post) 76 | 77 | - Supply an "X-Auth-Token" header followed by the token you get previously, e.g. "4e0b46e4-7c1d-44d4-8ba6-dc5f80694397" 78 | 79 | ``` 80 | curl -X GET -H "X-Auth-Token: 4e0b46e4-7c1d-44d4-8ba6-dc5f80694397" -H "Content-Type: application/json" https://account.scaleway.com/{resources} 81 | ``` 82 | 83 | ## Errors 84 | 85 | We use conventional HTTP response codes to indicate success or failure of an API request. 86 | 87 | In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that resulted from the provided information (e.g., a required parameter is missing), and codes in the 5xx range indicate an error with our servers. 88 | 89 | ### HTTP Status Code Summary 90 | 91 | - `200 OK` - Everything worked as expected. 92 | - `400 Bad Request` - Often missing a required parameter. 93 | - `401 Unauthorized` - No valid API key provided. 94 | - `402 Request Failed` - Parameters were valid but request failed. 95 | - `403 Forbidden` - Insufficient privileges to access requested resource. 96 | - `404 Not Found` - The requested item doesn't exist. 97 | - `50x` Server errors - something went wrong on api domain's end. 98 | 99 | Input and output data must be valid JSON with appropriate Content-Type header set. 100 | 101 | ### Attributes 102 | 103 | - type: 104 | 105 | - `invalid_request_error`: Occur when your request has invalid parameters. 106 | - `invitalid_auth`: Arise when there is a problem of authentication. 107 | - `uknown_resource`: Occur when the resource doesn't exist. 108 | - `authorization_required`: You don't have sufficient right to access the resource. 109 | - `api_error`: API errors use in case of problem with api domain's servers 110 | 111 | - message: 112 | 113 | - A human readable error giving more details about the error 114 | 115 | - fields (Optional): 116 | 117 | - An array of parameters with an human readable message giving more details about the error. 118 | 119 | ### Errors responses example 120 | 121 | + Response 400 (application/json) 122 | 123 | { 124 | "fields": { 125 | "email": [ 126 | "incorrect email address", 127 | "required key not provided" 128 | ], 129 | "firstname": [ 130 | "length of value must be at least 2", 131 | "required key not provided" 132 | ], 133 | "lastname": [ 134 | "length of value must be at least 2", 135 | "required key not provided" 136 | ] 137 | }, 138 | "message": "Validation Error", 139 | "type": "invalid_request_error" 140 | } 141 | 142 | + Response 401 (application/json) 143 | 144 | { 145 | "message": "The header 'X-Auth-Token' is missing", 146 | "type": "invalid_auth" 147 | } 148 | 149 | + Response 403 (application/json) 150 | 151 | { 152 | "message": "The token provided doesn't have the requested permission.", 153 | "type": "authorization_required" 154 | } 155 | 156 | + Response 404 (application/json) 157 | 158 | { 159 | "message": "User not found", 160 | "type": "unknown_resource" 161 | } 162 | 163 | 164 | ### group Tokens 165 | 166 | A Token is an identifier associated with your account. We use this token to authenticate commands in our APIs. 167 | 168 | #### Tokens [/tokens] 169 | 170 | ##### Create a token [POST] 171 | 172 | Authenticates a user against their username, password, and then returns a new Token, which can be used until it expires. 173 | 174 | The response is an object that has a key called `token`. This key contain a standard `token` object. 175 | 176 | + Attributes 177 | + email: `jsnow@got.com` (string, required) - User email 178 | + password: `winteriscoming` (string, required) - User password 179 | + expires: `false` (boolean, optional) - Set if you want a Token wich doesn't expire (default: true) 180 | 181 | + Request (application/json) 182 | 183 | + Body 184 | 185 | { 186 | "email": "jsnow@got.com", 187 | "password": "winteriscoming", 188 | "expires": false 189 | } 190 | 191 | + Response 201 (application/json) 192 | 193 | + Headers 194 | 195 | location: https://account.scaleway.com/tokens/9de8f869-c58e-4aa3-9208-2d4eaff5fa20 196 | 197 | + Body 198 | 199 | { 200 | "token": { 201 | "creation_date": "2014-05-22T08:05:57.556385+00:00", 202 | "expires": null, 203 | "id": "9de8f869-c58e-4aa3-9208-2d4eaff5fa20", 204 | "inherits_user_perms": true, 205 | "permissions": [], 206 | "roles": { 207 | "organization": null, 208 | "role": null 209 | }, 210 | "user_id": "5bea0358-db40-429e-bd82-914686a7e7b9" 211 | } 212 | } 213 | 214 | ##### List all tokens [GET] 215 | 216 | List all Tokens associate with your account 217 | 218 | The response is an object that has a key called `tokens`. This key contain an array of token objects each of which contain the standard `token` attributes. 219 | 220 | + Request (application/json) 221 | 222 | + Headers 223 | 224 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 225 | 226 | + Response 200 (application/json) 227 | 228 | { 229 | { 230 | "tokens": [ 231 | { 232 | "creation_date": "2014-03-13T10:53:11.456319+00:00", 233 | "expires": null, 234 | "id": "4e5570fb-c854-5349-979f-9f51d608d34z", 235 | "inherits_user_perms": true, 236 | "permissions": [], 237 | "roles": { 238 | "organization": null, 239 | "role": null 240 | }, 241 | "user_id": "5bea0358-db40-429e-bd82-953016a7e2s7" 242 | }, 243 | { 244 | "creation_date": "2014-05-19T18:05:47.304433+00:00", 245 | "expires": "2014-05-20T14:05:06.393875+00:00", 246 | "id": "654c95b0-2cf5-41a3-b3cc-733ffba4b4b7", 247 | "inherits_user_perms": true, 248 | "permissions": [], 249 | "roles": { 250 | "organization": null, 251 | "role": null 252 | }, 253 | "user_id": "5bea0358-db40-429e-bd82-953016a7e2s7" 254 | } 255 | ] 256 | } 257 | } 258 | 259 | 260 | #### Token [/tokens/{token_id}] 261 | 262 | + Parameters 263 | + token_id (required, string, `654c95b0-2cf5-41a3-b3cc-733ffba4b4b7`)... Token unique identifier 264 | 265 | ##### Retrieve a token [GET] 266 | 267 | List an individual Token 268 | 269 | The response is an object that has a key called `token`. This key contain a standard `token` object. 270 | 271 | + Request (application/json) 272 | 273 | + Headers 274 | 275 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 276 | 277 | 278 | + Response 200 (application/json) 279 | 280 | { 281 | "token": { 282 | "creation_date": "2014-05-22T08:06:51.742826+00:00", 283 | "expires": "2014-05-20T14:05:06.393875+00:00", 284 | "id": "654c95b0-2cf5-41a3-b3cc-733ffba4b4b7", 285 | "inherits_user_perms": true, 286 | "permissions": [], 287 | "roles": { 288 | "organization": null, 289 | "role": null 290 | }, 291 | "user_id": "5bea0358-db40-429e-bd82-953016a7e2s7" 292 | } 293 | } 294 | 295 | 296 | ##### Update a token [PATCH] 297 | 298 | Increase Token expiration time of 30 minutes 299 | 300 | The response is an object that has a key called `token`. This key contain a standard `token` object. 301 | 302 | + Attributes 303 | 304 | + expires: `false` (boolean, optional) - If false, the token is permanent, if true, it expires in 30 minutes 305 | + description: `my token` (string, optional) - A token description 306 | 307 | + Request (application/json) 308 | 309 | + Headers 310 | 311 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 312 | 313 | + Body 314 | 315 | { 316 | "expires": true, 317 | "description": "my token" 318 | } 319 | 320 | + Response 200 (application/json) 321 | 322 | { 323 | "token": { 324 | creation_date": "2014-05-22T08:06:51.742826+00:00", 325 | "expires": "2014-05-22T11:18:07.786841+00:00", 326 | "id": "654c95b0-2cf5-41a3-b3cc-733ffba4b4b7", 327 | "inherits_user_perms": true, 328 | "permissions": [], 329 | "roles": { 330 | "organization": null, 331 | "role": null 332 | }, 333 | "user_id": "5bea0358-db40-429e-bd82-953016a7e2s7" 334 | } 335 | } 336 | 337 | 338 | 339 | ##### Remove a token [DELETE] 340 | 341 | Delete an individual token 342 | 343 | The response code is a 204, which means that the action was successful with no returned body data. 344 | 345 | + Request (application/json) 346 | 347 | + Headers 348 | 349 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 350 | 351 | + Response 204 352 | 353 | ### group Organizations 354 | 355 | This resources of API methods allows you to get your Organizations informations 356 | 357 | #### Organizations [/organizations] 358 | 359 | ##### List all organizations [GET] 360 | 361 | List all Organizations associate with your account 362 | 363 | The response is an object that has a key called `organizations`. This key contain an array of organization objects each of which contain the standard `organization` attributes. 364 | 365 | + Request (application/json) 366 | 367 | + Headers 368 | 369 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 370 | 371 | + Response 200 (application/json) 372 | 373 | { 374 | "organizations": [ 375 | { 376 | "id": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 377 | "name": "jsnow@got.com", 378 | "users": [ 379 | { 380 | "email": "jsnow@got.com", 381 | "firstname": "John", 382 | "fullname": "John Snow", 383 | "id": "59a98700-8622-4495-a11a-e1efbfac5972", 384 | "lastname": "Snow", 385 | "organizations": [ 386 | { 387 | "id": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 388 | "name": "jsnow@got.com" 389 | } 390 | ], 391 | "roles": [ 392 | { 393 | "organization": { 394 | "id": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 395 | "name": "jsnow@got.com" 396 | }, 397 | "role": "manager" 398 | } 399 | ], 400 | "ssh_public_keys": [] 401 | } 402 | ] 403 | } 404 | ] 405 | } 406 | 407 | 408 | ### group Users 409 | 410 | #### User [/users/{user_id}] 411 | 412 | + Parameter 413 | + user_id (required, string, `5bea0358-db40-429e-bd82-953016a7e2s7`)... User unique identifier 414 | 415 | ##### Retrieve a user [GET] 416 | 417 | List informations about your user account 418 | 419 | The response is an object that has a key called `user`. This key contain a standard `user` object. 420 | 421 | + Request (application/json) 422 | 423 | + Headers 424 | 425 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 426 | 427 | + Response 200 (application/json) 428 | 429 | 430 | "user": { 431 | "email": "jsnow@got.com", 432 | "firstname": "John", 433 | "fullname": "John Snow", 434 | "id": "5bea0358-db40-429e-bd82-953016a7e2s7", 435 | "lastname": "Snow", 436 | "organizations": null, 437 | "roles": null, 438 | "ssh_public_keys": null 439 | } 440 | 441 | ### group Servers 442 | 443 | A Server is a dedicated machine for your own use. `servers` endpoint allow you to create, list or delete your servers. 444 | 445 | #### Servers [/servers] 446 | 447 | ##### Create a new server [POST] 448 | 449 | Create a new server 450 | 451 | The response is an object that has a key called `server`. This key contain a standard `server` object. 452 | 453 | + Attributes 454 | 455 | + name: `my_server` (string, required) - The server name 456 | + organization: `000a115d-2852-4b0a-9ce8-47f1134ba95a` (string, required) - Organization unique identifier 457 | + image: `85917034-46b0-4cc5-8b48-f0a2245e357e` (string, required) - Image unique identifier 458 | + volumes: `volumes: {1: {name: "vol_demo", organization: "ecc1c86a-eabb-43a7-9c0a-77e371753c0a", size: 10000000000, volume_type: "l_sdd"` (array, required) - A list of volumes identifier to be attached to the server 459 | + tags: `[test, www]` (array, optional) - A list of tags 460 | 461 | + Request (application/json) 462 | 463 | + Headers 464 | 465 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 466 | 467 | + Body 468 | 469 | { 470 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 471 | "name": "my_server", 472 | "image": "85917034-46b0-4cc5-8b48-f0a2245e357e", 473 | "tags": ["test", "www"] 474 | } 475 | 476 | + Response 201 (application/json) 477 | 478 | + Headers 479 | 480 | location: https://api.scaleway.com/servers/3cb18e2d-f4f7-48f7-b452-59b88ae8fc8c 481 | 482 | + Body 483 | 484 | { 485 | "server": { 486 | "bootscript": null, 487 | "dynamic_public_ip": false, 488 | "id": "3cb18e2d-f4f7-48f7-b452-59b88ae8fc8c", 489 | "image": { 490 | "id": "85917034-46b0-4cc5-8b48-f0a2245e357e", 491 | "name": "ubuntu working" 492 | }, 493 | "name": "my_server", 494 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 495 | "private_ip": null, 496 | "public_ip": null, 497 | "state": "running", 498 | "tags": [ 499 | "test", 500 | "www" 501 | ], 502 | "volumes": { 503 | "0": { 504 | "export_uri": null, 505 | "id": "d9257116-6919-49b4-a420-dcfdff51fcb1", 506 | "name": "vol simple snapshot", 507 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 508 | "server": { 509 | "id": "3cb18e2d-f4f7-48f7-b452-59b88ae8fc8c", 510 | "name": "my_server" 511 | }, 512 | "size": 10000000000, 513 | "volume_type": "l_ssd" 514 | } 515 | } 516 | } 517 | } 518 | 519 | ##### List all servers [GET] 520 | 521 | List all servers associate with your account 522 | 523 | The response is an object that has a key called `servers`. This key contain an array of server objects each of which contain the standard `server` attributes. 524 | 525 | + Request (application/json) 526 | 527 | + Headers 528 | 529 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 530 | 531 | + Response 200 (application/json) 532 | 533 | { 534 | "servers": [ 535 | { 536 | "bootscript": null, 537 | "dynamic_public_ip": false, 538 | "id": "741db378-6b87-46d4-a8c5-4e46a09ab1f8", 539 | "image": { 540 | "id": "85917034-46b0-4cc5-8b48-f0a2245e357e", 541 | "name": "ubuntu working" 542 | }, 543 | "name": "my_server", 544 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 545 | "private_ip": null, 546 | "public_ip": null, 547 | "state": "running", 548 | "tags": [ 549 | "test", 550 | "www" 551 | ], 552 | "volumes": { 553 | "0": { 554 | "export_uri": null, 555 | "id": "c1eb8f3a-4f0b-4b95-a71c-93223e457f5a", 556 | "name": "vol simple snapshot", 557 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 558 | "server": { 559 | "id": "741db378-6b87-46d4-a8c5-4e46a09ab1f8", 560 | "name": "my_server" 561 | }, 562 | "size": 10000000000, 563 | "volume_type": "l_ssd" 564 | } 565 | } 566 | }, 567 | { 568 | "bootscript": null, 569 | "dynamic_public_ip": false, 570 | "id": "0e9f85af-b6aa-401e-a00d-484f832c5024", 571 | "image": { 572 | "id": "85917034-46b0-4cc5-8b48-f0a2245e357e", 573 | "name": "ubuntu working" 574 | }, 575 | "name": "my_server", 576 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 577 | "private_ip": null, 578 | "public_ip": null, 579 | "state": "running", 580 | "tags": [ 581 | "test", 582 | "www" 583 | ], 584 | "volumes": { 585 | "0": { 586 | "export_uri": null, 587 | "id": "fb09bb31-ecd9-4dff-8b55-b6e45715199d", 588 | "name": "vol simple snapshot", 589 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 590 | "server": { 591 | "id": "0e9f85af-b6aa-401e-a00d-484f832c5024", 592 | "name": "my_server" 593 | }, 594 | "size": 10000000000, 595 | "volume_type": "l_ssd" 596 | } 597 | } 598 | } 599 | ] 600 | } 601 | 602 | 603 | #### Server [/servers/{server_id}] 604 | 605 | + Parameters 606 | 607 | + server_id (required, string, `741db378-6b87-46d4-a8c5-4e46a09ab1f8`)... Server unique identifier 608 | 609 | ##### Retrieve a server [GET] 610 | 611 | List an individual server 612 | 613 | The response is an object that has a key called `server`. This key contain a standard `server` object. 614 | 615 | + Request (application/json) 616 | 617 | + Headers 618 | 619 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 620 | 621 | + Response 200 (application/json) 622 | 623 | { 624 | "server": { 625 | "bootscript": null, 626 | "dynamic_public_ip": false, 627 | "id": "741db378-6b87-46d4-a8c5-4e46a09ab1f8", 628 | "image": { 629 | "id": "85917034-46b0-4cc5-8b48-f0a2245e357e", 630 | "name": "ubuntu working" 631 | }, 632 | "name": "my_server", 633 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 634 | "private_ip": null, 635 | "public_ip": null, 636 | "state": "running", 637 | "tags": [ 638 | "test", 639 | "www" 640 | ], 641 | "volumes": { 642 | "0": { 643 | "export_uri": null, 644 | "id": "c1eb8f3a-4f0b-4b95-a71c-93223e457f5a", 645 | "name": "vol simple snapshot", 646 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 647 | "server": { 648 | "id": "741db378-6b87-46d4-a8c5-4e46a09ab1f8", 649 | "name": "my_server" 650 | }, 651 | "size": 10000000000, 652 | "volume_type": "l_ssd" 653 | } 654 | } 655 | } 656 | } 657 | 658 | ##### Update a server [PUT] 659 | 660 | Update details about a server 661 | 662 | The response is an object that has a key called `server`. This key contain a standard `server` object. 663 | 664 | + Request (application/json) 665 | 666 | + Headers 667 | 668 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 669 | 670 | + Body 671 | 672 | { 673 | "bootscript": null, 674 | "dynamic_public_ip": false, 675 | "id": "741db378-6b87-46d4-a8c5-4e46a09ab1f8", 676 | "image": { 677 | "id": "85917034-46b0-4cc5-8b48-f0a2245e357e", 678 | "name": "ubuntu working" 679 | }, 680 | "name": "my_server", 681 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 682 | "private_ip": null, 683 | "public_ip": null, 684 | "state": "running", 685 | "tags": [ 686 | "test", 687 | "www", 688 | "new" 689 | ], 690 | "volumes": { 691 | "0": { 692 | "export_uri": null, 693 | "id": "c39b49f4-1804-4d03-96b4-952896b0918e", 694 | "name": "vol simple snapshot", 695 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 696 | "server": { 697 | "id": "345b862b-9198-4633-94a5-3f0307702652", 698 | "name": "my_server" 699 | }, 700 | "size": 10000000000, 701 | "volume_type": "l_ssd" 702 | } 703 | } 704 | } 705 | 706 | 707 | + Response 200 (application/json) 708 | 709 | { 710 | "server": { 711 | "bootscript": null, 712 | "dynamic_public_ip": false, 713 | "id": "741db378-6b87-46d4-a8c5-4e46a09ab1f8", 714 | "image": { 715 | "id": "85917034-46b0-4cc5-8b48-f0a2245e357e", 716 | "name": "ubuntu working" 717 | }, 718 | "name": "my_server", 719 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 720 | "private_ip": null, 721 | "public_ip": null, 722 | "state": "running", 723 | "tags": [ 724 | "prod", 725 | "www", 726 | "new" 727 | ], 728 | "volumes": { 729 | "0": { 730 | "export_uri": null, 731 | "id": "c1eb8f3a-4f0b-4b95-a71c-93223e457f5a", 732 | "name": "vol simple snapshot", 733 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 734 | "server": { 735 | "id": "741db378-6b87-46d4-a8c5-4e46a09ab1f8", 736 | "name": "my_server" 737 | }, 738 | "size": 10000000000, 739 | "volume_type": "l_ssd" 740 | } 741 | } 742 | } 743 | } 744 | 745 | ##### Remove a server [DELETE] 746 | 747 | Delete a server 748 | 749 | The response code is a 204, which means that the action was successful with no returned body data. 750 | 751 | + Request (application/json) 752 | 753 | + Headers 754 | 755 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 756 | 757 | + Response 204 758 | 759 | 760 | #### Actions [/servers/{server_id}/action] 761 | 762 | A collection of actions to be applied on a server 763 | 764 | + Parameters 765 | 766 | + server_id (required, string, `741db378-6b87-46d4-a8c5-4e46a09ab1f8`)... Server unique identifier 767 | 768 | ##### List all actions [GET] 769 | 770 | List all actions available for the secified server 771 | 772 | The response is an object that has a key called `actions`. This key contain an array of action 773 | 774 | + Request (application/json) 775 | 776 | + Headers 777 | 778 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 779 | 780 | + Response 200 (application/json) 781 | 782 | { 783 | "actions": [ 784 | "poweron", 785 | "poweroff", 786 | "reboot" 787 | ] 788 | } 789 | 790 | ##### Execute an action [POST] 791 | 792 | Execute an action on a server 793 | 794 | The response is an object that has a key called `task`. This key contain a standard `task` object. 795 | 796 | + Parameters 797 | 798 | + server_id (required, string, `741db378-6b87-46d4-a8c5-4e46a09ab1f8`)... Server unique identifier 799 | + action (required, string, `poweron`)... Action to execute 800 | 801 | + Request (application/json) 802 | 803 | + Headers 804 | 805 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 806 | 807 | + Body 808 | 809 | { 810 | "action": "poweroff" 811 | } 812 | 813 | + Response 202 (application/json) 814 | 815 | + Header 816 | 817 | location: https://api.scaleway.com/tasks/a8a1775c-0dda-4f52-87b2-4e8101d68d6e 818 | 819 | + Body 820 | 821 | { 822 | "task": { 823 | "description": "server_poweroff", 824 | "href_from": "/servers/741db378-6b87-46d4-a8c5-4e46a09ab1f8/action", 825 | "id": "a8a1775c-0dda-4f52-87b2-4e8101d68d6e", 826 | "progress": "0", 827 | "status": "pending" 828 | } 829 | } 830 | 831 | ### group Volumes 832 | 833 | A Volume abstracts data storage operations for your servers in a flexible manner. `volumes` endpoint allow you to create, list or delete your volumes. 834 | 835 | #### Volumes [/volumes] 836 | 837 | ##### Create a new volume [POST] 838 | 839 | Create a new volume 840 | 841 | The response is an object that has a key called `volume`. This key contain a standard `volume` object. 842 | 843 | + Attributes 844 | + name: `volume-0-3` (string, required) - The volume name 845 | + organization: `000a115d-2852-4b0a-9ce8-47f1134ba95a` (string, required) - Unique organization identifier 846 | + volume_type: `l_ssd` (string, required) - The volume type 847 | + size: `10000000000` (number, required) - The volume size 848 | 849 | + Request (application/json) 850 | 851 | + Headers 852 | 853 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 854 | 855 | + Body 856 | 857 | { 858 | "name": "volume-0-3", 859 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 860 | "size": 10000000000, 861 | "volume_type": "l_ssd" 862 | } 863 | 864 | + Response 201 (application/json) 865 | 866 | + Headers 867 | 868 | https://api.scaleway.com/volumes/c675f420-cfeb-48ff-ba2a-9d2a4dbe3fcd 869 | 870 | + Body 871 | 872 | { 873 | "volume": { 874 | "export_uri": null, 875 | "id": "c675f420-cfeb-48ff-ba2a-9d2a4dbe3fcd", 876 | "name": "volume-0-3", 877 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 878 | "server": null, 879 | "size": 10000000000, 880 | "volume_type": "l_ssd" 881 | } 882 | } 883 | 884 | 885 | ##### Retrieves all volumes [GET] 886 | 887 | List all volumes associate with your account 888 | 889 | The response is an object that has a key called `volumes`. This key contain an array of volume objects each of which contain the standard `volume` attributes. 890 | 891 | + Request (application/json) 892 | 893 | + Headers 894 | 895 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 896 | 897 | + Response 200 (application/json) 898 | 899 | { 900 | "volumes": [ 901 | { 902 | "export_uri": null, 903 | "id": "f929fe39-63f8-4be8-a80e-1e9c8ae22a76", 904 | "name": "volume-0-1", 905 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 906 | "server": null, 907 | "size": 10000000000, 908 | "volume_type": "l_ssd" 909 | }, 910 | { 911 | "export_uri": null, 912 | "id": "0facb6b5-b117-441a-81c1-f28b1d723779", 913 | "name": "volume-0-2", 914 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 915 | "server": null, 916 | "size": 20000000000, 917 | "volume_type": "l_ssd" 918 | } 919 | ] 920 | } 921 | 922 | 923 | #### Volume [/volumes/{volume_id}] 924 | 925 | + Parameters 926 | + volume_id (required, string, `f929fe39-63f8-4be8-a80e-1e9c8ae22a76`)... Volume unique identifier 927 | 928 | ##### Retrieves informations about a volume [GET] 929 | 930 | List an individual volume 931 | 932 | The response is an object that has a key called `volume`. This key contain a standard `volume` object. 933 | 934 | + Request (application/json) 935 | 936 | + Headers 937 | 938 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 939 | 940 | + Response 200 (application/json) 941 | 942 | { 943 | "volume": { 944 | "export_uri": null, 945 | "id": "f929fe39-63f8-4be8-a80e-1e9c8ae22a76", 946 | "name": "volume-0-1", 947 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 948 | "server": null, 949 | "size": 10000000000, 950 | "volume_type": "l_ssd" 951 | } 952 | } 953 | 954 | 955 | ##### Delete a volume [DELETE] 956 | 957 | Delete a volume 958 | 959 | The response code is a 204, which means that the action was successful with no returned body data. 960 | 961 | + Request (application/json) 962 | 963 | + Headers 964 | 965 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 966 | 967 | + Response 204 (application/json) 968 | 969 | 970 | ### group Snapshots 971 | 972 | A snapshot is a full-volume copy stored in our secure data centers. 973 | 974 | #### Snapshots [/snapshots] 975 | 976 | ##### Create a snapshot [POST] 977 | 978 | Create a new server 979 | 980 | The response is an object that has a key called `snapshot`. This key contain a standard `snapshot` object. 981 | 982 | + Attributes 983 | 984 | + name: `` (string, required) - Human readable snapshot name 985 | + organization: `000a115d-2852-4b0a-9ce8-47f1134ba95a` (string, required) - Unique organization identifier 986 | + volume_id: `701a8946-ff9d-4579-95e3-1c2c2d0f892d` (string, required) - Unique volume identifier 987 | 988 | + Request (application/json) 989 | 990 | + Headers 991 | 992 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 993 | 994 | + Body 995 | 996 | { 997 | "name": "snapshot-0-1", 998 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 999 | "volume_id": "701a8946-ff9d-4579-95e3-1c2c2d0f892d" 1000 | } 1001 | 1002 | + Response 200 (application/json) 1003 | 1004 | { 1005 | "snapshot": { 1006 | "base_volume": { 1007 | "id": "701a8946-ff9d-4579-95e3-1c2c2d0f892d", 1008 | "name": "vol simple snapshot" 1009 | }, 1010 | "creation_date": "2014-05-22T12:10:05.596769+00:00", 1011 | "id": "f0361e7b-cbe4-4882-a999-945192b7171b", 1012 | "name": "snapshot-0-1", 1013 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 1014 | "size": 10000000000, 1015 | "state": "snapshotting", 1016 | "volume_type": "l_ssd" 1017 | } 1018 | } 1019 | 1020 | 1021 | ##### List all snapshots [GET] 1022 | 1023 | List all snapshots associate with your account 1024 | 1025 | The response is an object that has a key called `snapshots`. This key contain an array of snapshot objects each of which contain the standard `snapshot` attributes. 1026 | 1027 | + Request (application/json) 1028 | 1029 | + Headers 1030 | 1031 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1032 | 1033 | + Response 200 (application/json) 1034 | 1035 | { 1036 | "snapshots": [ 1037 | { 1038 | "base_volume": { 1039 | "id": "09a4184c-733b-43c8-99c3-f1dde30536fe", 1040 | "name": "vol simple snapshot" 1041 | }, 1042 | "creation_date": "2014-05-22T12:11:06.055998+00:00", 1043 | "id": "6f418e5f-b42d-4423-a0b5-349c74c454a4", 1044 | "name": "snapshot-0-1", 1045 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 1046 | "size": 10000000000, 1047 | "state": "snapshotting", 1048 | "volume_type": "l_ssd" 1049 | }, 1050 | { 1051 | "base_volume": { 1052 | "id": "09a4184c-733b-43c8-99c3-f1dde30536fe", 1053 | "name": "vol simple snapshot" 1054 | }, 1055 | "creation_date": "2014-05-22T12:13:09.877961+00:00", 1056 | "id": "c6ff5501-eb35-44b8-aa01-8777211a830b", 1057 | "name": "snapshot-0-2", 1058 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 1059 | "size": 10000000000, 1060 | "state": "snapshotting", 1061 | "volume_type": "l_ssd" 1062 | } 1063 | ] 1064 | } 1065 | 1066 | #### Snapshot [/snapshots/{snapshot_id}] 1067 | 1068 | + Parameters 1069 | + snapshot_id: `6f418e5f-b42d-4423-a0b5-349c74c454a4` (string, required) - Snapshot unique identifier 1070 | 1071 | ##### Retrieve a snapshot [GET] 1072 | 1073 | List an individual snapshot 1074 | 1075 | The response is an object that has a key called `snapshot`. This key contain a standard `snapshot` object. 1076 | 1077 | + Request (application/json) 1078 | 1079 | + Headers 1080 | 1081 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1082 | 1083 | + Response 200 (application/json) 1084 | 1085 | { 1086 | "snapshot": { 1087 | "base_volume": { 1088 | "id": "09a4184c-733b-43c8-99c3-f1dde30536fe", 1089 | "name": "vol simple snapshot" 1090 | }, 1091 | "creation_date": "2014-05-22T12:11:06.055998+00:00", 1092 | "id": "6f418e5f-b42d-4423-a0b5-349c74c454a4", 1093 | "name": "snapshot-0-1", 1094 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 1095 | "size": 10000000000, 1096 | "state": "snapshotting", 1097 | "volume_type": "l_ssd" 1098 | } 1099 | } 1100 | 1101 | ##### Update a snapshot [PUT] 1102 | 1103 | Update details about a snapshot 1104 | 1105 | The response is an object that has a key called `snapshot`. This key contain a standard `snapshot` object. 1106 | 1107 | + Attributes 1108 | + organization: `000a115d-2852-4b0a-9ce8-47f1134ba95a` (string, required) - Organization unique identifier 1109 | 1110 | + Request (application/json) 1111 | 1112 | + Headers 1113 | 1114 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1115 | 1116 | + Body 1117 | 1118 | { 1119 | "organization": "f1350c5d-f1d8-4f9d-b114-6053905578e1" 1120 | } 1121 | 1122 | 1123 | + Response 200 (application/json) 1124 | 1125 | { 1126 | "snapshot": { 1127 | "base_volume": { 1128 | "id": "09a4184c-733b-43c8-99c3-f1dde30536fe", 1129 | "name": "vol simple snapshot" 1130 | }, 1131 | "creation_date": "2014-05-22T12:11:06.055998+00:00", 1132 | "id": "6f418e5f-b42d-4423-a0b5-349c74c454a4", 1133 | "name": "snapshot-0-1", 1134 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 1135 | "size": 10000000000, 1136 | "state": "snapshotting", 1137 | "volume_type": "l_ssd" 1138 | } 1139 | } 1140 | 1141 | ##### Remove a snapshot [DELETE] 1142 | 1143 | Delete a snapshot 1144 | 1145 | The response code is a 204, which means that the action was successful with no returned body data. 1146 | 1147 | + Request (application/json) 1148 | 1149 | + Headers 1150 | 1151 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1152 | 1153 | + Response 204 1154 | 1155 | ### group Images 1156 | 1157 | Images allow you to create series of servers with predefined configuration. 1158 | For instance, you can prepare to scale your serving capacity with a frontend image for an Apache server. 1159 | 1160 | #### Images [/images] 1161 | 1162 | ##### Create a new image [POST] 1163 | 1164 | Create a new image 1165 | 1166 | The response is an object that has a key called `image`. This key contain a standard `image` object. 1167 | 1168 | + Attributes 1169 | 1170 | + organization: `000a115d-2852-4b0a-9ce8-47f1134ba95a` (string, required) - Organization unique identifier 1171 | + name: `my_image` (string, required) - The image name 1172 | + arch: `arm` (string, required) - The architecture type 1173 | + root_volume: `f0361e7b-cbe4-4882-a999-945192b7171b` (string, required) - The root volume unique identifier 1174 | 1175 | + Request (application/json) 1176 | 1177 | + Headers 1178 | 1179 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1180 | 1181 | + Body 1182 | 1183 | { 1184 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 1185 | "arch": "arm", 1186 | "name": "my_image", 1187 | "root_volume": "f0361e7b-cbe4-4882-a999-945192b7171b" 1188 | } 1189 | 1190 | + Response 201 (application/json) 1191 | 1192 | { 1193 | "image": { 1194 | "arch": "arm", 1195 | "creation_date": "2014-05-22T12:56:56.984011+00:00", 1196 | "extra_volumes": "[]", 1197 | "from_image": null, 1198 | "from_server": null, 1199 | "id": "98bf3ac2-a1f5-471d-8c8f-1b706ab57ef0", 1200 | "marketplace_key": null, 1201 | "modification_date": "2014-05-22T12:56:56.984011+00:00", 1202 | "name": "my_image", 1203 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 1204 | "public": false, 1205 | "root_volume": { 1206 | "id": "f0361e7b-cbe4-4882-a999-945192b7171b", 1207 | "name": "vol-0-1" 1208 | } 1209 | } 1210 | } 1211 | 1212 | ##### List all images [GET] 1213 | 1214 | List all images associate with your account 1215 | 1216 | The response is an object that has a key called `images`. This key contain an array of image objects each of which contain the standard `images` attributes. 1217 | 1218 | + Request (application/json) 1219 | 1220 | + Headers 1221 | 1222 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1223 | 1224 | + Response 200 (application/json) 1225 | 1226 | { 1227 | "images": [ 1228 | { 1229 | "arch": "arm", 1230 | "creation_date": "2014-05-22T12:56:56.984011+00:00", 1231 | "extra_volumes": "[]", 1232 | "from_image": null, 1233 | "from_server": null, 1234 | "id": "98bf3ac2-a1f5-471d-8c8f-1b706ab57ef0", 1235 | "marketplace_key": null, 1236 | "modification_date": "2014-05-22T12:56:56.984011+00:00", 1237 | "name": "my_image", 1238 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 1239 | "public": false, 1240 | "root_volume": { 1241 | "id": "f0361e7b-cbe4-4882-a999-945192b7171b", 1242 | "name": "vol-0-1" 1243 | } 1244 | }, 1245 | { 1246 | "arch": "arm", 1247 | "creation_date": "2014-05-22T12:57:22.514299+00:00", 1248 | "extra_volumes": "[]", 1249 | "from_image": null, 1250 | "from_server": null, 1251 | "id": "1f73d975-35fc-4365-9ead-8dab7e54152f", 1252 | "marketplace_key": null, 1253 | "modification_date": "2014-05-22T12:57:22.514299+00:00", 1254 | "name": "my_image_1", 1255 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 1256 | "public": false, 1257 | "root_volume": { 1258 | "id": "f0361e7b-cbe4-4882-a999-945192b7171b", 1259 | "name": "vol-0-2" 1260 | } 1261 | } 1262 | ] 1263 | } 1264 | 1265 | #### Operation on a single image [/images/{image_id}] 1266 | 1267 | + Parameters 1268 | + image_id (required, string, `98bf3ac2-a1f5-471d-8c8f-1b706ab57ef0`)... Image unique identifier 1269 | 1270 | ##### Retrieves an image [GET] 1271 | 1272 | List an individual image 1273 | 1274 | The response is an object that has a key called `image`. This key contain a standard `image` object. 1275 | 1276 | + Request (application/json) 1277 | 1278 | + Headers 1279 | 1280 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1281 | 1282 | + Response 200 (application/json) 1283 | 1284 | { 1285 | "image": { 1286 | "arch": "arm", 1287 | "creation_date": "2014-05-22T12:56:56.984011+00:00", 1288 | "extra_volumes": "[]", 1289 | "from_image": null, 1290 | "from_server": null, 1291 | "id": "98bf3ac2-a1f5-471d-8c8f-1b706ab57ef0", 1292 | "marketplace_key": null, 1293 | "modification_date": "2014-05-22T12:56:56.984011+00:00", 1294 | "name": "my_image", 1295 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 1296 | "public": false, 1297 | "root_volume": { 1298 | "id": "f0361e7b-cbe4-4882-a999-945192b7171b", 1299 | "name": "vol-0-1" 1300 | } 1301 | } 1302 | } 1303 | 1304 | ##### Update an image [PUT] 1305 | 1306 | Update details about a image 1307 | 1308 | The response is an object that has a key called `image`. This key contain a standard `image` object. 1309 | 1310 | + Request (application/json) 1311 | 1312 | + Headers 1313 | 1314 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1315 | 1316 | + Body 1317 | 1318 | { 1319 | "arch": "arm", 1320 | "creation_date": "2014-05-22T12:57:22.514299+00:00", 1321 | "extra_volumes": "[]", 1322 | "from_image": null, 1323 | "from_server": null, 1324 | "id": "1f73d975-35fc-4365-9ead-8dab7e54152f", 1325 | "marketplace_key": null, 1326 | "modification_date": "2014-05-22T12:58:42.511040+00:00", 1327 | "name": "my_image_old", 1328 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 1329 | "public": false, 1330 | "root_volume": { 1331 | "id": "f0361e7b-cbe4-4882-a999-945192b7171b", 1332 | "name": "vol-0-1" 1333 | } 1334 | } 1335 | 1336 | 1337 | + Response 200 (application/json) 1338 | 1339 | { 1340 | "image": { 1341 | "arch": "arm", 1342 | "creation_date": "2014-05-22T12:56:56.984011+00:00", 1343 | "extra_volumes": "[]", 1344 | "from_image": null, 1345 | "from_server": null, 1346 | "id": "98bf3ac2-a1f5-471d-8c8f-1b706ab57ef0", 1347 | "marketplace_key": null, 1348 | "modification_date": "2014-05-22T13:00:15.462764+00:00", 1349 | "name": "my_image_old", 1350 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 1351 | "public": false, 1352 | "root_volume": { 1353 | "id": "f0361e7b-cbe4-4882-a999-945192b7171b", 1354 | "name": "TOTO" 1355 | } 1356 | } 1357 | } 1358 | 1359 | 1360 | ##### Delete an image [DELETE] 1361 | 1362 | Delete an image 1363 | 1364 | The response code is a 204, which means that the action was successful with no returned body data. 1365 | 1366 | + Request (application/json) 1367 | 1368 | + Headers 1369 | 1370 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1371 | 1372 | + Response 204 (application/json) 1373 | 1374 | ### group IPs 1375 | 1376 | A reserved IP address is a static IP address designed for cloud computing. 1377 | Reserved IPs address allow you to mask the failure of a server rapidly reallocating the IPs address to another server in your account. 1378 | 1379 | #### IPs [/ips] 1380 | 1381 | ##### Create a new IP [POST] 1382 | 1383 | Create a new reserved IP address 1384 | 1385 | The response is an object that has a key called `ip`. This key contain a standard `ip` object. 1386 | 1387 | + Attributes 1388 | 1389 | + organization: `000a115d-2852-4b0a-9ce8-47f1134ba95a` (string, required) - Organization unique identifier 1390 | 1391 | + Request (application/json) 1392 | 1393 | + Headers 1394 | 1395 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1396 | 1397 | + Body 1398 | 1399 | { 1400 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a" 1401 | } 1402 | 1403 | + Response 201 (application/json) 1404 | 1405 | { 1406 | "ip": { 1407 | "address": "212.47.226.88", 1408 | "id": "b50cd740-892d-47d3-8cbf-88510ef626e7", 1409 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 1410 | "server": null 1411 | } 1412 | } 1413 | 1414 | ##### Retrieves all IPs addresses [GET] 1415 | 1416 | List all IPs associate with your account 1417 | 1418 | The response is an object that has a key called `ips`. This key contain an array of ip objects each of which contain the standard `ip` attributes. 1419 | 1420 | + Request (application/json) 1421 | 1422 | + Headers 1423 | 1424 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1425 | 1426 | + Response 200 (application/json) 1427 | 1428 | { 1429 | "ips": [ 1430 | { 1431 | "address": "212.47.226.88", 1432 | "id": "b50cd740-892d-47d3-8cbf-88510ef626e7", 1433 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 1434 | "server": null 1435 | } 1436 | ] 1437 | } 1438 | 1439 | #### IP [/ips/{ip_id}] 1440 | 1441 | + Parameters 1442 | + ip_id (required, string, `b50cd740-892d-47d3-8cbf-88510ef626e7`)... Ip unique identifier 1443 | 1444 | ##### Retrieve an IP address [GET] 1445 | 1446 | List an individual IP address 1447 | 1448 | The response is an object that has a key called `ip`. This key contain a standard `ip` object. 1449 | 1450 | + Request (application/json) 1451 | 1452 | + Headers 1453 | 1454 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1455 | 1456 | + Response 200 (application/json) 1457 | 1458 | { 1459 | "ip": { 1460 | "address": "212.47.226.88", 1461 | "id": "b50cd740-892d-47d3-8cbf-88510ef626e7", 1462 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 1463 | "server": null 1464 | } 1465 | } 1466 | 1467 | ##### Attach an IP address [PUT] 1468 | 1469 | Allow you to remap an IP address to another server 1470 | 1471 | The response is an object that has a key called `ip`. This key contain a standard `ip` object. 1472 | 1473 | + Request (application/json) 1474 | 1475 | + Headers 1476 | 1477 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1478 | 1479 | + Body 1480 | 1481 | { 1482 | "address": "212.47.226.88", 1483 | "id": "b50cd740-892d-47d3-8cbf-88510ef626e7", 1484 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 1485 | "server": "c2d8994f-1582-413e-8d48-c53076db06cc" 1486 | } 1487 | 1488 | 1489 | + Response 200 (application/json) 1490 | 1491 | { 1492 | "ip": { 1493 | "address": "212.47.226.88", 1494 | "id": "b50cd740-892d-47d3-8cbf-88510ef626e7", 1495 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 1496 | "server": { 1497 | "id": "c2d8994f-1582-413e-8d48-c53076db06cc", 1498 | "name": "default_server_name - acfb51" 1499 | } 1500 | } 1501 | } 1502 | 1503 | 1504 | ##### Remove an IP address [DELETE] 1505 | 1506 | Delete a server 1507 | 1508 | The response code is a 204, which means that the action was successful with no returned body data. 1509 | 1510 | + Request (application/json) 1511 | 1512 | + Headers 1513 | 1514 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1515 | 1516 | + Response 204 (application/json) 1517 | 1518 | 1519 | ### group Security groups 1520 | 1521 | Security groups are like a virtual firewall. With security groups, you can define rules that restrict network access to your servers. 1522 | 1523 | #### Security Groups [/security_groups] 1524 | 1525 | ##### Create a security group [POST] 1526 | 1527 | Create a new security group 1528 | 1529 | The response is an object that has a key called `security_group`. This key contain a standard `security_group` object. 1530 | 1531 | + Attributes 1532 | 1533 | + organization: `000a115d-2852-4b0a-9ce8-47f1134ba95a` (string, required) - Organization unique identifier 1534 | + name: `security-group-01` (string, required) - The security group name 1535 | + description: `arm` (string, required) - The security group description 1536 | 1537 | + Request (application/json) 1538 | 1539 | + Headers 1540 | 1541 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1542 | 1543 | + Body 1544 | 1545 | { 1546 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 1547 | "name": "security-group-01", 1548 | "description": "Security group 01" 1549 | } 1550 | 1551 | + Response 201 (application/json) 1552 | 1553 | { 1554 | "security_group": { 1555 | "description": "Security group 01", 1556 | "enable_default_security": true, 1557 | "id": "adb5887b-5ab5-445a-ae70-276df95a9852", 1558 | "name": "security-group-01", 1559 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 1560 | "organization_default": false, 1561 | "servers": [] 1562 | } 1563 | } 1564 | 1565 | ##### List all security groups [GET] 1566 | 1567 | List all security groups associate with your account 1568 | 1569 | The response is an object that has a key called `security_groups`. This key contain an array of security group objects each of which contain the standard `security_groups` attributes. 1570 | 1571 | + Request (application/json) 1572 | 1573 | + Headers 1574 | 1575 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1576 | 1577 | + Response 200 (application/json) 1578 | 1579 | { 1580 | "security_groups": [ 1581 | { 1582 | "description": "Base security group", 1583 | "enable_default_security": true, 1584 | "id": "000a115d-2852-4b1a-9ce8-47f1134ba95a", 1585 | "name": "Base group", 1586 | "organization": "ecc1c86a-eabb-43a7-9c0a-77e371753c0a", 1587 | "organization_default": true, 1588 | "servers": [ 1589 | { 1590 | "id": "b5614869-1967-9ce8-8cd2-801febf9a3f9", 1591 | "name": "scw-9b0823" 1592 | }, 1593 | { 1594 | "id": "4167bf23-9ce8-4790-2852-d7c5b86934df", 1595 | "name": "scw-9b088e" 1596 | } 1597 | ] 1598 | } 1599 | ] 1600 | } 1601 | 1602 | #### Operation on a security groups [/security_groups/{group_id}] 1603 | 1604 | + Parameters 1605 | + group_id (required, string, `000a115d-2852-4b1a-9ce8-47f1134ba95a`)... Security group id unique identifier 1606 | 1607 | ##### Retrieves a security group [GET] 1608 | 1609 | List an individual security group 1610 | 1611 | The response is an object that has a key called `security_group`. This key contain a standard `security_group` object. 1612 | 1613 | + Request (application/json) 1614 | 1615 | + Headers 1616 | 1617 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1618 | 1619 | + Response 200 (application/json) 1620 | 1621 | { 1622 | "security_group": { 1623 | "description": "Base security group", 1624 | "enable_default_security": true, 1625 | "id": "000a115d-2852-4b1a-9ce8-47f1134ba95a", 1626 | "name": "Base group", 1627 | "organization": "ecc1c86a-eabb-43a7-9c0a-77e371753c0a", 1628 | "organization_default": true, 1629 | "servers": [ 1630 | { 1631 | "id": "b5614869-1967-9ce8-8cd2-801febf9a3f9", 1632 | "name": "scw-9b0823" 1633 | }, 1634 | { 1635 | "id": "4167bf23-9ce8-4790-2852-d7c5b86934df", 1636 | "name": "scw-9b088e" 1637 | } 1638 | ] 1639 | } 1640 | } 1641 | 1642 | ##### Update a security group [PUT] 1643 | 1644 | Update a security group details 1645 | 1646 | The response is an object that has a key called `security_group`. This key contain a standard `security_group` object. 1647 | 1648 | + Request (application/json) 1649 | 1650 | + Headers 1651 | 1652 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1653 | 1654 | + Body 1655 | 1656 | { 1657 | "organization": "000a115d-2852-4b0a-9ce8-47f1134ba95a", 1658 | "name": "security-group-02", 1659 | "description": "Security group 02" 1660 | } 1661 | 1662 | 1663 | + Response 200 (application/json) 1664 | 1665 | { 1666 | "security_group": { 1667 | "description": "Security group 02", 1668 | "enable_default_security": true, 1669 | "id": "000a115d-2852-4b1a-9ce8-47f1134ba95a", 1670 | "name": "security-group-02", 1671 | "organization": "ecc1c86a-eabb-43a7-9c0a-77e371753c0a", 1672 | "organization_default": true, 1673 | "servers": [ 1674 | { 1675 | "id": "b5614869-1967-9ce8-8cd2-801febf9a3f9", 1676 | "name": "scw-9b0823" 1677 | }, 1678 | { 1679 | "id": "4167bf23-9ce8-4790-2852-d7c5b86934df", 1680 | "name": "scw-9b088e" 1681 | } 1682 | ] 1683 | } 1684 | } 1685 | 1686 | 1687 | ##### Delete a security group [DELETE] 1688 | 1689 | Delete a security group 1690 | 1691 | The response code is a 204, which means that the action was successful with no returned body data. 1692 | 1693 | + Request (application/json) 1694 | 1695 | + Headers 1696 | 1697 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1698 | 1699 | + Response 204 1700 | 1701 | #### Manage rules [/security_groups/{group_id}/rules] 1702 | 1703 | + Parameters 1704 | + group_id: `000a115d-2852-4b1a-9ce8-47f1134ba95a` (string, required) - Security group unique identifier 1705 | 1706 | ##### Create a new rule [POST] 1707 | 1708 | Create a new rule 1709 | 1710 | The response is an object that has a key called `rule`. This key contain a standard `rule` object. 1711 | 1712 | action: "accept" 1713 | direction: "outbound" 1714 | ip_range: "0.0.0.0/0" 1715 | protocol: "ICMP" 1716 | 1717 | + Attributes 1718 | 1719 | + organization: `required, string, `000a115d-2852-4b0a-9ce8-47f1134ba95a` (string, required) - Organization unique identifier 1720 | + action: `drop` (string, required) - The rule action (accept, drop) 1721 | + direction: `'inbound` (string, required) - The rule direction (inbound, outbound) 1722 | + ip_range: `0.0.0.0/0` (string, required) - The IPs range, must be an IPv4 range 1723 | + protocol: `TCP` (string, required) - The rule protocol (TCP, UDP, ICMP) 1724 | + dest_port_from: `25` (string, optional) The port between 1 and 65535 1725 | 1726 | + Request (application/json) 1727 | 1728 | + Headers 1729 | 1730 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1731 | 1732 | + Body 1733 | 1734 | { 1735 | "action": "drop", 1736 | "direction": "inbound", 1737 | "ip_range": "0.0.0.0/0", 1738 | "protocol": "TCP" 1739 | } 1740 | 1741 | + Response 201 (application/json) 1742 | 1743 | { 1744 | "rule": { 1745 | "direction": "inbound", 1746 | "protocol": "TCP", 1747 | "ip_range": "0.0.0.0/0", 1748 | "dest_port_from": null, 1749 | "action": "drop", 1750 | "position": 2, 1751 | "dest_port_to": null, 1752 | "editable": null, 1753 | "id": "ef2136c9-6c21-491a-b238-b38de24726a7" 1754 | } 1755 | } 1756 | 1757 | ##### List all rules [GET] 1758 | 1759 | List all rules for a security group 1760 | 1761 | The response is an object that has a key called `rules`. This key contain an array of rules for a security group each of which contain the standard `rule` attributes. 1762 | 1763 | + Request (application/json) 1764 | 1765 | + Headers 1766 | 1767 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1768 | 1769 | + Response 200 (application/json) 1770 | 1771 | { 1772 | "rules": [ 1773 | { 1774 | "direction": "outbound", 1775 | "protocol": "TCP", 1776 | "ip_range": "0.0.0.0/0", 1777 | "dest_port_from": 25, 1778 | "action": "drop", 1779 | "position": 1, 1780 | "dest_port_to": null, 1781 | "editable": false, 1782 | "id": "58909be7-d17c-4ac8-9eb3-23d5fc58abc5" 1783 | }, { 1784 | "direction": "outbound", 1785 | "protocol": "TCP", 1786 | "ip_range": "0.0.0.0/0", 1787 | "dest_port_from": 465, 1788 | "action": "drop", 1789 | "position": 2, 1790 | "dest_port_to": null, 1791 | "editable": false, 1792 | "id": "25680235-108b-4bbc-8e25-114303d950bd" 1793 | }, { 1794 | "direction": "outbound", 1795 | "protocol": "TCP", 1796 | "ip_range": "0.0.0.0/0", 1797 | "dest_port_from": 587, 1798 | "action": "drop", 1799 | "position": 3, 1800 | "dest_port_to": null, 1801 | "editable": false, 1802 | "id": "4a31b633-118e-4900-bd52-facf1085fc8d" 1803 | } 1804 | ] 1805 | } 1806 | 1807 | #### Operation on a security rule [/security_groups/{group_id}/rules/{rule_id}] 1808 | 1809 | + Parameters 1810 | + group_id: `000a115d-2852-4b1a-9ce8-47f1134ba95a` (string, required) - Security group unique identifier 1811 | + rule_id: `4a31b633-118e-4900-bd52-facf1085fc8d` (string, required) - Security rule unique identifier 1812 | 1813 | ##### Update a security rule [PUT] 1814 | 1815 | Update a security rule 1816 | 1817 | The response is an object that has a key called `rule`. This key contain a standard `rule` object. 1818 | 1819 | + Request (application/json) 1820 | 1821 | + Headers 1822 | 1823 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1824 | 1825 | + Body 1826 | 1827 | { 1828 | "action": "drop", 1829 | "direction": "outbound", 1830 | "ip_range": "0.0.0.0/0", 1831 | "protocol": "TCP" 1832 | } 1833 | 1834 | 1835 | + Response 200 (application/json) 1836 | 1837 | { 1838 | "rule": { 1839 | "direction": "outbound", 1840 | "protocol": "TCP", 1841 | "ip_range": "0.0.0.0/0", 1842 | "dest_port_from": null, 1843 | "action": "drop", 1844 | "position": 2, 1845 | "dest_port_to": null, 1846 | "editable": null, 1847 | "id": "ef2136c9-6c21-491a-b238-b38de24726a7" 1848 | } 1849 | } 1850 | 1851 | ##### Retrieves a security rule [GET] 1852 | 1853 | List an individual security rule 1854 | 1855 | The response is an object that has a key called `rule`. This key contain a standard `rule` object. 1856 | 1857 | + Request (application/json) 1858 | 1859 | + Headers 1860 | 1861 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1862 | 1863 | + Response 200 (application/json) 1864 | 1865 | { 1866 | "rule": { 1867 | "direction": "outbound", 1868 | "protocol": "TCP", 1869 | "ip_range": "0.0.0.0/0", 1870 | "dest_port_from": null, 1871 | "action": "drop", 1872 | "position": 2, 1873 | "dest_port_to": null, 1874 | "editable": null, 1875 | "id": "ef2136c9-6c21-491a-b238-b38de24726a7" 1876 | } 1877 | } 1878 | 1879 | ##### Delete a security rule [DELETE] 1880 | 1881 | Delete and deactivate a security rule 1882 | 1883 | The response code is a 204, which means that the action was successful with no returned body data. 1884 | 1885 | + Request (application/json) 1886 | 1887 | + Headers 1888 | 1889 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1890 | 1891 | + Response 204 (application/json) 1892 | 1893 | ### group Metadata 1894 | 1895 | Resources related to server Metadata available from your C1 servers at `http://169.254.42.42` 1896 | 1897 | #### C1 server metadata [/conf{?format}] 1898 | 1899 | + Parameters 1900 | + format (optional, string, `json`)... Rendering format 1901 | 1902 | ##### Serves pimouss metadata [GET] 1903 | Serves instance metadata using its own IP address as authentication token. 1904 | 1905 | + Request (application/json) 1906 | 1907 | + Headers 1908 | 1909 | X-Auth-Token: aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee 1910 | 1911 | + Response 200 (application/json) 1912 | 1913 | { 1914 | "id": "9fc9a037-5eaa-4073-9919-63adbe400ab9", 1915 | "name": "Server 2", 1916 | "organization": "11111111-1111-4111-8111-111111111111", 1917 | "private_ip": "10.42.1.2", 1918 | "public_ip": "42.1.2.3", 1919 | "ssh_public_keys": [ 1920 | "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjHvTHk5QY+JZdCvAep6APwOhZvIimlC4aybrXkGSBxpNeZI1f+AexDuFFWGZPb1y135pgTAc7VXpKD2FU2xd4EwsSTHaBcaBIs1HkhpFScTwN15IfLiefIHgjgveP/8U8AKQvCK7oecz3egjvqNtBDDj9cHySpQ6w5Zq/rtF7Ku8xAfBa78NEQrwaYvdfHqI/1APeoo61MJse+xZH2LVHX1EZp79jRbHny/0WkZifVXudDCmM9aqI3G1ZgWTWvFxHW/HTkSLz1v8OHD1ZPOEjIIKLxCoYE4kukK2eVZVUWFb+iU+u6GunwqWUa6W/g+0NzpEoSHVcasIC88d3tBZD", 1921 | "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAutWtCIFyrtcpxBevMyDrNlYabV6cCVPjfWwfuKABofuWwCSX8gP2gSnmjQCdtTwYnz/vAuAXbKxn8pxtUy4c24oRvtwqHpEsFDMpzzMzWtghQFOHEd7NWzda3yDGCaJ8OFD1IkiFad5QNKmOt8nlERBUK9cwbPjzhTnP/o2Odn5nJJ8WySn0/TWwMaHH6hpZTtKMSrIn06Fo5MviPfeZ9Loe8IfgV7llB7ITMFTUKP5vPVvMlPJi8MYeo0AYmhFhbTO5wWj8hK8AJELF9RwMCehcsxjDRxKKbxiv9RL3yIdBH0dftlaNX5rYazRp4zB2BYvfPNjhpTqrY2RdPYAvTw==" 1922 | ], 1923 | "tags": [], 1924 | "volumes": [] 1925 | } 1926 | 1927 | + Response 200 (plain/text) 1928 | 1929 | NAME='Server 2' 1930 | TAGS=0 1931 | PUBLIC_IP=42.1.2.3 1932 | SSH_PUBLIC_KEYS=2 1933 | SSH_PUBLIC_KEYS_0='ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjHvTHk5QY+JZdCvAep6APwOhZvIimlC4aybrXkGSBxpNeZI1f+AexDuFFWGZPb1y135pgTAc7VXpKD2FU2xd4EwsSTHaBcaBIs1HkhpFScTwN15IfLiefIHgjgveP/8U8AKQvCK7oecz3egjvqNtBDDj9cHySpQ6w5Zq/rtF7Ku8xAfBa78NEQrwaYvdfHqI/1APeoo61MJse+xZH2LVHX1EZp79jRbHny/0WkZifVXudDCmM9aqI3G1ZgWTWvFxHW/HTkSLz1v8OHD1ZPOEjIIKLxCoYE4kukK2eVZVUWFb+iU+u6GunwqWUa6W/g+0NzpEoSHVcasIC88d3tBZD' 1934 | SSH_PUBLIC_KEYS_1='ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAutWtCIFyrtcpxBevMyDrNlYabV6cCVPjfWwfuKABofuWwCSX8gP2gSnmjQCdtTwYnz/vAuAXbKxn8pxtUy4c24oRvtwqHpEsFDMpzzMzWtghQFOHEd7NWzda3yDGCaJ8OFD1IkiFad5QNKmOt8nlERBUK9cwbPjzhTnP/o2Odn5nJJ8WySn0/TWwMaHH6hpZTtKMSrIn06Fo5MviPfeZ9Loe8IfgV7llB7ITMFTUKP5vPVvMlPJi8MYeo0AYmhFhbTO5wWj8hK8AJELF9RwMCehcsxjDRxKKbxiv9RL3yIdBH0dftlaNX5rYazRp4zB2BYvfPNjhpTqrY2RdPYAvTw==' 1935 | PRIVATE_IP=10.42.1.2 1936 | VOLUMES=0 1937 | ORGANIZATION=11111111-1111-4111-8111-111111111111 1938 | ID=9fc9a037-5eaa-4073-9919-63adbe400ab9 1939 | --------------------------------------------------------------------------------