refkey

package
v0.0.0-...-51fd5d7 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

README

Reference Keys

A reference key a way to make a unique reference to a metric using a string key. It is used to add a data to a basic metric from an external source.

Reference Key Definition

Key Type Validation Description
id number Unique reference key identifier
metric-id string Metric indetifier
refkey string min: 1, max: 200 Unique reference key

Create reference key

Create a reference key.

Details
  • Role: Admin
  • Route URL: POST /containers/basics/:containerId/metrics/:metricId/refkeys
  • Parameters: No parameters.
  • Body:
{
  "refkey": "string" // min: 1 max: 200
}
  • Responses:

    • 400 If invalid body.
    • 400 If json fields are invalid.
    • 400 If refkey already exists.
    • 404 If metric not found.
    • 200 If succeeded. With body containing its data in the format:
    {
        "id": "number"
    }
    

Update reference key

Updates a refkey by id.

Details
  • Role: Admin
  • Route URL: PATCH /containers/basics/:containerId/metrics/:metricId/refkeys/:refkeyId
  • Parameters: No parameters.
  • Body:
{
  "refkey": "string" // min: 1 max: 200
}
  • Responses:

    • 400 If invalid body.
    • 400 If json fields are invalid.
    • 400 If refkey already exists.
    • 404 If refkey not found.
    • 200 If succeeded.

Delete reference key

Deletes refkey by id.

Details
  • Role: Admin
  • Route URL: DELETE /containers/basics/:containerId/metrics/:metricId/refkeys/:refkeyId
  • Parameters: No parameters.
  • Body: No body.
  • Responses:
    • 400 If invalid id.
    • 404 If refkey not found.
    • 200 If succeeded.

Get reference keys

Get a reference key.

Details
  • Role: Admin
  • Route URL: GET /containers/basics/:containerId/metrics/:metricId/refkeys
  • Parameters: No parameters.
  • Body: No body.
  • Responses:
    • 400 If invalid params.
    • 200 If succeeded. With body containing its data in the format:
{
  "id": "number",
  "metric-id": "number"
  "refkey": "string"
}[]

Get reference key info

Get a reference key information by refkey.

Details
  • Role: Admin
  • Route URL: GET /refkeys/:refkey
  • Parameters: No parameters.
  • Body: No body.
  • Responses:
    • 400 If invalid params.
    • 404 If refkey not found.
    • 200 If succeeded. With body containing its data in the format:
{
  "id": "number",
  "metric-id": "number"
  "refkey": "string"
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateHandler

func CreateHandler(api *api.API, containerType container.ContainerType) func(c *gin.Context)

Creates a metric reference key. Responses:

  • 400 If invalid body.
  • 400 If json fields are invalid.
  • 404 If metric not found.
  • 400 If refkey already exists.
  • 200 If succeeded.

func DeleteHandler

func DeleteHandler(api *api.API) func(c *gin.Context)

Deletes a metric reference key. Responses:

  • 404 If metric not found.
  • 200 If succeeded.

func GetHandler

func GetHandler(api *api.API) func(c *gin.Context)

Get a metric reference key. Responses:

  • 404 If metric not found.
  • 200 If succeeded.

func MGetHandler

func MGetHandler(api *api.API) func(c *gin.Context)

Get all references key of a metric. Responses:

  • 404 If metric not found.
  • 200 If succeeded.

func UpdateHandler

func UpdateHandler(api *api.API, containerType container.ContainerType) func(c *gin.Context)

Updates a metric reference key. Responses:

  • 400 If invalid body.
  • 400 If json fields are invalid.
  • 404 If metric not found.
  • 400 If refkey already exists.
  • 200 If succeeded.

Types

This section is empty.

Jump to

Keyboard shortcuts

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