TASK: Add codeblocks to code examples

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Simon 2021-01-19 16:39:26 +01:00 committed by Sebastiaan van Stijn
parent 96357c9616
commit b2ac3a2884

View file

@ -29,7 +29,8 @@ order is not guaranteed.
To setup a registry instance to send notifications to endpoints, one must add
them to the configuration. A simple example follows:
notifications:
```yaml
notifications:
endpoints:
- name: alistener
url: https://mylistener.example.com/event
@ -38,6 +39,7 @@ them to the configuration. A simple example follows:
timeout: 500ms
threshold: 5
backoff: 1s
```
The above would configure the registry with an endpoint to send events to
`https://mylistener.example.com/event`, with the header "Authorization: Bearer
@ -123,10 +125,12 @@ contains a subset of the data contained in Get and Put events. Specifically,
only the digest and repository are sent.
```json
"target": {
{
"target": {
"digest": "sha256:d89e1bee20d9cb344674e213b581f14fbd8e70274ecf9d10c514bab78a307845",
"repository": "library/test"
},
}
}
```
> **Note**: As of version 2.1, the `length` field for event targets
@ -140,7 +144,7 @@ The envelope contains one or more events, with the following json structure:
```json
{
"events": [ ... ],
"events": [ "..." ]
}
```
@ -155,8 +159,8 @@ request coming to an endpoint.
An example of a full event may look as follows:
```json
GET /callback
```
GET /callback HTTP/1.1
Host: application/vnd.docker.distribution.events.v1+json
Authorization: Bearer <your token, if needed>
Content-Type: application/vnd.docker.distribution.events.v1+json
@ -263,49 +267,50 @@ The following provides an example of a few endpoints that have experienced
several failures and have since recovered:
```json
"notifications":{
"endpoints":[
{
"notifications": {
"endpoints": [
{
"name":"local-5003",
"url":"http://localhost:5003/callback",
"Headers":{
"Authorization":[
"name": "local-5003",
"url": "http://localhost:5003/callback",
"Headers": {
"Authorization": [
"Bearer \u003can example token\u003e"
]
},
"Timeout":1000000000,
"Threshold":10,
"Backoff":1000000000,
"Metrics":{
"Pending":76,
"Events":76,
"Successes":0,
"Failures":0,
"Errors":46,
"Statuses":{
"Timeout": 1000000000,
"Threshold": 10,
"Backoff": 1000000000,
"Metrics": {
"Pending": 76,
"Events": 76,
"Successes": 0,
"Failures": 0,
"Errors": 46,
"Statuses": {
}
}
},
{
"name":"local-8083",
"url":"http://localhost:8083/callback",
"Headers":null,
"Timeout":1000000000,
"Threshold":10,
"Backoff":1000000000,
"Metrics":{
"Pending":0,
"Events":76,
"Successes":76,
"Failures":0,
"Errors":28,
"Statuses":{
"202 Accepted":76
"name": "local-8083",
"url": "http://localhost:8083/callback",
"Headers": null,
"Timeout": 1000000000,
"Threshold": 10,
"Backoff": 1000000000,
"Metrics": {
"Pending": 0,
"Events": 76,
"Successes": 76,
"Failures": 0,
"Errors": 28,
"Statuses": {
"202 Accepted": 76
}
}
}
]
}
}
```