stl

package
v0.78.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: MIT Imports: 9 Imported by: 1

Documentation

Overview

Package stl provides support for HSDP STL services

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppFirewallException

type AppFirewallException struct {
	DeviceID int64 `json:"deviceId,omitempty"`
	TCP      []int `json:"tcp"`
	UDP      []int `json:"udp"`
}

type AppLogging

type AppLogging struct {
	DeviceID         int64  `json:"deviceId,omitempty"`
	RawConfig        string `json:"rawConfig"`
	HSDPLogging      bool   `json:"hsdpLogging"`
	HSDPIngestorHost string `json:"hsdpIngestorHost"`
	HSDPSharedKey    string `json:"hsdpSharedKey"`
	HSDPSecretKey    string `json:"hsdpSecretKey"`
	HSDPProductKey   string `json:"hsdpProductKey"`
	HSDPCustomField  *bool  `json:"hsdpCustomField,omitempty"`
}

type AppResource

type AppResource struct {
	ID       int64  `json:"id"`
	DeviceID int64  `json:"deviceId"`
	Name     string `json:"name"`
	Content  string `json:"content"`
}

type AppsService

type AppsService struct {
	// contains filtered or unexported fields
}

func (*AppsService) CreateAppResource

func (a *AppsService) CreateAppResource(ctx context.Context, input CreateApplicationResourceInput) (*AppResource, error)

func (*AppsService) DeleteAppResource

func (a *AppsService) DeleteAppResource(ctx context.Context, input DeleteApplicationResourceInput) (bool, error)

func (*AppsService) GetAppResourceByDeviceIDAndName

func (a *AppsService) GetAppResourceByDeviceIDAndName(ctx context.Context, deviceID int64, name string) (*AppResource, error)

func (*AppsService) GetAppResourceByID

func (a *AppsService) GetAppResourceByID(ctx context.Context, id int64) (*AppResource, error)

func (*AppsService) GetAppResourcesBySerial

func (a *AppsService) GetAppResourcesBySerial(ctx context.Context, serial string) (*[]AppResource, error)

func (*AppsService) UpdateAppResource

func (a *AppsService) UpdateAppResource(ctx context.Context, input UpdateApplicationResourceInput) (*AppResource, error)

type CertsService

type CertsService struct {
	// contains filtered or unexported fields
}

func (*CertsService) CreateCustomCert

func (a *CertsService) CreateCustomCert(ctx context.Context, input CreateAppCustomCertInput) (*CustomCert, error)

func (*CertsService) DeleteCustomCert

func (a *CertsService) DeleteCustomCert(ctx context.Context, input DeleteAppCustomCertInput) (bool, error)

func (*CertsService) GetCustomCertByID

func (a *CertsService) GetCustomCertByID(ctx context.Context, id int64) (*CustomCert, error)

func (*CertsService) GetCustomCertsBySerial

func (a *CertsService) GetCustomCertsBySerial(ctx context.Context, serial string) (*[]CustomCert, error)

func (*CertsService) UpdateCustomCert

func (a *CertsService) UpdateCustomCert(ctx context.Context, input UpdateAppCustomCertInput) (*CustomCert, error)

type Client

type Client struct {

	// User agent used when communicating with the HSDP Edge API.
	UserAgent string

	Devices *DevicesService
	Apps    *AppsService
	Config  *ConfigService
	Certs   *CertsService
	// contains filtered or unexported fields
}

A Client manages communication with HSDP Edge API

func NewClient

func NewClient(consoleClient *console.Client, config *Config) (*Client, error)

NewClient returns a new HSDP Edge API consoleClient. Configured console and IAM clients must be provided as the underlying API requires tokens from respective services

func (*Client) Close

func (c *Client) Close()

Close releases allocated resources of clients

func (*Client) Query

func (c *Client) Query(ctx context.Context, q interface{}, variables map[string]interface{}) error

Query is a generic GraphQL query

type Config

type Config struct {
	Region      string
	Environment string
	STLAPIURL   string
	DebugLog    string
}

Config contains the configuration of a consoleClient

type ConfigService

type ConfigService struct {
	// contains filtered or unexported fields
}

func (*ConfigService) GetAppLoggingBySerial

func (c *ConfigService) GetAppLoggingBySerial(ctx context.Context, serial string) (*AppLogging, error)

func (*ConfigService) GetFirewallExceptionsBySerial

func (c *ConfigService) GetFirewallExceptionsBySerial(ctx context.Context, serial string) (*AppFirewallException, error)

func (*ConfigService) UpdateAppFirewallExceptions

func (c *ConfigService) UpdateAppFirewallExceptions(ctx context.Context, input UpdateAppFirewallExceptionInput) (*AppFirewallException, error)

func (*ConfigService) UpdateAppLogging

func (c *ConfigService) UpdateAppLogging(ctx context.Context, input UpdateAppLoggingInput) (*AppLogging, error)

type CreateAppCustomCertInput

type CreateAppCustomCertInput struct {
	CustomCert
	SerialNumber string `json:"serialNumber"`
}

type CreateApplicationResourceInput

type CreateApplicationResourceInput struct {
	SerialNumber string `json:"serialNumber"`
	Name         string `json:"name"`
	Content      string `json:"content"`
	IsLocked     bool   `json:"isLocked"`
}

type CustomCert

type CustomCert struct {
	ID       int64  `json:"id"`
	DeviceID int64  `json:"deviceId,omitempty"`
	Name     string `json:"name"`
	Key      string `json:"key"`
	Cert     string `json:"cert"`
}

type DeleteAppCustomCertInput

type DeleteAppCustomCertInput struct {
	ID int64 `json:"id"`
}

type DeleteApplicationResourceInput

type DeleteApplicationResourceInput struct {
	ID           int64  `json:"id"`
	Name         string `json:"name"`
	SerialNumber string `json:"serialNumber"`
	DeviceID     int64  `json:"deviceId"`
	GroupID      string `json:"groupId"`
}

type Device

type Device struct {
	ID               int64
	Name             string
	State            string
	Region           string
	SerialNumber     string
	PrimaryInterface struct {
		Name    string
		Address string
	}
}

Device represents a STL device

type DevicesService

type DevicesService struct {
	// contains filtered or unexported fields
}

func (*DevicesService) GetDeviceByID

func (d *DevicesService) GetDeviceByID(ctx context.Context, id int64) (*Device, error)

GetDeviceByID retrieves a device by serial

func (*DevicesService) GetDeviceBySerial

func (d *DevicesService) GetDeviceBySerial(ctx context.Context, serial string) (*Device, error)

GetDeviceBySerial retrieves a device by serial

func (*DevicesService) SyncDeviceConfig

func (d *DevicesService) SyncDeviceConfig(ctx context.Context, serial string) error

type OptionFunc

type OptionFunc func(*http.Request) error

OptionFunc is the function signature function for options

type SyncDeviceConfigsInput

type SyncDeviceConfigsInput struct {
	SerialNumber string `json:"serialNumber"`
}

type UpdateAppCustomCertInput

type UpdateAppCustomCertInput struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
	Key  string `json:"key"`
	Cert string `json:"cert"`
}

type UpdateAppFirewallExceptionInput

type UpdateAppFirewallExceptionInput struct {
	AppFirewallException
	SerialNumber string `json:"serialNumber"`
}

type UpdateAppLoggingInput

type UpdateAppLoggingInput struct {
	AppLogging
	SerialNumber string `json:"serialNumber"`
}

func (UpdateAppLoggingInput) Validate

func (u UpdateAppLoggingInput) Validate() (bool, error)

type UpdateApplicationResourceInput

type UpdateApplicationResourceInput struct {
	ID           int64  `json:"id"`
	DeviceID     int64  `json:"deviceId"`
	SerialNumber string `json:"serialNumber"`
	GroupID      string `json:"groupId"`
	Name         string `json:"name"`
	Content      string `json:"content"`
	IsLocked     bool   `json:"isLocked"`
}

Jump to

Keyboard shortcuts

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