icsp

package
v9.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package icsp -

Package icsp -

Package icsp -

Package icsp -

Package icsp -

Package icsp

Package icsp -

Package icsp -

Index

Constants

View Source
const (
	// OsdSateOK - The target server is running a production OS with a production version of the agent and is reachable;
	OsdSateOK osdState = iota // 0
	// OsdSateUnReachable - The managed Server is unreachable by the appliance;
	OsdSateUnReachable // 1
	// OsdSateMaintenance - The Server has been booted to maintenance, and a maintenance version of the agent has been registered with the appliance.;
	OsdSateMaintenance // 2
)
View Source
const (
	Deactivated       opswLifecycle = iota // 0
	Managed                                // 1
	ProvisionedFailed                      // 2
	Provisioning                           // 3
	Unprovisioned                          // 4
	PreUnProvisioned                       // 5
)

Life-cycle value for the managed Server. The following are the valid values for the life-cycle of the Server:

View Source
const SplitSep = ","

SplitSep - split seperator

View Source
const (
	URLEndPointBuildPlan = "/rest/os-deployment-build-plans"
)

URLEndPoint(s) export this constant

View Source
const URLEndPointServer = "/rest/os-deployment-servers"

URLEndPoint export this constant

View Source
const URLEndPointSession = "/rest/login-sessions"

URLEndPoint export this constant

View Source
const URLEndPointValidator = "/rest/authz/validator"

URLEndPoint export this constant

View Source
const URLEndPointVersion = "/rest/version"

URLEndPoint export this constant

Variables

This section is empty.

Functions

This section is empty.

Types

type APIVersion

type APIVersion struct {
	CurrentVersion int `json:"currentVersion,omitempty"`
	MinimumVersion int `json:"minimumVersion,omitempty"`
}

APIVersion struct

type Auth

type Auth struct {
	UserName string `json:"userName,omitempty"`
	Password string `json:"password,omitempty"`
	Domain   string `json:"authLoginDomain,omitempty"`
}

Auth structure

type Authz

type Authz struct {
	Authorized string `json:"authorized,omitempty"`
}

Authz struct ...

type BuildPlanCustAttrs

type BuildPlanCustAttrs struct {
	Attribute string `json:"attribute,omitempty"` // Attribute - Name of the name/value custom attribute pair associated with this OS Build Plan
	Value     string `json:"value,omitempty"`     // Value - Value of the name/value custom attribute pair associated with this OS Build Plan
}

BuildPlanCustAttrs

type BuildPlanHistory

type BuildPlanHistory struct {
	Summary string `json:"summary,omitempty"` // summary - A time ordered array of change log entries. An empty array is returned if no entries were found
	User    string `json:"user,omitempty"`    // user - User to whom log entries belong
	Time    string `json:"time,omitempty"`    // time - Time window for log entries. Default is 90 days
}

BuildPlanHistory

type BuildPlanItem

type BuildPlanItem struct {
	CfgFileDownload  bool          `json:"cfgFileDownload,omitempty"`  // cfgFileDownload - Boolean that indicates whether the current step is used for downloading configuration file or uploading it
	CfgFileOverwrite bool          `json:"cfgFileOverwrite,omitempty"` // cfgFileOverwrite - Flag that indicates whether or not to overwrite the file on the target server if the step type is 'Config File' and it is a download
	CodeType         string        `json:"codeType,omitempty"`         // codeType -  Supported types for scripts: OGFS, Python, Unix, Windows .BAT, Windows VBScript. Supported types for packages: Install ZIP. Supported type for configuration file: Config File
	ID               string        `json:"id:omitempty"`               // id - System-assigned id of the Step
	Name             string        `json:"name,omitempty"`             // name  - name of step
	Parameters       string        `json:"parameters,omitempty"`       // parameters -  Additional parameters that affect the operations of the Step
	Type             string        `json:"type,omitempty"`             // type - TYpe of the step
	URI              utils.Nstring `json:"uri,omitempty"`              // uri - The canonical URI of the Step
}

BuildPlanItem

type CPU

type CPU struct {
	CacheSize string `json:"cacheSize,omitempty"` // cacheSize CPU's cache size  , string
	Family    string `json:"family,omitempty"`    // family CPU's family. For example, "x86_64"  , string
	Model     string `json:"model,omitempty"`     // model CPU's model. For example, "Xeon"  , string
	Slot      string `json:"slot,omitempty"`      // slot CPU's slot  , string
	Speed     string `json:"speed,omitempty"`     // speed CPU's speed  , string
	Status    string `json:"status,omitempty"`    // status The last reported status of the CPU. For example, on-line, off-line  , string
	Stepping  string `json:"stepping,omitempty"`  // stepping CPU's stepping information  , string
}

CPU struct

type CategoryAction

type CategoryAction struct {
	ActionDto   string `json:"actionDto,omitempty"`   // actionDto - the action name
	CategoryDto string `json:"categoryDto,omitempty"` // categoryDto - the category name
}

CategoryAction ...

type CustomAttribute

type CustomAttribute struct {
	Key    string      `json:"key,omitempty"` // key for name value pairs
	Values []ValueItem `json:"values,omitempty"`
}

CustomAttribute struct

type CustomServerAttributes

type CustomServerAttributes struct {
	Values map[string]string // Hash of strings for custom attributes
}

CustomServerAttributes setup custom attributes to apply to a server

func (*CustomServerAttributes) Get

func (cs *CustomServerAttributes) Get(key string) string

func (*CustomServerAttributes) New

func (*CustomServerAttributes) Set

func (cs *CustomServerAttributes) Set(key string, value string)

type CustomizeServer

type CustomizeServer struct {
	HostName         string                  // provide a hostname to set
	SerialNumber     string                  // should be the serial number for the server
	ILoUser          string                  // should be the user name for ilo administration
	IloPassword      string                  // should be the ilo password to use
	IloIPAddress     string                  // PXE ip address for ilo
	IloPort          int                     // port number for ilo server
	OSBuildPlans     []string                // name of the OS build plan
	ServerProperties *CustomServerAttributes // name value pairs for server custom attributes
	PublicSlotID     int                     // the public interface that will be used to get public ipaddress
	PublicMAC        string                  // public connection name, overrides PublicSlotID
}

CustomizeServer - use customizeserver when working with creating a new server server create if it's missing server apply deployment job

type DeploymentJobs

type DeploymentJobs struct {
	FailMode   string                       `json:"failMode,omitempty"`   // failMode Selects a behavior for handling OS Build Plan failure on a server. By default, when a build plan fails on a server, it will be excluded from running any remaining build plans, and successful servers will continue to run through the series of build plans. This can be changed by setting a different failure mode.
	OsbpUris   []string                     `json:"osbpUris,omitempty"`   // osbpUris An array of OS Build Plan URIs
	ServerData []OSDPersonalizeServerDataV2 `json:"serverData,omitempty"` // server data
	StepNo     int                          `json:"stepNo,omitempty"`     // stepNo The step number in the OS build plan from which to start execution. integer
}

DeploymentJobs is used for creating a new os build plan

func (DeploymentJobs) NewDeploymentJobs

func (dj DeploymentJobs) NewDeploymentJobs(bp []OSDBuildPlan, bpdata *OSDPersonalityDataV2, servers []Server) DeploymentJobs

type DeviceGroup

type DeviceGroup struct {
	Name  string        `json:"name,omitempty"`  // name Display name for the resource, string
	REFID int           `json:"refID,omitempty"` // refID The unique numerical identifier, integer
	URI   utils.Nstring `json:"uri,omitempty"`   // uri The canonical URI of the device group, string
}

DeviceGroup struct

type ElementJobStatus

type ElementJobStatus int

ElementJobStatus type

const (
	E_STATUS_ERROR ElementJobStatus = 1 + iota
	E_STATUS_OK
	E_STATUS_PENDING
	E_STATUS_WARNING
)

func (ElementJobStatus) Equal

func (o ElementJobStatus) Equal(s string) bool

Equal helper for ElementJobStatus

func (ElementJobStatus) String

func (o ElementJobStatus) String() string

String helper for ElementJobStatus

type FailModeData

type FailModeData int

FailModeData stage const

const (
	FM_ABORT FailModeData = 1 + iota
	FM_IGNORE
)

func (FailModeData) Equal

func (o FailModeData) Equal(s string) bool

Equal helper for stage

func (FailModeData) String

func (o FailModeData) String() string

String helper for stage

type ICSPClient

type ICSPClient struct {
	rest.Client
}

ICSPClient - wrapper class for icsp api's

func (*ICSPClient) ApplyDeploymentJobs

func (c *ICSPClient) ApplyDeploymentJobs(buildplans []string, bpdata *OSDPersonalityDataV2, s Server) (jt *JobTask, err error)

ApplyDeploymentJobs plan to server

func (*ICSPClient) CreateServer

func (c *ICSPClient) CreateServer(user string, pass string, ip string, port int) error

CreateServer create profile from template

func (*ICSPClient) CustomizeServer

func (c *ICSPClient) CustomizeServer(cs CustomizeServer) error

CustomizeServer - Customize Server

func (*ICSPClient) DeleteServer

func (c *ICSPClient) DeleteServer(mid string) (bool, error)

DeleteServer - deletes a server in icsp appliance instance

func (*ICSPClient) GetAPIVersion

func (c *ICSPClient) GetAPIVersion() (APIVersion, error)

GetAPIVersion - returns the api version for OneView server returns structure APIVersion

func (*ICSPClient) GetAllBuildPlans

func (c *ICSPClient) GetAllBuildPlans() (OSBuildPlan, error)

GetAllBuildPlans - returns all OS build plans returns BuildPlan note: this call is crap slow...API: should include filters/query params

func (*ICSPClient) GetAuthHeaderMap

func (c *ICSPClient) GetAuthHeaderMap() map[string]string

GetAuthHeaderMap Generate an auth Header map ...

func (*ICSPClient) GetAuthHeaderMapNoVer

func (c *ICSPClient) GetAuthHeaderMapNoVer() map[string]string

GetAuthHeaderMapNoVer Generate an auth Header map ... some api endpoints are hiddent, remove api version to get to them

func (*ICSPClient) GetBuildPlanByName

func (c *ICSPClient) GetBuildPlanByName(planName string) (OSDBuildPlan, error)

GetBuildPlanByName - returns a build plan

func (*ICSPClient) GetBuildPlanByUri added in v0.8.2

func (c *ICSPClient) GetBuildPlanByUri(uri utils.Nstring) (OSDBuildPlan, error)

func (*ICSPClient) GetIdleTimeout

func (c *ICSPClient) GetIdleTimeout() (int64, error)

GetIdleTimeout gets the current timeout for the logged on session returns timeout in milliseconds, or error when it fails

func (*ICSPClient) GetJob

func (c *ICSPClient) GetJob(u ODSUri) (Job, error)

GetJob get a job with the ODSUri

func (*ICSPClient) GetJobs

func (c *ICSPClient) GetJobs() (JobsList, error)

GetJobs get a jobs from icsp

func (*ICSPClient) GetServerByHostName

func (c *ICSPClient) GetServerByHostName(hostname string) (Server, error)

GetServerByHostName use the server hostname automatically assigned to get the server

func (*ICSPClient) GetServerByID

func (c *ICSPClient) GetServerByID(mid string) (Server, error)

GetServerByID - get a server from icsp - faster then getting all servers and ranging over them

func (*ICSPClient) GetServerByIP added in v0.8.2

func (c *ICSPClient) GetServerByIP(ip string) (Server, error)

GetServerByIP use the server ip to get the server

func (*ICSPClient) GetServerByName

func (c *ICSPClient) GetServerByName(name string) (Server, error)

GetServerByName use the server name to get the server type

func (*ICSPClient) GetServerBySerialNumber

func (c *ICSPClient) GetServerBySerialNumber(serial string) (Server, error)

GetServerBySerialNumber use the serial number to find the server

func (*ICSPClient) GetServers

func (c *ICSPClient) GetServers() (ServerList, error)

GetServers get a servers from icsp

func (*ICSPClient) IsServerManaged

func (c *ICSPClient) IsServerManaged(serial string) (bool, error)

IsServerManaged - returns true if server is managed

func (*ICSPClient) NewICSPClient

func (c *ICSPClient) NewICSPClient(user string, password string, domain string, endpoint string, sslverify bool, apiversion int) *ICSPClient

new Client

func (*ICSPClient) PostApplyDeploymentJobs

func (c *ICSPClient) PostApplyDeploymentJobs(jt *JobTask, s Server, properties []string) error

PostApplyDeploymentJobs - post deployment task to update custom attributes with results of a job task that was executed on the server

func (*ICSPClient) PreApplyDeploymentJobs

func (c *ICSPClient) PreApplyDeploymentJobs(s Server, publicinterface Interface) (Server, error)

PreApplyDeploymentJobs - update public interface information with what is actively the public interface

func (*ICSPClient) RefreshLogin

func (c *ICSPClient) RefreshLogin() error

RefreshLogin Refresh login authkey Should make sure we have a valid APIKey

func (*ICSPClient) RefreshVersion

func (c *ICSPClient) RefreshVersion() error

RefreshVersion - refresh the max api Version for the client

func (*ICSPClient) SaveServer

func (c *ICSPClient) SaveServer(s Server) (o Server, err error)

SaveServer save Server, submit new profile template

func (*ICSPClient) SessionLogin

func (c *ICSPClient) SessionLogin() (Session, error)

SessionLogin to OneView and get a session ID returns Session structure

func (*ICSPClient) SessionLogout

func (c *ICSPClient) SessionLogout() error

SessionLogout Logout to OneView and get a session ID returns Session structure

func (*ICSPClient) SetIdleTimeout

func (c *ICSPClient) SetIdleTimeout(thetime int64) error

SetIdleTimeout sets the current timeout

func (*ICSPClient) SubmitDeploymentJobs

func (c *ICSPClient) SubmitDeploymentJobs(dj DeploymentJobs) (jt *JobTask, err error)

SubmitDeploymentJobs api call to deployment jobs

func (*ICSPClient) SubmitNewServer

func (c *ICSPClient) SubmitNewServer(sc ServerCreate) (jt *JobTask, err error)

SubmitNewServer submit new profile template

func (*ICSPClient) UpdatePublicInterfaceAttributes

func (c *ICSPClient) UpdatePublicInterfaceAttributes(s Server, publicinterface Interface) (Server, error)

UpdatePublicInterfaceAttributes - updates the server attributes with public interface

type Ilo

type Ilo struct {
	Category       string        `json:"category,omitempty"`       // category The category is used to help identify the kind of resource, string
	Created        string        `json:"created,omitempty"`        // created Date and time when iLO was first discovered by Insight Control Server Provisioning, timestamp
	Description    string        `json:"description,omitempty"`    // description General description of the iLO, string
	ETAG           string        `json:"eTag,omitempty"`           // eTag Entity tag/version ID of the resource, the same value that is returned in the ETag header on a GET of the resource, string
	HealthStatus   string        `json:"healthStatus,omitempty"`   // healthStatus Overall health status of the resource, string
	IPAddress      string        `json:"ipAddress,omitempty"`      // ipAddress The IP address of the server’s iLO, string
	Modified       string        `json:"modified,omitempty"`       // modified Date and time when the resource was last modified, timestamp
	Name           string        `json:"name,omitempty"`           // name For servers added via iLO and booted to Intelligent Provisioning service OS, host name is determined by Intelligent Provisioning. For servers added via iLO and PXE booted to LinuxPE host name is "localhost". For servers added via iLO and PXE booted to WinPE host name is a random hostname "minint-xxx", string
	Passowrd       string        `json:"password,omitempty"`       // password ILO's password, string
	Port           int           `json:"port,omitempty"`           // port The socket on which the management service listens, integer
	ResourceStatus string        `json:"resourceStatus,omitempty"` // resourceStatus Current state of the resource, string
	Server         string        `json:"server,omitempty"`         // server The canonical URI of the hosting/managed server, string
	State          string        `json:"state,omitempty"`          // state Current state of the resource, string
	Status         string        `json:"status,omitempty"`         // status Overall health status of the resource, string
	Type           string        `json:"type,omitempty"`           // type Uniquely identifies the type of the JSON object(readonly), string
	URI            utils.Nstring `json:"uri,omitempty"`            // uri Unique numerical iLO identifier, string
	Username       string        `json:"username,omitempty"`       // username Username used to log in to iLO, string
}

Ilo struct

type Interface

type Interface struct {
	DHCPEnabled bool   `json:"dhcpEnabled,omitempty"` // dhcpEnabled Flag that indicates whether the interface IP address is configured using DHCP, Boolean
	Duplex      string `json:"duplex,omitempty"`      // duplex Reported duplex of the interface, string
	IPV4Addr    string `json:"ipv4Addr,omitempty"`    // ipv4Addr IPv4 address of the interface, string
	IPV6Addr    string `json:"ipv6Addr,omitempty"`    // ipv6Addr IPv6 address of the interface, string
	MACAddr     string `json:"macAddr,omitempty"`     // macAddr Interface hardware network address, string
	Netmask     string `json:"netmask,omitempty"`     // netmask Netmask in dotted decimal notation, string
	Slot        string `json:"slot,omitempty"`        // slot Interface identity reported by the Server's operating system, string
	Speed       string `json:"speed,omitempty"`       // speed Interface speed in megabits, string
	Type        string `json:"type,omitempty"`        // type Interface type. For example, ETHERNET, string
}

Interface struct

type Job

type Job struct {
	Category        string             `json:"category,omitempty"`        // category The category is used to help identify the kind of resource, string
	Created         string             `json:"created,omitempty"`         // created Date and time when the Job was created, timestamp
	Description     string             `json:"description,omitempty"`     // description Text description of the type of the Job, string
	ETAG            string             `json:"eTag,omitempty"`            // eTag Entity tag/version ID of the resource , string
	JobDeviceGroups []string           `json:"jobDeviceGroups,omitempty"` // jobDeviceGroups An array of device groups associated with this Job , array of string
	JobProgress     []OSDJobProgress   `json:"jobProgress,omitempty"`     // jobProgress An array of Job progress. A single Job can contain progress for multiple servers. Job progress is only available when the job is running. For a single Job this is the number of steps competed for this Job on the target server. When a set of jobs is run together user will see one Job listed. The progress for this Job is the number of jobs that have been completed
	JobResult       []OSDJobResult     `json:"jobResult,omitempty"`       // jobResult  An array of Job results. A single Job can contain results for multiple servers. Job result is only available once the Job completes. For a single Job this provides total steps completed, errors that happened during Job execution and logs
	JobServerInfo   []OSDJobServerInfo `json:"jobServerInfo,omitempty"`   // jobServerInfo An array of servers and their details associated with this Job
	JobUserName     string             `json:"jobUserName,omitempty"`     // jobUserName The name of the user under whose authority this Job was invoked string
	Modified        string             `json:"modified,omitempty"`        // modified Date and time when the Job was last modified timestamp
	Name            string             `json:"name,omitempty"`            // name Name of the job string
	NameOfJobType   string             `json:"nameOfJobType,omitempty"`   // nameOfJobType The name of the type of the Job. In some cases has the same value as the field "name" string
	Running         string             `json:"running,omitempty"`         // running Indicates whether the Job is running
	State           string             `json:"state,omitempty"`           // JobState  state A constant to help explain what state a Job is in. Possible values:
	Status          string             `json:"status,omitempty"`          // status Overall status of the Job. Values: string
	Type            string             `json:"type,omitempty"`            // type Uniquely identifies the type of the JSON object
	TypeOfJobType   string             `json:"typeOfJobType,omitempty"`   // typeOfJobType A constant that indicates what type of Job it is:
	URI             utils.Nstring      `json:"uri,omitempty"`             // uri The canonical URI of the resource string
	URIOfJobType    utils.Nstring      `json:"uriOfJobType,omitempty"`    // uriOfJobType The canonical URI of the OS Build Plan string
}

Job type

type JobHistory

type JobHistory struct {
	Description   string        `json:"description,omitempty"`   // description Description of the job, string
	EndDate       string        `json:"endDate,omitempty"`       // endDate Date and time when job was finished, string
	Initiator     string        `json:"initiator,omitempty"`     // initiator Name of the user who invoked the job on the Server, string
	Name          string        `json:"name,omitempty"`          // name Name of the job, string
	NameOfJobType string        `json:"nameOfJobType,omitempty"` // nameOfJobType Name of the OS Build Plan that was invoked on the Server, string
	StartDate     string        `json:"startDate,omitempty"`     // startDate Date and time when job was invoked, string
	URI           utils.Nstring `json:"uri,omitempty"`           // uri The canonical URI of the job, string
	URIOfJobType  utils.Nstring `json:"uriOfJobType,omitempty"`  // uriOfJobType The canonical URI of the OS Build Plan, string
}

JobHistory job history type

type JobRunning

type JobRunning int

JobRunning running state

const (
	JOB_RUNNING_YES JobRunning = 1 + iota
	JOB_RUNNING_NO
)

func (JobRunning) Equal

func (o JobRunning) Equal(s string) bool

Equal helper for JobStatus

func (JobRunning) String

func (o JobRunning) String() string

String helper for JobRunning

type JobServerInclusionStatus

type JobServerInclusionStatus int

JobServerInclusionStatus type

const (
	ADDED_INCLUSION_STATUS JobServerInclusionStatus = 1 + iota
	INCLUDED_INCLUSION_STATUS
	REMOVED_INCLUSION_STATUS
)

func (JobServerInclusionStatus) Equal

Equal helper for JobServerInclusionStatus

func (JobServerInclusionStatus) String

func (o JobServerInclusionStatus) String() string

String helper for JobServerInclusionStatus

type JobState

type JobState int

JobState type

const (
	STATUS_ABORTED JobState = 1 + iota
	STATUS_ACTIVE
	STATUS_BLOCKED
	STATUS_CANCELLED
	STATUS_DELETED
	STATUS_EXPIRED
	STATUS_FAILURE
	STATUS_PENDING
	STATUS_RECURRING
	STATUS_STALE
	STATUS_SUCCESS
	STATUS_TERMINATED
	STATUS_TERMINATING
	STATUS_UNKNOWN
	STATUS_WARNING
	STATUS_ZOMBIE
)

func (JobState) Equal

func (o JobState) Equal(s string) bool

Equal helper for JobState

func (JobState) String

func (o JobState) String() string

String helper for JobState

type JobStatus

type JobStatus int

JobStatus type

const (
	JOB_STATUS_OK JobStatus = 1 + iota
	JOB_STATUS_WARNING
	JOB_STATUS_ERROR
	JOB_STATUS_UNKNOWN
)

func (JobStatus) Equal

func (o JobStatus) Equal(s string) bool

Equal helper for JobStatus

func (JobStatus) String

func (o JobStatus) String() string

String helper for JobStatus

type JobStatusOnServer

type JobStatusOnServer int

JobStatusOnServer Status of the Job on a server

const (
	J_CANCELLED_STATUS JobStatusOnServer = 1 + iota
	J_FAILURE_STATUS
	J_SKIPPED_STATUS
	J_SUCCESS_STATUS
	J_UNKNOWN_STATUS
	J_WARNING_STATUS
)

func (JobStatusOnServer) Equal

func (o JobStatusOnServer) Equal(s string) bool

Equal helper for JobStatusOnServer

func (JobStatusOnServer) String

func (o JobStatusOnServer) String() string

String helper for JobStatusOnServer

type JobTask

type JobTask struct {
	Job                    // copy of the original job
	JobURI   ODSUri        // link to the job
	IsDone   bool          // when true, task are done
	Timeout  int           // time before timeout on Executor
	WaitTime time.Duration // time between task checks
	Client   *ICSPClient   // reference to a client
}

JobTask holds a Job ODSUri and task status

func (*JobTask) GetComplettedStatus

func (jt *JobTask) GetComplettedStatus() string

GetComplettedStatus get the message from JobResult

func (*JobTask) GetCurrentStatus

func (jt *JobTask) GetCurrentStatus() error

GetCurrentStatus - Get the current status

func (*JobTask) GetLastStatusUpdate

func (jt *JobTask) GetLastStatusUpdate() string

GetLastStatusUpdate get the last status from JobProgress

func (*JobTask) GetPercentProgress

func (jt *JobTask) GetPercentProgress() float64

GetPercentProgress get the progress as a percentage

func (*JobTask) NewJobTask

func (jt *JobTask) NewJobTask(c *ICSPClient) *JobTask

NewJobTask create a new job task

func (*JobTask) Reset

func (jt *JobTask) Reset()

Reset - reset job task

func (*JobTask) Wait

func (jt *JobTask) Wait() error

Wait - wait on job task to complete

type JobsList

type JobsList struct {
	Category    string        `json:"category,omitempty"`    // Resource category used for authorizations and resource type groupings
	Count       int           `json:"count,omitempty"`       // The actual number of resources returned in the specified page
	Created     string        `json:"created,omitempty"`     // timestamp for when resource was created
	ETAG        string        `json:"eTag,omitempty"`        // entity tag version id
	Members     []Job         `json:"members,omitempty"`     // array of Server types
	Modified    string        `json:"modified,omitempty"`    // timestamp resource last modified
	NextPageURI utils.Nstring `json:"nextPageUri,omitempty"` // Next page resources
	PrevPageURI utils.Nstring `json:"prevPageUri,omitempty"` // Previous page resources
	Start       int           `json:"start,omitempty"`       // starting row of resource for current page
	Total       int           `json:"total,omitempty"`       // total number of pages
	Type        string        `json:"type,omitempty"`        // type of paging
	URI         utils.Nstring `json:"uri,omitempty"`         // uri to page
}

JobsList List of jobs

type NetConfig

type NetConfig struct {
	Hostname      string               `json:"hostname,omitempty"`   // host1, optional hostname option
	Workgroup     string               `json:"workgroup,omitempty"`  // ams, optional WINS workgroup for windows only
	Domain        string               `json:"domain,omitempty"`     // corp.net, optional This is a period (.) separated string and is usually the right side part of a fully qualified host name.
	WINSList      utils.Nstring        `json:"-"`                    // ignore marshal/unmarshal calls on this field, comma seperated list of wins servers
	DNSNameList   utils.Nstring        `json:"-"`                    // ignore marshal/unmarshal calls on this field, comma seperated list of dns servers
	DNSSearchList utils.Nstring        `json:"-"`                    // ignore marshal/unmarshal calls on this field, comma seperated list of dns search servers
	Interfaces    []NetConfigInterface `json:"interfaces,omitempty"` // list of network interfaces to customize
}

NetConfig - create network customization objects that can be serialized and deserialized for configuration to run when executing to be saved on the server as hpsa_netconfig: Proliant SW - Post Install Network Personalization build plans

func NewNetConfig

func NewNetConfig(
	hostname utils.Nstring,
	workgroup utils.Nstring,
	domain utils.Nstring,
	winslist utils.Nstring,
	dnsnamelist utils.Nstring,
	dnssearchlist utils.Nstring) NetConfig

NewNetConfig - create a new netconfig object without interfaces

func (*NetConfig) AddAllDHCP

func (n *NetConfig) AddAllDHCP(interfaces []Interface, isipv6 bool, ipv6gateway utils.Nstring)

AddAllDHCP - make all the netconfig interfaces setup for dhcp

func (*NetConfig) GetPersonalityData

func (n *NetConfig) GetPersonalityData() *OSDPersonalityDataV2

GetPersonalityData - generate a PersonalityData *OSDPersonalityDataV2 from NetConfig

func (*NetConfig) NewNetConfigInterface

func (n *NetConfig) NewNetConfigInterface(
	enable bool,
	macaddr string,
	isdhcp bool,
	isipv6 bool,
	ipv6gateway utils.Nstring,
	ipv4gateway utils.Nstring,
	staticnets utils.Nstring,
	name utils.Nstring,
	wins utils.Nstring,
	dnsservers utils.Nstring,
	dnssearch utils.Nstring,
	vlandid int) NetConfigInterface

NewNetConfigInterface - creates an interface object for NetConfig

func (*NetConfig) Save

func (n *NetConfig) Save(s Server) (Server, error)

Save - save the netconfig to hpsa_netconfig

func (*NetConfig) SetStaticInterface

func (n *NetConfig) SetStaticInterface(
	iface Interface,
	ipv4gateway utils.Nstring,
	ipv6gateway utils.Nstring,
	staticiplist utils.Nstring,
	isipv6 bool)

SetStaticInterface - converts an interface from NetConfig.Interface from dhcp to static

func (*NetConfig) ToJSON added in v0.8.2

func (n *NetConfig) ToJSON() (string, error)

ToJSON - convert object to JSON string

type NetConfigInterface

type NetConfigInterface struct {
	Name           string   `json:"-"`                        // ignore marshal/unmarshal, optional name of the nic for the interface, also known as slot or interface name
	VlanID         int      `json:"vlanid"`                   // 0> vland id, automatically generated
	WINSServers    []string `json:"winsServers,omitempty"`    // optional [8.8.8.8, 8.8.4.4] optional list of wins servers to configure
	DNSServers     []string `json:"dnsServers,omitempty"`     // optional [8.8.8.8, 8.8.4.4] optional list of dns servers to configure
	DNSSearch      []string `json:"dnsSearch,omitempty"`      // optional [corp.net, my.corp.net] A list of period (.) separated character strings separated by spaces or commas.
	MACAddr        string   `json:"macAddress,omitempty"`     // mac address to configure for the interface
	Enabled        bool     `json:"enabled"`                  // boolean flag to enable network configuration or leave as is.
	DHCPv4         bool     `json:"dhcpv4"`                   // boolean flag when set to true no other options are needed, will use dhcp to configure
	IPv6Autoconfig bool     `json:"ipv6Autoconfig"`           // boolean to automatically configure ipv6
	IPv6Gateway    string   `json:"ipv6gateway,omitempty"`    // when ipv6Autoconfig is true, gateway for ipv6
	IPv4Gateway    string   `json:"ipv4gateway,omitempty"`    // when dhcpv4 is false , assume ipv4 config, specify the gateway
	StaticNetworks []string `json:"staticNetworks,omitempty"` // static ips to assign for the server, ie; 172.0.0.2/255.255.255.0
}

NetConfigInterface - part of NetCustomization type , describes interface configuration

type ODSUri

type ODSUri struct {
	URI utils.Nstring `json:"uri,omitempty"` // uri of job
}

ODSUri returned from create server for job uri task

type OSBuildPlan

type OSBuildPlan struct {
	Category    string         `json:"category,omitempty"`    //Category - Resource category used for authorizations and resource type groupings
	Count       int            `json:"count,omiitempty"`      // Count - The actual number of resources returned in the specified page
	Created     string         `json:"created,omitempty"`     // Created - Date and time when the resource was created
	ETag        string         `json:"eTag,omitempty"`        // ETag - Entity tag/version ID of the resource, the same value that is returned in the ETag header on a GET of the resource
	Members     []OSDBuildPlan `json:"members,omitempty"`     // Members - array of BuildPlans
	Modified    string         `json:"modified,omitempty"`    // Modified -
	NextPageURI utils.Nstring  `json:"nextPageUri,omitempty"` // NextPageURI - URI pointing to the page of resources following the list of resources contained in the specified collection
	PrevPageURI utils.Nstring  `json:"prevPageURI,omitempty"` // PrevPageURI - URI pointing to the page of resources preceding the list of resources contained in the specified collection
	Start       int            `json:"start,omitempty"`       // Start - The row or record number of the first resource returned in the specified page
	Total       int            `json:"total,omitempty"`       // Total -  The total number of resources that would be returned from the query (including any filters), without pagination or enforced resource limits
	URI         utils.Nstring  `json:"uri,omitempty"`         //  URI -
	Type        string         `json:"type,omitempty"`        // Type - type of paging
}

OSBuildPlan

type OSDBuildPlan

type OSDBuildPlan struct {
	Arch               string               `json:"arch,omitempty"`
	BuildPlanHistory   []BuildPlanHistory   `json:"buildPlanHistory,omitempty"` // buildPlanHistory array
	BuildPlanStepType  string               `json:"buildPlanStepType,omitempty"`
	IsCustomerContent  bool                 `json:"isCustomerContent,omitempty"`
	OS                 string               `json:"os,omitempty"`
	BuildPlanCustAttrs []BuildPlanCustAttrs `json:"buildPlanCustAttrs,omitempty"`
	BuildPlanItems     []BuildPlanItem      `json:"buildPlanItems,omitempty"`
	ModifiedBy         string               `json:"modifiedBy,omitempty"`
	CreatedBy          string               `json:"createdBy,omitempty"`
	LifeCycle          string               `json:"lifeCycle,omitstring"`
	Description        string               `json:"description,omitempty"`
	Status             string               `json:"status,omitempty"`
	Name               string               `json:"name,omitempty"`
	ETAG               string               `json:"eTag,omitempty"` // eTag Entity tag/version ID of the resource
	Modified           string               `json:"modified,omitempty"`
	Created            string               `json:"created,omitempty"`
	URI                utils.Nstring        `json:"uri,omitempty"` // uri The canonical URI of the buildplan
}

OSDBuildPlan struct

type OSDJobProgress

type OSDJobProgress struct {
	CurrentStepName   string        `json:"currentStepName,omitempty"`   // currentStepName The name of the step that this Job is currently on  , string
	ElementJobStatus  string        `json:"elementJobStatus,omitempty"`  // elementJobStatus The status of an individual server within the Job, string
	JobCompletedSteps int           `json:"jobCompletedSteps,omitempty"` // jobCompletedSteps Total number of completed steps of the Job, integer
	JobServerURI      utils.Nstring `json:"jobServerUri,omitempty"`      // jobServerUri The canonical URI of a server within the Job, string
	JobTotalSteps     int           `json:"jobTotalSteps,omitempty"`     // jobTotalSteps Total number of steps that the Job has, integer
}

OSDJobProgress struct

type OSDJobResult

type OSDJobResult struct {
	JobMessage              string        `json:"jobMessage,omitempty"`              // jobMessage Job result message  , string
	JobResultCompletedSteps int           `json:"jobResultCompletedSteps,omitempty"` // jobResultCompletedSteps Total number of completed steps  , integer
	JobResultErrorDetails   string        `json:"jobResultErrorDetails,omitempty"`   // jobResultErrorDetails Error details for the Job  , string
	JobResultLogDetails     string        `json:"jobResultLogDetails,omitempty"`     // jobResultLogDetails Log details for the Job  , string
	JobResultTotalSteps     int           `json:"jobResultTotalSteps,omitempty"`     // jobResultTotalSteps Total number of steps for the Job  , integer
	JobServerURI            utils.Nstring `json:"jobServerUri,omitempty"`            // jobServerUri The canonical URI of a server within the Job  , string
}

OSDJobResult struct

type OSDJobServerInfo

type OSDJobServerInfo struct {
	DeviceType               string        `json:"deviceType,omitempty"`               // deviceType The only supported type: os-deployment-servers, string
	JobServerInclusionStatus string        `json:"jobServerInclusionStatus,omitempty"` // jobServerInclusionStatus Information about a server that was affected by a job. Each server has information about how it was associated with the job (inclusion status) and the status of the job on that server (status). Inclusion values: string
	JobServerURI             utils.Nstring `json:"jobServerUri,omitempty"`             // jobServerUri The canonical URI of a server within the Job, string
	JobStatusOnServer        string        `json:"jobStatusOnServer,omitempty"`        // jobStatusOnServer Status of the Job on a server where this Job was executed. Status values: string
	ServerName               string        `json:"serverName,omitempty"`               // serverName Name of the server string
}

OSDJobServerInfo struct

type OSDNicDataV2

type OSDNicDataV2 struct {
	DHCPv4         bool     `json:"dhcpv4,omitempty"`         // interfaces[]dhcpv4 Boolean
	DNSSearch      []string `json:"dnsSearch,omitempty"`      // interfaces[]dnsSearch array of string
	DNSServers     []string `json:"dnsServers,omitempty"`     // interfaces[]dnsServers array of string
	Enabled        bool     `json:"enabled,omitempty"`        // interfaces[]enabled Boolean
	IPv4Gateway    string   `json:"ipv4gateway,omitempty"`    // interfaces[]ipv4gateway string
	IPv6Autoconfig bool     `json:"ipv6Autoconfig,omitempty"` // interfaces[]ipv6Autoconfig Boolean
	IPv6Gateway    string   `json:"ipv6gateway,omitempty"`    // interfaces[]ipv6gateway string
	MACAddress     string   `json:"macAddress,omitempty"`     // interfaces[]macAddress string
	StaticNetworks []string `json:"staticNetworks,omitempty"` // interfaces[]staticNetworks array of string
	VLanID         int      `json:"vlanid,omitempty"`         // interfaces[]vlanid integer
	WinsServers    []string `json:"winsServers,omitempty"`    // interfaces[]winsServers array of string
}

OSDNicDataV2 network interface

type OSDPersonalityDataV2

type OSDPersonalityDataV2 struct {
	Domain            string         `json:"domain,omitempty"`            // domain string
	HostName          string         `json:"hostname,omitempty"`          // hostname string
	Interfaces        []OSDNicDataV2 `json:"interfaces,omitempty"`        // interfaces array of OSDNicDataV2
	VirtualInterfaces []OSDNicDataV2 `json:"virtualInterfaces,omitempty"` // virtualInterfaces array of OSDNicDataV2
	Workgroup         string         `json:"workgroup,omitempty"`         // workgroup string
}

OSDPersonalityDataV2 personality data

type OSDPersonalizeServerDataV2

type OSDPersonalizeServerDataV2 struct {
	PersonalityData *OSDPersonalityDataV2 `json:"personalityData,omitempty"`
	ServerURI       string                `json:"serverUri,omitempty"`  // serverUri string
	SkipReboot      bool                  `json:"skipReboot,omitempty"` // skipReboot Boolean
}

OSDPersonalizeServerDataV2 server data

type Server

type Server struct {
	Architecture           string              `json:"architecture,omitempty"`           // architecture Server's architecture, string
	Category               string              `json:"category,omitempty"`               // category The category is used to help identify the kind of resource, string
	Cpus                   []CPU               `json:"cpus,omitempty"`                   // array of CPU's
	Created                string              `json:"created,omitempty"`                // created Date and time when the Server was discovered, timestamp
	CustomAttributes       []CustomAttribute   `json:"customAttributes,omitempty"`       // array of custom attributes
	DefaultGateway         string              `json:"defaultGateway,omitempty"`         // defaultGateway Gateway for this Server, string
	Description            string              `json:"description,omitempty"`            // description Brief description of the Server, string
	DeviceGroups           []DeviceGroup       `json:"deviceGroups,omitempty"`           // deviceGroups An array of device groups associated with the Server
	DiscoveredDate         string              `json:"discoveredDate,omitempty"`         // discoveredDate Date and time when the Server was discovered. Same as created date
	ETAG                   string              `json:"eTag,omitempty"`                   // eTag Entity tag/version ID of the resource
	Facility               string              `json:"facility,omitempty"`               // facility A facility represents the collection of servers. A facility can be all or part of a data center, Server room, or computer lab. Facilities are used as security boundaries with user groups
	HardwareModel          string              `json:"hardwareModel,omitempty"`          // hardwareModel The model name of the target server
	HostName               string              `json:"hostName,omitempty"`               // hostName The name of the server as reported by the server
	ILO                    *Ilo                `json:"ilo,omitempty"`                    // information on ilo
	Interfaces             []Interface         `json:"interfaces,omitempty"`             // list of interfaces
	JobsHistory            []JobHistory        `json:"jobsHistory,omitempty"`            // array of previous run jobs
	LastScannedDate        string              `json:"lastScannedDate,omitempty"`        // lastScannedDate Date and time when the Server was detected last , string
	Locale                 string              `json:"locale,omitempty"`                 // locale Server's configured locale , string
	LoopbackIP             string              `json:"loopbackIP,omitempty"`             // loopbackIP Server's loopback IP address in dotted decimal format, string
	ManagementIP           string              `json:"managementIP,omitempty"`           // managementIP Server's management IP address in dotted decimal format, string
	Manufacturer           string              `json:"manufacturer,omitempty"`           // manufacturer Manufacturer as reported by the Server  , string
	MID                    string              `json:"mid,omitempty"`                    // mid A unique ID assigned to the Server by Server Automation, string
	Modified               string              `json:"modified,omitempty"`               // modified Date and time when the Server was last modified , timestamp
	Name                   string              `json:"name,omitempty"`                   // name The display name of the server. This is what shows on the left hand side of the UI. It is not the same as the host name. , string
	NetBios                string              `json:"netBios,omitempty"`                // netBios Server's Net BIOS name, string
	OperatingSystem        string              `json:"operatingSystem,omitempty"`        // operatingSystem Operating system installed on the Server, string
	OperatingSystemVersion string              `json:"operatingSystemVersion,omitempty"` // operatingSystemVersion Version of the operating system installed on the Server, string
	OpswLifecycle          string              `json:"opswLifecycle,omitempty"`          // Use type OpswLifecycle
	OSFlavor               string              `json:"osFlavor,omitempty"`               // osFlavor Additional information about an operating system flavor, string
	OSSPVersion            string              `json:"osSPVersion,omitempty"`            // osSPVersion Windows Service Pack version info, string
	PeerIP                 string              `json:"peerIP,omitempty"`                 // peerIP Server's peer IP address, string
	RAM                    string              `json:"ram,omitempty"`                    // ram Amount of free memory on the Server, string
	Reporting              bool                `json:"reporting,omitempty"`              // reporting Flag that indicates if the client on the Server is reporting to the core, Boolean
	Running                string              `json:"running,omitempty"`                // running Flag that indicates whether provisioning is performed on the Server, string
	SerialNumber           string              `json:"serialNumber,omitempty"`           // serialNumber The serial number assigned to the Server, string
	ServerLocation         *ServerLocationItem `json:"serverLocation,omitempty"`         // serverLocation The Server location information such as rack and enclosure etc
	Stage                  string              `json:"stage,omitempty"`                  // stage type //stage When a managed Server is rolled out into production it typically passes to various stages of deployment.The following are the valid values for the stages of the Server:
	State                  string              `json:"state,omitempty"`                  // state Indicates the state of the agent on the target server. The following are the valid values for the state:
	Status                 string              `json:"status,omitempty"`                 // status Unified status of the target Server. Supported values:
	StorageDevices         []StorageDevice     `json:"storageDevices,omitempty"`         // storage devices on the server
	Swap                   string              `json:"swap,omitempty"`                   // swap Amount of swap space on the Server  , string
	Type                   string              `json:"type,omitempty"`                   // type Uniquely identifies the type of the JSON object  , string (readonly)
	URI                    utils.Nstring       `json:"uri,omitempty"`                    // uri The canonical URI of the Server  , string
	UUID                   string              `json:"uuid,omitempty"`                   // uuid Server's UUID  , string
}

Server type

func (Server) Clone

func (s Server) Clone() Server

Clone server profile so we can submit write attributes

func (Server) GetInterface

func (s Server) GetInterface(slotid int) (Interface, error)

GetInterface get the interface from slot location

func (Server) GetInterfaceFromMac

func (s Server) GetInterfaceFromMac(mac string) (Interface, error)

GetInterfaceFromMac get the server interface for mac address

func (Server) GetInterfaces

func (s Server) GetInterfaces() (interfaces []Interface)

GetInterfaces get a list of interfaces that have an ip address assigned usually called durring provisioning, and before we apply an os build plan

func (Server) GetPublicIPV4

func (s Server) GetPublicIPV4() (string, error)

GetPublicIPV4 returns the public ip interface

usually called after an os build plan is applied

func (Server) GetPublicInterface

func (s Server) GetPublicInterface() (*Interface, error)

GetPublicInterface - get public interface from public_interface for server

func (*Server) GetValueItem

func (s *Server) GetValueItem(key string, scope string) (int, ValueItem)

GetValueItem - gets a ValueItem from custom attribute

func (*Server) GetValueItems

func (s *Server) GetValueItems(key string) (int, []ValueItem)

GetValueItems - gets a customattribute value item by key

func (Server) ReloadFull

func (s Server) ReloadFull(c *ICSPClient) (Server, error)

ReloadFull GetServers() only returns a partial object, reload it to get everything

func (*Server) SetCustomAttribute

func (s *Server) SetCustomAttribute(key string, scope string, value string)

SetCustomAttribute set a custom attribute for server

func (*Server) SetValueItems

func (s *Server) SetValueItems(key string, newv ValueItem)

SetValueItems object

type ServerCreate

type ServerCreate struct {
	Type      string `json:"type,omitempty"`      // OSDIlo
	IPAddress string `json:"ipAddress,omitempty"` // PXE managed ip address
	Port      int    `json:"port,omitempty"`      // port number to use
	UserName  string `json:"username,omitempty"`  // iLo username
	Password  string `json:"password,omitempty"`  // iLO password
}

ServerCreate structure for create server

func (ServerCreate) NewServerCreate

func (sc ServerCreate) NewServerCreate(user string, pass string, ip string, port int) ServerCreate

NewServerCreate make a new servercreate object

type ServerList

type ServerList struct {
	Category    string        `json:"category,omitempty"`    // Resource category used for authorizations and resource type groupings
	Count       int           `json:"count,omitempty"`       // The actual number of resources returned in the specified page
	Created     string        `json:"created,omitempty"`     // timestamp for when resource was created
	ETAG        string        `json:"eTag,omitempty"`        // entity tag version id
	Members     []Server      `json:"members,omitempty"`     // array of Server types
	Modified    string        `json:"modified,omitempty"`    // timestamp resource last modified
	NextPageURI utils.Nstring `json:"nextPageUri,omitempty"` // Next page resources
	PrevPageURI utils.Nstring `json:"prevPageUri,omitempty"` // Previous page resources
	Start       int           `json:"start,omitempty"`       // starting row of resource for current page
	Total       int           `json:"total,omitempty"`       // total number of pages
	Type        string        `json:"type,omitempty"`        // type of paging
	URI         utils.Nstring `json:"uri,omitempty"`         // uri to page
}

ServerList List of Servers

type ServerLocationItem

type ServerLocationItem struct {
	Bay       string `json:"bay,omitempty"`       // bay Slot number in a rack where the Server is located string
	Enclosure string `json:"enclosure,omitempty"` // enclosure Name of an enclosure where the Server is physically located string
	Rack      string `json:"rack,omitempty"`      // rack Name of a rack where the Server is physically located string
}

ServerLocationItem server location type

type Session

type Session struct {
	ID string `json:"sessionID,omitempty"`
}

Session struct

type Stage

type Stage int

Stage stage const

const (
	// StageInDeployment -
	StageInDeployment Stage = iota // 0
	// StageLive -
	StageLive // 1
	// StageOffline -
	StageOffline // 2
	// StageOpsReady -
	StageOpsReady // 3
	// StageUnknown -
	StageUnknown // 4
)

func (Stage) Equal

func (o Stage) Equal(s string) bool

Equal helper for stage

func (Stage) String

func (o Stage) String() string

String helper for stage

type StorageDevice

type StorageDevice struct {
	Capacity   int    `json:"capacity,omitempty"`   // capacity Capacity of the storage in megabytes integer
	DeviceName string `json:"deviceName,omitempty"` // deviceName Device name, such as "C:" for Windows or "sda" for Linux string
	MediaType  string `json:"mediaType,omitempty"`  // mediaType Media type, such as "CDROM", "SCSI DISK" and etc. string
	Model      string `json:"model,omitempty"`      // model Model of the device string
	Vendor     string `json:"vendor,omitempty"`     // vendor Manufacturer of the device string
}

StorageDevice storage device type

type TimeOut

type TimeOut struct {
	IdleTimeout int64 `json:"idleTimeout"`
}

TimeOut structure

type URLEndPoint

type URLEndPoint string

URLEndPoint ...

type ValueItem

type ValueItem struct {
	Scope string `json:"scope,omitempty"` // scope of value
	Value string `json:"value,omitempty"` // value of information
}

ValueItem struct

Jump to

Keyboard shortcuts

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