godo

package module
Version: v1.91.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: BSD-3-Clause, MIT Imports: 20 Imported by: 1,020

README

Godo

Build Status GoDoc

Godo is a Go client library for accessing the DigitalOcean V2 API.

You can view the client API docs here: http://godoc.org/github.com/digitalocean/godo

You can view DigitalOcean API docs here: https://docs.digitalocean.com/reference/api/api-reference/

Install

go get github.com/digitalocean/godo@vX.Y.Z

where X.Y.Z is the version you need.

or

go get github.com/digitalocean/godo

for non Go modules usage or latest version.

Usage

import "github.com/digitalocean/godo"

Create a new DigitalOcean client, then use the exposed services to access different parts of the DigitalOcean API.

Authentication

Currently, Personal Access Token (PAT) is the only method of authenticating with the API. You can manage your tokens at the DigitalOcean Control Panel Applications Page.

You can then use your token to create a new client:

package main

import (
    "github.com/digitalocean/godo"
)

func main() {
    client := godo.NewFromToken("my-digitalocean-api-token")
}

If you need to provide a context.Context to your new client, you should use godo.NewClient to manually construct a client instead.

Examples

To create a new Droplet:

dropletName := "super-cool-droplet"

createRequest := &godo.DropletCreateRequest{
    Name:   dropletName,
    Region: "nyc3",
    Size:   "s-1vcpu-1gb",
    Image: godo.DropletCreateImage{
        Slug: "ubuntu-20-04-x64",
    },
}

ctx := context.TODO()

newDroplet, _, err := client.Droplets.Create(ctx, createRequest)

if err != nil {
    fmt.Printf("Something bad happened: %s\n\n", err)
    return err
}
Pagination

If a list of items is paginated by the API, you must request pages individually. For example, to fetch all Droplets:

func DropletList(ctx context.Context, client *godo.Client) ([]godo.Droplet, error) {
    // create a list to hold our droplets
    list := []godo.Droplet{}

    // create options. initially, these will be blank
    opt := &godo.ListOptions{}
    for {
        droplets, resp, err := client.Droplets.List(ctx, opt)
        if err != nil {
            return nil, err
        }

        // append the current page's droplets to our list
        list = append(list, droplets...)

        // if we are at the last page, break out the for loop
        if resp.Links == nil || resp.Links.IsLastPage() {
            break
        }

        page, err := resp.Links.CurrentPage()
        if err != nil {
            return nil, err
        }

        // set the page we want for the next request
        opt.Page = page + 1
    }

    return list, nil
}

Some endpoints offer token based pagination. For example, to fetch all Registry Repositories:

func ListRepositoriesV2(ctx context.Context, client *godo.Client, registryName string) ([]*godo.RepositoryV2, error) {
    // create a list to hold our registries
    list := []*godo.RepositoryV2{}

    // create options. initially, these will be blank
    opt := &godo.TokenListOptions{}
    for {
        repositories, resp, err := client.Registry.ListRepositoriesV2(ctx, registryName, opt)
        if err != nil {
            return nil, err
        }

        // append the current page's registries to our list
        list = append(list, repositories...)

        // if we are at the last page, break out the for loop
        if resp.Links == nil || resp.Links.IsLastPage() {
            break
        }

        // grab the next page token
        nextPageToken, err := resp.Links.NextPageToken()
        if err != nil {
            return nil, err
        }

        // provide the next page token for the next request
        opt.Token = nextPageToken
    }

    return list, nil
}

Versioning

Each version of the client is tagged and the version is updated accordingly.

To see the list of past versions, run git tag.

Documentation

For a comprehensive list of examples, check out the API documentation.

For details on all the functionality in this library, see the GoDoc documentation.

Contributing

We love pull requests! Please see the contribution guidelines.

Documentation

Overview

Package godo is the DigitalOcean API v2 client for Go.

Index

Constants

View Source
const (

	// ActionInProgress is an in progress action status
	ActionInProgress = "in-progress"

	//ActionCompleted is a completed action status
	ActionCompleted = "completed"
)
View Source
const (
	SQLModeAllowInvalidDates     = "ALLOW_INVALID_DATES"
	SQLModeANSIQuotes            = "ANSI_QUOTES"
	SQLModeHighNotPrecedence     = "HIGH_NOT_PRECEDENCE"
	SQLModeIgnoreSpace           = "IGNORE_SPACE"
	SQLModeNoAuthCreateUser      = "NO_AUTO_CREATE_USER"
	SQLModeNoAutoValueOnZero     = "NO_AUTO_VALUE_ON_ZERO"
	SQLModeNoBackslashEscapes    = "NO_BACKSLASH_ESCAPES"
	SQLModeNoDirInCreate         = "NO_DIR_IN_CREATE"
	SQLModeNoEngineSubstitution  = "NO_ENGINE_SUBSTITUTION"
	SQLModeNoFieldOptions        = "NO_FIELD_OPTIONS"
	SQLModeNoKeyOptions          = "NO_KEY_OPTIONS"
	SQLModeNoTableOptions        = "NO_TABLE_OPTIONS"
	SQLModeNoUnsignedSubtraction = "NO_UNSIGNED_SUBTRACTION"
	SQLModeNoZeroDate            = "NO_ZERO_DATE"
	SQLModeNoZeroInDate          = "NO_ZERO_IN_DATE"
	SQLModeOnlyFullGroupBy       = "ONLY_FULL_GROUP_BY"
	SQLModePadCharToFullLength   = "PAD_CHAR_TO_FULL_LENGTH"
	SQLModePipesAsConcat         = "PIPES_AS_CONCAT"
	SQLModeRealAsFloat           = "REAL_AS_FLOAT"
	SQLModeStrictAllTables       = "STRICT_ALL_TABLES"
	SQLModeStrictTransTables     = "STRICT_TRANS_TABLES"
	SQLModeANSI                  = "ANSI"
	SQLModeDB2                   = "DB2"
	SQLModeMaxDB                 = "MAXDB"
	SQLModeMSSQL                 = "MSSQL"
	SQLModeMYSQL323              = "MYSQL323"
	SQLModeMYSQL40               = "MYSQL40"
	SQLModeOracle                = "ORACLE"
	SQLModePostgreSQL            = "POSTGRESQL"
	SQLModeTraditional           = "TRADITIONAL"
)

SQL Mode constants allow for MySQL-specific SQL flavor configuration.

View Source
const (
	SQLAuthPluginNative      = "mysql_native_password"
	SQLAuthPluginCachingSHA2 = "caching_sha2_password"
)

SQL Auth constants allow for MySQL-specific user auth plugins

View Source
const (
	EvictionPolicyNoEviction     = "noeviction"
	EvictionPolicyAllKeysLRU     = "allkeys_lru"
	EvictionPolicyAllKeysRandom  = "allkeys_random"
	EvictionPolicyVolatileLRU    = "volatile_lru"
	EvictionPolicyVolatileRandom = "volatile_random"
	EvictionPolicyVolatileTTL    = "volatile_ttl"
)

Redis eviction policies supported by the managed Redis product.

View Source
const (
	KubernetesClusterStatusProvisioning = KubernetesClusterStatusState("provisioning")
	KubernetesClusterStatusRunning      = KubernetesClusterStatusState("running")
	KubernetesClusterStatusDegraded     = KubernetesClusterStatusState("degraded")
	KubernetesClusterStatusError        = KubernetesClusterStatusState("error")
	KubernetesClusterStatusDeleted      = KubernetesClusterStatusState("deleted")
	KubernetesClusterStatusUpgrading    = KubernetesClusterStatusState("upgrading")
	KubernetesClusterStatusInvalid      = KubernetesClusterStatusState("invalid")
)

Possible states for a cluster.

View Source
const (
	DropletCPUUtilizationPercent        = "v1/insights/droplet/cpu"
	DropletMemoryUtilizationPercent     = "v1/insights/droplet/memory_utilization_percent"
	DropletDiskUtilizationPercent       = "v1/insights/droplet/disk_utilization_percent"
	DropletPublicOutboundBandwidthRate  = "v1/insights/droplet/public_outbound_bandwidth"
	DropletPublicInboundBandwidthRate   = "v1/insights/droplet/public_inbound_bandwidth"
	DropletPrivateOutboundBandwidthRate = "v1/insights/droplet/private_outbound_bandwidth"
	DropletPrivateInboundBandwidthRate  = "v1/insights/droplet/private_inbound_bandwidth"
	DropletDiskReadRate                 = "v1/insights/droplet/disk_read"
	DropletDiskWriteRate                = "v1/insights/droplet/disk_write"
	DropletOneMinuteLoadAverage         = "v1/insights/droplet/load_1"
	DropletFiveMinuteLoadAverage        = "v1/insights/droplet/load_5"
	DropletFifteenMinuteLoadAverage     = "v1/insights/droplet/load_15"

	LoadBalancerCPUUtilizationPercent             = "v1/insights/lbaas/avg_cpu_utilization_percent"
	LoadBalancerConnectionUtilizationPercent      = "v1/insights/lbaas/connection_utilization_percent"
	LoadBalancerDropletHealth                     = "v1/insights/lbaas/droplet_health"
	LoadBalancerTLSUtilizationPercent             = "v1/insights/lbaas/tls_connections_per_second_utilization_percent"
	LoadBalancerIncreaseInHTTPErrorRatePercentage = "v1/insights/lbaas/increase_in_http_error_rate_percentage"
	LoadBalancerIncreaseInHTTPErrorRateCount      = "v1/insights/lbaas/increase_in_http_error_rate_count"
	LoadBalancerHighHttpResponseTime              = "v1/insights/lbaas/high_http_request_response_time"
	LoadBalancerHighHttpResponseTime50P           = "v1/insights/lbaas/high_http_request_response_time_50p"
	LoadBalancerHighHttpResponseTime95P           = "v1/insights/lbaas/high_http_request_response_time_95p"
	LoadBalancerHighHttpResponseTime99P           = "v1/insights/lbaas/high_http_request_response_time_99p"

	DbaasFifteenMinuteLoadAverage = "v1/dbaas/alerts/load_15_alerts"
	DbaasMemoryUtilizationPercent = "v1/dbaas/alerts/memory_utilization_alerts"
	DbaasDiskUtilizationPercent   = "v1/dbaas/alerts/disk_utilization_alerts"
	DbaasCPUUtilizationPercent    = "v1/dbaas/alerts/cpu_alerts"
)
View Source
const (
	// GCTypeUntaggedManifestsOnly indicates that a garbage collection should
	// only delete untagged manifests.
	GCTypeUntaggedManifestsOnly = GarbageCollectionType("untagged manifests only")
	// GCTypeUnreferencedBlobsOnly indicates that a garbage collection should
	// only delete unreferenced blobs.
	GCTypeUnreferencedBlobsOnly = GarbageCollectionType("unreferenced blobs only")
	// GCTypeUntaggedManifestsAndUnreferencedBlobs indicates that a garbage
	// collection should delete both untagged manifests and unreferenced blobs.
	GCTypeUntaggedManifestsAndUnreferencedBlobs = GarbageCollectionType("untagged manifests and unreferenced blobs")
)
View Source
const (
	// DefaultProject is the ID you should use if you are working with your
	// default project.
	DefaultProject = "default"
)
View Source
const (

	// RegistryServer is the hostname of the DigitalOcean registry service
	RegistryServer = "registry.digitalocean.com"
)

Variables

This section is empty.

Functions

func Bool deprecated

func Bool(v bool) *bool

Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.

Deprecated: Use PtrTo instead.

func CheckResponse

func CheckResponse(r *http.Response) error

CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range. API error responses are expected to have either no response body, or a JSON response body that maps to ErrorResponse. Any other response body will be silently ignored. If the API error response does not include the request ID in its body, the one from its header will be used.

func DoRequest added in v1.2.0

func DoRequest(ctx context.Context, req *http.Request) (*http.Response, error)

DoRequest submits an HTTP request.

func DoRequestWithClient added in v1.2.0

func DoRequestWithClient(
	ctx context.Context,
	client *http.Client,
	req *http.Request) (*http.Response, error)

DoRequestWithClient submits an HTTP request using the specified client.

func ForEachAppSpecComponent added in v1.85.0

func ForEachAppSpecComponent[T any](s *AppSpec, fn func(component T) error) error

ForEachAppSpecComponent loops over each component spec that matches the provided interface type. The type constraint is intentionally set to `any` to allow use of arbitrary interfaces to match the desired component types.

Examples:

  • interface constraint godo.ForEachAppSpecComponent(spec, func(component godo.AppBuildableComponentSpec) error { ... })
  • struct type constraint godo.ForEachAppSpecComponent(spec, func(component *godo.AppStaticSiteSpec) error { ... })

func GetAppSpecComponent added in v1.85.0

func GetAppSpecComponent[T interface {
	GetName() string
}](s *AppSpec, name string) (T, error)

GetAppSpecComponent returns an app spec component by type and name.

Examples:

  • interface constraint godo.GetAppSpecComponent[godo.AppBuildableComponentSpec](spec, "component-name")
  • struct type constraint godo.GetAppSpecComponent[*godo.AppServiceSpec](spec, "component-name")

func Int deprecated

func Int(v int) *int

Int is a helper routine that allocates a new int32 value to store v and returns a pointer to it, but unlike Int32 its argument value is an int.

Deprecated: Use PtrTo instead.

func PtrTo added in v1.90.0

func PtrTo[T any](v T) *T

PtrTo returns a pointer to the provided input.

func StreamToString

func StreamToString(stream io.Reader) string

StreamToString converts a reader to a string

func String deprecated

func String(v string) *string

String is a helper routine that allocates a new string value to store v and returns a pointer to it.

Deprecated: Use PtrTo instead.

func Stringify

func Stringify(message interface{}) string

Stringify attempts to create a string representation of DigitalOcean types

func ToURN added in v1.6.0

func ToURN(resourceType string, id interface{}) string

ToURN converts the resource type and ID to a valid DO API URN.

Types

type Account added in v0.9.0

type Account struct {
	DropletLimit    int       `json:"droplet_limit,omitempty"`
	FloatingIPLimit int       `json:"floating_ip_limit,omitempty"`
	ReservedIPLimit int       `json:"reserved_ip_limit,omitempty"`
	VolumeLimit     int       `json:"volume_limit,omitempty"`
	Email           string    `json:"email,omitempty"`
	UUID            string    `json:"uuid,omitempty"`
	EmailVerified   bool      `json:"email_verified,omitempty"`
	Status          string    `json:"status,omitempty"`
	StatusMessage   string    `json:"status_message,omitempty"`
	Team            *TeamInfo `json:"team,omitempty"`
}

Account represents a DigitalOcean Account

func (Account) String added in v0.9.0

func (r Account) String() string

type AccountService added in v0.9.0

type AccountService interface {
	Get(context.Context) (*Account, *Response, error)
}

AccountService is an interface for interfacing with the Account endpoints of the DigitalOcean API See: https://docs.digitalocean.com/reference/api/api-reference/#tag/Account

type AccountServiceOp added in v0.9.0

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

AccountServiceOp handles communication with the Account related methods of the DigitalOcean API.

func (*AccountServiceOp) Get added in v0.9.0

Get DigitalOcean account info

type Action

type Action struct {
	ID           int        `json:"id"`
	Status       string     `json:"status"`
	Type         string     `json:"type"`
	StartedAt    *Timestamp `json:"started_at"`
	CompletedAt  *Timestamp `json:"completed_at"`
	ResourceID   int        `json:"resource_id"`
	ResourceType string     `json:"resource_type"`
	Region       *Region    `json:"region,omitempty"`
	RegionSlug   string     `json:"region_slug,omitempty"`
}

Action represents a DigitalOcean Action

func (Action) String

func (a Action) String() string

type ActionRequest

type ActionRequest map[string]interface{}

ActionRequest represents DigitalOcean Action Request

type ActionsService

type ActionsService interface {
	List(context.Context, *ListOptions) ([]Action, *Response, error)
	Get(context.Context, int) (*Action, *Response, error)
}

ActionsService handles communication with action related methods of the DigitalOcean API: https://docs.digitalocean.com/reference/api/api-reference/#tag/Actions

type ActionsServiceOp added in v0.3.0

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

ActionsServiceOp handles communication with the image action related methods of the DigitalOcean API.

func (*ActionsServiceOp) Get added in v0.3.0

func (s *ActionsServiceOp) Get(ctx context.Context, id int) (*Action, *Response, error)

Get an action by ID.

func (*ActionsServiceOp) List added in v0.3.0

func (s *ActionsServiceOp) List(ctx context.Context, opt *ListOptions) ([]Action, *Response, error)

List all actions

type Address added in v1.31.0

type Address struct {
	AddressLine1    string    `json:"address_line1"`
	AddressLine2    string    `json:"address_line2"`
	City            string    `json:"city"`
	Region          string    `json:"region"`
	PostalCode      string    `json:"postal_code"`
	CountryISO2Code string    `json:"country_iso2_code"`
	CreatedAt       time.Time `json:"created_at"`
	UpdatedAt       time.Time `json:"updated_at"`
}

Address represents the billing address of a customer

type AlertDestinationUpdateRequest added in v1.65.0

type AlertDestinationUpdateRequest struct {
	Emails        []string                `json:"emails"`
	SlackWebhooks []*AppAlertSlackWebhook `json:"slack_webhooks"`
}

AlertDestinationUpdateRequest represents a request to update alert destinations.

type AlertPolicy added in v1.64.0

type AlertPolicy struct {
	UUID        string          `json:"uuid"`
	Type        string          `json:"type"`
	Description string          `json:"description"`
	Compare     AlertPolicyComp `json:"compare"`
	Value       float32         `json:"value"`
	Window      string          `json:"window"`
	Entities    []string        `json:"entities"`
	Tags        []string        `json:"tags"`
	Alerts      Alerts          `json:"alerts"`
	Enabled     bool            `json:"enabled"`
}

AlertPolicy represents a DigitalOcean alert policy

type AlertPolicyComp added in v1.64.0

type AlertPolicyComp string

AlertPolicyComp represents an alert policy comparison operation

const (
	// GreaterThan is the comparison >
	GreaterThan AlertPolicyComp = "GreaterThan"
	// LessThan is the comparison <
	LessThan AlertPolicyComp = "LessThan"
)

type AlertPolicyCreateRequest added in v1.64.0

type AlertPolicyCreateRequest struct {
	Type        string          `json:"type"`
	Description string          `json:"description"`
	Compare     AlertPolicyComp `json:"compare"`
	Value       float32         `json:"value"`
	Window      string          `json:"window"`
	Entities    []string        `json:"entities"`
	Tags        []string        `json:"tags"`
	Alerts      Alerts          `json:"alerts"`
	Enabled     *bool           `json:"enabled"`
}

AlertPolicyCreateRequest holds the info for creating a new alert policy

type AlertPolicyUpdateRequest added in v1.64.0

type AlertPolicyUpdateRequest struct {
	Type        string          `json:"type"`
	Description string          `json:"description"`
	Compare     AlertPolicyComp `json:"compare"`
	Value       float32         `json:"value"`
	Window      string          `json:"window"`
	Entities    []string        `json:"entities"`
	Tags        []string        `json:"tags"`
	Alerts      Alerts          `json:"alerts"`
	Enabled     *bool           `json:"enabled"`
}

AlertPolicyUpdateRequest holds the info for updating an existing alert policy

type Alerts added in v1.64.0

type Alerts struct {
	Slack []SlackDetails `json:"slack"`
	Email []string       `json:"email"`
}

Alerts represents the alerts section of an alert policy

type App added in v1.39.0

type App struct {
	ID                      string          `json:"id,omitempty"`
	OwnerUUID               string          `json:"owner_uuid,omitempty"`
	Spec                    *AppSpec        `json:"spec"`
	LastDeploymentActiveAt  time.Time       `json:"last_deployment_active_at,omitempty"`
	DefaultIngress          string          `json:"default_ingress,omitempty"`
	CreatedAt               time.Time       `json:"created_at,omitempty"`
	UpdatedAt               time.Time       `json:"updated_at,omitempty"`
	ActiveDeployment        *Deployment     `json:"active_deployment,omitempty"`
	InProgressDeployment    *Deployment     `json:"in_progress_deployment,omitempty"`
	LastDeploymentCreatedAt time.Time       `json:"last_deployment_created_at,omitempty"`
	LiveURL                 string          `json:"live_url,omitempty"`
	Region                  *AppRegion      `json:"region,omitempty"`
	TierSlug                string          `json:"tier_slug,omitempty"`
	LiveURLBase             string          `json:"live_url_base,omitempty"`
	LiveDomain              string          `json:"live_domain,omitempty"`
	Domains                 []*AppDomain    `json:"domains,omitempty"`
	PinnedDeployment        *Deployment     `json:"pinned_deployment,omitempty"`
	BuildConfig             *AppBuildConfig `json:"build_config,omitempty"`
	// The id of the project for the app. This will be empty if there is a lookup failure.
	ProjectID string `json:"project_id,omitempty"`
}

App An application's configuration and status.

func (*App) GetActiveDeployment added in v1.85.0

func (a *App) GetActiveDeployment() *Deployment

GetActiveDeployment returns the ActiveDeployment field.

func (*App) GetBuildConfig added in v1.85.0

func (a *App) GetBuildConfig() *AppBuildConfig

GetBuildConfig returns the BuildConfig field.

func (*App) GetCreatedAt added in v1.85.0

func (a *App) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field.

func (*App) GetDefaultIngress added in v1.85.0

func (a *App) GetDefaultIngress() string

GetDefaultIngress returns the DefaultIngress field.

func (*App) GetDomains added in v1.85.0

func (a *App) GetDomains() []*AppDomain

GetDomains returns the Domains field.

func (*App) GetID added in v1.85.0

func (a *App) GetID() string

GetID returns the ID field.

func (*App) GetInProgressDeployment added in v1.85.0

func (a *App) GetInProgressDeployment() *Deployment

GetInProgressDeployment returns the InProgressDeployment field.

func (*App) GetLastDeploymentActiveAt added in v1.85.0

func (a *App) GetLastDeploymentActiveAt() time.Time

GetLastDeploymentActiveAt returns the LastDeploymentActiveAt field.

func (*App) GetLastDeploymentCreatedAt added in v1.85.0

func (a *App) GetLastDeploymentCreatedAt() time.Time

GetLastDeploymentCreatedAt returns the LastDeploymentCreatedAt field.

func (*App) GetLiveDomain added in v1.85.0

func (a *App) GetLiveDomain() string

GetLiveDomain returns the LiveDomain field.

func (*App) GetLiveURL added in v1.85.0

func (a *App) GetLiveURL() string

GetLiveURL returns the LiveURL field.

func (*App) GetLiveURLBase added in v1.85.0

func (a *App) GetLiveURLBase() string

GetLiveURLBase returns the LiveURLBase field.

func (*App) GetOwnerUUID added in v1.85.0

func (a *App) GetOwnerUUID() string

GetOwnerUUID returns the OwnerUUID field.

func (*App) GetPinnedDeployment added in v1.85.0

func (a *App) GetPinnedDeployment() *Deployment

GetPinnedDeployment returns the PinnedDeployment field.

func (*App) GetProjectID added in v1.88.0

func (a *App) GetProjectID() string

GetProjectID returns the ProjectID field.

func (*App) GetRegion added in v1.85.0

func (a *App) GetRegion() *AppRegion

GetRegion returns the Region field.

func (*App) GetSpec added in v1.85.0

func (a *App) GetSpec() *AppSpec

GetSpec returns the Spec field.

func (*App) GetTierSlug added in v1.85.0

func (a *App) GetTierSlug() string

GetTierSlug returns the TierSlug field.

func (*App) GetUpdatedAt added in v1.85.0

func (a *App) GetUpdatedAt() time.Time

GetUpdatedAt returns the UpdatedAt field.

func (App) URN added in v1.82.0

func (a App) URN() string

URN returns a URN identifier for the app

type AppAlert added in v1.65.0

type AppAlert struct {
	// The ID of the alert. This will be auto-generated by App Platform once the spec is submitted.
	ID string `json:"id,omitempty"`
	// Name of the component this alert applies to.
	ComponentName string        `json:"component_name,omitempty"`
	Spec          *AppAlertSpec `json:"spec,omitempty"`
	// Email destinations for the alert when triggered.
	Emails []string `json:"emails,omitempty"`
	// Slack webhook destinations for the alert when triggered.
	SlackWebhooks []*AppAlertSlackWebhook `json:"slack_webhooks,omitempty"`
	Phase         AppAlertPhase           `json:"phase,omitempty"`
	Progress      *AppAlertProgress       `json:"progress,omitempty"`
}

AppAlert Represents an alert configured for an app or component.

func (*AppAlert) GetComponentName added in v1.85.0

func (a *AppAlert) GetComponentName() string

GetComponentName returns the ComponentName field.

func (*AppAlert) GetEmails added in v1.85.0

func (a *AppAlert) GetEmails() []string

GetEmails returns the Emails field.

func (*AppAlert) GetID added in v1.85.0

func (a *AppAlert) GetID() string

GetID returns the ID field.

func (*AppAlert) GetPhase added in v1.85.0

func (a *AppAlert) GetPhase() AppAlertPhase

GetPhase returns the Phase field.

func (*AppAlert) GetProgress added in v1.85.0

func (a *AppAlert) GetProgress() *AppAlertProgress

GetProgress returns the Progress field.

func (*AppAlert) GetSlackWebhooks added in v1.85.0

func (a *AppAlert) GetSlackWebhooks() []*AppAlertSlackWebhook

GetSlackWebhooks returns the SlackWebhooks field.

func (*AppAlert) GetSpec added in v1.85.0

func (a *AppAlert) GetSpec() *AppAlertSpec

GetSpec returns the Spec field.

type AppAlertPhase added in v1.65.0

type AppAlertPhase string

AppAlertPhase the model 'AppAlertPhase'

const (
	AppAlertPhase_Unknown     AppAlertPhase = "UNKNOWN"
	AppAlertPhase_Pending     AppAlertPhase = "PENDING"
	AppAlertPhase_Configuring AppAlertPhase = "CONFIGURING"
	AppAlertPhase_Active      AppAlertPhase = "ACTIVE"
	AppAlertPhase_Error       AppAlertPhase = "ERROR"
)

List of AppAlertPhase

type AppAlertProgress added in v1.65.0

type AppAlertProgress struct {
	Steps []*AppAlertProgressStep `json:"steps,omitempty"`
}

AppAlertProgress struct for AppAlertProgress

func (*AppAlertProgress) GetSteps added in v1.85.0

func (a *AppAlertProgress) GetSteps() []*AppAlertProgressStep

GetSteps returns the Steps field.

type AppAlertProgressStep added in v1.65.0

type AppAlertProgressStep struct {
	Name      string                      `json:"name,omitempty"`
	Status    AppAlertProgressStepStatus  `json:"status,omitempty"`
	Steps     []*AppAlertProgressStep     `json:"steps,omitempty"`
	StartedAt time.Time                   `json:"started_at,omitempty"`
	EndedAt   time.Time                   `json:"ended_at,omitempty"`
	Reason    *AppAlertProgressStepReason `json:"reason,omitempty"`
}

AppAlertProgressStep struct for AppAlertProgressStep

func (*AppAlertProgressStep) GetEndedAt added in v1.85.0

func (a *AppAlertProgressStep) GetEndedAt() time.Time

GetEndedAt returns the EndedAt field.

func (*AppAlertProgressStep) GetName added in v1.85.0

func (a *AppAlertProgressStep) GetName() string

GetName returns the Name field.

func (*AppAlertProgressStep) GetReason added in v1.85.0

GetReason returns the Reason field.

func (*AppAlertProgressStep) GetStartedAt added in v1.85.0

func (a *AppAlertProgressStep) GetStartedAt() time.Time

GetStartedAt returns the StartedAt field.

func (*AppAlertProgressStep) GetStatus added in v1.85.0

GetStatus returns the Status field.

func (*AppAlertProgressStep) GetSteps added in v1.85.0

func (a *AppAlertProgressStep) GetSteps() []*AppAlertProgressStep

GetSteps returns the Steps field.

type AppAlertProgressStepReason added in v1.65.0

type AppAlertProgressStepReason struct {
	Code    string `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}

AppAlertProgressStepReason struct for AppAlertProgressStepReason

func (*AppAlertProgressStepReason) GetCode added in v1.85.0

func (a *AppAlertProgressStepReason) GetCode() string

GetCode returns the Code field.

func (*AppAlertProgressStepReason) GetMessage added in v1.85.0

func (a *AppAlertProgressStepReason) GetMessage() string

GetMessage returns the Message field.

type AppAlertProgressStepStatus added in v1.65.0

type AppAlertProgressStepStatus string

AppAlertProgressStepStatus the model 'AppAlertProgressStepStatus'

const (
	AppAlertProgressStepStatus_Unknown AppAlertProgressStepStatus = "UNKNOWN"
	AppAlertProgressStepStatus_Pending AppAlertProgressStepStatus = "PENDING"
	AppAlertProgressStepStatus_Running AppAlertProgressStepStatus = "RUNNING"
	AppAlertProgressStepStatus_Error   AppAlertProgressStepStatus = "ERROR"
	AppAlertProgressStepStatus_Success AppAlertProgressStepStatus = "SUCCESS"
)

List of AppAlertProgressStepStatus

type AppAlertSlackWebhook added in v1.65.0

type AppAlertSlackWebhook struct {
	// URL for the Slack webhook. The value will be encrypted on the app spec after it is submitted.
	URL string `json:"url,omitempty"`
	// Name of the Slack channel.
	Channel string `json:"channel,omitempty"`
}

AppAlertSlackWebhook Configuration of a Slack alerting destination.

func (*AppAlertSlackWebhook) GetChannel added in v1.85.0

func (a *AppAlertSlackWebhook) GetChannel() string

GetChannel returns the Channel field.

func (*AppAlertSlackWebhook) GetURL added in v1.85.0

func (a *AppAlertSlackWebhook) GetURL() string

GetURL returns the URL field.

type AppAlertSpec added in v1.65.0

type AppAlertSpec struct {
	Rule AppAlertSpecRule `json:"rule,omitempty"`
	// Determines whether or not the alert is disabled.
	Disabled bool                 `json:"disabled,omitempty"`
	Operator AppAlertSpecOperator `json:"operator,omitempty"`
	// The meaning is dependent upon the rule. It is used in conjunction with the operator and window to determine when an alert should trigger.
	Value  float32            `json:"value,omitempty"`
	Window AppAlertSpecWindow `json:"window,omitempty"`
}

AppAlertSpec Configuration of an alert for the app or a individual component.

func (*AppAlertSpec) GetDisabled added in v1.85.0

func (a *AppAlertSpec) GetDisabled() bool

GetDisabled returns the Disabled field.

func (*AppAlertSpec) GetOperator added in v1.85.0

func (a *AppAlertSpec) GetOperator() AppAlertSpecOperator

GetOperator returns the Operator field.

func (*AppAlertSpec) GetRule added in v1.85.0

func (a *AppAlertSpec) GetRule() AppAlertSpecRule

GetRule returns the Rule field.

func (*AppAlertSpec) GetValue added in v1.85.0

func (a *AppAlertSpec) GetValue() float32

GetValue returns the Value field.

func (*AppAlertSpec) GetWindow added in v1.85.0

func (a *AppAlertSpec) GetWindow() AppAlertSpecWindow

GetWindow returns the Window field.

type AppAlertSpecOperator added in v1.65.0

type AppAlertSpecOperator string

AppAlertSpecOperator the model 'AppAlertSpecOperator'

const (
	AppAlertSpecOperator_UnspecifiedOperator AppAlertSpecOperator = "UNSPECIFIED_OPERATOR"
	AppAlertSpecOperator_GreaterThan         AppAlertSpecOperator = "GREATER_THAN"
	AppAlertSpecOperator_LessThan            AppAlertSpecOperator = "LESS_THAN"
)

List of AppAlertSpecOperator

type AppAlertSpecRule added in v1.65.0

type AppAlertSpecRule string

AppAlertSpecRule - CPU_UTILIZATION: Represents CPU for a given container instance. Only applicable at the component level. - MEM_UTILIZATION: Represents RAM for a given container instance. Only applicable at the component level. - RESTART_COUNT: Represents restart count for a given container instance. Only applicable at the component level. - DEPLOYMENT_FAILED: Represents whether a deployment has failed. Only applicable at the app level. - DEPLOYMENT_LIVE: Represents whether a deployment has succeeded. Only applicable at the app level. - DOMAIN_FAILED: Represents whether a domain configuration has failed. Only applicable at the app level. - DOMAIN_LIVE: Represents whether a domain configuration has succeeded. Only applicable at the app level. - FUNCTIONS_ACTIVATION_COUNT: Represents an activation count for a given functions instance. Only applicable to functions components. - FUNCTIONS_AVERAGE_DURATION_MS: Represents the average duration for function runtimes. Only applicable to functions components. - FUNCTIONS_ERROR_RATE_PER_MINUTE: Represents an error rate per minute for a given functions instance. Only applicable to functions components. - FUNCTIONS_AVERAGE_WAIT_TIME_MS: Represents the average wait time for functions. Only applicable to functions components. - FUNCTIONS_ERROR_COUNT: Represents an error count for a given functions instance. Only applicable to functions components. - FUNCTIONS_GB_RATE_PER_SECOND: Represents the rate of memory consumption (GB x seconds) for functions. Only applicable to functions components.

const (
	AppAlertSpecRule_UnspecifiedRule             AppAlertSpecRule = "UNSPECIFIED_RULE"
	AppAlertSpecRule_CPUUtilization              AppAlertSpecRule = "CPU_UTILIZATION"
	AppAlertSpecRule_MemUtilization              AppAlertSpecRule = "MEM_UTILIZATION"
	AppAlertSpecRule_RestartCount                AppAlertSpecRule = "RESTART_COUNT"
	AppAlertSpecRule_DeploymentFailed            AppAlertSpecRule = "DEPLOYMENT_FAILED"
	AppAlertSpecRule_DeploymentLive              AppAlertSpecRule = "DEPLOYMENT_LIVE"
	AppAlertSpecRule_DomainFailed                AppAlertSpecRule = "DOMAIN_FAILED"
	AppAlertSpecRule_DomainLive                  AppAlertSpecRule = "DOMAIN_LIVE"
	AppAlertSpecRule_FunctionsActivationCount    AppAlertSpecRule = "FUNCTIONS_ACTIVATION_COUNT"
	AppAlertSpecRule_FunctionsAverageDurationMS  AppAlertSpecRule = "FUNCTIONS_AVERAGE_DURATION_MS"
	AppAlertSpecRule_FunctionsErrorRatePerMinute AppAlertSpecRule = "FUNCTIONS_ERROR_RATE_PER_MINUTE"
	AppAlertSpecRule_FunctionsAverageWaitTimeMs  AppAlertSpecRule = "FUNCTIONS_AVERAGE_WAIT_TIME_MS"
	AppAlertSpecRule_FunctionsErrorCount         AppAlertSpecRule = "FUNCTIONS_ERROR_COUNT"
	AppAlertSpecRule_FunctionsGBRatePerSecond    AppAlertSpecRule = "FUNCTIONS_GB_RATE_PER_SECOND"
)

List of AppAlertSpecRule

type AppAlertSpecWindow added in v1.65.0

type AppAlertSpecWindow string

AppAlertSpecWindow the model 'AppAlertSpecWindow'

const (
	AppAlertSpecWindow_UnspecifiedWindow AppAlertSpecWindow = "UNSPECIFIED_WINDOW"
	AppAlertSpecWindow_FiveMinutes       AppAlertSpecWindow = "FIVE_MINUTES"
	AppAlertSpecWindow_TenMinutes        AppAlertSpecWindow = "TEN_MINUTES"
	AppAlertSpecWindow_ThirtyMinutes     AppAlertSpecWindow = "THIRTY_MINUTES"
	AppAlertSpecWindow_OneHour           AppAlertSpecWindow = "ONE_HOUR"
)

List of AppAlertSpecWindow

type AppBuildConfig added in v1.85.0

type AppBuildConfig struct {
	CNBVersioning *AppBuildConfigCNBVersioning `json:"cnb_versioning,omitempty"`
}

AppBuildConfig struct for AppBuildConfig

func (*AppBuildConfig) GetCNBVersioning added in v1.85.0

func (a *AppBuildConfig) GetCNBVersioning() *AppBuildConfigCNBVersioning

GetCNBVersioning returns the CNBVersioning field.

type AppBuildConfigCNBVersioning added in v1.85.0

type AppBuildConfigCNBVersioning struct {
	// List of versioned buildpacks used for the application.  Buildpacks are only versioned based on the major semver version, therefore exact versions will not be available at the app build config.
	Buildpacks []*Buildpack `json:"buildpacks,omitempty"`
}

AppBuildConfigCNBVersioning struct for AppBuildConfigCNBVersioning

func (*AppBuildConfigCNBVersioning) GetBuildpacks added in v1.85.0

func (a *AppBuildConfigCNBVersioning) GetBuildpacks() []*Buildpack

GetBuildpacks returns the Buildpacks field.

type AppBuildableComponentSpec added in v1.85.0

type AppBuildableComponentSpec interface {
	AppComponentSpec

	GetGit() *GitSourceSpec
	GetGitHub() *GitHubSourceSpec
	GetGitLab() *GitLabSourceSpec

	GetSourceDir() string

	GetEnvs() []*AppVariableDefinition
}

AppBuildableComponentSpec is a component that is buildable from source.

type AppCNBBuildableComponentSpec added in v1.85.0

type AppCNBBuildableComponentSpec interface {
	AppBuildableComponentSpec

	GetBuildCommand() string
}

AppCNBBuildableComponentSpec is a component that is buildable from source using cloud native buildpacks.

type AppCORSPolicy added in v1.48.0

type AppCORSPolicy struct {
	// The set of allowed CORS origins. This configures the Access-Control-Allow-Origin header.
	AllowOrigins []*AppStringMatch `json:"allow_origins,omitempty"`
	// The set of allowed HTTP methods. This configures the Access-Control-Allow-Methods header.
	AllowMethods []string `json:"allow_methods,omitempty"`
	// The set of allowed HTTP request headers. This configures the Access-Control-Allow-Headers header.
	AllowHeaders []string `json:"allow_headers,omitempty"`
	// The set of HTTP response headers that browsers are allowed to access. This configures the Access-Control-Expose-Headers  header.
	ExposeHeaders []string `json:"expose_headers,omitempty"`
	// An optional duration specifying how long browsers can cache the results of a preflight request. This configures the Access-Control-Max-Age header. Example: `5h30m`.
	MaxAge string `json:"max_age,omitempty"`
	// Whether browsers should expose the response to the client-side JavaScript code when the request's credentials mode is `include`. This configures the Access-Control-Allow-Credentials header.
	AllowCredentials bool `json:"allow_credentials,omitempty"`
}

AppCORSPolicy struct for AppCORSPolicy

func (*AppCORSPolicy) GetAllowCredentials added in v1.85.0

func (a *AppCORSPolicy) GetAllowCredentials() bool

GetAllowCredentials returns the AllowCredentials field.

func (*AppCORSPolicy) GetAllowHeaders added in v1.85.0

func (a *AppCORSPolicy) GetAllowHeaders() []string

GetAllowHeaders returns the AllowHeaders field.

func (*AppCORSPolicy) GetAllowMethods added in v1.85.0

func (a *AppCORSPolicy) GetAllowMethods() []string

GetAllowMethods returns the AllowMethods field.

func (*AppCORSPolicy) GetAllowOrigins added in v1.85.0

func (a *AppCORSPolicy) GetAllowOrigins() []*AppStringMatch

GetAllowOrigins returns the AllowOrigins field.

func (*AppCORSPolicy) GetExposeHeaders added in v1.85.0

func (a *AppCORSPolicy) GetExposeHeaders() []string

GetExposeHeaders returns the ExposeHeaders field.

func (*AppCORSPolicy) GetMaxAge added in v1.85.0

func (a *AppCORSPolicy) GetMaxAge() string

GetMaxAge returns the MaxAge field.

type AppComponentSpec added in v1.85.0

type AppComponentSpec interface {
	GetName() string
	GetType() AppComponentType
}

AppComponentSpec represents a component's spec.

type AppComponentType added in v1.85.0

type AppComponentType string

AppComponentType is an app component type.

const (
	// AppComponentTypeService is the type for a service component.
	AppComponentTypeService AppComponentType = "service"
	// AppComponentTypeWorker is the type for a worker component.
	AppComponentTypeWorker AppComponentType = "worker"
	// AppComponentTypeJob is the type for a job component.
	AppComponentTypeJob AppComponentType = "job"
	// AppComponentTypeStaticSite is the type for a static site component.
	AppComponentTypeStaticSite AppComponentType = "static_site"
	// AppComponentTypeDatabase is the type for a database component.
	AppComponentTypeDatabase AppComponentType = "database"
	// AppComponentTypeFunctions is the type for a functions component.
	AppComponentTypeFunctions AppComponentType = "functions"
)

type AppContainerComponentSpec added in v1.85.0

type AppContainerComponentSpec interface {
	AppBuildableComponentSpec

	GetImage() *ImageSourceSpec
	GetRunCommand() string
	GetInstanceSizeSlug() string
	GetInstanceCount() int64
}

AppContainerComponentSpec is a component that runs in a cluster.

type AppCreateRequest added in v1.39.0

type AppCreateRequest struct {
	Spec *AppSpec `json:"spec"`
	// Optional. The UUID of the project the app should be assigned.
	ProjectID string `json:"project_id,omitempty"`
}

AppCreateRequest struct for AppCreateRequest

func (*AppCreateRequest) GetProjectID added in v1.88.0

func (a *AppCreateRequest) GetProjectID() string

GetProjectID returns the ProjectID field.

func (*AppCreateRequest) GetSpec added in v1.85.0

func (a *AppCreateRequest) GetSpec() *AppSpec

GetSpec returns the Spec field.

type AppDatabaseSpec added in v1.39.0

type AppDatabaseSpec struct {
	// The name. Must be unique across all components within the same app.
	Name    string                `json:"name"`
	Engine  AppDatabaseSpecEngine `json:"engine,omitempty"`
	Version string                `json:"version,omitempty"`
	// Deprecated.
	Size string `json:"size,omitempty"`
	// Deprecated.
	NumNodes int64 `json:"num_nodes,omitempty"`
	// Whether this is a production or dev database.
	Production bool `json:"production,omitempty"`
	// The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, a new cluster will be provisioned.
	ClusterName string `json:"cluster_name,omitempty"`
	// The name of the MySQL or PostgreSQL database to configure.
	DBName string `json:"db_name,omitempty"`
	// The name of the MySQL or PostgreSQL user to configure.
	DBUser string `json:"db_user,omitempty"`
}

AppDatabaseSpec struct for AppDatabaseSpec

func (*AppDatabaseSpec) GetClusterName added in v1.85.0

func (a *AppDatabaseSpec) GetClusterName() string

GetClusterName returns the ClusterName field.

func (*AppDatabaseSpec) GetDBName added in v1.85.0

func (a *AppDatabaseSpec) GetDBName() string

GetDBName returns the DBName field.

func (*AppDatabaseSpec) GetDBUser added in v1.85.0

func (a *AppDatabaseSpec) GetDBUser() string

GetDBUser returns the DBUser field.

func (*AppDatabaseSpec) GetEngine added in v1.85.0

func (a *AppDatabaseSpec) GetEngine() AppDatabaseSpecEngine

GetEngine returns the Engine field.

func (*AppDatabaseSpec) GetName added in v1.85.0

func (a *AppDatabaseSpec) GetName() string

GetName returns the Name field.

func (*AppDatabaseSpec) GetNumNodes added in v1.85.0

func (a *AppDatabaseSpec) GetNumNodes() int64

GetNumNodes returns the NumNodes field.

func (*AppDatabaseSpec) GetProduction added in v1.85.0

func (a *AppDatabaseSpec) GetProduction() bool

GetProduction returns the Production field.

func (*AppDatabaseSpec) GetSize added in v1.85.0

func (a *AppDatabaseSpec) GetSize() string

GetSize returns the Size field.

func (*AppDatabaseSpec) GetType added in v1.85.0

func (s *AppDatabaseSpec) GetType() AppComponentType

GetType returns the Database component type.

func (*AppDatabaseSpec) GetVersion added in v1.85.0

func (a *AppDatabaseSpec) GetVersion() string

GetVersion returns the Version field.

type AppDatabaseSpecEngine added in v1.39.0

type AppDatabaseSpecEngine string

AppDatabaseSpecEngine the model 'AppDatabaseSpecEngine'

const (
	AppDatabaseSpecEngine_Unset   AppDatabaseSpecEngine = "UNSET"
	AppDatabaseSpecEngine_MySQL   AppDatabaseSpecEngine = "MYSQL"
	AppDatabaseSpecEngine_PG      AppDatabaseSpecEngine = "PG"
	AppDatabaseSpecEngine_Redis   AppDatabaseSpecEngine = "REDIS"
	AppDatabaseSpecEngine_MongoDB AppDatabaseSpecEngine = "MONGODB"
)

List of AppDatabaseSpecEngine

type AppDockerBuildableComponentSpec added in v1.85.0

type AppDockerBuildableComponentSpec interface {
	AppBuildableComponentSpec

	GetDockerfilePath() string
}

AppDockerBuildableComponentSpec is a component that is buildable from source using Docker.

type AppDomain added in v1.56.0

type AppDomain struct {
	ID                      string                 `json:"id,omitempty"`
	Spec                    *AppDomainSpec         `json:"spec,omitempty"`
	Phase                   AppDomainPhase         `json:"phase,omitempty"`
	Progress                *AppDomainProgress     `json:"progress,omitempty"`
	Validation              *AppDomainValidation   `json:"validation,omitempty"`
	Validations             []*AppDomainValidation `json:"validations,omitempty"`
	RotateValidationRecords bool                   `json:"rotate_validation_records,omitempty"`
	CertificateExpiresAt    time.Time              `json:"certificate_expires_at,omitempty"`
}

AppDomain struct for AppDomain

func (*AppDomain) GetCertificateExpiresAt added in v1.85.0

func (a *AppDomain) GetCertificateExpiresAt() time.Time

GetCertificateExpiresAt returns the CertificateExpiresAt field.

func (*AppDomain) GetID added in v1.85.0

func (a *AppDomain) GetID() string

GetID returns the ID field.

func (*AppDomain) GetPhase added in v1.85.0

func (a *AppDomain) GetPhase() AppDomainPhase

GetPhase returns the Phase field.

func (*AppDomain) GetProgress added in v1.85.0

func (a *AppDomain) GetProgress() *AppDomainProgress

GetProgress returns the Progress field.

func (*AppDomain) GetRotateValidationRecords added in v1.85.0

func (a *AppDomain) GetRotateValidationRecords() bool

GetRotateValidationRecords returns the RotateValidationRecords field.

func (*AppDomain) GetSpec added in v1.85.0

func (a *AppDomain) GetSpec() *AppDomainSpec

GetSpec returns the Spec field.

func (*AppDomain) GetValidation added in v1.85.0

func (a *AppDomain) GetValidation() *AppDomainValidation

GetValidation returns the Validation field.

func (*AppDomain) GetValidations added in v1.85.0

func (a *AppDomain) GetValidations() []*AppDomainValidation

GetValidations returns the Validations field.

type AppDomainPhase added in v1.56.0

type AppDomainPhase string

AppDomainPhase the model 'AppDomainPhase'

const (
	AppJobSpecKindPHASE_Unknown     AppDomainPhase = "UNKNOWN"
	AppJobSpecKindPHASE_Pending     AppDomainPhase = "PENDING"
	AppJobSpecKindPHASE_Configuring AppDomainPhase = "CONFIGURING"
	AppJobSpecKindPHASE_Active      AppDomainPhase = "ACTIVE"
	AppJobSpecKindPHASE_Error       AppDomainPhase = "ERROR"
)

List of AppDomainPhase

type AppDomainProgress added in v1.56.0

type AppDomainProgress struct {
	Steps []*AppDomainProgressStep `json:"steps,omitempty"`
}

AppDomainProgress struct for AppDomainProgress

func (*AppDomainProgress) GetSteps added in v1.85.0

func (a *AppDomainProgress) GetSteps() []*AppDomainProgressStep

GetSteps returns the Steps field.

type AppDomainProgressStep added in v1.56.0

type AppDomainProgressStep struct {
	Name      string                       `json:"name,omitempty"`
	Status    AppDomainProgressStepStatus  `json:"status,omitempty"`
	Steps     []*AppDomainProgressStep     `json:"steps,omitempty"`
	StartedAt time.Time                    `json:"started_at,omitempty"`
	EndedAt   time.Time                    `json:"ended_at,omitempty"`
	Reason    *AppDomainProgressStepReason `json:"reason,omitempty"`
}

AppDomainProgressStep struct for AppDomainProgressStep

func (*AppDomainProgressStep) GetEndedAt added in v1.85.0

func (a *AppDomainProgressStep) GetEndedAt() time.Time

GetEndedAt returns the EndedAt field.

func (*AppDomainProgressStep) GetName added in v1.85.0

func (a *AppDomainProgressStep) GetName() string

GetName returns the Name field.

func (*AppDomainProgressStep) GetReason added in v1.85.0

GetReason returns the Reason field.

func (*AppDomainProgressStep) GetStartedAt added in v1.85.0

func (a *AppDomainProgressStep) GetStartedAt() time.Time

GetStartedAt returns the StartedAt field.

func (*AppDomainProgressStep) GetStatus added in v1.85.0

GetStatus returns the Status field.

func (*AppDomainProgressStep) GetSteps added in v1.85.0

GetSteps returns the Steps field.

type AppDomainProgressStepReason added in v1.56.0

type AppDomainProgressStepReason struct {
	Code    string `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}

AppDomainProgressStepReason struct for AppDomainProgressStepReason

func (*AppDomainProgressStepReason) GetCode added in v1.85.0

func (a *AppDomainProgressStepReason) GetCode() string

GetCode returns the Code field.

func (*AppDomainProgressStepReason) GetMessage added in v1.85.0

func (a *AppDomainProgressStepReason) GetMessage() string

GetMessage returns the Message field.

type AppDomainProgressStepStatus added in v1.56.0

type AppDomainProgressStepStatus string

AppDomainProgressStepStatus the model 'AppDomainProgressStepStatus'

const (
	AppJobSpecKindProgressStepStatus_Unknown AppDomainProgressStepStatus = "UNKNOWN"
	AppJobSpecKindProgressStepStatus_Pending AppDomainProgressStepStatus = "PENDING"
	AppJobSpecKindProgressStepStatus_Running AppDomainProgressStepStatus = "RUNNING"
	AppJobSpecKindProgressStepStatus_Error   AppDomainProgressStepStatus = "ERROR"
	AppJobSpecKindProgressStepStatus_Success AppDomainProgressStepStatus = "SUCCESS"
)

List of AppDomainProgressStepStatus

type AppDomainSpec added in v1.39.0

type AppDomainSpec struct {
	Domain   string            `json:"domain"`
	Type     AppDomainSpecType `json:"type,omitempty"`
	Wildcard bool              `json:"wildcard,omitempty"`
	// Optional. If the domain uses DigitalOcean DNS and you would like App Platform to automatically manage it for you, set this to the name of the domain on your account.  For example, If the domain you are adding is `app.domain.com`, the zone could be `domain.com`.
	Zone        string `json:"zone,omitempty"`
	Certificate string `json:"certificate,omitempty"`
	// Optional. The minimum version of TLS a client application can use to access resources for the domain.  Must be one of the following values wrapped within quotations: `\"1.2\"` or `\"1.3\"`.
	MinimumTLSVersion string `json:"minimum_tls_version,omitempty"`
}

AppDomainSpec struct for AppDomainSpec

func (*AppDomainSpec) GetCertificate added in v1.85.0

func (a *AppDomainSpec) GetCertificate() string

GetCertificate returns the Certificate field.

func (*AppDomainSpec) GetDomain added in v1.85.0

func (a *AppDomainSpec) GetDomain() string

GetDomain returns the Domain field.

func (*AppDomainSpec) GetMinimumTLSVersion added in v1.85.0

func (a *AppDomainSpec) GetMinimumTLSVersion() string

GetMinimumTLSVersion returns the MinimumTLSVersion field.

func (*AppDomainSpec) GetType added in v1.85.0

func (a *AppDomainSpec) GetType() AppDomainSpecType

GetType returns the Type field.

func (*AppDomainSpec) GetWildcard added in v1.85.0

func (a *AppDomainSpec) GetWildcard() bool

GetWildcard returns the Wildcard field.

func (*AppDomainSpec) GetZone added in v1.85.0

func (a *AppDomainSpec) GetZone() string

GetZone returns the Zone field.

type AppDomainSpecType added in v1.43.0

type AppDomainSpecType string

AppDomainSpecType the model 'AppDomainSpecType'

const (
	AppDomainSpecType_Unspecified AppDomainSpecType = "UNSPECIFIED"
	AppDomainSpecType_Default     AppDomainSpecType = "DEFAULT"
	AppDomainSpecType_Primary     AppDomainSpecType = "PRIMARY"
	AppDomainSpecType_Alias       AppDomainSpecType = "ALIAS"
)

List of AppDomainSpecType

type AppDomainValidation added in v1.75.0

type AppDomainValidation struct {
	TXTName  string `json:"txt_name,omitempty"`
	TXTValue string `json:"txt_value,omitempty"`
}

AppDomainValidation struct for AppDomainValidation

func (*AppDomainValidation) GetTXTName added in v1.85.0

func (a *AppDomainValidation) GetTXTName() string

GetTXTName returns the TXTName field.

func (*AppDomainValidation) GetTXTValue added in v1.85.0

func (a *AppDomainValidation) GetTXTValue() string

GetTXTValue returns the TXTValue field.

type AppFunctionsSpec added in v1.74.0

type AppFunctionsSpec struct {
	// The name. Must be unique across all components within the same app.
	Name   string            `json:"name"`
	Git    *GitSourceSpec    `json:"git,omitempty"`
	GitHub *GitHubSourceSpec `json:"github,omitempty"`
	GitLab *GitLabSourceSpec `json:"gitlab,omitempty"`
	// An optional path to the working directory to use for the build. Must be relative to the root of the repo.
	SourceDir string `json:"source_dir,omitempty"`
	// A list of environment variables made available to the component.
	Envs []*AppVariableDefinition `json:"envs,omitempty"`
	// A list of HTTP routes that should be routed to this component.
	Routes []*AppRouteSpec `json:"routes,omitempty"`
	// A list of configured alerts the user has enabled.
	Alerts []*AppAlertSpec `json:"alerts,omitempty"`
	// A list of configured log forwarding destinations.
	LogDestinations []*AppLogDestinationSpec `json:"log_destinations,omitempty"`
	CORS            *AppCORSPolicy           `json:"cors,omitempty"`
}

AppFunctionsSpec struct for AppFunctionsSpec

func (*AppFunctionsSpec) GetAlerts added in v1.85.0

func (a *AppFunctionsSpec) GetAlerts() []*AppAlertSpec

GetAlerts returns the Alerts field.

func (*AppFunctionsSpec) GetCORS added in v1.85.0

func (a *AppFunctionsSpec) GetCORS() *AppCORSPolicy

GetCORS returns the CORS field.

func (*AppFunctionsSpec) GetEnvs added in v1.85.0

func (a *AppFunctionsSpec) GetEnvs() []*AppVariableDefinition

GetEnvs returns the Envs field.

func (*AppFunctionsSpec) GetGit added in v1.85.0

func (a *AppFunctionsSpec) GetGit() *GitSourceSpec

GetGit returns the Git field.

func (*AppFunctionsSpec) GetGitHub added in v1.85.0

func (a *AppFunctionsSpec) GetGitHub() *GitHubSourceSpec

GetGitHub returns the GitHub field.

func (*AppFunctionsSpec) GetGitLab added in v1.85.0

func (a *AppFunctionsSpec) GetGitLab() *GitLabSourceSpec

GetGitLab returns the GitLab field.

func (*AppFunctionsSpec) GetLogDestinations added in v1.85.0

func (a *AppFunctionsSpec) GetLogDestinations() []*AppLogDestinationSpec

GetLogDestinations returns the LogDestinations field.

func (*AppFunctionsSpec) GetName added in v1.85.0

func (a *AppFunctionsSpec) GetName() string

GetName returns the Name field.

func (*AppFunctionsSpec) GetRoutes added in v1.85.0

func (a *AppFunctionsSpec) GetRoutes() []*AppRouteSpec

GetRoutes returns the Routes field.

func (*AppFunctionsSpec) GetSourceDir added in v1.85.0

func (a *AppFunctionsSpec) GetSourceDir() string

GetSourceDir returns the SourceDir field.

func (*AppFunctionsSpec) GetType added in v1.85.0

func (s *AppFunctionsSpec) GetType() AppComponentType

GetType returns the Functions component type.

type AppIngressSpec added in v1.77.0

type AppIngressSpec struct {
	LoadBalancer     AppIngressSpecLoadBalancer `json:"load_balancer,omitempty"`
	LoadBalancerSize int64                      `json:"load_balancer_size,omitempty"`
}

AppIngressSpec struct for AppIngressSpec

func (*AppIngressSpec) GetLoadBalancer added in v1.85.0

func (a *AppIngressSpec) GetLoadBalancer() AppIngressSpecLoadBalancer

GetLoadBalancer returns the LoadBalancer field.

func (*AppIngressSpec) GetLoadBalancerSize added in v1.85.0

func (a *AppIngressSpec) GetLoadBalancerSize() int64

GetLoadBalancerSize returns the LoadBalancerSize field.

type AppIngressSpecLoadBalancer added in v1.77.0

type AppIngressSpecLoadBalancer string

AppIngressSpecLoadBalancer the model 'AppIngressSpecLoadBalancer'

const (
	AppIngressSpecLoadBalancer_Unknown      AppIngressSpecLoadBalancer = "UNKNOWN"
	AppIngressSpecLoadBalancer_DigitalOcean AppIngressSpecLoadBalancer = "DIGITALOCEAN"
)

List of AppIngressSpecLoadBalancer

type AppInstanceSize added in v1.48.0

type AppInstanceSize struct {
	Name            string                 `json:"name,omitempty"`
	Slug            string                 `json:"slug,omitempty"`
	CPUType         AppInstanceSizeCPUType `json:"cpu_type,omitempty"`
	CPUs            string                 `json:"cpus,omitempty"`
	MemoryBytes     string                 `json:"memory_bytes,omitempty"`
	USDPerMonth     string                 `json:"usd_per_month,omitempty"`
	USDPerSecond    string                 `json:"usd_per_second,omitempty"`
	TierSlug        string                 `json:"tier_slug,omitempty"`
	TierUpgradeTo   string                 `json:"tier_upgrade_to,omitempty"`
	TierDowngradeTo string                 `json:"tier_downgrade_to,omitempty"`
}

AppInstanceSize struct for AppInstanceSize

func (*AppInstanceSize) GetCPUType added in v1.85.0

func (a *AppInstanceSize) GetCPUType() AppInstanceSizeCPUType

GetCPUType returns the CPUType field.

func (*AppInstanceSize) GetCPUs added in v1.85.0

func (a *AppInstanceSize) GetCPUs() string

GetCPUs returns the CPUs field.

func (*AppInstanceSize) GetMemoryBytes added in v1.85.0

func (a *AppInstanceSize) GetMemoryBytes() string

GetMemoryBytes returns the MemoryBytes field.

func (*AppInstanceSize) GetName added in v1.85.0

func (a *AppInstanceSize) GetName() string

GetName returns the Name field.

func (*AppInstanceSize) GetSlug added in v1.85.0

func (a *AppInstanceSize) GetSlug() string

GetSlug returns the Slug field.

func (*AppInstanceSize) GetTierDowngradeTo added in v1.85.0

func (a *AppInstanceSize) GetTierDowngradeTo() string

GetTierDowngradeTo returns the TierDowngradeTo field.

func (*AppInstanceSize) GetTierSlug added in v1.85.0

func (a *AppInstanceSize) GetTierSlug() string

GetTierSlug returns the TierSlug field.

func (*AppInstanceSize) GetTierUpgradeTo added in v1.85.0

func (a *AppInstanceSize) GetTierUpgradeTo() string

GetTierUpgradeTo returns the TierUpgradeTo field.

func (*AppInstanceSize) GetUSDPerMonth added in v1.85.0

func (a *AppInstanceSize) GetUSDPerMonth() string

GetUSDPerMonth returns the USDPerMonth field.

func (*AppInstanceSize) GetUSDPerSecond added in v1.85.0

func (a *AppInstanceSize) GetUSDPerSecond() string

GetUSDPerSecond returns the USDPerSecond field.

type AppInstanceSizeCPUType added in v1.48.0

type AppInstanceSizeCPUType string

AppInstanceSizeCPUType the model 'AppInstanceSizeCPUType'

const (
	AppInstanceSizeCPUType_Unspecified AppInstanceSizeCPUType = "UNSPECIFIED"
	AppInstanceSizeCPUType_Shared      AppInstanceSizeCPUType = "SHARED"
	AppInstanceSizeCPUType_Dedicated   AppInstanceSizeCPUType = "DEDICATED"
)

List of AppInstanceSizeCPUType

type AppJobSpec added in v1.43.0

type AppJobSpec struct {
	// The name. Must be unique across all components within the same app.
	Name   string            `json:"name"`
	Git    *GitSourceSpec    `json:"git,omitempty"`
	GitHub *GitHubSourceSpec `json:"github,omitempty"`
	Image  *ImageSourceSpec  `json:"image,omitempty"`
	GitLab *GitLabSourceSpec `json:"gitlab,omitempty"`
	// The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
	DockerfilePath string `json:"dockerfile_path,omitempty"`
	// An optional build command to run while building this component from source.
	BuildCommand string `json:"build_command,omitempty"`
	// An optional run command to override the component's default.
	RunCommand string `json:"run_command,omitempty"`
	// An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
	SourceDir string `json:"source_dir,omitempty"`
	// An environment slug describing the type of this app. For a full list, please refer to [the product documentation](https://www.digitalocean.com/docs/app-platform/).
	EnvironmentSlug string `json:"environment_slug,omitempty"`
	// A list of environment variables made available to the component.
	Envs []*AppVariableDefinition `json:"envs,omitempty"`
	// The instance size to use for this component.
	InstanceSizeSlug string         `json:"instance_size_slug,omitempty"`
	InstanceCount    int64          `json:"instance_count,omitempty"`
	Kind             AppJobSpecKind `json:"kind,omitempty"`
	// A list of configured alerts which apply to the component.
	Alerts []*AppAlertSpec `json:"alerts,omitempty"`
	// A list of configured log forwarding destinations.
	LogDestinations []*AppLogDestinationSpec `json:"log_destinations,omitempty"`
}

AppJobSpec struct for AppJobSpec

func (*AppJobSpec) GetAlerts added in v1.85.0

func (a *AppJobSpec) GetAlerts() []*AppAlertSpec

GetAlerts returns the Alerts field.

func (*AppJobSpec) GetBuildCommand added in v1.85.0

func (a *AppJobSpec) GetBuildCommand() string

GetBuildCommand returns the BuildCommand field.

func (*AppJobSpec) GetDockerfilePath added in v1.85.0

func (a *AppJobSpec) GetDockerfilePath() string

GetDockerfilePath returns the DockerfilePath field.

func (*AppJobSpec) GetEnvs added in v1.85.0

func (a *AppJobSpec) GetEnvs() []*AppVariableDefinition

GetEnvs returns the Envs field.

func (*AppJobSpec) GetGit added in v1.85.0

func (a *AppJobSpec) GetGit() *GitSourceSpec

GetGit returns the Git field.

func (*AppJobSpec) GetGitHub added in v1.85.0

func (a *AppJobSpec) GetGitHub() *GitHubSourceSpec

GetGitHub returns the GitHub field.

func (*AppJobSpec) GetGitLab added in v1.85.0

func (a *AppJobSpec) GetGitLab() *GitLabSourceSpec

GetGitLab returns the GitLab field.

func (*AppJobSpec) GetImage added in v1.85.0

func (a *AppJobSpec) GetImage() *ImageSourceSpec

GetImage returns the Image field.

func (*AppJobSpec) GetInstanceCount added in v1.85.0

func (a *AppJobSpec) GetInstanceCount() int64

GetInstanceCount returns the InstanceCount field.

func (*AppJobSpec) GetInstanceSizeSlug added in v1.85.0

func (a *AppJobSpec) GetInstanceSizeSlug() string

GetInstanceSizeSlug returns the InstanceSizeSlug field.

func (*AppJobSpec) GetKind added in v1.85.0

func (a *AppJobSpec) GetKind() AppJobSpecKind

GetKind returns the Kind field.

func (*AppJobSpec) GetLogDestinations added in v1.85.0

func (a *AppJobSpec) GetLogDestinations() []*AppLogDestinationSpec

GetLogDestinations returns the LogDestinations field.

func (*AppJobSpec) GetName added in v1.85.0

func (a *AppJobSpec) GetName() string

GetName returns the Name field.

func (*AppJobSpec) GetRunCommand added in v1.85.0

func (a *AppJobSpec) GetRunCommand() string

GetRunCommand returns the RunCommand field.

func (*AppJobSpec) GetSourceDir added in v1.85.0

func (a *AppJobSpec) GetSourceDir() string

GetSourceDir returns the SourceDir field.

func (*AppJobSpec) GetType added in v1.85.0

func (s *AppJobSpec) GetType() AppComponentType

GetType returns the Job component type.

type AppJobSpecKind added in v1.48.0

type AppJobSpecKind string

AppJobSpecKind - UNSPECIFIED: Default job type, will auto-complete to POST_DEPLOY kind. - PRE_DEPLOY: Indicates a job that runs before an app deployment. - POST_DEPLOY: Indicates a job that runs after an app deployment. - FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy.

const (
	AppJobSpecKind_Unspecified  AppJobSpecKind = "UNSPECIFIED"
	AppJobSpecKind_PreDeploy    AppJobSpecKind = "PRE_DEPLOY"
	AppJobSpecKind_PostDeploy   AppJobSpecKind = "POST_DEPLOY"
	AppJobSpecKind_FailedDeploy AppJobSpecKind = "FAILED_DEPLOY"
)

List of AppJobSpecKind

type AppLogDestinationSpec added in v1.71.0

type AppLogDestinationSpec struct {
	// Name of the log destination.
	Name        string                           `json:"name"`
	Papertrail  *AppLogDestinationSpecPapertrail `json:"papertrail,omitempty"`
	Datadog     *AppLogDestinationSpecDataDog    `json:"datadog,omitempty"`
	Logtail     *AppLogDestinationSpecLogtail    `json:"logtail,omitempty"`
	Endpoint    string                           `json:"endpoint,omitempty"`
	TLSInsecure bool                             `json:"tls_insecure,omitempty"`
	Headers     []*AppLogDestinationSpecHeader   `json:"headers,omitempty"`
}

AppLogDestinationSpec struct for AppLogDestinationSpec

func (*AppLogDestinationSpec) GetDatadog added in v1.85.0

GetDatadog returns the Datadog field.

func (*AppLogDestinationSpec) GetEndpoint added in v1.85.0

func (a *AppLogDestinationSpec) GetEndpoint() string

GetEndpoint returns the Endpoint field.

func (*AppLogDestinationSpec) GetHeaders added in v1.85.0

GetHeaders returns the Headers field.

func (*AppLogDestinationSpec) GetLogtail added in v1.85.0

GetLogtail returns the Logtail field.

func (*AppLogDestinationSpec) GetName added in v1.85.0

func (a *AppLogDestinationSpec) GetName() string

GetName returns the Name field.

func (*AppLogDestinationSpec) GetPapertrail added in v1.85.0

GetPapertrail returns the Papertrail field.

func (*AppLogDestinationSpec) GetTLSInsecure added in v1.85.0

func (a *AppLogDestinationSpec) GetTLSInsecure() bool

GetTLSInsecure returns the TLSInsecure field.

type AppLogDestinationSpecDataDog added in v1.71.0

type AppLogDestinationSpecDataDog struct {
	// Datadog HTTP log intake endpoint.
	Endpoint string `json:"endpoint,omitempty"`
	// Datadog API key.
	ApiKey string `json:"api_key"`
}

AppLogDestinationSpecDataDog DataDog configuration.

func (*AppLogDestinationSpecDataDog) GetApiKey added in v1.85.0

func (a *AppLogDestinationSpecDataDog) GetApiKey() string

GetApiKey returns the ApiKey field.

func (*AppLogDestinationSpecDataDog) GetEndpoint added in v1.85.0

func (a *AppLogDestinationSpecDataDog) GetEndpoint() string

GetEndpoint returns the Endpoint field.

type AppLogDestinationSpecHeader added in v1.75.0

type AppLogDestinationSpecHeader struct {
	// The name
	Key string `json:"key"`
	// The header value.
	Value string `json:"value,omitempty"`
}

AppLogDestinationSpecHeader struct for AppLogDestinationSpecHeader

func (*AppLogDestinationSpecHeader) GetKey added in v1.85.0

func (a *AppLogDestinationSpecHeader) GetKey() string

GetKey returns the Key field.

func (*AppLogDestinationSpecHeader) GetValue added in v1.85.0

func (a *AppLogDestinationSpecHeader) GetValue() string

GetValue returns the Value field.

type AppLogDestinationSpecLogtail added in v1.71.0

type AppLogDestinationSpecLogtail struct {
	// Logtail token.
	Token string `json:"token"`
}

AppLogDestinationSpecLogtail Logtail configuration.

func (*AppLogDestinationSpecLogtail) GetToken added in v1.85.0

func (a *AppLogDestinationSpecLogtail) GetToken() string

GetToken returns the Token field.

type AppLogDestinationSpecPapertrail added in v1.71.0

type AppLogDestinationSpecPapertrail struct {
	// Papertrail syslog endpoint.
	Endpoint string `json:"endpoint"`
}

AppLogDestinationSpecPapertrail Papertrail configuration.

func (*AppLogDestinationSpecPapertrail) GetEndpoint added in v1.85.0

func (a *AppLogDestinationSpecPapertrail) GetEndpoint() string

GetEndpoint returns the Endpoint field.

type AppLogType added in v1.39.0

type AppLogType string

AppLogType is the type of app logs.

const (
	// AppLogTypeBuild represents build logs.
	AppLogTypeBuild AppLogType = "BUILD"
	// AppLogTypeDeploy represents deploy logs.
	AppLogTypeDeploy AppLogType = "DEPLOY"
	// AppLogTypeRun represents run logs.
	AppLogTypeRun AppLogType = "RUN"
)

type AppLogs added in v1.39.0

type AppLogs struct {
	LiveURL      string   `json:"live_url"`
	HistoricURLs []string `json:"historic_urls"`
}

AppLogs represent app logs.

type AppProposeRequest added in v1.56.0

type AppProposeRequest struct {
	Spec *AppSpec `json:"spec"`
	// An optional ID of an existing app. If set, the spec will be treated as a proposed update to the specified app. The existing app is not modified using this method.
	AppID string `json:"app_id,omitempty"`
}

AppProposeRequest struct for AppProposeRequest

func (*AppProposeRequest) GetAppID added in v1.85.0

func (a *AppProposeRequest) GetAppID() string

GetAppID returns the AppID field.

func (*AppProposeRequest) GetSpec added in v1.85.0

func (a *AppProposeRequest) GetSpec() *AppSpec

GetSpec returns the Spec field.

type AppProposeResponse added in v1.56.0

type AppProposeResponse struct {
	// Deprecated. Please use AppIsStarter instead.
	AppIsStatic bool `json:"app_is_static,omitempty"`
	// Indicates whether the app name is available.
	AppNameAvailable bool `json:"app_name_available,omitempty"`
	// If the app name is unavailable, this will be set to a suggested available name.
	AppNameSuggestion string `json:"app_name_suggestion,omitempty"`
	// Deprecated. Please use ExistingStarterApps instead.
	ExistingStaticApps string `json:"existing_static_apps,omitempty"`
	// Deprecated. Please use MaxFreeStarterApps instead.
	MaxFreeStaticApps string   `json:"max_free_static_apps,omitempty"`
	Spec              *AppSpec `json:"spec,omitempty"`
	// The monthly cost of the proposed app in USD.
	AppCost float32 `json:"app_cost,omitempty"`
	// The monthly cost of the proposed app in USD using the next pricing plan tier. For example, if you propose an app that uses the Basic tier, the `AppTierUpgradeCost` field displays the monthly cost of the app if it were to use the Professional tier. If the proposed app already uses the most expensive tier, the field is empty.
	AppTierUpgradeCost float32 `json:"app_tier_upgrade_cost,omitempty"`
	// The monthly cost of the proposed app in USD using the previous pricing plan tier. For example, if you propose an app that uses the Professional tier, the `AppTierDowngradeCost` field displays the monthly cost of the app if it were to use the Basic tier. If the proposed app already uses the lest expensive tier, the field is empty.
	AppTierDowngradeCost float32 `json:"app_tier_downgrade_cost,omitempty"`
	// The number of existing starter tier apps the account has.
	ExistingStarterApps string `json:"existing_starter_apps,omitempty"`
	// The maximum number of free starter apps the account can have. Any additional starter apps will be charged for. These include apps with only static sites, functions, and databases.
	MaxFreeStarterApps string `json:"max_free_starter_apps,omitempty"`
	// Indicates whether the app is a starter tier app.
	AppIsStarter bool `json:"app_is_starter,omitempty"`
}

AppProposeResponse struct for AppProposeResponse

func (*AppProposeResponse) GetAppCost added in v1.85.0

func (a *AppProposeResponse) GetAppCost() float32

GetAppCost returns the AppCost field.

func (*AppProposeResponse) GetAppIsStarter added in v1.85.0

func (a *AppProposeResponse) GetAppIsStarter() bool

GetAppIsStarter returns the AppIsStarter field.

func (*AppProposeResponse) GetAppIsStatic added in v1.85.0

func (a *AppProposeResponse) GetAppIsStatic() bool

GetAppIsStatic returns the AppIsStatic field.

func (*AppProposeResponse) GetAppNameAvailable added in v1.85.0

func (a *AppProposeResponse) GetAppNameAvailable() bool

GetAppNameAvailable returns the AppNameAvailable field.

func (*AppProposeResponse) GetAppNameSuggestion added in v1.85.0

func (a *AppProposeResponse) GetAppNameSuggestion() string

GetAppNameSuggestion returns the AppNameSuggestion field.

func (*AppProposeResponse) GetAppTierDowngradeCost added in v1.85.0

func (a *AppProposeResponse) GetAppTierDowngradeCost() float32

GetAppTierDowngradeCost returns the AppTierDowngradeCost field.

func (*AppProposeResponse) GetAppTierUpgradeCost added in v1.85.0

func (a *AppProposeResponse) GetAppTierUpgradeCost() float32

GetAppTierUpgradeCost returns the AppTierUpgradeCost field.

func (*AppProposeResponse) GetExistingStarterApps added in v1.85.0

func (a *AppProposeResponse) GetExistingStarterApps() string

GetExistingStarterApps returns the ExistingStarterApps field.

func (*AppProposeResponse) GetExistingStaticApps added in v1.85.0

func (a *AppProposeResponse) GetExistingStaticApps() string

GetExistingStaticApps returns the ExistingStaticApps field.

func (*AppProposeResponse) GetMaxFreeStarterApps added in v1.85.0

func (a *AppProposeResponse) GetMaxFreeStarterApps() string

GetMaxFreeStarterApps returns the MaxFreeStarterApps field.

func (*AppProposeResponse) GetMaxFreeStaticApps added in v1.85.0

func (a *AppProposeResponse) GetMaxFreeStaticApps() string

GetMaxFreeStaticApps returns the MaxFreeStaticApps field.

func (*AppProposeResponse) GetSpec added in v1.85.0

func (a *AppProposeResponse) GetSpec() *AppSpec

GetSpec returns the Spec field.

type AppRegion added in v1.45.0

type AppRegion struct {
	Slug        string   `json:"slug,omitempty"`
	Label       string   `json:"label,omitempty"`
	Flag        string   `json:"flag,omitempty"`
	Continent   string   `json:"continent,omitempty"`
	Disabled    bool     `json:"disabled,omitempty"`
	DataCenters []string `json:"data_centers,omitempty"`
	Reason      string   `json:"reason,omitempty"`
	// Whether or not the region is presented as the default.
	Default bool `json:"default,omitempty"`
}

AppRegion struct for AppRegion

func (*AppRegion) GetContinent added in v1.85.0

func (a *AppRegion) GetContinent() string

GetContinent returns the Continent field.

func (*AppRegion) GetDataCenters added in v1.85.0

func (a *AppRegion) GetDataCenters() []string

GetDataCenters returns the DataCenters field.

func (*AppRegion) GetDefault added in v1.85.0

func (a *AppRegion) GetDefault() bool

GetDefault returns the Default field.

func (*AppRegion) GetDisabled added in v1.85.0

func (a *AppRegion) GetDisabled() bool

GetDisabled returns the Disabled field.

func (*AppRegion) GetFlag added in v1.85.0

func (a *AppRegion) GetFlag() string

GetFlag returns the Flag field.

func (*AppRegion) GetLabel added in v1.85.0

func (a *AppRegion) GetLabel() string

GetLabel returns the Label field.

func (*AppRegion) GetReason added in v1.85.0

func (a *AppRegion) GetReason() string

GetReason returns the Reason field.

func (*AppRegion) GetSlug added in v1.85.0

func (a *AppRegion) GetSlug() string

GetSlug returns the Slug field.

type AppRoutableComponentSpec added in v1.85.0

type AppRoutableComponentSpec interface {
	AppComponentSpec

	GetRoutes() []*AppRouteSpec
	GetCORS() *AppCORSPolicy
}

AppRoutableComponentSpec is a component that defines routes.

type AppRouteSpec added in v1.39.0

type AppRouteSpec struct {
	// An HTTP path prefix. Paths must start with / and must be unique across all components within an app.
	Path string `json:"path,omitempty"`
	// An optional flag to preserve the path that is forwarded to the backend service. By default, the HTTP request path will be trimmed from the left when forwarded to the component. For example, a component with `path=/api` will have requests to `/api/list` trimmed to `/list`. If this value is `true`, the path will remain `/api/list`. Note: this is not applicable for Functions Components.
	PreservePathPrefix bool `json:"preserve_path_prefix,omitempty"`
}

AppRouteSpec struct for AppRouteSpec

func (*AppRouteSpec) GetPath added in v1.85.0

func (a *AppRouteSpec) GetPath() string

GetPath returns the Path field.

func (*AppRouteSpec) GetPreservePathPrefix added in v1.85.0

func (a *AppRouteSpec) GetPreservePathPrefix() bool

GetPreservePathPrefix returns the PreservePathPrefix field.

type AppServiceSpec added in v1.39.0

type AppServiceSpec struct {
	// The name. Must be unique across all components within the same app.
	Name   string            `json:"name"`
	Git    *GitSourceSpec    `json:"git,omitempty"`
	GitHub *GitHubSourceSpec `json:"github,omitempty"`
	Image  *ImageSourceSpec  `json:"image,omitempty"`
	GitLab *GitLabSourceSpec `json:"gitlab,omitempty"`
	// The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
	DockerfilePath string `json:"dockerfile_path,omitempty"`
	// An optional build command to run while building this component from source.
	BuildCommand string `json:"build_command,omitempty"`
	// An optional run command to override the component's default.
	RunCommand string `json:"run_command,omitempty"`
	// An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
	SourceDir string `json:"source_dir,omitempty"`
	// An environment slug describing the type of this app. For a full list, please refer to [the product documentation](https://www.digitalocean.com/docs/app-platform/).
	EnvironmentSlug string `json:"environment_slug,omitempty"`
	// A list of environment variables made available to the component.
	Envs             []*AppVariableDefinition `json:"envs,omitempty"`
	InstanceSizeSlug string                   `json:"instance_size_slug,omitempty"`
	InstanceCount    int64                    `json:"instance_count,omitempty"`
	// The internal port on which this service's run command will listen. Default: 8080 If there is not an environment variable with the name `PORT`, one will be automatically added with its value set to the value of this field.
	HTTPPort int64 `json:"http_port,omitempty"`
	// A list of HTTP routes that should be routed to this component.
	Routes      []*AppRouteSpec            `json:"routes,omitempty"`
	HealthCheck *AppServiceSpecHealthCheck `json:"health_check,omitempty"`
	CORS        *AppCORSPolicy             `json:"cors,omitempty"`
	// The ports on which this service will listen for internal traffic.
	InternalPorts []int64 `json:"internal_ports,omitempty"`
	// A list of configured alerts which apply to the component.
	Alerts []*AppAlertSpec `json:"alerts,omitempty"`
	// A list of configured log forwarding destinations.
	LogDestinations []*AppLogDestinationSpec `json:"log_destinations,omitempty"`
}

AppServiceSpec struct for AppServiceSpec

func (*AppServiceSpec) GetAlerts added in v1.85.0

func (a *AppServiceSpec) GetAlerts() []*AppAlertSpec

GetAlerts returns the Alerts field.

func (*AppServiceSpec) GetBuildCommand added in v1.85.0

func (a *AppServiceSpec) GetBuildCommand() string

GetBuildCommand returns the BuildCommand field.

func (*AppServiceSpec) GetCORS added in v1.85.0

func (a *AppServiceSpec) GetCORS() *AppCORSPolicy

GetCORS returns the CORS field.

func (*AppServiceSpec) GetDockerfilePath added in v1.85.0

func (a *AppServiceSpec) GetDockerfilePath() string

GetDockerfilePath returns the DockerfilePath field.

func (*AppServiceSpec) GetEnvs added in v1.85.0

func (a *AppServiceSpec) GetEnvs() []*AppVariableDefinition

GetEnvs returns the Envs field.

func (*AppServiceSpec) GetGit added in v1.85.0

func (a *AppServiceSpec) GetGit() *GitSourceSpec

GetGit returns the Git field.

func (*AppServiceSpec) GetGitHub added in v1.85.0

func (a *AppServiceSpec) GetGitHub() *GitHubSourceSpec

GetGitHub returns the GitHub field.

func (*AppServiceSpec) GetGitLab added in v1.85.0

func (a *AppServiceSpec) GetGitLab() *GitLabSourceSpec

GetGitLab returns the GitLab field.

func (*AppServiceSpec) GetHTTPPort added in v1.85.0

func (a *AppServiceSpec) GetHTTPPort() int64

GetHTTPPort returns the HTTPPort field.

func (*AppServiceSpec) GetHealthCheck added in v1.85.0

func (a *AppServiceSpec) GetHealthCheck() *AppServiceSpecHealthCheck

GetHealthCheck returns the HealthCheck field.

func (*AppServiceSpec) GetImage added in v1.85.0

func (a *AppServiceSpec) GetImage() *ImageSourceSpec

GetImage returns the Image field.

func (*AppServiceSpec) GetInstanceCount added in v1.85.0

func (a *AppServiceSpec) GetInstanceCount() int64

GetInstanceCount returns the InstanceCount field.

func (*AppServiceSpec) GetInstanceSizeSlug added in v1.85.0

func (a *AppServiceSpec) GetInstanceSizeSlug() string

GetInstanceSizeSlug returns the InstanceSizeSlug field.

func (*AppServiceSpec) GetInternalPorts added in v1.85.0

func (a *AppServiceSpec) GetInternalPorts() []int64

GetInternalPorts returns the InternalPorts field.

func (*AppServiceSpec) GetLogDestinations added in v1.85.0

func (a *AppServiceSpec) GetLogDestinations() []*AppLogDestinationSpec

GetLogDestinations returns the LogDestinations field.

func (*AppServiceSpec) GetName added in v1.85.0

func (a *AppServiceSpec) GetName() string

GetName returns the Name field.

func (*AppServiceSpec) GetRoutes added in v1.85.0

func (a *AppServiceSpec) GetRoutes() []*AppRouteSpec

GetRoutes returns the Routes field.

func (*AppServiceSpec) GetRunCommand added in v1.85.0

func (a *AppServiceSpec) GetRunCommand() string

GetRunCommand returns the RunCommand field.

func (*AppServiceSpec) GetSourceDir added in v1.85.0

func (a *AppServiceSpec) GetSourceDir() string

GetSourceDir returns the SourceDir field.

func (*AppServiceSpec) GetType added in v1.85.0

func (s *AppServiceSpec) GetType() AppComponentType

GetType returns the Service component type.

type AppServiceSpecHealthCheck added in v1.43.0

type AppServiceSpecHealthCheck struct {
	// Deprecated. Use http_path instead.
	Path string `json:"path,omitempty"`
	// The number of seconds to wait before beginning health checks. Default: 0 seconds; start health checks as soon as the service starts.
	InitialDelaySeconds int32 `json:"initial_delay_seconds,omitempty"`
	// The number of seconds to wait between health checks. Default: 10 seconds.
	PeriodSeconds int32 `json:"period_seconds,omitempty"`
	// The number of seconds after which the check times out. Default: 1 second.
	TimeoutSeconds int32 `json:"timeout_seconds,omitempty"`
	// The number of successful health checks before considered healthy. Default: 1.
	SuccessThreshold int32 `json:"success_threshold,omitempty"`
	// The number of failed health checks before considered unhealthy. Default: 9.
	FailureThreshold int32 `json:"failure_threshold,omitempty"`
	// The route path used for the HTTP health check ping. If not set, the HTTP health check will be disabled and a TCP health check used instead.
	HTTPPath string `json:"http_path,omitempty"`
	// The port on which the health check will be performed. If not set, the health check will be performed on the component's http_port.
	Port int64 `json:"port,omitempty"`
}

AppServiceSpecHealthCheck struct for AppServiceSpecHealthCheck

func (*AppServiceSpecHealthCheck) GetFailureThreshold added in v1.85.0

func (a *AppServiceSpecHealthCheck) GetFailureThreshold() int32

GetFailureThreshold returns the FailureThreshold field.

func (*AppServiceSpecHealthCheck) GetHTTPPath added in v1.85.0

func (a *AppServiceSpecHealthCheck) GetHTTPPath() string

GetHTTPPath returns the HTTPPath field.

func (*AppServiceSpecHealthCheck) GetInitialDelaySeconds added in v1.85.0

func (a *AppServiceSpecHealthCheck) GetInitialDelaySeconds() int32

GetInitialDelaySeconds returns the InitialDelaySeconds field.

func (*AppServiceSpecHealthCheck) GetPath added in v1.85.0

func (a *AppServiceSpecHealthCheck) GetPath() string

GetPath returns the Path field.

func (*AppServiceSpecHealthCheck) GetPeriodSeconds added in v1.85.0

func (a *AppServiceSpecHealthCheck) GetPeriodSeconds() int32

GetPeriodSeconds returns the PeriodSeconds field.

func (*AppServiceSpecHealthCheck) GetPort added in v1.85.0

func (a *AppServiceSpecHealthCheck) GetPort() int64

GetPort returns the Port field.

func (*AppServiceSpecHealthCheck) GetSuccessThreshold added in v1.85.0

func (a *AppServiceSpecHealthCheck) GetSuccessThreshold() int32

GetSuccessThreshold returns the SuccessThreshold field.

func (*AppServiceSpecHealthCheck) GetTimeoutSeconds added in v1.85.0

func (a *AppServiceSpecHealthCheck) GetTimeoutSeconds() int32

GetTimeoutSeconds returns the TimeoutSeconds field.

type AppSourceType added in v1.85.0

type AppSourceType string

AppSourceType is an app source type.

const (
	AppSourceTypeGitHub AppSourceType = "github"
	AppSourceTypeGitLab AppSourceType = "gitlab"
	AppSourceTypeGit    AppSourceType = "git"
	AppSourceTypeImage  AppSourceType = "image"
)

type AppSpec added in v1.39.0

type AppSpec struct {
	// The name of the app. Must be unique across all apps in the same account.
	Name string `json:"name"`
	// Workloads which expose publicly-accessible HTTP services.
	Services []*AppServiceSpec `json:"services,omitempty"`
	// Content which can be rendered to static web assets.
	StaticSites []*AppStaticSiteSpec `json:"static_sites,omitempty"`
	// Workloads which do not expose publicly-accessible HTTP services.
	Workers []*AppWorkerSpec `json:"workers,omitempty"`
	// Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
	Jobs []*AppJobSpec `json:"jobs,omitempty"`
	// Workloads which expose publicly-accessible HTTP services via Functions Components.
	Functions []*AppFunctionsSpec `json:"functions,omitempty"`
	// Database instances which can provide persistence to workloads within the application.
	Databases []*AppDatabaseSpec `json:"databases,omitempty"`
	// A set of hostnames where the application will be available.
	Domains []*AppDomainSpec `json:"domains,omitempty"`
	Region  string           `json:"region,omitempty"`
	// A list of environment variables made available to all components in the app.
	Envs []*AppVariableDefinition `json:"envs,omitempty"`
	// A list of alerts which apply to the app.
	Alerts   []*AppAlertSpec `json:"alerts,omitempty"`
	Ingress  *AppIngressSpec `json:"ingress,omitempty"`
	Features []string        `json:"features,omitempty"`
}

AppSpec The desired configuration of an application.

func (*AppSpec) ForEachAppComponentSpec added in v1.85.0

func (s *AppSpec) ForEachAppComponentSpec(fn func(component AppComponentSpec) error) error

ForEachAppComponentSpec iterates over each component spec in an app.

func (*AppSpec) GetAlerts added in v1.85.0

func (a *AppSpec) GetAlerts() []*AppAlertSpec

GetAlerts returns the Alerts field.

func (*AppSpec) GetDatabases added in v1.85.0

func (a *AppSpec) GetDatabases() []*AppDatabaseSpec

GetDatabases returns the Databases field.

func (*AppSpec) GetDomains added in v1.85.0

func (a *AppSpec) GetDomains() []*AppDomainSpec

GetDomains returns the Domains field.

func (*AppSpec) GetEnvs added in v1.85.0

func (a *AppSpec) GetEnvs() []*AppVariableDefinition

GetEnvs returns the Envs field.

func (*AppSpec) GetFeatures added in v1.85.0

func (a *AppSpec) GetFeatures() []string

GetFeatures returns the Features field.

func (*AppSpec) GetFunctions added in v1.85.0

func (a *AppSpec) GetFunctions() []*AppFunctionsSpec

GetFunctions returns the Functions field.

func (*AppSpec) GetIngress added in v1.85.0

func (a *AppSpec) GetIngress() *AppIngressSpec

GetIngress returns the Ingress field.

func (*AppSpec) GetJobs added in v1.85.0

func (a *AppSpec) GetJobs() []*AppJobSpec

GetJobs returns the Jobs field.

func (*AppSpec) GetName added in v1.85.0

func (a *AppSpec) GetName() string

GetName returns the Name field.

func (*AppSpec) GetRegion added in v1.85.0

func (a *AppSpec) GetRegion() string

GetRegion returns the Region field.

func (*AppSpec) GetServices added in v1.85.0

func (a *AppSpec) GetServices() []*AppServiceSpec

GetServices returns the Services field.

func (*AppSpec) GetStaticSites added in v1.85.0

func (a *AppSpec) GetStaticSites() []*AppStaticSiteSpec

GetStaticSites returns the StaticSites field.

func (*AppSpec) GetWorkers added in v1.85.0

func (a *AppSpec) GetWorkers() []*AppWorkerSpec

GetWorkers returns the Workers field.

type AppStaticSiteSpec added in v1.39.0

type AppStaticSiteSpec struct {
	// The name. Must be unique across all components within the same app.
	Name   string            `json:"name"`
	Git    *GitSourceSpec    `json:"git,omitempty"`
	GitHub *GitHubSourceSpec `json:"github,omitempty"`
	GitLab *GitLabSourceSpec `json:"gitlab,omitempty"`
	// The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
	DockerfilePath string `json:"dockerfile_path,omitempty"`
	// An optional build command to run while building this component from source.
	BuildCommand string `json:"build_command,omitempty"`
	// An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
	SourceDir string `json:"source_dir,omitempty"`
	// An environment slug describing the type of this app. For a full list, please refer to [the product documentation](https://www.digitalocean.com/docs/app-platform/).
	EnvironmentSlug string `json:"environment_slug,omitempty"`
	// An optional path to where the built assets will be located, relative to the build context. If not set, App Platform will automatically scan for these directory names: `_static`, `dist`, `public`, `build`.
	OutputDir     string `json:"output_dir,omitempty"`
	IndexDocument string `json:"index_document,omitempty"`
	// The name of the error document to use when serving this static site. Default: 404.html. If no such file exists within the built assets, App Platform will supply one.
	ErrorDocument string `json:"error_document,omitempty"`
	// A list of environment variables made available to the component.
	Envs []*AppVariableDefinition `json:"envs,omitempty"`
	// A list of HTTP routes that should be routed to this component.
	Routes []*AppRouteSpec `json:"routes,omitempty"`
	CORS   *AppCORSPolicy  `json:"cors,omitempty"`
	// The name of the document to use as the fallback for any requests to documents that are not found when serving this static site. Only 1 of `catchall_document` or `error_document` can be set.
	CatchallDocument string `json:"catchall_document,omitempty"`
}

AppStaticSiteSpec struct for AppStaticSiteSpec

func (*AppStaticSiteSpec) GetBuildCommand added in v1.85.0

func (a *AppStaticSiteSpec) GetBuildCommand() string

GetBuildCommand returns the BuildCommand field.

func (*AppStaticSiteSpec) GetCORS added in v1.85.0

func (a *AppStaticSiteSpec) GetCORS() *AppCORSPolicy

GetCORS returns the CORS field.

func (*AppStaticSiteSpec) GetCatchallDocument added in v1.85.0

func (a *AppStaticSiteSpec) GetCatchallDocument() string

GetCatchallDocument returns the CatchallDocument field.

func (*AppStaticSiteSpec) GetDockerfilePath added in v1.85.0

func (a *AppStaticSiteSpec) GetDockerfilePath() string

GetDockerfilePath returns the DockerfilePath field.

func (*AppStaticSiteSpec) GetEnvs added in v1.85.0

func (a *AppStaticSiteSpec) GetEnvs() []*AppVariableDefinition

GetEnvs returns the Envs field.

func (*AppStaticSiteSpec) GetErrorDocument added in v1.85.0

func (a *AppStaticSiteSpec) GetErrorDocument() string

GetErrorDocument returns the ErrorDocument field.

func (*AppStaticSiteSpec) GetGit added in v1.85.0

func (a *AppStaticSiteSpec) GetGit() *GitSourceSpec

GetGit returns the Git field.

func (*AppStaticSiteSpec) GetGitHub added in v1.85.0

func (a *AppStaticSiteSpec) GetGitHub() *GitHubSourceSpec

GetGitHub returns the GitHub field.

func (*AppStaticSiteSpec) GetGitLab added in v1.85.0

func (a *AppStaticSiteSpec) GetGitLab() *GitLabSourceSpec

GetGitLab returns the GitLab field.

func (*AppStaticSiteSpec) GetIndexDocument added in v1.85.0

func (a *AppStaticSiteSpec) GetIndexDocument() string

GetIndexDocument returns the IndexDocument field.

func (*AppStaticSiteSpec) GetName added in v1.85.0

func (a *AppStaticSiteSpec) GetName() string

GetName returns the Name field.

func (*AppStaticSiteSpec) GetOutputDir added in v1.85.0

func (a *AppStaticSiteSpec) GetOutputDir() string

GetOutputDir returns the OutputDir field.

func (*AppStaticSiteSpec) GetRoutes added in v1.85.0

func (a *AppStaticSiteSpec) GetRoutes() []*AppRouteSpec

GetRoutes returns the Routes field.

func (*AppStaticSiteSpec) GetSourceDir added in v1.85.0

func (a *AppStaticSiteSpec) GetSourceDir() string

GetSourceDir returns the SourceDir field.

func (*AppStaticSiteSpec) GetType added in v1.85.0

func (s *AppStaticSiteSpec) GetType() AppComponentType

GetType returns the StaticSite component type.

type AppStringMatch added in v1.48.0

type AppStringMatch struct {
	// Exact string match. Only 1 of `exact`, `prefix`, or `regex` must be set.
	Exact string `json:"exact,omitempty"`
	// Prefix-based match. Only 1 of `exact`, `prefix`, or `regex` must be set.
	Prefix string `json:"prefix,omitempty"`
	Regex  string `json:"regex,omitempty"`
}

AppStringMatch struct for AppStringMatch

func (*AppStringMatch) GetExact added in v1.85.0

func (a *AppStringMatch) GetExact() string

GetExact returns the Exact field.

func (*AppStringMatch) GetPrefix added in v1.85.0

func (a *AppStringMatch) GetPrefix() string

GetPrefix returns the Prefix field.

func (*AppStringMatch) GetRegex added in v1.85.0

func (a *AppStringMatch) GetRegex() string

GetRegex returns the Regex field.

type AppTier added in v1.48.0

type AppTier struct {
	Name                 string `json:"name,omitempty"`
	Slug                 string `json:"slug,omitempty"`
	EgressBandwidthBytes string `json:"egress_bandwidth_bytes,omitempty"`
	BuildSeconds         string `json:"build_seconds,omitempty"`
}

AppTier struct for AppTier

func (*AppTier) GetBuildSeconds added in v1.85.0

func (a *AppTier) GetBuildSeconds() string

GetBuildSeconds returns the BuildSeconds field.

func (*AppTier) GetEgressBandwidthBytes added in v1.85.0

func (a *AppTier) GetEgressBandwidthBytes() string

GetEgressBandwidthBytes returns the EgressBandwidthBytes field.

func (*AppTier) GetName added in v1.85.0

func (a *AppTier) GetName() string

GetName returns the Name field.

func (*AppTier) GetSlug added in v1.85.0

func (a *AppTier) GetSlug() string

GetSlug returns the Slug field.

type AppUpdateRequest added in v1.39.0

type AppUpdateRequest struct {
	Spec *AppSpec `json:"spec"`
}

AppUpdateRequest represents a request to update an app.

type AppVariableDefinition added in v1.39.0

type AppVariableDefinition struct {
	// The name
	Key string `json:"key"`
	// The value. If the type is `SECRET`, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
	Value string           `json:"value,omitempty"`
	Scope AppVariableScope `json:"scope,omitempty"`
	Type  AppVariableType  `json:"type,omitempty"`
}

AppVariableDefinition struct for AppVariableDefinition

func (*AppVariableDefinition) GetKey added in v1.85.0

func (a *AppVariableDefinition) GetKey() string

GetKey returns the Key field.

func (*AppVariableDefinition) GetScope added in v1.85.0

GetScope returns the Scope field.

func (*AppVariableDefinition) GetType added in v1.85.0

GetType returns the Type field.

func (*AppVariableDefinition) GetValue added in v1.85.0

func (a *AppVariableDefinition) GetValue() string

GetValue returns the Value field.

type AppVariableScope added in v1.45.0

type AppVariableScope string

AppVariableScope the model 'AppVariableScope'

const (
	AppVariableScope_Unset           AppVariableScope = "UNSET"
	AppVariableScope_RunTime         AppVariableScope = "RUN_TIME"
	AppVariableScope_BuildTime       AppVariableScope = "BUILD_TIME"
	AppVariableScope_RunAndBuildTime AppVariableScope = "RUN_AND_BUILD_TIME"
)

List of AppVariableScope

type AppVariableType added in v1.45.0

type AppVariableType string

AppVariableType the model 'AppVariableType'

const (
	AppVariableType_General AppVariableType = "GENERAL"
	AppVariableType_Secret  AppVariableType = "SECRET"
)

List of AppVariableType

type AppWorkerSpec added in v1.39.0

type AppWorkerSpec struct {
	// The name. Must be unique across all components within the same app.
	Name   string            `json:"name"`
	Git    *GitSourceSpec    `json:"git,omitempty"`
	GitHub *GitHubSourceSpec `json:"github,omitempty"`
	Image  *ImageSourceSpec  `json:"image,omitempty"`
	GitLab *GitLabSourceSpec `json:"gitlab,omitempty"`
	// The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
	DockerfilePath string `json:"dockerfile_path,omitempty"`
	// An optional build command to run while building this component from source.
	BuildCommand string `json:"build_command,omitempty"`
	// An optional run command to override the component's default.
	RunCommand string `json:"run_command,omitempty"`
	// An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
	SourceDir string `json:"source_dir,omitempty"`
	// An environment slug describing the type of this app. For a full list, please refer to [the product documentation](https://www.digitalocean.com/docs/app-platform/).
	EnvironmentSlug string `json:"environment_slug,omitempty"`
	// A list of environment variables made available to the component.
	Envs []*AppVariableDefinition `json:"envs,omitempty"`
	// The instance size to use for this component.
	InstanceSizeSlug string `json:"instance_size_slug,omitempty"`
	InstanceCount    int64  `json:"instance_count,omitempty"`
	// A list of configured alerts which apply to the component.
	Alerts []*AppAlertSpec `json:"alerts,omitempty"`
	// A list of configured log forwarding destinations.
	LogDestinations []*AppLogDestinationSpec `json:"log_destinations,omitempty"`
}

AppWorkerSpec struct for AppWorkerSpec

func (*AppWorkerSpec) GetAlerts added in v1.85.0

func (a *AppWorkerSpec) GetAlerts() []*AppAlertSpec

GetAlerts returns the Alerts field.

func (*AppWorkerSpec) GetBuildCommand added in v1.85.0

func (a *AppWorkerSpec) GetBuildCommand() string

GetBuildCommand returns the BuildCommand field.

func (*AppWorkerSpec) GetDockerfilePath added in v1.85.0

func (a *AppWorkerSpec) GetDockerfilePath() string

GetDockerfilePath returns the DockerfilePath field.

func (*AppWorkerSpec) GetEnvs added in v1.85.0

func (a *AppWorkerSpec) GetEnvs() []*AppVariableDefinition

GetEnvs returns the Envs field.

func (*AppWorkerSpec) GetGit added in v1.85.0

func (a *AppWorkerSpec) GetGit() *GitSourceSpec

GetGit returns the Git field.

func (*AppWorkerSpec) GetGitHub added in v1.85.0

func (a *AppWorkerSpec) GetGitHub() *GitHubSourceSpec

GetGitHub returns the GitHub field.

func (*AppWorkerSpec) GetGitLab added in v1.85.0

func (a *AppWorkerSpec) GetGitLab() *GitLabSourceSpec

GetGitLab returns the GitLab field.

func (*AppWorkerSpec) GetImage added in v1.85.0

func (a *AppWorkerSpec) GetImage() *ImageSourceSpec

GetImage returns the Image field.

func (*AppWorkerSpec) GetInstanceCount added in v1.85.0

func (a *AppWorkerSpec) GetInstanceCount() int64

GetInstanceCount returns the InstanceCount field.

func (*AppWorkerSpec) GetInstanceSizeSlug added in v1.85.0

func (a *AppWorkerSpec) GetInstanceSizeSlug() string

GetInstanceSizeSlug returns the InstanceSizeSlug field.

func (*AppWorkerSpec) GetLogDestinations added in v1.85.0

func (a *AppWorkerSpec) GetLogDestinations() []*AppLogDestinationSpec

GetLogDestinations returns the LogDestinations field.

func (*AppWorkerSpec) GetName added in v1.85.0

func (a *AppWorkerSpec) GetName() string

GetName returns the Name field.

func (*AppWorkerSpec) GetRunCommand added in v1.85.0

func (a *AppWorkerSpec) GetRunCommand() string

GetRunCommand returns the RunCommand field.

func (*AppWorkerSpec) GetSourceDir added in v1.85.0

func (a *AppWorkerSpec) GetSourceDir() string

GetSourceDir returns the SourceDir field.

func (*AppWorkerSpec) GetType added in v1.85.0

func (s *AppWorkerSpec) GetType() AppComponentType

GetType returns the Worker component type.

type AppsService added in v1.39.0

type AppsService interface {
	Create(ctx context.Context, create *AppCreateRequest) (*App, *Response, error)
	Get(ctx context.Context, appID string) (*App, *Response, error)
	List(ctx context.Context, opts *ListOptions) ([]*App, *Response, error)
	Update(ctx context.Context, appID string, update *AppUpdateRequest) (*App, *Response, error)
	Delete(ctx context.Context, appID string) (*Response, error)
	Propose(ctx context.Context, propose *AppProposeRequest) (*AppProposeResponse, *Response, error)

	GetDeployment(ctx context.Context, appID, deploymentID string) (*Deployment, *Response, error)
	ListDeployments(ctx context.Context, appID string, opts *ListOptions) ([]*Deployment, *Response, error)
	CreateDeployment(ctx context.Context, appID string, create ...*DeploymentCreateRequest) (*Deployment, *Response, error)

	GetLogs(ctx context.Context, appID, deploymentID, component string, logType AppLogType, follow bool, tailLines int) (*AppLogs, *Response, error)

	ListRegions(ctx context.Context) ([]*AppRegion, *Response, error)

	ListTiers(ctx context.Context) ([]*AppTier, *Response, error)
	GetTier(ctx context.Context, slug string) (*AppTier, *Response, error)

	ListInstanceSizes(ctx context.Context) ([]*AppInstanceSize, *Response, error)
	GetInstanceSize(ctx context.Context, slug string) (*AppInstanceSize, *Response, error)

	ListAlerts(ctx context.Context, appID string) ([]*AppAlert, *Response, error)
	UpdateAlertDestinations(ctx context.Context, appID, alertID string, update *AlertDestinationUpdateRequest) (*AppAlert, *Response, error)

	Detect(ctx context.Context, detect *DetectRequest) (*DetectResponse, *Response, error)

	ListBuildpacks(ctx context.Context) ([]*Buildpack, *Response, error)
	UpgradeBuildpack(ctx context.Context, appID string, opts UpgradeBuildpackOptions) (*UpgradeBuildpackResponse, *Response, error)
}

AppsService is an interface for interfacing with the App Platform endpoints of the DigitalOcean API.

type AppsServiceOp added in v1.39.0

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

AppsServiceOp handles communication with Apps methods of the DigitalOcean API.

func (*AppsServiceOp) Create added in v1.39.0

func (s *AppsServiceOp) Create(ctx context.Context, create *AppCreateRequest) (*App, *Response, error)

Create an app.

func (*AppsServiceOp) CreateDeployment added in v1.39.0

func (s *AppsServiceOp) CreateDeployment(ctx context.Context, appID string, create ...*DeploymentCreateRequest) (*Deployment, *Response, error)

CreateDeployment creates an app deployment.

func (*AppsServiceOp) Delete added in v1.39.0

func (s *AppsServiceOp) Delete(ctx context.Context, appID string) (*Response, error)

Delete an app.

func (*AppsServiceOp) Detect added in v1.82.0

func (s *AppsServiceOp) Detect(ctx context.Context, detect *DetectRequest) (*DetectResponse, *Response, error)

Detect an app.

func (*AppsServiceOp) Get added in v1.39.0

func (s *AppsServiceOp) Get(ctx context.Context, appID string) (*App, *Response, error)

Get an app.

func (*AppsServiceOp) GetDeployment added in v1.39.0

func (s *AppsServiceOp) GetDeployment(ctx context.Context, appID, deploymentID string) (*Deployment, *Response, error)

GetDeployment gets an app deployment.

func (*AppsServiceOp) GetInstanceSize added in v1.49.0

func (s *AppsServiceOp) GetInstanceSize(ctx context.Context, slug string) (*AppInstanceSize, *Response, error)

GetInstanceSize retrieves information about a specific instance size for service, worker, and job components.

func (*AppsServiceOp) GetLogs added in v1.39.0

func (s *AppsServiceOp) GetLogs(ctx context.Context, appID, deploymentID, component string, logType AppLogType, follow bool, tailLines int) (*AppLogs, *Response, error)

GetLogs retrieves app logs.

func (*AppsServiceOp) GetTier added in v1.49.0

func (s *AppsServiceOp) GetTier(ctx context.Context, slug string) (*AppTier, *Response, error)

GetTier retrieves information about a specific app tier.

func (*AppsServiceOp) List added in v1.39.0

func (s *AppsServiceOp) List(ctx context.Context, opts *ListOptions) ([]*App, *Response, error)

List apps.

func (*AppsServiceOp) ListAlerts added in v1.65.0

func (s *AppsServiceOp) ListAlerts(ctx context.Context, appID string) ([]*AppAlert, *Response, error)

ListAlerts retrieves a list of alerts on an app

func (*AppsServiceOp) ListBuildpacks added in v1.88.0

func (s *AppsServiceOp) ListBuildpacks(ctx context.Context) ([]*Buildpack, *Response, error)

ListBuildpacks lists the available buildpacks on App Platform.

func (*AppsServiceOp) ListDeployments added in v1.39.0

func (s *AppsServiceOp) ListDeployments(ctx context.Context, appID string, opts *ListOptions) ([]*Deployment, *Response, error)

ListDeployments lists an app deployments.

func (*AppsServiceOp) ListInstanceSizes added in v1.49.0

func (s *AppsServiceOp) ListInstanceSizes(ctx context.Context) ([]*AppInstanceSize, *Response, error)

ListInstanceSizes lists available instance sizes for service, worker, and job components.

func (*AppsServiceOp) ListRegions added in v1.49.0

func (s *AppsServiceOp) ListRegions(ctx context.Context) ([]*AppRegion, *Response, error)

ListRegions lists all regions supported by App Platform.

func (*AppsServiceOp) ListTiers added in v1.49.0

func (s *AppsServiceOp) ListTiers(ctx context.Context) ([]*AppTier, *Response, error)

ListTiers lists available app tiers.

func (*AppsServiceOp) Propose added in v1.56.0

Propose an app.

func (*AppsServiceOp) Update added in v1.39.0

func (s *AppsServiceOp) Update(ctx context.Context, appID string, update *AppUpdateRequest) (*App, *Response, error)

Update an app.

func (*AppsServiceOp) UpdateAlertDestinations added in v1.65.0

func (s *AppsServiceOp) UpdateAlertDestinations(ctx context.Context, appID, alertID string, update *AlertDestinationUpdateRequest) (*AppAlert, *Response, error)

UpdateAlertDestinations updates the alert destinations of an app's alert

func (*AppsServiceOp) UpgradeBuildpack added in v1.88.0

UpgradeBuildpack upgrades a buildpack for an app.

type ArgError added in v0.9.0

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

ArgError is an error that represents an error with an input to godo. It identifies the argument and the cause (if possible).

func NewArgError added in v0.9.0

func NewArgError(arg, reason string) *ArgError

NewArgError creates an InputError.

func (*ArgError) Error added in v0.9.0

func (e *ArgError) Error() string

type AssociatedResource added in v1.58.0

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

AssociatedResource is the object to represent a Kubernetes cluster associated resource's ID and Name.

type BackupWindow added in v1.0.0

type BackupWindow struct {
	Start *Timestamp `json:"start,omitempty"`
	End   *Timestamp `json:"end,omitempty"`
}

BackupWindow object

type Balance added in v1.29.0

type Balance struct {
	MonthToDateBalance string    `json:"month_to_date_balance"`
	AccountBalance     string    `json:"account_balance"`
	MonthToDateUsage   string    `json:"month_to_date_usage"`
	GeneratedAt        time.Time `json:"generated_at"`
}

Balance represents a DigitalOcean Balance

func (Balance) String added in v1.29.0

func (r Balance) String() string

type BalanceService added in v1.29.0

type BalanceService interface {
	Get(context.Context) (*Balance, *Response, error)
}

BalanceService is an interface for interfacing with the Balance endpoints of the DigitalOcean API See: https://docs.digitalocean.com/reference/api/api-reference/#operation/balance_get

type BalanceServiceOp added in v1.29.0

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

BalanceServiceOp handles communication with the Balance related methods of the DigitalOcean API.

func (*BalanceServiceOp) Get added in v1.29.0

Get DigitalOcean balance info

type BillingHistory added in v1.33.0

type BillingHistory struct {
	BillingHistory []BillingHistoryEntry `json:"billing_history"`
	Links          *Links                `json:"links"`
	Meta           *Meta                 `json:"meta"`
}

BillingHistory represents a DigitalOcean Billing History

func (BillingHistory) String added in v1.33.0

func (b BillingHistory) String() string

type BillingHistoryEntry added in v1.33.0

type BillingHistoryEntry struct {
	Description string    `json:"description"`
	Amount      string    `json:"amount"`
	InvoiceID   *string   `json:"invoice_id"`
	InvoiceUUID *string   `json:"invoice_uuid"`
	Date        time.Time `json:"date"`
	Type        string    `json:"type"`
}

BillingHistoryEntry represents an entry in a customer's Billing History

type BillingHistoryService added in v1.33.0

type BillingHistoryService interface {
	List(context.Context, *ListOptions) (*BillingHistory, *Response, error)
}

BillingHistoryService is an interface for interfacing with the BillingHistory endpoints of the DigitalOcean API See: https://docs.digitalocean.com/reference/api/api-reference/#operation/billingHistory_list

type BillingHistoryServiceOp added in v1.33.0

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

BillingHistoryServiceOp handles communication with the BillingHistory related methods of the DigitalOcean API.

func (*BillingHistoryServiceOp) List added in v1.33.0

List the Billing History for a customer

type Blob added in v1.73.0

type Blob struct {
	Digest              string `json:"digest,omitempty"`
	CompressedSizeBytes uint64 `json:"compressed_size_bytes,omitempty"`
}

Blob represents a registry blob

type Buildpack added in v1.85.0

type Buildpack struct {
	// The ID of the buildpack.
	ID string `json:"id,omitempty"`
	// Full semver version string.
	Version string `json:"version,omitempty"`
	// The major version line that the buildpack is pinned to. Example: a value of `1` indicates that the buildpack is pinned to versions `>=1.0.0 and <2.0.0`.
	MajorVersion int32 `json:"major_version,omitempty"`
	// Indicates whether the buildpack is on the latest major version line available.
	Latest bool `json:"latest,omitempty"`
	// A human friendly name.
	Name string `json:"name,omitempty"`
	// A description of the buildpack's purpose and steps performed at build time.
	Description []string `json:"description,omitempty"`
	// A link to the buildpack's documentation.
	DocsLink string `json:"docs_link,omitempty"`
}

Buildpack struct for Buildpack

func (*Buildpack) GetDescription added in v1.85.0

func (b *Buildpack) GetDescription() []string

GetDescription returns the Description field.

func (b *Buildpack) GetDocsLink() string

GetDocsLink returns the DocsLink field.

func (*Buildpack) GetID added in v1.85.0

func (b *Buildpack) GetID() string

GetID returns the ID field.

func (*Buildpack) GetLatest added in v1.85.0

func (b *Buildpack) GetLatest() bool

GetLatest returns the Latest field.

func (*Buildpack) GetMajorVersion added in v1.85.0

func (b *Buildpack) GetMajorVersion() int32

GetMajorVersion returns the MajorVersion field.

func (*Buildpack) GetName added in v1.85.0

func (b *Buildpack) GetName() string

GetName returns the Name field.

func (*Buildpack) GetVersion added in v1.85.0

func (b *Buildpack) GetVersion() string

GetVersion returns the Version field.

type CDN added in v1.4.0

type CDN struct {
	ID            string    `json:"id"`
	Origin        string    `json:"origin"`
	Endpoint      string    `json:"endpoint"`
	CreatedAt     time.Time `json:"created_at"`
	TTL           uint32    `json:"ttl"`
	CertificateID string    `json:"certificate_id,omitempty"`
	CustomDomain  string    `json:"custom_domain,omitempty"`
}

CDN represents a DigitalOcean CDN

type CDNCreateRequest added in v1.4.0

type CDNCreateRequest struct {
	Origin        string `json:"origin"`
	TTL           uint32 `json:"ttl"`
	CustomDomain  string `json:"custom_domain,omitempty"`
	CertificateID string `json:"certificate_id,omitempty"`
}

CDNCreateRequest represents a request to create a CDN.

type CDNFlushCacheRequest added in v1.4.0

type CDNFlushCacheRequest struct {
	Files []string `json:"files"`
}

CDNFlushCacheRequest represents a request to flush cache of a CDN.

type CDNService added in v1.4.0

CDNService is an interface for managing Spaces CDN with the DigitalOcean API.

type CDNServiceOp added in v1.4.0

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

CDNServiceOp handles communication with the CDN related methods of the DigitalOcean API.

func (CDNServiceOp) Create added in v1.4.0

func (c CDNServiceOp) Create(ctx context.Context, createRequest *CDNCreateRequest) (*CDN, *Response, error)

Create a new CDN

func (CDNServiceOp) Delete added in v1.4.0

func (c CDNServiceOp) Delete(ctx context.Context, id string) (*Response, error)

Delete an individual CDN

func (CDNServiceOp) FlushCache added in v1.4.0

func (c CDNServiceOp) FlushCache(ctx context.Context, id string, flushCacheRequest *CDNFlushCacheRequest) (*Response, error)

FlushCache flushes the cache of an individual CDN. Requires a non-empty slice of file paths and/or wildcards

func (CDNServiceOp) Get added in v1.4.0

func (c CDNServiceOp) Get(ctx context.Context, id string) (*CDN, *Response, error)

Get individual CDN. It requires a non-empty cdn id.

func (CDNServiceOp) List added in v1.4.0

func (c CDNServiceOp) List(ctx context.Context, opt *ListOptions) ([]CDN, *Response, error)

List all CDN endpoints

func (CDNServiceOp) UpdateCustomDomain added in v1.7.5

func (c CDNServiceOp) UpdateCustomDomain(ctx context.Context, id string, updateRequest *CDNUpdateCustomDomainRequest) (*CDN, *Response, error)

UpdateCustomDomain sets or removes the custom domain of an individual CDN

func (CDNServiceOp) UpdateTTL added in v1.4.0

func (c CDNServiceOp) UpdateTTL(ctx context.Context, id string, updateRequest *CDNUpdateTTLRequest) (*CDN, *Response, error)

UpdateTTL updates the ttl of an individual CDN

type CDNUpdateCustomDomainRequest added in v1.7.5

type CDNUpdateCustomDomainRequest struct {
	CustomDomain  string `json:"custom_domain"`
	CertificateID string `json:"certificate_id"`
}

CDNUpdateCustomDomainRequest represents a request to update the custom domain of a CDN.

type CDNUpdateTTLRequest added in v1.7.5

type CDNUpdateTTLRequest struct {
	TTL uint32 `json:"ttl"`
}

CDNUpdateTTLRequest represents a request to update the ttl of a CDN.

type Certificate added in v1.0.0

type Certificate struct {
	ID              string   `json:"id,omitempty"`
	Name            string   `json:"name,omitempty"`
	DNSNames        []string `json:"dns_names,omitempty"`
	NotAfter        string   `json:"not_after,omitempty"`
	SHA1Fingerprint string   `json:"sha1_fingerprint,omitempty"`
	Created         string   `json:"created_at,omitempty"`
	State           string   `json:"state,omitempty"`
	Type            string   `json:"type,omitempty"`
}

Certificate represents a DigitalOcean certificate configuration.

type CertificateRequest added in v1.0.0

type CertificateRequest struct {
	Name             string   `json:"name,omitempty"`
	DNSNames         []string `json:"dns_names,omitempty"`
	PrivateKey       string   `json:"private_key,omitempty"`
	LeafCertificate  string   `json:"leaf_certificate,omitempty"`
	CertificateChain string   `json:"certificate_chain,omitempty"`
	Type             string   `json:"type,omitempty"`
}

CertificateRequest represents configuration for a new certificate.

type CertificatesService added in v1.0.0

CertificatesService is an interface for managing certificates with the DigitalOcean API. See: https://docs.digitalocean.com/reference/api/api-reference/#tag/Certificates

type CertificatesServiceOp added in v1.0.0

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

CertificatesServiceOp handles communication with certificates methods of the DigitalOcean API.

func (*CertificatesServiceOp) Create added in v1.0.0

Create a new certificate with provided configuration.

func (*CertificatesServiceOp) Delete added in v1.0.0

func (c *CertificatesServiceOp) Delete(ctx context.Context, cID string) (*Response, error)

Delete a certificate by its identifier.

func (*CertificatesServiceOp) Get added in v1.0.0

Get an existing certificate by its identifier.

func (*CertificatesServiceOp) List added in v1.0.0

List all certificates.

type Client

type Client struct {

	// Base URL for API requests.
	BaseURL *url.URL

	// User agent for client
	UserAgent string

	// Rate contains the current rate limit for the client as determined by the most recent
	// API call. It is not thread-safe. Please consider using GetRate() instead.
	Rate Rate

	// Services used for communicating with the API
	Account           AccountService
	Actions           ActionsService
	Apps              AppsService
	Balance           BalanceService
	BillingHistory    BillingHistoryService
	CDNs              CDNService
	Domains           DomainsService
	Droplets          DropletsService
	DropletActions    DropletActionsService
	Images            ImagesService
	ImageActions      ImageActionsService
	Invoices          InvoicesService
	Keys              KeysService
	Regions           RegionsService
	Sizes             SizesService
	FloatingIPs       FloatingIPsService
	FloatingIPActions FloatingIPActionsService
	ReservedIPs       ReservedIPsService
	ReservedIPActions ReservedIPActionsService
	Snapshots         SnapshotsService
	Storage           StorageService
	StorageActions    StorageActionsService
	Tags              TagsService
	LoadBalancers     LoadBalancersService
	Certificates      CertificatesService
	Firewalls         FirewallsService
	Projects          ProjectsService
	Kubernetes        KubernetesService
	Registry          RegistryService
	Databases         DatabasesService
	VPCs              VPCsService
	OneClick          OneClickService
	Monitoring        MonitoringService
	Functions         FunctionsService
	// contains filtered or unexported fields
}

Client manages communication with DigitalOcean V2 API.

func New added in v1.0.0

func New(httpClient *http.Client, opts ...ClientOpt) (*Client, error)

New returns a new DigitalOcean API client instance.

func NewClient

func NewClient(httpClient *http.Client) *Client

NewClient returns a new DigitalOcean API client, using the given http.Client to perform all requests.

Users who wish to pass their own http.Client should use this method. If you're in need of further customization, the godo.New method allows more options, such as setting a custom URL or a custom user agent string.

func NewFromToken added in v1.31.0

func NewFromToken(token string) *Client

NewFromToken returns a new DigitalOcean API client with the given API token.

func (*Client) Do

func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*Response, error)

Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response will be written to v, without attempting to decode it.

func (*Client) GetRate added in v1.40.0

func (c *Client) GetRate() Rate

GetRate returns the current rate limit for the client as determined by the most recent API call. It is thread-safe.

func (*Client) NewRequest

func (c *Client) NewRequest(ctx context.Context, method, urlStr string, body interface{}) (*http.Request, error)

NewRequest creates an API request. A relative URL can be provided in urlStr, which will be resolved to the BaseURL of the Client. Relative URLS should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included in as the request body.

func (*Client) OnRequestCompleted added in v0.9.0

func (c *Client) OnRequestCompleted(rc RequestCompletionCallback)

OnRequestCompleted sets the DO API request completion callback

type ClientOpt added in v1.0.0

type ClientOpt func(*Client) error

ClientOpt are options for New.

func SetBaseURL added in v1.0.0

func SetBaseURL(bu string) ClientOpt

SetBaseURL is a client option for setting the base URL.

func SetRequestHeaders added in v1.55.0

func SetRequestHeaders(headers map[string]string) ClientOpt

SetRequestHeaders sets optional HTTP headers on the client that are sent on each HTTP request.

func SetStaticRateLimit added in v1.87.0

func SetStaticRateLimit(rps float64) ClientOpt

SetStaticRateLimit sets an optional client-side rate limiter that restricts the number of queries per second that the client can send to enforce QoS.

func SetUserAgent added in v1.0.0

func SetUserAgent(ua string) ClientOpt

SetUserAgent is a client option for setting the user agent.

type ClusterlintDiagnostic added in v1.53.0

type ClusterlintDiagnostic struct {
	CheckName string             `json:"check_name"`
	Severity  string             `json:"severity"`
	Message   string             `json:"message"`
	Object    *ClusterlintObject `json:"object"`
}

ClusterlintDiagnostic is a diagnostic returned from clusterlint.

type ClusterlintObject added in v1.53.0

type ClusterlintObject struct {
	Kind      string              `json:"kind"`
	Name      string              `json:"name"`
	Namespace string              `json:"namespace"`
	Owners    []*ClusterlintOwner `json:"owners,omitempty"`
}

ClusterlintObject is the object a clusterlint diagnostic refers to.

type ClusterlintOwner added in v1.53.0

type ClusterlintOwner struct {
	Kind string `json:"kind"`
	Name string `json:"name"`
}

ClusterlintOwner indicates the resource that owns the offending object.

type CreateProjectRequest added in v1.6.0

type CreateProjectRequest struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Purpose     string `json:"purpose"`
	Environment string `json:"environment"`
}

CreateProjectRequest represents the request to create a new project.

type CustomImageCreateRequest added in v1.7.1

type CustomImageCreateRequest struct {
	Name         string   `json:"name"`
	Url          string   `json:"url"`
	Region       string   `json:"region"`
	Distribution string   `json:"distribution,omitempty"`
	Description  string   `json:"description,omitempty"`
	Tags         []string `json:"tags,omitempty"`
}

CustomImageCreateRequest represents a request to create a custom image.

type Database added in v1.10.0

type Database struct {
	ID                 string                     `json:"id,omitempty"`
	Name               string                     `json:"name,omitempty"`
	EngineSlug         string                     `json:"engine,omitempty"`
	VersionSlug        string                     `json:"version,omitempty"`
	Connection         *DatabaseConnection        `json:"connection,omitempty"`
	PrivateConnection  *DatabaseConnection        `json:"private_connection,omitempty"`
	Users              []DatabaseUser             `json:"users,omitempty"`
	NumNodes           int                        `json:"num_nodes,omitempty"`
	SizeSlug           string                     `json:"size,omitempty"`
	DBNames            []string                   `json:"db_names,omitempty"`
	RegionSlug         string                     `json:"region,omitempty"`
	Status             string                     `json:"status,omitempty"`
	MaintenanceWindow  *DatabaseMaintenanceWindow `json:"maintenance_window,omitempty"`
	CreatedAt          time.Time                  `json:"created_at,omitempty"`
	PrivateNetworkUUID string                     `json:"private_network_uuid,omitempty"`
	Tags               []string                   `json:"tags,omitempty"`
	ProjectID          string                     `json:"project_id,omitempty"`
}

Database represents a DigitalOcean managed database product. These managed databases are usually comprised of a cluster of database nodes, a primary and 0 or more replicas. The EngineSlug is a string which indicates the type of database service. Some examples are "pg", "mysql" or "redis". A Database also includes connection information and other properties of the service like region, size and current status.

func (Database) URN added in v1.18.0

func (d Database) URN() string

URN returns a URN identifier for the database

type DatabaseBackup added in v1.10.0

type DatabaseBackup struct {
	CreatedAt     time.Time `json:"created_at,omitempty"`
	SizeGigabytes float64   `json:"size_gigabytes,omitempty"`
}

DatabaseBackup represents a database backup.

type DatabaseBackupRestore added in v1.60.0

type DatabaseBackupRestore struct {
	DatabaseName    string `json:"database_name,omitempty"`
	BackupCreatedAt string `json:"backup_created_at,omitempty"`
}

DatabaseBackupRestore contains information needed to restore a backup.

type DatabaseCA added in v1.61.0

type DatabaseCA struct {
	Certificate []byte `json:"certificate"`
}

DatabaseCA represents a database ca.

type DatabaseConnection added in v1.10.0

type DatabaseConnection struct {
	URI      string `json:"uri,omitempty"`
	Database string `json:"database,omitempty"`
	Host     string `json:"host,omitempty"`
	Port     int    `json:"port,omitempty"`
	User     string `json:"user,omitempty"`
	Password string `json:"password,omitempty"`
	SSL      bool   `json:"ssl,omitempty"`
}

DatabaseConnection represents a database connection

type DatabaseCreateDBRequest added in v1.10.0

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

DatabaseCreateDBRequest is used to create a new engine-specific database within the cluster

type DatabaseCreatePoolRequest added in v1.10.0

type DatabaseCreatePoolRequest struct {
	User     string `json:"user"`
	Name     string `json:"name"`
	Size     int    `json:"size"`
	Database string `json:"db"`
	Mode     string `json:"mode"`
}

DatabaseCreatePoolRequest is used to create a new database connection pool

type DatabaseCreateReplicaRequest added in v1.10.0

type DatabaseCreateReplicaRequest struct {
	Name               string   `json:"name"`
	Region             string   `json:"region"`
	Size               string   `json:"size"`
	PrivateNetworkUUID string   `json:"private_network_uuid"`
	Tags               []string `json:"tags,omitempty"`
}

DatabaseCreateReplicaRequest is used to create a new read-only replica

type DatabaseCreateRequest added in v1.10.0

type DatabaseCreateRequest struct {
	Name               string                 `json:"name,omitempty"`
	EngineSlug         string                 `json:"engine,omitempty"`
	Version            string                 `json:"version,omitempty"`
	SizeSlug           string                 `json:"size,omitempty"`
	Region             string                 `json:"region,omitempty"`
	NumNodes           int                    `json:"num_nodes,omitempty"`
	PrivateNetworkUUID string                 `json:"private_network_uuid"`
	Tags               []string               `json:"tags,omitempty"`
	BackupRestore      *DatabaseBackupRestore `json:"backup_restore,omitempty"`
	ProjectID          string                 `json:"project_id"`
}

DatabaseCreateRequest represents a request to create a database cluster

type DatabaseCreateUserRequest added in v1.10.0

type DatabaseCreateUserRequest struct {
	Name          string                     `json:"name"`
	MySQLSettings *DatabaseMySQLUserSettings `json:"mysql_settings,omitempty"`
}

DatabaseCreateUserRequest is used to create a new database user

type DatabaseDB added in v1.10.0

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

DatabaseDB represents an engine-specific database created within a database cluster. For SQL databases like PostgreSQL or MySQL, a "DB" refers to a database created on the RDBMS. For instance, a PostgreSQL database server can contain many database schemas, each with its own settings, access permissions and data. ListDBs will return all databases present on the server.

type DatabaseEngineOptions added in v1.83.0

type DatabaseEngineOptions struct {
	Regions  []string         `json:"regions"`
	Versions []string         `json:"versions"`
	Layouts  []DatabaseLayout `json:"layouts"`
}

DatabaseEngineOptions represents the configuration options that are available for a given database engine

type DatabaseFirewallRule added in v1.23.0

type DatabaseFirewallRule struct {
	UUID        string    `json:"uuid"`
	ClusterUUID string    `json:"cluster_uuid"`
	Type        string    `json:"type"`
	Value       string    `json:"value"`
	CreatedAt   time.Time `json:"created_at"`
}

DatabaseFirewallRule is a rule describing an inbound source to a database

type DatabaseLayout added in v1.83.0

type DatabaseLayout struct {
	NodeNum int      `json:"num_nodes"`
	Sizes   []string `json:"sizes"`
}

DatabaseLayout represents the slugs available for a given database engine at various node counts

type DatabaseMaintenanceWindow added in v1.10.0

type DatabaseMaintenanceWindow struct {
	Day         string   `json:"day,omitempty"`
	Hour        string   `json:"hour,omitempty"`
	Pending     bool     `json:"pending,omitempty"`
	Description []string `json:"description,omitempty"`
}

DatabaseMaintenanceWindow represents the maintenance_window of a database cluster

type DatabaseMigrateRequest added in v1.10.0

type DatabaseMigrateRequest struct {
	Region             string `json:"region,omitempty"`
	PrivateNetworkUUID string `json:"private_network_uuid"`
}

DatabaseMigrateRequest can be used to initiate a database migrate operation.

type DatabaseMySQLUserSettings added in v1.27.0

type DatabaseMySQLUserSettings struct {
	AuthPlugin string `json:"auth_plugin"`
}

DatabaseMySQLUserSettings contains MySQL-specific user settings

type DatabaseOptions added in v1.83.0

type DatabaseOptions struct {
	MongoDBOptions     DatabaseEngineOptions `json:"mongodb"`
	MySQLOptions       DatabaseEngineOptions `json:"mysql"`
	PostgresSQLOptions DatabaseEngineOptions `json:"pg"`
	RedisOptions       DatabaseEngineOptions `json:"redis"`
}

DatabaseOptions represents the available database engines

type DatabasePool added in v1.10.0

type DatabasePool struct {
	User              string              `json:"user"`
	Name              string              `json:"name"`
	Size              int                 `json:"size"`
	Database          string              `json:"db"`
	Mode              string              `json:"mode"`
	Connection        *DatabaseConnection `json:"connection"`
	PrivateConnection *DatabaseConnection `json:"private_connection,omitempty"`
}

DatabasePool represents a database connection pool

type DatabaseReplica added in v1.10.0

type DatabaseReplica struct {
	ID                 string              `json:"id"`
	Name               string              `json:"name"`
	Connection         *DatabaseConnection `json:"connection"`
	PrivateConnection  *DatabaseConnection `json:"private_connection,omitempty"`
	Region             string              `json:"region"`
	Status             string              `json:"status"`
	CreatedAt          time.Time           `json:"created_at"`
	PrivateNetworkUUID string              `json:"private_network_uuid,omitempty"`
	Tags               []string            `json:"tags,omitempty"`
}

DatabaseReplica represents a read-only replica of a particular database

type DatabaseResetUserAuthRequest added in v1.32.0

type DatabaseResetUserAuthRequest struct {
	MySQLSettings *DatabaseMySQLUserSettings `json:"mysql_settings,omitempty"`
}

DatabaseResetUserAuthRequest is used to reset a users DB auth

type DatabaseResizeRequest added in v1.10.0

type DatabaseResizeRequest struct {
	SizeSlug string `json:"size,omitempty"`
	NumNodes int    `json:"num_nodes,omitempty"`
}

DatabaseResizeRequest can be used to initiate a database resize operation.

type DatabaseUpdateFirewallRulesRequest added in v1.23.0

type DatabaseUpdateFirewallRulesRequest struct {
	Rules []*DatabaseFirewallRule `json:"rules"`
}

DatabaseUpdateFirewallRulesRequest is used to set the firewall rules for a database

type DatabaseUpdateMaintenanceRequest added in v1.10.0

type DatabaseUpdateMaintenanceRequest struct {
	Day  string `json:"day,omitempty"`
	Hour string `json:"hour,omitempty"`
}

DatabaseUpdateMaintenanceRequest can be used to update the database's maintenance window.

type DatabaseUser added in v1.10.0

type DatabaseUser struct {
	Name          string                     `json:"name,omitempty"`
	Role          string                     `json:"role,omitempty"`
	Password      string                     `json:"password,omitempty"`
	MySQLSettings *DatabaseMySQLUserSettings `json:"mysql_settings,omitempty"`
}

DatabaseUser represents a user in the database