1
0
mirror of https://github.com/docker/docs.git synced 2026-11-05 00:14:17 +03:00

Add more curl examples

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
Sven Dowideit
2015-08-19 22:36:31 +10:00
parent 84be13ab5d
commit c5a9df8727
6 changed files with 87 additions and 14 deletions

View File

@@ -300,7 +300,7 @@ Client must be authenticated as a system 'admin' user.
```
Response:
```json
{
"id": 5,
@@ -345,7 +345,7 @@ which case the `oldPassword` field may be omitted from the request body.
"name": "alice",
"isActive": true
}
```
```
**Authorization**
@@ -381,7 +381,7 @@ Client must be authenticated as a system 'admin' user.
"name": "alice",
"isActive": false
}
```
```
**Authorization**

View File

@@ -13,7 +13,7 @@ parent = "smn_dtrapi"
`GET /api/v0/repositories/{namespace}`
```curl
```bash
$ curl -v --user admin:password --insecure -X GET https://dtr.domain.com/api/v0/repositories/engineering
```
@@ -58,7 +58,7 @@ filtered to only those repositories that are visible to the client.
`GET /api/v0/repositories/{namespace}/{reponame}`
```curl
```bash
$ curl -v --user admin:password --insecure -X GET https://dtr.domain.com/api/v0/repositories/engineering/public-app
```
@@ -89,7 +89,7 @@ Client must be authenticated as a user which has visibility to the repository.
`POST /api/v0/repositories/{namespace}`
```curl
```bash
$ curl -v --user admin:password --insecure -X POST --data '{"name":"my-app"}' --header "Content-type: application/json" https://dtr.domain.com/api/v0/repositories/engineering
```
@@ -139,7 +139,7 @@ level access to the organization's namespace of repositories).
```
Any fields that are not preset in the body of this request will retain their existing value.
You cannot rename a repository using this API - the "name" field is ignored.
You cannot rename a repository using this API - the "name" field is ignored.
Example Request:

View File

@@ -31,6 +31,10 @@ or `admin` level access to any repository that is owned by that organization.
`GET /api/v0/repositories/{namespace}/{reponame}/teamAccess`
```bash
$ curl -v --user admin:password --insecure -X GET https://dtr.domain.com/api/v0/repositories/engineering/public-app/teamAccess
```
Example Response:
```json
@@ -85,6 +89,10 @@ repository.
`GET /api/v0/accounts/{name}/teams/{teamname}/repositoryAccess`
```bash
$ curl -v --user admin:password --insecure -X GET https://dtr.domain.com/api/v0/accounts/engineering/teams/dev/repositoryAccess
```
Example Response:
```json
@@ -142,6 +150,10 @@ in or be a member of that team.
`PUT /api/v0/repositories/{namespace}/{reponame}/teamAccess/{teamname}`
```bash
$ curl -v --user admin:password --insecure -X PUT --header "Content-type: application/json" --data '{"accessLevel":"read-write"}' https://dtr.domain.com/api/v0/repositories/engineering/public-app/teamAccess/dev
```
Example Request:
```http
@@ -194,6 +206,10 @@ repository.
```bash
$ curl -v --user admin:password --insecure -X DELETE https://dtr.domain.com/api/v0/repositories/engineering/public-app/teamAccess/dev
```
**Authorization**
Client must be authenticated as a user which has 'admin' level access to the
repository.
**Status Codes**

View File

@@ -40,6 +40,10 @@ by that organization.
`GET /api/v0/repositoryNamespaces/{namespace}/teamAccess`
```bash
$ curl -v --user admin:password --insecure -X GET https://dtr.domain.com/api/v0/repositoriesNamespaces/engineering/teamAccess
```
Example Response:
```json
@@ -83,12 +87,17 @@ namespace.
- *400* the namespace is not owned by an organization.
- *403* the client is not authorized.
- *404*
- *200* success.
## Get a Team's Granted Access to an Organization-Owned Namespace of Repositories
`GET /api/v0/repositoryNamespaces/{namespace}/teamAccess/{teamname}`
```bash
$ curl -v --user admin:password --insecure -X GET https://dtr.domain.com/api/v0/repositoryNamespaces/engineering/teamAccess/lead
```
Example Response:
```json
@@ -125,6 +134,10 @@ is a member of the team in question.
`PUT /api/v0/repositoryNamespaces/{namespace}/teamAccess/{teamname}`
```bash
curl -v --user admin:password --insecure -X PUT --header "Content-type: application/json" --data '{"accessLevel":"admin"}' https://dtr.domain.com/api/v0/repositoryNamespaces/engineering/teamAccess/lead
```
Example Request:
```http
@@ -172,6 +185,10 @@ namespace.
```bash
$ curl -v --user admin:password --insecure -X DELETE https://dtr.domain.com/api/v0/repositoryNamespaces/engineering/teamAccess/lead
```
**Authorization**
Client must be authenticated as a user which has 'admin' level access to the
namespace.
**Status Codes**
@@ -179,7 +196,7 @@ namespace.
- *400* the repository is not owned by an organization.
- *400* the team does not belong to the owning organization.
- *403* the client is not authorized.
- *200* success.
- *200* success.
- *400* the team does not belong to the owning organization.
- *403* the client is not authorized.
- *200* success.

View File

@@ -15,6 +15,10 @@ DTR Teams, like on the Docker Hub, only exist within an Organization.
`GET /api/v0/accounts/{name}/teams`
```bash
$ curl --insecure -v --user admin:password https://dtr.domain.com/api/v0/accounts/engineering/teams
```
Example Response:
```json
@@ -52,6 +56,10 @@ Client must be authenticated as a member of the organization.
`GET /api/v0/accounts/{name}/teams/{teamname}`
```bash
$ curl --insecure -v --user admin:password https://dtr.domain.com/api/v0/accounts/engineering/teams/qa
```
Example Response:
```json
@@ -78,6 +86,10 @@ Client must be authenticated as a member of the organization.
`GET /api/v0/accounts/{name}/teams/{teamname}/members`
```bash
$ curl --insecure -v --user admin:password https://dtr.domain.com/api/v0/accounts/engineering/teams/qa/members
```
Example Response:
```json
@@ -126,6 +138,10 @@ in the organization, or a member of the team in question.
`GET /api/v0/accounts/{name}/teams/{teamname}/members/{member}`
```bash
$ curl --insecure -v --user admin:password -X GET https://dtr.domain.com/api/v0/accounts/engineering/teams/qa/members/test
```
**Authorization**
Client must be authenticated as a user which has visibility into the team
@@ -141,6 +157,10 @@ Client must be authenticated as a user which has visibility into the team
`POST /api/v0/accounts/{name}/teams`
```bash
$ curl --insecure -v --user admin:password -X POST --data '{"name": "qa", "type": "managed"}' --header "Content-type: application/json" https://dtr.domain.com/api/v0/accounts/engineering/teams
```
Example Request:
```http
@@ -185,6 +205,10 @@ team in the organization.
Example Request:
```http
POST /api/v0/accounts/engineering/teams/5 HTTP/1.1
Content-Type: application/json
```
Example Response:
@@ -228,6 +252,10 @@ team in the organization.
**Status Codes**
- *403* the client is not authorized.
- *404* no such team or user.
- *200* success.
## Remove a User from a Team (if not LDAP synced).
`DELETE /api/v0/accounts/{name}/teams/{teamname}/members/{member}`
@@ -236,13 +264,17 @@ team in the organization.
$ curl --insecure -v --user admin:password -X DELETE https://dtr.domain.com/api/v0/accounts/engineering/teams/qa/members/alice
```
**Authorization**
Client must be authenticated as a system admin or a member of the "owners"
team in the organization.
**Status Codes**
- *403* the client is not authorized.
- *404* no such team exists.
- *204* success.
## Remove a Team.
`DELETE /api/v0/accounts/{name}/teams/{teamname}`
@@ -252,12 +284,16 @@ team in the organization.
```
**Authorization**
**Status Codes**
Client must be authenticated as a system admin or a member of the "owners"
team in the organization.
**Status Codes**
- *403* the client is not authorized.
- *204* success.
```
**Authorization**
Client must be authenticated as a system admin or a member of the "owners"

View File

@@ -31,8 +31,8 @@ to any repository that is owned by another user account.
`GET /api/v0/repositories/{namespace}/{reponame}/userAccess`
```curl
curl -v --user josh:password --insecure -X GET https://dtr.domain.com/api/v0/repositories/josh/public-app/userAccess
```bash
curl -v --user josh:password --insecure https://dtr.domain.com/api/v0/repositories/josh/public-app/userAccess
```
Example Response:
@@ -87,8 +87,8 @@ repository.
`PUT /api/v0/repositories/{namespace}/{reponame}/userAccess/{grantee}`
```curl
curl -v --user josh:password --insecure -X PUT --header "Content-type: application/json" --data '{"accessLevel":"read-write"}' https://192.168.18.129/api/v0/repositories/alice/public-app/userAccess/brian
```bash
curl -v --user josh:password --insecure -X PUT --header "Content-type: application/json" --data '{"accessLevel":"read-write"}' https://dtr.domain.com/api/v0/repositories/alice/public-app/userAccess/brian
```
Example Request:
@@ -141,6 +141,10 @@ repository.
```bash
$ curl -v --user josh:password --insecure -X DELETE https://dtr.domain.com/api/v0/repositories/josh/public-app/userAccess/user
```
**Authorization**
Client must be authenticated as a user which has 'admin' level access to the
repository.
**Status Codes**