Documentation ¶
Overview ¶
Package chassis ...
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( //GetDbConnectFunc ... GetDbConnectFunc = common.GetDBConnection //GenericSaveFunc ... GenericSaveFunc = smodel.GenericSave //JSONUnmarshalFunc1 ... JSONUnmarshalFunc1 = json.Unmarshal //JSONUnmarshalFunc2 ... JSONUnmarshalFunc2 = json.Unmarshal //JSONUnmarshalFunc3 ... JSONUnmarshalFunc3 = json.Unmarshal //JSONUnmarshalFunc4 ... JSONUnmarshalFunc4 = json.Unmarshal //StrconvUnquote ... StrconvUnquote = strconv.Unquote //JSONMarshalFunc ... JSONMarshalFunc = json.Marshal //GetResourceFunc ... GetResourceFunc = smodel.GetResource )
var ( //SmodelFindAllFunc ... SmodelFindAllFunc = smodel.FindAll //FindAllPluginsFunc ... FindAllPluginsFunc = findAllPlugins )
var ( //JSONUnmarshalFunc ... JSONUnmarshalFunc = json.Unmarshal //RequestParamsCaseValidatorFunc ... RequestParamsCaseValidatorFunc = common.RequestParamsCaseValidator )
var (
//ContactPluginFunc ...
ContactPluginFunc = contactPlugin
)
var ( // GetResourceInfoFromDeviceFunc function pointer for the scommon.GetResourceInfoFromDevice GetResourceInfoFromDeviceFunc = scommon.GetResourceInfoFromDevice )
Functions ¶
This section is empty.
Types ¶
type Create ¶
type Create struct {
// contains filtered or unexported fields
}
Create struct helps to create chassis
func NewCreateHandler ¶
func NewCreateHandler(createPluginClient plugin.ClientFactory) *Create
NewCreateHandler returns an instance of Create struct
func (*Create) Handle ¶
func (h *Create) Handle(ctx context.Context, req *chassisproto.CreateChassisRequest) response.RPC
Handle defines the operations which handle the RPC request-response for creating a chassis
type Delete ¶
type Delete struct {
// contains filtered or unexported fields
}
Delete struct helps to delete chassis
func NewDeleteHandler ¶
func NewDeleteHandler(createPluginClient plugin.ClientFactory, finder func(Table string, key string, r interface{}) *errors.Error) *Delete
NewDeleteHandler returns an instance of Delete struct
func (*Delete) Handle ¶
func (d *Delete) Handle(ctx context.Context, req *chassisproto.DeleteChassisRequest) response.RPC
Handle defines the operations which handle the RPC request-response for deleting a chassis
type Get ¶
type Get struct {
// contains filtered or unexported fields
}
Get struct helps to get chassis resource information
func NewGetHandler ¶
func NewGetHandler( pluginClientCreator plugin.ClientFactory, inMemoryDBFinder func(table, key string, r interface{}) *errors.Error) *Get
NewGetHandler returns an instance of Get Struct
func (*Get) Handle ¶
func (h *Get) Handle(ctx context.Context, req *chassisproto.GetChassisRequest) response.RPC
Handle is used to fetch resource data. The function is supposed to be used as part of RPC For getting chassis resource information, parameters need to be passed Request . Request holds the Uuid and Url , Url will be parsed from that search key will created There will be two return values for the function. One is the RPC response, which contains the status code, status message, headers and body and the second value is error.
type GetCollection ¶
type GetCollection struct {
// contains filtered or unexported fields
}
GetCollection struct helps to get chassis collection information
func NewGetCollectionHandler ¶
func NewGetCollectionHandler( pcf plugin.ClientFactory, imkp func(table string) ([]string, error)) *GetCollection
NewGetCollectionHandler returns an instance of GetCollection struct
type PluginContact ¶
type PluginContact struct { ContactClient func(context.Context, string, string, string, string, interface{}, map[string]string) (*http.Response, error) DecryptPassword func([]byte) ([]byte, error) GetPluginStatus func(context.Context, smodel.Plugin) bool }
PluginContact struct to inject the pmb client function into the handlers
func (*PluginContact) GetChassisResource ¶
func (p *PluginContact) GetChassisResource(ctx context.Context, req *chassisproto.GetChassisRequest) (response.RPC, error)
GetChassisResource is used to fetch resource data. The function is supposed to be used as part of RPC For getting chassis resource information, parameters need to be passed Request . Request holds the Uuid and Url , Url will be parsed from that search key will created There will be two return values for the fuction. One is the RPC response, which contains the status code, status message, headers and body and the second value is error.
type PluginToken ¶
PluginToken interface to hold the token
var Token PluginToken
Token variable hold the all the XAuthToken against the plguin ID
type Update ¶
type Update struct {
// contains filtered or unexported fields
}
Update struct helps to update chassis
func NewUpdateHandler ¶
func NewUpdateHandler(pluginClientFactory plugin.ClientFactory) *Update
NewUpdateHandler returns an instance of Update struct