From 3782761d048c96101811c79de64b505849ff772f Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Thu, 21 Jun 2018 16:59:05 +0300 Subject: [PATCH 1/4] chore(version): bump version number --- api/portainer.go | 2 +- api/swagger.yaml | 4 ++-- distribution/portainer.spec | 2 +- package.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/portainer.go b/api/portainer.go index 31b9c5203..2b941b5c7 100644 --- a/api/portainer.go +++ b/api/portainer.go @@ -484,7 +484,7 @@ type ( const ( // APIVersion is the version number of the Portainer API. - APIVersion = "1.18.0" + APIVersion = "1.18.1-dev" // DBVersion is the version number of the Portainer database. DBVersion = 12 // DefaultTemplatesURL represents the default URL for the templates definitions. diff --git a/api/swagger.yaml b/api/swagger.yaml index 086437dc3..64ff3e69c 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -54,7 +54,7 @@ info: **NOTE**: You can find more information on how to query the Docker API in the [Docker official documentation](https://docs.docker.com/engine/api/v1.30/) as well as in [this Portainer example](https://gist.github.com/deviantony/77026d402366b4b43fa5918d41bc42f8). - version: "1.18.0" + version: "1.18.1-dev" title: "Portainer API" contact: email: "info@portainer.io" @@ -2598,7 +2598,7 @@ definitions: description: "Is analytics enabled" Version: type: "string" - example: "1.18.0" + example: "1.18.1-dev" description: "Portainer API version" PublicSettingsInspectResponse: type: "object" diff --git a/distribution/portainer.spec b/distribution/portainer.spec index b99fff674..b065c5609 100644 --- a/distribution/portainer.spec +++ b/distribution/portainer.spec @@ -1,5 +1,5 @@ Name: portainer -Version: 1.18.0 +Version: 1.18.1-dev Release: 0 License: Zlib Summary: A lightweight docker management UI diff --git a/package.json b/package.json index d536cdccb..9a515e065 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Portainer.io", "name": "portainer", "homepage": "http://portainer.io", - "version": "1.18.0", + "version": "1.18.1-dev", "repository": { "type": "git", "url": "git@github.com:portainer/portainer.git" From f3925cb3ae840c79b790f4db2044adc7941e8d51 Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Fri, 22 Jun 2018 08:51:40 +0300 Subject: [PATCH 2/4] docs(swagger): update missing stack documentation --- api/swagger.yaml | 81 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 77 insertions(+), 4 deletions(-) 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: From dbcc6a96245cbad98d1cce425f745f06eaeb8168 Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Mon, 25 Jun 2018 14:48:28 +0300 Subject: [PATCH 3/4] fix(stack-creation): use numeric value for stack root folder name (#2000) --- api/http/handler/stacks/create_compose_stack.go | 2 +- api/http/handler/stacks/create_swarm_stack.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/http/handler/stacks/create_compose_stack.go b/api/http/handler/stacks/create_compose_stack.go index 26e1c6217..748b3c155 100644 --- a/api/http/handler/stacks/create_compose_stack.go +++ b/api/http/handler/stacks/create_compose_stack.go @@ -137,7 +137,7 @@ func (handler *Handler) createComposeStackFromGitRepository(w http.ResponseWrite EntryPoint: payload.ComposeFilePathInRepository, } - projectPath := handler.FileService.GetStackProjectPath(string(stack.ID)) + projectPath := handler.FileService.GetStackProjectPath(strconv.Itoa(int(stack.ID))) stack.ProjectPath = projectPath gitCloneParams := &cloneRepositoryParameters{ diff --git a/api/http/handler/stacks/create_swarm_stack.go b/api/http/handler/stacks/create_swarm_stack.go index 6fee54221..05084a99d 100644 --- a/api/http/handler/stacks/create_swarm_stack.go +++ b/api/http/handler/stacks/create_swarm_stack.go @@ -151,7 +151,7 @@ func (handler *Handler) createSwarmStackFromGitRepository(w http.ResponseWriter, Env: payload.Env, } - projectPath := handler.FileService.GetStackProjectPath(string(stack.ID)) + projectPath := handler.FileService.GetStackProjectPath(strconv.Itoa(int(stack.ID))) stack.ProjectPath = projectPath gitCloneParams := &cloneRepositoryParameters{ From b19356be6ff9c57c6d5ae63fc4dc3fb74ee84aad Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Mon, 25 Jun 2018 15:13:01 +0300 Subject: [PATCH 4/4] chore(version): bump version number --- api/portainer.go | 2 +- api/swagger.yaml | 4 ++-- distribution/portainer.spec | 2 +- package.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/portainer.go b/api/portainer.go index 2b941b5c7..abb60df79 100644 --- a/api/portainer.go +++ b/api/portainer.go @@ -484,7 +484,7 @@ type ( const ( // APIVersion is the version number of the Portainer API. - APIVersion = "1.18.1-dev" + APIVersion = "1.18.1" // DBVersion is the version number of the Portainer database. DBVersion = 12 // DefaultTemplatesURL represents the default URL for the templates definitions. diff --git a/api/swagger.yaml b/api/swagger.yaml index 2c583d6b4..1172d1706 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -54,7 +54,7 @@ info: **NOTE**: You can find more information on how to query the Docker API in the [Docker official documentation](https://docs.docker.com/engine/api/v1.30/) as well as in [this Portainer example](https://gist.github.com/deviantony/77026d402366b4b43fa5918d41bc42f8). - version: "1.18.1-dev" + version: "1.18.1" title: "Portainer API" contact: email: "info@portainer.io" @@ -2658,7 +2658,7 @@ definitions: description: "Is analytics enabled" Version: type: "string" - example: "1.18.1-dev" + example: "1.18.1" description: "Portainer API version" PublicSettingsInspectResponse: type: "object" diff --git a/distribution/portainer.spec b/distribution/portainer.spec index b065c5609..d38ffc694 100644 --- a/distribution/portainer.spec +++ b/distribution/portainer.spec @@ -1,5 +1,5 @@ Name: portainer -Version: 1.18.1-dev +Version: 1.18.1 Release: 0 License: Zlib Summary: A lightweight docker management UI diff --git a/package.json b/package.json index 9a515e065..5a4becede 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Portainer.io", "name": "portainer", "homepage": "http://portainer.io", - "version": "1.18.1-dev", + "version": "1.18.1", "repository": { "type": "git", "url": "git@github.com:portainer/portainer.git"