handlers

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	DB *gorm.DB
	NC *nats.Conn
	JS nats.JetStreamContext
}

func New

func New(db *gorm.DB, nc *nats.Conn, rc nats.JetStreamContext) Handler

func (Handler) AddAttachedObjectReference

func (h Handler) AddAttachedObjectReference(c echo.Context) error

@Summary adds a new attached object reference. @Description Add a new attached object reference to the Threeport database. @ID add-v1-attachedObjectReference @Accept json @Produce json @Param attachedObjectReference body v1.AttachedObjectReference true "AttachedObjectReference object" @Success 201 {object} v0.Response "Created" @Failure 400 {object} v0.Response "Bad Request" @Failure 500 {object} v0.Response "Internal Server Error" @Router /v1/attached-object-references [POST]

func (Handler) AddWorkloadInstance

func (h Handler) AddWorkloadInstance(c echo.Context) error

@Summary adds a new workload instance. @Description Add a new workload instance to the Threeport database. @ID add-v1-workloadInstance @Accept json @Produce json @Param workloadInstance body v1.WorkloadInstance true "WorkloadInstance object" @Success 201 {object} v0.Response "Created" @Failure 400 {object} v0.Response "Bad Request" @Failure 500 {object} v0.Response "Internal Server Error" @Router /v1/workload-instances [POST]

func (Handler) DeleteAttachedObjectReference

func (h Handler) DeleteAttachedObjectReference(c echo.Context) error

@Summary deletes a attached object reference. @Description Delete a attached object reference by ID from the database. @ID delete-v1-attachedObjectReference @Accept json @Produce json @Param id path int true "ID" @Success 200 {object} v0.Response "OK" @Failure 404 {object} v0.Response "Not Found" @Failure 409 {object} v0.Response "Conflict" @Failure 500 {object} v0.Response "Internal Server Error" @Router /v1/attached-object-references/{id} [DELETE]

func (Handler) DeleteWorkloadInstance

func (h Handler) DeleteWorkloadInstance(c echo.Context) error

@Summary deletes a workload instance. @Description Delete a workload instance by ID from the database. @ID delete-v1-workloadInstance @Accept json @Produce json @Param id path int true "ID" @Success 200 {object} v0.Response "OK" @Failure 404 {object} v0.Response "Not Found" @Failure 409 {object} v0.Response "Conflict" @Failure 500 {object} v0.Response "Internal Server Error" @Router /v1/workload-instances/{id} [DELETE]

func (Handler) GetAttachedObjectReference

func (h Handler) GetAttachedObjectReference(c echo.Context) error

@Summary gets a attached object reference. @Description Get a particular attached object reference from the database. @ID get-v1-attachedObjectReference @Accept json @Produce json @Param id path int true "ID" @Success 200 {object} v0.Response "OK" @Failure 404 {object} v0.Response "Not Found" @Failure 500 {object} v0.Response "Internal Server Error" @Router /v1/attached-object-references/{id} [GET]

func (Handler) GetAttachedObjectReferenceVersions

func (h Handler) GetAttachedObjectReferenceVersions(c echo.Context) error

@Summary GetAttachedObjectReferenceVersions gets the supported versions for the attached object reference API. @Description Get the supported API versions for attached object references. @ID attachedObjectReference-get-versions @Produce json @Success 200 {object} api.RESTAPIVersions "OK" @Router /attached-object-references/versions [GET]

func (Handler) GetAttachedObjectReferences

func (h Handler) GetAttachedObjectReferences(c echo.Context) error

@Summary gets all attached object references. @Description Get all attached object references from the Threeport database. @ID get-v1-attachedObjectReferences @Accept json @Produce json @Param name query string false "attached object reference search by name" @Success 200 {object} v0.Response "OK" @Failure 400 {object} v0.Response "Bad Request" @Failure 500 {object} v0.Response "Internal Server Error" @Router /v1/attached-object-references [GET]

func (Handler) GetWorkloadInstance

func (h Handler) GetWorkloadInstance(c echo.Context) error

@Summary gets a workload instance. @Description Get a particular workload instance from the database. @ID get-v1-workloadInstance @Accept json @Produce json @Param id path int true "ID" @Success 200 {object} v0.Response "OK" @Failure 404 {object} v0.Response "Not Found" @Failure 500 {object} v0.Response "Internal Server Error" @Router /v1/workload-instances/{id} [GET]

func (Handler) GetWorkloadInstanceVersions

func (h Handler) GetWorkloadInstanceVersions(c echo.Context) error

@Summary GetWorkloadInstanceVersions gets the supported versions for the workload instance API. @Description Get the supported API versions for workload instances. @ID workloadInstance-get-versions @Produce json @Success 200 {object} api.RESTAPIVersions "OK" @Router /workload-instances/versions [GET]

func (Handler) GetWorkloadInstances

func (h Handler) GetWorkloadInstances(c echo.Context) error

@Summary gets all workload instances. @Description Get all workload instances from the Threeport database. @ID get-v1-workloadInstances @Accept json @Produce json @Param name query string false "workload instance search by name" @Success 200 {object} v0.Response "OK" @Failure 400 {object} v0.Response "Bad Request" @Failure 500 {object} v0.Response "Internal Server Error" @Router /v1/workload-instances [GET]

func (Handler) ReplaceAttachedObjectReference

func (h Handler) ReplaceAttachedObjectReference(c echo.Context) error

@Summary updates an existing attached object reference by replacing the entire object. @Description Replace a attached object reference in the database. All required fields must be provided. @Description If any optional fields are not provided, they will be null post-update. @Description Note: This API endpint is for updating attached object reference objects only. @Description Request bodies that include related objects will be accepted, however @Description the related objects will not be changed. Call the patch or put method for @Description each particular existing object to change them. @ID replace-v1-attachedObjectReference @Accept json @Produce json @Param id path int true "ID" @Param attachedObjectReference body v1.AttachedObjectReference true "AttachedObjectReference object" @Success 200 {object} v0.Response "OK" @Failure 400 {object} v0.Response "Bad Request" @Failure 404 {object} v0.Response "Not Found" @Failure 500 {object} v0.Response "Internal Server Error" @Router /v1/attached-object-references/{id} [PUT]

func (Handler) ReplaceWorkloadInstance

func (h Handler) ReplaceWorkloadInstance(c echo.Context) error

@Summary updates an existing workload instance by replacing the entire object. @Description Replace a workload instance in the database. All required fields must be provided. @Description If any optional fields are not provided, they will be null post-update. @Description Note: This API endpint is for updating workload instance objects only. @Description Request bodies that include related objects will be accepted, however @Description the related objects will not be changed. Call the patch or put method for @Description each particular existing object to change them. @ID replace-v1-workloadInstance @Accept json @Produce json @Param id path int true "ID" @Param workloadInstance body v1.WorkloadInstance true "WorkloadInstance object" @Success 200 {object} v0.Response "OK" @Failure 400 {object} v0.Response "Bad Request" @Failure 404 {object} v0.Response "Not Found" @Failure 500 {object} v0.Response "Internal Server Error" @Router /v1/workload-instances/{id} [PUT]

func (Handler) UpdateAttachedObjectReference

func (h Handler) UpdateAttachedObjectReference(c echo.Context) error

@Summary updates specific fields for an existing attached object reference. @Description Update a attached object reference in the database. Provide one or more fields to update. @Description Note: This API endpint is for updating attached object reference objects only. @Description Request bodies that include related objects will be accepted, however @Description the related objects will not be changed. Call the patch or put method for @Description each particular existing object to change them. @ID update-v1-attachedObjectReference @Accept json @Produce json @Param id path int true "ID" @Param attachedObjectReference body v1.AttachedObjectReference true "AttachedObjectReference object" @Success 200 {object} v0.Response "OK" @Failure 400 {object} v0.Response "Bad Request" @Failure 404 {object} v0.Response "Not Found" @Failure 500 {object} v0.Response "Internal Server Error" @Router /v1/attached-object-references/{id} [PATCH]

func (Handler) UpdateWorkloadInstance

func (h Handler) UpdateWorkloadInstance(c echo.Context) error

@Summary updates specific fields for an existing workload instance. @Description Update a workload instance in the database. Provide one or more fields to update. @Description Note: This API endpint is for updating workload instance objects only. @Description Request bodies that include related objects will be accepted, however @Description the related objects will not be changed. Call the patch or put method for @Description each particular existing object to change them. @ID update-v1-workloadInstance @Accept json @Produce json @Param id path int true "ID" @Param workloadInstance body v1.WorkloadInstance true "WorkloadInstance object" @Success 200 {object} v0.Response "OK" @Failure 400 {object} v0.Response "Bad Request" @Failure 404 {object} v0.Response "Not Found" @Failure 500 {object} v0.Response "Internal Server Error" @Router /v1/workload-instances/{id} [PATCH]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL