Skip to content

Commit d3aa2a2

Browse files
yunkon-kimweb-flow
authored andcommitted
Update Swagger REST API doc
1 parent 2acc68b commit d3aa2a2

File tree

3 files changed

+759
-3
lines changed

3 files changed

+759
-3
lines changed

pkg/api/rest/docs/docs.go

Lines changed: 285 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,144 @@ const docTemplate = `{
331331
}
332332
}
333333
},
334+
"/migration/infra/instance": {
335+
"post": {
336+
"description": "It migrates instance on a cloud platform. Storage includes name, spec, OS, and so on.",
337+
"consumes": [
338+
"application/json"
339+
],
340+
"produces": [
341+
"application/json"
342+
],
343+
"tags": [
344+
"[Migration] Infrastructure"
345+
],
346+
"summary": "(Skeleton) Migrate instance on a cloud platform",
347+
"parameters": [
348+
{
349+
"description": "Specify name, spec, OS, and so on.",
350+
"name": "InstanceInfo",
351+
"in": "body",
352+
"required": true,
353+
"schema": {
354+
"$ref": "#/definitions/migration.MigrateInstanceRequest"
355+
}
356+
}
357+
],
358+
"responses": {
359+
"200": {
360+
"description": "Successfully migrated storage on a cloud platform",
361+
"schema": {
362+
"$ref": "#/definitions/migration.MigrateInstanceResponse"
363+
}
364+
},
365+
"404": {
366+
"description": "Not Found",
367+
"schema": {
368+
"$ref": "#/definitions/common.SimpleMsg"
369+
}
370+
},
371+
"500": {
372+
"description": "Internal Server Error",
373+
"schema": {
374+
"$ref": "#/definitions/common.SimpleMsg"
375+
}
376+
}
377+
}
378+
}
379+
},
380+
"/migration/infra/network": {
381+
"post": {
382+
"description": "It migrates network on a cloud platform. Network includes name, ID, IPv4 CIDR block, IPv6 CIDR block, and so on.",
383+
"consumes": [
384+
"application/json"
385+
],
386+
"produces": [
387+
"application/json"
388+
],
389+
"tags": [
390+
"[Migration] Infrastructure"
391+
],
392+
"summary": "(Skeleton) Migrate network on a cloud platform",
393+
"parameters": [
394+
{
395+
"description": "Specify name, IPv4 CIDR block, etc.",
396+
"name": "NetworkInfo",
397+
"in": "body",
398+
"required": true,
399+
"schema": {
400+
"$ref": "#/definitions/migration.MigrateNetworkRequest"
401+
}
402+
}
403+
],
404+
"responses": {
405+
"200": {
406+
"description": "Successfully migrated network on a cloud platform",
407+
"schema": {
408+
"$ref": "#/definitions/migration.MigrateNetworkResponse"
409+
}
410+
},
411+
"404": {
412+
"description": "Not Found",
413+
"schema": {
414+
"$ref": "#/definitions/common.SimpleMsg"
415+
}
416+
},
417+
"500": {
418+
"description": "Internal Server Error",
419+
"schema": {
420+
"$ref": "#/definitions/common.SimpleMsg"
421+
}
422+
}
423+
}
424+
}
425+
},
426+
"/migration/infra/storage": {
427+
"post": {
428+
"description": "It migrates storage on a cloud platform. Storage includes name, ID, type, size, and so on.",
429+
"consumes": [
430+
"application/json"
431+
],
432+
"produces": [
433+
"application/json"
434+
],
435+
"tags": [
436+
"[Migration] Infrastructure"
437+
],
438+
"summary": "(Skeleton) Migrate storage on a cloud platform",
439+
"parameters": [
440+
{
441+
"description": "Specify name, type, size, affiliated Network ID, and so on.",
442+
"name": "StorageInfo",
443+
"in": "body",
444+
"required": true,
445+
"schema": {
446+
"$ref": "#/definitions/migration.MigrateStorageRequest"
447+
}
448+
}
449+
],
450+
"responses": {
451+
"200": {
452+
"description": "Successfully migrated storage on a cloud platform",
453+
"schema": {
454+
"$ref": "#/definitions/migration.MigrateStorageResponse"
455+
}
456+
},
457+
"404": {
458+
"description": "Not Found",
459+
"schema": {
460+
"$ref": "#/definitions/common.SimpleMsg"
461+
}
462+
},
463+
"500": {
464+
"description": "Internal Server Error",
465+
"schema": {
466+
"$ref": "#/definitions/common.SimpleMsg"
467+
}
468+
}
469+
}
470+
}
471+
},
334472
"/ns": {
335473
"get": {
336474
"description": "List all namespaces or namespaces' ID",
@@ -939,6 +1077,132 @@ const docTemplate = `{
9391077
}
9401078
}
9411079
},
1080+
"migration.MigrateInstanceRequest": {
1081+
"type": "object",
1082+
"properties": {
1083+
"NetworkId": {
1084+
"type": "string"
1085+
},
1086+
"id": {
1087+
"type": "string"
1088+
},
1089+
"name": {
1090+
"type": "string"
1091+
},
1092+
"os": {
1093+
"type": "string"
1094+
},
1095+
"type": {
1096+
"type": "string"
1097+
}
1098+
}
1099+
},
1100+
"migration.MigrateInstanceResponse": {
1101+
"type": "object",
1102+
"properties": {
1103+
"NetworkId": {
1104+
"type": "string"
1105+
},
1106+
"id": {
1107+
"type": "string"
1108+
},
1109+
"name": {
1110+
"type": "string"
1111+
},
1112+
"os": {
1113+
"type": "string"
1114+
},
1115+
"type": {
1116+
"type": "string"
1117+
}
1118+
}
1119+
},
1120+
"migration.MigrateNetworkRequest": {
1121+
"type": "object",
1122+
"properties": {
1123+
"id": {
1124+
"type": "string"
1125+
},
1126+
"ipv4CidrBlock": {
1127+
"type": "string"
1128+
},
1129+
"ipv6CidrBlock": {
1130+
"type": "string"
1131+
},
1132+
"name": {
1133+
"type": "string"
1134+
},
1135+
"subnets": {
1136+
"type": "array",
1137+
"items": {
1138+
"$ref": "#/definitions/migration.Subnet"
1139+
}
1140+
}
1141+
}
1142+
},
1143+
"migration.MigrateNetworkResponse": {
1144+
"type": "object",
1145+
"properties": {
1146+
"id": {
1147+
"type": "string"
1148+
},
1149+
"ipv4CidrBlock": {
1150+
"type": "string"
1151+
},
1152+
"ipv6CidrBlock": {
1153+
"type": "string"
1154+
},
1155+
"name": {
1156+
"type": "string"
1157+
},
1158+
"subnets": {
1159+
"type": "array",
1160+
"items": {
1161+
"$ref": "#/definitions/migration.Subnet"
1162+
}
1163+
}
1164+
}
1165+
},
1166+
"migration.MigrateStorageRequest": {
1167+
"type": "object",
1168+
"properties": {
1169+
"NetworkId": {
1170+
"type": "string"
1171+
},
1172+
"id": {
1173+
"type": "string"
1174+
},
1175+
"name": {
1176+
"type": "string"
1177+
},
1178+
"size": {
1179+
"type": "string"
1180+
},
1181+
"type": {
1182+
"type": "string"
1183+
}
1184+
}
1185+
},
1186+
"migration.MigrateStorageResponse": {
1187+
"type": "object",
1188+
"properties": {
1189+
"NetworkId": {
1190+
"type": "string"
1191+
},
1192+
"id": {
1193+
"type": "string"
1194+
},
1195+
"name": {
1196+
"type": "string"
1197+
},
1198+
"size": {
1199+
"type": "string"
1200+
},
1201+
"type": {
1202+
"type": "string"
1203+
}
1204+
}
1205+
},
9421206
"migration.RegionInfo": {
9431207
"type": "object",
9441208
"properties": {
@@ -1136,6 +1400,26 @@ const docTemplate = `{
11361400
}
11371401
}
11381402
},
1403+
"migration.Subnet": {
1404+
"type": "object",
1405+
"properties": {
1406+
"id": {
1407+
"type": "string"
1408+
},
1409+
"ipv4CidrBlock": {
1410+
"type": "string"
1411+
},
1412+
"ipv6CidrBlock": {
1413+
"type": "string"
1414+
},
1415+
"name": {
1416+
"type": "string"
1417+
},
1418+
"parentNetworkId": {
1419+
"type": "string"
1420+
}
1421+
}
1422+
},
11391423
"migration.TbVmDynamicReq": {
11401424
"type": "object",
11411425
"required": [
@@ -1185,7 +1469,7 @@ const docTemplate = `{
11851469
"type": "string",
11861470
"example": "3"
11871471
},
1188-
"vmUserPassword default:": {
1472+
"vmUserPassword": {
11891473
"type": "string"
11901474
}
11911475
}

0 commit comments

Comments
 (0)