各种流行开源软件的 REST API 风格节选

发布于 2021-05-09 22:27:38 字数 3209 浏览 1547 评论 0

openstack keystone 用户组

List groups:

GET /v3/groups

Create group:

POST /v3/groups

Show group:

GET /v3/groups/{group_id}

Update group:

PATCH /v3/groups/{group_id}

Delete group:

DELETE /v3/groups/{group_id}

List users in group:

GET /v3/groups/{group_id}/users

Add user to group:

PUT /v3/groups/{group_id}/users/{user_id}

Check whether user belongs to group:

HEAD /v3/groups/{group_id}/users/{user_id}

Remove user from group:

DELETE /v3/groups/{group_id}/users/{user_id}

openstack swift 对象

Get object content and metadata:

GET /v1/{account}/{container}/{object}

Create or replace object:

PUT /v1/{account}/{container}/{object}

Copy object:

COPY /v1/{account}/{container}/{object}

Delete object:

DELETE /v1/{account}/{container}/{object}

Show object metadata:

HEAD /v1/{account}/{container}/{object}

Create or update object metadata:

POST /v1/{account}/{container}/{object}

apache ambari 服务

Returns a collection of the services for the cluster identified by ":name".

GET /clusters/:name/services

Gets the service information for the service identified by ":serviceName" for cluster identified by ":clusterName".

GET /clusters/:clusterName/services/:serviceName

Create the service identified by ":serviceName" in the cluster identified by ":clusterName".

POST /clusters/:clusterName/services/:serviceName

Update all services of the cluster identified by ":clusterName".

PUT /clusters/:clusterName/services

Update the service identified by ":serviceName" of the cluster identified by ":clusterName".

PUT /clusters/:clusterName/services/:serviceName

Okta Groups API

Add Group

POST /api/v1/groups

Get Group

GET /api/v1/groups/:id

List Groups

GET /api/v1/groups

Update Group

PUT /api/v1/groups/:id

Remove Group

DELETE /api/v1/groups/:id

List Group Members

GET /api/v1/groups/:id/users

Add User to Group

PUT /api/v1/groups/:gid/users/:uid

Remove User from Group

DELETE /api/v1/groups/:gid/users/:uid

List Assigned Applications

GET /api/v1/groups/:id/apps

github 文件 API

取开源库的内容不需要认证。

GET /repos/:owner/:repo/contents/:path

创建文件就需要认证了,需要在curl命令上增加-u参数。

PUT /repos/:owner/:repo/contents/:path

基本上与创建文件的API相同,只是输入的json串中多了一个"sha"对象,为要更新的文件哈希值。这个sha可以通过“取内容”的API返回。

PUT /repos/:owner/:repo/contents/:path

删除文件:

DELETE /repos/:owner/:repo/contents/:path

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

关于作者

JSmiles

生命进入颠沛而奔忙的本质状态,并将以不断告别和相遇的陈旧方式继续下去。

0 文章
0 评论
84960 人气
更多

推荐作者

沧笙踏歌

文章 0 评论 0

山田美奈子

文章 0 评论 0

佚名

文章 0 评论 0

岁月无声

文章 0 评论 0

暗藏城府

文章 0 评论 0

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文