Documentation
¶
Index ¶
- type Account
- type Alert
- type Alerts
- type Backup
- type Client
- func (c *Client) CreateDeployment(params DeploymentParams) (*Deployment, []error)
- func (c *Client) CreateDeploymentJSON(params DeploymentParams) (string, []error)
- func (c *Client) DeprovisionDeployment(deploymentID string) (*Recipe, []error)
- func (c *Client) DeprovisionDeploymentJSON(deploymentID string) (string, []error)
- func (c *Client) GetAccount() (*Account, []error)
- func (c *Client) GetAccountJSON() (string, []error)
- func (c *Client) GetAlertsForDeployment(deploymentid string) (*Alerts, []error)
- func (c *Client) GetAlertsForDeploymentJSON(deploymentid string) (string, []error)
- func (c *Client) GetBackupDetailsForDeployment(deploymentid string, backupid string) (*Backup, []error)
- func (c *Client) GetBackupDetailsForDeploymentJSON(deploymentid string, backupid string) (string, []error)
- func (c *Client) GetBackupsForDeployment(deploymentid string) (*[]Backup, []error)
- func (c *Client) GetBackupsForDeploymentJSON(deploymentid string) (string, []error)
- func (c *Client) GetClusterByName(clusterName string) (*Cluster, []error)
- func (c *Client) GetClusters() (*[]Cluster, []error)
- func (c *Client) GetClustersJSON() (string, []error)
- func (c *Client) GetDatabases() (*[]Database, []error)
- func (c *Client) GetDatabasesJSON() (string, []error)
- func (c *Client) GetDatacenters() (*[]Datacenter, []error)
- func (c *Client) GetDatacentersJSON() (string, []error)
- func (c *Client) GetDeployment(deploymentid string) (*Deployment, []error)
- func (c *Client) GetDeploymentByName(deploymentName string) (*Deployment, []error)
- func (c *Client) GetDeploymentJSON(deploymentid string) (string, []error)
- func (c *Client) GetDeployments() (*[]Deployment, []error)
- func (c *Client) GetDeploymentsJSON() (string, []error)
- func (c *Client) GetRecipe(recipeid string) (*Recipe, []error)
- func (c *Client) GetRecipeJSON(recipeid string) (string, []error)
- func (c *Client) GetRecipesForDeployment(deploymentid string) (*[]Recipe, []error)
- func (c *Client) GetRecipesForDeploymentJSON(deploymentid string) (string, []error)
- func (c *Client) GetScalings(deploymentid string) (*Scalings, []error)
- func (c *Client) GetScalingsJSON(deploymentid string) (string, []error)
- func (c *Client) GetUser() (*User, []error)
- func (c *Client) GetUserJSON() (string, []error)
- func (c *Client) GetVersionsForDeployment(deploymentid string) (*[]VersionTransition, []error)
- func (c *Client) GetVersionsForDeploymentJSON(deploymentid string) (string, []error)
- func (c *Client) RestoreBackup(params RestoreBackupParams) (*Deployment, []error)
- func (c *Client) RestoreBackupJSON(params RestoreBackupParams) (string, []error)
- func (c *Client) SetAPIToken(newtoken string)
- func (c *Client) SetScalings(scalingsParams ScalingsParams) (*Recipe, []error)
- func (c *Client) SetScalingsJSON(params ScalingsParams) (string, []error)
- func (c *Client) StartBackupForDeployment(deploymentid string) (*Recipe, []error)
- func (c *Client) StartBackupForDeploymentJSON(deploymentid string) (string, []error)
- type Cluster
- type ConnectionStrings
- type CreateDeploymentParams
- type Database
- type Datacenter
- type Deployment
- type DeploymentParams
- type Errors
- type Link
- type Links
- type Recipe
- type RestoreBackupParams
- type Scalings
- type ScalingsParams
- type User
- type Version
- type VersionTransition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct {
CapsuleID string `json:"capsule_id"`
DeploymentID string `json:"deployment_id"`
Message string `json:"message"`
Status string `json:"status"`
}
Alert type which holds each Alert
type Alerts ¶
type Alerts struct {
Summary string `json:"summary"`
Embedded struct {
Alerts []Alert `json:"alerts"`
} `json:"_embedded"`
}
Alerts type which contains all the Alerts and a summary
type Backup ¶
type Backup struct {
ID string `json:"id"`
Deploymentid string `json:"deployment_id"`
Name string `json:"name"`
Type string `json:"type"`
Status string `json:"status"`
DownloadLink string `json:"download_link"`
}
Backup structure
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a structure that holds session information for the API
func (*Client) CreateDeployment ¶
func (c *Client) CreateDeployment(params DeploymentParams) (*Deployment, []error)
CreateDeployment creates a deployment
func (*Client) CreateDeploymentJSON ¶
func (c *Client) CreateDeploymentJSON(params DeploymentParams) (string, []error)
CreateDeploymentJSON performs the call
func (*Client) DeprovisionDeployment ¶
DeprovisionDeployment deletes a deployment
func (*Client) DeprovisionDeploymentJSON ¶
DeprovisionDeploymentJSON performs the call
func (*Client) GetAccount ¶
GetAccount Gets first Account struct from account endpoint
func (*Client) GetAccountJSON ¶
GetAccountJSON gets JSON string from endpoint
func (*Client) GetAlertsForDeployment ¶
GetAlertsForDeployment gets deployment recipe life
func (*Client) GetAlertsForDeploymentJSON ¶
GetAlertsForDeploymentJSON returns raw JSON for getAlertsforDeployment
func (*Client) GetBackupDetailsForDeployment ¶
func (c *Client) GetBackupDetailsForDeployment(deploymentid string, backupid string) (*Backup, []error)
GetBackupDetailsForDeployment returns backup details for deployment
func (*Client) GetBackupDetailsForDeploymentJSON ¶
func (c *Client) GetBackupDetailsForDeploymentJSON(deploymentid string, backupid string) (string, []error)
GetBackupDetailsForDeploymentJSON returns the details and download link for a backup
func (*Client) GetBackupsForDeployment ¶
GetBackupsForDeployment returns backup details for deployment
func (*Client) GetBackupsForDeploymentJSON ¶
GetBackupsForDeploymentJSON returns backup details for deployment
func (*Client) GetClusterByName ¶
GetClusterByName returns a cluster of a given name
func (*Client) GetClusters ¶
GetClusters gets clusters available
func (*Client) GetClustersJSON ¶
GetClustersJSON gets clusters available
func (*Client) GetDatabases ¶
GetDatabases gets databases available as a Go struct
func (*Client) GetDatabasesJSON ¶
GetDatabasesJSON gets databases available as a string
func (*Client) GetDatacenters ¶
func (c *Client) GetDatacenters() (*[]Datacenter, []error)
GetDatacenters gets datacenters available as a Go struct
func (*Client) GetDatacentersJSON ¶
GetDatacentersJSON gets datacenters available as a string
func (*Client) GetDeployment ¶
func (c *Client) GetDeployment(deploymentid string) (*Deployment, []error)
GetDeployment returns deployment structure
func (*Client) GetDeploymentByName ¶
func (c *Client) GetDeploymentByName(deploymentName string) (*Deployment, []error)
GetDeploymentByName returns a deployment of a given name
func (*Client) GetDeploymentJSON ¶
GetDeploymentJSON returns raw deployment
func (*Client) GetDeployments ¶
func (c *Client) GetDeployments() (*[]Deployment, []error)
GetDeployments returns deployment structure
func (*Client) GetDeploymentsJSON ¶
GetDeploymentsJSON returns raw deployment
func (*Client) GetRecipeJSON ¶
GetRecipeJSON Gets raw JSON for recipeid
func (*Client) GetRecipesForDeployment ¶
GetRecipesForDeployment gets deployment recipe life
func (*Client) GetRecipesForDeploymentJSON ¶
GetRecipesForDeploymentJSON returns raw JSON for getRecipesforDeployment
func (*Client) GetScalings ¶
GetScalings returns deployment structure
func (*Client) GetScalingsJSON ¶
GetScalingsJSON returns raw scalings
func (*Client) GetUserJSON ¶
GetUserJSON returns user JSON string
func (*Client) GetVersionsForDeployment ¶
func (c *Client) GetVersionsForDeployment(deploymentid string) (*[]VersionTransition, []error)
GetVersionsForDeployment gets deployment recipe life
func (*Client) GetVersionsForDeploymentJSON ¶
GetVersionsForDeploymentJSON returns raw JSON for getVersionsforDeployment
func (*Client) RestoreBackup ¶
func (c *Client) RestoreBackup(params RestoreBackupParams) (*Deployment, []error)
RestoreBackup creates a deployment
func (*Client) RestoreBackupJSON ¶
func (c *Client) RestoreBackupJSON(params RestoreBackupParams) (string, []error)
RestoreBackupJSON performs the call
func (*Client) SetAPIToken ¶
SetAPIToken overrides the API token
func (*Client) SetScalings ¶
func (c *Client) SetScalings(scalingsParams ScalingsParams) (*Recipe, []error)
SetScalings sets scale and returns recipe for scaling
func (*Client) SetScalingsJSON ¶
func (c *Client) SetScalingsJSON(params ScalingsParams) (string, []error)
SetScalingsJSON sets JSON scaling and returns string respones
func (*Client) StartBackupForDeployment ¶
StartBackupForDeployment starts backup and returns recipe
type Cluster ¶
type Cluster struct {
ID string `json:"id"`
AccountID string `json:"account_id"`
Name string `json:"name"`
Type string `json:"type"`
Provider string `json:"provider"`
Region string `json:"region"`
Multitenant bool `json:"multitenant"`
AccountSlug string `json:"account_slug"`
CreatedAt time.Time `json:"created_at"`
Subdomain string `json:"subdomain"`
}
Cluster structure
type ConnectionStrings ¶
type ConnectionStrings struct {
Health string `json:"health,omitempty"`
SSH string `json:"ssh,omitempty"`
Admin string `json:"admin,omitempty"`
SSHAdmin string `json:"ssh_admin,omitempty"`
CLI []string `json:"cli,omitempty"`
Direct []string `json:"direct,omitempty"`
Misc interface{} `json:"misc,omitempty"`
}
ConnectionStrings structure, part of the Deployment struct
type CreateDeploymentParams ¶
type CreateDeploymentParams struct {
Deployment DeploymentParams `json:"deployment"`
}
CreateDeploymentParams Parameters to be completed before creating a deployment
type Database ¶
type Database struct {
DatabaseType string `json:"type"`
Status string `json:"status"`
Embedded struct {
Versions []Version `json:"versions"`
} `json:"_embedded"`
}
Database structure
type Datacenter ¶
type Datacenter struct {
Region string `json:"region"`
Provider string `json:"provider"`
Slug string `json:"slug"`
}
Datacenter structure
type Deployment ¶
type Deployment struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
CreatedAt time.Time `json:"created_at"`
ProvisionRecipeID string `json:"provision_recipe_id,omitempty"`
CACertificateBase64 string `json:"ca_certificate_base64,omitempty"`
Connection ConnectionStrings `json:"connection_strings,omitempty"`
Notes string `json:"notes,omitempty"`
CustomerBillingCode string `json:"customer_billing_code,omitempty"`
Links Links `json:"_links"`
}
Deployment structure
type DeploymentParams ¶
type DeploymentParams struct {
Name string `json:"name"`
AccountID string `json:"account_id"`
ClusterID string `json:"cluster_id,omitempty"`
Datacenter string `json:"datacenter,omitempty"`
DatabaseType string `json:"type"`
Version string `json:"version,omitempty"`
Units int `json:"units,omitempty"`
SSL bool `json:"ssl,omitempty"`
WiredTiger bool `json:"wired_tiger,omitempty"`
}
DeploymentParams core parameters for a new deployment
type Links ¶
type Links struct {
ComposeWebUILink Link `json:"compose_web_ui"`
ScalingsLink Link `json:"scalings"`
BackupsLink Link `json:"backups"`
AlertsLink Link `json:"alerts"`
ClusterLink Link `json:"cluster"`
}
Links structure, part of the Deployment struct
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 RestoreBackupParams ¶
type RestoreBackupParams struct {
DeploymentID string
BackupID string
Name string
ClusterID string
Datacenter string
Version string
SSL bool
}
RestoreBackupParams Parameters to be completed before creating a deployment
type Scalings ¶
type Scalings struct {
AllocatedUnits int `json:"allocated_units"`
UsedUnits int `json:"used_units"`
StartingUnits int `json:"starting_units"`
MinimumUnits int `json:"minimum_units"`
UnitSizeInMB int `json:"unit_size_in_mb"`
}
Scalings represents the used, allocated, starting and minimum unit scale of a deployment
type ScalingsParams ¶
ScalingsParams represents the parameters needed to scale a deployment