Skip to content

Commit

Permalink
api/source: Add endpoint to upload source inventory
Browse files Browse the repository at this point in the history
This commit adds an endpoint '/api/v1/source/' to allow creating sources
from inventory files.

Signed-off-by: Cosmin Tupangiu <[email protected]>
  • Loading branch information
tupyy authored and machacekondra committed Jan 14, 2025
1 parent 902c8de commit 5381dfc
Show file tree
Hide file tree
Showing 6 changed files with 409 additions and 35 deletions.
54 changes: 51 additions & 3 deletions api/v1alpha1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,54 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Error'
post:
tags:
- source
description: create a source from inventory file
operationId: createSource
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SourceCreate'
required: true
responses:
"201":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Source'
"400":
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
"401":
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
"403":
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
"404":
description: NotFound
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
"500":
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
delete:
tags:
- source
Expand Down Expand Up @@ -325,10 +373,10 @@ components:
SourceCreate:
type: object
properties:
name:
type: string
inventory:
$ref: '#/components/schemas/Inventory'
required:
- name
- inventory

SourceList:
type: array
Expand Down
63 changes: 32 additions & 31 deletions api/v1alpha1/spec.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion api/v1alpha1/types.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

180 changes: 180 additions & 0 deletions internal/api/client/client.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5381dfc

Please sign in to comment.