broker

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Apache-2.0 Imports: 43 Imported by: 3

Documentation

Overview

Package broker provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.15.0 DO NOT EDIT.

Index

Constants

View Source
const (
	// KanodPoolnameAnnotation is the annotation containing the poolname value
	KanodPoolnameAnnotation string = "kanod.io/poolname"

	// KanodServernameAnnotation is the annotation containing the servername value
	KanodServernameAnnotation string = "kanod.io/servername"

	// KanodRedfishSchemaAnnotation is the annotation containing the redfish-schema value
	KanodRedfishSchemaAnnotation string = "kanod.io/redfish-schema"

	// KanodBmdefNetworkAnnotation is the annotation containing
	// the network attachement names
	KanodBmdefNetworkAnnotation = "kanod.io/networks"

	// KanodPoolNamelabel is the label containing the pool name value
	KanodPoolNamelabel string = "baremetaldef.kanod.io/poolname"

	// KanodServerNamelabel is the label containing the server name  value
	KanodServerNamelabel string = "baremetaldef.kanod.io/servername"

	// NO_ERROR is given back when network assocation succeeds
	NO_ERROR ErrorCode = iota
	// CHECK_CERTIFICATE_ERROR is given back when certificate is wrong
	CHECK_CERTIFICATE_ERROR
	// OTHER_ERROR is an internal error
	OTHER_ERROR
)
View Source
const (
	ACCOUNTS_PATH = "/redfish/v1/AccountService/Accounts"
)

Variables

This section is empty.

Functions

func BrokerDefError added in v0.2.2

func BrokerDefError(w http.ResponseWriter, logger logr.Logger, err error, message string, statusCode int)

func BrokerProxyError added in v0.2.4

func BrokerProxyError(w http.ResponseWriter, logger logr.Logger, err error, message string, statusCode int)

func GetSwagger added in v0.2.3

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func Handler added in v0.2.3

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux added in v0.2.3

func HandlerFromMux(si ServerInterface, r *mux.Router) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL added in v0.2.3

func HandlerFromMuxWithBaseURL(si ServerInterface, r *mux.Router, baseURL string) http.Handler

func HandlerWithOptions added in v0.2.3

func HandlerWithOptions(si ServerInterface, options GorillaServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

func NewCreatePoolRequest added in v0.2.3

func NewCreatePoolRequest(server string, body CreatePoolJSONRequestBody) (*http.Request, error)

NewCreatePoolRequest calls the generic CreatePool builder with application/json body

func NewCreatePoolRequestWithBody added in v0.2.3

func NewCreatePoolRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewCreatePoolRequestWithBody generates requests for CreatePool with any type of body

func NewCreateServerRequest added in v0.2.3

func NewCreateServerRequest(server string, poolid string, body CreateServerJSONRequestBody) (*http.Request, error)

NewCreateServerRequest calls the generic CreateServer builder with application/json body

func NewCreateServerRequestWithBody added in v0.2.3

func NewCreateServerRequestWithBody(server string, poolid string, contentType string, body io.Reader) (*http.Request, error)

NewCreateServerRequestWithBody generates requests for CreateServer with any type of body

func NewDumpRequest added in v0.2.3

func NewDumpRequest(server string) (*http.Request, error)

NewDumpRequest generates requests for Dump

func NewGetAllServersRequest added in v0.2.3

func NewGetAllServersRequest(server string, poolid string) (*http.Request, error)

NewGetAllServersRequest generates requests for GetAllServers

func NewGetPoolRequest added in v0.2.3

func NewGetPoolRequest(server string, poolid string) (*http.Request, error)

NewGetPoolRequest generates requests for GetPool

func NewGetPooluserPasswordRequest added in v0.2.3

func NewGetPooluserPasswordRequest(server string, pooluserid string) (*http.Request, error)

NewGetPooluserPasswordRequest generates requests for GetPooluserPassword

func NewGetServerByIDRequest added in v0.2.3

func NewGetServerByIDRequest(server string, poolid string, serverid string) (*http.Request, error)

NewGetServerByIDRequest generates requests for GetServerByID

func NewHttpClient added in v0.2.4

func NewHttpClient(Certificate string) *http.Client

func NewRemovePoolRequest added in v0.2.3

func NewRemovePoolRequest(server string, poolid string) (*http.Request, error)

NewRemovePoolRequest generates requests for RemovePool

func NewRemoveServerRequest added in v0.2.3

func NewRemoveServerRequest(server string, poolid string, serverid string) (*http.Request, error)

NewRemoveServerRequest generates requests for RemoveServer

func NewSignChallengeRequest added in v0.2.3

func NewSignChallengeRequest(server string, poolid string, body SignChallengeJSONRequestBody) (*http.Request, error)

NewSignChallengeRequest calls the generic SignChallenge builder with application/json body

func NewSignChallengeRequestWithBody added in v0.2.3

func NewSignChallengeRequestWithBody(server string, poolid string, contentType string, body io.Reader) (*http.Request, error)

NewSignChallengeRequestWithBody generates requests for SignChallenge with any type of body

func NewTestVerifySignatureRequest added in v0.2.3

func NewTestVerifySignatureRequest(server string, body TestVerifySignatureJSONRequestBody) (*http.Request, error)

NewTestVerifySignatureRequest calls the generic TestVerifySignature builder with application/json body

func NewTestVerifySignatureRequestWithBody added in v0.2.3

func NewTestVerifySignatureRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewTestVerifySignatureRequestWithBody generates requests for TestVerifySignature with any type of body

func NewVerifySignatureRequest added in v0.2.3

func NewVerifySignatureRequest(server string, body VerifySignatureJSONRequestBody) (*http.Request, error)

NewVerifySignatureRequest calls the generic VerifySignature builder with application/json body

func NewVerifySignatureRequestWithBody added in v0.2.3

func NewVerifySignatureRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewVerifySignatureRequestWithBody generates requests for VerifySignature with any type of body

func PathToRawSpec added in v0.2.3

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

func Sign added in v0.1.5

func Sign(challenge string, logger logr.Logger) (result string, err error)

func ValidateServerDataRequest

func ValidateServerDataRequest(serverValues ServerRequest) error

func Verify added in v0.1.5

func Verify(challenge string, signature string, logger logr.Logger) (err error)

Types

type Account added in v0.1.10

type Account struct {
	Id       string `json:"Id"`
	Name     string `json:"Name"`
	Password string `json:"Password"`
	UserName string `json:"UserName"`
	RoleId   string `json:"RoleId"`
	Locked   bool   `json:"Locked"`
	Enabled  bool   `json:"Enabled"`
}

Account is the go representation of a Redfish account

type AuthRequest

type AuthRequest struct {
	UserName string `json:"username"`
	Password string `json:"password"`
}

type AuthScope added in v0.2.3

type AuthScope string
const (
	PoolBasicAuthScopes AuthScope = "poolBasicAuth.Scopes"
)

type BareMetal added in v0.2.0

type BareMetal struct {
	Id                             string               `json:"id"`
	Url                            string               `json:"url"`
	Username                       string               `json:"username"`
	Password                       string               `json:"password"`
	MacAddress                     string               `json:"macAddress"`
	K8sLabels                      map[string]string    `json:"k8slabels"`
	K8sAnnotations                 map[string]string    `json:"k8sannotations"`
	RootDeviceHints                *bmh.RootDeviceHints `json:"rootDeviceHints,omitempty"`
	DisableCertificateVerification bool                 `json:"disablecertificateverification"`
}

type Broker added in v0.1.10

type Broker struct {
	Client       client.Client
	Log          logr.Logger
	Scheme       *runtime.Scheme
	Pools        map[string]*Pool
	Users        map[string]*User
	Mutex        sync.Mutex
	Namespace    string
	BrokerImplem BrokerImplem
}

Broker implements a broker server that is used as a backend by BareMetalPools to retrieve access to servers

func NewBroker added in v0.1.10

func NewBroker(client client.Client, logr logr.Logger, scheme *runtime.Scheme, brokerImplem BrokerImplem) *Broker

NewBroker creates the structure associated to a redfish broker server.

func (*Broker) AddLabelsAndAnnotations added in v0.2.2

func (b *Broker) AddLabelsAndAnnotations(baremetalName string, namespace string, poolId string, serverId string, schema string) (*brokerv1.BareMetalDef, error)

func (*Broker) AddServerInPoolStore added in v0.2.3

func (b *Broker) AddServerInPoolStore(poolname string, serverdata *ServerData)

func (*Broker) AddUserInUserStore added in v0.2.3

func (b *Broker) AddUserInUserStore(user *User)

func (*Broker) AssociateServerToPool added in v0.2.2

func (b *Broker) AssociateServerToPool(poolId string, serverId string, bareMetalDef brokerv1.BareMetalDef, schema string) error

func (*Broker) BookOneServer added in v0.2.3

func (b *Broker) BookOneServer(pool *brokerv1.PoolDef) (bool, error)

func (*Broker) CreateNewPoolInPoolStore added in v0.2.3

func (b *Broker) CreateNewPoolInPoolStore(pool Pool)

func (*Broker) CreatePool added in v0.1.10

func (b *Broker) CreatePool(w http.ResponseWriter, r *http.Request)

func (*Broker) CreateServer added in v0.2.3

func (b *Broker) CreateServer(w http.ResponseWriter, r *http.Request, poolId string)

func (*Broker) DeleteBareMetal added in v0.2.0

func (b *Broker) DeleteBareMetal(baremetalName string, log logr.Logger) error

func (*Broker) DeletePoolInPoolStore added in v0.2.3

func (b *Broker) DeletePoolInPoolStore(poolId string)

func (*Broker) DeleteUserInPoolStore added in v0.2.3

func (b *Broker) DeleteUserInPoolStore(userId string, logger logr.Logger)

func (*Broker) DisassociateServerFromPool added in v0.2.3

func (b *Broker) DisassociateServerFromPool(serverId string, poolId string)

func (*Broker) Dump added in v0.2.3

func (b *Broker) Dump(w http.ResponseWriter, r *http.Request)

func (*Broker) GetAllServers added in v0.2.3

func (b *Broker) GetAllServers(w http.ResponseWriter, r *http.Request, poolId string)

func (*Broker) GetPool added in v0.2.3

func (b *Broker) GetPool(w http.ResponseWriter, r *http.Request, poolId string)

func (*Broker) GetPoolResponse added in v0.1.10

func (b *Broker) GetPoolResponse(pool *brokerv1.PoolDef) *PoolResponse

func (*Broker) GetPoolUser added in v0.2.3

func (b *Broker) GetPoolUser(poolUserName string) (*brokerv1.PoolUser, error)

func (*Broker) GetPooluserPassword added in v0.2.3

func (b *Broker) GetPooluserPassword(w http.ResponseWriter, r *http.Request, poolUserId string)

func (*Broker) GetSecret added in v0.2.3

func (b *Broker) GetSecret(secretName string) (*corev1.Secret, error)

func (*Broker) GetServerByID added in v0.2.3

func (b *Broker) GetServerByID(w http.ResponseWriter, r *http.Request, poolId string, serverId string)

func (*Broker) GetServerResponse added in v0.1.10

func (b *Broker) GetServerResponse(bmdef *brokerv1.BareMetalDef) *ServerResponse

func (*Broker) HandleBrokerApiRequests added in v0.1.10

func (b *Broker) HandleBrokerApiRequests()

func (*Broker) InitBrokerData added in v0.1.10

func (b *Broker) InitBrokerData(restConfig *rest.Config, setupLog logr.Logger) error

func (*Broker) IsBrokerDataEmpty added in v0.1.10

func (b *Broker) IsBrokerDataEmpty() bool

func (*Broker) PoolFound added in v0.1.10

func (b *Broker) PoolFound(name string) bool

func (*Broker) ReleaseOneServer added in v0.2.3

func (b *Broker) ReleaseOneServer(pool *brokerv1.PoolDef) error

func (*Broker) RemovePool added in v0.2.3

func (b *Broker) RemovePool(w http.ResponseWriter, r *http.Request, poolId string)

func (*Broker) RemoveServer added in v0.2.3

func (b *Broker) RemoveServer(w http.ResponseWriter, r *http.Request, poolId string, serverId string)

func (*Broker) RetrieveAllPools added in v0.1.10

func (b *Broker) RetrieveAllPools() ([]PoolResponse, error)

func (*Broker) RetrieveAllServers added in v0.1.10

func (b *Broker) RetrieveAllServers(poolId string) []ServerResponse

func (*Broker) ServerFound added in v0.1.10

func (b *Broker) ServerFound(name string, poolid string) bool

func (*Broker) SignChallenge added in v0.2.3

func (b *Broker) SignChallenge(w http.ResponseWriter, r *http.Request, poolId string)

func (*Broker) TestVerifySignature added in v0.2.3

func (b *Broker) TestVerifySignature(w http.ResponseWriter, r *http.Request)

func (*Broker) UpdatePoolValuesInPoolStore added in v0.2.3

func (b *Broker) UpdatePoolValuesInPoolStore(name string, poolValues Pool)

func (*Broker) UpdateUserUsage added in v0.2.3

func (b *Broker) UpdateUserUsage(userId string, namespace string) error

func (*Broker) VerifyPoolAuthent added in v0.1.10

func (b *Broker) VerifyPoolAuthent(username string, password string, poolId string) bool

func (*Broker) VerifySignature added in v0.1.10

func (b *Broker) VerifySignature(w http.ResponseWriter, r *http.Request)

func (*Broker) VerifyUserAuthent added in v0.1.10

func (b *Broker) VerifyUserAuthent(username string, password string) bool

//////////////////////////////////////////////////////////////

type BrokerAuth added in v0.1.10

type BrokerAuth struct {
	Broker *Broker
}

BrokerAuth is the type of the implementation of a Redfish broker using ephemeral accounts to virtualize the BMC of a server.

func (*BrokerAuth) BookServer added in v0.1.10

func (bp *BrokerAuth) BookServer(poolUserName string, poolUserSecret string, server *brokerv1.BareMetalDef) error

func (*BrokerAuth) CreateAccount added in v0.1.10

func (ba *BrokerAuth) CreateAccount(bmh *brokerv1.BareMetalDef, username string, password string) error

CreateAccount creates an account on a baremetal host. username and password are the credentials of the newly created account.

func (*BrokerAuth) FindAccount added in v0.1.10

func (ba *BrokerAuth) FindAccount(redfishClient *RedfishClient, username string) (string, error)

FindAccount

func (*BrokerAuth) GetComponents added in v0.1.10

func (ba *BrokerAuth) GetComponents(client *RedfishClient, target string) ([]string, error)

GetComponents gives back all the paths of a redfish collection.

func (*BrokerAuth) GetRedfishClient added in v0.1.10

func (ba *BrokerAuth) GetRedfishClient(bmh *brokerv1.BareMetalDef) (*RedfishClient, error)

GetRedfishClient builds a redfish client from a baremetalhost specification.

func (*BrokerAuth) Init added in v0.1.10

func (bp *BrokerAuth) Init(b *Broker, r *mux.Router)

func (*BrokerAuth) ReleaseServer added in v0.1.10

func (bp *BrokerAuth) ReleaseServer(poolUserName string, server *brokerv1.BareMetalDef) error

func (*BrokerAuth) RemoveAccount added in v0.1.10

func (ba *BrokerAuth) RemoveAccount(bmh *brokerv1.BareMetalDef, username string) error

RemoveAccount removes a redfish account on a baremetal host knowing the username of the account.

func (*BrokerAuth) ServerResponse added in v0.1.10

func (bp *BrokerAuth) ServerResponse(bareMetalDef *brokerv1.BareMetalDef) *ServerResponse

type BrokerImplem added in v0.1.10

type BrokerImplem interface {
	// Init initializes the specific implementation with the broker structure
	// and the base router so that new function can be provided.
	Init(b *Broker, r *mux.Router)
	// Synthesize the specific response for a given implementation.
	ServerResponse(bareMetalDef *brokerv1.BareMetalDef) *ServerResponse
	// Operations specific to an implementation performed when baremetal is booked.
	BookServer(poolUserName string, poolUserSecret string, server *brokerv1.BareMetalDef) error
	// Operations specific to an implementation performed when baremetal is released
	ReleaseServer(poolUserName string, server *brokerv1.BareMetalDef) error
}

BrokerImplem is the inteface that hides the specific implementation of the proxy or the authentication back-end that creates accounts.

type BrokerProxy added in v0.1.10

type BrokerProxy struct {
	RedfishDomain string
	Broker        *Broker
}

BrokerProxy is the type of the implementation of a Redfish broker using a proxy to virtualize the BMC of servers.

func (*BrokerProxy) BookServer added in v0.1.10

func (bp *BrokerProxy) BookServer(poolUserName string, poolUserSecret string, server *brokerv1.BareMetalDef) error

func (*BrokerProxy) Init added in v0.1.10

func (bp *BrokerProxy) Init(b *Broker, r *mux.Router)

func (*BrokerProxy) ReleaseServer added in v0.1.10

func (bp *BrokerProxy) ReleaseServer(poolUserName string, server *brokerv1.BareMetalDef) error

func (*BrokerProxy) ServerResponse added in v0.1.10

func (bp *BrokerProxy) ServerResponse(bareMetalDef *brokerv1.BareMetalDef) *ServerResponse

type ChallengeRequest added in v0.1.5

type ChallengeRequest struct {
	// Challenge challenge
	Challenge string `json:"challenge"`
}

ChallengeRequest defines model for ChallengeRequest.

type ChallengeResponse added in v0.1.5

type ChallengeResponse struct {
	// Challenge challenge
	Challenge string `json:"challenge"`

	// SignedChallenge signed challenge
	SignedChallenge *string `json:"signedChallenge,omitempty"`
}

ChallengeResponse defines model for ChallengeResponse.

type Client added in v0.2.3

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient added in v0.2.3

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) CreatePool added in v0.2.3

func (c *Client) CreatePool(ctx context.Context, body CreatePoolJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) CreatePoolWithBody added in v0.2.3

func (c *Client) CreatePoolWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) CreateServer added in v0.2.3

func (c *Client) CreateServer(ctx context.Context, poolid string, body CreateServerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) CreateServerWithBody added in v0.2.3

func (c *Client) CreateServerWithBody(ctx context.Context, poolid string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) Dump added in v0.2.3

func (c *Client) Dump(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetAllServers added in v0.2.3

func (c *Client) GetAllServers(ctx context.Context, poolid string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetPool added in v0.2.3

func (c *Client) GetPool(ctx context.Context, poolid string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetPooluserPassword added in v0.2.3

func (c *Client) GetPooluserPassword(ctx context.Context, pooluserid string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetServerByID added in v0.2.3

func (c *Client) GetServerByID(ctx context.Context, poolid string, serverid string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) RemovePool added in v0.2.3

func (c *Client) RemovePool(ctx context.Context, poolid string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) RemoveServer added in v0.2.3

func (c *Client) RemoveServer(ctx context.Context, poolid string, serverid string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) SignChallenge added in v0.2.3

func (c *Client) SignChallenge(ctx context.Context, poolid string, body SignChallengeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) SignChallengeWithBody added in v0.2.3

func (c *Client) SignChallengeWithBody(ctx context.Context, poolid string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) TestVerifySignature added in v0.2.3

func (c *Client) TestVerifySignature(ctx context.Context, body TestVerifySignatureJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) TestVerifySignatureWithBody added in v0.2.3

func (c *Client) TestVerifySignatureWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) VerifySignature added in v0.2.3

func (c *Client) VerifySignature(ctx context.Context, body VerifySignatureJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) VerifySignatureWithBody added in v0.2.3

func (c *Client) VerifySignatureWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface added in v0.2.3

type ClientInterface interface {
	// Dump request
	Dump(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreatePoolWithBody request with any body
	CreatePoolWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CreatePool(ctx context.Context, body CreatePoolJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// RemovePool request
	RemovePool(ctx context.Context, poolid string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetPool request
	GetPool(ctx context.Context, poolid string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetAllServers request
	GetAllServers(ctx context.Context, poolid string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateServerWithBody request with any body
	CreateServerWithBody(ctx context.Context, poolid string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CreateServer(ctx context.Context, poolid string, body CreateServerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// RemoveServer request
	RemoveServer(ctx context.Context, poolid string, serverid string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetServerByID request
	GetServerByID(ctx context.Context, poolid string, serverid string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SignChallengeWithBody request with any body
	SignChallengeWithBody(ctx context.Context, poolid string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	SignChallenge(ctx context.Context, poolid string, body SignChallengeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetPooluserPassword request
	GetPooluserPassword(ctx context.Context, pooluserid string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// TestVerifySignatureWithBody request with any body
	TestVerifySignatureWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	TestVerifySignature(ctx context.Context, body TestVerifySignatureJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// VerifySignatureWithBody request with any body
	VerifySignatureWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	VerifySignature(ctx context.Context, body VerifySignatureJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption added in v0.2.3

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL added in v0.2.3

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient added in v0.2.3

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithHttpsClient added in v0.2.4

func WithHttpsClient(Certificate string) ClientOption

func WithRequestEditorFn added in v0.2.3

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses added in v0.2.3

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses added in v0.2.3

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) CreatePoolWithBodyWithResponse added in v0.2.3

func (c *ClientWithResponses) CreatePoolWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePoolResponse, error)

CreatePoolWithBodyWithResponse request with arbitrary body returning *CreatePoolResponse

func (*ClientWithResponses) CreatePoolWithResponse added in v0.2.3

func (c *ClientWithResponses) CreatePoolWithResponse(ctx context.Context, body CreatePoolJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePoolResponse, error)

func (*ClientWithResponses) CreateServerWithBodyWithResponse added in v0.2.3

func (c *ClientWithResponses) CreateServerWithBodyWithResponse(ctx context.Context, poolid string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateServerResponse, error)

CreateServerWithBodyWithResponse request with arbitrary body returning *CreateServerResponse

func (*ClientWithResponses) CreateServerWithResponse added in v0.2.3

func (c *ClientWithResponses) CreateServerWithResponse(ctx context.Context, poolid string, body CreateServerJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateServerResponse, error)

func (*ClientWithResponses) DumpWithResponse added in v0.2.3

func (c *ClientWithResponses) DumpWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*DumpResponse, error)

DumpWithResponse request returning *DumpResponse

func (*ClientWithResponses) GetAllServersWithResponse added in v0.2.3

func (c *ClientWithResponses) GetAllServersWithResponse(ctx context.Context, poolid string, reqEditors ...RequestEditorFn) (*GetAllServersResponse, error)

GetAllServersWithResponse request returning *GetAllServersResponse

func (*ClientWithResponses) GetPoolWithResponse added in v0.2.3

func (c *ClientWithResponses) GetPoolWithResponse(ctx context.Context, poolid string, reqEditors ...RequestEditorFn) (*GetPoolResponse, error)

GetPoolWithResponse request returning *GetPoolResponse

func (*ClientWithResponses) GetPooluserPasswordWithResponse added in v0.2.3

func (c *ClientWithResponses) GetPooluserPasswordWithResponse(ctx context.Context, pooluserid string, reqEditors ...RequestEditorFn) (*GetPooluserPasswordResponse, error)

GetPooluserPasswordWithResponse request returning *GetPooluserPasswordResponse

func (*ClientWithResponses) GetServerByIDWithResponse added in v0.2.3

func (c *ClientWithResponses) GetServerByIDWithResponse(ctx context.Context, poolid string, serverid string, reqEditors ...RequestEditorFn) (*GetServerByIDResponse, error)

GetServerByIDWithResponse request returning *GetServerByIDResponse

func (*ClientWithResponses) RemovePoolWithResponse added in v0.2.3

func (c *ClientWithResponses) RemovePoolWithResponse(ctx context.Context, poolid string, reqEditors ...RequestEditorFn) (*RemovePoolResponse, error)

RemovePoolWithResponse request returning *RemovePoolResponse

func (*ClientWithResponses) RemoveServerWithResponse added in v0.2.3

func (c *ClientWithResponses) RemoveServerWithResponse(ctx context.Context, poolid string, serverid string, reqEditors ...RequestEditorFn) (*RemoveServerResponse, error)

RemoveServerWithResponse request returning *RemoveServerResponse

func (*ClientWithResponses) SignChallengeWithBodyWithResponse added in v0.2.3

func (c *ClientWithResponses) SignChallengeWithBodyWithResponse(ctx context.Context, poolid string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignChallengeResponse, error)

SignChallengeWithBodyWithResponse request with arbitrary body returning *SignChallengeResponse

func (*ClientWithResponses) SignChallengeWithResponse added in v0.2.3

func (c *ClientWithResponses) SignChallengeWithResponse(ctx context.Context, poolid string, body SignChallengeJSONRequestBody, reqEditors ...RequestEditorFn) (*SignChallengeResponse, error)

func (*ClientWithResponses) TestVerifySignatureWithBodyWithResponse added in v0.2.3

func (c *ClientWithResponses) TestVerifySignatureWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TestVerifySignatureResponse, error)

TestVerifySignatureWithBodyWithResponse request with arbitrary body returning *TestVerifySignatureResponse

func (*ClientWithResponses) TestVerifySignatureWithResponse added in v0.2.3

func (c *ClientWithResponses) TestVerifySignatureWithResponse(ctx context.Context, body TestVerifySignatureJSONRequestBody, reqEditors ...RequestEditorFn) (*TestVerifySignatureResponse, error)

func (*ClientWithResponses) VerifySignatureWithBodyWithResponse added in v0.2.3

func (c *ClientWithResponses) VerifySignatureWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*VerifySignatureResponse, error)

VerifySignatureWithBodyWithResponse request with arbitrary body returning *VerifySignatureResponse

func (*ClientWithResponses) VerifySignatureWithResponse added in v0.2.3

func (c *ClientWithResponses) VerifySignatureWithResponse(ctx context.Context, body VerifySignatureJSONRequestBody, reqEditors ...RequestEditorFn) (*VerifySignatureResponse, error)

type ClientWithResponsesInterface added in v0.2.3

type ClientWithResponsesInterface interface {
	// DumpWithResponse request
	DumpWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*DumpResponse, error)

	// CreatePoolWithBodyWithResponse request with any body
	CreatePoolWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePoolResponse, error)

	CreatePoolWithResponse(ctx context.Context, body CreatePoolJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePoolResponse, error)

	// RemovePoolWithResponse request
	RemovePoolWithResponse(ctx context.Context, poolid string, reqEditors ...RequestEditorFn) (*RemovePoolResponse, error)

	// GetPoolWithResponse request
	GetPoolWithResponse(ctx context.Context, poolid string, reqEditors ...RequestEditorFn) (*GetPoolResponse, error)

	// GetAllServersWithResponse request
	GetAllServersWithResponse(ctx context.Context, poolid string, reqEditors ...RequestEditorFn) (*GetAllServersResponse, error)

	// CreateServerWithBodyWithResponse request with any body
	CreateServerWithBodyWithResponse(ctx context.Context, poolid string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateServerResponse, error)

	CreateServerWithResponse(ctx context.Context, poolid string, body CreateServerJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateServerResponse, error)

	// RemoveServerWithResponse request
	RemoveServerWithResponse(ctx context.Context, poolid string, serverid string, reqEditors ...RequestEditorFn) (*RemoveServerResponse, error)

	// GetServerByIDWithResponse request
	GetServerByIDWithResponse(ctx context.Context, poolid string, serverid string, reqEditors ...RequestEditorFn) (*GetServerByIDResponse, error)

	// SignChallengeWithBodyWithResponse request with any body
	SignChallengeWithBodyWithResponse(ctx context.Context, poolid string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignChallengeResponse, error)

	SignChallengeWithResponse(ctx context.Context, poolid string, body SignChallengeJSONRequestBody, reqEditors ...RequestEditorFn) (*SignChallengeResponse, error)

	// GetPooluserPasswordWithResponse request
	GetPooluserPasswordWithResponse(ctx context.Context, pooluserid string, reqEditors ...RequestEditorFn) (*GetPooluserPasswordResponse, error)

	// TestVerifySignatureWithBodyWithResponse request with any body
	TestVerifySignatureWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TestVerifySignatureResponse, error)

	TestVerifySignatureWithResponse(ctx context.Context, body TestVerifySignatureJSONRequestBody, reqEditors ...RequestEditorFn) (*TestVerifySignatureResponse, error)

	// VerifySignatureWithBodyWithResponse request with any body
	VerifySignatureWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*VerifySignatureResponse, error)

	VerifySignatureWithResponse(ctx context.Context, body VerifySignatureJSONRequestBody, reqEditors ...RequestEditorFn) (*VerifySignatureResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type CreatePoolJSONRequestBody added in v0.2.3

type CreatePoolJSONRequestBody = PoolRequest

CreatePoolJSONRequestBody defines body for CreatePool for application/json ContentType.

type CreatePoolResponse added in v0.2.3

type CreatePoolResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *PoolResponse
	JSONDefault  *Error
}

func ParseCreatePoolResponse added in v0.2.3

func ParseCreatePoolResponse(rsp *http.Response) (*CreatePoolResponse, error)

ParseCreatePoolResponse parses an HTTP response from a CreatePoolWithResponse call

func (CreatePoolResponse) Status added in v0.2.3

func (r CreatePoolResponse) Status() string

Status returns HTTPResponse.Status

func (CreatePoolResponse) StatusCode added in v0.2.3

func (r CreatePoolResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateServerJSONRequestBody added in v0.2.3

type CreateServerJSONRequestBody = ServerRequest

CreateServerJSONRequestBody defines body for CreateServer for application/json ContentType.

type CreateServerResponse added in v0.2.3

type CreateServerResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *ServerResponse
	JSONDefault  *Error
}

func ParseCreateServerResponse added in v0.2.3

func ParseCreateServerResponse(rsp *http.Response) (*CreateServerResponse, error)

ParseCreateServerResponse parses an HTTP response from a CreateServerWithResponse call

func (CreateServerResponse) Status added in v0.2.3

func (r CreateServerResponse) Status() string

Status returns HTTPResponse.Status

func (CreateServerResponse) StatusCode added in v0.2.3

func (r CreateServerResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DumpResponse added in v0.2.3

type DumpResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSONDefault  *Error
}

func ParseDumpResponse added in v0.2.3

func ParseDumpResponse(rsp *http.Response) (*DumpResponse, error)

ParseDumpResponse parses an HTTP response from a DumpWithResponse call

func (DumpResponse) Status added in v0.2.3

func (r DumpResponse) Status() string

Status returns HTTPResponse.Status

func (DumpResponse) StatusCode added in v0.2.3

func (r DumpResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Error added in v0.2.3

type Error struct {
	// Message Error message
	Message string `json:"message"`
}

Error defines model for Error.

type ErrorCode added in v0.1.5

type ErrorCode int

ErrorCode is the identification of the error

type ErrorProxyResponse added in v0.2.4

type ErrorProxyResponse struct {
	Error ErrorRedfish `json:"error"`
}

ErrorProxyResponse is the error message with redfish formmat

type ErrorRedfish added in v0.2.4

type ErrorRedfish struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type ErrorResponseNetdef added in v0.1.5

type ErrorResponseNetdef struct {
	Code    ErrorCode `json:"code"`
	Message string    `json:"message"`
}

ErrorResponseNetDef is the error message for network assocation

type GetAllServersResponse added in v0.2.3

type GetAllServersResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]ServerResponse
	JSONDefault  *Error
}

func ParseGetAllServersResponse added in v0.2.3

func ParseGetAllServersResponse(rsp *http.Response) (*GetAllServersResponse, error)

ParseGetAllServersResponse parses an HTTP response from a GetAllServersWithResponse call

func (GetAllServersResponse) Status added in v0.2.3

func (r GetAllServersResponse) Status() string

Status returns HTTPResponse.Status

func (GetAllServersResponse) StatusCode added in v0.2.3

func (r GetAllServersResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetPoolResponse added in v0.2.3

type GetPoolResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *PoolResponse
	JSONDefault  *Error
}

func ParseGetPoolResponse added in v0.2.3

func ParseGetPoolResponse(rsp *http.Response) (*GetPoolResponse, error)

ParseGetPoolResponse parses an HTTP response from a GetPoolWithResponse call

func (GetPoolResponse) Status added in v0.2.3

func (r GetPoolResponse) Status() string

Status returns HTTPResponse.Status

func (GetPoolResponse) StatusCode added in v0.2.3

func (r GetPoolResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetPooluserPasswordResponse added in v0.2.3

type GetPooluserPasswordResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *PasswordData
	JSONDefault  *Error
}

func ParseGetPooluserPasswordResponse added in v0.2.3

func ParseGetPooluserPasswordResponse(rsp *http.Response) (*GetPooluserPasswordResponse, error)

ParseGetPooluserPasswordResponse parses an HTTP response from a GetPooluserPasswordWithResponse call

func (GetPooluserPasswordResponse) Status added in v0.2.3

Status returns HTTPResponse.Status

func (GetPooluserPasswordResponse) StatusCode added in v0.2.3

func (r GetPooluserPasswordResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetServerByIDResponse added in v0.2.3

type GetServerByIDResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ServerResponse
	JSONDefault  *Error
}

func ParseGetServerByIDResponse added in v0.2.3

func ParseGetServerByIDResponse(rsp *http.Response) (*GetServerByIDResponse, error)

ParseGetServerByIDResponse parses an HTTP response from a GetServerByIDWithResponse call

func (GetServerByIDResponse) Status added in v0.2.3

func (r GetServerByIDResponse) Status() string

Status returns HTTPResponse.Status

func (GetServerByIDResponse) StatusCode added in v0.2.3

func (r GetServerByIDResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GorillaServerOptions added in v0.2.3

type GorillaServerOptions struct {
	BaseURL          string
	BaseRouter       *mux.Router
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type HttpRequestDoer added in v0.2.3

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type InternalStore added in v0.2.3

type InternalStore struct {
	Userstore map[string]*User
	PoolStore map[string]*Pool
}

type InvalidParamFormatError added in v0.2.3

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error added in v0.2.3

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap added in v0.2.3

func (e *InvalidParamFormatError) Unwrap() error

type Member added in v0.1.10

type Member struct {
	ODataId string `json:"@odata.id"`
}

Member is a member of a redfish collection

type MiddlewareFunc added in v0.2.3

type MiddlewareFunc func(http.Handler) http.Handler

type PasswordData added in v0.1.11

type PasswordData struct {
	// Password password
	Password string `json:"password"`
}

PasswordData defines model for PasswordData.

type PatchSpec

type PatchSpec struct {
	Op    string `json:"op"`
	Path  string `json:"path"`
	Value string `json:"value"`
}

PatchSpec is a typed JSON patch description

type Pool

type Pool struct {
	Id       string
	Username string
	Servers  map[string]ServerData
}

type PoolLimit added in v0.1.10

type PoolLimit struct {
	Label   string
	Value   string
	Max     int
	Current int
}

func InitializeLimits added in v0.1.10

func InitializeLimits(limits []brokerv1.PoolLimit) []PoolLimit

type PoolRequest added in v0.1.10

type PoolRequest struct {
	// MaxServers size of the pool
	MaxServers *int `json:"MaxServers,omitempty"`

	// Id Name of the pool
	Id *string `json:"id,omitempty"`

	// LabelSelector labels associated with the pool
	LabelSelector *map[string]string `json:"labelSelector,omitempty"`
}

PoolRequest defines model for PoolRequest.

type PoolResponse

type PoolResponse struct {
	// Id name of the pool
	Id *string `json:"id,omitempty"`

	// LabelSelector labels associated with the pool
	LabelSelector *map[string]string `json:"labelSelector,omitempty"`

	// MaxServers size of the pool
	MaxServers *int `json:"maxServers,omitempty"`

	// Username username of the pool
	Username *string `json:"username,omitempty"`
}

PoolResponse defines model for PoolResponse.

type RedfishClient added in v0.1.10

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

RedfishClient is the type of a specialized http.Client for Redfish It stores the target host and the credentials.

func (*RedfishClient) DoRequest added in v0.1.10

func (c *RedfishClient) DoRequest(method string, path string, body io.Reader) (*http.Response, error)

DoRequest performs an arbitrary http request using a RedfishClient.

type RedfishCollection added in v0.1.10

type RedfishCollection struct {
	Name    string `json:"Name"`
	Members []Member
}

RedfishCollection is the type of a collection of records in Redfish. It only contains pointers to the actual objects.

type RemovePoolResponse added in v0.2.3

type RemovePoolResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSONDefault  *Error
}

func ParseRemovePoolResponse added in v0.2.3

func ParseRemovePoolResponse(rsp *http.Response) (*RemovePoolResponse, error)

ParseRemovePoolResponse parses an HTTP response from a RemovePoolWithResponse call

func (RemovePoolResponse) Status added in v0.2.3

func (r RemovePoolResponse) Status() string

Status returns HTTPResponse.Status

func (RemovePoolResponse) StatusCode added in v0.2.3

func (r RemovePoolResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RemoveServerResponse added in v0.2.3

type RemoveServerResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSONDefault  *Error
}

func ParseRemoveServerResponse added in v0.2.3

func ParseRemoveServerResponse(rsp *http.Response) (*RemoveServerResponse, error)

ParseRemoveServerResponse parses an HTTP response from a RemoveServerWithResponse call

func (RemoveServerResponse) Status added in v0.2.3

func (r RemoveServerResponse) Status() string

Status returns HTTPResponse.Status

func (RemoveServerResponse) StatusCode added in v0.2.3

func (r RemoveServerResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RequestEditorFn added in v0.2.3

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

func AddBasicAuth added in v0.2.4

func AddBasicAuth(username string, password string) RequestEditorFn

type RequiredHeaderError added in v0.2.3

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error added in v0.2.3

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap added in v0.2.3

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError added in v0.2.3

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error added in v0.2.3

func (e *RequiredParamError) Error() string

type ServerData

type ServerData struct {
	Id          string `json:"id"`
	BareMetal   string `json:"baremetal"`
	Schema      string `json:"schema"`
	BmcUsername string `json:"bmcUsername"`
	BmcPassword string `json:"bmcPpassword"`
	Url         string `json:"url"`
}

type ServerInterface added in v0.2.3

type ServerInterface interface {
	// Returns broker internal data
	// (GET /redfish-proxy/dump)
	Dump(w http.ResponseWriter, r *http.Request)
	// Creates a new pool
	// (POST /redfish-proxy/pools)
	CreatePool(w http.ResponseWriter, r *http.Request)
	// Deletes a pool by ID
	// (DELETE /redfish-proxy/pools/{poolid})
	RemovePool(w http.ResponseWriter, r *http.Request, poolid string)
	// get a pool
	// (GET /redfish-proxy/pools/{poolid})
	GetPool(w http.ResponseWriter, r *http.Request, poolid string)
	// Returns all servers in the pool
	// (GET /redfish-proxy/pools/{poolid}/servers)
	GetAllServers(w http.ResponseWriter, r *http.Request, poolid string)
	// Creates a new server
	// (POST /redfish-proxy/pools/{poolid}/servers)
	CreateServer(w http.ResponseWriter, r *http.Request, poolid string)
	// Deletes a server by ID
	// (DELETE /redfish-proxy/pools/{poolid}/servers/{serverid})
	RemoveServer(w http.ResponseWriter, r *http.Request, poolid string, serverid string)
	// Returns a server by ID
	// (GET /redfish-proxy/pools/{poolid}/servers/{serverid})
	GetServerByID(w http.ResponseWriter, r *http.Request, poolid string, serverid string)
	// Challenge signature
	// (POST /redfish-proxy/pools/{poolid}/signchallenge)
	SignChallenge(w http.ResponseWriter, r *http.Request, poolid string)
	// get a pool password
	// (GET /redfish-proxy/poolusers/{pooluserid}/getpassword)
	GetPooluserPassword(w http.ResponseWriter, r *http.Request, pooluserid string)
	// Signature verification
	// (POST /redfish-proxy/verifysignature)
	TestVerifySignature(w http.ResponseWriter, r *http.Request)
	// Signature verification
	// (POST /verifysignature)
	VerifySignature(w http.ResponseWriter, r *http.Request)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper added in v0.2.3

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandlerFunc   func(w http.ResponseWriter, r *http.Request, err error)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) CreatePool added in v0.2.3

func (siw *ServerInterfaceWrapper) CreatePool(w http.ResponseWriter, r *http.Request)

CreatePool operation middleware

func (*ServerInterfaceWrapper) CreateServer added in v0.2.3

func (siw *ServerInterfaceWrapper) CreateServer(w http.ResponseWriter, r *http.Request)

CreateServer operation middleware

func (*ServerInterfaceWrapper) Dump added in v0.2.3

Dump operation middleware

func (*ServerInterfaceWrapper) GetAllServers added in v0.2.3

func (siw *ServerInterfaceWrapper) GetAllServers(w http.ResponseWriter, r *http.Request)

GetAllServers operation middleware

func (*ServerInterfaceWrapper) GetPool added in v0.2.3

GetPool operation middleware

func (*ServerInterfaceWrapper) GetPooluserPassword added in v0.2.3

func (siw *ServerInterfaceWrapper) GetPooluserPassword(w http.ResponseWriter, r *http.Request)

GetPooluserPassword operation middleware

func (*ServerInterfaceWrapper) GetServerByID added in v0.2.3

func (siw *ServerInterfaceWrapper) GetServerByID(w http.ResponseWriter, r *http.Request)

GetServerByID operation middleware

func (*ServerInterfaceWrapper) RemovePool added in v0.2.3

func (siw *ServerInterfaceWrapper) RemovePool(w http.ResponseWriter, r *http.Request)

RemovePool operation middleware

func (*ServerInterfaceWrapper) RemoveServer added in v0.2.3

func (siw *ServerInterfaceWrapper) RemoveServer(w http.ResponseWriter, r *http.Request)

RemoveServer operation middleware

func (*ServerInterfaceWrapper) SignChallenge added in v0.2.3

func (siw *ServerInterfaceWrapper) SignChallenge(w http.ResponseWriter, r *http.Request)

SignChallenge operation middleware

func (*ServerInterfaceWrapper) TestVerifySignature added in v0.2.3

func (siw *ServerInterfaceWrapper) TestVerifySignature(w http.ResponseWriter, r *http.Request)

TestVerifySignature operation middleware

func (*ServerInterfaceWrapper) VerifySignature added in v0.2.3

func (siw *ServerInterfaceWrapper) VerifySignature(w http.ResponseWriter, r *http.Request)

VerifySignature operation middleware

type ServerRequest

type ServerRequest struct {
	// Id Name of the server
	Id string `json:"id"`

	// Schema schema associated with url of the server
	Schema string `json:"schema"`
}

ServerRequest defines model for ServerRequest.

type ServerResponse

type ServerResponse struct {
	// BareMetal name of the bmh associated with the server
	BareMetal *string `json:"bareMetal,omitempty"`

	// DisableCertificateVerification disableCertificateVerification field of the bmh associated with the server
	DisableCertificateVerification *bool `json:"disableCertificateVerification,omitempty"`

	// Id name of the server
	Id string `json:"id"`

	// K8sAnnotations annotations of the bmh associated with the server
	K8sAnnotations *map[string]string `json:"k8sAnnotations,omitempty"`

	// K8sLabels labels of the bmh associated with the server
	K8sLabels *map[string]string `json:"k8sLabels,omitempty"`

	// MacAddress mac address of the bmh associated with the server
	MacAddress *string `json:"macAddress,omitempty"`

	// RootDeviceHints (*bmh.RootDeviceHints) with bmh "github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1"
	RootDeviceHints *bmh.RootDeviceHints `json:"rootDeviceHints,omitempty"`

	// Url url of the bmh associated with the server
	Url *string `json:"url,omitempty"`
}

ServerResponse defines model for ServerResponse.

type SignChallengeJSONRequestBody added in v0.2.3

type SignChallengeJSONRequestBody = ChallengeRequest

SignChallengeJSONRequestBody defines body for SignChallenge for application/json ContentType.

type SignChallengeResponse added in v0.2.3

type SignChallengeResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ChallengeResponse
	JSONDefault  *Error
}

func ParseSignChallengeResponse added in v0.2.3

func ParseSignChallengeResponse(rsp *http.Response) (*SignChallengeResponse, error)

ParseSignChallengeResponse parses an HTTP response from a SignChallengeWithResponse call

func (SignChallengeResponse) Status added in v0.2.3

func (r SignChallengeResponse) Status() string

Status returns HTTPResponse.Status

func (SignChallengeResponse) StatusCode added in v0.2.3

func (r SignChallengeResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type SignatureRequest added in v0.1.5

type SignatureRequest struct {
	// Challenge challenge
	Challenge string `json:"challenge"`

	// Signature signed challenge
	Signature string `json:"signature"`
}

SignatureRequest defines model for SignatureRequest.

type SignatureResponse added in v0.1.5

type SignatureResponse struct {
	// SignatureVerified signature verification response
	SignatureVerified string `json:"signatureVerified"`
}

SignatureResponse defines model for SignatureResponse.

type TestVerifySignatureJSONRequestBody added in v0.2.3

type TestVerifySignatureJSONRequestBody = SignatureRequest

TestVerifySignatureJSONRequestBody defines body for TestVerifySignature for application/json ContentType.

type TestVerifySignatureResponse added in v0.2.3

type TestVerifySignatureResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *SignatureResponse
	JSONDefault  *Error
}

func ParseTestVerifySignatureResponse added in v0.2.3

func ParseTestVerifySignatureResponse(rsp *http.Response) (*TestVerifySignatureResponse, error)

ParseTestVerifySignatureResponse parses an HTTP response from a TestVerifySignatureWithResponse call

func (TestVerifySignatureResponse) Status added in v0.2.3

Status returns HTTPResponse.Status

func (TestVerifySignatureResponse) StatusCode added in v0.2.3

func (r TestVerifySignatureResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type TooManyValuesForParamError added in v0.2.3

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error added in v0.2.3

type UnescapedCookieParamError added in v0.2.3

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error added in v0.2.3

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap added in v0.2.3

func (e *UnescapedCookieParamError) Unwrap() error

type UnmarshalingParamError added in v0.2.3

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error added in v0.2.3

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap added in v0.2.3

func (e *UnmarshalingParamError) Unwrap() error

type User added in v0.1.10

type User struct {
	Username string
	Password string
}

type VerifySignatureJSONRequestBody added in v0.2.3

type VerifySignatureJSONRequestBody = SignatureRequest

VerifySignatureJSONRequestBody defines body for VerifySignature for application/json ContentType.

type VerifySignatureResponse added in v0.2.3

type VerifySignatureResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *SignatureResponse
	JSONDefault  *Error
}

func ParseVerifySignatureResponse added in v0.2.3

func ParseVerifySignatureResponse(rsp *http.Response) (*VerifySignatureResponse, error)

ParseVerifySignatureResponse parses an HTTP response from a VerifySignatureWithResponse call

func (VerifySignatureResponse) Status added in v0.2.3

func (r VerifySignatureResponse) Status() string

Status returns HTTPResponse.Status

func (VerifySignatureResponse) StatusCode added in v0.2.3

func (r VerifySignatureResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

Jump to

Keyboard shortcuts

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