composeapi

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2018 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BxUsSouthApiBase = "https://composebroker-dashboard-public.mybluemix.net/api/2016-07/"
	BxUsEastApiBase  = "https://composebroker-dashboard-public.us-east.mybluemix.net/api/2016-07/"
	BxEuGbApiBase    = "https://composebroker-dashboard-public.eu-gb.mybluemix.net/api/2016-07/"
	BxEuDeApiBase    = "https://composebroker-dashboard-public.eu-de.mybluemix.net/api/2016-07/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// The number of times to retry a failing request if the status code is
	// retryable (e.g. for HTTP 429 or 500)
	Retries int
	// The interval to wait between retries. gorequest does not yet support
	// exponential back-off on retries
	RetryInterval time.Duration
	// RetryStatusCodes is the list of status codes to retry for
	RetryStatusCodes []int
	// contains filtered or unexported fields
}

Client is a structure that holds session information for the API

func NewClient

func NewClient(apiToken string, apiBase string) (*Client, error)

NewClient returns a Client for further interaction with the API

func NewClientByRegion added in v0.2.0

func NewClientByRegion(apiToken string, region string) (*Client, error)

func (*Client) AddWhitelistForDeployment

func (c *Client) AddWhitelistForDeployment(deploymentid string, whitelist Whitelist) (*Recipe, []error)

GetRecipe gets status of Recipe

func (*Client) DeleteWhitelistForDeployment

func (c *Client) DeleteWhitelistForDeployment(deploymentid string, whitelistID string) (*Recipe, []error)

GetRecipe gets status of Recipe

func (*Client) GetRecipe

func (c *Client) GetRecipe(deploymentid string, recipeid string) (*Recipe, []error)

GetRecipe gets status of Recipe

func (*Client) GetRecipesForDeployment

func (c *Client) GetRecipesForDeployment(deploymentid string) (*[]Recipe, []error)

GetRecipesForDeployment gets deployment recipe life

func (*Client) GetWhitelistForDeployment

func (c *Client) GetWhitelistForDeployment(deploymentid string) (*Whitelist, []error)

GetRecipe gets status of Recipe

func (*Client) SetAPIToken

func (c *Client) SetAPIToken(newtoken string)

SetAPIToken overrides the API token

func (*Client) SetLogger

func (c *Client) SetLogger(enableLogging bool, logger io.Writer) *Client

SetLogger can enable or disable http logging to and from the Compose API endpoint using the provided io.Writer for the provided client.

type Errors

type Errors struct {
	Error map[string][]string `json:"errors,omitempty"`
}

Errors struct for parsing error returns

type Instance

type Instance struct {
	ID           string `json:"id"`
	ResourceType string `json:"resource_type"`
	ResourceID   string `json:"resource_id"`
}
type Link struct {
	HREF      string `json:"href"`
	Templated bool   `json:"templated"`
}

Link structure for JSON+HAL links

type Recipe

type Recipe struct {
	ID           string    `json:"id"`
	Template     string    `json:"template"`
	Status       string    `json:"status"`
	StatusDetail string    `json:"status_detail"`
	AccountID    string    `json:"account_id"`
	DeploymentID string    `json:"deployment_id"`
	Name         string    `json:"name"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
	Embedded     struct {
		Recipes []Recipe `json:"recipes"`
	} `json:"_embedded"`
}

Recipe structure

type Whitelist

type Whitelist struct {
	ID          string `json:"id"`
	Description string `json:"description"`
	IP          string `json:"ip"`
	Embedded    struct {
		Whitelist []Whitelist `json:"whitelist"`
	} `json:"_embedded"`
}

Whitelist structure

Jump to

Keyboard shortcuts

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