Merge pull request #14889 from chrispatrick/update-redoc

Update redoc and add DVP Data API doc
This commit is contained in:
jerae-duffin 2022-07-05 08:40:05 -05:00 committed by GitHub
commit f5ed8bbd6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 3861 additions and 1090 deletions

View File

@ -1030,8 +1030,12 @@ reference:
title: v1.19 reference
- path: /engine/api/v1.18/
title: v1.18 reference
- title: Docker Hub API
path: /docker-hub/api/latest/
- sectiontitle: Docker Hub API
section:
- title: Docker Hub API
path: /docker-hub/api/latest/
- title: DVP Data API
path: /docker-hub/api/dvp/
- title: Registry API
path: /registry/spec/api/
- sectiontitle: Docker Extension SDK API (Beta)

View File

@ -17,6 +17,6 @@
</head>
<body>
<redoc spec-url="/engine/api/{{ page.name | replace: '.md'}}.yaml" hide-hostname="true" suppress-warnings="true" lazy-rendering></redoc>
<script src="/js/redoc.min.js"></script>
<script src="/js/redoc.standalone.js"></script>
</body>
</html>

View File

@ -1,10 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<title>Docker Hub API {{ page.name | replace: '.md' }} Reference</title>
<title>Docker Hub API Reference - {{ page.name | replace: '.md' }}</title>
<!-- needed for adaptive design -->
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Reference documentation and Swagger (OpenAPI) specification for the v{{ page.name | replace: '.md' }} version of the API served by Docker Hub." />
<meta name="description" content="Reference documentation and Swagger (OpenAPI) specification for the {{ page.name | replace: '.md' }} API served by Docker Hub." />
<meta charset="utf-8" />
<!-- favicon -->
<meta name="msapplication-TileImage" content="/favicons/docs@2x.ico" />
@ -17,6 +17,6 @@
</head>
<body>
<redoc spec-url="/docker-hub/api/{{ page.name | replace: '.md'}}.yaml" hide-hostname="false" suppress-warnings="false" class="hub-api"></redoc>
<script src="/js/redoc.min.js"></script>
<script src="/js/redoc.standalone.js"></script>
</body>
</html>

View File

@ -12,7 +12,7 @@ module Jekyll
Dir.glob(%w[./docker-hub/api/*.yaml ./engine/api/*.yaml]) do |file_name|
Jekyll.logger.info " #{file_name}"
text = File.read(file_name)
replace = text.gsub!("https://docs.docker.com", "")
replace = text.gsub("https://docs.docker.com", "")
File.open(file_name, "w") { |file| file.puts replace }
end

View File

@ -16,14 +16,33 @@ body {
padding: 0;
}
api-logo {
background-color: $bg-header;
height: 60px;
text-align: left !important;
.menu-content {
> div:first-child {
background-color: $bg-header;
height: 60px;
text-align: left !important;
img {
width: 160px !important;
margin: 15px 20px;
img {
width: 160px !important;
margin: 15px 20px;
}
}
label.-depth0 span, label.-depth1 span {
font-family: $font !important;
}
label.-depth0 {
text-transform: none;
color: $body-text !important;
}
label.-depth1 span {
color: $primary-links !important;
}
ul + div {
display: none;
}
}
@ -37,18 +56,14 @@ redoc {
color: inherit !important;
}
p, a, .menu-item-title {
p, a {
font-family: $font !important;
}
a, .menu-item-title {
a {
color: $primary-links !important;
}
.menu-item-title {
text-transform: none;
}
// Disable request-type badges, see https://github.com/Rebilly/ReDoc/issues/61
.operation-type {
display: none !important;

3
docker-hub/api/dvp.md Normal file
View File

@ -0,0 +1,3 @@
---
layout: hub-api
---

747
docker-hub/api/dvp.yaml Normal file
View File

@ -0,0 +1,747 @@
openapi: 3.0.0
info:
title: DVP Data API
version: 1.0.0
x-logo:
url: https://docs.docker.com/images/logo-docker-main.png
href: /reference
description: |
The Docker DVP Data API allows [Docker Verified Publishers](https://docs.docker.com/docker-hub/publish/) to view image pull analytics data for their namespaces
servers:
- url: https://hub.docker.com/api/dvp/v1
security:
- HubAuth: []
features.openapi:
schemaDefinitionsTagName: Schemas
tags:
- name: namespaces
x-displayName: Namespace data
- name: repos
x-displayName: Repository data
- name: discovery
x-displayName: Discovery
- name: responseDataFile
x-displayName: ResponseDataFile
description: |
<SchemaDefinition schemaRef="#/components/schemas/ResponseDataFile" />
- name: yearModel
x-displayName: Year Data Model
description: |
<SchemaDefinition schemaRef="#/components/schemas/YearModel" />
- name: monthModel
x-displayName: Month Data Model
description: |
<SchemaDefinition schemaRef="#/components/schemas/MonthModel" />
- name: weekModel
x-displayName: Week Data Model
description: |
<SchemaDefinition schemaRef="#/components/schemas/WeekModel" />
x-tagGroups:
- name: API
tags:
- discovery
- namespaces
- repos
- name: Models
tags:
- responseDataFile
- yearModel
- monthModel
- weekModel
paths:
/data:
get:
tags: [discovery]
summary: Get namespaces and repos
description: Gets a list of your namespaces and repos which have data available
operationId: getNamespaces
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/NamespaceData'
/data/namespaces/{namespace}:
get:
tags: [discovery]
summary: Get namespace
description: Gets metadata associated with specified namespace, including extra repos associated with the namespace
operationId: getNamespace
parameters:
- in: path
name: namespace
schema:
type: string
required: true
description: Namespace to fetch data for
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/NamespaceMetadata'
/data/namespaces/{namespace}/years:
get:
tags: [namespaces]
summary: Get years with data
description: Gets a list of years that have data for the given namespace
operationId: getNamespaceYears
parameters:
- in: path
name: namespace
schema:
type: string
required: true
description: Namespace to fetch data for
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/YearData'
/data/namespaces/{namespace}/years/{year}/months:
get:
tags: [namespaces]
summary: Get months with data
description: Gets a list of months that have data for the given namespace and year
operationId: getNamespaceMonths
parameters:
- in: path
name: namespace
schema:
type: string
required: true
description: Namespace to fetch data for
- in: path
name: year
schema:
type: integer
required: true
description: Year to fetch data for
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/MonthData'
/data/namespaces/{namespace}/years/{year}/weeks:
get:
tags: [namespaces]
summary: Get weeks with data
description: Gets a list of weeks that have data for the given namespace and year
operationId: getNamespaceWeeks
parameters:
- in: path
name: namespace
schema:
type: string
required: true
description: Namespace to fetch data for
- in: path
name: year
schema:
type: integer
required: true
description: Year to fetch data for
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/WeekData'
/data/namespaces/{namespace}/years/{year}/months/{month}:
get:
tags: [namespaces]
summary: Get namespace metadata for month
description: Gets info about data for the given namespace and month
operationId: getNamespaceMonthMetadata
parameters:
- in: path
name: namespace
schema:
type: string
required: true
description: Namespace to fetch data for
- in: path
name: year
schema:
type: integer
required: true
description: Year to fetch data for
- in: path
name: month
schema:
type: integer
required: true
description: Month to fetch data for
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/MonthModel'
'404':
description: Not Found
/data/namespaces/{namespace}/years/{year}/months/{month}/raw:
get:
tags: [namespaces]
summary: Get namespace data for month
description: Gets a list of URLs that can be used to download the raw pull data for the given namespace and month
operationId: getNamespaceDataByMonth
parameters:
- in: path
name: namespace
schema:
type: string
required: true
description: Namespace to fetch data for
- in: path
name: year
schema:
type: integer
required: true
description: Year to fetch data for
- in: path
name: month
schema:
type: integer
required: true
description: Month to fetch data for
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseData'
/data/namespaces/{namespace}/years/{year}/weeks/{week}:
get:
tags: [namespaces]
summary: Get namespace metadata for week
description: Gets info about data for the given namespace and week
operationId: getNamespaceWeekMetadata
parameters:
- in: path
name: namespace
schema:
type: string
required: true
description: Namespace to fetch data for
- in: path
name: year
schema:
type: integer
required: true
description: Year to fetch data for
- in: path
name: week
schema:
type: integer
required: true
description: Week to fetch data for
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/WeekModel'
'404':
description: Not Found
/data/namespaces/{namespace}/years/{year}/weeks/{week}/raw:
get:
tags: [namespaces]
summary: Get namespace data for week
description: Gets a list of URLs that can be used to download the raw pull data for the given namespace and week
operationId: getNamespaceDataByWeek
parameters:
- in: path
name: namespace
schema:
type: string
required: true
description: Namespace to fetch data for
- in: path
name: year
schema:
type: integer
required: true
description: Year to fetch data for
- in: path
name: week
schema:
type: integer
required: true
description: Week to fetch data for
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseData'
/data/namespaces/{namespace}/years/{year}/months/{month}/summary:
get:
tags: [namespaces]
summary: Get namespace summary data for month
description: Gets a list of URLs that can be used to download the summary pull data for the given namespace and month
operationId: getNamespaceSummaryByMonth
parameters:
- in: path
name: namespace
schema:
type: string
required: true
description: Namespace to fetch data for
- in: path
name: year
schema:
type: integer
required: true
description: Year to fetch data for
- in: path
name: month
schema:
type: integer
required: true
description: Month to fetch data for
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseData'
/data/namespaces/{namespace}/years/{year}/weeks/{week}/summary:
get:
tags: [namespaces]
summary: Get namespace summary data for week
description: Gets a list of URLs that can be used to download the summary pull data for the given namespace and week
operationId: getNamespaceSummaryByWeek
parameters:
- in: path
name: namespace
schema:
type: string
required: true
description: Namespace to fetch data for
- in: path
name: year
schema:
type: integer
required: true
description: Year to fetch data for
- in: path
name: week
schema:
type: integer
required: true
description: Week to fetch data for
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseData'
/data/repos/{namespace}/{repo}/years:
get:
tags: [repos]
summary: Get years with data
description: Gets a list of years that have data for the given repository
operationId: getRepoYears
parameters:
- in: path
name: namespace
schema:
type: string
required: true
description: Namespace to fetch data for
- in: path
name: repo
schema:
type: string
required: true
description: Repo to fetch data for
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/YearData'
/data/repos/{namespace}/{repo}/years/{year}/months:
get:
tags: [repos]
summary: Get months with data
description: Gets a list of months that have data for the given repository and year
operationId: getRepoMonths
parameters:
- in: path
name: namespace
schema:
type: string
required: true
description: Namespace to fetch data for
- in: path
name: repo
schema:
type: string
required: true
description: Repo to fetch data for
- in: path
name: year
schema:
type: integer
required: true
description: Year to fetch data for
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/MonthData'
/data/repos/{namespace}/{repo}/years/{year}/weeks:
get:
tags: [repos]
summary: Get weeks with data
description: Gets a list of weeks that have data for the given repository and year
operationId: getRepoWeeks
parameters:
- in: path
name: namespace
schema:
type: string
required: true
description: Namespace to fetch data for
- in: path
name: repo
schema:
type: string
required: true
description: Repo to fetch data for
- in: path
name: year
schema:
type: integer
required: true
description: Year to fetch data for
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/WeekData'
/data/repos/{namespace}/{repo}/years/{year}/months/{month}:
get:
tags: [repos]
summary: Get repository metadata for month
description: Gets info about data for the given repository and month
operationId: getRepoMonthMetadata
parameters:
- in: path
name: namespace
schema:
type: string
required: true
description: Namespace to fetch data for
- in: path
name: repo
schema:
type: string
required: true
description: Repo to fetch data for
- in: path
name: year
schema:
type: integer
required: true
description: Year to fetch data for
- in: path
name: month
schema:
type: integer
required: true
description: Month to fetch data for
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/MonthModel'
'404':
description: Not Found
/data/repos/{namespace}/{repo}/years/{year}/months/{month}/raw:
get:
tags: [repos]
summary: Get repository data for month
description: Gets a list of URLs that can be used to download the raw pull data for the given repository and month
operationId: getRepoDataByMonth
parameters:
- in: path
name: namespace
schema:
type: string
required: true
description: Namespace to fetch data for
- in: path
name: repo
schema:
type: string
required: true
description: Repo to fetch data for
- in: path
name: year
schema:
type: integer
required: true
description: Year to fetch data for
- in: path
name: month
schema:
type: integer
required: true
description: Month to fetch data for
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseData'
/data/repos/{namespace}/{repo}/years/{year}/weeks/{week}:
get:
tags: [repos]
summary: Get repository metadata for week
description: Gets info about data for the given repository and week
operationId: getRepoWeekMetadata
parameters:
- in: path
name: namespace
schema:
type: string
required: true
description: Namespace to fetch data for
- in: path
name: repo
schema:
type: string
required: true
description: Repo to fetch data for
- in: path
name: year
schema:
type: integer
required: true
description: Year to fetch data for
- in: path
name: week
schema:
type: integer
required: true
description: Week to fetch data for
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/WeekModel'
'404':
description: Not Found
/data/repos/{namespace}/{repo}/years/{year}/weeks/{week}/raw:
get:
tags: [repos]
summary: Get repository data for week
description: Gets a list of URLs that can be used to download the raw pull data for the given repository and week
operationId: getRepoDataByWeek
parameters:
- in: path
name: namespace
schema:
type: string
required: true
description: Namespace to fetch data for
- in: path
name: repo
schema:
type: string
required: true
description: Repo to fetch data for
- in: path
name: year
schema:
type: integer
required: true
description: Year to fetch data for
- in: path
name: week
schema:
type: integer
required: true
description: Week to fetch data for
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseData'
/data/repos/{namespace}/{repo}/years/{year}/months/{month}/summary:
get:
tags: [repos]
summary: Get repository summary data for month
description: Gets a list of URLs that can be used to download the summary pull data for the given repository and month
operationId: getRepoSummaryByMonth
parameters:
- in: path
name: namespace
schema:
type: string
required: true
description: Namespace to fetch data for
- in: path
name: repo
schema:
type: string
required: true
description: Repo to fetch data for
- in: path
name: year
schema:
type: integer
required: true
description: Year to fetch data for
- in: path
name: month
schema:
type: integer
required: true
description: Month to fetch data for
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseData'
/data/repos/{namespace}/{repo}/years/{year}/weeks/{week}/summary:
get:
tags: [repos]
summary: Get repository summary data for week
description: Gets a list of URLs that can be used to download the summary pull data for the given repository and week
operationId: getRepoSummaryByWeek
parameters:
- in: path
name: namespace
schema:
type: string
required: true
description: Namespace to fetch data for
- in: path
name: repo
schema:
type: string
required: true
description: Repo to fetch data for
- in: path
name: year
schema:
type: integer
required: true
description: Year to fetch data for
- in: path
name: week
schema:
type: integer
required: true
description: Week to fetch data for
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseData'
components:
schemas:
ResponseData:
properties:
data:
type: array
items:
$ref: '#/components/schemas/ResponseDataFile'
ResponseDataFile:
properties:
url:
type: string
NamespaceData:
properties:
namespaces:
type: array
items:
type: string
repos:
type: array
items:
type: string
NamespaceMetadata:
properties:
namespace:
type: string
extraRepos:
type: array
items:
type: string
YearData:
properties:
years:
type: array
items:
$ref: '#/components/schemas/YearModel'
YearModel:
properties:
year:
type: integer
MonthData:
properties:
months:
type: array
items:
$ref: '#/components/schemas/MonthModel'
MonthModel:
properties:
month:
type: integer
WeekData:
properties:
weeks:
type: array
items:
$ref: '#/components/schemas/WeekModel'
WeekModel:
properties:
week:
type: integer
securitySchemes:
HubAuth:
type: https
scheme: bearer
bearerFormat: JWT
description: >
See [Hub API Authentication docs](https://docs.docker.com/docker-hub/api/latest/#tag/authentication)
x-displayName: Docker Hub Authentication

File diff suppressed because it is too large Load Diff

8
js/redoc.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1740
js/redoc.standalone.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -30,7 +30,8 @@ various APIs, CLIs, and file formats.
|:------------------------------------------------------|:---------------------------------------------------------------------------------------|
| [Engine API](/engine/api/) | The main API for Docker, provides programmatic access to a daemon |
| [Registry API](/registry/spec/api/) | Facilitates distribution of images to the engine |
| [Docker Hub API](/docker-hub/api/latest/) | API to interact with Docker Hub |
| [Docker Hub API](/docker-hub/api/latest/) | API to interact with Docker Hub |
| [DVP Data API](/docker-hub/api/dvp/) | API for Docker Verified Publishers to fetch analytics data |
## Drivers and specifications