개인 액세스 토큰 목록 조회

개인 액세스 토큰 목록 조회

개인 액세스 토큰 목록을 페이지네이션으로 반환해요.

출처: 문서

본문

GET /v2/access-tokens

개인 액세스 토큰 목록 조회 작업이에요. 개인 액세스 토큰 목록을 페이지네이션으로 반환해요.

요청 예시

실행 전에 자리 표시자를 바꾸고 필요 자격 증명이나 요청 바디를 채워야 해요.

curl \
  --request GET \
  --header "Authorization: Bearer ${TOKEN}" \
  --header 'Accept: application/json' \
  'https://hub.docker.com/v2/access-tokens'

요청과 응답

응답 200 OK

Schema:

{
  "$ref": "#/components/schemas/getAccessTokensResponse"
}

Schema example:

{
  "active_count": 1,
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "client_id": "HUB",
      "created_at": "2021-07-20T12:00:00.000000Z",
      "creator_ip": "127.0.0.1",
      "creator_ua": "some user agent",
      "expires_at": "2021-10-28T18:30:19.520861Z",
      "generated_by": "manual",
      "is_active": true,
      "last_used": null,
      "scopes": [
        "repo:read"
      ],
      "token": "***",
      "token_label": "My read only token",
      "uuid": "b30bbf97-506c-4ecd-aabc-842f3cb484fb"
    }
  ]
}

응답 400 Bad Request

Schema:

{
  "$ref": "#/components/schemas/error"
}

error:

{
  "errinfo": null,
  "message": "bad request"
}

응답 401 Unauthorized

Schema:

{
  "$ref": "#/components/schemas/error"
}

error:

{
  "errinfo": null,
  "message": "unauthorized"
}

전체 작업 계약

{
  "description": "Returns a paginated list of personal access tokens.",
  "operationId": "getV2AccessTokens",
  "parameters": [
    {
      "description": "Page number to return.",
      "in": "query",
      "name": "page",
      "schema": {
        "default": 1,
        "type": "number"
      }
    },
    {
      "description": "Number of results per page.",
      "in": "query",
      "name": "page_size",
      "schema": {
        "default": 10,
        "type": "number"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/getAccessTokensResponse"
          }
        }
      },
      "description": "OK"
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "summary": "List personal access tokens",
  "tags": [
    "access-tokens"
  ]
}

참조된 스키마

더 알아보기