gog5k

package module
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: BSD-3-Clause, MIT Imports: 14 Imported by: 1

README

gog5k

Documentation

Index

Constants

View Source
const (
	// DeploymentTerminatedState Terminated status
	DeploymentTerminatedState = "terminated"
	// DeploymentErrorState Error status
	DeploymentErrorState = "error"
)
View Source
const (
	//OARJobRunningState Running state
	OARJobRunningState = "running"
	//OARJobWaitingState Waiting state
	OARJobWaitingState = "waiting"
	//OARJobTerminatedState Terminated state
	OARJobTerminatedState = "terminated"
	//OARJobErrorState Error state
	OARJobErrorState = "error"
)

Variables

This section is empty.

Functions

func CheckResponse

func CheckResponse(r *http.Response) error

CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range. API error responses are expected to have either no response body, or a JSON response body that maps to ErrorResponse. Any other response body will be silently ignored.

func DoRequest

func DoRequest(ctx context.Context, req *http.Request) (*http.Response, error)

DoRequest submits an HTTP request.

func DoRequestWithClient

func DoRequestWithClient(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error)

DoRequestWithClient submits an HTTP request using the specified client.

Types

type Architecture

type Architecture struct {
	PlatformType     string `json:"platform_type"`
	ProcessorsCount  int16  `json:"nb_procs"`
	CoresCount       int16  `json:"nb_cores"`
	ThreadsCount     int16  `json:"nb_threads"`
	CPUCoreNumbering string `json:"cpu_core_numbering"`
}

Architecture represent a node architecture

type ArgError

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

ArgError is an error that represents an error with an input to go. It identifies the argument and the cause (if possible).

func NewArgError

func NewArgError(arg, reason string) *ArgError

NewArgError creates an InputError.

func (*ArgError) Error

func (e *ArgError) Error() string

type BIOS

type BIOS struct {
	Vendor      string `json:"vendor,omitempty"`
	ReleaseDate string `json:"release_date,omitempty"`
}

BIOS represent a node BIOS information

type BasicAuthTransport

type BasicAuthTransport struct {
	Username      string // Grid5000 username
	Password      string // Grid5000 password
	RestfullyFile string // Restfully config file

	// Transport is the underlying HTTP transport to use when making requests.
	// It will default to http.DefaultTransport if nil.
	Transport http.RoundTripper
}

BasicAuthTransport is an http.RoundTripper that authenticates all requests using HTTP Basic Authentication with the provided username and password.

func (*BasicAuthTransport) Client

func (t *BasicAuthTransport) Client() *http.Client

Client returns an *http.Client that makes requests that are authenticated using HTTP Basic Authentication.

func (*BasicAuthTransport) RestfullyClient

func (t *BasicAuthTransport) RestfullyClient() *http.Client

RestfullyClient return an *httpClient that makes requests that are authenticated using HTTP Basic Authentication based on restfully config.

func (*BasicAuthTransport) RoundTrip

func (t *BasicAuthTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements the RoundTripper interface.

type CSODAuth

type CSODAuth struct {
	Entity       string               `json:"entity"`
	Key          string               `json:"key"`
	Capabilities CSODAuthCapabilities `json:"caps"`
}

CSODAuth represent a Cephx auth

type CSODAuthCapabilities

type CSODAuthCapabilities struct {
	MON string `json:"mon"`
	OSD string `json:"osd"`
}

CSODAuthCapabilities represent a Cephx auth capabilities

type CSODPool

type CSODPool struct {
	Pool           int       `json:"pool"`
	PoolName       string    `json:"pool_name"`
	Size           int       `json:"size"`
	QuotaMaxBytes  int64     `json:"quota_max_bytes"`
	ExpirationDate time.Time `json:"expiration_date"`
}

CSODPool represent a Ceph pool

type CSODPoolCreateRequest

type CSODPoolCreateRequest struct {
	PoolName       string    `json:"poolName"`
	Size           int       `json:"size"`
	QuotaMaxBytes  int64     `json:"quota"`
	ExpirationDate time.Time `json:"expiration_date"`
}

CSODPoolCreateRequest represent a request to create a Ceph pool

type CSODService

type CSODService interface {
	GetAuth(ctx context.Context, siteName string, userName string) (*CSODAuth, *Response, error)
	ListPools(ctx context.Context, siteName string) ([]CSODPool, *Response, error)
	GetPool(ctx context.Context, siteName string, poolname string) (*CSODPool, *Response, error)
	CreatePool(ctx context.Context, siteName string, createRequest *CSODPoolCreateRequest) (*Response, error)
	DeletePool(ctx context.Context, siteName string, poolName string) (*Response, error)
	UpdatePool(ctx context.Context, siteName string, updateRequest *CSODPool) (*Response, error)
}

CSODService is an interface for interfacing with the ceph storage endpoint of the Grid5000 API

type CSODServiceOp

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

CSODServiceOp handles communication with the ceph related methods of the Grid5000 API

func (*CSODServiceOp) CreatePool

func (s *CSODServiceOp) CreatePool(ctx context.Context, siteName string, createRequest *CSODPoolCreateRequest) (*Response, error)

CreatePool create a ceph pool

func (*CSODServiceOp) DeletePool

func (s *CSODServiceOp) DeletePool(ctx context.Context, siteName string, poolName string) (*Response, error)

DeletePool delete a ceph pool

func (*CSODServiceOp) GetAuth

func (s *CSODServiceOp) GetAuth(ctx context.Context, siteName string, userName string) (*CSODAuth, *Response, error)

GetAuth retrieve a Cephx auth

func (*CSODServiceOp) GetPool

func (s *CSODServiceOp) GetPool(ctx context.Context, siteName string, poolname string) (*CSODPool, *Response, error)

GetPool retrieve a ceph pool

func (*CSODServiceOp) ListPools

func (s *CSODServiceOp) ListPools(ctx context.Context, siteName string) ([]CSODPool, *Response, error)

ListPools retrive ceph pool list

func (*CSODServiceOp) UpdatePool

func (s *CSODServiceOp) UpdatePool(ctx context.Context, siteName string, updateRequest *CSODPool) (*Response, error)

UpdatePool update a ceph pool

type Chassis

type Chassis struct {
	Name         string `json:"name"`
	Manufacturer string `json:"manufacturer,omitempty"`
	Serial       string `json:"serial,omitempty"`
}

Chassis represent a node chassis

type Client

type Client struct {
	BaseURL   *url.URL
	UserAgent string

	// Services used for communicating with the API
	Sites       SitesService
	Clusters    ClustersService
	Nodes       NodesService
	Vlans       VlansService
	OARJobs     OARJobsService
	Deployments DeploymentsService
	PDUs        PDUsService
	CSOD        CSODService
	Firewall    FirewallService
	// contains filtered or unexported fields
}

Client manages communication with Grid5000 stable API

func New

func New(httpClient *http.Client, opts ...ClientOpt) (*Client, error)

New returns a new Grid5000 API client instance.

func NewClient

func NewClient(httpClient *http.Client) *Client

NewClient returns a new Grid5000 API client, using the given http.Client to perform all requests.

Users who wish to pass their own http.Client should use this method. If you're in need of further customization, the gog5k.New method allows more options, such as setting a custom URL or a custom user agent string.

func (*Client) Do

func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*Response, error)

Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response will be written to v, without attempting to decode it.

func (*Client) NewRequest

func (c *Client) NewRequest(ctx context.Context, method, urlStr string, body interface{}) (*http.Request, error)

NewRequest creates an API request. A relative URL can be provided in urlStr, which will be resolved to the BaseURL of the Client. Relative URLS should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included in as the request body.

func (*Client) OnRequestCompleted

func (c *Client) OnRequestCompleted(rc RequestCompletionCallback)

OnRequestCompleted sets the Grid5000 API request completion callback

type ClientOpt

type ClientOpt func(*Client) error

ClientOpt are options for New.

func SetBaseURL

func SetBaseURL(bu string) ClientOpt

SetBaseURL is a client option for setting the base URL.

func SetUserAgent

func SetUserAgent(ua string) ClientOpt

SetUserAgent is a client option for setting the user agent.

type Cluster

type Cluster struct {
	UID    string   `json:"uid"`
	Queues []string `json:"queues,omitempty"`
	Model  string   `json:"model,omitempty"`
	Kavlan bool     `json:"kavlan,omitempty"`
}

Cluster represent a Grid5000 cluster

type ClustersService

type ClustersService interface {
	List(ctx context.Context, site string) ([]Cluster, *Response, error)
}

ClustersService is an interface for interfacing with the clusters endpoint of the Grid5000 API

type ClustersServiceOp

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

ClustersServiceOp handles communication with cluster related methods of the Grid5000 API

func (*ClustersServiceOp) List

func (s *ClustersServiceOp) List(ctx context.Context, site string) ([]Cluster, *Response, error)

List lists all available clusters by site

type Deployment

type Deployment struct {
	ID          string `json:"uid"`
	Status      string `json:"status"`
	User        string `json:"user_uid"`
	Environment string `json:"environment"`
	Key         string `json:"key,omitempty"`
	CreatedAt   int32  `json:"created_at"`
	UpdatedAt   int32  `json:"updated_at"`
}

Deployment respresent a Grid5000 Kadeploy deployment

type DeploymentCreateRequest

type DeploymentCreateRequest struct {
	Environment     string   `json:"environment"`
	Key             string   `json:"key,omitempty"`
	Nodes           []string `json:"nodes"`
	Vlan            int16    `json:"vlan,omitempty"`
	PartitionNumber int      `json:"partition_number,omitempty"`
	BlockDevice     string   `json:"block_device,omitempty"`
}

DeploymentCreateRequest represents a request to create a Kadeploy deployment

type DeploymentsService

type DeploymentsService interface {
	List(ctx context.Context, siteName string) ([]Deployment, *Response, error)
	Get(ctx context.Context, siteName string, deploymentID string) (*Deployment, *Response, error)
	Create(ctx context.Context, siteName string, createRequest *DeploymentCreateRequest) (*Deployment, *Response, error)
	WaitForState(ctx context.Context, siteName string, deploymentID string, state string) (*Deployment, error)
}

DeploymentsService is an interface for interfacing with the Kadeploy endpoint of the Grid5000 API

type DeploymentsServiceOp

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

DeploymentsServiceOp handles communication with deployments related methods of the Grid5000 API.

func (*DeploymentsServiceOp) Create

func (s *DeploymentsServiceOp) Create(ctx context.Context, siteName string, createRequest *DeploymentCreateRequest) (*Deployment, *Response, error)

Create Submit a Kadeploy deployment

func (*DeploymentsServiceOp) Get

func (s *DeploymentsServiceOp) Get(ctx context.Context, siteName string, deploymentID string) (*Deployment, *Response, error)

Get restrieve a Kadeploy deployments by ID

func (*DeploymentsServiceOp) List

func (s *DeploymentsServiceOp) List(ctx context.Context, siteName string) ([]Deployment, *Response, error)

List lists all Kadeploy deployments

func (*DeploymentsServiceOp) WaitForState

func (s *DeploymentsServiceOp) WaitForState(ctx context.Context, siteName string, deploymentID string, state string) (*Deployment, error)

WaitForState get deployment state until desired state

type ErrorResponse

type ErrorResponse struct {
	// HTTP response that caused this error
	Response *http.Response

	// Error message
	Message string `json:"message"`

	// RequestID returned from the API, useful to contact support.
	RequestID string `json:"request_id"`
}

An ErrorResponse reports the error caused by an API request

func (*ErrorResponse) Error

func (r *ErrorResponse) Error() string

type Firewall added in v0.0.9

type Firewall struct {
	Dest     []string `json:"addr"`
	Ports    []int    `json:"port,omitempty"`
	Protocol string   `json:"proto,omitempty"`
	Src      []string `json:"src_addr,omitempty"`
}

Firewall represent a firewal opening

type FirewallService added in v0.0.9

type FirewallService interface {
	Create(ctx context.Context, siteName string, jobID int32, createRequest []*Firewall) (*Response, error)
	Delete(ctx context.Context, siteName string, jobID int32) (*Response, error)
	Get(ctx context.Context, siteName string, jobID int32) ([]Firewall, *Response, error)
}

FirewallService is an interface for interacting with the firewall endpoint of the Grid'5000 API

type FirewallServiceOp added in v0.0.9

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

FirewallServiceOp handles communication with the firewall related methods of the Grid'5000 API

func (*FirewallServiceOp) Create added in v0.0.9

func (s *FirewallServiceOp) Create(ctx context.Context, siteName string, jobID int32, createRequest []*Firewall) (*Response, error)

func (*FirewallServiceOp) Delete added in v0.0.9

func (s *FirewallServiceOp) Delete(ctx context.Context, siteName string, jobID int32) (*Response, error)

func (*FirewallServiceOp) Get added in v0.0.9

func (s *FirewallServiceOp) Get(ctx context.Context, siteName string, jobID int32) ([]Firewall, *Response, error)

type GPUDevice added in v0.0.9

type GPUDevice struct {
	CPUAffinity int    `json:"cpu_affinity,omitempty"`
	Device      string `json:"device,omitempty"`
	Memory      int64  `json:"memory,omitempty"`
	Model       string `json:"model,omitempty"`
	// See : https://intranet.grid5000.fr/bugzilla/show_bug.cgi?id=11500
	//PowerDefaultLimit string `json:"power_default_limit,omitempty"`
	VBIOSVersion string `json:"vbios_version,omitempty"`
	Vendor       string `json:"vendor,omitempty"`
}

GPUDevice represent GPU device informations

type GPUDevices added in v0.0.9

type GPUDevices map[string]GPUDevice

GPUDevices represent a map of GPUDevice

type ListOARJobsOptions

type ListOARJobsOptions struct {
	User  string `url:"user,omitempty"`
	State string `url:"state,omitempty"`
}

ListOARJobsOptions struct for options on OAR jobs list

type MainMemory

type MainMemory struct {
	RAMSize int64 `json:"ram_size"`
}

MainMemory represent a node memory information

type NetworkAdapter

type NetworkAdapter struct {
	Name            string `json:"name,omitempty"`
	Device          string `json:"device"`
	Mounted         bool   `json:"mounted"`
	Mountable       bool   `json:"mountable"`
	Enabled         bool   `json:"enabled"`
	IP              string `json:"ip,omitempty"`
	IP6             string `json:"ip6,omitempty"`
	Driver          string `json:"driver,omitempty"`
	Vendor          string `json:"vendor,omitempty"`
	Switch          string `json:"switch,omitempty"`
	Bridged         bool   `json:"bridged,omitempty"`
	FirmwareVersion string `json:"firmware_version,omitempty"`
	MAC             string `json:"mac,omitempty"`
	Interface       string `json:"interface,omitempty"`
	Kavlan          bool   `json:"kavlan,omitempty"`
	NetworkAddress  string `json:"network_address,omitempty"`
	SwitchPort      string `json:"switch_port,omitempty"`
	Model           string `json:"model,omitempty"`
	Management      bool   `json:"management,omitempty"`
	Rate            int64  `json:"rate,omitempty"`
}

NetworkAdapter represent a node network adapter

type Node

type Node struct {
	UID               string            `json:"uid"`
	NetworkAdapters   []NetworkAdapter  `json:"network_adapters"`
	StorageDevices    []StorageDevice   `json:"storage_devices"`
	Chassis           Chassis           `json:"chassis"`
	Architecture      Architecture      `json:"architecture"`
	BIOS              BIOS              `json:"bios,omitempty"`
	MainMemory        MainMemory        `json:"main_memory"`
	Processor         Processor         `json:"processor"`
	GPUDevices        GPUDevices        `json:"gpu_devices,omitempty"`
	BMCVersion        string            `json:"bmc_version,omitempty"`
	Performance       Performance       `json:"performance,omitempty"`
	OperatingSystem   OperatingSystem   `json:"operating_system,omitempty"`
	Exotic            bool              `json:"exotic,omitempty"`
	SupportedJobTypes SupportedJobTypes `json:"supported_job_types,omitempty"`
}

Node represent a Grid5000 node

type NodesService

type NodesService interface {
	Get(ctx context.Context, siteName string, hostName string) (*Node, *Response, error)
	List(ctx context.Context, siteName string, clusterName string) ([]Node, *Response, error)
}

NodesService is an interface for interfacing with the nodes endpoint of the Grid5000 API

type NodesServiceOp

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

NodesServiceOp handles communication with nodes related methods of the Grid5000 API

func (*NodesServiceOp) Get

func (s *NodesServiceOp) Get(ctx context.Context, siteName string, hostName string) (*Node, *Response, error)

Get retrieves a node

func (*NodesServiceOp) List added in v0.0.9

func (s *NodesServiceOp) List(ctx context.Context, site string, clusterName string) ([]Node, *Response, error)

List lists all available clusters by site

type OARJob

type OARJob struct {
	State           string                `json:"state"`
	Name            string                `json:"name,omitempty"`
	Queue           string                `json:"queue,omitempty"`
	Properties      string                `json:"propertie,omitempty"`
	Message         string                `json:"message,omitempty"`
	UserUID         string                `json:"user_uid"`
	Events          []OARJobEvent         `json:"events,omitempty"`
	User            string                `json:"user"`
	SubmittedAt     int32                 `json:"submitted_at,omitempty"`
	Types           []string              `json:"types,omitempty"`
	Mode            string                `json:"mode,omitempty"`
	StoppedAt       int32                 `json:"stopped_at,omitempty"`
	StartedAt       int32                 `json:"started_at,omitempty"`
	ScheduledAt     int32                 `json:"scheduled_at,omitempty"`
	Walltime        int32                 `json:"walltime,omitempty"`
	ID              int32                 `json:"uid"`
	Project         string                `json:"project,omitempty"`
	Command         string                `json:"command,omitempty"`
	Directory       string                `json:"directory,omitempty"`
	AssignedNodes   []string              `json:"assigned_nodes,omitempty"`
	ResourcesByType OARJobResourcesByType `json:"resources_by_type,omitempty"`
}

OARJob represent a Grid5000 OAR job

type OARJobCreateRequest

type OARJobCreateRequest struct {
	Name        string   `json:"name,omitempty"`
	Resources   string   `json:"resources,omitempty"`
	Command     string   `json:"command"`
	Types       []string `json:"types,omitempty"`
	Properties  string   `json:"properties,omitempty"`
	Reservation string   `json:"reservation,omitempty"`
}

OARJobCreateRequest represents a request to create a OAR job.

type OARJobEvent

type OARJobEvent struct {
	UID         int32  `json:"uid"`
	Type        string `json:"type"`
	CreatedAt   int32  `json:"created_at"`
	Description string `json:"description"`
}

OARJobEvent respresent a OAR job event

type OARJobResourcesByType

type OARJobResourcesByType struct {
	Vlans   []string `json:"vlans"`
	Subnets []string `json:"subnets"`
	Disks   []string `json:"disks"`
}

OARJobResourcesByType represent a assigned resources by type

type OARJobsService

type OARJobsService interface {
	List(ctx context.Context, siteName string, opts *ListOARJobsOptions) ([]OARJob, *Response, error)
	Get(ctx context.Context, siteName string, jobID int32) (*OARJob, *Response, error)
	Create(ctx context.Context, siteName string, createRequest *OARJobCreateRequest) (*OARJob, *Response, error)
	Delete(ctx context.Context, siteName string, jobID int32) (*Response, error)
	WaitForState(ctx context.Context, siteName string, jobID int32, state string) (*OARJob, error)
}

OARJobsService is an interface for interfacing with the OAR jobs endpoint of the Grid5000 API

type OARJobsServiceOp

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

OARJobsServiceOp handles communication with the site related methods of the Grid5000 API.

func (*OARJobsServiceOp) Create

func (s *OARJobsServiceOp) Create(ctx context.Context, siteName string, createRequest *OARJobCreateRequest) (*OARJob, *Response, error)

Create Submit a Grid5000 OAR job

func (*OARJobsServiceOp) Delete

func (s *OARJobsServiceOp) Delete(ctx context.Context, siteName string, jobID int32) (*Response, error)

Delete a OAR job.

func (*OARJobsServiceOp) Get

func (s *OARJobsServiceOp) Get(ctx context.Context, siteName string, jobID int32) (*OARJob, *Response, error)

Get retrieves a OAR job by ID.

func (*OARJobsServiceOp) List

func (s *OARJobsServiceOp) List(ctx context.Context, site string, opts *ListOARJobsOptions) ([]OARJob, *Response, error)

List lists all OAR jobs

func (*OARJobsServiceOp) WaitForState

func (s *OARJobsServiceOp) WaitForState(ctx context.Context, siteName string, jobID int32, state string) (*OARJob, error)

WaitForState get Job state until desired state

type OperatingSystem

type OperatingSystem struct {
	TurboBoostEnabled     bool   `json:"turboboost_enabled,omitempty"`
	CStateDriver          string `json:"cstate_driver,omitempty"`
	CStateGovernor        string `json:"cstate_governor,omitempty"`
	PStateDrive           string `json:"pstate_driver,omitempty"`
	PStateGovernor        string `json:"pstate_governor,omitempty"`
	HyperthreadingEnabled bool   `json:"ht_enabled,omitempty"`
}

OperatingSystem respresent a node operating system information

type PDU

type PDU struct {
	UID    string            `json:"uid"`
	Vendor string            `json:"vendor"`
	Model  string            `json:"model"`
	IP     string            `json:"ip"`
	Ports  map[string]string `json:"ports"`
}

PDU represent a Grid5000 PDU

type PDUsService

type PDUsService interface {
	List(ctx context.Context, site string) ([]PDU, *Response, error)
}

PDUsService is an interface for interfacing with the pdus endpoint of the Grid5000 API

type PDUsServiceOp

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

PDUsServiceOp handles communication with the pdus related methods of the Grid5000 API

func (*PDUsServiceOp) List

func (s *PDUsServiceOp) List(ctx context.Context, site string) ([]PDU, *Response, error)

List lists all available PDUs

type Performance

type Performance struct {
	NodeFlops int64 `json:"node_flops,omitempty"`
	CoreFlops int64 `json:"core_flops,omitempty"`
}

Performance represent a node performances information

type Processor

type Processor struct {
	MicroArchitecture string `json:"micro_architecture,omitempty"`
	Vendor            string `json:"vendor,omitempty"`
	// See : https://intranet.grid5000.fr/bugzilla/show_bug.cgi?id=11500
	//Version           string `json:"version,omitempty"`
	Model            string `json:"model,omitempty"`
	HTCapable        bool   `json:"ht_capable,omitempty"`
	ClockSpeed       int64  `json:"clock_speed,omitempty"`
	InstructionSet   string `json:"instruction_set,omitempty"`
	Microcode        string `json:"microcode,omitempty"`
	OtherDescription string `json:"other_description,omitempty"`
}

Processor represent a node processor information

type RequestCompletionCallback

type RequestCompletionCallback func(*http.Request, *http.Response)

RequestCompletionCallback defines the type of the request callback function

type Response

type Response struct {
	*http.Response
}

Response is a Grid5000 response. This wraps the standard http.Response returned from Grid5000.

type RestfullyConfig

type RestfullyConfig struct {
	BaseURI  string `yaml:"base_uri"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

RestfullyConfig define restfully config

type Site

type Site struct {
	UID          string  `json:"uid"`
	Name         string  `json:"name"`
	FrontendIP   string  `json:"frontend_ip,omitempty"`
	EmailContact string  `json:"email_contact,omitempty"`
	Production   bool    `json:"production,omitempty"`
	RenaterIP    string  `json:"renater_ip,omitempty"`
	Longitude    float32 `json:"longitude,omitempty"`
	Latitude     float32 `json:"latitude,omitempty"`
	Description  string  `json:"description,omitempty"`
	Location     string  `json:"location,omitempty"`
}

Site represents a Grid5000 site

type SitesService

type SitesService interface {
	List(context.Context) ([]Site, *Response, error)
	GetByName(ctx context.Context, siteName string) (*Site, *Response, error)
}

SitesService is an interface for interfacing with the sites endpoint of the Grid5000 API

type SitesServiceOp

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

SitesServiceOp handles communication with the site related methods of the Grid5000 API.

func (*SitesServiceOp) GetByName

func (s *SitesServiceOp) GetByName(ctx context.Context, siteName string) (*Site, *Response, error)

GetByName retrieves a site by name.

func (*SitesServiceOp) List

func (s *SitesServiceOp) List(ctx context.Context) ([]Site, *Response, error)

List lists all available sites

type StorageDevice

type StorageDevice struct {
	Device    string `json:"device"`
	Interface string `json:"interface"`
	Vendor    string `json:"vendor,omitempty"`
	// See : https://intranet.grid5000.fr/bugzilla/show_bug.cgi?id=11500
	//FirmwareVersion string `json:"firmware_version,omitempty"`
	Size         int64  `json:"size"`
	Storage      string `json:"storage"`
	Model        string `json:"model,omitempty"`
	DeviceByID   string `json:"by_id,omitempty"`
	DeviceByPath string `json:"by_path,omitempty"`
}

StorageDevice represent a node storage device

type SupportedJobTypes

type SupportedJobTypes struct {
	// See : https://intranet.grid5000.fr/bugzilla/show_bug.cgi?id=11500
	//Virtual     string   `json:"virtual"`
	Besteffort  bool     `json:"besteffort"`
	Queues      []string `json:"queues"`
	Deploy      bool     `json:"deploy"`
	MaxWalltime int64    `json:"max_walltime"`
}

SupportedJobTypes respresent supported job types by a node

type Vlan

type Vlan struct {
	UID  string `json:"uid"`
	Type string `json:"type"`
}

Vlan respresents a Grid5000 vlan

type VlanNode

type VlanNode struct {
	UID  string `json:"uid"`
	Vlan string `json:"vlan"`
}

VlanNode represent a node with assigned Vlan

type VlansService

type VlansService interface {
	List(ctx context.Context, site string) ([]Vlan, *Response, error)
	GetNodes(ctx context.Context, site string, id string) ([]VlanNode, *Response, error)
}

VlansService is an interface for interfacing with the vlans endpoint of the Grid5000 API

type VlansServiceOp

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

VlansServiceOp handles communication with the vlans retlates methods of the Grid5000 API

func (*VlansServiceOp) GetNodes

func (s *VlansServiceOp) GetNodes(ctx context.Context, site string, id string) ([]VlanNode, *Response, error)

GetNodes list nodes by vlans

func (*VlansServiceOp) List

func (s *VlansServiceOp) List(ctx context.Context, site string) ([]Vlan, *Response, error)

List lists all available vlans

Jump to

Keyboard shortcuts

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