...
The sample API above was create using the swagger.yaml below.
swagger.yml
Code Block | ||||
---|---|---|---|---|
| ||||
swagger: "2.0" |
...
info: |
...
description: "Addresses deployment of workloads in the edge" |
...
version: "1.0.0" |
...
title: "Integrated Cloud Native RESTful API" |
...
schemes: |
...
- "http" |
...
consumes: |
...
- "application/json" |
...
produces: |
...
- "application/json" |
...
paths: |
...
/v1/baremetalcluster/{clustername}/images/: |
...
get: tags: - "Deployment of Images" summary: "List all Images." description: "Endpoint to list all Images." produces: - "application/json" parameters: - name: "clustername" in: "path" description: "Name of the cluster used to query" required: true type: "string" responses: 200: description: "successful operation" schema: $ref: "#/definitions/GETResponse" default: description: generic error response schema: $ref: "#/definitions/error" |
...
/v1/baremetalcluster/{clustername}/images/{name}: |
...
get: tags: - "Deployment of Images" summary: "Get details of an image." description: "Endpoint to get details of ICN available images." produces: - "application/json" parameters: - name: "clustername" in: "path" description: "Name of the cluster used to query" required: true type: "string" - name: "name" in: "path" description: "Name used to query" required: true type: "string" responses: 200: description: "successful operation" schema: $ref: "#/definitions/GETResponse" default: description: generic error response schema: $ref: "#/definitions/error" |
...
definitions: |
...
GETResponse: type: "object" properties: ID: type: "string" image_id: type: "string" repo: type: "string" tag: type: "string" description: type: "string" minLength: 1 error: type: "object" required: - "message" properties: code: type: "integer" format: "int64" message: type: "string" |
Testing:
Proposed sample command to GET all binary images
...