您的位置:首页 > 运维架构 > Linux

kong 在Linux下操作

2015-11-20 16:00 531 查看
1、API
查询所有api
curl -i http://localhost:8888/apis/
查询单个api的插件
curl -i http://localhost:8888/apis/58600fdb-d8f4-47cd-c7ce-3dbefd7e78a6/plugins/
删除api
curl -X DELETE http://localhost:8888/apis/oxo9 --data "name=oxo9"

删除插件:
curl -X DELETE http://localhost:8888/apis/e73cc900-b2ae-4813-c899-7a5f8057f61b/plugins/af4e06d1-a10e-485a-c818-bbd6f4e28597 \
--data "api_id=e73cc900-b2ae-4813-c899-7a5f8057f61b" \
--data "id=af4e06d1-a10e-485a-c818-bbd6f4e28597"

查询api的oauth2 token
curl -i http://localhost:8888/consumers/{api id}/oauth2

创建API
curl -i -X POST \
--url http://localhost:8888/apis/ \
--data 'name=qwer' \
--data 'upstream_url=http://v.juhe.cn/weather/uni?' \
--data 'request_path=/api/qwer'

访问api
curl -i http://localhost:8889/api/k8s7 -H "authorization: bearer f8d2f2ad576a479ac71309fe64aa16a3"

2、Consumer
查询所有consumers
curl -i http://localhost:8888/consumers
查询单个consumer
curl -i http://localhost:8888/consumers/consumerId
删除consumer:
curl -X DELETE http://localhost:8888/consumers/admin \
--data "username=admin"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: