blob: 4e7685b3c82f7fbac15d4d52a02d494833a2806e [file] [log] [blame]
swagger: "2.0"
info:
title: ""
version: ""
basePath: /
paths:
/v1/kv:
get:
summary: search key values by labels combination
operationId: SearchByLabels
parameters:
- name: q
in: query
description: 'the combination format is {label_key}:{label_value}+{label_key}:{label_value}
for example: /v1/kv?q=app:mall&q=app:mall+service:cart that will query key
values from 2 kinds of labels'
type: string
consumes:
- application/json
produces:
- application/json
responses:
"200":
description: get key value success
schema:
type: array
items:
$ref: '#/definitions/KVResponse'
/v1/kv/{key}:
get:
summary: get key values by key and labels
operationId: GetByKey
parameters:
- name: key
in: path
required: true
type: string
- name: X-Depth
in: header
description: integer, default is 1, if you set match policy, you can set,depth
to decide label number
type: string
- name: body
in: body
required: true
schema:
$ref: '#/definitions/*v1.KVBody'
consumes:
- application/json
produces:
- application/json
responses:
"200":
description: get key value success
schema:
type: array
items:
$ref: '#/definitions/KVResponse'
put:
summary: create or update key value
operationId: Put
parameters:
- name: key
in: path
required: true
type: string
- name: X-Realm
in: header
description: set kv to heterogeneous config server, not implement yet
type: string
- name: body
in: body
required: true
schema:
$ref: '#/definitions/v1.KVBody'
consumes:
- application/json
produces:
- application/json
responses:
"200":
description: "true"
/v1/kv/{kvID}:
delete:
summary: Delete key by kvID and labelID,If the labelID is nil, query the collection
kv to get it.It means if only get kvID, it can also delete normally.But if
you want better performance, you need to pass the labelID
operationId: Delete
parameters:
- name: key
in: path
required: true
type: string
responses:
"204":
description: Delete success
"400":
description: Failed,check url
"500":
description: Server error
definitions:
KVDoc:
type: object
properties:
_id:
type: array
items:
type: integer
format: byte
check:
type: string
domain:
type: string
key:
type: string
label_id:
type: string
labels:
type: object
additionalProperties:
type: string
revision:
type: integer
format: int32
value:
type: string
value_type:
type: string
KVResponse:
type: object
properties:
data:
type: array
items:
$ref: '#/definitions/KVDoc'
label:
$ref: '#/definitions/LabelDocResponse'
LabelDocResponse:
type: object
properties:
label_id:
type: string
labels:
type: object
additionalProperties:
type: string
v1.KVBody:
type: object
properties:
labels:
type: object
additionalProperties:
type: string
value:
type: string
valueType:
type: string