1{
2  "swagger": "2.0",
3  "info": {
4    "title": "vic-machine API",
5    "description": "An API for performing administrative operations on Virtual Container Hosts. Provides functionality similar to the vic-machine CLI.",
6    "license": {
7      "name": "Apache 2.0",
8      "url": "https://raw.githubusercontent.com/vmware/vic/master/LICENSE"
9    },
10    "version": "v0.1.0"
11  },
12  "basePath": "/container",
13  "schemes": [
14    "http",
15    "https"
16  ],
17  "consumes": [
18    "application/json"
19  ],
20  "produces": [
21    "application/json"
22  ],
23  "paths": {
24    "/": {
25      "get": {
26        "summary": "Show VIC metadata",
27        "description": "A `GET` request on the base resource will return a JSON object containing metadata including the version number of the server software and a list of available appliance ISOs.",
28        "responses": {
29          "200": { "$ref": "#/responses/metadata" }
30        },
31        "tags": ["not-yet-implemented"],
32        "security": []
33      }
34    },
35    "/hello": {
36      "get": {
37        "summary": "Provide a welcome message",
38        "description": "The API server may deployed with self-signed certificates. JavaScript API clients may wish to direct users to this endpoint to view certificate validation errors in their browser.",
39        "produces": [
40          "text/plain"
41        ],
42        "responses": {
43          "200": { "$ref": "#/responses/hello" }
44        },
45        "security": []
46      }
47    },
48    "/version": {
49      "get": {
50        "summary": "Show VIC version information",
51        "description": "A `GET` request on the `version` sub-resource will return the version number of the server software.",
52        "produces": [
53          "text/plain"
54        ],
55        "responses": {
56          "200": { "$ref": "#/responses/version" }
57        },
58        "security": []
59      }
60    },
61    "/target/{target}": {
62      "get": {
63        "summary": "Show information about the specified vSphere resources",
64        "description": "A `GET` request on a vSphere target will return information about the state of the host firewall on those resources.",
65        "parameters": [
66          { "$ref": "#/parameters/target" },
67          { "$ref": "#/parameters/computeResource" },
68          { "$ref": "#/parameters/thumbprint" }
69        ],
70        "responses": {
71          "200": { "$ref": "#/responses/target" },
72          "default": { "$ref": "#/responses/error" }
73        },
74        "tags": ["not-yet-implemented"]
75      },
76      "post": {
77        "summary": "Perform an action on the specified vSphere resources",
78        "description": "A `POST` request on a vSphere target with an action of `firewall:allow` or `firewall:deny` will update the host firewall on those resources.",
79        "parameters": [
80          { "$ref": "#/parameters/target" },
81          { "$ref": "#/parameters/computeResource" },
82          { "$ref": "#/parameters/target-action" },
83          { "$ref": "#/parameters/thumbprint" }
84        ],
85        "responses": {
86          "204": { "$ref": "#/responses/success" },
87          "default": { "$ref": "#/responses/error" }
88        },
89        "tags": ["not-yet-implemented"]
90      }
91    },
92    "/target/{target}/vch": {
93      "get": {
94        "summary": "List VCHs on the target system",
95        "description": "A `GET` request on `/vch` under a target will return information about the VCHs on that target.",
96        "parameters": [
97          { "$ref": "#/parameters/target" },
98          { "$ref": "#/parameters/computeResource" },
99          { "$ref": "#/parameters/thumbprint" }
100        ],
101        "responses": {
102          "200": { "$ref": "#/responses/vch-list" },
103          "default": { "$ref": "#/responses/error" }
104        }
105      },
106      "post": {
107        "summary": "Create a VCH on the target system",
108        "description": "A `POST` request on `/vch` under a target will create a VCH on that target. Information about the VCH will be provided in the body of the request. A portion of the request, including validation, will occur synchronously, with any errors being returned using an appropriate response code and status. The rest of the operation will proceed asynchronously. If present, the returned task can be used to track the progress and status of that asynchronous work.",
109        "parameters": [
110          { "$ref": "#/parameters/target" },
111          { "$ref": "#/parameters/vch" },
112          { "$ref": "#/parameters/thumbprint" }
113        ],
114        "responses": {
115          "201": { "$ref": "#/responses/vsphere-task" },
116          "default": { "$ref": "#/responses/error" }
117        }
118      }
119    },
120    "/target/{target}/vch/{vchId}": {
121      "get": {
122        "summary": "Get information about the target VCH",
123        "description": "A `GET` request on a VCH resource will return information about the VCH. Information about the VCH will be provided in the body of the response in the same format as the `POST` request to create a VCH.",
124        "parameters": [
125          { "$ref": "#/parameters/target" },
126          { "$ref": "#/parameters/vch-id" },
127          { "$ref": "#/parameters/thumbprint" }
128        ],
129        "responses": {
130          "200": { "$ref": "#/responses/vch" },
131          "default": { "$ref": "#/responses/error" }
132        }
133      },
134      "put": {
135        "summary": "Reconfigure the target VCH",
136        "description": "A `PUT` request on a VCH resource will update that VCH's configuration. Information about the VCH will be provided in the body of the request in the same format as the `POST` request to create a VCH. Fields which cannot be modified may appear in the body of a `PUT` as long as the value of those fields match the current state of the object. When the value of a field which cannot be modified does not match the current state, a `409 Conflict` will be returned.",
137        "parameters": [
138          { "$ref": "#/parameters/target" },
139          { "$ref": "#/parameters/vch-id" },
140          { "$ref": "#/parameters/vch" },
141          { "$ref": "#/parameters/thumbprint" }
142        ],
143        "responses": {
144          "202": { "$ref": "#/responses/vsphere-task" },
145          "default": { "$ref": "#/responses/error" }
146        },
147        "tags": ["not-yet-implemented"]
148      },
149      "patch": {
150        "summary": "Reconfigure the target VCH",
151        "description": "A `PATCH` request on a VCH resource (with a body as described in RFC 7396) will update a subset of that VCH's configuration. As `PATCH` is an explicit request to update a set of fields, fields which cannot be modified must not appear in the body of the `PATCH` request, even if the modification would be a no-op.",
152        "consumes": [
153          "application/merge-patch+json"
154        ],
155        "parameters": [
156          { "$ref": "#/parameters/target" },
157          { "$ref": "#/parameters/vch-id" },
158          { "$ref": "#/parameters/vch" },
159          { "$ref": "#/parameters/thumbprint" }
160        ],
161        "responses": {
162          "202": { "$ref": "#/responses/vsphere-task" },
163          "default": { "$ref": "#/responses/error" }
164        },
165        "tags": ["not-yet-implemented"]
166      },
167      "post": {
168        "summary": "Perform an action on the target VCH",
169        "description": "A `POST` request on a VCH resource with an action of `upgrade` will initiate an upgrade of the VCH. The body of the request will be a JSON object containing the following optional properties: `bootstrap-iso` (a reference to a known bootstrap ISO on the OVA) and `rollback` (a boolean value).",
170        "parameters": [
171          { "$ref": "#/parameters/target" },
172          { "$ref": "#/parameters/vch-id" },
173          { "$ref": "#/parameters/vch-action" },
174          { "$ref": "#/parameters/thumbprint" }
175        ],
176        "responses": {
177          "202": { "$ref": "#/responses/vsphere-task" },
178          "default": { "$ref": "#/responses/error" }
179        },
180        "tags": ["not-yet-implemented"]
181      },
182      "delete": {
183        "summary": "Delete the target VCH",
184        "description": "A `DELETE` request on a VCH resource will delete that VCH. By default, the request will fail if the VCH contains powered on Container VMs. By default, volume stores will not be deleted.",
185        "parameters": [
186          { "$ref": "#/parameters/target" },
187          { "$ref": "#/parameters/vch-id" },
188          { "$ref": "#/parameters/deletion-specification" },
189          { "$ref": "#/parameters/thumbprint" }
190        ],
191        "responses": {
192          "202": { "$ref": "#/responses/vsphere-task" },
193          "default": { "$ref": "#/responses/error" }
194        }
195      }
196    },
197    "/target/{target}/vch/{vchId}/certificate": {
198      "get": {
199        "summary": "Access the host certificate for a VCH",
200        "description": "A GET request on `/certificate` under a VCH resource will return the certificate the VCH uses when acting as a server, which clients may wish to download and add to a trust store.",
201        "produces": [
202            "application/x-pem-file"
203        ],
204        "parameters": [
205          { "$ref": "#/parameters/target" },
206          { "$ref": "#/parameters/vch-id" },
207          { "$ref": "#/parameters/thumbprint" }
208        ],
209        "responses": {
210            "200": {
211                "$ref": "#/responses/vch-certificate"
212            },
213          "default": { "$ref": "#/responses/error" }
214        }
215      }
216    },
217    "/target/{target}/vch/{vchId}/log": {
218      "get": {
219        "summary": "Access log messages for a VCH",
220        "description": "A `GET` request on `/log` under a VCH resource will return the log messages for the creation process of that VCH.",
221        "produces": [ "text/plain" ],
222        "parameters": [
223          { "$ref": "#/parameters/target" },
224          { "$ref": "#/parameters/vch-id" },
225          { "$ref": "#/parameters/thumbprint" }
226        ],
227        "responses": {
228          "200": { "$ref": "#/responses/vch-log" },
229          "default": { "$ref": "#/responses/error-plain" }
230        }
231      }
232    },
233    "/target/{target}/datacenter/{datacenter}": {
234      "get": {
235        "summary": "Show information about the specified vSphere resources",
236        "description": "Making a `GET` request on a datacenter will return information about the state of the host firewall on those resources.",
237        "parameters": [
238          { "$ref": "#/parameters/target" },
239          { "$ref": "#/parameters/datacenter" },
240          { "$ref": "#/parameters/computeResource" },
241          { "$ref": "#/parameters/thumbprint" }
242        ],
243        "responses": {
244          "200": { "$ref": "#/responses/target" },
245          "default": { "$ref": "#/responses/error" }
246        },
247        "tags": ["not-yet-implemented"]
248      },
249      "post": {
250        "summary": "Perform an action on the specified vSphere resources",
251        "description": "Making a `POST` request on a datacenter with an action of `firewall:allow` or `firewall:deny` will update the host firewall on those resources.",
252        "parameters": [
253          { "$ref": "#/parameters/target" },
254          { "$ref": "#/parameters/datacenter" },
255          { "$ref": "#/parameters/computeResource" },
256          { "$ref": "#/parameters/target-action" },
257          { "$ref": "#/parameters/thumbprint" }
258        ],
259        "responses": {
260          "204": { "$ref": "#/responses/success" },
261          "default": { "$ref": "#/responses/error" }
262        },
263        "tags": ["not-yet-implemented"]
264      }
265    },
266    "/target/{target}/datacenter/{datacenter}/vch": {
267      "get": {
268        "summary": "List VCHs in the specified datacenter of the target system",
269        "description": "A `GET` request on `/vch` under a datacenter will return information about the VCHs in that datacenter.",
270        "parameters": [
271          { "$ref": "#/parameters/target" },
272          { "$ref": "#/parameters/datacenter" },
273          { "$ref": "#/parameters/computeResource" },
274          { "$ref": "#/parameters/thumbprint" }
275        ],
276        "responses": {
277          "200": { "$ref": "#/responses/vch-list" },
278          "default": { "$ref": "#/responses/error" }
279        }
280      },
281      "post": {
282        "summary": "Create a VCH on the target system",
283        "description": "A `POST` request on `/vch` under a datacenter will create a VCH in that datacenter. Information about the VCH will be provided in the body of the request. A portion of the request, including validation, will occur synchronously, with any errors being returned using an appropriate response code and status. The rest of the operation will proceed asynchronously. If present, the returned task can be used to track the progress and status of that asynchronous work.",
284        "parameters": [
285          { "$ref": "#/parameters/target" },
286          { "$ref": "#/parameters/datacenter" },
287          { "$ref": "#/parameters/vch" },
288          { "$ref": "#/parameters/thumbprint" }
289        ],
290        "responses": {
291          "201": { "$ref": "#/responses/vsphere-task" },
292          "default": { "$ref": "#/responses/error" }
293        }
294      }
295    },
296    "/target/{target}/datacenter/{datacenter}/vch/{vchId}": {
297      "get": {
298        "summary": "Get information about the target VCH",
299        "description": "A `GET` request on a VCH resource will return information about the VCH. Information about the VCH will be provided in the body of the response in the same format as the `POST` request to create a VCH.",
300        "parameters": [
301          { "$ref": "#/parameters/target" },
302          { "$ref": "#/parameters/datacenter" },
303          { "$ref": "#/parameters/vch-id" },
304          { "$ref": "#/parameters/thumbprint" }
305        ],
306        "responses": {
307          "200": { "$ref": "#/responses/vch" },
308          "default": { "$ref": "#/responses/error" }
309        }
310      },
311      "put": {
312        "summary": "Reconfigure the target VCH",
313        "description": "A `PUT` request on a VCH resource will update that VCH's configuration. Information about the VCH will be provided in the body of the request in the same format as the `POST` request to create a VCH. Fields which cannot be modified may appear in the body of a `PUT` as long as the value of those fields match the current state of the object. When the value of a field which cannot be modified does not match the current state, a `409 Conflict` will be returned.",
314        "parameters": [
315          { "$ref": "#/parameters/target" },
316          { "$ref": "#/parameters/datacenter" },
317          { "$ref": "#/parameters/vch-id" },
318          { "$ref": "#/parameters/vch" },
319          { "$ref": "#/parameters/thumbprint" }
320        ],
321        "responses": {
322          "202": { "$ref": "#/responses/vsphere-task" },
323          "default": { "$ref": "#/responses/error" }
324        },
325        "tags": ["not-yet-implemented"]
326      },
327      "patch": {
328        "summary": "Reconfigure the target VCH",
329        "description": "A `PATCH` request on a VCH resource (with a body as described in RFC 7396) will update a subset of that VCH's configuration. As `PATCH` is an explicit request to update a set of fields, fields which cannot be modified must not appear in the body of the `PATCH` request, even if the modification would be a no-op.",
330        "consumes": [
331          "application/merge-patch+json"
332        ],
333        "parameters": [
334          { "$ref": "#/parameters/target" },
335          { "$ref": "#/parameters/datacenter" },
336          { "$ref": "#/parameters/vch-id" },
337          { "$ref": "#/parameters/vch" },
338          { "$ref": "#/parameters/thumbprint" }
339        ],
340        "responses": {
341          "202": { "$ref": "#/responses/vsphere-task" },
342          "default": { "$ref": "#/responses/error" }
343        },
344        "tags": ["not-yet-implemented"]
345      },
346      "post": {
347        "summary": "Perform an action on the target VCH",
348        "description": "A `POST` request on a VCH resource with an action of `upgrade` will initiate an upgrade of the VCH. The body of the request will be a JSON object containing the following optional properties: `bootstrap-iso` (a reference to a known bootstrap ISO on the OVA) and `rollback` (a boolean value).",
349        "parameters": [
350          { "$ref": "#/parameters/target" },
351          { "$ref": "#/parameters/datacenter" },
352          { "$ref": "#/parameters/vch-id" },
353          { "$ref": "#/parameters/vch-action" },
354          { "$ref": "#/parameters/thumbprint" }
355        ],
356        "responses": {
357          "202": { "$ref": "#/responses/vsphere-task" },
358          "default": { "$ref": "#/responses/error" }
359        },
360        "tags": ["not-yet-implemented"]
361      },
362      "delete": {
363        "summary": "Delete the target VCH",
364        "description": "A `DELETE` request on a VCH resource will delete that VCH. By default, the request will fail if the VCH contains powered on Container VMs. By default, volume stores will not be deleted.",
365        "parameters": [
366          { "$ref": "#/parameters/target" },
367          { "$ref": "#/parameters/datacenter" },
368          { "$ref": "#/parameters/vch-id" },
369          { "$ref": "#/parameters/deletion-specification" },
370          { "$ref": "#/parameters/thumbprint" }
371        ],
372        "responses": {
373          "202": { "$ref": "#/responses/vsphere-task" },
374          "default": { "$ref": "#/responses/error" }
375        }
376      }
377    },
378    "/target/{target}/datacenter/{datacenter}/vch/{vchId}/certificate": {
379      "get": {
380        "summary": "Access the host certificate for a VCH",
381        "description": "A GET request on `/certificate` under a VCH resource will return the certificate the VCH uses when acting as a server, which clients may wish to download and add to a trust store.",
382        "produces": [
383            "application/x-pem-file"
384        ],
385        "parameters": [
386          { "$ref": "#/parameters/target" },
387          { "$ref": "#/parameters/datacenter" },
388          { "$ref": "#/parameters/vch-id" },
389          { "$ref": "#/parameters/thumbprint" }
390        ],
391        "responses": {
392            "200": {
393                "$ref": "#/responses/vch-certificate"
394            },
395          "default": { "$ref": "#/responses/error" }
396        }
397      }
398    },
399    "/target/{target}/datacenter/{datacenter}/vch/{vchId}/log": {
400      "get": {
401        "summary": "Access log messages for a VCH",
402        "description": "A `GET` request on `/log` under a VCH resource will return the log messages for the creation process of that VCH.",
403        "produces": [ "text/plain" ],
404        "parameters": [
405          { "$ref": "#/parameters/target" },
406          { "$ref": "#/parameters/datacenter" },
407          { "$ref": "#/parameters/vch-id" },
408          { "$ref": "#/parameters/thumbprint" }
409        ],
410        "responses": {
411          "200": { "$ref": "#/responses/vch-log" },
412          "default": { "$ref": "#/responses/error-plain" }
413        }
414      }
415    }
416  },
417  "definitions": {
418    "Error": {
419      "type": "object",
420      "properties": {
421        "message": {
422          "type": "string"
423        }
424      }
425    },
426    "Version": {
427      "type": "string",
428      "pattern": "^v[0-9]+.[0-9]+.[0-9]+-[a-z0-9]+-[0-9]+-[a-f0-9]{7,40}$"
429    },
430    "Bootstrap_Image": {
431      "type": "string"
432    },
433    "Bootstrap_Image_List": {
434      "type": "array",
435      "items": { "$ref": "#/definitions/Bootstrap_Image" }
436    },
437    "Target": {
438      "type": "object",
439      "description": "Information about the current state of a vSphere target.",
440      "properties": {
441        "firewall": {
442          "type": "array",
443          "description": "Information about the firewall status on each host.",
444          "items": {
445            "type": "object",
446            "properties": {
447              "target": {
448                "type": "string"
449              },
450              "in_supported_state": {
451                "type": "boolean"
452              }
453            }
454          }
455        }
456      }
457    },
458    "Value": {
459      "type": "object",
460      "properties": {
461        "units": {
462          "type": "string"
463        },
464        "value": {
465          "type": "integer"
466        }
467      }
468    },
469    "Value_Bits": {
470      "type": "object",
471      "allOf": [
472        { "$ref" : "#/definitions/Value" }
473      ],
474      "properties": {
475        "units": {
476          "type": "string",
477          "enum": [
478            "bit"
479          ]
480        }
481      }
482    },
483    "Value_Bytes": {
484      "type": "object",
485      "allOf": [
486        { "$ref" : "#/definitions/Value" }
487      ],
488      "properties": {
489        "units": {
490          "type": "string",
491          "enum": [
492            "B",
493            "KiB",
494            "MiB",
495            "GiB",
496            "TiB",
497            "PiB"
498          ]
499        }
500      }
501    },
502    "Value_Bytes_Metric": {
503      "type": "object",
504      "allOf": [
505        { "$ref" : "#/definitions/Value" }
506      ],
507      "properties": {
508        "units": {
509          "type": "string",
510          "enum": [
511            "B",
512            "KB",
513            "MB",
514            "GB",
515            "TB",
516            "PB"
517          ]
518        }
519      }
520    },
521    "Value_Hertz": {
522      "type": "object",
523      "allOf": [
524        { "$ref" : "#/definitions/Value" }
525      ],
526      "properties": {
527        "units": {
528          "type": "string",
529          "enum": [
530            "Hz",
531            "KHz",
532            "MHz",
533            "GHz"
534          ]
535        }
536      }
537    },
538    "Shares": {
539      "type": "object",
540      "minProperties": 1,
541      "maxProperties": 1,
542      "properties": {
543        "number": {
544          "type": "integer"
545        },
546        "level": {
547          "type": "string",
548          "enum": [
549            "high",
550            "normal",
551            "low"
552          ]
553        }
554      }
555    },
556    "Managed_Object": {
557      "type": "object",
558      "minProperties": 1,
559      "maxProperties": 1,
560      "properties": {
561        "id": {
562          "type": "string"
563        },
564        "name": {
565          "type": "string"
566        }
567      }
568    },
569    "CIDR": {
570      "type": "string",
571      "description": "A range of IP addresses in CIDR notation (like 192.0.2.0/24).",
572      "pattern": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$"
573    },
574    "IP_Range": {
575      "type": "string",
576      "description": "A range of IP addresses in CIDR notation (like 192.0.2.0/24) or expressed as a simple range (like 198.51.100.10-198.51.100.20).",
577      "pattern": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2])|\\-(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))$"
578    },
579    "IP_Address": {
580      "type": "string",
581      "description": "TODO: see if this can just be a string with a format that captures IPv4 and IPv6?",
582      "format": "ipv4"
583    },
584    "Gateway": {
585      "type": "object",
586      "properties": {
587        "routing_destinations": {
588          "type": "array",
589          "items": { "$ref": "#/definitions/CIDR" }
590        },
591        "address": { "$ref": "#/definitions/IP_Address" }
592      }
593    },
594    "Network": {
595      "type": "object",
596      "properties": {
597        "port_group": { "$ref": "#/definitions/Managed_Object" },
598        "gateway": { "$ref": "#/definitions/Gateway" },
599        "nameservers": {
600          "type": "array",
601          "items": { "$ref": "#/definitions/IP_Address" }
602        },
603        "static": { "$ref": "#/definitions/CIDR" }
604      }
605    },
606    "Container_Network" : {
607      "type": "object",
608      "properties": {
609        "alias": {
610          "type": "string"
611        },
612        "firewall": {
613          "type": "string",
614          "enum": [
615            "closed",
616            "outbound",
617            "peers",
618            "published",
619            "open"
620          ]
621        },
622        "nameservers": {
623          "type": "array",
624          "items": { "$ref": "#/definitions/IP_Address" }
625        },
626        "port_group": { "$ref": "#/definitions/Managed_Object" },
627        "gateway": { "$ref": "#/definitions/Gateway" },
628        "ip_ranges": {
629          "type": "array",
630          "items": { "$ref": "#/definitions/IP_Range" }
631        }
632      }
633    },
634    "PEM": {
635      "type": "string",
636      "pattern": "^.*-----BEGIN [A-Z ]+-----\\s+[A-Za-z0-9+\/\\s]+={0,2}\\s-----END [A-Z ]+-----\\s*$"
637    },
638    "X509_Data": {
639      "type": "object",
640      "minProperties": 1,
641      "maxProperties": 1,
642      "properties": {
643          "pem": { "$ref": "#/definitions/PEM" }
644      }
645    },
646    "VCH": {
647      "type": "object",
648      "properties": {
649        "version":  { "$ref": "#/definitions/Version" },
650        "name": {
651          "type": "string"
652        },
653        "debug": {
654          "type": "integer"
655        },
656        "compute": {
657          "type": "object",
658          "properties": {
659            "cpu": {
660              "type": "object",
661              "properties": {
662                "limit": { "$ref": "#/definitions/Value_Hertz" },
663                "reservation": { "$ref": "#/definitions/Value_Hertz" },
664                "shares": { "$ref": "#/definitions/Shares" }
665              }
666            },
667            "memory": {
668              "type": "object",
669              "properties": {
670                "limit": { "$ref": "#/definitions/Value_Bytes" },
671                "reservation": { "$ref": "#/definitions/Value_Bytes" },
672                "shares": { "$ref": "#/definitions/Shares" }
673              }
674            },
675            "resource": { "$ref": "#/definitions/Managed_Object" },
676            "affinity": {
677              "type": "object",
678              "properties": {
679                "use_vm_group": {
680                  "type": "boolean"
681                }
682              }
683            }
684          }
685        },
686        "network": {
687          "type": "object",
688          "properties": {
689            "bridge": {
690              "type": "object",
691              "properties": {
692                "ip_range": { "$ref": "#/definitions/CIDR" },
693                "network_width": { "type": "integer", "minimum": 1, "maximum": 30, "default": 16},
694                "port_group": { "$ref": "#/definitions/Managed_Object" }
695              }
696            },
697            "client": { "$ref": "#/definitions/Network" },
698            "management": { "$ref": "#/definitions/Network" },
699            "public": { "$ref": "#/definitions/Network" },
700            "container": {
701              "type": "array",
702              "items": { "$ref": "#/definitions/Container_Network" }
703            }
704          }
705        },
706        "storage": {
707          "type": "object",
708          "properties": {
709            "image_stores": {
710              "type": "array",
711              "items": {
712                "type": "string"
713              }
714            },
715            "volume_stores": {
716              "type": "array",
717              "items": {
718                "type": "object",
719                "properties": {
720                  "datastore": {"type": "string"},
721                  "label": {"type": "string"}
722                }
723              }
724            },
725            "base_image_size": { "$ref": "#/definitions/Value_Bytes_Metric" }
726          }
727        },
728        "auth": {
729          "type": "object",
730          "description": "Either `no_tls` or both `client` and `server` must be present.",
731          "properties": {
732            "no_tls": {
733              "type": "boolean"
734            },
735            "client": {
736              "type": "object",
737              "minProperties": 1,
738              "maxProperties": 1,
739              "properties": {
740                "no_tls_verify": {
741                  "type": "boolean"
742                },
743                "certificate_authorities": {
744                  "type": "array",
745                  "items": { "$ref": "#/definitions/X509_Data" }
746                }
747              }
748            },
749            "server": {
750              "type": "object",
751              "description": "Either `generate` or both `certificate` and `private_key` must be provided when creating a VCH. Only `certificate` will be present when retrieving a VCH.",
752              "properties": {
753                "certificate": { "$ref": "#/definitions/X509_Data" },
754                "private_key": { "$ref": "#/definitions/X509_Data" },
755                "generate": {
756                  "type": "object",
757                  "properties": {
758                    "size": { "$ref": "#/definitions/Value_Bits" },
759                    "organization": {
760                      "type": "array",
761                      "items": {
762                        "type": "string"
763                      }
764                    },
765                    "cname": {
766                      "type": "string"
767                    }
768                  }
769                }
770              }
771            }
772          }
773        },
774        "endpoint": {
775          "type": "object",
776          "properties": {
777            "memory": { "$ref": "#/definitions/Value_Bytes" },
778            "cpu": {
779              "type": "object",
780              "properties": {
781                "sockets": {
782                  "type": "integer"
783                }
784              }
785            },
786            "operations_credentials": {
787              "type": "object",
788              "properties": {
789                "password": {
790                  "type": "string",
791                  "format": "password"
792                },
793                "user": {
794                  "type": "string"
795                },
796                "grant_permissions": {
797                  "type": "boolean"
798                }
799              }
800            }
801          }
802        },
803        "registry": {
804          "type": "object",
805          "properties": {
806            "insecure": {
807              "type": "array",
808              "items": {
809                "type": "string"
810              }
811            },
812            "whitelist": {
813              "type": "array",
814              "items": {
815                "type": "string"
816              }
817            },
818            "certificate_authorities": {
819              "type": "array",
820              "items": { "$ref": "#/definitions/X509_Data" }
821            },
822            "image_fetch_proxy": {
823              "type": "object",
824              "properties": {
825                "http": {
826                  "type": "string",
827                  "format": "uri"
828                },
829                "https": {
830                  "type": "string",
831                  "format": "uri"
832                },
833                "no_proxy": {
834                  "type": "array",
835                  "items": {
836                    "type": "string",
837                    "format": "uri"
838                  }
839                }
840              }
841            }
842          }
843        },
844        "runtime": {
845          "type": "object",
846          "properties": {
847            "power_state": {
848              "type": "string"
849            },
850            "upgrade_status": {
851              "type": "string"
852            },
853            "admin_portal": {
854              "type": "string"
855            },
856            "docker_host": {
857              "type": "string"
858            }
859          }
860        },
861        "syslog_addr": {
862          "type": "string",
863          "format": "uri",
864          "pattern": "^(tc|ud)p:\/\/.*"
865        },
866        "container": {
867          "type": "object",
868          "properties": {
869            "name_convention": {
870              "type": "string",
871              "pattern": "^.*(\\{id\\}|\\{name\\}).*"
872            }
873          }
874        }
875      }
876    },
877    "VCH_List_Item": {
878      "type": "object",
879      "properties": {
880        "id": {
881          "type": "string"
882        },
883        "name": {
884          "type": "string"
885        },
886        "parent": {
887          "$ref": "#/definitions/Managed_Object"
888        },
889        "version": {
890          "type": "string"
891        },
892        "power_state": {
893          "type": "string"
894        },
895        "upgrade_status": {
896          "type": "string"
897        },
898        "admin_portal": {
899          "type": "string"
900        },
901        "docker_host": {
902          "type": "string"
903        }
904      }
905    },
906    "VCH_List": {
907      "type": "array",
908      "items": { "$ref": "#/definitions/VCH_List_Item" }
909    },
910    "Deletion_Specification": {
911      "type": "object",
912      "properties": {
913        "containers": {
914          "type": "string",
915          "enum": [
916            "off",
917            "all"
918          ],
919          "default": "off"
920        },
921        "volume_stores": {
922          "type": "string",
923          "enum": [
924            "none",
925            "all"
926          ],
927          "default": "none"
928        }
929      }
930    }
931  },
932  "parameters": {
933    "target": {
934        "name": "target",
935        "in": "path",
936        "required": true,
937        "type": "string"
938    },
939    "datacenter": {
940      "name": "datacenter",
941      "in": "path",
942      "required": true,
943      "type": "string"
944    },
945    "target-action": {
946      "name": "action",
947      "in": "query",
948      "description": "The action to perform on the specified vSphere resources",
949      "required": true,
950      "type": "string",
951      "enum": [
952        "firewall:allow",
953        "firewall:deny"
954      ]
955    },
956    "computeResource": {
957      "name": "compute-resource",
958      "in": "query",
959      "description": "Compute resource path",
960      "type": "string"
961    },
962    "deletion-specification": {
963      "name": "deletion-specification",
964      "in": "body",
965      "description": "Information about the deletion operation",
966      "required": false,
967      "schema": {
968        "$ref": "#/definitions/Deletion_Specification"
969      }
970    },
971    "thumbprint": {
972      "name": "thumbprint",
973      "in": "query",
974      "description": "ESX or vCenter host certificate thumbprint",
975      "type": "string"
976    },
977    "vch-id": {
978      "name": "vchId",
979      "in": "path",
980      "required": true,
981      "type": "string"
982    },
983    "vch": {
984      "name": "vch",
985      "in": "body",
986      "description": "The VCH to create",
987      "required": true,
988      "schema": {
989        "$ref": "#/definitions/VCH"
990      }
991    },
992    "vch-action": {
993      "name": "action",
994      "in": "query",
995      "description": "The action to perform on a VCH",
996      "required": true,
997      "type": "string",
998      "enum": [
999        "debug",
1000        "upgrade"
1001      ]
1002    }
1003  },
1004  "responses": {
1005    "success": {
1006      "description": "A successful operation"
1007    },
1008    "error": {
1009      "description": "An error occurred",
1010      "schema": { "$ref": "#/definitions/Error" }
1011    },
1012    "error-plain": {
1013      "description": "An error occurred",
1014      "schema": {
1015        "type": "string"
1016      }
1017    },
1018    "hello": {
1019      "description": "A static welcome message",
1020      "schema": {
1021        "type": "string"
1022      }
1023    },
1024    "metadata": {
1025      "description": "VIC metadata information",
1026      "schema": {
1027        "type": "object",
1028        "properties": {
1029          "version": { "$ref": "#/definitions/Version" },
1030          "bootstrap-images": { "$ref": "#/definitions/Bootstrap_Image_List" }
1031        }
1032      }
1033    },
1034    "target": {
1035      "description": "A vSphere target",
1036      "schema": { "$ref": "#/definitions/Target" }
1037    },
1038    "vch": {
1039      "description": "A VCH",
1040      "schema": { "$ref": "#/definitions/VCH" }
1041    },
1042    "vch-list": {
1043      "description": "A list of VCHs",
1044      "schema": {
1045        "type": "object",
1046        "properties": {
1047          "vchs": { "$ref": "#/definitions/VCH_List" }
1048        }
1049      }
1050    },
1051    "vch-certificate": {
1052      "description": "A VCH host certificate",
1053      "schema": { "$ref": "#/definitions/PEM" }
1054    },
1055    "vch-log": {
1056      "description": "Log messages for a VCH",
1057      "schema": {
1058        "type": "string"
1059      }
1060    },
1061    "vsphere-task": {
1062      "description": "A vSphere task for work that is occurring asynchronously, or null if the operation is complete.",
1063      "schema": {
1064        "type": "object",
1065        "properties": {
1066          "task": {
1067            "type": "string",
1068            "format": "uri"
1069          }
1070        }
1071      }
1072    },
1073    "version": {
1074      "description": "VIC version information.",
1075      "schema": {
1076        "type": "string"
1077      },
1078      "examples": {
1079        "text/plain": "v1.3.0-xxx-0-000000"
1080      }
1081    }
1082  },
1083  "securityDefinitions": {
1084    "basic": {
1085      "type": "basic"
1086    },
1087    "session": {
1088      "type": "apiKey",
1089      "in": "header",
1090      "name": "X-VMWARE-TICKET"
1091    }
1092  },
1093  "security": [
1094    {"basic": []},
1095    {"session": []}
1096  ]
1097}
1098