Revision 701eab3b

b/docs/cyclades-api-guide.rst
112 112
``/servers/detail`` GET    ✔        ✔
113 113
=================== ====== ======== ==========
114 114

  
115
* Both requests return a list of servers. The first returns just ``id`` and
116
  ``name``, while the second returns the full collections of server
117
  attributes.
115
* Both requests return a list of servers. The first returns just ``id``,
116
  ``name`` and ``links``, while the second returns the full collections of
117
  server attributes.
118 118

  
119 119
|
120 120

  
......
180 180
================= ====================== ======== ==========
181 181
id                The server id          ✔        ✔
182 182
name              The server name        ✔        ✔
183
links             Reference links        ✔        ✔
183 184
hostId            Server playground      empty    ✔
184 185
created           Creation date          ✔        ✔
185 186
updated           Creation date          ✔        ✔
......
216 217
  nic-<server-id>-<ordinal-number>. More details can be found `here
217 218
  <#nic-ref>`_.
218 219

  
219
*Example List Servers: JSON*
220

  
221
*Example List Servers: JSON (regular)*
220 222

  
221 223
.. code-block:: javascript
222 224

  
223
  {
224
    "servers": [
225
    [
226
      {
227
        "links": [
228
            {
229
                "href": "https://example.org/compute/v2.0/servers/42", 
230
                "rel": "self"
231
            }, 
232
            {
233
                "href": "https://example.org/compute/v2.0/servers/42", 
234
                "rel": "bookmark"
235
            }
236
        ],
237
        "id": "42",
238
        "name": "My Server",
239
      }, {
240
        "links": [
241
            {
242
                "href": "https://example.org/compute/v2.0/servers/43", 
243
                "rel": "self"
244
            }, 
245
            {
246
                "href": "https://example.org/compute/v2.0/servers/43", 
247
                "rel": "bookmark"
248
            }
249
        ],
250
        "id": "43",
251
        "name": "My Server",
252
      }
253
    ]
254

  
255
*Example List Servers: JSON (detail)*
256

  
257
.. code-block:: javascript
258

  
259
    [
225 260
      {
226 261
        "attachments": [
227 262
            {
......
233 268
              "ipv6": "2001:648:2ffc:1222:a800:ff:fef5:3f5b"
234 269
            }
235 270
        ],
271
        "links": [
272
            {
273
                "href": "https://example.org/compute/v2.0/servers/42", 
274
                "rel": "self"
275
            }, 
276
            {
277
                "href": "https://example.org/compute/v2.0/servers/42", 
278
                "rel": "bookmark"
279
            }
280
        ],
236 281
        "created': '2011-04-19T10:18:52.085737+00:00',
237
        "flavorRef": "1",
282
        "flavor": {
283
            "id": 1",
284
            "links": [
285
                {
286
                    "href": "https://example.org/compute/v2.0/flavors/1", 
287
                    "rel": "self"
288
                }, 
289
                {
290
                    "href": "https://example.org/compute/v2.0/flavors/1", 
291
                    "rel": "bookmark"
292
                }
293
            ]
294

  
295
        },
238 296
        "hostId": "",
239 297
        "id": "42",
240
        "imageRef": "3",
298
        "image": {
299
            "id": "im4g3-1d",
300
            "links": [
301
                {
302
                    "href": "https://example.org/compute/v2.0/images/im4g3-1d", 
303
                    "rel": "self"
304
                }, 
305
                {
306
                    "href": "https://example.org/compute/v2.0/images/im4g3-1d", 
307
                    "rel": "bookmark"
308
                }, 
309
                {
310
                    "href": "https://example.org/image/v1.0/images/im4g3-1d", 
311
                    "rel": "alternate"
312
                }
313
            ]
314
        },
241 315
        "metadata": {{"foo": "bar"},
242 316
        "name": "My Server",
243 317
        "status": "ACTIVE",
......
265 339
              "ipv6": "2001:638:2eec:1222:a800:ff:fef5:3f5c"
266 340
            }
267 341
        ],
342
        "links": [
343
            {
344
                "href": "https://example.org/compute/v2.0/servers/43", 
345
                "rel": "self"
346
            }, 
347
            {
348
                "href": "https://example.org/compute/v2.0/servers/43", 
349
                "rel": "bookmark"
350
            }
351
        ],
268 352
        "created": "2011-05-02T20:51:08.527759+00:00",
269
        "flavorRef": "1",
353
        "flavor": {
354
            "id": 1",
355
            "links": [
356
                {
357
                    "href": "https://example.org/compute/v2.0/flavors/1", 
358
                    "rel": "self"
359
                }, 
360
                {
361
                    "href": "https://example.org/compute/v2.0/flavors/1", 
362
                    "rel": "bookmark"
363
                }
364
            ]
365

  
366
        },
270 367
        "hostId": "",
271 368
        "id": "43",
272
        "imageRef": "3",
369
        "image": {
370
            "id": "im4g3-1d",
371
            "links": [
372
                {
373
                    "href": "https://example.org/compute/v2.0/images/im4g3-1d", 
374
                    "rel": "self"
375
                }, 
376
                {
377
                    "href": "https://example.org/compute/v2.0/images/im4g3-1d", 
378
                    "rel": "bookmark"
379
                }, 
380
                {
381
                    "href": "https://example.org/image/v1.0/images/im4g3-1d", 
382
                    "rel": "alternate"
383
                }
384
            ]
385
        },
273 386
        "name": "Other Server",
274 387
        "description": "A sample server to showcase server requests",
275 388
        "progress": "0",
......
277 390
        "updated": "2011-05-29T14:59:11.267087+00:00"
278 391
      }
279 392
    ]
280
  }
281 393

  
282 394

  
283 395
Create Server
......
435 547

  
436 548
  {
437 549
    "server": {
438
      "id": 28130
550
      "addresses": 
551
      "id": 28130,
552
        "links": [
553
            {
554
                "href": "https://example.org/compute/v2.0/servers/42", 
555
                "rel": "self"
556
            }, 
557
            {
558
                "href": "https://example.org/compute/v2.0/servers/42", 
559
                "rel": "bookmark"
560
            }
561
        ],
562

  
563
      "image": {
564
        "id": im4g3-1d
565
        "links": [
566
            {
567
                "href": "https://example.org/compute/v2.0/images/im4g3-1d"
568
                "rel": "self"
569
            }, {
570
                "href": "https://example.org/compute/v2.0/images/im4g3-1d"
571
                "rel": "bookmark"
572
            }, {
573
                "href": "https://example.org/image/v1.0/images/im4g3-1d"
574
                "rel": "alternate"
575
            }
576
        ]
577
      },
578
      "flavor": {
579
        "id": 289
580
        "links": [
581
            {
582
                "href": "https://example.org/compute/v2.0/flavors/289"
583
                "rel": "self"
584
            }, {
585
                "href": "https://example.org/compute/v2.0/flavors/289"
586
                "rel": "bookmark"
587
            }
588
        ]
589
      },
439 590
      "status": "BUILD",
440 591
      "updated": "2013-04-10T13:52:18.140686+00:00",
441 592
      "hostId": "",
442 593
      "name": "My Server Name: Example Name",
443
      "imageRef": "da7a211f-...-f901ce81a3e6",
444 594
      "created": "2013-04-10T13:52:17.085402+00:00",
445
      "flavorRef": 289,
446 595
      "adminPass": "fKCqlZe2at",
447 596
      "suspended": false,
448 597
      "progress": 0
......
464 613
    status="BUILD"
465 614
    hostId="",
466 615
    name="My Server Name: Example Name"
467
    imageRef="da7a211f-...-f901ce81a3e6"
468 616
    created="2013-04-10T13:52:17.085402+00:00"
469
    flavorRef="289"
470 617
    adminPass="fKCqlZe2at"
471 618
    suspended="false"
472 619
    progress="0"
620
    ...
473 621
  />
474 622

  
475 623
Get Server Stats
......
773 921

  
774 922
  {
775 923
    "server": {
776
      "id": 42042,
777
      "name": "My Example Server",
778
      "status": "ACTIVE",
779
      "updated": "2013-04-18T10:09:57.824266+00:00",
780
      "hostId": "",
781
      "imageRef": "926a1bc5-2d85-49d4-aebe-0fc127ed89b9",
782
      "created": "2013-04-18T10:06:58.288273+00:00",
783
      "flavorRef": 22,
784
      "attachments": [
785
        {
786
          "network_id": "1888",
787
          "mac_address": "aa:0c:f5:ad:16:41",
788
          "firewallProfile": "DISABLED",
789
          "ipv4": "83.212.112.56",
790
          "ipv6": "2001:648:2ffc:1119:a80c:f5ff:fead:1641",
791
          "id": "nic-42042-0"
792
        }
793
      ],
794
      "suspended": false,
795
      "diagnostics": [
796
        {
797
          "level": "DEBUG",
798
          "created": "2013-04-18T10:09:52.776920+00:00",
799
          "source": "image-info",
800
          "source_date": "2013-04-18T10:09:52.709791+00:00",
801
          "message": "Image customization finished successfully.",
802
          "details": null
803
        }
804
      ],
805
      "progress": 100,
806
      "metadata": {
807
        "OS": "windows",
808
        "users": "Administrator"
924
        "attachments": [
925
            {
926
              "network_id": "1888",
927
              "mac_address": "aa:0c:f5:ad:16:41",
928
              "firewallProfile": "DISABLED",
929
              "ipv4": "83.212.112.56",
930
              "ipv6": "2001:648:2ffc:1119:a80c:f5ff:fead:1641",
931
              "id": "nic-42042-0"
932
            }
933
        ],
934
        "links": [
935
            {
936
                "href": "https://example.org/compute/v2.0/servers/42031", 
937
                "rel": "self"
938
            }, 
939
            {
940
                "href": "https://example.org/compute/v2.0/servers/42042",
941
                "rel": "bookmark"
942
            }
943
        ],
944
        "created": "2011-05-02T20:51:08.527759+00:00",
945
        "flavor": {
946
            "id": 1,
947
            "links": [
948
                {
949
                    "href": "https://example.org/compute/v2.0/flavors/1", 
950
                    "rel": "self"
951
                }, 
952
                {
953
                    "href": "https://example.org/compute/v2.0/flavors/1", 
954
                    "rel": "bookmark"
955
                }
956
            ]
957

  
958
        },
959
        "hostId": "",
960
        "id": "42042",
961
        "image": {
962
            "id": "im4g3-1d",
963
            "links": [
964
                {
965
                    "href": "https://example.org/compute/v2.0/images/im4g3-1d", 
966
                    "rel": "self"
967
                }, 
968
                {
969
                    "href": "https://example.org/compute/v2.0/images/im4g3-1d", 
970
                    "rel": "bookmark"
971
                }, 
972
                {
973
                    "href": "https://example.org/image/v1.0/images/im4g3-1d", 
974
                    "rel": "alternate"
975
                }
976
            ]
977
        },
978
        "name": "My Example Server",
979
        "description": "A sample server to showcase server requests",
980
        "progress": "0",
981
        "status": "ACTIVE",
982
        "updated": "2011-05-29T14:59:11.267087+00:00",
983
        "suspended": false,
984
        "diagnostics": [
985
            {
986
                "level": "DEBUG",
987
                "created": "2013-04-18T10:09:52.776920+00:00",
988
                "source": "image-info",
989
                "source_date": "2013-04-18T10:09:52.709791+00:00",
990
                "message": "Image customization finished successfully.",
991
                "details": null
992
            }
993
        ],
809 994
      }
810 995
    }
811 996
  }
......
1710 1895
      {
1711 1896
        "id": 1,
1712 1897
        "name": "One code",
1898
        "links": [
1899
            {
1900
                "href": "https://example.org/compute/v2.0/flavors/1", 
1901
                "rel": "self"
1902
            }, 
1903
            {
1904
                "href": "https://example.org/compute/v2.0/flavors/1", 
1905
                "rel": "bookmark"
1906
            }
1907
        ]
1713 1908
      }, {
1714 1909
        "id": 3,
1715 1910
        "name": "Four core",
1911
        "links": [
1912
            {
1913
                "href": "https://example.org/compute/v2.0/flavors/3", 
1914
                "rel": "self"
1915
            }, 
1916
            {
1917
                "href": "https://example.org/compute/v2.0/flavors/3", 
1918
                "rel": "bookmark"
1919
            }
1920
        ]
1716 1921
      }
1717 1922
    ]
1718 1923
  }
......
1741 1946
        "ram": 1024,
1742 1947
        "SNF:disk_template": "drbd",
1743 1948
        "disk": 20,
1744
        "cpu": 1
1949
        "cpu": 1,
1950
        "links": [
1951
            {
1952
                "href": "https://example.org/compute/v2.0/flavors/1", 
1953
                "rel": "self"
1954
            }, 
1955
            {
1956
                "href": "https://example.org/compute/v2.0/flavors/1", 
1957
                "rel": "bookmark"
1958
            }
1959
        ]
1745 1960
      }, {
1746 1961
        "id": 3,
1747 1962
        "name": "Four core",
1748 1963
        "ram": 1024,
1749 1964
        "SNF:disk_template": "drbd",
1750 1965
        "disk": 40,
1751
        "cpu": 4
1966
        "cpu": 4,
1967
        "links": [
1968
            {
1969
                "href": "https://example.org/compute/v2.0/flavors/3", 
1970
                "rel": "self"
1971
            }, 
1972
            {
1973
                "href": "https://example.org/compute/v2.0/flavors/3", 
1974
                "rel": "bookmark"
1975
            }
1976
        ]
1752 1977
      }
1753 1978
    ]
1754 1979
  }
......
1823 2048
        "ram": 1024,
1824 2049
        "SNF:disk_template": "drbd",
1825 2050
        "disk": 20,
1826
        "cpu": 1
2051
        "cpu": 1,
2052
        "links": [
2053
            {
2054
                "href": "https://example.org/compute/v2.0/flavors/1", 
2055
                "rel": "self"
2056
            }, 
2057
            {
2058
                "href": "https://example.org/compute/v2.0/flavors/1", 
2059
                "rel": "bookmark"
2060
            }
2061
        ]
1827 2062
      }
1828 2063
    }
1829 2064
  }
......
1949 2184
        "created": "2013-03-02T12:21:00+00:00",
1950 2185
        "progress": 100,
1951 2186
        "id": "175716...526236",
2187
        "links": [
2188
          {
2189
            "href": "https://example.org/compute/v2.0/images/175716...526236", 
2190
            "rel": "self"
2191
          }, 
2192
          {
2193
            "href": "https://example.org/compute/v2.0/images/175716...526236", 
2194
            "rel": "bookmark"
2195
          }, 
2196
          {
2197
            "href": "https://example.org/image/v1.0/images/175716...526236", 
2198
            "rel": "alternate"
2199
          }
2200
        ],
1952 2201
        "metadata": {
1953 2202
          "partition_table": "msdos",
1954 2203
          "osfamily": "linux",
......
1965 2214
        "created": "2013-03-02T12:21:00+00:00",
1966 2215
        "progress": 100,
1967 2216
        "id": "1357163d...c526206",
2217
        "links": [
2218
          {
2219
            "href": "https://example.org/compute/v2.0/images/1357163d...c526206", 
2220
            "rel": "self"
2221
          }, 
2222
          {
2223
            "href": "https://example.org/compute/v2.0/images/1357163d...c526206", 
2224
            "rel": "bookmark"
2225
          }, 
2226
          {
2227
            "href": "https://example.org/image/v1.0/images/1357163d...c526206", 
2228
            "rel": "alternate"
2229
          }
2230
        ],
1968 2231
        "metadata": {
1969 2232
          "partition_table": "msdos",
1970 2233
          "osfamily": "windows",
......
2045 2308
    "updated": "2013-04-24T12:06:02+00:00",
2046 2309
    "created": "2013-04-24T11:52:16+00:00",
2047 2310
    "progress": 100,
2311
    "links": [
2312
      {
2313
        "href": "https://example.org/compute/v2.0/images/6404619d-...-aef57eaff4af", 
2314
        "rel": "self"
2315
      }, 
2316
      {
2317
        "href": "https://example.org/compute/v2.0/images/6404619d-...-aef57eaff4af", 
2318
        "rel": "bookmark"
2319
      }, 
2320
      {
2321
        "href": "https://example.org/image/v1.0/images/6404619d-...-aef57eaff4af", 
2322
        "rel": "alternate"
2323
      }
2324
    ],
2048 2325
    "metadata": {
2049 2326
      "kernel": "9.1 RELEASE",
2050 2327
      "osfamily": "freebsd",
......
2539 2816

  
2540 2817
  {
2541 2818
    "networks": [
2542
      {"id": "1", "name": "public"},
2543
      {"id": "2", "name": "my private network"}
2819
      {
2820
        "id": "1",
2821
        "name": "public",
2822
        "links": [
2823
            {
2824
                "href": "https://example.org/compute/v2.0/networks/1",
2825
                "rel": "self"
2826
            }, {
2827
                "href": "https://example.org/compute/v2.0/networks/1",
2828
                "rel": "bookmark"
2829
            }
2830
        ], 
2831
      },
2832
      {
2833
        "id": "2",
2834
        "name": "my private network",
2835
        "links": [
2836
            {
2837
                "href": "https://example.org/compute/v2.0/networks/2",
2838
                "rel": "self"
2839
            }, {
2840
                "href": "https://example.org/compute/v2.0/networks/2",
2841
                "rel": "bookmark"
2842
            }
2843
        ],
2844
      }
2544 2845
    ]
2545 2846
  }
2546 2847

  
......
2553 2854
      {
2554 2855
        "id": "1",
2555 2856
        "name": "public",
2857
        "links": [
2858
            {
2859
                "href": "https://example.org/compute/v2.0/networks/1", 
2860
                "rel": "self"
2861
            }, 
2862
            {
2863
                "href": "https://example.org/compute/v2.0/networks/1", 
2864
                "rel": "bookmark"
2865
            }
2866
        ], 
2556 2867
        "created": "2011-04-20T15:31:08.199640+00:00",
2557 2868
        "updated": "2011-05-06T12:47:05.582679+00:00",
2558 2869
        "attachments": ["nic-42-0", "nic-73-0"]
2559 2870
      }, {
2560 2871
        "id": 2,
2561 2872
        "name": "my private network",
2873
        "links": [
2874
            {
2875
                "href": "https://example.org/compute/v2.0/networks/2", 
2876
                "rel": "self"
2877
            }, 
2878
            {
2879
                "href": "https://example.org/compute/v2.0/networks/2", 
2880
                "rel": "bookmark"
2881
            }
2882
        ], 
2562 2883
        "created": "2011-04-20T14:32:08.199640+00:00",
2563 2884
        "updated": "2011-05-06T11:40:05.582679+00:00",
2564 2885
        "attachments": ["nic-42-2", "nic-7-3"]
......
2671 2992
      "status": "PENDING",
2672 2993
      "updated": "2013-04-25T13:31:17.165237+00:00",
2673 2994
      "name": "my private network",
2995
      "links": [
2996
        {
2997
            "href": "https://example.org/compute/v2.0/networks/6567",
2998
            "rel": "self"
2999
        }, {
3000
            "href": "https://example.org/compute/v2.0/networks/6567",
3001
            "rel": "bookmark"
3002
        }
3003
      ], 
2674 3004
      "created": "2013-04-25T13:31:17.165088+00:00",
2675 3005
      "cidr6": null,
2676 3006
      "id": "6567",
......
2741 3071
      "status": "PENDING",
2742 3072
      "updated": "2013-04-25T13:31:17.165237+00:00",
2743 3073
      "name": "my private network",
3074
      "links": [
3075
        {
3076
            "href": "https://example.org/compute/v2.0/networks/6567", 
3077
            "rel": "self"
3078
        }, {
3079
            "href": "https://example.org/compute/v2.0/networks/6567", 
3080
            "rel": "bookmark"
3081
        }
3082
      ],
2744 3083
      "created": "2013-04-25T13:31:17.165088+00:00",
2745 3084
      "cidr6": null,
2746 3085
      "id": "6567",

Also available in: Unified diff