blob: 3a09dd01271203b663e5326793cc9f9c11607ad7 [file] [log] [blame]
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
swagger: "2.0"
info:
title: ""
version: ""
basePath: /
paths:
/v1/{project}/kie/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/test/kie/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/{project}/kie/kv/{key}:
get:
summary: get key values by key and labels
operationId: GetByKey
parameters:
- name: project
in: path
required: true
type: string
- 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: project
in: path
required: true
type: string
- 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/{project}/kie/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: project
in: path
required: true
type: string
- name: key
in: path
required: true
type: string
responses:
"204":
description: Delete success
"400":
description: Failed,check url
"500":
description: Server error
/v1/{project}/kie/revision/{label_id}:
get:
summary: get history revisions by label id
operationId: GetRevisionsByLabelID
parameters:
- name: project
in: path
required: true
type: string
- name: label_id
in: path
required: true
type: string
consumes:
- application/json
produces:
- application/json
responses:
"200":
description: get history revisions success
schema:
type: array
items:
$ref: "#/definitions/LabelRevisionResponse"
"403":
description: label_id must not be empty
"404":
description: no revisions found
"500":
description: internal 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
LabelRevisionResponse:
type: object
properties:
data:
type: array
items:
$ref: "#/definitions/KVDoc"
label_id:
type: string
labels:
type: object
additionalProperties:
type: string
revision:
type: integer
format: int32
v1.KVBody:
type: object
properties:
labels:
type: object
additionalProperties:
type: string
value:
type: string
valueType:
type: string