composeapi

package module
v0.0.0-...-7648d1e Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

README

gocomposeapi

GoDoc

A Go wrapper for the Compose API

This is a basic wrapper around the Compose API as documented on apidocs.compose.com

Documentation

Overview

Package composeapi provides an idiomatic Go wrapper around the Compose API for database platform for deployment, management and monitoring.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessErrors

func ProcessErrors(statuscode int, body string) []error

ProcessErrors tries to turn errors into an Errors struct

Types

type Account

type Account struct {
	ID   string `json:"id"`
	Slug string `json:"slug"`
	Name string `json:"name"`
}

Account structure

type AccountParams

type AccountParams struct {
	StripeCustomerID string `json:"stripe_customer_id"`
}

AccountParams is the list of parameters that can be updated on an existing account

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 AuditEvent

type AuditEvent struct {
	Links        Links             `json:"_links"`
	AccountID    string            `json:"account_id"`
	ClusterID    string            `json:"cluster_id,omitempty"`
	CreatedAt    time.Time         `json:"created_at"`
	Data         map[string]string `json:"data"`
	DeploymentID string            `json:"deployment_id,omitempty"`
	Email        string            `json:"email,omitempty"`
	Event        string            `json:"event"`
	ID           string            `json:"id"`
	IP           string            `json:"ip"`
	UserAgent    string            `json:"user_agent"`
	UserID       string            `json:"user_id"`
}

AuditEvent is the returned information for a single Compose audit event

type AuditEventsParams

type AuditEventsParams struct {
	OlderThan *time.Time `json:"older_than,omitempty"`
	NewerThan *time.Time `json:"newer_than,omitempty"`
	Cursor    string     `json:"cursor,omitempty"`
	Limit     int        `json:"limit,omitempty"`
}

AuditEventsParams is the structure of entirely optional options for filtering or paging through audit events

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"`
	IsDownloadable bool      `json:"is_downloadable"`
	IsRestorable   bool      `json:"is_restorable"`
	CreatedAt      time.Time `json:"created_at"`
	DownloadLink   string    `json:"download_link"`
}

Backup structure

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) (*Client, error)

NewClient returns a Client for further interaction with the API

func (*Client) AddTagsToCluster

func (c *Client) AddTagsToCluster(clusterID string, tags []string) (*Cluster, []error)

AddTagsToCluster returns cluster data of cluster to which tahs have been added

func (*Client) AddTagsToClusterJSON

func (c *Client) AddTagsToClusterJSON(clusterID string, tags []string) (string, []error)

AddTagsToClusterJSON returns raw result of call to add tags cluster endpoint

func (*Client) CreateAccountUser

func (c *Client) CreateAccountUser(accountID string, params UserParams) (*User, []error)

CreateAccountUser adds a new user to an account and returns a User object on success

func (*Client) CreateAccountUserJSON

func (c *Client) CreateAccountUserJSON(accountID string, params UserParams) (string, []error)

CreateAccountUserJSON performs the call

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) CreateDeploymentWhitelist

func (c *Client) CreateDeploymentWhitelist(deploymentID string, params DeploymentWhitelistParams) (*Recipe, []error)

CreateDeploymentWhitelist creates a single deployment whitelist entry for a CIDR range

func (*Client) CreateTeam

func (c *Client) CreateTeam(params TeamParams) (*Team, []error)

CreateTeam creates a team

func (*Client) CreateTeamJSON

func (c *Client) CreateTeamJSON(params TeamParams) (string, []error)

CreateTeamJSON performs the call to create a team

func (*Client) CreateTeamRole

func (c *Client) CreateTeamRole(deploymentID string, params TeamRoleParams) (*TeamRole, []error)

CreateTeamRole adds a team role to a deployment

func (*Client) CreateTeamRoleJSON

func (c *Client) CreateTeamRoleJSON(deploymentID string, params TeamRoleParams) (string, []error)

CreateTeamRoleJSON performs the raw call to add a new team role

func (*Client) DeleteAccountUser

func (c *Client) DeleteAccountUser(accountID, userID string) (*User, []error)

DeleteAccountUser removes a user from the provided account

func (*Client) DeleteAccountUserJSON

func (c *Client) DeleteAccountUserJSON(accountID, userID string) (string, []error)

DeleteAccountUserJSON performs the call

func (*Client) DeleteTagsFromCluster

func (c *Client) DeleteTagsFromCluster(clusterID string, tags []string) (*Cluster, []error)

DeleteTagsFromCluster returns cluster data after deleting tags from cluster

func (*Client) DeleteTagsFromClusterJSON

func (c *Client) DeleteTagsFromClusterJSON(clusterID string, tags []string) (string, []error)

DeleteTagsFromClusterJSON returns raw result of call to delete tags cluster endpoint

func (*Client) DeleteTeam

func (c *Client) DeleteTeam(teamID string) (*Team, []error)

DeleteTeam deletes a team

func (*Client) DeleteTeamJSON

func (c *Client) DeleteTeamJSON(teamID string) (string, []error)

DeleteTeamJSON performs that call

func (*Client) DeleteTeamRole

func (c *Client) DeleteTeamRole(deploymentID string, params TeamRoleParams) []error

DeleteTeamRole deletes a team role

func (*Client) DeleteTeamRoleJSON

func (c *Client) DeleteTeamRoleJSON(deploymentID string, params TeamRoleParams) []error

DeleteTeamRoleJSON is the raw call to remove a team_role

func (*Client) DeprovisionDeployment

func (c *Client) DeprovisionDeployment(deploymentID string) (*Recipe, []error)

DeprovisionDeployment deletes a deployment

func (*Client) DeprovisionDeploymentJSON

func (c *Client) DeprovisionDeploymentJSON(deploymentID string) (string, []error)

DeprovisionDeploymentJSON performs the call

func (*Client) GetAccount

func (c *Client) GetAccount() (*Account, []error)

GetAccount Gets first Account struct from account endpoint

func (*Client) GetAccountJSON

func (c *Client) GetAccountJSON() (string, []error)

GetAccountJSON gets JSON string from endpoint

func (*Client) GetAccountUsers

func (c *Client) GetAccountUsers() ([]User, []error)

GetAccountUsers gets the user array for the current account

func (*Client) GetAccountUsersJSON

func (c *Client) GetAccountUsersJSON() (string, []error)

GetAccountUsersJSON gets the JSON string from the users endpoint for this account

func (*Client) GetAlertsForDeployment

func (c *Client) GetAlertsForDeployment(deploymentid string) (*Alerts, []error)

GetAlertsForDeployment gets deployment recipe life

func (*Client) GetAlertsForDeploymentJSON

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

GetAlertsForDeploymentJSON returns raw JSON for getAlertsforDeployment

func (*Client) GetAuditEvent

func (c *Client) GetAuditEvent(id string) (*AuditEvent, []error)

GetAuditEvent returns the specified audit_event

func (*Client) GetAuditEventJSON

func (c *Client) GetAuditEventJSON(id string) (string, []error)

GetAuditEventJSON performs the call

func (*Client) GetAuditEvents

func (c *Client) GetAuditEvents(params AuditEventsParams) (*[]AuditEvent, []error)

GetAuditEvents returns all audit_events the API Key has access to.

func (*Client) GetAuditEventsJSON

func (c *Client) GetAuditEventsJSON(params AuditEventsParams) (string, []error)

GetAuditEventsJSON performs the call

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

func (c *Client) GetBackupsForDeployment(deploymentid string) (*[]Backup, []error)

GetBackupsForDeployment returns backup details for deployment

func (*Client) GetBackupsForDeploymentJSON

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

GetBackupsForDeploymentJSON returns backup details for deployment

func (*Client) GetCluster

func (c *Client) GetCluster(clusterid string) (*Cluster, []error)

GetCluster returns cluster structure

func (*Client) GetClusterByName

func (c *Client) GetClusterByName(clusterName string) (*Cluster, []error)

GetClusterByName returns a cluster of a given name

func (*Client) GetClusterJSON

func (c *Client) GetClusterJSON(clusterid string) (string, []error)

GetClusterJSON returns raw cluster

func (*Client) GetClusters

func (c *Client) GetClusters() (*[]Cluster, []error)

GetClusters gets clusters available

func (*Client) GetClustersJSON

func (c *Client) GetClustersJSON() (string, []error)

GetClustersJSON gets clusters available

func (*Client) GetDatabases

func (c *Client) GetDatabases() (*[]Database, []error)

GetDatabases gets databases available as a Go struct

func (*Client) GetDatabasesJSON

func (c *Client) GetDatabasesJSON() (string, []error)

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

func (c *Client) GetDatacentersJSON() (string, []error)

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

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

GetDeploymentJSON returns raw deployment

func (*Client) GetDeployments

func (c *Client) GetDeployments() (*[]Deployment, []error)

GetDeployments returns deployment structure

func (*Client) GetDeploymentsJSON

func (c *Client) GetDeploymentsJSON() (string, []error)

GetDeploymentsJSON returns raw deployment

func (*Client) GetLogfileDetailsForDeployment

func (c *Client) GetLogfileDetailsForDeployment(deploymentid string, logfileid string) (*Logfile, []error)

GetLogfileDetailsForDeployment returns logfile details for deployment

func (*Client) GetLogfileDetailsForDeploymentJSON

func (c *Client) GetLogfileDetailsForDeploymentJSON(deploymentid string, logfileid string) (string, []error)

GetLogfileDetailsForDeploymentJSON returns the details and download link for a logfile

func (*Client) GetLogfilesForDeployment

func (c *Client) GetLogfilesForDeployment(deploymentid string) (*[]Logfile, []error)

GetLogfilesForDeployment returns logfile details for deployment

func (*Client) GetLogfilesForDeploymentJSON

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

GetLogfilesForDeploymentJSON returns logfile details for deployment

func (*Client) GetRecipe

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

GetRecipe gets status of Recipe

func (*Client) GetRecipeJSON

func (c *Client) GetRecipeJSON(recipeid string) (string, []error)

GetRecipeJSON Gets raw JSON for recipeid

func (*Client) GetRecipesForDeployment

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

GetRecipesForDeployment gets deployment recipe life

func (*Client) GetRecipesForDeploymentJSON

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

GetRecipesForDeploymentJSON returns raw JSON for getRecipesforDeployment

func (*Client) GetScalings

func (c *Client) GetScalings(deploymentid string) (*Scalings, []error)

GetScalings returns deployment structure

func (*Client) GetScalingsJSON

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

GetScalingsJSON returns raw scalings

func (*Client) GetTeam

func (c *Client) GetTeam(teamID string) (*Team, []error)

GetTeam returns team structure

func (*Client) GetTeamByName

func (c *Client) GetTeamByName(teamName string) (*Team, []error)

GetTeamByName returns a team of a given name

func (*Client) GetTeamJSON

func (c *Client) GetTeamJSON(teamID string) (string, []error)

GetTeamJSON returns a raw team

func (*Client) GetTeamRoles

func (c *Client) GetTeamRoles(deploymentID string) (*[]TeamRole, []error)

GetTeamRoles returns a slice of team roles for the given deployment

func (*Client) GetTeamRolesJSON

func (c *Client) GetTeamRolesJSON(deploymentID string) (string, []error)

GetTeamRolesJSON returns raw team roles

func (*Client) GetTeams

func (c *Client) GetTeams() (*[]Team, []error)

GetTeams returns team structure

func (*Client) GetTeamsJSON

func (c *Client) GetTeamsJSON() (string, []error)

GetTeamsJSON returns raw teams

func (*Client) GetUser

func (c *Client) GetUser() (*User, []error)

GetUser Gets information about user

func (*Client) GetUserJSON

func (c *Client) GetUserJSON() (string, []error)

GetUserJSON returns user JSON string

func (*Client) GetVersionsForDeployment

func (c *Client) GetVersionsForDeployment(deploymentid string) (*[]VersionTransition, []error)

GetVersionsForDeployment gets deployment recipe life

func (*Client) GetVersionsForDeploymentJSON

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

GetVersionsForDeploymentJSON returns raw JSON for getVersionsforDeployment

func (*Client) GetWhitelistForDeployment

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

GetWhitelistForDeployment gets all whitelist entries for a given deployment ID

func (*Client) PatchDeployment

func (c *Client) PatchDeployment(params PatchDeploymentParams) (*Deployment, []error)

PatchDeployment patches a deployment

func (*Client) PatchDeploymentJSON

func (c *Client) PatchDeploymentJSON(params PatchDeploymentParams) (string, []error)

PatchDeploymentJSON performs the call

func (*Client) PatchTeam

func (c *Client) PatchTeam(teamID, teamName string) (*Team, []error)

PatchTeam changes a team name

func (*Client) PatchTeamJSON

func (c *Client) PatchTeamJSON(teamID, teamName string) (string, []error)

PatchTeamJSON changes a team's name

func (*Client) PutTeamUsers

func (c *Client) PutTeamUsers(teamID string, userIDs []string) (*Team, []error)

PutTeamUsers adds users to the given team

func (*Client) PutTeamUsersJSON

func (c *Client) PutTeamUsersJSON(teamID string, userIDs []string) (string, []error)

PutTeamUsersJSON performs the call

func (*Client) ReplaceTagsOnCluster

func (c *Client) ReplaceTagsOnCluster(clusterID string, tags []string) (*Cluster, []error)

ReplaceTagsOnCluster returns cluster data after replacing tags on cluster

func (*Client) ReplaceTagsOnClusterJSON

func (c *Client) ReplaceTagsOnClusterJSON(clusterID string, tags []string) (string, []error)

ReplaceTagsOnClusterJSON returns raw result of call to replace tags cluster endpoint

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

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.

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

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

StartBackupForDeployment starts backup and returns recipe

func (*Client) StartBackupForDeploymentJSON

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

StartBackupForDeploymentJSON starts backup and returns JSON response

func (*Client) UpdateVersion

func (c *Client) UpdateVersion(deploymentID, version string) (*Recipe, []error)

UpdateVersion returns Recipe for version update that is now taking progress

func (*Client) UpdateVersionJSON

func (c *Client) UpdateVersionJSON(deploymentID string, version string) (string, []error)

UpdateVersionJSON returns raw JSON as result of patching version

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"`
	Tags        []string  `json:"tags"`
}

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"`
	Maps     []map[string]string `json:"maps,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"`
	Version             string            `json:"version,omitempty"`
	ClusterID           string            `json:"cluster_id,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"`
	ProvisioningTags    []string `json:"provisioning_tags,omitempty"`
	DatabaseType        string   `json:"type"`
	Version             string   `json:"version,omitempty"`
	Units               int      `json:"units,omitempty"`
	SSL                 bool     `json:"ssl,omitempty"`
	CacheMode           bool     `json:"cache_mode,omitempty"`
	WiredTiger          bool     `json:"wired_tiger,omitempty"`
	Notes               string   `json:"notes,omitempty"`
	CustomerBillingCode string   `json:"customer_billing_code,omitempty"`
}

DeploymentParams core parameters for a new deployment

type DeploymentWhitelist

type DeploymentWhitelist struct {
	DeploymentWhitelistID string `json:"id"`
	Description           string `json:"description"`
	IP                    string `json:"ip"`
}

DeploymentWhitelist - representation of an applied whitelist entry

type DeploymentWhitelistParams

type DeploymentWhitelistParams struct {
	IP          string `json:"ip"`
	Description string `json:"description"`
}

DeploymentWhitelistParams - construct to pass to CreateDeploymentWhitelist

type Errors

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

Errors struct for parsing error returns

type Link struct {
	HREF      string `json:"href"`
	Templated bool   `json:"templated"`
}

Link structure for JSON+HAL links

type Links struct {
	ComposeWebUILink Link `json:"compose_web_ui"`
	ScalingsLink     Link `json:"scalings"`
	BackupsLink      Link `json:"backups"`
	AlertsLink       Link `json:"alerts"`
	PortalUsersLink  Link `json:"portal_users"`
	ClusterLink      Link `json:"cluster"`
}

Links structure, part of the Deployment struct

type Logfile

type Logfile struct {
	ID           string    `json:"id"`
	Deploymentid string    `json:"deployment_id"`
	Capsuleid    string    `json:"capsule_id"`
	Name         string    `json:"name"`
	Region       string    `json:"region"`
	Status       string    `json:"status"`
	Date         time.Time `json:"created_at"`
	DownloadLink string    `json:"download_link"`
}

Logfile structure

type PatchDeploymentParams

type PatchDeploymentParams struct {
	DeploymentID        string `json:"omit"`
	Notes               string `json:"notes,omitempty"`
	CustomerBillingCode string `json:"customer_billing_code,omitempty"`
}

PatchDeploymentParams is used to pass parameters to PatchDeployment

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"`
	UnitType       string `json:"unit_type"`
}

Scalings represents the used, allocated, starting and minimum unit scale of a deployment

type ScalingsParams

type ScalingsParams struct {
	DeploymentID string
	Units        int
}

ScalingsParams represents the parameters needed to scale a deployment

type SimpleError

type SimpleError struct {
	Error string `json:"errors"`
}

SimpleError struct for parsing simple error returns

type Team

type Team struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Users []User `json:"users"`
}

Team structure

type TeamParams

type TeamParams struct {
	Name string `json:"name"`
}

TeamParams core parameters for a new team

type TeamRole

type TeamRole struct {
	Name  string `json:"name"`
	Teams []Team `json:"teams"`
}

TeamRole the name of the role and list of teams with that role for a deployment

type TeamRoleParams

type TeamRoleParams struct {
	Name   string `json:"name"`
	TeamID string `json:"team_id"`
}

TeamRoleParams the core parameters to create or delete a team role

type User

type User struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

User structure

type UserParams

type UserParams struct {
	Name  string `json:"name"`
	Email string `json:"email"`
	Phone string `json:"phone"`
}

UserParams structure

type Version

type Version struct {
	Application string `json:"application"`
	Status      string `json:"status"`
	Preferred   bool   `json:"preferred"`
	Version     string `json:"version"`
}

Version structure

type VersionTransition

type VersionTransition struct {
	Application string `json:"application"`
	Method      string `json:"method"`
	FromVersion string `json:"from_version"`
	ToVersion   string `json:"to_version"`
}

VersionTransition a struct wrapper for version transition information

Jump to

Keyboard shortcuts

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