File: quantum-api-guide.xml

package info (click to toggle)
quantum 2012.1-5%2Bdeb70u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,028 kB
  • sloc: python: 19,594; xml: 2,611; sh: 485; makefile: 105
file content (2011 lines) | stat: -rw-r--r-- 92,747 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book [
        <!-- Some useful entities borrowed from HTML -->
        <!ENTITY ndash  "&#x2013;">
        <!ENTITY mdash  "&#x2014;">
        <!ENTITY hellip "&#x2026;">
        <!ENTITY plusmn "&#xB1;">

        <!-- Useful for describing APIs -->
        <!ENTITY GET    '<command xmlns="http://docbook.org/ns/docbook">GET</command>'>
        <!ENTITY PUT    '<command xmlns="http://docbook.org/ns/docbook">PUT</command>'>
        <!ENTITY POST   '<command xmlns="http://docbook.org/ns/docbook">POST</command>'>
        <!ENTITY DELETE '<command xmlns="http://docbook.org/ns/docbook">DELETE</command>'>

        <!ENTITY CHECK  '<inlinemediaobject xmlns="http://docbook.org/ns/docbook">
                 <imageobject role="fo">
                  <imagedata fileref="figures/Check_mark_23x20_02.svg"
                             format="SVG" scale="60"/>
                </imageobject>
                 <imageobject role="html">
                  <imagedata fileref="../figures/Check_mark_23x20_02.png"
                             format="PNG" />
                </imageobject>
              </inlinemediaobject>'>

        <!ENTITY ARROW  '<inlinemediaobject xmlns="http://docbook.org/ns/docbook">
                 <imageobject role="fo">
                  <imagedata fileref="figures/Arrow_east.svg"
                             format="SVG" scale="60"/>
                </imageobject>
                 <imageobject role="html">
                  <imagedata fileref="../figures/Arrow_east.png"
                             format="PNG" />
                </imageobject>
              </inlinemediaobject>'>
]>
<book xmlns="http://docbook.org/ns/docbook"
      xmlns:xlink="http://www.w3.org/1999/xlink"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:svg="http://www.w3.org/2000/svg"
      xmlns:m="http://www.w3.org/1998/Math/MathML"
      xmlns:html="http://www.w3.org/1999/xhtml"
      xmlns:db="http://docbook.org/ns/docbook"
      version="5.0" status="final"
    xml:id="Quantum-api-spec">
    <title>Quantum API Guide (1.0)</title>
    <titleabbrev>Quantum API 1.0</titleabbrev>
    <info>
        <author>
            <personname>
                <firstname/>
                <surname/>
            </personname>
        </author>
        <copyright>
            <year>2011</year>
            <holder>OpenStack</holder>
        </copyright>
        <releaseinfo>Quantum API v1.0</releaseinfo>
        <productname>OpenStack Quantum (virtual network service)</productname>
        <pubdate>2011-09-22</pubdate>
        <legalnotice role="apache2">
            <annotation>
                <remark>Copyright details are filled in by the template.</remark>
            </annotation>
        </legalnotice>
        <abstract>
            <para>This document is intended for software developers interested in developing
                applications using the OpenStack Quantum Layer-2 Networking Service
                    (<abbrev>API</abbrev>). </para>
        </abstract>
    </info>
    <chapter xml:id="Overview-d1e71">
        <title>Overview</title>
        <para>
            Quantum is a project to provide "network connectivity as a
            service" between devices managed by the OpenStack compute service.
            For more information on Quantum and the other network-related
            projects please check the Quantum home page
            (<link xlink:href="http://wiki.openstack.org/Quantum"/>)
            and the NetStack home page
            (<link xlink:href="http://wiki.openstack.org/Network"/>).
        </para>
        <para> We welcome feedback, comments, and bug reports at <link
            xlink:href="http://bugs.launchpad.net/Quantum">bugs.launchpad.net/Quantum</link>.
        </para>
        <section xml:id="Intended_Audience-d1e85">
            <title>Intended Audience</title>
            <para> This Guide is intended to assist software
            developers who want to develop applications using the
            Quantum API. To use the information provided
            here, you should first have a general understanding of the
            OpenStack Quantum network service, the OpenStack compute
            service (Nova), and the integration between the two.
            The user should also have access to a plugin providing the
            implementation for the API described in this document.
            Two plugins are included in the Quantum distribution:
			</para>
            <itemizedlist spacing="compact">
                <listitem>
                    <para>Openvswitch - Implementing Quantum API with Open vSwitch</para>
                </listitem>
                <listitem>
                    <para>Cisco - Implementing Quantum API for Cisco UCS blades and
                    Nexus switches</para>
                </listitem>
            </itemizedlist>
            <para>
            You should also be familiar with:
			</para>
            <itemizedlist spacing="compact">
                <listitem>
                    <para>ReSTful web services</para>
                </listitem>
                <listitem>
                    <para>HTTP/1.1</para>
                </listitem>
                <listitem>
                    <para>JSON and/or XML data serialization formats</para>
                </listitem>
            </itemizedlist>
        </section>
        <section xml:id="Document_Change_History-d1e118">
            <title>Document Change History</title>
            <para>The most recent changes are described in the table below:</para>
            <informaltable rules='all'>
                    <thead>
                        <tr>
                            <td align="center" colspan="1">Revision Date</td>
                            <td align="center" colspan="4">Summary of Changes</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td colspan="1" align="center">September 22, 2011</td>
                            <td colspan="4">
                                 <itemizedlist spacing="compact">
                                     <listitem>
                                         <para>
                                             Initial release.
                                         </para>
                                    </listitem>
                                </itemizedlist>
                            </td>
                        </tr>
                    </tbody>
            </informaltable>
        </section>
        <?hard-pagebreak?>
        <section xml:id="Glossary">
        	<title>Glossary</title>
        	<informaltable rules='all'>
                    <thead>
                        <tr>
                            <td colspan="1" align="center">Term</td>
                            <td colspan="4" align="center">Description</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td colspan="1" align="center">
                            Entity
                            </td>
                            <td colspan="4">
                            A generic term for any piece of hardware or
                            software desiring to connect to the network
                            services provided by Quantum. An entity may
                            make use of Quantum by implementing a VIF.
                            </td>
                        </tr>
                        <tr>
                            <td colspan="1" align="center" bgcolor="#4F91BD">
                            Layer-2 network
                            </td>
                            <td colspan="4" bgcolor="#4F91BD">
                            A virtual Ethernet network managed by the Quantum
                            service. For the time being, Quantum will manage
                            only Ethernet networks.
                            </td>
                        </tr>
                        <tr>
                            <td align="center">
                            Network
                            </td>
                            <td colspan="4">
                            A virtual network providing connectivity
                            between entities, i.e.: collection of virtual
                            ports sharing network connectivity. In the
                            Quantum terminology, a network is always a Layer-2
                            network.
                            </td>
                        </tr>
                        <tr>
                            <td align="center" bgcolor="#4F91BD">
                            Plugin
                            </td>
                            <td colspan="4" bgcolor="#4F91BD">
                            Software component providing the actual
                            implementation for Quantum APIs.
                            </td>
                        </tr>
                        <tr>
                            <td align="center">
                            Port
                            </td>
                            <td colspan="4">
                            A port on the virtual network switch represented
                            by a Quantum virtual Layer-2 network.
                            </td>
                        </tr>
                        <tr>
                            <td align="center" bgcolor="#4F91BD">
                            VIF
                            </td>
                            <td colspan="4" bgcolor="#4F91BD">
                            A Virtual network InterFace plugged into a port of a Quantum
                            network; typically a virtual network interface
                            belonging to a VM
                            </td>
                        </tr>
                        <tr>
                            <td align="center">
                            Attachment
                            </td>
                            <td colspan="4">
                            Association of an interface identifier to a logical
                            port, which represent 'plugging' an interface into
                            a port.
                            </td>
                        </tr>
                    </tbody>
        	</informaltable>
        </section>
        <?hard-pagebreak?>
	    <section xml:id="Theory">
	    	<title>Theory of Operation</title>
	    	<para>
			This section presents the objects and semantics of Quantum’s
			logical model.
			</para><para>
			Quantum abstracts the physical implementation of the network,
			allowing plugins to configure and manage physical resources.
			Quantum is a standalone service, in that it requires no other
			project within OpenStack to function correctly.
			</para><para>
			Further Quantum is agnostic to the entities it allows to connect.
			While we anticipate Nova instances will be a heavy user of
			Quantum, any entity can make use of any Quantum created network
			so long as it provides an appropriate interfaces for exposing VIFs
			to Quantum itself.
			</para><para>
			Virtual Interfaces(VIF) in the logical model are analogous to
			physical network interface cards (NICs). VIFs are typically
			owned a managed by an external service; for instance when
			Quantum is used for building OpenStack networks,
			VIFs would be created, owned, and managed in Nova.
			VIFs are connected to Quantum networks via ports.
			A port is analogous to a port on a network switch, and it
			has an administrative state. Quantum API
			allows for controlling the administrative state of the port,
			which can be either 'DOWN' or 'ACTIVE'.
			</para><para>
			When a VIF is attached to a port the Quantum API creates
			an attachment object, which specifies the fact that a VIF with a
			given identifier is plugged into the port.
			</para><para>
			The Quantum plugin is responsible for managing virtual and/or
			physical network switches to implement the network forwarding
			connectivity described by the Quantum networks, ports, and
			attachments.
			</para><para>
			VIFs attached to ACTIVE ports are required to have access to the
			L2 broadcast domain defined by the network where they are attached.
			Each VIF shall be capable of exchanging traffic with all other
			entities attached through ACTIVE ports.
	    	</para>
	   </section>
	   <?hard-pagebreak?>
    </chapter>
    <chapter xml:id="Concepts-d1e369">
        <?dbhtml stop-chunking?>
        <title>Concepts</title>
        <para>
        To use the Quantum API effectively, developers should understand
        the concepts introduced in this chapter.
        </para>
        <section xml:id="Network">
            <title>Network</title>
            <para>
			Each tenant can define one or more networks. A network is a virtual
			isolated layer-2 broadcast domain reserved to the tenant.
			A tenant can create several ports for a network, and plug
			virtual interfaces into these ports.
			</para>
        </section>
        <section xml:id="Port">
            <title>Port</title>
            <para>
			A port represents a virtual switch port on a logical
			network switch where all the interfaces attached to a given
			network are connected.
			</para><para>
			A port has an administrative state which
			is either 'DOWN' or 'ACTIVE'. Ports which are administratively
			down will not be able to receive/send traffic.
			</para>
        </section>
        <section xml:id="Attachment">
            <title>Attachment</title>
            <para>
			An attachment represents an interface plugged into a logical
			port. At any time at most one attachment can be plugged into a
			given port.
			</para><para>
			An attachment typically identified a virtual network interface.
			Network interfaces are typically defined in an external services
			which uses Quantum, for instance the OpenStack Compute service,
			Nova.
            </para>
        </section>
    </chapter>
    <chapter xml:id="General_API_Information-d1e436">
        <title>General API Information</title>
        <para>
            The OpenStack Quantum API is defined as a ReSTful HTTP
            service. The API takes advantage of all aspects of the
            HTTP protocol (methods, URIs, media types, response codes,
            etc.) and providers are free to use existing features of
            the protocol such as caching, persistent connections, and
            content compression among others.  For example, providers
            who employ a caching layer may respond with a 203 when a
            request is served from the cache instead of a 200.
            Additionally, providers may offer support for conditional
            &GET; requests using ETags, or they may send a redirect in
            response to a &GET; request.  Clients should be written to
            account for these differences.
        </para>
        <section xml:id="Authentication-d1e444">
            <title>Authentication</title>
            <para>
                The current version of the OpenStack Quantum service
                does not require that each request will include the credentials
                of the user submitting the request.
            </para><para>
                However, Quantum deployments can support several
                authentication schemes (OAuth, Basic Auth, Token). The
                authentication scheme used is determined by the
                provider of the Quantum service. Please contact
                your provider to determine the best way to
                authenticate against this API.
            </para><para>
                Ideally, middleware modules for Authentication and/or Authorization
                should be inserted in the first stages of the Quantum pipeline
                (available in <code>etc/quantum.conf</code>).
            </para>
            <note>
                <para>
                    Some authentication schemes may require that the
                    API operate using SSL over HTTP (HTTPS).
                </para>
            </note>
        </section>
        <?hard-pagebreak?>
        <section xml:id="URI_structure">
        	<title>URI structure</title>
        	<para>
				Each request to the OpenStack Quantum API must refer to a
				specific version of the API itself, and it must also
				identify the tenant for which the request is being sent.
        	</para>
        	<para>
        		This information is specified in the URI. The URI
        		for each request to the OpenStack Quantum API should be
        		prefixed with the API version identifier and the tenant
        		identifier, as follows:
        	</para>
        	<para>
        		<code>/{Quantum-version}/tenants/{tenant-id}/{Quantum-API-entity}</code>
        	</para>
        	<para>
        		As an example, the following URI represents a request for
        		retrieving all the networks configured for the tenant "ABC"
        		using the 1.0 API.
        	</para>
        	<para>
        		<code>/v1.0/ABC/networks</code>
        	</para>
        </section>
        <section xml:id="Request_Response_Types">
            <title>Request/Response Types</title>
            <para>
                The OpenStack Quantum  API supports both the JSON and XML
                data serialization formats.
                The format for both the request and the response can be
                specified either using the <code>Content-Type</code> header,
				the <code>Accept</code> header or adding an <code>.xml</code>
				or <code>.json</code> extension to the request  URI.
            </para><para>
                If conflicting formats are specified in headers and/or format
                extensions, the latter takes precedence. XML is currently
                the default format for both requests and responses.
            </para>
            <table rules="all">
                <caption>JSON and XML Response Formats</caption>
                <thead>
                    <tr>
                        <td>Format</td>
                        <td>Accept Header</td>
                        <td>Query Extension</td>
                        <td>Default</td>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>JSON</td>
                        <td>application/json</td>
                        <td>.json</td>
                        <td>No</td>
                    </tr>
                    <tr>
                        <td>XML</td>
                        <td>application/xml</td>
                        <td>.xml</td>
                        <td>Yes</td>
                    </tr>
                </tbody>
            </table>
            <example>
                <title>Request/Response with Headers: JSON</title>
                <literallayout class="monospaced">
POST			/v1.0/tenants/tenantX/networks HTTP/1.1
Host			127.0.0.1:9696
Accept			text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Content-Type	application/json; charset=UTF-8
Content-Length	30
                </literallayout>
                <programlisting language="javascript"><xi:include href="samples/networks-post-req.json" parse="text"/></programlisting>
                <literallayout class="monospaced">
HTTP/1.1 200 Accepted
Content-Type	application/json
Content-Length	59
                </literallayout>
                <programlisting language="javascript"><xi:include href="samples/networks-post-res.json" parse="text"/></programlisting>
            </example>
            <para>
                Notice, in the above example, that both the
                <code>Content-Type</code> and the <code>Accept</code>
                headers are specified. The
                <code>Content-Type</code> header always takes precedence
                over the <code>Accept</code> header. The value of the latter
                header is therefore ignored in the example above.
            </para>
            <example>
                <title>Request/Response with Headers: XML</title>
                <literallayout class="monospaced">
POST 			/v1.0/tenants/tenantX/networks HTTP/1.1
Host			127.0.0.1:9696
Accept			text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Content-Type	application/xml; charset=UTF-8
Content-Length	22
                </literallayout>
                <programlisting language="xml"><?db-font-size 80%?><xi:include href="samples/networks-post-req.xml" parse="text"/></programlisting>
                <literallayout class="monospaced">
HTTP/1.1 200 Accepted
Content-Type	application/xml
Content-Length	52
                </literallayout>
                <programlisting language="javascript"><xi:include href="samples/networks-post-res.xml" parse="text"/></programlisting>
            </example>
            <?hard-pagebreak?>
            <example>
                <title>Request/Response with Extensions: JSON</title>
                <literallayout class="monospaced">
POST 			/v1.0/tenants/tenantX/networks.json HTTP/1.1
Host			127.0.0.1:9696
Accept			text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Content-Type	application/json; charset=UTF-8
Content-Length	30
                </literallayout>
                <programlisting language="javascript"><xi:include href="samples/networks-post-req.json" parse="text"/></programlisting>
                <literallayout class="monospaced">
HTTP/1.1 200 Accepted
Content-Type	application/json
Content-Length	59
                </literallayout>
                <programlisting language="javascript"><xi:include href="samples/networks-post-res.json" parse="text"/></programlisting>
            </example>
        </section>
        <section xml:id="Async_behaviour">
        <title>Asynchronous Behavior by Quantum Plugins</title>
		<para>
		The Quantum API presents a logical model of network connectivity
		consisting of networks, ports, and attachments. It is up to
		the Quantum plugin to communicate with all managed virtual
		and/or physical switches to ensure that these devices implement
		packet forwarding behavior consistent with the logical model.
		</para><para>
		The plugin's task of mapping from the logical model to the physical
		world might happen asynchronously.  This means that when an API
		client modifies the logical model using an HTTP POST, PUT,
		or DELETE, the API call may return prior to the plugin performing
		any modifications to underlying virtual and/or physical switching
		devices.  The only guarantee an API client has is that all
		subsequent API calls will properly reflect the changed logical model.
		</para><para>
		As a concrete example, consider the case where a client uses an HTTP
		PUT to set the attachment for a port. There is no guarantee that
		packets sent by the interface named in the attachment will be
		forwarded immediately once the HTTP call returns.
		However, there is a guarantee that a subsequent HTTP GET to view
		the attachment on that port would return the new attachment value.
		</para>
		<note><para>
		Future versions of the API may expose a notion of an "operational status"
		on a logical entity like a network or port.
		</para><para>
		This would indicate whether the Quantum plugin had successfully
		configured virtual and/or physical switches in order to implement
		the network connectivity described by that element of the logical
		model.
		</para><para>
		For example, a port might have an operational status of <code>"DOWN"</code>
		because the VM interface specified as an attachment was not
		currently running on any physical server.
		</para></note>
        </section>
        <section xml:id="Versions">
            <title>Versions</title>
            <para>
                The Quantum API uses a URI based versioning scheme.
				The first element of the URI path contains the target
				version identifier.
            <example>
                <title>Request with URI versioning</title>
                <literallayout class="monospaced">
GET 			/v1.0/tenants/tenantX/networks HTTP/1.1
Host			127.0.0.1:9696
Accept			text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Content-Type	application/xml; charset=UTF-8
Content-Length	22
                </literallayout>
            </example>
             </para>
            <para>
                Available API versions can be retrieved
                by performing a &GET; on the root URL
                (i.e. with the version and everything to the
                right of it truncated) of the Quantum Service.
            </para>
            <example>
                <title>Versions List Request/Response (XML)</title>
                <literallayout class="monospaced">
GET 			/ HTTP/1.1
Host			127.0.0.1:9696
Content-Type	application/xml
                </literallayout>
                <programlisting language="xml"><xi:include href="samples/versions.xml" parse="text"/>
                </programlisting>
            </example>
            <?hard-pagebreak?>


            <example>
                <title>Version List Request/Response: JSON</title>
                <literallayout class="monospaced">
GET 			/ HTTP/1.1
Host			127.0.0.1:9696
Content-Type	application/json
                </literallayout>
                <programlisting language="javascript"><xi:include
                href="samples/versions.json" parse="text"/></programlisting>
            </example>
        </section>
        <?hard-pagebreak?>
        <section xml:id="Extensions">
            <title>Extensions</title>
            <para>
                The Quantum API is extensible. Extensions
                serve several purposes:
            </para>
            <itemizedlist spacing="compact">
                <listitem>
                    <para>
                    They allow the introduction of new
                	features in the API without requiring a
                	version change;
                    </para>
                </listitem>
                <listitem>
                    <para>
					They allow the introduction of vendor specific
                	niche functionality
                    </para>
                </listitem>
                <listitem>
                    <para>
					They act as a proving ground for experimental
					functionalities which might be included in a future
					version of the API.
                    </para>
                </listitem>
            </itemizedlist>
            <para>
				Applications can programmatically
                determine what extensions are available by performing
                a &GET; on the <code>/v1.0/extensions</code> URI.
                Note that this is a versioned request &mdash; that is,
                an extension available in one API version may not be
                available in another.
            </para>
            <example>
                <title>Extensions Response: XML</title>
                <programlisting language="xml"><?db-font-size 90%?>
<xi:include href="samples/extensions.xml" parse="text"/>
                </programlisting>
            </example>
            <?hard-pagebreak?>
            <example>
                <title>Extensions Response: JSON</title>
                <programlisting language="javascript"><?db-font-size 90%?><xi:include
                href="samples/extensions.json" parse="text"/></programlisting>
            </example>
			<para>
	            Extensions may also be queried individually by their unique alias by performing
	            a &GET; on the <code>/v1.0/extensions/alias_name</code>. This provides the simplest
	            method of checking if an extension is available as an unavailable extension will issue an
	            itemNotFound (404) response.
		    </para>
            <para>
            <note>
				Existing core API resources can be extended with new actions or extra data in request/response of existing actions.
				Further new resources can also be added as extensions.
				Extensions usually have vendor specific tags that prevent clash with other extensions.
				Availability of an extension will vary with deployments and the specific plugin in use.
            </note>
            </para>
            <important>
                <para>
                    Applications should be prepared to ignore response
                    data that contains extension elements.
                    Applications should also verify that an extension
                    is available before submitting an extended request.
                </para>
            </important>
        </section>
        <?hard-pagebreak?>
        <section xml:id="Faults">
            <title>Faults</title>
            	<para>
                	When an error occurs at request time, the system
                	will return an HTTP error response code denoting
                	the type of error. The system will also return
                	additional information about the fault in the body
                	of the response.
             	</para>
                <example>
                    <title>"Network not found" fault Response (XML)</title>
                    <programlisting language="xml"><xi:include href="samples/fault.xml" parse="text"/>
                    </programlisting>
                </example>
                <example>
                    <title>"Network not found" fault Response (JSON)</title>
                    <programlisting language="javascript"><xi:include href="samples/fault.json" parse="text"/>
                    </programlisting>
                </example>
                <para> The error code is returned in the body of the response for convenience. The
                message section returns a human-readable message that is appropriate for display to
                the end user. The detail section is optional and may contain information&mdash;for example, a stack trace&mdash;to
                assist in tracking down an error.
                </para>
                <para>
                    The root element of the fault (e.g. networkNotFound)
                    may change depending on the type of error. The
                    following is a list of possible elements along with
                    their associated error codes.
                </para>
                <?hard-pagebreak?>
                <table rules="all">
                    <caption>Fault Elements and Error Codes</caption>
                    <thead>
                        <tr>
                            <td>Fault Element</td>
                            <td>Error Code</td>
                            <td colspan="2">Description</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td bgcolor="#4F91BD">BadRequest</td>
                            <td bgcolor="#4F91BD">400</td>
                            <td bgcolor="#4F91BD" colspan="2">
                            Malformed request body.
                            The Quantum service is unable to parse the contents of the
                            request body.
                            </td>
                        </tr>
                        <tr>
                            <td>Unauthorized</td>
                            <td>401</td>
                            <td colspan="2">
                            User has not provided authentication credentials.
                            If authentication is provided by the Keystone identity
                            service, this might mean that either no authentication
                            token has been supplied in the request, or that the
                            token itself is either invalid or expired.
                            </td>
                        </tr>
                        <tr>
                            <td bgcolor="#4F91BD">Forbidden</td>
                            <td bgcolor="#4F91BD">403</td>
                            <td bgcolor="#4F91BD" colspan="2">
                            The user does not have the necessary rights
                            to execute the requested operation
                            </td>
                        </tr>
                        <tr>
                            <td>ItemNotFound</td>
                            <td>404</td>
                            <td colspan="2">
                            The requested resource does not exist on the Quantum API server
                            </td>
                        </tr>
                        <tr>
                            <td bgcolor="#4F91BD">NetworkNotFound</td>
                            <td bgcolor="#4F91BD">420</td>
                            <td bgcolor="#4F91BD" colspan="2">
                            The specified network has not been created or has been removed.
                            </td>
                        </tr>
                        <tr>
                            <td>NetworkInUse</td>
                            <td>421</td>
                            <td colspan="2">
                            The specified network has attachments plugged into one or more of its ports.
                            </td>
                        </tr>
                        <tr>
                            <td bgcolor="#4F91BD">PortNotFound</td>
                            <td bgcolor="#4F91BD">430</td>
                            <td bgcolor="#4F91BD" colspan="2">
                            The specified port has not been created or has been removed.
                            </td>
                        </tr>
                        <tr>
                            <td>RequestedStateInvalid</td>
                            <td>431</td>
                            <td colspan="2">
                            Indicates a request to change port to an administrative
                            state not currently supported.
                            </td>
                        </tr>
						<tr>
                            <td bgcolor="#4F91BD">PortInUse</td>
                            <td bgcolor="#4F91BD">432</td>
                            <td bgcolor="#4F91BD" colspan="2">
							The specified port cannot be removed as there is an attachment plugged in it.
                            </td>
                        </tr>
						<tr>
                            <td>AlreadyAttached</td>
                            <td>440</td>
                            <td colspan="2">
							Attachment is already plugged into another port.
                            </td>
                        </tr>
                    </tbody>
                </table>
                <note>
                <para>
                The error codes 401 and 403 will be returned only if some
                Authentication/Authorization system has been enabled in the
                Quantum pipeline
                </para>
                </note>
        </section>
    </chapter>
    <chapter xml:id="API_Operations">
        <title>API Operations</title>
        <section xml:id="Networks">
            <title>Networks</title>
            <para>
            This section describes the operations exposed by Quantum API for
            manipulating network resources.
            </para>
            <section xml:id="List_Networks">
                <title>List Networks</title>
                <informaltable rules="all">
                    <thead>
                        <tr>
                            <td colspan="1">Verb</td>
                            <td colspan="2">URI</td>
                            <td colspan="3">Description</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td colspan="1">&GET;</td>
                            <td colspan="2">/tenants/<emphasis>{tenant-id}</emphasis>/networks</td>
                            <td colspan="3">
                            List summary of networks configured in Quantum for
                            a given tenant, identified by tenant-id
                            </td>
                        </tr>
                    </tbody>
                </informaltable>
                <simpara>
                    Normal Response Code(s):
                    <returnvalue>200</returnvalue>
                </simpara>
                <simpara>
                    Error Response Code(s):
                    Unauthorized (<errorcode>401</errorcode>),
                    Forbidden (<errorcode>403</errorcode>)
                </simpara>
                <para>
                    This operation returns the list of all networks
                    currently defined in Quantum for the tenant
                    specified in the request URI.
                    The returned list will provide the unique identifier
                    of each network configured for the tenant specified
                    in the resource URI.
                </para>
                <note>
                    <para>
                        <property>TenantId</property> is a unique tenant
                        identifier. The Quantum service does not directly
                        manages tenants. Tenant management should be
                        performed by the identity service
                    </para>
                </note>
                <para>This operation does not require a request body.</para>
                <example>
                    <title>Networks List Request/Response (XML)</title>
                    <para>Request:</para>
                <literallayout class="monospaced">
GET /tenants/XYZ/networks.xml
                </literallayout>
                    <para>Response:</para>
                    <programlisting language="xml"><xi:include href="samples/networks-get-res.xml" parse="text"/>
                    </programlisting>
                </example>
            	<?hard-pagebreak?>
                <example>
                    <title>Networks List Request/Response (JSON)</title>
                    <para>Request:</para>
	                <literallayout class="monospaced">
GET /tenants/XYZ/networks.json
	                </literallayout>
                    <para>Response:</para>
                    <programlisting language="javascript"><xi:include href="samples/networks-get-res.json" parse="text"/>
                    </programlisting>
                </example>
            </section>
            <section xml:id="List_Networks_Detail">
                <title>List Networks Details</title>
                <informaltable rules="all">
                    <thead>
                        <tr>
                            <td colspan="1">Verb</td>
                            <td colspan="2">URI</td>
                            <td colspan="3">Description</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td colspan="1">&GET;</td>
                            <td colspan="2">/tenants/<emphasis>{tenant-id}</emphasis>/networks/detail</td>
                            <td colspan="3">
                            List more detailed information about networks
                            configured in Quantum for a given tenant,
                            identified by tenant-id
                            </td>
                        </tr>
                    </tbody>
                </informaltable>
                <simpara>
                    Normal Response Code(s):
                    <returnvalue>200</returnvalue>
                </simpara>
                <simpara>
                    Error Response Code(s):
                    Unauthorized (<errorcode>401</errorcode>),
                    Forbidden (<errorcode>403</errorcode>)
                </simpara>
                <para>
                This operation returns the list of all networks currently
                defined in Quantum; for each network, its identifier
                and name are returned.
                </para>
                <para>This operation does not require a request body.</para>
                <example>
                    <title>Networks List Request/Response (XML)</title>
                    <para>Request:</para>
                <literallayout class="monospaced">
GET /tenants/XYZ/networks/detail.xml
                </literallayout>
                    <para>Response:</para>
                    <programlisting language="xml"><xi:include href="samples/networks-get-detail-res.xml" parse="text"/>
                    </programlisting>
                </example>
                <?hard-pageb reak?>
                <example>
                    <title>Networks List Request/Response (JSON)</title>
                    <para>Request:</para>
	                <literallayout class="monospaced">
GET /tenants/XYZ/networks/detail.json
	                </literallayout>
                    <para>Response:</para>
                    <programlisting language="javascript"><xi:include href="samples/networks-get-detail-res.json" parse="text"/>
                    </programlisting>
                </example>
            </section>
            <section xml:id="Show_Network">
                <title>Show Network</title>
                <informaltable rules="all">
                    <thead>
                        <tr>
                            <td colspan="1">Verb</td>
                            <td colspan="2">URI</td>
                            <td colspan="3">Description</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td colspan="1">&GET;</td>
                            <td colspan="2">/tenants/<emphasis>{tenant-id}</emphasis>/networks/<emphasis>{network-id}</emphasis></td>
                            <td colspan="3">
							List information for a specific network,
							identified by <emphasis>network-id</emphasis>,
							for a given tenant, identified by <emphasis>tenant-id</emphasis>.
                            </td>
                        </tr>
                    </tbody>
                </informaltable>
                <simpara>
                    Normal Response Code(s):
                    <returnvalue>200</returnvalue>
                </simpara>
                <simpara>
                    Error Response Code(s):
                    Unauthorized (<errorcode>401</errorcode>),
                    Forbidden (<errorcode>403</errorcode>),
                    NetworkNotFound (<errorcode>420</errorcode>),
                </simpara>
                <para>
				This operation returns the identifier and the name for a
				specific network configured in Quantum.
				</para><para>
				This operation does not require a request body.</para>
                <example>
                    <title>Show Network Request/Response (XML)</title>
                    <para>Request:</para>
                <literallayout class="monospaced">
GET /tenants/XYZ/networks/8bec1293-16bd-4568-ba75-1f58bec0b4c3.xml
                </literallayout>
                    <para>Response:</para>
                    <programlisting language="xml"><xi:include href="samples/network-get-res.xml" parse="text"/>
                    </programlisting>
                </example>
                <?hard-pagebreak?>
                <example>
                    <title>Show Network Request/Response (JSON)</title>
                    <para>Request:</para>
	                <literallayout class="monospaced">
GET /tenants/XYZ/networks/8bec1293-16bd-4568-ba75-1f58bec0b4c3.json
	                </literallayout>
                    <para>Response:</para>
                    <programlisting language="javascript"><xi:include href="samples/network-get-res.json" parse="text"/>
                    </programlisting>
                </example>
            </section>
            <section xml:id="Show_Network_Detail">
                <title>Show Network Details</title>
                <informaltable rules="all">
                    <thead>
                        <tr>
                            <td colspan="1">Verb</td>
                            <td colspan="2">URI</td>
                            <td colspan="3">Description</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td colspan="1">&GET;</td>
                            <td colspan="2">/tenants/<emphasis>{tenant-id}</emphasis>/networks/<emphasis>{network-id}</emphasis>/detail</td>
                            <td colspan="3">
							List detailed information for a specific network,
							identified by <emphasis>network-id</emphasis>,
							for a given tenant, identified by <emphasis>tenant-id</emphasis>.
                            </td>
                        </tr>
                    </tbody>
                </informaltable>
                <simpara>
                    Normal Response Code(s):
                    <returnvalue>200</returnvalue>
                </simpara>
                <simpara>
                    Error Response Code(s):
                    Unauthorized (<errorcode>401</errorcode>),
                    Forbidden (<errorcode>403</errorcode>),
                    NetworkNotFound (<errorcode>420</errorcode>),
                </simpara>
                <para>
				This operation returns detailed information concerning the
				network specified in the request URI. Returned data include
				the full list of ports configured for the network
				and attachments plugged into such ports.
                </para><para>
                If no attachment is plugged into a port, the response will
                not include an <code>attachment</code> child element for that
                port.
                </para>
                <para>This operation does not require a request body.</para>
                <example>
                    <title>Show Network Detail Request/Response (XML)</title>
                    <para>Request:</para>
                <literallayout class="monospaced">
GET /tenants/XYZ/networks/8bec1293-16bd-4568-ba75-1f58bec0b4c3/detail.xml
                </literallayout>
                    <para>Response:</para>
                    <programlisting language="xml"><xi:include href="samples/network-get-detail-res.xml" parse="text"/>
                    </programlisting>
                </example>
                <example>
                    <title>Show Network Detail Request/Response (JSON)</title>
                    <para>Request:</para>
	                <literallayout class="monospaced">
GET /tenants/XYZ/networks/8bec1293-16bd-4568-ba75-1f58bec0b4c3/detail.json
	                </literallayout>
                    <para>Response:</para>
                    <programlisting language="javascript"><xi:include href="samples/network-get-detail-res.json" parse="text"/>
                    </programlisting>
                </example>
            </section>
            <section xml:id="Create_Network">
                <title>Create Network</title>
                <informaltable rules="all">
                    <thead>
                        <tr>
                            <td colspan="1">Verb</td>
                            <td colspan="2">URI</td>
                            <td colspan="3">Description</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td colspan="1">&POST;</td>
                            <td colspan="2">/tenants/<emphasis>{tenant-id}</emphasis>/networks</td>
                            <td colspan="3">
							Creates a new logical layer-2 network for the
							tenant identified by <emphasis>tenant-id</emphasis>
							</td>
                        </tr>
                    </tbody>
                </informaltable>
                <simpara>
                    Normal Response Code(s):
                    <returnvalue>200</returnvalue>
                </simpara>
                <simpara>
                    Error Response Code(s):
                    BadRequest (<errorcode>400</errorcode>)
                    Unauthorized (<errorcode>401</errorcode>),
                    Forbidden (<errorcode>403</errorcode>),
                </simpara>
                <para>
				This operation creates a Layer-2 network in
				Quantum based on the information provided in the request body.
				</para><para>
				Quantum validates the request, and dispatches it to the plugin,
				and then returns the unique identifier of the network to the
				caller. Although the network API entity can be immediately used
				for other operations, this does not guarantee that the network
				will be available when the API call returns, as this depends
				on the particular plugin implementation.
				</para><para>
				If the validation phase fails, the network object is not
				created at all, and a 400 error is returned to the caller.
				</para>
				<note>
					<para>
					The Quantum API v1.0 does not provide an interface
					for checking the progress of asynchronous operations
					performed by plugins.
					</para>
					<para>
					This will be addressed in future releases of the
					Quantum API.
					</para>
				</note>
                <para>
				The body for this request must contain a Network object
				specifying a symbolic name for the network.
                </para>
                <example>
                    <title>Create Network Request/Response (XML)</title>
                    <para>Request:</para>
                <literallayout class="monospaced">
POST /tenants/XYZ/networks.xml
                </literallayout>
                    <programlisting language="xml"><xi:include href="samples/network-post-req.xml" parse="text"/>
                    </programlisting>
                    <para>Response:</para>
                    <programlisting language="xml"><xi:include href="samples/network-post-res.xml" parse="text"/>
                    </programlisting>
                </example>
                <example>
                    <title>Create Network Request/Response (JSON)</title>
                    <para>Request:</para>
	                <literallayout class="monospaced">
POST /tenants/XYZ/networks.json
	                </literallayout>
                    <programlisting language="javascript"><xi:include href="samples/network-post-req.json" parse="text"/>
                    </programlisting>
                    <para>Response:</para>
                    <programlisting language="javascript"><xi:include href="samples/network-post-res.json" parse="text"/>
                    </programlisting>
                </example>
            </section>
			<section xml:id="Update_Network">
                <title>Update Network</title>
                <informaltable rules="all">
                    <thead>
                        <tr>
                            <td colspan="1">Verb</td>
                            <td colspan="2">URI</td>
                            <td colspan="3">Description</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td colspan="1">&PUT;</td>
                            <td colspan="2">/tenants/<emphasis>{tenant-id}</emphasis>/networks/<emphasis>{network-id}</emphasis></td>
                            <td colspan="3">
                            Renames the network identified by
                            <emphasis>network-id</emphasis> for the
							tenant identified by <emphasis>tenant-id</emphasis>
							</td>
                        </tr>
                    </tbody>
                </informaltable>
                <simpara>
                    Normal Response Code(s):
                    <returnvalue>204</returnvalue>
                </simpara>
                <simpara>
                    Error Response Code(s):
                    BadRequest (<errorcode>400</errorcode>)
                    Unauthorized (<errorcode>401</errorcode>),
                    Forbidden (<errorcode>403</errorcode>),
                    NetworkNotFound (<errorcode>420</errorcode>)
                </simpara>
                <para>
				This operation renames a Quantum network using the data
				provided in the request body.
				</para>
                <para>
				The body for this request must contain a Network object
				specifying a symbolic name for the network. The network
				entity specified in the request body can contain the
				network's identifier as well, even if it is not required,
				as the identifier must be expressed on the URI; in this
				case the identifier in the request body will be ignored.
                </para>
                <example>
                    <title>Update Network Request/Response (XML)</title>
                    <para>Request:</para>
                <literallayout class="monospaced">
PUT /tenants/XYZ/networks/158233b0-ca9a-40b4-8614-54a4a99d47d1.xml
                </literallayout>
                    <programlisting language="xml"><xi:include href="samples/network-post-req.xml" parse="text"/>
                    </programlisting>
                    <para>Response:</para>
                    <para><emphasis>No data returned in response body</emphasis></para>
                </example>
                <example>
                    <title>Update Network Request/Response (JSON)</title>
                    <para>Request:</para>
	                <literallayout class="monospaced">
PUT /tenants/XYZ/networks/158233b0-ca9a-40b4-8614-54a4a99d47d1.json
	                </literallayout>
                    <programlisting language="javascript"><xi:include href="samples/network-post-req.json" parse="text"/>
                    </programlisting>
                    <para>Response:</para>
                    <para><emphasis>No data returned in response body</emphasis></para>
                    </example>
            </section>
            <section xml:id="Delete_Network">
                <title>Delete Network</title>
                <informaltable rules="all">
                    <thead>
                        <tr>
                            <td colspan="1">Verb</td>
                            <td colspan="2">URI</td>
                            <td colspan="3">Description</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td colspan="1">&DELETE;</td>
                            <td colspan="2">/tenants/<emphasis>{tenant-id}</emphasis>/networks/<emphasis>{network-id}</emphasis></td>
                            <td colspan="3">
                            Destroys the network identified by
                            <emphasis>network-id</emphasis> for the
							tenant identified by <emphasis>tenant-id</emphasis>
							</td>
                        </tr>
                    </tbody>
                </informaltable>
                <simpara>
                    Normal Response Code(s):
                    <returnvalue>204</returnvalue>
                </simpara>
                <simpara>
                    Error Response Code(s):
                    BadRequest (<errorcode>400</errorcode>)
                    Unauthorized (<errorcode>401</errorcode>),
                    Forbidden (<errorcode>403</errorcode>),
                    NetworkNotFound (<errorcode>420</errorcode>),
                    NetworkInUse (<errorcode>421</errorcode>)
                </simpara>
                <para>
				This operation removes the network specified in the URI.
				This request will fail as long as there is at least one
				port on the network with attachments plugged in it.
				If all ports on the networks are unattached, they will
				be destroyed together with the network itself.
				</para>
				<para>
				As for the create operation there is no guarantee that the
				plugin will have completely removed the network when the
				call returns. Quantum forwards the request to the plugin,
				which will then destroy the network.
				</para><para>
				Please note that this operation cannot be undone.
				</para>
                <para>
                This operation does not require a request body.
                </para>
                <example>
                    <title>Delete Network Request/Response (XML)</title>
                    <para>Request:</para>
                <literallayout class="monospaced">
DELETE /tenants/XYZ/networks/158233b0-ca9a-40b4-8614-54a4a99d47d1.xml
                </literallayout>
                    <para>Response:</para>
                    <para><emphasis>No data returned in response body</emphasis></para>
                </example>
                <example>
                    <title>Update Network Request/Response (JSON)</title>
                    <para>Request:</para>
	                <literallayout class="monospaced">
DELETE /tenants/XYZ/networks/158233b0-ca9a-40b4-8614-54a4a99d47d1.json
	                </literallayout>
                    <para>Response:</para>
                    <para><emphasis>No data returned in response body</emphasis></para>
                    </example>
            </section>
        </section>
        <section xml:id="Ports">
            <title>Ports</title>
            <para>
            This section describes the operations exposed by Quantum API for
            manipulating port resources.
            </para>
			<section xml:id="List_Ports">
                <title>List Ports</title>
                <informaltable rules="all">
                    <thead>
                        <tr>
                            <td colspan="1">Verb</td>
                            <td colspan="2">URI</td>
                            <td colspan="3">Description</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td colspan="1">&GET;</td>
                            <td colspan="2">/tenants/<emphasis>{tenant-id}</emphasis>/networks/
                            				<emphasis>{network-id}/ports</emphasis></td>
                            <td colspan="3">
							Lists all the ports currently defined for a Quantum network,
							identified by <emphasis>network-id</emphasis>
							</td>
                        </tr>
                    </tbody>
                </informaltable>
                <simpara>
                    Normal Response Code(s):
                    <returnvalue>200</returnvalue>
                </simpara>
                <simpara>
                    Error Response Code(s):
                    Unauthorized (<errorcode>401</errorcode>),
                    Forbidden (<errorcode>403</errorcode>),
                    NetworkNotFound (<errorcode>420</errorcode>)
                </simpara>
                <para>
					This operation lists all the ports currently configured
					for a network. For each port the response reports its
					unique identifier. If no ports have been
					created on the network an empty list will be returned.
				</para>
                <para>This operation does not require a request body.</para>
                <example>
                    <title>Port List Request/Response (XML)</title>
                    <para>Request:</para>
                <literallayout class="monospaced">
GET /tenants/XYZ/networks/158233b0-ca9a-40b4-8614-54a4a99d47d1/ports.xml
                </literallayout>
                    <para>Response:</para>
                    <programlisting language="xml"><xi:include href="samples/ports-get-res.xml" parse="text"/>
                    </programlisting>
                </example>
            	<?hard-pagebreak?>
                <example>
                    <title>Port List Request/Response (JSON)</title>
                    <para>Request:</para>
	                <literallayout class="monospaced">
GET /tenants/XYZ/networks/158233b0-ca9a-40b4-8614-54a4a99d47d1/ports.json
	                </literallayout>
                    <para>Response:</para>
                    <programlisting language="javascript"><xi:include href="samples/ports-get-res.json" parse="text"/>
                    </programlisting>
                </example>
            </section>
			<section xml:id="List_Ports_Details">
                <title>List Ports Details</title>
                <informaltable rules="all">
                    <thead>
                        <tr>
                            <td colspan="1">Verb</td>
                            <td colspan="2">URI</td>
                            <td colspan="3">Description</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td colspan="1">&GET;</td>
                            <td colspan="2">/tenants/<emphasis>{tenant-id}</emphasis>/networks/
                            				<emphasis>{network-id}</emphasis>/ports/detail</td>
                            <td colspan="3">
							Lists detailed information for all the ports currently defined
							for the network identified by <emphasis>network-id</emphasis>
							</td>
                        </tr>
                    </tbody>
                </informaltable>
                <simpara>
                    Normal Response Code(s):
                    <returnvalue>200</returnvalue>
                </simpara>
                <simpara>
                    Error Response Code(s):
                    Unauthorized (<errorcode>401</errorcode>),
                    Forbidden (<errorcode>403</errorcode>),
                    NetworkNotFound (<errorcode>420</errorcode>)
                </simpara>
                <para>
                This operation lists detailed information for all the ports
                currently configured for a network. Response for each port
                includes its identifier and the current administrative state.
                If no ports have been created on the network an
                empty list will be returned.
				</para>
                <para>This operation does not require a request body.</para>
                <example>
                    <title>Port List Details Request/Response (XML)</title>
                    <para>Request:</para>
                <literallayout class="monospaced">
GET /tenants/XYZ/networks/158233b0-ca9a-40b4-8614-54a4a99d47d1/ports/detail.xml
                </literallayout>
                    <para>Response:</para>
                    <programlisting language="xml"><xi:include href="samples/ports-get-detail-res.xml" parse="text"/>
                    </programlisting>
                </example>
            	<?hard-pagebreak?>
                <example>
                    <title>Port List Details Request/Response (JSON)</title>
                    <para>Request:</para>
	                <literallayout class="monospaced">
GET /tenants/XYZ/networks/158233b0-ca9a-40b4-8614-54a4a99d47d1/ports/detail.json
	                </literallayout>
                    <para>Response:</para>
                    <programlisting language="javascript"><xi:include href="samples/ports-get-detail-res.json" parse="text"/>
                    </programlisting>
                </example>
            </section>
			<section xml:id="Show_port">
                <title>Show Port</title>
                <informaltable rules="all">
                    <thead>
                        <tr>
                            <td colspan="1">Verb</td>
                            <td colspan="2">URI</td>
                            <td colspan="3">Description</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td colspan="1">&GET;</td>
                            <td colspan="2">/tenants/<emphasis>{tenant-id}</emphasis>/networks/
                            				<emphasis>{network-id}</emphasis>/ports/
                            				<emphasis>{port-id}</emphasis></td>
                            <td colspan="3">
							Retrieves the port
							<emphasis>port-id</emphasis> configured for the
							network <emphasis>network-id</emphasis> belonging
							to the tenant <emphasis>tenant-id</emphasis>.
							</td>
                        </tr>
                    </tbody>
                </informaltable>
                <simpara>
                    Normal Response Code(s):
                    <returnvalue>200</returnvalue>
                </simpara>
                <simpara>
                    Error Response Code(s):
                    Unauthorized (<errorcode>401</errorcode>),
                    Forbidden (<errorcode>403</errorcode>),
                    NetworkNotFound (<errorcode>420</errorcode>),
                    PortNotFound (<errorcode>430</errorcode>)
                </simpara>
                <para>
				This operation returns the unique identifier and the
				current administrative state for a specific port configured
				for the network specified in the request URI.
				</para>
                <para>This operation does not require a request body.</para>
                <example>
                    <title>Show Port Request/Response (XML)</title>
                    <para>Request:</para>
                <literallayout class="monospaced">
GET /tenants/33/networks/158233b0-ca9a-40b4-8614-54a4a99d47d1/ports/98017ddc-efc8-4c25-a915-774b2a633855.xml
                </literallayout>
                    <para>Response:</para>
                    <programlisting language="xml"><xi:include href="samples/port-get-res.xml" parse="text"/>
                    </programlisting>
                </example>
            	<?hard-pagebreak?>
                <example>
                    <title>Show Port Request/Response (JSON)</title>
                    <para>Request:</para>
	                <literallayout class="monospaced">
GET /tenants/33/networks/158233b0-ca9a-40b4-8614-54a4a99d47d1/ports/98017ddc-efc8-4c25-a915-774b2a633855.json
	                </literallayout>
                    <para>Response:</para>
                    <programlisting language="javascript"><xi:include href="samples/port-get-res.json" parse="text"/>
                    </programlisting>
                </example>
            </section>
            <section xml:id="Show_port_Details">
                <title>Show Port Details</title>
                <informaltable rules="all">
                    <thead>
                        <tr>
                            <td colspan="1">Verb</td>
                            <td colspan="2">URI</td>
                            <td colspan="3">Description</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td colspan="1">&GET;</td>
                            <td colspan="2">/tenants/<emphasis>{tenant-id}</emphasis>/networks/
                            				<emphasis>{network-id}</emphasis>/ports/
                            				<emphasis>{port-id}</emphasis>/detail</td>
                            <td colspan="3">
							Retrieves detailed information for the port
							<emphasis>port-id</emphasis> configured for the
							network <emphasis>network-id</emphasis> belonging
							to the tenant <emphasis>tenant-id</emphasis>.
							</td>
                        </tr>
                    </tbody>
                </informaltable>
                <simpara>
                    Normal Response Code(s):
                    <returnvalue>200</returnvalue>
                </simpara>
                <simpara>
                    Error Response Code(s):
                    Unauthorized (<errorcode>401</errorcode>),
                    Forbidden (<errorcode>403</errorcode>),
                    NetworkNotFound (<errorcode>420</errorcode>),
                    PortNotFound (<errorcode>430</errorcode>)
                </simpara>
                <para>
				This operation provides at least the identifier and the
				current administrative state for specific port configured
				for a given network.
				</para><para>
				If an attachment is plugged into the port, this operation
				will return the identifier of the attachment as well.
				</para>
                <para>This operation does not require a request body.</para>
                <example>
                    <title>Show Port Detail Request/Response (XML)</title>
                    <para>Request:</para>
                <literallayout class="monospaced">
GET /tenants/33/networks/158233b0-ca9a-40b4-8614-54a4a99d47d1/ports/98017ddc-efc8-4c25-a915-774b2a633855/detail.xml
                </literallayout>
                    <para>Response:</para>
                    <programlisting language="xml"><xi:include href="samples/port-get-detail-res.xml" parse="text"/>
                    </programlisting>
                </example>
                <example>
                    <title>Show Port Detail Request/Response (JSON)</title>
                    <para>Request:</para>
	                <literallayout class="monospaced">
GET /tenants/33/networks/158233b0-ca9a-40b4-8614-54a4a99d47d1/ports/98017ddc-efc8-4c25-a915-774b2a633855/detail.json
	                </literallayout>
                    <para>Response:</para>
                    <programlisting language="javascript"><xi:include href="samples/port-get-detail-res.json" parse="text"/>
                    </programlisting>
                </example>
            </section>
			<section xml:id="Create_Port">
                <title>Create Port</title>
                <informaltable rules="all">
                    <thead>
                        <tr>
                            <td colspan="1">Verb</td>
                            <td colspan="2">URI</td>
                            <td colspan="3">Description</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td colspan="1">&POST;</td>
                            <td colspan="2">/tenants/<emphasis>{tenant-id}</emphasis>/networks/
                            				<emphasis>{network-id}</emphasis>/ports</td>
                            <td colspan="3">
							Creates a port on the network specified
							in the request URI, identified by
							<emphasis>network-id</emphasis>
							</td>
                        </tr>
                    </tbody>
                </informaltable>
                <simpara>
                    Normal Response Code(s):
                    <returnvalue>200</returnvalue>
                </simpara>
                <simpara>
                    Error Response Code(s):
                    BadRequest (<errorcode>400</errorcode>),
                    Unauthorized (<errorcode>401</errorcode>),
                    Forbidden (<errorcode>403</errorcode>),
                    NetworkNotFound (<errorcode>420</errorcode>),
                    RequestedStateInvalid (<errorcode>431</errorcode>)
                </simpara>
                <para>
				This operation creates a port on a Quantum network based on
				the information provided in the request body.
				Quantum validates the request, and dispatches the request
				to the plugin, which creates the port and attaches
				it to the appropriate network.
				</para><para>
				This operation could not be implemented for some
				plugins as the number of ports available might be fixed
				when the network is created.
				</para><para>
				If the validation phase fails, the port object is not
				created at all, and a <code>BadRequest</code> error is returned
				to the caller.
				</para><para>
				The operation returns a port with an identifier, and set its
				administrative state set to <code>DOWN</code>, unless a state
				has been explicitly specified in the request body.
				</para><para>
				Please note that this operation does not guarantee that the
				port has been actually created when the calls returns,
				as the plugin might still be performing the necessary
				operations on the network infrastructure. However, the port
				entity can be immediately used for API operations.
				</para><para>
				The request body is not mandatory for this operation,
				but it can optionally contain the administrative state
				for the port being created, which can be either
				<code>DOWN</code> or <code>ACTIVE</code>.
				The administrative state should be encapsulated into a Port
				object within the request body, as shown in the example below.
				</para>
                <example>
                    <title>Create Port Request/Response (XML)</title>
                    <para>Request:</para>
                <literallayout class="monospaced">
POST /tenants/33/networks/158233b0-ca9a-40b4-8614-54a4a99d47d1/ports.xml
                </literallayout>
                <programlisting language="xml"><xi:include href="samples/port-post-req.xml" parse="text"/>
                </programlisting>
                    <para>Response:</para>
                    <programlisting language="xml"><xi:include href="samples/port-post-res.xml" parse="text"/>
                    </programlisting>
                </example>
                <example>
                    <title>Create Port Request/Response (JSON)</title>
                    <para>Request:</para>
	                <literallayout class="monospaced">
POST /tenants/33/networks/158233b0-ca9a-40b4-8614-54a4a99d47d1/ports.json
	                </literallayout>
	                <programlisting language="xml"><xi:include href="samples/port-post-req.json" parse="text"/>
                	</programlisting>
                    <para>Response:</para>
                    <programlisting language="javascript"><xi:include href="samples/port-post-res.json" parse="text"/>
                    </programlisting>
                </example>
            </section>
			<section xml:id="Update_Port">
                <title>Update Port</title>
                <informaltable rules="all">
                    <thead>
                        <tr>
                            <td colspan="1">Verb</td>
                            <td colspan="2">URI</td>
                            <td colspan="3">Description</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td colspan="1">&PUT;</td>
                            <td colspan="2">/tenants/<emphasis>{tenant-id}</emphasis>/networks/
                            				<emphasis>{network-id}</emphasis>/ports/
                            				<emphasis>{port-id}</emphasis></td>
                            <td colspan="3">
							Sets the administrative state for the port
							identified by <emphasis>port-id</emphasis>
							on the network identified by
							<emphasis>network-id</emphasis>
							</td>
                        </tr>
                    </tbody>
                </informaltable>
                <simpara>
                    Normal Response Code(s):
                    <returnvalue>204</returnvalue>
                </simpara>
                <simpara>
                    Error Response Code(s):
                    BadRequest (<errorcode>400</errorcode>),
                    Unauthorized (<errorcode>401</errorcode>),
                    Forbidden (<errorcode>403</errorcode>),
                    NetworkNotFound (<errorcode>420</errorcode>),
                    PortNotFound (<errorcode>430</errorcode>),
                    RequestedStateInvalid (<errorcode>431</errorcode>)
                </simpara>
                <para>
				This operation sets the administrative state for a port.
				Currently Quantum recognizes two port states:
				<code>DOWN</code> and <code>ACTIVE</code>. In the
				<code>DOWN</code> state a port will not provide
				connectivity to the network.
				</para><para>
				This feature allows the tenant the ability to take entities
				offline without affecting the logical topology.
				</para><para>
				The operation will return the <code>RequestedStateInvalid</code>
				error code if the specified administrative state is not either
				<code>DOWN</code> or <code>ACTIVE</code>.
				</para><para>
				The operation's request body must contain a Port object with
				the new administrative state for the port.
				</para>
                <example>
                    <title>Set Port State Request/Response (XML)</title>
                    <para>Request:</para>
                <literallayout class="monospaced">
PUT tenants/33/networks/158233b0-ca9a-40b4-8614-54a4a99d47d1/ports/98017ddc-efc8-4c25-a915-774b2a633855.xml
                </literallayout>
                <programlisting language="xml"><xi:include href="samples/port-post-req.xml" parse="text"/>
                </programlisting>
                    <para>Response:</para>
					<para><emphasis>No data returned in response body.</emphasis></para>
                </example>
                <example>
                    <title>Set Port State Request/Response (JSON)</title>
                    <para>Request:</para>
	                <literallayout class="monospaced">
PUT tenants/33/networks/158233b0-ca9a-40b4-8614-54a4a99d47d1/ports/98017ddc-efc8-4c25-a915-774b2a633855.json
	                </literallayout>
	                <programlisting language="xml"><xi:include href="samples/port-post-req.json" parse="text"/>
                	</programlisting>
                    <para>Response:</para>
                    <para><emphasis>No data returned in response body.</emphasis></para>
                </example>
            </section>
            <section xml:id="Delete_Port">
                <title>Delete Port</title>
                <informaltable rules="all">
                    <thead>
                        <tr>
                            <td colspan="1">Verb</td>
                            <td colspan="2">URI</td>
                            <td colspan="3">Description</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td colspan="1">&DELETE;</td>
                            <td colspan="2">/tenants/<emphasis>{tenant-id}</emphasis>/networks/
                            				<emphasis>{network-id}</emphasis>/ports/
                            				<emphasis>{port-id}</emphasis></td>
                            <td colspan="3">
							Destroys the port
							identified by <emphasis>port-id</emphasis>
							on the network identified by
							<emphasis>network-id</emphasis>
							</td>
                        </tr>
                    </tbody>
                </informaltable>
                <simpara>
                    Normal Response Code(s):
                    <returnvalue>204</returnvalue>
                </simpara>
                <simpara>
                    Error Response Code(s):
                    BadRequest (<errorcode>400</errorcode>),
                    Unauthorized (<errorcode>401</errorcode>),
                    Forbidden (<errorcode>403</errorcode>),
                    NetworkNotFound (<errorcode>420</errorcode>),
                    PortNotFound (<errorcode>430</errorcode>),
                    PortInUse (<errorcode>432</errorcode>)
                </simpara>
                <para>
				This operation removes a port from a Quantum network.
				This operation might not be available for plugins in
				which the number of ports is fixed at network creation;
				in this case ports should not be deleted, just as they
				cannot be created.
				</para><para>
				The operation is not recoverable and will fail if an
				attachment is plugged into the port. 			#
				</para><para>
				This operation does not require a request body.
				</para>
                <example>
                    <title>Delete Port State Request/Response (XML)</title>
                    <para>Request:</para>
                <literallayout class="monospaced">
DELETE tenants/33/networks/158233b0-ca9a-40b4-8614-54a4a99d47d1/ports/98017ddc-efc8-4c25-a915-774b2a633855.xml
                </literallayout>
                    <para>Response:</para>
					<para><emphasis>No data returned in response body.</emphasis></para>
                </example>
                <example>
                    <title>Delete Port State Request/Response (JSON)</title>
                    <para>Request:</para>
	                <literallayout class="monospaced">
DELETE tenants/33/networks/158233b0-ca9a-40b4-8614-54a4a99d47d1/ports/98017ddc-efc8-4c25-a915-774b2a633855.json
	                </literallayout>
                    <para>Response:</para>
                    <para><emphasis>No data returned in response body.</emphasis></para>
                </example>
            </section>
        </section>
        <section xml:id="Attachments">
            <title>Attachments</title>
            <para>
            This section describes the operations exposed by Quantum API for
            manipulating port attachments.
            </para><para>
			An attachment is typically a virtual network interface
			belonging to a VM instance. Different kinds of resources
			can be defined in the future.
            </para>
			<section xml:id="Show_Attachment">
                <title>Show Attachment for Port</title>
                <informaltable rules="all">
                    <thead>
                        <tr>
                            <td colspan="1">Verb</td>
                            <td colspan="2">URI</td>
                            <td colspan="3">Description</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td colspan="1">&GET;</td>
                            <td colspan="2">/tenants/<emphasis>{tenant-id}</emphasis>/networks/
                            				<emphasis>{network-id}</emphasis>/ports/
                            				<emphasis>{port-id}</emphasis>/attachment</td>
                            <td colspan="3">
							Returns the identifier of the attachment plugged
							into the specified port, identified by
							<emphasis>port-id</emphasis>.
							</td>
                        </tr>
                    </tbody>
                </informaltable>
                <simpara>
                    Normal Response Code(s):
                    <returnvalue>200</returnvalue>
                </simpara>
                <simpara>
                    Error Response Code(s):
                    Unauthorized (<errorcode>401</errorcode>),
                    Forbidden (<errorcode>403</errorcode>),
                    NetworkNotFound (<errorcode>420</errorcode>),
                    PortNotFound (<errorcode>430</errorcode>)
                </simpara>
                <para>
				This operation returns configuration details for the
				attachment plugged into the port specified in the request URI.
				This information is a reference to a virtual interface
				identifier.
				</para><para>
				If no attachment is currently plugged into the port,
				the operation does not return any attachment
				identifier in the response.
				The response will contain an empty <code>attachment</code> element
                with no <code>id</code> attribute set.
				</para>
                <para>This operation does not require a request body.</para>
                <example>
                    <title>Show Attachment (XML)</title>
                    <para>Request:</para>
                <literallayout class="monospaced">
GET /tenants/XYZ/networks/158233b0-ca9a-40b4-8614-54a4a99d47d1/ports/b832be00-6553-4f69-af33-acd554e36d08/attachment.xml
                </literallayout>
                    <para>Response (attachment set):</para>
                    <programlisting language="xml"><xi:include href="samples/att-get-res.xml" parse="text"/>
                    </programlisting>
                    <para>Response (attachment not set):</para>
                    <programlisting language="xml"><xi:include href="samples/att-get-res-none.xml" parse="text"/>
                    </programlisting>
                </example>
                <example>
                    <title>Show Attachment (JSON)</title>
                    <para>Request:</para>
	                <literallayout class="monospaced">
GET /tenants/XYZ/networks/158233b0-ca9a-40b4-8614-54a4a99d47d1/ports/b832be00-6553-4f69-af33-acd554e36d08/attachment.json
	                </literallayout>
                    <para>Response (attachment set):</para>
                    <programlisting language="javascript"><xi:include href="samples/att-get-res.json" parse="text"/>
                    </programlisting>
                    <para>Response (attachment not set):</para>
                    <programlisting language="javascript"><xi:include href="samples/att-get-res-none.json" parse="text"/>
                    </programlisting>
                </example>
            </section>
            <section xml:id="Put_Attachment">
                <title>Plug Attachment into Port</title>
                <informaltable rules="all">
                    <thead>
                        <tr>
                            <td colspan="1">Verb</td>
                            <td colspan="2">URI</td>
                            <td colspan="3">Description</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td colspan="1">&PUT;</td>
                            <td colspan="2">/tenants/<emphasis>{tenant-id}</emphasis>/networks/
                            				<emphasis>{network-id}</emphasis>/ports/
                            				<emphasis>{port-id}</emphasis>/attachment</td>
                            <td colspan="3">
							Plugs a resource, i.e. a virtual network interface
							into the port identified by
							<emphasis>port-id</emphasis>.
							</td>
                        </tr>
                    </tbody>
                </informaltable>
                <simpara>
                    Normal Response Code(s):
                    <returnvalue>204</returnvalue>
                </simpara>
                <simpara>
                    Error Response Code(s):
                    Unauthorized (<errorcode>401</errorcode>),
                    Forbidden (<errorcode>403</errorcode>),
                    NetworkNotFound (<errorcode>420</errorcode>),
                    PortNotFound (<errorcode>430</errorcode>),
                    PortInUse (<errorcode>432</errorcode>),
                    AlreadyAttached (<errorcode>440</errorcode>)
                </simpara>
                <para>
				This operation plugs an attachment into the port
				specified in the request URL.
				</para><para>
				The request will be first validated by Quantum and then
				dispatched to the plugin. It is not guaranteed that the
				attached resource will be available as soon as the
				operation returns.
				</para><para>
				The validation can fail if:
				</para>
	            <itemizedlist spacing="compact">
	                <listitem>
	                    <para>
	                    An attachment with the same identifier
	                    is already plugged somewhere else;
	                    </para>
	                </listitem>
	                <listitem>
	                    <para>
						There is already another attachment plugged
						into the specified port.
	                    </para>
	                </listitem>
	            </itemizedlist>
				<para>
				If the validation phase fails, the attachment is not
				created at all, and the appropriate error code is
				returned to the caller.
				</para>
	            <para>
				If no attachment is currently plugged into the port,
				the operation does not return any attachment
				identifier in the response.
				The response will contain an empty <code>attachment</code> element.
				</para>
                <para>
                The request body for this network should contain a reference
                to the attachment to plug into the port.
                </para>
                <example>
                    <title>Plug Attachment (XML)</title>
                    <para>Request:</para>
	                <literallayout class="monospaced">
PUT /tenants/XYZ/networks/158233b0-ca9a-40b4-8614-54a4a99d47d1/ports/b832be00-6553-4f69-af33-acd554e36d08/attachment.xml
	                </literallayout>
                    <programlisting language="xml"><xi:include href="samples/att-put-req.xml" parse="text"/>
                    </programlisting>
                   <para>Response:</para>
                   <para>No data returned in response body</para>
                </example>
                <example>
                    <title>Plug Attachment (JSON)</title>
                    <para>Request:</para>
	                <literallayout class="monospaced">
PUT /tenants/XYZ/networks/158233b0-ca9a-40b4-8614-54a4a99d47d1/ports/b832be00-6553-4f69-af33-acd554e36d08/attachment.json
	                </literallayout>
                    <programlisting language="xml"><xi:include href="samples/att-put-req.json" parse="text"/>
                    </programlisting>
                    <para>Response:</para>
					<para>No data returned in response body</para>
				</example>
            </section>
			<section xml:id="Delete_Attachment">
                <title>Unplug Attachment from Port</title>
                <informaltable rules="all">
                    <thead>
                        <tr>
                            <td colspan="1">Verb</td>
                            <td colspan="2">URI</td>
                            <td colspan="3">Description</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td colspan="1">&DELETE;</td>
                            <td colspan="2">/tenants/<emphasis>{tenant-id}</emphasis>/networks/
                            				<emphasis>{network-id}</emphasis>/ports/
                            				<emphasis>{port-id}</emphasis>/attachment</td>
                            <td colspan="3">
							Removes the attachment currently plugged
							into the port identified by
							<emphasis>port-id</emphasis>.
							</td>
                        </tr>
                    </tbody>
                </informaltable>
                <simpara>
                    Normal Response Code(s):
                    <returnvalue>204</returnvalue>
                </simpara>
                <simpara>
                    Error Response Code(s):
                    Unauthorized (<errorcode>401</errorcode>),
                    Forbidden (<errorcode>403</errorcode>),
                    NetworkNotFound (<errorcode>420</errorcode>),
                    PortNotFound (<errorcode>430</errorcode>)
                </simpara>
                <para>
				This operation removes the attachment from the port
				specified in the request URI.
				</para><para>
				If no attachment is currently plugged into the port,
				this operation has no effect.
				</para>
                <para>
                This operation does not require a request body
                </para>
                <example>
                    <title>Remove Attachment (XML)</title>
                    <para>Request:</para>
	                <literallayout class="monospaced">
DELETE /tenants/XYZ/networks/158233b0-ca9a-40b4-8614-54a4a99d47d1/ports/b832be00-6553-4f69-af33-acd554e36d08/attachment.xml
	                </literallayout>
                   <para>Response:</para>
                   <para>No data returned in response body</para>
                </example>
                <example>
                    <title>Remove Attachment (JSON)</title>
                    <para>Request:</para>
	                <literallayout class="monospaced">
DELETE /tenants/XYZ/networks/158233b0-ca9a-40b4-8614-54a4a99d47d1/ports/b832be00-6553-4f69-af33-acd554e36d08/attachment.json
	                </literallayout>
                    <para>Response:</para>
					<para>No data returned in response body</para>
				</example>
            </section>
        </section>
    </chapter>
</book>