evresponse

package
v0.0.0-...-81c02da Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package evresponse have error and response struct and also have functionality to create error response

Package evresponse have error and response struct and also have functionality to create error response

Package evresponse have error and response struct and also have functionality to create error response

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Target          string   `json:"target"`
	AllowableValues []string `json:"EventType@Redfish.AllowableValues"`
}

Action struct definition

type Actions

type Actions struct {
	SubmitTestEvent Action `json:"#EventService.SubmitTestEvent"`
	Oem             Oem    `json:"Oem"`
}

Actions struct definition

type Error

type Error struct {
	Code                string            `json:"Code"`
	Message             string            `json:"Message"`
	MessageExtendedInfo []MsgExtendedInfo `json:"@Message.ExtendedInfo"`
}

Error struct is standard response struct

type ErrorResponse

type ErrorResponse struct {
	Error Error `json:"Error"`
}

ErrorResponse struct is response Error struct

func CreateErrorResponse

func CreateErrorResponse(message string) ErrorResponse

CreateErrorResponse will accrpts the message string and create standard error resopnse

type EventResponse

type EventResponse struct {
	StatusCode int         `json:"StatusCode"`
	Location   string      `json:"Location"`
	Response   interface{} `json:"Response"`
}

EventResponse is response struct

type EventServiceResponse

type EventServiceResponse struct {
	OdataContext                      string                        `json:"@odata.context,omitempty"`
	Etag                              string                        `json:"@odata.etag,omitempty"`
	ID                                string                        `json:"Id"`
	OdataID                           string                        `json:"@odata.id"`
	OdataType                         string                        `json:"@odata.type"`
	Name                              string                        `json:"Name"`
	Description                       string                        `json:"Description,omitempty"`
	Actions                           Actions                       `json:"Actions,omitempty"`
	DeliveryRetryAttempts             int                           `json:"DeliveryRetryAttempts"`
	DeliveryRetryIntervalSeconds      int                           `json:"DeliveryRetryIntervalSeconds"`
	EventFormatTypes                  []string                      `json:"EventFormatTypes"`
	EventTypesForSubscription         []string                      `json:"EventTypesForSubscription"` // Deprecated v1.3
	RegistryPrefixes                  []string                      `json:"RegistryPrefixes"`          //Removed omitempty as this is mandatory property for OCP
	ResourceTypes                     []string                      `json:"ResourceTypes"`
	ServerSentEventURI                string                        `json:"ServerSentEventUri,omitempty"`
	ServiceEnabled                    bool                          `json:"ServiceEnabled,omitempty"`
	SSEFilterPropertiesSupported      *SSEFilterPropertiesSupported `json:"SSEFilterPropertiesSupported,omitempty"`
	Status                            Status                        `json:"Status,omitempty"`
	SubordinateResourcesSupported     bool                          `json:"SubordinateResourcesSupported,omitempty"`
	Subscriptions                     Subscriptions                 `json:"Subscriptions,omitempty"`
	Oem                               Oem                           `json:"Oem,omitempty"`
	IncludeOriginOfConditionSupported bool                          `json:"IncludeOriginOfConditionSupported,omitempty"`
	SMTP                              *SMTP                         `json:"SMTP,omitempty"`
	ExcludeRegistryPrefix             bool                          `json:"ExcludeRegistryPrefix,omitempty"`
	ExcludeMessageID                  bool                          `json:"ExcludeMessageId,omitempty"`
}

EventServiceResponse is struct for event service response

type ListResponse

type ListResponse struct {
	OdataContext string       `json:"@odata.context"`
	Etag         string       `json:"@odata.etag,omitempty"`
	OdataID      string       `json:"@odata.id"`
	OdataType    string       `json:"@odata.type"`
	Name         string       `json:"Name,omitempty"`
	Description  string       `json:"Description,omitempty"`
	MembersCount int          `json:"Members@odata.count"`
	Members      []model.Link `json:"Members"`
}

ListResponse define list for odimra

type MsgExtendedInfo

type MsgExtendedInfo struct {
	MessageID   string   `json:"MessageId,omitempty"`
	Message     string   `json:"Message,omitempty"`
	MessageArgs []string `json:"MessageArgs,omitempty"`
	OdataType   string   `json:"@odata.type,omitempty"`
	Severity    string   `json:"Severity,omitempty"`
	Resolution  string   `json:"Resolution,omitempty"`
}

MsgExtendedInfo struct definition

type MutexLock

type MutexLock struct {
	Lock     *sync.Mutex
	Hosts    map[string]string
	Response map[string]EventResponse
}

MutexLock is a struct for mutex lock and Response and hosts

func (*MutexLock) AddResponse

func (r *MutexLock) AddResponse(origin, host string, response EventResponse)

AddResponse will add the response to the map and host to the hosts slice

func (*MutexLock) ReadResponse

func (r *MutexLock) ReadResponse(subscriptionID string) (response.RPC, []string)

ReadResponse will read the response from the response

type Oem

type Oem struct {
}

Oem struct definition placeholder.

type SMTP

type SMTP struct {
	Authentication     string `json:"Authentication,omitempty"`
	ConnectionProtocol string `json:"ConnectionProtocol,omitempty"`
	FromAddress        string `json:"FromAddress,omitempty"`
	Password           string `json:"Password,omitempty"`
	Port               int    `json:"Port,omitempty"`
	ServerAddress      string `json:"ServerAddress,omitempty"`
	ServiceEnabled     bool   `json:"ServiceEnabled,omitempty"`
	Username           string `json:"Username,omitempty"`
}

SMTP is for SMTP event delivery

type SSEFilterPropertiesSupported

type SSEFilterPropertiesSupported struct {
	EventFormatType        bool `json:"EventFormatType"`
	EventType              bool `json:"EventType"` //Deprecated v1.3
	MessageID              bool `json:"MessageId"`
	MetricReportDefinition bool `json:"MetricReportDefinition"`
	OriginResource         bool `json:"OriginResource"`
	RegistryPrefix         bool `json:"RegistryPrefix"`
	ResourceType           bool `json:"ResourceType"`
	SubordinateResources   bool `json:"SubordinateResources"`
}

SSEFilterPropertiesSupported defines set propertis that are supported in the $filter query parameter for the ServerSentEventUri

type Status

type Status struct {
	Health       string `json:"Health"`
	HealthRollup string `json:"HealthRollup"`
	State        string `json:"State"`
}

Status struct definition

type SubscriptionResponse

type SubscriptionResponse struct {
	response.Response
	Destination             string                   `json:"Destination,omitempty"`
	Context                 string                   `json:"Context,omitempty"`
	Protocol                string                   `json:"Protocol,omitempty"`
	EventTypes              []string                 `json:"EventTypes,omitempty"`
	SubscriptionType        dmtf.SubscriptionType    `json:"SubscriptionType,omitempty"`
	MessageIds              []string                 `json:"MessageIds,omitempty"`
	ResourceTypes           []string                 `json:"ResourceTypes,omitempty"`
	OriginResources         []model.Link             `json:"OriginResources,omitempty"`
	ExcludeMessageIds       []string                 `json:"ExcludeMessageIds,omitempty"`
	ExcludeRegistryPrefixes []string                 `json:"ExcludeRegistryPrefixes,omitempty"`
	DeliveryRetryPolicy     dmtf.DeliveryRetryPolicy `json:"DeliveryRetryPolicy,omitempty"`
}

SubscriptionResponse is used to return response to end user

type Subscriptions

type Subscriptions struct {
	OdataID string `json:"@odata.id"`
}

Subscriptions containes link to a resource

Jump to

Keyboard shortcuts

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