api

package
v0.40.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package api provides an API client sdk for making requests to a haul API server

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiClient added in v0.31.0

type ApiClient struct {
	Key      string
	Host     string
	Port     int
	Protocol string
}

func NewApiClient added in v0.31.0

func NewApiClient(key, host, protocol string, port int) *ApiClient

func NewApiClientFromViper added in v0.31.0

func NewApiClientFromViper() (*ApiClient, error)

func (*ApiClient) Call added in v0.31.0

func (a *ApiClient) Call(method, route string, requestBody io.Reader, useKey bool) (*http.Response, error)

func (*ApiClient) ClearAssetTarget added in v0.31.0

func (a *ApiClient) ClearAssetTarget(assetID int64) (responses.DeleteAssetTargetResponse, error)

func (*ApiClient) DeleteAsset added in v0.31.0

func (a *ApiClient) DeleteAsset(assetID int64) (responses.DeleteAssetResponse, error)

func (*ApiClient) GetAssetAttributes added in v0.33.0

func (a *ApiClient) GetAssetAttributes(assetID int64) (responses.GetAssetAttributesResponse, error)

func (*ApiClient) GetAssetDescription added in v0.31.0

func (a *ApiClient) GetAssetDescription(assetID int64) (responses.GetAssetDescriptionResponse, error)

func (*ApiClient) GetAssetStatus added in v0.31.0

func (a *ApiClient) GetAssetStatus(assetID int64) (responses.GetAssetStatusResponse, error)

func (*ApiClient) GetAssetTarget added in v0.31.0

func (a *ApiClient) GetAssetTarget(assetID int64) (responses.GetAssetTargetResponse, error)

func (*ApiClient) GetAssets added in v0.31.0

func (a *ApiClient) GetAssets(deleted bool) (responses.GetAssetsResponse, error)

func (*ApiClient) GetAssetsAttributes added in v0.33.0

func (a *ApiClient) GetAssetsAttributes() (responses.GetAssetsAttributesResponse, error)

func (*ApiClient) GetAttributes added in v0.33.0

func (a *ApiClient) GetAttributes() (responses.GetAttributesResponse, error)

func (*ApiClient) GetEvents added in v0.31.0

func (a *ApiClient) GetEvents() (responses.GetEventsResponse, error)

func (*ApiClient) GetHealth added in v0.31.0

func (a *ApiClient) GetHealth() (responses.GetHealthcheckResponse, error)

GetHealth allows checking for API server health

func (*ApiClient) InsertAssetAttributes added in v0.33.0

func (a *ApiClient) InsertAssetAttributes(assetAttributes []models.AssetAttribute) (responses.PostAssetAttributesResponse, error)

func (*ApiClient) InsertAssets added in v0.31.0

func (a *ApiClient) InsertAssets(assets []models.Asset) (responses.PostAssetsResponse, error)

func (*ApiClient) InsertAttributes added in v0.33.0

func (a *ApiClient) InsertAttributes(attributes []models.Attribute) (responses.PostAttributesResponse, error)

func (*ApiClient) RestoreAsset added in v0.31.0

func (a *ApiClient) RestoreAsset(assetID int64) (responses.RestoreAssetResponse, error)

func (*ApiClient) Seed added in v0.31.0

Seed allows creating the required tables in the database

func (*ApiClient) UpdateAssetDescription added in v0.31.0

func (a *ApiClient) UpdateAssetDescription(assetID int64, description string) (responses.PutAssetDescriptionResponse, error)

func (*ApiClient) UpdateAssetStatus added in v0.31.0

func (a *ApiClient) UpdateAssetStatus(assetID int64, status string) (responses.PutAssetStatusResponse, error)

func (*ApiClient) UpdateAssetTarget added in v0.31.0

func (a *ApiClient) UpdateAssetTarget(assetID, target int64) (responses.PutAssetTargetResponse, error)

Jump to

Keyboard shortcuts

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