diff --git a/api/swagger.yaml b/api/swagger.yaml index 64ff3e69c..2c583d6b4 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -1386,7 +1386,7 @@ paths: in: "path" description: "Stack identifier" required: true - type: "string" + type: "integer" responses: 200: description: "Success" @@ -1431,7 +1431,12 @@ paths: in: "path" description: "Stack identifier" required: true - type: "string" + type: "integer" + - name: "endpointId" + in: "query" + description: "Stacks created before version 1.18.0 might not have an associated endpoint identifier. Use this \ + optional parameter to set the endpoint identifier used by the stack." + type: "integer" - in: "body" name: "body" description: "Stack details" @@ -1478,7 +1483,7 @@ paths: in: "path" description: "Stack identifier" required: true - type: "string" + type: "integer" - name: "external" in: "query" description: "Set to true to delete an external stack. Only external Swarm stacks are supported." @@ -1528,7 +1533,7 @@ paths: in: "path" description: "Stack identifier" required: true - type: "string" + type: "integer" responses: 200: description: "Success" @@ -1556,6 +1561,61 @@ paths: description: "Server error" schema: $ref: "#/definitions/GenericError" + /stacks/{id}/migrate: + post: + tags: + - "stacks" + summary: "Migrate a stack to another endpoint" + description: | + Migrate a stack from an endpoint to another endpoint. It will re-create + the stack inside the target endpoint before removing the original stack. + **Access policy**: restricted + operationId: "StackMigrate" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "Stack identifier" + required: true + type: "integer" + - name: "endpointId" + in: "query" + description: "Stacks created before version 1.18.0 might not have an associated endpoint identifier. Use this \ + optional parameter to set the endpoint identifier used by the stack." + type: "integer" + - in: "body" + name: "body" + description: "Stack migration details." + schema: + $ref: "#/definitions/StackMigrateRequest" + responses: + 200: + description: "Success" + schema: + $ref: "#/definitions/Stack" + 400: + description: "Invalid request" + schema: + $ref: "#/definitions/GenericError" + examples: + application/json: + err: "Invalid request" + 403: + description: "Unauthorized" + schema: + $ref: "#/definitions/GenericError" + 404: + description: "Stack not found" + schema: + $ref: "#/definitions/GenericError" + examples: + application/json: + err: "Stack not found" + 500: + description: "Server error" + schema: + $ref: "#/definitions/GenericError" /users: get: tags: @@ -3561,6 +3621,19 @@ definitions: type: "string" example: "nginx:latest" description: "The Docker image associated to the template" + StackMigrateRequest: + type: "object" + required: + - "EndpointID" + properties: + EndpointID: + type: "integer" + example: 2 + description: "Endpoint identifier of the target endpoint where the stack will be relocated" + SwarmID: + type: "string" + example: "jpofkc0i9uo9wtx1zesuk649w" + description: "Swarm cluster identifier, must match the identifier of the cluster where the stack will be relocated" StackCreateRequest: type: "object" required: