Skip to content

Commit

Permalink
Merge 60b3019 into af44fc4
Browse files Browse the repository at this point in the history
  • Loading branch information
tianxiaoliang committed May 30, 2020
2 parents af44fc4 + 60b3019 commit 9e2448c
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 98 deletions.
116 changes: 52 additions & 64 deletions docs/api.yaml
@@ -1,10 +1,25 @@
swagger: "2.0"
swagger: '2.0'
info:
title: ""
version: ""
title: ''
version: ''
basePath: /
paths:
/v1/{project}/kie/kv:
/v1/health:
get:
summary: health check return version and revision
operationId: HealthCheck
consumes:
- application/json
- text/yaml
produces:
- application/json
- text/yaml
responses:
'200':
description: ''
schema:
$ref: '#/definitions/DocHealthCheck'
'/v1/{project}/kie/kv':
get:
summary: list key values by labels and key
operationId: List
Expand All @@ -18,26 +33,19 @@ paths:
type: string
- name: label
in: query
description: label pairs,for example &label=service:order&label=version:1.0.0
description: 'label pairs,for example &label=service:order&label=version:1.0.0'
type: string
- name: wait
in: query
description: wait until any kv changed. for example wait=5s, server will not
response until 5 seconds, during that time window, if any kv changed, server
will return 200 and kv list, otherwise return 304 and empty body
description: 'wait until any kv changed. for example wait=5s, server will not response until 5 seconds, during that time window, if any kv changed, server will return 200 and kv list, otherwise return 304 and empty body'
type: string
- name: match
in: query
description: match works with label query param, it specifies label match
pattern. if it is empty, server will return kv which's labels partial match
the label query param. uf it is exact, server will return kv which's labels
exact match the label query param
description: 'match works with label query param, it specifies label match pattern. if it is empty, server will return kv which''s labels partial match the label query param. uf it is exact, server will return kv which''s labels exact match the label query param'
type: string
- name: revision
in: query
description: each time you query,server will return a number in header X-Kie-Revision.
you can record it in client side, use this number as param value. if current
revision is greater than it, server will return data
description: 'each time you query,server will return a number in header X-Kie-Revision. you can record it in client side, use this number as param value. if current revision is greater than it, server will return data'
type: string
- name: limit
in: query
Expand All @@ -53,16 +61,15 @@ paths:
- application/json
- text/yaml
responses:
"200":
description: ""
'200':
description: ''
schema:
$ref: '#/definitions/DocResponseGetKey'
headers:
X-Kie-Revision:
description: cluster latest revision number, if key value is changed,
it will increase.
description: 'cluster latest revision number, if key value is changed, it will increase.'
type: integer
"304":
'304':
description: empty body
post:
summary: create a key value
Expand All @@ -74,8 +81,7 @@ paths:
type: string
- name: Content-Type
in: header
description: used to indicate the media type of the resource, the value can
be application/json or text/yaml
description: 'used to indicate the media type of the resource, the value can be application/json or text/yaml'
required: true
type: string
- name: body
Expand All @@ -90,8 +96,8 @@ paths:
- application/json
- text/yaml
responses:
"200":
description: ""
'200':
description: ''
schema:
$ref: '#/definitions/DocResponseSingleKey'
delete:
Expand All @@ -104,8 +110,7 @@ paths:
type: string
- name: Content-Type
in: header
description: used to indicate the media type of the resource, the value only
can be application/json
description: 'used to indicate the media type of the resource, the value only can be application/json'
required: true
type: string
- name: body
Expand All @@ -118,11 +123,11 @@ paths:
produces:
- application/json
responses:
"204":
'204':
description: delete success
"500":
'500':
description: server error
/v1/{project}/kie/kv/{kv_id}:
'/v1/{project}/kie/kv/{kv_id}':
get:
summary: get key values by kv_id
operationId: Get
Expand All @@ -141,16 +146,15 @@ paths:
- application/json
- text/yaml
responses:
"200":
'200':
description: get key value success
schema:
$ref: '#/definitions/DocResponseSingleKey'
headers:
X-Kie-Revision:
description: cluster latest revision number, if key value is changed,
it will increase.
description: 'cluster latest revision number, if key value is changed, it will increase.'
type: integer
"404":
'404':
description: key value not found
put:
summary: update a key value
Expand All @@ -166,8 +170,7 @@ paths:
type: string
- name: Content-Type
in: header
description: used to indicate the media type of the resource, the value can
be application/json or text/yaml
description: 'used to indicate the media type of the resource, the value can be application/json or text/yaml'
required: true
type: string
- name: body
Expand All @@ -182,8 +185,8 @@ paths:
- application/json
- text/yaml
responses:
"200":
description: ""
'200':
description: ''
schema:
$ref: '#/definitions/DocResponseSingleKey'
delete:
Expand All @@ -203,13 +206,13 @@ paths:
produces:
- '*/*'
responses:
"204":
'204':
description: delete success
"404":
'404':
description: no key value found for deletion
"500":
'500':
description: server error
/v1/{project}/kie/revision/{kv_id}:
'/v1/{project}/kie/revision/{kv_id}':
get:
summary: get all revisions by key id
operationId: GetRevisions
Expand All @@ -229,11 +232,11 @@ paths:
- application/json
- text/yaml
responses:
"200":
description: ""
'200':
description: ''
schema:
$ref: '#/definitions/DocResponseGetKey'
/v1/{project}/kie/track:
'/v1/{project}/kie/track':
get:
summary: get polling tracks of clients of kie server
operationId: GetPollingData
Expand Down Expand Up @@ -265,27 +268,12 @@ paths:
- application/json
- text/yaml
responses:
"200":
description: "true"
'200':
description: 'true'
schema:
type: array
items:
$ref: '#/definitions/PollingDataResponse'
/v1/health:
get:
summary: health check return version and revision
operationId: HealthCheck
consumes:
- application/json
- text/yaml
produces:
- application/json
- text/yaml
responses:
"200":
description: ""
schema:
$ref: '#/definitions/DocHealthCheck'
definitions:
DocHealthCheck:
type: object
Expand Down Expand Up @@ -319,7 +307,7 @@ definitions:
type: string
key:
type: string
label_id:
label_format:
type: string
labels:
type: object
Expand Down Expand Up @@ -356,9 +344,9 @@ definitions:
params:
type: object
additionalProperties:
type: string
type: 'string'
response_body:
type: string
type: 'string'
response_code:
type: integer
format: int32
Expand Down
20 changes: 0 additions & 20 deletions docs/getstarted/install.md
Expand Up @@ -40,23 +40,3 @@ it will launch 3 components
- mongodb UI:http://127.0.0.1:8081
- servicecomb-kie: http://127.0.0.1:30110


### Run locally without Docker

Download and run mongodb,
see [MongoDB Community Edition Installation Tutorials](https://docs.mongodb.com/manual/installation/#mongodb-community-edition-installation-tutorials)


use the [db init script](https://github.com/apache/servicecomb-kie/blob/master/deployments/db.js)
```shell script bash
mongo 127.0.0.1/kie db.js
```

Download the binary of kie, see https://apache.org/dyn/closer.cgi/servicecomb/servicecomb-kie/0.1.0/
Unzip and Run it.
For Example:
```shell script bash
tar -xzvf apache-servicecomb-kie--${platform}-amd64.tar.gz
cd apache-servicecomb-kie--${platform}-amd64
./kie --config conf/kie-conf.yaml
```
33 changes: 19 additions & 14 deletions docs/getstarted/verify.md
@@ -1,28 +1,33 @@
# After running
Put a key
```shell script
curl -X PUT \
http://127.0.0.1:30110/v1/default/kie/kv/ingressRule \
curl -X POST \
http://127.0.0.1:30110/v1/default/kie/kv/ \
-H 'Content-Type: application/json' \
-d '{
"value":"some rule",
"type": "yaml",
"labels":{"app":"default"}
"key": "timeout",
"value": "2s",
"labels": {
"service": "order"
}
}'
```

response is
```json
{
"id": "05529229-efc3-49ca-a765-05759b23ab28",
"key": "ingressRule",
"value": "some rule",
"value_type": "text",
"create_revision": 13,
"update_revision": 13,
"labels": {
"app": "default"
}
"id": "b01ad993-2bad-4468-8a3c-5aa7ad54afea",
"key": "timeout",
"value": "2s",
"value_type": "text",
"create_revision": 2,
"update_revision": 2,
"status": "disabled",
"create_time": 1590802244,
"update_time": 1590802244,
"labels": {
"service": "order"
}
}
```

Expand Down

0 comments on commit 9e2448c

Please sign in to comment.