各种流行开源软件的 REST API 风格节选
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论