Documentation
¶
Overview ¶
Package goblueboxapi exposes functionality to interact with the Blue Box API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct { ID string Hostname string IPs []BlockIP Status string VSHID string `json:"vsh_id"` }
A Block is an on demand virtual computing resource.
type BlockIP ¶
type BlockIP struct {
Address string
}
A BlockIP holds an IPv4 or IPv6 address for a block.
type BlockParams ¶
type BlockParams struct { Product string Template string Password string SshPublicKey string Hostname string Username string Location string IPv6Only bool }
BlockParams holds the information needed to boot a block. Product and Template as well as either SshPublicKey or Password (but not both) must be specified.
type BlocksService ¶
type BlocksService struct {
// contains filtered or unexported fields
}
BlocksService exposes the API endpoints to interact with blocks.
func (*BlocksService) Create ¶
func (s *BlocksService) Create(p BlockParams) (*Block, error)
Create boots a new block with the given parameters, and returns the block.
func (*BlocksService) Destroy ¶
func (s *BlocksService) Destroy(uuid string) error
Destroy shuts down a block.
func (*BlocksService) Get ¶
func (s *BlocksService) Get(uuid string) (*Block, error)
Get returns a block given its Id, or an error if there was a problem fetching the information from the API.
func (*BlocksService) List ¶
func (s *BlocksService) List() ([]Block, error)
List returns the currently running blocks, or an error if there was a problem fetching the information from the API.
type Client ¶
type Client struct { BaseURL *url.URL // Credentials which is used for authentication during API requests CustomerID string APIKey string Blocks *BlocksService Templates *TemplatesService // contains filtered or unexported fields }
A Client manages communication with the Blue Box API
type TemplateCreationStatus ¶
A rich description of the output when creating a new Template.
type TemplatesService ¶
type TemplatesService struct {
// contains filtered or unexported fields
}
TemplatesService exposes the API endpoints to interact with templates.
func (*TemplatesService) Create ¶
func (s *TemplatesService) Create(uuid string, description string) (*TemplateCreationStatus, error)
Create queues a new template for creation from a block uuid.
func (*TemplatesService) Destroy ¶
func (s *TemplatesService) Destroy(uuid string) error
Destroy destroys the template/image.
func (*TemplatesService) Get ¶
func (s *TemplatesService) Get(uuid string) (*Template, error)
Get returns a template given its Id, or an error if there was a problem fetching the information from the API.
func (*TemplatesService) List ¶
func (s *TemplatesService) List() ([]Template, error)
List returns the currently known templates, or an error if there was a problem fetching the information from the API.