Skip to content

Commit

Permalink
feature. add api to stack (fetch)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktkfree committed Apr 13, 2023
1 parent 6de8240 commit cf9fecc
Show file tree
Hide file tree
Showing 12 changed files with 960 additions and 641 deletions.
499 changes: 298 additions & 201 deletions api/swagger/docs.go

Large diffs are not rendered by default.

499 changes: 298 additions & 201 deletions api/swagger/swagger.json

Large diffs are not rendered by default.

348 changes: 207 additions & 141 deletions api/swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ definitions:
type: string
organizationId:
type: string
stackTemplate:
$ref: '#/definitions/domain.StackTemplate'
stackTemplateId:
type: string
status:
type: integer
statusDesc:
Expand Down Expand Up @@ -458,22 +462,18 @@ definitions:
properties:
cloudSettingId:
type: string
description:
type: string
machineReplicas:
cpNodeCnt:
type: integer
machineType:
description:
type: string
name:
type: string
numOfAz:
type: integer
organizationId:
type: string
region:
type: string
stackTemplateId:
type: string
tksNodeCnt:
type: integer
userNodeCnt:
type: integer
type: object
domain.CreateStackResponse:
properties:
Expand Down Expand Up @@ -850,6 +850,41 @@ definitions:
updator:
$ref: '#/definitions/domain.SimpleUserResponse'
type: object
domain.StackTemplate:
properties:
cloudService:
type: string
createdAt:
type: string
creator:
$ref: '#/definitions/domain.User'
creatorId:
type: string
description:
type: string
id:
type: string
kubeType:
type: string
kubeVersion:
type: string
name:
type: string
organizationId:
type: string
platform:
type: string
template:
type: string
updatedAt:
type: string
updator:
$ref: '#/definitions/domain.User'
updatorId:
type: string
version:
type: string
type: object
domain.StackTemplateResponse:
properties:
cloudService:
Expand Down Expand Up @@ -1786,6 +1821,168 @@ paths:
summary: Update primary cluster
tags:
- Organizations
/organizations/{organizationId}/stacks:
get:
consumes:
- application/json
description: Get Stacks
parameters:
- description: organizationId
in: path
name: organizationId
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/domain.GetStacksResponse'
security:
- JWT: []
summary: Get Stacks
tags:
- Stacks
post:
consumes:
- application/json
description: Create Stack
parameters:
- description: organizationId
in: path
name: organizationId
required: true
type: string
- description: create cloud setting request
in: body
name: body
required: true
schema:
$ref: '#/definitions/domain.CreateStackRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/domain.CreateStackResponse'
security:
- JWT: []
summary: Create Stack
tags:
- Stacks
/organizations/{organizationId}/stacks/{stackId}:
delete:
consumes:
- application/json
description: Delete Stack
parameters:
- description: organizationId
in: path
name: organizationId
required: true
type: string
- description: Delete cloud setting request
in: body
name: body
required: true
schema:
$ref: '#/definitions/domain.DeleteStackRequest'
- description: stackId
in: path
name: stackId
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
security:
- JWT: []
summary: Delete Stack
tags:
- Stacks
get:
consumes:
- application/json
description: Get Stack
parameters:
- description: organizationId
in: path
name: organizationId
required: true
type: string
- description: stackId
in: path
name: stackId
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/domain.GetStackResponse'
security:
- JWT: []
summary: Get Stack
tags:
- Stacks
put:
consumes:
- application/json
description: Update Stack
parameters:
- description: organizationId
in: path
name: organizationId
required: true
type: string
- description: Update cloud setting request
in: body
name: body
required: true
schema:
$ref: '#/definitions/domain.UpdateStackRequest'
produces:
- application/json
responses:
"200":
description: OK
security:
- JWT: []
summary: Update Stack
tags:
- Stacks
/organizations/{organizationId}/stacks/name/{name}/existence:
get:
consumes:
- application/json
description: Check name for stack
parameters:
- description: organizationId
in: path
name: organizationId
required: true
type: string
- description: name
in: path
name: name
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
security:
- JWT: []
summary: Check name for stack
tags:
- Stacks
/organizations/{organizationId}/users:
get:
consumes:
Expand Down Expand Up @@ -2091,137 +2288,6 @@ paths:
summary: Update StackTemplate 'NOT IMPLEMENTED'
tags:
- StackTemplates
/stacks:
get:
consumes:
- application/json
description: Get Stacks
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/domain.GetStacksResponse'
security:
- JWT: []
summary: Get Stacks
tags:
- Stacks
post:
consumes:
- application/json
description: Create Stack
parameters:
- description: create cloud setting request
in: body
name: body
required: true
schema:
$ref: '#/definitions/domain.CreateStackRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/domain.CreateStackResponse'
security:
- JWT: []
summary: Create Stack
tags:
- Stacks
/stacks/{stackId}:
delete:
consumes:
- application/json
description: Delete Stack
parameters:
- description: Delete cloud setting request
in: body
name: body
required: true
schema:
$ref: '#/definitions/domain.DeleteStackRequest'
- description: stackId
in: path
name: stackId
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
security:
- JWT: []
summary: Delete Stack
tags:
- Stacks
get:
consumes:
- application/json
description: Get Stack
parameters:
- description: stackId
in: path
name: stackId
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/domain.GetStackResponse'
security:
- JWT: []
summary: Get Stack
tags:
- Stacks
put:
consumes:
- application/json
description: Update Stack
parameters:
- description: Update cloud setting request
in: body
name: body
required: true
schema:
$ref: '#/definitions/domain.UpdateStackRequest'
produces:
- application/json
responses:
"200":
description: OK
security:
- JWT: []
summary: Update Stack
tags:
- Stacks
/stacks/name/{name}/existence:
get:
consumes:
- application/json
description: Check name for stack
parameters:
- description: name
in: path
name: name
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
security:
- JWT: []
summary: Check name for stack
tags:
- Stacks
securityDefinitions:
JWT:
in: header
Expand Down
1 change: 1 addition & 0 deletions cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func init() {
flag.String("git-base-url", "https://github.com", "git base url")
flag.String("git-account", "decapod10", "git account of admin cluster")
flag.String("revision", "main", "revision")
flag.Bool("migrate-db", true, "If the values is true, enable db migration. recommend only development")

// app-serve-apps
flag.String("image-registry-url", "harbor-dev.taco-cat.xyz/appserving", "URL of image registry")
Expand Down
Loading

0 comments on commit cf9fecc

Please sign in to comment.