· 6 years ago · Oct 25, 2019, 03:36 AM
1swagger: "2.0"
2info:
3 description: ""
4 version: "1.0.0"
5 title: "Skyline kubernetes infrastructure"
6 contact:
7 email: "grp.skyline@corp.netease.com"
8host: "int.api.test-skyline.nie.netease.com"
9basePath: "/provider"
10tags:
11- name: "infrastructure"
12 description: "kuberntes infrastructure"
13 externalDocs:
14 description: "infrastructure of kubernetes"
15 url: "http://int.api.test-skyline.nie.netease.com/api/v1/"
16- name: "instances"
17 description: "cloud instance Operations"
18 externalDocs:
19 url: "http://int.api.test-skyline.nie.netease.com/api/v1/"
20schemes:
21- "http"
22paths:
23 /aws.global/k8sinfra:
24 post:
25 tags:
26 - "infrastructure"
27 summary: "create kubernetes network infrastructure on aws"
28 description: ""
29 operationId: "awsCreateInfrastructure"
30 consumes:
31 - "application/json"
32 produces:
33 - "application/json"
34 parameters:
35 - in: "body"
36 name: "body"
37 description: "cluster api aws network spec"
38 required: true
39 schema:
40 $ref: "#/definitions/awsCreateInfrastructure"
41 responses:
42 200:
43 description: "successful operation"
44 schema:
45 $ref: "#/definitions/ApiResponse"
46 405:
47 description: "Invalid input"
48 /aws.global/{k8sinfra}:
49 get:
50 tags:
51 - "infrastructure"
52 summary: "describe cluster by clusterID"
53 description: ""
54 operationId: "awsDescribeInfrastructure"
55 produces:
56 - "application/json"
57 parameters:
58 - name: "k8sinfra"
59 in: "path"
60 description: "ID of pet that needs to be fetched"
61 required: true
62 type: "string"
63 responses:
64 200:
65 description: "successful operation"
66 schema:
67 $ref: "#/definitions/awsDescribeInfrastructureRsp"
68 400:
69 description: "Invalid ID supplied"
70 404:
71 description: "Order not found"
72 patch:
73 tags:
74 - "infrastructure"
75 summary: "Update an existing clusterID"
76 description: ""
77 operationId: "awsUpdateInfrastructure"
78 consumes:
79 - "application/json"
80 produces:
81 - "application/json"
82 parameters:
83 - name: "k8sinfra"
84 in: "path"
85 description: "ID of pet that needs to be fetched"
86 required: true
87 type: "string"
88 - in: "body"
89 name: "body"
90 description: "cluster object that needs to be update to the store"
91 required: true
92 schema:
93 $ref: "#/definitions/awsCreateInfrastructure"
94 responses:
95 200:
96 description: "successful Update operation"
97 schema:
98 $ref: "#/definitions/awsDescribeInfrastructureRsp"
99 400:
100 description: "Invalid ID supplied"
101 404:
102 description: "Pet not found"
103 405:
104 description: "Validation exception"
105 delete:
106 tags:
107 - "infrastructure"
108 summary: "Delete cluster by clusterID"
109 description: ""
110 operationId: "awsDeleteInfrastructure"
111 produces:
112 - "application/json"
113 parameters:
114 - name: "k8sinfra"
115 in: "path"
116 description: "ID of the cluster that needs to be deleted"
117 required: true
118 type: "string"
119 responses:
120 200:
121 description: "successful operation"
122 schema:
123 $ref: "#/definitions/DeleteCluster"
124 400:
125 description: "Invalid ID supplied"
126 404:
127 description: "Cluster not found"
128 /instances:
129 post:
130 tags:
131 - "instances"
132 summary: "create cloud instances"
133 description: ""
134 operationId: "addInstances"
135 consumes:
136 - "application/json"
137 produces:
138 - "application/json"
139 parameters:
140 - in: "body"
141 name: "body"
142 description: "create cloud instances"
143 required: true
144 schema:
145 $ref: "#/definitions/Instances"
146 responses:
147 200:
148 description: "successful operation"
149 schema:
150 $ref: "#/definitions/ApiResponse"
151 405:
152 description: "Invalid input"
153definitions:
154 awsCreateInfrastructure:
155 required:
156 - "networkSpec"
157 - "region"
158 - "sshKeyName"
159 properties:
160 networkSpec:
161 required:
162 - "subnets"
163 - "vpc"
164 properties:
165 subnets:
166 type: "array"
167 items:
168 type: "object"
169 properties:
170 availabilityZone:
171 type: "string"
172 example: "us-east-1a"
173 cidrBlock:
174 type: "string"
175 example: "10.66.0.0/27"
176 isPublic:
177 type: "boolean"
178 example: true
179 tags:
180 required:
181 - "Name"
182 properties:
183 Name:
184 type: "string"
185 example: "oceantest-subnet-public"
186 kubernetes.io/cluster/oceantest:
187 type: "string"
188 example: "shared"
189 kubernetes.io/role/elb:
190 type: "string"
191 example: "1"
192 sigs.k8s.io/cluster-api-provider-aws/cluster/oceantest:
193 type: "string"
194 example: "owned"
195 sigs.k8s.io/cluster-api-provider-aws/role:
196 type: "string"
197 example: "public"
198 type: "object"
199 vpc:
200 required:
201 - "cidrBlock"
202 - "tags"
203 properties:
204 cidrBlock:
205 type: "string"
206 example: "10.66.0.0/24"
207 tags:
208 required:
209 - "Name"
210 properties:
211 Name:
212 type: "string"
213 example: "oceantest-vpc"
214 sigs.k8s.io/cluster-api-provider-aws/cluster/oceantest:
215 type: "string"
216 example: "owned"
217 sigs.k8s.io/cluster-api-provider-aws/role:
218 type: "string"
219 example: "common"
220 type: "object"
221 type: "object"
222 type: "object"
223 region:
224 type: "string"
225 example: "us-east-1"
226 sshKeyName:
227 type: "string"
228 example: "guohao"
229 awsDescribeInfrastructureRsp:
230 required:
231 - "apiEndpoints"
232 - "bastion"
233 - "network"
234 - "ready"
235 properties:
236 apiEndpoints:
237 type: "array"
238 items:
239 type: "object"
240 properties:
241 host:
242 type: "string"
243 example: "oceantest-apiserver-307855724.us-east-1.elb.amazonaws.com"
244 port:
245 type: "number"
246 example: 6443
247 bastion:
248 required:
249 - "ebsOptimized"
250 - "enaSupport"
251 - "id"
252 - "imageId"
253 - "instanceState"
254 - "privateIp"
255 - "publicIp"
256 - "securityGroupIds"
257 - "sshKeyName"
258 - "subnetId"
259 - "tags"
260 - "type"
261 properties:
262 ebsOptimized:
263 type: "boolean"
264 example: false
265 enaSupport:
266 type: "boolean"
267 example: true
268 id:
269 type: "string"
270 example: "i-079518db65b77f093"
271 imageId:
272 type: "string"
273 example: "ami-41e0b93b"
274 instanceState:
275 type: "string"
276 example: "running"
277 privateIp:
278 type: "string"
279 example: "10.66.0.13"
280 publicIp:
281 type: "string"
282 example: "34.205.81.73"
283 securityGroupIds:
284 type: "array"
285 items:
286 type: "string"
287 example:
288 - "sg-0199a4bb3df34f337"
289 sshKeyName:
290 type: "string"
291 example: "guohao"
292 subnetId:
293 type: "string"
294 example: "subnet-0cf7495d794776a5e"
295 tags:
296 required:
297 - "Name"
298 - "sigs.k8s.io/cluster-api-provider-aws/cluster/oceantest"
299 - "sigs.k8s.io/cluster-api-provider-aws/role"
300 properties:
301 Name:
302 type: "string"
303 example: "oceantest-bastion"
304 sigs.k8s.io/cluster-api-provider-aws/cluster/oceantest:
305 type: "string"
306 example: "owned"
307 sigs.k8s.io/cluster-api-provider-aws/role:
308 type: "string"
309 example: "bastion"
310 type: "object"
311 type:
312 type: "string"
313 example: "t2.micro"
314 type: "object"
315 network:
316 required:
317 - "apiServerElb"
318 - "securityGroups"
319 properties:
320 apiServerElb:
321 required:
322 - "attributes"
323 - "dnsName"
324 - "name"
325 - "scheme"
326 - "securityGroupIds"
327 - "subnetIds"
328 properties:
329 attributes:
330 required:
331 - "idleTimeout"
332 properties:
333 idleTimeout:
334 type: "number"
335 example: 600000000000
336 type: "object"
337 dnsName:
338 type: "string"
339 example: "oceantest-apiserver-307855724.us-east-1.elb.amazonaws.com"
340 name:
341 type: "string"
342 example: "oceantest-apiserver"
343 scheme:
344 type: "string"
345 example: "internet-facing"
346 securityGroupIds:
347 type: "array"
348 items:
349 type: "string"
350 example:
351 - "sg-0be7a077b81b0638b"
352 subnetIds:
353 type: "array"
354 items:
355 type: "string"
356 example:
357 - "subnet-014bcf11ae3b8772a"
358 - "subnet-0cf7495d794776a5e"
359 - "subnet-0e2ea3c60d35f31fe"
360 type: "object"
361 securityGroups:
362 required:
363 - "bastion"
364 - "controlplane"
365 - "lb"
366 - "node"
367 properties:
368 bastion:
369 required:
370 - "id"
371 - "ingressRule"
372 - "name"
373 - "tags"
374 properties:
375 id:
376 type: "string"
377 example: "sg-0199a4bb3df34f337"
378 ingressRule:
379 type: "array"
380 items:
381 type: "object"
382 properties:
383 cidrBlocks:
384 type: "array"
385 items:
386 type: "string"
387 example:
388 - "0.0.0.0/0"
389 description:
390 type: "string"
391 example: "SSH"
392 fromPort:
393 type: "number"
394 example: 22
395 protocol:
396 type: "string"
397 example: "tcp"
398 toPort:
399 type: "number"
400 example: 22
401 name:
402 type: "string"
403 example: "oceantest-bastion"
404 tags:
405 required:
406 - "Name"
407 - "sigs.k8s.io/cluster-api-provider-aws/cluster/oceantest"
408 - "sigs.k8s.io/cluster-api-provider-aws/role"
409 properties:
410 Name:
411 type: "string"
412 example: "oceantest-bastion"
413 sigs.k8s.io/cluster-api-provider-aws/cluster/oceantest:
414 type: "string"
415 example: "owned"
416 sigs.k8s.io/cluster-api-provider-aws/role:
417 type: "string"
418 example: "bastion"
419 type: "object"
420 type: "object"
421 controlplane:
422 required:
423 - "id"
424 - "ingressRule"
425 - "name"
426 - "tags"
427 properties:
428 id:
429 type: "string"
430 example: "sg-0be7a077b81b0638b"
431 ingressRule:
432 type: "array"
433 items:
434 type: "object"
435 properties:
436 cidrBlocks:
437 type: "array"
438 items:
439 type: "string"
440 example:
441 - "0.0.0.0/0"
442 description:
443 type: "string"
444 example: "Kubernetes API"
445 fromPort:
446 type: "number"
447 example: 6443
448 protocol:
449 type: "string"
450 example: "tcp"
451 toPort:
452 type: "number"
453 example: 6443
454 name:
455 type: "string"
456 example: "oceantest-controlplane"
457 tags:
458 required:
459 - "Name"
460 - "sigs.k8s.io/cluster-api-provider-aws/cluster/oceantest"
461 - "sigs.k8s.io/cluster-api-provider-aws/role"
462 properties:
463 Name:
464 type: "string"
465 example: "oceantest-controlplane"
466 sigs.k8s.io/cluster-api-provider-aws/cluster/oceantest:
467 type: "string"
468 example: "owned"
469 sigs.k8s.io/cluster-api-provider-aws/role:
470 type: "string"
471 example: "controlplane"
472 type: "object"
473 type: "object"
474 lb:
475 required:
476 - "id"
477 - "ingressRule"
478 - "name"
479 - "tags"
480 properties:
481 id:
482 type: "string"
483 example: "sg-0a5a4419ad9a4eeb8"
484 ingressRule:
485 type: "array"
486 items:
487 type: "object"
488 properties:
489 description:
490 type: "string"
491 example: ""
492 fromPort:
493 type: "number"
494 example: 0
495 protocol:
496 type: "string"
497 example: "tcp"
498 sourceSecurityGroupIds:
499 type: "array"
500 items:
501 type: "string"
502 example:
503 - "sg-08c9f9ed7bca27cfd"
504 toPort:
505 type: "number"
506 example: 65535
507 name:
508 type: "string"
509 example: "oceantest-lb"
510 tags:
511 required:
512 - "Name"
513 - "kubernetes.io/cluster/oceantest"
514 - "sigs.k8s.io/cluster-api-provider-aws/cluster/oceantest"
515 - "sigs.k8s.io/cluster-api-provider-aws/role"
516 properties:
517 Name:
518 type: "string"
519 example: "oceantest-lb"
520 kubernetes.io/cluster/oceantest:
521 type: "string"
522 example: "owned"
523 sigs.k8s.io/cluster-api-provider-aws/cluster/oceantest:
524 type: "string"
525 example: "owned"
526 sigs.k8s.io/cluster-api-provider-aws/role:
527 type: "string"
528 example: "lb"
529 type: "object"
530 type: "object"
531 node:
532 required:
533 - "id"
534 - "ingressRule"
535 - "name"
536 - "tags"
537 properties:
538 id:
539 type: "string"
540 example: "sg-0a53c314f5ce6781e"
541 ingressRule:
542 type: "array"
543 items:
544 type: "object"
545 properties:
546 cidrBlocks:
547 type: "array"
548 items:
549 type: "string"
550 example:
551 - "0.0.0.0/0"
552 description:
553 type: "string"
554 example: "Node Port Services"
555 fromPort:
556 type: "number"
557 example: 30000
558 protocol:
559 type: "string"
560 example: "tcp"
561 toPort:
562 type: "number"
563 example: 32767
564 name:
565 type: "string"
566 example: "oceantest-node"
567 tags:
568 required:
569 - "Name"
570 - "sigs.k8s.io/cluster-api-provider-aws/cluster/oceantest"
571 - "sigs.k8s.io/cluster-api-provider-aws/role"
572 properties:
573 Name:
574 type: "string"
575 example: "oceantest-node"
576 sigs.k8s.io/cluster-api-provider-aws/cluster/oceantest:
577 type: "string"
578 example: "owned"
579 sigs.k8s.io/cluster-api-provider-aws/role:
580 type: "string"
581 example: "node"
582 type: "object"
583 type: "object"
584 type: "object"
585 type: "object"
586 ready:
587 type: "boolean"
588 example: true
589 DeleteCluster:
590 type: "object"
591 required:
592 - "id"
593 - "status"
594 properties:
595 id:
596 type: "string"
597 example: "548affad-2759-4d2c-be6e-afe533288658"
598 status:
599 type: "string"
600 example: "success"
601 Instances:
602 type: "object"
603 required:
604 - "region"
605 - "server_type"
606 - "subnet_cidr"
607 - "inst_type"
608 - "quantity"
609 - "os"
610 - "disks"
611 - "tags"
612 - "userdata"
613 - "project"
614 - "cost_project"
615 - "cloud_type"
616 properties:
617 region:
618 type: "string"
619 example: "[eu-west-2]London"
620 server_type:
621 type: "string"
622 example: "control-plane"
623 enum:
624 - "control-plane"
625 - "worker-node"
626 subnet_cidr:
627 type: "string"
628 example: "10.69.181.64/26"
629 inst_type:
630 type: "string"
631 example: "t3.nano"
632 quantity:
633 type: "integer"
634 format: "int32"
635 os:
636 type: "array"
637 items:
638 $ref: "#/definitions/inst_os"
639 disks:
640 type: "array"
641 items:
642 $ref: "#/definitions/inst_disks"
643 tags:
644 type: "array"
645 items:
646 $ref: "#/definitions/inst_tag"
647 userdata:
648 type: "string"
649 example: "base64-encode-string"
650 project:
651 type: "string"
652 example: "skyline"
653 cost_project:
654 type: "string"
655 example: "skyline"
656 cloud_type:
657 type: "string"
658 example: "aws.global"
659 enum:
660 - "aws.global"
661 - "aws.china"
662 - "gcp.global"
663 inst_os:
664 type: "object"
665 properties:
666 os:
667 type: "string"
668 example: "Debian9"
669 framework:
670 type: "string"
671 example: "64bit"
672 enum:
673 - "64bit"
674 - "arm64"
675 inst_disks:
676 type: "object"
677 properties:
678 type:
679 type: "string"
680 example: "gp2"
681 enum:
682 - "gp2"
683 size:
684 type: "integer"
685 format: "int32"
686 inst_tag:
687 type: "object"
688 properties:
689 Name:
690 type: "string"
691 example: "oceantest-controlplane-0"
692 Key:
693 type: "string"
694 example: "Value"
695 ApiResponse:
696 type: "object"
697 properties:
698 code:
699 type: "integer"
700 format: "int32"
701 example: "200"
702 type:
703 type: "string"
704 message:
705 type: "string"