Documentation ¶
Index ¶
- Variables
- func CacheExpires(r *http.Response) time.Time
- type APIClient
- type APIKey
- type APIResponse
- type BasicAuth
- type Boot
- type BootSource
- type BootSourceOverrideEnabled
- type Collection
- type ComputerSystem
- type ComputerSystemActions
- type ComputerSystemReset
- type Configuration
- type ConnectedVia
- type DefaultApiService
- func (a *DefaultApiService) EjectVirtualMedia(ctx _context.Context, managerId string, virtualMediaId string, ...) (RedfishError, *_nethttp.Response, error)
- func (a *DefaultApiService) GetManager(ctx _context.Context, managerId string) (Manager, *_nethttp.Response, error)
- func (a *DefaultApiService) GetManagerVirtualMedia(ctx _context.Context, managerId string, virtualMediaId string) (VirtualMedia, *_nethttp.Response, error)
- func (a *DefaultApiService) GetRoot(ctx _context.Context) (Root, *_nethttp.Response, error)
- func (a *DefaultApiService) GetSystem(ctx _context.Context, systemId string) (ComputerSystem, *_nethttp.Response, error)
- func (a *DefaultApiService) InsertVirtualMedia(ctx _context.Context, managerId string, virtualMediaId string, ...) (RedfishError, *_nethttp.Response, error)
- func (a *DefaultApiService) ListManagerVirtualMedia(ctx _context.Context, managerId string) (Collection, *_nethttp.Response, error)
- func (a *DefaultApiService) ListManagers(ctx _context.Context) (Collection, *_nethttp.Response, error)
- func (a *DefaultApiService) ListSystems(ctx _context.Context) (Collection, *_nethttp.Response, error)
- func (a *DefaultApiService) ResetSystem(ctx _context.Context, computerSystemId string, ...) (RedfishError, *_nethttp.Response, error)
- func (a *DefaultApiService) SetSystem(ctx _context.Context, systemId string, computerSystem ComputerSystem) (ComputerSystem, *_nethttp.Response, error)
- type GenericOpenAPIError
- type Health
- type IdRef
- type IndicatorLed
- type InsertMediaRequestBody
- type Manager
- type ManagerLinks
- type ManagerType
- type MemorySummary
- type Message
- type PowerState
- type ProcessorSummary
- type RedfishError
- type RedfishErrorError
- type ResetRequestBody
- type ResetType
- type Root
- type State
- type Status
- type SystemLinks
- type TransferMethod
- type TransferProtocolType
- type VirtualMedia
- type VirtualMediaActions
- type VirtualMediaActionsVirtualMediaEjectMedia
Constants ¶
This section is empty.
Variables ¶
var ( // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. ContextOAuth2 = contextKey("token") // ContextBasicAuth takes BasicAuth as authentication for the request. ContextBasicAuth = contextKey("basic") // ContextAccessToken takes a string oauth2 access token as authentication for the request. ContextAccessToken = contextKey("accesstoken") // ContextAPIKey takes an APIKey as authentication for the request ContextAPIKey = contextKey("apikey") )
Functions ¶
Types ¶
type APIClient ¶
type APIClient struct { DefaultApi *DefaultApiService // contains filtered or unexported fields }
APIClient manages communication with the Redfish OAPI specification API v0.0.1 In most cases there should be only one, shared, APIClient.
func NewAPIClient ¶
func NewAPIClient(cfg *Configuration) *APIClient
NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.
func (*APIClient) ChangeBasePath ¶
Change base path to allow switching to mocks
type APIKey ¶
APIKey provides API key based authentication to a request passed via context using ContextAPIKey
type APIResponse ¶
type APIResponse struct { *http.Response `json:"-"` Message string `json:"message,omitempty"` // Operation is the name of the OpenAPI operation. Operation string `json:"operation,omitempty"` // RequestURL is the request URL. This value is always available, even if the // embedded *http.Response is nil. RequestURL string `json:"url,omitempty"` // Method is the HTTP method used for the request. This value is always // available, even if the embedded *http.Response is nil. Method string `json:"method,omitempty"` // Payload holds the contents of the response body (which may be nil or empty). // This is provided here as the raw response.Body() reader will have already // been drained. Payload []byte `json:"-"` }
func NewAPIResponse ¶
func NewAPIResponse(r *http.Response) *APIResponse
func NewAPIResponseWithError ¶
func NewAPIResponseWithError(errorMessage string) *APIResponse
type BasicAuth ¶
type BasicAuth struct { UserName string `json:"userName,omitempty"` Password string `json:"password,omitempty"` }
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
type Boot ¶
type Boot struct { BootSourceOverrideEnabled BootSourceOverrideEnabled `json:"BootSourceOverrideEnabled,omitempty"` BootSourceOverrideTarget BootSource `json:"BootSourceOverrideTarget,omitempty"` BootSourceOverrideTargetRedfishAllowableValues []BootSource `json:"BootSourceOverrideTarget@Redfish.AllowableValues,omitempty"` }
type BootSource ¶
type BootSource string
const ( BOOTSOURCE_NONE BootSource = "None" BOOTSOURCE_PXE BootSource = "Pxe" BOOTSOURCE_FLOPPY BootSource = "Floppy" BOOTSOURCE_CD BootSource = "Cd" BOOTSOURCE_USB BootSource = "Usb" BOOTSOURCE_HDD BootSource = "Hdd" BOOTSOURCE_BIOS_SETUP BootSource = "BiosSetup" BOOTSOURCE_UTILITIES BootSource = "Utilities" BOOTSOURCE_DIAGS BootSource = "Diags" BOOTSOURCE_UEFI_SHELL BootSource = "UefiShell" BOOTSOURCE_UEFI_TARGET BootSource = "UefiTarget" BOOTSOURCE_SD_CARD BootSource = "SDCard" BOOTSOURCE_UEFI_HTTP BootSource = "UefiHttp" BOOTSOURCE_REMOTE_DRIVE BootSource = "RemoteDrive" BOOTSOURCE_UEFI_BOOT_NEXT BootSource = "UefiBootNext" )
List of BootSource
type BootSourceOverrideEnabled ¶
type BootSourceOverrideEnabled string
const ( BOOTSOURCEOVERRIDEENABLED_ONCE BootSourceOverrideEnabled = "Once" BOOTSOURCEOVERRIDEENABLED_CONTINUOUS BootSourceOverrideEnabled = "Continuous" )
List of BootSourceOverrideEnabled
type Collection ¶
type Collection struct { // context OdataContext string `json:"@odata.context,omitempty"` // etag OdataEtag string `json:"@odata.etag,omitempty"` // id OdataId string `json:"@odata.id"` // type OdataType string `json:"@odata.type"` // description Description *string `json:"Description,omitempty"` // Contains the members of this collection. Members []IdRef `json:"Members"` // The number of items in a collection. MembersodataCount int32 `json:"Members@odata.count,omitempty"` // The URI to the resource containing the next set of partial members. MembersodataNextLink string `json:"Members@odata.nextLink,omitempty"` // The name of the resource. Name string `json:"Name"` }
A Collection of ComputerSystem resource instances.
type ComputerSystem ¶
type ComputerSystem struct { // The name of the resource. Id string `json:"Id,omitempty"` // The name of the resource. Name string `json:"Name"` // redfish version RedfishVersion string `json:"RedfishVersion,omitempty"` UUID string `json:"UUID,omitempty"` // The type of a resource. OdataType string `json:"@odata.type"` // The unique identifier for a resource. OdataId string `json:"@odata.id"` // The OData description of a payload. OdataContext string `json:"@odata.context,omitempty"` // redfish copyright RedfishCopyright string `json:"@Redfish.Copyright,omitempty"` Bios IdRef `json:"Bios,omitempty"` Processors IdRef `json:"Processors,omitempty"` Memory IdRef `json:"Memory,omitempty"` EthernetInterfaces IdRef `json:"EthernetInterfaces,omitempty"` SimpleStorage IdRef `json:"SimpleStorage,omitempty"` PowerState PowerState `json:"PowerState,omitempty"` Status Status `json:"Status,omitempty"` Boot Boot `json:"Boot,omitempty"` ProcessorSummary ProcessorSummary `json:"ProcessorSummary,omitempty"` MemorySummary MemorySummary `json:"MemorySummary,omitempty"` IndicatorLED IndicatorLed `json:"IndicatorLED,omitempty"` Links SystemLinks `json:"Links,omitempty"` Actions ComputerSystemActions `json:"Actions,omitempty"` }
Root redfish path.
type ComputerSystemActions ¶
type ComputerSystemActions struct {
ComputerSystemReset ComputerSystemReset `json:"#ComputerSystem.Reset,omitempty"`
}
type ComputerSystemReset ¶
type Configuration ¶
type Configuration struct { BasePath string `json:"basePath,omitempty"` Host string `json:"host,omitempty"` Scheme string `json:"scheme,omitempty"` DefaultHeader map[string]string `json:"defaultHeader,omitempty"` UserAgent string `json:"userAgent,omitempty"` HTTPClient *http.Client }
func NewConfiguration ¶
func NewConfiguration() *Configuration
func (*Configuration) AddDefaultHeader ¶
func (c *Configuration) AddDefaultHeader(key string, value string)
type ConnectedVia ¶
type ConnectedVia string
const ( CONNECTEDVIA_NOT_CONNECTED ConnectedVia = "NotConnected" CONNECTEDVIA_URI ConnectedVia = "URI" CONNECTEDVIA_APPLET ConnectedVia = "Applet" CONNECTEDVIA_OEM ConnectedVia = "Oem" )
List of ConnectedVia
type DefaultApiService ¶
type DefaultApiService service
func (*DefaultApiService) EjectVirtualMedia ¶
func (a *DefaultApiService) EjectVirtualMedia(ctx _context.Context, managerId string, virtualMediaId string, body map[string]interface{}) (RedfishError, *_nethttp.Response, error)
DefaultApiService
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param managerId ID of resource
- @param virtualMediaId ID of resource
- @param body
@return RedfishError
func (*DefaultApiService) GetManager ¶
func (a *DefaultApiService) GetManager(ctx _context.Context, managerId string) (Manager, *_nethttp.Response, error)
DefaultApiService
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param managerId ID of resource
@return Manager
func (*DefaultApiService) GetManagerVirtualMedia ¶
func (a *DefaultApiService) GetManagerVirtualMedia(ctx _context.Context, managerId string, virtualMediaId string) (VirtualMedia, *_nethttp.Response, error)
DefaultApiService
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param managerId ID of resource
- @param virtualMediaId ID of resource
@return VirtualMedia
func (*DefaultApiService) GetRoot ¶
DefaultApiService
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return Root
func (*DefaultApiService) GetSystem ¶
func (a *DefaultApiService) GetSystem(ctx _context.Context, systemId string) (ComputerSystem, *_nethttp.Response, error)
DefaultApiService
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param systemId ID of resource
@return ComputerSystem
func (*DefaultApiService) InsertVirtualMedia ¶
func (a *DefaultApiService) InsertVirtualMedia(ctx _context.Context, managerId string, virtualMediaId string, insertMediaRequestBody InsertMediaRequestBody) (RedfishError, *_nethttp.Response, error)
DefaultApiService
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param managerId ID of resource
- @param virtualMediaId ID of resource
- @param insertMediaRequestBody
@return RedfishError
func (*DefaultApiService) ListManagerVirtualMedia ¶
func (a *DefaultApiService) ListManagerVirtualMedia(ctx _context.Context, managerId string) (Collection, *_nethttp.Response, error)
DefaultApiService
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param managerId ID of resource
@return Collection
func (*DefaultApiService) ListManagers ¶
func (a *DefaultApiService) ListManagers(ctx _context.Context) (Collection, *_nethttp.Response, error)
DefaultApiService
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return Collection
func (*DefaultApiService) ListSystems ¶
func (a *DefaultApiService) ListSystems(ctx _context.Context) (Collection, *_nethttp.Response, error)
DefaultApiService
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return Collection
func (*DefaultApiService) ResetSystem ¶
func (a *DefaultApiService) ResetSystem(ctx _context.Context, computerSystemId string, resetRequestBody ResetRequestBody) (RedfishError, *_nethttp.Response, error)
DefaultApiService
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param computerSystemId
- @param resetRequestBody
@return RedfishError
func (*DefaultApiService) SetSystem ¶
func (a *DefaultApiService) SetSystem(ctx _context.Context, systemId string, computerSystem ComputerSystem) (ComputerSystem, *_nethttp.Response, error)
DefaultApiService
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param systemId ID of resource
- @param computerSystem
@return ComputerSystem
type GenericOpenAPIError ¶
type GenericOpenAPIError struct {
// contains filtered or unexported fields
}
GenericOpenAPIError Provides access to the body, error and model on returned errors.
func (GenericOpenAPIError) Body ¶
func (e GenericOpenAPIError) Body() []byte
Body returns the raw bytes of the response
func (GenericOpenAPIError) Error ¶
func (e GenericOpenAPIError) Error() string
Error returns non-empty string if there was an error.
func (GenericOpenAPIError) Model ¶
func (e GenericOpenAPIError) Model() interface{}
Model returns the unpacked model of the error
type IdRef ¶
type IdRef struct { // The unique identifier for a resource. OdataId string `json:"@odata.id,omitempty"` }
A reference to a resource.
type IndicatorLed ¶
type IndicatorLed string
const ( INDICATORLED_UNKNOWN IndicatorLed = "Unknown" INDICATORLED_LIT IndicatorLed = "Lit" INDICATORLED_BLINKING IndicatorLed = "Blinking" INDICATORLED_OFF IndicatorLed = "Off" )
List of IndicatorLED
type InsertMediaRequestBody ¶
type InsertMediaRequestBody struct { Image string `json:"Image"` Inserted bool `json:"Inserted,omitempty"` Password string `json:"Password,omitempty"` TransferMethod TransferMethod `json:"TransferMethod,omitempty"` TransferProtocolType TransferProtocolType `json:"TransferProtocolType,omitempty"` UserName string `json:"UserName,omitempty"` WriteProtected bool `json:"WriteProtected,omitempty"` }
type Manager ¶
type Manager struct { // The name of the resource. Id string `json:"Id,omitempty"` // The name of the resource. Name string `json:"Name"` UUID string `json:"UUID,omitempty"` ServiceEntryPointUUID string `json:"ServiceEntryPointUUID,omitempty"` // The type of a resource. OdataType string `json:"@odata.type"` // The unique identifier for a resource. OdataId string `json:"@odata.id"` // The OData description of a payload. OdataContext string `json:"@odata.context,omitempty"` // redfish copyright RedfishCopyright string `json:"@Redfish.Copyright,omitempty"` Model *string `json:"Model,omitempty"` ManagerType ManagerType `json:"ManagerType,omitempty"` Status Status `json:"Status,omitempty"` DateTime *string `json:"DateTime,omitempty"` // The time offset from UTC that the DateTime property is set to in format: +06:00 . DateTimeLocalOffset *string `json:"DateTimeLocalOffset,omitempty"` // description Description *string `json:"Description,omitempty"` EthernetInterfaces IdRef `json:"EthernetInterfaces,omitempty"` FirmwareVersion *string `json:"FirmwareVersion,omitempty"` Links ManagerLinks `json:"Links,omitempty"` PowerState PowerState `json:"PowerState,omitempty"` VirtualMedia IdRef `json:"VirtualMedia,omitempty"` }
Redfish manager resource.
type ManagerLinks ¶
type ManagerType ¶
type ManagerType string
const ( MANAGERTYPE_MANAGEMENT_CONTROLLER ManagerType = "ManagementController" MANAGERTYPE_ENCLOSURE_MANAGER ManagerType = "EnclosureManager" MANAGERTYPE_BMC ManagerType = "BMC" MANAGERTYPE_RACK_MANAGER ManagerType = "RackManager" MANAGERTYPE_AUXILIARY_CONTROLLER ManagerType = "AuxiliaryController" MANAGERTYPE_SERVICE ManagerType = "Service" )
List of ManagerType
type MemorySummary ¶
type Message ¶
type Message struct { Message string `json:"Message,omitempty"` MessageArgs []string `json:"MessageArgs,omitempty"` MessageId string `json:"MessageId"` RelatedProperties []string `json:"RelatedProperties,omitempty"` Resolution string `json:"Resolution,omitempty"` Severity string `json:"Severity,omitempty"` }
type PowerState ¶
type PowerState string
const ( POWERSTATE_TRUE PowerState = "true" POWERSTATE_FALSE PowerState = "false" POWERSTATE_POWERING_ON PowerState = "PoweringOn" POWERSTATE_POWERING_OFF PowerState = "PoweringOff" )
List of PowerState
type ProcessorSummary ¶
type RedfishError ¶
type RedfishError struct {
Error RedfishErrorError `json:"error"`
}
Contains an error payload from a Redfish Service.
type RedfishErrorError ¶
type ResetRequestBody ¶
type ResetRequestBody struct {
ResetType ResetType `json:"ResetType,omitempty"`
}
type ResetType ¶
type ResetType string
const ( RESETTYPE_ON ResetType = "On" RESETTYPE_FORCE_OFF ResetType = "ForceOff" RESETTYPE_GRACEFUL_SHUTDOWN ResetType = "GracefulShutdown" RESETTYPE_GRACEFUL_RESTART ResetType = "GracefulRestart" RESETTYPE_FORCE_RESTART ResetType = "ForceRestart" RESETTYPE_NMI ResetType = "Nmi" RESETTYPE_FORCE_ON ResetType = "ForceOn" RESETTYPE_PUSH_POWER_BUTTON ResetType = "PushPowerButton" RESETTYPE_POWER_CYCLE ResetType = "PowerCycle" )
List of ResetType
type Root ¶
type Root struct { // The name of the resource. Id string `json:"Id,omitempty"` // The name of the resource. Name string `json:"Name"` // redfish version RedfishVersion string `json:"RedfishVersion,omitempty"` UUID string `json:"UUID,omitempty"` // The type of a resource. OdataType string `json:"@odata.type"` // The unique identifier for a resource. OdataId string `json:"@odata.id"` // redfish copyright RedfishCopyright string `json:"@Redfish.Copyright,omitempty"` Systems IdRef `json:"Systems,omitempty"` Managers IdRef `json:"Managers,omitempty"` }
Root redfish path.
type State ¶
type State string
const ( STATE_ENABLED State = "Enabled" STATE_DISABLED State = "Disabled" STATE_STANDBY_OFFLINE State = "StandbyOffline" STATE_STANDBY_SPARE State = "StandbySpare" STATE_IN_TEST State = "InTest" STATE_STARTING State = "Starting" STATE_ABSENT State = "Absent" STATE_UNAVAILABLE_OFFLINE State = "UnavailableOffline" STATE_DEFERRING State = "Deferring" STATE_QUIESCED State = "Quiesced" STATE_UPDATING State = "Updating" )
List of State
type SystemLinks ¶
type TransferMethod ¶
type TransferMethod string
const ( TRANSFERMETHOD_STREAM TransferMethod = "Stream" TRANSFERMETHOD_UPLOAD TransferMethod = "Upload" )
List of TransferMethod
type TransferProtocolType ¶
type TransferProtocolType string
const ( TRANSFERPROTOCOLTYPE_CIFS TransferProtocolType = "CIFS" TRANSFERPROTOCOLTYPE_FTP TransferProtocolType = "FTP" TRANSFERPROTOCOLTYPE_SFTP TransferProtocolType = "SFTP" TRANSFERPROTOCOLTYPE_HTTP TransferProtocolType = "HTTP" TRANSFERPROTOCOLTYPE_HTTPS TransferProtocolType = "HTTPS" TRANSFERPROTOCOLTYPE_NFS TransferProtocolType = "NFS" TRANSFERPROTOCOLTYPE_SCP TransferProtocolType = "SCP" TRANSFERPROTOCOLTYPE_TFTP TransferProtocolType = "TFTP" )
List of TransferProtocolType
type VirtualMedia ¶
type VirtualMedia struct { // The name of the resource. Id string `json:"Id,omitempty"` // The name of the resource. Name string `json:"Name"` // The type of a resource. OdataType string `json:"@odata.type"` // The unique identifier for a resource. OdataId string `json:"@odata.id"` // The OData description of a payload. OdataContext string `json:"@odata.context,omitempty"` // redfish copyright RedfishCopyright string `json:"@Redfish.Copyright,omitempty"` // description Description *string `json:"Description,omitempty"` Image *string `json:"Image,omitempty"` ImageName *string `json:"ImageName,omitempty"` Inserted *bool `json:"Inserted,omitempty"` ConnectedVia ConnectedVia `json:"ConnectedVia,omitempty"` MediaTypes []string `json:"MediaTypes,omitempty"` WriteProtected *bool `json:"WriteProtected,omitempty"` UserName *string `json:"UserName,omitempty"` Password *string `json:"Password,omitempty"` TransferMethod TransferMethod `json:"TransferMethod,omitempty"` TransferProtocolType TransferProtocolType `json:"TransferProtocolType,omitempty"` Actions VirtualMediaActions `json:"Actions,omitempty"` }
Redfish virtual media resource for manager.
type VirtualMediaActions ¶
type VirtualMediaActions struct { VirtualMediaEjectMedia VirtualMediaActionsVirtualMediaEjectMedia `json:"#VirtualMedia.EjectMedia,omitempty"` VirtualMediaInsertMedia VirtualMediaActionsVirtualMediaEjectMedia `json:"#VirtualMedia.InsertMedia,omitempty"` }
type VirtualMediaActionsVirtualMediaEjectMedia ¶
type VirtualMediaActionsVirtualMediaEjectMedia struct { // The unique identifier for a resource. Target string `json:"target,omitempty"` }
Source Files ¶
- api_default.go
- client.go
- configuration.go
- model_boot.go
- model_boot_source.go
- model_boot_source_override_enabled.go
- model_collection.go
- model_computer_system.go
- model_computer_system_actions.go
- model_computer_system_reset.go
- model_connected_via.go
- model_health.go
- model_id_ref.go
- model_indicator_led.go
- model_insert_media_request_body.go
- model_manager.go
- model_manager_links.go
- model_manager_type.go
- model_memory_summary.go
- model_message.go
- model_power_state.go
- model_processor_summary.go
- model_redfish_error.go
- model_redfish_error_error.go
- model_reset_request_body.go
- model_reset_type.go
- model_root.go
- model_state.go
- model_status.go
- model_system_links.go
- model_transfer_method.go
- model_transfer_protocol_type.go
- model_virtual_media.go
- model_virtual_media_actions.go
- model_virtual_media_actions_virtual_media_eject_media.go
- response.go