api-with-examples.yaml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. openapi: "3.0.0"
  2. info:
  3. title: Simple API overview
  4. version: 2.0.0
  5. paths:
  6. /:
  7. get:
  8. operationId: listVersionsv2
  9. summary: List API versions
  10. responses:
  11. '200':
  12. description: |-
  13. 200 response
  14. content:
  15. application/json:
  16. examples:
  17. foo:
  18. value: {
  19. "versions": [
  20. {
  21. "status": "CURRENT",
  22. "updated": "2011-01-21T11:33:21Z",
  23. "id": "v2.0",
  24. "links": [
  25. {
  26. "href": "http://127.0.0.1:8774/v2/",
  27. "rel": "self"
  28. }
  29. ]
  30. },
  31. {
  32. "status": "EXPERIMENTAL",
  33. "updated": "2013-07-23T11:33:21Z",
  34. "id": "v3.0",
  35. "links": [
  36. {
  37. "href": "http://127.0.0.1:8774/v3/",
  38. "rel": "self"
  39. }
  40. ]
  41. }
  42. ]
  43. }
  44. '300':
  45. description: |-
  46. 300 response
  47. content:
  48. application/json:
  49. examples:
  50. foo:
  51. value: |
  52. {
  53. "versions": [
  54. {
  55. "status": "CURRENT",
  56. "updated": "2011-01-21T11:33:21Z",
  57. "id": "v2.0",
  58. "links": [
  59. {
  60. "href": "http://127.0.0.1:8774/v2/",
  61. "rel": "self"
  62. }
  63. ]
  64. },
  65. {
  66. "status": "EXPERIMENTAL",
  67. "updated": "2013-07-23T11:33:21Z",
  68. "id": "v3.0",
  69. "links": [
  70. {
  71. "href": "http://127.0.0.1:8774/v3/",
  72. "rel": "self"
  73. }
  74. ]
  75. }
  76. ]
  77. }
  78. /v2:
  79. get:
  80. operationId: getVersionDetailsv2
  81. summary: Show API version details
  82. responses:
  83. '200':
  84. description: |-
  85. 200 response
  86. content:
  87. application/json:
  88. examples:
  89. foo:
  90. value: {
  91. "version": {
  92. "status": "CURRENT",
  93. "updated": "2011-01-21T11:33:21Z",
  94. "media-types": [
  95. {
  96. "base": "application/xml",
  97. "type": "application/vnd.openstack.compute+xml;version=2"
  98. },
  99. {
  100. "base": "application/json",
  101. "type": "application/vnd.openstack.compute+json;version=2"
  102. }
  103. ],
  104. "id": "v2.0",
  105. "links": [
  106. {
  107. "href": "http://127.0.0.1:8774/v2/",
  108. "rel": "self"
  109. },
  110. {
  111. "href": "http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf",
  112. "type": "application/pdf",
  113. "rel": "describedby"
  114. },
  115. {
  116. "href": "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl",
  117. "type": "application/vnd.sun.wadl+xml",
  118. "rel": "describedby"
  119. },
  120. {
  121. "href": "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl",
  122. "type": "application/vnd.sun.wadl+xml",
  123. "rel": "describedby"
  124. }
  125. ]
  126. }
  127. }
  128. '203':
  129. description: |-
  130. 203 response
  131. content:
  132. application/json:
  133. examples:
  134. foo:
  135. value: {
  136. "version": {
  137. "status": "CURRENT",
  138. "updated": "2011-01-21T11:33:21Z",
  139. "media-types": [
  140. {
  141. "base": "application/xml",
  142. "type": "application/vnd.openstack.compute+xml;version=2"
  143. },
  144. {
  145. "base": "application/json",
  146. "type": "application/vnd.openstack.compute+json;version=2"
  147. }
  148. ],
  149. "id": "v2.0",
  150. "links": [
  151. {
  152. "href": "http://23.253.228.211:8774/v2/",
  153. "rel": "self"
  154. },
  155. {
  156. "href": "http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf",
  157. "type": "application/pdf",
  158. "rel": "describedby"
  159. },
  160. {
  161. "href": "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl",
  162. "type": "application/vnd.sun.wadl+xml",
  163. "rel": "describedby"
  164. }
  165. ]
  166. }
  167. }