Revision 860432a5

b/docs/compute-api-guide.rst
516 516
personality Personality contents   ✔        ✔
517 517
metadata    Custom metadata        ✔        ✔
518 518
networks    Connection information ✔        ✔
519
project     Project UUID           ✔        **✘**
519
.. project  .. Project UUID        .. ✔     .. **✘**
520 520
=========== ====================== ======== ==========
521 521

  
522 522
* **name** can be any string
......
1590 1590
`Confirm Resized <#os-compute-specific>`_       **✘**    ✔
1591 1591
`Revert Resized <#os-compute-specific>`_        **✘**    ✔
1592 1592
`Create Image <#os-compute-specific>`_          **✘**    ✔
1593
.. `Reassign to project <#server-reassign>`_    .. ✔     .. **✘**
1593 1594
=============================================== ======== ==========
1594 1595

  
1595 1596
.. rubric:: Request
......
1674 1675

  
1675 1676
  resize: {flavorRef: <flavor ID>}
1676 1677

  
1678
*Example Resize Server: JSON*
1679

  
1677 1680
.. code-block:: javascript
1678 1681

  
1679 1682
  {"resize" : { "flavorRef": 153}}
......
1764 1767

  
1765 1768
.. note:: Response body should be empty
1766 1769

  
1770
.. Server reassign
1771
.. .............
1772

  
1773
.. Each resource is assigned to a project. A Synnefo project is a set of resource
1774
.. limits e.g., maximum number of CPU cores per user, maximum ammount of RAM, etc.
1775

  
1776
.. Although its resource is assigned exactly one project, a user may be a member
1777
.. of more, so that different resources are registered to different projects.
1778

  
1779
.. Project reassignment is the process of assigning a project to a different
1780
.. project
1781

  
1782
.. Request body contents::
1783
..   reassign: { project: <project ID>}
1784

  
1785
.. .. code-block:: javascript
1786
..   "reassign": { "project": "s0m3-pr0j3ct-1d"}
1787

  
1767 1788
OS/Compute Specific
1768 1789
...................
1769 1790

  
......
1838 1859

  
1839 1860
.. code-block:: javascript
1840 1861

  
1862
  GET https://example.org/compute/v2.0/flavors
1863

  
1841 1864
  {
1842 1865
    "flavors": [
1843 1866
      {
......
1886 1909

  
1887 1910
.. code-block:: javascript
1888 1911

  
1912
  GET https://example.org/compute/v2.0/flavors/detail
1913

  
1889 1914
  {
1890 1915
    "flavors": [
1891 1916
      {
......
1894 1919
        "ram": 1024,
1895 1920
        "SNF:disk_template": "drbd",
1896 1921
        "disk": 20,
1897
        "cpu": 1,
1922
        "vcpus": 1,
1898 1923
        "links": [
1899 1924
            {
1900 1925
                "href": "https://example.org/compute/v2.0/flavors/1", 
......
1911 1936
        "ram": 1024,
1912 1937
        "SNF:disk_template": "drbd",
1913 1938
        "disk": 40,
1914
        "cpu": 4,
1939
        "vcpus": 4,
1915 1940
        "links": [
1916 1941
            {
1917 1942
                "href": "https://example.org/compute/v2.0/flavors/3", 
......
1929 1954
Get Flavor Details
1930 1955
------------------
1931 1956

  
1932
Get the configuration of a specific flavor
1933

  
1934 1957
.. rubric:: Request
1935 1958

  
1936 1959
======================= ====== ======== ==========
......
1939 1962
``/flavors/<flavor-id`` GET    ✔        ✔
1940 1963
======================= ====== ======== ==========
1941 1964

  
1942
* **flavor-id** is the identifier of the flavor
1943

  
1944 1965
|
1945

  
1946 1966
==============  ========================= ======== ==========
1947 1967
Request Header  Value                     Cyclades OS/Compute
1948 1968
==============  ========================= ======== ==========
......
1950 1970
==============  ========================= ======== ==========
1951 1971

  
1952 1972
|
1953

  
1954 1973
================= ===============
1955 1974
Request Parameter Value
1956 1975
================= ===============
......
1958 1977
xml               Respond in xml
1959 1978
================= ===============
1960 1979

  
1961
.. note:: Request body should be empty
1962

  
1963 1980
.. rubric:: Response
1964 1981

  
1965 1982
=========================== =====================
......
1986 2003

  
1987 2004
*Example Flavor Details: JSON*
1988 2005

  
2006
  GET https://example.org/compute/v2.0/flavors/1
2007

  
1989 2008
.. code-block:: javascript
1990 2009

  
1991 2010
  {
......
1996 2015
        "ram": 1024,
1997 2016
        "SNF:disk_template": "drbd",
1998 2017
        "disk": 20,
1999
        "cpu": 1,
2018
        "vcpus": 1,
2000 2019
        "links": [
2001 2020
            {
2002 2021
                "href": "https://example.org/compute/v2.0/flavors/1", 
......
2011 2030
    }
2012 2031
  }
2013 2032

  
2014
*Example Flavor Details: XML*
2015

  
2016
.. code-block:: xml
2017

  
2018
  <?xml version="1.0" encoding="UTF-8"?>
2019
  <flavor xmlns="http://docs.openstack.org/compute/api/v1"
2020
    xmlns:atom="http://www.w3.org/2005/Atom"
2021
    id="1" name="One core" ram="1024" disk="20" cpu="1" />
2022

  
2023 2033
List Images
2024 2034
-----------
2025 2035

  
......
2035 2045
=================== ====== ======== ==========
2036 2046

  
2037 2047
|
2038

  
2039 2048
==============  ========================= ======== ==========
2040 2049
Request Header  Value                     Cyclades OS/Compute
2041 2050
==============  ========================= ======== ==========
......
2043 2052
==============  ========================= ======== ==========
2044 2053

  
2045 2054
|
2046

  
2047 2055
================= ======================== ======== ==========
2048 2056
Request Parameter Value                    Cyclades OS/Compute
2049 2057
================= ======================== ======== ==========
......
2061 2069
  [- POLL_LIMIT ... now]. POLL_LIMIT default value is 3600 seconds except if it
2062 2070
  is set otherwise at server side.
2063 2071

  
2064
.. note:: Request body should be empty
2065

  
2066 2072
.. rubric:: Response
2067 2073

  
2068 2074
=========================== =====================
......
2100 2106

  
2101 2107
.. code-block:: javascript
2102 2108

  
2109
  GET https://example.org/compute/v2.0/images
2110

  
2103 2111
  {
2104 2112
    "images: [
2105 2113
      {
2106 2114
        "status": "ACTIVE",
2107 2115
        "updated": "2013-03-02T15:57:03+00:00",
2108
        "name": "edx_saas",
2116
        "name": "Verbal description",
2109 2117
        "created": "2013-03-02T12:21:00+00:00",
2110
        "progress": 100,
2111
        "id": "175716...526236",
2118
        "id": "s0m3-1m4g3-1d",
2112 2119
        "links": [
2113 2120
          {
2114
            "href": "https://example.org/compute/v2.0/images/175716...526236", 
2121
            "href": "https://example.org/compute/v2.0/images/s0m3-1m4g3-1d", 
2115 2122
            "rel": "self"
2116 2123
          }, 
2117 2124
          {
2118
            "href": "https://example.org/compute/v2.0/images/175716...526236", 
2125
            "href": "https://example.org/compute/v2.0/images/s0m3-1m4g3-1d", 
2119 2126
            "rel": "bookmark"
2120
          }, 
2121
          {
2122
            "href": "https://example.org/image/v1.0/images/175716...526236", 
2123
            "rel": "alternate"
2124 2127
          }
2125 2128
        ],
2126 2129
        "metadata": {
2127
          "partition_table": "msdos",
2128
          "osfamily": "linux",
2129
          "users": "root saasbook",
2130
          "exclude_task_changepassword": "yes",
2131
          "os": "ubuntu",
2132
          "root_partition": "1",
2133
          "description": "Ubuntu 12.04 LTS"
2130
          "PARTITION_TABLE": "msdos",
2131
          "OSFAMILY": "linux",
2132
          "USERS": "root",
2133
          "OS": "ubuntu",
2134 2134
        }
2135 2135
      }, {
2136 2136
        "status": "ACTIVE",
......
2138 2138
        "name": "edx_saas",
2139 2139
        "created": "2013-03-02T12:21:00+00:00",
2140 2140
        "progress": 100,
2141
        "id": "1357163d...c526206",
2141
        "id": "07h3r-1m4g3-1d",
2142 2142
        "links": [
2143 2143
          {
2144
            "href": "https://example.org/compute/v2.0/images/1357163d...c526206", 
2144
            "href": "https://example.org/compute/v2.0/images/07h3r-1m4g3-1d", 
2145 2145
            "rel": "self"
2146 2146
          }, 
2147 2147
          {
2148
            "href": "https://example.org/compute/v2.0/images/1357163d...c526206", 
2148
            "href": "https://example.org/compute/v2.0/images/07h3r-1m4g3-1d", 
2149 2149
            "rel": "bookmark"
2150
          }, 
2151
          {
2152
            "href": "https://example.org/image/v1.0/images/1357163d...c526206", 
2153
            "rel": "alternate"
2154 2150
          }
2155 2151
        ],
2156 2152
        "metadata": {
2157
          "partition_table": "msdos",
2158
          "osfamily": "windows",
2159
          "users": "Administratior",
2160
          "exclude_task_changepassword": "yes",
2161
          "os": "WinME",
2162
          "root_partition": "1",
2163
          "description": "Rerto Windows"
2153
          "PARTITION_TABLE": "ext3",
2154
          "OSFAMILY": "Linux",
2155
          "USERS": "root",
2156
          "OS": "Debian"
2164 2157
        }
2165 2158
      }
2166 2159
    ]
......
2179 2172
``/images/<image-id>`` GET    ✔        ✔
2180 2173
====================== ====== ======== ==========
2181 2174

  
2182
* **image-id** is the identifier of the virtual image
2183

  
2184 2175
|
2185

  
2186 2176
==============  ========================= ======== ==========
2187 2177
Request Header  Value                     Cyclades OS/Compute
2188 2178
==============  ========================= ======== ==========
2189 2179
X-Auth-Token    User authentication token required required
2190 2180
==============  ========================= ======== ==========
2191 2181

  
2192
.. note:: Request parameters should be empty
2193

  
2194
.. note:: Request body should be empty
2195

  
2196 2182
.. rubric:: Response
2197 2183

  
2198 2184
=========================== =====================
......
2225 2211

  
2226 2212
.. code-block:: javascript
2227 2213

  
2214
  GET https://example.org/compute/v2.0/images/s0m3-1m4g3-1d
2215

  
2228 2216
  {
2229
  "image": {
2230
    "id": "6404619d-...-aef57eaff4af",
2231
    "name": "FreeBSD",
2232
    "status": "ACTIVE",
2233
    "updated": "2013-04-24T12:06:02+00:00",
2234
    "created": "2013-04-24T11:52:16+00:00",
2235
    "progress": 100,
2236
    "links": [
2217
    "image":
2237 2218
      {
2238
        "href": "https://example.org/compute/v2.0/images/6404619d-...-aef57eaff4af", 
2239
        "rel": "self"
2240
      }, 
2241
      {
2242
        "href": "https://example.org/compute/v2.0/images/6404619d-...-aef57eaff4af", 
2243
        "rel": "bookmark"
2244
      }, 
2245
      {
2246
        "href": "https://example.org/image/v1.0/images/6404619d-...-aef57eaff4af", 
2247
        "rel": "alternate"
2248
      }
2249
    ],
2250
    "metadata": {
2251
      "kernel": "9.1 RELEASE",
2252
      "osfamily": "freebsd",
2253
      "users": "root",
2254
      "gui": "No GUI",
2255
      "sortorder": "9",
2256
      "os": "freebsd",
2257
      "root_partition": "2",
2258
      "description": "FreeBSD 9"
2259
      }
2219
        "status": "ACTIVE",
2220
        "updated": "2013-03-02T15:57:03+00:00",
2221
        "name": "Verbal description",
2222
        "created": "2013-03-02T12:21:00+00:00",
2223
        "id": "s0m3-1m4g3-1d",
2224
        "links": [
2225
          {
2226
            "href": "https://example.org/compute/v2.0/images/s0m3-1m4g3-1d", 
2227
            "rel": "self"
2228
          }, 
2229
          {
2230
            "href": "https://example.org/compute/v2.0/images/s0m3-1m4g3-1d", 
2231
            "rel": "bookmark"
2232
          }
2233
        ],
2234
        "metadata": {
2235
          "PARTITION_TABLE": "msdos",
2236
          "OSFAMILY": "linux",
2237
          "USERS": "root",
2238
          "OS": "ubuntu",
2239
        }
2260 2240
    }
2261
  }
2262

  
2241
}
2263 2242

  
2264 2243
Delete Image
2265 2244
------------
......
2274 2253
``/images/<image id>`` DELETE ✔        ✔
2275 2254
====================== ====== ======== ==========
2276 2255

  
2277
* **image id** is the identifier of the image
2278

  
2279 2256
|
2280

  
2281 2257
==============  ========================= ======== ==========
2282 2258
Request Header  Value                     Cyclades OS/Compute
2283 2259
==============  ========================= ======== ==========
2284 2260
X-Auth-Token    User authentication token required required
2285 2261
==============  ========================= ======== ==========
2286 2262

  
2287
.. note:: Request parameters should be empty
2288

  
2289
.. note:: Request body should be empty
2290

  
2291 2263
.. rubric:: Response
2292 2264

  
2293 2265
=========================== =====================
......
2316 2288
``/images/<image-id>/metadata`` GET    ✔        ✔
2317 2289
=============================== ====== ======== ==========
2318 2290

  
2319
* **image-id** is the identifier of the virtual image
2320

  
2321 2291
|
2322 2292
==============  ========================= ======== ==========
2323 2293
Request Header  Value                     Cyclades OS/Compute
......
2325 2295
X-Auth-Token    User authentication token required required
2326 2296
==============  ========================= ======== ==========
2327 2297

  
2328
.. note:: Request parameters should be empty
2329

  
2330
.. note:: Request body should be empty
2331

  
2332 2298
.. rubric:: Response
2333 2299

  
2334 2300
=========================== =====================
......
2356 2322

  
2357 2323
.. code-block:: javascript
2358 2324

  
2325
  GET https://example.org/compute/v2.0/images/s0m3-1m4g3-1d/metadata
2326

  
2359 2327
  {
2360 2328
    "metadata": {
2361
      "partition_table": "msdos",
2362
      "kernel": "3.2.0",
2363
      "osfamily": "linux",
2364
      "users": "user",
2365
      "gui": "Unity 5",
2366
      "sortorder": "3",
2367
      "os": "ubuntu",
2368
      "root_partition": "1",
2369
      "description": "Ubuntu 12 LTS"
2329
      "PARTITION_TABLE": "msdos",
2330
      "OSFAMILY": "linux",
2331
      "USERS": "root",
2332
      "OS": "ubuntu",
2370 2333
    }
2371 2334
  }
2372 2335

  
......
2395 2358
``/images/<image-id>/metadata`` POST   ✔        ✔
2396 2359
=============================== ====== ======== ==========
2397 2360

  
2398
* **image-id** is the identifier of the virtual image
2399

  
2400 2361
|
2401 2362
==============  ========================= ======== ==========
2402 2363
Request Header  Value                     Cyclades OS/Compute
......
2406 2367
Content-Length  Length of request body    required required
2407 2368
==============  ========================= ======== ==========
2408 2369

  
2409
**Example Request Headers**::
2410

  
2411
  X-Auth-Token:   z31uRXUn1LZy45p1r7V==
2412
  Content-Type:   application/json
2413
  Content-Length: 52
2414

  
2415 2370
.. note:: Request parameters should be empty
2416 2371

  
2417 2372
Request body content::
......
2425 2380

  
2426 2381
.. code-block:: javascript
2427 2382

  
2428
  {"metadata": {"NewAttr": "NewVal", "os": "Xubuntu'}}
2383
  POST https://example.org/compute/v2.0/images/s0m3-1m4g3-1d/metadata
2384

  
2385
  {"metadata": {"NewAttr": "NewVal", "OS": "Xubuntu'}}
2429 2386

  
2430 2387
.. rubric:: Response
2431 2388

  
......
2456 2413

  
2457 2414
  {
2458 2415
    "metadata": {
2459
      "partition_table": "msdos",
2460
      "kernel": "3.2.0",
2461
      "osfamily": "linux",
2462
      "users": "user",
2463
      "gui": "Unity 5",
2464
      "sortorder": "3",
2465
      "os": "Xubuntu",
2466
      "root_partition": "1",
2467
      "description": "Ubuntu 12 LTS",
2468
      "NewAttr": "NewVal"
2416
      "PARTITION_TABLE": "msdos",
2417
      "OSFAMILY": "linux",
2418
      "USERS": "root",
2419
      "OS": "Xubuntu",
2420
      "NEWATTR": "NewVal"
2469 2421
    }
2470 2422
  }
2471 2423

  
......
2480 2432
``/images/<image-id>/metadata/<key>`` GET    ✔        ✔
2481 2433
===================================== ====== ======== ==========
2482 2434

  
2483
* **image-id** is the identifier of the image
2484

  
2485
* **key** is the key of a mata ``key``:``value`` pair
2486

  
2487 2435
|
2488

  
2489 2436
==============  ========================= ======== ==========
2490 2437
Request Header  Value                     Cyclades OS/Compute
2491 2438
==============  ========================= ======== ==========
2492 2439
X-Auth-Token    User authentication token required required
2493 2440
==============  ========================= ======== ==========
2494 2441

  
2495
.. note:: Request parameters should be empty
2496

  
2497
.. note:: Request body should be empty
2498

  
2499 2442
.. rubric:: Response
2500 2443

  
2501 2444
=========================== =====================
......
2519 2462

  
2520 2463
.. code-block:: javascript
2521 2464

  
2522
  {"metadata": {"os": "Xubuntu"}}
2465
  GET https://example.org/compute/v2.0/images/s0m3-1m4g3-1d/metadata/OS
2466

  
2467
  {"metadata": {"OS": "Xubuntu"}}
2523 2468

  
2524 2469
.. note:: In OS/Compute, ``metadata`` is ``meta``
2525 2470

  
......
2534 2479
``/images/<image-id>/metadata/<key>`` PUT    ✔        ✔
2535 2480
===================================== ====== ======== ==========
2536 2481

  
2537
* **image-id** is the identifier of the image
2538

  
2539
* **key** is the key of a matadata ``key``:``value`` pair
2540

  
2541 2482
|
2542

  
2543 2483
==============  ========================= ======== ==========
2544 2484
Request Header  Value                     Cyclades OS/Compute
2545 2485
==============  ========================= ======== ==========
......
2548 2488
Content-Length  Length of request body    required required
2549 2489
==============  ========================= ======== ==========
2550 2490

  
2551
**Example Request Headers**::
2552

  
2553
  X-Auth-Token:   z31uRXUn1LZy45p1r7V==
2554
  Content-Type:   application/json
2555
  Content-Length: 27
2556

  
2557
|
2558

  
2559 2491
.. note:: Request parameters should be empty
2560 2492

  
2561 2493
Request body content::
......
2566 2498

  
2567 2499
.. code-block:: javascript
2568 2500

  
2569
  {"metadata": {"os": "Kubuntu"}}
2501
  PUT https://example.org/compute/v2.0/images/s0m3-1m4g3-1d/metadata/OS
2502
  {
2503
    "metadata": {"OS": "Kubuntu"}
2504
  }
2570 2505

  
2571 2506
.. rubric:: Response
2572 2507

  
......
2592 2527

  
2593 2528
.. code-block:: javascript
2594 2529

  
2595
  {"metadata": {"os": "Kubuntu"}}
2530
  {"metadata": {"OS": "Kubuntu"}}
2596 2531

  
2597 2532
Delete Image Metadata
2598 2533
---------------------
......
2607 2542
``/images/<image-id>/metadata/<key>`` DELETE ✔        ✔
2608 2543
===================================== ====== ======== ==========
2609 2544

  
2610
* **image-id** is the identifier of the image
2611

  
2612
* **key** is the key of a mata ``key``:``value`` pair
2613

  
2614 2545
|
2615 2546
==============  ========================= ======== ==========
2616 2547
Request Header  Value                     Cyclades OS/Compute
......
2618 2549
X-Auth-Token    User authentication token required required
2619 2550
==============  ========================= ======== ==========
2620 2551

  
2621
.. note:: Request parameters should be empty
2622

  
2623
.. note:: Request body should be empty
2624

  
2625 2552
.. rubric:: Response
2626 2553

  
2627 2554
=========================== =====================
......
2637 2564
503 (Service Unavailable)   The server is not currently available
2638 2565
=========================== =====================
2639 2566

  
2640
.. note:: In case of a 204 code, the response body should be empty.
2641

  
2642 2567
Index of Attributes
2643 2568
-------------------
2644 2569

  
......
2781 2706
SNF:disk_template Storage mechanism    ✔        **✘**
2782 2707
disk              Server disk size     ✔        ✔
2783 2708
vcpus             # of Virtual CPUs    ✔        ✔
2784
links rel         Atom link rel field  **✘**
2785
links href        Atom link href field **✘**
2709
links rel         Atom link rel field  
2710
links href        Atom link href field 
2786 2711
================= ==================== ======== ==========
2787 2712

  
2788 2713
* **id** is the flavor unique id (a possitive integer)
2789

  
2790 2714
* **name** is the flavor name (a string)
2791

  
2792 2715
* **ram** is the server RAM size in MB
2793

  
2794 2716
* **SNF:disk_template** is a reference to the underlying storage mechanism
2795
  used by the Cyclades server. It is Cyclades specific.
2796

  
2717
  used by the Cyclades server (e.g., drdb, ext_elmc).
2797 2718
* **disk** the servers disk size in GB
2798

  
2799 2719
* **vcpus** refer to the number of virtual CPUs assigned to a server
2800

  
2801 2720
* **link ref** and **link href** refer to the Atom link attributes that are
2802 2721
  `used in OS/Compute API <http://docs.openstack.org/api/openstack-compute/2/content/List_Flavors-d1e4188.html>`_.
2803 2722

  

Also available in: Unified diff