Skip to content

Commit

Permalink
feat: add CreatePeer to manager rest api (dragonflyoss#2749)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <[email protected]>
  • Loading branch information
gaius-qi authored Sep 20, 2023
1 parent 5289f03 commit 85fba4c
Show file tree
Hide file tree
Showing 9 changed files with 405 additions and 6 deletions.
121 changes: 120 additions & 1 deletion api/manager/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

121 changes: 120 additions & 1 deletion api/manager/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1511,6 +1511,47 @@
"description": "Internal Server Error"
}
}
},
"post": {
"description": "Create by json config",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Peer"
],
"summary": "Create Peer",
"parameters": [
{
"description": "Peer",
"name": "Peer",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/d7y_io_dragonfly_v2_manager_types.CreatePeerRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/d7y_io_dragonfly_v2_manager_models.Peer"
}
},
"400": {
"description": "Bad Request"
},
"404": {
"description": "Not Found"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/peers/{id}": {
Expand Down Expand Up @@ -4386,6 +4427,83 @@
}
}
},
"d7y_io_dragonfly_v2_manager_types.CreatePeerRequest": {
"type": "object",
"required": [
"download_port",
"host_name",
"ip",
"port",
"scheduler_cluster_id",
"type"
],
"properties": {
"build_platform": {
"type": "string"
},
"download_port": {
"type": "integer"
},
"git_commit": {
"type": "string"
},
"git_version": {
"type": "string"
},
"host_name": {
"type": "string"
},
"idc": {
"type": "string"
},
"ip": {
"type": "string"
},
"kernel_version": {
"type": "string"
},
"location": {
"type": "string"
},
"object_storage_port": {
"type": "integer"
},
"os": {
"type": "string"
},
"platform": {
"type": "string"
},
"platform_family": {
"type": "string"
},
"platform_version": {
"type": "string"
},
"port": {
"type": "integer"
},
"scheduler_cluster_id": {
"type": "integer"
},
"state": {
"type": "string",
"enum": [
"active",
"inactive"
]
},
"type": {
"type": "string",
"enum": [
"super",
"strong",
"weak",
"normal"
]
}
}
},
"d7y_io_dragonfly_v2_manager_types.CreatePersonalAccessTokenRequest": {
"type": "object",
"required": [
Expand Down Expand Up @@ -4948,7 +5066,8 @@
"state": {
"type": "string",
"enum": [
"active"
"active",
"inactive"
]
}
}
Expand Down
82 changes: 82 additions & 0 deletions api/manager/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,60 @@ definitions:
- client_secret
- name
type: object
d7y_io_dragonfly_v2_manager_types.CreatePeerRequest:
properties:
build_platform:
type: string
download_port:
type: integer
git_commit:
type: string
git_version:
type: string
host_name:
type: string
idc:
type: string
ip:
type: string
kernel_version:
type: string
location:
type: string
object_storage_port:
type: integer
os:
type: string
platform:
type: string
platform_family:
type: string
platform_version:
type: string
port:
type: integer
scheduler_cluster_id:
type: integer
state:
enum:
- active
- inactive
type: string
type:
enum:
- super
- strong
- weak
- normal
type: string
required:
- download_port
- host_name
- ip
- port
- scheduler_cluster_id
- type
type: object
d7y_io_dragonfly_v2_manager_types.CreatePersonalAccessTokenRequest:
properties:
bio:
Expand Down Expand Up @@ -916,6 +970,7 @@ definitions:
state:
enum:
- active
- inactive
type: string
type: object
d7y_io_dragonfly_v2_manager_types.UpdateOauthRequest:
Expand Down Expand Up @@ -2054,6 +2109,33 @@ paths:
summary: Get Peers
tags:
- Peer
post:
consumes:
- application/json
description: Create by json config
parameters:
- description: Peer
in: body
name: Peer
required: true
schema:
$ref: '#/definitions/d7y_io_dragonfly_v2_manager_types.CreatePeerRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/d7y_io_dragonfly_v2_manager_models.Peer'
"400":
description: Bad Request
"404":
description: Not Found
"500":
description: Internal Server Error
summary: Create Peer
tags:
- Peer
/peers/{id}:
delete:
consumes:
Expand Down
Loading

0 comments on commit 85fba4c

Please sign in to comment.