aptible

package
v0.0.0-...-84e8dfe Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEndpointType

func GetEndpointType(t string) (string, error)

func GetHost

func GetHost() (string, error)

Gets host from env var, ensures it ends in ".com", or sets default.

func GetIDFromHref

func GetIDFromHref(href string) (int64, error)

Gets ID from an href

func GetToken

func GetToken() (string, error)

func MakeStringSlice

func MakeStringSlice(if_slice []interface{}) ([]string, error)

makes a string slice out of a slice of type interface

Types

type App

type App struct {
	ID      int64
	GitRepo string
}

type Client

type Client struct {
	Client *deploy.DeployAPIV1
	Token  runtime.ClientAuthInfoWriter
}

func SetUpClient

func SetUpClient() (*Client, error)

sets up client and gets auth token used for API requests

func (*Client) CreateApp

func (c *Client) CreateApp(handle string, env_id int64) (App, error)

func (*Client) CreateDatabase

func (c *Client) CreateDatabase(env_id int64, attrs DBCreateAttrs) (Database, error)

func (*Client) CreateEndpoint

func (c *Client) CreateEndpoint(resource_id int64, attrs EndpointCreateAttrs) (Endpoint, error)

CreateEndpoint() creates Vhost API object + provision operation on the app.

func (*Client) CreateReplica

func (c *Client) CreateReplica(attrs ReplicateAttrs) (Database, error)

func (*Client) DeleteApp

func (c *Client) DeleteApp(app_id int64) (bool, error)

func (*Client) DeleteDatabase

func (c *Client) DeleteDatabase(db_id int64) error

func (*Client) DeleteEndpoint

func (c *Client) DeleteEndpoint(endpoint_id int64) error

DeleteEndpoint() deletes the endpoint.

func (*Client) DeleteReplica

func (c *Client) DeleteReplica(replica_id int64) error

func (*Client) DeployApp

func (c *Client) DeployApp(app_id int64, config map[string]interface{}) error

func (*Client) GetApp

func (c *Client) GetApp(app_id int64) (bool, error)

func (*Client) GetContainerSize

func (c *Client) GetContainerSize(href string) (int64, error)

func (*Client) GetDatabase

func (c *Client) GetDatabase(db_id int64) (Database, bool, error)

func (*Client) GetDatabaseIDFromHandle

func (c *Client) GetDatabaseIDFromHandle(env_id int64, handle string) (int64, bool, error)

Gets database id associated with a given handle.

func (*Client) GetDatabaseOperations

func (c *Client) GetDatabaseOperations(db_id int64, page int64) (*models.InlineResponse20029, error)

Gets operations of a database on a per page basis

func (*Client) GetDiskSize

func (c *Client) GetDiskSize(href string) (int64, error)

func (*Client) GetEndpoint

func (c *Client) GetEndpoint(endpoint_id int64, resource_type string) (Endpoint, bool, error)

GetEndpoint() returns the response's payload, a bool saying whether or not the endpoint has been deprovisioned, and an error.

func (*Client) GetEnvironmentIDFromHandle

func (c *Client) GetEnvironmentIDFromHandle(handle string) (int64, error)

Gets environment id associated with a given handle.

func (*Client) GetReplica

func (c *Client) GetReplica(replica_id int64) (Database, bool, error)

func (*Client) GetReplicaFromHandle

func (c *Client) GetReplicaFromHandle(db_id int64, handle string) (*models.InlineResponse20014EmbeddedDatabases, error)

func (*Client) GetServiceID

func (c *Client) GetServiceID(resource_id int64, resource_type string) (int64, error)

GetServiceID() Gets the service ID + acts as a helper for GetEndpoint().

func (*Client) UpdateApp

func (c *Client) UpdateApp(config map[string]interface{}, app_id int64) error

Updates the `config` based on changes made in the config file

func (*Client) UpdateDatabase

func (c *Client) UpdateDatabase(db_id int64, updates DBUpdates) error

func (*Client) UpdateEndpoint

func (c *Client) UpdateEndpoint(endpoint_id int64, up EndpointUpdates) error

UpdateEndpoint() takes in an endpoint_id and updates needed, and updates the endpoint.

func (*Client) UpdateReplica

func (c *Client) UpdateReplica(replica_id int64, updates DBUpdates) error

func (*Client) WaitForOperation

func (c *Client) WaitForOperation(op_id int64) (bool, error)

Waits for operation to succeed.

type DBCreateAttrs

type DBCreateAttrs struct {
	Handle        *string
	Type          string
	ContainerSize int64
	DiskSize      int64
}

type DBUpdates

type DBUpdates struct {
	ContainerSize int64
	DiskSize      int64
}

type Database

type Database struct {
	ID            int64
	ConnectionURL string
	ContainerSize int64
	DiskSize      int64
}

type Endpoint

type Endpoint struct {
	ID            int64
	Hostname      string
	ContainerPort int64
	IPWhitelist   []string
	Platform      string
}

type EndpointCreateAttrs

type EndpointCreateAttrs struct {
	ResourceType  string
	Type          *string
	Default       bool
	Internal      bool
	ContainerPort int64
	IPWhitelist   []string
	Platform      string
}

type EndpointUpdates

type EndpointUpdates struct {
	ContainerPort int64
	IPWhitelist   []string
	Platform      string
}

type ReplicaIdentifiers

type ReplicaIdentifiers struct {
	ReplicaID     int64
	ProvisionOpID int64
}

type ReplicateAttrs

type ReplicateAttrs struct {
	EnvID         int64
	DatabaseID    int64
	ReplicaHandle string
	ContainerSize int64
	DiskSize      int64
}

Jump to

Keyboard shortcuts

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