diff --git a/api/services/ocean/aksV2/paths/workloadMigrationDiscovery.yaml b/api/services/ocean/aksV2/paths/workloadMigrationDiscovery.yaml new file mode 100644 index 000000000..ff92504d7 --- /dev/null +++ b/api/services/ocean/aksV2/paths/workloadMigrationDiscovery.yaml @@ -0,0 +1,22 @@ +get: + summary: "Get Migration Discovery" + description: | + Get information about nodes which can be migrated into Ocean. + operationId: "oceanAksV2GetMigrationDiscovery" + tags: + - "Ocean AKS" + parameters: + - $ref: "../../../../commons/parameters/accountId.yaml" + - $ref: "../../commons/parameters/oceanClusterId.yaml" + - in: "query" + name: "shouldFetchPods" + example: "true" + description: > + Should fetch data about running pods for each node. + schema: + type: "boolean" + responses: + 200: + $ref: "../responses/migrationDiscovery.yaml" + 400: + description: "Bad Request" \ No newline at end of file diff --git a/api/services/ocean/aksV2/responses/migrationDiscovery.yaml b/api/services/ocean/aksV2/responses/migrationDiscovery.yaml new file mode 100644 index 000000000..a2b3ee326 --- /dev/null +++ b/api/services/ocean/aksV2/responses/migrationDiscovery.yaml @@ -0,0 +1,23 @@ +description: Migration Discovery Response +content: + application/json: + schema: + allOf: + - $ref: "../../../../commons/schemas/responseItemWrapper.yaml" + - type: object + properties: + request: + type: object + properties: + url: + example: "ocean/azure/np/cluster/o-abcd1234/migration/discovery" + method: + example: "GET" + response: + properties: + items: + type: array + items: + $ref: "../schemas/oceanMigrationDiscovery.yaml" + kind: + example: "spotinst:ocean:azure:k8s:np:nodePoolUnmanaged" \ No newline at end of file diff --git a/api/services/ocean/aksV2/schemas/oceanMigrationDiscovery.yaml b/api/services/ocean/aksV2/schemas/oceanMigrationDiscovery.yaml new file mode 100644 index 000000000..b6c6b8a65 --- /dev/null +++ b/api/services/ocean/aksV2/schemas/oceanMigrationDiscovery.yaml @@ -0,0 +1,16 @@ +title: Workload migration discovery details +description: "Information about available nodes which can be migrated to the Ocean cluster" +type: object +properties: + nodeName: + type: string + description: "The node name." + example: "aks-mynodepool-18735776-vmss000001" + nodePoolName: + type: string + description: "The NodePool Name." + example: "mynodepool" + runningPods: + type: integer + description: "The number of running pods on the node (appears if shouldFetchPods was true)." + example: "6" diff --git a/api/spot.yaml b/api/spot.yaml index c4616fa24..948242c51 100644 --- a/api/spot.yaml +++ b/api/spot.yaml @@ -694,6 +694,8 @@ paths: $ref: services/ocean/aksV2/paths/clusterLaunchNodes.yaml /ocean/azure/np/virtualNodeGroup: $ref: services/ocean/aksV2/paths/virtualNodeGroups.yaml + /ocean/azure/np/cluster/{oceanClusterId}/migration/discovery: + $ref: services/ocean/aksV2/paths/workloadMigrationDiscovery.yaml /ocean/azure/np/virtualNodeGroup/{virtualNodeGroupId}: $ref: services/ocean/aksV2/paths/virtualNodeGroup.yaml /ocean/azure/np/virtualNodeGroup/import: