196 lines
4.1 KiB
YAML
196 lines
4.1 KiB
YAML
swagger: "2.0"
|
|
info:
|
|
title: beego Test API
|
|
description: |
|
|
beego has a very cool tools to autogenerate documents for your API
|
|
version: 1.0.0
|
|
termsOfService: http://beego.me/
|
|
contact:
|
|
email: astaxie@gmail.com
|
|
license:
|
|
name: Apache 2.0
|
|
url: http://www.apache.org/licenses/LICENSE-2.0.html
|
|
basePath: /oc
|
|
paths:
|
|
/identity/:
|
|
get:
|
|
tags:
|
|
- identity
|
|
description: |-
|
|
get Identity
|
|
<br>
|
|
operationId: IdentityController.Get
|
|
responses:
|
|
"200":
|
|
description: ""
|
|
schema:
|
|
$ref: '#/definitions/models.Identity'
|
|
post:
|
|
tags:
|
|
- identity
|
|
description: |-
|
|
create identitys
|
|
<br>
|
|
operationId: IdentityController.CreateIdentity
|
|
parameters:
|
|
- in: body
|
|
name: body
|
|
description: body for identity content
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/models.Identity'
|
|
responses:
|
|
"200":
|
|
description: '{int} models.Identity.Id'
|
|
"403":
|
|
description: body is empty
|
|
/peer/:
|
|
get:
|
|
tags:
|
|
- peer
|
|
description: |-
|
|
get all peers
|
|
<br>
|
|
operationId: PeerController.GetAll
|
|
responses:
|
|
"200":
|
|
description: ""
|
|
post:
|
|
tags:
|
|
- peer
|
|
description: |-
|
|
create peer
|
|
<br>
|
|
operationId: PeerController.Create
|
|
parameters:
|
|
- in: body
|
|
name: body
|
|
description: The peer content
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/models.Peer'
|
|
responses:
|
|
"200":
|
|
description: '{string} models.Peer.Id'
|
|
"403":
|
|
description: body is empty
|
|
/peer/{peerId}:
|
|
get:
|
|
tags:
|
|
- peer
|
|
description: |-
|
|
find peer by peerid
|
|
<br>
|
|
operationId: PeerController.Get
|
|
parameters:
|
|
- in: path
|
|
name: peerId
|
|
description: the peerid you want to get
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: '{peer} models.Peer'
|
|
"403":
|
|
description: :peerId is empty
|
|
put:
|
|
tags:
|
|
- peer
|
|
description: |-
|
|
update the peer
|
|
<br>
|
|
operationId: PeerController.Update
|
|
parameters:
|
|
- in: path
|
|
name: peerId
|
|
description: The peerid you want to update
|
|
required: true
|
|
type: string
|
|
- in: body
|
|
name: body
|
|
description: The body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/models.Peer'
|
|
responses:
|
|
"200":
|
|
description: '{peer} models.Peer'
|
|
"403":
|
|
description: :peerId is empty
|
|
delete:
|
|
tags:
|
|
- peer
|
|
description: |-
|
|
delete the peer
|
|
<br>
|
|
operationId: PeerController.Delete
|
|
parameters:
|
|
- in: path
|
|
name: peerId
|
|
description: The peerId you want to delete
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: '{string} delete success!'
|
|
"403":
|
|
description: peerId is empty
|
|
/version/:
|
|
get:
|
|
tags:
|
|
- version
|
|
description: |-
|
|
get version
|
|
<br>
|
|
operationId: VersionController.GetAll
|
|
responses:
|
|
"200":
|
|
description: ""
|
|
definitions:
|
|
models.Identity:
|
|
title: Identity
|
|
type: object
|
|
properties:
|
|
Id:
|
|
type: string
|
|
Name:
|
|
type: string
|
|
PublicKey:
|
|
type: string
|
|
Url:
|
|
type: string
|
|
models.Peer:
|
|
title: Peer
|
|
type: object
|
|
properties:
|
|
api_version:
|
|
type: string
|
|
keywords:
|
|
type: array
|
|
items:
|
|
type: string
|
|
last_seen_online:
|
|
type: string
|
|
format: datetime
|
|
name:
|
|
type: string
|
|
peer_id:
|
|
type: string
|
|
public_key:
|
|
type: string
|
|
score:
|
|
type: integer
|
|
format: int64
|
|
url:
|
|
type: string
|
|
tags:
|
|
- name: peer
|
|
description: |
|
|
Operations about peer
|
|
- name: identity
|
|
description: |
|
|
Operations about Identitys
|
|
- name: version
|
|
description: |
|
|
VersionController operations for Version
|