Skip to content

Commit

Permalink
Add logic to check if the project namespace exists
Browse files Browse the repository at this point in the history
  • Loading branch information
seungkyua committed Feb 20, 2024
1 parent 3cbaf4b commit 84cc40f
Show file tree
Hide file tree
Showing 9 changed files with 515 additions and 15 deletions.
123 changes: 123 additions & 0 deletions api/swagger/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2290,6 +2290,56 @@ const docTemplate = `{
}
}
},
"/organizations/{organizationId}/projects/check/existence": {
"get": {
"security": [
{
"JWT": []
}
],
"description": "Check project name exist",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Projects"
],
"summary": "Check project name exist",
"parameters": [
{
"type": "string",
"description": "Organization ID",
"name": "organizationId",
"in": "path",
"required": true
},
{
"type": "string",
"description": "type (name)",
"name": "type",
"in": "query"
},
{
"type": "string",
"description": "value (project name)",
"name": "value",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/domain.CheckExistedResponse"
}
}
}
}
},
"/organizations/{organizationId}/projects/pass/project-roles": {
"get": {
"security": [
Expand Down Expand Up @@ -3857,6 +3907,71 @@ const docTemplate = `{
}
}
},
"put": {
"security": [
{
"JWT": []
}
],
"description": "Update project namespace",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Projects"
],
"summary": "Update project namespace",
"parameters": [
{
"type": "string",
"description": "Organization ID",
"name": "organizationId",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Project ID",
"name": "projectId",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Project Namespace",
"name": "projectNamespace",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Project Stack ID",
"name": "stackId",
"in": "path",
"required": true
},
{
"description": "Request body to update project namespace",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.UpdateProjectNamespaceRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/domain.CommonProjectResponse"
}
}
}
},
"delete": {
"security": [
{
Expand Down Expand Up @@ -8353,6 +8468,14 @@ const docTemplate = `{
}
}
},
"domain.UpdateProjectNamespaceRequest": {
"type": "object",
"properties": {
"description": {
"type": "string"
}
}
},
"domain.UpdateProjectRequest": {
"type": "object",
"required": [
Expand Down
123 changes: 123 additions & 0 deletions api/swagger/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2284,6 +2284,56 @@
}
}
},
"/organizations/{organizationId}/projects/check/existence": {
"get": {
"security": [
{
"JWT": []
}
],
"description": "Check project name exist",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Projects"
],
"summary": "Check project name exist",
"parameters": [
{
"type": "string",
"description": "Organization ID",
"name": "organizationId",
"in": "path",
"required": true
},
{
"type": "string",
"description": "type (name)",
"name": "type",
"in": "query"
},
{
"type": "string",
"description": "value (project name)",
"name": "value",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/domain.CheckExistedResponse"
}
}
}
}
},
"/organizations/{organizationId}/projects/pass/project-roles": {
"get": {
"security": [
Expand Down Expand Up @@ -3851,6 +3901,71 @@
}
}
},
"put": {
"security": [
{
"JWT": []
}
],
"description": "Update project namespace",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Projects"
],
"summary": "Update project namespace",
"parameters": [
{
"type": "string",
"description": "Organization ID",
"name": "organizationId",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Project ID",
"name": "projectId",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Project Namespace",
"name": "projectNamespace",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Project Stack ID",
"name": "stackId",
"in": "path",
"required": true
},
{
"description": "Request body to update project namespace",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.UpdateProjectNamespaceRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/domain.CommonProjectResponse"
}
}
}
},
"delete": {
"security": [
{
Expand Down Expand Up @@ -8347,6 +8462,14 @@
}
}
},
"domain.UpdateProjectNamespaceRequest": {
"type": "object",
"properties": {
"description": {
"type": "string"
}
}
},
"domain.UpdateProjectRequest": {
"type": "object",
"required": [
Expand Down
80 changes: 80 additions & 0 deletions api/swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2224,6 +2224,11 @@ definitions:
type: object
type: array
type: object
domain.UpdateProjectNamespaceRequest:
properties:
description:
type: string
type: object
domain.UpdateProjectRequest:
properties:
description:
Expand Down Expand Up @@ -4830,6 +4835,49 @@ paths:
summary: Get project namespace
tags:
- Projects
put:
consumes:
- application/json
description: Update project namespace
parameters:
- description: Organization ID
in: path
name: organizationId
required: true
type: string
- description: Project ID
in: path
name: projectId
required: true
type: string
- description: Project Namespace
in: path
name: projectNamespace
required: true
type: string
- description: Project Stack ID
in: path
name: stackId
required: true
type: string
- description: Request body to update project namespace
in: body
name: request
required: true
schema:
$ref: '#/definitions/domain.UpdateProjectNamespaceRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/domain.CommonProjectResponse'
security:
- JWT: []
summary: Update project namespace
tags:
- Projects
/organizations/{organizationId}/projects/{projectId}/namespaces/{projectNamespace}/stacks/{stackId}/existence:
get:
consumes:
Expand Down Expand Up @@ -4868,6 +4916,38 @@ paths:
summary: Check project namespace exist
tags:
- Projects
/organizations/{organizationId}/projects/check/existence:
get:
consumes:
- application/json
description: Check project name exist
parameters:
- description: Organization ID
in: path
name: organizationId
required: true
type: string
- description: type (name)
in: query
name: type
type: string
- description: value (project name)
in: query
name: value
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/domain.CheckExistedResponse'
security:
- JWT: []
summary: Check project name exist
tags:
- Projects
/organizations/{organizationId}/projects/pass/project-roles:
get:
consumes:
Expand Down
Loading

0 comments on commit 84cc40f

Please sign in to comment.