scalingo

package module
v6.7.7 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: BSD-4-Clause Imports: 25 Imported by: 3

README

Codeship Status for Scalingo/go-scalingo

Go client for Scalingo API v6.7.7

This repository is the Go client for the Scalingo APIs.

Getting Started

package main

import (
	"github.com/Scalingo/go-scalingo/v6"
)

func getClient() (*scalingo.Client, error) {
	config := scalingo.ClientConfig{
		APIEndpoint: "https://api.osc-fr1.scalingo.com", // Possible endpoints can be found at https://developers.scalingo.com/#endpoints
		APIToken: "tk-us-XYZXYZYZ", // You can create a token in the dashboard at Profile > Token > Create new token
	}
	return scalingo.New(config)
}

func main() {
	client, err := getClient()
	if err != nil {
		panic(err)
	}
	apps, err := client.AppsList()
	if err != nil {
		panic(err)
	}
	for _, app := range apps {
		println("App: " + app.Name)
	}
}

Explore

As this Go client maps all the public Scalingo APIs, you can explore the API documentation. If you need an implementation example, you can take a look at the Scalingo CLI code.

Repository Processes

Add Support for a New Event

A couple of files must be updated when adding support for a new event type. For instance if your event type is named my_event:

  • events_struct.go:
    • Add the EventMyEvent constant
    • Add the EventMyEventTypeData structure
    • Add EventMyEventType structure which embeds a field TypeData of the type EventMyEventTypeData.
    • Implement function String for EventMyEventType
    • [optional] Implement Who function for EventMyEventType. E.g. if the event type can be created by an addon.

Once the Event has been added run the following command to update boilerplate code

go generate
Client HTTP Errors

HTTP errors are managed in the file http/errors.go. It follows the Scalingo standards detailed in the developers documentation.

Release a New Version

Bump new version number in:

  • CHANGELOG.md
  • README.md
  • version.go

Commit, tag and create a new release:

version="6.7.7"

git switch --create release/${version}
git add CHANGELOG.md README.md version.go
git commit -m "Bump v${version}"
git push --set-upstream origin release/${version}
gh pr create --reviewer=EtienneM --title "$(git log -1 --pretty=%B)"

Once the pull request merged, you can tag the new release.

git tag v${version}
git push origin master v${version}
gh release create v${version}

The title of the release should be the version number and the text of the release is the same as the changelog.

Documentation

Overview

Package scalingo is a generated GoMock package.

Index

Constants

View Source
const (
	MetricMemory                = "memory"
	MetricSwap                  = "swap"
	MetricCPU                   = "cpu"
	MetricRouter5XX             = "5XX"
	MetricRouterAll             = "all"
	MetricRouterServersAmount   = "servers_amount"
	MetricRouterRPMPerContainer = "rpm_per_container"
	MetricRouterP95ResponseTime = "p95_response_time"
)

These constants contain the string repsentation for all metric available on Scalingo

View Source
const (
	RegionMigrationStatusCreated          RegionMigrationStatus = "created"
	RegionMigrationStatusPreflightSuccess RegionMigrationStatus = "preflight-success"
	RegionMigrationStatusPreflightError   RegionMigrationStatus = "preflight-error"
	RegionMigrationStatusRunning          RegionMigrationStatus = "running"
	RegionMigrationStatusPrepared         RegionMigrationStatus = "prepared"
	RegionMigrationStatusDataMigrated     RegionMigrationStatus = "data-migrated"
	RegionMigrationStatusAborting         RegionMigrationStatus = "aborting"
	RegionMigrationStatusAborted          RegionMigrationStatus = "aborted"
	RegionMigrationStatusError            RegionMigrationStatus = "error"
	RegionMigrationStatusDone             RegionMigrationStatus = "done"

	RegionMigrationStepAbort     RegionMigrationStep = "abort"
	RegionMigrationStepPreflight RegionMigrationStep = "preflight"
	RegionMigrationStepPrepare   RegionMigrationStep = "prepare"
	RegionMigrationStepData      RegionMigrationStep = "data"
	RegionMigrationStepFinalize  RegionMigrationStep = "finalize"

	StepStatusRunning StepStatus = "running"
	StepStatusDone    StepStatus = "done"
	StepStatusError   StepStatus = "error"
)
View Source
const BillingMonthDateFormat = "2006-01-02"

Variables

View Source
var ErrOTPRequired = http.ErrOTPRequired

Deprecated: use http.ErrOTPRequired instead of this wrapper.

View Source
var (
	ErrRegionNotFound = errgo.New("Region not found")
)
View Source
var NotifierPlatformNames = map[string]string{
	"email":       "E-mail",
	"rocker_chat": "Rocket Chat",
	"slack":       "Slack",
	"webhook":     "Webhook",
}
View Source
var SCMTypeDisplay = map[SCMType]string{
	SCMGithubType:           "GitHub",
	SCMGitlabType:           "GitLab",
	SCMGithubEnterpriseType: "GitHub Enterprise",
	SCMGitlabSelfHostedType: "GitLab self-hosted",
}
View Source
var Version = "6.7.7"

Functions

func HasFailedString

func HasFailedString(status DeploymentStatus) bool

func IsFinishedString

func IsFinishedString(status DeploymentStatus) bool

func IsOTPRequired deprecated

func IsOTPRequired(err error) bool

IsOTPRequired tests if the authentication backend return an OTP Required error

Deprecated: use http.IsOTPRequired instead of this wrapper.

func MockAuth

func MockAuth(ctrl *gomock.Controller) *httpmock.MockClient

Types

type ACMEErrorVariables

type ACMEErrorVariables struct {
	DNSProvider string   `json:"dns_provider"`
	Variables   []string `json:"variables"`
}

type Addon

type Addon struct {
	ID              string         `json:"id"`
	AppID           string         `json:"app_id"`
	ResourceID      string         `json:"resource_id"`
	Status          AddonStatus    `json:"status"`
	Plan            *Plan          `json:"plan"`
	AddonProvider   *AddonProvider `json:"addon_provider"`
	ProvisionedAt   time.Time      `json:"provisioned_at"`
	DeprovisionedAt time.Time      `json:"deprovisioned_at"`
}

type AddonLogsURLRes

type AddonLogsURLRes struct {
	URL string `json:"url"`
}

type AddonProvider

type AddonProvider struct {
	ID               string   `json:"id"`
	LogoURL          string   `json:"logo_url"`
	Name             string   `json:"name"`
	ShortDescription string   `json:"short_description"`
	Description      string   `json:"description"`
	Category         Category `json:"category"`
	ProviderName     string   `json:"provider_name"`
	ProviderURL      string   `json:"provider_url"`
	HDSAvailable     bool     `json:"hds_available"`
	Plans            []Plan   `json:"plans"`
}

type AddonProvidersService

type AddonProvidersService interface {
	AddonProvidersList(context.Context) ([]*AddonProvider, error)
	AddonProviderPlansList(ctx context.Context, addon string) ([]*Plan, error)
}

type AddonProvisionParams

type AddonProvisionParams struct {
	AddonProviderID string            `json:"addon_provider_id"`
	PlanID          string            `json:"plan_id"`
	Options         map[string]string `json:"options"`
}

AddonProvisionParams gathers all arguments which can be sent to provision an addon

type AddonProvisionParamsWrapper

type AddonProvisionParamsWrapper struct {
	Addon AddonProvisionParams `json:"addon"`
}

type AddonRes

type AddonRes struct {
	Addon     Addon    `json:"addon"`
	Message   string   `json:"message,omitempty"`
	Variables []string `json:"variables,omitempty"`
}

type AddonStatus

type AddonStatus string
const (
	AddonStatusRunning      AddonStatus = "running"
	AddonStatusProvisioning AddonStatus = "provisioning"
	AddonStatusSuspended    AddonStatus = "suspended"
)

type AddonToken

type AddonToken struct {
	Token string `json:"token"`
}

type AddonTokenRes

type AddonTokenRes struct {
	Addon AddonToken `json:"addon"`
}

type AddonUpgradeParams

type AddonUpgradeParams struct {
	PlanID string `json:"plan_id"`
}

type AddonUpgradeParamsWrapper

type AddonUpgradeParamsWrapper struct {
	Addon AddonUpgradeParams `json:"addon"`
}

type AddonsRes

type AddonsRes struct {
	Addons []*Addon `json:"addons"`
}

type AddonsService

type AddonsService interface {
	AddonsList(ctx context.Context, app string) ([]*Addon, error)
	AddonProvision(ctx context.Context, app string, params AddonProvisionParams) (AddonRes, error)
	AddonDestroy(ctx context.Context, app, addonID string) error
	AddonUpgrade(ctx context.Context, app, addonID string, params AddonUpgradeParams) (AddonRes, error)
	AddonToken(ctx context.Context, app, addonID string) (string, error)
	AddonLogsURL(ctx context.Context, app, addonID string) (string, error)
	AddonLogsArchives(ctx context.Context, app, addonID string, page int) (*LogsArchivesResponse, error)
}

type Alert

type Alert struct {
	ID                    string                 `json:"id"`
	AppID                 string                 `json:"app_id"`
	ContainerType         string                 `json:"container_type"`
	Metric                string                 `json:"metric"`
	Limit                 float64                `json:"limit"`
	Disabled              bool                   `json:"disabled"`
	SendWhenBelow         bool                   `json:"send_when_below"`
	DurationBeforeTrigger time.Duration          `json:"duration_before_trigger"`
	RemindEvery           string                 `json:"remind_every"`
	CreatedAt             time.Time              `json:"created_at"`
	UpdatedAt             time.Time              `json:"updated_at"`
	Metadata              map[string]interface{} `json:"metadata"`
	Notifiers             []string               `json:"notifiers"`
}

type AlertAddParams

type AlertAddParams struct {
	ContainerType         string
	Metric                string
	Limit                 float64
	Disabled              bool
	RemindEvery           *time.Duration
	DurationBeforeTrigger *time.Duration
	SendWhenBelow         bool
	Notifiers             []string
}

type AlertRes

type AlertRes struct {
	Alert *Alert `json:"alert"`
}

type AlertUpdateParams

type AlertUpdateParams struct {
	ContainerType         *string        `json:"container_type,omitempty"`
	Metric                *string        `json:"metric,omitempty"`
	Limit                 *float64       `json:"limit,omitempty"`
	Disabled              *bool          `json:"disabled,omitempty"`
	DurationBeforeTrigger *time.Duration `json:"duration_before_trigger,omitempty"`
	RemindEvery           *time.Duration `json:"remind_every,omitempty"`
	SendWhenBelow         *bool          `json:"send_when_below,omitempty"`
	Notifiers             *[]string      `json:"notifiers,omitempty"`
}

type AlertsRes

type AlertsRes struct {
	Alerts []*Alert `json:"alerts"`
}

type AlertsService

type AlertsService interface {
	AlertsList(ctx context.Context, app string) ([]*Alert, error)
	AlertAdd(ctx context.Context, app string, params AlertAddParams) (*Alert, error)
	AlertShow(ctx context.Context, app, id string) (*Alert, error)
	AlertUpdate(ctx context.Context, app, id string, params AlertUpdateParams) (*Alert, error)
	AlertRemove(ctx context.Context, app, id string) error
}

type App

type App struct {
	ID                string                 `json:"id"`
	Name              string                 `json:"name"`
	Region            string                 `json:"region"`
	Owner             Owner                  `json:"owner"`
	GitURL            string                 `json:"git_url"`
	URL               string                 `json:"url"`
	BaseURL           string                 `json:"base_url"`
	Status            AppStatus              `json:"status"`
	LastDeployedAt    *time.Time             `json:"last_deployed_at"`
	LastDeployedBy    string                 `json:"last_deployed_by"`
	CreatedAt         *time.Time             `json:"created_at"`
	UpdatedAt         *time.Time             `json:"updated_at"`
	Links             *AppLinks              `json:"links"`
	StackID           string                 `json:"stack_id"`
	StickySession     bool                   `json:"sticky_session"`
	ForceHTTPS        bool                   `json:"force_https"`
	RouterLogs        bool                   `json:"router_logs"`
	DataAccessConsent *DataAccessConsent     `json:"data_access_consent,omitempty"`
	Flags             map[string]bool        `json:"flags"`
	Limits            map[string]interface{} `json:"limits"`
	HDSResource       bool                   `json:"hds_resource"`
}

func (App) String

func (app App) String() string
type AppLinks struct {
	DeploymentsStream string `json:"deployments_stream"`
}

type AppResponse

type AppResponse struct {
	App *App `json:"app"`
}

type AppStatsRes

type AppStatsRes struct {
	Stats []*ContainerStat `json:"stats"`
}

type AppStatus

type AppStatus string
const (
	AppStatusNew        AppStatus = "new"
	AppStatusRunning    AppStatus = "running"
	AppStatusStopped    AppStatus = "stopped"
	AppStatusScaling    AppStatus = "scaling"
	AppStatusRestarting AppStatus = "restarting"
)

type AppsContainerTypesRes

type AppsContainerTypesRes struct {
	Containers []ContainerType `json:"containers"`
}

type AppsCreateOpts

type AppsCreateOpts struct {
	Name      string `json:"name"`
	ParentApp string `json:"parent_id,omitempty"`
	StackID   string `json:"stack_id,omitempty"`
}

type AppsPsRes

type AppsPsRes struct {
	Containers []Container `json:"containers"`
}

type AppsRestartParams

type AppsRestartParams struct {
	Scope []string `json:"scope"`
}

type AppsScaleParams

type AppsScaleParams struct {
	Containers []ContainerType `json:"containers"`
}

type AppsService

type AppsService interface {
	AppsList(ctx context.Context) ([]*App, error)
	AppsShow(ctx context.Context, appName string) (*App, error)
	AppsDestroy(ctx context.Context, name string, currentName string) error
	AppsRename(ctx context.Context, name string, newName string) (*App, error)
	AppsTransfer(ctx context.Context, name string, email string) (*App, error)
	AppsSetStack(ctx context.Context, name string, stackID string) (*App, error)
	AppsRestart(ctx context.Context, app string, scope *AppsRestartParams) (*http.Response, error)
	AppsCreate(ctx context.Context, opts AppsCreateOpts) (*App, error)
	AppsStats(ctx context.Context, app string) (*AppStatsRes, error)
	AppsContainerTypes(ctx context.Context, app string) ([]ContainerType, error)
	AppsContainersPs(ctx context.Context, app string) ([]Container, error)
	AppsScale(ctx context.Context, app string, params *AppsScaleParams) (*http.Response, error)
	AppsForceHTTPS(ctx context.Context, name string, enable bool) (*App, error)
	AppsStickySession(ctx context.Context, name string, enable bool) (*App, error)
	AppsRouterLogs(ctx context.Context, name string, enable bool) (*App, error)
}

type AuthStruct

type AuthStruct struct {
	Type string             `json:"type"`
	Data AuthenticationData `json:"data"`
}

type AuthenticationData

type AuthenticationData struct {
	Token string `json:"token"`
}

type Autoscaler

type Autoscaler struct {
	ID            string  `json:"id"`
	AppID         string  `json:"app_id"`
	ContainerType string  `json:"container_type"`
	Metric        string  `json:"metric"`
	Target        float64 `json:"target"`
	MinContainers int     `json:"min_containers"`
	MaxContainers int     `json:"max_containers"`
	Disabled      bool    `json:"disabled"`
}

type AutoscalerAddParams

type AutoscalerAddParams struct {
	ContainerType string  `json:"container_type"`
	Metric        string  `json:"metric"`
	Target        float64 `json:"target"`
	MinContainers int     `json:"min_containers"`
	MaxContainers int     `json:"max_containers"`
}

type AutoscalerRes

type AutoscalerRes struct {
	Autoscaler Autoscaler `json:"autoscaler"`
}

type AutoscalerUpdateParams

type AutoscalerUpdateParams struct {
	Metric        *string  `json:"metric,omitempty"`
	Target        *float64 `json:"target,omitempty"`
	MinContainers *int     `json:"min_containers,omitempty"`
	MaxContainers *int     `json:"max_containers,omitempty"`
	Disabled      *bool    `json:"disabled,omitempty"`
}

type AutoscalersRes

type AutoscalersRes struct {
	Autoscalers []Autoscaler `json:"autoscalers"`
}

type AutoscalersService

type AutoscalersService interface {
	AutoscalersList(ctx context.Context, app string) ([]Autoscaler, error)
	AutoscalerAdd(ctx context.Context, app string, params AutoscalerAddParams) (*Autoscaler, error)
	AutoscalerRemove(ctx context.Context, app string, id string) error
}

type Backup

type Backup struct {
	ID         string       `json:"id"`
	CreatedAt  time.Time    `json:"created_at"`
	StartedAt  time.Time    `json:"started_at"`
	Name       string       `json:"name"`
	Size       uint64       `json:"size"`
	Status     BackupStatus `json:"status"`
	DatabaseID string       `json:"database_id"`
	Method     BackupMethod `json:"method"`
}

type BackupMethod added in v6.4.0

type BackupMethod string
const (
	BackupMethodPeriodic BackupMethod = "periodic"
	BackupMethodManual   BackupMethod = "manual"
)

type BackupRes

type BackupRes struct {
	Backup Backup `json:"database_backup"`
}

type BackupStatus

type BackupStatus string
const (
	BackupStatusScheduled BackupStatus = "scheduled"
	BackupStatusRunning   BackupStatus = "running"
	BackupStatusDone      BackupStatus = "done"
	BackupStatusError     BackupStatus = "error"
)

type BackupsRes

type BackupsRes struct {
	Backups []Backup `json:"database_backups"`
}

type BackupsService

type BackupsService interface {
	BackupList(ctx context.Context, app, addonID string) ([]Backup, error)
	BackupCreate(ctx context.Context, app, addonID string) (*Backup, error)
	BackupShow(ctx context.Context, app, addonID, backupID string) (*Backup, error)
	BackupDownloadURL(ctx context.Context, app, addonID, backupID string) (string, error)
}

type BearerTokenRes

type BearerTokenRes struct {
	Token string `json:"token"`
}

type Category

type Category struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Position    int    `json:"position"`
}

type Client

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

func New

func New(ctx context.Context, cfg ClientConfig) (*Client, error)

func (*Client) AddonDestroy

func (c *Client) AddonDestroy(ctx context.Context, app, addonID string) error

func (*Client) AddonLogsArchives

func (c *Client) AddonLogsArchives(ctx context.Context, app, addonID string, page int) (*LogsArchivesResponse, error)

func (*Client) AddonLogsURL

func (c *Client) AddonLogsURL(ctx context.Context, app, addonID string) (string, error)

func (*Client) AddonProviderPlansList

func (c *Client) AddonProviderPlansList(ctx context.Context, addon string) ([]*Plan, error)

func (*Client) AddonProvidersList

func (c *Client) AddonProvidersList(ctx context.Context) ([]*AddonProvider, error)

func (*Client) AddonProvision

func (c *Client) AddonProvision(ctx context.Context, app string, params AddonProvisionParams) (AddonRes, error)

func (*Client) AddonShow

func (c *Client) AddonShow(ctx context.Context, app, addonID string) (Addon, error)

func (*Client) AddonToken

func (c *Client) AddonToken(ctx context.Context, app, addonID string) (string, error)

func (*Client) AddonUpgrade

func (c *Client) AddonUpgrade(ctx context.Context, app, addonID string, params AddonUpgradeParams) (AddonRes, error)

func (*Client) AddonsList

func (c *Client) AddonsList(ctx context.Context, app string) ([]*Addon, error)

func (*Client) AlertAdd

func (c *Client) AlertAdd(ctx context.Context, app string, params AlertAddParams) (*Alert, error)

func (*Client) AlertRemove

func (c *Client) AlertRemove(ctx context.Context, app, id string) error

func (*Client) AlertShow

func (c *Client) AlertShow(ctx context.Context, app, id string) (*Alert, error)

func (*Client) AlertUpdate

func (c *Client) AlertUpdate(ctx context.Context, app, id string, params AlertUpdateParams) (*Alert, error)

func (*Client) AlertsList

func (c *Client) AlertsList(ctx context.Context, app string) ([]*Alert, error)

func (*Client) AppsContainerTypes

func (c *Client) AppsContainerTypes(ctx context.Context, app string) ([]ContainerType, error)

func (*Client) AppsContainersPs

func (c *Client) AppsContainersPs(ctx context.Context, app string) ([]Container, error)

func (*Client) AppsCreate

func (c *Client) AppsCreate(ctx context.Context, opts AppsCreateOpts) (*App, error)

func (*Client) AppsDestroy

func (c *Client) AppsDestroy(ctx context.Context, name string, currentName string) error

func (*Client) AppsForceHTTPS

func (c *Client) AppsForceHTTPS(ctx context.Context, name string, enable bool) (*App, error)

func (*Client) AppsList

func (c *Client) AppsList(ctx context.Context) ([]*App, error)

func (*Client) AppsRename

func (c *Client) AppsRename(ctx context.Context, name string, newName string) (*App, error)

func (*Client) AppsRestart

func (c *Client) AppsRestart(ctx context.Context, app string, scope *AppsRestartParams) (*http.Response, error)

func (*Client) AppsRouterLogs

func (c *Client) AppsRouterLogs(ctx context.Context, name string, enable bool) (*App, error)

func (*Client) AppsScale

func (c *Client) AppsScale(ctx context.Context, app string, params *AppsScaleParams) (*http.Response, error)

func (*Client) AppsSetStack

func (c *Client) AppsSetStack(ctx context.Context, app string, stackID string) (*App, error)

func (*Client) AppsShow

func (c *Client) AppsShow(ctx context.Context, appName string) (*App, error)

func (*Client) AppsStats

func (c *Client) AppsStats(ctx context.Context, app string) (*AppStatsRes, error)

func (*Client) AppsStickySession

func (c *Client) AppsStickySession(ctx context.Context, name string, enable bool) (*App, error)

func (*Client) AppsTransfer

func (c *Client) AppsTransfer(ctx context.Context, name string, email string) (*App, error)

func (*Client) AuthAPI

func (c *Client) AuthAPI() http.Client

func (*Client) AutoscalerAdd

func (c *Client) AutoscalerAdd(ctx context.Context, app string, params AutoscalerAddParams) (*Autoscaler, error)

func (*Client) AutoscalerRemove

func (c *Client) AutoscalerRemove(ctx context.Context, app, id string) error

func (*Client) AutoscalerShow

func (c *Client) AutoscalerShow(ctx context.Context, app, id string) (*Autoscaler, error)

func (*Client) AutoscalerUpdate

func (c *Client) AutoscalerUpdate(ctx context.Context, app, id string, params AutoscalerUpdateParams) (*Autoscaler, error)

func (*Client) AutoscalersList

func (c *Client) AutoscalersList(ctx context.Context, app string) ([]Autoscaler, error)

func (*Client) BackupCreate

func (c *Client) BackupCreate(ctx context.Context, app, addonID string) (*Backup, error)

func (*Client) BackupDownloadURL

func (c *Client) BackupDownloadURL(ctx context.Context, app, addonID, backupID string) (string, error)

func (*Client) BackupList

func (c *Client) BackupList(ctx context.Context, app string, addonID string) ([]Backup, error)

func (*Client) BackupShow

func (c *Client) BackupShow(ctx context.Context, app, addonID, backup string) (*Backup, error)

func (*Client) CollaboratorAdd

func (c *Client) CollaboratorAdd(ctx context.Context, app string, email string) (Collaborator, error)

func (*Client) CollaboratorRemove

func (c *Client) CollaboratorRemove(ctx context.Context, app string, id string) error

func (*Client) CollaboratorsList

func (c *Client) CollaboratorsList(ctx context.Context, app string) ([]Collaborator, error)

func (*Client) ContainerSizesList

func (c *Client) ContainerSizesList(ctx context.Context) ([]ContainerSize, error)

func (*Client) ContainersKill added in v6.1.0

func (c *Client) ContainersKill(ctx context.Context, app string, signal string, containerID string) error

func (*Client) ContainersStop

func (c *Client) ContainersStop(ctx context.Context, appName, containerID string) error

func (*Client) CreateRegionMigration

func (c *Client) CreateRegionMigration(ctx context.Context, appID string, params RegionMigrationParams) (RegionMigration, error)

func (*Client) CronTasksGet

func (c *Client) CronTasksGet(ctx context.Context, app string) (CronTasks, error)

func (*Client) DBAPI

func (c *Client) DBAPI(app, addon string) http.Client

func (*Client) DatabaseCreateUser added in v6.7.4

func (c *Client) DatabaseCreateUser(ctx context.Context, app, addonID string, user DatabaseCreateUserParam) (DatabaseUser, error)

DatabaseCreateUser creates an user to the given database addon

func (*Client) DatabaseDeleteUser added in v6.7.4

func (c *Client) DatabaseDeleteUser(ctx context.Context, app, addonID, userName string) error

DatabaseDeleteUser delete an user from the given database addon

func (*Client) DatabaseDisableFeature

func (c *Client) DatabaseDisableFeature(ctx context.Context, app, addonID, feature string) (DatabaseDisableFeatureResponse, error)

DatabaseDisableFeature disables a feature on a given database addon

func (*Client) DatabaseEnableFeature

func (c *Client) DatabaseEnableFeature(ctx context.Context, app, addonID, feature string) (DatabaseEnableFeatureResponse, error)

DatabaseEnableFeature enable a feature on a given database addon.

func (*Client) DatabaseListMaintenance added in v6.7.0

func (c *Client) DatabaseListMaintenance(ctx context.Context, app, addonID string, opts PaginationOpts) ([]*Maintenance, PaginationMeta, error)

func (*Client) DatabaseListUsers added in v6.7.4

func (c *Client) DatabaseListUsers(ctx context.Context, app, addonID string) ([]DatabaseUser, error)

DatabaseListUsers list the users of the given database addon

func (*Client) DatabaseShow

func (c *Client) DatabaseShow(ctx context.Context, app, addonID string) (Database, error)

DatabaseShow returns the Database info of the given app/addonID

func (*Client) DatabaseShowMaintenance added in v6.7.0

func (c *Client) DatabaseShowMaintenance(ctx context.Context, app, addonID, maintenanceID string) (Maintenance, error)

func (Client) DatabaseTypeVersion

func (c Client) DatabaseTypeVersion(ctx context.Context, appID, addonID, versionID string) (DatabaseTypeVersion, error)

func (*Client) DatabaseUpdateMaintenanceWindow added in v6.7.0

func (c *Client) DatabaseUpdateMaintenanceWindow(ctx context.Context, app, addonID string, params MaintenanceWindowParams) (Database, error)

func (*Client) DatabaseUpdatePeriodicBackupsConfig

func (c *Client) DatabaseUpdatePeriodicBackupsConfig(ctx context.Context, app, addonID string, params DatabaseUpdatePeriodicBackupsConfigParams) (Database, error)

DatabaseUpdatePeriodicBackupsConfig updates the configuration of periodic backups for a given database addon

func (*Client) DatabaseUpdateUser added in v6.7.7

func (c *Client) DatabaseUpdateUser(ctx context.Context, app, addonID, username string, databaseUserParams DatabaseUpdateUserParam) (DatabaseUser, error)

DatabaseUpdateUser updates a user to the given database addon

func (*Client) Deployment

func (c *Client) Deployment(ctx context.Context, app string, deploy string) (*Deployment, error)

func (*Client) DeploymentCacheReset

func (c *Client) DeploymentCacheReset(ctx context.Context, app string) error

func (*Client) DeploymentList

func (c *Client) DeploymentList(ctx context.Context, app string) ([]*Deployment, error)

func (*Client) DeploymentListWithPagination

func (c *Client) DeploymentListWithPagination(ctx context.Context, app string, opts PaginationOpts) ([]*Deployment, PaginationMeta, error)

func (*Client) DeploymentLogs

func (c *Client) DeploymentLogs(ctx context.Context, deployURL string) (*http.Response, error)

func (*Client) DeploymentStream

func (c *Client) DeploymentStream(ctx context.Context, deployURL string) (*websocket.Conn, error)

DeploymentStream returns a websocket connection to follow the various deployment events happening on an application. The type of the data sent on this connection is DeployEvent.

func (*Client) DeploymentsCreate

func (c *Client) DeploymentsCreate(ctx context.Context, app string, params *DeploymentsCreateParams) (*Deployment, error)

func (*Client) DomainSetCanonical

func (c *Client) DomainSetCanonical(ctx context.Context, app, id string) (Domain, error)

func (*Client) DomainSetCertificate

func (c *Client) DomainSetCertificate(ctx context.Context, app, id, tlsCert, tlsKey string) (Domain, error)

func (*Client) DomainUnsetCanonical

func (c *Client) DomainUnsetCanonical(ctx context.Context, app string) (Domain, error)

func (*Client) DomainUnsetCertificate

func (c *Client) DomainUnsetCertificate(ctx context.Context, app, id string) (Domain, error)

func (*Client) DomainsAdd

func (c *Client) DomainsAdd(ctx context.Context, app string, d Domain) (Domain, error)

func (*Client) DomainsList

func (c *Client) DomainsList(ctx context.Context, app string) ([]Domain, error)

func (*Client) DomainsRemove

func (c *Client) DomainsRemove(ctx context.Context, app, id string) error

func (*Client) DomainsShow

func (c *Client) DomainsShow(ctx context.Context, app, id string) (Domain, error)

func (*Client) EventCategoriesList

func (c *Client) EventCategoriesList(ctx context.Context) ([]EventCategory, error)

func (*Client) EventTypesList

func (c *Client) EventTypesList(ctx context.Context) ([]EventType, error)

func (*Client) EventsList

func (c *Client) EventsList(ctx context.Context, app string, opts PaginationOpts) (Events, PaginationMeta, error)

func (*Client) GetAccessToken

func (c *Client) GetAccessToken(ctx context.Context) (string, error)

func (*Client) InvoiceShow

func (c *Client) InvoiceShow(ctx context.Context, id string) (*Invoice, error)

func (*Client) InvoicesList

func (c *Client) InvoicesList(ctx context.Context, opts PaginationOpts) (Invoices, PaginationMeta, error)

func (*Client) KeysAdd

func (c *Client) KeysAdd(ctx context.Context, name string, content string) (*Key, error)

func (*Client) KeysDelete

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

func (*Client) KeysList

func (c *Client) KeysList(ctx context.Context) ([]Key, error)

func (*Client) ListRegionMigrations

func (c *Client) ListRegionMigrations(ctx context.Context, appID string) ([]RegionMigration, error)

func (*Client) LogDrainAdd

func (c *Client) LogDrainAdd(ctx context.Context, app string, params LogDrainAddParams) (*LogDrainRes, error)

func (*Client) LogDrainAddonAdd

func (c *Client) LogDrainAddonAdd(ctx context.Context, app string, addonID string, params LogDrainAddParams) (*LogDrainRes, error)

func (*Client) LogDrainAddonRemove

func (c *Client) LogDrainAddonRemove(ctx context.Context, app, addonID string, URL string) error

func (*Client) LogDrainRemove

func (c *Client) LogDrainRemove(ctx context.Context, app, URL string) error

func (*Client) LogDrainsAddonList

func (c *Client) LogDrainsAddonList(ctx context.Context, app string, addonID string) ([]LogDrain, error)

func (*Client) LogDrainsList

func (c *Client) LogDrainsList(ctx context.Context, app string) ([]LogDrain, error)

func (*Client) Logs

func (c *Client) Logs(ctx context.Context, logsURL string, n int, filter string) (*http.Response, error)

func (*Client) LogsArchives

func (c *Client) LogsArchives(ctx context.Context, app string, page int) (*LogsArchivesResponse, error)

func (*Client) LogsArchivesByCursor

func (c *Client) LogsArchivesByCursor(ctx context.Context, app string, cursor string) (*LogsArchivesResponse, error)

func (*Client) LogsURL

func (c *Client) LogsURL(ctx context.Context, app string) (*http.Response, error)

func (*Client) NotificationPlatformByName

func (c *Client) NotificationPlatformByName(ctx context.Context, name string) ([]*NotificationPlatform, error)

func (*Client) NotificationPlatformsList

func (c *Client) NotificationPlatformsList(ctx context.Context) ([]*NotificationPlatform, error)

func (*Client) NotifierByID

func (c *Client) NotifierByID(ctx context.Context, app, ID string) (*Notifier, error)

func (*Client) NotifierDestroy

func (c *Client) NotifierDestroy(ctx context.Context, app, ID string) error

func (*Client) NotifierProvision

func (c *Client) NotifierProvision(ctx context.Context, app string, params NotifierParams) (*Notifier, error)

func (*Client) NotifierUpdate

func (c *Client) NotifierUpdate(ctx context.Context, app, ID string, params NotifierParams) (*Notifier, error)

func (*Client) NotifiersList

func (c *Client) NotifiersList(ctx context.Context, app string) (Notifiers, error)

func (*Client) OperationsShow

func (c *Client) OperationsShow(ctx context.Context, app, opID string) (*Operation, error)

func (*Client) OperationsShowFromURL

func (c *Client) OperationsShowFromURL(ctx context.Context, url string) (*Operation, error)

func (*Client) RegionsList

func (c *Client) RegionsList(ctx context.Context) ([]Region, error)

func (*Client) Run

func (c *Client) Run(ctx context.Context, opts RunOpts) (*RunRes, error)

func (*Client) RunRegionMigrationStep

func (c *Client) RunRegionMigrationStep(ctx context.Context, appID, migrationID string, step RegionMigrationStep) error

func (*Client) SCMIntegrationsCreate

func (c *Client) SCMIntegrationsCreate(ctx context.Context, scmType SCMType, url string, accessToken string) (*SCMIntegration, error)

func (*Client) SCMIntegrationsDelete

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

func (*Client) SCMIntegrationsImportKeys

func (c *Client) SCMIntegrationsImportKeys(ctx context.Context, id string) ([]Key, error)

func (*Client) SCMIntegrationsList

func (c *Client) SCMIntegrationsList(ctx context.Context) ([]SCMIntegration, error)

func (*Client) SCMIntegrationsShow

func (c *Client) SCMIntegrationsShow(ctx context.Context, id string) (*SCMIntegration, error)

func (*Client) SCMRepoLinkCreate

func (c *Client) SCMRepoLinkCreate(ctx context.Context, app string, params SCMRepoLinkCreateParams) (*SCMRepoLink, error)

func (*Client) SCMRepoLinkDelete

func (c *Client) SCMRepoLinkDelete(ctx context.Context, app string) error

func (*Client) SCMRepoLinkDeployments

func (c *Client) SCMRepoLinkDeployments(ctx context.Context, app string) ([]*Deployment, error)
func (c *Client) SCMRepoLinkList(ctx context.Context, opts PaginationOpts) ([]*SCMRepoLink, PaginationMeta, error)

func (*Client) SCMRepoLinkManualDeploy

func (c *Client) SCMRepoLinkManualDeploy(ctx context.Context, app, branch string) (*Deployment, error)

func (*Client) SCMRepoLinkManualReviewApp

func (c *Client) SCMRepoLinkManualReviewApp(ctx context.Context, app, pullRequestID string) error

func (*Client) SCMRepoLinkPullRequest added in v6.6.0

func (c *Client) SCMRepoLinkPullRequest(ctx context.Context, app string, number int) (*RepoLinkPullRequest, error)

func (*Client) SCMRepoLinkReviewApps

func (c *Client) SCMRepoLinkReviewApps(ctx context.Context, app string) ([]*ReviewApp, error)

func (*Client) SCMRepoLinkShow

func (c *Client) SCMRepoLinkShow(ctx context.Context, app string) (*SCMRepoLink, error)

func (*Client) SCMRepoLinkUpdate

func (c *Client) SCMRepoLinkUpdate(ctx context.Context, app string, params SCMRepoLinkUpdateParams) (*SCMRepoLink, error)

func (*Client) ScalingoAPI

func (c *Client) ScalingoAPI() http.Client

func (*Client) Self

func (c *Client) Self(ctx context.Context) (*User, error)

func (*Client) ShowRegionMigration

func (c *Client) ShowRegionMigration(ctx context.Context, appID, migrationID string) (RegionMigration, error)

func (*Client) SignUp

func (c *Client) SignUp(ctx context.Context, email, password string) error

func (*Client) SourcesCreate

func (c *Client) SourcesCreate(ctx context.Context) (*Source, error)

func (*Client) StacksList

func (c *Client) StacksList(ctx context.Context) ([]Stack, error)

func (*Client) TokenCreate

func (c *Client) TokenCreate(ctx context.Context, params TokenCreateParams) (Token, error)

func (*Client) TokenCreateWithLogin

func (c *Client) TokenCreateWithLogin(ctx context.Context, params TokenCreateParams, login LoginParams) (Token, error)

func (*Client) TokenExchange

func (c *Client) TokenExchange(ctx context.Context, token string) (string, error)

func (*Client) TokenShow

func (c *Client) TokenShow(ctx context.Context, id int) (Token, error)

func (*Client) TokensList

func (c *Client) TokensList(ctx context.Context) (Tokens, error)

func (*Client) UpdateUser

func (c *Client) UpdateUser(ctx context.Context, params UpdateUserParams) (*User, error)

func (*Client) UserEventsList

func (c *Client) UserEventsList(ctx context.Context, opts PaginationOpts) (Events, PaginationMeta, error)

func (*Client) UserStopFreeTrial

func (c *Client) UserStopFreeTrial(ctx context.Context) error

func (*Client) VariableMultipleSet

func (c *Client) VariableMultipleSet(ctx context.Context, app string, variables Variables) (Variables, int, error)

func (*Client) VariableSet

func (c *Client) VariableSet(ctx context.Context, app string, name string, value string) (*Variable, int, error)

func (*Client) VariableUnset

func (c *Client) VariableUnset(ctx context.Context, app string, id string) error

func (*Client) VariablesList

func (c *Client) VariablesList(ctx context.Context, app string) (Variables, error)

func (*Client) VariablesListWithoutAlias

func (c *Client) VariablesListWithoutAlias(ctx context.Context, app string) (Variables, error)

type ClientConfig

type ClientConfig struct {
	Timeout                time.Duration
	TLSConfig              *tls.Config
	APIEndpoint            string
	APIPrefix              string
	AuthEndpoint           string
	AuthPrefix             string
	DatabaseAPIEndpoint    string
	DatabaseAPIPrefix      string
	APIToken               string
	Region                 string
	UserAgent              string
	DisableHTTPClientCache bool

	// StaticTokenGenerator is present for Scalingo internal use only
	StaticTokenGenerator *StaticTokenGenerator
}

type Collaborator

type Collaborator struct {
	ID       string             `json:"id"`
	AppID    string             `json:"app_id"`
	Username string             `json:"username"`
	Email    string             `json:"email"`
	Status   CollaboratorStatus `json:"status"`
	UserID   string             `json:"user_id"`
}

type CollaboratorRes

type CollaboratorRes struct {
	Collaborator Collaborator `json:"collaborator"`
}

type CollaboratorStatus

type CollaboratorStatus string
const (
	CollaboratorStatusPending  CollaboratorStatus = "pending"
	CollaboratorStatusAccepted CollaboratorStatus = "accepted"
	CollaboratorStatusDeleted  CollaboratorStatus = "user account deleted"
)

type CollaboratorsRes

type CollaboratorsRes struct {
	Collaborators []Collaborator `json:"collaborators"`
}

type CollaboratorsService

type CollaboratorsService interface {
	CollaboratorsList(ctx context.Context, app string) ([]Collaborator, error)
	CollaboratorAdd(ctx context.Context, app string, email string) (Collaborator, error)
	CollaboratorRemove(ctx context.Context, app string, id string) error
}

type Container

type Container struct {
	ID            string        `json:"id"`
	AppID         string        `json:"app_id"`
	CreatedAt     *time.Time    `json:"created_at"`
	DeletedAt     *time.Time    `json:"deleted_at"`
	Command       string        `json:"command"`
	Type          string        `json:"type"`
	TypeIndex     int           `json:"type_index"`
	Label         string        `json:"label"`
	State         string        `json:"state"`
	App           *App          `json:"app"`
	ContainerSize ContainerSize `json:"container_size"`
}

type ContainerSize

type ContainerSize struct {
	ID        string `json:"id"`
	SKU       string `json:"sku,omitempty"`
	Name      string `json:"name"`
	HumanName string `json:"human_name"`
	HumanCPU  string `json:"human_cpu"`
	Memory    int    `json:"memory"`
	PidsLimit int    `json:"pids_limit,omitempty"`

	HourlyPrice     int                          `json:"hourly_price"`
	ThirtydaysPrice int                          `json:"thirtydays_price"`
	Pricings        map[string]map[string]string `json:"pricings"`

	Swap    int `json:"swap"`
	Ordinal int `json:"ordinal"`
}

type ContainerSizesService

type ContainerSizesService interface {
	ContainerSizesList(ctx context.Context) ([]ContainerSize, error)
}

type ContainerStat

type ContainerStat struct {
	ID                 string `json:"id"`
	CPUUsage           int    `json:"cpu_usage"`
	MemoryUsage        int64  `json:"memory_usage"`
	SwapUsage          int64  `json:"swap_usage"`
	MemoryLimit        int64  `json:"memory_limit"`
	SwapLimit          int64  `json:"swap_limit"`
	HighestMemoryUsage int64  `json:"highest_memory_usage"`
	HighestSwapUsage   int64  `json:"highest_swap_usage"`
}

type ContainerType

type ContainerType struct {
	AppID   string `json:"app_id"`
	Name    string `json:"name"`
	Amount  int    `json:"amount"`
	Command string `json:"command"`
	Size    string `json:"size"`
}

type ContainersService

type ContainersService interface {
	ContainersStop(ctx context.Context, appName, containerID string) error
}

type CronTasks

type CronTasks struct {
	Jobs []Job `json:"jobs"`
}

type CronTasksService

type CronTasksService interface {
	CronTasksGet(ctx context.Context, app string) (CronTasks, error)
}

type DataAccessConsent

type DataAccessConsent struct {
	AppID           string     `json:"app_id"`
	UserID          string     `json:"user_id"`
	ContainersUntil *time.Time `json:"containers_until,omitempty"`
	DatabasesUntil  *time.Time `json:"databases_until,omitempty"`
}

type Database

type Database struct {
	ID                         string            `json:"id"`
	CreatedAt                  time.Time         `json:"created_at"`
	ResourceID                 string            `json:"resource_id"`
	AppName                    string            `json:"app_name"`
	EncryptionAtRest           bool              `json:"encryption_at_rest"`
	Features                   []DatabaseFeature `json:"features"`
	Plan                       string            `json:"plan"`
	Status                     DatabaseStatus    `json:"status"`
	TypeID                     string            `json:"type_id"`
	TypeName                   string            `json:"type_name"`
	VersionID                  string            `json:"version_id"`
	MongoReplSetName           string            `json:"mongo_repl_set_name"`
	Instances                  []Instance        `json:"instances"`
	NextVersionID              string            `json:"next_version_id"`
	ReadableVersion            string            `json:"readable_version"`
	Hostname                   string            `json:"hostname"`
	CurrentOperationID         string            `json:"current_operation_id"`
	Cluster                    bool              `json:"cluster"`
	PeriodicBackupsEnabled     bool              `json:"periodic_backups_enabled"`
	PeriodicBackupsScheduledAt []int             `json:"periodic_backups_scheduled_at"` // Hours of the day of the periodic backups (UTC)
	MaintenanceWindow          MaintenanceWindow `json:"maintenance_window"`
}

Database contains the metadata and configuration of a database deployment

type DatabaseCreateUserParam added in v6.7.4

type DatabaseCreateUserParam struct {
	DatabaseID           string `json:"database_id"`
	Name                 string `json:"name"`
	ReadOnly             bool   `json:"read_only"`
	Password             string `json:"password,omitempty"`
	PasswordConfirmation string `json:"password_confirmation,omitempty"`
}

type DatabaseDisableFeatureResponse

type DatabaseDisableFeatureResponse struct {
	Message string `json:"message"`
}

DatabaseDisableFeatureResponse is the response body of DatabaseDisableFeature

type DatabaseEnableFeatureParams

type DatabaseEnableFeatureParams struct {
	Feature DatabaseFeature `json:"feature"`
}

DatabaseEnableFeatureParams contains the feature which has to be enabled

type DatabaseEnableFeatureResponse

type DatabaseEnableFeatureResponse struct {
	Name    string                `json:"name"`
	Status  DatabaseFeatureStatus `json:"status"`
	Message string                `json:"message"`
}

DatabaseEnableFeatureResponse is the response structure from DatabaseEnableFeature

type DatabaseFeature

type DatabaseFeature struct {
	Name   string                `json:"name"`
	Status DatabaseFeatureStatus `json:"status"`
}

DatabaseFeature represents the state of application of a database feature

type DatabaseFeatureStatus

type DatabaseFeatureStatus string

DatabaseFeatureStatus is a type of string representing the advancement of the application of a database feature

const (
	// DatabaseFeatureStatusActivated is set when the feature has been enabled with success
	DatabaseFeatureStatusActivated DatabaseFeatureStatus = "ACTIVATED"
	// DatabaseFeatureStatusPending is set when the feature is being enabled
	DatabaseFeatureStatusPending DatabaseFeatureStatus = "PENDING"
	// DatabaseFeatureStatusFailed is set when the feature failed to get enabeld
	DatabaseFeatureStatusFailed DatabaseFeatureStatus = "FAILED"
)

type DatabaseRes

type DatabaseRes struct {
	Database Database `json:"database"`
}

DatabaseRes is the returned response from DatabaseShow

type DatabaseStatus

type DatabaseStatus string

DatabaseStatus is a string representing the status of a database deployment

const (
	// DatabaseStatusCreating is set when the database is being started before
	// it's operational
	DatabaseStatusCreating DatabaseStatus = "creating"
	// DatabaseStatusRunning is the standard status of a database when everything
	// is operational
	DatabaseStatusRunning DatabaseStatus = "running"
	// DatabaseStatusMigrating is set when a component of the database is being
	// migrated by Scalingo infrastructure
	DatabaseStatusMigrating DatabaseStatus = "migrating"
	// DatabaseStatusUpdating is set the plan of the database is being changed
	DatabaseStatusUpdating DatabaseStatus = "updating"
	// DatabaseStatusUpgrading is set when a database version upgrade is being
	// applied on the database
	DatabaseStatusUpgrading DatabaseStatus = "upgrading"
	// DatabaseStatusStopped is set when the database has been stopped (suspended
	// after free trial or when an account has been suspended)
	DatabaseStatusStopped DatabaseStatus = "stopped"
)

type DatabaseTypeVersion

type DatabaseTypeVersion struct {
	ID             string                      `json:"id"`
	DatabaseTypeID string                      `json:"database_type_id"`
	CreatedAt      time.Time                   `json:"created_at"`
	UpdatedAt      time.Time                   `json:"updated_at"`
	Features       []string                    `json:"features"`
	NextUpgrade    *DatabaseTypeVersion        `json:"next_upgrade"`
	AllowedPlugins []DatabaseTypeVersionPlugin `json:"allowed_plugins"`
	Major          int                         `json:"major"`
	Minor          int                         `json:"minor"`
	Patch          int                         `json:"patch"`
	Build          int                         `json:"build"`
}

func (DatabaseTypeVersion) String

func (v DatabaseTypeVersion) String() string

type DatabaseTypeVersionPlugin

type DatabaseTypeVersionPlugin struct {
	ID          string `json:"id"`
	FeatureName string `json:"feature_name"`
	InstallName string `json:"install_name"`
	DisplayName string `json:"display_name"`
	Description string `json:"description"`
}

type DatabaseTypeVersionShowResponse

type DatabaseTypeVersionShowResponse struct {
	DatabaseTypeVersion DatabaseTypeVersion `json:"database_type_version"`
}

type DatabaseUpdatePeriodicBackupsConfigParams

type DatabaseUpdatePeriodicBackupsConfigParams struct {
	ScheduledAt *int  `json:"periodic_backups_scheduled_at,omitempty"`
	Enabled     *bool `json:"periodic_backups_enabled,omitempty"`
}

DatabaseUpdatePeriodicBackupsConfigParams contains the parameters which can be tweaked to update how periodic backups are triggered.

type DatabaseUpdateUserParam added in v6.7.7

type DatabaseUpdateUserParam struct {
	DatabaseID           string `json:"database_id"`
	Password             string `json:"password,omitempty"`
	PasswordConfirmation string `json:"password_confirmation,omitempty"`
}

type DatabaseUser added in v6.7.4

type DatabaseUser struct {
	Name           string          `json:"name"`
	ReadOnly       bool            `json:"read_only"`
	Protected      bool            `json:"protected"`
	Password       string          `json:"password,omitempty"`
	DbmsAttributes *DbmsAttributes `json:"dbms_attributes,omitempty"`
}

type DatabaseUserResponse added in v6.7.4

type DatabaseUserResponse struct {
	DatabaseUser DatabaseUser `json:"database_user"`
}

DatabaseUserResponse is the response body of database create user

type DatabaseUsersResponse added in v6.7.4

type DatabaseUsersResponse struct {
	DatabaseUsers []DatabaseUser `json:"database-users"`
}

DatabaseUsersResponse is the response body of database list users

type DatabasesService

type DatabasesService interface {
	DatabaseShow(ctx context.Context, app, addonID string) (Database, error)
	DatabaseEnableFeature(ctx context.Context, app, addonID, feature string) (DatabaseEnableFeatureResponse, error)
	DatabaseDisableFeature(ctx context.Context, app, addonID, feature string) (DatabaseDisableFeatureResponse, error)
	DatabaseUpdatePeriodicBackupsConfig(ctx context.Context, app, addonID string, params DatabaseUpdatePeriodicBackupsConfigParams) (Database, error)
	DatabaseUpdateMaintenanceWindow(ctx context.Context, app, addonID string, params MaintenanceWindowParams) (Database, error)
	DatabaseListMaintenance(ctx context.Context, app, addonID string, opts PaginationOpts) ([]*Maintenance, PaginationMeta, error)
	DatabaseShowMaintenance(ctx context.Context, app, addonID, maintenanceID string) (Maintenance, error)
}

DatabasesService is the interface gathering all the methods related to database addon configuration updates

type DbmsAttributes added in v6.7.4

type DbmsAttributes struct {
	PasswordEncryption string `json:"password_encryption"`
}

type Deployment

type Deployment struct {
	ID             string           `json:"id"`
	AppID          string           `json:"app_id"`
	CreatedAt      *time.Time       `json:"created_at"`
	Status         DeploymentStatus `json:"status"`
	GitRef         string           `json:"git_ref"`
	Image          string           `json:"image"`
	Registry       string           `json:"registry"`
	Duration       int              `json:"duration"`
	PostdeployHook string           `json:"postdeploy_hook"`
	ImageSize      uint64           `json:"image_size"`
	StackBaseImage string           `json:"stack_base_image"`
	User           *User            `json:"pusher"`
	Links          *DeploymentLinks `json:"links"`
}

func (*Deployment) HasFailed

func (d *Deployment) HasFailed() bool

func (*Deployment) IsFinished

func (d *Deployment) IsFinished() bool

type DeploymentEvent

type DeploymentEvent struct {
	// ID of the deployment which this event belongs to
	ID   string              `json:"id"`
	Type DeploymentEventType `json:"type"`
	Data json.RawMessage     `json:"data"`
}

DeploymentEvent represents a deployment stream event sent on the websocket.

type DeploymentEventDataLog

type DeploymentEventDataLog struct {
	Content string `json:"content"`
}

DeploymentEventDataLog is the data type present in the DeploymentEvent.Data field if the DeploymentEvent.Type is DeploymentEventDataLog

type DeploymentEventDataStatus

type DeploymentEventDataStatus struct {
	Status DeploymentStatus `json:"status"`
}

DeploymentEventDataStatus is the data type present in the DeploymentEvent.Data field if the DeploymentEvent.Type is DeploymentEventDataStatus

type DeploymentEventType

type DeploymentEventType string

DeploymentEventType holds all different deployment stream types of event.

const (
	DeploymentEventTypePing   DeploymentEventType = "ping"
	DeploymentEventTypeNew    DeploymentEventType = "new"
	DeploymentEventTypeLog    DeploymentEventType = "log"
	DeploymentEventTypeStatus DeploymentEventType = "status"
)
type DeploymentLinks struct {
	Output string `json:"output"`
}

type DeploymentList

type DeploymentList struct {
	Deployments []*Deployment `json:"deployments"`
	Meta        struct {
		PaginationMeta PaginationMeta `json:"pagination"`
	}
}

type DeploymentStatus

type DeploymentStatus string
const (
	StatusSuccess      DeploymentStatus = "success"
	StatusQueued       DeploymentStatus = "queued"
	StatusBuilding     DeploymentStatus = "building"
	StatusStarting     DeploymentStatus = "starting"
	StatusPushing      DeploymentStatus = "pushing"
	StatusAborted      DeploymentStatus = "aborted"
	StatusBuildError   DeploymentStatus = "build-error"
	StatusCrashedError DeploymentStatus = "crashed-error"
	StatusTimeoutError DeploymentStatus = "timeout-error"
	StatusHookError    DeploymentStatus = "hook-error"
)

type DeploymentsCreateParams

type DeploymentsCreateParams struct {
	GitRef    *string `json:"git_ref"`
	SourceURL string  `json:"source_url"`
}

type DeploymentsCreateRes

type DeploymentsCreateRes struct {
	Deployment *Deployment `json:"deployment"`
}

type DeploymentsService

type DeploymentsService interface {
	DeploymentList(ctx context.Context, app string) ([]*Deployment, error)
	DeploymentListWithPagination(ctx context.Context, app string, opts PaginationOpts) ([]*Deployment, PaginationMeta, error)
	Deployment(ctx context.Context, app string, deploy string) (*Deployment, error)
	DeploymentLogs(ctx context.Context, deployURL string) (*http.Response, error)
	DeploymentStream(ctx context.Context, deployURL string) (*websocket.Conn, error)
	DeploymentsCreate(ctx context.Context, app string, params *DeploymentsCreateParams) (*Deployment, error)
}

type DeprecationDate

type DeprecationDate struct {
	time.Time
}

func (*DeprecationDate) UnmarshalJSON

func (deprecationDate *DeprecationDate) UnmarshalJSON(b []byte) error

The regional API returns a date formatted as "2006-01-02" Go standard library does not unmarshal that format

type DetailedEvent

type DetailedEvent interface {
	fmt.Stringer
	GetEvent() *Event
	PrintableType() string
	When() string
	Who() string
	TypeDataPtr() interface{}
}

type DetailedNotifier

type DetailedNotifier interface {
	GetNotifier() *Notifier
	GetID() string
	GetName() string
	GetType() NotifierType
	GetSendAllEvents() bool
	GetSendAllAlerts() bool
	GetSelectedEventIDs() []string
	IsActive() bool
	When() string
	TypeDataPtr() interface{}
	TypeDataMap() map[string]interface{}
}

func NewDetailedNotifier

func NewDetailedNotifier(notifierType string, params NotifierParams) DetailedNotifier

type Domain

type Domain struct {
	ID                string             `json:"id"`
	AppID             string             `json:"app_id"`
	Name              string             `json:"name"`
	TLSCert           string             `json:"tlscert,omitempty"`
	TLSKey            string             `json:"tlskey,omitempty"`
	SSL               bool               `json:"ssl"`
	Validity          time.Time          `json:"validity"`
	Canonical         bool               `json:"canonical"`
	LetsEncrypt       bool               `json:"letsencrypt"`
	LetsEncryptStatus LetsEncryptStatus  `json:"letsencrypt_status"`
	SslStatus         SslStatus          `json:"ssl_status"`
	AcmeDNSFqdn       string             `json:"acme_dns_fqdn"`
	AcmeDNSValue      string             `json:"acme_dns_value"`
	AcmeDNSError      ACMEErrorVariables `json:"acme_dns_error"`
}

type DomainRes

type DomainRes struct {
	Domain Domain `json:"domain"`
}

type DomainsRes

type DomainsRes struct {
	Domains []Domain `json:"domains"`
}

type DomainsService

type DomainsService interface {
	DomainsList(ctx context.Context, app string) ([]Domain, error)
	DomainsAdd(ctx context.Context, app string, d Domain) (Domain, error)
	DomainsRemove(ctx context.Context, app string, id string) error
	DomainSetCanonical(ctx context.Context, app, id string) (Domain, error)
	DomainUnsetCanonical(ctx context.Context, app string) (Domain, error)
	DomainSetCertificate(ctx context.Context, app, id, tlsCert, tlsKey string) (Domain, error)
	DomainUnsetCertificate(ctx context.Context, app, id string) (Domain, error)
}

type DownloadURLRes

type DownloadURLRes struct {
	DownloadURL string `json:"download_url"`
}

type Event

type Event struct {
	ID          string                 `json:"id"`
	AppID       string                 `json:"app_id"`
	CreatedAt   time.Time              `json:"created_at"`
	User        EventUser              `json:"user"`
	Type        EventTypeName          `json:"type"`
	AppName     string                 `json:"app_name"`
	RawTypeData json.RawMessage        `json:"type_data"`
	TypeData    map[string]interface{} `json:"-"`
}

func (*Event) GetEvent

func (ev *Event) GetEvent() *Event

func (*Event) PrintableType

func (ev *Event) PrintableType() string

func (*Event) Specialize

func (pev *Event) Specialize() DetailedEvent

func (*Event) String

func (ev *Event) String() string

func (*Event) TypeDataPtr

func (ev *Event) TypeDataPtr() interface{}

func (*Event) When

func (ev *Event) When() string

func (*Event) Who

func (ev *Event) Who() string

type EventAcceptCollaboratorType

type EventAcceptCollaboratorType struct {
	Event
	TypeData EventAcceptCollaboratorTypeData `json:"type_data"`
}

func (*EventAcceptCollaboratorType) String

func (ev *EventAcceptCollaboratorType) String() string

func (*EventAcceptCollaboratorType) TypeDataPtr

func (e *EventAcceptCollaboratorType) TypeDataPtr() interface{}

type EventAcceptCollaboratorTypeData

type EventAcceptCollaboratorTypeData struct {
	Collaborator EventCollaborator `json:"collaborator"`
}

Inviter is filled there

type EventAddCreditType

type EventAddCreditType struct {
	Event
	TypeData EventAddCreditTypeData `json:"type_data"`
}

func (*EventAddCreditType) String

func (ev *EventAddCreditType) String() string

func (*EventAddCreditType) TypeDataPtr

func (e *EventAddCreditType) TypeDataPtr() interface{}

type EventAddCreditTypeData

type EventAddCreditTypeData struct {
	PaymentMethod string  `json:"payment_method"`
	Amount        float64 `json:"amount"`
}

type EventAddPaymentMethodType

type EventAddPaymentMethodType struct {
	Event
	TypeData EventAddPaymentMethodTypeData `json:"type_data"`
}

func (*EventAddPaymentMethodType) String

func (ev *EventAddPaymentMethodType) String() string

func (*EventAddPaymentMethodType) TypeDataPtr

func (e *EventAddPaymentMethodType) TypeDataPtr() interface{}

type EventAddPaymentMethodTypeData

type EventAddPaymentMethodTypeData struct {
	billing.Profile
}

type EventAddVoucherType

type EventAddVoucherType struct {
	Event
	TypeData EventAddVoucherTypeData `json:"type_data"`
}

func (*EventAddVoucherType) String

func (ev *EventAddVoucherType) String() string

func (*EventAddVoucherType) TypeDataPtr

func (e *EventAddVoucherType) TypeDataPtr() interface{}

type EventAddVoucherTypeData

type EventAddVoucherTypeData struct {
	Code string `json:"code"`
}

type EventAddon

type EventAddon struct {
	AddonProviderName string `json:"addon_provider_name"`
	PlanName          string `json:"plan_name"`
	ResourceID        string `json:"resource_id"`
}

type EventAddonUpdatedType

type EventAddonUpdatedType struct {
	Event
	TypeData EventAddonUpdatedTypeData `json:"type_data"`
}

func (*EventAddonUpdatedType) String

func (ev *EventAddonUpdatedType) String() string

func (*EventAddonUpdatedType) TypeDataPtr

func (e *EventAddonUpdatedType) TypeDataPtr() interface{}

type EventAddonUpdatedTypeData

type EventAddonUpdatedTypeData struct {
	AddonID           string `json:"addon_id"`
	AddonPlanName     string `json:"addon_plan_name"`
	AddonResourceID   string `json:"addon_resource_id"`
	AddonProviderID   string `json:"addon_provider_id"`
	AddonProviderName string `json:"addon_provider_name"`

	// Status has only two items when is updated, the old value and the new value, in this order
	Status []AddonStatus `json:"status"`
	// AttributesChanged contain names of changed attributes
	AttributesChanged []string `json:"attributes_changed"`
}

type EventAlertType

type EventAlertType struct {
	Event
	TypeData EventAlertTypeData `json:"type_data"`
}

func (*EventAlertType) String

func (ev *EventAlertType) String() string

func (*EventAlertType) TypeDataPtr

func (e *EventAlertType) TypeDataPtr() interface{}

type EventAlertTypeData

type EventAlertTypeData struct {
	SenderName    string  `json:"sender_name"`
	Metric        string  `json:"metric"`
	Limit         float64 `json:"limit"`
	LimitText     string  `json:"limit_text"`
	Value         float64 `json:"value"`
	ValueText     string  `json:"value_text"`
	Activated     bool    `json:"activated"`
	SendWhenBelow bool    `json:"send_when_below"`
	RawLimit      float64 `json:"raw_limit"`
	RawValue      float64 `json:"raw_value"`
}

type EventAuthorizeGithubType

type EventAuthorizeGithubType struct {
	Event
	TypeData EventAuthorizeGithubTypeData `json:"type_data"`
}

func (*EventAuthorizeGithubType) String

func (ev *EventAuthorizeGithubType) String() string

func (*EventAuthorizeGithubType) TypeDataPtr

func (e *EventAuthorizeGithubType) TypeDataPtr() interface{}

type EventAuthorizeGithubTypeData

type EventAuthorizeGithubTypeData struct {
	GithubUser struct {
		Login     string `json:"login"`
		AvatarURL string `json:"avatar_url"`
	} `json:"github_user"`
}

type EventCategory

type EventCategory struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Position int    `json:"position"`
}

type EventCollaborator

type EventCollaborator struct {
	EventUser
	Inviter EventUser `json:"inviter"`
}

type EventCompleteDatabaseMaintenanceType added in v6.7.3

type EventCompleteDatabaseMaintenanceType struct {
	Event
	TypeData EventCompleteDatabaseMaintenanceTypeData `json:"type_data"`
}

func (*EventCompleteDatabaseMaintenanceType) String added in v6.7.3

func (*EventCompleteDatabaseMaintenanceType) TypeDataPtr added in v6.7.3

func (e *EventCompleteDatabaseMaintenanceType) TypeDataPtr() interface{}

func (*EventCompleteDatabaseMaintenanceType) Who added in v6.7.3

type EventCompleteDatabaseMaintenanceTypeData added in v6.7.3

type EventCompleteDatabaseMaintenanceTypeData struct {
	AddonName                string    `json:"addon_name"`
	MaintenanceID            string    `json:"maintenance_id"`
	MaintenanceWindowInHours int       `json:"maintenance_window_in_hours"`
	MaintenanceType          string    `json:"maintenance_type"`
	NextMaintenanceWindow    time.Time `json:"next_maintenance_window"`
}

Database maintenance completed

type EventCrashType

type EventCrashType struct {
	Event
	TypeData EventCrashTypeData `json:"type_data"`
}

func (*EventCrashType) String

func (ev *EventCrashType) String() string

func (*EventCrashType) TypeDataPtr

func (e *EventCrashType) TypeDataPtr() interface{}

type EventCrashTypeData

type EventCrashTypeData struct {
	ContainerType string `json:"container_type"`
	CrashLogs     string `json:"crash_logs"`
	LogsURL       string `json:"logs_url"`
}

type EventCreateDataAccessConsentType

type EventCreateDataAccessConsentType struct {
	Event
	TypeData EventCreateDataAccessConsentTypeData `json:"type_data"`
}

func (*EventCreateDataAccessConsentType) String

func (*EventCreateDataAccessConsentType) TypeDataPtr

func (e *EventCreateDataAccessConsentType) TypeDataPtr() interface{}

type EventCreateDataAccessConsentTypeData

type EventCreateDataAccessConsentTypeData struct {
	EndAt      time.Time `json:"end_at"`
	Databases  bool      `json:"databases"`
	Containers bool      `json:"containers"`
}

Create data_access_consent

type EventCreateReviewAppType added in v6.7.0

type EventCreateReviewAppType struct {
	Event
	TypeData EventCreateReviewAppTypeData `json:"type_data"`
}

func (*EventCreateReviewAppType) String added in v6.7.0

func (ev *EventCreateReviewAppType) String() string

func (*EventCreateReviewAppType) TypeDataPtr added in v6.7.0

func (e *EventCreateReviewAppType) TypeDataPtr() interface{}

type EventCreateReviewAppTypeData added in v6.7.0

type EventCreateReviewAppTypeData struct {
	AppID                    string `json:"app_id"`
	ReviewAppName            string `json:"review_app_name"`
	ReviewAppURL             string `json:"review_app_url"`
	SourceRepoName           string `json:"source_repo_name"`
	SourceRepoURL            string `json:"source_repo_url"`
	PullRequestName          string `json:"pr_name"`
	PullRequestNumber        int    `json:"pr_number"`
	PullRequestURL           string `json:"pr_url"`
	PullRequestComesFromFork bool   `json:"pr_comes_from_a_fork"`
}

type EventDatabaseAddFeatureType

type EventDatabaseAddFeatureType struct {
	Event
	TypeData EventDatabaseAddFeatureTypeData `json:"type_data"`
}

func (*EventDatabaseAddFeatureType) String

func (ev *EventDatabaseAddFeatureType) String() string

func (*EventDatabaseAddFeatureType) TypeDataPtr

func (e *EventDatabaseAddFeatureType) TypeDataPtr() interface{}

type EventDatabaseAddFeatureTypeData

type EventDatabaseAddFeatureTypeData struct {
	Feature           string `json:"feature"`
	AddonProviderID   string `json:"addon_provider_id"`
	AddonProviderName string `json:"addon_provider_name"`
	AddonUUID         string `json:"addon_uuid"`
	EventSecurityTypeData
}

type EventDatabaseRemoveFeatureType

type EventDatabaseRemoveFeatureType struct {
	Event
	TypeData EventDatabaseRemoveFeatureTypeData `json:"type_data"`
}

func (*EventDatabaseRemoveFeatureType) String

func (*EventDatabaseRemoveFeatureType) TypeDataPtr

func (e *EventDatabaseRemoveFeatureType) TypeDataPtr() interface{}

type EventDatabaseRemoveFeatureTypeData

type EventDatabaseRemoveFeatureTypeData struct {
	Feature           string `json:"feature"`
	AddonProviderID   string `json:"addon_provider_id"`
	AddonProviderName string `json:"addon_provider_name"`
	AddonUUID         string `json:"addon_uuid"`
	EventSecurityTypeData
}

type EventDeleteAddonLogDrainType

type EventDeleteAddonLogDrainType struct {
	Event
	TypeData EventDeleteAddonLogDrainTypeData `json:"type_data"`
}

func (*EventDeleteAddonLogDrainType) String

func (ev *EventDeleteAddonLogDrainType) String() string

func (*EventDeleteAddonLogDrainType) TypeDataPtr

func (e *EventDeleteAddonLogDrainType) TypeDataPtr() interface{}

type EventDeleteAddonLogDrainTypeData

type EventDeleteAddonLogDrainTypeData struct {
	URL       string `json:"url"`
	AddonUUID string `json:"addon_uuid"`
	AddonName string `json:"addon_name"`
}

Delete addon log drain

type EventDeleteAddonType

type EventDeleteAddonType struct {
	Event
	TypeData EventDeleteAddonTypeData `json:"type_data"`
}

func (*EventDeleteAddonType) String

func (ev *EventDeleteAddonType) String() string

func (*EventDeleteAddonType) TypeDataPtr

func (e *EventDeleteAddonType) TypeDataPtr() interface{}

type EventDeleteAddonTypeData

type EventDeleteAddonTypeData struct {
	EventAddon
}

type EventDeleteAlertType

type EventDeleteAlertType struct {
	Event
	TypeData EventDeleteAlertTypeData `json:"type_data"`
}

func (*EventDeleteAlertType) String

func (ev *EventDeleteAlertType) String() string

func (*EventDeleteAlertType) TypeDataPtr

func (e *EventDeleteAlertType) TypeDataPtr() interface{}

type EventDeleteAlertTypeData

type EventDeleteAlertTypeData struct {
	ContainerType string `json:"container_type"`
	Metric        string `json:"metric"`
}

type EventDeleteAppType

type EventDeleteAppType struct {
	Event
}

func (*EventDeleteAppType) String

func (ev *EventDeleteAppType) String() string

func (*EventDeleteAppType) TypeDataPtr

func (e *EventDeleteAppType) TypeDataPtr() interface{}

type EventDeleteAutoscalerType

type EventDeleteAutoscalerType struct {
	Event
	TypeData EventDeleteAutoscalerTypeData `json:"type_data"`
}

func (*EventDeleteAutoscalerType) String

func (ev *EventDeleteAutoscalerType) String() string

func (*EventDeleteAutoscalerType) TypeDataPtr

func (e *EventDeleteAutoscalerType) TypeDataPtr() interface{}

type EventDeleteAutoscalerTypeData

type EventDeleteAutoscalerTypeData struct {
	ContainerType string `json:"container_type"`
	Metric        string `json:"metric"`
}

type EventDeleteCollaboratorType

type EventDeleteCollaboratorType struct {
	Event
	TypeData EventDeleteCollaboratorTypeData `json:"type_data"`
}

func (*EventDeleteCollaboratorType) String

func (ev *EventDeleteCollaboratorType) String() string

func (*EventDeleteCollaboratorType) TypeDataPtr

func (e *EventDeleteCollaboratorType) TypeDataPtr() interface{}

type EventDeleteCollaboratorTypeData

type EventDeleteCollaboratorTypeData struct {
	Collaborator EventCollaborator `json:"collaborator"`
}

type EventDeleteDomainType

type EventDeleteDomainType struct {
	Event
	TypeData EventDeleteDomainTypeData `json:"type_data"`
}

func (*EventDeleteDomainType) String

func (ev *EventDeleteDomainType) String() string

func (*EventDeleteDomainType) TypeDataPtr

func (e *EventDeleteDomainType) TypeDataPtr() interface{}

type EventDeleteDomainTypeData

type EventDeleteDomainTypeData struct {
	Hostname string `json:"hostname"`
}

type EventDeleteIntegrationType

type EventDeleteIntegrationType struct {
	Event
	TypeData EventDeleteIntegrationTypeData `json:"type_data"`
}

func (*EventDeleteIntegrationType) String

func (ev *EventDeleteIntegrationType) String() string

func (*EventDeleteIntegrationType) TypeDataPtr

func (e *EventDeleteIntegrationType) TypeDataPtr() interface{}

type EventDeleteIntegrationTypeData

type EventDeleteIntegrationTypeData struct {
	IntegrationID   string  `json:"integration_id"`
	IntegrationType SCMType `json:"integration_type"`
	Data            struct {
		Login     string `json:"login"`
		AvatarURL string `json:"avatar_url"`
		URL       string `json:"url"`
	} `json:"data"`
}

type EventDeleteKeyType

type EventDeleteKeyType struct {
	Event
	TypeData EventDeleteKeyTypeData `json:"type_data"`
}

func (*EventDeleteKeyType) String

func (ev *EventDeleteKeyType) String() string

func (*EventDeleteKeyType) TypeDataPtr

func (e *EventDeleteKeyType) TypeDataPtr() interface{}

type EventDeleteKeyTypeData

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

type EventDeleteLogDrainType

type EventDeleteLogDrainType struct {
	Event
	TypeData EventDeleteLogDrainTypeData `json:"type_data"`
}

func (*EventDeleteLogDrainType) String

func (ev *EventDeleteLogDrainType) String() string

func (*EventDeleteLogDrainType) TypeDataPtr

func (e *EventDeleteLogDrainType) TypeDataPtr() interface{}

type EventDeleteLogDrainTypeData

type EventDeleteLogDrainTypeData struct {
	URL string `json:"url"`
}

Delete log drain

type EventDeleteNotifierType

type EventDeleteNotifierType struct {
	Event
	TypeData EventDeleteNotifierTypeData `json:"type_data"`
}

func (*EventDeleteNotifierType) String

func (ev *EventDeleteNotifierType) String() string

func (*EventDeleteNotifierType) TypeDataPtr

func (e *EventDeleteNotifierType) TypeDataPtr() interface{}

type EventDeleteNotifierTypeData

type EventDeleteNotifierTypeData struct {
	NotifierName     string                 `json:"notifier_name"`
	Active           bool                   `json:"active"`
	SendAllEvents    bool                   `json:"send_all_events"`
	SelectedEvents   []string               `json:"selected_events"`
	NotifierType     string                 `json:"notifier_type"`
	NotifierTypeData map[string]interface{} `json:"notifier_type_data"`
	PlatformName     string                 `json:"platform_name"`
}

Delete notifier

type EventDeleteTokenType

type EventDeleteTokenType struct {
	Event
	TypeData EventDeleteTokenTypeData `json:"type_data"`
}

func (*EventDeleteTokenType) String

func (ev *EventDeleteTokenType) String() string

func (*EventDeleteTokenType) TypeDataPtr

func (e *EventDeleteTokenType) TypeDataPtr() interface{}

type EventDeleteTokenTypeData

type EventDeleteTokenTypeData struct {
	TokenName string `json:"token_name"`
	TokenID   string `json:"token_id"`
}

type EventDeleteVariableType

type EventDeleteVariableType struct {
	Event
	TypeData EventDeleteVariableTypeData `json:"type_data"`
}

func (*EventDeleteVariableType) String

func (ev *EventDeleteVariableType) String() string

func (*EventDeleteVariableType) TypeDataPtr

func (e *EventDeleteVariableType) TypeDataPtr() interface{}

type EventDeleteVariableTypeData

type EventDeleteVariableTypeData struct {
	EventVariable
}

type EventDeploymentType

type EventDeploymentType struct {
	Event
	TypeData EventDeploymentTypeData `json:"type_data"`
}

func (*EventDeploymentType) String

func (ev *EventDeploymentType) String() string

func (*EventDeploymentType) TypeDataPtr

func (e *EventDeploymentType) TypeDataPtr() interface{}

type EventDeploymentTypeData

type EventDeploymentTypeData struct {
	DeploymentID   string `json:"deployment_id"`
	Pusher         string `json:"pusher"`
	GitRef         string `json:"git_ref"`
	Status         string `json:"status"`
	Duration       int    `json:"duration"`
	DeploymentUUID string `json:"deployment_uuid"`
}

type EventDestroyReviewAppType added in v6.7.0

type EventDestroyReviewAppType struct {
	Event
	TypeData EventCreateReviewAppTypeData `json:"type_data"`
}

func (*EventDestroyReviewAppType) String added in v6.7.0

func (ev *EventDestroyReviewAppType) String() string

func (*EventDestroyReviewAppType) TypeDataPtr added in v6.7.0

func (e *EventDestroyReviewAppType) TypeDataPtr() interface{}

type EventDestroyReviewAppTypeData added in v6.7.0

type EventDestroyReviewAppTypeData struct {
	AppID                    string `json:"app_id"`
	ReviewAppName            string `json:"review_app_name"`
	SourceRepoName           string `json:"source_repo_name"`
	SourceRepoURL            string `json:"source_repo_url"`
	PullRequestName          string `json:"pr_name"`
	PullRequestNumber        int    `json:"pr_number"`
	PullRequestURL           string `json:"pr_url"`
	PullRequestComesFromFork bool   `json:"pr_comes_from_a_fork"`
}

type EventEditAppType

type EventEditAppType struct {
	Event
	TypeData EventEditAppTypeData `json:"type_data"`
}

func (*EventEditAppType) String

func (ev *EventEditAppType) String() string

func (*EventEditAppType) TypeDataPtr

func (e *EventEditAppType) TypeDataPtr() interface{}

type EventEditAppTypeData

type EventEditAppTypeData struct {
	ForceHTTPS *bool `json:"force_https"`
}

type EventEditAutoscalerType

type EventEditAutoscalerType struct {
	Event
	TypeData EventEditAutoscalerTypeData `json:"type_data"`
}

func (*EventEditAutoscalerType) String

func (ev *EventEditAutoscalerType) String() string

func (*EventEditAutoscalerType) TypeDataPtr

func (e *EventEditAutoscalerType) TypeDataPtr() interface{}

type EventEditAutoscalerTypeData

type EventEditAutoscalerTypeData struct {
	ContainerType string  `json:"container_type"`
	MinContainers int     `json:"min_containers,string"`
	MaxContainers int     `json:"max_containers,string"`
	Metric        string  `json:"metric"`
	Target        float64 `json:"target"`
	TargetText    string  `json:"target_text"`
}

type EventEditDomainType

type EventEditDomainType struct {
	Event
	TypeData EventEditDomainTypeData `json:"type_data"`
}

func (*EventEditDomainType) String

func (ev *EventEditDomainType) String() string

func (*EventEditDomainType) TypeDataPtr

func (e *EventEditDomainType) TypeDataPtr() interface{}

type EventEditDomainTypeData

type EventEditDomainTypeData struct {
	Hostname string `json:"hostname"`
	SSL      bool   `json:"ssl"`
	OldSSL   bool   `json:"old_ssl"`
}

type EventEditHDSContactType

type EventEditHDSContactType struct {
	Event
	TypeData EventEditHDSContactTypeData `json:"type_data"`
}

func (*EventEditHDSContactType) String

func (ev *EventEditHDSContactType) String() string

func (*EventEditHDSContactType) TypeDataPtr

func (e *EventEditHDSContactType) TypeDataPtr() interface{}

type EventEditHDSContactTypeData

type EventEditHDSContactTypeData struct {
	Name           string `json:"name"`
	Email          string `json:"email"`
	PhoneNumber    string `json:"phone_number"`
	Company        string `json:"company"`
	AddressLine1   string `json:"address_line1"`
	AddressLine2   string `json:"address_line2"`
	AddressCity    string `json:"address_city"`
	AddressZip     string `json:"address_zip"`
	AddressCountry string `json:"address_country"`
	Notes          string `json:"notes"`
}

Edit hds_contact

type EventEditKeyType

type EventEditKeyType struct {
	Event
	TypeData EventEditKeyTypeData `json:"type_data"`
}

func (*EventEditKeyType) String

func (ev *EventEditKeyType) String() string

func (*EventEditKeyType) TypeDataPtr

func (e *EventEditKeyType) TypeDataPtr() interface{}

type EventEditKeyTypeData

type EventEditKeyTypeData struct {
	Name        string `json:"name"`
	Fingerprint string `json:"fingerprint"`
}

type EventEditNotifierType

type EventEditNotifierType struct {
	Event
	TypeData EventEditNotifierTypeData `json:"type_data"`
}

func (*EventEditNotifierType) String

func (ev *EventEditNotifierType) String() string

func (*EventEditNotifierType) TypeDataPtr

func (e *EventEditNotifierType) TypeDataPtr() interface{}

type EventEditNotifierTypeData

type EventEditNotifierTypeData struct {
	NotifierName     string                 `json:"notifier_name"`
	Active           bool                   `json:"active"`
	SendAllEvents    bool                   `json:"send_all_events"`
	SelectedEvents   []string               `json:"selected_events"`
	NotifierType     string                 `json:"notifier_type"`
	NotifierTypeData map[string]interface{} `json:"notifier_type_data"`
	PlatformName     string                 `json:"platform_name"`
}

Edit notifier

type EventEditVariableType

type EventEditVariableType struct {
	Event
	TypeData EventEditVariableTypeData `json:"type_data"`
}

func (*EventEditVariableType) String

func (ev *EventEditVariableType) String() string

func (*EventEditVariableType) TypeDataPtr

func (e *EventEditVariableType) TypeDataPtr() interface{}

func (*EventEditVariableType) Who

func (ev *EventEditVariableType) Who() string

type EventEditVariableTypeData

type EventEditVariableTypeData struct {
	EventVariable
	OldValue  string `json:"old_value"`
	AddonName string `json:"addon_name"`
}

type EventEditVariablesType

type EventEditVariablesType struct {
	Event
	TypeData EventEditVariablesTypeData `json:"type_data"`
}

func (*EventEditVariablesType) String

func (ev *EventEditVariablesType) String() string

func (*EventEditVariablesType) TypeDataPtr

func (e *EventEditVariablesType) TypeDataPtr() interface{}

type EventEditVariablesTypeData

type EventEditVariablesTypeData struct {
	NewVars     EventVariables `json:"new_vars"`
	UpdatedVars EventVariables `json:"updated_vars"`
	DeletedVars EventVariables `json:"deleted_vars"`
}

type EventLinkGithubType

type EventLinkGithubType struct {
	Event
	TypeData EventLinkGithubTypeData `json:"type_data"`
}

func (*EventLinkGithubType) String

func (ev *EventLinkGithubType) String() string

func (*EventLinkGithubType) TypeDataPtr

func (e *EventLinkGithubType) TypeDataPtr() interface{}

type EventLinkGithubTypeData

type EventLinkGithubTypeData struct {
	RepoName       string `json:"repo_name"`
	LinkerUsername string `json:"linker_username"`
	GithubSource   string `json:"github_source"`
}

type EventLinkSCMType

type EventLinkSCMType struct {
	Event
	TypeData EventLinkSCMTypeData `json:"type_data"`
}

func (*EventLinkSCMType) String

func (ev *EventLinkSCMType) String() string

func (*EventLinkSCMType) TypeDataPtr

func (e *EventLinkSCMType) TypeDataPtr() interface{}

type EventLinkSCMTypeData

type EventLinkSCMTypeData struct {
	RepoName                 string `json:"repo_name"`
	LinkerUsername           string `json:"linker_username"`
	Source                   string `json:"source"`
	Branch                   string `json:"branch"`
	AutoDeploy               bool   `json:"auto_deploy"`
	AutoDeployReviewApps     bool   `json:"auto_deploy_review_apps"`
	DeleteOnClose            bool   `json:"delete_on_close"`
	DeleteStale              bool   `json:"delete_stale"`
	HoursBeforeDeleteOnClose int    `json:"hours_before_delete_on_close"`
	HoursBeforeDeleteStale   int    `json:"hours_before_delete_stale"`
	CreationFromForksAllowed bool   `json:"creation_from_forks_allowed"`
}

type EventLoginFailureType

type EventLoginFailureType struct {
	Event
	TypeData EventLoginFailureTypeData `json:"type_data"`
}

func (*EventLoginFailureType) String

func (ev *EventLoginFailureType) String() string

func (*EventLoginFailureType) TypeDataPtr

func (e *EventLoginFailureType) TypeDataPtr() interface{}

type EventLoginFailureTypeData

type EventLoginFailureTypeData EventSecurityTypeData

type EventLoginLockType

type EventLoginLockType struct {
	Event
	TypeData EventLoginLockTypeData `json:"type_data"`
}

func (*EventLoginLockType) String

func (ev *EventLoginLockType) String() string

func (*EventLoginLockType) TypeDataPtr

func (e *EventLoginLockType) TypeDataPtr() interface{}

type EventLoginLockTypeData

type EventLoginLockTypeData EventSecurityTypeData

type EventLoginSuccessType

type EventLoginSuccessType struct {
	Event
	TypeData EventLoginSuccessTypeData `json:"type_data"`
}

func (*EventLoginSuccessType) String

func (ev *EventLoginSuccessType) String() string

func (*EventLoginSuccessType) TypeDataPtr

func (e *EventLoginSuccessType) TypeDataPtr() interface{}

type EventLoginSuccessTypeData

type EventLoginSuccessTypeData EventSecurityTypeData

type EventLoginUnlockSuccessType

type EventLoginUnlockSuccessType struct {
	Event
	TypeData EventLoginUnlockSuccessTypeData `json:"type_data"`
}

func (*EventLoginUnlockSuccessType) String

func (ev *EventLoginUnlockSuccessType) String() string

func (*EventLoginUnlockSuccessType) TypeDataPtr

func (e *EventLoginUnlockSuccessType) TypeDataPtr() interface{}

type EventLoginUnlockSuccessTypeData

type EventLoginUnlockSuccessTypeData EventSecurityTypeData

type EventNewAddonLogDrainType

type EventNewAddonLogDrainType struct {
	Event
	TypeData EventNewAddonLogDrainTypeData `json:"type_data"`
}

func (*EventNewAddonLogDrainType) String

func (ev *EventNewAddonLogDrainType) String() string

func (*EventNewAddonLogDrainType) TypeDataPtr

func (e *EventNewAddonLogDrainType) TypeDataPtr() interface{}

type EventNewAddonLogDrainTypeData

type EventNewAddonLogDrainTypeData struct {
	URL       string `json:"url"`
	AddonUUID string `json:"addon_uuid"`
	AddonName string `json:"addon_name"`
}

New addon log drain

type EventNewAddonType

type EventNewAddonType struct {
	Event
	TypeData EventNewAddonTypeData `json:"type_data"`
}

func (*EventNewAddonType) String

func (ev *EventNewAddonType) String() string

func (*EventNewAddonType) TypeDataPtr

func (e *EventNewAddonType) TypeDataPtr() interface{}

type EventNewAddonTypeData

type EventNewAddonTypeData struct {
	EventAddon
}

type EventNewAlertType

type EventNewAlertType struct {
	Event
	TypeData EventNewAlertTypeData `json:"type_data"`
}

func (*EventNewAlertType) String

func (ev *EventNewAlertType) String() string

func (*EventNewAlertType) TypeDataPtr

func (e *EventNewAlertType) TypeDataPtr() interface{}

type EventNewAlertTypeData

type EventNewAlertTypeData struct {
	ContainerType string  `json:"container_type"`
	Metric        string  `json:"metric"`
	Limit         float64 `json:"limit"`
	LimitText     string  `json:"limit_text"`
	SendWhenBelow bool    `json:"send_when_below"`
}

type EventNewAppType

type EventNewAppType struct {
	Event
	TypeData EventNewAppTypeData `json:"type_data"`
}

func (*EventNewAppType) String

func (ev *EventNewAppType) String() string

func (*EventNewAppType) TypeDataPtr

func (e *EventNewAppType) TypeDataPtr() interface{}

type EventNewAppTypeData

type EventNewAppTypeData struct {
	GitSource string `json:"git_source"`
}

type EventNewAutoscalerType

type EventNewAutoscalerType struct {
	Event
	TypeData EventNewAutoscalerTypeData `json:"type_data"`
}

func (*EventNewAutoscalerType) String

func (ev *EventNewAutoscalerType) String() string

func (*EventNewAutoscalerType) TypeDataPtr

func (e *EventNewAutoscalerType) TypeDataPtr() interface{}

type EventNewAutoscalerTypeData

type EventNewAutoscalerTypeData struct {
	ContainerType string  `json:"container_type"`
	MinContainers int     `json:"min_containers,string"`
	MaxContainers int     `json:"max_containers,string"`
	Metric        string  `json:"metric"`
	Target        float64 `json:"target"`
	TargetText    string  `json:"target_text"`
}

type EventNewCollaboratorType

type EventNewCollaboratorType struct {
	Event
	TypeData EventNewCollaboratorTypeData `json:"type_data"`
}

func (*EventNewCollaboratorType) String

func (ev *EventNewCollaboratorType) String() string

func (*EventNewCollaboratorType) TypeDataPtr

func (e *EventNewCollaboratorType) TypeDataPtr() interface{}

type EventNewCollaboratorTypeData

type EventNewCollaboratorTypeData struct {
	Collaborator EventCollaborator `json:"collaborator"`
}

type EventNewDomainType

type EventNewDomainType struct {
	Event
	TypeData EventNewDomainTypeData `json:"type_data"`
}

func (*EventNewDomainType) String

func (ev *EventNewDomainType) String() string

func (*EventNewDomainType) TypeDataPtr

func (e *EventNewDomainType) TypeDataPtr() interface{}

type EventNewDomainTypeData

type EventNewDomainTypeData struct {
	Hostname string `json:"hostname"`
	SSL      bool   `json:"ssl"`
}

type EventNewIntegrationType

type EventNewIntegrationType struct {
	Event
	TypeData EventNewIntegrationTypeData `json:"type_data"`
}

func (*EventNewIntegrationType) String

func (ev *EventNewIntegrationType) String() string

func (*EventNewIntegrationType) TypeDataPtr

func (e *EventNewIntegrationType) TypeDataPtr() interface{}

type EventNewIntegrationTypeData

type EventNewIntegrationTypeData struct {
	IntegrationID   string  `json:"integration_id"`
	IntegrationType SCMType `json:"integration_type"`
	Data            struct {
		Login     string `json:"login"`
		AvatarURL string `json:"avatar_url"`
		URL       string `json:"url"`
	} `json:"data"`
}

type EventNewKeyType

type EventNewKeyType struct {
	Event
	TypeData EventNewKeyTypeData `json:"type_data"`
}

func (*EventNewKeyType) String

func (ev *EventNewKeyType) String() string

func (*EventNewKeyType) TypeDataPtr

func (e *EventNewKeyType) TypeDataPtr() interface{}

type EventNewKeyTypeData

type EventNewKeyTypeData struct {
	Name        string `json:"name"`
	Fingerprint string `json:"fingerprint"`
}

type EventNewLogDrainType

type EventNewLogDrainType struct {
	Event
	TypeData EventNewLogDrainTypeData `json:"type_data"`
}

func (*EventNewLogDrainType) String

func (ev *EventNewLogDrainType) String() string

func (*EventNewLogDrainType) TypeDataPtr

func (e *EventNewLogDrainType) TypeDataPtr() interface{}

type EventNewLogDrainTypeData

type EventNewLogDrainTypeData struct {
	URL string `json:"url"`
}

New log drain

type EventNewNotifierType

type EventNewNotifierType struct {
	Event
	TypeData EventNewNotifierTypeData `json:"type_data"`
}

func (*EventNewNotifierType) String

func (ev *EventNewNotifierType) String() string

func (*EventNewNotifierType) TypeDataPtr

func (e *EventNewNotifierType) TypeDataPtr() interface{}

type EventNewNotifierTypeData

type EventNewNotifierTypeData struct {
	NotifierName     string                 `json:"notifier_name"`
	Active           bool                   `json:"active"`
	SendAllEvents    bool                   `json:"send_all_events"`
	SelectedEvents   []string               `json:"selected_events"`
	NotifierType     string                 `json:"notifier_type"`
	NotifierTypeData map[string]interface{} `json:"notifier_type_data"`
	PlatformName     string                 `json:"platform_name"`
}

New notifier

type EventNewTokenType

type EventNewTokenType struct {
	Event
	TypeData EventNewTokenTypeData `json:"type_data"`
}

func (*EventNewTokenType) String

func (ev *EventNewTokenType) String() string

func (*EventNewTokenType) TypeDataPtr

func (e *EventNewTokenType) TypeDataPtr() interface{}

type EventNewTokenTypeData

type EventNewTokenTypeData struct {
	TokenName string `json:"token_name"`
	TokenID   string `json:"token_id"`
}

type EventNewUserType

type EventNewUserType struct {
	Event
	TypeData EventNewUserTypeData `json:"type_data"`
}

func (*EventNewUserType) String

func (ev *EventNewUserType) String() string

func (*EventNewUserType) TypeDataPtr

func (e *EventNewUserType) TypeDataPtr() interface{}

type EventNewUserTypeData

type EventNewUserTypeData struct {
}

type EventNewVariableType

type EventNewVariableType struct {
	Event
	TypeData EventNewVariableTypeData `json:"type_data"`
}

func (*EventNewVariableType) String

func (ev *EventNewVariableType) String() string

func (*EventNewVariableType) TypeDataPtr

func (e *EventNewVariableType) TypeDataPtr() interface{}

func (*EventNewVariableType) Who

func (ev *EventNewVariableType) Who() string

type EventNewVariableTypeData

type EventNewVariableTypeData struct {
	AddonName string `json:"addon_name"`
	EventVariable
}

type EventPasswordResetQueryType

type EventPasswordResetQueryType struct {
	Event
	TypeData EventPasswordResetQueryTypeData `json:"type_data"`
}

func (*EventPasswordResetQueryType) String

func (ev *EventPasswordResetQueryType) String() string

func (*EventPasswordResetQueryType) TypeDataPtr

func (e *EventPasswordResetQueryType) TypeDataPtr() interface{}

type EventPasswordResetQueryTypeData

type EventPasswordResetQueryTypeData EventSecurityTypeData

type EventPasswordResetSuccessType

type EventPasswordResetSuccessType struct {
	Event
	TypeData EventPasswordResetSuccessTypeData `json:"type_data"`
}

func (*EventPasswordResetSuccessType) String

func (*EventPasswordResetSuccessType) TypeDataPtr

func (e *EventPasswordResetSuccessType) TypeDataPtr() interface{}

type EventPasswordResetSuccessTypeData

type EventPasswordResetSuccessTypeData EventSecurityTypeData

type EventPaymentAttemptType

type EventPaymentAttemptType struct {
	Event
	TypeData EventPaymentAttemptTypeData `json:"type_data"`
}

func (*EventPaymentAttemptType) String

func (ev *EventPaymentAttemptType) String() string

func (*EventPaymentAttemptType) TypeDataPtr

func (e *EventPaymentAttemptType) TypeDataPtr() interface{}

type EventPaymentAttemptTypeData

type EventPaymentAttemptTypeData struct {
	Amount        float32 `json:"amount"`
	PaymentMethod string  `json:"payment_method"`
	Status        string  `json:"status"`
}

type EventPlanDatabaseMaintenanceType added in v6.7.3

type EventPlanDatabaseMaintenanceType struct {
	Event
	TypeData EventPlanDatabaseMaintenanceTypeData `json:"type_data"`
}

func (*EventPlanDatabaseMaintenanceType) String added in v6.7.3

func (*EventPlanDatabaseMaintenanceType) TypeDataPtr added in v6.7.3

func (e *EventPlanDatabaseMaintenanceType) TypeDataPtr() interface{}

func (*EventPlanDatabaseMaintenanceType) Who added in v6.7.3

type EventPlanDatabaseMaintenanceTypeData added in v6.7.3

type EventPlanDatabaseMaintenanceTypeData struct {
	AddonName                string    `json:"addon_name"`
	MaintenanceID            string    `json:"maintenance_id"`
	MaintenanceWindowInHours int       `json:"maintenance_window_in_hours"`
	MaintenanceType          string    `json:"maintenance_type"`
	NextMaintenanceWindow    time.Time `json:"next_maintenance_window"`
}

Database maintenance planned

type EventRegenerateTokenType

type EventRegenerateTokenType struct {
	Event
	TypeData EventRegenerateTokenTypeData `json:"type_data"`
}

func (*EventRegenerateTokenType) String

func (ev *EventRegenerateTokenType) String() string

func (*EventRegenerateTokenType) TypeDataPtr

func (e *EventRegenerateTokenType) TypeDataPtr() interface{}

type EventRegenerateTokenTypeData

type EventRegenerateTokenTypeData struct {
	TokenName string `json:"token_name"`
	TokenID   string `json:"token_id"`
}

type EventRenameAppType

type EventRenameAppType struct {
	Event
	TypeData EventRenameAppTypeData `json:"type_data"`
}

func (*EventRenameAppType) String

func (ev *EventRenameAppType) String() string

func (*EventRenameAppType) TypeDataPtr

func (e *EventRenameAppType) TypeDataPtr() interface{}

type EventRenameAppTypeData

type EventRenameAppTypeData struct {
	OldName string `json:"old_name"`
	NewName string `json:"new_name"`
}

type EventRepeatedCrashType

type EventRepeatedCrashType struct {
	Event
	TypeData EventRepeatedCrashTypeData `json:"type_data"`
}

func (*EventRepeatedCrashType) String

func (ev *EventRepeatedCrashType) String() string

func (*EventRepeatedCrashType) TypeDataPtr

func (e *EventRepeatedCrashType) TypeDataPtr() interface{}

type EventRepeatedCrashTypeData

type EventRepeatedCrashTypeData struct {
	ContainerType string `json:"container_type"`
	CrashLogs     string `json:"crash_logs"`
	LogsURL       string `json:"logs_url"`
}

type EventRestartType

type EventRestartType struct {
	Event
	TypeData EventRestartTypeData `json:"type_data"`
}

func (*EventRestartType) String

func (ev *EventRestartType) String() string

func (*EventRestartType) TypeDataPtr

func (e *EventRestartType) TypeDataPtr() interface{}

func (*EventRestartType) Who

func (ev *EventRestartType) Who() string

type EventRestartTypeData

type EventRestartTypeData struct {
	Scope     []string `json:"scope"`
	AddonName string   `json:"addon_name"`
}

type EventResumeAddonType

type EventResumeAddonType struct {
	Event
	TypeData EventResumeAddonTypeData `json:"type_data"`
}

func (*EventResumeAddonType) String

func (ev *EventResumeAddonType) String() string

func (*EventResumeAddonType) TypeDataPtr

func (e *EventResumeAddonType) TypeDataPtr() interface{}

type EventResumeAddonTypeData

type EventResumeAddonTypeData struct {
	EventAddon
}

type EventRevokeGithubType

type EventRevokeGithubType struct {
	Event
}

func (*EventRevokeGithubType) String

func (ev *EventRevokeGithubType) String() string

func (*EventRevokeGithubType) TypeDataPtr

func (e *EventRevokeGithubType) TypeDataPtr() interface{}

type EventRunType

type EventRunType struct {
	Event
	TypeData EventRunTypeData `json:"type_data"`
}

func (*EventRunType) String

func (ev *EventRunType) String() string

func (*EventRunType) TypeDataPtr

func (e *EventRunType) TypeDataPtr() interface{}

func (*EventRunType) Who added in v6.7.3

func (ev *EventRunType) Who() string

type EventRunTypeData

type EventRunTypeData struct {
	Command    string `json:"command"`
	AuditLogID string `json:"audit_log_id"`
	Detached   bool   `json:"detached"`
}

type EventScaleType

type EventScaleType struct {
	Event
	TypeData EventScaleTypeData `json:"type_data"`
}

func (*EventScaleType) String

func (ev *EventScaleType) String() string

func (*EventScaleType) TypeDataPtr

func (e *EventScaleType) TypeDataPtr() interface{}

type EventScaleTypeData

type EventScaleTypeData struct {
	PreviousContainers map[string]string `json:"previous_containers"`
	Containers         map[string]string `json:"containers"`
}

type EventSecurityTypeData

type EventSecurityTypeData struct {
	RemoteIP string `json:"remote_ip"`
}

type EventStackChangedType added in v6.3.0

type EventStackChangedType struct {
	Event
	TypeData EventStackChangedTypeData `json:"type_data"`
}

func (*EventStackChangedType) String added in v6.3.0

func (ev *EventStackChangedType) String() string

func (*EventStackChangedType) TypeDataPtr added in v6.3.0

func (e *EventStackChangedType) TypeDataPtr() interface{}

type EventStackChangedTypeData added in v6.3.0

type EventStackChangedTypeData struct {
	PreviousStackID   string `json:"previous_stack_id"`
	CurrentStackID    string `json:"current_stack_id"`
	PreviousStackName string `json:"previous_stack_name"`
	CurrentStackName  string `json:"current_stack_name"`
}

Stack changed

type EventStartDatabaseMaintenanceType added in v6.7.3

type EventStartDatabaseMaintenanceType struct {
	Event
	TypeData EventStartDatabaseMaintenanceTypeData `json:"type_data"`
}

func (*EventStartDatabaseMaintenanceType) String added in v6.7.3

func (*EventStartDatabaseMaintenanceType) TypeDataPtr added in v6.7.3

func (e *EventStartDatabaseMaintenanceType) TypeDataPtr() interface{}

func (*EventStartDatabaseMaintenanceType) Who added in v6.7.3

type EventStartDatabaseMaintenanceTypeData added in v6.7.3

type EventStartDatabaseMaintenanceTypeData struct {
	AddonName                string    `json:"addon_name"`
	MaintenanceID            string    `json:"maintenance_id"`
	MaintenanceWindowInHours int       `json:"maintenance_window_in_hours"`
	MaintenanceType          string    `json:"maintenance_type"`
	NextMaintenanceWindow    time.Time `json:"next_maintenance_window"`
}

Database maintenance started

type EventStartRegionMigrationType

type EventStartRegionMigrationType struct {
	Event
	TypeData EventStartRegionMigrationTypeData `json:"type_data"`
}

func (*EventStartRegionMigrationType) String

func (*EventStartRegionMigrationType) TypeDataPtr

func (e *EventStartRegionMigrationType) TypeDataPtr() interface{}

type EventStartRegionMigrationTypeData

type EventStartRegionMigrationTypeData struct {
	MigrationID string `json:"migration_id"`
	Destination string `json:"destination"`
	Source      string `json:"source"`
	DstAppName  string `json:"dst_app_name"`
}

type EventStopAppType

type EventStopAppType struct {
	Event
	TypeData EventStopAppTypeData `json:"type_data"`
}

func (*EventStopAppType) String

func (ev *EventStopAppType) String() string

func (*EventStopAppType) TypeDataPtr

func (e *EventStopAppType) TypeDataPtr() interface{}

type EventStopAppTypeData

type EventStopAppTypeData struct {
	Reason string `json:"reason"`
}

type EventSuspendAddonType

type EventSuspendAddonType struct {
	Event
	TypeData EventSuspendAddonTypeData `json:"type_data"`
}

func (*EventSuspendAddonType) String

func (ev *EventSuspendAddonType) String() string

func (*EventSuspendAddonType) TypeDataPtr

func (e *EventSuspendAddonType) TypeDataPtr() interface{}

type EventSuspendAddonTypeData

type EventSuspendAddonTypeData struct {
	EventAddon
	Reason string `json:"reason"`
}

type EventTfaDisabledType

type EventTfaDisabledType struct {
	Event
	TypeData EventTfaDisabledTypeData `json:"type_data"`
}

func (*EventTfaDisabledType) String

func (ev *EventTfaDisabledType) String() string

func (*EventTfaDisabledType) TypeDataPtr

func (e *EventTfaDisabledType) TypeDataPtr() interface{}

type EventTfaDisabledTypeData

type EventTfaDisabledTypeData struct {
}

Disable Tfa

type EventTfaEnabledType

type EventTfaEnabledType struct {
	Event
	TypeData EventTfaEnabledTypeData `json:"type_data"`
}

func (*EventTfaEnabledType) String

func (ev *EventTfaEnabledType) String() string

func (*EventTfaEnabledType) TypeDataPtr

func (e *EventTfaEnabledType) TypeDataPtr() interface{}

type EventTfaEnabledTypeData

type EventTfaEnabledTypeData struct {
	Provider string `json:"provider"`
}

Enable Tfa

type EventTransferAppType

type EventTransferAppType struct {
	Event
	TypeData EventTransferAppTypeData `json:"type_data"`
}

func (*EventTransferAppType) String

func (ev *EventTransferAppType) String() string

func (*EventTransferAppType) TypeDataPtr

func (e *EventTransferAppType) TypeDataPtr() interface{}

type EventTransferAppTypeData

type EventTransferAppTypeData struct {
	OldOwner EventUser `json:"old_owner"`
	NewOwner EventUser `json:"new_owner"`
}

type EventType

type EventType struct {
	ID          string `json:"id"`
	CategoryID  string `json:"category_id"`
	Name        string `json:"name"`
	DisplayName string `json:"display_name"`
	Description string `json:"description"`
	Template    string `json:"template"`
}

type EventTypeName

type EventTypeName string
const (
	EventNewUser                     EventTypeName = "new_user"
	EventNewApp                      EventTypeName = "new_app"
	EventEditApp                     EventTypeName = "edit_app"
	EventDeleteApp                   EventTypeName = "delete_app"
	EventRenameApp                   EventTypeName = "rename_app"
	EventTransferApp                 EventTypeName = "transfer_app"
	EventRestart                     EventTypeName = "restart"
	EventScale                       EventTypeName = "scale"
	EventStopApp                     EventTypeName = "stop_app"
	EventCrash                       EventTypeName = "crash"
	EventRepeatedCrash               EventTypeName = "repeated_crash"
	EventDeployment                  EventTypeName = "deployment"
	EventLinkSCM                     EventTypeName = "link_scm"
	EventUpdateSCM                   EventTypeName = "update_scm"
	EventUnlinkSCM                   EventTypeName = "unlink_scm"
	EventNewIntegration              EventTypeName = "new_integration"
	EventDeleteIntegration           EventTypeName = "delete_integration"
	EventAuthorizeGithub             EventTypeName = "authorize_github"
	EventRevokeGithub                EventTypeName = "revoke_github"
	EventRun                         EventTypeName = "run"
	EventNewDomain                   EventTypeName = "new_domain"
	EventEditDomain                  EventTypeName = "edit_domain"
	EventDeleteDomain                EventTypeName = "delete_domain"
	EventUpgradeDatabase             EventTypeName = "upgrade_database"
	EventNewAddon                    EventTypeName = "new_addon"
	EventUpgradeAddon                EventTypeName = "upgrade_addon"
	EventDeleteAddon                 EventTypeName = "delete_addon"
	EventResumeAddon                 EventTypeName = "resume_addon"
	EventSuspendAddon                EventTypeName = "suspend_addon"
	EventDatabaseAddFeature          EventTypeName = "database/add_feature"
	EventDatabaseRemoveFeature       EventTypeName = "database/remove_feature"
	EventNewCollaborator             EventTypeName = "new_collaborator"
	EventAcceptCollaborator          EventTypeName = "accept_collaborator"
	EventDeleteCollaborator          EventTypeName = "delete_collaborator"
	EventNewVariable                 EventTypeName = "new_variable"
	EventEditVariable                EventTypeName = "edit_variable"
	EventEditVariables               EventTypeName = "edit_variables"
	EventDeleteVariable              EventTypeName = "delete_variable"
	EventAddCredit                   EventTypeName = "add_credit"
	EventAddPaymentMethod            EventTypeName = "add_payment_method"
	EventAddVoucher                  EventTypeName = "add_voucher"
	EventNewKey                      EventTypeName = "new_key"
	EventEditKey                     EventTypeName = "edit_key"
	EventDeleteKey                   EventTypeName = "delete_key"
	EventPaymentAttempt              EventTypeName = "payment_attempt"
	EventNewAlert                    EventTypeName = "new_alert"
	EventAlert                       EventTypeName = "alert"
	EventDeleteAlert                 EventTypeName = "delete_alert"
	EventNewAutoscaler               EventTypeName = "new_autoscaler"
	EventEditAutoscaler              EventTypeName = "edit_autoscaler"
	EventDeleteAutoscaler            EventTypeName = "delete_autoscaler"
	EventAddonUpdated                EventTypeName = "addon_updated"
	EventStartRegionMigration        EventTypeName = "start_region_migration"
	EventNewLogDrain                 EventTypeName = "new_log_drain"
	EventDeleteLogDrain              EventTypeName = "delete_log_drain"
	EventNewAddonLogDrain            EventTypeName = "new_addon_log_drain"
	EventDeleteAddonLogDrain         EventTypeName = "delete_addon_log_drain"
	EventNewNotifier                 EventTypeName = "new_notifier"
	EventEditNotifier                EventTypeName = "edit_notifier"
	EventDeleteNotifier              EventTypeName = "delete_notifier"
	EventEditHDSContact              EventTypeName = "edit_hds_contact"
	EventCreateDataAccessConsent     EventTypeName = "create_data_access_consent"
	EventNewToken                    EventTypeName = "new_token"
	EventRegenerateToken             EventTypeName = "regenerate_token"
	EventDeleteToken                 EventTypeName = "delete_token"
	EventTfaEnabled                  EventTypeName = "tfa_enabled"
	EventTfaDisabled                 EventTypeName = "tfa_disabled"
	EventLoginSuccess                EventTypeName = "login_success"
	EventLoginFailure                EventTypeName = "login_failure"
	EventLoginLock                   EventTypeName = "login_lock"
	EventLoginUnlockSuccess          EventTypeName = "login_unlock_success"
	EventPasswordResetQuery          EventTypeName = "password_reset_query"
	EventPasswordResetSuccess        EventTypeName = "password_reset_success"
	EventStackChanged                EventTypeName = "stack_changed"
	EventCreateReviewApp             EventTypeName = "create_review_app"
	EventDestroyReviewApp            EventTypeName = "destroy_review_app"
	EventPlanDatabaseMaintenance     EventTypeName = "plan_database_maintenance"
	EventStartDatabaseMaintenance    EventTypeName = "start_database_maintenance"
	EventCompleteDatabaseMaintenance EventTypeName = "complete_database_maintenance"

	// EventLinkGithub and EventUnlinkGithub events are kept for
	// retro-compatibility. They are replaced by SCM events.
	EventLinkGithub   EventTypeName = "link_github"
	EventUnlinkGithub EventTypeName = "unlink_github"
)

type EventUnlinkGithubType

type EventUnlinkGithubType struct {
	Event
	TypeData EventUnlinkGithubTypeData `json:"type_data"`
}

func (*EventUnlinkGithubType) String

func (ev *EventUnlinkGithubType) String() string

func (*EventUnlinkGithubType) TypeDataPtr

func (e *EventUnlinkGithubType) TypeDataPtr() interface{}

type EventUnlinkGithubTypeData

type EventUnlinkGithubTypeData struct {
	RepoName         string `json:"repo_name"`
	UnlinkerUsername string `json:"unlinker_username"`
	GithubSource     string `json:"github_source"`
}

type EventUnlinkSCMType

type EventUnlinkSCMType struct {
	Event
	TypeData EventUnlinkSCMTypeData `json:"type_data"`
}

func (*EventUnlinkSCMType) String

func (ev *EventUnlinkSCMType) String() string

func (*EventUnlinkSCMType) TypeDataPtr

func (e *EventUnlinkSCMType) TypeDataPtr() interface{}

type EventUnlinkSCMTypeData

type EventUnlinkSCMTypeData struct {
	RepoName         string `json:"repo_name"`
	UnlinkerUsername string `json:"unlinker_username"`
	Source           string `json:"source"`
}

type EventUpdateSCMType added in v6.5.0

type EventUpdateSCMType struct {
	Event
	TypeData EventLinkSCMTypeData `json:"type_data"`
}

func (*EventUpdateSCMType) String added in v6.5.0

func (ev *EventUpdateSCMType) String() string

func (*EventUpdateSCMType) TypeDataPtr added in v6.5.0

func (e *EventUpdateSCMType) TypeDataPtr() interface{}

type EventUpgradeAddonType

type EventUpgradeAddonType struct {
	Event
	TypeData EventUpgradeAddonTypeData `json:"type_data"`
}

func (*EventUpgradeAddonType) String

func (ev *EventUpgradeAddonType) String() string

func (*EventUpgradeAddonType) TypeDataPtr

func (e *EventUpgradeAddonType) TypeDataPtr() interface{}

type EventUpgradeAddonTypeData

type EventUpgradeAddonTypeData struct {
	EventAddon
	OldPlanName string `json:"old_plan_name"`
	NewPlanName string `json:"new_plan_name"`
}

type EventUpgradeDatabaseType

type EventUpgradeDatabaseType struct {
	Event
	TypeData EventUpgradeDatabaseTypeData `json:"type_data"`
}

func (*EventUpgradeDatabaseType) String

func (ev *EventUpgradeDatabaseType) String() string

func (*EventUpgradeDatabaseType) TypeDataPtr

func (e *EventUpgradeDatabaseType) TypeDataPtr() interface{}

func (*EventUpgradeDatabaseType) Who

func (ev *EventUpgradeDatabaseType) Who() string

type EventUpgradeDatabaseTypeData

type EventUpgradeDatabaseTypeData struct {
	AddonName  string `json:"addon_name"`
	OldVersion string `json:"old_version"`
	NewVersion string `json:"new_version"`
}

type EventUser

type EventUser struct {
	Username string `json:"username"`
	Email    string `json:"email"`
	ID       string `json:"id"`
}

type EventVariable

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

type EventVariables

type EventVariables []EventVariable

func (EventVariables) Names

func (evs EventVariables) Names() string

type Events

type Events []DetailedEvent

type EventsRes

type EventsRes struct {
	Events []*Event `json:"events"`
	Meta   struct {
		PaginationMeta PaginationMeta `json:"pagination"`
	}
}

type EventsService

type EventsService interface {
	EventTypesList(context.Context) ([]EventType, error)
	EventCategoriesList(context.Context) ([]EventCategory, error)
	EventsList(ctx context.Context, app string, opts PaginationOpts) (Events, PaginationMeta, error)
	UserEventsList(context.Context, PaginationOpts) (Events, PaginationMeta, error)
}

type Instance

type Instance struct {
	ID        string         `json:"id"`
	Hostname  string         `json:"hostname"`
	Port      int            `json:"port"`
	Status    InstanceStatus `json:"status"`
	Type      InstanceType   `json:"type"`
	Features  []string       `json:"features"`
	PrivateIP string         `json:"private_ip"`
}

Instance contains the metadata of an Instance which is one component of a Database deployment.

type InstanceStatus

type InstanceStatus string

InstanceStatus is a type of string representing the status of an Instance

const (
	// InstanceStatusBooting is set when an instance is starting for the first
	// time
	InstanceStatusBooting InstanceStatus = "booting"
	// InstanceStatusRunning is the default status when the instance is working
	// normally
	InstanceStatusRunning InstanceStatus = "running"
	// InstanceStatusRestarting is set when an instance is restarting (during a
	// plan change, at the end of an upgrade or a migration)
	InstanceStatusRestarting InstanceStatus = "restarting"
	// InstanceStatusMigrating is set when an instance is being migrated by the
	// Scalingo infrastructure
	InstanceStatusMigrating InstanceStatus = "migrating"
	// InstanceStatusUpgrading is set when an instance version is being changed,
	// part of a Database upgrade
	InstanceStatusUpgrading InstanceStatus = "upgrading"
	// InstanceStatusStopped is set when an instance has been stopped
	InstanceStatusStopped InstanceStatus = "stopped"
	// InstanceStatusRemoving is set during the deletion of an Instance (business
	// to starter downgrade or database deletion)
	InstanceStatusRemoving InstanceStatus = "removing"
)

type InstanceType

type InstanceType string

InstanceType is a type of string representing the type of the Instance inside a Database

const (
	// InstanceTypeDBNode instances represent database instances holding data
	InstanceTypeDBNode InstanceType = "db-node"
	// InstanceTypeUtility instances are those running service used for running a
	// service which is neither holding data nor routing requests utilities as
	// stated by its Name
	InstanceTypeUtility InstanceType = "utility"
	// InstanceTypeHAProxy are instances running a HAProxy reverse proxy in order
	// to route requests to the InstanceTypeDBNodes
	InstanceTypeHAProxy InstanceType = "haproxy"
)

type Invoice

type Invoice struct {
	ID                string                `json:"id"`
	TotalPrice        int                   `json:"total_price"`
	TotalPriceWithVat int                   `json:"total_price_with_vat"`
	BillingMonth      billingMonthDate      `json:"billing_month"`
	PdfURL            string                `json:"pdf_url"`
	InvoiceNumber     string                `json:"invoice_number"`
	State             string                `json:"state"`
	VatRate           int                   `json:"vat_rate"`
	Items             []InvoiceItem         `json:"items"`
	DetailedItems     []InvoiceDetailedItem `json:"detailed_items"`
}

type InvoiceDetailedItem

type InvoiceDetailedItem struct {
	ID    string `json:"id"`
	Label string `json:"label"`
	Price int    `json:"price"`
	App   string `json:"app"`
}

type InvoiceItem

type InvoiceItem struct {
	ID    string `json:"id"`
	Label string `json:"label"`
	Price int    `json:"price"`
}

type InvoiceRes

type InvoiceRes struct {
	Invoice *Invoice `json:"invoice"`
}

type Invoices

type Invoices []*Invoice

type InvoicesRes

type InvoicesRes struct {
	Invoices Invoices `json:"invoices"`
	Meta     struct {
		PaginationMeta PaginationMeta `json:"pagination"`
	}
}

type InvoicesService

type InvoicesService interface {
	InvoicesList(context.Context, PaginationOpts) (Invoices, PaginationMeta, error)
	InvoiceShow(context.Context, string) (*Invoice, error)
}

type Job

type Job struct {
	Command           string    `json:"command"`
	Size              string    `json:"size,omitempty"`
	LastExecutionDate time.Time `json:"last_execution_date,omitempty"`
	NextExecutionDate time.Time `json:"next_execution_date,omitempty"`
}

type Key

type Key struct {
	ID      string `json:"id,omitempty"`
	Name    string `json:"name"`
	Content string `json:"content"`
}

type KeyRes

type KeyRes struct {
	Key Key `json:"key"`
}

type KeysRes

type KeysRes struct {
	Keys []Key `json:"keys"`
}

type KeysService

type KeysService interface {
	KeysList(context.Context) ([]Key, error)
	KeysAdd(ctx context.Context, name string, content string) (*Key, error)
	KeysDelete(ctx context.Context, id string) error
}

type LetsEncryptStatus

type LetsEncryptStatus string
const (
	LetsEncryptStatusPendingDNS  LetsEncryptStatus = "pending_dns"
	LetsEncryptStatusNew         LetsEncryptStatus = "new"
	LetsEncryptStatusCreated     LetsEncryptStatus = "created"
	LetsEncryptStatusDNSRequired LetsEncryptStatus = "dns_required"
	LetsEncryptStatusError       LetsEncryptStatus = "error"
)

type ListMaintenanceResponse added in v6.7.0

type ListMaintenanceResponse struct {
	Maintenance []*Maintenance `json:"maintenance"`
	Meta        struct {
		PaginationMeta PaginationMeta `json:"pagination"`
	}
}

type ListParams

type ListParams struct {
	AddonProviders []*AddonProvider `json:"addon_providers"`
}

type LogDrain

type LogDrain struct {
	AppID string `json:"app_id"`
	URL   string `json:"url"`
}

type LogDrainAddParams

type LogDrainAddParams struct {
	Type        string `json:"type"`
	URL         string `json:"url"`
	Port        string `json:"port"`
	Host        string `json:"host"`
	Token       string `json:"token"`
	DrainRegion string `json:"drain_region"`
}

type LogDrainAddPayload

type LogDrainAddPayload struct {
	Drain LogDrainAddParams `json:"drain"`
}

type LogDrainRes

type LogDrainRes struct {
	Drain LogDrain `json:"drain"`
}

type LogDrainsRes

type LogDrainsRes struct {
	Drains []LogDrain `json:"drains"`
}

type LogDrainsService

type LogDrainsService interface {
	LogDrainsList(ctx context.Context, app string) ([]LogDrain, error)
	LogDrainAdd(ctx context.Context, app string, params LogDrainAddParams) (*LogDrainRes, error)
	LogDrainRemove(ctx context.Context, app, URL string) error
	LogDrainAddonRemove(ctx context.Context, app, addonID string, URL string) error
	LogDrainsAddonList(ctx context.Context, app string, addonID string) ([]LogDrain, error)
	LogDrainAddonAdd(ctx context.Context, app string, addonID string, params LogDrainAddParams) (*LogDrainRes, error)
}

type LoginParams

type LoginParams struct {
	Identifier string `json:"identifier"`
	Password   string `json:"password"`
	OTP        string `json:"otp"`
	JWT        string `json:"jwt"`
}

type LogsArchiveItem

type LogsArchiveItem struct {
	URL  string `json:"url"`
	From string `json:"from"`
	To   string `json:"to"`
	Size int64  `json:"size"`
}

type LogsArchivesResponse

type LogsArchivesResponse struct {
	NextCursor string            `json:"next_cursor"`
	HasMore    bool              `json:"has_more"`
	Archives   []LogsArchiveItem `json:"archives"`
}

type LogsArchivesService

type LogsArchivesService interface {
	LogsArchivesByCursor(ctx context.Context, app string, cursor string) (*LogsArchivesResponse, error)
	LogsArchives(ctx context.Context, app string, page int) (*LogsArchivesResponse, error)
}

type LogsService

type LogsService interface {
	LogsURL(ctx context.Context, app string) (*http.Response, error)
	Logs(ctx context.Context, logsURL string, n int, filter string) (*http.Response, error)
}

type Maintenance added in v6.7.0

type Maintenance struct {
	ID         string            `json:"id"`
	DatabaseID string            `json:"database_id"`
	Status     MaintenanceStatus `json:"status"`
	Type       string            `json:"type"`
	StartedAt  *time.Time        `json:"started_at,omitempty"`
	EndedAt    *time.Time        `json:"ended_at,omitempty"`
}

type MaintenanceStatus added in v6.7.0

type MaintenanceStatus string
const (
	MaintenanceStatusScheduled MaintenanceStatus = "scheduled"
	MaintenanceStatusNotified  MaintenanceStatus = "notified"
	MaintenanceStatusQueued    MaintenanceStatus = "queued"
	MaintenanceStatusCancelled MaintenanceStatus = "cancelled"
	MaintenanceStatusRunning   MaintenanceStatus = "running"
	MaintenanceStatusFailed    MaintenanceStatus = "failed"
	MaintenanceStatusDone      MaintenanceStatus = "done"
)

type MaintenanceWindow added in v6.7.0

type MaintenanceWindow struct {
	WeekdayUTC      int `json:"weekday_utc"`
	StartingHourUTC int `json:"starting_hour_utc"`
	DurationInHour  int `json:"duration_in_hour"`
}

type MaintenanceWindowParams added in v6.7.0

type MaintenanceWindowParams struct {
	WeekdayUTC      *int `json:"weekday_utc,omitempty"`
	StartingHourUTC *int `json:"starting_hour_utc,omitempty"`
}

type MockSubresourceService

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

MockSubresourceService is a mock of SubresourceService interface

func NewMockSubresourceService

func NewMockSubresourceService(ctrl *gomock.Controller) *MockSubresourceService

NewMockSubresourceService creates a new mock instance

func (*MockSubresourceService) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

type MockSubresourceServiceMockRecorder

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

MockSubresourceServiceMockRecorder is the mock recorder for MockSubresourceService

type NotificationPlatform

type NotificationPlatform struct {
	ID                string   `json:"id"`
	Name              string   `json:"name"`
	DisplayName       string   `json:"display_name"`
	LogoURL           string   `json:"logo_url"`
	Description       string   `json:"description"`
	AvailableEventIDs []string `json:"available_event_ids"`
}

type NotificationPlatformsService

type NotificationPlatformsService interface {
	NotificationPlatformsList(context.Context) ([]*NotificationPlatform, error)
	NotificationPlatformByName(ctx context.Context, name string) ([]*NotificationPlatform, error)
}

type Notifier

type Notifier struct {
	ID               string                 `json:"id"`
	AppID            string                 `json:"app_id"`
	Active           *bool                  `json:"active,omitempty"`
	Name             string                 `json:"name,omitempty"`
	Type             NotifierType           `json:"type"`
	SendAllEvents    *bool                  `json:"send_all_events,omitempty"`
	SendAllAlerts    *bool                  `json:"send_all_alerts,omitempty"`
	SelectedEventIDs []string               `json:"selected_event_ids,omitempty"`
	TypeData         map[string]interface{} `json:"-"`
	RawTypeData      json.RawMessage        `json:"type_data"`
	PlatformID       string                 `json:"platform_id"`
	CreatedAt        time.Time              `json:"created_at"`
	UpdatedAt        time.Time              `json:"updated_at"`
}

Struct used to represent a notifier.

func (*Notifier) GetID

func (n *Notifier) GetID() string

func (*Notifier) GetName

func (n *Notifier) GetName() string

func (*Notifier) GetNotifier

func (n *Notifier) GetNotifier() *Notifier

DetailedNotifier implementation

func (*Notifier) GetSelectedEventIDs

func (n *Notifier) GetSelectedEventIDs() []string

func (*Notifier) GetSendAllAlerts

func (n *Notifier) GetSendAllAlerts() bool

func (*Notifier) GetSendAllEvents

func (n *Notifier) GetSendAllEvents() bool

func (*Notifier) GetType

func (n *Notifier) GetType() NotifierType

func (*Notifier) IsActive

func (n *Notifier) IsActive() bool

func (*Notifier) Specialize

func (n *Notifier) Specialize() DetailedNotifier

func (*Notifier) TypeDataMap

func (n *Notifier) TypeDataMap() map[string]interface{}

func (*Notifier) TypeDataPtr

func (n *Notifier) TypeDataPtr() interface{}

func (*Notifier) When

func (n *Notifier) When() string

type NotifierEmailType

type NotifierEmailType struct {
	Notifier
	TypeData NotifierEmailTypeData `json:"type_data,omitempty"`
}

Email

func (*NotifierEmailType) TypeDataMap

func (n *NotifierEmailType) TypeDataMap() map[string]interface{}

func (*NotifierEmailType) TypeDataPtr

func (n *NotifierEmailType) TypeDataPtr() interface{}

type NotifierEmailTypeData

type NotifierEmailTypeData struct {
	Emails  []string `json:"emails,omitempty"`
	UserIDs []string `json:"user_ids,omitempty"`
}

type NotifierOutput

type NotifierOutput struct {
	*Notifier
	TypeData    NotifierTypeDataParams `json:"type_data,omitempty"`
	RawTypeData omit                   `json:",omitempty"` // Will always be empty and not serialized
}

Struct used to serialize a notifier

type NotifierParams

type NotifierParams struct {
	Active           *bool
	Name             string
	SendAllEvents    *bool
	SendAllAlerts    *bool
	SelectedEventIDs []string
	PlatformID       string

	// Options
	PhoneNumber string   // SMS notifier
	Emails      []string // Email notifier
	UserIDs     []string // Email notifier
	WebhookURL  string   // Webhook and Slack notifier
}

NotifierParams will be given as a parameter in notifiers function's

type NotifierSlackType

type NotifierSlackType struct {
	Notifier
	TypeData NotifierSlackTypeData `json:"type_data,omitempty"`
}

Slack

func (*NotifierSlackType) TypeDataMap

func (n *NotifierSlackType) TypeDataMap() map[string]interface{}

func (*NotifierSlackType) TypeDataPtr

func (n *NotifierSlackType) TypeDataPtr() interface{}

type NotifierSlackTypeData

type NotifierSlackTypeData struct {
	WebhookURL string `json:"webhook_url,omitempty"`
}

type NotifierType

type NotifierType string
const (
	NotifierWebhook NotifierType = "webhook"
	NotifierSlack   NotifierType = "slack"
	NotifierEmail   NotifierType = "email"
)

type NotifierTypeDataParams

type NotifierTypeDataParams struct {
	WebhookURL  string   `json:"webhook_url,omitempty"`
	Emails      []string `json:"emails,omitempty"`
	UserIDs     []string `json:"user_ids,omitempty"`
	PhoneNumber string   `json:"phone_number,omitempty"`
}

type NotifierWebhookType

type NotifierWebhookType struct {
	Notifier
	TypeData NotifierWebhookTypeData `json:"type_data,omitempty"`
}

Webhook

func (*NotifierWebhookType) TypeDataMap

func (n *NotifierWebhookType) TypeDataMap() map[string]interface{}

func (*NotifierWebhookType) TypeDataPtr

func (n *NotifierWebhookType) TypeDataPtr() interface{}

type NotifierWebhookTypeData

type NotifierWebhookTypeData struct {
	WebhookURL string `json:"webhook_url,omitempty"`
}

type Notifiers

type Notifiers []DetailedNotifier

type NotifiersService

type NotifiersService interface {
	NotifiersList(ctx context.Context, app string) (Notifiers, error)
	NotifierProvision(ctx context.Context, app string, params NotifierParams) (*Notifier, error)
	NotifierByID(ctx context.Context, app, ID string) (*Notifier, error)
	NotifierUpdate(ctx context.Context, app, ID string, params NotifierParams) (*Notifier, error)
	NotifierDestroy(ctx context.Context, app, ID string) error
}

type Operation

type Operation struct {
	ID              string                   `json:"id"`
	AppID           string                   `json:"app_id"`
	CreatedAt       time.Time                `json:"created_at"`
	FinishedAt      time.Time                `json:"finished_at"`
	Status          OperationStatus          `json:"status"`
	Type            OperationType            `json:"type"`
	Error           string                   `json:"error"`
	StartOneOffData OperationStartOneOffData `json:"start_one_off_data"`
}

func (*Operation) ElapsedDuration

func (op *Operation) ElapsedDuration() float64

type OperationResponse

type OperationResponse struct {
	Op Operation `json:"operation"`
}

type OperationStartOneOffData added in v6.4.0

type OperationStartOneOffData struct {
	AttachURL   string `json:"attach_url"`
	ContainerID string `json:"container_id"`
}

type OperationStatus

type OperationStatus string
const (
	OperationStatusPending OperationStatus = "pending"
	OperationStatusDone    OperationStatus = "done"
	OperationStatusRunning OperationStatus = "running"
	OperationStatusError   OperationStatus = "error"
)

type OperationType

type OperationType string
const (
	OperationTypeScale       OperationType = "scale"
	OperationTypeStart       OperationType = "start"
	OperationTypeStartOneOff OperationType = "start-one-off"
)

type OperationsService

type OperationsService interface {
	OperationsShow(ctx context.Context, app, opID string) (*Operation, error)
}

type Owner

type Owner struct {
	ID       string `json:"id"`
	Username string `json:"username"`
	Email    string `json:"email"`
}

type PaginationMeta

type PaginationMeta struct {
	PrevPage    int `json:"prev_page"`
	CurrentPage int `json:"current_page"`
	NextPage    int `json:"next_page"`
	TotalPages  int `json:"total_pages"`
	TotalCount  int `json:"total_count"`
}

type PaginationOpts

type PaginationOpts struct {
	Page    int
	PerPage int
}

func (PaginationOpts) ToMap

func (opts PaginationOpts) ToMap() map[string]string

type Plan

type Plan struct {
	ID                        string `json:"id"`
	DisplayName               string `json:"display_name"`
	Name                      string `json:"name"`
	Description               string `json:"description"`
	Position                  int    `json:"position"`
	OnDemand                  bool   `json:"on_demand"`
	Disabled                  bool   `json:"disabled"`
	DisabledAlternativePlanID bool   `json:"disabled_alternative_plan_id"`
	SKU                       string `json:"sku"`
	HDSAvailable              bool   `json:"hds_available"`
}

type PlansParams

type PlansParams struct {
	Plans []*Plan `json:"plans"`
}

type PlatformRes

type PlatformRes struct {
	NotificationPlatform *NotificationPlatform `json:"notification_platform"`
}

type PlatformsRes

type PlatformsRes struct {
	NotificationPlatforms []*NotificationPlatform `json:"notification_platforms"`
}

type PullRequest

type PullRequest struct {
	Number     int       `json:"number"`
	BranchName string    `json:"branch_name"`
	Title      string    `json:"title"`
	URL        string    `json:"url"`
	HTMLURL    string    `json:"html_url"`
	Ref        string    `json:"ref"`
	BaseRef    string    `json:"base_ref"`
	CreatedAt  time.Time `json:"created_at"`
	ClosedAt   time.Time `json:"closed_at"`
}

type Region

type Region struct {
	Name        string `json:"name"`
	DisplayName string `json:"display_name"`
	SSH         string `json:"ssh"`
	API         string `json:"api"`
	Dashboard   string `json:"dashboard"`
	DatabaseAPI string `json:"database_api"`
	Default     bool   `json:"default"`
}

type RegionMigration

type RegionMigration struct {
	ID          string                `json:"id"`
	SrcAppName  string                `json:"src_app_name"`
	DstAppName  string                `json:"dst_app_name"`
	AppID       string                `json:"app_id"`
	NewAppID    string                `json:"new_app_id"`
	Source      string                `json:"source"`
	Destination string                `json:"destination"`
	Status      RegionMigrationStatus `json:"status"`
	StartedAt   time.Time             `json:"started_at"`
	FinishedAt  time.Time             `json:"finished_at"`
	Steps       Steps                 `json:"steps"`
}

type RegionMigrationParams

type RegionMigrationParams struct {
	Destination string `json:"destination"`
	DstAppName  string `json:"dst_app_name"`
}

type RegionMigrationStatus

type RegionMigrationStatus string

type RegionMigrationStep

type RegionMigrationStep string

type RegionMigrationsService

type RegionMigrationsService interface {
	CreateRegionMigration(ctx context.Context, appID string, params RegionMigrationParams) (RegionMigration, error)
	RunRegionMigrationStep(ctx context.Context, appID, migrationID string, step RegionMigrationStep) error
	ShowRegionMigration(ctx context.Context, appID, migrationID string) (RegionMigration, error)
	ListRegionMigrations(ctx context.Context, appID string) ([]RegionMigration, error)
}

type RegionsService

type RegionsService interface {
	RegionsList(context.Context) ([]Region, error)
}

type RepoLinkPullRequest added in v6.6.0

type RepoLinkPullRequest struct {
	ID                    int    `json:"id"`
	Number                int    `json:"number"`
	Title                 string `json:"title"`
	HTMLURL               string `json:"html_url"`
	SourceRepoName        string `json:"source_repo_name"`
	SourceRepoHTMLURL     string `json:"source_repo_html_url"`
	OpenedFromAForkedRepo bool   `json:"opened_from_a_forked_repo"`
}

type ReviewApp

type ReviewApp struct {
	ID                  string       `json:"id"`
	RepoLinkID          string       `json:"repo_link_id"`
	AppID               string       `json:"app_id"`
	AppName             string       `json:"app_name"`
	ParentAppID         string       `json:"parent_app_id"`
	ParentAppName       string       `json:"parent_app_name"`
	CreatedAt           time.Time    `json:"created_at"`
	StaleDeletionDate   time.Time    `json:"stale_deletion_date"`
	OnCloseDeletionDate time.Time    `json:"on_close_deletion_date"`
	PullRequest         *PullRequest `json:"pull_request"`
	LastDeployment      *Deployment  `json:"last_deployment"`
}

type RunOpts

type RunOpts struct {
	App        string
	Command    []string
	Env        map[string]string
	Size       string
	Detached   bool
	Async      bool
	HasUploads bool
}

type RunRes

type RunRes struct {
	Container    *Container `json:"container"`
	AttachURL    string     `json:"attach_url"`
	OperationURL string     `json:"-"`
}

type RunsService

type RunsService interface {
	Run(ctx context.Context, opts RunOpts) (*RunRes, error)
}

type SCMIntegration

type SCMIntegration struct {
	ID          string    `json:"id"`
	SCMType     SCMType   `json:"scm_type"`
	URL         string    `json:"url,omitempty"`
	AccessToken string    `json:"access_token"`
	UID         string    `json:"uid"`
	Username    string    `json:"username"`
	Email       string    `json:"email"`
	AvatarURL   string    `json:"avatar_url"`
	ProfileURL  string    `json:"profile_url"`
	CreatedAt   time.Time `json:"created_at"`
	Owner       Owner     `json:"owner"`
}

type SCMIntegrationParams

type SCMIntegrationParams struct {
	SCMType     SCMType `json:"scm_type"`
	URL         string  `json:"url,omitempty"`
	AccessToken string  `json:"access_token"`
}

type SCMIntegrationParamsReq

type SCMIntegrationParamsReq struct {
	SCMIntegrationParams SCMIntegrationParams `json:"scm_integration"`
}

type SCMIntegrationRes

type SCMIntegrationRes struct {
	SCMIntegration SCMIntegration `json:"scm_integration"`
}

type SCMIntegrationsRes

type SCMIntegrationsRes struct {
	SCMIntegrations []SCMIntegration `json:"scm_integrations"`
}

type SCMIntegrationsService

type SCMIntegrationsService interface {
	SCMIntegrationsList(context.Context) ([]SCMIntegration, error)
	SCMIntegrationsShow(ctx context.Context, id string) (*SCMIntegration, error)
	SCMIntegrationsCreate(ctx context.Context, scmType SCMType, url string, accessToken string) (*SCMIntegration, error)
	SCMIntegrationsDelete(ctx context.Context, id string) error
	SCMIntegrationsImportKeys(ctx context.Context, id string) ([]Key, error)
}
type SCMRepoLink struct {
	ID                                string            `json:"id"`
	AppID                             string            `json:"app_id"`
	Linker                            SCMRepoLinkLinker `json:"linker"`
	URL                               string            `json:"url"`
	Owner                             string            `json:"owner"`
	Repo                              string            `json:"repo"`
	Branch                            string            `json:"branch"`
	SCMType                           SCMType           `json:"scm_type"`
	CreatedAt                         time.Time         `json:"created_at"`
	UpdatedAt                         time.Time         `json:"updated_at"`
	AutoDeployEnabled                 bool              `json:"auto_deploy_enabled"`
	AuthIntegrationUUID               string            `json:"auth_integration_uuid"`
	DeployReviewAppsEnabled           bool              `json:"deploy_review_apps_enabled"`
	DeleteOnCloseEnabled              bool              `json:"delete_on_close_enabled"`
	DeleteStaleEnabled                bool              `json:"delete_stale_enabled"`
	HoursBeforeDeleteOnClose          uint              `json:"hours_before_delete_on_close"`
	HoursBeforeDeleteStale            uint              `json:"hours_before_delete_stale"`
	LastAutoDeployAt                  time.Time         `json:"last_auto_deploy_at"`
	AutomaticCreationFromForksAllowed bool              `json:"automatic_creation_from_forks_allowed"`
}

type SCMRepoLinkCreateParams

type SCMRepoLinkCreateParams struct {
	Source                            *string `json:"source,omitempty"`
	Branch                            *string `json:"branch,omitempty"`
	AuthIntegrationUUID               *string `json:"auth_integration_uuid,omitempty"`
	AutoDeployEnabled                 *bool   `json:"auto_deploy_enabled,omitempty"`
	DeployReviewAppsEnabled           *bool   `json:"deploy_review_apps_enabled,omitempty"`
	DestroyOnCloseEnabled             *bool   `json:"delete_on_close_enabled,omitempty"`
	HoursBeforeDeleteOnClose          *uint   `json:"hours_before_delete_on_close,omitempty"`
	DestroyStaleEnabled               *bool   `json:"delete_stale_enabled,omitempty"`
	HoursBeforeDeleteStale            *uint   `json:"hours_before_delete_stale,omitempty"`
	AutomaticCreationFromForksAllowed *bool   `json:"automatic_creation_from_forks_allowed,omitempty"`
}

type SCMRepoLinkDeploymentsResponse

type SCMRepoLinkDeploymentsResponse struct {
	Deployments []*Deployment `json:"deployments"`
}

type SCMRepoLinkLinker

type SCMRepoLinkLinker struct {
	Username string `json:"username"`
	Email    string `json:"email"`
	ID       string `json:"id"`
}

type SCMRepoLinkManualDeployResponse added in v6.5.0

type SCMRepoLinkManualDeployResponse struct {
	Deployment *Deployment `json:"deployment"`
}

type SCMRepoLinkPullRequestResponse added in v6.6.0

type SCMRepoLinkPullRequestResponse struct {
	Pull RepoLinkPullRequest `json:"pull"`
}

type SCMRepoLinkReviewAppsResponse

type SCMRepoLinkReviewAppsResponse struct {
	ReviewApps []*ReviewApp `json:"review_apps"`
}

type SCMRepoLinkService

type SCMRepoLinkService interface {
	SCMRepoLinkList(ctx context.Context, opts PaginationOpts) ([]*SCMRepoLink, PaginationMeta, error)
	SCMRepoLinkShow(ctx context.Context, app string) (*SCMRepoLink, error)
	SCMRepoLinkCreate(ctx context.Context, app string, params SCMRepoLinkCreateParams) (*SCMRepoLink, error)
	SCMRepoLinkUpdate(ctx context.Context, app string, params SCMRepoLinkUpdateParams) (*SCMRepoLink, error)
	SCMRepoLinkDelete(ctx context.Context, app string) error
	SCMRepoLinkPullRequest(ctx context.Context, app string, number int) (*RepoLinkPullRequest, error)

	SCMRepoLinkManualDeploy(ctx context.Context, app, branch string) (*Deployment, error)
	SCMRepoLinkManualReviewApp(ctx context.Context, app, pullRequestID string) error
	SCMRepoLinkDeployments(ctx context.Context, app string) ([]*Deployment, error)
	SCMRepoLinkReviewApps(ctx context.Context, app string) ([]*ReviewApp, error)
}

type SCMRepoLinkUpdateParams

type SCMRepoLinkUpdateParams struct {
	Branch                            *string `json:"branch,omitempty"`
	AutoDeployEnabled                 *bool   `json:"auto_deploy_enabled,omitempty"`
	DeployReviewAppsEnabled           *bool   `json:"deploy_review_apps_enabled,omitempty"`
	DestroyOnCloseEnabled             *bool   `json:"delete_on_close_enabled,omitempty"`
	HoursBeforeDeleteOnClose          *uint   `json:"hours_before_delete_on_close,omitempty"`
	DestroyStaleEnabled               *bool   `json:"delete_stale_enabled,omitempty"`
	HoursBeforeDeleteStale            *uint   `json:"hours_before_delete_stale,omitempty"`
	AutomaticCreationFromForksAllowed *bool   `json:"automatic_creation_from_forks_allowed,omitempty"`
}

type SCMRepoLinksResponse

type SCMRepoLinksResponse struct {
	SCMRepoLinks []*SCMRepoLink `json:"scm_repo_links"`
	Meta         struct {
		PaginationMeta PaginationMeta `json:"pagination"`
	}
}

type SCMType

type SCMType string
const (
	SCMGithubType           SCMType = "github"             // GitHub
	SCMGithubEnterpriseType SCMType = "github-enterprise"  // GitHub Enterprise (private instance)
	SCMGitlabType           SCMType = "gitlab"             // GitLab.com
	SCMGitlabSelfHostedType SCMType = "gitlab-self-hosted" // GitLab self-hosted (private instance)
)

Type of SCM integrations

func (SCMType) Str

func (t SCMType) Str() string

type ScmRepoLinkResponse

type ScmRepoLinkResponse struct {
	SCMRepoLink *SCMRepoLink `json:"scm_repo_link"`
}

type SelfResponse

type SelfResponse struct {
	User *User `json:"user"`
}

type SignUpService

type SignUpService interface {
	SignUp(ctx context.Context, email, password string) error
}

type Source

type Source struct {
	DownloadURL string `json:"download_url"`
	UploadURL   string `json:"upload_url"`
}

type SourcesCreateResponse

type SourcesCreateResponse struct {
	Source *Source `json:"source"`
}

type SourcesService

type SourcesService interface {
	SourcesCreate(context.Context) (*Source, error)
}

type SslStatus

type SslStatus string
const (
	SslStatusPendingDNS SslStatus = "pending"
	SslStatusNew        SslStatus = "error"
	SslStatusCreated    SslStatus = "success"
)

type Stack

type Stack struct {
	ID           string          `json:"id"`
	CreatedAt    time.Time       `json:"created_at"`
	Name         string          `json:"name"`
	Description  string          `json:"description"`
	BaseImage    string          `json:"base_image"`
	Default      bool            `json:"default"`
	DeprecatedAt DeprecationDate `json:"deprecated_at,omitempty"`
}

func (*Stack) IsDeprecated

func (s *Stack) IsDeprecated() bool

type StacksService

type StacksService interface {
	StacksList(ctx context.Context) ([]Stack, error)
}

type StaticTokenGenerator

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

StaticTokenGenerator is an implementation of TokenGenerator which always return the same token. This token is provided to the constructor. The TokenGenerator is used by the Client to authenticate to the Scalingo API.

Usage:

t := GetStaticTokenGenerator("my-token")
client := NewClient(ClientConfig{
	TokenGenerator: t,
})

Any subsequent calls to the Scalingo API will use this token to authenticate.

func NewStaticTokenGenerator

func NewStaticTokenGenerator(token string) *StaticTokenGenerator

NewStaticTokenGenerator returns a new StaticTokenGenerator. The only argument is the token that will always be returned by this generator.

func (*StaticTokenGenerator) GetAccessToken

func (t *StaticTokenGenerator) GetAccessToken(context.Context) (string, error)

GetAccessToken always returns the configured token.

func (*StaticTokenGenerator) SetClient

func (t *StaticTokenGenerator) SetClient(c *Client)

SetClient sets the client attribute of this token generator.

type Step

type Step struct {
	ID     string     `json:"id"`
	Name   string     `json:"name"`
	Status StepStatus `json:"status"`
	Logs   string     `json:"logs"`
}

type StepStatus

type StepStatus string

type Steps

type Steps []Step

type Token

type Token struct {
	ID         string    `json:"id"`
	Name       string    `json:"name"`
	CreatedAt  time.Time `json:"created_at"`
	LastUsedAt time.Time `json:"last_used_at"`
	Token      string    `json:"token"`
}

type TokenCreateParams

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

type TokenRes

type TokenRes struct {
	Token Token `json:"token"`
}

type Tokens

type Tokens []*Token

type TokensRes

type TokensRes struct {
	Tokens Tokens `json:"tokens"`
}

type TokensService

type TokensService interface {
	TokensList(context.Context) (Tokens, error)
	TokenCreate(context.Context, TokenCreateParams) (Token, error)
	TokenExchange(ctx context.Context, token string) (string, error)
	TokenShow(ctx context.Context, id int) (Token, error)
}

type UpdateUserParams

type UpdateUserParams struct {
	Password string `json:"password,omitempty"`
	Email    string `json:"email,omitempty"`
}

type UpdateUserResponse

type UpdateUserResponse struct {
	User *User `json:"user"`
}

type User

type User struct {
	ID       string          `json:"id"`
	Username string          `json:"username"`
	Fullname string          `json:"fullname"`
	Email    string          `json:"email"`
	Flags    map[string]bool `json:"flags"`
}

type UsersService

type UsersService interface {
	Self(context.Context) (*User, error)
	UpdateUser(context.Context, UpdateUserParams) (*User, error)
	UserStopFreeTrial(context.Context) error
}

type Variable

type Variable struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Value string `json:"value"`
}

type VariableSetParams

type VariableSetParams struct {
	Variable *Variable `json:"variable"`
}

type Variables

type Variables []*Variable

func (Variables) Contains

func (vs Variables) Contains(name string) (*Variable, bool)

type VariablesRes

type VariablesRes struct {
	Variables Variables `json:"variables"`
}

type VariablesService

type VariablesService interface {
	VariablesList(ctx context.Context, app string) (Variables, error)
	VariablesListWithoutAlias(ctx context.Context, app string) (Variables, error)
	VariableSet(ctx context.Context, app string, name string, value string) (*Variable, int, error)
	VariableMultipleSet(ctx context.Context, app string, variables Variables) (Variables, int, error)
	VariableUnset(ctx context.Context, app string, id string) error
}

Directories

Path Synopsis
cmd
examples
httpmock
Package httpmock is a generated GoMock package.
Package httpmock is a generated GoMock package.
tokensservicemock
Package tokensservicemock is a generated GoMock package.
Package tokensservicemock is a generated GoMock package.
Package scalingomock is a generated GoMock package.
Package scalingomock is a generated GoMock package.

Jump to

Keyboard shortcuts

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