Documentation ¶
Index ¶
- Variables
- func CacheExpires(r *http.Response) time.Time
- type APIClient
- type APIKey
- type APIResponse
- type BasicAuth
- type Configuration
- type ErrorResponse
- type GenericOpenAPIError
- type HostApiService
- func (a *HostApiService) HostDelete(ctx _context.Context, nodeSet string) (*_nethttp.Response, error)
- func (a *HostApiService) HostFind(ctx _context.Context, nodeSet string) (model.HostList, *_nethttp.Response, error)
- func (a *HostApiService) HostList(ctx _context.Context) (model.HostList, *_nethttp.Response, error)
- func (a *HostApiService) HostProvision(ctx _context.Context, nodeSet string) (*_nethttp.Response, error)
- func (a *HostApiService) HostTag(ctx _context.Context, nodeSet string, tags string) (*_nethttp.Response, error)
- func (a *HostApiService) HostTags(ctx _context.Context, tags string) (model.HostList, *_nethttp.Response, error)
- func (a *HostApiService) HostUnprovision(ctx _context.Context, nodeSet string) (*_nethttp.Response, error)
- func (a *HostApiService) HostUntag(ctx _context.Context, nodeSet string, tags string) (*_nethttp.Response, error)
- func (a *HostApiService) StoreHosts(ctx _context.Context, body model.HostList) (*_nethttp.Response, error)
- type ImageApiService
- func (a *ImageApiService) ImageDelete(ctx _context.Context, name string) (*_nethttp.Response, error)
- func (a *ImageApiService) ImageFind(ctx _context.Context, name string) (model.BootImageList, *_nethttp.Response, error)
- func (a *ImageApiService) ImageList(ctx _context.Context) (model.BootImageList, *_nethttp.Response, error)
- func (a *ImageApiService) StoreImages(ctx _context.Context, body model.BootImageList) (*_nethttp.Response, error)
- type ServerConfiguration
- type ServerVariable
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 ¶ added in v0.0.2
type APIClient struct { HostApi *HostApiService ImageApi *ImageApiService // contains filtered or unexported fields }
APIClient manages communication with the Grendel API API v1.0.0 In most cases there should be only one, shared, APIClient.
func NewAPIClient ¶ added in v0.0.2
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 ¶ added in v0.0.2
ChangeBasePath changes base path to allow switching to mocks
func (*APIClient) GetConfig ¶ added in v0.0.2
func (c *APIClient) GetConfig() *Configuration
Allow modification of underlying config for alternate implementations and testing Caution: modifying the configuration while live can cause data races and potentially unwanted behavior
type APIKey ¶ added in v0.0.2
APIKey provides API key based authentication to a request passed via context using ContextAPIKey
type APIResponse ¶ added in v0.0.2
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:"-"` }
APIResponse stores the API response returned by the server.
func NewAPIResponse ¶ added in v0.0.2
func NewAPIResponse(r *http.Response) *APIResponse
NewAPIResponse returns a new APIResonse object.
func NewAPIResponseWithError ¶ added in v0.0.2
func NewAPIResponseWithError(errorMessage string) *APIResponse
NewAPIResponseWithError returns a new APIResponse object with the provided error message.
type BasicAuth ¶ added in v0.0.2
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 Configuration ¶ added in v0.0.2
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"` Debug bool `json:"debug,omitempty"` Servers []ServerConfiguration HTTPClient *http.Client }
Configuration stores the configuration of the API client
func NewConfiguration ¶ added in v0.0.2
func NewConfiguration() *Configuration
NewConfiguration returns a new Configuration object
func (*Configuration) AddDefaultHeader ¶ added in v0.0.2
func (c *Configuration) AddDefaultHeader(key string, value string)
AddDefaultHeader adds a new HTTP header to the default header in the request
type ErrorResponse ¶ added in v0.0.2
type ErrorResponse struct {
Message string `json:"message,omitempty"`
}
ErrorResponse struct for ErrorResponse
type GenericOpenAPIError ¶ added in v0.0.2
type GenericOpenAPIError struct {
// contains filtered or unexported fields
}
GenericOpenAPIError Provides access to the body, error and model on returned errors.
func (GenericOpenAPIError) Body ¶ added in v0.0.2
func (e GenericOpenAPIError) Body() []byte
Body returns the raw bytes of the response
func (GenericOpenAPIError) Error ¶ added in v0.0.2
func (e GenericOpenAPIError) Error() string
Error returns non-empty string if there was an error.
func (GenericOpenAPIError) Model ¶ added in v0.0.2
func (e GenericOpenAPIError) Model() interface{}
Model returns the unpacked model of the error
type HostApiService ¶ added in v0.0.2
type HostApiService service
HostApiService HostApi service
func (*HostApiService) HostDelete ¶ added in v0.0.6
func (a *HostApiService) HostDelete(ctx _context.Context, nodeSet string) (*_nethttp.Response, error)
HostDelete Delete hosts by name or nodeset Delete hosts in the given nodeset
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param nodeSet nodeset syntax. Example: cpn-d13-[01-100]
func (*HostApiService) HostFind ¶ added in v0.0.2
func (a *HostApiService) HostFind(ctx _context.Context, nodeSet string) (model.HostList, *_nethttp.Response, error)
HostFind Find hosts by name or nodeset Returns a list of hosts in the given nodeset
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param nodeSet nodeset syntax. Example: cpn-d13-[01-100]
@return []Host
func (*HostApiService) HostList ¶ added in v0.0.2
HostList List all hosts Returns all host stored in Grendel
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return []Host
func (*HostApiService) HostProvision ¶ added in v0.0.4
func (a *HostApiService) HostProvision(ctx _context.Context, nodeSet string) (*_nethttp.Response, error)
HostProvision Set hosts to provision by name or nodeset Sets hosts to provision in the given nodeset
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param nodeSet nodeset syntax. Example: cpn-d13-[01-100]
func (*HostApiService) HostTag ¶ added in v0.0.5
func (a *HostApiService) HostTag(ctx _context.Context, nodeSet string, tags string) (*_nethttp.Response, error)
HostTag Tag hosts by name or nodeset Tag hosts in the given nodeset
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param nodeSet nodeset syntax. Example: cpn-d13-[01-100]
- @param tags list of tags. Example: ib,noib,k16
func (*HostApiService) HostTags ¶ added in v0.0.5
func (a *HostApiService) HostTags(ctx _context.Context, tags string) (model.HostList, *_nethttp.Response, error)
HostTags Find hosts by tags Returns a list of hosts with the given tags
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param tags comman separated list of tags. Example: ib,noib,k16
@return []Host
func (*HostApiService) HostUnprovision ¶ added in v0.0.4
func (a *HostApiService) HostUnprovision(ctx _context.Context, nodeSet string) (*_nethttp.Response, error)
HostUnprovision Set hosts to unprovision by name or nodeset Sets hosts to unprovision in the given nodeset
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param nodeSet nodeset syntax. Example: cpn-d13-[01-100]
func (*HostApiService) HostUntag ¶ added in v0.0.5
func (a *HostApiService) HostUntag(ctx _context.Context, nodeSet string, tags string) (*_nethttp.Response, error)
HostUntag Untag hosts name or nodeset Untag hosts the given nodeset
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param nodeSet nodeset syntax. Example: cpn-d13-[01-100]
- @param tags list of tags. Example: ib,noib,k16
func (*HostApiService) StoreHosts ¶ added in v0.0.2
func (a *HostApiService) StoreHosts(ctx _context.Context, body model.HostList) (*_nethttp.Response, error)
StoreHosts Add or update hosts in Grendel
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param body Add/Update one or more hosts to Grendel
type ImageApiService ¶ added in v0.0.3
type ImageApiService service
ImageApiService ImageApi service
func (*ImageApiService) ImageDelete ¶ added in v0.0.6
func (a *ImageApiService) ImageDelete(ctx _context.Context, name string) (*_nethttp.Response, error)
ImageDelete Delete boot images by name Delete boot images with the given name
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param name Name of boot image to delete
func (*ImageApiService) ImageFind ¶ added in v0.0.3
func (a *ImageApiService) ImageFind(ctx _context.Context, name string) (model.BootImageList, *_nethttp.Response, error)
ImageFind Find image by name Returns image with the given name
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param name Name of image
@return []BootImage
func (*ImageApiService) ImageList ¶ added in v0.0.3
func (a *ImageApiService) ImageList(ctx _context.Context) (model.BootImageList, *_nethttp.Response, error)
ImageList List all images Returns all images stored in Grendel
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return []BootImage
func (*ImageApiService) StoreImages ¶ added in v0.0.3
func (a *ImageApiService) StoreImages(ctx _context.Context, body model.BootImageList) (*_nethttp.Response, error)
StoreImages Add or update images in Grendel
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param body Add/Update one or more images to Grendel
type ServerConfiguration ¶ added in v0.0.2
type ServerConfiguration struct { Url string Description string Variables map[string]ServerVariable }
ServerConfiguration stores the information about a server
type ServerVariable ¶ added in v0.0.2
ServerVariable stores the information about a server variable