api

package
v0.0.233-pre-6 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2021 License: Apache-2.0 Imports: 17 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("Not Found")

ErrNotFound - Error to return when something is not found

View Source
var ErrUnknown = errors.New("An unknown server error occured, please try again")

ErrUnknown - Error to return when an unknown server error occurs

Functions

func BoolPointer added in v0.0.98

func BoolPointer(val bool) *bool

BoolPointer - Returns a pointer to a bool

func GetAccessToken

func GetAccessToken(email, password, otp string) (string, error)

GetAccessToken - uses email, password and possible otp to get token

func IntPointer added in v0.0.98

func IntPointer(val int) *int

IntPointer - Returns a pointer to an int

func IsClientError

func IsClientError(err error) bool

func IsNotAuthenticatedError

func IsNotAuthenticatedError(err error) bool

func IsNotFoundError

func IsNotFoundError(err error) bool

func IsServerError

func IsServerError(err error) bool

func SetBaseURL

func SetBaseURL(url string)

SetBaseURL - Sets the base URL for the API

func SetErrorLog added in v0.0.135

func SetErrorLog(log bool)

SetErrorLog - Sets whether errors should be loddes

func StringPointer added in v0.0.110

func StringPointer(val string) *string

StringPointer - Returns a pointer to a string

Types

type AllocateIPAddressInput

type AllocateIPAddressInput struct {
	AppID string `json:"appId"`
	Type  string `json:"type"`
}

type AllocationEvent

type AllocationEvent struct {
	Timestamp time.Time
	Type      string
	Message   string
}

type AllocationStatus

type AllocationStatus struct {
	ID                 string
	IDShort            string
	Version            int
	Region             string
	Status             string
	DesiredStatus      string
	Healthy            bool
	Canary             bool
	Failed             bool
	Restarts           int
	CreatedAt          time.Time
	UpdatedAt          time.Time
	Checks             []CheckState
	Events             []AllocationEvent
	LatestVersion      bool
	PassingCheckCount  int
	WarningCheckCount  int
	CriticalCheckCount int
	Transitioning      bool
	PrivateIP          string
	RecentLogs         []LogEntry
	AttachedVolumes    struct {
		Nodes []Volume
	}
}

type ApiError

type ApiError struct {
	WrappedError error
	Message      string
	Status       int
}

func ErrorFromResp

func ErrorFromResp(resp *http.Response) *ApiError

func (*ApiError) Error

func (e *ApiError) Error() string

type App

type App struct {
	ID             string
	Name           string
	State          string
	Status         string
	Deployed       bool
	Hostname       string
	AppURL         string
	Version        int
	Release        *Release
	Organization   Organization
	Secrets        []Secret
	CurrentRelease *Release
	Releases       struct {
		Nodes []Release
	}
	IPAddresses struct {
		Nodes []IPAddress
	}
	IPAddress *IPAddress
	Builds    struct {
		Nodes []Build
	}
	Changes struct {
		Nodes []AppChange
	}
	Certificates struct {
		Nodes []AppCertificate
	}
	Certificate      AppCertificate
	Config           AppConfig
	ParseConfig      AppConfig
	Allocations      []*AllocationStatus
	Allocation       *AllocationStatus
	DeploymentStatus *DeploymentStatus
	Autoscaling      *AutoscalingConfig
	VMSize           VMSize
	Regions          *[]Region
	BackupRegions    *[]Region
	Volumes          struct {
		Nodes []Volume
	}
	TaskGroupCounts []TaskGroupCount
	HealthChecks    *struct {
		Nodes []CheckState
	}
	PostgresAppRole *struct {
		Databases *[]PostgresClusterDatabase
		Users     *[]PostgresClusterUser
	}
	Image *Image
}

type AppCertificate

type AppCertificate struct {
	ID                        string
	AcmeDNSConfigured         bool
	AcmeALPNConfigured        bool
	Configured                bool
	CertificateAuthority      string
	CreatedAt                 time.Time
	DNSProvider               string
	DNSValidationInstructions string
	DNSValidationHostname     string
	DNSValidationTarget       string
	Hostname                  string
	Source                    string
	ClientStatus              string
	IsApex                    bool
	IsWildcard                bool
	Issued                    struct {
		Nodes []struct {
			ExpiresAt time.Time
			Type      string
		}
	}
}

type AppCertificateCompact added in v0.0.138

type AppCertificateCompact struct {
	CreatedAt    time.Time
	Hostname     string
	ClientStatus string
}

type AppCertsCompact added in v0.0.138

type AppCertsCompact struct {
	Certificates struct {
		Nodes []AppCertificateCompact
	}
}

type AppChange

type AppChange struct {
	ID        string
	CreatedAt time.Time
	UpdatedAt time.Time
	Actor     struct {
		Type string
	}
	Status      string
	Description string
	Reason      string
	User        User
}

type AppCompact added in v0.0.135

type AppCompact struct {
	ID           string
	Name         string
	Status       string
	Deployed     bool
	Hostname     string
	AppURL       string
	Version      int
	Release      *Release
	Organization Organization
	IPAddresses  struct {
		Nodes []IPAddress
	}
	Services []Service
}

type AppConfig

type AppConfig struct {
	Definition Definition
	Services   []Service
	Valid      bool
	Errors     []string
}

type AppStatus added in v0.0.135

type AppStatus struct {
	ID               string
	Name             string
	Deployed         bool
	Status           string
	Hostname         string
	Version          int
	AppURL           string
	Organization     Organization
	DeploymentStatus *DeploymentStatus
	Allocations      []*AllocationStatus
}

type AttachPostgresClusterInput added in v0.0.162

type AttachPostgresClusterInput struct {
	AppID                string  `json:"appId"`
	PostgresClusterAppID string  `json:"postgresClusterAppId"`
	DatabaseName         *string `json:"databaseName,omitempty"`
	VariableName         *string `json:"variableName,omitempty"`
}

type AttachPostgresClusterPayload added in v0.0.165

type AttachPostgresClusterPayload struct {
	App                     App
	PostgresClusterApp      App
	ConnectionString        string
	EnvironmentVariableName string
}

type AutoscaleRegionConfigInput added in v0.0.98

type AutoscaleRegionConfigInput struct {
	Code     string `json:"code"`
	MinCount *int   `json:"minCount"`
	Weight   *int   `json:"weight"`
	Reset    *bool  `json:"reset"`
}

type AutoscalingConfig added in v0.0.98

type AutoscalingConfig struct {
	BalanceRegions bool
	Enabled        bool
	MaxCount       int
	MinCount       int
	Regions        []AutoscalingRegionConfig
}

type AutoscalingRegionConfig added in v0.0.98

type AutoscalingRegionConfig struct {
	Code     string
	MinCount int
	Weight   int
}

type Billable added in v0.0.138

type Billable struct {
	Category string
	Product  string
	Time     time.Time
	Quantity float64
	App      App
}

type Build

type Build struct {
	ID         string
	InProgress bool
	Status     string
	User       User
	Logs       string
	Image      string
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

type BuildArgInput added in v0.0.111

type BuildArgInput struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type CLISessionAuth

type CLISessionAuth struct {
	ID          string `json:"id"`
	AuthURL     string `json:"auth_url"`
	AccessToken string `json:"access_token"`
}

CLISessionAuth holds access information

func GetAccessTokenForCLISession

func GetAccessTokenForCLISession(id string) (CLISessionAuth, error)

GetAccessTokenForCLISession Obtains the access token for the session

func StartCLISessionWebAuth

func StartCLISessionWebAuth(machineName string, signup bool) (CLISessionAuth, error)

StartCLISessionWebAuth starts a session with the platform via web auth

type Check

type Check struct {
	Type              string       `json:"type"`
	Interval          *uint64      `json:"interval"`
	Timeout           *uint64      `json:"timeout"`
	HTTPMethod        *string      `json:"httpMethod"`
	HTTPPath          *string      `json:"httpPath"`
	HTTPProtocol      *string      `json:"httpProtocol"`
	HTTPSkipTLSVerify *bool        `json:"httpTlsSkipVerify"`
	HTTPHeaders       []HTTPHeader `json:"httpHeaders"`
}

type CheckDomainResult added in v0.0.144

type CheckDomainResult struct {
	DomainName            string
	TLD                   string
	RegistrationSupported bool
	RegistrationAvailable bool
	RegistrationPrice     int
	RegistrationPeriod    int
	TransferAvailable     bool
	DnsAvailable          bool
}

type CheckState

type CheckState struct {
	Name        string
	Status      string
	Output      string
	ServiceName string
	Allocation  *AllocationStatus
	Type        string
	UpdatedAt   time.Time
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client - API client encapsulating the http and GraphQL clients

func NewClient

func NewClient(accessToken string, version string) *Client

NewClient - creates a new Client, takes an access token

func (*Client) AddCertificate

func (c *Client) AddCertificate(appName, hostname string) (*AppCertificate, *HostnameCheck, error)

func (*Client) AllocateIPAddress

func (c *Client) AllocateIPAddress(appName string, addrType string) (*IPAddress, error)

func (*Client) AppAutoscalingConfig added in v0.0.98

func (c *Client) AppAutoscalingConfig(appName string) (*AutoscalingConfig, error)

func (*Client) AppVMResources added in v0.0.157

func (c *Client) AppVMResources(appName string) (VMSize, []TaskGroupCount, error)

func (*Client) AttachPostgresCluster added in v0.0.162

func (client *Client) AttachPostgresCluster(input AttachPostgresClusterInput) (*AttachPostgresClusterPayload, error)

func (*Client) CheckAppCertificate

func (c *Client) CheckAppCertificate(appName, hostname string) (*AppCertificate, *HostnameCheck, error)

func (*Client) CheckDomain added in v0.0.144

func (c *Client) CheckDomain(name string) (*CheckDomainResult, error)

func (*Client) ClosestWireguardGatewayRegion added in v0.0.213

func (c *Client) ClosestWireguardGatewayRegion() (*Region, error)

func (*Client) ConfigureRegions added in v0.0.121

func (c *Client) ConfigureRegions(input ConfigureRegionsInput) ([]Region, []Region, error)

func (*Client) CreateAndRegisterDomain added in v0.0.144

func (c *Client) CreateAndRegisterDomain(organizationID string, name string) (*Domain, error)

func (*Client) CreateApp

func (client *Client) CreateApp(name string, orgId string, preferredRegionCode *string) (*App, error)

func (*Client) CreateDelegatedWireGuardToken added in v0.0.179

func (c *Client) CreateDelegatedWireGuardToken(org *Organization, name string) (*DelegatedWireGuardToken, error)

func (*Client) CreateDomain added in v0.0.144

func (c *Client) CreateDomain(organizationID string, name string) (*Domain, error)

func (*Client) CreateOrganization added in v0.0.138

func (c *Client) CreateOrganization(organizationname string) (*Organization, error)

func (*Client) CreateOrganizationInvite added in v0.0.227

func (c *Client) CreateOrganizationInvite(id, email string) (*Invitation, error)

func (*Client) CreatePostgresCluster added in v0.0.162

func (client *Client) CreatePostgresCluster(input CreatePostgresClusterInput) (*CreatePostgresClusterPayload, error)

func (*Client) CreateSignedUrls

func (c *Client) CreateSignedUrls(appId string, filename string) (getUrl string, putUrl string, err error)

func (*Client) CreateVolume added in v0.0.145

func (c *Client) CreateVolume(appName string, volname string, region string, sizeGb int, encrypted bool) (*Volume, error)

func (*Client) CreateWireGuardPeer added in v0.0.152

func (c *Client) CreateWireGuardPeer(org *Organization, region, name, pubkey string) (*CreatedWireGuardPeer, error)

func (*Client) DeleteApp

func (client *Client) DeleteApp(appName string) error

func (*Client) DeleteCertificate

func (c *Client) DeleteCertificate(appName, hostname string) (*DeleteCertificatePayload, error)

func (*Client) DeleteDelegatedWireGuardToken added in v0.0.179

func (c *Client) DeleteDelegatedWireGuardToken(org *Organization, name, token *string) error

func (*Client) DeleteHealthCheckHandler added in v0.0.160

func (client *Client) DeleteHealthCheckHandler(orgID string, handlerName string) error

func (*Client) DeleteOrganization added in v0.0.138

func (c *Client) DeleteOrganization(id string) (deletedid string, err error)

func (*Client) DeleteVolume added in v0.0.145

func (c *Client) DeleteVolume(volID string) (App *App, err error)

func (*Client) DeployImage

func (client *Client) DeployImage(input DeployImageInput) (*Release, *ReleaseCommand, error)

func (*Client) DetachPostgresCluster added in v0.0.162

func (client *Client) DetachPostgresCluster(postgresAppName string, appName string) error

func (*Client) EnsureRemoteBuilderForApp added in v0.0.217

func (client *Client) EnsureRemoteBuilderForApp(appName string) (string, *App, error)

func (*Client) EnsureRemoteBuilderForOrg added in v0.0.217

func (client *Client) EnsureRemoteBuilderForOrg(orgID string) (string, *App, error)

func (*Client) EstablishSSHKey added in v0.0.172

func (c *Client) EstablishSSHKey(org *Organization, override bool) (*SSHCertificate, error)

func (*Client) ExportDNSRecords added in v0.0.138

func (c *Client) ExportDNSRecords(domainId string) (string, error)

func (*Client) FindIPAddress

func (c *Client) FindIPAddress(appName string, address string) (*IPAddress, error)

func (*Client) FindOrganizationBySlug added in v0.0.138

func (client *Client) FindOrganizationBySlug(slug string) (*Organization, error)

func (*Client) GetAllocationStatus added in v0.0.109

func (c *Client) GetAllocationStatus(appName string, allocID string, logLimit int) (*AllocationStatus, error)

func (*Client) GetApp

func (client *Client) GetApp(appName string) (*App, error)

func (*Client) GetAppCertificates

func (c *Client) GetAppCertificates(appName string) ([]AppCertificateCompact, error)

func (*Client) GetAppChanges

func (c *Client) GetAppChanges(appName string) ([]AppChange, error)

func (*Client) GetAppCompact added in v0.0.135

func (client *Client) GetAppCompact(appName string) (*AppCompact, error)

func (*Client) GetAppHealthChecks added in v0.0.160

func (client *Client) GetAppHealthChecks(appName string, checkName *string, limitOutput *int, compactOutput *bool) ([]CheckState, error)

func (*Client) GetAppID added in v0.0.124

func (client *Client) GetAppID(appName string) (string, error)

func (*Client) GetAppLogs

func (c *Client) GetAppLogs(appName string, nextToken string, region string, instanceId string) ([]LogEntry, string, error)

func (*Client) GetAppReleases

func (c *Client) GetAppReleases(appName string, limit int) ([]Release, error)

func (*Client) GetAppSecrets

func (c *Client) GetAppSecrets(appName string) ([]Secret, error)

func (*Client) GetAppStatus

func (c *Client) GetAppStatus(appName string, showCompleted bool) (*AppStatus, error)

func (*Client) GetAppVMCount added in v0.0.157

func (c *Client) GetAppVMCount(appID string) ([]TaskGroupCount, error)

func (*Client) GetApps

func (client *Client) GetApps(role *string) ([]App, error)

func (*Client) GetBuild

func (c *Client) GetBuild(buildId string) (*Build, error)

func (*Client) GetConfig

func (client *Client) GetConfig(appName string) (*AppConfig, error)

func (*Client) GetCurrentOrganizations added in v0.0.138

func (client *Client) GetCurrentOrganizations() (Organization, []Organization, error)

func (*Client) GetCurrentUser

func (c *Client) GetCurrentUser() (*User, error)

func (*Client) GetDNSRecords added in v0.0.138

func (c *Client) GetDNSRecords(domainName string) ([]*DNSRecord, error)

func (*Client) GetDelegatedWireGuardTokens added in v0.0.179

func (c *Client) GetDelegatedWireGuardTokens(slug string) ([]*DelegatedWireGuardTokenHandle, error)

func (*Client) GetDeploymentStatus

func (c *Client) GetDeploymentStatus(appName string, deploymentID string) (*DeploymentStatus, error)

func (*Client) GetDomain added in v0.0.144

func (c *Client) GetDomain(name string) (*Domain, error)

func (*Client) GetDomains added in v0.0.144

func (c *Client) GetDomains(organizationSlug string) ([]*Domain, error)

func (*Client) GetHealthCheckHandlers added in v0.0.160

func (client *Client) GetHealthCheckHandlers(organizationSlug string) ([]HealthCheckHandler, error)

func (*Client) GetIPAddresses

func (c *Client) GetIPAddresses(appName string) ([]IPAddress, error)

func (*Client) GetLoggedCertificates added in v0.0.172

func (c *Client) GetLoggedCertificates(slug string) ([]LoggedCertificate, error)

func (*Client) GetOrganizationBySlug added in v0.0.138

func (client *Client) GetOrganizationBySlug(slug string) (*OrganizationDetails, error)

func (*Client) GetOrganizations

func (client *Client) GetOrganizations(typeFilter *OrganizationType) ([]Organization, error)

func (*Client) GetReleaseCommand added in v0.0.201

func (c *Client) GetReleaseCommand(ctx context.Context, id string) (*ReleaseCommand, error)

func (*Client) GetTemplateDeployment added in v0.0.162

func (client *Client) GetTemplateDeployment(id string) (*TemplateDeployment, error)

func (*Client) GetVolume added in v0.0.145

func (c *Client) GetVolume(volID string) (Volume *Volume, err error)

func (*Client) GetVolumes added in v0.0.145

func (c *Client) GetVolumes(appName string) ([]Volume, error)

func (*Client) GetWireGuardPeers added in v0.0.152

func (c *Client) GetWireGuardPeers(slug string) ([]*WireGuardPeer, error)

func (*Client) ImportDNSRecords added in v0.0.138

func (c *Client) ImportDNSRecords(domainId string, zonefile string) ([]ImportDnsWarning, []ImportDnsChange, error)

func (*Client) IssueSSHCertificate added in v0.0.172

func (c *Client) IssueSSHCertificate(org *Organization, email string, username *string, valid_hours *int) (*IssuedCertificate, error)

func (*Client) ListAppRegions added in v0.0.121

func (c *Client) ListAppRegions(appName string) ([]Region, []Region, error)

func (*Client) ListBuilds

func (c *Client) ListBuilds(appName string) ([]Build, error)

func (*Client) ListPostgresDatabases added in v0.0.164

func (client *Client) ListPostgresDatabases(appName string) ([]PostgresClusterDatabase, error)

func (*Client) ListPostgresUsers added in v0.0.164

func (client *Client) ListPostgresUsers(appName string) ([]PostgresClusterUser, error)

func (*Client) MoveApp

func (client *Client) MoveApp(appName string, orgID string) (*App, error)

func (*Client) NewRequest

func (c *Client) NewRequest(q string) *graphql.Request

NewRequest - creates a new GraphQL request

func (*Client) ParseConfig

func (client *Client) ParseConfig(appName string, definition Definition) (*AppConfig, error)

func (*Client) PlatformRegions added in v0.0.95

func (c *Client) PlatformRegions() ([]Region, *Region, error)

func (*Client) PlatformRegionsAll added in v0.0.133

func (c *Client) PlatformRegionsAll() ([]Region, error)

func (*Client) PlatformVMSizes added in v0.0.98

func (c *Client) PlatformVMSizes() ([]VMSize, error)

func (*Client) ReleaseIPAddress

func (c *Client) ReleaseIPAddress(id string) error

func (*Client) RemoveWireGuardPeer added in v0.0.152

func (c *Client) RemoveWireGuardPeer(org *Organization, name string) error

func (*Client) ResolveImageForApp added in v0.0.191

func (client *Client) ResolveImageForApp(appName, imageRef string) (*Image, error)

func (*Client) RestartAllocation added in v0.0.176

func (client *Client) RestartAllocation(appName string, allocId string) error

func (*Client) RestartApp added in v0.0.128

func (client *Client) RestartApp(appName string) (*App, error)

RestartApp - Send GQL mutation to restart app

func (*Client) ResumeApp added in v0.0.124

func (client *Client) ResumeApp(appName string) (*App, error)

ResumeApp - Send GQL mutation to pause app

func (*Client) Run

func (c *Client) Run(req *graphql.Request) (Query, error)

Run - Runs a GraphQL request

func (*Client) RunWithContext

func (c *Client) RunWithContext(ctx context.Context, req *graphql.Request) (Query, error)

RunWithContext - Runs a GraphQL request within a Go context

func (*Client) ScaleApp added in v0.0.94

func (c *Client) ScaleApp(appID string, regions []ScaleRegionInput) ([]ScaleRegionChange, error)

func (*Client) SetAppVMCount added in v0.0.157

func (c *Client) SetAppVMCount(appID string, count int, maxPerRegion *int) ([]TaskGroupCount, []string, error)

func (*Client) SetAppVMSize added in v0.0.98

func (c *Client) SetAppVMSize(appID string, sizeName string, memoryMb int64) (VMSize, error)

func (*Client) SetPagerdutyHealthCheckHandler added in v0.0.160

func (client *Client) SetPagerdutyHealthCheckHandler(input SetPagerdutyHandlerInput) (*HealthCheckHandler, error)

func (*Client) SetSecrets

func (c *Client) SetSecrets(appName string, secrets map[string]string) (*Release, error)

func (*Client) SetSlackHealthCheckHandler added in v0.0.160

func (client *Client) SetSlackHealthCheckHandler(input SetSlackHandlerInput) (*HealthCheckHandler, error)

func (*Client) StartBuild added in v0.0.111

func (c *Client) StartBuild(input StartBuildInput) (*Build, error)

func (*Client) StopAllocation added in v0.0.176

func (client *Client) StopAllocation(appName string, allocId string) error

func (*Client) SuspendApp added in v0.0.135

func (client *Client) SuspendApp(appName string) (*App, error)

SuspendApp - Send GQL mutation to suspend app

func (*Client) UnsetSecrets

func (c *Client) UnsetSecrets(appName string, keys []string) (*Release, error)

func (*Client) UpdateAutoscaleConfig added in v0.0.98

func (c *Client) UpdateAutoscaleConfig(input UpdateAutoscaleConfigInput) (*AutoscalingConfig, error)

func (*Client) ValidateWireGuardPeers added in v0.0.232

func (c *Client) ValidateWireGuardPeers(peerIPs []string) (invalid []string, err error)

type ConfigureRegionsInput added in v0.0.121

type ConfigureRegionsInput struct {
	AppID         string   `json:"appId"`
	AllowRegions  []string `json:"allowRegions"`
	DenyRegions   []string `json:"denyRegions"`
	BackupRegions []string `json:"backupRegions"`
}

type CreateAppInput

type CreateAppInput struct {
	OrganizationID  string  `json:"organizationId"`
	Runtime         string  `json:"runtime"`
	Name            string  `json:"name"`
	PreferredRegion *string `json:"preferredRegion,omitempty"`
	Network         *string `json:"network,omitempty"`
}

type CreateOrganizationInvitation added in v0.0.227

type CreateOrganizationInvitation struct {
	Invitation Invitation
}

type CreateOrganizationPayload added in v0.0.138

type CreateOrganizationPayload struct {
	Organization Organization
}

type CreatePostgresClusterInput added in v0.0.164

type CreatePostgresClusterInput struct {
	OrganizationID string  `json:"organizationId"`
	Name           string  `json:"name"`
	Region         *string `json:"region,omitempty"`
	Password       *string `json:"password,omitempty"`
	VMSize         *string `json:"vmSize,omitempty"`
	VolumeSizeGB   *int    `json:"volumeSizeGb,omitempty"`
	ImageRef       *string `json:"imageRef,omitempty"`
}

type CreatePostgresClusterPayload added in v0.0.164

type CreatePostgresClusterPayload struct {
	App      *App
	Username string
	Password string
}

type CreateVolumeInput added in v0.0.145

type CreateVolumeInput struct {
	AppID     string `json:"appId"`
	Name      string `json:"name"`
	Region    string `json:"region"`
	SizeGb    int    `json:"sizeGb"`
	Encrypted bool   `json:"encrypted"`
}

type CreateVolumePayload added in v0.0.145

type CreateVolumePayload struct {
	App    App
	Volume Volume
}

type CreatedWireGuardPeer added in v0.0.152

type CreatedWireGuardPeer struct {
	Peerip     string `json:"peerip"`
	Endpointip string `json:"endpointip"`
	Pubkey     string `json:"pubkey"`
}

type DNSRecord added in v0.0.138

type DNSRecord struct {
	ID         string
	Name       string
	FQDN       string
	IsApex     bool
	IsWildcard bool
	IsSystem   bool
	TTL        int
	Type       string
	RData      string
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

type DNSRecords added in v0.0.138

type DNSRecords struct {
	ID         string
	Name       string
	Ttl        int
	Values     []string
	CreatedAt  time.Time
	UpdatedAt  time.Time
	Fqdn       string
	IsApex     bool
	IsSystem   bool
	IsWildcard bool
	Domain     *Domain
}

type Definition

type Definition map[string]interface{}

func DefinitionPtr added in v0.0.191

func DefinitionPtr(in map[string]interface{}) *Definition

type DelegatedWireGuardToken added in v0.0.179

type DelegatedWireGuardToken struct {
	Token string
}

type DelegatedWireGuardTokenHandle added in v0.0.179

type DelegatedWireGuardTokenHandle struct {
	Name string
}

type DeleteCertificatePayload

type DeleteCertificatePayload struct {
	App         App
	Certificate AppCertificate
}

type DeleteOrganizationPayload added in v0.0.138

type DeleteOrganizationPayload struct {
	DeletedOrganizationId string
}

type DeleteVolumeInput added in v0.0.145

type DeleteVolumeInput struct {
	VolumeID string `json:"volumeId"`
}

type DeleteVolumePayload added in v0.0.145

type DeleteVolumePayload struct {
	App App
}

type DeployImageInput

type DeployImageInput struct {
	AppID      string      `json:"appId"`
	Image      string      `json:"image"`
	Services   *[]Service  `json:"services"`
	Definition *Definition `json:"definition"`
	Strategy   *string     `json:"strategy"`
}

type DeploymentStatus

type DeploymentStatus struct {
	ID             string
	Status         string
	Description    string
	InProgress     bool
	Successful     bool
	CreatedAt      time.Time
	Allocations    []*AllocationStatus
	Version        int
	DesiredCount   int
	PlacedCount    int
	HealthyCount   int
	UnhealthyCount int
}

type Domain added in v0.0.144

type Domain struct {
	ID                   string
	Name                 string
	CreatedAt            time.Time
	Organization         *Organization
	AutoRenew            *bool
	DelegatedNameservers *[]string
	ZoneNameservers      *[]string
	DnsStatus            *string
	RegistrationStatus   *string
	ExpiresAt            time.Time
	DnsRecords           *struct {
		Nodes *[]*DNSRecord
	}
}

type EnsureRemoteBuilderInput added in v0.0.164

type EnsureRemoteBuilderInput struct {
	AppName        *string `json:"appName"`
	OrganizationID *string `json:"organizationId"`
}

type Error added in v0.0.135

type Error struct {
	Message    string
	Path       []string
	Extensions Extensions
}

type Errors added in v0.0.135

type Errors []Error

type Extensions added in v0.0.135

type Extensions struct {
	Code        string
	ServiceName string
	Query       string
	Variables   map[string]string
}

type HTTPHeader

type HTTPHeader struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type HealthCheck added in v0.0.160

type HealthCheck struct {
	Entity      string
	Name        string
	Output      string
	State       string
	LastPassing time.Time
}

type HealthCheckHandler added in v0.0.160

type HealthCheckHandler struct {
	Name string
	Type string
}

type HostnameCheck added in v0.0.138

type HostnameCheck struct {
	ARecords              []string `json:"aRecords"`
	AAAARecords           []string `json:"aaaaRecords"`
	CNAMERecords          []string `json:"cnameRecords"`
	SOA                   string   `json:"soa"`
	DNSProvider           string   `json:"dnsProvider"`
	DNSVerificationRecord string   `json:"dnsVerificationRecord"`
	ResolvedAddresses     []string `json:"resolvedAddresses"`
}

type IPAddress

type IPAddress struct {
	ID        string
	Address   string
	Type      string
	CreatedAt time.Time
}

type Image added in v0.0.191

type Image struct {
	ID             string
	Digest         string
	Ref            string
	CompressedSize uint64
}

type ImportDnsChange added in v0.0.144

type ImportDnsChange struct {
	Action  string
	OldText string
	NewText string
}

type ImportDnsWarning added in v0.0.144

type ImportDnsWarning struct {
	Action     string
	Attributes struct {
		Name  string
		Type  string
		TTL   int
		Rdata string
	}
	Message string
}

type Invitation added in v0.0.227

type Invitation struct {
	ID           string
	Email        string
	CreatedAt    time.Time
	Redeemed     bool
	Inviter      *User
	Organization *Organization
}

type IssuedCertificate added in v0.0.172

type IssuedCertificate struct {
	Certificate string
	Key         string
}

type LogEntry

type LogEntry struct {
	Timestamp string
	Message   string
	Level     string
	Instance  string
	Region    string
	Meta      struct {
		Instance string
		Region   string
		Event    struct {
			Provider string
		}
		HTTP struct {
			Request struct {
				ID      string
				Method  string
				Version string
			}
			Response struct {
				StatusCode int `json:"status_code"`
			}
		}
		Error struct {
			Code    int
			Message string
		}
		URL struct {
			Full string
		}
	}
}

type LoggedCertificate added in v0.0.172

type LoggedCertificate struct {
	Root bool
	Cert string
}

type LoggingTransport

type LoggingTransport struct {
	// contains filtered or unexported fields
}

func (*LoggingTransport) RoundTrip

func (t *LoggingTransport) RoundTrip(req *http.Request) (*http.Response, error)

type Organization

type Organization struct {
	ID   string
	Name string
	Slug string
	Type string

	Domains struct {
		Nodes *[]*Domain
		Edges *[]*struct {
			Cursor *string
			Node   *Domain
		}
	}

	WireGuardPeers struct {
		Nodes *[]*WireGuardPeer
		Edges *[]*struct {
			Cursor *string
			Node   *WireGuardPeer
		}
	}

	DelegatedWireGuardTokens struct {
		Nodes *[]*DelegatedWireGuardTokenHandle
		Edges *[]*struct {
			Cursor *string
			Node   *DelegatedWireGuardTokenHandle
		}
	}

	HealthCheckHandlers *struct {
		Nodes []HealthCheckHandler
	}

	HealthChecks *struct {
		Nodes []HealthCheck
	}

	LoggedCertificates *struct {
		Nodes []LoggedCertificate
	}
}

type OrganizationDetails added in v0.0.138

type OrganizationDetails struct {
	ID         string
	Name       string
	Slug       string
	Type       string
	ViewerRole string
	Apps       struct {
		Nodes []App
	}
	Members struct {
		Edges []OrganizationMembershipEdge
	}
}

type OrganizationMembershipEdge added in v0.0.138

type OrganizationMembershipEdge struct {
	Cursor   string
	Node     User
	Role     string
	JoinedAt time.Time
}

type OrganizationType added in v0.0.227

type OrganizationType string
const (
	OrganizationTypePersonal OrganizationType = "PERSONAL"
	OrganizationTypeShared   OrganizationType = "SHARED"
)

type PortHandler

type PortHandler struct {
	Port     int      `json:"port"`
	Handlers []string `json:"handlers"`
}

type PostgresClusterDatabase added in v0.0.164

type PostgresClusterDatabase struct {
	Name  string
	Users []string
}

type PostgresClusterUser added in v0.0.164

type PostgresClusterUser struct {
	Username    string
	IsSuperuser bool
	Databases   []string
}

type Query

type Query struct {
	Errors Errors

	Apps struct {
		Nodes []App
	}
	App                  App
	AppCompact           AppCompact
	AppStatus            AppStatus
	AppCertsCompact      AppCertsCompact
	CurrentUser          User
	PersonalOrganization Organization
	Organizations        struct {
		Nodes []Organization
	}

	Organization *Organization
	// PersonalOrganizations PersonalOrganizations
	OrganizationDetails OrganizationDetails
	Build               Build
	Volume              Volume
	Domain              *Domain

	Node  interface{}
	Nodes []interface{}

	Platform struct {
		RequestRegion string
		Regions       []Region
		VMSizes       []VMSize
	}

	NearestRegion *Region

	TemplateDeploymentNode *TemplateDeployment
	ReleaseCommandNode     *ReleaseCommand

	// mutations
	CreateApp struct {
		App App
	}

	SetSecrets struct {
		Release Release
	}

	UnsetSecrets struct {
		Release Release
	}

	DeployImage struct {
		Release        Release
		ReleaseCommand *ReleaseCommand
	}

	EnsureRemoteBuilder *struct {
		App     *App
		URL     string
		Release Release
	}

	CreateSignedUrl SignedUrls

	StartBuild struct {
		Build Build
	}

	AddCertificate struct {
		Certificate *AppCertificate
		Check       *HostnameCheck
	}

	DeleteCertificate DeleteCertificatePayload

	CheckCertificate struct {
		App         *App
		Certificate *AppCertificate
		Check       *HostnameCheck
	}

	AllocateIPAddress struct {
		App       App
		IPAddress IPAddress
	}
	ReleaseIPAddress struct {
		App App
	}
	ScaleApp struct {
		App       App
		Placement []RegionPlacement
		Delta     []ScaleRegionChange
	}

	UpdateAutoscaleConfig struct {
		App App
	}

	SetVMSize struct {
		App    App
		VMSize *VMSize
	}

	SetVMCount struct {
		App             App
		TaskGroupCounts []TaskGroupCount
		Warnings        []string
	}

	ConfigureRegions struct {
		App           App
		Regions       []Region
		BackupRegions []Region
	}

	ResumeApp struct {
		App App
	}

	SuspendApp struct {
		App App
	}

	RestartApp struct {
		App App
	}

	CreateDomain struct {
		Domain *Domain
	}
	CreateAndRegisterDomain struct {
		Domain *Domain
	}

	CheckDomain *CheckDomainResult

	ExportDnsZone struct {
		Contents string
	}

	ImportDnsZone struct {
		Warnings []ImportDnsWarning
		Changes  []ImportDnsChange
	}
	CreateOrganization CreateOrganizationPayload
	DeleteOrganization DeleteOrganizationPayload

	CreateVolume CreateVolumePayload
	DeleteVolume DeleteVolumePayload

	AddWireGuardPeer              CreatedWireGuardPeer
	EstablishSSHKey               SSHCertificate
	IssueCertificate              IssuedCertificate
	CreateDelegatedWireGuardToken DelegatedWireGuardToken
	DeleteDelegatedWireGuardToken DelegatedWireGuardToken

	RemoveWireGuardPeer struct {
		Organization Organization
	}

	SetSlackHandler *struct {
		Handler *HealthCheckHandler
	}

	SetPagerdutyHandler *struct {
		Handler *HealthCheckHandler
	}

	CreatePostgresCluster *CreatePostgresClusterPayload

	AttachPostgresCluster *AttachPostgresClusterPayload

	CreateOrganizationInvitation CreateOrganizationInvitation

	ValidateWireGuardPeers struct {
		InvalidPeerIPs []string
	}
}

Query - Master query which encapsulates all possible returned structures

type Region added in v0.0.95

type Region struct {
	Code             string
	Name             string
	Latitude         float32
	Longitude        float32
	GatewayAvailable bool
}

type RegionPlacement added in v0.0.94

type RegionPlacement struct {
	Region string
	Count  int
}

type Release

type Release struct {
	ID                 string
	Version            int
	Stable             bool
	InProgress         bool
	Reason             string
	Description        string
	Status             string
	DeploymentStrategy string
	User               User
	CreatedAt          time.Time
}

type ReleaseCommand added in v0.0.201

type ReleaseCommand struct {
	ID         string
	Command    string
	Status     string
	ExitCode   *int
	InstanceID *string
	InProgress bool
	Succeeded  bool
	Failed     bool
}

type ReleaseIPAddressInput

type ReleaseIPAddressInput struct {
	IPAddressID string `json:"ipAddressId"`
}

type SSHCertificate added in v0.0.172

type SSHCertificate struct {
	Certificate string
}

type ScaleAppInput added in v0.0.94

type ScaleAppInput struct {
	AppID   string             `json:"appId"`
	Regions []ScaleRegionInput `json:"regions"`
}

type ScaleRegionChange added in v0.0.94

type ScaleRegionChange struct {
	Region    string
	FromCount int
	ToCount   int
}

type ScaleRegionInput added in v0.0.94

type ScaleRegionInput struct {
	Region string `json:"region"`
	Count  int    `json:"count"`
}

type Secret

type Secret struct {
	Name      string
	Digest    string
	CreatedAt time.Time
}

type Service

type Service struct {
	Description     string        `json:"description"`
	Protocol        string        `json:"protocol,omitempty"`
	InternalPort    int           `json:"internalPort,omitempty"`
	Ports           []PortHandler `json:"ports,omitempty"`
	Checks          []Check       `json:"checks,omitempty"`
	SoftConcurrency int           `json:"softConcurrency,omitempty"`
	HardConcurrency int           `json:"hardConcurrency,omitempty"`
}

type SetPagerdutyHandlerInput added in v0.0.160

type SetPagerdutyHandlerInput struct {
	OrganizationID string `json:"organizationId"`
	Name           string `json:"name"`
	PagerdutyToken string `json:"pagerdutyToken"`
}

type SetSecretsInput

type SetSecretsInput struct {
	AppID   string                  `json:"appId"`
	Secrets []SetSecretsInputSecret `json:"secrets"`
}

type SetSecretsInputSecret

type SetSecretsInputSecret struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type SetSlackHandlerInput added in v0.0.160

type SetSlackHandlerInput struct {
	OrganizationID  string  `json:"organizationId"`
	Name            string  `json:"name"`
	SlackWebhookURL string  `json:"slackWebhookUrl"`
	SlackChannel    *string `json:"slackChannel"`
	SlackUsername   *string `json:"slackUsername"`
	SlackIconURL    *string `json:"slackIconUrl"`
}

type SetVMCountInput added in v0.0.157

type SetVMCountInput struct {
	AppID       string         `json:"appId"`
	GroupCounts []VMCountInput `json:"groupCounts"`
}

type SetVMSizeInput added in v0.0.98

type SetVMSizeInput struct {
	AppID    string `json:"appId"`
	SizeName string `json:"sizeName"`
	MemoryMb int64  `json:"memoryMb"`
}

type SignedUrls

type SignedUrls struct {
	GetUrl string
	PutUrl string
}

type StartBuildInput added in v0.0.111

type StartBuildInput struct {
	AppID      string          `json:"appId"`
	SourceURL  string          `json:"sourceUrl"`
	SourceType string          `json:"sourceType"`
	BuildType  *string         `json:"buildType"`
	BuildArgs  []BuildArgInput `json:"buildArgs"`
}

type TaskGroupCount added in v0.0.157

type TaskGroupCount struct {
	Name  string
	Count int
}

type TemplateDeployment added in v0.0.162

type TemplateDeployment struct {
	ID     string
	Status string
	Apps   *struct {
		Nodes []App
	}
}

type UnsetSecretsInput

type UnsetSecretsInput struct {
	AppID string   `json:"appId"`
	Keys  []string `json:"keys"`
}

type UpdateAutoscaleConfigInput added in v0.0.98

type UpdateAutoscaleConfigInput struct {
	AppID          string                       `json:"appId"`
	Enabled        *bool                        `json:"enabled"`
	MinCount       *int                         `json:"minCount"`
	MaxCount       *int                         `json:"maxCount"`
	BalanceRegions *bool                        `json:"balanceRegions"`
	ResetRegions   *bool                        `json:"resetRegions"`
	Regions        []AutoscaleRegionConfigInput `json:"regions"`
}

type User

type User struct {
	ID    string
	Name  string
	Email string
}

type VMCountInput added in v0.0.157

type VMCountInput struct {
	Group        string `json:"group"`
	Count        int    `json:"count"`
	MaxPerRegion *int   `json:"maxPerRegion"`
}

type VMSize added in v0.0.98

type VMSize struct {
	Name               string
	CPUCores           float32
	MemoryGB           float32
	MemoryMB           int
	PriceMonth         float32
	PriceSecond        float32
	MemoryIncrementsMB []int
}

type Volume added in v0.0.145

type Volume struct {
	ID                 string `json:"id"`
	App                string
	Name               string
	SizeGb             int
	Region             string
	Encrypted          bool
	CreatedAt          time.Time
	AttachedAllocation *AllocationStatus
}

type WireGuardPeer added in v0.0.152

type WireGuardPeer struct {
	ID     string
	Pubkey string
	Region string
	Name   string
	Peerip string
}

Jump to

Keyboard shortcuts

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