labcloud

package
v0.0.0-...-d72ab3e Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	Application  string `json:"application"`
	CommitSHA    string `json:"commit_sha"`
	DownloadHref string `json:"download_href"`
}

Application describes the properties of an application

func ReadLatestApplication

func ReadLatestApplication(applicationName string, releaseChannel string) Application

ReadLatestApplication will return the properties of an application

type ApplicationResponse

type ApplicationResponse struct {
	Data Application `json:"data"`
}

ApplicationResponse is an intermediate struct for the properties of a user

type ConflictResponse

type ConflictResponse struct {
	Error string `json:"error"`
	ID    string `json:"id"`
}

ConflictResponse occurs if an entity already exists.

type HealthResponse

type HealthResponse struct {
	Started string `json:"started"`
	Tag     string `json:"tag"`
}

HealthResponse describes the state of the server

func Health

func Health() (res HealthResponse)

Health returns the health of the API server.

type Machine

type Machine struct {
	Permission string   `json:"permission"`
	Status     string   `json:"status"`
	Node       string   `json:"node"`
	User       string   `json:"user"`
	Job        string   `json:"job"`
	Number     int      `json:"number"`
	Attributes []string `json:"attributes"`
	Created    string   `json:"created"`
	Updated    string   `json:"updated"`
	ID         string   `json:"id"`
}

Machine describes the properties of a machine

func ReadMachine

func ReadMachine(ID string) Machine

ReadMachine reads the properties of a machine

func UpdateMachineStatus

func UpdateMachineStatus(ID string, status string) Machine

UpdateMachineStatus updates the status of a machine

func UpdateMachineUser

func UpdateMachineUser(ID string, userID string) Machine

UpdateMachineUser updates the user of the machine and sets the status to busy.

type MachineResponse

type MachineResponse struct {
	Data Machine `json:"data"`
}

MachineResponse is an intermediate struct for the properties of a machine

type MachineStatus

type MachineStatus struct {
	Status string `json:"status"`
}

MachineStatus describes the status of a machine

type MachineUser

type MachineUser struct {
	User   string `json:"user"`
	Status string `json:"status"`
}

MachineUser describes the user of a machine

type Node

type Node struct {
	ApplicationName    string   `json:"application_name"`
	ApplicationVersion string   `json:"application_version"`
	Capabilities       []string `json:"capabilities"`
	Created            string   `json:"created"`
	ID                 string   `json:"id"`
	MACAddress         string   `json:"mac_address"`
	Machine            string   `json:"machine"`
	OperatingSystem    string   `json:"operating_system"`
	ReleaseChannel     string   `json:"release_channel"`
	Roles              []string `json:"roles"`
	SerialNumber       string   `json:"serial_number"`
	Sessions           []string `json:"sessions"`
	Updated            string   `json:"updated"`
}

Node describes the properties of a node

func CreateOrReadNode

func CreateOrReadNode(nodeInfo NodeInfo) Node

CreateOrReadNode creates a new node, which has to be unique by its combination of MAC and serial number. If the node already exists, it will read the node from the API.

func ReadNode

func ReadNode(ID string) Node

ReadNode reads the node identified by the ID.

func UpdateNode

func UpdateNode(ID string, node Node) Node

UpdateNode updates the node identified by the ID.

type NodeApplicationUpdate

type NodeApplicationUpdate struct {
	ApplicationVersion string `json:"application_version"`
	ApplicationName    string `json:"application_name"`
}

NodeApplicationUpdate describes the application version of the node.

type NodeInfo

type NodeInfo struct {
	ApplicationVersion string `json:"application_version"`
	ApplicationName    string `json:"application_name"`
	MACAddress         string `json:"mac_address"`
	SerialNumber       string `json:"serial_number"`
	OperatingSystem    string `json:"operating_system"`
}

NodeInfo describes a device that is managed by the LabCloud platform.

type NodeResponse

type NodeResponse struct {
	Data Node `json:"data"`
}

NodeResponse describes the properties of an existing node

type Permission

type Permission struct {
	Description  string `json:"description"`
	Scheduling   string `json:"scheduling"`
	Workflow     string `json:"workflow"`
	Default      bool   `json:"open"`
	Abbreviation string `json:"abbreviation"`
	Name         string `json:"name"`
	Image        string `json:"image"`
	Created      string `json:"created"`
	Updated      string `json:"updated"`
	ID           string `json:"id"`
}

Permission describes the properties of a permission

func ReadPermission

func ReadPermission(ID string) Permission

ReadPermission reads the properties of a permission

type PermissionResponse

type PermissionResponse struct {
	Data Permission `json:"data"`
}

PermissionResponse is an intermediate struct for the properties of a permission

type Session

type Session struct {
	Authorized bool   `json:"authorized"`
	Created    string `json:"created"`
	ID         string `json:"id"`
	Identify   bool   `json:"identify"`
	Node       string `json:"node"`
	Seen       string `json:"seen"`
	Token      string `json:"token"`
	Updated    string `json:"updated"`
}

Session describes the properties of a session

func CreateSession

func CreateSession(ID string) Session

CreateSession creates a new session for the node specified by the ID

func ReadSession

func ReadSession(ID string, sessionID string) Session

ReadSession reads the properties of an existing session

type SessionResponse

type SessionResponse struct {
	Data Session `json:"data"`
}

SessionResponse is an intermediate struct for the properties of a session

type User

type User struct {
	ID          string   `json:"id"`
	AzureID     string   `json:"azure_id"`
	CardID      string   `json:"card_id"`
	CardNumber  string   `json:"card_number"`
	Created     string   `json:"created"`
	DisplayName string   `json:"display_name"`
	Email       string   `json:"email"`
	FirstName   string   `json:"first_name"`
	LastName    string   `json:"last_name"`
	Permissions []string `json:"permissions"`
	Role        string   `json:"role"`
	Updated     string   `json:"updated"`
}

User describes the properties of a user

func ReadUser

func ReadUser(ID string) User

ReadUser reads the properties of a user

type UserResponse

type UserResponse struct {
	Data User `json:"data"`
}

UserResponse is an intermediate struct for the properties of a user

Jump to

Keyboard shortcuts

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