v3election.swagger.json 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "title": "etcdserver/api/v3election/v3electionpb/v3election.proto",
  5. "version": "version not set"
  6. },
  7. "schemes": [
  8. "http",
  9. "https"
  10. ],
  11. "consumes": [
  12. "application/json"
  13. ],
  14. "produces": [
  15. "application/json"
  16. ],
  17. "paths": {
  18. "/v3/election/campaign": {
  19. "post": {
  20. "summary": "Campaign waits to acquire leadership in an election, returning a LeaderKey\nrepresenting the leadership if successful. The LeaderKey can then be used\nto issue new values on the election, transactionally guard API requests on\nleadership still being held, and resign from the election.",
  21. "operationId": "Campaign",
  22. "responses": {
  23. "200": {
  24. "description": "A successful response.",
  25. "schema": {
  26. "$ref": "#/definitions/v3electionpbCampaignResponse"
  27. }
  28. }
  29. },
  30. "parameters": [
  31. {
  32. "name": "body",
  33. "in": "body",
  34. "required": true,
  35. "schema": {
  36. "$ref": "#/definitions/v3electionpbCampaignRequest"
  37. }
  38. }
  39. ],
  40. "tags": [
  41. "Election"
  42. ]
  43. }
  44. },
  45. "/v3/election/leader": {
  46. "post": {
  47. "summary": "Leader returns the current election proclamation, if any.",
  48. "operationId": "Leader",
  49. "responses": {
  50. "200": {
  51. "description": "A successful response.",
  52. "schema": {
  53. "$ref": "#/definitions/v3electionpbLeaderResponse"
  54. }
  55. }
  56. },
  57. "parameters": [
  58. {
  59. "name": "body",
  60. "in": "body",
  61. "required": true,
  62. "schema": {
  63. "$ref": "#/definitions/v3electionpbLeaderRequest"
  64. }
  65. }
  66. ],
  67. "tags": [
  68. "Election"
  69. ]
  70. }
  71. },
  72. "/v3/election/observe": {
  73. "post": {
  74. "summary": "Observe streams election proclamations in-order as made by the election's\nelected leaders.",
  75. "operationId": "Observe",
  76. "responses": {
  77. "200": {
  78. "description": "A successful response.(streaming responses)",
  79. "schema": {
  80. "$ref": "#/definitions/v3electionpbLeaderResponse"
  81. }
  82. }
  83. },
  84. "parameters": [
  85. {
  86. "name": "body",
  87. "in": "body",
  88. "required": true,
  89. "schema": {
  90. "$ref": "#/definitions/v3electionpbLeaderRequest"
  91. }
  92. }
  93. ],
  94. "tags": [
  95. "Election"
  96. ]
  97. }
  98. },
  99. "/v3/election/proclaim": {
  100. "post": {
  101. "summary": "Proclaim updates the leader's posted value with a new value.",
  102. "operationId": "Proclaim",
  103. "responses": {
  104. "200": {
  105. "description": "A successful response.",
  106. "schema": {
  107. "$ref": "#/definitions/v3electionpbProclaimResponse"
  108. }
  109. }
  110. },
  111. "parameters": [
  112. {
  113. "name": "body",
  114. "in": "body",
  115. "required": true,
  116. "schema": {
  117. "$ref": "#/definitions/v3electionpbProclaimRequest"
  118. }
  119. }
  120. ],
  121. "tags": [
  122. "Election"
  123. ]
  124. }
  125. },
  126. "/v3/election/resign": {
  127. "post": {
  128. "summary": "Resign releases election leadership so other campaigners may acquire\nleadership on the election.",
  129. "operationId": "Resign",
  130. "responses": {
  131. "200": {
  132. "description": "A successful response.",
  133. "schema": {
  134. "$ref": "#/definitions/v3electionpbResignResponse"
  135. }
  136. }
  137. },
  138. "parameters": [
  139. {
  140. "name": "body",
  141. "in": "body",
  142. "required": true,
  143. "schema": {
  144. "$ref": "#/definitions/v3electionpbResignRequest"
  145. }
  146. }
  147. ],
  148. "tags": [
  149. "Election"
  150. ]
  151. }
  152. }
  153. },
  154. "definitions": {
  155. "etcdserverpbResponseHeader": {
  156. "type": "object",
  157. "properties": {
  158. "cluster_id": {
  159. "type": "string",
  160. "format": "uint64",
  161. "description": "cluster_id is the ID of the cluster which sent the response."
  162. },
  163. "member_id": {
  164. "type": "string",
  165. "format": "uint64",
  166. "description": "member_id is the ID of the member which sent the response."
  167. },
  168. "revision": {
  169. "type": "string",
  170. "format": "int64",
  171. "description": "revision is the key-value store revision when the request was applied.\nFor watch progress responses, the header.revision indicates progress. All future events\nrecieved in this stream are guaranteed to have a higher revision number than the\nheader.revision number."
  172. },
  173. "raft_term": {
  174. "type": "string",
  175. "format": "uint64",
  176. "description": "raft_term is the raft term when the request was applied."
  177. }
  178. }
  179. },
  180. "mvccpbKeyValue": {
  181. "type": "object",
  182. "properties": {
  183. "key": {
  184. "type": "string",
  185. "format": "byte",
  186. "description": "key is the key in bytes. An empty key is not allowed."
  187. },
  188. "create_revision": {
  189. "type": "string",
  190. "format": "int64",
  191. "description": "create_revision is the revision of last creation on this key."
  192. },
  193. "mod_revision": {
  194. "type": "string",
  195. "format": "int64",
  196. "description": "mod_revision is the revision of last modification on this key."
  197. },
  198. "version": {
  199. "type": "string",
  200. "format": "int64",
  201. "description": "version is the version of the key. A deletion resets\nthe version to zero and any modification of the key\nincreases its version."
  202. },
  203. "value": {
  204. "type": "string",
  205. "format": "byte",
  206. "description": "value is the value held by the key, in bytes."
  207. },
  208. "lease": {
  209. "type": "string",
  210. "format": "int64",
  211. "description": "lease is the ID of the lease that attached to key.\nWhen the attached lease expires, the key will be deleted.\nIf lease is 0, then no lease is attached to the key."
  212. }
  213. }
  214. },
  215. "v3electionpbCampaignRequest": {
  216. "type": "object",
  217. "properties": {
  218. "name": {
  219. "type": "string",
  220. "format": "byte",
  221. "description": "name is the election's identifier for the campaign."
  222. },
  223. "lease": {
  224. "type": "string",
  225. "format": "int64",
  226. "description": "lease is the ID of the lease attached to leadership of the election. If the\nlease expires or is revoked before resigning leadership, then the\nleadership is transferred to the next campaigner, if any."
  227. },
  228. "value": {
  229. "type": "string",
  230. "format": "byte",
  231. "description": "value is the initial proclaimed value set when the campaigner wins the\nelection."
  232. }
  233. }
  234. },
  235. "v3electionpbCampaignResponse": {
  236. "type": "object",
  237. "properties": {
  238. "header": {
  239. "$ref": "#/definitions/etcdserverpbResponseHeader"
  240. },
  241. "leader": {
  242. "$ref": "#/definitions/v3electionpbLeaderKey",
  243. "description": "leader describes the resources used for holding leadereship of the election."
  244. }
  245. }
  246. },
  247. "v3electionpbLeaderKey": {
  248. "type": "object",
  249. "properties": {
  250. "name": {
  251. "type": "string",
  252. "format": "byte",
  253. "description": "name is the election identifier that correponds to the leadership key."
  254. },
  255. "key": {
  256. "type": "string",
  257. "format": "byte",
  258. "description": "key is an opaque key representing the ownership of the election. If the key\nis deleted, then leadership is lost."
  259. },
  260. "rev": {
  261. "type": "string",
  262. "format": "int64",
  263. "description": "rev is the creation revision of the key. It can be used to test for ownership\nof an election during transactions by testing the key's creation revision\nmatches rev."
  264. },
  265. "lease": {
  266. "type": "string",
  267. "format": "int64",
  268. "description": "lease is the lease ID of the election leader."
  269. }
  270. }
  271. },
  272. "v3electionpbLeaderRequest": {
  273. "type": "object",
  274. "properties": {
  275. "name": {
  276. "type": "string",
  277. "format": "byte",
  278. "description": "name is the election identifier for the leadership information."
  279. }
  280. }
  281. },
  282. "v3electionpbLeaderResponse": {
  283. "type": "object",
  284. "properties": {
  285. "header": {
  286. "$ref": "#/definitions/etcdserverpbResponseHeader"
  287. },
  288. "kv": {
  289. "$ref": "#/definitions/mvccpbKeyValue",
  290. "description": "kv is the key-value pair representing the latest leader update."
  291. }
  292. }
  293. },
  294. "v3electionpbProclaimRequest": {
  295. "type": "object",
  296. "properties": {
  297. "leader": {
  298. "$ref": "#/definitions/v3electionpbLeaderKey",
  299. "description": "leader is the leadership hold on the election."
  300. },
  301. "value": {
  302. "type": "string",
  303. "format": "byte",
  304. "description": "value is an update meant to overwrite the leader's current value."
  305. }
  306. }
  307. },
  308. "v3electionpbProclaimResponse": {
  309. "type": "object",
  310. "properties": {
  311. "header": {
  312. "$ref": "#/definitions/etcdserverpbResponseHeader"
  313. }
  314. }
  315. },
  316. "v3electionpbResignRequest": {
  317. "type": "object",
  318. "properties": {
  319. "leader": {
  320. "$ref": "#/definitions/v3electionpbLeaderKey",
  321. "description": "leader is the leadership to relinquish by resignation."
  322. }
  323. }
  324. },
  325. "v3electionpbResignResponse": {
  326. "type": "object",
  327. "properties": {
  328. "header": {
  329. "$ref": "#/definitions/etcdserverpbResponseHeader"
  330. }
  331. }
  332. }
  333. }
  334. }