feat: add stacks APIs to codegen (#163)

This commit is contained in:
Daniel Moran
2021-06-30 14:47:35 -04:00
committed by GitHub
parent a3f36a9821
commit aaf99da0a9
22 changed files with 2820 additions and 0 deletions

View File

@ -79,6 +79,10 @@ paths:
$ref: "./overrides/paths/templates_export.yml"
/templates/apply:
$ref: "./overrides/paths/templates_apply.yml"
/stacks:
$ref: "./overrides/paths/stacks.yml"
/stacks/{stack_id}:
$ref: "./overrides/paths/stacks_stack_id.yml"
/dbrps:
$ref: "./openapi/src/common/paths/dbrps.yml"
"/dbrps/{dbrpID}":
@ -371,6 +375,22 @@ components:
$ref: "./overrides/schemas/TemplateSummaryDiffVariable.yml"
TemplateSummaryDiffVariableFields:
$ref: "./overrides/schemas/TemplateSummaryDiffVariableFields.yml"
Stacks:
$ref: "./overrides/schemas/Stacks.yml"
Stack:
$ref: "./overrides/schemas/Stack.yml"
StackEvent:
$ref: "./overrides/schemas/StackEvent.yml"
StackEventResource:
$ref: "./overrides/schemas/StackEventResource.yml"
StackEventResourceAssociation:
$ref: "./overrides/schemas/StackEventResourceAssociation.yml"
StackPostRequest:
$ref: "./overrides/schemas/StackPostRequest.yml"
StackPatchRequest:
$ref: "./overrides/schemas/StackPatchRequest.yml"
StackPatchRequestResource:
$ref: "./overrides/schemas/StackPatchRequestResource.yml"
SecretKeysResponse:
$ref: "./openapi/src/common/schemas/SecretKeysResponse.yml"
SecretKeys:

View File

@ -0,0 +1,64 @@
get:
operationId: ListStacks
tags:
- Stacks
summary: List all installed InfluxDB templates
parameters:
- in: query
name: orgID
required: true
schema:
type: string
description: The organization id of the stacks
- in: query
name: name
schema:
type: array
items:
type: string
description: A collection of names to filter the list by.
- in: query
name: stackID
schema:
type: array
items:
type: string
description: A collection of stackIDs to filter the list by.
responses:
"200":
description: Influx stacks found
content:
application/json:
schema:
$ref: "../schemas/Stacks.yml"
default:
description: Unexpected error
content:
application/json:
schema:
$ref: "../../openapi/src/common/schemas/Error.yml"
post:
operationId: CreateStack
tags:
- Stacks
summary: Create a new stack
requestBody:
description: Stack to create.
required: true
content:
application/json:
schema:
$ref: "../schemas/StackPostRequest.yml"
responses:
"201":
description: InfluxDB Stack created
content:
application/json:
schema:
$ref: "../schemas/Stack.yml"
default:
description: Unexpected error
content:
application/json:
schema:
$ref: "../../openapi/src/common/schemas/Error.yml"

View File

@ -0,0 +1,84 @@
get:
operationId: ReadStack
tags:
- Stacks
summary: Retrieve a stack
parameters:
- in: path
name: stack_id
required: true
schema:
type: string
description: Theidentifier of the stack.
responses:
"200":
description: The InfluxDB stack
content:
application/json:
schema:
$ref: "../schemas/Stack.yml"
default:
description: Unexpected error
content:
application/json:
schema:
$ref: "../../openapi/src/common/schemas/Error.yml"
patch:
operationId: UpdateStack
tags:
- Stacks
summary: Update an InfluxDB Stack
parameters:
- in: path
name: stack_id
required: true
schema:
type: string
description: Theidentifier of the stack.
requestBody:
description: Influx stack to update.
required: true
content:
application/json:
schema:
$ref: "../schemas/StackPatchRequest.yml"
responses:
"200":
description: Influx stack updated
content:
application/json:
schema:
$ref: "../schemas/Stack.yml"
default:
description: Unexpected error
content:
application/json:
schema:
$ref: "../../openapi/src/common/schemas/Error.yml"
delete:
operationId: DeleteStack
tags:
- Stacks
summary: Delete a stack and associated resources
parameters:
- in: path
name: stack_id
required: true
schema:
type: string
description: Theidentifier of the stack.
- in: query
name: orgID
required: true
schema:
type: string
description: The identifier of the organization.
responses:
"204":
description: The stack and its associated resources are deleted
default:
description: Unexpected error
content:
application/json:
schema:
$ref: "../../openapi/src/common/schemas/Error.yml"

View File

@ -0,0 +1,14 @@
type: object
properties:
id:
type: string
orgID:
type: string
createdAt:
type: string
format: date-time
events:
type: array
items:
$ref: "./StackEvent.yml"
required: [id, orgID, createdAt, events]

View File

@ -0,0 +1,24 @@
type: object
properties:
eventType:
type: string
name:
type: string
description:
type: string
sources:
type: array
items:
type: string
resources:
type: array
items:
$ref: "./StackEventResource.yml"
urls:
type: array
items:
type: string
updatedAt:
type: string
format: date-time
required: [eventType, name, sources, resources, urls, updatedAt]

View File

@ -0,0 +1,20 @@
type: object
properties:
apiVersion:
type: string
resourceID:
type: string
kind:
type: string
templateMetaName:
type: string
associations:
type: array
items:
$ref: "./StackEventResourceAssociation.yml"
links:
type: object
properties:
self:
type: string
required: [apiVersion, resourceID, kind, templateMetaName, associations]

View File

@ -0,0 +1,7 @@
type: object
properties:
kind:
type: string
metaName:
type: string
required: [kind, metaName]

View File

@ -0,0 +1,15 @@
type: object
properties:
name:
type: string
description:
type: string
templateURLs:
type: array
items:
type: string
additionalResources:
type: array
items:
$ref: "./StackPatchRequestResource.yml"
required: [templateURLs, additionalResources]

View File

@ -0,0 +1,9 @@
type: object
properties:
resourceID:
type: string
kind:
type: string
templateMetaName:
type: string
required: [kind, resourceID]

View File

@ -0,0 +1,13 @@
type: object
properties:
orgID:
type: string
name:
type: string
description:
type: string
urls:
type: array
items:
type: string
required: [orgID, name, urls]

View File

@ -0,0 +1,7 @@
type: object
properties:
stacks:
type: array
items:
$ref: "./Stack.yml"
required: [stacks]