-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial swagger documentation. Covers host credential basic API. Closes
#6.
- Loading branch information
1 parent
2116b5e
commit c303fbe
Showing
1 changed file
with
172 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
swagger: "2.0" | ||
info: | ||
description: "The models and API for the Quipucords server." | ||
version: "1.0.0" | ||
title: "Quipucords API" | ||
contact: | ||
email: "quipucords@redhat.com" | ||
license: | ||
name: "GPL 3.0" | ||
url: "https://www.gnu.org/licenses/gpl-3.0.txt" | ||
|
||
basePath: "/api/v1" | ||
|
||
tags: | ||
- name: "Host Credential" | ||
description: "API related to the Host Credential model" | ||
|
||
paths: | ||
/credentials/hosts: | ||
post: | ||
tags: | ||
- "Host Credential" | ||
summary: "Add a new host credential" | ||
description: "Create a new host credential for use when connecting to a target system." | ||
operationId: "addHostCredential" | ||
consumes: | ||
- "application/json" | ||
produces: | ||
- "application/json" | ||
parameters: | ||
- in: "body" | ||
name: "body" | ||
description: "Host credential object that needs to be stored" | ||
required: true | ||
schema: | ||
$ref: "#/definitions/HostCredential" | ||
responses: | ||
201: | ||
description: "Host credential created" | ||
400: | ||
description: "Invalid input" | ||
get: | ||
tags: | ||
- "Host Credential" | ||
summary: "List exsiting host credentials" | ||
description: "List all host credential for use when connecting to a target system." | ||
operationId: "listHostCredentials" | ||
consumes: | ||
- "application/json" | ||
produces: | ||
- "application/json" | ||
responses: | ||
200: | ||
description: "Host credential retrieved" | ||
schema: | ||
type: "array" | ||
items: | ||
$ref: "#/definitions/HostCredentialExt" | ||
/credentials/hosts/{host_cred_id}: | ||
get: | ||
tags: | ||
- "Host Credential" | ||
summary: "Get an existing host credential" | ||
description: "Get a host credential for use when connecting to a target system." | ||
operationId: "getHostCredential" | ||
consumes: | ||
- "application/json" | ||
produces: | ||
- "application/json" | ||
parameters: | ||
- name: "host_cred_id" | ||
in: "path" | ||
description: "ID of host credential to retrieve" | ||
required: true | ||
type: "integer" | ||
format: "int64" | ||
responses: | ||
200: | ||
description: "Host credential retrieved" | ||
schema: | ||
$ref: "#/definitions/HostCredentialExt" | ||
404: | ||
description: "Host credential not found" | ||
put: | ||
tags: | ||
- "Host Credential" | ||
summary: "Update an existing host credential" | ||
description: "Update a host credential for use when connecting to a target system." | ||
operationId: "updateHostCredential" | ||
consumes: | ||
- "application/json" | ||
produces: | ||
- "application/json" | ||
parameters: | ||
- name: "host_cred_id" | ||
in: "path" | ||
description: "ID of host credential to update" | ||
required: true | ||
type: "integer" | ||
format: "int64" | ||
- in: "body" | ||
name: "body" | ||
description: "Host credential object that needs to be modified" | ||
required: true | ||
schema: | ||
$ref: "#/definitions/HostCredential" | ||
responses: | ||
200: | ||
description: "Host credential updated" | ||
schema: | ||
$ref: "#/definitions/HostCredentialExt" | ||
400: | ||
description: "Invalid input" | ||
404: | ||
description: "Host credential not found" | ||
delete: | ||
tags: | ||
- "Host Credential" | ||
summary: "Delete an existing host credential" | ||
description: "Delete a host credential for use when connecting to a target system." | ||
operationId: "deleteHostCredential" | ||
consumes: | ||
- "application/json" | ||
produces: | ||
- "application/json" | ||
parameters: | ||
- name: "host_cred_id" | ||
in: "path" | ||
description: "ID of host credential to delete" | ||
required: true | ||
type: "integer" | ||
format: "int64" | ||
responses: | ||
204: | ||
description: "Host credential deleted" | ||
404: | ||
description: "Host credential not found" | ||
|
||
definitions: | ||
HostCredential: | ||
type: "object" | ||
required: | ||
- name | ||
- username | ||
- password | ||
- sshkeyfile | ||
properties: | ||
name: | ||
type: "string" | ||
description: "The name of the host credential" | ||
username: | ||
type: "string" | ||
description: "The connection username for the host credential" | ||
password: | ||
type: "string" | ||
description: "The connection password for the host credential" | ||
sshkeyfile: | ||
type: "string" | ||
description: "The connection private ssh keyfile for the host credential" | ||
sudo_password: | ||
type: "string" | ||
description: "The password for sudo permission escalation after connection for the host credential" | ||
HostCredentialExt: | ||
allOf: | ||
- $ref: "#/definitions/HostCredential" | ||
- type: "object" | ||
required: | ||
- id | ||
properties: | ||
id: | ||
type: "integer" | ||
format: "int64" |