docs: split http and json code blocks
This commit is contained in:
parent
d4522e9c6e
commit
12c47e4066
@ -39,11 +39,13 @@ The HTTP status code of the response should indicate what type of failure occurr
|
|||||||
|
|
||||||
#### Example Response
|
#### Example Response
|
||||||
|
|
||||||
```json
|
```http
|
||||||
HTTP/1.1 400 Bad Request
|
HTTP/1.1 400 Bad Request
|
||||||
Content-Type: application/json;charset=utf-8
|
Content-Type: application/json;charset=utf-8
|
||||||
Server: clair
|
Server: clair
|
||||||
|
```
|
||||||
|
|
||||||
|
```json
|
||||||
{
|
{
|
||||||
"Error": {
|
"Error": {
|
||||||
"Message": "example error message"
|
"Message": "example error message"
|
||||||
@ -67,9 +69,11 @@ The Authorization field is an optional value whose contents will fill the Author
|
|||||||
|
|
||||||
#### Example Request
|
#### Example Request
|
||||||
|
|
||||||
```json
|
```http
|
||||||
POST http://localhost:6060/v1/layers HTTP/1.1
|
POST http://localhost:6060/v1/layers HTTP/1.1
|
||||||
|
```
|
||||||
|
|
||||||
|
```json
|
||||||
{
|
{
|
||||||
"Layer": {
|
"Layer": {
|
||||||
"Name": "523ef1d23f222195488575f52a39c729c76a8c5630c9a194139cb246fb212da6",
|
"Name": "523ef1d23f222195488575f52a39c729c76a8c5630c9a194139cb246fb212da6",
|
||||||
@ -85,11 +89,13 @@ POST http://localhost:6060/v1/layers HTTP/1.1
|
|||||||
|
|
||||||
#### Example Response
|
#### Example Response
|
||||||
|
|
||||||
```json
|
```http
|
||||||
HTTP/1.1 201 Created
|
HTTP/1.1 201 Created
|
||||||
Content-Type: application/json;charset=utf-8
|
Content-Type: application/json;charset=utf-8
|
||||||
Server: clair
|
Server: clair
|
||||||
|
```
|
||||||
|
|
||||||
|
```json
|
||||||
{
|
{
|
||||||
"Layer": {
|
"Layer": {
|
||||||
"Name": "523ef1d23f222195488575f52a39c729c76a8c5630c9a194139cb246fb212da6",
|
"Name": "523ef1d23f222195488575f52a39c729c76a8c5630c9a194139cb246fb212da6",
|
||||||
@ -119,17 +125,19 @@ The GET route for the Layers resource displays a Layer and optionally all of its
|
|||||||
|
|
||||||
#### Example Request
|
#### Example Request
|
||||||
|
|
||||||
```
|
```http
|
||||||
GET http://localhost:6060/v1/layers/17675ec01494d651e1ccf81dc9cf63959ebfeed4f978fddb1666b6ead008ed52?features&vulnerabilities HTTP/1.1
|
GET http://localhost:6060/v1/layers/17675ec01494d651e1ccf81dc9cf63959ebfeed4f978fddb1666b6ead008ed52?features&vulnerabilities HTTP/1.1
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Example Response
|
#### Example Response
|
||||||
|
|
||||||
```json
|
```http
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Content-Type: application/json;charset=utf-8
|
Content-Type: application/json;charset=utf-8
|
||||||
Server: clair
|
Server: clair
|
||||||
|
```
|
||||||
|
|
||||||
|
```json
|
||||||
{
|
{
|
||||||
"Layer": {
|
"Layer": {
|
||||||
"Name": "17675ec01494d651e1ccf81dc9cf63959ebfeed4f978fddb1666b6ead008ed52",
|
"Name": "17675ec01494d651e1ccf81dc9cf63959ebfeed4f978fddb1666b6ead008ed52",
|
||||||
@ -165,13 +173,13 @@ The DELETE route for the Layers resource removes a Layer and all of its children
|
|||||||
|
|
||||||
#### Example Request
|
#### Example Request
|
||||||
|
|
||||||
```json
|
```http
|
||||||
DELETE http://localhost:6060/v1/layers/17675ec01494d651e1ccf81dc9cf63959ebfeed4f978fddb1666b6ead008ed52 HTTP/1.1
|
DELETE http://localhost:6060/v1/layers/17675ec01494d651e1ccf81dc9cf63959ebfeed4f978fddb1666b6ead008ed52 HTTP/1.1
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Example Response
|
#### Example Response
|
||||||
|
|
||||||
```json
|
```http
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Server: clair
|
Server: clair
|
||||||
```
|
```
|
||||||
@ -187,17 +195,19 @@ The GET route for the Namespaces resource displays a list of namespaces currentl
|
|||||||
|
|
||||||
#### Example Request
|
#### Example Request
|
||||||
|
|
||||||
```json
|
```http
|
||||||
GET http://localhost:6060/v1/namespaces HTTP/1.1
|
GET http://localhost:6060/v1/namespaces HTTP/1.1
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Example Response
|
#### Example Response
|
||||||
|
|
||||||
```json
|
```http
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Content-Type: application/json;charset=utf-8
|
Content-Type: application/json;charset=utf-8
|
||||||
Server: clair
|
Server: clair
|
||||||
|
```
|
||||||
|
|
||||||
|
```json
|
||||||
{
|
{
|
||||||
"Namespaces": [
|
"Namespaces": [
|
||||||
{ "Name": "debian:8" },
|
{ "Name": "debian:8" },
|
||||||
@ -223,17 +233,19 @@ The GET route for the Vulnerabilities resource displays the vulnerabilities data
|
|||||||
|
|
||||||
#### Example Request
|
#### Example Request
|
||||||
|
|
||||||
```json
|
```http
|
||||||
GET http://localhost:6060/v1/namespaces/debian%3A8/vulnerabilities?limit=2 HTTP/1.1
|
GET http://localhost:6060/v1/namespaces/debian%3A8/vulnerabilities?limit=2 HTTP/1.1
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Example Response
|
#### Example Response
|
||||||
|
|
||||||
```json
|
```http
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Content-Type: application/json;charset=utf-8
|
Content-Type: application/json;charset=utf-8
|
||||||
Server: clair
|
Server: clair
|
||||||
|
```
|
||||||
|
|
||||||
|
```json
|
||||||
{
|
{
|
||||||
"Vulnerabilities": [
|
"Vulnerabilities": [
|
||||||
{
|
{
|
||||||
@ -271,9 +283,11 @@ The POST route for the Vulnerabilities resource creates a new Vulnerability.
|
|||||||
|
|
||||||
#### Example Request
|
#### Example Request
|
||||||
|
|
||||||
```json
|
```http
|
||||||
POST http://localhost:6060/v1/namespaces/debian%3A8/vulnerabilities HTTP/1.1
|
POST http://localhost:6060/v1/namespaces/debian%3A8/vulnerabilities HTTP/1.1
|
||||||
|
```
|
||||||
|
|
||||||
|
```json
|
||||||
{
|
{
|
||||||
"Vulnerability": {
|
"Vulnerability": {
|
||||||
"Name": "CVE-2014-9471",
|
"Name": "CVE-2014-9471",
|
||||||
@ -302,11 +316,13 @@ POST http://localhost:6060/v1/namespaces/debian%3A8/vulnerabilities HTTP/1.1
|
|||||||
|
|
||||||
#### Example Response
|
#### Example Response
|
||||||
|
|
||||||
```json
|
```http
|
||||||
HTTP/1.1 201 Created
|
HTTP/1.1 201 Created
|
||||||
Content-Type: application/json;charset=utf-8
|
Content-Type: application/json;charset=utf-8
|
||||||
Server: clair
|
Server: clair
|
||||||
|
```
|
||||||
|
|
||||||
|
```json
|
||||||
{
|
{
|
||||||
"Vulnerability": {
|
"Vulnerability": {
|
||||||
"Name": "CVE-2014-9471",
|
"Name": "CVE-2014-9471",
|
||||||
@ -347,17 +363,19 @@ The GET route for the Vulnerabilities resource displays the current data for a g
|
|||||||
|
|
||||||
#### Example Request
|
#### Example Request
|
||||||
|
|
||||||
```json
|
```http
|
||||||
GET http://localhost:6060/v1/namespaces/debian%3A8/vulnerabilities/CVE-2014-9471?fixedIn HTTP/1.1
|
GET http://localhost:6060/v1/namespaces/debian%3A8/vulnerabilities/CVE-2014-9471?fixedIn HTTP/1.1
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Example Response
|
#### Example Response
|
||||||
|
|
||||||
```json
|
```http
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Content-Type: application/json;charset=utf-8
|
Content-Type: application/json;charset=utf-8
|
||||||
Server: clair
|
Server: clair
|
||||||
|
```
|
||||||
|
|
||||||
|
```json
|
||||||
{
|
{
|
||||||
"Vulnerability": {
|
"Vulnerability": {
|
||||||
"Name": "CVE-2014-9471",
|
"Name": "CVE-2014-9471",
|
||||||
@ -395,9 +413,11 @@ If this vulnerability was inserted by a Fetcher, changes may be lost when the Fe
|
|||||||
|
|
||||||
#### Example Request
|
#### Example Request
|
||||||
|
|
||||||
```json
|
```http
|
||||||
PUT http://localhost:6060/v1/namespaces/debian%3A8/vulnerabilities/CVE-2014-9471
|
PUT http://localhost:6060/v1/namespaces/debian%3A8/vulnerabilities/CVE-2014-9471
|
||||||
|
```
|
||||||
|
|
||||||
|
```json
|
||||||
{
|
{
|
||||||
"Vulnerability": {
|
"Vulnerability": {
|
||||||
"Name": "CVE-2014-9471",
|
"Name": "CVE-2014-9471",
|
||||||
@ -419,10 +439,12 @@ PUT http://localhost:6060/v1/namespaces/debian%3A8/vulnerabilities/CVE-2014-9471
|
|||||||
|
|
||||||
#### Example Response
|
#### Example Response
|
||||||
|
|
||||||
```json
|
```http
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Server: clair
|
Server: clair
|
||||||
|
```
|
||||||
|
|
||||||
|
```json
|
||||||
{
|
{
|
||||||
"Vulnerability": {
|
"Vulnerability": {
|
||||||
"Name": "CVE-2014-9471",
|
"Name": "CVE-2014-9471",
|
||||||
@ -452,13 +474,13 @@ If this vulnerability was inserted by a Fetcher, it may be re-inserted when the
|
|||||||
|
|
||||||
#### Example Request
|
#### Example Request
|
||||||
|
|
||||||
```json
|
```http
|
||||||
GET http://localhost:6060/v1/namespaces/debian%3A8/vulnerabilities/CVE-2014-9471 HTTP/1.1
|
GET http://localhost:6060/v1/namespaces/debian%3A8/vulnerabilities/CVE-2014-9471 HTTP/1.1
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Example Response
|
#### Example Response
|
||||||
|
|
||||||
```json
|
```http
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Server: clair
|
Server: clair
|
||||||
```
|
```
|
||||||
@ -473,17 +495,19 @@ The GET route for the Fixes resource displays the list of Features that fix the
|
|||||||
|
|
||||||
#### Example Request
|
#### Example Request
|
||||||
|
|
||||||
```json
|
```http
|
||||||
GET http://localhost:6060/v1/namespaces/debian%3A8/vulnerabilities/CVE-2014-9471/fixes HTTP/1.1
|
GET http://localhost:6060/v1/namespaces/debian%3A8/vulnerabilities/CVE-2014-9471/fixes HTTP/1.1
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Example Response
|
#### Example Response
|
||||||
|
|
||||||
```json
|
```http
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Content-Type: application/json;charset=utf-8
|
Content-Type: application/json;charset=utf-8
|
||||||
Server: clair
|
Server: clair
|
||||||
|
```
|
||||||
|
|
||||||
|
```json
|
||||||
{
|
{
|
||||||
"Features": [
|
"Features": [
|
||||||
{
|
{
|
||||||
@ -503,9 +527,11 @@ The PUT route for the Fixes resource updates a Feature that is the fix for a giv
|
|||||||
|
|
||||||
#### Example Request
|
#### Example Request
|
||||||
|
|
||||||
```json
|
```http
|
||||||
PUT http://localhost:6060/v1/namespaces/debian%3A8/vulnerabilities/CVE-2014-9471/fixes/coreutils HTTP/1.1
|
PUT http://localhost:6060/v1/namespaces/debian%3A8/vulnerabilities/CVE-2014-9471/fixes/coreutils HTTP/1.1
|
||||||
|
```
|
||||||
|
|
||||||
|
```json
|
||||||
{
|
{
|
||||||
"Feature": {
|
"Feature": {
|
||||||
"Name": "coreutils",
|
"Name": "coreutils",
|
||||||
@ -517,10 +543,12 @@ PUT http://localhost:6060/v1/namespaces/debian%3A8/vulnerabilities/CVE-2014-9471
|
|||||||
|
|
||||||
#### Example Response
|
#### Example Response
|
||||||
|
|
||||||
```json
|
```http
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Server: clair
|
Server: clair
|
||||||
|
```
|
||||||
|
|
||||||
|
```json
|
||||||
{
|
{
|
||||||
"Feature": {
|
"Feature": {
|
||||||
"Name": "coreutils",
|
"Name": "coreutils",
|
||||||
@ -538,13 +566,13 @@ The DELETE route for the Fixes resource removes a Feature as fix for the given V
|
|||||||
|
|
||||||
#### Example Request
|
#### Example Request
|
||||||
|
|
||||||
```json
|
```http
|
||||||
DELETE http://localhost:6060/v1/namespaces/debian%3A8/vulnerabilities/CVE-2014-9471/fixes/coreutils
|
DELETE http://localhost:6060/v1/namespaces/debian%3A8/vulnerabilities/CVE-2014-9471/fixes/coreutils
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Example Response
|
#### Example Response
|
||||||
|
|
||||||
```json
|
```http
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Server: clair
|
Server: clair
|
||||||
```
|
```
|
||||||
@ -568,7 +596,7 @@ The `LayersIntroducingVulnerability` property is deprecated and will eventually
|
|||||||
|
|
||||||
#### Example Request
|
#### Example Request
|
||||||
|
|
||||||
```json
|
```http
|
||||||
GET http://localhost:6060/v1/notifications/ec45ec87-bfc8-4129-a1c3-d2b82622175a?limit=2 HTTP/1.1
|
GET http://localhost:6060/v1/notifications/ec45ec87-bfc8-4129-a1c3-d2b82622175a?limit=2 HTTP/1.1
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -655,13 +683,13 @@ The time at which this Notification was marked as read can be seen in the `Notif
|
|||||||
|
|
||||||
#### Example Request
|
#### Example Request
|
||||||
|
|
||||||
```json
|
```http
|
||||||
DELETE http://localhost:6060/v1/notification/ec45ec87-bfc8-4129-a1c3-d2b82622175a HTTP/1.1
|
DELETE http://localhost:6060/v1/notification/ec45ec87-bfc8-4129-a1c3-d2b82622175a HTTP/1.1
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Example Response
|
#### Example Response
|
||||||
|
|
||||||
```json
|
```http
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Server: clair
|
Server: clair
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user