godo

package module
v1.223.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: BSD-3-Clause, MIT Imports: 29 Imported by: 1,447

README

Godo

GitHub Actions CI 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/

🚀 New in v1.191.0 — AI & Inference support

godo now ships first-class support for DigitalOcean's DigitalOcean Inference: chat completions (with streaming), image generation, embeddings, batch inference, model listing, and more — all from the same Client. Jump to AI & Inference to get started.

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

You can manage API tokens at the DigitalOcean Control Panel Applications Page.

package main

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

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

Credentials for inference APIs

What matters is the credential you pass to godo.NewFromToken, not which DigitalOcean API you call:

What you're calling What you need
Infrastructure APIs (Droplets, Kubernetes, Volumes, …) A DigitalOcean API token (PAT).
Inference APIs (Chat, Models, Embeddings, ImageGenerations, Messages, Responses, BatchInference, …) A PAT created with full access scope, or a model access key.

If you only have a limited-scope PAT, infrastructure calls will work but inference calls will fail with 401. Create a new PAT with full access, or use a Model Access Key instead.

// Either credential works with godo.NewFromToken:
client := godo.NewFromToken(os.Getenv("DIGITALOCEAN_TOKEN"))  // full-access PAT
client := godo.NewFromToken(os.Getenv("MODEL_ACCESS_KEY"))    // model access key

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

Action Gateway

client.ActionGateway exposes the Action Gateway control-plane resources: tools, toolbelts, output views, MCP servers, connections, sessions, users, and end-user limits. Use a PAT with the corresponding action_gateway scopes. For example:

toolbelts, _, err := client.ActionGateway.Toolbelts.List(ctx, &godo.ActionGatewayToolbeltsListOptions{Status: "active"})
if err != nil { return err }
fmt.Println(toolbelts.Toolbelts)

session, _, err := client.ActionGateway.Sessions.CreateRuntime(ctx, &godo.ActionGatewaySessionCreateRequest{
    ActorID: "alice",
})
if err != nil { return err }
tools, _, err := session.ChatTools(ctx, nil) // action_search, action_invoke, action_code
if err != nil { return err }
completion, _, err := client.Chat.Completions.New(ctx, &godo.ChatCompletionNewParams{
    Model: "llama3.3-70b-instruct", Messages: []godo.ChatCompletionMessage{godo.UserMessage("Find recent news")}, Tools: tools,
})
if err != nil { return err }
toolMessages, _, err := session.HandleChatToolCalls(ctx, completion)
if err != nil { return err }
fmt.Println(toolMessages)

session.Tools supports direct discovery and invocation, while session.Code runs sandboxed code. MessageTools/HandleMessageToolCalls and ResponseTools/HandleResponseToolCalls integrate with the other inference formats. CreateRuntime defaults to an ask-before-executing policy; provide an explicit policy to change it. Omitted Tools enables all tools, while an empty non-nil slice enables none. MCP calls accept only HTTPS session URLs on actions.do-ai.run; WithActionGatewayMCPBaseURL overrides the origin for development or tests.

AI & Inference

Talk to models on DigitalOcean Inference with the same godo.Client.

The Serverless Inference API is available at https://inference.do-ai.run/. Use a DigitalOcean PAT with full access scope or a model access key — see the credentials note above.

Chat completion
completion, _, err := client.Chat.Completions.New(ctx, &godo.ChatCompletionNewParams{
    Model: "llama3.3-70b-instruct",
    Messages: []godo.ChatCompletionMessage{
        godo.UserMessage("Write me a haiku"),
    },
})
List models
page, _, err := client.Models.List(ctx)
for _, m := range page.Data {
    fmt.Println(m.ID)
}
Image generation
image, _, err := client.ImageGenerations.Generate(ctx, &godo.ImageGenerateParams{
    Model:  "stable-diffusion-3.5-large",
    Prompt: "A friendly cartoon shark typing on a laptop at a sunny beach",
    N:      1,
})

For streaming, embeddings, messages, responses, async invocations, batch inference, agent inference, and full runnable programs, see examples/serverless-inference/ and examples/agent-inference/.

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
}
Automatic Retries and Exponential Backoff

The Godo client can be configured to use automatic retries and exponentional backoff for requests that fail with 429 or 500-level response codes via go-retryablehttp. To configure Godo to enable usage of go-retryablehttp, the RetryConfig.RetryMax must be set.

tokenSrc := oauth2.StaticTokenSource(&oauth2.Token{
    AccessToken: "dop_v1_xxxxxx",
})

oauth_client := oauth2.NewClient(oauth2.NoContext, tokenSrc)

waitMax := godo.PtrTo(6.0)
waitMin := godo.PtrTo(3.0)

retryConfig := godo.RetryConfig{
    RetryMax:     3,
    RetryWaitMin: waitMin,
    RetryWaitMax: waitMax,
}

client, err := godo.New(oauth_client, godo.WithRetryAndBackoffs(retryConfig))

Please refer to the RetryConfig Godo documentation for more information.

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 (
	KnowledgeBasePath = "/v2/gen-ai/knowledge_bases"

	KnowledgeBaseDataSourcesPath = KnowledgeBasePath + "/%s/data_sources"
	GetKnowledgeBaseByIDPath     = KnowledgeBasePath + "/%s"
	UpdateKnowledgeBaseByIDPath  = KnowledgeBasePath + "/%s"
	DeleteKnowledgeBaseByIDPath  = KnowledgeBasePath + "/%s"
	AgentKnowledgeBasePath       = "/v2/gen-ai/agents" + "/%s/knowledge_bases/%s"
	DeleteDataSourcePath         = KnowledgeBasePath + "/%s/data_sources/%s"
	IndexingJobsPath             = "/v2/gen-ai/indexing_jobs"
	IndexingJobByIDPath          = IndexingJobsPath + "/%s"
	IndexingJobCancelPath        = IndexingJobsPath + "/%s/cancel"
	IndexingJobDataSourcesPath   = IndexingJobsPath + "/%s/data_sources"
	AnthropicAPIKeysPath         = "/v2/gen-ai/anthropic/keys"
	AnthropicAPIKeyByIDPath      = AnthropicAPIKeysPath + "/%s"
	OpenAIAPIKeysPath            = "/v2/gen-ai/openai/keys"
	UpdateFunctionRoutePath      = functionRouteBasePath + "/%s"
	DeleteFunctionRoutePath      = functionRouteBasePath + "/%s"

	UpdateModelEvaluationRunPath = modelEvaluationRunsBasePath + "/%s"
)
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 (
	GPUPartitionModeSPXNPS1 = "PARTITION_MODE_SPX_NPS1"
	GPUPartitionModeDPXNPS2 = "PARTITION_MODE_DPX_NPS2"
)

GPU partition modes supported when creating a GPU Droplet. Omitting the value (or sending an empty string) is treated as PARTITION_MODE_UNSET, i.e. a full GPU with SPX/NPS1 behavior.

View Source
const (
	InsightsChannelTypeEmail   = "CHANNEL_TYPE_EMAIL"
	InsightsChannelTypeSlack   = "CHANNEL_TYPE_SLACK"
	InsightsChannelTypeWebhook = "CHANNEL_TYPE_WEBHOOK"
)

Insights notification channel types. These are the protobuf enum values the API returns on read; create and update select the type by which config object is set.

View Source
const (
	InsightsAlertRuleStatusActive = "ALERT_RULE_STATUS_ACTIVE"
	InsightsAlertRuleStatusPaused = "ALERT_RULE_STATUS_PAUSED"
)

Insights alert rule statuses.

View Source
const (
	InsightsEvaluationWindow1m  = "EVALUATION_WINDOW_1M"
	InsightsEvaluationWindow5m  = "EVALUATION_WINDOW_5M"
	InsightsEvaluationWindow10m = "EVALUATION_WINDOW_10M"
	InsightsEvaluationWindow15m = "EVALUATION_WINDOW_15M"
	InsightsEvaluationWindow30m = "EVALUATION_WINDOW_30M"
	InsightsEvaluationWindow1h  = "EVALUATION_WINDOW_1H"
)

Insights alert evaluation windows.

View Source
const (
	InsightsThresholdOperatorEqual              = "THRESHOLD_OPERATOR_EQUAL"
	InsightsThresholdOperatorLessThanOrEqual    = "THRESHOLD_OPERATOR_LESS_THAN_OR_EQUAL"
	InsightsThresholdOperatorLessThan           = "THRESHOLD_OPERATOR_LESS_THAN"
	InsightsThresholdOperatorGreaterThan        = "THRESHOLD_OPERATOR_GREATER_THAN"
	InsightsThresholdOperatorGreaterThanOrEqual = "THRESHOLD_OPERATOR_GREATER_THAN_OR_EQUAL"
	InsightsThresholdOperatorNotEqual           = "THRESHOLD_OPERATOR_NOT_EQUAL"
)

Insights threshold operators.

View Source
const (
	InsightsFilterOperatorEqual              = "FILTER_OPERATOR_EQUAL"
	InsightsFilterOperatorNotEqual           = "FILTER_OPERATOR_NOT_EQUAL"
	InsightsFilterOperatorLessThan           = "FILTER_OPERATOR_LESS_THAN"
	InsightsFilterOperatorLessThanOrEqual    = "FILTER_OPERATOR_LESS_THAN_OR_EQUAL"
	InsightsFilterOperatorGreaterThan        = "FILTER_OPERATOR_GREATER_THAN"
	InsightsFilterOperatorGreaterThanOrEqual = "FILTER_OPERATOR_GREATER_THAN_OR_EQUAL"
)

Insights metrics-query filter operators.

View Source
const (
	InsightsReAlertDuration30m   = "RE_ALERT_DURATION_30M"
	InsightsReAlertDuration1h    = "RE_ALERT_DURATION_1H"
	InsightsReAlertDuration4h    = "RE_ALERT_DURATION_4H"
	InsightsReAlertDurationNever = "RE_ALERT_DURATION_NEVER"
)

Insights re-alert durations.

View Source
const (
	InsightsSeverityWarning  = "SEVERITY_WARNING"
	InsightsSeverityCritical = "SEVERITY_CRITICAL"
)

Insights severities used when binding a notification channel to an alert rule.

View Source
const (
	InsightsAlertInstanceStatusActive   = "active"
	InsightsAlertInstanceStatusResolved = "resolved"
)

Insights alert instance statuses. These are lowercase, unlike the protobuf enums used by alert rules and notification channels.

View Source
const (
	InsightsAlertInstanceSeverityWarning  = "warning"
	InsightsAlertInstanceSeverityCritical = "critical"
)

Insights alert instance severities.

View Source
const (
	InsightsLogsFilterOperatorEqual              = "FILTER_OPERATOR_EQ"
	InsightsLogsFilterOperatorNotEqual           = "FILTER_OPERATOR_NEQ"
	InsightsLogsFilterOperatorIn                 = "FILTER_OPERATOR_IN"
	InsightsLogsFilterOperatorExists             = "FILTER_OPERATOR_EXISTS"
	InsightsLogsFilterOperatorGreaterThanOrEqual = "FILTER_OPERATOR_GTE"
	InsightsLogsFilterOperatorLessThanOrEqual    = "FILTER_OPERATOR_LTE"
)

Insights logs filter operators.

View Source
const (
	InsightsLogsFieldScopeResource   = "FIELD_SCOPE_RESOURCE"
	InsightsLogsFieldScopeAttributes = "FIELD_SCOPE_ATTRIBUTES"
)

Insights logs field scopes.

View Source
const (
	InsightsLogsSortDirectionAscending  = "SORT_DIRECTION_ASC"
	InsightsLogsSortDirectionDescending = "SORT_DIRECTION_DESC"
)

Insights logs sort directions.

View Source
const (
	KubernetesAMDPartitionModeSPXNPS1 = "AMD_PARTITION_MODE_SPX_NPS1"
	KubernetesAMDPartitionModeDPXNPS2 = "AMD_PARTITION_MODE_DPX_NPS2"
)

Kubernetes GPU partition modes for AMD GPU node pools. Omitting the value (or sending an empty string) leaves the pool unpartitioned.

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 (
	// Load Balancer types
	LoadBalancerTypeGlobal          = "GLOBAL"
	LoadBalancerTypeRegional        = "REGIONAL"
	LoadBalancerTypeRegionalNetwork = "REGIONAL_NETWORK"

	// Load Balancer network types
	LoadBalancerNetworkTypeExternal = "EXTERNAL"
	LoadBalancerNetworkTypeInternal = "INTERNAL"

	// Load Balancer network_stack types
	LoadBalancerNetworkStackIPv4      = "IPV4"
	LoadBalancerNetworkStackDualstack = "DUALSTACK"

	// Supported TLS Cipher policies
	LoadBalancerTLSCipherPolicyDefault = "DEFAULT"
	LoadBalancerTLSCipherPolicyStrong  = "STRONG"
)
View Source
const (
	MicroVMStateUnknown     = MicroVMState("unknown")
	MicroVMStateCreating    = MicroVMState("creating")
	MicroVMStateRunning     = MicroVMState("running")
	MicroVMStatePausing     = MicroVMState("pausing")
	MicroVMStatePaused      = MicroVMState("paused")
	MicroVMStateResuming    = MicroVMState("resuming")
	MicroVMStateTerminating = MicroVMState("terminating")
	MicroVMStateTerminated  = MicroVMState("terminated")
	MicroVMStateFailed      = MicroVMState("failed")
)

Possible lifecycle states for a MicroVM.

View Source
const (
	MicroVMNetworkingUnknown = MicroVMNetworking("unknown")
	MicroVMNetworkingPublic  = MicroVMNetworking("public")
	MicroVMNetworkingVPC     = MicroVMNetworking("vpc")
)

Possible networking modes for a MicroVM.

View Source
const (
	MicroVMHTTPProtocolHTTP  = MicroVMHTTPProtocol("http")
	MicroVMHTTPProtocolHTTP2 = MicroVMHTTPProtocol("http2")
)

Possible HTTP protocol values for a MicroVM.

View Source
const (
	MicroVMURLStatusPending = MicroVMURLStatus("PENDING")
	MicroVMURLStatusActive  = MicroVMURLStatus("ACTIVE")
)

Possible statuses for a MicroVM URL.

View Source
const (
	MicroVMCheckpointStatusUnknown   = MicroVMCheckpointStatus("CHECKPOINT_UNKNOWN")
	MicroVMCheckpointStatusCreating  = MicroVMCheckpointStatus("CHECKPOINT_CREATING")
	MicroVMCheckpointStatusAvailable = MicroVMCheckpointStatus("CHECKPOINT_AVAILABLE")
	MicroVMCheckpointStatusFailed    = MicroVMCheckpointStatus("CHECKPOINT_FAILED")
	MicroVMCheckpointStatusDeleted   = MicroVMCheckpointStatus("CHECKPOINT_DELETED")
	MicroVMCheckpointStatusDeleting  = MicroVMCheckpointStatus("CHECKPOINT_DELETING")
)

Possible states for a MicroVM checkpoint.

View Source
const (
	MicroVMConsoleErrDialFailed  = "dial_failed"
	MicroVMConsoleErrStartFailed = "start_failed"
	MicroVMConsoleErrAgentError  = "agent_error"
)

Stable console WebSocket error.code values (server → client text frames).

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"
	LoadBalancerIncreaseInHTTPErrorRatePercentage5xx = "v1/insights/lbaas/increase_in_http_error_rate_percentage_5xx"
	LoadBalancerIncreaseInHTTPErrorRatePercentage4xx = "v1/insights/lbaas/increase_in_http_error_rate_percentage_4xx"
	LoadBalancerIncreaseInHTTPErrorRateCount5xx      = "v1/insights/lbaas/increase_in_http_error_rate_count_5xx"
	LoadBalancerIncreaseInHTTPErrorRateCount4xx      = "v1/insights/lbaas/increase_in_http_error_rate_count_4xx"
	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 (
	NfsShareCreating = NfsShareStatus("CREATING")
	NfsShareActive   = NfsShareStatus("ACTIVE")
	NfsShareFailed   = NfsShareStatus("FAILED")
	NfsShareDeleted  = NfsShareStatus("DELETED")
)

Possible states for an NFS share.

View Source
const (
	NfsSnapshotUnknown  = NfsSnapshotStatus("UNKNOWN")
	NfsSnapshotCreating = NfsSnapshotStatus("CREATING")
	NfsSnapshotActive   = NfsSnapshotStatus("ACTIVE")
	NfsSnapshotFailed   = NfsSnapshotStatus("FAILED")
	NfsSnapshotDeleted  = NfsSnapshotStatus("DELETED")
)

Possible states for an NFS snapshot.

View Source
const (
	NfsAccessPointCreating = NfsAccessPointStatus("ACCESS_POINT_CREATING")
	NfsAccessPointActive   = NfsAccessPointStatus("ACCESS_POINT_ACTIVE")
	NfsAccessPointFailed   = NfsAccessPointStatus("ACCESS_POINT_FAILED")
	NfsAccessPointDeleted  = NfsAccessPointStatus("ACCESS_POINT_DELETED")
)

Possible states for an NFS access point.

View Source
const (
	NfsAccessPolicyProtocolNFS  = NfsAccessPolicyProtocol("NFS")
	NfsAccessPolicyProtocolNFS4 = NfsAccessPolicyProtocol("NFS4")
)

Possible protocol values for an NFS access policy.

View Source
const (
	NfsSquashConfigNoSquash   = NfsSquashConfig("NO_SQUASH")
	NfsSquashConfigRootSquash = NfsSquashConfig("ROOT_SQUASH")
	NfsSquashConfigAllSquash  = NfsSquashConfig("ALL_SQUASH")
)

Possible squash config values for an NFS access policy.

View Source
const (
	NfsActionStatusInProgress = "IN_PROGRESS"
	NfsActionStatusCompleted  = "COMPLETED"
	NfsActionStatusFailed     = "ACTION_FAILED"
)

NfsActionStatus values as returned by the NFS API.

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 (
	RouteTypeStatic  = "STATIC"
	RouteTypeDynamic = "DYNAMIC"
)

Route types assigned by the server.

View Source
const (
	// SignalsConsentSourceAgent is per-agent consent (default).
	SignalsConsentSourceAgent = "agent"
	// SignalsConsentSourceInference is team-level consent for serverless inference traffic.
	SignalsConsentSourceInference = "inference"
)

Consent sources. A consent row is keyed by (team, source, agent_id): agent rows carry an agent_id; inference consent is team-wide and has an empty agent_id.

View Source
const (
	// SignalsDeletionTypeAgent deletes all Signals data for one agent.
	SignalsDeletionTypeAgent = "agent"
	// SignalsDeletionTypeManagedAgent is deprecated; use SignalsDeletionTypeAgent.
	SignalsDeletionTypeManagedAgent = SignalsDeletionTypeAgent
	// SignalsDeletionTypeInference deletes all Signals data for team-wide inference traffic.
	SignalsDeletionTypeInference = "inference"

	// SignalsDeletionStatusQueued means the job is waiting to be picked up.
	SignalsDeletionStatusQueued = "queued"
	// SignalsDeletionStatusRunning means the job is being processed.
	SignalsDeletionStatusRunning = "running"
	// SignalsDeletionStatusComplete means the job finished successfully.
	SignalsDeletionStatusComplete = "complete"
	// SignalsDeletionStatusFailed means the job failed; see ErrorMessage.
	SignalsDeletionStatusFailed = "failed"
)

Deletion types and job statuses used by the Signals deletion API.

View Source
const (
	// ErrVolumeCapacityLimitExceeded means the account is at its volume/snapshot capacity limit.
	ErrVolumeCapacityLimitExceeded = "capacity limit exceeded"

	// ErrVolumeAlreadyAttached means volume is already attached to an existing droplet.
	ErrVolumeAlreadyAttached = "This volume is already attached"

	// ErrDropletPendingEvent means the volume couldn't be attached because the droplet has a pending
	// volume event.
	ErrDropletPendingEvent = "Droplet already has a pending event"

	// ErrPerDropletVolumeCountLimit means number of volumes which can be attached to a droplet has reached
	// its limit.
	ErrPerDropletVolumeCountLimit = "cannot attach more volumes to the Droplet"

	// ErrAttachmentNotFound means the volume to be detached from a droplet is not attached currently.
	ErrAttachmentNotFound = "Attachment not found"
)

Block storage error codes. These constant are only supposed to be string matched against the error message which API/godo returns. Later this may return proper error codes like volume_capacity_limit_exceeded or snapshot_capacity_limit_exceeded once error responses support proper error codes.

View Source
const (
	// DefaultProject is the ID you should use if you are working with your
	// default project.
	DefaultProject = "default"
)
View Source
const (

	// HostedAgentForkMaxCount is the v1 cap on children created by one fork call.
	HostedAgentForkMaxCount = 4
)
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 CIDRSourceFirewall added in v1.92.0

func CIDRSourceFirewall(cidr string) string

CIDRSourceFirewall takes a CIDR notation IP address and prefix length string like "192.0.2.0/24" and returns a formatted cidr source firewall rule

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 IPSourceFirewall added in v1.92.0

func IPSourceFirewall(ip string) string

IPSourceFirewall takes an IP (string) and returns a formatted ip source firewall rule

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 MarshalMicroVMConsoleResize added in v1.212.0

func MarshalMicroVMConsoleResize(rows, cols uint32) ([]byte, error)

MarshalMicroVMConsoleResize encodes a client → server text frame that resizes the console PTY: {"resize":{"rows":N,"cols":M}}.

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"`
	Name            string    `json:"name,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 ActionGatewayActorLimitsResponse added in v1.216.0

type ActionGatewayActorLimitsResponse struct {
	ConfiguredLimits []ActionGatewayLimitOverride `json:"configured_limits"`
	EffectiveLimits  *ActionGatewayToolQuotas     `json:"effective_limits"`
}

ActionGatewayActorLimitsResponse contains overrides and effective quotas.

type ActionGatewayActorLimitsService added in v1.216.0

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

ActionGatewayActorLimitsService manages end-user rate-limit overrides.

func (*ActionGatewayActorLimitsService) Clear added in v1.216.0

Clear removes selected overrides using the public limits:clear action.

func (*ActionGatewayActorLimitsService) Get added in v1.216.0

Get retrieves an actor's configured and effective limits.

func (*ActionGatewayActorLimitsService) Set added in v1.216.0

Set changes selected limit categories using the public limits:set action.

type ActionGatewayClearLimitsRequest added in v1.216.0

type ActionGatewayClearLimitsRequest struct {
	Categories []string `json:"categories"`
}

ActionGatewayClearLimitsRequest selects categories to clear.

type ActionGatewayConnection added in v1.216.0

type ActionGatewayConnection struct {
	ID                   string                          `json:"id"`
	Provider             string                          `json:"provider"`
	ProviderDisplayName  string                          `json:"provider_display_name"`
	UserID               string                          `json:"user_id"`
	Status               string                          `json:"status"`
	CreatedAt            *Timestamp                      `json:"created_at"`
	UpdatedAt            *Timestamp                      `json:"updated_at"`
	RevokedAt            *Timestamp                      `json:"revoked_at"`
	ConnectionParameters map[string]interface{}          `json:"connection_parameters"`
	CredentialKind       string                          `json:"credential_kind"`
	CredentialID         string                          `json:"credential_id"`
	Network              *ActionGatewayConnectionNetwork `json:"network"`
	OAuth                *struct {
		Scopes    []string   `json:"scopes"`
		GrantedAt *Timestamp `json:"granted_at"`
	} `json:"oauth"`
	APIKey              json.RawMessage `json:"api_key"`
	Scopes              []string        `json:"scopes"`
	GrantedAt           *Timestamp      `json:"granted_at"`
	OwningUserID        string          `json:"owning_user_id"`
	OwningUserNumericID string          `json:"owning_user_numeric_id"`
}

ActionGatewayConnection describes a user's provider authorization.

type ActionGatewayConnectionAuthorization added in v1.216.0

type ActionGatewayConnectionAuthorization struct {
	Status           string     `json:"status"`
	ConnectURL       string     `json:"connect_url"`
	VerificationCode string     `json:"verification_code"`
	ExpiresAt        *Timestamp `json:"expires_at"`
}

ActionGatewayConnectionAuthorization describes an incomplete authorization.

type ActionGatewayConnectionCreateNetwork added in v1.216.0

type ActionGatewayConnectionCreateNetwork struct {
	VPC *ActionGatewayConnectionCreateVPC `json:"vpc"`
}

ActionGatewayConnectionCreateNetwork selects a VPC without output-only region.

type ActionGatewayConnectionCreateRequest added in v1.216.0

type ActionGatewayConnectionCreateRequest struct {
	Provider             string                                `json:"provider"`
	UserID               string                                `json:"user_id"`
	Scopes               []string                              `json:"scopes,omitempty"`
	ConnectionParameters map[string]interface{}                `json:"connection_parameters,omitempty"`
	Credential           *ActionGatewayConnectionCredential    `json:"credential,omitempty"`
	Network              *ActionGatewayConnectionCreateNetwork `json:"network,omitempty"`
}

ActionGatewayConnectionCreateRequest creates a provider connection.

type ActionGatewayConnectionCreateVPC added in v1.216.0

type ActionGatewayConnectionCreateVPC struct {
	VPCUUID      string                               `json:"vpc_uuid"`
	Destinations []ActionGatewayConnectionDestination `json:"destinations,omitempty"`
}

ActionGatewayConnectionCreateVPC selects a VPC on create.

type ActionGatewayConnectionCredential added in v1.216.0

type ActionGatewayConnectionCredential struct {
	DigitalOceanOAuth *struct{}                    `json:"digitalocean_oauth,omitempty"`
	TeamCredential    *ActionGatewayTeamCredential `json:"team_credential,omitempty"`
}

ActionGatewayConnectionCredential selects exactly one authorization mode.

type ActionGatewayConnectionDestination added in v1.216.0

type ActionGatewayConnectionDestination struct {
	Host           string   `json:"host"`
	Port           uint32   `json:"port"`
	AllowedIPCIDRs []string `json:"allowed_ip_cidrs"`
}

ActionGatewayConnectionDestination permits a private endpoint in a VPC.

type ActionGatewayConnectionListOptions added in v1.216.0

type ActionGatewayConnectionListOptions struct {
	Provider      string `url:"provider,omitempty"`
	UserID        string `url:"user_id,omitempty"`
	Status        string `url:"status,omitempty"`
	Sort          string `url:"sort,omitempty"`
	SortDirection string `url:"sort_direction,omitempty"`
	Page          int    `url:"page,omitempty"`
	PerPage       int    `url:"per_page,omitempty"`
}

ActionGatewayConnectionListOptions filters connections.

type ActionGatewayConnectionNetwork added in v1.216.0

type ActionGatewayConnectionNetwork struct {
	VPC *ActionGatewayConnectionVPC `json:"vpc"`
}

ActionGatewayConnectionNetwork identifies the VPC and destinations.

type ActionGatewayConnectionParameter added in v1.216.0

type ActionGatewayConnectionParameter struct {
	Key                 string   `json:"key"`
	Label               string   `json:"label"`
	Description         string   `json:"description"`
	InputKind           string   `json:"input_kind"`
	Required            bool     `json:"required"`
	Normalization       string   `json:"normalization"`
	AllowedValues       []string `json:"allowed_values"`
	AllowedHostSuffixes []string `json:"allowed_host_suffixes"`
	MaxLength           int      `json:"max_length"`
	Pattern             string   `json:"pattern"`
}

ActionGatewayConnectionParameter describes one required provider setting.

type ActionGatewayConnectionResponse added in v1.216.0

type ActionGatewayConnectionResponse struct {
	Connection    *ActionGatewayConnection              `json:"connection"`
	Authorization *ActionGatewayConnectionAuthorization `json:"authorization"`
}

ActionGatewayConnectionResponse contains one connection and any pending authorization.

type ActionGatewayConnectionVPC added in v1.216.0

type ActionGatewayConnectionVPC struct {
	VPCUUID      string                               `json:"vpc_uuid"`
	Region       string                               `json:"region,omitempty"`
	Destinations []ActionGatewayConnectionDestination `json:"destinations,omitempty"`
}

ActionGatewayConnectionVPC describes an existing VPC connection.

type ActionGatewayConnectionsResponse added in v1.216.0

type ActionGatewayConnectionsResponse struct {
	Connections []ActionGatewayConnection `json:"connections"`
	Pagination  *ActionGatewayPagination  `json:"pagination"`
}

ActionGatewayConnectionsResponse contains offset-paginated connections.

type ActionGatewayConnectionsService added in v1.216.0

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

ActionGatewayConnectionsService manages provider connections for end users.

func (*ActionGatewayConnectionsService) Create added in v1.216.0

Create creates a connection.

func (*ActionGatewayConnectionsService) Delete added in v1.216.0

Delete revokes and deletes a connection.

func (*ActionGatewayConnectionsService) Get added in v1.216.0

Get retrieves one connection.

func (*ActionGatewayConnectionsService) List added in v1.216.0

List lists connections.

type ActionGatewayCursorOptions added in v1.216.0

type ActionGatewayCursorOptions struct {
	PageSize  int    `url:"page_size,omitempty"`
	PageToken string `url:"page_token,omitempty"`
}

ActionGatewayCursorOptions selects an opaque cursor-based page.

type ActionGatewayGetToolHealthResponse added in v1.216.0

type ActionGatewayGetToolHealthResponse struct {
	Snapshot *ActionGatewayHealthSnapshot `json:"snapshot"`
	Tool     *ActionGatewayToolHealth     `json:"tool"`
	History  *ActionGatewayHealthHistory  `json:"history"`
}

ActionGatewayGetToolHealthResponse contains one tool's health and history.

type ActionGatewayGetToolbeltOptions added in v1.216.0

type ActionGatewayGetToolbeltOptions struct {
	Version   string `url:"version,omitempty"`
	PageSize  int    `url:"page_size,omitempty"`
	PageToken string `url:"page_token,omitempty"`
	Search    string `url:"search,omitempty"`
}

ActionGatewayGetToolbeltOptions selects a version and pages member details.

type ActionGatewayGetToolbeltResponse added in v1.216.0

type ActionGatewayGetToolbeltResponse struct {
	Toolbelt      *ActionGatewayToolbelt      `json:"toolbelt"`
	ToolDetails   []ActionGatewayToolbeltTool `json:"tool_details"`
	NextPageToken string                      `json:"next_page_token"`
}

ActionGatewayGetToolbeltResponse contains one toolbelt and cursor-paginated member details.

type ActionGatewayHTTPLookup added in v1.216.0

type ActionGatewayHTTPLookup struct {
	Method              string   `json:"method"`
	URL                 string   `json:"url"`
	MatchField          string   `json:"matchField"`
	MatchValue          string   `json:"matchValue"`
	MatchValueParameter string   `json:"match_value_parameter"`
	CaseInsensitive     bool     `json:"caseInsensitive"`
	TrimTrailingSlash   bool     `json:"trimTrailingSlash"`
	ExtractField        string   `json:"extractField"`
	BaseURLTemplate     string   `json:"baseUrlTemplate"`
	RequiredScopes      []string `json:"requiredScopes"`
}

ActionGatewayHTTPLookup describes HTTP-based credential resolution.

type ActionGatewayHealthHistory added in v1.216.0

type ActionGatewayHealthHistory struct {
	Resolution string `json:"resolution"`
	Stale      bool   `json:"stale"`
	Points     []struct {
		BucketStart *Timestamp                  `json:"bucket_start"`
		Health      *ActionGatewayHealthMetrics `json:"health"`
	} `json:"points"`
}

ActionGatewayHealthHistory contains per-bucket measurements.

type ActionGatewayHealthMetrics added in v1.216.0

type ActionGatewayHealthMetrics struct {
	DataStatus       string  `json:"data_status"`
	UptimePercentage float64 `json:"uptime_percentage"`
	LatencyP50MS     float64 `json:"latency_p50_ms"`
	LatencyP95MS     float64 `json:"latency_p95_ms"`
}

ActionGatewayHealthMetrics describes measured tool or provider health.

type ActionGatewayHealthOptions added in v1.216.0

type ActionGatewayHealthOptions struct {
	Provider string `url:"provider,omitempty"`
	Window   string `url:"window,omitempty"`
	Page     int    `url:"page,omitempty"`
	PerPage  int    `url:"per_page,omitempty"`
}

ActionGatewayHealthOptions filters a paginated health listing.

type ActionGatewayHealthSnapshot added in v1.216.0

type ActionGatewayHealthSnapshot struct {
	MeasuredAt *Timestamp `json:"measured_at"`
	Window     string     `json:"window"`
	Stale      bool       `json:"stale"`
}

ActionGatewayHealthSnapshot describes a health sampling window.

type ActionGatewayInferenceToolsOptions added in v1.216.0

type ActionGatewayInferenceToolsOptions struct {
	IncludeAll bool
	Names      []string
	Search     *ActionGatewayToolSearchRequest
}

ActionGatewayInferenceToolsOptions selects session tools for an inference request. By default it selects the three meta-tools.

type ActionGatewayInvokeResponse added in v1.216.0

type ActionGatewayInvokeResponse struct {
	TotalCount   int                         `json:"total_count"`
	SuccessCount int                         `json:"success_count"`
	ErrorCount   int                         `json:"error_count"`
	Results      []ActionGatewayInvokeResult `json:"results"`
}

ActionGatewayInvokeResponse contains the full invocation batch envelope.

type ActionGatewayInvokeResult added in v1.216.0

type ActionGatewayInvokeResult struct {
	Tool   string `json:"tool"`
	Result struct {
		Status string                  `json:"status"`
		Output json.RawMessage         `json:"output"`
		Error  *ActionGatewayToolError `json:"error"`
		Meta   json.RawMessage         `json:"_meta"`
	} `json:"result"`
}

ActionGatewayInvokeResult contains one item in a batch invocation.

type ActionGatewayInvokeTool added in v1.216.0

type ActionGatewayInvokeTool struct {
	Tool      string          `json:"tool"`
	Arguments json.RawMessage `json:"arguments"`
}

ActionGatewayInvokeTool describes one invocation and its JSON arguments.

type ActionGatewayLimitOverride added in v1.216.0

type ActionGatewayLimitOverride struct {
	Category          string `json:"category"`
	RequestsPerMinute string `json:"requests_per_minute"`
}

ActionGatewayLimitOverride changes one quota category.

type ActionGatewayListOptions added in v1.216.0

type ActionGatewayListOptions struct {
	Page    int `url:"page,omitempty"`
	PerPage int `url:"per_page,omitempty"`
}

ActionGatewayListOptions selects an offset-based page.

type ActionGatewayMCPServer added in v1.216.0

type ActionGatewayMCPServer struct {
	ServerRef                    string   `json:"serverRef"`
	Endpoint                     string   `json:"endpoint"`
	Transport                    string   `json:"transport"`
	CredentialRefSource          string   `json:"credentialRefSource"`
	CredentialRef                string   `json:"credentialRef"`
	SyncStatus                   string   `json:"syncStatus"`
	SyncError                    string   `json:"syncError"`
	LastSyncedAt                 string   `json:"lastSyncedAt"`
	ProtocolVersion              string   `json:"protocolVersion"`
	ToolCount                    int      `json:"toolCount"`
	CreatedAt                    string   `json:"createdAt"`
	UpdatedAt                    string   `json:"updatedAt"`
	Description                  string   `json:"description"`
	OAuthAuthorizeURL            string   `json:"oauth_authorize_url"`
	OAuthScopes                  []string `json:"oauth_scopes"`
	OAuthAuthorizationTTLSeconds string   `json:"oauth_authorization_ttl_seconds"`
}

ActionGatewayMCPServer describes a registered MCP server.

type ActionGatewayMCPServerCreateRequest added in v1.216.0

type ActionGatewayMCPServerCreateRequest struct {
	ServerRef                    string   `json:"serverRef"`
	Endpoint                     string   `json:"endpoint"`
	Transport                    string   `json:"transport,omitempty"`
	CredentialRefSource          string   `json:"credentialRefSource,omitempty"`
	Description                  string   `json:"description,omitempty"`
	CredentialRef                string   `json:"credentialRef,omitempty"`
	APIKey                       string   `json:"api_key,omitempty"`
	OAuthClientID                string   `json:"oauth_client_id,omitempty"`
	OAuthClientSecret            string   `json:"oauth_client_secret,omitempty"`
	OAuthAuthorizeURL            string   `json:"oauth_authorize_url,omitempty"`
	OAuthTokenURL                string   `json:"oauth_token_url,omitempty"`
	OAuthScopes                  []string `json:"oauth_scopes,omitempty"`
	OAuthAuthorizationTTLSeconds string   `json:"oauth_authorization_ttl_seconds,omitempty"`
}

ActionGatewayMCPServerCreateRequest registers an MCP server.

type ActionGatewayMCPServerResponse added in v1.216.0

type ActionGatewayMCPServerResponse struct {
	MCPServer *ActionGatewayMCPServer `json:"mcpServer"`
}

ActionGatewayMCPServerResponse contains one MCP server.

type ActionGatewayMCPServerResyncRequest added in v1.216.0

type ActionGatewayMCPServerResyncRequest struct {
	UserID string `json:"user_id,omitempty"`
}

ActionGatewayMCPServerResyncRequest optionally selects a user for resync.

type ActionGatewayMCPServerResyncResponse added in v1.216.0

type ActionGatewayMCPServerResyncResponse struct {
	MCPServer     *ActionGatewayMCPServer               `json:"mcpServer"`
	Tools         []ActionGatewayMCPServerTool          `json:"tools"`
	Pending       bool                                  `json:"pending"`
	Authorization *ActionGatewayConnectionAuthorization `json:"authorization"`
}

ActionGatewayMCPServerResyncResponse reports an immediate or pending resync.

type ActionGatewayMCPServerTool added in v1.216.0

type ActionGatewayMCPServerTool struct {
	Name             string `json:"name"`
	ToolSlug         string `json:"toolSlug"`
	Description      string `json:"description"`
	Enabled          bool   `json:"enabled"`
	Quarantined      bool   `json:"quarantined"`
	QuarantineReason string `json:"quarantineReason"`
	CatalogSlug      string `json:"catalogSlug"`
}

ActionGatewayMCPServerTool is a discovered MCP tool.

type ActionGatewayMCPServerToolsResponse added in v1.216.0

type ActionGatewayMCPServerToolsResponse struct {
	Tools []ActionGatewayMCPServerTool `json:"tools"`
}

ActionGatewayMCPServerToolsResponse contains discovered tools.

type ActionGatewayMCPServerToolsUpdateRequest added in v1.216.0

type ActionGatewayMCPServerToolsUpdateRequest struct {
	EnabledToolSlugs []string `json:"enabledToolSlugs"`
	UserID           string   `json:"user_id,omitempty"`
}

ActionGatewayMCPServerToolsUpdateRequest selects the enabled server tools.

type ActionGatewayMCPServerUpdateRequest added in v1.216.0

type ActionGatewayMCPServerUpdateRequest struct {
	Description string `json:"description"`
}

ActionGatewayMCPServerUpdateRequest updates a server's description.

type ActionGatewayMCPServersResponse added in v1.216.0

type ActionGatewayMCPServersResponse struct {
	MCPServers []ActionGatewayMCPServer `json:"mcpServers"`
}

ActionGatewayMCPServersResponse contains registered servers.

type ActionGatewayMCPServersService added in v1.216.0

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

ActionGatewayMCPServersService manages registered MCP servers.

func (*ActionGatewayMCPServersService) Create added in v1.216.0

Create registers an MCP server.

func (*ActionGatewayMCPServersService) Delete added in v1.216.0

Delete unregisters an MCP server.

func (*ActionGatewayMCPServersService) Get added in v1.216.0

Get retrieves one MCP server.

func (*ActionGatewayMCPServersService) List added in v1.216.0

List retrieves all registered MCP servers.

func (*ActionGatewayMCPServersService) ListTools added in v1.216.0

ListTools retrieves the discovered server tools.

func (*ActionGatewayMCPServersService) Resync added in v1.216.0

Resync refreshes a server's discovered tools; the response may be pending.

func (*ActionGatewayMCPServersService) Update added in v1.216.0

Update changes an MCP server's description.

func (*ActionGatewayMCPServersService) UpdateTools added in v1.216.0

UpdateTools changes the enabled server tools.

type ActionGatewayMCPTool added in v1.216.0

type ActionGatewayMCPTool struct {
	Name         string          `json:"name"`
	Title        string          `json:"title"`
	Description  string          `json:"description"`
	InputSchema  json.RawMessage `json:"inputSchema"`
	OutputSchema json.RawMessage `json:"outputSchema"`
}

ActionGatewayMCPTool is a session-visible MCP tool definition.

type ActionGatewayOutputView added in v1.216.0

type ActionGatewayOutputView struct {
	ViewID       string          `json:"view_id"`
	ToolID       string          `json:"tool_id"`
	Tool         string          `json:"tool"`
	Version      string          `json:"version"`
	TeamID       string          `json:"team_id"`
	Name         string          `json:"name"`
	Description  string          `json:"description"`
	Kind         string          `json:"kind"`
	Fields       []string        `json:"fields"`
	Transform    json.RawMessage `json:"transform"`
	OutputSchema json.RawMessage `json:"output_schema"`
	Audit        *struct {
		CreatedAt *Timestamp `json:"createdAt"`
		UpdatedAt *Timestamp `json:"updatedAt"`
		DeletedAt *Timestamp `json:"deletedAt"`
		CreatedBy string     `json:"createdBy"`
		UpdatedBy string     `json:"updatedBy"`
	} `json:"audit"`
	DeletedBy string `json:"deleted_by"`
}

ActionGatewayOutputView is a saved or previewed output projection.

type ActionGatewayOutputViewCreateRequest added in v1.216.0

type ActionGatewayOutputViewCreateRequest struct {
	Tool        string   `json:"tool,omitempty"`
	ToolID      string   `json:"tool_id,omitempty"`
	Name        string   `json:"name"`
	Description string   `json:"description,omitempty"`
	Fields      []string `json:"fields"`
}

ActionGatewayOutputViewCreateRequest creates an output projection.

type ActionGatewayOutputViewListOptions added in v1.216.0

type ActionGatewayOutputViewListOptions struct {
	Tool      string `url:"tool,omitempty"`
	ToolID    string `url:"tool_id,omitempty"`
	PageSize  int    `url:"page_size,omitempty"`
	PageToken string `url:"page_token,omitempty"`
}

ActionGatewayOutputViewListOptions filters and pages output views.

type ActionGatewayOutputViewPreviewRequest added in v1.216.0

type ActionGatewayOutputViewPreviewRequest struct {
	Tool        string   `json:"tool,omitempty"`
	ToolID      string   `json:"tool_id,omitempty"`
	Name        string   `json:"name,omitempty"`
	Description string   `json:"description,omitempty"`
	Fields      []string `json:"fields"`
}

ActionGatewayOutputViewPreviewRequest previews an output projection without saving it.

type ActionGatewayOutputViewResponse added in v1.216.0

type ActionGatewayOutputViewResponse struct {
	View *ActionGatewayOutputView `json:"view"`
}

ActionGatewayOutputViewResponse contains one view.

type ActionGatewayOutputViewsResponse added in v1.216.0

type ActionGatewayOutputViewsResponse struct {
	Views         []ActionGatewayOutputView `json:"views"`
	ToolID        string                    `json:"tool_id"`
	Tool          string                    `json:"tool"`
	Version       string                    `json:"version"`
	NextPageToken string                    `json:"next_page_token"`
}

ActionGatewayOutputViewsResponse contains cursor-paginated views.

type ActionGatewayOutputViewsService added in v1.216.0

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

ActionGatewayOutputViewsService manages tool output projections.

func (*ActionGatewayOutputViewsService) Create added in v1.216.0

Create saves an output view.

func (*ActionGatewayOutputViewsService) Delete added in v1.216.0

Delete deletes an output view.

func (*ActionGatewayOutputViewsService) Get added in v1.216.0

Get retrieves an output view.

func (*ActionGatewayOutputViewsService) List added in v1.216.0

List retrieves cursor-paginated output views.

func (*ActionGatewayOutputViewsService) Preview added in v1.216.0

Preview validates an output view without saving it.

type ActionGatewayPagination added in v1.216.0

type ActionGatewayPagination struct {
	Page    int `json:"page"`
	PerPage int `json:"per_page"`
	Total   int `json:"total"`
}

ActionGatewayPagination describes offset-based list results.

type ActionGatewayProtocolError added in v1.216.0

type ActionGatewayProtocolError struct {
	Message string
	Code    int
	Data    json.RawMessage
}

ActionGatewayProtocolError reports a malformed or failed MCP JSON-RPC response.

func (*ActionGatewayProtocolError) Error added in v1.216.0

func (err *ActionGatewayProtocolError) Error() string

type ActionGatewayProvider added in v1.216.0

type ActionGatewayProvider struct {
	Name                 string                             `json:"name"`
	DisplayName          string                             `json:"display_name"`
	Description          string                             `json:"description"`
	AuthTypes            []string                           `json:"auth_types"`
	AuthType             string                             `json:"auth_type"`
	Scopes               []string                           `json:"scopes"`
	ConnectionParameters []ActionGatewayConnectionParameter `json:"connection_parameters"`
	CredentialParameters []ActionGatewayConnectionParameter `json:"credential_parameters"`
}

ActionGatewayProvider describes a tool provider and its connection requirements.

type ActionGatewayProviderHealth added in v1.216.0

type ActionGatewayProviderHealth struct {
	Provider string                      `json:"provider"`
	Health   *ActionGatewayHealthMetrics `json:"health"`
}

ActionGatewayProviderHealth is a provider's health summary.

type ActionGatewayProviderHealthResponse added in v1.216.0

type ActionGatewayProviderHealthResponse struct {
	Snapshot   *ActionGatewayHealthSnapshot  `json:"snapshot"`
	Providers  []ActionGatewayProviderHealth `json:"providers"`
	Pagination *ActionGatewayPagination      `json:"pagination"`
}

ActionGatewayProviderHealthResponse contains paginated provider health.

type ActionGatewayProviderSearchOptions added in v1.216.0

type ActionGatewayProviderSearchOptions struct {
	Query     string `url:"query,omitempty"`
	PageSize  int    `url:"page_size,omitempty"`
	PageToken string `url:"page_token,omitempty"`
}

ActionGatewayProviderSearchOptions filters provider search.

type ActionGatewayProvidersResponse added in v1.216.0

type ActionGatewayProvidersResponse struct {
	Providers []ActionGatewayProvider `json:"providers"`
}

ActionGatewayProvidersResponse contains providers.

type ActionGatewayResponseToolOutput added in v1.216.0

type ActionGatewayResponseToolOutput struct {
	Type   string `json:"type"`
	CallID string `json:"call_id"`
	Output string `json:"output"`
}

ActionGatewayResponseToolOutput is a function_call_output item for Responses input.

type ActionGatewaySearchProvidersResponse added in v1.216.0

type ActionGatewaySearchProvidersResponse struct {
	Providers     []ActionGatewayProvider `json:"providers"`
	NextPageToken string                  `json:"next_page_token"`
}

ActionGatewaySearchProvidersResponse contains cursor-paginated provider hits.

type ActionGatewaySearchSessionsResponse added in v1.216.0

type ActionGatewaySearchSessionsResponse struct {
	Sessions      []ActionGatewaySessionRecord `json:"sessions"`
	NextPageToken string                       `json:"next_page_token"`
}

ActionGatewaySearchSessionsResponse contains cursor-paginated sessions.

type ActionGatewaySearchToolbeltsResponse added in v1.216.0

type ActionGatewaySearchToolbeltsResponse struct {
	Toolbelts     []ActionGatewayToolbeltSummary `json:"toolbelts"`
	NextPageToken string                         `json:"next_page_token"`
}

ActionGatewaySearchToolbeltsResponse contains cursor-paginated search results.

type ActionGatewaySearchToolsResponse added in v1.216.0

type ActionGatewaySearchToolsResponse struct {
	Tools         []ActionGatewayToolSearchResult `json:"tools"`
	NextPageToken string                          `json:"next_page_token"`
}

ActionGatewaySearchToolsResponse contains cursor-paginated tool hits.

type ActionGatewayService added in v1.216.0

ActionGatewayService groups the public Action Gateway control-plane resources.

type ActionGatewaySession added in v1.216.0

type ActionGatewaySession struct {
	Record  *ActionGatewaySessionRecord
	MCPURL  string
	ActorID string
	Tools   *ActionGatewaySessionTools
	Code    *ActionGatewaySessionCode
	// contains filtered or unexported fields
}

ActionGatewaySession is a control-plane session bound to its MCP endpoint.

func (*ActionGatewaySession) Approve added in v1.216.0

func (session *ActionGatewaySession) Approve(ctx context.Context, approvalID string) (json.RawMessage, *Response, error)

Approve approves a pending tool invocation.

func (*ActionGatewaySession) ChatTools added in v1.216.0

ChatTools returns tools ready for ChatCompletionNewParams.Tools.

func (*ActionGatewaySession) Deny added in v1.216.0

func (session *ActionGatewaySession) Deny(ctx context.Context, approvalID string) (json.RawMessage, *Response, error)

Deny denies a pending tool invocation.

func (*ActionGatewaySession) ExecuteToolCalls added in v1.216.0

func (session *ActionGatewaySession) ExecuteToolCalls(ctx context.Context, calls []ActionGatewayToolCall, rationale string) ([]json.RawMessage, *Response, error)

ExecuteToolCalls executes meta-tools and batches concrete tool calls. Individual failures are returned as error payloads for the model; transport failures return an error.

func (*ActionGatewaySession) HandleChatToolCalls added in v1.216.0

func (session *ActionGatewaySession) HandleChatToolCalls(ctx context.Context, completion *ChatCompletion) ([]ChatCompletionMessage, *Response, error)

HandleChatToolCalls returns Chat Completions tool messages for the first choice.

func (*ActionGatewaySession) HandleMessageToolCalls added in v1.216.0

func (session *ActionGatewaySession) HandleMessageToolCalls(ctx context.Context, message *Message) ([]MessageParam, *Response, error)

HandleMessageToolCalls returns a single Messages user turn of tool results.

func (*ActionGatewaySession) HandleResponseToolCalls added in v1.216.0

func (session *ActionGatewaySession) HandleResponseToolCalls(ctx context.Context, responseBody *ResponsesResponse) ([]ActionGatewayResponseToolOutput, *Response, error)

HandleResponseToolCalls returns Responses function-call output items.

func (*ActionGatewaySession) MessageTools added in v1.216.0

MessageTools returns tools ready for MessageNewParams.Tools.

func (*ActionGatewaySession) ResponseTools added in v1.216.0

ResponseTools returns tools ready for ResponseNewParams.Tools.

type ActionGatewaySessionCode added in v1.216.0

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

ActionGatewaySessionCode executes sandboxed Python through action_code.

func (*ActionGatewaySessionCode) Execute added in v1.216.0

func (code *ActionGatewaySessionCode) Execute(ctx context.Context, source, thought string) (json.RawMessage, *Response, error)

Execute runs code in the gateway sandbox.

type ActionGatewaySessionCreateRequest added in v1.216.0

type ActionGatewaySessionCreateRequest struct {
	Name     string                        `json:"name"`
	ActorID  string                        `json:"actorId,omitempty"`
	Policy   *ActionGatewaySessionPolicy   `json:"policy,omitempty"`
	Tools    []string                      `json:"tools,omitempty"`
	Config   json.RawMessage               `json:"config,omitempty"`
	Network  *ActionGatewaySessionNetwork  `json:"network,omitempty"`
	Insights *ActionGatewaySessionInsights `json:"insights,omitempty"`
}

ActionGatewaySessionCreateRequest is the wire request for creating a session. Nil Tools enables all tools; a non-nil empty slice enables none.

func (ActionGatewaySessionCreateRequest) MarshalJSON added in v1.216.0

func (body ActionGatewaySessionCreateRequest) MarshalJSON() ([]byte, error)

MarshalJSON preserves an explicitly empty tools selection on create.

type ActionGatewaySessionCreateResponse added in v1.216.0

type ActionGatewaySessionCreateResponse struct {
	Session *ActionGatewaySessionRecord `json:"session"`
	MCPURL  string                      `json:"mcpUrl"`
	Tools   []string                    `json:"tools"`
}

ActionGatewaySessionCreateResponse contains the new session and pinned MCP URL.

type ActionGatewaySessionInsights added in v1.216.0

type ActionGatewaySessionInsights struct {
	Metrics *bool `json:"metrics,omitempty"`
	Logs    *bool `json:"logs,omitempty"`
	Traces  *bool `json:"traces,omitempty"`
}

ActionGatewaySessionInsights controls session telemetry.

type ActionGatewaySessionListOptions added in v1.216.0

type ActionGatewaySessionListOptions struct {
	EndUserID string `url:"end_user_id,omitempty"`
	Page      int    `url:"page,omitempty"`
	PerPage   int    `url:"per_page,omitempty"`
}

ActionGatewaySessionListOptions filters sessions by end user.

type ActionGatewaySessionNetwork added in v1.216.0

type ActionGatewaySessionNetwork struct {
	VPCUUID string `json:"vpcUuid"`
}

ActionGatewaySessionNetwork places a session on a VPC.

type ActionGatewaySessionPolicy added in v1.216.0

type ActionGatewaySessionPolicy struct {
	DefaultAction string                           `json:"defaultAction,omitempty"`
	Rules         []ActionGatewaySessionPolicyRule `json:"rules,omitempty"`
}

ActionGatewaySessionPolicy controls tool permissions.

type ActionGatewaySessionPolicyRule added in v1.216.0

type ActionGatewaySessionPolicyRule struct {
	Tool   string            `json:"tool"`
	Match  map[string]string `json:"match,omitempty"`
	Action string            `json:"action"`
}

ActionGatewaySessionPolicyRule selects a tool and allowed argument matches.

type ActionGatewaySessionRecord added in v1.216.0

type ActionGatewaySessionRecord struct {
	SessionURN string                      `json:"sessionUrn"`
	Name       string                      `json:"name"`
	ActorID    string                      `json:"actorId"`
	Policy     *ActionGatewaySessionPolicy `json:"policy"`
	Tools      *struct {
		References []ActionGatewaySessionToolReference `json:"references"`
	} `json:"tools"`
	Config              json.RawMessage               `json:"config"`
	Network             *ActionGatewaySessionNetwork  `json:"network"`
	Insights            *ActionGatewaySessionInsights `json:"insights"`
	AgentURN            string                        `json:"agentUrn"`
	AgentName           string                        `json:"agentName"`
	CreatedAt           *Timestamp                    `json:"createdAt"`
	UpdatedAt           *Timestamp                    `json:"updatedAt"`
	OwningUserID        string                        `json:"owning_user_id"`
	OwningUserNumericID string                        `json:"owning_user_numeric_id"`
}

ActionGatewaySessionRecord is the public control-plane session representation.

type ActionGatewaySessionSearchOptions added in v1.216.0

type ActionGatewaySessionSearchOptions struct {
	Query     string `url:"query,omitempty"`
	EndUserID string `url:"end_user_id,omitempty"`
	PageSize  int    `url:"page_size,omitempty"`
	PageToken string `url:"page_token,omitempty"`
}

ActionGatewaySessionSearchOptions searches sessions by query and user.

type ActionGatewaySessionToolReference added in v1.216.0

type ActionGatewaySessionToolReference struct {
	Kind    string `json:"kind"`
	Name    string `json:"name"`
	Version string `json:"version"`
}

ActionGatewaySessionToolReference is a pinned tool or toolbelt reference.

type ActionGatewaySessionTools added in v1.216.0

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

ActionGatewaySessionTools discovers and invokes bound session tools.

func (*ActionGatewaySessionTools) Call added in v1.216.0

func (tools *ActionGatewaySessionTools) Call(ctx context.Context, name string, arguments interface{}) (json.RawMessage, *Response, error)

Call invokes one MCP tool directly, including the gateway meta-tools.

func (*ActionGatewaySessionTools) Invoke added in v1.216.0

Invoke runs one to ten tools and retains individual failures in the envelope.

func (*ActionGatewaySessionTools) InvokeOne added in v1.216.0

func (tools *ActionGatewaySessionTools) InvokeOne(ctx context.Context, name string, arguments json.RawMessage, rationale string) (json.RawMessage, *Response, error)

InvokeOne invokes a single tool and returns its output or individual failure.

func (*ActionGatewaySessionTools) List added in v1.216.0

func (tools *ActionGatewaySessionTools) List(ctx context.Context, includeAll bool) ([]ActionGatewayMCPTool, *Response, error)

List retrieves the three meta-tools by default; includeAll also retrieves concrete tools.

func (*ActionGatewaySessionTools) Search added in v1.216.0

Search discovers catalog tools by use case.

type ActionGatewaySessionsResponse added in v1.216.0

type ActionGatewaySessionsResponse struct {
	Sessions   []ActionGatewaySessionRecord `json:"sessions"`
	Pagination *ActionGatewayPagination     `json:"pagination"`
}

ActionGatewaySessionsResponse contains offset-paginated sessions.

type ActionGatewaySessionsService added in v1.216.0

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

ActionGatewaySessionsService manages control-plane session records.

func (*ActionGatewaySessionsService) Create added in v1.216.0

Create creates a control-plane session.

func (*ActionGatewaySessionsService) CreateRuntime added in v1.216.0

CreateRuntime creates and binds a session to its MCP endpoint. It supplies a generated name and an ask-by-default policy when those are omitted.

func (*ActionGatewaySessionsService) Delete added in v1.216.0

Delete deletes a session by URN.

func (*ActionGatewaySessionsService) List added in v1.216.0

List lists sessions.

func (*ActionGatewaySessionsService) Search added in v1.216.0

Search searches sessions using cursor pagination.

type ActionGatewaySetLimitsRequest added in v1.216.0

type ActionGatewaySetLimitsRequest struct {
	Overrides []ActionGatewayLimitOverride `json:"overrides"`
}

ActionGatewaySetLimitsRequest supplies one or more overrides.

type ActionGatewayTeamCredential added in v1.216.0

type ActionGatewayTeamCredential struct {
	CredentialID string `json:"credential_id"`
}

ActionGatewayTeamCredential references a previously registered team credential.

type ActionGatewayTool added in v1.216.0

type ActionGatewayTool struct {
	Name           string                        `json:"name"`
	ToolkitID      string                        `json:"toolkitId"`
	ToolSlug       string                        `json:"toolSlug"`
	Title          string                        `json:"title"`
	Description    string                        `json:"description"`
	Version        string                        `json:"version"`
	InputSchema    json.RawMessage               `json:"inputSchema"`
	OutputSchema   json.RawMessage               `json:"outputSchema"`
	Annotations    *ActionGatewayToolAnnotations `json:"annotations"`
	Parallelizable bool                          `json:"parallelizable"`
	StreamingSafe  bool                          `json:"streamingSafe"`
}

ActionGatewayTool describes a catalog tool.

type ActionGatewayToolAnnotations added in v1.216.0

type ActionGatewayToolAnnotations struct {
	Title           string `json:"title"`
	ReadOnlyHint    bool   `json:"readOnlyHint"`
	IdempotentHint  bool   `json:"idempotentHint"`
	OpenWorldHint   bool   `json:"openWorldHint"`
	DestructiveHint bool   `json:"destructiveHint"`
}

ActionGatewayToolAnnotations describes a tool's behavioral hints.

type ActionGatewayToolAuth added in v1.216.0

type ActionGatewayToolAuth struct {
	Modes                  []string `json:"modes"`
	Provider               string   `json:"provider"`
	Scopes                 []string `json:"scopes"`
	CredentialBinding      string   `json:"credentialBinding"`
	CredentialRefSource    string   `json:"credentialRefSource"`
	DOManagedCredentialRef string   `json:"doManagedCredentialRef"`
	Injection              *struct {
		Location string `json:"location"`
		Name     string `json:"name"`
		Scheme   string `json:"scheme"`
	} `json:"injection"`
	BaseURLResolution *struct {
		HTTPLookup *ActionGatewayHTTPLookup `json:"httpLookup"`
	} `json:"baseUrlResolution"`
	HeaderResolution []struct {
		HeaderName string                   `json:"headerName"`
		HTTPLookup *ActionGatewayHTTPLookup `json:"httpLookup"`
	} `json:"headerResolution"`
	TeamAPIKey *struct {
		TokenExchange *struct {
			Method        string `json:"method"`
			URLTemplate   string `json:"urlTemplate"`
			ExtractField  string `json:"extractField"`
			BodyParameter string `json:"bodyParameter"`
		} `json:"tokenExchange"`
	} `json:"teamApiKey"`
}

ActionGatewayToolAuth describes a definition's authentication requirements.

type ActionGatewayToolCall added in v1.216.0

type ActionGatewayToolCall struct {
	ID        string
	Name      string
	Arguments json.RawMessage
}

ActionGatewayToolCall is a normalized model-requested tool invocation.

type ActionGatewayToolClassification added in v1.216.0

type ActionGatewayToolClassification struct {
	Operation   string   `json:"operation"`
	Risk        string   `json:"risk"`
	DataClasses []string `json:"dataClasses"`
}

ActionGatewayToolClassification describes a tool's risk and data classes.

type ActionGatewayToolDefinition added in v1.216.0

type ActionGatewayToolDefinition struct {
	ToolID         string                           `json:"toolId"`
	Name           string                           `json:"name"`
	ToolkitID      string                           `json:"toolkitId"`
	ToolSlug       string                           `json:"toolSlug"`
	Title          string                           `json:"title"`
	Description    string                           `json:"description"`
	InputSchema    json.RawMessage                  `json:"inputSchema"`
	OutputSchema   json.RawMessage                  `json:"outputSchema"`
	Annotations    *ActionGatewayToolAnnotations    `json:"annotations"`
	Version        string                           `json:"version"`
	SchemaVersion  string                           `json:"schemaVersion"`
	Status         string                           `json:"status"`
	Parallelizable bool                             `json:"parallelizable"`
	StreamingSafe  bool                             `json:"streamingSafe"`
	Auth           *ActionGatewayToolAuth           `json:"auth"`
	Execution      *ActionGatewayToolExecution      `json:"execution"`
	Transform      *ActionGatewayToolTransform      `json:"transform"`
	Policy         *ActionGatewayToolPolicy         `json:"policy"`
	Reliability    *ActionGatewayToolReliability    `json:"reliability"`
	Hooks          *ActionGatewayToolHooks          `json:"hooks"`
	Classification *ActionGatewayToolClassification `json:"classification"`
	FlipperName    string                           `json:"flipperName"`
	Tags           []string                         `json:"tags"`
	ProviderKind   string                           `json:"providerKind"`
}

ActionGatewayToolDefinition is the full public catalog definition.

type ActionGatewayToolError added in v1.216.0

type ActionGatewayToolError struct {
	Message      string          `json:"message"`
	Class        string          `json:"class,omitempty"`
	Retriable    bool            `json:"retriable,omitempty"`
	RecoveryHint string          `json:"recovery_hint,omitempty"`
	InvocationID string          `json:"invocation_id,omitempty"`
	Meta         json.RawMessage `json:"_meta,omitempty"`
}

ActionGatewayToolError reports an individual failed tool invocation.

func (*ActionGatewayToolError) Error added in v1.216.0

func (err *ActionGatewayToolError) Error() string

type ActionGatewayToolExecution added in v1.216.0

type ActionGatewayToolExecution struct {
	Type           string `json:"type"`
	AdapterVersion string `json:"adapterVersion"`
	ConfigRef      string `json:"configRef"`
	HTTP           *struct {
		BaseURL             string   `json:"baseUrl"`
		Path                string   `json:"path"`
		Method              string   `json:"method"`
		AllowedHosts        []string `json:"allowedHosts"`
		RequestEncoding     string   `json:"requestEncoding"`
		ResponseFormat      string   `json:"responseFormat"`
		AllowedHostSuffixes []string `json:"allowed_host_suffixes"`
	} `json:"http"`
	MCP *struct {
		Endpoint            string   `json:"endpoint"`
		ToolName            string   `json:"toolName"`
		Transport           string   `json:"transport"`
		ServerRef           string   `json:"serverRef"`
		AllowedHosts        []string `json:"allowedHosts"`
		AllowedHostSuffixes []string `json:"allowed_host_suffixes"`
	} `json:"mcp"`
}

ActionGatewayToolExecution describes a tool execution adapter.

type ActionGatewayToolHealth added in v1.216.0

type ActionGatewayToolHealth struct {
	ToolSlug string                      `json:"tool_slug"`
	Provider string                      `json:"provider"`
	Health   *ActionGatewayHealthMetrics `json:"health"`
}

ActionGatewayToolHealth is a tool's health summary.

type ActionGatewayToolHealthOptions added in v1.216.0

type ActionGatewayToolHealthOptions struct {
	Window         string `url:"window,omitempty"`
	IncludeHistory bool   `url:"include_history,omitempty"`
}

ActionGatewayToolHealthOptions selects a tool's health window and history.

type ActionGatewayToolHealthResponse added in v1.216.0

type ActionGatewayToolHealthResponse struct {
	Snapshot   *ActionGatewayHealthSnapshot `json:"snapshot"`
	Tools      []ActionGatewayToolHealth    `json:"tools"`
	Pagination *ActionGatewayPagination     `json:"pagination"`
}

ActionGatewayToolHealthResponse contains paginated tool health.

type ActionGatewayToolHooks added in v1.216.0

type ActionGatewayToolHooks struct {
	Usage *struct {
		Billable bool `json:"billable"`
		Meters   []struct {
			SKU            string `json:"sku"`
			Unit           string `json:"unit"`
			QuantitySource string `json:"quantitySource"`
		} `json:"meters"`
	} `json:"usage"`
}

ActionGatewayToolHooks describes billing hooks.

type ActionGatewayToolListOptions added in v1.216.0

type ActionGatewayToolListOptions struct {
	ToolkitID string `url:"toolkit_id,omitempty"`
	Page      int    `url:"page,omitempty"`
	PerPage   int    `url:"per_page,omitempty"`
}

ActionGatewayToolListOptions filters the tool catalog.

type ActionGatewayToolPolicy added in v1.216.0

type ActionGatewayToolPolicy struct {
	Permission string `json:"permission"`
}

ActionGatewayToolPolicy describes a tool's permission classification.

type ActionGatewayToolQuery added in v1.216.0

type ActionGatewayToolQuery struct {
	UseCase     string `json:"use_case"`
	KnownFields string `json:"known_fields,omitempty"`
}

ActionGatewayToolQuery describes a use case to search for tools.

type ActionGatewayToolQuotas added in v1.216.0

type ActionGatewayToolQuotas struct {
	WebSearchRequestsPerMinute          string `json:"web_search_requests_per_minute"`
	WebFetchRequestsPerMinute           string `json:"web_fetch_requests_per_minute"`
	NativeToolCallsRequestsPerMinute    string `json:"native_tool_calls_requests_per_minute"`
	NonNativeToolCallsRequestsPerMinute string `json:"non_native_tool_calls_requests_per_minute"`
}

ActionGatewayToolQuotas lists effective per-minute limits.

type ActionGatewayToolReliability added in v1.216.0

type ActionGatewayToolReliability struct {
	TimeoutMS      int    `json:"timeoutMs"`
	MaxOutputBytes string `json:"maxOutputBytes"`
	Retry          *struct {
		MaxAttempts     int      `json:"maxAttempts"`
		Backoff         string   `json:"backoff"`
		RetryOn         []string `json:"retryOn"`
		HonorRetryAfter bool     `json:"honorRetryAfter"`
		BackoffPolicy   *struct {
			InitialMS  string  `json:"initialMs"`
			Multiplier float64 `json:"multiplier"`
			MaxMS      string  `json:"maxMs"`
			Jitter     string  `json:"jitter"`
		} `json:"backoffPolicy"`
		Replay *struct {
			Mode string `json:"mode"`
		} `json:"replay"`
		Billable *struct {
			Enabled bool `json:"enabled"`
		} `json:"billable"`
	} `json:"retry"`
	ProviderRateLimit *struct {
		Scope string `json:"scope"`
	} `json:"provider_rate_limit"`
}

ActionGatewayToolReliability describes timeouts and retry settings.

type ActionGatewayToolSearchOptions added in v1.216.0

type ActionGatewayToolSearchOptions struct {
	Query     string   `url:"query,omitempty"`
	Providers []string `url:"provider,omitempty"`
	Toolbelt  string   `url:"toolbelt,omitempty"`
	PageSize  int      `url:"page_size,omitempty"`
	PageToken string   `url:"page_token,omitempty"`
}

ActionGatewayToolSearchOptions filters the cursor-based tool search.

type ActionGatewayToolSearchRequest added in v1.216.0

type ActionGatewayToolSearchRequest struct {
	Queries   []ActionGatewayToolQuery `json:"queries"`
	Providers []string                 `json:"providers,omitempty"`
	Tags      []string                 `json:"tags,omitempty"`
	Limit     *int                     `json:"limit,omitempty"`
}

ActionGatewayToolSearchRequest specifies use cases and optional filters.

type ActionGatewayToolSearchResult added in v1.216.0

type ActionGatewayToolSearchResult struct {
	ToolSlug    string `json:"tool_slug"`
	Name        string `json:"name"`
	Title       string `json:"title"`
	Description string `json:"description"`
	Provider    string `json:"provider"`
	Category    string `json:"category"`
	Version     int    `json:"version"`
}

ActionGatewayToolSearchResult is a compact search hit.

type ActionGatewayToolTransform added in v1.216.0

type ActionGatewayToolTransform struct {
	Language string          `json:"language"`
	Input    json.RawMessage `json:"input"`
	Output   json.RawMessage `json:"output"`
}

ActionGatewayToolTransform describes public input and output mappings.

type ActionGatewayToolbelt added in v1.216.0

type ActionGatewayToolbelt struct {
	Name            string     `json:"name"`
	Version         string     `json:"version"`
	DisplayName     string     `json:"display_name"`
	Description     string     `json:"description"`
	Tools           []string   `json:"tools"`
	Status          string     `json:"status"`
	Reference       string     `json:"reference"`
	ReferenceLatest string     `json:"reference_latest"`
	ToolCount       int        `json:"tool_count"`
	CreatedAt       *Timestamp `json:"created_at"`
	UpdatedAt       *Timestamp `json:"updated_at"`
}

ActionGatewayToolbelt is an immutable version of a toolbelt.

type ActionGatewayToolbeltCreateRequest added in v1.216.0

type ActionGatewayToolbeltCreateRequest struct {
	Name        string   `json:"name"`
	Version     string   `json:"version,omitempty"`
	DisplayName string   `json:"display_name,omitempty"`
	Description string   `json:"description,omitempty"`
	Tools       []string `json:"tools,omitempty"`
}

ActionGatewayToolbeltCreateRequest creates a toolbelt.

type ActionGatewayToolbeltProvider added in v1.216.0

type ActionGatewayToolbeltProvider struct {
	Provider    string     `json:"provider"`
	ToolCount   int        `json:"tool_count"`
	ID          string     `json:"id"`
	Name        string     `json:"name"`
	Description string     `json:"description"`
	Categories  []string   `json:"categories"`
	CreatedAt   *Timestamp `json:"created_at"`
}

ActionGatewayToolbeltProvider describes a provider in a toolbelt.

type ActionGatewayToolbeltProviderOptions added in v1.216.0

type ActionGatewayToolbeltProviderOptions struct {
	Version string `url:"version,omitempty"`
	Page    int    `url:"page,omitempty"`
	PerPage int    `url:"per_page,omitempty"`
	Search  string `url:"search,omitempty"`
}

ActionGatewayToolbeltProviderOptions selects a version and offset page.

type ActionGatewayToolbeltProviderToolsResponse added in v1.216.0

type ActionGatewayToolbeltProviderToolsResponse struct {
	Tools      []ActionGatewayToolbeltTool `json:"tools"`
	Pagination *ActionGatewayPagination    `json:"pagination"`
}

ActionGatewayToolbeltProviderToolsResponse contains tools for a provider.

type ActionGatewayToolbeltProvidersResponse added in v1.216.0

type ActionGatewayToolbeltProvidersResponse struct {
	Toolbelt   *ActionGatewayToolbelt          `json:"toolbelt"`
	Providers  []ActionGatewayToolbeltProvider `json:"providers"`
	Pagination *ActionGatewayPagination        `json:"pagination"`
}

ActionGatewayToolbeltProvidersResponse contains a toolbelt's providers.

type ActionGatewayToolbeltResponse added in v1.216.0

type ActionGatewayToolbeltResponse struct {
	Toolbelt *ActionGatewayToolbelt `json:"toolbelt"`
}

ActionGatewayToolbeltResponse contains the resulting toolbelt.

type ActionGatewayToolbeltSummary added in v1.216.0

type ActionGatewayToolbeltSummary struct {
	Name            string     `json:"name"`
	DisplayName     string     `json:"display_name"`
	Description     string     `json:"description"`
	LatestVersion   string     `json:"latest_version"`
	VersionCount    int        `json:"version_count"`
	ToolCount       int        `json:"tool_count"`
	Status          string     `json:"status"`
	ReferenceLatest string     `json:"reference_latest"`
	UpdatedAt       *Timestamp `json:"updated_at"`
}

ActionGatewayToolbeltSummary summarizes the latest version.

type ActionGatewayToolbeltTool added in v1.216.0

type ActionGatewayToolbeltTool struct {
	ToolSlug    string `json:"tool_slug"`
	Name        string `json:"name"`
	Title       string `json:"title"`
	Description string `json:"description"`
	Provider    string `json:"provider"`
	Category    string `json:"category"`
	Version     int    `json:"version"`
}

ActionGatewayToolbeltTool describes one pinned tool.

type ActionGatewayToolbeltToolsRequest added in v1.216.0

type ActionGatewayToolbeltToolsRequest struct {
	Tools []string `json:"tools"`
}

ActionGatewayToolbeltToolsRequest modifies a toolbelt's members.

type ActionGatewayToolbeltsListOptions added in v1.216.0

type ActionGatewayToolbeltsListOptions struct {
	Status  string `url:"status,omitempty"`
	Page    int    `url:"page,omitempty"`
	PerPage int    `url:"per_page,omitempty"`
}

ActionGatewayToolbeltsListOptions filters an offset-based toolbelt list.

type ActionGatewayToolbeltsResponse added in v1.216.0

type ActionGatewayToolbeltsResponse struct {
	Toolbelts  []ActionGatewayToolbeltSummary `json:"toolbelts"`
	Pagination *ActionGatewayPagination       `json:"pagination"`
}

ActionGatewayToolbeltsResponse contains an offset-paginated list.

type ActionGatewayToolbeltsSearchOptions added in v1.216.0

type ActionGatewayToolbeltsSearchOptions struct {
	Query     string `url:"query,omitempty"`
	Status    string `url:"status,omitempty"`
	PageSize  int    `url:"page_size,omitempty"`
	PageToken string `url:"page_token,omitempty"`
}

ActionGatewayToolbeltsSearchOptions filters cursor-based toolbelt search.

type ActionGatewayToolbeltsService added in v1.216.0

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

ActionGatewayToolbeltsService manages versioned toolbelts.

func (*ActionGatewayToolbeltsService) AddTools added in v1.216.0

AddTools creates a new version containing the additional tools.

func (*ActionGatewayToolbeltsService) Create added in v1.216.0

Create creates a toolbelt.

func (*ActionGatewayToolbeltsService) Delete added in v1.216.0

Delete deletes a toolbelt.

func (*ActionGatewayToolbeltsService) Get added in v1.216.0

Get retrieves one toolbelt.

func (*ActionGatewayToolbeltsService) List added in v1.216.0

List lists toolbelts.

func (*ActionGatewayToolbeltsService) ListProviderTools added in v1.216.0

ListProviderTools lists a provider's tools in a toolbelt.

func (*ActionGatewayToolbeltsService) ListProviders added in v1.216.0

ListProviders lists providers in a toolbelt.

func (*ActionGatewayToolbeltsService) RemoveTools added in v1.216.0

RemoveTools creates a new version without the specified tools.

func (*ActionGatewayToolbeltsService) Search added in v1.216.0

Search searches toolbelts using cursor pagination.

type ActionGatewayToolkit added in v1.216.0

type ActionGatewayToolkit struct {
	ID          string     `json:"id"`
	Name        string     `json:"name"`
	Description string     `json:"description"`
	Categories  []string   `json:"categories"`
	CreatedAt   *Timestamp `json:"created_at"`
}

ActionGatewayToolkit describes a catalog toolkit.

type ActionGatewayToolkitsResponse added in v1.216.0

type ActionGatewayToolkitsResponse struct {
	Version  string                 `json:"version"`
	Toolkits []ActionGatewayToolkit `json:"toolkits"`
}

ActionGatewayToolkitsResponse contains toolkits and their catalog version.

type ActionGatewayToolsResponse added in v1.216.0

type ActionGatewayToolsResponse struct {
	Version     string                        `json:"version"`
	Tools       []ActionGatewayTool           `json:"tools"`
	Definitions []ActionGatewayToolDefinition `json:"definitions"`
	Pagination  *ActionGatewayPagination      `json:"pagination"`
}

ActionGatewayToolsResponse contains a page of tools and definitions.

type ActionGatewayToolsService added in v1.216.0

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

ActionGatewayToolsService exposes catalog and health operations.

func (*ActionGatewayToolsService) GetHealth added in v1.216.0

GetHealth retrieves health and optionally history for one tool.

func (*ActionGatewayToolsService) List added in v1.216.0

List retrieves a page of catalog tools.

func (*ActionGatewayToolsService) ListHealth added in v1.216.0

ListHealth retrieves tool health snapshots.

func (*ActionGatewayToolsService) ListProviderHealth added in v1.216.0

ListProviderHealth retrieves provider health snapshots.

func (*ActionGatewayToolsService) ListProviders added in v1.216.0

ListProviders retrieves tool providers.

func (*ActionGatewayToolsService) ListToolkits added in v1.216.0

ListToolkits retrieves catalog toolkits.

func (*ActionGatewayToolsService) Search added in v1.216.0

Search retrieves cursor-paginated tool search results.

func (*ActionGatewayToolsService) SearchProviders added in v1.216.0

SearchProviders retrieves cursor-paginated provider search results.

type ActionGatewayUser added in v1.216.0

type ActionGatewayUser struct {
	UserID      string                        `json:"user_id"`
	Sessions    []ActionGatewayUserSession    `json:"sessions"`
	Connections []ActionGatewayUserConnection `json:"connections"`
}

ActionGatewayUser is a derived end-user summary.

type ActionGatewayUserConnection added in v1.216.0

type ActionGatewayUserConnection struct {
	ID                   string                          `json:"id"`
	Provider             string                          `json:"provider"`
	ProviderDisplayName  string                          `json:"provider_display_name"`
	UserID               string                          `json:"user_id"`
	Scopes               []string                        `json:"scopes"`
	Status               string                          `json:"status"`
	GrantedAt            *Timestamp                      `json:"granted_at"`
	RevokedAt            *Timestamp                      `json:"revoked_at"`
	CreatedAt            *Timestamp                      `json:"created_at"`
	UpdatedAt            *Timestamp                      `json:"updated_at"`
	ConnectionParameters map[string]interface{}          `json:"connection_parameters"`
	CredentialKind       string                          `json:"credential_kind"`
	CredentialID         string                          `json:"credential_id"`
	Network              *ActionGatewayConnectionNetwork `json:"network"`
	OwningUserID         string                          `json:"owning_user_id"`
	OwningUserNumericID  string                          `json:"owning_user_numeric_id"`
}

ActionGatewayUserConnection is a connection associated with an end user.

type ActionGatewayUserResponse added in v1.216.0

type ActionGatewayUserResponse struct {
	User *ActionGatewayUser `json:"user"`
}

ActionGatewayUserResponse contains one end-user summary.

type ActionGatewayUserSession added in v1.216.0

type ActionGatewayUserSession struct {
	SessionURN string     `json:"session_urn"`
	Name       string     `json:"name"`
	CreatedAt  *Timestamp `json:"created_at"`
	UpdatedAt  *Timestamp `json:"updated_at"`
}

ActionGatewayUserSession is a session associated with an end user.

type ActionGatewayUsersListOptions added in v1.216.0

type ActionGatewayUsersListOptions struct {
	UserID        string `url:"user_id,omitempty"`
	Sort          string `url:"sort,omitempty"`
	SortDirection string `url:"sort_direction,omitempty"`
	Page          int    `url:"page,omitempty"`
	PerPage       int    `url:"per_page,omitempty"`
}

ActionGatewayUsersListOptions filters end users.

type ActionGatewayUsersResponse added in v1.216.0

type ActionGatewayUsersResponse struct {
	UserIDs    []string                 `json:"user_ids"`
	Pagination *ActionGatewayPagination `json:"pagination"`
}

ActionGatewayUsersResponse contains offset-paginated end-user IDs.

type ActionGatewayUsersService added in v1.216.0

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

ActionGatewayUsersService exposes end-user summaries.

func (*ActionGatewayUsersService) Get added in v1.216.0

Get retrieves an end-user summary.

func (*ActionGatewayUsersService) List added in v1.216.0

List lists end-user IDs.

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 AddKnowledgeBaseDataSourceRequest added in v1.152.0

type AddKnowledgeBaseDataSourceRequest struct {
	KnowledgeBaseUuid    string                `json:"knowledge_base_uuid"`
	SpacesDataSource     *SpacesDataSource     `json:"spaces_data_source"`
	WebCrawlerDataSource *WebCrawlerDataSource `json:"web_crawler_data_source"`
}

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 AdvancedMySQLConfig added in v1.200.0

type AdvancedMySQLConfig struct {
	MySQLParameters []AdvancedMySQLParameter `json:"mysql_parameters,omitempty"`
}

AdvancedMySQLConfig holds advanced configurations for advanced_mysql database clusters.

type AdvancedMySQLConfigUpdate added in v1.200.0

type AdvancedMySQLConfigUpdate struct {
	MySQLParameters map[string]string `json:"mysql_parameters,omitempty"`
}

AdvancedMySQLConfigUpdate is the PATCH payload for advanced_mysql database clusters.

type AdvancedMySQLParameter added in v1.200.0

type AdvancedMySQLParameter struct {
	Name            string `json:"name,omitempty"`
	Value           string `json:"value,omitempty"`
	Description     string `json:"description,omitempty"`
	RequiresRestart bool   `json:"requires_restart,omitempty"`
	DefaultValue    string `json:"default_value,omitempty"`
}

AdvancedMySQLParameter is one system variable returned by GET /config for advanced_mysql clusters.

type AdvancedPostgresConfig added in v1.195.0

type AdvancedPostgresConfig struct {
	PGParameters []AdvancedPostgresPGParameter `json:"pg_parameters,omitempty"`
}

AdvancedPostgresConfig holds advanced configurations for advanced_pg database clusters.

type AdvancedPostgresConfigUpdate added in v1.195.0

type AdvancedPostgresConfigUpdate struct {
	PGParameters map[string]string `json:"pg_parameters,omitempty"`
}

AdvancedPostgresConfigUpdate is the PATCH payload for advanced_pg database clusters.

type AdvancedPostgresPGParameter added in v1.195.0

type AdvancedPostgresPGParameter struct {
	Name            string `json:"name,omitempty"`
	Value           string `json:"value,omitempty"`
	Description     string `json:"description,omitempty"`
	RequiresRestart bool   `json:"requires_restart,omitempty"`
	DefaultValue    string `json:"default_value,omitempty"`
}

AdvancedPostgresPGParameter is one GUC parameter returned by GET /config for advanced_pg clusters.

type AffectedResource added in v1.175.0

type AffectedResource struct {
	URN  string `json:"urn,omitempty"`
	Name string `json:"name,omitempty"`
	Type string `json:"type,omitempty"`
}

An AffectedResource represents a resource affected by a scan finding.

type Agent added in v1.149.0

type Agent struct {
	AnthropicApiKey         *AnthropicApiKeyInfo      `json:"anthropic_api_key,omitempty"`
	ApiKeyInfos             []*ApiKeyInfo             `json:"api_key_infos,omitempty"`
	ApiKeys                 []*ApiKey                 `json:"api_keys,omitempty"`
	ChatBot                 *ChatBot                  `json:"chatbot,omitempty"`
	ChatbotIdentifiers      []*AgentChatbotIdentifier `json:"chatbot_identifiers,omitempty"`
	CreatedAt               *Timestamp                `json:"created_at,omitempty"`
	ChildAgents             []*Agent                  `json:"child_agents,omitempty"`
	ConversationLogsEnabled bool                      `json:"conversation_logs_enabled,omitempty"`
	Deployment              *AgentDeployment          `json:"deployment,omitempty"`
	Description             string                    `json:"description,omitempty"`
	Functions               []*AgentFunction          `json:"functions,omitempty"`
	Guardrails              []*AgentGuardrail         `json:"guardrails,omitempty"`
	IfCase                  string                    `json:"if_case,omitempty"`
	Instruction             string                    `json:"instruction,omitempty"`
	K                       int                       `json:"k,omitempty"`
	KnowledgeBases          []*KnowledgeBase          `json:"knowledge_bases,omitempty"`
	MaxTokens               int                       `json:"max_tokens,omitempty"`
	Model                   *Model                    `json:"model,omitempty"`
	Name                    string                    `json:"name,omitempty"`
	OpenAiApiKey            *OpenAiApiKey             `json:"open_ai_api_key,omitempty"`
	ParentAgents            []*Agent                  `json:"parent_agents,omitempty"`
	ProjectId               string                    `json:"project_id,omitempty"`
	ProvideCitations        bool                      `json:"provide_citations,omitempty"`
	Region                  string                    `json:"region,omitempty"`
	RetrievalMethod         string                    `json:"retrieval_method,omitempty"`
	RouteCreatedAt          *Timestamp                `json:"route_created_at,omitempty"`
	RouteCreatedBy          string                    `json:"route_created_by,omitempty"`
	RouteUuid               string                    `json:"route_uuid,omitempty"`
	RouteName               string                    `json:"route_name,omitempty"`
	Tags                    []string                  `json:"tags,omitempty"`
	Template                *AgentTemplate            `json:"template,omitempty"`
	Temperature             float64                   `json:"temperature,omitempty"`
	TopP                    float64                   `json:"top_p,omitempty"`
	UpdatedAt               *Timestamp                `json:"updated_at,omitempty"`
	Url                     string                    `json:"url,omitempty"`
	UserId                  string                    `json:"user_id,omitempty"`
	Uuid                    string                    `json:"uuid,omitempty"`
	VersionHash             string                    `json:"version_hash,omitempty"`
	VPCEgressIPs            []string                  `json:"vpc_egress_ips,omitempty"`
	VPCUuid                 string                    `json:"vpc_uuid,omitempty"`
	Workspace               Workspace                 `json:"workspace,omitempty"`
}

Agent represents an Agent Platform Agent

func (Agent) String added in v1.149.0

func (a Agent) String() string

type AgentAPIKeyCreateRequest added in v1.151.0

type AgentAPIKeyCreateRequest struct {
	AgentUuid string `json:"agent_uuid,omitempty"`
	Name      string `json:"name,omitempty"`
}

AgentAPIKeyCreateRequest represents the request to create a new Agent Platform Agent API Key

type AgentAPIKeyUpdateRequest added in v1.151.0

type AgentAPIKeyUpdateRequest struct {
	AgentUuid  string `json:"agent_uuid,omitempty"`
	APIKeyUuid string `json:"api_key_uuid,omitempty"`
	Name       string `json:"name,omitempty"`
}

AgentAPIKeyUpdateRequest represents the request to update an existing Agent Platform Agent API Key

type AgentChatCompletionService added in v1.191.0

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

AgentChatCompletionService exposes POST /api/v1/chat/completions?agent=true.

func (*AgentChatCompletionService) New added in v1.191.0

New creates a non-streaming agent chat completion.

func (*AgentChatCompletionService) NewStreaming added in v1.191.0

NewStreaming opens an SSE stream of chat completion chunks; body.Stream is forced to true. Callers MUST Close the returned stream.

type AgentChatService added in v1.191.0

type AgentChatService struct {
	Completions *AgentChatCompletionService
}

type AgentChatbotIdentifier added in v1.149.0

type AgentChatbotIdentifier struct {
	AgentChatbotIdentifier string `json:"agent_chatbot_identifier,omitempty"`
}

type AgentCreateRequest added in v1.149.0

type AgentCreateRequest struct {
	AnthropicKeyUuid     string   `json:"anthropic_key_uuid,omitempty"`
	Description          string   `json:"description,omitempty"`
	Instruction          string   `json:"instruction,omitempty"`
	KnowledgeBaseUuid    []string `json:"knowledge_base_uuid,omitempty"`
	ModelProviderKeyUuid string   `json:"model_provider_key_uuid,omitempty"`
	ModelUuid            string   `json:"model_uuid,omitempty"`
	Name                 string   `json:"name,omitempty"`
	OpenAiKeyUuid        string   `json:"open_ai_key_uuid,omitempty"`
	ProjectId            string   `json:"project_id,omitempty"`
	Region               string   `json:"region,omitempty"`
	Tags                 []string `json:"tags,omitempty"`
	WorkspaceUuid        string   `json:"workspace_uuid,omitempty"`
}

AgentCreateRequest represents the request to create a new Agent Platform Agent

type AgentDeployment added in v1.149.0

type AgentDeployment struct {
	CreatedAt  *Timestamp `json:"created_at,omitempty"`
	Name       string     `json:"name,omitempty"`
	Status     string     `json:"status,omitempty"`
	UpdatedAt  *Timestamp `json:"updated_at,omitempty"`
	Url        string     `json:"url,omitempty"`
	Uuid       string     `json:"uuid,omitempty"`
	Visibility string     `json:"visibility,omitempty"`
}

AgentDeployment represents the deployment information of an Agent Platform Agent

type AgentFunction added in v1.149.0

type AgentFunction struct {
	ApiKey        string     `json:"api_key,omitempty"`
	CreatedAt     *Timestamp `json:"created_at,omitempty"`
	Description   string     `json:"description,omitempty"`
	GuardrailUuid string     `json:"guardrail_uuid,omitempty"`
	FaasName      string     `json:"faas_name,omitempty"`
	FaasNamespace string     `json:"faas_namespace,omitempty"`
	Name          string     `json:"name,omitempty"`
	UpdatedAt     *Timestamp `json:"updated_at,omitempty"`
	Url           string     `json:"url,omitempty"`
	Uuid          string     `json:"uuid,omitempty"`
	IsDeleted     bool       `json:"is_deleted,omitempty"`
}

AgentFunction represents an Agent Platform Agent Function

type AgentGuardrail added in v1.149.0

type AgentGuardrail struct {
	AgentUuid       string     `json:"agent_uuid,omitempty"`
	CreatedAt       *Timestamp `json:"created_at,omitempty"`
	DefaultResponse string     `json:"default_response,omitempty"`
	Description     string     `json:"description,omitempty"`
	GuardrailUuid   string     `json:"guardrail_uuid,omitempty"`
	IsAttached      bool       `json:"is_attached,omitempty"`
	IsDefault       bool       `json:"is_default,omitempty"`
	Name            string     `json:"name,omitempty"`
	Priority        int        `json:"priority,omitempty"`
	Type            string     `json:"type,omitempty"`
	UpdatedAt       *Timestamp `json:"updated_at,omitempty"`
	Uuid            string     `json:"uuid,omitempty"`
	IsDeleted       bool       `json:"is_deleted,omitempty"`
}

AgentGuardrail represents a Guardrail attached to Agent Platform Agent

type AgentInferenceClient added in v1.191.0

type AgentInferenceClient struct {
	Chat *AgentChatService
	// contains filtered or unexported fields
}

func NewAgentInferenceClient added in v1.191.0

func NewAgentInferenceClient(baseURL, accessKey string, opts ...AgentInferenceClientOpt) (*AgentInferenceClient, error)

func (*AgentInferenceClient) BaseURL added in v1.191.0

func (c *AgentInferenceClient) BaseURL() *url.URL

BaseURL returns the (normalised) agent base URL.

func (*AgentInferenceClient) OnRequestCompleted added in v1.191.0

func (c *AgentInferenceClient) OnRequestCompleted(rc RequestCompletionCallback)

OnRequestCompleted registers a callback fired after each HTTP request.

type AgentInferenceClientOpt added in v1.191.0

type AgentInferenceClientOpt func(*AgentInferenceClient) error

AgentInferenceClientOpt is a functional option for an AgentInferenceClient.

func SetAgentHTTPClient added in v1.191.0

func SetAgentHTTPClient(hc *http.Client) AgentInferenceClientOpt

SetAgentHTTPClient overrides the http.Client used for all requests.

func SetAgentRequestHeaders added in v1.191.0

func SetAgentRequestHeaders(headers map[string]string) AgentInferenceClientOpt

SetAgentRequestHeaders adds default request headers. Authorization, Content-Type, Accept, and User-Agent are reserved and overwritten by the client.

func SetAgentUserAgent added in v1.191.0

func SetAgentUserAgent(ua string) AgentInferenceClientOpt

SetAgentUserAgent prepends ua to the User-Agent header.

type AgentPlatformService added in v1.216.0

type AgentPlatformService interface {
	ListAgents(context.Context, *ListOptions) ([]*Agent, *Response, error)
	CreateAgent(context.Context, *AgentCreateRequest) (*Agent, *Response, error)
	ListAgentAPIKeys(context.Context, string, *ListOptions) ([]*ApiKeyInfo, *Response, error)
	CreateAgentAPIKey(context.Context, string, *AgentAPIKeyCreateRequest) (*ApiKeyInfo, *Response, error)
	UpdateAgentAPIKey(context.Context, string, string, *AgentAPIKeyUpdateRequest) (*ApiKeyInfo, *Response, error)
	DeleteAgentAPIKey(context.Context, string, string) (*ApiKeyInfo, *Response, error)
	RegenerateAgentAPIKey(context.Context, string, string) (*ApiKeyInfo, *Response, error)
	GetAgent(context.Context, string) (*Agent, *Response, error)
	UpdateAgent(context.Context, string, *AgentUpdateRequest) (*Agent, *Response, error)
	DeleteAgent(context.Context, string) (*Agent, *Response, error)
	UpdateAgentVisibility(context.Context, string, *AgentVisibilityUpdateRequest) (*Agent, *Response, error)
	ListKnowledgeBases(ctx context.Context, opt *ListOptions) ([]KnowledgeBase, *Response, error)
	CreateKnowledgeBase(ctx context.Context, knowledgeBaseCreate *KnowledgeBaseCreateRequest) (*KnowledgeBase, *Response, error)
	ListKnowledgeBaseDataSources(ctx context.Context, knowledgeBaseID string, opt *ListOptions) ([]KnowledgeBaseDataSource, *Response, error)
	AddKnowledgeBaseDataSource(ctx context.Context, knowledgeBaseID string, addDataSource *AddKnowledgeBaseDataSourceRequest) (*KnowledgeBaseDataSource, *Response, error)
	DeleteKnowledgeBaseDataSource(ctx context.Context, knowledgeBaseID string, dataSourceID string) (string, string, *Response, error)
	GetKnowledgeBase(ctx context.Context, knowledgeBaseID string) (*KnowledgeBase, string, *Response, error)
	UpdateKnowledgeBase(ctx context.Context, knowledgeBaseID string, update *UpdateKnowledgeBaseRequest) (*KnowledgeBase, *Response, error)
	DeleteKnowledgeBase(ctx context.Context, knowledgeBaseID string) (string, *Response, error)
	ListIndexingJobs(ctx context.Context, opt *ListOptions) (*IndexingJobsResponse, *Response, error)
	GetIndexingJob(ctx context.Context, indexingJobUUID string) (*IndexingJobResponse, *Response, error)
	CancelIndexingJob(ctx context.Context, indexingJobUUID string) (*IndexingJobResponse, *Response, error)
	ListIndexingJobDataSources(ctx context.Context, indexingJobUUID string) (*IndexingJobDataSourcesResponse, *Response, error)
	AttachKnowledgeBaseToAgent(ctx context.Context, agentID string, knowledgeBaseID string) (*Agent, *Response, error)
	DetachKnowledgeBaseToAgent(ctx context.Context, agentID string, knowledgeBaseID string) (*Agent, *Response, error)
	AddAgentRoute(context.Context, string, string, *AgentRouteCreateRequest) (*AgentRouteResponse, *Response, error)
	UpdateAgentRoute(context.Context, string, string, *AgentRouteUpdateRequest) (*AgentRouteResponse, *Response, error)
	DeleteAgentRoute(context.Context, string, string) (*AgentRouteResponse, *Response, error)
	ListAgentVersions(context.Context, string, *ListOptions) ([]*AgentVersion, *Response, error)
	RollbackAgentVersion(context.Context, string, string) (string, *Response, error)
	ListAnthropicAPIKeys(context.Context, *ListOptions) ([]*AnthropicApiKeyInfo, *Response, error)
	CreateAnthropicAPIKey(ctx context.Context, anthropicAPIKeyCreateRequest *AnthropicAPIKeyCreateRequest) (*AnthropicApiKeyInfo, *Response, error)
	GetAnthropicAPIKey(ctx context.Context, id string) (*AnthropicApiKeyInfo, *Response, error)
	UpdateAnthropicAPIKey(ctx context.Context, id string, anthropicAPIKeyUpdateRequest *AnthropicAPIKeyUpdateRequest) (*AnthropicApiKeyInfo, *Response, error)
	DeleteAnthropicAPIKey(ctx context.Context, id string) (*AnthropicApiKeyInfo, *Response, error)
	ListAgentsByAnthropicAPIKey(ctx context.Context, id string, opt *ListOptions) ([]*Agent, *Response, error)
	ListOpenAIAPIKeys(context.Context, *ListOptions) ([]*OpenAiApiKey, *Response, error)
	CreateOpenAIAPIKey(ctx context.Context, openaiAPIKeyCreate *OpenAIAPIKeyCreateRequest) (*OpenAiApiKey, *Response, error)
	GetOpenAIAPIKey(ctx context.Context, openaiApiKeyId string) (*OpenAiApiKey, *Response, error)
	UpdateOpenAIAPIKey(ctx context.Context, openaiApiKeyId string, openaiAPIKeyUpdate *OpenAIAPIKeyUpdateRequest) (*OpenAiApiKey, *Response, error)
	DeleteOpenAIAPIKey(ctx context.Context, openaiApiKeyId string) (*OpenAiApiKey, *Response, error)
	ListAgentsByOpenAIAPIKey(ctx context.Context, openaiApiKeyId string, opt *ListOptions) ([]*Agent, *Response, error)
	CreateFunctionRoute(context.Context, string, *FunctionRouteCreateRequest) (*Agent, *Response, error)
	DeleteFunctionRoute(context.Context, string, string) (*Agent, *Response, error)
	UpdateFunctionRoute(context.Context, string, string, *FunctionRouteUpdateRequest) (*Agent, *Response, error)
	ListInferenceRouters(context.Context, *ListOptions) ([]*InferenceRouterSummary, *Response, error)
	GetInferenceRouter(context.Context, string) (*InferenceRouter, *Response, error)
	CreateInferenceRouter(context.Context, *InferenceRouterCreateRequest) (*InferenceRouter, *Response, error)
	UpdateInferenceRouter(context.Context, string, *InferenceRouterUpdateRequest) (*InferenceRouter, *Response, error)
	DeleteInferenceRouter(context.Context, string) (*InferenceRouterDeleteResponse, *Response, error)
	ListInferenceRouterTaskPresets(context.Context, *ListOptions) ([]*InferenceRouterTaskPreset, *Response, error)
	ListAvailableModels(context.Context, *ListOptions) ([]*Model, *Response, error)
	SearchModels(context.Context, string) ([]string, *Response, error)
	GetModelByUUID(context.Context, string) (*Model, *Response, error)
	ListDatacenterRegions(context.Context, *bool, *bool) ([]*DatacenterRegions, *Response, error)
	ListCustomModels(ctx context.Context, opt *CustomModelListOptions) (*CustomModelListResponse, *Response, error)
	GetCustomModel(ctx context.Context, uuid string) (*CustomModel, *Response, error)
	ImportCustomModel(ctx context.Context, importRequest *CustomModelImportRequest) (*CustomModelImportResponse, *Response, error)
	DeleteCustomModel(ctx context.Context, uuid string) (*CustomModelDeleteResponse, *Response, error)
	UpdateCustomModelMetadata(ctx context.Context, uuid string, updateRequest *CustomModelMetadataUpdateRequest) (*CustomModel, *Response, error)
	CreateCustomEvaluationMetric(ctx context.Context, createRequest *CreateCustomEvaluationMetricRequest) (*EvaluationMetric, *Response, error)
	UpdateCustomEvaluationMetric(ctx context.Context, metricUUID string, updateRequest *UpdateCustomEvaluationMetricRequest) (*EvaluationMetric, *Response, error)
	DeleteCustomEvaluationMetric(ctx context.Context, metricUUID string) (*Response, error)
	DeleteModelEvaluationRun(ctx context.Context, evalRunUUID string) (*ModelEvaluationRunDeleteResponse, *Response, error)
	DeleteModelEvaluationPreset(ctx context.Context, evalPresetUUID string) (*ModelEvaluationPresetDeleteResponse, *Response, error)
	CancelModelEvaluationRun(ctx context.Context, evalRunUUID string) (*ModelEvaluationRunCancelResponse, *Response, error)
	CreateModelEvaluationRun(ctx context.Context, createRequest *CreateModelEvaluationRunRequest) (*ModelEvaluationRunCreateResponse, *Response, error)
	UpdateModelEvaluationRun(ctx context.Context, evalRunUUID string, updateRequest *UpdateModelEvaluationRunRequest) (*ModelEvaluationRunUpdateResponse, *Response, error)
	CreateModelEvalDatasetUploadPresignedURLs(ctx context.Context, createRequest *CreateModelEvalDatasetUploadPresignedURLsRequest) (*CreateModelEvalDatasetUploadPresignedURLsResponse, *Response, error)
	GetModelEvaluationRun(ctx context.Context, evalRunUUID string, opt *ModelEvaluationRunGetOptions) (*ModelEvaluationRunGetResponse, *Response, error)
	GetModelEvaluationPreset(ctx context.Context, evalPresetUUID string) (*ModelEvaluationPresetGetResponse, *Response, error)
	GetModelEvaluationRunResultsDownloadURL(ctx context.Context, evalRunUUID string) (*ModelEvaluationRunResultsDownloadURLResponse, *Response, error)
	ListModelEvaluationRuns(ctx context.Context, opt *ModelEvaluationRunListOptions) (*ModelEvaluationRunListResponse, *Response, error)
	ListModelEvaluationPresets(ctx context.Context) (*ModelEvaluationPresetListResponse, *Response, error)
	ListModelEvaluationMetrics(ctx context.Context) (*ModelEvaluationMetricListResponse, *Response, error)
	ListEvaluationDatasets(ctx context.Context, opt *EvaluationDatasetListOptions) (*EvaluationDatasetListResponse, *Response, error)
	CreateEvaluationDataset(ctx context.Context, createRequest *CreateEvaluationDatasetRequest) (*CreateEvaluationDatasetResponse, *Response, error)
	DeleteEvaluationDataset(ctx context.Context, datasetUUID string) (*EvaluationDatasetDeleteResponse, *Response, error)
	CreateScenarioSetUploadPresignedURLs(ctx context.Context, createRequest *CreateScenarioSetUploadPresignedURLsRequest) (*CreateScenarioSetUploadPresignedURLsResponse, *Response, error)
	CreateScenarioSet(ctx context.Context, createRequest *CreateScenarioSetRequest) (*ScenarioSet, *Response, error)
	GenerateScenarioSet(ctx context.Context, generateRequest *GenerateScenarioSetRequest) (*ScenarioSet, *Response, error)
	ListScenarioSets(ctx context.Context, opt *ScenarioSetListOptions) (*ScenarioSetListResponse, *Response, error)
	GetScenarioSet(ctx context.Context, scenarioSetUUID string) (*ScenarioSet, *Response, error)
	ListScenarios(ctx context.Context, scenarioSetUUID string, opt *ScenarioListOptions) (*ScenarioListResponse, *Response, error)
	GetScenarioSetDownloadURL(ctx context.Context, scenarioSetUUID string) (*ScenarioSetDownloadURLResponse, *Response, error)
	UpdateScenarioSet(ctx context.Context, scenarioSetUUID string, updateRequest *UpdateScenarioSetRequest) (*ScenarioSet, *Response, error)
	DeleteScenarioSet(ctx context.Context, scenarioSetUUID string) (*ScenarioSetDeleteResponse, *Response, error)
	ListScenarioLibrary(ctx context.Context, opt *ScenarioLibraryListOptions) (*ScenarioLibraryListResponse, *Response, error)
	ListScenarioLibraryScenarios(ctx context.Context, libraryScenarioUUID string, opt *ScenarioListOptions) (*ScenarioListResponse, *Response, error)
	CreateScenarioSetFromLibrary(ctx context.Context, libraryScenarioUUID string, createRequest *CreateScenarioSetFromLibraryRequest) (*ScenarioSet, *Response, error)
	CreateSimulationRun(ctx context.Context, createRequest *CreateSimulationRunRequest) (*SimulationRun, *Response, error)
	ListSimulationRuns(ctx context.Context, opt *SimulationRunListOptions) (*SimulationRunListResponse, *Response, error)
	GetSimulationRun(ctx context.Context, runUUID string) (*SimulationRunGetResponse, *Response, error)
	UpdateSimulationRun(ctx context.Context, runUUID string, updateRequest *UpdateSimulationRunRequest) (*SimulationRun, *Response, error)
	CancelSimulationRun(ctx context.Context, runUUID string) (*SimulationRun, *Response, error)
	DeleteSimulationRun(ctx context.Context, runUUID string) (*SimulationRunDeleteResponse, *Response, error)
	ListSimulationJourneys(ctx context.Context, runUUID string, opt *SimulationJourneyListOptions) (*SimulationJourneyListResponse, *Response, error)
	GetSimulationJourney(ctx context.Context, runUUID, journeyUUID string) (*SimulationJourney, *Response, error)
	GetSimulationJourneyTrajectoryURL(ctx context.Context, runUUID, journeyUUID string) (*SimulationJourneyTrajectoryURLResponse, *Response, error)
	GetSimulationJourneyTrajectory(ctx context.Context, runUUID, journeyUUID string) (*SimulationTrajectory, *Response, error)
}

AgentPlatformService is an interface for interfacing with the Agent Platform Agent endpoints of the DigitalOcean API. See https://docs.digitalocean.com/reference/api/digitalocean/#tag/Agent-Platform-API for more details.

type AgentPlatformServiceOp added in v1.216.0

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

AgentPlatformServiceOp interfaces with the Agent Platform Service endpoints in the DigitalOcean API.

func (*AgentPlatformServiceOp) AddAgentRoute added in v1.216.0

func (s *AgentPlatformServiceOp) AddAgentRoute(ctx context.Context, parentId string, childId string, route *AgentRouteCreateRequest) (*AgentRouteResponse, *Response, error)

AddAgentRoute function adds a route between a parent and child agent.

func (*AgentPlatformServiceOp) AddKnowledgeBaseDataSource added in v1.216.0

func (s *AgentPlatformServiceOp) AddKnowledgeBaseDataSource(ctx context.Context, knowledgeBaseID string, addDataSource *AddKnowledgeBaseDataSourceRequest) (*KnowledgeBaseDataSource, *Response, error)

Add Data Source to a Knowledge Base

func (*AgentPlatformServiceOp) AttachKnowledgeBaseToAgent added in v1.216.0

func (s *AgentPlatformServiceOp) AttachKnowledgeBaseToAgent(ctx context.Context, agentID string, knowledgeBaseID string) (*Agent, *Response, error)

Attach a knowledge base to an agent

func (*AgentPlatformServiceOp) CancelIndexingJob added in v1.216.0

func (s *AgentPlatformServiceOp) CancelIndexingJob(ctx context.Context, indexingJobUUID string) (*IndexingJobResponse, *Response, error)

CancelIndexingJob cancels a specific indexing job for a knowledge base

func (*AgentPlatformServiceOp) CancelModelEvaluationRun added in v1.216.0

func (s *AgentPlatformServiceOp) CancelModelEvaluationRun(ctx context.Context, evalRunUUID string) (*ModelEvaluationRunCancelResponse, *Response, error)

CancelModelEvaluationRun cancels an in-progress model evaluation run. The run must be in a non-terminal status (queued, running_dataset, or evaluating_results); already-terminal runs return an error. The returned summary's status is `cancelling` while the underlying workflow is being torn down and transitions to `cancelled` once cluster-side teardown completes.

func (*AgentPlatformServiceOp) CancelSimulationRun added in v1.216.0

func (s *AgentPlatformServiceOp) CancelSimulationRun(ctx context.Context, runUUID string) (*SimulationRun, *Response, error)

CancelSimulationRun cancels an in-progress simulation run.

func (*AgentPlatformServiceOp) CreateAgent added in v1.216.0

func (s *AgentPlatformServiceOp) CreateAgent(ctx context.Context, create *AgentCreateRequest) (*Agent, *Response, error)

CreateAgent creates a new Agent Platform Agent by providing the AgentCreateRequest object

func (*AgentPlatformServiceOp) CreateAgentAPIKey added in v1.216.0

func (s *AgentPlatformServiceOp) CreateAgentAPIKey(ctx context.Context, agentId string, createRequest *AgentAPIKeyCreateRequest) (*ApiKeyInfo, *Response, error)

CreateAgentAPIKey creates a new API key for the specified Agent Platform agent

func (*AgentPlatformServiceOp) CreateAnthropicAPIKey added in v1.216.0

func (s *AgentPlatformServiceOp) CreateAnthropicAPIKey(ctx context.Context, anthropicAPIKeyCreate *AnthropicAPIKeyCreateRequest) (*AnthropicApiKeyInfo, *Response, error)

func (*AgentPlatformServiceOp) CreateCustomEvaluationMetric added in v1.216.0

func (s *AgentPlatformServiceOp) CreateCustomEvaluationMetric(ctx context.Context, createRequest *CreateCustomEvaluationMetricRequest) (*EvaluationMetric, *Response, error)

CreateCustomEvaluationMetric creates a custom model-evaluation metric.

func (*AgentPlatformServiceOp) CreateEvaluationDataset added in v1.217.0

CreateEvaluationDataset registers an evaluation dataset from a file that was previously uploaded via CreateModelEvalDatasetUploadPresignedURLs.

func (*AgentPlatformServiceOp) CreateFunctionRoute added in v1.216.0

func (g *AgentPlatformServiceOp) CreateFunctionRoute(ctx context.Context, id string, create *FunctionRouteCreateRequest) (*Agent, *Response, error)

Attaches a functionroute to an agent.

func (*AgentPlatformServiceOp) CreateInferenceRouter added in v1.216.0

CreateInferenceRouter creates a new inference router.

func (*AgentPlatformServiceOp) CreateKnowledgeBase added in v1.216.0

func (s *AgentPlatformServiceOp) CreateKnowledgeBase(ctx context.Context, knowledgeBaseCreate *KnowledgeBaseCreateRequest) (*KnowledgeBase, *Response, error)

Create a knowledge base

func (*AgentPlatformServiceOp) CreateModelEvalDatasetUploadPresignedURLs added in v1.216.0

CreateModelEvalDatasetUploadPresignedURLs creates presigned URLs that can be used to upload model evaluation dataset files.

func (*AgentPlatformServiceOp) CreateModelEvaluationRun added in v1.216.0

CreateModelEvaluationRun creates a new model evaluation run.

func (*AgentPlatformServiceOp) CreateOpenAIAPIKey added in v1.216.0

func (s *AgentPlatformServiceOp) CreateOpenAIAPIKey(ctx context.Context, openaiAPIKeyCreate *OpenAIAPIKeyCreateRequest) (*OpenAiApiKey, *Response, error)

func (*AgentPlatformServiceOp) CreateScenarioSet added in v1.216.0

func (s *AgentPlatformServiceOp) CreateScenarioSet(ctx context.Context, createRequest *CreateScenarioSetRequest) (*ScenarioSet, *Response, error)

CreateScenarioSet creates a scenario set from inline scenarios or an uploaded file. Exactly one of the two sources must be provided.

func (*AgentPlatformServiceOp) CreateScenarioSetFromLibrary added in v1.216.0

func (s *AgentPlatformServiceOp) CreateScenarioSetFromLibrary(ctx context.Context, libraryScenarioUUID string, createRequest *CreateScenarioSetFromLibraryRequest) (*ScenarioSet, *Response, error)

CreateScenarioSetFromLibrary materializes a library entry into a team-owned scenario set.

func (*AgentPlatformServiceOp) CreateScenarioSetUploadPresignedURLs added in v1.216.0

CreateScenarioSetUploadPresignedURLs creates presigned URLs for uploading scenario set files.

func (*AgentPlatformServiceOp) CreateSimulationRun added in v1.216.0

func (s *AgentPlatformServiceOp) CreateSimulationRun(ctx context.Context, createRequest *CreateSimulationRunRequest) (*SimulationRun, *Response, error)

CreateSimulationRun creates a simulation run.

func (*AgentPlatformServiceOp) DeleteAgent added in v1.216.0

func (s *AgentPlatformServiceOp) DeleteAgent(ctx context.Context, id string) (*Agent, *Response, error)

DeleteAgent function deletes an Agent Platform Agent by its corresponding UUID

func (*AgentPlatformServiceOp) DeleteAgentAPIKey added in v1.216.0

func (s *AgentPlatformServiceOp) DeleteAgentAPIKey(ctx context.Context, agentId, apiKeyId string) (*ApiKeyInfo, *Response, error)

DeleteAgentAPIKey deletes an existing API key for the specified Agent Platform agent

func (*AgentPlatformServiceOp) DeleteAgentRoute added in v1.216.0

func (s *AgentPlatformServiceOp) DeleteAgentRoute(ctx context.Context, parentId string, childId string) (*AgentRouteResponse, *Response, error)

DeleteAgentRoute function deletes a route between a parent and child agent.

func (*AgentPlatformServiceOp) DeleteAnthropicAPIKey added in v1.216.0

func (s *AgentPlatformServiceOp) DeleteAnthropicAPIKey(ctx context.Context, anthropicApiKeyId string) (*AnthropicApiKeyInfo, *Response, error)

func (*AgentPlatformServiceOp) DeleteCustomEvaluationMetric added in v1.216.0

func (s *AgentPlatformServiceOp) DeleteCustomEvaluationMetric(ctx context.Context, metricUUID string) (*Response, error)

DeleteCustomEvaluationMetric soft-deletes a custom model-evaluation metric.

func (*AgentPlatformServiceOp) DeleteCustomModel added in v1.216.0

DeleteCustomModel deletes the custom model with the given UUID.

func (*AgentPlatformServiceOp) DeleteEvaluationDataset added in v1.216.0

func (s *AgentPlatformServiceOp) DeleteEvaluationDataset(ctx context.Context, datasetUUID string) (*EvaluationDatasetDeleteResponse, *Response, error)

DeleteEvaluationDataset deletes the evaluation dataset with the given UUID.

func (*AgentPlatformServiceOp) DeleteFunctionRoute added in v1.216.0

func (g *AgentPlatformServiceOp) DeleteFunctionRoute(ctx context.Context, agent_id string, function_id string) (*Agent, *Response, error)

Deletes a functionroute to an agent.

func (*AgentPlatformServiceOp) DeleteInferenceRouter added in v1.216.0

func (s *AgentPlatformServiceOp) DeleteInferenceRouter(ctx context.Context, uuid string) (*InferenceRouterDeleteResponse, *Response, error)

DeleteInferenceRouter deletes an inference router by UUID.

func (*AgentPlatformServiceOp) DeleteKnowledgeBase added in v1.216.0

func (s *AgentPlatformServiceOp) DeleteKnowledgeBase(ctx context.Context, knowledgeBaseID string) (string, *Response, error)

Deletes a knowledge base by its corresponding UUID and returns the UUID of the deleted knowledge base

func (*AgentPlatformServiceOp) DeleteKnowledgeBaseDataSource added in v1.216.0

func (s *AgentPlatformServiceOp) DeleteKnowledgeBaseDataSource(ctx context.Context, knowledgeBaseID string, dataSourceID string) (string, string, *Response, error)

Deletes data source from a knowledge base

func (*AgentPlatformServiceOp) DeleteModelEvaluationPreset added in v1.216.0

func (s *AgentPlatformServiceOp) DeleteModelEvaluationPreset(ctx context.Context, evalPresetUUID string) (*ModelEvaluationPresetDeleteResponse, *Response, error)

DeleteModelEvaluationPreset deletes the saved model evaluation preset with the given UUID.

func (*AgentPlatformServiceOp) DeleteModelEvaluationRun added in v1.216.0

func (s *AgentPlatformServiceOp) DeleteModelEvaluationRun(ctx context.Context, evalRunUUID string) (*ModelEvaluationRunDeleteResponse, *Response, error)

DeleteModelEvaluationRun deletes the model evaluation run with the given UUID. The run must be in a terminal status (successful, partially_successful, failed, or cancelled). For runs still in progress, either wait for the run to finish or cancel it, then retry the delete.

func (*AgentPlatformServiceOp) DeleteOpenAIAPIKey added in v1.216.0

func (s *AgentPlatformServiceOp) DeleteOpenAIAPIKey(ctx context.Context, openaiApiKeyId string) (*OpenAiApiKey, *Response, error)

func (*AgentPlatformServiceOp) DeleteScenarioSet added in v1.216.0

func (s *AgentPlatformServiceOp) DeleteScenarioSet(ctx context.Context, scenarioSetUUID string) (*ScenarioSetDeleteResponse, *Response, error)

DeleteScenarioSet deletes a scenario set by UUID.

func (*AgentPlatformServiceOp) DeleteSimulationRun added in v1.216.0

func (s *AgentPlatformServiceOp) DeleteSimulationRun(ctx context.Context, runUUID string) (*SimulationRunDeleteResponse, *Response, error)

DeleteSimulationRun deletes a simulation run by UUID.

func (*AgentPlatformServiceOp) DetachKnowledgeBaseToAgent added in v1.216.0

func (s *AgentPlatformServiceOp) DetachKnowledgeBaseToAgent(ctx context.Context, agentID string, knowledgeBaseID string) (*Agent, *Response, error)

Detach a knowledge base from an agent

func (*AgentPlatformServiceOp) GenerateScenarioSet added in v1.216.0

func (s *AgentPlatformServiceOp) GenerateScenarioSet(ctx context.Context, generateRequest *GenerateScenarioSetRequest) (*ScenarioSet, *Response, error)

GenerateScenarioSet dispatches goal-driven scenario generation.

func (*AgentPlatformServiceOp) GetAgent added in v1.216.0

func (s *AgentPlatformServiceOp) GetAgent(ctx context.Context, id string) (*Agent, *Response, error)

GetAgent returns the details of an Agent Platform Agent based on the Agent UUID

func (*AgentPlatformServiceOp) GetAnthropicAPIKey added in v1.216.0

func (s *AgentPlatformServiceOp) GetAnthropicAPIKey(ctx context.Context, anthropicApiKeyId string) (*AnthropicApiKeyInfo, *Response, error)

func (*AgentPlatformServiceOp) GetCustomModel added in v1.216.0

func (s *AgentPlatformServiceOp) GetCustomModel(ctx context.Context, uuid string) (*CustomModel, *Response, error)

GetCustomModel retrieves a single custom model by UUID.

func (*AgentPlatformServiceOp) GetIndexingJob added in v1.216.0

func (s *AgentPlatformServiceOp) GetIndexingJob(ctx context.Context, indexingJobUUID string) (*IndexingJobResponse, *Response, error)

GetIndexingJob retrieves the status of a specific indexing job for a knowledge base

func (*AgentPlatformServiceOp) GetInferenceRouter added in v1.216.0

func (s *AgentPlatformServiceOp) GetInferenceRouter(ctx context.Context, uuid string) (*InferenceRouter, *Response, error)

GetInferenceRouter retrieves an inference router by UUID.

func (*AgentPlatformServiceOp) GetKnowledgeBase added in v1.216.0

func (s *AgentPlatformServiceOp) GetKnowledgeBase(ctx context.Context, knowledgeBaseID string) (*KnowledgeBase, string, *Response, error)

Get information about a KnowledgeBase and its Database status Database status can be "CREATING","ONLINE","POWEROFF","REBUILDING","REBALANCING","DECOMMISSIONED","FORKING","MIGRATING","RESIZING","RESTORING","POWERING_ON","UNHEALTHY"

func (*AgentPlatformServiceOp) GetModelByUUID added in v1.216.0

func (g *AgentPlatformServiceOp) GetModelByUUID(ctx context.Context, uuid string) (*Model, *Response, error)

MCPSearchModelByUUID searches available models for a specific UUID and returns the model if it exists.

func (*AgentPlatformServiceOp) GetModelEvaluationPreset added in v1.216.0

func (s *AgentPlatformServiceOp) GetModelEvaluationPreset(ctx context.Context, evalPresetUUID string) (*ModelEvaluationPresetGetResponse, *Response, error)

GetModelEvaluationPreset retrieves a saved model evaluation preset by UUID.

func (*AgentPlatformServiceOp) GetModelEvaluationRun added in v1.216.0

GetModelEvaluationRun retrieves a model evaluation run by UUID. Optional pagination options control the per-prompt results page returned alongside the run detail.

func (*AgentPlatformServiceOp) GetModelEvaluationRunResultsDownloadURL added in v1.216.0

func (s *AgentPlatformServiceOp) GetModelEvaluationRunResultsDownloadURL(ctx context.Context, evalRunUUID string) (*ModelEvaluationRunResultsDownloadURLResponse, *Response, error)

GetModelEvaluationRunResultsDownloadURL returns a presigned download URL (gzip-compressed JSON) for a model evaluation run's results.

func (*AgentPlatformServiceOp) GetOpenAIAPIKey added in v1.216.0

func (s *AgentPlatformServiceOp) GetOpenAIAPIKey(ctx context.Context, openaiApiKeyId string) (*OpenAiApiKey, *Response, error)

func (*AgentPlatformServiceOp) GetScenarioSet added in v1.216.0

func (s *AgentPlatformServiceOp) GetScenarioSet(ctx context.Context, scenarioSetUUID string) (*ScenarioSet, *Response, error)

GetScenarioSet retrieves a scenario set by UUID.

func (*AgentPlatformServiceOp) GetScenarioSetDownloadURL added in v1.216.0

func (s *AgentPlatformServiceOp) GetScenarioSetDownloadURL(ctx context.Context, scenarioSetUUID string) (*ScenarioSetDownloadURLResponse, *Response, error)

GetScenarioSetDownloadURL returns a presigned download URL for a scenario set's canonical JSONL file.

func (*AgentPlatformServiceOp) GetSimulationJourney added in v1.216.0

func (s *AgentPlatformServiceOp) GetSimulationJourney(ctx context.Context, runUUID, journeyUUID string) (*SimulationJourney, *Response, error)

GetSimulationJourney retrieves a single journey within a simulation run.

func (*AgentPlatformServiceOp) GetSimulationJourneyTrajectory added in v1.216.0

func (s *AgentPlatformServiceOp) GetSimulationJourneyTrajectory(ctx context.Context, runUUID, journeyUUID string) (*SimulationTrajectory, *Response, error)

GetSimulationJourneyTrajectory retrieves the parsed trajectory JSON for a journey.

func (*AgentPlatformServiceOp) GetSimulationJourneyTrajectoryURL added in v1.216.0

func (s *AgentPlatformServiceOp) GetSimulationJourneyTrajectoryURL(ctx context.Context, runUUID, journeyUUID string) (*SimulationJourneyTrajectoryURLResponse, *Response, error)

GetSimulationJourneyTrajectoryURL returns a presigned download URL for a journey's trajectory JSON.

func (*AgentPlatformServiceOp) GetSimulationRun added in v1.216.0

func (s *AgentPlatformServiceOp) GetSimulationRun(ctx context.Context, runUUID string) (*SimulationRunGetResponse, *Response, error)

GetSimulationRun retrieves a simulation run by UUID, including per-scenario result rollups when available.

func (*AgentPlatformServiceOp) ImportCustomModel added in v1.216.0

ImportCustomModel imports a new custom model from a supported source (HuggingFace, Spaces, etc.).

func (*AgentPlatformServiceOp) ListAgentAPIKeys added in v1.216.0

func (s *AgentPlatformServiceOp) ListAgentAPIKeys(ctx context.Context, agentId string, opt *ListOptions) ([]*ApiKeyInfo, *Response, error)

ListAgentAPIKeys retrieves list of API Keys associated with the specified Agent Platform agent

func (*AgentPlatformServiceOp) ListAgentVersions added in v1.216.0

func (s *AgentPlatformServiceOp) ListAgentVersions(ctx context.Context, agentId string, opt *ListOptions) ([]*AgentVersion, *Response, error)

ListAgentVersions retrieves a list of versions for the specified Agent Platform agent

func (*AgentPlatformServiceOp) ListAgents added in v1.216.0

func (s *AgentPlatformServiceOp) ListAgents(ctx context.Context, opt *ListOptions) ([]*Agent, *Response, error)

ListAgents returns a list of Agent Platform Agents

func (*AgentPlatformServiceOp) ListAgentsByAnthropicAPIKey added in v1.216.0

func (s *AgentPlatformServiceOp) ListAgentsByAnthropicAPIKey(ctx context.Context, anthropicApiKeyId string, opt *ListOptions) ([]*Agent, *Response, error)

func (*AgentPlatformServiceOp) ListAgentsByOpenAIAPIKey added in v1.216.0

func (s *AgentPlatformServiceOp) ListAgentsByOpenAIAPIKey(ctx context.Context, openaiApiKeyId string, opt *ListOptions) ([]*Agent, *Response, error)

func (*AgentPlatformServiceOp) ListAnthropicAPIKeys added in v1.216.0

func (s *AgentPlatformServiceOp) ListAnthropicAPIKeys(ctx context.Context, opt *ListOptions) ([]*AnthropicApiKeyInfo, *Response, error)

ListAnthropicAPIKeys retrieves a list of Anthropic API Keys

func (*AgentPlatformServiceOp) ListAvailableModels added in v1.216.0

func (g *AgentPlatformServiceOp) ListAvailableModels(ctx context.Context, opt *ListOptions) ([]*Model, *Response, error)

ListAvailableModels returns a list of available Agent Platform models

func (*AgentPlatformServiceOp) ListCustomModels added in v1.216.0

ListCustomModels returns the list of custom models for the team.

func (*AgentPlatformServiceOp) ListDatacenterRegions added in v1.216.0

func (g *AgentPlatformServiceOp) ListDatacenterRegions(ctx context.Context, servesInference, servesBatch *bool) ([]*DatacenterRegions, *Response, error)

ListDatacenterRegions returns a list of available datacenter regions for Agent Platform services

func (*AgentPlatformServiceOp) ListEvaluationDatasets added in v1.216.0

ListEvaluationDatasets lists evaluation datasets. Results can be filtered by dataset type using the provided options.

func (*AgentPlatformServiceOp) ListIndexingJobDataSources added in v1.216.0

func (s *AgentPlatformServiceOp) ListIndexingJobDataSources(ctx context.Context, indexingJobUUID string) (*IndexingJobDataSourcesResponse, *Response, error)

ListIndexingJobDataSources returns the data sources for a specific indexing job

func (*AgentPlatformServiceOp) ListIndexingJobs added in v1.216.0

ListIndexingJobs returns a list of all indexing jobs for knowledge bases

func (*AgentPlatformServiceOp) ListInferenceRouterTaskPresets added in v1.216.0

func (s *AgentPlatformServiceOp) ListInferenceRouterTaskPresets(ctx context.Context, opt *ListOptions) ([]*InferenceRouterTaskPreset, *Response, error)

ListInferenceRouterTaskPresets returns a page of preset tasks for building inference router policies.

func (*AgentPlatformServiceOp) ListInferenceRouters added in v1.216.0

func (s *AgentPlatformServiceOp) ListInferenceRouters(ctx context.Context, opt *ListOptions) ([]*InferenceRouterSummary, *Response, error)

ListInferenceRouters returns a page of inference routers.

func (*AgentPlatformServiceOp) ListKnowledgeBaseDataSources added in v1.216.0

func (s *AgentPlatformServiceOp) ListKnowledgeBaseDataSources(ctx context.Context, knowledgeBaseID string, opt *ListOptions) ([]KnowledgeBaseDataSource, *Response, error)

List Data Sources for a Knowledge Base

func (*AgentPlatformServiceOp) ListKnowledgeBases added in v1.216.0

func (s *AgentPlatformServiceOp) ListKnowledgeBases(ctx context.Context, opt *ListOptions) ([]KnowledgeBase, *Response, error)

List all knowledge bases

func (*AgentPlatformServiceOp) ListModelEvaluationMetrics added in v1.216.0

func (s *AgentPlatformServiceOp) ListModelEvaluationMetrics(ctx context.Context) (*ModelEvaluationMetricListResponse, *Response, error)

ListModelEvaluationMetrics lists all available metrics that can be selected when creating a model evaluation run.

func (*AgentPlatformServiceOp) ListModelEvaluationPresets added in v1.216.0

func (s *AgentPlatformServiceOp) ListModelEvaluationPresets(ctx context.Context) (*ModelEvaluationPresetListResponse, *Response, error)

ListModelEvaluationPresets lists all saved model evaluation presets.

func (*AgentPlatformServiceOp) ListModelEvaluationRuns added in v1.216.0

ListModelEvaluationRuns lists model evaluation runs. Results can be filtered by preset UUID, status (single or multiple), candidate model source types, and a free-text search across run, candidate model, and dataset names. The result set can also be sorted via SortBy / SortDirection.

func (*AgentPlatformServiceOp) ListOpenAIAPIKeys added in v1.216.0

func (s *AgentPlatformServiceOp) ListOpenAIAPIKeys(ctx context.Context, opt *ListOptions) ([]*OpenAiApiKey, *Response, error)

func (*AgentPlatformServiceOp) ListScenarioLibrary added in v1.216.0

ListScenarioLibrary lists platform-curated scenario library entries.

func (*AgentPlatformServiceOp) ListScenarioLibraryScenarios added in v1.216.0

func (s *AgentPlatformServiceOp) ListScenarioLibraryScenarios(ctx context.Context, libraryScenarioUUID string, opt *ScenarioListOptions) (*ScenarioListResponse, *Response, error)

ListScenarioLibraryScenarios lists scenarios within a scenario library entry.

func (*AgentPlatformServiceOp) ListScenarioSets added in v1.216.0

ListScenarioSets lists scenario sets for the team.

func (*AgentPlatformServiceOp) ListScenarios added in v1.216.0

func (s *AgentPlatformServiceOp) ListScenarios(ctx context.Context, scenarioSetUUID string, opt *ScenarioListOptions) (*ScenarioListResponse, *Response, error)

ListScenarios lists scenarios within a scenario set.

func (*AgentPlatformServiceOp) ListSimulationJourneys added in v1.216.0

ListSimulationJourneys lists journeys for a simulation run.

func (*AgentPlatformServiceOp) ListSimulationRuns added in v1.216.0

ListSimulationRuns lists simulation runs for the team.

func (*AgentPlatformServiceOp) RegenerateAgentAPIKey added in v1.216.0

func (s *AgentPlatformServiceOp) RegenerateAgentAPIKey(ctx context.Context, agentId, apiKeyId string) (*ApiKeyInfo, *Response, error)

RegenerateAgentAPIKey regenerates an API key for the specified Agent Platform agent

func (*AgentPlatformServiceOp) RollbackAgentVersion added in v1.216.0

func (s *AgentPlatformServiceOp) RollbackAgentVersion(ctx context.Context, agentId string, versionId string) (string, *Response, error)

func (*AgentPlatformServiceOp) SearchModels added in v1.216.0

func (g *AgentPlatformServiceOp) SearchModels(ctx context.Context, query string) ([]string, *Response, error)

MCPSearchModels searches available models by name and returns the list of matching UUIDs.

func (*AgentPlatformServiceOp) UpdateAgent added in v1.216.0

func (s *AgentPlatformServiceOp) UpdateAgent(ctx context.Context, id string, update *AgentUpdateRequest) (*Agent, *Response, error)

UpdateAgent function updates an Agent Platform Agent properties for the given UUID

func (*AgentPlatformServiceOp) UpdateAgentAPIKey added in v1.216.0

func (s *AgentPlatformServiceOp) UpdateAgentAPIKey(ctx context.Context, agentId, apiKeyId string, updateRequest *AgentAPIKeyUpdateRequest) (*ApiKeyInfo, *Response, error)

UpdateAgentAPIKey updates an existing API key for the specified Agent Platform agent

func (*AgentPlatformServiceOp) UpdateAgentRoute added in v1.216.0

func (s *AgentPlatformServiceOp) UpdateAgentRoute(ctx context.Context, parentId string, childId string, route *AgentRouteUpdateRequest) (*AgentRouteResponse, *Response, error)

UpdateAgentRoute function updates a route between a parent and child agent.

func (*AgentPlatformServiceOp) UpdateAgentVisibility added in v1.216.0

func (s *AgentPlatformServiceOp) UpdateAgentVisibility(ctx context.Context, id string, update *AgentVisibilityUpdateRequest) (*Agent, *Response, error)

UpdateAgentVisibility function updates an Agent Platform Agent status by changing visibility to public or private.

func (*AgentPlatformServiceOp) UpdateAnthropicAPIKey added in v1.216.0

func (s *AgentPlatformServiceOp) UpdateAnthropicAPIKey(ctx context.Context, anthropicApiKeyId string, anthropicAPIKeyUpdate *AnthropicAPIKeyUpdateRequest) (*AnthropicApiKeyInfo, *Response, error)

func (*AgentPlatformServiceOp) UpdateCustomEvaluationMetric added in v1.216.0

func (s *AgentPlatformServiceOp) UpdateCustomEvaluationMetric(ctx context.Context, metricUUID string, updateRequest *UpdateCustomEvaluationMetricRequest) (*EvaluationMetric, *Response, error)

UpdateCustomEvaluationMetric updates an existing custom model-evaluation metric.

func (*AgentPlatformServiceOp) UpdateCustomModelMetadata added in v1.216.0

func (s *AgentPlatformServiceOp) UpdateCustomModelMetadata(ctx context.Context, uuid string, updateRequest *CustomModelMetadataUpdateRequest) (*CustomModel, *Response, error)

UpdateCustomModelMetadata updates the metadata of an existing custom model.

func (*AgentPlatformServiceOp) UpdateFunctionRoute added in v1.216.0

func (g *AgentPlatformServiceOp) UpdateFunctionRoute(ctx context.Context, agent_id string, function_id string, update *FunctionRouteUpdateRequest) (*Agent, *Response, error)

Updates a functionroute to an agent.

func (*AgentPlatformServiceOp) UpdateInferenceRouter added in v1.216.0

func (s *AgentPlatformServiceOp) UpdateInferenceRouter(ctx context.Context, uuid string, update *InferenceRouterUpdateRequest) (*InferenceRouter, *Response, error)

UpdateInferenceRouter updates an inference router. At least one field in the update request must be set.

func (*AgentPlatformServiceOp) UpdateKnowledgeBase added in v1.216.0

func (s *AgentPlatformServiceOp) UpdateKnowledgeBase(ctx context.Context, knowledgeBaseID string, update *UpdateKnowledgeBaseRequest) (*KnowledgeBase, *Response, error)

Update a knowledge base

func (*AgentPlatformServiceOp) UpdateModelEvaluationRun added in v1.216.0

func (s *AgentPlatformServiceOp) UpdateModelEvaluationRun(ctx context.Context, evalRunUUID string, updateRequest *UpdateModelEvaluationRunRequest) (*ModelEvaluationRunUpdateResponse, *Response, error)

UpdateModelEvaluationRun updates mutable fields on an existing model evaluation run identified by its UUID. Currently only the run's display name can be updated.

func (*AgentPlatformServiceOp) UpdateOpenAIAPIKey added in v1.216.0

func (s *AgentPlatformServiceOp) UpdateOpenAIAPIKey(ctx context.Context, openaiApiKeyId string, openaiAPIKeyUpdate *OpenAIAPIKeyUpdateRequest) (*OpenAiApiKey, *Response, error)

func (*AgentPlatformServiceOp) UpdateScenarioSet added in v1.216.0

func (s *AgentPlatformServiceOp) UpdateScenarioSet(ctx context.Context, scenarioSetUUID string, updateRequest *UpdateScenarioSetRequest) (*ScenarioSet, *Response, error)

UpdateScenarioSet updates a scenario set name and/or replaces its scenarios.

func (*AgentPlatformServiceOp) UpdateSimulationRun added in v1.216.0

func (s *AgentPlatformServiceOp) UpdateSimulationRun(ctx context.Context, runUUID string, updateRequest *UpdateSimulationRunRequest) (*SimulationRun, *Response, error)

UpdateSimulationRun updates mutable fields on a simulation run.

type AgentRouteCreateRequest added in v1.155.0

type AgentRouteCreateRequest struct {
	ChildAgentUuid  string `json:"child_agent_uuid,omitempty"`
	IfCase          string `json:"if_case,omitempty"`
	ParentAgentUuid string `json:"parent_agent_uuid,omitempty"`
	RouteName       string `json:"route_name,omitempty"`
}

AgentRouteCreateRequest represents a route between a parent and child agent.

type AgentRouteResponse added in v1.155.0

type AgentRouteResponse struct {
	ChildAgentUuid  string `json:"child_agent_uuid,omitempty"`
	ParentAgentUuid string `json:"parent_agent_uuid,omitempty"`
	Rollback        bool   `json:"rollback,omitempty"`
	UUID            string `json:"uuid,omitempty"`
}

func (AgentRouteResponse) String added in v1.155.0

func (a AgentRouteResponse) String() string

type AgentRouteUpdateRequest added in v1.155.0

type AgentRouteUpdateRequest struct {
	ChildAgentUuid  string `json:"child_agent_uuid,omitempty"`
	IfCase          string `json:"if_case,omitempty"`
	ParentAgentUuid string `json:"parent_agent_uuid,omitempty"`
	RouteName       string `json:"route_name,omitempty"`
	UUID            string `json:"uuid,omitempty"`
}

AgentRouteUpdateRequest represents the request to update an existing route between a parent and child agent.

type AgentTemplate added in v1.149.0

type AgentTemplate struct {
	CreatedAt      *Timestamp       `json:"created_at,omitempty"`
	Instruction    string           `json:"instruction,omitempty"`
	Description    string           `json:"description,omitempty"`
	K              int              `json:"k,omitempty"`
	KnowledgeBases []*KnowledgeBase `json:"knowledge_bases,omitempty"`
	MaxTokens      int              `json:"max_tokens,omitempty"`
	Model          *Model           `json:"model,omitempty"`
	Name           string           `json:"name,omitempty"`
	Temperature    float64          `json:"temperature,omitempty"`
	TopP           float64          `json:"top_p,omitempty"`
	UpdatedAt      *Timestamp       `json:"updated_at,omitempty"`
	Uuid           string           `json:"uuid,omitempty"`
}

AgentTemplate represents the template of an Agent Platform Agent

type AgentUpdateRequest added in v1.149.0

type AgentUpdateRequest struct {
	AnthropicKeyUuid string   `json:"anthropic_key_uuid,omitempty"`
	Description      string   `json:"description,omitempty"`
	Instruction      string   `json:"instruction,omitempty"`
	K                int      `json:"k,omitempty"`
	MaxTokens        int      `json:"max_tokens,omitempty"`
	ModelUuid        string   `json:"model_uuid,omitempty"`
	Name             string   `json:"name,omitempty"`
	OpenAiKeyUuid    string   `json:"open_ai_key_uuid,omitempty"`
	ProjectId        string   `json:"project_id,omitempty"`
	RetrievalMethod  string   `json:"retrieval_method,omitempty"`
	Region           string   `json:"region,omitempty"`
	Tags             []string `json:"tags,omitempty"`
	Temperature      float64  `json:"temperature,omitempty"`
	TopP             float64  `json:"top_p,omitempty"`
	Uuid             string   `json:"uuid,omitempty"`
	ProvideCitations bool     `json:"provide_citations,omitempty"`
}

AgentUpdateRequest represents the request to update an existing Agent Platform Agent

type AgentVersion added in v1.155.0

type AgentVersion struct {
	AgentUuid              string                `json:"agent_uuid,omitempty"`
	AttachedChildAgents    []*AttachedChildAgent `json:"attached_child_agents,omitempty"`
	AttachedFunctions      []*AgentFunction      `json:"attached_functions,omitempty"`
	AttachedGuardrails     []*AgentGuardrail     `json:"attached_guardrails,omitempty"`
	AttachedKnowledgeBases []*KnowledgeBase      `json:"attached_knowledgebases,omitempty"`
	CanRollback            bool                  `json:"can_rollback,omitempty"`
	CreatedAt              *Timestamp            `json:"created_at,omitempty"`
	CreatedByEmail         string                `json:"created_by_email,omitempty"`
	CurrentlyApplied       bool                  `json:"currently_applied,omitempty"`
	Description            string                `json:"description,omitempty"`
	ID                     string                `json:"id,omitempty"`
	Instruction            string                `json:"instruction,omitempty"`
	K                      int64                 `json:"k,omitempty"`
	MaxTokens              int64                 `json:"max_tokens,omitempty"`
	ModelName              string                `json:"model_name,omitempty"`
	Name                   string                `json:"name,omitempty"`
	ProvideCitations       bool                  `json:"provide_citations,omitempty"`
	RetrievalMethod        string                `json:"retrieval_method,omitempty"`
	Tags                   []string              `json:"tags,omitempty"`
	Temperature            float64               `json:"temperature,omitempty"`
	TopP                   float64               `json:"top_p,omitempty"`
	TriggerAction          string                `json:"trigger_action,omitempty"`
	VersionHash            string                `json:"version_hash,omitempty"`
}

AgentVersion represents a version of an Agent Platform Agent

func (AgentVersion) String added in v1.155.0

func (a AgentVersion) String() string

type AgentVisibilityUpdateRequest added in v1.149.0

type AgentVisibilityUpdateRequest struct {
	Uuid       string `json:"uuid,omitempty"`
	Visibility string `json:"visibility,omitempty"`
}

AgentVersionUpdateRequest represents the request to update the version of an agent

type Agreement added in v1.149.0

type Agreement struct {
	Description string `json:"description,omitempty"`
	Name        string `json:"name,omitempty"`
	Url         string `json:"url,omitempty"`
	Uuid        string `json:"uuid,omitempty"`
}

Agreement represents the agreement information of an Agent Platform Model

type AlertCondition added in v1.218.0

type AlertCondition struct {
	Window string `json:"window,omitempty"`
}

AlertCondition is the evaluation window for an alert rule.

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 AlertInstance added in v1.218.0

type AlertInstance struct {
	ID              string     `json:"id"`
	RuleID          string     `json:"rule_id"`
	Severity        string     `json:"severity"`
	Status          string     `json:"status"`
	ResourceURN     string     `json:"resource_urn,omitempty"`
	Value           float64    `json:"value"`
	TriggeredAt     time.Time  `json:"triggered_at"`
	LastTriggeredAt time.Time  `json:"last_triggered_at"`
	ResolvedAt      *time.Time `json:"resolved_at,omitempty"`
	LastNotifiedAt  *time.Time `json:"last_notified_at,omitempty"`
}

AlertInstance is a read-only firing of an alert rule against a resource.

type AlertInstanceListOptions added in v1.218.0

type AlertInstanceListOptions struct {
	Page        int    `url:"page,omitempty"`
	PerPage     int    `url:"per_page,omitempty"`
	Status      string `url:"status,omitempty"`
	RuleID      string `url:"rule_id,omitempty"`
	ResourceURN string `url:"resource_urn,omitempty"`
}

AlertInstanceListOptions are filters for listing alert instances.

type AlertMetricsQuery added in v1.218.0

type AlertMetricsQuery struct {
	Metric       string             `json:"metric"`
	Filters      []AlertQueryFilter `json:"filters,omitempty"`
	ResourceURNs []string           `json:"resource_urns,omitempty"`
	Tags         []string           `json:"tags,omitempty"`
}

AlertMetricsQuery is the metric an alert rule evaluates. Metric must be a dotted OpenTelemetry name such as do.droplets.cpu_utilization.

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 AlertQueryFilter added in v1.218.0

type AlertQueryFilter struct {
	Field    string `json:"field"`
	Operator string `json:"operator"`
	Value    string `json:"value"`
}

AlertQueryFilter is a label filter on an alert metrics query.

type AlertRule added in v1.218.0

type AlertRule struct {
	ID        string        `json:"id"`
	Spec      AlertRuleSpec `json:"spec"`
	Status    string        `json:"status"`
	CreatedAt time.Time     `json:"created_at"`
	UpdatedAt time.Time     `json:"updated_at"`
}

AlertRule is an Insights alert rule.

type AlertRuleListOptions added in v1.218.0

type AlertRuleListOptions struct {
	Page        int    `url:"page,omitempty"`
	PerPage     int    `url:"per_page,omitempty"`
	ResourceURN string `url:"resource_urn,omitempty"`
}

AlertRuleListOptions are filters for listing alert rules.

type AlertRuleRequest added in v1.218.0

type AlertRuleRequest struct {
	Spec   AlertRuleSpec `json:"spec"`
	Status string        `json:"status,omitempty"`
}

AlertRuleRequest is the body for creating or updating an alert rule. Status is optional: create defaults to active, and update keeps the current status when empty.

type AlertRuleSpec added in v1.218.0

type AlertRuleSpec struct {
	Name       string            `json:"name"`
	Query      AlertMetricsQuery `json:"query"`
	Condition  *AlertCondition   `json:"condition,omitempty"`
	Thresholds AlertThresholds   `json:"thresholds"`
	// NotificationChannels are notified when the rule fires.
	// On create, set a non-empty list. On update, leave nil to keep existing bindings.
	// A pointer to an empty slice is sent as [] and the API rejects it.
	NotificationChannels *[]NotificationChannelBinding `json:"notification_channels,omitempty"`
	ReAlertDuration      string                        `json:"re_alert_duration,omitempty"`
}

AlertRuleSpec is the configuration of an alert rule.

type AlertThresholds added in v1.218.0

type AlertThresholds struct {
	Warning  *float64 `json:"warning,omitempty"`
	Critical *float64 `json:"critical,omitempty"`
	Operator string   `json:"operator"`
}

AlertThresholds is the comparison applied to the aggregated metric. At least one of Warning or Critical must be set. Use a pointer so a threshold of 0 is sent.

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 AnthropicAPIKeyCreateRequest added in v1.156.0

type AnthropicAPIKeyCreateRequest struct {
	Name   string `json:"name,omitempty"`
	ApiKey string `json:"api_key,omitempty"`
}

type AnthropicAPIKeyUpdateRequest added in v1.156.0

type AnthropicAPIKeyUpdateRequest struct {
	Name       string `json:"name,omitempty"`
	ApiKey     string `json:"api_key,omitempty"`
	ApiKeyUuid string `json:"api_key_uuid,omitempty"`
}

type AnthropicApiKeyInfo added in v1.149.0

type AnthropicApiKeyInfo struct {
	CreatedAt *Timestamp `json:"created_at,omitempty"`
	CreatedBy string     `json:"created_by,omitempty"`
	DeletedAt *Timestamp `json:"deleted_at,omitempty"`
	Name      string     `json:"name,omitempty"`
	UpdatedAt *Timestamp `json:"updated_at,omitempty"`
	Uuid      string     `json:"uuid,omitempty"`
}

AnthropicApiKeyInfo represents the Anthropic API Key information

type ApiKey added in v1.149.0

type ApiKey struct {
	ApiKey string `json:"api_key,omitempty"`
}

type ApiKeyInfo added in v1.149.0

type ApiKeyInfo struct {
	CreatedAt *Timestamp `json:"created_at,omitempty"`
	CreatedBy string     `json:"created_by,omitempty"`
	DeletedAt *Timestamp `json:"deleted_at,omitempty"`
	Name      string     `json:"name,omitempty"`
	SecretKey string     `json:"secret_key,omitempty"`
	Uuid      string     `json:"uuid,omitempty"`
}

ApiKeyInfo represents the information of an API key

func (ApiKeyInfo) String added in v1.151.0

func (a ApiKeyInfo) String() string

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"`
	PendingDeployment       *Deployment     `json:"pending_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 fleet (project) lookup failure.
	ProjectID string `json:"project_id,omitempty"`
	// The dedicated egress ip addresses associated with the app.
	DedicatedIps []*AppDedicatedIp `json:"dedicated_ips,omitempty"`
	VPC          *AppVPC           `json:"vpc,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) GetDedicatedIps added in v1.109.0

func (a *App) GetDedicatedIps() []*AppDedicatedIp

GetDedicatedIps returns the DedicatedIps 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) GetPendingDeployment added in v1.97.0

func (a *App) GetPendingDeployment() *Deployment

GetPendingDeployment returns the PendingDeployment 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) GetVPC added in v1.159.0

func (a *App) GetVPC() *AppVPC

GetVPC returns the VPC 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.
	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. - DEPLOYMENT_STARTED: Represents whether a deployment has started. Only applicable at the app level. - DEPLOYMENT_CANCELED: Represents whether a deployment has been canceled. 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. - AUTOSCALE_FAILED: Represents whether autoscaling has failed. Only applicable at the app level. - AUTOSCALE_SUCCEEDED: Represents whether autoscaling has succeeded. Only applicable at the app level. - JOB_INVOCATION_FAILED: Represents whether a job invocation has failed. Only applicable to scheduled job components. - 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. - REQUESTS_PER_SECOND: Represents requests per second for a service. Only applicable to service components. - REQUEST_DURATION_P95_MS: Represents request duration p95 in milliseconds for a service. Only applicable to service 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_DeploymentStarted           AppAlertSpecRule = "DEPLOYMENT_STARTED"
	AppAlertSpecRule_DeploymentCanceled          AppAlertSpecRule = "DEPLOYMENT_CANCELED"
	AppAlertSpecRule_DomainFailed                AppAlertSpecRule = "DOMAIN_FAILED"
	AppAlertSpecRule_DomainLive                  AppAlertSpecRule = "DOMAIN_LIVE"
	AppAlertSpecRule_AutoscaleFailed             AppAlertSpecRule = "AUTOSCALE_FAILED"
	AppAlertSpecRule_AutoscaleSucceeded          AppAlertSpecRule = "AUTOSCALE_SUCCEEDED"
	AppAlertSpecRule_JobInvocationFailed         AppAlertSpecRule = "JOB_INVOCATION_FAILED"
	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"
	AppAlertSpecRule_RequestsPerSecond           AppAlertSpecRule = "REQUESTS_PER_SECOND"
	AppAlertSpecRule_RequestDurationP95Ms        AppAlertSpecRule = "REQUEST_DURATION_P95_MS"
)

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 AppAutoscalingSpec added in v1.105.0

type AppAutoscalingSpec struct {
	// The minimum amount of instances for this component.
	MinInstanceCount int64 `json:"min_instance_count,omitempty"`
	// The maximum amount of instances for this component. Maximum 250. Consider using a larger instance size if your application requires more than 250 instances.
	MaxInstanceCount int64                      `json:"max_instance_count,omitempty"`
	Metrics          *AppAutoscalingSpecMetrics `json:"metrics,omitempty"`
}

AppAutoscalingSpec struct for AppAutoscalingSpec

func (*AppAutoscalingSpec) GetMaxInstanceCount added in v1.105.0

func (a *AppAutoscalingSpec) GetMaxInstanceCount() int64

GetMaxInstanceCount returns the MaxInstanceCount field.

func (*AppAutoscalingSpec) GetMetrics added in v1.105.0

GetMetrics returns the Metrics field.

func (*AppAutoscalingSpec) GetMinInstanceCount added in v1.105.0

func (a *AppAutoscalingSpec) GetMinInstanceCount() int64

GetMinInstanceCount returns the MinInstanceCount field.

type AppAutoscalingSpecMetricCPU added in v1.105.0

type AppAutoscalingSpecMetricCPU struct {
	// The average target CPU utilization for the component.
	Percent int64 `json:"percent,omitempty"`
}

AppAutoscalingSpecMetricCPU struct for AppAutoscalingSpecMetricCPU

func (*AppAutoscalingSpecMetricCPU) GetPercent added in v1.105.0

func (a *AppAutoscalingSpecMetricCPU) GetPercent() int64

GetPercent returns the Percent field.

type AppAutoscalingSpecMetricRequestDuration added in v1.185.0

type AppAutoscalingSpecMetricRequestDuration struct {
	// The p95 target request duration in milliseconds for the component.
	P95Milliseconds int64 `json:"p95_milliseconds,omitempty"`
}

AppAutoscalingSpecMetricRequestDuration struct for AppAutoscalingSpecMetricRequestDuration

func (*AppAutoscalingSpecMetricRequestDuration) GetP95Milliseconds added in v1.185.0

func (a *AppAutoscalingSpecMetricRequestDuration) GetP95Milliseconds() int64

GetP95Milliseconds returns the P95Milliseconds field.

type AppAutoscalingSpecMetricRequestsPerSecond added in v1.185.0

type AppAutoscalingSpecMetricRequestsPerSecond struct {
	// The target number of requests per second per instance for the component.
	PerInstance int64 `json:"per_instance,omitempty"`
}

AppAutoscalingSpecMetricRequestsPerSecond struct for AppAutoscalingSpecMetricRequestsPerSecond

func (*AppAutoscalingSpecMetricRequestsPerSecond) GetPerInstance added in v1.185.0

GetPerInstance returns the PerInstance field.

type AppAutoscalingSpecMetrics added in v1.105.0

type AppAutoscalingSpecMetrics struct {
	CPU               *AppAutoscalingSpecMetricCPU               `json:"cpu,omitempty"`
	RequestsPerSecond *AppAutoscalingSpecMetricRequestsPerSecond `json:"requests_per_second,omitempty"`
	RequestDuration   *AppAutoscalingSpecMetricRequestDuration   `json:"request_duration,omitempty"`
}

AppAutoscalingSpecMetrics struct for AppAutoscalingSpecMetrics

func (*AppAutoscalingSpecMetrics) GetCPU added in v1.105.0

GetCPU returns the CPU field.

func (*AppAutoscalingSpecMetrics) GetRequestDuration added in v1.185.0

GetRequestDuration returns the RequestDuration field.

func (*AppAutoscalingSpecMetrics) GetRequestsPerSecond added in v1.185.0

GetRequestsPerSecond returns the RequestsPerSecond field.

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"`
	// A version id that represents the underlying CNB stack. The version of the stack indicates what buildpacks are supported.
	StackID string `json:"stack_id,omitempty"`
}

AppBuildConfigCNBVersioning struct for AppBuildConfigCNBVersioning

func (*AppBuildConfigCNBVersioning) GetBuildpacks added in v1.85.0

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

GetBuildpacks returns the Buildpacks field.

func (*AppBuildConfigCNBVersioning) GetStackID added in v1.98.0

func (a *AppBuildConfigCNBVersioning) GetStackID() string

GetStackID returns the StackID field.

type AppBuildableComponentSpec added in v1.85.0

type AppBuildableComponentSpec interface {
	AppComponentSpec

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

	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 database's name. The name must be unique across all components within the same app and cannot use capital letters.
	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"
	AppDatabaseSpecEngine_Kafka      AppDatabaseSpecEngine = "KAFKA"
	AppDatabaseSpecEngine_Opensearch AppDatabaseSpecEngine = "OPENSEARCH"
	AppDatabaseSpecEngine_Valkey     AppDatabaseSpecEngine = "VALKEY"
)

List of AppDatabaseSpecEngine

type AppDedicatedIp added in v1.109.0

type AppDedicatedIp struct {
	// The ip address of the dedicated egress ip.
	Ip string `json:"ip,omitempty"`
	// The id of the dedictated egress ip.
	ID     string               `json:"id,omitempty"`
	Status AppDedicatedIpStatus `json:"status,omitempty"`
}

AppDedicatedIp Represents a dedicated egress ip.

func (*AppDedicatedIp) GetID added in v1.109.0

func (a *AppDedicatedIp) GetID() string

GetID returns the ID field.

func (*AppDedicatedIp) GetIp added in v1.109.0

func (a *AppDedicatedIp) GetIp() string

GetIp returns the Ip field.

func (*AppDedicatedIp) GetStatus added in v1.109.0

func (a *AppDedicatedIp) GetStatus() AppDedicatedIpStatus

GetStatus returns the Status field.

type AppDedicatedIpStatus added in v1.109.0

type AppDedicatedIpStatus string

AppDedicatedIpStatus the model 'AppDedicatedIpStatus'

const (
	APPDEDICATEDIPSTATUS_Unknown   AppDedicatedIpStatus = "UNKNOWN"
	APPDEDICATEDIPSTATUS_Assigning AppDedicatedIpStatus = "ASSIGNING"
	APPDEDICATEDIPSTATUS_Assigned  AppDedicatedIpStatus = "ASSIGNED"
	APPDEDICATEDIPSTATUS_Removed   AppDedicatedIpStatus = "REMOVED"
)

List of AppDedicatedIPStatus

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 AppEgressSpec added in v1.107.0

type AppEgressSpec struct {
	Type AppEgressSpecType `json:"type,omitempty"`
}

AppEgressSpec Specification for app egress configurations.

func (*AppEgressSpec) GetType added in v1.107.0

func (a *AppEgressSpec) GetType() AppEgressSpecType

GetType returns the Type field.

type AppEgressSpecType added in v1.107.0

type AppEgressSpecType string

AppEgressSpecType the model 'AppEgressSpecType'

const (
	APPEGRESSSPECTYPE_Autoassign  AppEgressSpecType = "AUTOASSIGN"
	APPEGRESSSPECTYPE_DedicatedIp AppEgressSpecType = "DEDICATED_IP"
)

List of AppEgressSpecType

type AppExec added in v1.130.0

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

AppExec represents the websocket URL used for sending/receiving console input and output.

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"`
	Bitbucket *BitbucketSourceSpec `json:"bitbucket,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"`
	// (Deprecated) 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) GetBitbucket added in v1.132.0

func (a *AppFunctionsSpec) GetBitbucket() *BitbucketSourceSpec

GetBitbucket returns the Bitbucket 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 AppGetExecOptions added in v1.146.0

type AppGetExecOptions struct {
	DeploymentID string `json:"deployment_id,omitempty"`
	// InstanceName is the unique name of the instance to connect to. It is an optional parameter.
	// If not provided, the first available instance will be used.
	InstanceName string `json:"instance_name,omitempty"`
}

GetExecOptions represents options for retrieving the websocket URL used for sending/receiving console input and output.

type AppHealth added in v1.156.0

type AppHealth struct {
	Components          []*ComponentHealth          `json:"components,omitempty"`
	FunctionsComponents []*FunctionsComponentHealth `json:"functions_components,omitempty"`
}

AppHealth struct for AppHealth

func (*AppHealth) GetComponents added in v1.165.1

func (a *AppHealth) GetComponents() []*ComponentHealth

GetComponents returns the Components field.

func (*AppHealth) GetFunctionsComponents added in v1.165.1

func (a *AppHealth) GetFunctionsComponents() []*FunctionsComponentHealth

GetFunctionsComponents returns the FunctionsComponents field.

type AppIngressSpec added in v1.77.0

type AppIngressSpec struct {
	LoadBalancer     AppIngressSpecLoadBalancer `json:"load_balancer,omitempty"`
	LoadBalancerSize int64                      `json:"load_balancer_size,omitempty"`
	// Rules for configuring HTTP ingress for component routes, CORS, rewrites, and redirects.
	Rules        []*AppIngressSpecRule `json:"rules,omitempty"`
	SecureHeader *AppSecureHeaderSpec  `json:"secure_header,omitempty"`
}

AppIngressSpec Specification for app ingress configurations.

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.

func (*AppIngressSpec) GetRules added in v1.98.0

func (a *AppIngressSpec) GetRules() []*AppIngressSpecRule

GetRules returns the Rules 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 AppIngressSpecRule added in v1.98.0

type AppIngressSpecRule struct {
	Match     *AppIngressSpecRuleMatch            `json:"match,omitempty"`
	Component *AppIngressSpecRuleRoutingComponent `json:"component,omitempty"`
	Redirect  *AppIngressSpecRuleRoutingRedirect  `json:"redirect,omitempty"`
	CORS      *AppCORSPolicy                      `json:"cors,omitempty"`
}

AppIngressSpecRule A rule that configures component routes, rewrites, redirects and cors.

func (*AppIngressSpecRule) GetCORS added in v1.98.0

func (a *AppIngressSpecRule) GetCORS() *AppCORSPolicy

GetCORS returns the CORS field.

func (*AppIngressSpecRule) GetComponent added in v1.98.0

GetComponent returns the Component field.

func (*AppIngressSpecRule) GetMatch added in v1.98.0

GetMatch returns the Match field.

func (*AppIngressSpecRule) GetRedirect added in v1.98.0

GetRedirect returns the Redirect field.

type AppIngressSpecRuleMatch added in v1.98.0

type AppIngressSpecRuleMatch struct {
	Path      *AppIngressSpecRuleStringMatch `json:"path,omitempty"`
	Authority *AppIngressSpecRuleStringMatch `json:"authority,omitempty"`
}

AppIngressSpecRuleMatch The match configuration for a rule.

func (*AppIngressSpecRuleMatch) GetAuthority added in v1.145.0

GetAuthority returns the Authority field.

func (*AppIngressSpecRuleMatch) GetPath added in v1.98.0

GetPath returns the Path field.

type AppIngressSpecRuleRoutingComponent added in v1.98.0

type AppIngressSpecRuleRoutingComponent struct {
	// The name of the component to route to.
	Name string `json:"name,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 and is mutually exclusive with `rewrite`.
	PreservePathPrefix bool `json:"preserve_path_prefix,omitempty"`
	// An optional field that will rewrite the path of the component to be what is specified here. 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 you specified the rewrite to be `/v1/`, requests to `/api/list` would be rewritten to `/v1/list`. Note: this is mutually exclusive with `preserve_path_prefix`.
	Rewrite string `json:"rewrite,omitempty"`
}

AppIngressSpecRuleRoutingComponent The component routing configuration.

func (*AppIngressSpecRuleRoutingComponent) GetName added in v1.98.0

GetName returns the Name field.

func (*AppIngressSpecRuleRoutingComponent) GetPreservePathPrefix added in v1.98.0

func (a *AppIngressSpecRuleRoutingComponent) GetPreservePathPrefix() bool

GetPreservePathPrefix returns the PreservePathPrefix field.

func (*AppIngressSpecRuleRoutingComponent) GetRewrite added in v1.98.0

GetRewrite returns the Rewrite field.

type AppIngressSpecRuleRoutingRedirect added in v1.98.0

type AppIngressSpecRuleRoutingRedirect struct {
	// An optional URI path to redirect to. Note: if this is specified the whole URI of the original request will be overwritten to this value, irrespective of the original request URI being matched.
	Uri string `json:"uri,omitempty"`
	// The authority/host to redirect to. This can be a hostname or IP address. Note: use `port` to set the port.
	Authority string `json:"authority,omitempty"`
	// The port to redirect to.
	Port int64 `json:"port,omitempty"`
	// The scheme to redirect to. Supported values are `http` or `https`. Default: `https`.
	Scheme string `json:"scheme,omitempty"`
	// The redirect code to use. Defaults to `302`. Supported values are 300, 301, 302, 303, 304, 307, 308.
	RedirectCode int64 `json:"redirect_code,omitempty"`
}

AppIngressSpecRuleRoutingRedirect The redirect routing configuration.

func (*AppIngressSpecRuleRoutingRedirect) GetAuthority added in v1.98.0

func (a *AppIngressSpecRuleRoutingRedirect) GetAuthority() string

GetAuthority returns the Authority field.

func (*AppIngressSpecRuleRoutingRedirect) GetPort added in v1.98.0

GetPort returns the Port field.

func (*AppIngressSpecRuleRoutingRedirect) GetRedirectCode added in v1.98.0

func (a *AppIngressSpecRuleRoutingRedirect) GetRedirectCode() int64

GetRedirectCode returns the RedirectCode field.

func (*AppIngressSpecRuleRoutingRedirect) GetScheme added in v1.98.0

GetScheme returns the Scheme field.

func (*AppIngressSpecRuleRoutingRedirect) GetUri added in v1.98.0

GetUri returns the Uri field.

type AppIngressSpecRuleStringMatch added in v1.98.0

type AppIngressSpecRuleStringMatch struct {
	// Prefix-based match. For example, `/api` will match `/api`, `/api/`, and any nested paths such as `/api/v1/endpoint`.
	Prefix *string `json:"prefix,omitempty"`
	Exact  *string `json:"exact,omitempty"`
}

AppIngressSpecRuleStringMatch The string match configuration.

func (*AppIngressSpecRuleStringMatch) GetExact added in v1.145.0

func (a *AppIngressSpecRuleStringMatch) GetExact() string

GetExact returns the Exact field.

func (*AppIngressSpecRuleStringMatch) GetPrefix added in v1.98.0

func (a *AppIngressSpecRuleStringMatch) GetPrefix() string

GetPrefix returns the Prefix field.

type AppInstance added in v1.147.0

type AppInstance struct {
	// The name of the component this instance belongs to.
	ComponentName string `json:"component_name,omitempty"`
	// The unique name identifying this specific instance.
	InstanceName  string                   `json:"instance_name,omitempty"`
	ComponentType AppInstanceComponentType `json:"component_type,omitempty"`
	// An optional alias for the instance, used for display or identification.
	InstanceAlias string `json:"instance_alias,omitempty"`
}

AppInstance struct for AppInstance

func (*AppInstance) GetComponentName added in v1.147.0

func (a *AppInstance) GetComponentName() string

GetComponentName returns the ComponentName field.

func (*AppInstance) GetComponentType added in v1.147.0

func (a *AppInstance) GetComponentType() AppInstanceComponentType

GetComponentType returns the ComponentType field.

func (*AppInstance) GetInstanceAlias added in v1.151.0

func (a *AppInstance) GetInstanceAlias() string

GetInstanceAlias returns the InstanceAlias field.

func (*AppInstance) GetInstanceName added in v1.147.0

func (a *AppInstance) GetInstanceName() string

GetInstanceName returns the InstanceName field.

type AppInstanceComponentType added in v1.147.0

type AppInstanceComponentType string

AppInstanceComponentType the model 'AppInstanceComponentType'

const (
	APPINSTANCECOMPONENTTYPE_Unknown AppInstanceComponentType = "UNKNOWN"
	APPINSTANCECOMPONENTTYPE_Service AppInstanceComponentType = "SERVICE"
	APPINSTANCECOMPONENTTYPE_Worker  AppInstanceComponentType = "WORKER"
	APPINSTANCECOMPONENTTYPE_Job     AppInstanceComponentType = "JOB"
)

List of AppInstanceComponentType

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"`
	// (Deprecated) The slug of the corresponding upgradable instance size on the higher tier.
	TierUpgradeTo string `json:"tier_upgrade_to,omitempty"`
	// (Deprecated) The slug of the corresponding downgradable instance size on the lower tier.
	TierDowngradeTo string `json:"tier_downgrade_to,omitempty"`
	// Indicates if the tier instance size can enable autoscaling.
	Scalable bool `json:"scalable,omitempty"`
	// (Deprecated) Indicates if the tier instance size is in feature preview state.
	FeaturePreview bool `json:"feature_preview,omitempty"`
	// Indicates if the tier instance size allows more than one instance.
	SingleInstanceOnly bool `json:"single_instance_only,omitempty"`
	// Indicates if the tier instance size is intended for deprecation.
	DeprecationIntent bool `json:"deprecation_intent,omitempty"`
	// The bandwidth allowance in GiB for the tier instance size.
	BandwidthAllowanceGib string `json:"bandwidth_allowance_gib,omitempty"`
}

AppInstanceSize struct for AppInstanceSize

func (*AppInstanceSize) GetBandwidthAllowanceGib added in v1.110.0

func (a *AppInstanceSize) GetBandwidthAllowanceGib() string

GetBandwidthAllowanceGib returns the BandwidthAllowanceGib field.

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) GetDeprecationIntent added in v1.110.0

func (a *AppInstanceSize) GetDeprecationIntent() bool

GetDeprecationIntent returns the DeprecationIntent field.

func (*AppInstanceSize) GetFeaturePreview added in v1.109.0

func (a *AppInstanceSize) GetFeaturePreview() bool

GetFeaturePreview returns the FeaturePreview 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) GetScalable added in v1.109.0

func (a *AppInstanceSize) GetScalable() bool

GetScalable returns the Scalable field.

func (*AppInstanceSize) GetSingleInstanceOnly added in v1.109.0

func (a *AppInstanceSize) GetSingleInstanceOnly() bool

GetSingleInstanceOnly returns the SingleInstanceOnly 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"`
	Bitbucket *BitbucketSourceSpec `json:"bitbucket,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"`
	// A slug identifying the type of app, such as `node-js`. Available values are `node-js`, `php`, `ruby`, `python`, `go`, `hugo`, `html`, `hexo`, `ruby-on-rails`, `jekyll`, and `gatsby`.
	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"`
	// The amount of instances that this component should be scaled to. Default 1, Minimum 1, Maximum 250. Consider using a larger instance size if your application requires more than 250 instances.
	InstanceCount int64               `json:"instance_count,omitempty"`
	Kind          AppJobSpecKind      `json:"kind,omitempty"`
	Schedule      *AppJobSpecSchedule `json:"schedule,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"`
	Termination     *AppJobSpecTermination   `json:"termination,omitempty"`
	// The maximum amount of time a job is allowed to run before it is automatically terminated. If not specified, defaults to 30 minutes. Example: `1h30m`.
	Timeout string `json:"timeout,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) GetBitbucket added in v1.132.0

func (a *AppJobSpec) GetBitbucket() *BitbucketSourceSpec

GetBitbucket returns the Bitbucket 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) GetEnvironmentSlug added in v1.98.0

func (a *AppJobSpec) GetEnvironmentSlug() string

GetEnvironmentSlug returns the EnvironmentSlug 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) GetSchedule added in v1.165.1

func (a *AppJobSpec) GetSchedule() *AppJobSpecSchedule

GetSchedule returns the Schedule field.

func (*AppJobSpec) GetSourceDir added in v1.85.0

func (a *AppJobSpec) GetSourceDir() string

GetSourceDir returns the SourceDir field.

func (*AppJobSpec) GetTermination added in v1.114.0

func (a *AppJobSpec) GetTermination() *AppJobSpecTermination

GetTermination returns the Termination field.

func (*AppJobSpec) GetTimeout added in v1.165.1

func (a *AppJobSpec) GetTimeout() string

GetTimeout returns the Timeout 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 the model 'AppJobSpecKind'

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

List of AppJobSpecKind

type AppJobSpecSchedule added in v1.165.1

type AppJobSpecSchedule struct {
	Cron     string `json:"cron,omitempty"`
	TimeZone string `json:"time_zone,omitempty"`
}

AppJobSpecSchedule struct for AppJobSpecSchedule

func (*AppJobSpecSchedule) GetCron added in v1.165.1

func (a *AppJobSpecSchedule) GetCron() string

GetCron returns the Cron field.

func (*AppJobSpecSchedule) GetTimeZone added in v1.165.1

func (a *AppJobSpecSchedule) GetTimeZone() string

GetTimeZone returns the TimeZone field.

type AppJobSpecTermination added in v1.114.0

type AppJobSpecTermination struct {
	// The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. Default: 120, Minimum 1, Maximum 600.
	GracePeriodSeconds int32 `json:"grace_period_seconds,omitempty"`
}

AppJobSpecTermination struct for AppJobSpecTermination

func (*AppJobSpecTermination) GetGracePeriodSeconds added in v1.114.0

func (a *AppJobSpecTermination) GetGracePeriodSeconds() int32

GetGracePeriodSeconds returns the GracePeriodSeconds field.

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"`
	OpenSearch  *AppLogDestinationSpecOpenSearch `json:"open_search,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) GetOpenSearch added in v1.117.0

GetOpenSearch returns the OpenSearch 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 AppLogDestinationSpecOpenSearch added in v1.117.0

type AppLogDestinationSpecOpenSearch struct {
	// OpenSearch API Endpoint. Only HTTPS is supported. Format: https://<host>:<port>. Cannot be specified if `cluster_name` is also specified.
	Endpoint  string               `json:"endpoint,omitempty"`
	BasicAuth *OpenSearchBasicAuth `json:"basic_auth,omitempty"`
	// The index name to use for the logs. If not set, the default index name is \"logs\".
	IndexName string `json:"index_name,omitempty"`
	// The name of a DigitalOcean DBaaS OpenSearch cluster to use as a log forwarding destination. Cannot be specified if `endpoint` is also specified.
	ClusterName string `json:"cluster_name,omitempty"`
}

AppLogDestinationSpecOpenSearch OpenSearch configuration.

func (*AppLogDestinationSpecOpenSearch) GetBasicAuth added in v1.117.0

GetBasicAuth returns the BasicAuth field.

func (*AppLogDestinationSpecOpenSearch) GetClusterName added in v1.119.0

func (a *AppLogDestinationSpecOpenSearch) GetClusterName() string

GetClusterName returns the ClusterName field.

func (*AppLogDestinationSpecOpenSearch) GetEndpoint added in v1.117.0

func (a *AppLogDestinationSpecOpenSearch) GetEndpoint() string

GetEndpoint returns the Endpoint field.

func (*AppLogDestinationSpecOpenSearch) GetIndexName added in v1.117.0

func (a *AppLogDestinationSpecOpenSearch) GetIndexName() string

GetIndexName returns the IndexName 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"
	// AppLogTypeRunRestarted represents logs of crashed/restarted instances during runtime.
	AppLogTypeRunRestarted AppLogType = "RUN_RESTARTED"
	// AppLogTypeAutoscaleEvent represents logs of an autoscaling event.
	AppLogTypeAutoscaleEvent AppLogType = "AUTOSCALE_EVENT"
)

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 AppMaintenanceSpec added in v1.128.0

type AppMaintenanceSpec struct {
	// Indicates whether maintenance mode should be enabled for the app.
	Enabled bool `json:"enabled,omitempty"`
	// Indicates whether the app should be archived. Setting this to true implies that enabled is set to true.
	Archive bool `json:"archive,omitempty"`
	// A custom offline page to display when maintenance mode is enabled or the app is archived.
	OfflinePageURL string `json:"offline_page_url,omitempty"`
}

AppMaintenanceSpec struct for AppMaintenanceSpec

func (*AppMaintenanceSpec) GetArchive added in v1.128.0

func (a *AppMaintenanceSpec) GetArchive() bool

GetArchive returns the Archive field.

func (*AppMaintenanceSpec) GetEnabled added in v1.128.0

func (a *AppMaintenanceSpec) GetEnabled() bool

GetEnabled returns the Enabled field.

func (*AppMaintenanceSpec) GetOfflinePageURL added in v1.135.0

func (a *AppMaintenanceSpec) GetOfflinePageURL() string

GetOfflinePageURL returns the OfflinePageURL field.

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 app_is_starter 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 existing_starter_apps instead.
	ExistingStaticApps string `json:"existing_static_apps,omitempty"`
	// Deprecated. Please use max_free_starter_apps 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"`
	// (Deprecated) 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 `app_tier_upgrade_cost` 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"`
	// (Deprecated) 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 `app_tier_downgrade_cost` 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 AppRestartRequest added in v1.131.0

type AppRestartRequest struct {
	Components []string `json:"components"`
}

AppRestartRequest represents a request to restart an app.

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 {
	// (Deprecated) An HTTP path prefix. Paths must start with / and must be unique across all components within an app.
	Path string `json:"path,omitempty"`
	// (Deprecated) 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 AppSecureHeaderSpec added in v1.174.0

type AppSecureHeaderSpec struct {
	// The name of the header to set.
	Key string `json:"key,omitempty"`
	// The value of the header to set.
	Value string `json:"value,omitempty"`
	// Remove the header from incoming requests before forwarding to the app.
	RemoveHeader bool `json:"remove_header,omitempty"`
}

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"`
	Bitbucket *BitbucketSourceSpec `json:"bitbucket,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"`
	// The amount of instances that this component should be scaled to. Default 1, Minimum 1, Maximum 250. Consider using a larger instance size if your application requires more than 250 instances.
	InstanceCount int64               `json:"instance_count,omitempty"`
	Autoscaling   *AppAutoscalingSpec `json:"autoscaling,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"`
	Protocol ServingProtocol `json:"protocol,omitempty"`
	// (Deprecated) 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"`
	Termination     *AppServiceSpecTermination `json:"termination,omitempty"`
	// A configuration for putting the service to sleep after it has been inactive. Note: this is in Private Preview.
	InactivitySleep     *AppServiceSpecInactivitySleep `json:"inactivity_sleep,omitempty"`
	LivenessHealthCheck *HealthCheckSpec               `json:"liveness_health_check,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) GetAutoscaling added in v1.105.0

func (a *AppServiceSpec) GetAutoscaling() *AppAutoscalingSpec

GetAutoscaling returns the Autoscaling field.

func (*AppServiceSpec) GetBitbucket added in v1.132.0

func (a *AppServiceSpec) GetBitbucket() *BitbucketSourceSpec

GetBitbucket returns the Bitbucket 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) GetEnvironmentSlug added in v1.98.0

func (a *AppServiceSpec) GetEnvironmentSlug() string

GetEnvironmentSlug returns the EnvironmentSlug 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) GetInactivitySleep added in v1.174.0

func (a *AppServiceSpec) GetInactivitySleep() *AppServiceSpecInactivitySleep

GetInactivitySleep returns the InactivitySleep 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) GetLivenessHealthCheck added in v1.165.1

func (a *AppServiceSpec) GetLivenessHealthCheck() *HealthCheckSpec

GetLivenessHealthCheck returns the LivenessHealthCheck 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) GetProtocol added in v1.128.0

func (a *AppServiceSpec) GetProtocol() ServingProtocol

GetProtocol returns the Protocol 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) GetTermination added in v1.114.0

func (a *AppServiceSpec) GetTermination() *AppServiceSpecTermination

GetTermination returns the Termination 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, Minimum 0, Maximum 3600. When used in liveness_health_check, Default: 5 seconds, Minimum 0, Maximum 3600.
	InitialDelaySeconds int32 `json:"initial_delay_seconds,omitempty"`
	// The number of seconds to wait between health checks. Default: 10 seconds, Minimum 1, Maximum 300. When used in liveness_health_check, Default: 10 seconds, Minimum 1, Maximum 300.
	PeriodSeconds int32 `json:"period_seconds,omitempty"`
	// The number of seconds after which the check times out. Default: 1 second, Minimum 1, Maximum 120.
	TimeoutSeconds int32 `json:"timeout_seconds,omitempty"`
	// The number of successful health checks before considered healthy. Default: 1 second, Minimum 1, Maximum 50. When used in liveness_health_check, Default: 1 second, Minimum 1, Maximum 1.
	SuccessThreshold int32 `json:"success_threshold,omitempty"`
	// The number of failed health checks before considered unhealthy. Default: 9 seconds, Minimum 1, Maximum 50. When used in liveness_health_check, Default: 18 seconds, Minimum 1, Maximum 50.
	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 AppServiceSpecInactivitySleep added in v1.174.0

type AppServiceSpecInactivitySleep struct {
	// The number of seconds to wait before putting the service to sleep after it has been inactive. Minimum 600, Maximum 86400.
	AfterSeconds int32                       `json:"after_seconds,omitempty"`
	LoadingPage  *InactivitySleepLoadingPage `json:"loading_page,omitempty"`
}

AppServiceSpecInactivitySleep struct for AppServiceSpecInactivitySleep

func (*AppServiceSpecInactivitySleep) GetAfterSeconds added in v1.174.0

func (a *AppServiceSpecInactivitySleep) GetAfterSeconds() int32

GetAfterSeconds returns the AfterSeconds field.

func (*AppServiceSpecInactivitySleep) GetLoadingPage added in v1.174.0

GetLoadingPage returns the LoadingPage field.

type AppServiceSpecTermination added in v1.114.0

type AppServiceSpecTermination struct {
	// The number of seconds to wait between selecting a container instance for termination and issuing the TERM signal. Selecting a container instance for termination begins an asynchronous drain of new requests on upstream load-balancers. Default: 15 seconds, Minimum 1, Maximum 110.
	DrainSeconds int32 `json:"drain_seconds,omitempty"`
	// The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. Default: 120, Minimum 1, Maximum 600.
	GracePeriodSeconds int32 `json:"grace_period_seconds,omitempty"`
}

AppServiceSpecTermination struct for AppServiceSpecTermination

func (*AppServiceSpecTermination) GetDrainSeconds added in v1.114.0

func (a *AppServiceSpecTermination) GetDrainSeconds() int32

GetDrainSeconds returns the DrainSeconds field.

func (*AppServiceSpecTermination) GetGracePeriodSeconds added in v1.114.0

func (a *AppServiceSpecTermination) GetGracePeriodSeconds() int32

GetGracePeriodSeconds returns the GracePeriodSeconds field.

type AppSourceType added in v1.85.0

type AppSourceType string

AppSourceType is an app source type.

const (
	AppSourceTypeBitbucket AppSourceType = "bitbucket"
	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"`
	Egress      *AppEgressSpec      `json:"egress,omitempty"`
	Features    []string            `json:"features,omitempty"`
	Maintenance *AppMaintenanceSpec `json:"maintenance,omitempty"`
	Vpc         *AppVpcSpec         `json:"vpc,omitempty"`
	// Set to `true` to disable the CDN cache, allowing you to use your own CDN, use SSE, and build MCP servers. Defaults to `false`.
	DisableEdgeCache bool `json:"disable_edge_cache,omitempty"`
	// Set to `true` to disable email obfuscation, presenting any email addresses in your site's HTML as they are, instead of automatically anonymizing them. Defaults to `false`.
	DisableEmailObfuscation bool `json:"disable_email_obfuscation,omitempty"`
	// Set to `true` to enable enhanced threat control for Layer 7 DDoS protection. This returns a `403 Forbidden` error response to suspicious API requests. Takes up to 30 seconds to propagate. Defaults to `false`.
	EnhancedThreatControlEnabled bool `json:"enhanced_threat_control_enabled,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) GetDisableEdgeCache added in v1.150.0

func (a *AppSpec) GetDisableEdgeCache() bool

GetDisableEdgeCache returns the DisableEdgeCache field.

func (*AppSpec) GetDisableEmailObfuscation added in v1.150.0

func (a *AppSpec) GetDisableEmailObfuscation() bool

GetDisableEmailObfuscation returns the DisableEmailObfuscation field.

func (*AppSpec) GetDomains added in v1.85.0

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

GetDomains returns the Domains field.

func (*AppSpec) GetEgress added in v1.107.0

func (a *AppSpec) GetEgress() *AppEgressSpec

GetEgress returns the Egress field.

func (*AppSpec) GetEnhancedThreatControlEnabled added in v1.150.0

func (a *AppSpec) GetEnhancedThreatControlEnabled() bool

GetEnhancedThreatControlEnabled returns the EnhancedThreatControlEnabled 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) GetMaintenance added in v1.128.0

func (a *AppSpec) GetMaintenance() *AppMaintenanceSpec

GetMaintenance returns the Maintenance 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) GetVpc added in v1.159.0

func (a *AppSpec) GetVpc() *AppVpcSpec

GetVpc returns the Vpc 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"`
	Bitbucket *BitbucketSourceSpec `json:"bitbucket,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"`
	// A slug identifying the type of app, such as `node-js`. Available values are `node-js`, `php`, `ruby`, `python`, `go`, `hugo`, `html`, `hexo`, `ruby-on-rails`, `jekyll`, and `gatsby`.
	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"`
	// (Deprecated) 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) GetBitbucket added in v1.132.0

func (a *AppStaticSiteSpec) GetBitbucket() *BitbucketSourceSpec

GetBitbucket returns the Bitbucket field.

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) GetEnvironmentSlug added in v1.98.0

func (a *AppStaticSiteSpec) GetEnvironmentSlug() string

GetEnvironmentSlug returns the EnvironmentSlug 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"`
	// Whether or not to update the source versions (for example fetching a new commit or image digest) of all components. By default (when this is false) only newly added sources will be updated to avoid changes like updating the scale of a component from also updating the respective code.
	UpdateAllSourceVersions bool `json:"update_all_source_versions"`
}

AppUpdateRequest represents a request to update an app.

type AppVPC added in v1.159.0

type AppVPC struct {
	// The ID of the VPC (derived from the app spec).
	ID string `json:"id,omitempty"`
	// The private IP addresses allocated for the app in the customer's VPC.
	EgressIPs []*AppVPCEgressIP `json:"egress_ips,omitempty"`
}

AppVPC The VPC configuration for the app.

func (*AppVPC) GetEgressIPs added in v1.159.0

func (a *AppVPC) GetEgressIPs() []*AppVPCEgressIP

GetEgressIPs returns the EgressIPs field.

func (*AppVPC) GetID added in v1.159.0

func (a *AppVPC) GetID() string

GetID returns the ID field.

type AppVPCEgressIP added in v1.159.0

type AppVPCEgressIP struct {
	IP string `json:"ip,omitempty"`
}

AppVPCEgressIP struct for AppVPCEgressIP

func (*AppVPCEgressIP) GetIP added in v1.159.0

func (a *AppVPCEgressIP) GetIP() string

GetIP returns the IP field.

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 AppVpcSpec added in v1.159.0

type AppVpcSpec struct {
	// The id of the target VPC, in UUID format.
	ID string `json:"id,omitempty"`
}

AppVpcSpec Configuration of VPC.

func (*AppVpcSpec) GetID added in v1.159.0

func (a *AppVpcSpec) GetID() string

GetID returns the ID field.

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"`
	Bitbucket *BitbucketSourceSpec `json:"bitbucket,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"`
	// A slug identifying the type of app, such as `node-js`. Available values are `node-js`, `php`, `ruby`, `python`, `go`, `hugo`, `html`, `hexo`, `ruby-on-rails`, `jekyll`, and `gatsby`.
	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"`
	// The amount of instances that this component should be scaled to. Default 1, Minimum 1, Maximum 250. Consider using a larger instance size if your application requires more than 250 instances.
	InstanceCount int64               `json:"instance_count,omitempty"`
	Autoscaling   *AppAutoscalingSpec `json:"autoscaling,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"`
	Termination         *AppWorkerSpecTermination `json:"termination,omitempty"`
	LivenessHealthCheck *HealthCheckSpec          `json:"liveness_health_check,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) GetAutoscaling added in v1.105.0

func (a *AppWorkerSpec) GetAutoscaling() *AppAutoscalingSpec

GetAutoscaling returns the Autoscaling field.

func (*AppWorkerSpec) GetBitbucket added in v1.132.0

func (a *AppWorkerSpec) GetBitbucket() *BitbucketSourceSpec

GetBitbucket returns the Bitbucket 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) GetEnvironmentSlug added in v1.98.0

func (a *AppWorkerSpec) GetEnvironmentSlug() string

GetEnvironmentSlug returns the EnvironmentSlug 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) GetLivenessHealthCheck added in v1.165.1

func (a *AppWorkerSpec) GetLivenessHealthCheck() *HealthCheckSpec

GetLivenessHealthCheck returns the LivenessHealthCheck 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) GetTermination added in v1.114.0

func (a *AppWorkerSpec) GetTermination() *AppWorkerSpecTermination

GetTermination returns the Termination field.

func (*AppWorkerSpec) GetType added in v1.85.0

func (s *AppWorkerSpec) GetType() AppComponentType

GetType returns the Worker component type.

type AppWorkerSpecTermination added in v1.114.0

type AppWorkerSpecTermination struct {
	// The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. Default: 120, Minimum 1, Maximum 600.
	GracePeriodSeconds int32 `json:"grace_period_seconds,omitempty"`
}

AppWorkerSpecTermination struct for AppWorkerSpecTermination

func (*AppWorkerSpecTermination) GetGracePeriodSeconds added in v1.114.0

func (a *AppWorkerSpecTermination) GetGracePeriodSeconds() int32

GetGracePeriodSeconds returns the GracePeriodSeconds field.

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)

	Restart(ctx context.Context, appID string, opts *AppRestartRequest) (*Deployment, *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)
	// Deprecated: Use GetExecWithOpts instead.
	GetExec(ctx context.Context, appID, deploymentID, component string) (*AppExec, *Response, error)
	GetExecWithOpts(ctx context.Context, appID, componentName string, opts *AppGetExecOptions) (*AppExec, *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)
	GetAppHealth(ctx context.Context, appID string) (*AppHealth, *Response, error)
	GetAppDatabaseConnectionDetails(ctx context.Context, appID string) ([]*GetDatabaseConnectionDetailsResponse, *Response, error)
	ResetDatabasePassword(ctx context.Context, appID string, component string) (*Deployment, *Response, error)
	ToggleDatabaseTrustedSource(
		ctx context.Context,
		appID string,
		component string,
		opts ToggleDatabaseTrustedSourceOptions,
	) (
		*ToggleDatabaseTrustedSourceResponse,
		*Response,
		error,
	)

	GetAppInstances(ctx context.Context, appID string, opts *GetAppInstancesOpts) ([]*AppInstance, *Response, error)

	ListJobInvocations(ctx context.Context, appID string, opts *ListJobInvocationsOptions) ([]*JobInvocation, *Response, error)
	GetJobInvocation(ctx context.Context, appID string, jobInvocationId string, opts *GetJobInvocationOptions) (*JobInvocation, *Response, error)
	GetJobInvocationLogs(ctx context.Context, appID, jobInvocationId string, opts *GetJobInvocationLogsOptions) (*AppLogs, *Response, error)
	CancelJobInvocation(ctx context.Context, appID, jobInvocationID string, opts *CancelJobInvocationOptions) (*JobInvocation, *Response, error)

	ListEvents(ctx context.Context, appID string, opts *ListEventsOptions) ([]*Event, *Response, error)
	GetEvent(ctx context.Context, appID, eventID string) (*Event, *Response, error)
	CancelEvent(ctx context.Context, appID, eventID string) (*Event, *Response, error)
	GetEventLogs(ctx context.Context, appID, eventID string, opts *GetEventLogsOptions) (*AppLogs, *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) CancelEvent added in v1.177.0

func (s *AppsServiceOp) CancelEvent(ctx context.Context, appID, eventID string) (*Event, *Response, error)

CancelEvent cancels an in-progress autoscaling event.

func (*AppsServiceOp) CancelJobInvocation added in v1.172.0

func (s *AppsServiceOp) CancelJobInvocation(ctx context.Context, appID string, jobInvocationId string, opts *CancelJobInvocationOptions) (*JobInvocation, *Response, error)

CancelJobInvocation cancels a specific job invocation for a given app.

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) GetAppDatabaseConnectionDetails added in v1.109.0

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

GetAppDatabaseConnectionDetails retrieves credentials for databases associated with the app.

func (*AppsServiceOp) GetAppHealth added in v1.156.0

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

func (*AppsServiceOp) GetAppInstances added in v1.147.0

func (s *AppsServiceOp) GetAppInstances(ctx context.Context, appID string, opts *GetAppInstancesOpts) ([]*AppInstance, *Response, error)

GetAppInstances returns a list of emphemeral compute instances of the current deployment for an app. opts is reserved for future use.

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) GetEvent added in v1.177.0

func (s *AppsServiceOp) GetEvent(ctx context.Context, appID, eventID string) (*Event, *Response, error)

GetEvent retrieves a single event for an app.

func (*AppsServiceOp) GetEventLogs added in v1.177.0

func (s *AppsServiceOp) GetEventLogs(ctx context.Context, appID, eventID string, opts *GetEventLogsOptions) (*AppLogs, *Response, error)

GetEventLogs retrieves logs for an autoscaling event.

func (*AppsServiceOp) GetExec added in v1.130.0

func (s *AppsServiceOp) GetExec(ctx context.Context, appID, deploymentID, component string) (*AppExec, *Response, error)

GetExec retrieves the websocket URL used for sending/receiving console input and output. Deprecated: Use GetExecWithOpts instead.

func (*AppsServiceOp) GetExecWithOpts added in v1.146.0

func (s *AppsServiceOp) GetExecWithOpts(ctx context.Context, appID, componentName string, opts *AppGetExecOptions) (*AppExec, *Response, error)

GetExecWithOpts retrieves the websocket URL used for sending/receiving console input and output.

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) GetJobInvocation added in v1.165.1

func (s *AppsServiceOp) GetJobInvocation(ctx context.Context, appID string, jobInvocationId string, opts *GetJobInvocationOptions) (*JobInvocation, *Response, error)

GetJobInvocation gets a specific job invocation for a given app.

func (*AppsServiceOp) GetJobInvocationLogs added in v1.165.1

func (s *AppsServiceOp) GetJobInvocationLogs(ctx context.Context, appID, jobInvocationId string, opts *GetJobInvocationLogsOptions) (*AppLogs, *Response, error)

GetJobInvocationLogs retrieves job invocation logs.

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 deprecated 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.

Deprecated: The '/v2/apps/tiers/{slug}' endpoints have been deprecated as app tiers are no longer tied to instance sizes. The concept of tiers is being retired.

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) ListEvents added in v1.177.0

func (s *AppsServiceOp) ListEvents(ctx context.Context, appID string, opts *ListEventsOptions) ([]*Event, *Response, error)

ListEvents lists all events for a given app.

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) ListJobInvocations added in v1.165.1

func (s *AppsServiceOp) ListJobInvocations(ctx context.Context, appID string, opts *ListJobInvocationsOptions) ([]*JobInvocation, *Response, error)

ListJobInvocations lists all job invocations for a given app.

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 deprecated added in v1.49.0

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

ListTiers lists available app tiers.

Deprecated: The '/v2/apps/tiers' endpoint has been deprecated as app tiers are no longer tied to instance sizes. The concept of tiers is being retired.

func (*AppsServiceOp) Propose added in v1.56.0

Propose an app.

func (*AppsServiceOp) ResetDatabasePassword added in v1.109.0

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

ResetDatabasePassword resets credentials for a database component associated with the app.

func (*AppsServiceOp) Restart added in v1.131.0

func (s *AppsServiceOp) Restart(ctx context.Context, appID string, opts *AppRestartRequest) (*Deployment, *Response, error)

Restart restarts an app.

func (*AppsServiceOp) ToggleDatabaseTrustedSource added in v1.109.0

func (s *AppsServiceOp) ToggleDatabaseTrustedSource(
	ctx context.Context,
	appID string,
	component string,
	opts ToggleDatabaseTrustedSourceOptions,
) (
	*ToggleDatabaseTrustedSourceResponse,
	*Response,
	error,
)

ToggleDatabaseTrustedSource enables/disables trusted sources on the specified dev database component.

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 AssociatedModelEvaluationPreset added in v1.198.0

type AssociatedModelEvaluationPreset struct {
	EvalPresetUUID string `json:"eval_preset_uuid,omitempty"`
	Name           string `json:"name,omitempty"`
}

AssociatedModelEvaluationPreset identifies a saved model evaluation preset that references a custom metric.

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 AsyncInvocation added in v1.191.0

type AsyncInvocation struct {
	RequestID   string                 `json:"request_id"`
	ModelID     string                 `json:"model_id"`
	Status      string                 `json:"status"`
	CreatedAt   string                 `json:"created_at"`
	StartedAt   *string                `json:"started_at,omitempty"`
	CompletedAt *string                `json:"completed_at,omitempty"`
	Output      map[string]interface{} `json:"output,omitempty"`
	Error       *string                `json:"error,omitempty"`
}

AsyncInvocation is the response body of POST /v1/async-invoke. Status is one of QUEUED, IN_PROGRESS, COMPLETED, or FAILED.

type AsyncInvocationNewParams added in v1.191.0

type AsyncInvocationNewParams struct {
	ModelID string                 `json:"model_id"`
	Input   map[string]interface{} `json:"input"`
	Tags    []InferenceTag         `json:"tags,omitempty"`
}

AsyncInvocationNewParams is the request body for POST /v1/async-invoke. Input carries model-specific parameters (prompt, text, seconds_total, ...).

type AsyncInvocationService added in v1.191.0

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

AsyncInvocationService exposes POST /v1/async-invoke for async fal model invocations.

func (*AsyncInvocationService) Get added in v1.191.0

Get fetches the current status of an async invocation; Output/Error are populated only on terminal states.

func (*AsyncInvocationService) New added in v1.191.0

New starts an asynchronous fal model invocation.

type AttachedChildAgent added in v1.155.0

type AttachedChildAgent struct {
	AgentName      string `json:"agent_name,omitempty"`
	ChildAgentUuid string `json:"child_agent_uuid,omitempty"`
	IfCase         string `json:"if_case,omitempty"`
	IsDeleted      bool   `json:"is_deleted,omitempty"`
	RouteName      string `json:"route_name,omitempty"`
}

type AuditHeader added in v1.155.0

type AuditHeader struct {
	ActorID           string `json:"actor_id,omitempty"`
	ActorIP           string `json:"actor_ip,omitempty"`
	ActorUUID         string `json:"actor_uuid,omitempty"`
	ContextURN        string `json:"context_urn,omitempty"`
	OriginApplication string `json:"origin_application,omitempty"`
	UserID            string `json:"user_id,omitempty"`
	UserUUID          string `json:"user_uuid,omitempty"`
}

AuditHeader represents audit metadata for an action.

type AutoPauseConfig added in v1.200.0

type AutoPauseConfig struct {
	Enabled     *bool  `json:"enabled,omitempty"`
	IdleTimeout string `json:"idle_timeout,omitempty"`
}

AutoPauseConfig configures MicroVM auto-pause behavior. IdleTimeout is a Go duration string (e.g. "5m", "30s") describing how long the MicroVM must be idle before it is paused.

type AutoscalerActionScaleChange added in v1.161.0

type AutoscalerActionScaleChange struct {
	From int64 `json:"from,omitempty"`
	To   int64 `json:"to,omitempty"`
	// The metric that triggered the scale change while scaling up. Known values are \"cpu\", \"requests_per_second\", \"request_duration\". For inactivity sleep, \"scale_from_zero\" and \"scale_to_zero\" are used.
	TriggeringMetric string `json:"triggering_metric,omitempty"`
}

AutoscalerActionScaleChange struct for AutoscalerActionScaleChange

func (*AutoscalerActionScaleChange) GetFrom added in v1.161.0

func (a *AutoscalerActionScaleChange) GetFrom() int64

GetFrom returns the From field.

func (*AutoscalerActionScaleChange) GetTo added in v1.161.0

GetTo returns the To field.

func (*AutoscalerActionScaleChange) GetTriggeringMetric added in v1.185.0

func (a *AutoscalerActionScaleChange) GetTriggeringMetric() string

GetTriggeringMetric returns the TriggeringMetric field.

type AutoscalingEventComponentScaleChange added in v1.177.0

type AutoscalingEventComponentScaleChange struct {
	From int64 `json:"from,omitempty"`
	To   int64 `json:"to,omitempty"`
	// The metric that triggered the scale change while scaling up. Known values are \"cpu\", \"requests_per_second\", \"request_duration\". For inactivity sleep, \"scale_from_zero\" and \"scale_to_zero\" are used.
	TriggeringMetric string `json:"triggering_metric,omitempty"`
}

AutoscalingEventComponentScaleChange struct for AutoscalingEventComponentScaleChange

func (*AutoscalingEventComponentScaleChange) GetFrom added in v1.177.0

GetFrom returns the From field.

func (*AutoscalingEventComponentScaleChange) GetTo added in v1.177.0

GetTo returns the To field.

func (*AutoscalingEventComponentScaleChange) GetTriggeringMetric added in v1.177.0

func (a *AutoscalingEventComponentScaleChange) GetTriggeringMetric() string

GetTriggeringMetric returns the TriggeringMetric field.

type BGP added in v1.133.0

type BGP struct {
	// LocalASN is the local ASN
	LocalASN int `json:"local_asn,omitempty"`
	// LocalRouterIP is the local router IP
	LocalRouterIP string `json:"local_router_ip,omitempty"`
	// PeerASN is the peer ASN
	PeerASN int `json:"peer_asn,omitempty"`
	// PeerRouterIP is the peer router IP
	PeerRouterIP string `json:"peer_router_ip,omitempty"`
	// AuthKey is the authentication key
	AuthKey string `json:"auth_key,omitempty"`
}

BGP represents the BGP configuration of a Partner Attachment.

func (*BGP) UnmarshalJSON added in v1.139.0

func (b *BGP) UnmarshalJSON(data []byte) error

type BGPInput added in v1.139.0

type BGPInput struct {
	// LocalASN is the local ASN
	LocalASN int `json:"local_router_asn,omitempty"`
	// LocalRouterIP is the local router IP
	LocalRouterIP string `json:"local_router_ip,omitempty"`
	// PeerASN is the peer ASN
	PeerASN int `json:"peer_router_asn,omitempty"`
	// PeerRouterIP is the peer router IP
	PeerRouterIP string `json:"peer_router_ip,omitempty"`
	// AuthKey is the authentication key
	AuthKey string `json:"auth_key,omitempty"`
}

BGPInput represents the BGP configuration of a Partner Attachment.

type BYOIPPrefix added in v1.154.0

type BYOIPPrefix struct {
	Prefix        string `json:"prefix"`
	Status        string `json:"status"`
	UUID          string `json:"uuid"`
	Region        string `json:"region"`
	Validations   []any  `json:"validations"`
	FailureReason string `json:"failure_reason"`
	ProjectID     string `json:"project_id"`
	Advertised    bool   `json:"advertised"`
	Locked        bool   `json:"locked"`
}

func (BYOIPPrefix) String added in v1.154.0

func (r BYOIPPrefix) String() string

type BYOIPPrefixCreateReq added in v1.154.0

type BYOIPPrefixCreateReq struct {
	Prefix    string `json:"prefix"`
	Signature string `json:"signature"`
	Region    string `json:"region"`
}

BYOIPPrefixCreateReq represents a request to create a BYOIP prefix.

type BYOIPPrefixCreateResp added in v1.153.0

type BYOIPPrefixCreateResp struct {
	UUID   string `json:"uuid"`
	Region string `json:"region"`
	Status string `json:"status"`
}

BYOIPPrefixCreateResp represents the response from creating a BYOIP prefix.

type BYOIPPrefixResource added in v1.154.0

type BYOIPPrefixResource struct {
	ID         uint64    `json:"id"`
	BYOIP      string    `json:"byoip"`
	Resource   string    `json:"resource"`
	Region     string    `json:"region"`
	AssignedAt time.Time `json:"assigned_at"`
}

BYOIPPrefixResource represents a BYOIP resource allocations

type BYOIPPrefixServiceOp added in v1.154.0

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

BYOIPPrefixServiceOp handles communication with the BYOIP Prefix related methods of the DigitalOcean API.

func (*BYOIPPrefixServiceOp) Create added in v1.154.0

Create a BYOIP prefix

func (*BYOIPPrefixServiceOp) Delete added in v1.154.0

func (r *BYOIPPrefixServiceOp) Delete(ctx context.Context, uuid string) (*Response, error)

func (*BYOIPPrefixServiceOp) Get added in v1.154.0

Get an individual BYOIP prefix details.

func (*BYOIPPrefixServiceOp) GetResources added in v1.154.0

func (r *BYOIPPrefixServiceOp) GetResources(ctx context.Context, uuid string, opt *ListOptions) ([]BYOIPPrefixResource, *Response, error)

GetResources return all existing BYOIP allocations for given BYOIP prefix id.

func (*BYOIPPrefixServiceOp) List added in v1.154.0

List all BYOIP prefixes.

func (*BYOIPPrefixServiceOp) Update added in v1.164.0

func (r *BYOIPPrefixServiceOp) Update(ctx context.Context, prefixUUID string, updateReq *BYOIPPrefixUpdateReq) (*BYOIPPrefix, *Response, error)

Update a BYOIP prefix

type BYOIPPrefixUpdateReq added in v1.164.0

type BYOIPPrefixUpdateReq struct {
	Advertise *bool `json:"advertise"`
}

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 Batch added in v1.187.0

type Batch struct {
	BatchID           string              `json:"batch_id"`
	Provider          string              `json:"provider"`
	FileID            string              `json:"file_id"`
	CompletionWindow  string              `json:"completion_window"`
	Status            string              `json:"status"`
	RequestID         string              `json:"request_id"`
	RequestCounts     *BatchRequestCounts `json:"request_counts,omitempty"`
	ResultAvailable   bool                `json:"result_available"`
	CancelRequestedAt *string             `json:"cancel_requested_at"`
	CreatedAt         string              `json:"created_at"`
	UpdatedAt         string              `json:"updated_at"`
	ExpiresAt         *string             `json:"expires_at"`
}

Batch represents a batch inference job returned by the inference proxy. Timestamps are ISO 8601 strings. Nullable fields use *string.

type BatchEdge added in v1.187.0

type BatchEdge struct {
	Cursor string `json:"cursor"`
	Node   Batch  `json:"node"`
}

BatchEdge is a single edge in the Relay-style batch list response.

type BatchInferenceService added in v1.187.0

type BatchInferenceService interface {
	CreatePresignedUploadURL(context.Context, *CreateBatchFileRequest) (*CreateBatchFileResponse, *Response, error)
	UploadInputFile(ctx context.Context, uploadURL string, content io.Reader) (*Response, error)
	CreateJob(context.Context, *CreateBatchRequest) (*Batch, *Response, error)
	ListJobs(context.Context, *ListBatchesOptions) (*ListBatchesResponse, *Response, error)
	GetJob(context.Context, string) (*Batch, *Response, error)
	CancelJob(context.Context, string) (*Batch, *Response, error)
	GetJobResult(context.Context, string) (*BatchResultsResponse, *Response, error)
}

BatchInferenceService is an interface for managing batch inference jobs via the inference proxy at inference.do-ai.run.

type BatchInferenceServiceOp added in v1.187.0

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

BatchInferenceServiceOp handles communication with the batch inference endpoints on the inference proxy (inference.do-ai.run).

func (*BatchInferenceServiceOp) CancelJob added in v1.187.0

func (s *BatchInferenceServiceOp) CancelJob(ctx context.Context, batchID string) (*Batch, *Response, error)

CancelJob requests cancellation of a batch inference job.

func (*BatchInferenceServiceOp) CreateJob added in v1.187.0

func (s *BatchInferenceServiceOp) CreateJob(ctx context.Context, createReq *CreateBatchRequest) (*Batch, *Response, error)

CreateJob creates a new batch inference job.

func (*BatchInferenceServiceOp) CreatePresignedUploadURL added in v1.187.0

func (s *BatchInferenceServiceOp) CreatePresignedUploadURL(ctx context.Context, createReq *CreateBatchFileRequest) (*CreateBatchFileResponse, *Response, error)

CreatePresignedUploadURL creates a presigned URL for uploading a batch JSONL input file.

func (*BatchInferenceServiceOp) GetJob added in v1.187.0

func (s *BatchInferenceServiceOp) GetJob(ctx context.Context, batchID string) (*Batch, *Response, error)

GetJob retrieves a batch inference job by ID.

func (*BatchInferenceServiceOp) GetJobResult added in v1.187.0

func (s *BatchInferenceServiceOp) GetJobResult(ctx context.Context, batchID string) (*BatchResultsResponse, *Response, error)

GetJobResult retrieves the result download URLs for a completed batch inference job.

func (*BatchInferenceServiceOp) ListJobs added in v1.187.0

ListJobs returns a list of batch inference jobs with optional filtering and pagination.

func (*BatchInferenceServiceOp) UploadInputFile added in v1.187.0

func (s *BatchInferenceServiceOp) UploadInputFile(ctx context.Context, uploadURL string, content io.Reader) (*Response, error)

UploadInputFile uploads batch JSONL content to a presigned S3 URL returned by CreatePresignedUploadURL. A plain HTTP client is used (no Authorization header) because the presigned URL already embeds authentication in its query parameters.

type BatchPageInfo added in v1.187.0

type BatchPageInfo struct {
	EndCursor   string `json:"endCursor"`
	HasNextPage bool   `json:"hasNextPage"`
}

BatchPageInfo holds forward-only pagination info for batch listing.

type BatchRequestCounts added in v1.187.0

type BatchRequestCounts struct {
	Total     int `json:"total"`
	Completed int `json:"completed"`
	Failed    int `json:"failed"`
}

BatchRequestCounts holds per-request completion counts for a batch job.

type BatchResultsDownload added in v1.187.0

type BatchResultsDownload struct {
	PresignedURL string `json:"presigned_url"`
	ExpiresAt    string `json:"expires_at"`
}

BatchResultsDownload holds the presigned download URL and its expiry.

type BatchResultsResponse added in v1.187.0

type BatchResultsResponse struct {
	Download     BatchResultsDownload `json:"download"`
	OutputFileID string               `json:"output_file_id"`
}

BatchResultsResponse is returned by GET /v1/batches/{batch_id}/results.

type BgpAuthKey added in v1.138.0

type BgpAuthKey struct {
	Value string `json:"value"`
}

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 BitbucketSourceSpec added in v1.132.0

type BitbucketSourceSpec struct {
	Repo         string `json:"repo,omitempty"`
	Branch       string `json:"branch,omitempty"`
	DeployOnPush bool   `json:"deploy_on_push,omitempty"`
}

BitbucketSourceSpec struct for BitbucketSourceSpec

func (*BitbucketSourceSpec) GetBranch added in v1.132.0

func (b *BitbucketSourceSpec) GetBranch() string

GetBranch returns the Branch field.

func (*BitbucketSourceSpec) GetDeployOnPush added in v1.132.0

func (b *BitbucketSourceSpec) GetDeployOnPush() bool

GetDeployOnPush returns the DeployOnPush field.

func (*BitbucketSourceSpec) GetRepo added in v1.132.0

func (b *BitbucketSourceSpec) GetRepo() string

GetRepo returns the Repo field.

func (*BitbucketSourceSpec) GetType added in v1.132.0

func (s *BitbucketSourceSpec) GetType() AppSourceType

GetType returns the Bitbucket source type.

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 CDNSettings added in v1.111.0

type CDNSettings struct {
	// IsEnabled is the caching enabled flag
	IsEnabled bool `json:"is_enabled"`
}

CDNSettings define CDN settings for a Global LB

func (CDNSettings) String added in v1.111.0

func (c CDNSettings) String() string

String creates a human-readable description of a CDNSettings

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 CancelIndexingJobRequest added in v1.165.0

type CancelIndexingJobRequest struct {
	UUID string `json:"uuid"`
}

CancelIndexingJobRequest represents the request payload for cancelling an indexing job

type CancelJobInvocationOptions added in v1.172.0

type CancelJobInvocationOptions struct {
	JobName string `url:"job_name,omitempty"`
}

type CancelModelEvaluationRunRequest added in v1.193.0

type CancelModelEvaluationRunRequest struct {
	EvalRunUUID string `json:"eval_run_uuid"`
}

CancelModelEvaluationRunRequest represents the request payload for cancelling a model evaluation run.

type CandidateAgentConfig added in v1.206.0

type CandidateAgentConfig struct {
	AgentUUID           string `json:"agent_uuid,omitempty"`
	AgentDeploymentUUID string `json:"agent_deployment_uuid,omitempty"`
	Name                string `json:"name,omitempty"`
}

CandidateAgentConfig configures the candidate agent under test for a simulation run.

type CandidateInferenceConfig added in v1.194.1

type CandidateInferenceConfig struct {
	MaxTokens       int64   `json:"max_tokens,omitempty"`
	ReasoningEffort string  `json:"reasoning_effort,omitempty"`
	StopToken       string  `json:"stop_token,omitempty"`
	SystemPrompt    string  `json:"system_prompt,omitempty"`
	Temperature     float32 `json:"temperature,omitempty"`
}

CandidateInferenceConfig is the inference configuration applied to the candidate model when running a model evaluation run.

type CandidateModelSource added in v1.193.0

type CandidateModelSource string

CandidateModelSource indicates whether the evaluation candidate is a served model (serverless, dedicated, or router) or an OHS-hosted agent config.

const (
	CandidateModelSourceServerless CandidateModelSource = "CANDIDATE_MODEL_SOURCE_SERVERLESS"
	CandidateModelSourceDedicated  CandidateModelSource = "CANDIDATE_MODEL_SOURCE_DEDICATED"
	CandidateModelSourceRouter     CandidateModelSource = "CANDIDATE_MODEL_SOURCE_ROUTER"
	CandidateModelSourceAgent      CandidateModelSource = "CANDIDATE_MODEL_SOURCE_AGENT"
)

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.

func (*CertificatesServiceOp) ListByName added in v1.110.0

func (c *CertificatesServiceOp) ListByName(ctx context.Context, name string, opt *ListOptions) ([]Certificate, *Response, error)

type ChatBot added in v1.149.0

type ChatBot struct {
	ButtonBackgroundColor string `json:"button_background_color,omitempty"`
	Name                  string `json:"name,omitempty"`
	PrimaryColor          string `json:"primary_color,omitempty"`
	SecondaryColor        string `json:"secondary_color,omitempty"`
	StartingMessage       string `json:"starting_message,omitempty"`
}

ChatBot represents the chatbot information of an Agent Platform Agent

type ChatCompletion added in v1.191.0

type ChatCompletion struct {
	ID      string                 `json:"id"`
	Object  string                 `json:"object"`
	Created int64                  `json:"created"`
	Model   string                 `json:"model"`
	Choices []ChatCompletionChoice `json:"choices"`
	Usage   *ChatCompletionUsage   `json:"usage,omitempty"`
}

ChatCompletion is returned by POST /v1/chat/completions when stream is false.

type ChatCompletionCacheCreation added in v1.191.0

type ChatCompletionCacheCreation struct {
	Ephemeral1hInputTokens int `json:"ephemeral_1h_input_tokens"`
	Ephemeral5mInputTokens int `json:"ephemeral_5m_input_tokens"`
}

ChatCompletionCacheCreation breaks prompt cache writes down by TTL.

type ChatCompletionChoice added in v1.191.0

type ChatCompletionChoice struct {
	Index        int                           `json:"index"`
	FinishReason string                        `json:"finish_reason"`
	Message      ChatCompletionMessage         `json:"message"`
	Logprobs     *ChatCompletionChoiceLogprobs `json:"logprobs,omitempty"`
}

ChatCompletionChoice is a single choice in a chat completion response.

type ChatCompletionChoiceLogprobs added in v1.191.0

type ChatCompletionChoiceLogprobs struct {
	Content []ChatCompletionLogprob `json:"content"`
	Refusal []ChatCompletionLogprob `json:"refusal"`
}

ChatCompletionChoiceLogprobs is the logprobs payload on a chat choice.

type ChatCompletionChunk added in v1.191.0

type ChatCompletionChunk struct {
	ID                string                      `json:"id"`
	Object            string                      `json:"object"`
	Created           int64                       `json:"created"`
	Model             string                      `json:"model"`
	SystemFingerprint string                      `json:"system_fingerprint,omitempty"`
	Choices           []ChatCompletionChunkChoice `json:"choices"`
	Usage             *ChatCompletionUsage        `json:"usage,omitempty"`
}

ChatCompletionChunk is one streamed event from POST /v1/chat/completions when stream=true.

type ChatCompletionChunkChoice added in v1.191.0

type ChatCompletionChunkChoice struct {
	Index        int                            `json:"index"`
	Delta        ChatCompletionChunkChoiceDelta `json:"delta"`
	Logprobs     *ChatCompletionChoiceLogprobs  `json:"logprobs,omitempty"`
	FinishReason *string                        `json:"finish_reason"`
}

ChatCompletionChunkChoice is a single choice within a streamed chunk.

type ChatCompletionChunkChoiceDelta added in v1.191.0

type ChatCompletionChunkChoiceDelta struct {
	Role             string                   `json:"role,omitempty"`
	Content          string                   `json:"content,omitempty"`
	ReasoningContent string                   `json:"reasoning_content,omitempty"`
	Refusal          string                   `json:"refusal,omitempty"`
	ToolCalls        []ChatCompletionToolCall `json:"tool_calls,omitempty"`
}

ChatCompletionChunkChoiceDelta holds the incremental fields delivered in a streamed chunk.

type ChatCompletionLogprob added in v1.191.0

type ChatCompletionLogprob struct {
	Token       string                  `json:"token"`
	Logprob     float64                 `json:"logprob"`
	Bytes       []int                   `json:"bytes"`
	TopLogprobs []ChatCompletionLogprob `json:"top_logprobs"`
}

ChatCompletionLogprob is a single token's log-probability information.

type ChatCompletionMessage added in v1.191.0

type ChatCompletionMessage struct {
	Role             string                   `json:"role"`
	Content          *string                  `json:"content,omitempty"`
	ReasoningContent *string                  `json:"reasoning_content,omitempty"`
	Refusal          *string                  `json:"refusal,omitempty"`
	ToolCallID       string                   `json:"tool_call_id,omitempty"`
	ToolCalls        []ChatCompletionToolCall `json:"tool_calls,omitempty"`
}

ChatCompletionMessage is a single message in the chat conversation.

func AssistantMessage added in v1.191.0

func AssistantMessage(content string) ChatCompletionMessage

AssistantMessage builds a ChatCompletionMessage with role "assistant".

func SystemMessage added in v1.191.0

func SystemMessage(content string) ChatCompletionMessage

SystemMessage builds a ChatCompletionMessage with role "system".

func UserMessage added in v1.191.0

func UserMessage(content string) ChatCompletionMessage

UserMessage builds a ChatCompletionMessage with role "user".

type ChatCompletionNewParams added in v1.191.0

type ChatCompletionNewParams struct {
	Model               string                       `json:"model"`
	Messages            []ChatCompletionMessage      `json:"messages"`
	FrequencyPenalty    *float64                     `json:"frequency_penalty,omitempty"`
	LogitBias           map[string]int               `json:"logit_bias,omitempty"`
	Logprobs            *bool                        `json:"logprobs,omitempty"`
	TopLogprobs         *int                         `json:"top_logprobs,omitempty"`
	MaxTokens           *int                         `json:"max_tokens,omitempty"`
	MaxCompletionTokens *int                         `json:"max_completion_tokens,omitempty"`
	Metadata            map[string]string            `json:"metadata,omitempty"`
	N                   *int                         `json:"n,omitempty"`
	PresencePenalty     *float64                     `json:"presence_penalty,omitempty"`
	ReasoningEffort     *string                      `json:"reasoning_effort,omitempty"`
	Seed                *int                         `json:"seed,omitempty"`
	Stop                json.RawMessage              `json:"stop,omitempty"`
	Stream              *bool                        `json:"stream,omitempty"`
	StreamOptions       *ChatCompletionStreamOptions `json:"stream_options,omitempty"`
	Temperature         *float64                     `json:"temperature,omitempty"`
	ToolChoice          json.RawMessage              `json:"tool_choice,omitempty"`
	Tools               []ChatCompletionTool         `json:"tools,omitempty"`
	TopP                *float64                     `json:"top_p,omitempty"`
	User                string                       `json:"user,omitempty"`
}

ChatCompletionNewParams is the request body for POST /v1/chat/completions. Stop and ToolChoice are json.RawMessage to accept either a string or a structured value.

type ChatCompletionService added in v1.191.0

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

ChatCompletionService exposes POST /v1/chat/completions.

func (*ChatCompletionService) New added in v1.191.0

New creates a non-streaming chat completion.

func (*ChatCompletionService) NewStreaming added in v1.191.0

NewStreaming opens an SSE stream of chat completion chunks; body.Stream is forced to true. Callers MUST Close the returned stream.

type ChatCompletionStream added in v1.191.0

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

ChatCompletionStream is a typed iterator over a /v1/chat/completions SSE stream.

func (*ChatCompletionStream) Close added in v1.191.0

func (s *ChatCompletionStream) Close() error

Close releases the underlying HTTP response body. Always call Close.

func (*ChatCompletionStream) Current added in v1.191.0

Current returns the most recent chunk produced by Next.

func (*ChatCompletionStream) Err added in v1.191.0

func (s *ChatCompletionStream) Err() error

Err returns any non-EOF error encountered during iteration.

func (*ChatCompletionStream) Next added in v1.191.0

func (s *ChatCompletionStream) Next() bool

Next advances to the next chunk; returns false on EOF, "[DONE]", or error.

type ChatCompletionStreamOptions added in v1.191.0

type ChatCompletionStreamOptions struct {
	IncludeUsage *bool `json:"include_usage,omitempty"`
}

ChatCompletionStreamOptions toggles streaming-only response options.

type ChatCompletionTool added in v1.191.0

type ChatCompletionTool struct {
	Type     string                     `json:"type"`
	Function ChatCompletionToolFunction `json:"function"`
}

ChatCompletionTool is a tool definition exposed to the model.

type ChatCompletionToolCall added in v1.191.0

type ChatCompletionToolCall struct {
	ID       string                     `json:"id"`
	Type     string                     `json:"type"`
	Function ChatCompletionToolCallFunc `json:"function"`
}

ChatCompletionToolCall is a tool invocation produced by the model.

type ChatCompletionToolCallFunc added in v1.191.0

type ChatCompletionToolCallFunc struct {
	Name      string `json:"name"`
	Arguments string `json:"arguments"`
}

ChatCompletionToolCallFunc holds the function name and JSON-encoded arguments for a tool call.

type ChatCompletionToolFunction added in v1.191.0

type ChatCompletionToolFunction struct {
	Name        string                 `json:"name"`
	Description string                 `json:"description,omitempty"`
	Parameters  map[string]interface{} `json:"parameters,omitempty"`
}

ChatCompletionToolFunction describes a callable function tool.

type ChatCompletionUsage added in v1.191.0

type ChatCompletionUsage struct {
	PromptTokens            int                          `json:"prompt_tokens"`
	CompletionTokens        int                          `json:"completion_tokens"`
	TotalTokens             int                          `json:"total_tokens"`
	CacheCreatedInputTokens int                          `json:"cache_created_input_tokens,omitempty"`
	CacheReadInputTokens    int                          `json:"cache_read_input_tokens,omitempty"`
	CacheCreation           *ChatCompletionCacheCreation `json:"cache_creation,omitempty"`
}

ChatCompletionUsage holds token accounting for a chat completion.

type ChatService added in v1.191.0

type ChatService struct {
	Completions *ChatCompletionService
}

ChatService hosts the Completions sub-service to mirror openai-go's namespace.

type Client

type Client struct {
	// HTTP client used to communicate with the DO API.
	HTTPClient *http.Client

	// 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
	Prepayment          PrepaymentService
	CDNs                CDNService
	Certificates        CertificatesService
	Databases           DatabasesService
	Domains             DomainsService
	Droplets            DropletsService
	DropletActions      DropletActionsService
	DropletAutoscale    DropletAutoscaleService
	VPCNATGateways      VPCNATGatewaysService
	Firewalls           FirewallsService
	FloatingIPs         FloatingIPsService
	FloatingIPActions   FloatingIPActionsService
	Functions           FunctionsService
	Images              ImagesService
	ImageActions        ImageActionsService
	Insights            InsightsService
	Invoices            InvoicesService
	Keys                KeysService
	Kubernetes          KubernetesService
	LoadBalancers       LoadBalancersService
	MicroVMs            MicroVMsService
	Monitoring          MonitoringService
	Security            SecurityService
	Secrets             SecretsService
	Nfs                 NfsService
	NfsActions          NfsActionsService
	OneClick            OneClickService
	Projects            ProjectsService
	Regions             RegionsService
	Registry            RegistryService
	Registries          RegistriesService
	ReservedIPs         ReservedIPsService
	ReservedIPV6s       ReservedIPV6sService
	ReservedIPActions   ReservedIPActionsService
	ReservedIPV6Actions ReservedIPV6ActionsService
	Sizes               SizesService
	Snapshots           SnapshotsService
	SpacesKeys          SpacesKeysService
	Storage             StorageService
	StorageActions      StorageActionsService
	Tags                TagsService
	UptimeChecks        UptimeChecksService
	VectorDBs           VectorDBsService
	VPCs                VPCsService
	Routes              RoutesService
	PartnerAttachment   PartnerAttachmentService
	AgentPlatform       AgentPlatformService
	ActionGateway       *ActionGatewayService
	HostedAgents        HostedAgentsService
	HostedAgentTriggers HostedAgentTriggersService
	DedicatedInference  DedicatedInferenceService
	BatchInference      BatchInferenceService
	Signals             SignalsService
	BYOIPPrefixes       BYOIPPrefixesService

	// Serverless Inference resources at https://inference.do-ai.run.
	Chat             *ChatService
	Embeddings       *EmbeddingService
	ImageGenerations *ImageGenerationService
	Messages         *MessageService
	Models           *ModelService
	Responses        *ResponseService
	AsyncInvocations *AsyncInvocationService

	// Optional retry values. Setting the RetryConfig.RetryMax value enables automatically retrying requests
	// that fail with 429 or 500-level response codes using the go-retryablehttp client
	RetryConfig RetryConfig
	// 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) DoStream added in v1.191.0

func (c *Client) DoStream(ctx context.Context, req *http.Request) (*Response, error)

DoStream sends an API request and returns the response with its body left open for streaming consumption (e.g. text/event-stream). On 2xx, the caller owns resp.Body and must close it. On non-2xx, the body is drained and closed and the typed *ErrorResponse is returned.

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.

func WithActionGatewayMCPBaseURL added in v1.216.0

func WithActionGatewayMCPBaseURL(rawURL string) ClientOpt

WithActionGatewayMCPBaseURL replaces only the origin of returned session MCP URLs. HTTP is permitted for loopback development servers only.

func WithRetryAndBackoffs added in v1.101.0

func WithRetryAndBackoffs(retryConfig RetryConfig) ClientOpt

WithRetryAndBackoffs sets retry values. Setting the RetryConfig.RetryMax value enables automatically retrying requests that fail with 429 or 500-level response codes using the go-retryablehttp client

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 ComponentHealth added in v1.156.0

type ComponentHealth struct {
	Name               string                `json:"name,omitempty"`
	CPUUsagePercent    float64               `json:"cpu_usage_percent,omitempty"`
	MemoryUsagePercent float64               `json:"memory_usage_percent,omitempty"`
	ReplicasDesired    int64                 `json:"replicas_desired,omitempty"`
	ReplicasReady      int64                 `json:"replicas_ready,omitempty"`
	State              ComponentHealthStatus `json:"state,omitempty"`
}

ComponentHealth struct for ComponentHealth

func (*ComponentHealth) GetCPUUsagePercent added in v1.165.1

func (c *ComponentHealth) GetCPUUsagePercent() float64

GetCPUUsagePercent returns the CPUUsagePercent field.

func (*ComponentHealth) GetMemoryUsagePercent added in v1.165.1

func (c *ComponentHealth) GetMemoryUsagePercent() float64

GetMemoryUsagePercent returns the MemoryUsagePercent field.

func (*ComponentHealth) GetName added in v1.165.1

func (c *ComponentHealth) GetName() string

GetName returns the Name field.

func (*ComponentHealth) GetReplicasDesired added in v1.165.1

func (c *ComponentHealth) GetReplicasDesired() int64

GetReplicasDesired returns the ReplicasDesired field.

func (*ComponentHealth) GetReplicasReady added in v1.165.1

func (c *ComponentHealth) GetReplicasReady() int64

GetReplicasReady returns the ReplicasReady field.

func (*ComponentHealth) GetState added in v1.165.1

func (c *ComponentHealth) GetState() ComponentHealthStatus

GetState returns the State field.

type ComponentHealthStatus added in v1.156.0

type ComponentHealthStatus string

ComponentHealthStatus the model 'ComponentHealthStatus'

const (
	COMPONENTHEALTHSTATUS_Unknown   ComponentHealthStatus = "UNKNOWN"
	COMPONENTHEALTHSTATUS_Healthy   ComponentHealthStatus = "HEALTHY"
	COMPONENTHEALTHSTATUS_Unhealthy ComponentHealthStatus = "UNHEALTHY"
)

List of ComponentHealthStatus

type CreateBatchFileRequest added in v1.187.0

type CreateBatchFileRequest struct {
	FileName string `json:"file_name"`
}

CreateBatchFileRequest represents a request to create a presigned URL for uploading a batch JSONL input file.

type CreateBatchFileResponse added in v1.187.0

type CreateBatchFileResponse struct {
	FileID    string `json:"file_id"`
	UploadURL string `json:"upload_url"`
	ExpiresAt string `json:"expires_at"`
}

CreateBatchFileResponse is returned when creating a presigned file upload URL.

type CreateBatchRequest added in v1.187.0

type CreateBatchRequest struct {
	Provider         string `json:"provider"`
	FileID           string `json:"file_id"`
	CompletionWindow string `json:"completion_window"`
	RequestID        string `json:"request_id,omitempty"`
	Endpoint         string `json:"endpoint,omitempty"`
}

CreateBatchRequest represents a request to create a batch inference job. Provider is always required. Endpoint is required only when Provider is "openai".

type CreateCustomEvaluationMetricRequest added in v1.198.0

type CreateCustomEvaluationMetricRequest struct {
	MetricName  string                        `json:"metric_name,omitempty"`
	Description string                        `json:"description,omitempty"`
	Config      *CustomEvaluationMetricConfig `json:"config,omitempty"`
}

CreateCustomEvaluationMetricRequest is the request payload for creating a custom evaluation metric.

type CreateEmbeddingResponse added in v1.191.0

type CreateEmbeddingResponse struct {
	Object string          `json:"object"`
	Model  string          `json:"model"`
	Data   []Embedding     `json:"data"`
	Usage  EmbeddingsUsage `json:"usage"`
}

CreateEmbeddingResponse is returned by POST /v1/embeddings.

type CreateEvaluationDatasetRequest added in v1.217.0

type CreateEvaluationDatasetRequest struct {
	Name              string                    `json:"name,omitempty"`
	DatasetType       EvaluationDatasetType     `json:"dataset_type,omitempty"`
	DatasetParadigm   EvaluationDatasetParadigm `json:"dataset_paradigm,omitempty"`
	FileUploadDataset *FileUploadDataSource     `json:"file_upload_dataset,omitempty"`
}

CreateEvaluationDatasetRequest is the request body for creating an evaluation dataset from a previously uploaded file.

type CreateEvaluationDatasetResponse added in v1.217.0

type CreateEvaluationDatasetResponse struct {
	EvaluationDatasetUUID string `json:"evaluation_dataset_uuid,omitempty"`
}

CreateEvaluationDatasetResponse is the response returned by CreateEvaluationDataset.

type CreateModelEvalDatasetUploadPresignedURLsRequest added in v1.194.1

type CreateModelEvalDatasetUploadPresignedURLsRequest struct {
	Files []*PresignedUrlFile `json:"files,omitempty"`
}

CreateModelEvalDatasetUploadPresignedURLsRequest is the request body for creating presigned URLs for uploading model evaluation dataset files.

type CreateModelEvalDatasetUploadPresignedURLsResponse added in v1.194.1

type CreateModelEvalDatasetUploadPresignedURLsResponse struct {
	RequestID string                      `json:"request_id,omitempty"`
	Uploads   []*FilePresignedUrlResponse `json:"uploads,omitempty"`
}

CreateModelEvalDatasetUploadPresignedURLsResponse is the response returned by CreateModelEvalDatasetUploadPresignedURLs.

type CreateModelEvaluationRunRequest added in v1.194.1

type CreateModelEvaluationRunRequest struct {
	CandidateInferenceConfig *CandidateInferenceConfig `json:"candidate_inference_config,omitempty"`
	CandidateModelName       string                    `json:"candidate_model_name,omitempty"`
	CandidateModelSource     CandidateModelSource      `json:"candidate_model_source,omitempty"`
	CandidateModelUUID       string                    `json:"candidate_model_uuid,omitempty"`
	DatasetUUID              string                    `json:"dataset_uuid,omitempty"`
	// Epochs is the number of times to evaluate each dataset row (n-pass).
	// Defaults to 1 when unset. Capped at 3 by the API today.
	Epochs         uint32   `json:"epochs,omitempty"`
	EvalPresetUUID string   `json:"eval_preset_uuid,omitempty"`
	JudgeModelUUID string   `json:"judge_model_uuid,omitempty"`
	MetricUUIDs    []string `json:"metric_uuids,omitempty"`
	Name           string   `json:"name,omitempty"`
	PresetName     string   `json:"preset_name,omitempty"`
	// PresetSaveSections controls which sections of the resolved configuration
	// are persisted as a new reusable preset. Empty means do not save a preset.
	// Ignored when EvalPresetUUID is set.
	PresetSaveSections []PresetSaveSection `json:"preset_save_sections,omitempty"`
	Source             string              `json:"source,omitempty"`
	StarMetric         *StarMetric         `json:"star_metric,omitempty"`
}

CreateModelEvaluationRunRequest is the request body for creating a model evaluation run.

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 CreateScanRequest added in v1.175.0

type CreateScanRequest struct {
	Resources []string `json:"resources,omitempty"`
}

CreateScanRequest contains the request payload to create a scan.

type CreateScenarioSetFromLibraryRequest added in v1.206.0

type CreateScenarioSetFromLibraryRequest struct {
	LibraryScenarioUUID string `json:"library_scenario_uuid,omitempty"`
	Name                string `json:"name,omitempty"`
}

CreateScenarioSetFromLibraryRequest materializes a library entry into a team-owned scenario set.

type CreateScenarioSetRequest added in v1.206.0

type CreateScenarioSetRequest struct {
	Name                  string                `json:"name,omitempty"`
	Scenarios             []*Scenario           `json:"scenarios,omitempty"`
	FileUploadScenarioSet *FileUploadDataSource `json:"file_upload_scenario_set,omitempty"`
}

CreateScenarioSetRequest creates a scenario set from inline scenarios or an uploaded file.

type CreateScenarioSetUploadPresignedURLsRequest added in v1.206.0

type CreateScenarioSetUploadPresignedURLsRequest struct {
	Files []*PresignedUrlFile `json:"files,omitempty"`
}

CreateScenarioSetUploadPresignedURLsRequest requests presigned upload URLs for scenario set files.

type CreateScenarioSetUploadPresignedURLsResponse added in v1.206.0

type CreateScenarioSetUploadPresignedURLsResponse struct {
	RequestID string                      `json:"request_id,omitempty"`
	Uploads   []*FilePresignedUrlResponse `json:"uploads,omitempty"`
}

CreateScenarioSetUploadPresignedURLsResponse is returned by CreateScenarioSetUploadPresignedURLs.

type CreateSimulationRunRequest added in v1.206.0

type CreateSimulationRunRequest struct {
	ScenarioSetUUID        string                      `json:"scenario_set_uuid,omitempty"`
	Name                   string                      `json:"name,omitempty"`
	AgentConfig            *CandidateAgentConfig       `json:"agent_config,omitempty"`
	UserSimulatorModelUUID string                      `json:"user_simulator_model_uuid,omitempty"`
	JudgeModelUUID         string                      `json:"judge_model_uuid,omitempty"`
	UserSimulatorConfig    map[string]interface{}      `json:"user_simulator_config,omitempty"`
	ExplorationBudget      uint32                      `json:"exploration_budget,omitempty"`
	MaxTurns               uint32                      `json:"max_turns,omitempty"`
	EvaluationConfig       *SimulationEvaluationConfig `json:"evaluation_config,omitempty"`
}

CreateSimulationRunRequest creates a simulation run.

type CreateUptimeAlertRequest added in v1.94.0

type CreateUptimeAlertRequest struct {
	Name          string          `json:"name"`
	Type          string          `json:"type"`
	Threshold     int             `json:"threshold"`
	Comparison    UptimeAlertComp `json:"comparison"`
	Notifications *Notifications  `json:"notifications"`
	Period        string          `json:"period"`
}

CreateUptimeUptimeAlertRequest represents the request to create a new Uptime Alert.

type CreateUptimeCheckRequest added in v1.94.0

type CreateUptimeCheckRequest struct {
	Name    string   `json:"name"`
	Type    string   `json:"type"`
	Target  string   `json:"target"`
	Regions []string `json:"regions"`
	Enabled bool     `json:"enabled"`
}

CreateUptimeCheckRequest represents the request to create a new uptime check.

type CustomEvaluationMetricConfig added in v1.198.0

type CustomEvaluationMetricConfig struct {
	RequiresGroundTruth bool       `json:"requires_ground_truth,omitempty"`
	ScoringPrompt       string     `json:"scoring_prompt,omitempty"`
	CreatedAt           *Timestamp `json:"created_at,omitempty"`
	UpdatedAt           *Timestamp `json:"updated_at,omitempty"`
	DeletedAt           *Timestamp `json:"deleted_at,omitempty"`
}

CustomEvaluationMetricConfig represents the LLM-as-judge scoring configuration for custom evaluation metrics.

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 CustomModel added in v1.190.0

type CustomModel struct {
	Uuid                 string                         `json:"uuid,omitempty"`
	Name                 string                         `json:"name,omitempty"`
	Description          string                         `json:"description,omitempty"`
	Status               CustomModelStatus              `json:"status,omitempty"`
	Architecture         string                         `json:"architecture,omitempty"`
	SourceType           CustomModelSourceType          `json:"source_type,omitempty"`
	SourceRef            *CustomModelSourceRef          `json:"source_ref,omitempty"`
	TotalSizeBytes       string                         `json:"total_size_bytes,omitempty"`
	FileCount            int                            `json:"file_count,omitempty"`
	License              string                         `json:"license,omitempty"`
	Tags                 *CustomModelTags               `json:"tags,omitempty"`
	CreatedAt            *Timestamp                     `json:"created_at,omitempty"`
	UpdatedAt            *Timestamp                     `json:"updated_at,omitempty"`
	ActiveDeployments    []*CustomModelActiveDeployment `json:"active_deployments,omitempty"`
	ContextLength        int                            `json:"context_length,omitempty"`
	CostEstimatePerMonth int                            `json:"cost_estimate_per_month,omitempty"`
	InputModalities      []string                       `json:"input_modalities,omitempty"`
	OutputModalities     []string                       `json:"output_modalities,omitempty"`
	Parameters           string                         `json:"parameters,omitempty"`
	TeamId               string                         `json:"team_id,omitempty"`
	ConfigJson           map[string]any                 `json:"config_json,omitempty"`
	StorageRegion        string                         `json:"storage_region,omitempty"`
	ErrorMessage         string                         `json:"error_message,omitempty"`
}

CustomModel represents a user-imported model (from HuggingFace, Spaces, etc.).

type CustomModelActiveDeployment added in v1.190.0

type CustomModelActiveDeployment struct {
	Id         string                                `json:"id,omitempty"`
	Name       string                                `json:"name,omitempty"`
	RegionSlug string                                `json:"region_slug,omitempty"`
	State      string                                `json:"state,omitempty"`
	Endpoints  *CustomModelActiveDeploymentEndpoints `json:"endpoints,omitempty"`
	CreatedAt  string                                `json:"created_at,omitempty"`
	UpdatedAt  string                                `json:"updated_at,omitempty"`
}

CustomModelActiveDeployment represents an active dedicated inference deployment using a custom model.

type CustomModelActiveDeploymentEndpoints added in v1.190.0

type CustomModelActiveDeploymentEndpoints struct {
	PublicEndpointFqdn  string `json:"public_endpoint_fqdn,omitempty"`
	PrivateEndpointFqdn string `json:"private_endpoint_fqdn,omitempty"`
}

CustomModelActiveDeploymentEndpoints contains the endpoint URLs for a custom-model deployment.

type CustomModelDeleteResponse added in v1.190.0

type CustomModelDeleteResponse struct {
	Status DeleteCustomModelStatus `json:"status,omitempty"`
	Error  string                  `json:"error,omitempty"`
}

CustomModelDeleteResponse is the response returned by DeleteCustomModel.

type CustomModelImportJob added in v1.190.0

type CustomModelImportJob struct {
	Uuid         string     `json:"uuid,omitempty"`
	Status       string     `json:"status,omitempty"`
	FilesTotal   int        `json:"files_total,omitempty"`
	FilesDone    int        `json:"files_done,omitempty"`
	BytesTotal   string     `json:"bytes_total,omitempty"`
	BytesDone    string     `json:"bytes_done,omitempty"`
	ErrorMessage string     `json:"error_message,omitempty"`
	ErrorStep    string     `json:"error_step,omitempty"`
	StartedAt    *Timestamp `json:"started_at,omitempty"`
	CompletedAt  *Timestamp `json:"completed_at,omitempty"`
	CreatedAt    *Timestamp `json:"created_at,omitempty"`
}

CustomModelImportJob tracks the progress of a custom model import.

type CustomModelImportRequest added in v1.190.0

type CustomModelImportRequest struct {
	Name                     string                `json:"name"`
	SourceType               CustomModelSourceType `json:"source_type"`
	SourceRef                *CustomModelSourceRef `json:"source_ref,omitempty"`
	Description              string                `json:"description,omitempty"`
	PreferredGpuRegion       string                `json:"preferred_gpu_region,omitempty"`
	AcceptTermsAndConditions bool                  `json:"accept_terms_and_conditions,omitempty"`
	Tags                     *CustomModelTags      `json:"tags,omitempty"`
}

CustomModelImportRequest is the request body for importing a custom model.

type CustomModelImportResponse added in v1.190.0

type CustomModelImportResponse struct {
	Model           *CustomModel                       `json:"model,omitempty"`
	ImportJob       *CustomModelImportJob              `json:"import_job,omitempty"`
	ValidationSteps []*CustomModelImportValidationStep `json:"validation_steps,omitempty"`
	Error           string                             `json:"error,omitempty"`
}

CustomModelImportResponse is the response returned by ImportCustomModel.

type CustomModelImportValidationStep added in v1.190.0

type CustomModelImportValidationStep struct {
	Name   string `json:"name,omitempty"`
	Passed bool   `json:"passed,omitempty"`
	Error  string `json:"error,omitempty"`
}

CustomModelImportValidationStep describes a single validation step performed during a custom model import.

type CustomModelListOptions added in v1.190.0

type CustomModelListOptions struct {
	Status CustomModelStatus `url:"status,omitempty"`
	ListOptions
}

CustomModelListOptions specifies optional parameters for listing custom models.

type CustomModelListResponse added in v1.190.0

type CustomModelListResponse struct {
	Models       []*CustomModel `json:"models,omitempty"`
	Links        *Links         `json:"links,omitempty"`
	Meta         *Meta          `json:"meta,omitempty"`
	MaxThreshold int            `json:"max_threshold,omitempty"`
}

CustomModelListResponse is the response returned by ListCustomModels.

type CustomModelMetadataUpdateRequest added in v1.190.0

type CustomModelMetadataUpdateRequest struct {
	Name             string           `json:"name,omitempty"`
	Description      string           `json:"description,omitempty"`
	Tags             *CustomModelTags `json:"tags,omitempty"`
	InputModalities  []string         `json:"input_modalities,omitempty"`
	OutputModalities []string         `json:"output_modalities,omitempty"`
	Parameters       string           `json:"parameters,omitempty"`
	License          string           `json:"license,omitempty"`
}

CustomModelMetadataUpdateRequest is the request body for updating custom model metadata.

type CustomModelSourceRef added in v1.190.0

type CustomModelSourceRef struct {
	RepoId     string                         `json:"repo_id,omitempty"`
	CommitSha  string                         `json:"commit_sha,omitempty"`
	AccessType CustomModelSourceRefAccessType `json:"access_type,omitempty"`
	Bucket     string                         `json:"bucket,omitempty"`
	Region     string                         `json:"region,omitempty"`
	Prefix     string                         `json:"prefix,omitempty"`
	HfToken    string                         `json:"hf_token,omitempty"`
}

CustomModelSourceRef references the original source of a custom model.

type CustomModelSourceRefAccessType added in v1.190.0

type CustomModelSourceRefAccessType string

CustomModelSourceRefAccessType represents the access level required for a custom model source repository.

const (
	CustomModelSourceRefAccessTypeUnspecified CustomModelSourceRefAccessType = "ACCESS_TYPE_UNSPECIFIED"
	CustomModelSourceRefAccessTypePublic      CustomModelSourceRefAccessType = "ACCESS_TYPE_PUBLIC"
	CustomModelSourceRefAccessTypePrivate     CustomModelSourceRefAccessType = "ACCESS_TYPE_PRIVATE"
	CustomModelSourceRefAccessTypeGated       CustomModelSourceRefAccessType = "ACCESS_TYPE_GATED"
)

type CustomModelSourceType added in v1.190.0

type CustomModelSourceType string

CustomModelSourceType represents the source from which a custom model was imported.

const (
	CustomModelSourceTypeUnspecified  CustomModelSourceType = "SOURCE_TYPE_UNSPECIFIED"
	CustomModelSourceTypeHuggingFace  CustomModelSourceType = "SOURCE_TYPE_HUGGINGFACE"
	CustomModelSourceTypeSpacesBucket CustomModelSourceType = "SOURCE_TYPE_SPACES_BUCKET"
	CustomModelSourceTypeSDKUpload    CustomModelSourceType = "SOURCE_TYPE_SDK_UPLOAD"
	CustomModelSourceTypeFineTuning   CustomModelSourceType = "SOURCE_TYPE_FINE_TUNING"
)

type CustomModelStatus added in v1.190.0

type CustomModelStatus string

CustomModelStatus represents the status of a custom model.

const (
	CustomModelStatusUnspecified CustomModelStatus = "STATUS_UNSPECIFIED"
	CustomModelStatusImporting   CustomModelStatus = "STATUS_IMPORTING"
	CustomModelStatusReady       CustomModelStatus = "STATUS_READY"
	CustomModelStatusFailed      CustomModelStatus = "STATUS_FAILED"
	CustomModelStatusDeleted     CustomModelStatus = "STATUS_DELETED"
)

type CustomModelTags added in v1.190.0

type CustomModelTags struct {
	Tags []string `json:"tags,omitempty"`
}

CustomModelTags contains user-defined tags for organizing custom models.

type DOSettings added in v1.174.0

type DOSettings struct {
	ServiceCnames []string `json:"service_cnames,omitempty"`
}

DOSettings contains DigitalOcean-specific settings for a database cluster.

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"`
	UIConnection             *DatabaseConnection        `json:"ui_connection,omitempty"`
	PrivateConnection        *DatabaseConnection        `json:"private_connection,omitempty"`
	StandbyConnection        *DatabaseConnection        `json:"standby_connection,omitempty"`
	StandbyPrivateConnection *DatabaseConnection        `json:"standby_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"`
	StorageSizeMib           uint64                     `json:"storage_size_mib,omitempty"`
	StorageAutoscale         *DatabaseStorageAutoscale  `json:"storage_autoscale,omitempty"`
	MetricsEndpoints         []*ServiceAddress          `json:"metrics_endpoints,omitempty"`
	DOSettings               *DOSettings                `json:"do_settings,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 {
	Protocol         string            `json:"protocol"`
	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"`
	ApplicationPorts map[string]uint32 `json:"application_ports,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 DatabaseCreateFirewallRule added in v1.131.0

type DatabaseCreateFirewallRule struct {
	UUID  string `json:"uuid"`
	Type  string `json:"type"`
	Value string `json:"value"`
}

DatabaseCreateFirewallRule is a rule describing an inbound source to a database

type DatabaseCreateLogsinkRequest added in v1.121.0

type DatabaseCreateLogsinkRequest struct {
	Name   string                 `json:"sink_name"`
	Type   string                 `json:"sink_type"`
	Config *DatabaseLogsinkConfig `json:"config"`
}

DatabaseCreateLogsinkRequest is used to create logsink for a database cluster

func (DatabaseCreateLogsinkRequest) MarshalJSON added in v1.165.1

func (r DatabaseCreateLogsinkRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements custom JSON marshaling for DatabaseCreateLogsinkRequest to ensure the TLS field is always included for rsyslog sink types

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"`
	StorageSizeMib     uint64      `json:"storage_size_mib,omitempty"`
	DOSettings         *DOSettings `json:"do_settings,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"`
	StorageSizeMib     uint64                        `json:"storage_size_mib,omitempty"`
	StorageAutoscale   *DatabaseStorageAutoscale     `json:"storage_autoscale,omitempty"`
	Rules              []*DatabaseCreateFirewallRule `json:"rules"`
	DOSettings         *DOSettings                   `json:"do_settings,omitempty"`
}

DatabaseCreateRequest represents a request to create a database cluster

type DatabaseCreateTopicRequest added in v1.103.0

type DatabaseCreateTopicRequest struct {
	Name              string       `json:"name"`
	PartitionCount    *uint32      `json:"partition_count,omitempty"`
	ReplicationFactor *uint32      `json:"replication_factor,omitempty"`
	Config            *TopicConfig `json:"config,omitempty"`
}

DatabaseCreateTopicRequest is used to create a new topic within a kafka cluster

type DatabaseCreateUserRequest added in v1.10.0

type DatabaseCreateUserRequest struct {
	Name          string                     `json:"name"`
	MySQLSettings *DatabaseMySQLUserSettings `json:"mysql_settings,omitempty"`
	Settings      *DatabaseUserSettings      `json:"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 DatabaseEvent added in v1.112.0

type DatabaseEvent struct {
	ID          string `json:"id"`
	ServiceName string `json:"cluster_name"`
	EventType   string `json:"event_type"`
	CreateTime  string `json:"create_time"`
}

DatbaseEvent contains the information about a Datbase event.

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 DatabaseIndex added in v1.121.0

type DatabaseIndex struct {
	IndexName        string            `json:"index_name"`
	NumberofShards   uint64            `json:"number_of_shards"`
	NumberofReplicas uint64            `json:"number_of_replicas"`
	Size             int64             `json:"size,omitempty"`
	Health           string            `json:"health,omitempty"`
	Status           string            `json:"status,omitempty"`
	Docs             int64             `json:"docs,omitempty"`
	CreateTime       string            `json:"create_time"`
	Replication      *IndexReplication `json:"replication,omitempty"`
}

type DatabaseKafkaSchemaRegistryConfig added in v1.163.0

type DatabaseKafkaSchemaRegistryConfig struct {
	CompatibilityLevel string `json:"compatibility_level"`
}

type DatabaseKafkaSchemaRegistryRequest added in v1.163.0

type DatabaseKafkaSchemaRegistryRequest struct {
	SubjectName string `json:"subject_name"`
	SchemaType  string `json:"schema_type"`
	Schema      string `json:"schema"`
}

type DatabaseKafkaSchemaRegistrySubject added in v1.163.0

type DatabaseKafkaSchemaRegistrySubject struct {
	SubjectName string `json:"subject_name"`
	SchemaType  string `json:"schema_type"`
	Schema      string `json:"schema"`
	SchemaID    int    `json:"schema_id"`
}

type DatabaseKafkaSchemaRegistrySubjectConfigResponse added in v1.163.0

type DatabaseKafkaSchemaRegistrySubjectConfigResponse struct {
	SubjectName        string `json:"subject_name"`
	CompatibilityLevel string `json:"compatibility_level"`
}

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 DatabaseLogsink added in v1.121.0

type DatabaseLogsink struct {
	ID     string                 `json:"sink_id"`
	Name   string                 `json:"sink_name,omitempty"`
	Type   string                 `json:"sink_type,omitempty"`
	Config *DatabaseLogsinkConfig `json:"config,omitempty"`
}

DatabaseLogsink represents a logsink

type DatabaseLogsinkConfig added in v1.121.0

type DatabaseLogsinkConfig struct {
	URL          string  `json:"url,omitempty"`
	IndexPrefix  string  `json:"index_prefix,omitempty"`
	IndexDaysMax int     `json:"index_days_max,omitempty"`
	Timeout      float32 `json:"timeout,omitempty"`
	Server       string  `json:"server,omitempty"`
	Port         int     `json:"port,omitempty"`
	TLS          bool    `json:"tls,omitempty"`
	Format       string  `json:"format,omitempty"`
	Logline      string  `json:"logline,omitempty"`
	SD           string  `json:"sd,omitempty"`
	CA           string  `json:"ca,omitempty"`
	Key          string  `json:"key,omitempty"`
	Cert         string  `json:"cert,omitempty"`
}

DatabaseLogsinkConfig represents one of the configurable options (rsyslog_logsink, elasticsearch_logsink, or opensearch_logsink) for a logsink.

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 DatabaseMetricsCredentials added in v1.110.0

type DatabaseMetricsCredentials struct {
	BasicAuthUsername string `json:"basic_auth_username"`
	BasicAuthPassword string `json:"basic_auth_password"`
}

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 DatabaseOnlineMigrationConfig added in v1.136.0

type DatabaseOnlineMigrationConfig struct {
	Host         string `json:"host,omitempty"`
	Port         int    `json:"port,omitempty"`
	DatabaseName string `json:"dbname,omitempty"`
	Username     string `json:"username,omitempty"`
	Password     string `json:"password,omitempty"`
}

DatabaseOnlineMigrationConfig represents the configuration options for database online migrations.

type DatabaseOnlineMigrationStatus added in v1.136.0

type DatabaseOnlineMigrationStatus struct {
	ID        string `json:"id"`
	Status    string `json:"status"`
	CreatedAt string `json:"created_at"`
}

DatabaseOnlineMigrationStatus represents an online migration status

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"`
	ValkeyOptions              DatabaseEngineOptions `json:"valkey"`
	KafkaOptions               DatabaseEngineOptions `json:"kafka"`
	OpensearchOptions          DatabaseEngineOptions `json:"opensearch"`
	AdvancedMySQLOptions       DatabaseEngineOptions `json:"advanced_mysql"`
	AdvancedPostgresSQLOptions DatabaseEngineOptions `json:"advanced_pg"`
}

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"`
	StandbyConnection        *DatabaseConnection `json:"standby_connection,omitempty"`
	StandbyPrivateConnection *DatabaseConnection `json:"standby_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"`
	StorageSizeMib     uint64              `json:"storage_size_mib,omitempty"`
	Size               string              `json:"size"`
	DOSettings         *DOSettings         `json:"do_settings,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"`
	Settings      *DatabaseUserSettings      `json:"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"`
	StorageSizeMib uint64 `json:"storage_size_mib,omitempty"`
}

DatabaseResizeRequest can be used to initiate a database resize operation.

type DatabaseStartOnlineMigrationRequest added in v1.136.0

type DatabaseStartOnlineMigrationRequest struct {
	Source     *DatabaseOnlineMigrationConfig `json:"source"`
	DisableSSL bool                           `json:"disable_ssl,omitempty"`
	IgnoreDBs  []string                       `json:"ignore_dbs,omitempty"`
}

DatabaseStartOnlineMigrationRequest is used to start an online migration for a database cluster

type DatabaseStorageAutoscale added in v1.193.0

type DatabaseStorageAutoscale struct {
	Enabled          bool    `json:"enabled"`
	ThresholdPercent *int    `json:"threshold_percent,omitempty"`
	IncrementGib     *uint64 `json:"increment_gib,omitempty"`
}

DatabaseStorageAutoscale represents the storage autoscaling configuration for a database cluster

type DatabaseTopic added in v1.103.0

type DatabaseTopic struct {
	Name              string            `json:"name"`
	Partitions        []*TopicPartition `json:"partitions,omitempty"`
	ReplicationFactor *uint32           `json:"replication_factor,omitempty"`
	State             string            `json:"state,omitempty"`
	Config            *TopicConfig      `json:"config,omitempty"`
}

DatabaseTopic represents a Kafka topic

type DatabaseUpdateDOSettingsRequest added in v1.198.0

type DatabaseUpdateDOSettingsRequest struct {
	DOSettings *DOSettings `json:"do_settings"`
}

DatabaseUpdateDOSettingsRequest is used to update DigitalOcean-specific settings.

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 DatabaseUpdateLogsinkRequest added in v1.121.0

type DatabaseUpdateLogsinkRequest struct {
	Config *DatabaseLogsinkConfig `json:"config"`
}

DatabaseUpdateLogsinkRequest is used to update logsink for a database cluster

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 DatabaseUpdateMetricsCredentialsRequest added in v1.110.0

type DatabaseUpdateMetricsCredentialsRequest struct {
	Credentials *DatabaseMetricsCredentials `json:"credentials"`
}

type DatabaseUpdatePoolRequest added in v1.94.0

type DatabaseUpdatePoolRequest struct {
	User     string `json:"user,omitempty"`
	Size     int    `json:"size"`
	Database string `json:"db"`
	Mode     string `json:"mode"`
}

DatabaseUpdatePoolRequest is used to update a database connection pool

type DatabaseUpdateTopicRequest added in v1.103.0

type DatabaseUpdateTopicRequest struct {
	PartitionCount    *uint32      `json:"partition_count,omitempty"`
	ReplicationFactor *uint32      `json:"replication_factor,omitempty"`
	Config            *TopicConfig `json:"config,omitempty"`
}

DatabaseUpdateTopicRequest ...

type DatabaseUpdateUserRequest added in v1.107.0

type DatabaseUpdateUserRequest struct {
	Settings *DatabaseUserSettings `json:"settings,omitempty"`
}

DatabaseUpdateUserRequest is used to update an existing database user

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"`
	AccessCert    string                     `json:"access_cert,omitempty"`
	AccessKey     string                     `json:"access_key,omitempty"`
	MySQLSettings *DatabaseMySQLUserSettings `json:"mysql_settings,omitempty"`
	Settings      *DatabaseUserSettings      `json:"settings,omitempty"`
}

DatabaseUser represents a user in the database

type DatabaseUserSettings added in v1.103.0

type DatabaseUserSettings struct {
	ACL               []*KafkaACL        `json:"acl,omitempty"`
	OpenSearchACL     []*OpenSearchACL   `json:"opensearch_acl,omitempty"`
	MongoUserSettings *MongoUserSettings `json:"mongo_user_settings,omitempty"`
}

DatabaseUserSettings contains user settings

type DatabasesService added in v1.10.0

type DatabasesService interface {
	List(context.Context, *ListOptions) ([]Database, *Response, error)
	Get(context.Context, string) (*Database, *Response, error)
	GetCA(context.Context, string) (*DatabaseCA, *Response, error)
	Create(context.Context, *DatabaseCreateRequest) (*Database, *Response, error)
	Delete(context.Context, string) (*Response, error)
	Resize(context.Context, string, *DatabaseResizeRequest) (*Response, error)
	Migrate(context.Context, string, *DatabaseMigrateRequest) (*Response, error)
	UpdateMaintenance(context.Context, string, *DatabaseUpdateMaintenanceRequest) (*Response, error)
	GetStorageAutoscale(context.Context, string) (*DatabaseStorageAutoscale, *Response, error)
	UpdateStorageAutoscale(context.Context, string, *DatabaseStorageAutoscale) (*Response, error)
	InstallUpdate(context.Context, string) (*Response, error)
	ListBackups(context.Context, string, *ListOptions) ([]DatabaseBackup, *Response, error)
	GetUser(context.Context, string, string) (*DatabaseUser, *Response, error)
	ListUsers(context.Context, string, *ListOptions) ([]DatabaseUser, *Response, error)
	CreateUser(context.Context, string, *DatabaseCreateUserRequest) (*DatabaseUser, *Response, error)
	UpdateUser(context.Context, string, string, *DatabaseUpdateUserRequest) (*DatabaseUser, *Response, error)
	DeleteUser(context.Context, string, string) (*Response, error)
	ResetUserAuth(context.Context, string, string, *DatabaseResetUserAuthRequest) (*DatabaseUser, *Response, error)
	ListDBs(context.Context, string, *ListOptions) ([]DatabaseDB, *Response, error)
	CreateDB(context.Context, string, *DatabaseCreateDBRequest) (*DatabaseDB, *Response, error)
	GetDB(context.Context, string, string) (*DatabaseDB, *Response, error)
	DeleteDB(context.Context, string, string) (*Response, error)
	ListPools(context.Context, string, *ListOptions) ([]DatabasePool, *Response, error)
	CreatePool(context.Context, string, *DatabaseCreatePoolRequest) (*DatabasePool, *Response, error)
	GetPool(context.Context, string, string) (*DatabasePool, *Response, error)
	DeletePool(context.Context, string, string) (*Response, error)
	UpdatePool(context.Context, string, string, *DatabaseUpdatePoolRequest) (*Response, error)
	GetReplica(context.Context, string, string) (*DatabaseReplica, *Response, error)
	ListReplicas(context.Context, string, *ListOptions) ([]DatabaseReplica, *Response, error)
	CreateReplica(context.Context, string, *DatabaseCreateReplicaRequest) (*DatabaseReplica, *Response, error)
	DeleteReplica(context.Context, string, string) (*Response, error)
	PromoteReplicaToPrimary(context.Context, string, string) (*Response, error)
	GetEvictionPolicy(context.Context, string) (string, *Response, error)
	SetEvictionPolicy(context.Context, string, string) (*Response, error)
	GetSQLMode(context.Context, string) (string, *Response, error)
	SetSQLMode(context.Context, string, ...string) (*Response, error)
	GetFirewallRules(context.Context, string) ([]DatabaseFirewallRule, *Response, error)
	UpdateFirewallRules(context.Context, string, *DatabaseUpdateFirewallRulesRequest) (*Response, error)
	GetDOSettings(context.Context, string) (*DOSettings, *Response, error)
	UpdateDOSettings(context.Context, string, *DatabaseUpdateDOSettingsRequest) (*Response, error)
	GetPostgreSQLConfig(context.Context, string) (*PostgreSQLConfig, *Response, error)
	GetRedisConfig(context.Context, string) (*RedisConfig, *Response, error)
	GetValkeyConfig(context.Context, string) (*ValkeyConfig, *Response, error)
	GetMySQLConfig(context.Context, string) (*MySQLConfig, *Response, error)
	GetMongoDBConfig(context.Context, string) (*MongoDBConfig, *Response, error)
	GetOpensearchConfig(context.Context, string) (*OpensearchConfig, *Response, error)
	GetKafkaConfig(context.Context, string) (*KafkaConfig, *Response, error)
	GetAdvancedPostgresSQLConfig(context.Context, string) (*AdvancedPostgresConfig, *Response, error)
	GetAdvancedMySQLConfig(context.Context, string) (*AdvancedMySQLConfig, *Response, error)
	UpdatePostgreSQLConfig(context.Context, string, *PostgreSQLConfig) (*Response, error)
	UpdateRedisConfig(context.Context, string, *RedisConfig) (*Response, error)
	UpdateValkeyConfig(context.Context, string, *ValkeyConfig) (*Response, error)
	UpdateMySQLConfig(context.Context, string, *MySQLConfig) (*Response, error)
	UpdateMongoDBConfig(context.Context, string, *MongoDBConfig) (*Response, error)
	UpdateOpensearchConfig(context.Context, string, *OpensearchConfig) (*Response, error)
	UpdateKafkaConfig(context.Context, string, *KafkaConfig) (*Response, error)
	UpdateAdvancedPostgresSQLConfig(context.Context, string, *AdvancedPostgresConfigUpdate) (*Response, error)
	UpdateAdvancedMySQLConfig(context.Context, string, *AdvancedMySQLConfigUpdate) (*Response, error)
	ListOptions(todo context.Context) (*DatabaseOptions, *Response, error)
	UpgradeMajorVersion(context.Context, string, *UpgradeVersionRequest) (*Response, error)
	ListTopics(context.Context, string, *ListOptions) ([]DatabaseTopic, *Response, error)
	CreateTopic(context.Context, string, *DatabaseCreateTopicRequest) (*DatabaseTopic, *Response, error)
	GetTopic(context.Context, string, string) (*DatabaseTopic, *Response, error)
	DeleteTopic(context.Context, string, string) (*Response, error)
	UpdateTopic(context.Context, string, string, *DatabaseUpdateTopicRequest) (*Response, error)
	GetMetricsCredentials(context.Context) (*DatabaseMetricsCredentials, *Response, error)
	UpdateMetricsCredentials(context.Context, *DatabaseUpdateMetricsCredentialsRequest) (*Response, error)
	ListDatabaseEvents(context.Context, string, *ListOptions) ([]DatabaseEvent, *Response, error)
	ListIndexes(context.Context, string, *ListOptions) ([]DatabaseIndex, *Response, error)
	DeleteIndex(context.Context, string, string) (*Response, error)
	CreateLogsink(ctx context.Context, databaseID string, createLogsink *DatabaseCreateLogsinkRequest) (*DatabaseLogsink, *Response, error)
	GetLogsink(ctx context.Context, databaseID string, logsinkID string) (*DatabaseLogsink, *Response, error)
	ListLogsinks(ctx context.Context, databaseID string, opts *ListOptions) ([]DatabaseLogsink, *Response, error)
	UpdateLogsink(ctx context.Context, databaseID string, logsinkID string, updateLogsink *DatabaseUpdateLogsinkRequest) (*Response, error)
	DeleteLogsink(ctx context.Context, databaseID, logsinkID string) (*Response, error)
	StartOnlineMigration(ctx context.Context, databaseID string, onlineMigrationRequest *DatabaseStartOnlineMigrationRequest) (*DatabaseOnlineMigrationStatus, *Response, error)
	StopOnlineMigration(ctx context.Context, databaseID, migrationID string) (*Response, error)
	GetOnlineMigrationStatus(ctx context.Context, databaseID string) (*DatabaseOnlineMigrationStatus, *Response, error)
	ListKafkaSchemaRegistry(ctx context.Context, databaseID string, opts *ListOptions) ([]DatabaseKafkaSchemaRegistrySubject, *Response, error)
	CreateKafkaSchemaRegistry(ctx context.Context, databaseID string, createKafkaSchemaRegistry *DatabaseKafkaSchemaRegistryRequest) (*DatabaseKafkaSchemaRegistrySubject, *Response, error)
	GetKafkaSchemaRegistry(ctx context.Context, databaseID, subject string) (*DatabaseKafkaSchemaRegistrySubject, *Response, error)
	DeleteKafkaSchemaRegistry(ctx context.Context, databaseID, subject string) (*Response, error)
	GetKafkaSchemaRegistryConfig(ctx context.Context, databaseID string) (*DatabaseKafkaSchemaRegistryConfig, *Response, error)
	UpdateKafkaSchemaRegistryConfig(ctx context.Context, databaseID string, updateKafkaSchemaRegistryConfig *DatabaseKafkaSchemaRegistryConfig) (*DatabaseKafkaSchemaRegistryConfig, *Response, error)
	GetKafkaSchemaRegistrySubjectConfig(ctx context.Context, databaseID, subject string) (*DatabaseKafkaSchemaRegistrySubjectConfigResponse, *Response, error)
	UpdateKafkaSchemaRegistrySubjectConfig(ctx context.Context, databaseID, subject string, updateKafkaSchemaRegistrySubjectConfig *DatabaseKafkaSchemaRegistryConfig) (*DatabaseKafkaSchemaRegistrySubjectConfigResponse, *Response, error)
}

The DatabasesService provides access to the DigitalOcean managed database suite of products through the public API. Customers can create new database clusters, migrate them between regions, create replicas and interact with their configurations. Each database service is referred to as a Database. A SQL database service can have multiple databases residing in the system. To help make these entities distinct from Databases in godo, we refer to them here as DatabaseDBs.

See: https://docs.digitalocean.com/reference/api/api-reference/#tag/Databases

type DatabasesServiceOp added in v1.10.0

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

DatabasesServiceOp handles communication with the Databases related methods of the DigitalOcean API.

func (*DatabasesServiceOp) Create added in v1.10.0

Create creates a database cluster

func (*DatabasesServiceOp) CreateDB added in v1.10.0

func (svc *DatabasesServiceOp) CreateDB(ctx context.Context, databaseID string, createDB *DatabaseCreateDBRequest) (*DatabaseDB, *Response, error)

CreateDB will create a new database

func (*DatabasesServiceOp) CreateKafkaSchemaRegistry added in v1.163.0

func (svc *DatabasesServiceOp) CreateKafkaSchemaRegistry(ctx context.Context, databaseID string, createKafkaSchemaRegistry *DatabaseKafkaSchemaRegistryRequest) (*DatabaseKafkaSchemaRegistrySubject, *Response, error)

CreateKafkaSchemaRegistry creates a kafka schema registry subject

func (*DatabasesServiceOp) CreateLogsink added in v1.121.0

func (svc *DatabasesServiceOp) CreateLogsink(ctx context.Context, databaseID string, createLogsink *DatabaseCreateLogsinkRequest) (*DatabaseLogsink, *Response, error)

CreateLogsink creates a new logsink for a database

func (*DatabasesServiceOp) CreatePool added in v1.10.0

func (svc *DatabasesServiceOp) CreatePool(ctx context.Context, databaseID string, createPool *DatabaseCreatePoolRequest) (*DatabasePool, *Response, error)

CreatePool will create a new database connection pool

func (*DatabasesServiceOp) CreateReplica added in v1.10.0

func (svc *DatabasesServiceOp) CreateReplica(ctx context.Context, databaseID string, createReplica *DatabaseCreateReplicaRequest) (*DatabaseReplica, *Response, error)

CreateReplica will create a new database connection pool

func (*DatabasesServiceOp) CreateTopic added in v1.103.0

func (svc *DatabasesServiceOp) CreateTopic(ctx context.Context, databaseID string, createTopic *DatabaseCreateTopicRequest) (*DatabaseTopic, *Response, error)

CreateTopic will create a new kafka topic

func (*DatabasesServiceOp) CreateUser added in v1.10.0

func (svc *DatabasesServiceOp) CreateUser(ctx context.Context, databaseID string, createUser *DatabaseCreateUserRequest) (*DatabaseUser, *Response, error)

CreateUser will create a new database user

func (*DatabasesServiceOp) Delete added in v1.10.0

func (svc *DatabasesServiceOp) Delete(ctx context.Context, databaseID string) (*Response, error)

Delete deletes a database cluster. There is no way to recover a cluster once it has been destroyed.

func (*DatabasesServiceOp) DeleteDB added in v1.10.0

func (svc *DatabasesServiceOp) DeleteDB(ctx context.Context, databaseID, name string) (*Response, error)

DeleteDB will delete an existing database

func (*DatabasesServiceOp) DeleteIndex added in v1.121.0

func (svc *DatabasesServiceOp) DeleteIndex(ctx context.Context, databaseID, name string) (*Response, error)

DeleteIndex will delete an existing opensearch index

func (*DatabasesServiceOp) DeleteKafkaSchemaRegistry added in v1.163.0

func (svc *DatabasesServiceOp) DeleteKafkaSchemaRegistry(ctx context.Context, databaseID, subjectName string) (*Response, error)

DeleteKafkaSchemaRegistry deletes a kafka schema registry subject

func (*DatabasesServiceOp) DeleteLogsink added in v1.121.0

func (svc *DatabasesServiceOp) DeleteLogsink(ctx context.Context, databaseID, logsinkID string) (*Response, error)

DeleteLogsink deletes a logsink for a database cluster

func (*DatabasesServiceOp) DeletePool added in v1.10.0

func (svc *DatabasesServiceOp) DeletePool(ctx context.Context, databaseID, name string) (*Response, error)

DeletePool will delete an existing database connection pool

func (*DatabasesServiceOp) DeleteReplica added in v1.10.0

func (svc *DatabasesServiceOp) DeleteReplica(ctx context.Context, databaseID, name string) (*Response, error)

DeleteReplica will delete an existing database replica

func (*DatabasesServiceOp) DeleteTopic added in v1.103.0

func (svc *DatabasesServiceOp) DeleteTopic(ctx context.Context, databaseID, name string) (*Response, error)

DeleteTopic will delete an existing kafka topic

func (*DatabasesServiceOp) DeleteUser added in v1.10.0

func (svc *DatabasesServiceOp) DeleteUser(ctx context.Context, databaseID, userID string) (*Response, error)

DeleteUser will delete an existing database user

func (*DatabasesServiceOp) Get added in v1.10.0

func (svc *DatabasesServiceOp) Get(ctx context.Context, databaseID string) (*Database, *Response, error)

Get retrieves the details of a database cluster

func (*DatabasesServiceOp) GetAdvancedMySQLConfig added in v1.200.0

func (svc *DatabasesServiceOp) GetAdvancedMySQLConfig(ctx context.Context, databaseID string) (*AdvancedMySQLConfig, *Response, error)

GetAdvancedMySQLConfig retrieves the config for an advanced_mysql database cluster.

func (*DatabasesServiceOp) GetAdvancedPostgresSQLConfig added in v1.195.0

func (svc *DatabasesServiceOp) GetAdvancedPostgresSQLConfig(ctx context.Context, databaseID string) (*AdvancedPostgresConfig, *Response, error)

GetAdvancedPostgresSQLConfig retrieves the config for an advanced_pg database cluster.

func (*DatabasesServiceOp) GetCA added in v1.61.0

func (svc *DatabasesServiceOp) GetCA(ctx context.Context, databaseID string) (*DatabaseCA, *Response, error)

GetCA retrieves the CA of a database cluster.

func (*DatabasesServiceOp) GetDB added in v1.10.0

func (svc *DatabasesServiceOp) GetDB(ctx context.Context, databaseID, name string) (*DatabaseDB, *Response, error)

GetDB returns a single database by name

func (*DatabasesServiceOp) GetDOSettings added in v1.198.0

func (svc *DatabasesServiceOp) GetDOSettings(ctx context.Context, databaseID string) (*DOSettings, *Response, error)

GetDOSettings retrieves the DigitalOcean-specific settings for a given cluster.

func (*DatabasesServiceOp) GetEvictionPolicy added in v1.17.0

func (svc *DatabasesServiceOp) GetEvictionPolicy(ctx context.Context, databaseID string) (string, *Response, error)

GetEvictionPolicy loads the eviction policy for a given Redis cluster.

func (*DatabasesServiceOp) GetFirewallRules added in v1.23.0

func (svc *DatabasesServiceOp) GetFirewallRules(ctx context.Context, databaseID string) ([]DatabaseFirewallRule, *Response, error)

GetFirewallRules loads the inbound sources for a given cluster.

func (*DatabasesServiceOp) GetKafkaConfig added in v1.126.0

func (svc *DatabasesServiceOp) GetKafkaConfig(ctx context.Context, databaseID string) (*KafkaConfig, *Response, error)

GetKafkaConfig retrieves the config for a Kafka database cluster.

func (*DatabasesServiceOp) GetKafkaSchemaRegistry added in v1.163.0

func (svc *DatabasesServiceOp) GetKafkaSchemaRegistry(ctx context.Context, databaseID, subjectName string) (*DatabaseKafkaSchemaRegistrySubject, *Response, error)

GetKafkaSchemaRegistry retrieves a kafka schema registry subject

func (*DatabasesServiceOp) GetKafkaSchemaRegistryConfig added in v1.163.0

func (svc *DatabasesServiceOp) GetKafkaSchemaRegistryConfig(ctx context.Context, databaseID string) (*DatabaseKafkaSchemaRegistryConfig, *Response, error)

GetKafkaSchemaRegistryConfig retrieves the configuration for a kafka schema registry

func (*DatabasesServiceOp) GetKafkaSchemaRegistrySubjectConfig added in v1.163.0

func (svc *DatabasesServiceOp) GetKafkaSchemaRegistrySubjectConfig(ctx context.Context, databaseID, subject string) (*DatabaseKafkaSchemaRegistrySubjectConfigResponse, *Response, error)

GetKafkaSchemaRegistrySubjectConfig retrieves the configuration for a kafka schema registry subject

func (*DatabasesServiceOp) GetLogsink added in v1.121.0

func (svc *DatabasesServiceOp) GetLogsink(ctx context.Context, databaseID string, logsinkID string) (*DatabaseLogsink, *Response, error)

GetLogsink gets a logsink for a database

func (*DatabasesServiceOp) GetMetricsCredentials added in v1.110.0

func (svc *DatabasesServiceOp) GetMetricsCredentials(ctx context.Context) (*DatabaseMetricsCredentials, *Response, error)

GetMetricsCredentials gets the credentials required to access a user's metrics endpoints

func (*DatabasesServiceOp) GetMongoDBConfig added in v1.125.0

func (svc *DatabasesServiceOp) GetMongoDBConfig(ctx context.Context, databaseID string) (*MongoDBConfig, *Response, error)

GetMongoDBConfig retrieves the config for a MongoDB database cluster.

func (*DatabasesServiceOp) GetMySQLConfig added in v1.82.0

func (svc *DatabasesServiceOp) GetMySQLConfig(ctx context.Context, databaseID string) (*MySQLConfig, *Response, error)

GetMySQLConfig retrieves the config for a MySQL database cluster.

func (*DatabasesServiceOp) GetOnlineMigrationStatus added in v1.136.0

func (svc *DatabasesServiceOp) GetOnlineMigrationStatus(ctx context.Context, databaseID string) (*DatabaseOnlineMigrationStatus, *Response, error)

GetOnlineMigrationStatus retrieves the status of the most recent online migration

func (*DatabasesServiceOp) GetOpensearchConfig added in v1.127.0

func (svc *DatabasesServiceOp) GetOpensearchConfig(ctx context.Context, databaseID string) (*OpensearchConfig, *Response, error)

GetOpensearchConfig retrieves the config for a Opensearch database cluster.

func (*DatabasesServiceOp) GetPool added in v1.10.0

func (svc *DatabasesServiceOp) GetPool(ctx context.Context, databaseID, name string) (*DatabasePool, *Response, error)

GetPool returns a single database connection pool by name

func (*DatabasesServiceOp) GetPostgreSQLConfig added in v1.82.0

func (svc *DatabasesServiceOp) GetPostgreSQLConfig(ctx context.Context, databaseID string) (*PostgreSQLConfig, *Response, error)

GetPostgreSQLConfig retrieves the config for a PostgreSQL database cluster.

func (*DatabasesServiceOp) GetRedisConfig added in v1.82.0

func (svc *DatabasesServiceOp) GetRedisConfig(ctx context.Context, databaseID string) (*RedisConfig, *Response, error)

GetRedisConfig retrieves the config for a Redis database cluster.

func (*DatabasesServiceOp) GetReplica added in v1.10.0

func (svc *DatabasesServiceOp) GetReplica(ctx context.Context, databaseID, name string) (*DatabaseReplica, *Response, error)

GetReplica returns a single database replica

func (*DatabasesServiceOp) GetSQLMode added in v1.26.0

func (svc *DatabasesServiceOp) GetSQLMode(ctx context.Context, databaseID string) (string, *Response, error)

GetSQLMode loads the SQL Mode settings for a given MySQL cluster.

func (*DatabasesServiceOp) GetStorageAutoscale added in v1.193.0

func (svc *DatabasesServiceOp) GetStorageAutoscale(ctx context.Context, databaseID string) (*DatabaseStorageAutoscale, *Response, error)

GetStorageAutoscale retrieves the storage autoscaling configuration for a database cluster.

func (*DatabasesServiceOp) GetTopic added in v1.103.0

func (svc *DatabasesServiceOp) GetTopic(ctx context.Context, databaseID, name string) (*DatabaseTopic, *Response, error)

GetTopic returns a single kafka topic by name

func (*DatabasesServiceOp) GetUser added in v1.10.0

func (svc *DatabasesServiceOp) GetUser(ctx context.Context, databaseID, userID string) (*DatabaseUser, *Response, error)

GetUser returns the database user identified by userID

func (*DatabasesServiceOp) GetValkeyConfig added in v1.162.0

func (svc *DatabasesServiceOp) GetValkeyConfig(ctx context.Context, databaseID string) (*ValkeyConfig, *Response, error)

GetValkeyConfig updates the config for a Valkey database cluster.

func (*DatabasesServiceOp) InstallUpdate added in v1.124.0

func (svc *DatabasesServiceOp) InstallUpdate(ctx context.Context, databaseID string) (*Response, error)

InstallUpdate starts installation of updates

func (*DatabasesServiceOp) List added in v1.10.0

func (svc *DatabasesServiceOp) List(ctx context.Context, opts *ListOptions) ([]Database, *Response, error)

List returns a list of the Databases visible with the caller's API token

func (*DatabasesServiceOp) ListBackups added in v1.10.0

func (svc *DatabasesServiceOp) ListBackups(ctx context.Context, databaseID string, opts *ListOptions) ([]DatabaseBackup, *Response, error)

ListBackups returns a list of the current backups of a database

func (*DatabasesServiceOp) ListDBs added in v1.10.0

func (svc *DatabasesServiceOp) ListDBs(ctx context.Context, databaseID string, opts *ListOptions) ([]DatabaseDB, *Response, error)

ListDBs returns all databases for a given database cluster

func (*DatabasesServiceOp) ListDatabaseEvents added in v1.112.0

func (svc *DatabasesServiceOp) ListDatabaseEvents(ctx context.Context, databaseID string, opts *ListOptions) ([]DatabaseEvent, *Response, error)

ListDatabaseEvents returns all the events for a given cluster

func (*DatabasesServiceOp) ListIndexes added in v1.121.0

func (svc *DatabasesServiceOp) ListIndexes(ctx context.Context, databaseID string, opts *ListOptions) ([]DatabaseIndex, *Response, error)

ListIndexes returns all indexes for a given opensearch cluster

func (*DatabasesServiceOp) ListKafkaSchemaRegistry added in v1.163.0

func (svc *DatabasesServiceOp) ListKafkaSchemaRegistry(ctx context.Context, databaseID string, opts *ListOptions) ([]DatabaseKafkaSchemaRegistrySubject, *Response, error)

ListKafkaSchemaRegistry lists the kafka schema registry subjects

func (*DatabasesServiceOp) ListLogsinks added in v1.121.0

func (svc *DatabasesServiceOp) ListLogsinks(ctx context.Context, databaseID string, opts *ListOptions) ([]DatabaseLogsink, *Response, error)

ListTopics returns all topics for a given kafka cluster

func (*DatabasesServiceOp) ListOptions added in v1.83.0

func (svc *DatabasesServiceOp) ListOptions(ctx context.Context) (*DatabaseOptions, *Response, error)

ListOptions gets the database options available.

func (*DatabasesServiceOp) ListPools added in v1.10.0

func (svc *DatabasesServiceOp) ListPools(ctx context.Context, databaseID string, opts *ListOptions) ([]DatabasePool, *Response, error)

ListPools returns all connection pools for a given database cluster

func (*DatabasesServiceOp) ListReplicas added in v1.10.0

func (svc *DatabasesServiceOp) ListReplicas(ctx context.Context, databaseID string, opts *ListOptions) ([]DatabaseReplica, *Response, error)

ListReplicas returns all read-only replicas for a given database cluster

func (*DatabasesServiceOp) ListTopics added in v1.103.0

func (svc *DatabasesServiceOp) ListTopics(ctx context.Context, databaseID string, opts *ListOptions) ([]DatabaseTopic, *Response, error)

ListTopics returns all topics for a given kafka cluster

func (*DatabasesServiceOp) ListUsers added in v1.10.0

func (svc *DatabasesServiceOp) ListUsers(ctx context.Context, databaseID string, opts *ListOptions) ([]DatabaseUser, *Response, error)

ListUsers returns all database users for the database

func (*DatabasesServiceOp) Migrate added in v1.10.0

func (svc *DatabasesServiceOp) Migrate(ctx context.Context, databaseID string, migrate *DatabaseMigrateRequest) (*Response, error)

Migrate migrates a database cluster to a new region

func (*DatabasesServiceOp) PromoteReplicaToPrimary added in v1.96.0

func (svc *DatabasesServiceOp) PromoteReplicaToPrimary(ctx context.Context, databaseID, name string) (*Response, error)

PromoteReplicaToPrimary will sever the read replica integration and then promote the replica cluster to be a R/W cluster

func (*DatabasesServiceOp) ResetUserAuth added in v1.32.0

func (svc *DatabasesServiceOp) ResetUserAuth(ctx context.Context, databaseID, userID string, resetAuth *DatabaseResetUserAuthRequest) (*DatabaseUser, *Response, error)

ResetUserAuth will reset user authentication

func (*DatabasesServiceOp) Resize added in v1.10.0

func (svc *DatabasesServiceOp) Resize(ctx context.Context, databaseID string, resize *DatabaseResizeRequest) (*Response, error)

Resize resizes a database cluster by number of nodes or size

func (*DatabasesServiceOp) SetEvictionPolicy added in v1.17.0

func (svc *DatabasesServiceOp) SetEvictionPolicy(ctx context.Context, databaseID, policy string) (*Response, error)

SetEvictionPolicy updates the eviction policy for a given Redis cluster.

The valid eviction policies are documented by the exported string constants with the prefix `EvictionPolicy`.

func (*DatabasesServiceOp) SetSQLMode added in v1.26.0

func (svc *DatabasesServiceOp) SetSQLMode(ctx context.Context, databaseID string, sqlModes ...string) (*Response, error)

SetSQLMode updates the SQL Mode settings for a given MySQL cluster.

func (*DatabasesServiceOp) StartOnlineMigration added in v1.136.0

func (svc *DatabasesServiceOp) StartOnlineMigration(ctx context.Context, databaseID string, onlineMigration *DatabaseStartOnlineMigrationRequest) (*DatabaseOnlineMigrationStatus, *Response, error)

StartOnlineMigration starts an online migration for a database. Migrating a cluster establishes a connection with an existing cluster and replicates its contents to the target cluster. Online migration is only available for MySQL, PostgreSQL, Redis and Valkey clusters.

func (*DatabasesServiceOp) StopOnlineMigration added in v1.136.0

func (svc *DatabasesServiceOp) StopOnlineMigration(ctx context.Context, databaseID, migrationID string) (*Response, error)

StopOnlineMigration stops an online migration

func (*DatabasesServiceOp) UpdateAdvancedMySQLConfig added in v1.200.0

func (svc *DatabasesServiceOp) UpdateAdvancedMySQLConfig(ctx context.Context, databaseID string, config *AdvancedMySQLConfigUpdate) (*Response, error)

UpdateAdvancedMySQLConfig updates the config for an advanced_mysql database cluster.

func (*DatabasesServiceOp) UpdateAdvancedPostgresSQLConfig added in v1.195.0

func (svc *DatabasesServiceOp) UpdateAdvancedPostgresSQLConfig(ctx context.Context, databaseID string, config *AdvancedPostgresConfigUpdate) (*Response, error)

UpdateAdvancedPostgresSQLConfig updates the config for an advanced_pg database cluster.

func (*DatabasesServiceOp) UpdateDOSettings added in v1.198.0

func (svc *DatabasesServiceOp) UpdateDOSettings(ctx context.Context, databaseID string, updateReq *DatabaseUpdateDOSettingsRequest) (*Response, error)

UpdateDOSettings updates the DigitalOcean-specific settings for a given cluster.

func (*DatabasesServiceOp) UpdateFirewallRules added in v1.23.0

func (svc *DatabasesServiceOp) UpdateFirewallRules(ctx context.Context, databaseID string, firewallRulesReq *DatabaseUpdateFirewallRulesRequest) (*Response, error)

UpdateFirewallRules sets the inbound sources for a given cluster.

func (*DatabasesServiceOp) UpdateKafkaConfig added in v1.126.0

func (svc *DatabasesServiceOp) UpdateKafkaConfig(ctx context.Context, databaseID string, config *KafkaConfig) (*Response, error)

UpdateKafkaConfig updates the config for a Kafka database cluster.

func (*DatabasesServiceOp) UpdateKafkaSchemaRegistryConfig added in v1.163.0

func (svc *DatabasesServiceOp) UpdateKafkaSchemaRegistryConfig(ctx context.Context, databaseID string, updateKafkaSchemaRegistryConfig *DatabaseKafkaSchemaRegistryConfig) (*DatabaseKafkaSchemaRegistryConfig, *Response, error)

UpdateKafkaSchemaRegistryConfig updates the configuration for a kafka schema registry

func (*DatabasesServiceOp) UpdateKafkaSchemaRegistrySubjectConfig added in v1.163.0

func (svc *DatabasesServiceOp) UpdateKafkaSchemaRegistrySubjectConfig(ctx context.Context, databaseID, subject string, updateKafkaSchemaRegistrySubjectConfig *DatabaseKafkaSchemaRegistryConfig) (*DatabaseKafkaSchemaRegistrySubjectConfigResponse, *Response, error)

UpdateKafkaSchemaRegistrySubjectConfig updates the configuration for a kafka schema registry subject

func (*DatabasesServiceOp) UpdateLogsink added in v1.121.0

func (svc *DatabasesServiceOp) UpdateLogsink(ctx context.Context, databaseID string, logsinkID string, updateLogsink *DatabaseUpdateLogsinkRequest) (*Response, error)

UpdateLogsink updates a logsink for a database cluster

func (*DatabasesServiceOp) UpdateMaintenance added in v1.10.0

func (svc *DatabasesServiceOp) UpdateMaintenance(ctx context.Context, databaseID string, maintenance *DatabaseUpdateMaintenanceRequest) (*Response, error)

UpdateMaintenance updates the maintenance window on a cluster

func (*DatabasesServiceOp) UpdateMetricsCredentials added in v1.110.0

func (svc *DatabasesServiceOp) UpdateMetricsCredentials(ctx context.Context, updateCreds *DatabaseUpdateMetricsCredentialsRequest) (*Response, error)

UpdateMetricsAuth updates the credentials required to access a user's metrics endpoints

func (*DatabasesServiceOp) UpdateMongoDBConfig added in v1.125.0

func (svc *DatabasesServiceOp) UpdateMongoDBConfig(ctx context.Context, databaseID string, config *MongoDBConfig) (*Response, error)

UpdateMongoDBConfig updates the config for a MongoDB database cluster.

func (*DatabasesServiceOp) UpdateMySQLConfig added in v1.82.0

func (svc *DatabasesServiceOp) UpdateMySQLConfig(ctx context.Context, databaseID string, config *MySQLConfig) (*Response, error)

UpdateMySQLConfig updates the config for a MySQL database cluster.

func (*DatabasesServiceOp) UpdateOpensearchConfig added in v1.127.0

func (svc *DatabasesServiceOp) UpdateOpensearchConfig(ctx context.Context, databaseID string, config *OpensearchConfig) (*Response, error)

UpdateOpensearchConfig updates the config for a Opensearch database cluster.

func (*DatabasesServiceOp) UpdatePool added in v1.94.0

func (svc *DatabasesServiceOp) UpdatePool(ctx context.Context, databaseID, name string, updatePool *DatabaseUpdatePoolRequest) (*Response, error)

UpdatePool will update an existing database connection pool

func (*DatabasesServiceOp) UpdatePostgreSQLConfig added in v1.82.0

func (svc *DatabasesServiceOp) UpdatePostgreSQLConfig(ctx context.Context, databaseID string, config *PostgreSQLConfig) (*Response, error)

UpdatePostgreSQLConfig updates the config for a PostgreSQL database cluster.

func (*DatabasesServiceOp) UpdateRedisConfig added in v1.82.0

func (svc *DatabasesServiceOp) UpdateRedisConfig(ctx context.Context, databaseID string, config *RedisConfig) (*Response, error)

UpdateRedisConfig updates the config for a Redis database cluster.

func (*DatabasesServiceOp) UpdateStorageAutoscale added in v1.193.0

func (svc *DatabasesServiceOp) UpdateStorageAutoscale(ctx context.Context, databaseID string, autoscale *DatabaseStorageAutoscale) (*Response, error)

UpdateStorageAutoscale updates the storage autoscaling configuration on a cluster

func (*DatabasesServiceOp) UpdateTopic added in v1.103.0

func (svc *DatabasesServiceOp) UpdateTopic(ctx context.Context, databaseID string, name string, updateTopic *DatabaseUpdateTopicRequest) (*Response, error)

UpdateTopic updates a single kafka topic

func (*DatabasesServiceOp) UpdateUser added in v1.107.0

func (svc *DatabasesServiceOp) UpdateUser(ctx context.Context, databaseID, userID string, updateUser *DatabaseUpdateUserRequest) (*DatabaseUser, *Response, error)

UpdateUser will update an existing database user

func (*DatabasesServiceOp) UpdateValkeyConfig added in v1.162.0

func (svc *DatabasesServiceOp) UpdateValkeyConfig(ctx context.Context, databaseID string, config *ValkeyConfig) (*Response, error)

UpdateValkeyConfig updates the config for a Valkey database cluster.

func (*DatabasesServiceOp) UpgradeMajorVersion added in v1.95.0

func (svc *DatabasesServiceOp) UpgradeMajorVersion(ctx context.Context, databaseID string, upgradeReq *UpgradeVersionRequest) (*Response, error)

UpgradeMajorVersion upgrades the major version of a cluster.

type DatacenterRegions added in v1.162.0

type DatacenterRegions struct {
	Region             string `json:"region"`
	InferenceUrl       string `json:"inference_url"`
	ServesBatch        bool   `json:"serves_batch"`
	ServesInference    bool   `json:"serves_inference"`
	StreamInferenceUrl string `json:"stream_inference_url"`
}

type DbaasMysqlCpuUsageRequest added in v1.176.0

type DbaasMysqlCpuUsageRequest struct {
	DbaasMysqlMetricsRequest
	Aggregate string // avg, max, min
}

DbaasMysqlCpuUsageRequest holds the information needed to retrieve MySQL cluster CPU usage (percent). Aggregate: avg, max, min.

type DbaasMysqlDiskUsageRequest added in v1.176.0

type DbaasMysqlDiskUsageRequest struct {
	DbaasMysqlMetricsRequest
	Aggregate string // avg, max, min
}

DbaasMysqlDiskUsageRequest holds the information needed to retrieve MySQL cluster disk usage (percent). Aggregate: avg, max, min.

type DbaasMysqlLoadRequest added in v1.176.0

type DbaasMysqlLoadRequest struct {
	DbaasMysqlMetricsRequest
	Metric    string // load1, load5, load15
	Aggregate string // avg, max
}

DbaasMysqlLoadRequest holds the information needed to retrieve MySQL cluster load average. Metric: load1, load5, load15. Aggregate: avg, max.

type DbaasMysqlMemoryUsageRequest added in v1.176.0

type DbaasMysqlMemoryUsageRequest struct {
	DbaasMysqlMetricsRequest
	Aggregate string // avg, max, min
}

DbaasMysqlMemoryUsageRequest holds the information needed to retrieve MySQL cluster memory usage (percent). Aggregate: avg, max, min.

type DbaasMysqlMetricsRequest added in v1.176.0

type DbaasMysqlMetricsRequest struct {
	DBID  string
	Start time.Time
	End   time.Time
}

DbaasMysqlMetricsRequest holds the information needed to retrieve DBaaS MySQL host-level metrics (db_id only).

type DbaasMysqlOpRatesRequest added in v1.176.0

type DbaasMysqlOpRatesRequest struct {
	DbaasMysqlServiceMetricsRequest
	Metric string // select, insert, update, delete
}

DbaasMysqlOpRatesRequest holds the information needed to retrieve MySQL service operations rate. Metric: select, insert, update, delete.

type DbaasMysqlSchemaLatencyRequest added in v1.176.0

type DbaasMysqlSchemaLatencyRequest struct {
	DbaasMysqlSchemaMetricsRequest
	Metric string // insert, fetch, update, delete
}

DbaasMysqlSchemaLatencyRequest holds the information needed to retrieve MySQL schema table I/O latency (seconds). Metric: insert, fetch, update, delete.

type DbaasMysqlSchemaMetricsRequest added in v1.176.0

type DbaasMysqlSchemaMetricsRequest struct {
	DBID    string
	Service string
	Schema  string
	Start   time.Time
	End     time.Time
}

DbaasMysqlSchemaMetricsRequest holds the information needed to retrieve DBaaS MySQL schema-level metrics (db_id + service + schema).

type DbaasMysqlSchemaThroughputRequest added in v1.176.0

type DbaasMysqlSchemaThroughputRequest struct {
	DbaasMysqlSchemaMetricsRequest
	Metric string // insert, fetch, update, delete
}

DbaasMysqlSchemaThroughputRequest holds the information needed to retrieve MySQL schema table I/O throughput (rows/s). Metric: insert, fetch, update, delete.

type DbaasMysqlServiceMetricsRequest added in v1.176.0

type DbaasMysqlServiceMetricsRequest struct {
	DBID    string
	Service string
	Start   time.Time
	End     time.Time
}

DbaasMysqlServiceMetricsRequest holds the information needed to retrieve DBaaS MySQL service-level metrics (db_id + service).

type DedicatedInference added in v1.178.0

type DedicatedInference struct {
	ID                    string                        `json:"id"`
	Name                  string                        `json:"name"`
	Region                string                        `json:"region"`
	Status                string                        `json:"status"`
	VPCUUID               string                        `json:"vpc_uuid"`
	Endpoints             *DedicatedInferenceEndpoints  `json:"endpoints,omitempty"`
	DeploymentSpec        *DedicatedInferenceDeployment `json:"spec,omitempty"`
	PendingDeploymentSpec *DedicatedInferenceDeployment `json:"pending_deployment_spec,omitempty"`
	CreatedAt             time.Time                     `json:"created_at,omitempty"`
	UpdatedAt             time.Time                     `json:"updated_at,omitempty"`
}

DedicatedInference represents a Dedicated Inference resource returned by the API.

func (DedicatedInference) String added in v1.178.0

func (d DedicatedInference) String() string

type DedicatedInferenceAccelerator added in v1.178.0

type DedicatedInferenceAccelerator struct {
	AcceleratorID   string `json:"accelerator_id"`
	AcceleratorSlug string `json:"accelerator_slug"`
	State           string `json:"state"`
	Type            string `json:"type"`
	Scale           uint64 `json:"scale"`
}

DedicatedInferenceAccelerator represents an accelerator in an API response.

type DedicatedInferenceAcceleratorInfo added in v1.178.0

type DedicatedInferenceAcceleratorInfo struct {
	ID        string    `json:"id"`
	Name      string    `json:"name"`
	Slug      string    `json:"slug"`
	Status    string    `json:"status"`
	CreatedAt time.Time `json:"created_at"`
}

DedicatedInferenceAcceleratorInfo represents an accelerator in a list accelerators response.

type DedicatedInferenceAcceleratorRequest added in v1.178.0

type DedicatedInferenceAcceleratorRequest struct {
	AcceleratorSlug string `json:"accelerator_slug"`
	Scale           uint64 `json:"scale"`
	Type            string `json:"type"`
}

DedicatedInferenceAcceleratorRequest represents an accelerator in a request.

type DedicatedInferenceCreateRequest added in v1.178.0

type DedicatedInferenceCreateRequest struct {
	Spec    *DedicatedInferenceSpecRequest `json:"spec"`
	Secrets *DedicatedInferenceSecrets     `json:"secrets,omitempty"`
}

DedicatedInferenceCreateRequest represents a request to create a Dedicated Inference.

type DedicatedInferenceDeployment added in v1.178.0

type DedicatedInferenceDeployment struct {
	Version              uint64                               `json:"version"`
	ID                   string                               `json:"id"`
	DedicatedInferenceID string                               `json:"dedicated_inference_id"`
	State                string                               `json:"state"`
	EnablePublicEndpoint bool                                 `json:"enable_public_endpoint"`
	VPCConfig            *DedicatedInferenceVPCConfig         `json:"vpc_config,omitempty"`
	ModelDeployments     []*DedicatedInferenceModelDeployment `json:"model_deployments"`
	CreatedAt            time.Time                            `json:"created_at,omitempty"`
	UpdatedAt            time.Time                            `json:"updated_at,omitempty"`
}

DedicatedInferenceDeployment represents a deployment spec in the API response.

type DedicatedInferenceEndpoints added in v1.178.0

type DedicatedInferenceEndpoints struct {
	PublicEndpointFQDN  string `json:"public_endpoint_fqdn,omitempty"`
	PrivateEndpointFQDN string `json:"private_endpoint_fqdn,omitempty"`
}

DedicatedInferenceEndpoints represents the endpoints for a Dedicated Inference.

type DedicatedInferenceGPUModelConfig added in v1.178.0

type DedicatedInferenceGPUModelConfig struct {
	GPUSlugs     []string `json:"gpu_slugs"`
	ModelSlug    string   `json:"model_slug"`
	ModelName    string   `json:"model_name"`
	IsModelGated bool     `json:"is_model_gated"`
}

DedicatedInferenceGPUModelConfig represents a GPU model configuration.

type DedicatedInferenceGPUModelConfigResponse added in v1.178.0

type DedicatedInferenceGPUModelConfigResponse struct {
	GPUModelConfigs []*DedicatedInferenceGPUModelConfig `json:"gpu_model_configs"`
}

DedicatedInferenceGPUModelConfigResponse represents the response from GetGPUModelConfig.

type DedicatedInferenceListAcceleratorsOptions added in v1.178.0

type DedicatedInferenceListAcceleratorsOptions struct {
	Slug string `url:"slug,omitempty"`
	ListOptions
}

DedicatedInferenceListAcceleratorsOptions specifies optional parameters for listing accelerators.

type DedicatedInferenceListItem added in v1.178.0

type DedicatedInferenceListItem struct {
	ID              string                       `json:"id"`
	Name            string                       `json:"name"`
	Region          string                       `json:"region"`
	Status          string                       `json:"status"`
	VPCUUID         string                       `json:"vpc_uuid"`
	ProviderModelID []string                     `json:"provider_model_id,omitempty"`
	Endpoints       *DedicatedInferenceEndpoints `json:"endpoints,omitempty"`
	CreatedAt       time.Time                    `json:"created_at,omitempty"`
	UpdatedAt       time.Time                    `json:"updated_at,omitempty"`
}

DedicatedInferenceListItem represents a Dedicated Inference item in a list response.

type DedicatedInferenceListOptions added in v1.178.0

type DedicatedInferenceListOptions struct {
	Region string `url:"region,omitempty"`
	Name   string `url:"name,omitempty"`
	ListOptions
}

DedicatedInferenceListOptions specifies optional parameters for listing Dedicated Inferences.

type DedicatedInferenceModelDeployment added in v1.178.0

type DedicatedInferenceModelDeployment struct {
	ModelID         string                           `json:"model_id"`
	ModelSlug       string                           `json:"model_slug"`
	ModelProvider   string                           `json:"model_provider"`
	ProviderModelID string                           `json:"provider_model_id,omitempty"`
	Accelerators    []*DedicatedInferenceAccelerator `json:"accelerators"`
}

DedicatedInferenceModelDeployment represents a model deployment in an API response.

type DedicatedInferenceModelRequest added in v1.178.0

type DedicatedInferenceModelRequest struct {
	ModelID         string                                  `json:"model_id,omitempty"`
	ModelSlug       string                                  `json:"model_slug"`
	ModelProvider   string                                  `json:"model_provider"`
	ProviderModelID string                                  `json:"provider_model_id"`
	WorkloadConfig  *DedicatedInferenceWorkloadConfig       `json:"workload_config,omitempty"`
	Accelerators    []*DedicatedInferenceAcceleratorRequest `json:"accelerators"`
}

DedicatedInferenceModelRequest represents a model deployment in a request.

type DedicatedInferenceSecrets added in v1.178.0

type DedicatedInferenceSecrets struct {
	HuggingFaceToken string `json:"hugging_face_token,omitempty"`
}

DedicatedInferenceSecrets represents secrets for external model providers.

type DedicatedInferenceServiceOp added in v1.178.0

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

DedicatedInferenceServiceOp handles communication with Dedicated Inference methods of the DigitalOcean API.

func (*DedicatedInferenceServiceOp) Create added in v1.178.0

Create a new Dedicated Inference with the given configuration.

func (*DedicatedInferenceServiceOp) CreateToken added in v1.178.0

CreateToken creates a new auth token for a Dedicated Inference.

func (*DedicatedInferenceServiceOp) Delete added in v1.178.0

Delete an existing Dedicated Inference by its UUID.

func (*DedicatedInferenceServiceOp) Get added in v1.178.0

Get an existing Dedicated Inference by its UUID.

func (*DedicatedInferenceServiceOp) GetGPUModelConfig added in v1.178.0

GetGPUModelConfig returns supported GPU model configurations.

func (*DedicatedInferenceServiceOp) GetSizes added in v1.178.0

GetSizes returns available Dedicated Inference sizes and pricing.

func (*DedicatedInferenceServiceOp) List added in v1.178.0

List all Dedicated Inferences.

func (*DedicatedInferenceServiceOp) ListAccelerators added in v1.178.0

ListAccelerators lists accelerators for a Dedicated Inference.

func (*DedicatedInferenceServiceOp) ListTokens added in v1.178.0

ListTokens lists all auth tokens for a Dedicated Inference.

func (*DedicatedInferenceServiceOp) RevokeToken added in v1.178.0

func (s *DedicatedInferenceServiceOp) RevokeToken(ctx context.Context, diID string, tokenID string) (*Response, error)

RevokeToken revokes (deletes) an auth token for a Dedicated Inference.

func (*DedicatedInferenceServiceOp) Update added in v1.178.0

Update an existing Dedicated Inference.

type DedicatedInferenceSize added in v1.178.0

type DedicatedInferenceSize struct {
	GPUSlug      string                          `json:"gpu_slug"`
	PricePerHour string                          `json:"price_per_hour"`
	Regions      []string                        `json:"regions"`
	Currency     string                          `json:"currency"`
	CPU          uint32                          `json:"cpu"`
	Memory       uint32                          `json:"memory"`
	GPU          *DedicatedInferenceSizeGPU      `json:"gpu"`
	SizeCategory *DedicatedInferenceSizeCategory `json:"size_category"`
	Disks        []*DedicatedInferenceSizeDisk   `json:"disks"`
}

DedicatedInferenceSize represents a GPU size with pricing information.

type DedicatedInferenceSizeCategory added in v1.178.0

type DedicatedInferenceSizeCategory struct {
	Name      string `json:"name"`
	FleetName string `json:"fleet_name"`
}

DedicatedInferenceSizeCategory represents the category of a size.

type DedicatedInferenceSizeDisk added in v1.178.0

type DedicatedInferenceSizeDisk struct {
	Type   string `json:"type"`
	SizeGb uint64 `json:"size_gb"`
}

DedicatedInferenceSizeDisk represents a disk in a size.

type DedicatedInferenceSizeGPU added in v1.178.0

type DedicatedInferenceSizeGPU struct {
	Count  uint32 `json:"count"`
	VramGb uint32 `json:"vram_gb"`
	Slug   string `json:"slug"`
}

DedicatedInferenceSizeGPU represents GPU details in a size.

type DedicatedInferenceSizesResponse added in v1.178.0

type DedicatedInferenceSizesResponse struct {
	EnabledRegions []string                  `json:"enabled_regions"`
	Sizes          []*DedicatedInferenceSize `json:"sizes"`
}

DedicatedInferenceSizesResponse represents the response from GetSizes.

type DedicatedInferenceSpecRequest added in v1.178.0

type DedicatedInferenceSpecRequest struct {
	Version              int                               `json:"version"`
	Name                 string                            `json:"name"`
	Region               string                            `json:"region"`
	EnablePublicEndpoint bool                              `json:"enable_public_endpoint"`
	VPC                  *DedicatedInferenceVPCRequest     `json:"vpc"`
	ModelDeployments     []*DedicatedInferenceModelRequest `json:"model_deployments"`
}

DedicatedInferenceSpecRequest represents the deployment specification in a create/update request.

type DedicatedInferenceToken added in v1.178.0

type DedicatedInferenceToken struct {
	ID        string    `json:"id"`
	Name      string    `json:"name"`
	Value     string    `json:"value,omitempty"`
	IsManaged bool      `json:"is_managed"`
	CreatedAt time.Time `json:"created_at"`
}

DedicatedInferenceToken represents an auth token returned on create and list.

func (DedicatedInferenceToken) String added in v1.178.0

func (t DedicatedInferenceToken) String() string

type DedicatedInferenceTokenCreateRequest added in v1.178.0

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

DedicatedInferenceTokenCreateRequest represents a request to create an auth token.

type DedicatedInferenceUpdateRequest added in v1.178.0

type DedicatedInferenceUpdateRequest struct {
	Spec    *DedicatedInferenceSpecRequest `json:"spec"`
	Secrets *DedicatedInferenceSecrets     `json:"secrets,omitempty"`
}

DedicatedInferenceUpdateRequest represents a request to update a Dedicated Inference.

type DedicatedInferenceVPCConfig added in v1.178.0

type DedicatedInferenceVPCConfig struct {
	VPCUUID string `json:"vpc_uuid"`
}

DedicatedInferenceVPCConfig represents the VPC config in an API response.

type DedicatedInferenceVPCRequest added in v1.178.0

type DedicatedInferenceVPCRequest struct {
	UUID string `json:"uuid"`
}

DedicatedInferenceVPCRequest represents the VPC configuration in a request.

type DedicatedInferenceWorkloadConfig added in v1.178.0

type DedicatedInferenceWorkloadConfig struct{}

DedicatedInferenceWorkloadConfig represents workload-specific configuration.

type DeleteCustomModelStatus added in v1.190.0

type DeleteCustomModelStatus string

DeleteCustomModelStatus represents the status of a delete custom model operation.

const (
	DeleteCustomModelStatusUnspecified DeleteCustomModelStatus = "DELETE_CUSTOM_MODEL_STATUS_UNSPECIFIED"
	DeleteCustomModelStatusSuccess     DeleteCustomModelStatus = "DELETE_CUSTOM_MODEL_STATUS_SUCCESS"
	DeleteCustomModelStatusFail        DeleteCustomModelStatus = "DELETE_CUSTOM_MODEL_STATUS_FAIL"
)

type DeleteDataSourceRoot added in v1.152.0

type DeleteDataSourceRoot struct {
	DataSourceUuid    string `json:"data_source_uuid"`
	KnowledgeBaseUuid string `json:"knowledge_base_uuid"`
}

type DeleteKnowledgeBaseRoot added in v1.152.0

type DeleteKnowledgeBaseRoot struct {
	KnowledgeBaseUuid string `json:"uuid"`
}

type DeleteModelEvaluationRunStatus added in v1.193.0

type DeleteModelEvaluationRunStatus string

DeleteModelEvaluationRunStatus represents the status of a delete model evaluation run operation.

const (
	DeleteModelEvaluationRunStatusUnspecified DeleteModelEvaluationRunStatus = "DELETE_MODEL_EVALUATION_RUN_STATUS_UNSPECIFIED"
	DeleteModelEvaluationRunStatusSuccess     DeleteModelEvaluationRunStatus = "DELETE_MODEL_EVALUATION_RUN_STATUS_SUCCESS"
	DeleteModelEvaluationRunStatusFail        DeleteModelEvaluationRunStatus = "DELETE_MODEL_EVALUATION_RUN_STATUS_FAIL"
)

type DeletedKnowledgeBaseResponse added in v1.152.0

type DeletedKnowledgeBaseResponse struct {
	DataSourceUuid    string `json:"data_source_uuid"`
	KnowledgeBaseUuid string `json:"knowledge_base_uuid"`
}

type DeployTemplate added in v1.82.0

type DeployTemplate struct {
	Spec *AppSpec `json:"spec,omitempty"`
}

DeployTemplate struct for DeployTemplate

func (*DeployTemplate) GetSpec added in v1.85.0

func (d *DeployTemplate) GetSpec() *AppSpec

GetSpec returns the Spec field.

type Deployment added in v1.39.0

type Deployment struct {
	ID                   string                  `json:"id,omitempty"`
	Spec                 *AppSpec                `json:"spec,omitempty"`
	Services             []*DeploymentService    `json:"services,omitempty"`
	StaticSites          []*DeploymentStaticSite `json:"static_sites,omitempty"`
	Workers              []*DeploymentWorker     `json:"workers,omitempty"`
	Jobs                 []*DeploymentJob        `json:"jobs,omitempty"`
	Functions            []*DeploymentFunctions  `json:"functions,omitempty"`
	PhaseLastUpdatedAt   time.Time               `json:"phase_last_updated_at,omitempty"`
	CreatedAt            time.Time               `json:"created_at,omitempty"`
	UpdatedAt            time.Time               `json:"updated_at,omitempty"`
	Cause                string                  `json:"cause,omitempty"`
	ClonedFrom           string                  `json:"cloned_from,omitempty"`
	Progress             *DeploymentProgress     `json:"progress,omitempty"`
	Phase                DeploymentPhase         `json:"phase,omitempty"`
	TierSlug             string                  `json:"tier_slug,omitempty"`
	PreviousDeploymentID string                  `json:"previous_deployment_id,omitempty"`
	CauseDetails         *DeploymentCauseDetails `json:"cause_details,omitempty"`
	LoadBalancerID       string                  `json:"load_balancer_id,omitempty"`
	Timing               *DeploymentTiming       `json:"timing,omitempty"`
}

Deployment struct for Deployment

func (*Deployment) GetCause added in v1.85.0

func (d *Deployment) GetCause() string

GetCause returns the Cause field.

func (*Deployment) GetCauseDetails added in v1.85.0

func (d *Deployment) GetCauseDetails() *DeploymentCauseDetails

GetCauseDetails returns the CauseDetails field.

func (*Deployment) GetClonedFrom added in v1.85.0

func (d *Deployment) GetClonedFrom() string

GetClonedFrom returns the ClonedFrom field.

func (*Deployment) GetCreatedAt added in v1.85.0

func (d *Deployment) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field.

func (*Deployment) GetFunctions added in v1.85.0

func (d *Deployment) GetFunctions() []*DeploymentFunctions

GetFunctions returns the Functions field.

func (*Deployment) GetID added in v1.85.0

func (d *Deployment) GetID() string

GetID returns the ID field.

func (*Deployment) GetJobs added in v1.85.0

func (d *Deployment) GetJobs() []*DeploymentJob

GetJobs returns the Jobs field.

func (*Deployment) GetLoadBalancerID added in v1.85.0

func (d *Deployment) GetLoadBalancerID() string

GetLoadBalancerID returns the LoadBalancerID field.

func (*Deployment) GetPhase added in v1.85.0

func (d *Deployment) GetPhase() DeploymentPhase

GetPhase returns the Phase field.

func (*Deployment) GetPhaseLastUpdatedAt added in v1.85.0

func (d *Deployment) GetPhaseLastUpdatedAt() time.Time

GetPhaseLastUpdatedAt returns the PhaseLastUpdatedAt field.

func (*Deployment) GetPreviousDeploymentID added in v1.85.0

func (d *Deployment) GetPreviousDeploymentID() string

GetPreviousDeploymentID returns the PreviousDeploymentID field.

func (*Deployment) GetProgress added in v1.85.0

func (d *Deployment) GetProgress() *DeploymentProgress

GetProgress returns the Progress field.

func (*Deployment) GetServices added in v1.85.0

func (d *Deployment) GetServices() []*DeploymentService

GetServices returns the Services field.

func (*Deployment) GetSpec added in v1.85.0

func (d *Deployment) GetSpec() *AppSpec

GetSpec returns the Spec field.

func (*Deployment) GetStaticSites added in v1.85.0

func (d *Deployment) GetStaticSites() []*DeploymentStaticSite

GetStaticSites returns the StaticSites field.

func (*Deployment) GetTierSlug added in v1.85.0

func (d *Deployment) GetTierSlug() string

GetTierSlug returns the TierSlug field.

func (*Deployment) GetTiming added in v1.97.0

func (d *Deployment) GetTiming() *DeploymentTiming

GetTiming returns the Timing field.

func (*Deployment) GetUpdatedAt added in v1.85.0

func (d *Deployment) GetUpdatedAt() time.Time

GetUpdatedAt returns the UpdatedAt field.

func (*Deployment) GetWorkers added in v1.85.0

func (d *Deployment) GetWorkers() []*DeploymentWorker

GetWorkers returns the Workers field.

type DeploymentCauseDetails added in v1.65.0

type DeploymentCauseDetails struct {
	DigitalOceanUserAction *DeploymentCauseDetailsDigitalOceanUserAction `json:"digitalocean_user_action,omitempty"`
	GitPush                *DeploymentCauseDetailsGitPush                `json:"git_push,omitempty"`
	DOCRPush               *DeploymentCauseDetailsDOCRPush               `json:"docr_push,omitempty"`
	Internal               bool                                          `json:"internal,omitempty"`
	Autoscaler             *DeploymentCauseDetailsAutoscalerAction       `json:"autoscaler,omitempty"`
	Type                   DeploymentCauseDetailsType                    `json:"type,omitempty"`
}

DeploymentCauseDetails struct for DeploymentCauseDetails

func (*DeploymentCauseDetails) GetAutoscaler added in v1.105.0

GetAutoscaler returns the Autoscaler field.

func (*DeploymentCauseDetails) GetDOCRPush added in v1.86.0

GetDOCRPush returns the DOCRPush field.

func (*DeploymentCauseDetails) GetDigitalOceanUserAction added in v1.85.0

GetDigitalOceanUserAction returns the DigitalOceanUserAction field.

func (*DeploymentCauseDetails) GetGitPush added in v1.85.0

GetGitPush returns the GitPush field.

func (*DeploymentCauseDetails) GetInternal added in v1.85.0

func (d *DeploymentCauseDetails) GetInternal() bool

GetInternal returns the Internal field.

func (*DeploymentCauseDetails) GetType added in v1.85.0

GetType returns the Type field.

type DeploymentCauseDetailsAutoscalerAction added in v1.105.0

type DeploymentCauseDetailsAutoscalerAction struct {
	Autoscaled       bool                                   `json:"autoscaled,omitempty"`
	ScaledComponents map[string]AutoscalerActionScaleChange `json:"scaled_components,omitempty"`
}

DeploymentCauseDetailsAutoscalerAction struct for DeploymentCauseDetailsAutoscalerAction

func (*DeploymentCauseDetailsAutoscalerAction) GetAutoscaled added in v1.105.0

func (d *DeploymentCauseDetailsAutoscalerAction) GetAutoscaled() bool

GetAutoscaled returns the Autoscaled field.

func (*DeploymentCauseDetailsAutoscalerAction) GetScaledComponents added in v1.161.0

GetScaledComponents returns the ScaledComponents map if it's non-nil, an empty map otherwise.

type DeploymentCauseDetailsDOCRPush added in v1.86.0

type DeploymentCauseDetailsDOCRPush struct {
	// The registry name.
	Registry string `json:"registry,omitempty"`
	// The repository name.
	Repository string `json:"repository,omitempty"`
	// The repository tag.
	Tag string `json:"tag,omitempty"`
	// OCI Image digest.
	ImageDigest string `json:"image_digest,omitempty"`
}

DeploymentCauseDetailsDOCRPush struct for DeploymentCauseDetailsDOCRPush

func (*DeploymentCauseDetailsDOCRPush) GetImageDigest added in v1.86.0

func (d *DeploymentCauseDetailsDOCRPush) GetImageDigest() string

GetImageDigest returns the ImageDigest field.

func (*DeploymentCauseDetailsDOCRPush) GetRegistry added in v1.86.0

func (d *DeploymentCauseDetailsDOCRPush) GetRegistry() string

GetRegistry returns the Registry field.

func (*DeploymentCauseDetailsDOCRPush) GetRepository added in v1.86.0

func (d *DeploymentCauseDetailsDOCRPush) GetRepository() string

GetRepository returns the Repository field.

func (*DeploymentCauseDetailsDOCRPush) GetTag added in v1.86.0

GetTag returns the Tag field.

type DeploymentCauseDetailsDigitalOceanUser added in v1.65.0

type DeploymentCauseDetailsDigitalOceanUser struct {
	UUID     string `json:"uuid,omitempty"`
	Email    string `json:"email,omitempty"`
	FullName string `json:"full_name,omitempty"`
}

DeploymentCauseDetailsDigitalOceanUser struct for DeploymentCauseDetailsDigitalOceanUser

func (*DeploymentCauseDetailsDigitalOceanUser) GetEmail added in v1.85.0

GetEmail returns the Email field.

func (*DeploymentCauseDetailsDigitalOceanUser) GetFullName added in v1.85.0

GetFullName returns the FullName field.

func (*DeploymentCauseDetailsDigitalOceanUser) GetUUID added in v1.85.0

GetUUID returns the UUID field.

type DeploymentCauseDetailsDigitalOceanUserAction added in v1.65.0

type DeploymentCauseDetailsDigitalOceanUserAction struct {
	User *DeploymentCauseDetailsDigitalOceanUser          `json:"user,omitempty"`
	Name DeploymentCauseDetailsDigitalOceanUserActionName `json:"name,omitempty"`
}

DeploymentCauseDetailsDigitalOceanUserAction struct for DeploymentCauseDetailsDigitalOceanUserAction

func (*DeploymentCauseDetailsDigitalOceanUserAction) GetName added in v1.85.0

GetName returns the Name field.

func (*DeploymentCauseDetailsDigitalOceanUserAction) GetUser added in v1.85.0

GetUser returns the User field.

type DeploymentCauseDetailsDigitalOceanUserActionName added in v1.65.0

type DeploymentCauseDetailsDigitalOceanUserActionName string

DeploymentCauseDetailsDigitalOceanUserActionName the model 'CauseDetailsDigitalOceanUserActionName'

const (
	DeploymentCauseDetailsDigitalOceanUserActionName_Unknown               DeploymentCauseDetailsDigitalOceanUserActionName = "UNKNOWN"
	DeploymentCauseDetailsDigitalOceanUserActionName_CreateDeployment      DeploymentCauseDetailsDigitalOceanUserActionName = "CREATE_DEPLOYMENT"
	DeploymentCauseDetailsDigitalOceanUserActionName_UpdateSpec            DeploymentCauseDetailsDigitalOceanUserActionName = "UPDATE_SPEC"
	DeploymentCauseDetailsDigitalOceanUserActionName_ResetDatabasePassword DeploymentCauseDetailsDigitalOceanUserActionName = "RESET_DATABASE_PASSWORD"
	DeploymentCauseDetailsDigitalOceanUserActionName_RollbackApp           DeploymentCauseDetailsDigitalOceanUserActionName = "ROLLBACK_APP"
	DeploymentCauseDetailsDigitalOceanUserActionName_RevertAppRollback     DeploymentCauseDetailsDigitalOceanUserActionName = "REVERT_APP_ROLLBACK"
	DeploymentCauseDetailsDigitalOceanUserActionName_UpgradeBuildpack      DeploymentCauseDetailsDigitalOceanUserActionName = "UPGRADE_BUILDPACK"
	DeploymentCauseDetailsDigitalOceanUserActionName_Restart               DeploymentCauseDetailsDigitalOceanUserActionName = "RESTART"
)

List of DeploymentCauseDetailsDigitalOceanUserActionName

type DeploymentCauseDetailsGitPush added in v1.65.0

type DeploymentCauseDetailsGitPush struct {
	GitHub        *GitHubSourceSpec    `json:"github,omitempty"`
	GitLab        *GitLabSourceSpec    `json:"gitlab,omitempty"`
	Bitbucket     *BitbucketSourceSpec `json:"bitbucket,omitempty"`
	Username      string               `json:"username,omitempty"`
	CommitAuthor  string               `json:"commit_author,omitempty"`
	CommitSHA     string               `json:"commit_sha,omitempty"`
	CommitMessage string               `json:"commit_message,omitempty"`
}

DeploymentCauseDetailsGitPush struct for DeploymentCauseDetailsGitPush

func (*DeploymentCauseDetailsGitPush) GetBitbucket added in v1.132.0

GetBitbucket returns the Bitbucket field.

func (*DeploymentCauseDetailsGitPush) GetCommitAuthor added in v1.85.0

func (d *DeploymentCauseDetailsGitPush) GetCommitAuthor() string

GetCommitAuthor returns the CommitAuthor field.

func (*DeploymentCauseDetailsGitPush) GetCommitMessage added in v1.85.0

func (d *DeploymentCauseDetailsGitPush) GetCommitMessage() string

GetCommitMessage returns the CommitMessage field.

func (*DeploymentCauseDetailsGitPush) GetCommitSHA added in v1.85.0

func (d *DeploymentCauseDetailsGitPush) GetCommitSHA() string

GetCommitSHA returns the CommitSHA field.

func (*DeploymentCauseDetailsGitPush) GetGitHub added in v1.85.0

GetGitHub returns the GitHub field.

func (*DeploymentCauseDetailsGitPush) GetGitLab added in v1.85.0

GetGitLab returns the GitLab field.

func (*DeploymentCauseDetailsGitPush) GetUsername added in v1.85.0

func (d *DeploymentCauseDetailsGitPush) GetUsername() string

GetUsername returns the Username field.

type DeploymentCauseDetailsType added in v1.65.0

type DeploymentCauseDetailsType string

DeploymentCauseDetailsType - MANUAL: A deployment that was manually created - DEPLOY_ON_PUSH: A deployment that was automatically created by a Deploy on Push hook - MAINTENANCE: A deployment created for App Platform maintenance - MANUAL_ROLLBACK: A rollback deployment that was manually created - AUTO_ROLLBACK: An automatic rollback deployment created as a result of a previous deployment failing - UPDATE_DATABASE_TRUSTED_SOURCES: A deployment that was created due to an update in database trusted sources. - AUTOSCALED: A deployment that was created due to an autoscaler update.

const (
	DeploymentCauseDetailsType_Unknown                      DeploymentCauseDetailsType = "UNKNOWN"
	DeploymentCauseDetailsType_Manual                       DeploymentCauseDetailsType = "MANUAL"
	DeploymentCauseDetailsType_DeployOnPush                 DeploymentCauseDetailsType = "DEPLOY_ON_PUSH"
	DeploymentCauseDetailsType_Maintenance                  DeploymentCauseDetailsType = "MAINTENANCE"
	DeploymentCauseDetailsType_ManualRollback               DeploymentCauseDetailsType = "MANUAL_ROLLBACK"
	DeploymentCauseDetailsType_AutoRollback                 DeploymentCauseDetailsType = "AUTO_ROLLBACK"
	DeploymentCauseDetailsType_UpdateDatabaseTrustedSources DeploymentCauseDetailsType = "UPDATE_DATABASE_TRUSTED_SOURCES"
	DeploymentCauseDetailsType_Autoscaled                   DeploymentCauseDetailsType = "AUTOSCALED"
)

List of DeploymentCauseDetailsType

type DeploymentCreateRequest added in v1.52.0

type DeploymentCreateRequest struct {
	ForceBuild bool `json:"force_build"`
}

DeploymentCreateRequest represents a request to create a deployment.

type DeploymentFunctions added in v1.74.0

type DeploymentFunctions struct {
	Name string `json:"name,omitempty"`
	// The commit hash of the repository that was used to build this functions component.
	SourceCommitHash string `json:"source_commit_hash,omitempty"`
	// The namespace where the functions are deployed.
	Namespace string `json:"namespace,omitempty"`
}

DeploymentFunctions struct for DeploymentFunctions

func (*DeploymentFunctions) GetName added in v1.85.0

func (d *DeploymentFunctions) GetName() string

GetName returns the Name field.

func (*DeploymentFunctions) GetNamespace added in v1.85.0

func (d *DeploymentFunctions) GetNamespace() string

GetNamespace returns the Namespace field.

func (*DeploymentFunctions) GetSourceCommitHash added in v1.85.0

func (d *DeploymentFunctions) GetSourceCommitHash() string

GetSourceCommitHash returns the SourceCommitHash field.

type DeploymentJob added in v1.43.0

type DeploymentJob struct {
	Name             string `json:"name,omitempty"`
	SourceCommitHash string `json:"source_commit_hash,omitempty"`
	// The list of resolved buildpacks used for a given deployment component.
	Buildpacks []*Buildpack `json:"buildpacks,omitempty"`
}

DeploymentJob struct for DeploymentJob

func (*DeploymentJob) GetBuildpacks added in v1.85.0

func (d *DeploymentJob) GetBuildpacks() []*Buildpack

GetBuildpacks returns the Buildpacks field.

func (*DeploymentJob) GetName added in v1.85.0

func (d *DeploymentJob) GetName() string

GetName returns the Name field.

func (*DeploymentJob) GetSourceCommitHash added in v1.85.0

func (d *DeploymentJob) GetSourceCommitHash() string

GetSourceCommitHash returns the SourceCommitHash field.

type DeploymentPhase added in v1.45.0

type DeploymentPhase string

DeploymentPhase the model 'DeploymentPhase'

const (
	DeploymentPhase_Unknown       DeploymentPhase = "UNKNOWN"
	DeploymentPhase_PendingBuild  DeploymentPhase = "PENDING_BUILD"
	DeploymentPhase_Building      DeploymentPhase = "BUILDING"
	DeploymentPhase_PendingDeploy DeploymentPhase = "PENDING_DEPLOY"
	DeploymentPhase_Deploying     DeploymentPhase = "DEPLOYING"
	DeploymentPhase_Active        DeploymentPhase = "ACTIVE"
	DeploymentPhase_Superseded    DeploymentPhase = "SUPERSEDED"
	DeploymentPhase_Error         DeploymentPhase = "ERROR"
	DeploymentPhase_Canceled      DeploymentPhase = "CANCELED"
)

List of DeploymentPhase

type DeploymentProgress added in v1.39.0

type DeploymentProgress struct {
	PendingSteps int32                     `json:"pending_steps,omitempty"`
	RunningSteps int32                     `json:"running_steps,omitempty"`
	SuccessSteps int32                     `json:"success_steps,omitempty"`
	ErrorSteps   int32                     `json:"error_steps,omitempty"`
	TotalSteps   int32                     `json:"total_steps,omitempty"`
	Steps        []*DeploymentProgressStep `json:"steps,omitempty"`
	SummarySteps []*DeploymentProgressStep `json:"summary_steps,omitempty"`
}

DeploymentProgress struct for DeploymentProgress

func (*DeploymentProgress) GetErrorSteps added in v1.85.0

func (d *DeploymentProgress) GetErrorSteps() int32

GetErrorSteps returns the ErrorSteps field.

func (*DeploymentProgress) GetPendingSteps added in v1.85.0

func (d *DeploymentProgress) GetPendingSteps() int32

GetPendingSteps returns the PendingSteps field.

func (*DeploymentProgress) GetRunningSteps added in v1.85.0

func (d *DeploymentProgress) GetRunningSteps() int32

GetRunningSteps returns the RunningSteps field.

func (*DeploymentProgress) GetSteps added in v1.85.0

func (d *DeploymentProgress) GetSteps() []*DeploymentProgressStep

GetSteps returns the Steps field.

func (*DeploymentProgress) GetSuccessSteps added in v1.85.0

func (d *DeploymentProgress) GetSuccessSteps() int32

GetSuccessSteps returns the SuccessSteps field.

func (*DeploymentProgress) GetSummarySteps added in v1.85.0

func (d *DeploymentProgress) GetSummarySteps() []*DeploymentProgressStep

GetSummarySteps returns the SummarySteps field.

func (*DeploymentProgress) GetTotalSteps added in v1.85.0

func (d *DeploymentProgress) GetTotalSteps() int32

GetTotalSteps returns the TotalSteps field.

type DeploymentProgressStep added in v1.39.0

type DeploymentProgressStep struct {
	Name          string                        `json:"name,omitempty"`
	Status        DeploymentProgressStepStatus  `json:"status,omitempty"`
	Steps         []*DeploymentProgressStep     `json:"steps,omitempty"`
	StartedAt     time.Time                     `json:"started_at,omitempty"`
	EndedAt       time.Time                     `json:"ended_at,omitempty"`
	Reason        *DeploymentProgressStepReason `json:"reason,omitempty"`
	ComponentName string                        `json:"component_name,omitempty"`
	// The base of a human-readable description of the step intended to be combined with the component name for presentation. For example:  `message_base` = \"Building service\" `component_name` = \"api\"
	MessageBase string `json:"message_base,omitempty"`
}

DeploymentProgressStep struct for DeploymentProgressStep

func (*DeploymentProgressStep) GetComponentName added in v1.85.0

func (d *DeploymentProgressStep) GetComponentName() string

GetComponentName returns the ComponentName field.

func (*DeploymentProgressStep) GetEndedAt added in v1.85.0

func (d *DeploymentProgressStep) GetEndedAt() time.Time

GetEndedAt returns the EndedAt field.

func (*DeploymentProgressStep) GetMessageBase added in v1.85.0

func (d *DeploymentProgressStep) GetMessageBase() string

GetMessageBase returns the MessageBase field.

func (*DeploymentProgressStep) GetName added in v1.85.0

func (d *DeploymentProgressStep) GetName() string

GetName returns the Name field.

func (*DeploymentProgressStep) GetReason added in v1.85.0

GetReason returns the Reason field.

func (*DeploymentProgressStep) GetStartedAt added in v1.85.0

func (d *DeploymentProgressStep) GetStartedAt() time.Time

GetStartedAt returns the StartedAt field.

func (*DeploymentProgressStep) GetStatus added in v1.85.0

GetStatus returns the Status field.

func (*DeploymentProgressStep) GetSteps added in v1.85.0

GetSteps returns the Steps field.

type DeploymentProgressStepReason added in v1.45.0

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

DeploymentProgressStepReason struct for DeploymentProgressStepReason

func (*DeploymentProgressStepReason) GetCode added in v1.85.0

func (d *DeploymentProgressStepReason) GetCode() string

GetCode returns the Code field.

func (*DeploymentProgressStepReason) GetMessage added in v1.85.0

func (d *DeploymentProgressStepReason) GetMessage() string

GetMessage returns the Message field.

type DeploymentProgressStepStatus added in v1.45.0

type DeploymentProgressStepStatus string

DeploymentProgressStepStatus the model 'DeploymentProgressStepStatus'

const (
	DeploymentProgressStepStatus_Unknown DeploymentProgressStepStatus = "UNKNOWN"
	DeploymentProgressStepStatus_Pending DeploymentProgressStepStatus = "PENDING"
	DeploymentProgressStepStatus_Running DeploymentProgressStepStatus = "RUNNING"
	DeploymentProgressStepStatus_Error   DeploymentProgressStepStatus = "ERROR"
	DeploymentProgressStepStatus_Success DeploymentProgressStepStatus = "SUCCESS"
)

List of DeploymentProgressStepStatus

type DeploymentService added in v1.39.0

type DeploymentService struct {
	Name             string `json:"name,omitempty"`
	SourceCommitHash string `json:"source_commit_hash,omitempty"`
	// The list of resolved buildpacks used for a given deployment component.
	Buildpacks []*Buildpack `json:"buildpacks,omitempty"`
}

DeploymentService struct for DeploymentService

func (*DeploymentService) GetBuildpacks added in v1.85.0

func (d *DeploymentService) GetBuildpacks() []*Buildpack

GetBuildpacks returns the Buildpacks field.

func (*DeploymentService) GetName added in v1.85.0

func (d *DeploymentService) GetName() string

GetName returns the Name field.

func (*DeploymentService) GetSourceCommitHash added in v1.85.0

func (d *DeploymentService) GetSourceCommitHash() string

GetSourceCommitHash returns the SourceCommitHash field.

type DeploymentStaticSite added in v1.39.0

type DeploymentStaticSite struct {
	Name             string `json:"name,omitempty"`
	SourceCommitHash string `json:"source_commit_hash,omitempty"`
	// The list of resolved buildpacks used for a given deployment component.
	Buildpacks []*Buildpack `json:"buildpacks,omitempty"`
}

DeploymentStaticSite struct for DeploymentStaticSite

func (*DeploymentStaticSite) GetBuildpacks added in v1.85.0

func (d *DeploymentStaticSite) GetBuildpacks() []*Buildpack

GetBuildpacks returns the Buildpacks field.

func (*DeploymentStaticSite) GetName added in v1.85.0

func (d *DeploymentStaticSite) GetName() string

GetName returns the Name field.

func (*DeploymentStaticSite) GetSourceCommitHash added in v1.85.0

func (d *DeploymentStaticSite) GetSourceCommitHash() string

GetSourceCommitHash returns the SourceCommitHash field.

type DeploymentTiming added in v1.97.0

type DeploymentTiming struct {
	// Pending describes the time spent waiting for the build to begin. This may include delays related to build concurrency limits.
	Pending string `json:"pending,omitempty"`
	// BuildTotal describes total time between the start of the build and its completion.
	BuildTotal string `json:"build_total,omitempty"`
	// BuildBillable describes the time spent executing the build. As builds may run concurrently this may be greater than the build total.
	BuildBillable string `json:"build_billable,omitempty"`
	// Components breaks down billable build time by component.
	Components []*DeploymentTimingComponent `json:"components,omitempty"`
	// DatabaseProvision describes the time spent creating databases.
	DatabaseProvision string `json:"database_provision,omitempty"`
	// Deploying is time spent starting containers and waiting for health checks to pass.
	Deploying string `json:"deploying,omitempty"`
}

DeploymentTiming struct for DeploymentTiming

func (*DeploymentTiming) GetBuildBillable added in v1.97.0

func (d *DeploymentTiming) GetBuildBillable() string

GetBuildBillable returns the BuildBillable field.

func (*DeploymentTiming) GetBuildTotal added in v1.97.0

func (d *DeploymentTiming) GetBuildTotal() string

GetBuildTotal returns the BuildTotal field.

func (*DeploymentTiming) GetComponents added in v1.97.0

func (d *DeploymentTiming) GetComponents() []*DeploymentTimingComponent

GetComponents returns the Components field.

func (*DeploymentTiming) GetDatabaseProvision added in v1.97.0

func (d *DeploymentTiming) GetDatabaseProvision() string

GetDatabaseProvision returns the DatabaseProvision field.

func (*DeploymentTiming) GetDeploying added in v1.97.0

func (d *DeploymentTiming) GetDeploying() string

GetDeploying returns the Deploying field.

func (*DeploymentTiming) GetPending added in v1.97.0

func (d *DeploymentTiming) GetPending() string

GetPending returns the Pending field.

type DeploymentTimingComponent added in v1.97.0

type DeploymentTimingComponent struct {
	// Name of the component.
	Name string `json:"name,omitempty"`
	// BuildBillable is the billable build time for this component.
	BuildBillable string `json:"build_billable,omitempty"`
}

DeploymentTimingComponent struct for DeploymentTimingComponent

func (*DeploymentTimingComponent) GetBuildBillable added in v1.97.0

func (d *DeploymentTimingComponent) GetBuildBillable() string

GetBuildBillable returns the BuildBillable field.

func (*DeploymentTimingComponent) GetName added in v1.97.0

func (d *DeploymentTimingComponent) GetName() string

GetName returns the Name field.

type DeploymentWorker added in v1.39.0

type DeploymentWorker struct {
	Name             string `json:"name,omitempty"`
	SourceCommitHash string `json:"source_commit_hash,omitempty"`
	// The list of resolved buildpacks used for a given deployment component.
	Buildpacks []*Buildpack `json:"buildpacks,omitempty"`
}

DeploymentWorker struct for DeploymentWorker

func (*DeploymentWorker) GetBuildpacks added in v1.85.0

func (d *DeploymentWorker) GetBuildpacks() []*Buildpack

GetBuildpacks returns the Buildpacks field.

func (*DeploymentWorker) GetName added in v1.85.0

func (d *DeploymentWorker) GetName() string

GetName returns the Name field.

func (*DeploymentWorker) GetSourceCommitHash added in v1.85.0

func (d *DeploymentWorker) GetSourceCommitHash() string

GetSourceCommitHash returns the SourceCommitHash field.

type Destinations added in v1.1.0

type Destinations struct {
	Addresses        []string `json:"addresses,omitempty"`
	Tags             []string `json:"tags,omitempty"`
	DropletIDs       []int    `json:"droplet_ids,omitempty"`
	LoadBalancerUIDs []string `json:"load_balancer_uids,omitempty"`
	KubernetesIDs    []string `json:"kubernetes_ids,omitempty"`
}

Destinations represents a DigitalOcean Firewall OutboundRule destinations.

type DetectRequest added in v1.82.0

type DetectRequest struct {
	Git       *GitSourceSpec       `json:"git,omitempty"`
	GitHub    *GitHubSourceSpec    `json:"github,omitempty"`
	GitLab    *GitLabSourceSpec    `json:"gitlab,omitempty"`
	Bitbucket *BitbucketSourceSpec `json:"bitbucket,omitempty"`
	// An optional commit hash to use instead of the branch specified in the source spec.
	CommitSHA string `json:"commit_sha,omitempty"`
	// An optional path to the working directory for the detection process.
	SourceDir string `json:"source_dir,omitempty"`
}

DetectRequest struct for DetectRequest

func (*DetectRequest) GetBitbucket added in v1.132.0

func (d *DetectRequest) GetBitbucket() *BitbucketSourceSpec

GetBitbucket returns the Bitbucket field.

func (*DetectRequest) GetCommitSHA added in v1.85.0

func (d *DetectRequest) GetCommitSHA() string

GetCommitSHA returns the CommitSHA field.

func (*DetectRequest) GetGit added in v1.85.0

func (d *DetectRequest) GetGit() *GitSourceSpec

GetGit returns the Git field.

func (*DetectRequest) GetGitHub added in v1.85.0

func (d *DetectRequest) GetGitHub() *GitHubSourceSpec

GetGitHub returns the GitHub field.

func (*DetectRequest) GetGitLab added in v1.85.0

func (d *DetectRequest) GetGitLab() *GitLabSourceSpec

GetGitLab returns the GitLab field.

func (*DetectRequest) GetSourceDir added in v1.85.0

func (d *DetectRequest) GetSourceDir() string

GetSourceDir returns the SourceDir field.

type DetectResponse added in v1.82.0

type DetectResponse struct {
	Components    []*DetectResponseComponent `json:"components,omitempty"`
	Template      *DeployTemplate            `json:"template,omitempty"`
	TemplateFound bool                       `json:"template_found,omitempty"`
	TemplateValid bool                       `json:"template_valid,omitempty"`
	TemplateError string                     `json:"template_error,omitempty"`
	// Whether or not the underlying detection is still pending. If true, the request can be retried as-is until this field is false and the response contains the detection result.
	Pending bool `json:"pending,omitempty"`
}

DetectResponse struct for DetectResponse

func (*DetectResponse) GetComponents added in v1.85.0

func (d *DetectResponse) GetComponents() []*DetectResponseComponent

GetComponents returns the Components field.

func (*DetectResponse) GetPending added in v1.128.0

func (d *DetectResponse) GetPending() bool

GetPending returns the Pending field.

func (*DetectResponse) GetTemplate added in v1.85.0

func (d *DetectResponse) GetTemplate() *DeployTemplate

GetTemplate returns the Template field.

func (*DetectResponse) GetTemplateError added in v1.85.0

func (d *DetectResponse) GetTemplateError() string

GetTemplateError returns the TemplateError field.

func (*DetectResponse) GetTemplateFound added in v1.85.0

func (d *DetectResponse) GetTemplateFound() bool

GetTemplateFound returns the TemplateFound field.

func (*DetectResponse) GetTemplateValid added in v1.85.0

func (d *DetectResponse) GetTemplateValid() bool

GetTemplateValid returns the TemplateValid field.

type DetectResponseComponent added in v1.82.0

type DetectResponseComponent struct {
	Strategy DetectResponseType `json:"strategy,omitempty"`
	Types    []string           `json:"types,omitempty"`
	// A list of Dockerfiles that were found for this component. The recommendation is to use the first Dockerfile.
	Dockerfiles     []string `json:"dockerfiles,omitempty"`
	BuildCommand    string   `json:"build_command,omitempty"`
	RunCommand      string   `json:"run_command,omitempty"`
	EnvironmentSlug string   `json:"environment_slug,omitempty"`
	// A list of HTTP ports that this component may listen on. The recommendation is to use the last port in the list.
	HTTPPorts []int64                  `json:"http_ports,omitempty"`
	EnvVars   []*AppVariableDefinition `json:"env_vars,omitempty"`
	// List of serverless packages detected.
	ServerlessPackages []*DetectResponseServerlessPackage `json:"serverless_packages,omitempty"`
	SourceDir          string                             `json:"source_dir,omitempty"`
	// The list of detected buildpacks that will be used for the component build.
	Buildpacks []*Buildpack `json:"buildpacks,omitempty"`
}

DetectResponseComponent struct for DetectResponseComponent

func (*DetectResponseComponent) GetBuildCommand added in v1.85.0

func (d *DetectResponseComponent) GetBuildCommand() string

GetBuildCommand returns the BuildCommand field.

func (*DetectResponseComponent) GetBuildpacks added in v1.85.0

func (d *DetectResponseComponent) GetBuildpacks() []*Buildpack

GetBuildpacks returns the Buildpacks field.

func (*DetectResponseComponent) GetDockerfiles added in v1.85.0

func (d *DetectResponseComponent) GetDockerfiles() []string

GetDockerfiles returns the Dockerfiles field.

func (*DetectResponseComponent) GetEnvVars added in v1.85.0

GetEnvVars returns the EnvVars field.

func (*DetectResponseComponent) GetEnvironmentSlug added in v1.98.0

func (d *DetectResponseComponent) GetEnvironmentSlug() string

GetEnvironmentSlug returns the EnvironmentSlug field.

func (*DetectResponseComponent) GetHTTPPorts added in v1.85.0

func (d *DetectResponseComponent) GetHTTPPorts() []int64

GetHTTPPorts returns the HTTPPorts field.

func (*DetectResponseComponent) GetRunCommand added in v1.85.0

func (d *DetectResponseComponent) GetRunCommand() string

GetRunCommand returns the RunCommand field.

func (*DetectResponseComponent) GetServerlessPackages added in v1.85.0

func (d *DetectResponseComponent) GetServerlessPackages() []*DetectResponseServerlessPackage

GetServerlessPackages returns the ServerlessPackages field.

func (*DetectResponseComponent) GetSourceDir added in v1.85.0

func (d *DetectResponseComponent) GetSourceDir() string

GetSourceDir returns the SourceDir field.

func (*DetectResponseComponent) GetStrategy added in v1.85.0

GetStrategy returns the Strategy field.

func (*DetectResponseComponent) GetTypes added in v1.85.0

func (d *DetectResponseComponent) GetTypes() []string

GetTypes returns the Types field.

type DetectResponseServerlessFunction added in v1.82.0

type DetectResponseServerlessFunction struct {
	// Name of the function.
	Name string `json:"name,omitempty"`
	// Package that the function belongs to.
	Package string `json:"package,omitempty"`
	// Runtime detected for the function.
	Runtime string                                  `json:"runtime,omitempty"`
	Limits  *DetectResponseServerlessFunctionLimits `json:"limits,omitempty"`
}

DetectResponseServerlessFunction struct for DetectResponseServerlessFunction

func (*DetectResponseServerlessFunction) GetLimits added in v1.85.0

GetLimits returns the Limits field.

func (*DetectResponseServerlessFunction) GetName added in v1.85.0

GetName returns the Name field.

func (*DetectResponseServerlessFunction) GetPackage added in v1.85.0

func (d *DetectResponseServerlessFunction) GetPackage() string

GetPackage returns the Package field.

func (*DetectResponseServerlessFunction) GetRuntime added in v1.85.0

func (d *DetectResponseServerlessFunction) GetRuntime() string

GetRuntime returns the Runtime field.

type DetectResponseServerlessFunctionLimits added in v1.82.0

type DetectResponseServerlessFunctionLimits struct {
	// Timeout for function invocation in milliseconds.
	Timeout string `json:"timeout,omitempty"`
	// Max memory allocation for function invocation in megabytes.
	Memory string `json:"memory,omitempty"`
	// Max log size usage for function invocation in kilobytes.
	Logs string `json:"logs,omitempty"`
}

DetectResponseServerlessFunctionLimits struct for DetectResponseServerlessFunctionLimits

func (*DetectResponseServerlessFunctionLimits) GetLogs added in v1.85.0

GetLogs returns the Logs field.

func (*DetectResponseServerlessFunctionLimits) GetMemory added in v1.85.0

GetMemory returns the Memory field.

func (*DetectResponseServerlessFunctionLimits) GetTimeout added in v1.85.0

GetTimeout returns the Timeout field.

type DetectResponseServerlessPackage added in v1.82.0

type DetectResponseServerlessPackage struct {
	// Name of the serverless package.
	Name string `json:"name,omitempty"`
	// List of functions detected in the serverless package.
	Functions []*DetectResponseServerlessFunction `json:"functions,omitempty"`
}

DetectResponseServerlessPackage struct for DetectResponseServerlessPackage

func (*DetectResponseServerlessPackage) GetFunctions added in v1.85.0

GetFunctions returns the Functions field.

func (*DetectResponseServerlessPackage) GetName added in v1.85.0

GetName returns the Name field.

type DetectResponseType added in v1.82.0

type DetectResponseType string

DetectResponseType the model 'DetectResponseType'

const (
	DetectResponseType_Unspecified DetectResponseType = "UNSPECIFIED"
	DetectResponseType_Dockerfile  DetectResponseType = "DOCKERFILE"
	DetectResponseType_Buildpack   DetectResponseType = "BUILDPACK"
	DetectResponseType_HTML        DetectResponseType = "HTML"
	DetectResponseType_Serverless  DetectResponseType = "SERVERLESS"
)

List of DetectResponseType

type DiskInfo added in v1.129.0

type DiskInfo struct {
	Type string    `json:"type,omitempty"`
	Size *DiskSize `json:"size,omitempty"`
}

DiskInfo containing information about the disks available to Droplets created with this size.

type DiskSize added in v1.129.0

type DiskSize struct {
	Amount int    `json:"amount,omitempty"`
	Unit   string `json:"unit,omitempty"`
}

DiskSize provides information about the size of a disk.

type DockerCredentials added in v1.25.0

type DockerCredentials struct {
	DockerConfigJSON []byte
}

DockerCredentials is the content of a Docker config file that is used by the docker CLI See: https://docs.docker.com/engine/reference/commandline/cli/#configjson-properties

type Domain added in v0.3.0

type Domain struct {
	Name     string `json:"name"`
	TTL      int    `json:"ttl"`
	ZoneFile string `json:"zone_file"`
}

Domain represents a DigitalOcean domain

func (Domain) String added in v0.3.0

func (d Domain) String() string

func (Domain) URN added in v1.6.0

func (d Domain) URN() string

URN returns the domain name in a valid DO API URN form.

type DomainCreateRequest added in v0.3.0

type DomainCreateRequest struct {
	Name      string `json:"name"`
	IPAddress string `json:"ip_address,omitempty"`
}

DomainCreateRequest represents a request to create a domain.

type DomainRecord

type DomainRecord struct {
	ID       int    `json:"id,omitempty"`
	Type     string `json:"type,omitempty"`
	Name     string `json:"name,omitempty"`
	Data     string `json:"data,omitempty"`
	Priority int    `json:"priority"`
	Port     int    `json:"port"`
	TTL      int    `json:"ttl,omitempty"`
	Weight   int    `json:"weight"`
	Flags    int    `json:"flags"`
	Tag      string `json:"tag,omitempty"`
}

DomainRecord represents a DigitalOcean DomainRecord

func (DomainRecord) String

func (d DomainRecord) String() string

Converts a DomainRecord to a string.

type DomainRecordEditRequest

type DomainRecordEditRequest struct {
	Type     string `json:"type,omitempty"`
	Name     string `json:"name,omitempty"`
	Data     string `json:"data,omitempty"`
	Priority int    `json:"priority"`
	Port     int    `json:"port"`
	TTL      int    `json:"ttl,omitempty"`
	Weight   int    `json:"weight"`
	Flags    int    `json:"flags"`
	Tag      string `json:"tag,omitempty"`
}

DomainRecordEditRequest represents a request to update a domain record.

func (DomainRecordEditRequest) String

func (d DomainRecordEditRequest) String() string

Converts a DomainRecordEditRequest to a string.

type DomainsServiceOp added in v0.3.0

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

DomainsServiceOp handles communication with the domain related methods of the DigitalOcean API.

func (*DomainsServiceOp) Create added in v0.3.0

func (s *DomainsServiceOp) Create(ctx context.Context, createRequest *DomainCreateRequest) (*Domain, *Response, error)

Create a new domain

func (*DomainsServiceOp) CreateRecord added in v0.3.0

func (s *DomainsServiceOp) CreateRecord(ctx context.Context,
	domain string,
	createRequest *DomainRecordEditRequest) (*DomainRecord, *Response, error)

CreateRecord creates a record using a DomainRecordEditRequest

func (*DomainsServiceOp) Delete added in v0.3.0

func (s *DomainsServiceOp) Delete(ctx context.Context, name string) (*Response, error)

Delete domain

func (*DomainsServiceOp) DeleteRecord added in v0.3.0

func (s *DomainsServiceOp) DeleteRecord(ctx context.Context, domain string, id int) (*Response, error)

DeleteRecord deletes a record from a domain identified by id

func (*DomainsServiceOp) EditRecord added in v0.3.0

func (s *DomainsServiceOp) EditRecord(ctx context.Context,
	domain string,
	id int,
	editRequest *DomainRecordEditRequest,
) (*DomainRecord, *Response, error)

EditRecord edits a record using a DomainRecordEditRequest

func (*DomainsServiceOp) Get added in v0.3.0

func (s *DomainsServiceOp) Get(ctx context.Context, name string) (*Domain, *Response, error)

Get individual domain. It requires a non-empty domain name.

func (DomainsServiceOp) List added in v0.3.0

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

List all domains.

func (*DomainsServiceOp) Record added in v0.3.0

func (s *DomainsServiceOp) Record(ctx context.Context, domain string, id int) (*DomainRecord, *Response, error)

Record returns the record id from a domain

func (*DomainsServiceOp) Records added in v0.3.0

func (s *DomainsServiceOp) Records(ctx context.Context, domain string, opt *ListOptions) ([]DomainRecord, *Response, error)

Records returns a slice of DomainRecord for a domain.

func (*DomainsServiceOp) RecordsByName added in v1.38.0

func (s *DomainsServiceOp) RecordsByName(ctx context.Context, domain, name string, opt *ListOptions) ([]DomainRecord, *Response, error)

RecordsByName returns a slice of DomainRecord for a domain matched by record name.

func (*DomainsServiceOp) RecordsByType added in v1.38.0

func (s *DomainsServiceOp) RecordsByType(ctx context.Context, domain, ofType string, opt *ListOptions) ([]DomainRecord, *Response, error)

RecordsByType returns a slice of DomainRecord for a domain matched by record type.

func (*DomainsServiceOp) RecordsByTypeAndName added in v1.38.0

func (s *DomainsServiceOp) RecordsByTypeAndName(ctx context.Context, domain, ofType, name string, opt *ListOptions) ([]DomainRecord, *Response, error)

RecordsByTypeAndName returns a slice of DomainRecord for a domain matched by record type and name.

type Droplet

type Droplet struct {
	ID               int           `json:"id,float64,omitempty"`
	Name             string        `json:"name,omitempty"`
	Memory           int           `json:"memory,omitempty"`
	Vcpus            int           `json:"vcpus,omitempty"`
	Disk             int           `json:"disk,omitempty"`
	Region           *Region       `json:"region,omitempty"`
	Image            *Image        `json:"image,omitempty"`
	Size             *Size         `json:"size,omitempty"`
	SizeSlug         string        `json:"size_slug,omitempty"`
	BackupIDs        []int         `json:"backup_ids,omitempty"`
	NextBackupWindow *BackupWindow `json:"next_backup_window,omitempty"`
	SnapshotIDs      []int         `json:"snapshot_ids,omitempty"`
	Features         []string      `json:"features,omitempty"`
	Locked           bool          `json:"locked,bool,omitempty"`
	Status           string        `json:"status,omitempty"`
	Networks         *Networks     `json:"networks,omitempty"`
	Created          string        `json:"created_at,omitempty"`
	Kernel           *Kernel       `json:"kernel,omitempty"`
	Tags             []string      `json:"tags,omitempty"`
	VolumeIDs        []string      `json:"volume_ids"`
	VPCUUID          string        `json:"vpc_uuid,omitempty"`
	SubnetUUID       string        `json:"subnet_uuid,omitempty"`
	// GPUPartitionMode is echoed back on create when the Droplet was created
	// with a partitioned GPU. Note: read-back on droplet GET is not delivered in
	// v1, so this is only reliably populated on the create response.
	GPUPartitionMode string `json:"gpu_partition_mode,omitempty"`
}

Droplet represents a DigitalOcean Droplet

func (*Droplet) PrivateIPv4 added in v1.0.0

func (d *Droplet) PrivateIPv4() (string, error)

PrivateIPv4 returns the private IPv4 address for the Droplet.

func (*Droplet) PublicIPv4 added in v1.0.0

func (d *Droplet) PublicIPv4() (string, error)

PublicIPv4 returns the public IPv4 address for the Droplet.

func (*Droplet) PublicIPv6 added in v1.0.0

func (d *Droplet) PublicIPv6() (string, error)

PublicIPv6 returns the public IPv6 address for the Droplet.

func (Droplet) String

func (d Droplet) String() string

Convert Droplet to a string

func (Droplet) URN added in v1.6.0

func (d Droplet) URN() string

URN returns the droplet ID in a valid DO API URN form.

type DropletActionsService

type DropletActionsService interface {
	Shutdown(context.Context, int) (*Action, *Response, error)
	ShutdownByTag(context.Context, string) ([]Action, *Response, error)
	PowerOff(context.Context, int) (*Action, *Response, error)
	PowerOffByTag(context.Context, string) ([]Action, *Response, error)
	PowerOn(context.Context, int) (*Action, *Response, error)
	PowerOnByTag(context.Context, string) ([]Action, *Response, error)
	PowerCycle(context.Context, int) (*Action, *Response, error)
	PowerCycleByTag(context.Context, string) ([]Action, *Response, error)
	Reboot(context.Context, int) (*Action, *Response, error)
	Restore(context.Context, int, int) (*Action, *Response, error)
	Resize(context.Context, int, string, bool) (*Action, *Response, error)
	Rename(context.Context, int, string) (*Action, *Response, error)
	Snapshot(context.Context, int, string) (*Action, *Response, error)
	SnapshotByTag(context.Context, string, string) ([]Action, *Response, error)
	EnableBackups(context.Context, int) (*Action, *Response, error)
	EnableBackupsByTag(context.Context, string) ([]Action, *Response, error)
	EnableBackupsWithPolicy(context.Context, int, *DropletBackupPolicyRequest) (*Action, *Response, error)
	ChangeBackupPolicy(context.Context, int, *DropletBackupPolicyRequest) (*Action, *Response, error)
	DisableBackups(context.Context, int) (*Action, *Response, error)
	DisableBackupsByTag(context.Context, string) ([]Action, *Response, error)
	PasswordReset(context.Context, int) (*Action, *Response, error)
	RebuildByImageID(context.Context, int, int) (*Action, *Response, error)
	RebuildByImageSlug(context.Context, int, string) (*Action, *Response, error)
	ChangeKernel(context.Context, int, int) (*Action, *Response, error)
	EnableIPv6(context.Context, int) (*Action, *Response, error)
	EnableIPv6ByTag(context.Context, string) ([]Action, *Response, error)
	EnablePrivateNetworking(context.Context, int) (*Action, *Response, error)
	EnablePrivateNetworkingByTag(context.Context, string) ([]Action, *Response, error)
	Get(context.Context, int, int) (*Action, *Response, error)
	GetByURI(context.Context, string) (*Action, *Response, error)
}

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

type DropletActionsServiceOp added in v0.3.0

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

DropletActionsServiceOp handles communication with the Droplet action related methods of the DigitalOcean API.

func (*DropletActionsServiceOp) ChangeBackupPolicy added in v1.129.0

func (s *DropletActionsServiceOp) ChangeBackupPolicy(ctx context.Context, id int, policy *DropletBackupPolicyRequest) (*Action, *Response, error)

ChangeBackupPolicy updates a backup policy when backups are enabled.

func (*DropletActionsServiceOp) ChangeKernel added in v0.9.0

func (s *DropletActionsServiceOp) ChangeKernel(ctx context.Context, id, kernelID int) (*Action, *Response, error)

ChangeKernel changes the kernel for a Droplet.

func (*DropletActionsServiceOp) DisableBackups added in v0.9.0

func (s *DropletActionsServiceOp) DisableBackups(ctx context.Context, id int) (*Action, *Response, error)

DisableBackups disables backups for a Droplet.

func (*DropletActionsServiceOp) DisableBackupsByTag added in v1.0.0

func (s *DropletActionsServiceOp) DisableBackupsByTag(ctx context.Context, tag string) ([]Action, *Response, error)

DisableBackupsByTag disables backups for Droplet matched by a Tag.

func (*DropletActionsServiceOp) EnableBackups added in v1.0.0

func (s *DropletActionsServiceOp) EnableBackups(ctx context.Context, id int) (*Action, *Response, error)

EnableBackups enables backups for a Droplet.

func (*DropletActionsServiceOp) EnableBackupsByTag added in v1.0.0

func (s *DropletActionsServiceOp) EnableBackupsByTag(ctx context.Context, tag string) ([]Action, *Response, error)

EnableBackupsByTag enables backups for Droplets matched by a Tag.

func (*DropletActionsServiceOp) EnableBackupsWithPolicy added in v1.129.0

func (s *DropletActionsServiceOp) EnableBackupsWithPolicy(ctx context.Context, id int, policy *DropletBackupPolicyRequest) (*Action, *Response, error)

EnableBackupsWithPolicy enables droplet's backup with a backup policy applied.

func (*DropletActionsServiceOp) EnableIPv6 added in v0.9.0

func (s *DropletActionsServiceOp) EnableIPv6(ctx context.Context, id int) (*Action, *Response, error)

EnableIPv6 enables IPv6 for a Droplet.

func (*DropletActionsServiceOp) EnableIPv6ByTag added in v1.0.0

func (s *DropletActionsServiceOp) EnableIPv6ByTag(ctx context.Context, tag string) ([]Action, *Response, error)

EnableIPv6ByTag enables IPv6 for Droplets matched by a Tag.

func (*DropletActionsServiceOp) EnablePrivateNetworking added in v0.9.0

func (s *DropletActionsServiceOp) EnablePrivateNetworking(ctx context.Context, id int) (*Action, *Response, error)

EnablePrivateNetworking enables private networking for a Droplet.

func (*DropletActionsServiceOp) EnablePrivateNetworkingByTag added in v1.0.0

func (s *DropletActionsServiceOp) EnablePrivateNetworkingByTag(ctx context.Context, tag string) ([]Action, *Response, error)

EnablePrivateNetworkingByTag enables private networking for Droplets matched by a Tag.

func (*DropletActionsServiceOp) Get added in v0.3.0

func (s *DropletActionsServiceOp) Get(ctx context.Context, dropletID, actionID int) (*Action, *Response, error)

Get an action for a particular Droplet by id.

func (*DropletActionsServiceOp) GetByURI added in v0.3.0

func (s *DropletActionsServiceOp) GetByURI(ctx context.Context, rawurl string) (*Action, *Response, error)

GetByURI gets an action for a particular Droplet by URI.

func (*DropletActionsServiceOp) PasswordReset added in v0.9.0

func (s *DropletActionsServiceOp) PasswordReset(ctx context.Context, id int) (*Action, *Response, error)

PasswordReset resets the password for a Droplet.

func (*DropletActionsServiceOp) PowerCycle added in v0.3.0

func (s *DropletActionsServiceOp) PowerCycle(ctx context.Context, id int) (*Action, *Response, error)

PowerCycle a Droplet

func (*DropletActionsServiceOp) PowerCycleByTag added in v1.0.0

func (s *DropletActionsServiceOp) PowerCycleByTag(ctx context.Context, tag string) ([]Action, *Response, error)

PowerCycleByTag power cycles Droplets matched by a Tag.

func (*DropletActionsServiceOp) PowerOff added in v0.3.0

func (s *DropletActionsServiceOp) PowerOff(ctx context.Context, id int) (*Action, *Response, error)

PowerOff a Droplet

func (*DropletActionsServiceOp) PowerOffByTag added in v1.0.0

func (s *DropletActionsServiceOp) PowerOffByTag(ctx context.Context, tag string) ([]Action, *Response, error)

PowerOffByTag powers off Droplets matched by a Tag.

func (*DropletActionsServiceOp) PowerOn added in v0.4.0

func (s *DropletActionsServiceOp) PowerOn(ctx context.Context, id int) (*Action, *Response, error)

PowerOn a Droplet

func (*DropletActionsServiceOp) PowerOnByTag added in v1.0.0

func (s *DropletActionsServiceOp) PowerOnByTag(ctx context.Context, tag string) ([]Action, *Response, error)

PowerOnByTag powers on Droplets matched by a Tag.

func (*DropletActionsServiceOp) Reboot added in v0.3.0

func (s *DropletActionsServiceOp) Reboot(ctx context.Context, id int) (*Action, *Response, error)

Reboot a Droplet

func (*DropletActionsServiceOp) RebuildByImageID added in v0.9.0

func (s *DropletActionsServiceOp) RebuildByImageID(ctx context.Context, id, imageID int) (*Action, *Response, error)

RebuildByImageID rebuilds a Droplet from an image with a given id.

func (*DropletActionsServiceOp) RebuildByImageSlug added in v0.9.0

func (s *DropletActionsServiceOp) RebuildByImageSlug(ctx context.Context, id int, slug string) (*Action, *Response, error)

RebuildByImageSlug rebuilds a Droplet from an Image matched by a given Slug.

func (*DropletActionsServiceOp) Rename added in v0.3.0

func (s *DropletActionsServiceOp) Rename(ctx context.Context, id int, name string) (*Action, *Response, error)

Rename a Droplet

func (*DropletActionsServiceOp) Resize added in v0.3.0

func (s *DropletActionsServiceOp) Resize(ctx context.Context, id int, sizeSlug string, resizeDisk bool) (*Action, *Response, error)

Resize a Droplet

func (*DropletActionsServiceOp) Restore added in v0.3.0

func (s *DropletActionsServiceOp) Restore(ctx context.Context, id, imageID int) (*Action, *Response, error)

Restore an image to a Droplet

func (*DropletActionsServiceOp) Shutdown added in v0.3.0

func (s *DropletActionsServiceOp) Shutdown(ctx context.Context, id int) (*Action, *Response, error)

Shutdown a Droplet

func (*DropletActionsServiceOp) ShutdownByTag added in v1.0.0

func (s *DropletActionsServiceOp) ShutdownByTag(ctx context.Context, tag string) ([]Action, *Response, error)

ShutdownByTag shuts down Droplets matched by a Tag.

func (*DropletActionsServiceOp) Snapshot added in v0.6.0

func (s *DropletActionsServiceOp) Snapshot(ctx context.Context, id int, name string) (*Action, *Response, error)

Snapshot a Droplet.

func (*DropletActionsServiceOp) SnapshotByTag added in v1.0.0

func (s *DropletActionsServiceOp) SnapshotByTag(ctx context.Context, tag string, name string) ([]Action, *Response, error)

SnapshotByTag snapshots Droplets matched by a Tag.

type DropletAssociatedResource added in v1.166.0

type DropletAssociatedResource struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Cost string `json:"cost"`
}

DropletAssociatedResource represents a billable resource associated with a Droplet.

type DropletAssociatedResources added in v1.166.0

type DropletAssociatedResources struct {
	ReservedIPs     []*DropletAssociatedResource `json:"reserved_ips"`
	FloatingIPs     []*DropletAssociatedResource `json:"floating_ips"`
	Snapshots       []*DropletAssociatedResource `json:"snapshots"`
	Volumes         []*DropletAssociatedResource `json:"volumes"`
	VolumeSnapshots []*DropletAssociatedResource `json:"volume_snapshots"`
}

DropletAssociatedResources represents the associated billable resources that can be destroyed along with a Droplet.

func (DropletAssociatedResources) String added in v1.166.0

type DropletAutoscaleConfiguration added in v1.128.0

type DropletAutoscaleConfiguration struct {
	MinInstances            uint64  `json:"min_instances,omitempty"`
	MaxInstances            uint64  `json:"max_instances,omitempty"`
	TargetCPUUtilization    float64 `json:"target_cpu_utilization,omitempty"`
	TargetMemoryUtilization float64 `json:"target_memory_utilization,omitempty"`
	CooldownMinutes         uint32  `json:"cooldown_minutes,omitempty"`
	TargetNumberInstances   uint64  `json:"target_number_instances,omitempty"`
}

DropletAutoscaleConfiguration represents a DigitalOcean droplet autoscale pool configuration

type DropletAutoscaleHistoryEvent added in v1.128.0

type DropletAutoscaleHistoryEvent struct {
	HistoryEventID       string    `json:"history_event_id"`
	CurrentInstanceCount uint64    `json:"current_instance_count"`
	DesiredInstanceCount uint64    `json:"desired_instance_count"`
	Reason               string    `json:"reason"`
	Status               string    `json:"status"`
	ErrorReason          string    `json:"error_reason,omitempty"`
	CreatedAt            time.Time `json:"created_at"`
	UpdatedAt            time.Time `json:"updated_at"`
}

DropletAutoscaleHistoryEvent represents a DigitalOcean droplet autoscale pool history event

type DropletAutoscalePool added in v1.128.0

type DropletAutoscalePool struct {
	ID                 string                               `json:"id"`
	Name               string                               `json:"name"`
	Config             *DropletAutoscaleConfiguration       `json:"config"`
	DropletTemplate    *DropletAutoscaleResourceTemplate    `json:"droplet_template"`
	CreatedAt          time.Time                            `json:"created_at"`
	UpdatedAt          time.Time                            `json:"updated_at"`
	CurrentUtilization *DropletAutoscaleResourceUtilization `json:"current_utilization,omitempty"`
	Status             string                               `json:"status"`
}

DropletAutoscalePool represents a DigitalOcean droplet autoscale pool

type DropletAutoscalePoolRequest added in v1.128.0

type DropletAutoscalePoolRequest struct {
	Name            string                            `json:"name"`
	Config          *DropletAutoscaleConfiguration    `json:"config"`
	DropletTemplate *DropletAutoscaleResourceTemplate `json:"droplet_template"`
}

DropletAutoscalePoolRequest represents a DigitalOcean droplet autoscale pool create/update request

type DropletAutoscaleResource added in v1.128.0

type DropletAutoscaleResource struct {
	DropletID          uint64                               `json:"droplet_id"`
	CreatedAt          time.Time                            `json:"created_at"`
	UpdatedAt          time.Time                            `json:"updated_at"`
	HealthStatus       string                               `json:"health_status"`
	UnhealthyReason    string                               `json:"unhealthy_reason,omitempty"`
	Status             string                               `json:"status"`
	CurrentUtilization *DropletAutoscaleResourceUtilization `json:"current_utilization,omitempty"`
}

DropletAutoscaleResource represents a DigitalOcean droplet autoscale pool resource

type DropletAutoscaleResourceTemplate added in v1.128.0

type DropletAutoscaleResourceTemplate struct {
	Size             string   `json:"size"`
	Region           string   `json:"region"`
	Image            string   `json:"image"`
	Tags             []string `json:"tags"`
	SSHKeys          []string `json:"ssh_keys"`
	VpcUUID          string   `json:"vpc_uuid"`
	WithDropletAgent bool     `json:"with_droplet_agent"`
	ProjectID        string   `json:"project_id"`
	IPV6             bool     `json:"ipv6"`
	UserData         string   `json:"user_data"`
	PublicNetworking *bool    `json:"public_networking"`
}

DropletAutoscaleResourceTemplate represents a DigitalOcean droplet autoscale pool resource template

type DropletAutoscaleResourceUtilization added in v1.128.0

type DropletAutoscaleResourceUtilization struct {
	Memory float64 `json:"memory,omitempty"`
	CPU    float64 `json:"cpu,omitempty"`
}

DropletAutoscaleResourceUtilization represents a DigitalOcean droplet autoscale pool resource utilization

type DropletAutoscaleService added in v1.128.0

DropletAutoscaleService defines an interface for managing droplet autoscale pools through DigitalOcean API

type DropletAutoscaleServiceOp added in v1.128.0

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

DropletAutoscaleServiceOp handles communication with droplet autoscale-related methods of the DigitalOcean API

func (*DropletAutoscaleServiceOp) Create added in v1.128.0

Create a new droplet autoscale pool

func (*DropletAutoscaleServiceOp) Delete added in v1.128.0

Delete an existing autoscale pool

func (*DropletAutoscaleServiceOp) DeleteDangerous added in v1.128.0

func (d *DropletAutoscaleServiceOp) DeleteDangerous(ctx context.Context, id string) (*Response, error)

DeleteDangerous deletes an existing autoscale pool with all underlying resources

func (*DropletAutoscaleServiceOp) Get added in v1.128.0

Get an existing droplet autoscale pool

func (*DropletAutoscaleServiceOp) List added in v1.128.0

List all existing droplet autoscale pools

func (*DropletAutoscaleServiceOp) ListHistory added in v1.128.0

ListHistory all history events for an existing droplet autoscale pool

func (*DropletAutoscaleServiceOp) ListMembers added in v1.128.0

ListMembers all members for an existing droplet autoscale pool

func (*DropletAutoscaleServiceOp) Update added in v1.128.0

Update an existing autoscale pool

type DropletBackupPolicy added in v1.129.0

type DropletBackupPolicy struct {
	DropletID        int                        `json:"droplet_id,omitempty"`
	BackupEnabled    bool                       `json:"backup_enabled,omitempty"`
	BackupPolicy     *DropletBackupPolicyConfig `json:"backup_policy,omitempty"`
	NextBackupWindow *BackupWindow              `json:"next_backup_window,omitempty"`
}

DropletBackupPolicy defines the information about a droplet's backup policy.

type DropletBackupPolicyConfig added in v1.129.0

type DropletBackupPolicyConfig struct {
	Plan                string `json:"plan,omitempty"`
	Weekday             string `json:"weekday,omitempty"`
	Hour                int    `json:"hour,omitempty"`
	WindowLengthHours   int    `json:"window_length_hours,omitempty"`
	RetentionPeriodDays int    `json:"retention_period_days,omitempty"`
}

DropletBackupPolicyConfig defines the backup policy for a Droplet.

type DropletBackupPolicyRequest added in v1.129.0

type DropletBackupPolicyRequest struct {
	Plan    string `json:"plan,omitempty"`
	Weekday string `json:"weekday,omitempty"`
	Hour    *int   `json:"hour,omitempty"`
}

DropletBackupPolicyRequest defines the backup policy when creating a Droplet.

type DropletBandwidthMetricsRequest added in v1.70.0

type DropletBandwidthMetricsRequest struct {
	DropletMetricsRequest
	Interface string
	Direction string
}

DropletBandwidthMetricsRequest holds the information needed to retrieve Droplet bandwidth metrics.

type DropletCreateImage added in v0.9.0

type DropletCreateImage struct {
	ID   int
	Slug string
}

DropletCreateImage identifies an image for the create request. It prefers slug over ID.

func (DropletCreateImage) MarshalJSON added in v0.9.0

func (d DropletCreateImage) MarshalJSON() ([]byte, error)

MarshalJSON returns either the slug or id of the image. It returns the id if the slug is empty.

type DropletCreateRequest

type DropletCreateRequest struct {
	Name              string                      `json:"name"`
	Region            string                      `json:"region"`
	Size              string                      `json:"size"`
	Image             DropletCreateImage          `json:"image"`
	SSHKeys           []DropletCreateSSHKey       `json:"ssh_keys"`
	Backups           bool                        `json:"backups"`
	IPv6              bool                        `json:"ipv6"`
	PrivateNetworking bool                        `json:"private_networking"`
	Monitoring        bool                        `json:"monitoring"`
	UserData          string                      `json:"user_data,omitempty"`
	Volumes           []DropletCreateVolume       `json:"volumes,omitempty"`
	Tags              []string                    `json:"tags"`
	VPCUUID           string                      `json:"vpc_uuid,omitempty"`
	SubnetUUID        string                      `json:"subnet_uuid,omitempty"`
	WithDropletAgent  *bool                       `json:"with_droplet_agent,omitempty"`
	BackupPolicy      *DropletBackupPolicyRequest `json:"backup_policy,omitempty"`
	PublicNetworking  *bool                       `json:"public_networking,omitempty"`
	// GPUPartitionMode selects the partition mode for a GPU Droplet. Omit or
	// leave empty for PARTITION_MODE_UNSET (full GPU). Use one of the
	// GPUPartitionMode* constants for supported values.
	GPUPartitionMode string `json:"gpu_partition_mode,omitempty"`
}

DropletCreateRequest represents a request to create a Droplet.

func (DropletCreateRequest) String

func (d DropletCreateRequest) String() string

type DropletCreateSSHKey added in v0.9.0

type DropletCreateSSHKey struct {
	ID          int
	Fingerprint string
}

DropletCreateSSHKey identifies a SSH Key for the create request. It prefers fingerprint over ID.

func (DropletCreateSSHKey) MarshalJSON added in v0.9.0

func (d DropletCreateSSHKey) MarshalJSON() ([]byte, error)

MarshalJSON returns either the fingerprint or id of the ssh key. It returns the id if the fingerprint is empty.

type DropletCreateVolume added in v1.0.0

type DropletCreateVolume struct {
	ID string
	// Deprecated: You must pass the volume's ID when creating a Droplet.
	Name string
}

DropletCreateVolume identifies a volume to attach for the create request.

func (DropletCreateVolume) MarshalJSON added in v1.0.0

func (d DropletCreateVolume) MarshalJSON() ([]byte, error)

MarshalJSON returns an object with either the ID or name of the volume. It prefers the ID over the name.

type DropletMetricsRequest added in v1.70.0

type DropletMetricsRequest struct {
	HostID string
	Start  time.Time
	End    time.Time
}

DropletMetricsRequest holds the information needed to retrieve Droplet various metrics.

type DropletMultiCreateRequest added in v1.0.0

type DropletMultiCreateRequest struct {
	Names             []string                    `json:"names"`
	Region            string                      `json:"region"`
	Size              string                      `json:"size"`
	Image             DropletCreateImage          `json:"image"`
	SSHKeys           []DropletCreateSSHKey       `json:"ssh_keys"`
	Backups           bool                        `json:"backups"`
	IPv6              bool                        `json:"ipv6"`
	PrivateNetworking bool                        `json:"private_networking"`
	Monitoring        bool                        `json:"monitoring"`
	UserData          string                      `json:"user_data,omitempty"`
	Tags              []string                    `json:"tags"`
	VPCUUID           string                      `json:"vpc_uuid,omitempty"`
	SubnetUUID        string                      `json:"subnet_uuid,omitempty"`
	WithDropletAgent  *bool                       `json:"with_droplet_agent,omitempty"`
	BackupPolicy      *DropletBackupPolicyRequest `json:"backup_policy,omitempty"`
	PublicNetworking  *bool                       `json:"public_networking,omitempty"`
	// GPUPartitionMode selects the partition mode for the GPU Droplets. Omit or
	// leave empty for PARTITION_MODE_UNSET (full GPU). Use one of the
	// GPUPartitionMode* constants for supported values.
	GPUPartitionMode string `json:"gpu_partition_mode,omitempty"`
}

DropletMultiCreateRequest is a request to create multiple Droplets.

func (DropletMultiCreateRequest) String added in v1.0.0

func (d DropletMultiCreateRequest) String() string

type DropletsService

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

type DropletsServiceOp added in v0.3.0

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

DropletsServiceOp handles communication with the Droplet related methods of the DigitalOcean API.

func (*DropletsServiceOp) Actions added in v0.9.0

func (s *DropletsServiceOp) Actions(ctx context.Context, dropletID int, opt *ListOptions) ([]Action, *Response, error)

Actions lists the actions for a Droplet.

func (*DropletsServiceOp) Backups added in v0.9.0

func (s *DropletsServiceOp) Backups(ctx context.Context, dropletID int, opt *ListOptions) ([]Image, *Response, error)

Backups lists the backups for a Droplet.

func (*DropletsServiceOp) Create added in v0.3.0

func (s *DropletsServiceOp) Create(ctx context.Context, createRequest *DropletCreateRequest) (*Droplet, *Response, error)

Create Droplet

func (*DropletsServiceOp) CreateMultiple added in v1.0.0

func (s *DropletsServiceOp) CreateMultiple(ctx context.Context, createRequest *DropletMultiCreateRequest) ([]Droplet, *Response, error)

CreateMultiple creates multiple Droplets.

func (*DropletsServiceOp) Delete added in v0.3.0

func (s *DropletsServiceOp) Delete(ctx context.Context, dropletID int) (*Response, error)

Delete Droplet.

func (*DropletsServiceOp) DeleteByTag added in v1.0.0

func (s *DropletsServiceOp) DeleteByTag(ctx context.Context, tag string) (*Response, error)

DeleteByTag deletes Droplets matched by a Tag.

func (*DropletsServiceOp) Get added in v0.3.0

func (s *DropletsServiceOp) Get(ctx context.Context, dropletID int) (*Droplet, *Response, error)

Get individual Droplet.

func (*DropletsServiceOp) GetBackupPolicy added in v1.129.0

func (s *DropletsServiceOp) GetBackupPolicy(ctx context.Context, dropletID int) (*DropletBackupPolicy, *Response, error)

Get individual droplet backup policy.

func (*DropletsServiceOp) Kernels added in v0.9.0

func (s *DropletsServiceOp) Kernels(ctx context.Context, dropletID int, opt *ListOptions) ([]Kernel, *Response, error)

Kernels lists kernels available for a Droplet.

func (*DropletsServiceOp) List added in v0.3.0

List all Droplets.

func (*DropletsServiceOp) ListAssociatedResourcesForDeletion added in v1.166.0

func (s *DropletsServiceOp) ListAssociatedResourcesForDeletion(ctx context.Context, dropletID int) (*DropletAssociatedResources, *Response, error)

ListAssociatedResourcesForDeletion lists a Droplet's associated resources that can be destroyed along with the Droplet. Associated resources include reserved IPs, floating IPs, snapshots, volumes, and volume snapshots.

func (*DropletsServiceOp) ListBackupPolicies added in v1.129.0

func (s *DropletsServiceOp) ListBackupPolicies(ctx context.Context, opt *ListOptions) (map[int]*DropletBackupPolicy, *Response, error)

List all droplet backup policies.

func (*DropletsServiceOp) ListByName added in v1.82.0

func (s *DropletsServiceOp) ListByName(ctx context.Context, name string, opt *ListOptions) ([]Droplet, *Response, error)

ListByName lists all Droplets filtered by name returning only exact matches. It is case-insensitive

func (*DropletsServiceOp) ListByTag added in v1.0.0

func (s *DropletsServiceOp) ListByTag(ctx context.Context, tag string, opt *ListOptions) ([]Droplet, *Response, error)

ListByTag lists all Droplets matched by a Tag.

func (*DropletsServiceOp) ListSupportedBackupPolicies added in v1.129.0

func (s *DropletsServiceOp) ListSupportedBackupPolicies(ctx context.Context) ([]*SupportedBackupPolicy, *Response, error)

List supported droplet backup policies.

func (*DropletsServiceOp) ListWithGPUs added in v1.129.0

func (s *DropletsServiceOp) ListWithGPUs(ctx context.Context, opt *ListOptions) ([]Droplet, *Response, error)

ListWithGPUs lists all Droplets with GPUs.

func (*DropletsServiceOp) Neighbors added in v0.9.0

func (s *DropletsServiceOp) Neighbors(ctx context.Context, dropletID int) ([]Droplet, *Response, error)

Neighbors lists the neighbors for a Droplet.

func (*DropletsServiceOp) Snapshots added in v0.9.0

func (s *DropletsServiceOp) Snapshots(ctx context.Context, dropletID int, opt *ListOptions) ([]Image, *Response, error)

Snapshots lists the snapshots available for a Droplet.

type Egresses added in v1.148.0

type Egresses struct {
	PublicGateways []*PublicGateway `json:"public_gateways,omitempty"`
}

Egresses define egress routes supported by a VPC NAT Gateway

type EmailNotificationConfig added in v1.218.0

type EmailNotificationConfig struct {
	To string `json:"to"`
}

EmailNotificationConfig is an email notification channel. To is one or more verified team-member addresses separated by commas, semicolons, or spaces.

type Embedding added in v1.191.0

type Embedding struct {
	Object    string          `json:"object"`
	Index     int             `json:"index"`
	Embedding json.RawMessage `json:"embedding"`
}

Embedding is a single embedding entry; Embedding is raw JSON because the API returns []float32 or a base64 string depending on encoding_format.

type EmbeddingNewParams added in v1.191.0

type EmbeddingNewParams struct {
	Model          string      `json:"model"`
	Input          interface{} `json:"input"`
	EncodingFormat string      `json:"encoding_format,omitempty"`
	User           string      `json:"user,omitempty"`
}

EmbeddingNewParams is the request body for POST /v1/embeddings; Input is a string or []string.

type EmbeddingService added in v1.191.0

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

EmbeddingService exposes POST /v1/embeddings.

func (*EmbeddingService) New added in v1.191.0

New creates one or more embedding vectors. There is no streaming variant.

type EmbeddingsUsage added in v1.191.0

type EmbeddingsUsage struct {
	PromptTokens int `json:"prompt_tokens"`
	TotalTokens  int `json:"total_tokens"`
}

EmbeddingsUsage holds prompt/total token counts for an embeddings call.

type EpochResultSummary added in v1.217.0

type EpochResultSummary struct {
	AvgAtKPercent      float64                  `json:"avg_at_k_percent,omitempty"`
	ConsAtKPercent     float64                  `json:"cons_at_k_percent,omitempty"`
	Epochs             uint32                   `json:"epochs,omitempty"`
	PassAtKPercent     float64                  `json:"pass_at_k_percent,omitempty"`
	PerEpoch           []*PerEpochResultSummary `json:"per_epoch,omitempty"`
	RowsExcluded       uint32                   `json:"rows_excluded,omitempty"`
	RowsScored         uint32                   `json:"rows_scored,omitempty"`
	ScoreStddevPercent float64                  `json:"score_stddev_percent,omitempty"`
}

EpochResultSummary aggregates avg@k/pass@k/cons@k across epochs when a run repeats each dataset row k times. Only populated when epochs > 1.

type ErrorResponse

type ErrorResponse struct {
	// HTTP response that caused this error
	Response *http.Response

	// Error message
	Message string `json:"message"`

	// RequestID returned from the API, useful to contact support.
	RequestID string `json:"request_id"`

	// Attempts is the number of times the request was attempted when retries are enabled.
	Attempts int

	// NestedError captures the alternate {"error":{"code":...,"message":...}}
	// envelope returned by some DigitalOcean services (e.g. the hosted-agents
	// harness-api) instead of the top-level {"message":...} shape. When the
	// top-level Message is empty, Error() falls back to this message so callers
	// see the server's reason rather than a bare status code.
	NestedError *struct {
		Code    int    `json:"code"`
		Message string `json:"message"`
	} `json:"error,omitempty"`
}

An ErrorResponse reports the error caused by an API request

func (*ErrorResponse) Error

func (r *ErrorResponse) Error() string

type EvaluationDataset added in v1.171.0

type EvaluationDataset struct {
	DatasetUUID     string                    `json:"dataset_uuid,omitempty"`
	DatasetName     string                    `json:"dataset_name,omitempty"`
	RowCount        uint32                    `json:"row_count,omitempty"`
	HasGroundTruth  bool                      `json:"has_ground_truth,omitempty"`
	FileSize        uint64                    `json:"file_size,omitempty"`
	DatasetType     EvaluationDatasetType     `json:"dataset_type,omitempty"`
	DatasetParadigm EvaluationDatasetParadigm `json:"dataset_paradigm,omitempty"`
	CreatedAt       *Timestamp                `json:"created_at,omitempty"`
}

EvaluationDataset represents the dataset information for an evaluation.

type EvaluationDatasetDeleteResponse added in v1.196.0

type EvaluationDatasetDeleteResponse struct{}

EvaluationDatasetDeleteResponse is the response returned by DeleteEvaluationDataset.

type EvaluationDatasetInfo added in v1.195.0

type EvaluationDatasetInfo struct {
	CreatedAt       *Timestamp                `json:"created_at,omitempty"`
	DatasetName     string                    `json:"dataset_name,omitempty"`
	DatasetParadigm EvaluationDatasetParadigm `json:"dataset_paradigm,omitempty"`
	DatasetType     EvaluationDatasetType     `json:"dataset_type,omitempty"`
	DatasetUUID     string                    `json:"dataset_uuid,omitempty"`
	FileSize        string                    `json:"file_size,omitempty"`
	HasGroundTruth  bool                      `json:"has_ground_truth,omitempty"`
	RowCount        int64                     `json:"row_count,omitempty"`
}

EvaluationDatasetInfo represents an evaluation dataset returned by ListEvaluationDatasets.

type EvaluationDatasetListOptions added in v1.195.0

type EvaluationDatasetListOptions struct {
	// DatasetType filters the results by evaluation dataset type.
	DatasetType EvaluationDatasetType `url:"dataset_type,omitempty"`
	// DatasetParadigm filters by row/content shape.
	DatasetParadigm EvaluationDatasetParadigm `url:"dataset_paradigm,omitempty"`
	// HasGroundTruth filters by whether the dataset includes ground-truth values.
	HasGroundTruth *bool `url:"has_ground_truth,omitempty"`
}

EvaluationDatasetListOptions holds the optional filters for ListEvaluationDatasets.

type EvaluationDatasetListResponse added in v1.195.0

type EvaluationDatasetListResponse struct {
	EvaluationDatasets []*EvaluationDatasetInfo `json:"evaluation_datasets,omitempty"`
}

EvaluationDatasetListResponse is the response returned by ListEvaluationDatasets.

type EvaluationDatasetParadigm added in v1.217.0

type EvaluationDatasetParadigm string

EvaluationDatasetParadigm is the row/content shape of a dataset, orthogonal to EvaluationDatasetType (e.g. a model dataset can be single- or multi-turn).

const (
	EvaluationDatasetParadigmSingleTurn EvaluationDatasetParadigm = "EVALUATION_DATASET_PARADIGM_SINGLE_TURN"
	EvaluationDatasetParadigmMultiTurn  EvaluationDatasetParadigm = "EVALUATION_DATASET_PARADIGM_MULTI_TURN"
	EvaluationDatasetParadigmCoding     EvaluationDatasetParadigm = "EVALUATION_DATASET_PARADIGM_CODING"
	EvaluationDatasetParadigmNPlus1     EvaluationDatasetParadigm = "EVALUATION_DATASET_PARADIGM_N_PLUS_1"
)

type EvaluationDatasetType added in v1.195.0

type EvaluationDatasetType string

EvaluationDatasetType represents the type of an evaluation dataset.

const (
	EvaluationDatasetTypeUnknown EvaluationDatasetType = "EVALUATION_DATASET_TYPE_UNKNOWN"
	EvaluationDatasetTypeADK     EvaluationDatasetType = "EVALUATION_DATASET_TYPE_ADK"
	EvaluationDatasetTypeNonADK  EvaluationDatasetType = "EVALUATION_DATASET_TYPE_NON_ADK"
	EvaluationDatasetTypeModel   EvaluationDatasetType = "EVALUATION_DATASET_TYPE_MODEL"
)

type EvaluationMetric added in v1.171.0

type EvaluationMetric struct {
	MetricUUID        string                            `json:"metric_uuid,omitempty"`
	MetricName        string                            `json:"metric_name,omitempty"`
	Description       string                            `json:"description,omitempty"`
	MetricType        EvaluationMetricType              `json:"metric_type,omitempty"`
	MetricValueType   EvaluationMetricValueType         `json:"metric_value_type,omitempty"`
	RangeMin          float32                           `json:"range_min,omitempty"`
	RangeMax          float32                           `json:"range_max,omitempty"`
	Inverted          bool                              `json:"inverted,omitempty"`
	Category          EvaluationMetricCategory          `json:"category,omitempty"`
	IsMetricGoal      bool                              `json:"is_metric_goal,omitempty"`
	MetricRank        uint32                            `json:"metric_rank,omitempty"`
	Source            EvaluationMetricSource            `json:"source,omitempty"`
	CustomEvalConfig  *CustomEvaluationMetricConfig     `json:"custom_eval_config,omitempty"`
	AssociatedPresets []AssociatedModelEvaluationPreset `json:"associated_presets,omitempty"`
}

EvaluationMetric represents an evaluation metric definition.

type EvaluationMetricCategory added in v1.171.0

type EvaluationMetricCategory string

EvaluationMetricCategory represents the category of an evaluation metric.

const (
	MetricCategoryUnspecified       EvaluationMetricCategory = "METRIC_CATEGORY_UNSPECIFIED"
	MetricCategoryCorrectness       EvaluationMetricCategory = "METRIC_CATEGORY_CORRECTNESS"
	MetricCategoryUserOutcomes      EvaluationMetricCategory = "METRIC_CATEGORY_USER_OUTCOMES"
	MetricCategorySafetyAndSecurity EvaluationMetricCategory = "METRIC_CATEGORY_SAFETY_AND_SECURITY"
	MetricCategoryContextQuality    EvaluationMetricCategory = "METRIC_CATEGORY_CONTEXT_QUALITY"
	MetricCategoryModelFit          EvaluationMetricCategory = "METRIC_CATEGORY_MODEL_FIT"
	MetricCategoryConversational    EvaluationMetricCategory = "METRIC_CATEGORY_CONVERSATIONAL"
)

type EvaluationMetricResult added in v1.206.0

type EvaluationMetricResult struct {
	ErrorDescription string                       `json:"error_description,omitempty"`
	MetricName       string                       `json:"metric_name,omitempty"`
	MetricUUID       string                       `json:"metric_uuid,omitempty"`
	MetricValueType  EvaluationMetricValueType    `json:"metric_value_type,omitempty"`
	NumberValue      float64                      `json:"number_value,omitempty"`
	Reasoning        string                       `json:"reasoning,omitempty"`
	Status           EvaluationMetricResultStatus `json:"status,omitempty"`
	StringValue      string                       `json:"string_value,omitempty"`
}

EvaluationMetricResult is a per-metric score and judge reasoning. Matches cthulhu EvaluationMetricResult (used on simulation trajectories).

type EvaluationMetricResultStatus added in v1.206.0

type EvaluationMetricResultStatus string

EvaluationMetricResultStatus is the outcome of scoring a single metric. Matches cthulhu EvaluationMetricResultStatus.

const (
	EvaluationMetricResultStatusUnspecified EvaluationMetricResultStatus = "EVALUATION_METRIC_RESULT_STATUS_UNSPECIFIED"
	EvaluationMetricResultStatusCompleted   EvaluationMetricResultStatus = "EVALUATION_METRIC_RESULT_STATUS_COMPLETED"
	EvaluationMetricResultStatusFailed      EvaluationMetricResultStatus = "EVALUATION_METRIC_RESULT_STATUS_FAILED"
	EvaluationMetricResultStatusSkipped     EvaluationMetricResultStatus = "EVALUATION_METRIC_RESULT_STATUS_SKIPPED"
)

type EvaluationMetricSource added in v1.198.0

type EvaluationMetricSource string

EvaluationMetricSource distinguishes platform catalog metrics from user-defined LLM-as-judge metrics.

const (
	EvaluationMetricSourceUnspecified EvaluationMetricSource = "EVALUATION_METRIC_SOURCE_UNSPECIFIED"
	EvaluationMetricSourceBuiltin     EvaluationMetricSource = "EVALUATION_METRIC_SOURCE_BUILTIN"
	EvaluationMetricSourceCustom      EvaluationMetricSource = "EVALUATION_METRIC_SOURCE_CUSTOM"
)

type EvaluationMetricType added in v1.171.0

type EvaluationMetricType string

EvaluationMetricType represents the type of evaluation metric.

const (
	MetricTypeUnspecified    EvaluationMetricType = "METRIC_TYPE_UNSPECIFIED"
	MetricTypeGeneralQuality EvaluationMetricType = "METRIC_TYPE_GENERAL_QUALITY"
	MetricTypeRAGAndTool     EvaluationMetricType = "METRIC_TYPE_RAG_AND_TOOL"
	MetricTypeModelQuality   EvaluationMetricType = "METRIC_TYPE_MODEL_QUALITY"
	MetricTypeModelSafety    EvaluationMetricType = "METRIC_TYPE_MODEL_SAFETY"
)

type EvaluationMetricValueType added in v1.171.0

type EvaluationMetricValueType string

EvaluationMetricValueType represents the value type of an evaluation metric.

const (
	MetricValueTypeUnspecified EvaluationMetricValueType = "METRIC_VALUE_TYPE_UNSPECIFIED"
	MetricValueTypeNumber      EvaluationMetricValueType = "METRIC_VALUE_TYPE_NUMBER"
	MetricValueTypeString      EvaluationMetricValueType = "METRIC_VALUE_TYPE_STRING"
	MetricValueTypePercentage  EvaluationMetricValueType = "METRIC_VALUE_TYPE_PERCENTAGE"
)

type EvaluationPricing added in v1.194.1

type EvaluationPricing struct {
	Currency                 string               `json:"currency,omitempty"`
	JudgeModelPricing        *TokenPricing        `json:"judge_model_pricing,omitempty"`
	PerCandidateModelPricing []*ModelPricingEntry `json:"per_candidate_model_pricing,omitempty"`
	TotalCost                float64              `json:"total_cost,omitempty"`
}

EvaluationPricing contains the pricing breakdown for an evaluation run.

type EvaluationTestCase added in v1.171.0

type EvaluationTestCase struct {
	TestCaseUUID              string              `json:"test_case_uuid,omitempty"`
	Name                      string              `json:"name,omitempty"`
	Description               string              `json:"description,omitempty"`
	Version                   uint32              `json:"version,omitempty"`
	DatasetUUID               string              `json:"dataset_uuid,omitempty"` // Deprecated
	DatasetName               string              `json:"dataset_name,omitempty"` // Deprecated
	Metrics                   []*EvaluationMetric `json:"metrics,omitempty"`
	StarMetric                *StarMetric         `json:"star_metric,omitempty"`
	TotalRuns                 int32               `json:"total_runs,omitempty"`
	LatestVersionNumberOfRuns int32               `json:"latest_version_number_of_runs,omitempty"`
	UpdatedByUserID           uint64              `json:"updated_by_user_id,omitempty"`
	UpdatedByUserEmail        string              `json:"updated_by_user_email,omitempty"`
	CreatedByUserEmail        string              `json:"created_by_user_email,omitempty"`
	CreatedByUserID           uint64              `json:"created_by_user_id,omitempty"`
	CreatedAt                 *Timestamp          `json:"created_at,omitempty"`
	UpdatedAt                 *Timestamp          `json:"updated_at,omitempty"`
	ArchivedAt                *Timestamp          `json:"archived_at,omitempty"`
	Dataset                   *EvaluationDataset  `json:"dataset,omitempty"`
}

EvaluationTestCase represents an evaluation test case configuration.

type Event added in v1.177.0

type Event struct {
	ID           string                 `json:"id,omitempty"`
	Type         EventType              `json:"type,omitempty"`
	CreatedAt    time.Time              `json:"created_at,omitempty"`
	DeploymentID string                 `json:"deployment_id,omitempty"`
	Deployment   *Deployment            `json:"deployment,omitempty"`
	Autoscaling  *EventAutoscalingEvent `json:"autoscaling,omitempty"`
}

Event struct for Event

func (*Event) GetAutoscaling added in v1.177.0

func (e *Event) GetAutoscaling() *EventAutoscalingEvent

GetAutoscaling returns the Autoscaling field.

func (*Event) GetCreatedAt added in v1.177.0

func (e *Event) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field.

func (*Event) GetDeployment added in v1.177.0

func (e *Event) GetDeployment() *Deployment

GetDeployment returns the Deployment field.

func (*Event) GetDeploymentID added in v1.177.0

func (e *Event) GetDeploymentID() string

GetDeploymentID returns the DeploymentID field.

func (*Event) GetID added in v1.177.0

func (e *Event) GetID() string

GetID returns the ID field.

func (*Event) GetType added in v1.177.0

func (e *Event) GetType() EventType

GetType returns the Type field.

type EventAutoscalingEvent added in v1.177.0

type EventAutoscalingEvent struct {
	Phase      EventAutoscalingEventPhase                      `json:"phase,omitempty"`
	Components map[string]AutoscalingEventComponentScaleChange `json:"components,omitempty"`
}

EventAutoscalingEvent struct for EventAutoscalingEvent

func (*EventAutoscalingEvent) GetComponents added in v1.177.0

GetComponents returns the Components field.

func (*EventAutoscalingEvent) GetPhase added in v1.177.0

GetPhase returns the Phase field.

type EventAutoscalingEventPhase added in v1.177.0

type EventAutoscalingEventPhase string

EventAutoscalingEventPhase the model 'EventAutoscalingEventPhase'

const (
	EVENTAUTOSCALINGEVENTPHASE_Unknown    EventAutoscalingEventPhase = "UNKNOWN"
	EVENTAUTOSCALINGEVENTPHASE_Pending    EventAutoscalingEventPhase = "PENDING"
	EVENTAUTOSCALINGEVENTPHASE_InProgress EventAutoscalingEventPhase = "IN_PROGRESS"
	EVENTAUTOSCALINGEVENTPHASE_Succeeded  EventAutoscalingEventPhase = "SUCCEEDED"
	EVENTAUTOSCALINGEVENTPHASE_Failed     EventAutoscalingEventPhase = "FAILED"
	EVENTAUTOSCALINGEVENTPHASE_Canceled   EventAutoscalingEventPhase = "CANCELED"
)

List of EventAutoscalingEventPhase

type EventType added in v1.177.0

type EventType string

EventType the model 'EventType'

const (
	EVENTTYPE_Unknown     EventType = "UNKNOWN"
	EVENTTYPE_Deployment  EventType = "DEPLOYMENT"
	EVENTTYPE_Autoscaling EventType = "AUTOSCALING"
)

List of EventType

type FilePresignedUrlResponse added in v1.194.1

type FilePresignedUrlResponse struct {
	ExpiresAt        *Timestamp `json:"expires_at,omitempty"`
	ObjectKey        string     `json:"object_key,omitempty"`
	OriginalFileName string     `json:"original_file_name,omitempty"`
	PresignedURL     string     `json:"presigned_url,omitempty"`
}

FilePresignedUrlResponse describes the presigned URL details returned for a single requested file.

type FileUploadDataSource added in v1.152.0

type FileUploadDataSource struct {
	OriginalFileName string `json:"original_file_name,omitempty"`
	Size             string `json:"size_in_bytes,omitempty"`
	StoredObjectKey  string `json:"stored_object_key,omitempty"`
}

FileUploadDataSource represents the file upload data source information

type Firewall added in v1.1.0

type Firewall struct {
	ID             string          `json:"id"`
	Name           string          `json:"name"`
	Status         string          `json:"status"`
	InboundRules   []InboundRule   `json:"inbound_rules"`
	OutboundRules  []OutboundRule  `json:"outbound_rules"`
	DropletIDs     []int           `json:"droplet_ids"`
	Tags           []string        `json:"tags"`
	Created        string          `json:"created_at"`
	PendingChanges []PendingChange `json:"pending_changes"`
}

Firewall represents a DigitalOcean Firewall configuration.

func (Firewall) String added in v1.1.0

func (fw Firewall) String() string

String creates a human-readable description of a Firewall.

func (Firewall) URN added in v1.6.0

func (fw Firewall) URN() string

URN returns the firewall name in a valid DO API URN form.

type FirewallRequest added in v1.1.0

type FirewallRequest struct {
	Name          string         `json:"name"`
	InboundRules  []InboundRule  `json:"inbound_rules"`
	OutboundRules []OutboundRule `json:"outbound_rules"`
	DropletIDs    []int          `json:"droplet_ids"`
	Tags          []string       `json:"tags"`
}

FirewallRequest represents the configuration to be applied to an existing or a new Firewall.

type FirewallRuleAction added in v1.207.0

type FirewallRuleAction string

FirewallRuleAction represents the action to be taken by a firewall rule. When not specified, the API defaults to "allow" for backward compatibility.

const (
	// FirewallRuleActionAllow indicates that matching traffic should be allowed.
	FirewallRuleActionAllow FirewallRuleAction = "allow"
	// FirewallRuleActionDeny indicates that matching traffic should be denied.
	FirewallRuleActionDeny FirewallRuleAction = "deny"
)

type FirewallRulesRequest added in v1.1.0

type FirewallRulesRequest struct {
	InboundRules  []InboundRule  `json:"inbound_rules"`
	OutboundRules []OutboundRule `json:"outbound_rules"`
}

FirewallRulesRequest represents rules configuration to be applied to an existing Firewall.

type FirewallsService added in v1.1.0

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

type FirewallsServiceOp added in v1.1.0

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

FirewallsServiceOp handles communication with Firewalls methods of the DigitalOcean API.

func (*FirewallsServiceOp) AddDroplets added in v1.1.0

func (fw *FirewallsServiceOp) AddDroplets(ctx context.Context, fID string, dropletIDs ...int) (*Response, error)

AddDroplets to a Firewall.

func (*FirewallsServiceOp) AddRules added in v1.1.0

AddRules to a Firewall.

func (*FirewallsServiceOp) AddTags added in v1.1.0

func (fw *FirewallsServiceOp) AddTags(ctx context.Context, fID string, tags ...string) (*Response, error)

AddTags to a Firewall.

func (*FirewallsServiceOp) Create added in v1.1.0

Create a new Firewall with a given configuration.

func (*FirewallsServiceOp) Delete added in v1.1.0

func (fw *FirewallsServiceOp) Delete(ctx context.Context, fID string) (*Response, error)

Delete a Firewall by its identifier.

func (*FirewallsServiceOp) Get added in v1.1.0

Get an existing Firewall by its identifier.

func (*FirewallsServiceOp) List added in v1.1.0

List Firewalls.

func (*FirewallsServiceOp) ListByDroplet added in v1.1.0

func (fw *FirewallsServiceOp) ListByDroplet(ctx context.Context, dID int, opt *ListOptions) ([]Firewall, *Response, error)

ListByDroplet Firewalls.

func (*FirewallsServiceOp) RemoveDroplets added in v1.1.0

func (fw *FirewallsServiceOp) RemoveDroplets(ctx context.Context, fID string, dropletIDs ...int) (*Response, error)

RemoveDroplets from a Firewall.

func (*FirewallsServiceOp) RemoveRules added in v1.1.0

func (fw *FirewallsServiceOp) RemoveRules(ctx context.Context, fID string, rr *FirewallRulesRequest) (*Response, error)

RemoveRules from a Firewall.

func (*FirewallsServiceOp) RemoveTags added in v1.1.0

func (fw *FirewallsServiceOp) RemoveTags(ctx context.Context, fID string, tags ...string) (*Response, error)

RemoveTags from a Firewall.

func (*FirewallsServiceOp) Update added in v1.1.0

Update an existing Firewall with new configuration.

type FloatingIP added in v1.0.0

type FloatingIP struct {
	Region    *Region  `json:"region"`
	Droplet   *Droplet `json:"droplet"`
	IP        string   `json:"ip"`
	ProjectID string   `json:"project_id"`
	Locked    bool     `json:"locked"`
}

FloatingIP represents a Digital Ocean floating IP.

func (FloatingIP) String added in v1.0.0

func (f FloatingIP) String() string

func (FloatingIP) URN added in v1.6.0

func (f FloatingIP) URN() string

URN returns the floating IP in a valid DO API URN form.

type FloatingIPActionsService added in v1.0.0

type FloatingIPActionsService interface {
	Assign(ctx context.Context, ip string, dropletID int) (*Action, *Response, error)
	Unassign(ctx context.Context, ip string) (*Action, *Response, error)
	Get(ctx context.Context, ip string, actionID int) (*Action, *Response, error)
	List(ctx context.Context, ip string, opt *ListOptions) ([]Action, *Response, error)
}

FloatingIPActionsService is an interface for interfacing with the floating IPs actions endpoints of the Digital Ocean API. See: https://docs.digitalocean.com/reference/api/api-reference/#tag/Floating-IP-Actions

type FloatingIPActionsServiceOp added in v1.0.0

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

FloatingIPActionsServiceOp handles communication with the floating IPs action related methods of the DigitalOcean API.

func (*FloatingIPActionsServiceOp) Assign added in v1.0.0

func (s *FloatingIPActionsServiceOp) Assign(ctx context.Context, ip string, dropletID int) (*Action, *Response, error)

Assign a floating IP to a droplet.

func (*FloatingIPActionsServiceOp) Get added in v1.0.0

func (s *FloatingIPActionsServiceOp) Get(ctx context.Context, ip string, actionID int) (*Action, *Response, error)

Get an action for a particular floating IP by id.

func (*FloatingIPActionsServiceOp) List added in v1.0.0

List the actions for a particular floating IP.

func (*FloatingIPActionsServiceOp) Unassign added in v1.0.0

Unassign a floating IP from the droplet it is currently assigned to.

type FloatingIPCreateRequest added in v1.0.0

type FloatingIPCreateRequest struct {
	Region    string `json:"region,omitempty"`
	DropletID int    `json:"droplet_id,omitempty"`
	ProjectID string `json:"project_id,omitempty"`
}

FloatingIPCreateRequest represents a request to create a floating IP. Specify DropletID to assign the floating IP to a Droplet or Region to reserve it to the region.

type FloatingIPsService added in v1.0.0

FloatingIPsService is an interface for interfacing with the floating IPs endpoints of the Digital Ocean API. See: https://docs.digitalocean.com/reference/api/api-reference/#tag/Floating-IPs

type FloatingIPsServiceOp added in v1.0.0

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

FloatingIPsServiceOp handles communication with the floating IPs related methods of the DigitalOcean API.

func (*FloatingIPsServiceOp) Create added in v1.0.0

Create a floating IP. If the DropletID field of the request is not empty, the floating IP will also be assigned to the droplet.

func (*FloatingIPsServiceOp) Delete added in v1.0.0

func (f *FloatingIPsServiceOp) Delete(ctx context.Context, ip string) (*Response, error)

Delete a floating IP.

func (*FloatingIPsServiceOp) Get added in v1.0.0

Get an individual floating IP.

func (*FloatingIPsServiceOp) List added in v1.0.0

List all floating IPs.

type ForwardingRule added in v1.0.0

type ForwardingRule struct {
	EntryProtocol  string `json:"entry_protocol,omitempty"`
	EntryPort      int    `json:"entry_port,omitempty"`
	TargetProtocol string `json:"target_protocol,omitempty"`
	TargetPort     int    `json:"target_port,omitempty"`
	CertificateID  string `json:"certificate_id,omitempty"`
	TlsPassthrough bool   `json:"tls_passthrough,omitempty"`
}

ForwardingRule represents load balancer forwarding rules.

func (ForwardingRule) String added in v1.0.0

func (f ForwardingRule) String() string

String creates a human-readable description of a ForwardingRule.

type FunctionInputSchema added in v1.158.0

type FunctionInputSchema struct {
	Parameters []OpenAPIParameterSchema `json:"parameters" validate:"required,min=1,dive"`
}

type FunctionRouteCreateRequest added in v1.158.0

type FunctionRouteCreateRequest struct {
	AgentUuid     string              `json:"agent_uuid,omitempty"`
	Description   string              `json:"description,omitempty"`
	FaasName      string              `json:"faas_name,omitempty"`
	FaasNamespace string              `json:"faas_namespace,omitempty"`
	FunctionName  string              `json:"function_name,omitempty"`
	InputSchema   FunctionInputSchema `json:"input_schema,omitempty"`
	OutputSchema  json.RawMessage     `json:"output_schema,omitempty"`
}

type FunctionRouteUpdateRequest added in v1.158.0

type FunctionRouteUpdateRequest struct {
	AgentUuid     string              `json:"agent_uuid,omitempty"`
	Description   string              `json:"description,omitempty"`
	FaasName      string              `json:"faas_name,omitempty"`
	FaasNamespace string              `json:"faas_namespace,omitempty"`
	FunctionName  string              `json:"function_name,omitempty"`
	FunctionUuid  string              `json:"function_uuid,omitempty"`
	InputSchema   FunctionInputSchema `json:"input_schema,omitempty"`
	OutputSchema  json.RawMessage     `json:"output_schema,omitempty"`
}

type FunctionsAccessKey added in v1.182.0

type FunctionsAccessKey struct {
	ID         string    `json:"id,omitempty"`
	Name       string    `json:"name,omitempty"`
	Secret     string    `json:"secret,omitempty"`
	ExpiresAt  time.Time `json:"expires_at,omitempty"`
	CreatedAt  time.Time `json:"created_at,omitempty"`
	UpdatedAt  time.Time `json:"updated_at,omitempty"`
	LastUsedAt time.Time `json:"last_used_at,omitempty"`
}

type FunctionsAccessKeyCreateRequest added in v1.182.0

type FunctionsAccessKeyCreateRequest struct {
	Name      string `json:"name"`
	ExpiresIn string `json:"expires_in,omitempty"`
}

type FunctionsAccessKeyUpdateRequest added in v1.182.0

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

type FunctionsComponentHealth added in v1.156.0

type FunctionsComponentHealth struct {
	Name                            string                             `json:"name,omitempty"`
	FunctionsComponentHealthMetrics []*FunctionsComponentHealthMetrics `json:"functions_component_health_metrics,omitempty"`
}

FunctionsComponentHealth struct for FunctionsComponentHealth

func (*FunctionsComponentHealth) GetFunctionsComponentHealthMetrics added in v1.165.1

func (f *FunctionsComponentHealth) GetFunctionsComponentHealthMetrics() []*FunctionsComponentHealthMetrics

GetFunctionsComponentHealthMetrics returns the FunctionsComponentHealthMetrics field.

func (*FunctionsComponentHealth) GetName added in v1.165.1

func (f *FunctionsComponentHealth) GetName() string

GetName returns the Name field.

type FunctionsComponentHealthMetrics added in v1.156.0

type FunctionsComponentHealthMetrics struct {
	MetricLabel string  `json:"metric_label,omitempty"`
	MetricValue float64 `json:"metric_value,omitempty"`
	TimeWindow  string  `json:"time_window,omitempty"`
}

FunctionsComponentHealthMetrics struct for FunctionsComponentHealthMetrics

func (*FunctionsComponentHealthMetrics) GetMetricLabel added in v1.165.1

func (f *FunctionsComponentHealthMetrics) GetMetricLabel() string

GetMetricLabel returns the MetricLabel field.

func (*FunctionsComponentHealthMetrics) GetMetricValue added in v1.165.1

func (f *FunctionsComponentHealthMetrics) GetMetricValue() float64

GetMetricValue returns the MetricValue field.

func (*FunctionsComponentHealthMetrics) GetTimeWindow added in v1.165.1

func (f *FunctionsComponentHealthMetrics) GetTimeWindow() string

GetTimeWindow returns the TimeWindow field.

type FunctionsNamespace added in v1.90.0

type FunctionsNamespace struct {
	ApiHost   string    `json:"api_host,omitempty"`
	Namespace string    `json:"namespace,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	Label     string    `json:"label,omitempty"`
	Region    string    `json:"region,omitempty"`
	UUID      string    `json:"uuid,omitempty"`
	Key       string    `json:"key,omitempty"`
}

type FunctionsNamespaceCreateRequest added in v1.90.0

type FunctionsNamespaceCreateRequest struct {
	Label  string `json:"label"`
	Region string `json:"region"`
}

type FunctionsServiceOp added in v1.90.0

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

func (*FunctionsServiceOp) CreateAccessKey added in v1.182.0

CreateAccessKey creates an access key for a namespace

func (*FunctionsServiceOp) CreateNamespace added in v1.90.0

Creates a namespace

func (*FunctionsServiceOp) CreateTrigger added in v1.92.0

CreateTrigger creates a trigger

func (*FunctionsServiceOp) DeleteAccessKey added in v1.182.0

func (s *FunctionsServiceOp) DeleteAccessKey(ctx context.Context, namespace string, keyID string) (*Response, error)

DeleteAccessKey deletes an access key for a namespace

func (*FunctionsServiceOp) DeleteNamespace added in v1.90.0

func (s *FunctionsServiceOp) DeleteNamespace(ctx context.Context, namespace string) (*Response, error)

Delete a namespace

func (*FunctionsServiceOp) DeleteTrigger added in v1.92.0

func (s *FunctionsServiceOp) DeleteTrigger(ctx context.Context, namespace string, trigger string) (*Response, error)

DeleteTrigger deletes a trigger

func (*FunctionsServiceOp) GetNamespace added in v1.90.0

func (s *FunctionsServiceOp) GetNamespace(ctx context.Context, namespace string) (*FunctionsNamespace, *Response, error)

Gets a single namespace

func (*FunctionsServiceOp) GetTrigger added in v1.92.0

func (s *FunctionsServiceOp) GetTrigger(ctx context.Context, namespace string, trigger string) (*FunctionsTrigger, *Response, error)

GetTrigger gets a single trigger

func (*FunctionsServiceOp) ListAccessKeys added in v1.182.0

func (s *FunctionsServiceOp) ListAccessKeys(ctx context.Context, namespace string) ([]FunctionsAccessKey, *Response, error)

ListAccessKeys lists access keys for a namespace

func (*FunctionsServiceOp) ListNamespaces added in v1.90.0

func (s *FunctionsServiceOp) ListNamespaces(ctx context.Context) ([]FunctionsNamespace, *Response, error)

Gets a list of namespaces

func (*FunctionsServiceOp) ListTriggers added in v1.92.0

func (s *FunctionsServiceOp) ListTriggers(ctx context.Context, namespace string) ([]FunctionsTrigger, *Response, error)

ListTriggers gets a list of triggers

func (*FunctionsServiceOp) UpdateAccessKey added in v1.182.0

func (s *FunctionsServiceOp) UpdateAccessKey(ctx context.Context, namespace string, keyID string, opts *FunctionsAccessKeyUpdateRequest) (*FunctionsAccessKey, *Response, error)

UpdateAccessKey updates an access key for a namespace

func (*FunctionsServiceOp) UpdateTrigger added in v1.92.0

func (s *FunctionsServiceOp) UpdateTrigger(ctx context.Context, namespace string, trigger string, opts *FunctionsTriggerUpdateRequest) (*FunctionsTrigger, *Response, error)

UpdateTrigger updates a trigger

type FunctionsTrigger added in v1.92.0

type FunctionsTrigger struct {
	Namespace        string                   `json:"namespace,omitempty"`
	Function         string                   `json:"function,omitempty"`
	Type             string                   `json:"type,omitempty"`
	Name             string                   `json:"name,omitempty"`
	IsEnabled        bool                     `json:"is_enabled"`
	CreatedAt        time.Time                `json:"created_at,omitempty"`
	UpdatedAt        time.Time                `json:"updated_at,omitempty"`
	ScheduledDetails *TriggerScheduledDetails `json:"scheduled_details,omitempty"`
	ScheduledRuns    *TriggerScheduledRuns    `json:"scheduled_runs,omitempty"`
}

type FunctionsTriggerCreateRequest added in v1.92.0

type FunctionsTriggerCreateRequest struct {
	Name             string                   `json:"name"`
	Type             string                   `json:"type"`
	Function         string                   `json:"function"`
	IsEnabled        bool                     `json:"is_enabled"`
	ScheduledDetails *TriggerScheduledDetails `json:"scheduled_details,omitempty"`
}

type FunctionsTriggerUpdateRequest added in v1.92.0

type FunctionsTriggerUpdateRequest struct {
	IsEnabled        *bool                    `json:"is_enabled,omitempty"`
	ScheduledDetails *TriggerScheduledDetails `json:"scheduled_details,omitempty"`
}

type GLBSettings added in v1.111.0

type GLBSettings struct {
	// TargetProtocol is the outgoing traffic protocol.
	TargetProtocol string `json:"target_protocol"`
	// EntryPort is the outgoing traffic port.
	TargetPort uint32 `json:"target_port"`
	// CDNSettings is the CDN configurations
	CDN *CDNSettings `json:"cdn"`
	// RegionPriorities embeds regional priority information for regional active-passive failover policy
	RegionPriorities map[string]uint32 `json:"region_priorities,omitempty"`
	// FailoverThreshold embeds failover threshold percentage for regional active-passive failover policy
	FailoverThreshold uint32 `json:"failover_threshold,omitempty"`
}

GLBSettings define settings for configuring a Global LB

func (GLBSettings) String added in v1.111.0

func (s GLBSettings) String() string

String creates a human-readable description of a GLBSettings

type GPUInfo added in v1.129.0

type GPUInfo struct {
	Count int    `json:"count,omitempty"`
	VRAM  *VRAM  `json:"vram,omitempty"`
	Model string `json:"model,omitempty"`
	// SupportedPartitionModes lists the GPU partition modes available for this
	// size. It is only returned to callers with access to the feature, so an
	// empty/absent value means the partition-mode picker should be hidden.
	SupportedPartitionModes []string `json:"supported_partition_modes,omitempty"`
}

GPUInfo provides information about the GPU available to Droplets created with this size.

type GarbageCollection added in v1.50.0

type GarbageCollection struct {
	UUID         string                `json:"uuid"`
	RegistryName string                `json:"registry_name"`
	Status       string                `json:"status"`
	Type         GarbageCollectionType `json:"type"`
	CreatedAt    time.Time             `json:"created_at"`
	UpdatedAt    time.Time             `json:"updated_at"`
	BlobsDeleted uint64                `json:"blobs_deleted"`
	FreedBytes   uint64                `json:"freed_bytes"`
}

GarbageCollection represents a garbage collection.

type GarbageCollectionType added in v1.54.0

type GarbageCollectionType string

type GenAISortDirection added in v1.206.0

type GenAISortDirection string

GenAISortDirection is the sort direction used by GenAI list endpoints.

const (
	GenAISortDirectionUnspecified GenAISortDirection = "SORT_DIRECTION_UNSPECIFIED"
	GenAISortDirectionAsc         GenAISortDirection = "SORT_DIRECTION_ASC"
	GenAISortDirectionDesc        GenAISortDirection = "SORT_DIRECTION_DESC"
)

type GenerateScenarioSetRequest added in v1.206.0

type GenerateScenarioSetRequest struct {
	Name               string `json:"name,omitempty"`
	GoalDescription    string `json:"goal_description,omitempty"`
	NumScenarios       uint32 `json:"num_scenarios,omitempty"`
	GeneratorModelUUID string `json:"generator_model_uuid,omitempty"`
}

GenerateScenarioSetRequest dispatches goal-driven scenario generation.

type GeneratedImage added in v1.191.0

type GeneratedImage struct {
	B64JSON       string `json:"b64_json"`
	RevisedPrompt string `json:"revised_prompt,omitempty"`
}

GeneratedImage is a single image entry returned by an image generation call.

type GetAppDatabaseConnectionDetailsResponse added in v1.109.0

type GetAppDatabaseConnectionDetailsResponse struct {
	ConnectionDetails []*GetDatabaseConnectionDetailsResponse `json:"connection_details,omitempty"`
}

GetAppDatabaseConnectionDetailsResponse struct for GetAppDatabaseConnectionDetailsResponse

func (*GetAppDatabaseConnectionDetailsResponse) GetConnectionDetails added in v1.109.0

GetConnectionDetails returns the ConnectionDetails field.

type GetAppHealthResponse added in v1.156.0

type GetAppHealthResponse struct {
	AppHealth *AppHealth `json:"app_health,omitempty"`
}

GetAppHealthResponse struct for GetAppHealthResponse

func (*GetAppHealthResponse) GetAppHealth added in v1.165.1

func (g *GetAppHealthResponse) GetAppHealth() *AppHealth

GetAppHealth returns the AppHealth field.

type GetAppInstancesOpts added in v1.147.0

type GetAppInstancesOpts struct {
}

type GetAppInstancesResponse added in v1.147.0

type GetAppInstancesResponse struct {
	Instances []*AppInstance `json:"instances,omitempty"`
}

GetAppInstancesResponse struct for GetAppInstancesResponse

func (*GetAppInstancesResponse) GetInstances added in v1.151.0

func (g *GetAppInstancesResponse) GetInstances() []*AppInstance

GetInstances returns the Instances field.

type GetDatabaseConnectionDetailsResponse added in v1.109.0

type GetDatabaseConnectionDetailsResponse struct {
	Host          string                                      `json:"host,omitempty"`
	Port          int64                                       `json:"port,omitempty"`
	Username      string                                      `json:"username,omitempty"`
	Password      string                                      `json:"password,omitempty"`
	DatabaseName  string                                      `json:"database_name,omitempty"`
	SslMode       string                                      `json:"ssl_mode,omitempty"`
	DatabaseURL   string                                      `json:"database_url,omitempty"`
	ComponentName string                                      `json:"component_name,omitempty"`
	Pools         []*GetDatabaseConnectionDetailsResponsePool `json:"pools,omitempty"`
}

GetDatabaseConnectionDetailsResponse struct for GetDatabaseConnectionDetailsResponse

func (*GetDatabaseConnectionDetailsResponse) GetComponentName added in v1.109.0

func (g *GetDatabaseConnectionDetailsResponse) GetComponentName() string

GetComponentName returns the ComponentName field.

func (*GetDatabaseConnectionDetailsResponse) GetDatabaseName added in v1.109.0

func (g *GetDatabaseConnectionDetailsResponse) GetDatabaseName() string

GetDatabaseName returns the DatabaseName field.

func (*GetDatabaseConnectionDetailsResponse) GetDatabaseURL added in v1.109.0

func (g *GetDatabaseConnectionDetailsResponse) GetDatabaseURL() string

GetDatabaseURL returns the DatabaseURL field.

func (*GetDatabaseConnectionDetailsResponse) GetHost added in v1.109.0

GetHost returns the Host field.

func (*GetDatabaseConnectionDetailsResponse) GetPassword added in v1.109.0

GetPassword returns the Password field.

func (*GetDatabaseConnectionDetailsResponse) GetPools added in v1.109.0

GetPools returns the Pools field.

func (*GetDatabaseConnectionDetailsResponse) GetPort added in v1.109.0

GetPort returns the Port field.

func (*GetDatabaseConnectionDetailsResponse) GetSslMode added in v1.109.0

GetSslMode returns the SslMode field.

func (*GetDatabaseConnectionDetailsResponse) GetUsername added in v1.109.0

GetUsername returns the Username field.

type GetDatabaseConnectionDetailsResponsePool added in v1.109.0

type GetDatabaseConnectionDetailsResponsePool struct {
	PoolName     string `json:"pool_name,omitempty"`
	Host         string `json:"host,omitempty"`
	Port         int64  `json:"port,omitempty"`
	Username     string `json:"username,omitempty"`
	Password     string `json:"password,omitempty"`
	DatabaseName string `json:"database_name,omitempty"`
	SslMode      string `json:"ssl_mode,omitempty"`
	DatabaseURL  string `json:"database_url,omitempty"`
}

GetDatabaseConnectionDetailsResponsePool struct for GetDatabaseConnectionDetailsResponsePool

func (*GetDatabaseConnectionDetailsResponsePool) GetDatabaseName added in v1.109.0

func (g *GetDatabaseConnectionDetailsResponsePool) GetDatabaseName() string

GetDatabaseName returns the DatabaseName field.

func (*GetDatabaseConnectionDetailsResponsePool) GetDatabaseURL added in v1.109.0

GetDatabaseURL returns the DatabaseURL field.

func (*GetDatabaseConnectionDetailsResponsePool) GetHost added in v1.109.0

GetHost returns the Host field.

func (*GetDatabaseConnectionDetailsResponsePool) GetPassword added in v1.109.0

GetPassword returns the Password field.

func (*GetDatabaseConnectionDetailsResponsePool) GetPoolName added in v1.109.0

GetPoolName returns the PoolName field.

func (*GetDatabaseConnectionDetailsResponsePool) GetPort added in v1.109.0

GetPort returns the Port field.

func (*GetDatabaseConnectionDetailsResponsePool) GetSslMode added in v1.109.0

GetSslMode returns the SslMode field.

func (*GetDatabaseConnectionDetailsResponsePool) GetUsername added in v1.109.0

GetUsername returns the Username field.

type GetDatabaseTrustedSourceResponse added in v1.109.0

type GetDatabaseTrustedSourceResponse struct {
	IsEnabled bool `json:"is_enabled,omitempty"`
}

GetDatabaseTrustedSourceResponse struct for GetDatabaseTrustedSourceResponse

func (*GetDatabaseTrustedSourceResponse) GetIsEnabled added in v1.109.0

func (g *GetDatabaseTrustedSourceResponse) GetIsEnabled() bool

GetIsEnabled returns the IsEnabled field.

type GetEventLogsOptions added in v1.177.0

type GetEventLogsOptions struct {
	Follow    bool
	TailLines int
}

GetEventLogsOptions specifies the optional parameters to the GetEventLogs method.

type GetJobInvocationLogsOptions added in v1.165.1

type GetJobInvocationLogsOptions struct {
	// JobName is the name of the job to retrieve logs for.
	JobName string
	// Follow indicates whether to stream the logs.
	Follow bool
	// TailLines is the number of lines from the end of the logs to retrieve.
	TailLines int
}

type GetJobInvocationOptions added in v1.165.1

type GetJobInvocationOptions struct {
	JobName string `url:"job_name,omitempty"`
}

type GetJobInvocationResponse added in v1.165.1

type GetJobInvocationResponse struct {
	JobInvocation *JobInvocation `json:"job_invocation,omitempty"`
}

GetJobInvocationResponse struct for GetJobInvocationResponse

func (*GetJobInvocationResponse) GetJobInvocation added in v1.165.1

func (g *GetJobInvocationResponse) GetJobInvocation() *JobInvocation

GetJobInvocation returns the JobInvocation field.

type GitHubSourceSpec added in v1.39.0

type GitHubSourceSpec struct {
	Repo         string `json:"repo,omitempty"`
	Branch       string `json:"branch,omitempty"`
	DeployOnPush bool   `json:"deploy_on_push,omitempty"`
}

GitHubSourceSpec struct for GitHubSourceSpec

func (*GitHubSourceSpec) GetBranch added in v1.85.0

func (g *GitHubSourceSpec) GetBranch() string

GetBranch returns the Branch field.

func (*GitHubSourceSpec) GetDeployOnPush added in v1.85.0

func (g *GitHubSourceSpec) GetDeployOnPush() bool

GetDeployOnPush returns the DeployOnPush field.

func (*GitHubSourceSpec) GetRepo added in v1.85.0

func (g *GitHubSourceSpec) GetRepo() string

GetRepo returns the Repo field.

func (*GitHubSourceSpec) GetType added in v1.85.0

func (s *GitHubSourceSpec) GetType() AppSourceType

GetType returns the GitHub source type.

type GitLabSourceSpec added in v1.57.0

type GitLabSourceSpec struct {
	Repo         string `json:"repo,omitempty"`
	Branch       string `json:"branch,omitempty"`
	DeployOnPush bool   `json:"deploy_on_push,omitempty"`
}

GitLabSourceSpec struct for GitLabSourceSpec

func (*GitLabSourceSpec) GetBranch added in v1.85.0

func (g *GitLabSourceSpec) GetBranch() string

GetBranch returns the Branch field.

func (*GitLabSourceSpec) GetDeployOnPush added in v1.85.0

func (g *GitLabSourceSpec) GetDeployOnPush() bool

GetDeployOnPush returns the DeployOnPush field.

func (*GitLabSourceSpec) GetRepo added in v1.85.0

func (g *GitLabSourceSpec) GetRepo() string

GetRepo returns the Repo field.

func (*GitLabSourceSpec) GetType added in v1.85.0

func (s *GitLabSourceSpec) GetType() AppSourceType

GetType returns the GitLab source type.

type GitSourceSpec added in v1.39.0

type GitSourceSpec struct {
	RepoCloneURL string `json:"repo_clone_url,omitempty"`
	Branch       string `json:"branch,omitempty"`
}

GitSourceSpec struct for GitSourceSpec

func (*GitSourceSpec) GetBranch added in v1.85.0

func (g *GitSourceSpec) GetBranch() string

GetBranch returns the Branch field.

func (*GitSourceSpec) GetRepo added in v1.85.0

func (s *GitSourceSpec) GetRepo() string

GetRepo allows GitSourceSpec to implement the SourceSpec interface.

func (*GitSourceSpec) GetRepoCloneURL added in v1.85.0

func (g *GitSourceSpec) GetRepoCloneURL() string

GetRepoCloneURL returns the RepoCloneURL field.

func (*GitSourceSpec) GetType added in v1.85.0

func (s *GitSourceSpec) GetType() AppSourceType

GetType returns the Git source type.

type Grant added in v1.134.0

type Grant struct {
	Bucket     string              `json:"bucket"`
	Permission SpacesKeyPermission `json:"permission"`
}

Grant represents a Grant for a Spaces key

type HealthCheck added in v1.0.0

type HealthCheck struct {
	Protocol               string `json:"protocol,omitempty"`
	Port                   int    `json:"port,omitempty"`
	Path                   string `json:"path,omitempty"`
	CheckIntervalSeconds   int    `json:"check_interval_seconds,omitempty"`
	ResponseTimeoutSeconds int    `json:"response_timeout_seconds,omitempty"`
	HealthyThreshold       int    `json:"healthy_threshold,omitempty"`
	UnhealthyThreshold     int    `json:"unhealthy_threshold,omitempty"`
	ProxyProtocol          *bool  `json:"proxy_protocol,omitempty"`
}

HealthCheck represents optional load balancer health check rules.

func (HealthCheck) String added in v1.0.0

func (h HealthCheck) String() string

String creates a human-readable description of a HealthCheck.

type HealthCheckSpec added in v1.146.0

type HealthCheckSpec struct {
	// The number of seconds to wait before beginning health checks. Default: 5 seconds, Minimum 0, Maximum 3600.
	InitialDelaySeconds int32 `json:"initial_delay_seconds,omitempty"`
	// The number of seconds to wait between health checks. Default: 10 seconds, Minimum 1, Maximum 300.
	PeriodSeconds int32 `json:"period_seconds,omitempty"`
	// The number of seconds after which the check times out. Default: 1 second, Minimum 1, Maximum 120.
	TimeoutSeconds int32 `json:"timeout_seconds,omitempty"`
	// The number of successful health checks before considered healthy. Default: 1, Minimum 1, Maximum 50. When used in liveness_health_check, Default: 1, Minimum 1, Maximum 1.
	SuccessThreshold int32 `json:"success_threshold,omitempty"`
	// The number of failed health checks before considered unhealthy. Default: 9, Minimum 1, Maximum 50. When used in liveness_health_check, Default: 18, Minimum 1, Maximum 50.
	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.
	Port int64 `json:"port,omitempty"`
}

HealthCheckSpec struct for HealthCheckSpec

func (*HealthCheckSpec) GetFailureThreshold added in v1.165.1

func (h *HealthCheckSpec) GetFailureThreshold() int32

GetFailureThreshold returns the FailureThreshold field.

func (*HealthCheckSpec) GetHTTPPath added in v1.165.1

func (h *HealthCheckSpec) GetHTTPPath() string

GetHTTPPath returns the HTTPPath field.

func (*HealthCheckSpec) GetInitialDelaySeconds added in v1.165.1

func (h *HealthCheckSpec) GetInitialDelaySeconds() int32

GetInitialDelaySeconds returns the InitialDelaySeconds field.

func (*HealthCheckSpec) GetPeriodSeconds added in v1.165.1

func (h *HealthCheckSpec) GetPeriodSeconds() int32

GetPeriodSeconds returns the PeriodSeconds field.

func (*HealthCheckSpec) GetPort added in v1.165.1

func (h *HealthCheckSpec) GetPort() int64

GetPort returns the Port field.

func (*HealthCheckSpec) GetSuccessThreshold added in v1.165.1

func (h *HealthCheckSpec) GetSuccessThreshold() int32

GetSuccessThreshold returns the SuccessThreshold field.

func (*HealthCheckSpec) GetTimeoutSeconds added in v1.165.1

func (h *HealthCheckSpec) GetTimeoutSeconds() int32

GetTimeoutSeconds returns the TimeoutSeconds field.

type HostedAgentCheckpoint added in v1.211.0

type HostedAgentCheckpoint struct {
	CheckpointID string                      `json:"checkpoint_id"`
	SessionID    string                      `json:"session_id"`
	Status       HostedAgentCheckpointStatus `json:"status"`
	Kind         HostedAgentCheckpointKind   `json:"kind"`
	Label        string                      `json:"label,omitempty"`
	EventID      string                      `json:"event_id,omitempty"`
	SizeBytes    uint64                      `json:"size_bytes,omitempty"`
	CreatedAt    Timestamp                   `json:"created_at"`
	ErrorMessage string                      `json:"error_message,omitempty"`
}

HostedAgentCheckpoint is an immutable save point of a session's microVM (files + live process memory) plus an event-log cursor.

type HostedAgentCheckpointCreateRequest added in v1.211.0

type HostedAgentCheckpointCreateRequest struct {
	Label string `json:"label,omitempty"`
}

HostedAgentCheckpointCreateRequest is the optional body for CreateCheckpoint.

type HostedAgentCheckpointDeleteResponse added in v1.211.0

type HostedAgentCheckpointDeleteResponse struct {
	CheckpointID string `json:"checkpoint_id"`
	Deleted      bool   `json:"deleted"`
}

HostedAgentCheckpointDeleteResponse is returned by DeleteCheckpoint.

type HostedAgentCheckpointKind added in v1.211.0

type HostedAgentCheckpointKind string

HostedAgentCheckpointKind distinguishes user-requested vs automatic checkpoints.

const (
	HostedAgentCheckpointKindExplicit HostedAgentCheckpointKind = "explicit"
	HostedAgentCheckpointKindImplicit HostedAgentCheckpointKind = "implicit"
)

type HostedAgentCheckpointListOptions added in v1.211.0

type HostedAgentCheckpointListOptions struct {
	PageToken string `url:"page_token,omitempty"`
	PageSize  int    `url:"page_size,omitempty"`
}

HostedAgentCheckpointListOptions paginates ListCheckpoints (newest-first).

type HostedAgentCheckpointStatus added in v1.211.0

type HostedAgentCheckpointStatus string

HostedAgentCheckpointStatus is the lifecycle status of a session checkpoint.

const (
	HostedAgentCheckpointStatusPending HostedAgentCheckpointStatus = "PENDING"
	HostedAgentCheckpointStatusReady   HostedAgentCheckpointStatus = "READY"
	HostedAgentCheckpointStatusFailed  HostedAgentCheckpointStatus = "FAILED"
)

type HostedAgentCheckpointsListResponse added in v1.211.0

type HostedAgentCheckpointsListResponse struct {
	Checkpoints   []HostedAgentCheckpoint `json:"checkpoints"`
	NextPageToken string                  `json:"next_page_token"`
}

HostedAgentCheckpointsListResponse is returned by ListCheckpoints.

type HostedAgentConfig added in v1.211.0

type HostedAgentConfig struct {
	ID                     string                            `json:"id"`
	Name                   string                            `json:"name"`
	AgentSpecSchemaVersion string                            `json:"agentspec_schema_version"`
	Manifest               json.RawMessage                   `json:"manifest"`
	ContentHash            string                            `json:"content_hash"`
	CreatedBy              string                            `json:"created_by"`
	CreatedAt              Timestamp                         `json:"created_at"`
	UpdatedAt              Timestamp                         `json:"updated_at"`
	Credentials            []HostedAgentConfigCredentialSlot `json:"credentials,omitempty"`
	// Warnings carries non-fatal create-time advisories computed from the
	// manifest. It is populated on the create response only.
	Warnings []string `json:"warnings,omitempty"`
}

HostedAgentConfig is an immutable team-scoped environment definition (product name: Environment; historically called Agent Config). Prefer HostedEnvironment; this name remains for compatibility.

type HostedAgentConfigCreateRequest added in v1.211.0

type HostedAgentConfigCreateRequest struct {
	Name         string `json:"name"`
	ManifestYAML string `json:"manifest_yaml"`
}

HostedAgentConfigCreateRequest is the body for POST /v2/agents/configs. Credentials are not request fields: every secret is declared in the manifest under secrets (Environment Spec) or the legacy agents.yaml shape, and a tenantSecret slot carries its plaintext in a write-only value that is extracted server-side and never persisted or returned. Sending the retired secrets or oauth_assignments maps is rejected with a 400. Prefer HostedEnvironmentCreateRequest; this name remains for compatibility.

type HostedAgentConfigCredentialSlot added in v1.211.0

type HostedAgentConfigCredentialSlot struct {
	Name     string `json:"name"`
	Source   string `json:"source,omitempty"`
	Provider string `json:"provider,omitempty"`
}

HostedAgentConfigCredentialSlot is redacted credential metadata on GET/create. It echoes only the manifest's declaration for the slot; secret values are never returned. Whether a slot is fulfilled is implied by Source: a tenantSecret is always stored at create, and an oauth slot is a declaration only until oauth brokering is implemented.

Prefer HostedEnvironmentCredentialSlot; this name remains for compatibility.

type HostedAgentConfigListOptions added in v1.211.0

type HostedAgentConfigListOptions struct {
	PageToken string `url:"page_token,omitempty"`
	PageSize  int    `url:"page_size,omitempty"`
}

HostedAgentConfigListOptions specifies optional list pagination. Prefer HostedEnvironmentListOptions; this name remains for compatibility.

type HostedAgentConfigSummary added in v1.211.0

type HostedAgentConfigSummary struct {
	ID                     string    `json:"id"`
	Name                   string    `json:"name"`
	AgentSpecSchemaVersion string    `json:"agentspec_schema_version"`
	ContentHash            string    `json:"content_hash"`
	CreatedBy              string    `json:"created_by"`
	CreatedAt              Timestamp `json:"created_at"`
	UpdatedAt              Timestamp `json:"updated_at"`
}

HostedAgentConfigSummary is the list view (no manifest / credentials). Prefer HostedEnvironmentSummary; this name remains for compatibility.

type HostedAgentConfigsListResponse added in v1.211.0

type HostedAgentConfigsListResponse struct {
	Configs       []HostedAgentConfigSummary `json:"configs"`
	NextPageToken string                     `json:"next_page_token"`
}

HostedAgentConfigsListResponse is returned by GET /v2/agents/configs. The JSON field remains "configs" on the wire. Prefer HostedEnvironmentsListResponse; this name remains for compatibility.

type HostedAgentConnection added in v1.219.0

type HostedAgentConnection struct {
	ID                  string                      `json:"id"`
	Provider            string                      `json:"provider"`
	ProviderDisplayName string                      `json:"provider_display_name,omitempty"`
	ActorID             string                      `json:"user_id"`
	Status              string                      `json:"status"`
	OwningUserID        string                      `json:"owning_user_id,omitempty"`
	CreatedAt           *Timestamp                  `json:"created_at,omitempty"`
	UpdatedAt           *Timestamp                  `json:"updated_at,omitempty"`
	OAuth               *HostedAgentConnectionOAuth `json:"oauth,omitempty"`
}

HostedAgentConnection is one external-provider connection as published by harness-api's connection-management proxy. ActorID (user_id on the wire) is the actor identifier a manifest's secret `actor:` binds to — not a DO user id. OwningUserID is the DO user that created the connection. No token or authorization handle is ever exposed on this surface.

type HostedAgentConnectionAuthorization added in v1.219.0

type HostedAgentConnectionAuthorization struct {
	Status           string     `json:"status,omitempty"`
	ConnectURL       string     `json:"connect_url,omitempty"`
	VerificationCode string     `json:"verification_code,omitempty"`
	ExpiresAt        *Timestamp `json:"expires_at,omitempty"`
}

HostedAgentConnectionAuthorization is the interactive step a still-pending connection needs. Omitted once the connection is active.

type HostedAgentConnectionCreateRequest added in v1.219.0

type HostedAgentConnectionCreateRequest struct {
	ActorID string   `json:"user_id"`
	Scopes  []string `json:"scopes,omitempty"`
}

HostedAgentConnectionCreateRequest is the body for POST .../connections. ActorID (user_id on the wire) names the actor the connection acts for and is required. Scopes is optional; omitted requests the provider's full configured scope set.

type HostedAgentConnectionEnvelope added in v1.219.0

type HostedAgentConnectionEnvelope struct {
	Connection    HostedAgentConnection               `json:"connection"`
	Authorization *HostedAgentConnectionAuthorization `json:"authorization,omitempty"`
}

HostedAgentConnectionEnvelope is a single connection plus any authorization still outstanding — the shape CreateConnection, GetConnection, and DeleteConnection all return.

type HostedAgentConnectionListOptions added in v1.219.0

type HostedAgentConnectionListOptions struct {
	ActorID string `url:"user_id,omitempty"`
	Status  string `url:"status,omitempty"`
	Page    int    `url:"page,omitempty"`
	PerPage int    `url:"per_page,omitempty"`
}

HostedAgentConnectionListOptions specifies optional connection list filters. ActorID filters to a single actor (user_id on the wire); Status filters by connection status. Page/PerPage are forwarded to tool-registry, which defaults to 20 per page and caps at 100.

type HostedAgentConnectionOAuth added in v1.219.0

type HostedAgentConnectionOAuth struct {
	Scopes    []string   `json:"scopes"`
	GrantedAt *Timestamp `json:"granted_at,omitempty"`
}

HostedAgentConnectionOAuth carries a connection's granted OAuth detail. Absent on connections that hold no OAuth grant (e.g. API-key connections).

type HostedAgentConnectionPagination added in v1.219.0

type HostedAgentConnectionPagination struct {
	Page    int32 `json:"page"`
	PerPage int32 `json:"per_page"`
	Total   int32 `json:"total"`
}

HostedAgentConnectionPagination is the page descriptor for a connection list.

type HostedAgentConnectionsListResponse added in v1.219.0

type HostedAgentConnectionsListResponse struct {
	Connections []HostedAgentConnection         `json:"connections"`
	Pagination  HostedAgentConnectionPagination `json:"pagination"`
}

HostedAgentConnectionsListResponse is one page of connections.

type HostedAgentCreateCronConfig added in v1.211.0

type HostedAgentCreateCronConfig struct {
	CronExpr string `json:"cron_expr"`
	Timezone string `json:"timezone"`
}

HostedAgentCreateCronConfig is the cron block on create/update.

type HostedAgentCreateWebhookConfig added in v1.211.0

type HostedAgentCreateWebhookConfig struct {
	Provider HostedAgentWebhookProviderKey `json:"provider,omitempty"`
}

HostedAgentCreateWebhookConfig is the webhook block on create.

type HostedAgentCronConfig added in v1.211.0

type HostedAgentCronConfig struct {
	CronExpr  string    `json:"cron_expr,omitempty"`
	Timezone  string    `json:"timezone,omitempty"`
	NextRunAt Timestamp `json:"next_run_at,omitempty"`
}

HostedAgentCronConfig is present when kind=cron.

type HostedAgentEvent added in v1.211.0

type HostedAgentEvent struct {
	EventID   string
	SessionID string
	RunID     string
	Seq       uint64
	At        Timestamp
	Kind      HostedAgentEventKind
	Payload   json.RawMessage

	// SourceEventID is the native event id from the agent runtime before
	// canonical mapping (Event.source_event_id). Empty when the runtime does
	// not supply stable ids or the server does not forward it.
	SourceEventID string
	// SourceEventType is the native event type label from the agent runtime
	// (e.g. codex's "item/agentMessage/delta"). Empty when not forwarded.
	SourceEventType string
	// SourceRaw is the exact native event bytes the in-sandbox adapter
	// captured before canonical mapping (Event.source_raw) — for codex, one
	// JSON-RPC frame as read off the app-server transport. Only present when
	// the stream was opened with HostedAgentSessionStreamOptions.IncludeRaw
	// and the server retained the bytes; base64 on the wire (JSON []byte).
	SourceRaw []byte
}

HostedAgentEvent is one SSE payload from a session stream (see StreamSession).

The server serializes the SPI canonical event envelope, whose JSON shape differs from this struct's field names: the discriminator is `type` (not `kind`), the per-kind body is `data` (not `payload`), and the timestamp is `timestamp` (not `at`). UnmarshalJSON maps that wire shape onto these fields, so callers read Kind/Payload/At directly.

func (*HostedAgentEvent) UnmarshalJSON added in v1.211.0

func (e *HostedAgentEvent) UnmarshalJSON(b []byte) error

UnmarshalJSON decodes the SPI canonical event wire shape.

type HostedAgentEventKind added in v1.211.0

type HostedAgentEventKind string

HostedAgentEventKind is the SSE event discriminator for session stream payloads. The values are the canonical SPI event type names (dot-separated) emitted on the wire's `type` field — NOT proto enum names. They mirror the spi.EventType constants owned by the hosted-agents stack.

const (
	HostedAgentEventKindUnspecified          HostedAgentEventKind = ""
	HostedAgentEventKindRunStarted           HostedAgentEventKind = "run.started"
	HostedAgentEventKindTokenChunk           HostedAgentEventKind = "run.token_delta"
	HostedAgentEventKindToolCallStarted      HostedAgentEventKind = "run.tool_call_started"
	HostedAgentEventKindToolCallCompleted    HostedAgentEventKind = "run.tool_call_completed"
	HostedAgentEventKindHITLRequested        HostedAgentEventKind = "run.human_input_requested"
	HostedAgentEventKindHITLResolved         HostedAgentEventKind = "run.human_input_received"
	HostedAgentEventKindRunCompleted         HostedAgentEventKind = "run.completed"
	HostedAgentEventKindRunFailed            HostedAgentEventKind = "run.failed"
	HostedAgentEventKindRunPaused            HostedAgentEventKind = "run.paused"
	HostedAgentEventKindRunResumed           HostedAgentEventKind = "run.resumed"
	HostedAgentEventKindSessionUpdated       HostedAgentEventKind = "session.updated"
	HostedAgentEventKindRunStateCheckpointed HostedAgentEventKind = "run.state_checkpointed"
	HostedAgentEventKindRunHandoff           HostedAgentEventKind = "run.handoff"
	HostedAgentEventKindRunUsageRecorded     HostedAgentEventKind = "run.usage_recorded"
	HostedAgentEventKindRunSandboxAllocated  HostedAgentEventKind = "run.sandbox_allocated"
	HostedAgentEventKindRunSandboxReleased   HostedAgentEventKind = "run.sandbox_released"
	HostedAgentEventKindRunCostAccrued       HostedAgentEventKind = "run.cost_accrued"
	HostedAgentEventKindRunLog               HostedAgentEventKind = "run.log"

	// HostedAgentEventKindStreamState is a transport control frame, not an agent
	// event: it reports the health of the SSE connection itself. Only the
	// data-plane events endpoint emits it. It arrives in the same envelope as an
	// event, but only SessionID, At and Payload are meaningful — decode Payload
	// with HostedAgentStreamState. Renderers should skip it rather than display
	// it as session activity.
	HostedAgentEventKindStreamState HostedAgentEventKind = "stream.state"
)

type HostedAgentForkSessionRequest added in v1.211.0

type HostedAgentForkSessionRequest struct {
	FromCheckpointID string `json:"from_checkpoint_id,omitempty"`
	Count            int    `json:"count,omitempty"`
}

HostedAgentForkSessionRequest is the body for ForkSession. Count defaults to 1 when zero; the server rejects values above HostedAgentForkMaxCount.

type HostedAgentForkSessionResponse added in v1.211.0

type HostedAgentForkSessionResponse struct {
	Sessions []HostedAgentSession `json:"sessions"`
}

HostedAgentForkSessionResponse is returned by ForkSession.

type HostedAgentHITLActionKind added in v1.211.0

type HostedAgentHITLActionKind string

HostedAgentHITLActionKind classifies a human-in-the-loop approval request.

const (
	HostedAgentHITLActionUnspecified               HostedAgentHITLActionKind = "HITL_ACTION_KIND_UNSPECIFIED"
	HostedAgentHITLActionBash                      HostedAgentHITLActionKind = "HITL_ACTION_BASH"
	HostedAgentHITLActionFileWriteOutsideWorkspace HostedAgentHITLActionKind = "HITL_ACTION_FILE_WRITE_OUTSIDE_WORKSPACE"
	HostedAgentHITLActionGitHubCommitPush          HostedAgentHITLActionKind = "HITL_ACTION_GITHUB_COMMIT_PUSH"
	HostedAgentHITLActionGitHubCreatePR            HostedAgentHITLActionKind = "HITL_ACTION_GITHUB_CREATE_PR"
	HostedAgentHITLActionGitHubBranchDelete        HostedAgentHITLActionKind = "HITL_ACTION_GITHUB_BRANCH_DELETE"
	HostedAgentHITLActionGitHubForcePush           HostedAgentHITLActionKind = "HITL_ACTION_GITHUB_FORCE_PUSH"
)

type HostedAgentHITLDecision added in v1.211.0

type HostedAgentHITLDecision struct {
	RequestID string                 `json:"request_id"`
	Outcome   HostedAgentHITLOutcome `json:"outcome"`
	Actor     string                 `json:"actor,omitempty"`
	At        Timestamp              `json:"at"`
	Reason    string                 `json:"reason,omitempty"`
}

HostedAgentHITLDecision records a resolved HITL request.

type HostedAgentHITLOutcome added in v1.211.0

type HostedAgentHITLOutcome string

HostedAgentHITLOutcome is the user's decision on a HITL request.

const (
	HostedAgentHITLOutcomeUnspecified HostedAgentHITLOutcome = "HITL_OUTCOME_UNSPECIFIED"
	HostedAgentHITLOutcomeApprove     HostedAgentHITLOutcome = "HITL_OUTCOME_APPROVE"
	HostedAgentHITLOutcomeReject      HostedAgentHITLOutcome = "HITL_OUTCOME_REJECT"
	HostedAgentHITLOutcomeDefer       HostedAgentHITLOutcome = "HITL_OUTCOME_DEFER"
)

type HostedAgentHITLRequest added in v1.211.0

type HostedAgentHITLRequest struct {
	RequestID string                    `json:"request_id"`
	SessionID string                    `json:"session_id"`
	RunID     string                    `json:"run_id"`
	Action    HostedAgentHITLActionKind `json:"action"`
	Details   map[string]interface{}    `json:"details,omitempty"`
	Workdir   string                    `json:"workdir,omitempty"`
	Deadline  *Timestamp                `json:"deadline,omitempty"`
}

HostedAgentHITLRequest is a pending human-in-the-loop approval.

type HostedAgentKind added in v1.211.0

type HostedAgentKind string

HostedAgentKind identifies the agent runtime provisioned for a session.

const (
	HostedAgentKindUnspecified HostedAgentKind = "AGENT_KIND_UNSPECIFIED"
	HostedAgentKindClaudeCode  HostedAgentKind = "AGENT_KIND_CLAUDE_CODE"
	HostedAgentKindOpenCode    HostedAgentKind = "AGENT_KIND_OPENCODE"
	HostedAgentKindCodexCLI    HostedAgentKind = "AGENT_KIND_CODEX_CLI"
	HostedAgentKindCursorCLI   HostedAgentKind = "AGENT_KIND_CURSOR_CLI"
	// HostedAgentKindOpenAICodex is the OpenAI Agents API sandbox-provider kind
	// (adapter codex-agentapi). Attach bridges to OpenAI, not DO's SSE stream.
	HostedAgentKindOpenAICodex HostedAgentKind = "AGENT_KIND_OPENAI_CODEX"
	HostedAgentKindNone        HostedAgentKind = "AGENT_KIND_NONE"
	HostedAgentKindCustom      HostedAgentKind = "AGENT_KIND_CUSTOM"
)

type HostedAgentManifestCreateOptions added in v1.211.0

type HostedAgentManifestCreateOptions struct {
	OpenAISessionID string `url:"openai_session_id,omitempty"`
	// ResumeOnTopoff opts the new session in to automatic resumption when the
	// team's prepayment balance is restored after a low-balance pause. It is a
	// query parameter rather than an agents.yaml field because that document is
	// immutable and shared through Agent Configs, while spending consent has to
	// stay per-session. Omitted when false (the server default).
	ResumeOnTopoff bool `url:"resume_on_topoff,omitempty"`
}

HostedAgentManifestCreateOptions configures CreateSessionFromManifest. OpenAISessionID is sent as the openai_session_id query parameter (not in the YAML body). harness-api persists it for AGENT_KIND_OPENAI_CODEX attach correlation. See docs/design/openai-sandbox-provider.md.

A persistent workspace cannot be attached when creating from a manifest. To use one, save the manifest as an Environment and create the session with CreateSessionFromEnvironment (or CreateSessionFromConfig) and WorkspaceID.

type HostedAgentPolicyAction added in v1.211.0

type HostedAgentPolicyAction string

HostedAgentPolicyAction is a tool-permission disposition.

const (
	HostedAgentPolicyActionAllow HostedAgentPolicyAction = "allow"
	HostedAgentPolicyActionAsk   HostedAgentPolicyAction = "ask"
	HostedAgentPolicyActionDeny  HostedAgentPolicyAction = "deny"
)

type HostedAgentPolicyEnforcement added in v1.211.0

type HostedAgentPolicyEnforcement string

HostedAgentPolicyEnforcement controls how strictly a rule is enforced.

const (
	HostedAgentPolicyEnforcementStrict     HostedAgentPolicyEnforcement = "strict"
	HostedAgentPolicyEnforcementBestEffort HostedAgentPolicyEnforcement = "best-effort"
)

type HostedAgentPolicyResolvedRule added in v1.211.0

type HostedAgentPolicyResolvedRule struct {
	ID          string                       `json:"id,omitempty"`
	Tool        string                       `json:"tool,omitempty"`
	Match       map[string]string            `json:"match,omitempty"`
	Action      HostedAgentPolicyAction      `json:"action,omitempty"`
	Enforcement HostedAgentPolicyEnforcement `json:"enforcement,omitempty"`
}

HostedAgentPolicyResolvedRule is a rule after resolution, carrying a stable id for audit correlation.

type HostedAgentPolicyRuleVerdict added in v1.211.0

type HostedAgentPolicyRuleVerdict struct {
	Rule       HostedAgentPolicyResolvedRule `json:"rule,omitempty"`
	Verdict    HostedAgentPolicyVerdict      `json:"verdict,omitempty"`
	Rendered   HostedAgentPolicyAction       `json:"rendered,omitempty"`
	Reason     string                        `json:"reason,omitempty"`
	Suggestion string                        `json:"suggestion,omitempty"`
}

HostedAgentPolicyRuleVerdict pairs a resolved rule with its validation outcome.

type HostedAgentPolicyValidationResult added in v1.211.0

type HostedAgentPolicyValidationResult struct {
	Agent   string `json:"agent,omitempty"`
	Version string `json:"version,omitempty"`
	OK      bool   `json:"ok"`
	// DefaultAction is the catch-all disposition as shipped (after unverified
	// allow→ask downgrade). When DefaultActionVerdict is degraded, this remains
	// the shipped value; see DefaultActionRendered for what the agent enforces.
	DefaultAction HostedAgentPolicyAction `json:"defaultAction,omitempty"`
	// DefaultActionVerdict classifies how faithfully the agent can enforce the
	// catch-all defaultAction.
	DefaultActionVerdict HostedAgentPolicyVerdict `json:"defaultActionVerdict,omitempty"`
	// DefaultActionRendered is the disposition the agent will actually enforce
	// as the catch-all.
	DefaultActionRendered HostedAgentPolicyAction        `json:"defaultActionRendered,omitempty"`
	DefaultActionReason   string                         `json:"defaultActionReason,omitempty"`
	Verdicts              []HostedAgentPolicyRuleVerdict `json:"verdicts,omitempty"`
	// ActionGatewayReason is set when a do.actions tool/toolbelt reference failed
	// tool-registry's existence check.
	ActionGatewayReason string `json:"actionGatewayReason,omitempty"`
}

HostedAgentPolicyValidationResult is returned by ValidatePolicy. The same shape is persisted per session in session_policies.verdicts.

type HostedAgentPolicyVerdict added in v1.211.0

type HostedAgentPolicyVerdict string

HostedAgentPolicyVerdict is the validation outcome for one resolved rule.

const (
	HostedAgentPolicyVerdictExact       HostedAgentPolicyVerdict = "exact"
	HostedAgentPolicyVerdictDegraded    HostedAgentPolicyVerdict = "degraded"
	HostedAgentPolicyVerdictUnsupported HostedAgentPolicyVerdict = "unsupported"
	HostedAgentPolicyVerdictUnverified  HostedAgentPolicyVerdict = "unverified"
	HostedAgentPolicyVerdictDelegated   HostedAgentPolicyVerdict = "delegated"
)

type HostedAgentProviderAuthPoll added in v1.211.0

type HostedAgentProviderAuthPoll struct {
	Provider  string     `json:"provider"`
	Status    string     `json:"status"`
	ExpiresAt *Timestamp `json:"expires_at,omitempty"`
}

HostedAgentProviderAuthPoll is returned by GET /v2/agents/auth/{provider}/poll. It reports only whether authorization has completed ("pending" or "success"); no secret is returned.

type HostedAgentProviderAuthStart added in v1.211.0

type HostedAgentProviderAuthStart struct {
	Provider         string     `json:"provider"`
	Status           string     `json:"status"`
	ConnectURL       string     `json:"connect_url,omitempty"`
	PollURL          string     `json:"poll_url,omitempty"`
	VerificationCode string     `json:"verification_code,omitempty"`
	ExpiresAt        *Timestamp `json:"expires_at,omitempty"`
}

HostedAgentProviderAuthStart is returned by POST /v2/agents/auth/{provider}. Status is "pending" when the user must still authorize in a browser (ConnectURL/PollURL/VerificationCode are set), or "success" when the team is already connected (those fields are empty). It is a free-form connect-flow status, distinct from the HostedAgentProviderAuthState session field. The authorization handle is never exposed: tokens are exchanged server-side at session time.

type HostedAgentProviderAuthState added in v1.211.0

type HostedAgentProviderAuthState string

HostedAgentProviderAuthState tracks OAuth authorization for an external provider.

const (
	HostedAgentProviderAuthStateUnspecified HostedAgentProviderAuthState = "PROVIDER_AUTH_STATE_UNSPECIFIED"
	HostedAgentProviderAuthStateNone        HostedAgentProviderAuthState = "PROVIDER_AUTH_STATE_NONE"
	HostedAgentProviderAuthStatePending     HostedAgentProviderAuthState = "PROVIDER_AUTH_STATE_PENDING"
	HostedAgentProviderAuthStateAuthorized  HostedAgentProviderAuthState = "PROVIDER_AUTH_STATE_AUTHORIZED"
	HostedAgentProviderAuthStateExpired     HostedAgentProviderAuthState = "PROVIDER_AUTH_STATE_EXPIRED"
)

type HostedAgentRelayRequest added in v1.211.0

type HostedAgentRelayRequest struct {
	// SourceRaw is the caller's native protocol request frame — for codex, a
	// single JSON-RPC request object carrying the caller's own id. Named to
	// match SendInput's field: both mean "my own frame, verbatim". Base64 on
	// the wire per the proto bytes JSON mapping.
	SourceRaw []byte `json:"source_raw"`
}

HostedAgentRelayRequest is the body for POST .../request: one native agent-protocol request frame, forwarded to the session's agent verbatim.

Where SendInput carries the one message with a canonical meaning ("the user said something"), this carries everything else a client that speaks the session's own protocol needs to ask — for codex, the requests behind interrupts, slash commands, and model pickers. The control plane never parses the frame; only the in-sandbox adapter decides what is safe to forward.

type HostedAgentRelayResponse added in v1.211.0

type HostedAgentRelayResponse struct {
	// SourceRaw is the agent's reply frame, addressed to the caller's own
	// request id but otherwise verbatim. A protocol-level failure (a JSON-RPC
	// error object) is a normal reply and arrives here rather than as an HTTP
	// error.
	//
	// Empty means the in-sandbox adapter declined to forward the method.
	// Callers must answer their own caller on that case rather than waiting
	// for something that will not come.
	SourceRaw []byte `json:"source_raw,omitempty"`
}

HostedAgentRelayResponse is the reply to POST .../request.

type HostedAgentResolutionSource added in v1.211.0

type HostedAgentResolutionSource string

HostedAgentResolutionSource records where a HITL decision originated.

const (
	HostedAgentResolutionSourceUnspecified     HostedAgentResolutionSource = "RESOLUTION_SOURCE_UNSPECIFIED"
	HostedAgentResolutionSourceInlineKeystroke HostedAgentResolutionSource = "RESOLUTION_SOURCE_INLINE_KEYSTROKE"
	HostedAgentResolutionSourceOutOfBand       HostedAgentResolutionSource = "RESOLUTION_SOURCE_OUT_OF_BAND"
)

type HostedAgentResolveHITLRequest added in v1.211.0

type HostedAgentResolveHITLRequest struct {
	Outcome HostedAgentHITLOutcome      `json:"outcome"`
	Reason  string                      `json:"reason,omitempty"`
	Source  HostedAgentResolutionSource `json:"source,omitempty"`

	// SourceRaw is the client's reply in the agent's own protocol, forwarded
	// to the in-sandbox agent untouched. It carries what Outcome cannot: an
	// elicitation's content, a tool's requested input, a scope beyond this one
	// call. Outcome stays required alongside it — it is what the audit trail
	// records, and what the agent falls back to when this is absent.
	SourceRaw []byte `json:"source_raw,omitempty"`

	// Content is a structured answer for a gated request that asks for DATA
	// rather than just a verdict — an MCP *form* elicitation sends a
	// requestedSchema and expects an object matching it back (e.g.
	// {"site_url": "https://acme.atlassian.net"} for a Jira connection). Its
	// keys are the requesting server's, never fixed here. Omitted for plain
	// approvals, where Outcome alone is the whole answer. Mirrors
	// harness-api's resolveHITLBody.Content; forwarded to the run and never
	// persisted (form content can carry user-entered secrets).
	Content map[string]any `json:"content,omitempty"`
}

HostedAgentResolveHITLRequest is the body for POST .../hitl/{requestID}.

type HostedAgentReusableSession added in v1.211.0

type HostedAgentReusableSession struct {
	SessionID   string                   `json:"session_id,omitempty"`
	Name        string                   `json:"name,omitempty"`
	AgentKind   HostedAgentKind          `json:"agent_kind,omitempty"`
	Status      HostedAgentSessionStatus `json:"status,omitempty"`
	CreatedAt   Timestamp                `json:"created_at,omitempty"`
	LastEventAt Timestamp                `json:"last_event_at,omitempty"`
}

HostedAgentReusableSession is a paused session suitable for session_mode=reuse.

type HostedAgentReusableSessionListOptions added in v1.211.0

type HostedAgentReusableSessionListOptions struct {
	PageSize  int    `url:"page_size,omitempty"`
	PageToken string `url:"page_token,omitempty"`
}

HostedAgentReusableSessionListOptions specifies pagination for reusable sessions.

type HostedAgentReusableSessionsListResponse added in v1.211.0

type HostedAgentReusableSessionsListResponse struct {
	Sessions      []HostedAgentReusableSession `json:"sessions"`
	NextPageToken string                       `json:"next_page_token,omitempty"`
}

HostedAgentReusableSessionsListResponse is returned by ListReusableSessions.

type HostedAgentRun added in v1.211.0

type HostedAgentRun struct {
	RunID                string              `json:"run_id"`
	SessionID            string              `json:"session_id"`
	State                HostedAgentRunState `json:"state"`
	StartedAt            Timestamp           `json:"started_at"`
	EndedAt              *Timestamp          `json:"ended_at,omitempty"`
	CumulativeCostMicros int64               `json:"cumulative_cost_micros"`
}

HostedAgentRun represents a single execution within a session.

type HostedAgentRunFailureCode added in v1.211.0

type HostedAgentRunFailureCode string

HostedAgentRunFailureCode classifies a failed run.

const (
	HostedAgentRunFailureCodeUnspecified    HostedAgentRunFailureCode = "RUN_FAILURE_CODE_UNSPECIFIED"
	HostedAgentRunFailureCodeModelError     HostedAgentRunFailureCode = "RUN_FAILURE_CODE_MODEL_ERROR"
	HostedAgentRunFailureCodeModelTimeout   HostedAgentRunFailureCode = "RUN_FAILURE_CODE_MODEL_TIMEOUT"
	HostedAgentRunFailureCodeToolError      HostedAgentRunFailureCode = "RUN_FAILURE_CODE_TOOL_ERROR"
	HostedAgentRunFailureCodeSandboxLost    HostedAgentRunFailureCode = "RUN_FAILURE_CODE_SANDBOX_LOST"
	HostedAgentRunFailureCodeHITLRejected   HostedAgentRunFailureCode = "RUN_FAILURE_CODE_HITL_REJECTED"
	HostedAgentRunFailureCodeBudgetExceeded HostedAgentRunFailureCode = "RUN_FAILURE_CODE_BUDGET_EXCEEDED"
	HostedAgentRunFailureCodeInternal       HostedAgentRunFailureCode = "RUN_FAILURE_CODE_INTERNAL"
)

type HostedAgentRunState added in v1.211.0

type HostedAgentRunState string

HostedAgentRunState is the lifecycle state of a single agent run.

const (
	HostedAgentRunStateUnspecified  HostedAgentRunState = "RUN_STATE_UNSPECIFIED"
	HostedAgentRunStateQueued       HostedAgentRunState = "RUN_STATE_QUEUED"
	HostedAgentRunStateRunning      HostedAgentRunState = "RUN_STATE_RUNNING"
	HostedAgentRunStateAwaitingHITL HostedAgentRunState = "RUN_STATE_AWAITING_HITL"
	HostedAgentRunStatePaused       HostedAgentRunState = "RUN_STATE_PAUSED"
	HostedAgentRunStateCompleted    HostedAgentRunState = "RUN_STATE_COMPLETED"
	HostedAgentRunStateFailed       HostedAgentRunState = "RUN_STATE_FAILED"
)

type HostedAgentSandboxExecRequest added in v1.211.0

type HostedAgentSandboxExecRequest struct {
	Argv           []string `json:"argv"`
	Workdir        string   `json:"workdir,omitempty"`
	TimeoutSeconds int64    `json:"timeout_seconds,omitempty"`
}

HostedAgentSandboxExecRequest is the body for POST .../sandbox/exec.

type HostedAgentSandboxExecResponse added in v1.211.0

type HostedAgentSandboxExecResponse struct {
	ExitCode int    `json:"exit_code"`
	Stdout   string `json:"stdout,omitempty"`
	Stderr   string `json:"stderr,omitempty"`
}

HostedAgentSandboxExecResponse is returned by POST .../sandbox/exec.

type HostedAgentSandboxSize added in v1.211.0

type HostedAgentSandboxSize struct {
	Slug             string  `json:"slug,omitempty"`
	VCPUs            int     `json:"vcpus,omitempty"`
	MemoryMB         int     `json:"memory_mb,omitempty"`
	PricePerHourUSD  float64 `json:"price_per_hour_usd,omitempty"`
	PricePerMonthUSD float64 `json:"price_per_month_usd,omitempty"`
}

HostedAgentSandboxSize is a customer-selectable sandbox (microVM) size from GET /v2/agents/sessions/sandbox/sizes. Submit Slug as spec.sandbox.sizeSlug on CreateSession; VCPUs, MemoryMB, and the price fields are for display.

type HostedAgentSandboxSizesResponse added in v1.211.0

type HostedAgentSandboxSizesResponse struct {
	// Sizes is ordered smallest-to-largest.
	Sizes []HostedAgentSandboxSize `json:"sizes"`
}

HostedAgentSandboxSizesResponse is returned by ListSandboxSizes.

type HostedAgentSendInputRequest added in v1.211.0

type HostedAgentSendInputRequest struct {
	Text string `json:"text"`

	// SourceRaw optionally carries the client's exact native protocol frame
	// this input was extracted from — for codex, the TUI's turn/start
	// JSON-RPC message with its full params. The in-sandbox adapter uses it
	// as the template for the turn it drives, so client intent beyond plain
	// text (input items, model, effort, approval policy, ...) survives the
	// text reduction. Only meaningful when the caller speaks the session's
	// own agent protocol; Text stays required either way. Inbound
	// counterpart of HostedAgentEvent.SourceRaw. Base64 on the wire per the
	// proto bytes JSON mapping — encoding/json does that for []byte.
	SourceRaw []byte `json:"source_raw,omitempty"`
}

HostedAgentSendInputRequest is the body for POST .../input.

type HostedAgentSendInputResponse added in v1.211.0

type HostedAgentSendInputResponse struct {
	RunID string `json:"run_id"`
}

HostedAgentSendInputResponse is returned by POST .../input.

type HostedAgentSession added in v1.211.0

type HostedAgentSession struct {
	SessionID    string                                  `json:"session_id"`
	Name         string                                  `json:"name,omitempty"`
	AgentKind    HostedAgentKind                         `json:"agent_kind"`
	Status       HostedAgentSessionStatus                `json:"status"`
	CreatedAt    Timestamp                               `json:"created_at"`
	LastEventAt  Timestamp                               `json:"last_event_at"`
	RepoHint     string                                  `json:"repo_hint,omitempty"`
	ProviderAuth map[string]HostedAgentProviderAuthState `json:"provider_auth,omitempty"`
	// Origin is present for newly created sessions (including direct). Older
	// sessions may omit it.
	Origin *HostedAgentSessionOrigin `json:"origin,omitempty"`
	// PauseReason qualifies Status when it is SESSION_STATUS_PAUSED, and is
	// omitted otherwise. Unrecognized values are opaque, not errors — see
	// HostedAgentSessionPauseReason.
	PauseReason HostedAgentSessionPauseReason `json:"pause_reason,omitempty"`
	// SandboxID is the sandbox identity for support / debugging. Informational;
	// omitted until a sandbox is allocated.
	SandboxID string `json:"sandbox_id,omitempty"`
	// ResumeOnTopoff is the consent to auto-resume this session when a
	// prepayment balance is restored. Set at create (manifest query param or
	// config JSON body), toggled afterwards with UpdateSession, and returned on
	// get/list so clients can confirm enrollment. Never inherited by forks.
	// Omitted when false.
	ResumeOnTopoff bool `json:"resume_on_topoff,omitempty"`
	// WorkspaceID is the persistent workspace this session attaches (see
	// HostedAgentWorkspace). Set at create and returned on get/list; omitted
	// when the session has no persistent workspace.
	WorkspaceID string `json:"workspace_id,omitempty"`
	// OpenAISessionID is the OpenAI Agents session id (sess_…) linked to this DO
	// sandbox for AGENT_KIND_OPENAI_CODEX. Used by attach to bridge to OpenAI;
	// omitempty for other agent kinds.
	OpenAISessionID string `json:"openai_session_id,omitempty"`
	// OpenAIEnvironmentID is captured from the resolved CODEX_ENVIRONMENT_ID
	// guest env value at create. Non-secret correlation metadata.
	OpenAIEnvironmentID string `json:"openai_environment_id,omitempty"`
	// ParentSessionID is set on forked child sessions; empty/omitted for roots.
	ParentSessionID string `json:"parent_session_id,omitempty"`
	// ForkID is a branch label on forked sessions; empty/omitted for roots.
	ForkID string `json:"fork_id,omitempty"`
	// ConfigID is the durable Environment UUID the session was created from
	// (inline manifests persist an environment too, named after the session).
	// Returned on create/get/list; omitted for sessions created before
	// environment references were stored. Historically called Agent Config.
	ConfigID string `json:"config_id,omitempty"`
	// Warnings carries non-fatal create-time advisories from the server
	// (manifest parse + policy fidelity). Populated on the create response
	// only; omitted on get/list.
	Warnings []string `json:"warnings,omitempty"`
}

HostedAgentSession is a provisioned hosted-agent sandbox session.

type HostedAgentSessionCreateRequest added in v1.211.0

type HostedAgentSessionCreateRequest struct {
	AgentKind          HostedAgentKind `json:"agent_kind"`
	RepoHint           string          `json:"repo_hint,omitempty"`
	IdleTimeoutSeconds int64           `json:"idle_timeout_seconds,omitempty"`
	// Origin claims product-workflow provenance. Omit for a verified direct
	// session. Simulation/evaluation require resource_id.
	Origin *HostedAgentSessionOriginRequest `json:"origin,omitempty"`
}

HostedAgentSessionCreateRequest is the body for POST /v2/agents/sessions.

type HostedAgentSessionFromConfigRequest added in v1.211.0

type HostedAgentSessionFromConfigRequest struct {
	Name     string `json:"name"`
	ConfigID string `json:"config_id"`
	// ResumeOnTopoff opts the new session in to automatic resumption when the
	// team's prepayment balance is restored. Session-scoped, not
	// environment-scoped: the referenced Environment never confers it, so one
	// shared Environment cannot enrol every session created from it. Omitted
	// when false, which leaves the server default (also false).
	ResumeOnTopoff bool `json:"resume_on_topoff,omitempty"`
	// WorkspaceID attaches an existing persistent workspace (see
	// HostedAgentWorkspace) to the new session. This is the only create path
	// that can attach one; CreateSessionFromManifest cannot. Session-scoped, not
	// environment-scoped: the referenced Environment never names a workspace, so
	// one shared Environment can be used with a different workspace per session.
	// Omitted when empty, which creates the session without one.
	WorkspaceID string `json:"workspace_id,omitempty"`
}

HostedAgentSessionFromConfigRequest creates a session from an existing immutable Environment (POST /v2/agents/sessions with a JSON body). Name is required and becomes the new session name; ConfigID must be the UUID of an Environment owned by the caller's team. Prefer HostedAgentSessionFromEnvironmentRequest; this name remains for compatibility. The JSON field remains "config_id" on the wire.

type HostedAgentSessionFromEnvironmentRequest added in v1.214.0

type HostedAgentSessionFromEnvironmentRequest = HostedAgentSessionFromConfigRequest

HostedAgentSessionFromEnvironmentRequest is the advertised alias for HostedAgentSessionFromConfigRequest.

type HostedAgentSessionListOptions added in v1.211.0

type HostedAgentSessionListOptions struct {
	PageToken string                   `url:"page_token,omitempty"`
	PageSize  int                      `url:"page_size,omitempty"`
	Status    HostedAgentSessionStatus `url:"status,omitempty"`
	Name      string                   `url:"name,omitempty"`
	// ParentSessionID lists child (forked) sessions of the given parent.
	ParentSessionID string `url:"parent_session_id,omitempty"`
}

HostedAgentSessionListOptions specifies optional list filters.

type HostedAgentSessionOrigin added in v1.211.0

type HostedAgentSessionOrigin struct {
	Product    HostedAgentSessionOriginProduct `json:"product"`
	ResourceID string                          `json:"resource_id,omitempty"`
	Verified   bool                            `json:"verified"`
}

HostedAgentSessionOrigin is server-returned product-workflow provenance. Verified is true for direct sessions and for product claims established through a trusted adapter.

type HostedAgentSessionOriginProduct added in v1.211.0

type HostedAgentSessionOriginProduct string

HostedAgentSessionOriginProduct identifies the product workflow that created a session. Wire values match harness SessionOrigin.product.

const (
	HostedAgentSessionOriginProductDirect     HostedAgentSessionOriginProduct = "direct"
	HostedAgentSessionOriginProductSimulation HostedAgentSessionOriginProduct = "simulation"
	HostedAgentSessionOriginProductEvaluation HostedAgentSessionOriginProduct = "evaluation"
)

type HostedAgentSessionOriginRequest added in v1.211.0

type HostedAgentSessionOriginRequest struct {
	Product    HostedAgentSessionOriginProduct `json:"product"`
	ResourceID string                          `json:"resource_id,omitempty"`
}

HostedAgentSessionOriginRequest is the product-provenance claim on create. Omission creates a verified direct session. Simulation and evaluation require resource_id; direct forbids it. verified is server-assigned and must not be sent on create (see HostedAgentSessionOrigin).

type HostedAgentSessionPauseReason added in v1.211.0

type HostedAgentSessionPauseReason string

HostedAgentSessionPauseReason is why a paused session was paused. The API reserves the right to add reasons, so an unrecognized value is an opaque reason string rather than an error: compare against the constants below to recognize a reason, but pass anything else through as-is.

const (
	// HostedAgentSessionPauseReasonManual is a pause requested through PauseSession.
	HostedAgentSessionPauseReasonManual HostedAgentSessionPauseReason = "manual"
	// HostedAgentSessionPauseReasonIdle is an automatic pause after inactivity.
	HostedAgentSessionPauseReasonIdle HostedAgentSessionPauseReason = "idle"
	// HostedAgentSessionPauseReasonZeroBalance is a pause by the prepayment gate.
	// It is the only reason the server auto-resumes from, and only for sessions
	// with ResumeOnTopoff set.
	HostedAgentSessionPauseReasonZeroBalance HostedAgentSessionPauseReason = "zero_balance"
	// Deprecated: Use HostedAgentSessionPauseReasonZeroBalance. Servers now return
	// "zero_balance"; this constant is kept for backward compatibility with older API responses.
	HostedAgentSessionPauseReasonLowBalance HostedAgentSessionPauseReason = "low_balance"
)

type HostedAgentSessionStatus added in v1.211.0

type HostedAgentSessionStatus string

HostedAgentSessionStatus is the lifecycle status of a hosted agent session.

const (
	HostedAgentSessionStatusUnspecified  HostedAgentSessionStatus = "SESSION_STATUS_UNSPECIFIED"
	HostedAgentSessionStatusProvisioning HostedAgentSessionStatus = "SESSION_STATUS_PROVISIONING"
	HostedAgentSessionStatusReady        HostedAgentSessionStatus = "SESSION_STATUS_READY"
	HostedAgentSessionStatusDetached     HostedAgentSessionStatus = "SESSION_STATUS_DETACHED"
	HostedAgentSessionStatusDestroying   HostedAgentSessionStatus = "SESSION_STATUS_DESTROYING"
	HostedAgentSessionStatusDestroyed    HostedAgentSessionStatus = "SESSION_STATUS_DESTROYED"
	HostedAgentSessionStatusFailed       HostedAgentSessionStatus = "SESSION_STATUS_FAILED"
	HostedAgentSessionStatusPaused       HostedAgentSessionStatus = "SESSION_STATUS_PAUSED"
)

type HostedAgentSessionStream added in v1.211.0

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

HostedAgentSessionStream is a typed iterator over a session SSE stream.

func (*HostedAgentSessionStream) Close added in v1.211.0

func (s *HostedAgentSessionStream) Close() error

Close releases the underlying HTTP response body. Always call Close.

func (*HostedAgentSessionStream) Current added in v1.211.0

Current returns the most recent event produced by Next.

func (*HostedAgentSessionStream) Err added in v1.211.0

Err returns any non-EOF error encountered during iteration.

func (*HostedAgentSessionStream) HasMore added in v1.211.0

func (s *HostedAgentSessionStream) HasMore() bool

HasMore reports whether the history page just read has older events behind it. Only meaningful once a stream opened with HostedAgentSessionStreamOptions.Before has been drained to its end: the trailer arrives after the last event.

func (*HostedAgentSessionStream) Next added in v1.211.0

func (s *HostedAgentSessionStream) Next() bool

Next advances to the next event. Returns false on EOF or error.

type HostedAgentSessionStreamOptions added in v1.211.0

type HostedAgentSessionStreamOptions struct {
	// ReplayFrom is the resume cursor: the id of the last event the caller
	// already rendered. On the live stream it is sent as Last-Event-ID; on a
	// ReplayOnly read it is sent as the replay_from query parameter.
	ReplayFrom string
	// ReplayOnly reads the stored event history and ends the stream at the last
	// stored event instead of holding the connection open for live events.
	ReplayOnly bool

	// Before turns the request into a single backward page of durable
	// history: the events strictly older than this event id, oldest-first,
	// after which the stream closes without live events. Set it to the
	// oldest event id already held. Requires ReplayOnly, since a live
	// attach cannot start in the past.
	//
	// A cursorless replay only covers the newest window of a session's
	// history (the server's replay budget), so walking backwards from its
	// oldest event is how older history is read. HasMore reports whether
	// the walk can continue.
	Before string

	// Limit caps the events in one history page. Only meaningful with
	// Before. Zero leaves the server's default (200); the server also caps
	// any request at its replay budget.
	Limit int

	// IncludeRaw asks the server to include each event's native source bytes
	// (HostedAgentEvent.SourceRaw) alongside the canonical payload. Raw
	// payloads meaningfully fatten every event, so this is opt-in; consumers
	// that don't translate native protocols should leave it off.
	IncludeRaw bool
}

HostedAgentSessionStreamOptions configures the session SSE stream.

ReplayOnly selects between the two modes StreamSession can open on the events endpoint (see StreamSession); Before and Limit page backwards through history within the replay-only mode.

type HostedAgentSessionUpdateRequest added in v1.211.0

type HostedAgentSessionUpdateRequest struct {
	// ResumeOnTopoff sets whether the session opts in to automatic resumption
	// once the team's prepayment balance is restored after a low-balance pause.
	// Nil leaves the current consent unchanged. Revoking takes effect
	// immediately for later sweeps; granting it does not by itself resume a
	// session that is already paused.
	ResumeOnTopoff *bool `json:"resume_on_topoff,omitempty"`
}

HostedAgentSessionUpdateRequest is the body for PATCH /v2/agents/sessions/{session_id}: an allowlisted subset of session-scoped settings, never an agents.yaml or Agent Config mutation. The server rejects unknown top-level keys, and rejects an empty object, so every field is a pointer: nil omits it and leaves the server-side value untouched.

type HostedAgentSessionsListResponse added in v1.211.0

type HostedAgentSessionsListResponse struct {
	Sessions      []HostedAgentSession `json:"sessions"`
	NextPageToken string               `json:"next_page_token"`
}

HostedAgentSessionsListResponse is returned by GET /v2/agents/sessions.

type HostedAgentStreamState added in v1.211.0

type HostedAgentStreamState struct {
	State  HostedAgentStreamStateValue `json:"state"`
	Cursor string                      `json:"cursor,omitempty"`
}

HostedAgentStreamState is the payload of a HostedAgentEventKindStreamState frame: the current health of the SSE connection.

type HostedAgentStreamStateValue added in v1.211.0

type HostedAgentStreamStateValue string

HostedAgentStreamStateValue enumerates the stream health states.

const (
	// HostedAgentStreamStateLive means events are being delivered contiguously.
	HostedAgentStreamStateLive HostedAgentStreamStateValue = "live"
	// HostedAgentStreamStateCatchingUp means the connection is replaying recent
	// history before it joins the live tail.
	HostedAgentStreamStateCatchingUp HostedAgentStreamStateValue = "catching_up"
	// HostedAgentStreamStateDegraded means delivery continues with reduced
	// guarantees (the server fell back to polling).
	HostedAgentStreamStateDegraded HostedAgentStreamStateValue = "degraded"
	// HostedAgentStreamStateSuperseded means a newer connection from the same
	// device took over. The server closes this stream; the client should stop
	// rather than reconnect, or the two connections will evict each other.
	HostedAgentStreamStateSuperseded HostedAgentStreamStateValue = "superseded"
)

type HostedAgentTemplate added in v1.211.0

type HostedAgentTemplate struct {
	TemplateID string                    `json:"template_id"`
	Name       string                    `json:"name"`
	Spec       *HostedAgentTemplateSpec  `json:"spec,omitempty"`
	Status     HostedAgentTemplateStatus `json:"status"`
	CreatedAt  Timestamp                 `json:"created_at"`
	UpdatedAt  Timestamp                 `json:"updated_at"`
}

HostedAgentTemplate is a team-owned custom sandbox template.

type HostedAgentTemplateBuild added in v1.211.0

type HostedAgentTemplateBuild struct {
	BuildID    string                         `json:"build_id"`
	TemplateID string                         `json:"template_id,omitempty"`
	Name       string                         `json:"name,omitempty"`
	Spec       *HostedAgentTemplateSpec       `json:"spec,omitempty"`
	Status     HostedAgentTemplateBuildStatus `json:"status"`
	Error      string                         `json:"error,omitempty"`
	CreatedAt  Timestamp                      `json:"created_at"`
	UpdatedAt  Timestamp                      `json:"updated_at"`
}

HostedAgentTemplateBuild is one immutable build of a template.

type HostedAgentTemplateBuildListOptions added in v1.211.0

type HostedAgentTemplateBuildListOptions struct {
	PageToken string `url:"page_token,omitempty"`
	PageSize  int    `url:"page_size,omitempty"`
}

HostedAgentTemplateBuildListOptions paginates ListTemplateBuilds.

type HostedAgentTemplateBuildLogs added in v1.211.0

type HostedAgentTemplateBuildLogs struct {
	// SignedURL is a short-lived (15-minute) pre-signed Spaces GET URL.
	SignedURL string `json:"signed_url"`
}

HostedAgentTemplateBuildLogs is returned by GET .../builds/{build_id}/logs.

type HostedAgentTemplateBuildStatus added in v1.211.0

type HostedAgentTemplateBuildStatus string

HostedAgentTemplateBuildStatus is the lifecycle status of a template build.

const (
	HostedAgentTemplateBuildStatusUnspecified HostedAgentTemplateBuildStatus = "STATUS_UNSPECIFIED"
	HostedAgentTemplateBuildStatusPending     HostedAgentTemplateBuildStatus = "PENDING"
	HostedAgentTemplateBuildStatusBuilding    HostedAgentTemplateBuildStatus = "BUILDING"
	HostedAgentTemplateBuildStatusSucceeded   HostedAgentTemplateBuildStatus = "SUCCEEDED"
	HostedAgentTemplateBuildStatusFailed      HostedAgentTemplateBuildStatus = "FAILED"
)

type HostedAgentTemplateBuildsListResponse added in v1.211.0

type HostedAgentTemplateBuildsListResponse struct {
	Builds        []HostedAgentTemplateBuild `json:"builds"`
	NextPageToken string                     `json:"next_page_token,omitempty"`
}

HostedAgentTemplateBuildsListResponse is returned by GET .../builds.

type HostedAgentTemplateCreateRequest added in v1.211.0

type HostedAgentTemplateCreateRequest struct {
	Name         string `json:"name"`
	BaseTemplate string `json:"base_template"`
	SourceOCIRef string `json:"source_oci_ref"`
}

HostedAgentTemplateCreateRequest is the body for POST /v2/agents/templates.

type HostedAgentTemplateDeleteResponse added in v1.211.0

type HostedAgentTemplateDeleteResponse struct {
	TemplateID string `json:"template_id"`
	Deleted    bool   `json:"deleted"`
}

HostedAgentTemplateDeleteResponse is returned by DELETE /v2/agents/templates/{template_id}.

type HostedAgentTemplateImageSource added in v1.211.0

type HostedAgentTemplateImageSource struct {
	Registry   string `json:"registry,omitempty"`
	Repository string `json:"repository,omitempty"`
	Tag        string `json:"tag,omitempty"`
	Digest     string `json:"digest,omitempty"`
}

HostedAgentTemplateImageSource is the customer OCI image used as template input.

type HostedAgentTemplateListOptions added in v1.211.0

type HostedAgentTemplateListOptions struct {
	PageToken string `url:"page_token,omitempty"`
	PageSize  int    `url:"page_size,omitempty"`
}

HostedAgentTemplateListOptions paginates ListTemplates.

type HostedAgentTemplateSpec added in v1.211.0

type HostedAgentTemplateSpec struct {
	// BaseTemplate is the platform base key: coding-base | coding-codex | coding-opencode.
	BaseTemplate string                          `json:"base_template,omitempty"`
	Image        *HostedAgentTemplateImageSource `json:"image,omitempty"`
}

HostedAgentTemplateSpec is the resolved template source.

type HostedAgentTemplateStatus added in v1.211.0

type HostedAgentTemplateStatus string

HostedAgentTemplateStatus is the lifecycle status of a team custom template.

const (
	HostedAgentTemplateStatusUnspecified HostedAgentTemplateStatus = "TEMPLATE_STATUS_UNSPECIFIED"
	HostedAgentTemplateStatusPending     HostedAgentTemplateStatus = "TEMPLATE_STATUS_PENDING"
	HostedAgentTemplateStatusBuilding    HostedAgentTemplateStatus = "TEMPLATE_STATUS_BUILDING"
	HostedAgentTemplateStatusReady       HostedAgentTemplateStatus = "TEMPLATE_STATUS_READY"
	HostedAgentTemplateStatusFailed      HostedAgentTemplateStatus = "TEMPLATE_STATUS_FAILED"
)

type HostedAgentTemplateUpdateRequest added in v1.211.0

type HostedAgentTemplateUpdateRequest struct {
	SourceOCIRef string `json:"source_oci_ref,omitempty"`
	BaseTemplate string `json:"base_template,omitempty"`
}

HostedAgentTemplateUpdateRequest is the body for PUT /v2/agents/templates/{template_id}. Updating source kicks a new build.

type HostedAgentTemplatesListResponse added in v1.211.0

type HostedAgentTemplatesListResponse struct {
	Templates     []HostedAgentTemplate `json:"templates"`
	NextPageToken string                `json:"next_page_token,omitempty"`
}

HostedAgentTemplatesListResponse is returned by GET /v2/agents/templates.

type HostedAgentTrigger added in v1.211.0

type HostedAgentTrigger struct {
	TriggerID       string                        `json:"trigger_id,omitempty"`
	TeamID          int64                         `json:"team_id,omitempty"`
	Kind            HostedAgentTriggerKind        `json:"kind,omitempty"`
	Name            string                        `json:"name,omitempty"`
	Status          HostedAgentTriggerStatus      `json:"status,omitempty"`
	SessionMode     HostedAgentTriggerSessionMode `json:"session_mode,omitempty"`
	AgentKind       HostedAgentKind               `json:"agent_kind,omitempty"`
	PromptTemplate  string                        `json:"prompt_template,omitempty"`
	Output          *HostedAgentTriggerOutputRead `json:"output,omitempty"`
	SessionTemplate string                        `json:"session_template,omitempty"`
	BoundSessionID  string                        `json:"bound_session_id,omitempty"`
	Webhook         *HostedAgentWebhookConfig     `json:"webhook,omitempty"`
	Cron            *HostedAgentCronConfig        `json:"cron,omitempty"`
	CreatedAt       Timestamp                     `json:"created_at,omitempty"`
	UpdatedAt       Timestamp                     `json:"updated_at,omitempty"`
}

HostedAgentTrigger is a webhook or cron automation bound to an agent/session.

type HostedAgentTriggerCancelExecutionOptions added in v1.216.0

type HostedAgentTriggerCancelExecutionOptions struct {
	// Force cancels even if the execution has not started a run yet (the
	// worker's own dispatch may still be in flight). Without this, that
	// case returns 409; the server-side reclaim sweep clears it
	// automatically within 15m regardless.
	Force bool `url:"force,omitempty"`
}

HostedAgentTriggerCancelExecutionOptions specifies optional cancel behaviour.

type HostedAgentTriggerCreateRequest added in v1.211.0

type HostedAgentTriggerCreateRequest struct {
	Kind            HostedAgentTriggerKind          `json:"kind"`
	Name            string                          `json:"name"`
	SessionMode     HostedAgentTriggerSessionMode   `json:"session_mode"`
	PromptTemplate  string                          `json:"prompt_template"`
	Output          HostedAgentTriggerOutputWrite   `json:"output"`
	SessionTemplate string                          `json:"session_template,omitempty"`
	BoundSessionID  string                          `json:"bound_session_id,omitempty"`
	Webhook         *HostedAgentCreateWebhookConfig `json:"webhook,omitempty"`
	Cron            *HostedAgentCreateCronConfig    `json:"cron,omitempty"`
}

HostedAgentTriggerCreateRequest creates a webhook or cron trigger.

type HostedAgentTriggerCreateResponse added in v1.211.0

type HostedAgentTriggerCreateResponse struct {
	Trigger       *HostedAgentTrigger `json:"trigger,omitempty"`
	WebhookSecret string              `json:"webhook_secret,omitempty"`
}

HostedAgentTriggerCreateResponse is returned on create. WebhookSecret is present for webhook triggers only and shown exactly once.

type HostedAgentTriggerExecution added in v1.211.0

type HostedAgentTriggerExecution struct {
	ExecutionID     string                            `json:"execution_id,omitempty"`
	TriggerID       string                            `json:"trigger_id,omitempty"`
	Status          HostedAgentTriggerExecutionStatus `json:"status,omitempty"`
	SessionID       string                            `json:"session_id,omitempty"`
	RunID           string                            `json:"run_id,omitempty"`
	FailureReason   string                            `json:"failure_reason,omitempty"`
	CreatedAt       Timestamp                         `json:"created_at,omitempty"`
	UpdatedAt       Timestamp                         `json:"updated_at,omitempty"`
	Payload         string                            `json:"payload,omitempty"`
	OutputText      string                            `json:"output_text,omitempty"`
	OutputTruncated bool                              `json:"output_truncated,omitempty"`
}

HostedAgentTriggerExecution is one row per firing.

type HostedAgentTriggerExecutionListOptions added in v1.211.0

type HostedAgentTriggerExecutionListOptions struct {
	PageSize  int                               `url:"page_size,omitempty"`
	PageToken string                            `url:"page_token,omitempty"`
	Status    HostedAgentTriggerExecutionStatus `url:"status,omitempty"`
}

HostedAgentTriggerExecutionListOptions specifies optional execution list filters.

type HostedAgentTriggerExecutionStatus added in v1.211.0

type HostedAgentTriggerExecutionStatus string

HostedAgentTriggerExecutionStatus is the per-firing outcome.

const (
	HostedAgentTriggerExecutionStatusPending   HostedAgentTriggerExecutionStatus = "pending"
	HostedAgentTriggerExecutionStatusRunning   HostedAgentTriggerExecutionStatus = "running"
	HostedAgentTriggerExecutionStatusSucceeded HostedAgentTriggerExecutionStatus = "succeeded"
	HostedAgentTriggerExecutionStatusFailed    HostedAgentTriggerExecutionStatus = "failed"
)

type HostedAgentTriggerExecutionsListResponse added in v1.211.0

type HostedAgentTriggerExecutionsListResponse struct {
	Executions    []HostedAgentTriggerExecution `json:"executions"`
	NextPageToken string                        `json:"next_page_token,omitempty"`
}

HostedAgentTriggerExecutionsListResponse is returned by ListExecutions.

type HostedAgentTriggerKind added in v1.211.0

type HostedAgentTriggerKind string

HostedAgentTriggerKind is how a trigger fires.

const (
	HostedAgentTriggerKindWebhook HostedAgentTriggerKind = "webhook"
	HostedAgentTriggerKindCron    HostedAgentTriggerKind = "cron"
)

type HostedAgentTriggerListOptions added in v1.211.0

type HostedAgentTriggerListOptions struct {
	PageSize  int                      `url:"page_size,omitempty"`
	PageToken string                   `url:"page_token,omitempty"`
	Kind      HostedAgentTriggerKind   `url:"kind,omitempty"`
	Status    HostedAgentTriggerStatus `url:"status,omitempty"`
}

HostedAgentTriggerListOptions specifies optional list filters and pagination.

type HostedAgentTriggerOutputMode added in v1.211.0

type HostedAgentTriggerOutputMode string

HostedAgentTriggerOutputMode is how run output is delivered.

const (
	HostedAgentTriggerOutputModeNone  HostedAgentTriggerOutputMode = "none"
	HostedAgentTriggerOutputModeEmail HostedAgentTriggerOutputMode = "email"
	// HostedAgentTriggerOutputModeSlack delivers run output to a Slack incoming webhook.
	HostedAgentTriggerOutputModeSlack HostedAgentTriggerOutputMode = "slack"
)

type HostedAgentTriggerOutputRead added in v1.211.0

type HostedAgentTriggerOutputRead struct {
	Mode            HostedAgentTriggerOutputMode `json:"mode,omitempty"`
	EmailConfigured bool                         `json:"email_configured,omitempty"`
	SlackConfigured bool                         `json:"slack_configured,omitempty"`
}

HostedAgentTriggerOutputRead is output-delivery config as returned on reads. Email addresses and Slack webhook URLs are write-only and never returned.

type HostedAgentTriggerOutputWrite added in v1.211.0

type HostedAgentTriggerOutputWrite struct {
	Mode  HostedAgentTriggerOutputMode        `json:"mode"`
	Email string                              `json:"email,omitempty"`
	Slack *HostedAgentTriggerSlackOutputWrite `json:"slack,omitempty"`
}

HostedAgentTriggerOutputWrite is output-delivery config on create/update. Email is required when mode=email; Slack is required when mode=slack. Destinations are stored encrypted and never returned on reads.

type HostedAgentTriggerRotateSecretOptions added in v1.211.0

type HostedAgentTriggerRotateSecretOptions struct {
	// GracePeriodSeconds is how long the outgoing secret keeps verifying.
	// Nil omits the query parameter (server default). Non-nil 0 revokes now.
	GracePeriodSeconds *int `url:"grace_period_seconds,omitempty"`
}

HostedAgentTriggerRotateSecretOptions specifies optional rotation behaviour. A nil options pointer, or GracePeriodSeconds left nil, selects the server default (5 minutes). Pass a pointer to 0 to revoke the outgoing secret immediately; any positive value is a custom handoff window in seconds (server-enforced max, default 1 hour).

type HostedAgentTriggerRotateSecretResponse added in v1.211.0

type HostedAgentTriggerRotateSecretResponse struct {
	WebhookSecret string `json:"webhook_secret,omitempty"`
	// PreviousSecretExpiresAt is when the outgoing secret stops verifying
	// deliveries. Nil when the secret was revoked on the rotate call.
	PreviousSecretExpiresAt *Timestamp `json:"previous_secret_expires_at,omitempty"`
	// PreviousSecretRevoked reports that the outgoing secret is already dead.
	PreviousSecretRevoked bool `json:"previous_secret_revoked,omitempty"`
}

HostedAgentTriggerRotateSecretResponse is returned by RotateSecret. Exactly one of PreviousSecretExpiresAt and PreviousSecretRevoked is set, so a caller never has to infer the outcome from a missing field.

type HostedAgentTriggerSessionMode added in v1.211.0

type HostedAgentTriggerSessionMode string

HostedAgentTriggerSessionMode controls whether each firing creates a new session or reuses a bound paused session.

const (
	HostedAgentTriggerSessionModeFresh HostedAgentTriggerSessionMode = "fresh"
	HostedAgentTriggerSessionModeReuse HostedAgentTriggerSessionMode = "reuse"
)

type HostedAgentTriggerSlackOutputWrite added in v1.211.0

type HostedAgentTriggerSlackOutputWrite struct {
	WebhookURL string `json:"webhook_url"`
}

HostedAgentTriggerSlackOutputWrite is the Slack destination on create/update.

type HostedAgentTriggerStatus added in v1.211.0

type HostedAgentTriggerStatus string

HostedAgentTriggerStatus is the trigger lifecycle state.

const (
	HostedAgentTriggerStatusActive HostedAgentTriggerStatus = "active"
	HostedAgentTriggerStatusPaused HostedAgentTriggerStatus = "paused"
)

type HostedAgentTriggerUpdateRequest added in v1.211.0

type HostedAgentTriggerUpdateRequest struct {
	Name            string                         `json:"name,omitempty"`
	Status          HostedAgentTriggerStatus       `json:"status,omitempty"`
	PromptTemplate  string                         `json:"prompt_template,omitempty"`
	Output          *HostedAgentTriggerOutputWrite `json:"output,omitempty"`
	SessionTemplate string                         `json:"session_template,omitempty"`
	BoundSessionID  string                         `json:"bound_session_id,omitempty"`
	Cron            *HostedAgentCreateCronConfig   `json:"cron,omitempty"`
}

HostedAgentTriggerUpdateRequest is a partial update (pause/re-enable via status).

type HostedAgentTriggersListResponse added in v1.211.0

type HostedAgentTriggersListResponse struct {
	Triggers      []HostedAgentTrigger `json:"triggers"`
	NextPageToken string               `json:"next_page_token,omitempty"`
}

HostedAgentTriggersListResponse is returned by List.

type HostedAgentTriggersService added in v1.211.0

HostedAgentTriggersService exposes the Hosted Agents Triggers public REST API (webhook & cron triggers for agent runs) under /v2/agents/triggers and /v2/agents/webhook-providers.

type HostedAgentTriggersServiceOp added in v1.211.0

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

HostedAgentTriggersServiceOp handles communication with Hosted Agents Trigger methods.

func (*HostedAgentTriggersServiceOp) Cancel added in v1.216.0

Cancel ends a running execution: fails it and frees the trigger's in-flight slot. A fresh-mode session is destroyed outright; a reuse-mode session is only paused, since the API has no run-interrupt call -- the agent's turn may still be in flight server-side. Cancelling a non-running execution is a no-op that still succeeds. See HostedAgentTriggerCancelExecutionOptions.Force for the 409 this can return when the execution has not started a run yet.

func (*HostedAgentTriggersServiceOp) Create added in v1.211.0

Create creates a webhook or cron trigger. For webhook triggers, WebhookSecret is returned exactly once.

func (*HostedAgentTriggersServiceOp) Delete added in v1.211.0

func (s *HostedAgentTriggersServiceOp) Delete(ctx context.Context, triggerID string) (*Response, error)

Delete soft-deletes a trigger. The API returns HTTP 204 on success.

func (*HostedAgentTriggersServiceOp) Get added in v1.211.0

Get returns a single trigger by ID.

func (*HostedAgentTriggersServiceOp) GetBySession added in v1.211.0

func (s *HostedAgentTriggersServiceOp) GetBySession(ctx context.Context, sessionID string) (*HostedAgentTrigger, *Response, error)

GetBySession reverse-looks-up the trigger that produced or binds a session.

func (*HostedAgentTriggersServiceOp) GetExecution added in v1.211.0

func (s *HostedAgentTriggersServiceOp) GetExecution(ctx context.Context, triggerID, executionID string) (*HostedAgentTriggerExecution, *Response, error)

GetExecution returns a single execution, including its payload.

func (*HostedAgentTriggersServiceOp) List added in v1.211.0

List enumerates the calling team's triggers.

func (*HostedAgentTriggersServiceOp) ListExecutions added in v1.211.0

ListExecutions returns a trigger's execution history (payload omitted from list items).

func (*HostedAgentTriggersServiceOp) ListReusableSessions added in v1.211.0

ListReusableSessions lists the team's PAUSED sessions for the reuse picker.

func (*HostedAgentTriggersServiceOp) ListWebhookProviders added in v1.211.0

ListWebhookProviders lists supported webhook providers for the create-trigger UI.

func (*HostedAgentTriggersServiceOp) RotateSecret added in v1.211.0

RotateSecret issues a new webhook secret (webhook triggers only). By default (nil options, or GracePeriodSeconds left nil) the outgoing secret keeps verifying for the server default window (5 minutes) and PreviousSecretExpiresAt reports when it dies. Pass GracePeriodSeconds pointing at 0 to revoke it on this call, or at a positive value for a custom window.

func (*HostedAgentTriggersServiceOp) Update added in v1.211.0

Update partially updates, pauses, or re-enables a trigger.

type HostedAgentWebhookConfig added in v1.211.0

type HostedAgentWebhookConfig struct {
	Provider   HostedAgentWebhookProviderKey `json:"provider,omitempty"`
	WebhookURL string                        `json:"webhook_url,omitempty"`
}

HostedAgentWebhookConfig is present when kind=webhook.

type HostedAgentWebhookProvider added in v1.211.0

type HostedAgentWebhookProvider struct {
	Key         HostedAgentWebhookProviderKey        `json:"key,omitempty"`
	DisplayName string                               `json:"display_name,omitempty"`
	Description string                               `json:"description,omitempty"`
	DocsURL     string                               `json:"docs_url,omitempty"`
	PasteHint   string                               `json:"paste_hint,omitempty"`
	Signature   *HostedAgentWebhookProviderSignature `json:"signature,omitempty"`
}

HostedAgentWebhookProvider is a static registry entry for the create-trigger UI.

type HostedAgentWebhookProviderKey added in v1.211.0

type HostedAgentWebhookProviderKey string

HostedAgentWebhookProviderKey identifies the signature-verification scheme.

const (
	HostedAgentWebhookProviderGitHub HostedAgentWebhookProviderKey = "github"
	HostedAgentWebhookProviderGitLab HostedAgentWebhookProviderKey = "gitlab"
	HostedAgentWebhookProviderCustom HostedAgentWebhookProviderKey = "custom"
)

type HostedAgentWebhookProviderSignature added in v1.211.0

type HostedAgentWebhookProviderSignature struct {
	Header string                            `json:"header,omitempty"`
	Scheme HostedAgentWebhookSignatureScheme `json:"scheme,omitempty"`
}

HostedAgentWebhookProviderSignature describes how a provider signs deliveries.

type HostedAgentWebhookProvidersListResponse added in v1.211.0

type HostedAgentWebhookProvidersListResponse struct {
	Providers []HostedAgentWebhookProvider `json:"providers"`
}

HostedAgentWebhookProvidersListResponse is returned by ListWebhookProviders.

type HostedAgentWebhookSignatureScheme added in v1.211.0

type HostedAgentWebhookSignatureScheme string

HostedAgentWebhookSignatureScheme is how an external system authenticates a delivery.

const (
	HostedAgentWebhookSignatureHMACSHA256 HostedAgentWebhookSignatureScheme = "hmac-sha256"
	HostedAgentWebhookSignaturePlaintext  HostedAgentWebhookSignatureScheme = "plaintext"
)

type HostedAgentWorkspace added in v1.220.0

type HostedAgentWorkspace struct {
	// WorkspaceID is the opaque workspace identifier.
	WorkspaceID string `json:"workspace_id"`
	// Name is an optional label. It is not unique.
	Name  string                    `json:"name,omitempty"`
	State HostedAgentWorkspaceState `json:"state"`
	// AttachedSessionID is the session that holds the workspace; omitted when no
	// session does.
	AttachedSessionID string `json:"attached_session_id,omitempty"`
	SizeGibibytes     int32  `json:"size_gibibytes"`
	BytesUsed         int64  `json:"bytes_used"`
	// LastSavedAt is when the workspace contents were last saved; omitted until
	// the first save.
	LastSavedAt *Timestamp `json:"last_saved_at,omitempty"`
	CreatedAt   Timestamp  `json:"created_at"`
	// UpdatedAt is when a user request last changed the workspace. It equals
	// CreatedAt until then; changes the platform makes itself, such as a save
	// finishing, do not move it.
	UpdatedAt Timestamp `json:"updated_at"`
	// CreatedBy is the user (user UUID) who created the workspace. It never
	// changes.
	CreatedBy string `json:"created_by"`
	// UpdatedBy is the user (user UUID) whose request last changed the
	// workspace. It equals CreatedBy until then.
	UpdatedBy string `json:"updated_by"`
}

HostedAgentWorkspace is a persistent workspace: a separate set of files that outlives sessions and is attached to one session at a time. It is not the session's /workspace file transfer API (see HostedAgentWorkspaceTransfer and UploadWorkspace / DownloadWorkspace), which moves files in and out of a running session.

type HostedAgentWorkspaceCreateRequest added in v1.220.0

type HostedAgentWorkspaceCreateRequest struct {
	// SizeGibibytes is the size in GiB, from 1 to 100. The server validates it, and
	// a team limit can lower the maximum.
	SizeGibibytes int32 `json:"size_gibibytes"`
	// Name is an optional label. It is not unique.
	Name string `json:"name,omitempty"`
	// IdempotencyKey makes a retried create safe. It is sent as the
	// Idempotency-Key header, not in the body. Within 24 hours the same key and
	// body return the first workspace, while the same key with a different body
	// is rejected (HTTP 422). Keys are scoped to the team. Omitted when empty.
	IdempotencyKey string `json:"-"`
}

HostedAgentWorkspaceCreateRequest is the body for CreateWorkspace.

type HostedAgentWorkspaceDownload added in v1.211.0

type HostedAgentWorkspaceDownload struct {
	Body io.ReadCloser
	// IsArchive is true when the payload is a tar stream.
	IsArchive bool
	// SizeBytes is the X-Workspace-Size-Bytes hint (0 when unknown); payload
	// size only (excludes the integrity footer). Not a Content-Length.
	SizeBytes int64
}

HostedAgentWorkspaceDownload is the streaming result of DownloadWorkspace. Body strips the trailing integrity footer and verifies SHA-256 of the payload: read it to EOF and then Close it. A missing, invalid, or mismatched footer is an error. An HTTP X-Content-Sha256 trailer may still be present but is best-effort only; the body footer is the source of truth.

type HostedAgentWorkspaceDownloadRequest added in v1.211.0

type HostedAgentWorkspaceDownloadRequest struct {
	// Path is the source resolved inside the workspace root (/workspace). Required.
	Path string
	// AsArchive tar-streams the directory at Path when true.
	AsArchive bool
}

HostedAgentWorkspaceDownloadRequest is the input for DownloadWorkspace.

type HostedAgentWorkspaceListOptions added in v1.220.0

type HostedAgentWorkspaceListOptions struct {
	PageToken string `url:"page_token,omitempty"`
	// PageSize defaults to 50 on the server and is clamped to 200.
	PageSize int `url:"page_size,omitempty"`
	// State, when not empty, lists only workspaces in that state. It takes one
	// value; the server answers 400 for anything that is not one of the six
	// HostedAgentWorkspaceState values.
	State HostedAgentWorkspaceState `url:"state,omitempty"`
}

HostedAgentWorkspaceListOptions paginates ListWorkspaces (newest-first).

A page can hold fewer workspaces than PageSize, even none, while NextPageToken is not empty (for example when State skips records), so keep requesting pages until NextPageToken is empty.

type HostedAgentWorkspaceState added in v1.220.0

type HostedAgentWorkspaceState string

HostedAgentWorkspaceState is the lifecycle state of a persistent workspace.

const (
	// HostedAgentWorkspaceStateAvailable means no session holds the workspace.
	HostedAgentWorkspaceStateAvailable HostedAgentWorkspaceState = "AVAILABLE"
	// HostedAgentWorkspaceStateAttaching means a session is claiming the workspace.
	HostedAgentWorkspaceStateAttaching HostedAgentWorkspaceState = "ATTACHING"
	// HostedAgentWorkspaceStateAttached means a session holds the workspace.
	HostedAgentWorkspaceStateAttached HostedAgentWorkspaceState = "ATTACHED"
	// HostedAgentWorkspaceStateReleasing means the workspace is being released
	// by the session that held it.
	HostedAgentWorkspaceStateReleasing HostedAgentWorkspaceState = "RELEASING"
	// HostedAgentWorkspaceStateFailed means the workspace is not usable.
	HostedAgentWorkspaceStateFailed HostedAgentWorkspaceState = "FAILED"
	// HostedAgentWorkspaceStateDeleting means the workspace is being deleted. It
	// cannot be attached or deleted again until the delete finishes.
	HostedAgentWorkspaceStateDeleting HostedAgentWorkspaceState = "DELETING"
)

type HostedAgentWorkspaceTransfer added in v1.211.0

type HostedAgentWorkspaceTransfer struct {
	TransferID   string                                `json:"transfer_id"`
	Direction    HostedAgentWorkspaceTransferDirection `json:"direction,omitempty"`
	Status       HostedAgentWorkspaceTransferStatus    `json:"status"`
	UploadID     string                                `json:"upload_id,omitempty"`
	PartSize     int64                                 `json:"part_size,omitempty"`
	ExpiresAt    *Timestamp                            `json:"expires_at,omitempty"`
	SizeBytes    int64                                 `json:"size_bytes,omitempty"`
	BytesWritten int64                                 `json:"bytes_written,omitempty"`
	SHA256       string                                `json:"sha256,omitempty"`
	DownloadURL  string                                `json:"download_url,omitempty"`
	ErrorMessage string                                `json:"error_message,omitempty"`
}

HostedAgentWorkspaceTransfer is returned by create/commit/get transfer calls.

type HostedAgentWorkspaceTransferCancelRequest added in v1.211.0

type HostedAgentWorkspaceTransferCancelRequest struct {
	Reason string `json:"reason,omitempty"`
}

HostedAgentWorkspaceTransferCancelRequest aborts an in-flight transfer.

type HostedAgentWorkspaceTransferCancelResponse added in v1.211.0

type HostedAgentWorkspaceTransferCancelResponse struct {
	TransferID string                             `json:"transfer_id"`
	Aborted    bool                               `json:"aborted"`
	Status     HostedAgentWorkspaceTransferStatus `json:"status"`
}

HostedAgentWorkspaceTransferCancelResponse is returned by CancelWorkspaceTransfer.

type HostedAgentWorkspaceTransferCommitRequest added in v1.211.0

type HostedAgentWorkspaceTransferCommitRequest struct {
	SHA256 string `json:"sha256,omitempty"`
}

HostedAgentWorkspaceTransferCommitRequest finalizes an upload after all parts are PUT.

type HostedAgentWorkspaceTransferCreateRequest added in v1.211.0

type HostedAgentWorkspaceTransferCreateRequest struct {
	Direction HostedAgentWorkspaceTransferDirection `json:"direction"`
	Path      string                                `json:"path"`
	IsArchive bool                                  `json:"is_archive,omitempty"`
	AsArchive bool                                  `json:"as_archive,omitempty"`
	SizeBytes int64                                 `json:"size_bytes,omitempty"`
	SHA256    string                                `json:"sha256,omitempty"`
}

HostedAgentWorkspaceTransferCreateRequest starts a large upload or download. Upload uses IsArchive; download uses AsArchive (per OHS HTTP contract).

type HostedAgentWorkspaceTransferDirection added in v1.211.0

type HostedAgentWorkspaceTransferDirection string

HostedAgentWorkspaceTransferDirection is the direction of a staged transfer.

const (
	HostedAgentWorkspaceTransferDirectionUpload   HostedAgentWorkspaceTransferDirection = "upload"
	HostedAgentWorkspaceTransferDirectionDownload HostedAgentWorkspaceTransferDirection = "download"
)

type HostedAgentWorkspaceTransferPartUploadURL added in v1.211.0

type HostedAgentWorkspaceTransferPartUploadURL struct {
	PartNumber int    `json:"part_number"`
	UploadURL  string `json:"upload_url"`
}

HostedAgentWorkspaceTransferPartUploadURL is one entry in a part-upload-urls response. PUT the part bytes directly to UploadURL (not through OHS).

type HostedAgentWorkspaceTransferPartUploadURLs added in v1.211.0

type HostedAgentWorkspaceTransferPartUploadURLs struct {
	PartURLs []HostedAgentWorkspaceTransferPartUploadURL `json:"part_urls"`
}

HostedAgentWorkspaceTransferPartUploadURLs is returned by CreateWorkspaceTransferPartUploadURLs.

type HostedAgentWorkspaceTransferPartUploadURLsRequest added in v1.211.0

type HostedAgentWorkspaceTransferPartUploadURLsRequest struct {
	PartNumbers []int `json:"part_numbers"`
}

HostedAgentWorkspaceTransferPartUploadURLsRequest requests presigned URLs for one or more upload parts. PartNumbers are 1-based.

type HostedAgentWorkspaceTransferStatus added in v1.211.0

type HostedAgentWorkspaceTransferStatus string

HostedAgentWorkspaceTransferStatus is the status of a staged transfer.

const (
	HostedAgentWorkspaceTransferStatusPending    HostedAgentWorkspaceTransferStatus = "pending"
	HostedAgentWorkspaceTransferStatusInProgress HostedAgentWorkspaceTransferStatus = "in_progress"
	HostedAgentWorkspaceTransferStatusCompleted  HostedAgentWorkspaceTransferStatus = "completed"
	HostedAgentWorkspaceTransferStatusFailed     HostedAgentWorkspaceTransferStatus = "failed"
)

type HostedAgentWorkspaceUploadRequest added in v1.211.0

type HostedAgentWorkspaceUploadRequest struct {
	// Path is the destination resolved inside the workspace root (/workspace). Required.
	Path string
	// IsArchive indicates Body is a tar archive to extract at Path.
	IsArchive bool
	// ContentSHA256 is an optional hex SHA-256 digest of the payload, forwarded to the guest for verification.
	ContentSHA256 string
	// Body is the raw file or tar bytes to upload. Required.
	Body io.Reader
}

HostedAgentWorkspaceUploadRequest is the input for UploadWorkspace.

type HostedAgentWorkspaceUploadResponse added in v1.211.0

type HostedAgentWorkspaceUploadResponse struct {
	Path         string `json:"path"`
	BytesWritten int64  `json:"bytes_written"`
}

HostedAgentWorkspaceUploadResponse is returned by UploadWorkspace.

type HostedAgentWorkspacesListResponse added in v1.220.0

type HostedAgentWorkspacesListResponse struct {
	Workspaces []HostedAgentWorkspace `json:"workspaces"`
	// NextPageToken is empty when there are no more results.
	NextPageToken string `json:"next_page_token"`
}

HostedAgentWorkspacesListResponse is returned by ListWorkspaces.

type HostedAgentsService added in v1.211.0

type HostedAgentsService interface {
	// CreateSession provisions a session using the legacy JSON body (agent_kind,
	// repo_hint, idle_timeout_seconds). Prefer CreateSessionFromManifest for
	// Environment Spec YAML (or CreateSessionFromEnvironment for a saved
	// Environment).
	CreateSession(context.Context, *HostedAgentSessionCreateRequest) (*HostedAgentSession, *Response, error)
	// CreateSessionFromManifest uploads an environment spec YAML document
	// (Content-Type: application/x-yaml). Legacy agents.digitalocean.com/v1alpha1
	// Agent manifests are also accepted where the API still supports them.
	// For OpenAI sandbox-provider sessions (adapter codex-agentapi), pass
	// OpenAISessionID in opt so harness-api can persist openai_session_id for
	// attach correlation (?openai_session_id=). doctl resolves ${...}
	// placeholders client-side before calling this API; there is no
	// server-side variables map.
	CreateSessionFromManifest(context.Context, []byte, *HostedAgentManifestCreateOptions) (*HostedAgentSession, *Response, error)
	// CreateSessionFromEnvironment provisions a session from an existing
	// immutable Environment, referenced by config_id. The request uses
	// Content-Type: application/json with a {name, config_id} body (optional
	// resume_on_topoff and workspace_id); the environment's stored manifest and
	// declared credentials seed the session at create time. This is the only
	// create path that can attach a persistent workspace.
	CreateSessionFromEnvironment(context.Context, *HostedAgentSessionFromEnvironmentRequest) (*HostedAgentSession, *Response, error)
	// CreateSessionFromConfig is an alias for CreateSessionFromEnvironment.
	// Prefer CreateSessionFromEnvironment; this name remains for compatibility.
	CreateSessionFromConfig(context.Context, *HostedAgentSessionFromConfigRequest) (*HostedAgentSession, *Response, error)
	// ValidatePolicy checks a manifest's tool-permission policy against the
	// agent's capabilities without creating a session. Manifest is the same YAML
	// document accepted by CreateSessionFromManifest (Content-Type:
	// application/x-yaml). Returns per-rule verdicts; OK is false when any strict
	// rule is unsupported or unverified (i.e. CreateSession would reject it).
	ValidatePolicy(context.Context, []byte) (*HostedAgentPolicyValidationResult, *Response, error)
	ListSessions(context.Context, *HostedAgentSessionListOptions) (*HostedAgentSessionsListResponse, *Response, error)
	GetSession(context.Context, string) (*HostedAgentSession, *Response, error)
	// UpdateSession patches session-scoped settings on an existing session and
	// returns the updated snapshot. Never touches the agent manifest or config.
	UpdateSession(context.Context, string, *HostedAgentSessionUpdateRequest) (*HostedAgentSession, *Response, error)
	DestroySession(context.Context, string) (*Response, error)
	PauseSession(context.Context, string) (*Response, error)
	ResumeSession(context.Context, string) (*Response, error)
	StreamSession(context.Context, string, *HostedAgentSessionStreamOptions) (*HostedAgentSessionStream, *Response, error)
	SendInput(context.Context, string, *HostedAgentSendInputRequest) (*HostedAgentSendInputResponse, *Response, error)
	RelayRequest(context.Context, string, *HostedAgentRelayRequest) (*HostedAgentRelayResponse, *Response, error)
	ResolveHITL(context.Context, string, string, *HostedAgentResolveHITLRequest) (*Response, error)

	// StartProviderAuth begins (or resumes) the team-scoped connect flow for an
	// external provider (e.g. "github"). The team is derived from the
	// authenticated principal; there is no request body.
	StartProviderAuth(context.Context, string) (*HostedAgentProviderAuthStart, *Response, error)
	// PollProviderAuth reports whether a pending connect link has been
	// authorized. pollURL is the PollURL returned by StartProviderAuth.
	PollProviderAuth(context.Context, string, string) (*HostedAgentProviderAuthPoll, *Response, error)

	// ListConnections lists the team's connections for an external provider
	// (e.g. "github"), scoped server-side to the caller's team. Paginated with
	// page/per_page (tool-registry defaults to 20 per page and caps at 100).
	ListConnections(context.Context, string, *HostedAgentConnectionListOptions) (*HostedAgentConnectionsListResponse, *Response, error)
	// CreateConnection creates (or resumes) a connection binding an actor to the
	// provider. A still-pending connection comes back with an Authorization the
	// user must complete in a browser; an already-active one has none.
	CreateConnection(context.Context, string, *HostedAgentConnectionCreateRequest) (*HostedAgentConnectionEnvelope, *Response, error)
	// GetConnection reads one connection by id, used to poll a pending
	// authorization to completion.
	GetConnection(context.Context, string, string) (*HostedAgentConnectionEnvelope, *Response, error)
	// DeleteConnection revokes one connection by id and returns its final state.
	DeleteConnection(context.Context, string, string) (*HostedAgentConnectionEnvelope, *Response, error)
	ExecInSandbox(context.Context, string, *HostedAgentSandboxExecRequest) (*HostedAgentSandboxExecResponse, *Response, error)
	// ListSandboxSizes returns the customer-selectable sandbox (microVM) size
	// catalog (GET /v2/agents/sessions/sandbox/sizes). Every slug is accepted by
	// CreateSession as spec.sandbox.sizeSlug. Ordered smallest-to-largest; no
	// pagination.
	ListSandboxSizes(context.Context) (*HostedAgentSandboxSizesResponse, *Response, error)
	UploadWorkspace(context.Context, string, *HostedAgentWorkspaceUploadRequest) (*HostedAgentWorkspaceUploadResponse, *Response, error)
	DownloadWorkspace(context.Context, string, *HostedAgentWorkspaceDownloadRequest) (*HostedAgentWorkspaceDownload, *Response, error)

	// Large-file (>~50 MiB) staged workspace transfer APIs. Streaming
	// UploadWorkspace / DownloadWorkspace remain for smaller payloads.
	CreateWorkspaceTransfer(context.Context, string, *HostedAgentWorkspaceTransferCreateRequest) (*HostedAgentWorkspaceTransfer, *Response, error)
	CreateWorkspaceTransferPartUploadURLs(context.Context, string, string, *HostedAgentWorkspaceTransferPartUploadURLsRequest) (*HostedAgentWorkspaceTransferPartUploadURLs, *Response, error)
	CommitWorkspaceTransfer(context.Context, string, string, *HostedAgentWorkspaceTransferCommitRequest) (*HostedAgentWorkspaceTransfer, *Response, error)
	GetWorkspaceTransfer(context.Context, string, string) (*HostedAgentWorkspaceTransfer, *Response, error)
	CancelWorkspaceTransfer(context.Context, string, string, *HostedAgentWorkspaceTransferCancelRequest) (*HostedAgentWorkspaceTransferCancelResponse, *Response, error)

	// Checkpoint / fork / rollback (session save points).
	CreateCheckpoint(context.Context, string, *HostedAgentCheckpointCreateRequest) (*HostedAgentCheckpoint, *Response, error)
	ListCheckpoints(context.Context, string, *HostedAgentCheckpointListOptions) (*HostedAgentCheckpointsListResponse, *Response, error)
	GetCheckpoint(context.Context, string, string) (*HostedAgentCheckpoint, *Response, error)
	DeleteCheckpoint(context.Context, string, string) (*HostedAgentCheckpointDeleteResponse, *Response, error)
	ForkSession(context.Context, string, *HostedAgentForkSessionRequest) (*HostedAgentForkSessionResponse, *Response, error)
	RollbackToCheckpoint(context.Context, string, string) (*HostedAgentSession, *Response, error)

	// Persistent workspaces (separate sets of files that outlive sessions, attached to a
	// session at create time). Routes live under /v2/agents/workspaces. These are
	// distinct from the session /workspace file transfer APIs above.
	CreateWorkspace(context.Context, *HostedAgentWorkspaceCreateRequest) (*HostedAgentWorkspace, *Response, error)
	ListWorkspaces(context.Context, *HostedAgentWorkspaceListOptions) (*HostedAgentWorkspacesListResponse, *Response, error)
	GetWorkspace(context.Context, string) (*HostedAgentWorkspace, *Response, error)
	DeleteWorkspace(context.Context, string) (*Response, error)

	// Environments (immutable team-scoped environment definitions). Routes
	// live under /v2/agents/configs. Prefer the Environment* methods; the
	// AgentConfig* names remain as compatible aliases.
	ListEnvironments(context.Context, *HostedEnvironmentListOptions) (*HostedEnvironmentsListResponse, *Response, error)
	GetEnvironment(context.Context, string) (*HostedEnvironment, *Response, error)
	CreateEnvironment(context.Context, *HostedEnvironmentCreateRequest) (*HostedEnvironment, *Response, error)
	DeleteEnvironment(context.Context, string) (*Response, error)
	ListEnvironmentSessions(context.Context, string, *HostedAgentSessionListOptions) (*HostedAgentSessionsListResponse, *Response, error)
	// Prefer ListEnvironments / GetEnvironment / CreateEnvironment /
	// DeleteEnvironment / ListEnvironmentSessions.
	ListAgentConfigs(context.Context, *HostedAgentConfigListOptions) (*HostedAgentConfigsListResponse, *Response, error)
	GetAgentConfig(context.Context, string) (*HostedAgentConfig, *Response, error)
	CreateAgentConfig(context.Context, *HostedAgentConfigCreateRequest) (*HostedAgentConfig, *Response, error)
	DeleteAgentConfig(context.Context, string) (*Response, error)
	ListAgentConfigSessions(context.Context, string, *HostedAgentSessionListOptions) (*HostedAgentSessionsListResponse, *Response, error)

	// Team custom templates (BYOA). Routes live under /v2/agents/templates.
	ListTemplates(context.Context, *HostedAgentTemplateListOptions) (*HostedAgentTemplatesListResponse, *Response, error)
	CreateTemplate(context.Context, *HostedAgentTemplateCreateRequest) (*HostedAgentTemplate, *Response, error)
	GetTemplate(context.Context, string) (*HostedAgentTemplate, *Response, error)
	UpdateTemplate(context.Context, string, *HostedAgentTemplateUpdateRequest) (*HostedAgentTemplate, *Response, error)
	DeleteTemplate(context.Context, string) (*HostedAgentTemplateDeleteResponse, *Response, error)
	ListTemplateBuilds(context.Context, string, *HostedAgentTemplateBuildListOptions) (*HostedAgentTemplateBuildsListResponse, *Response, error)
	GetTemplateBuild(context.Context, string, string) (*HostedAgentTemplateBuild, *Response, error)
	GetTemplateBuildLogs(context.Context, string, string) (*HostedAgentTemplateBuildLogs, *Response, error)
}

HostedAgentsService exposes the DigitalOcean Hosted Agents session API (HarnessAPI from harness.proto). Routes live under /v2/agents/sessions.

type HostedAgentsServiceOp added in v1.211.0

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

HostedAgentsServiceOp handles communication with Hosted Agents session methods.

func (*HostedAgentsServiceOp) CancelWorkspaceTransfer added in v1.211.0

CancelWorkspaceTransfer aborts an in-flight transfer. Idempotent.

func (*HostedAgentsServiceOp) CommitWorkspaceTransfer added in v1.211.0

func (s *HostedAgentsServiceOp) CommitWorkspaceTransfer(ctx context.Context, sessionID, transferID string, input *HostedAgentWorkspaceTransferCommitRequest) (*HostedAgentWorkspaceTransfer, *Response, error)

CommitWorkspaceTransfer finalizes an upload after all parts have been PUT and starts applying the file into the workspace. Poll GetWorkspaceTransfer afterward.

func (*HostedAgentsServiceOp) CreateAgentConfig added in v1.211.0

CreateAgentConfig creates an immutable Environment from a name and environment spec YAML. Prefer CreateEnvironment; this name remains for compatibility. Secret values belong in the manifest, not as separate request fields.

func (*HostedAgentsServiceOp) CreateCheckpoint added in v1.211.0

CreateCheckpoint captures a save point for the session. The call blocks until the checkpoint reaches a terminal READY state (or the server returns an error). Checkpoints are only allowed between turns (at run.completed).

func (*HostedAgentsServiceOp) CreateConnection added in v1.219.0

CreateConnection creates (or resumes) a connection binding an actor to the provider.

func (*HostedAgentsServiceOp) CreateEnvironment added in v1.214.0

CreateEnvironment creates an immutable Environment from a name and environment spec YAML. Secret values belong in the manifest's secrets map (or legacy agents.yaml secret slots), not as separate request fields.

func (*HostedAgentsServiceOp) CreateSession added in v1.211.0

CreateSession provisions a new hosted agent session.

func (*HostedAgentsServiceOp) CreateSessionFromConfig added in v1.211.0

CreateSessionFromConfig provisions a session from a durable Environment. Prefer CreateSessionFromEnvironment; this name remains for compatibility. The JSON {name, config_id} body selects the environment-backed create path on the server, which reloads the Environment's stored manifest and resolves its declared credentials into the new session.

func (*HostedAgentsServiceOp) CreateSessionFromEnvironment added in v1.214.0

CreateSessionFromEnvironment provisions a session from a durable Environment. The JSON {name, config_id} body selects the environment-backed create path on the server, which reloads the Environment's stored manifest and resolves its declared credentials into the new session.

func (*HostedAgentsServiceOp) CreateSessionFromManifest added in v1.211.0

func (s *HostedAgentsServiceOp) CreateSessionFromManifest(ctx context.Context, manifest []byte, opt *HostedAgentManifestCreateOptions) (*HostedAgentSession, *Response, error)

func (*HostedAgentsServiceOp) CreateTemplate added in v1.211.0

CreateTemplate creates a team custom template and kicks a build.

func (*HostedAgentsServiceOp) CreateWorkspace added in v1.220.0

CreateWorkspace creates a persistent workspace. The API answers 201 for a new workspace and 200 when an IdempotencyKey replays an earlier create; both are returned as success. It answers 409 when the team is at its workspace limit, or when the key belongs to a workspace that is being deleted: retry in a moment, and the key then creates a new workspace.

func (*HostedAgentsServiceOp) CreateWorkspaceTransfer added in v1.211.0

CreateWorkspaceTransfer starts a large-file staged upload or download. For uploads, response includes part_size for client-side chunking.

func (*HostedAgentsServiceOp) CreateWorkspaceTransferPartUploadURLs added in v1.211.0

func (s *HostedAgentsServiceOp) CreateWorkspaceTransferPartUploadURLs(ctx context.Context, sessionID, transferID string, input *HostedAgentWorkspaceTransferPartUploadURLsRequest) (*HostedAgentWorkspaceTransferPartUploadURLs, *Response, error)

CreateWorkspaceTransferPartUploadURLs returns presigned URLs to PUT one or more upload parts. Upload only. Part numbers start at 1. If a URL expires, request that part_number again.

func (*HostedAgentsServiceOp) DeleteAgentConfig added in v1.211.0

func (s *HostedAgentsServiceOp) DeleteAgentConfig(ctx context.Context, configID string) (*Response, error)

DeleteAgentConfig soft-deletes an Environment. The API returns HTTP 204. Prefer DeleteEnvironment; this name remains for compatibility.

func (*HostedAgentsServiceOp) DeleteCheckpoint added in v1.211.0

func (s *HostedAgentsServiceOp) DeleteCheckpoint(ctx context.Context, sessionID, checkpointID string) (*HostedAgentCheckpointDeleteResponse, *Response, error)

DeleteCheckpoint removes a checkpoint (DB row + substrate capture). Idempotent: deleting an already-gone checkpoint still returns success.

func (*HostedAgentsServiceOp) DeleteConnection added in v1.219.0

func (s *HostedAgentsServiceOp) DeleteConnection(ctx context.Context, provider, id string) (*HostedAgentConnectionEnvelope, *Response, error)

DeleteConnection revokes one connection by id.

func (*HostedAgentsServiceOp) DeleteEnvironment added in v1.214.0

func (s *HostedAgentsServiceOp) DeleteEnvironment(ctx context.Context, environmentID string) (*Response, error)

DeleteEnvironment soft-deletes an Environment. The API returns HTTP 204.

func (*HostedAgentsServiceOp) DeleteTemplate added in v1.211.0

DeleteTemplate deletes a team custom template.

func (*HostedAgentsServiceOp) DeleteWorkspace added in v1.220.0

func (s *HostedAgentsServiceOp) DeleteWorkspace(ctx context.Context, workspaceID string) (*Response, error)

DeleteWorkspace deletes a persistent workspace. The API returns HTTP 204 once its files are gone, or 409 when a session still holds the workspace or it is attaching or being saved; retry after the session is removed or the save ends. A repeat call after a delete is a 404.

func (*HostedAgentsServiceOp) DestroySession added in v1.211.0

func (s *HostedAgentsServiceOp) DestroySession(ctx context.Context, sessionID string) (*Response, error)

DestroySession tears down a session. The API returns HTTP 204 on success.

func (*HostedAgentsServiceOp) DownloadWorkspace added in v1.211.0

DownloadWorkspace streams a file (or tar archive) out of the session workspace. Callers MUST read the returned Body to EOF and then Close it; the body strips the trailing integrity footer and verifies SHA-256 of the payload.

func (*HostedAgentsServiceOp) ExecInSandbox added in v1.211.0

ExecInSandbox runs a command inside the session sandbox.

func (*HostedAgentsServiceOp) ForkSession added in v1.211.0

ForkSession creates N independent child sessions from a checkpoint (or from "now" when FromCheckpointID is empty). Count defaults to 1; max is HostedAgentForkMaxCount. The operation is all-or-nothing: on failure nothing is left running.

func (*HostedAgentsServiceOp) GetAgentConfig added in v1.211.0

func (s *HostedAgentsServiceOp) GetAgentConfig(ctx context.Context, configID string) (*HostedAgentConfig, *Response, error)

GetAgentConfig returns one Environment with redacted credential slots. Prefer GetEnvironment; this name remains for compatibility.

func (*HostedAgentsServiceOp) GetCheckpoint added in v1.211.0

func (s *HostedAgentsServiceOp) GetCheckpoint(ctx context.Context, sessionID, checkpointID string) (*HostedAgentCheckpoint, *Response, error)

GetCheckpoint returns a single checkpoint by ID.

func (*HostedAgentsServiceOp) GetConnection added in v1.219.0

func (s *HostedAgentsServiceOp) GetConnection(ctx context.Context, provider, id string) (*HostedAgentConnectionEnvelope, *Response, error)

GetConnection reads one connection by id.

func (*HostedAgentsServiceOp) GetEnvironment added in v1.214.0

func (s *HostedAgentsServiceOp) GetEnvironment(ctx context.Context, environmentID string) (*HostedEnvironment, *Response, error)

GetEnvironment returns one Environment with redacted credential slots.

func (*HostedAgentsServiceOp) GetSession added in v1.211.0

func (s *HostedAgentsServiceOp) GetSession(ctx context.Context, sessionID string) (*HostedAgentSession, *Response, error)

GetSession returns a single session by ID.

func (*HostedAgentsServiceOp) GetTemplate added in v1.211.0

func (s *HostedAgentsServiceOp) GetTemplate(ctx context.Context, templateID string) (*HostedAgentTemplate, *Response, error)

GetTemplate returns a team custom template by public id.

func (*HostedAgentsServiceOp) GetTemplateBuild added in v1.211.0

func (s *HostedAgentsServiceOp) GetTemplateBuild(ctx context.Context, templateID, buildID string) (*HostedAgentTemplateBuild, *Response, error)

GetTemplateBuild returns a single template build.

func (*HostedAgentsServiceOp) GetTemplateBuildLogs added in v1.211.0

func (s *HostedAgentsServiceOp) GetTemplateBuildLogs(ctx context.Context, templateID, buildID string) (*HostedAgentTemplateBuildLogs, *Response, error)

GetTemplateBuildLogs returns a short-lived signed URL for archived build logs.

func (*HostedAgentsServiceOp) GetWorkspace added in v1.220.0

func (s *HostedAgentsServiceOp) GetWorkspace(ctx context.Context, workspaceID string) (*HostedAgentWorkspace, *Response, error)

GetWorkspace returns a single persistent workspace by ID.

func (*HostedAgentsServiceOp) GetWorkspaceTransfer added in v1.211.0

func (s *HostedAgentsServiceOp) GetWorkspaceTransfer(ctx context.Context, sessionID, transferID string) (*HostedAgentWorkspaceTransfer, *Response, error)

GetWorkspaceTransfer polls transfer status. On a completed download, DownloadURL and SHA256 are set; verify SHA256(file) == SHA256 after fetching DownloadURL. This path has no DOWSSHA1 body footer.

func (*HostedAgentsServiceOp) ListAgentConfigSessions added in v1.211.0

ListAgentConfigSessions lists sessions created from an Environment. Prefer ListEnvironmentSessions; this name remains for compatibility.

func (*HostedAgentsServiceOp) ListAgentConfigs added in v1.211.0

ListAgentConfigs lists active Environments for the caller's team. Prefer ListEnvironments; this name remains for compatibility.

func (*HostedAgentsServiceOp) ListCheckpoints added in v1.211.0

ListCheckpoints returns checkpoints for a session, newest first.

func (*HostedAgentsServiceOp) ListConnections added in v1.219.0

ListConnections lists the team's connections for an external provider.

func (*HostedAgentsServiceOp) ListEnvironmentSessions added in v1.214.0

ListEnvironmentSessions lists sessions created from an Environment.

func (*HostedAgentsServiceOp) ListEnvironments added in v1.214.0

ListEnvironments lists active Environments for the caller's team.

func (*HostedAgentsServiceOp) ListSandboxSizes added in v1.211.0

ListSandboxSizes returns the customer-selectable sandbox (microVM) size catalog. The set is the single source of truth shared with create-time validation; every returned slug is accepted as spec.sandbox.sizeSlug. Sizes are ordered smallest-to-largest. The catalog is static and independent of team/session; there is no pagination.

func (*HostedAgentsServiceOp) ListSessions added in v1.211.0

ListSessions returns sessions visible to the caller's team.

The server omits simulation and evaluation sessions from the list so customer surfaces stay free of product-owned internal runs. GetSession by session_id still returns those sessions for the owning product workflow.

func (*HostedAgentsServiceOp) ListTemplateBuilds added in v1.211.0

ListTemplateBuilds returns build history for a template.

func (*HostedAgentsServiceOp) ListTemplates added in v1.211.0

ListTemplates returns the caller's team custom templates.

func (*HostedAgentsServiceOp) ListWorkspaces added in v1.220.0

ListWorkspaces returns the team's persistent workspaces, newest first.

func (*HostedAgentsServiceOp) PauseSession added in v1.211.0

func (s *HostedAgentsServiceOp) PauseSession(ctx context.Context, sessionID string) (*Response, error)

func (*HostedAgentsServiceOp) PollProviderAuth added in v1.211.0

func (s *HostedAgentsServiceOp) PollProviderAuth(ctx context.Context, provider, pollURL string) (*HostedAgentProviderAuthPoll, *Response, error)

PollProviderAuth checks whether a pending connect link has been authorized. pollURL is the PollURL returned by StartProviderAuth; it is forwarded to the server as the poll_url query parameter.

func (*HostedAgentsServiceOp) RelayRequest added in v1.211.0

RelayRequest forwards one native agent-protocol request frame to the session's agent and returns its reply verbatim. Blocks on the agent, so it is slower than the other session calls; an empty reply means the in-sandbox adapter declined the method.

func (*HostedAgentsServiceOp) ResolveHITL added in v1.211.0

func (s *HostedAgentsServiceOp) ResolveHITL(ctx context.Context, sessionID, requestID string, body *HostedAgentResolveHITLRequest) (*Response, error)

ResolveHITL submits a human-in-the-loop decision. The API returns HTTP 204 on success.

func (*HostedAgentsServiceOp) ResumeSession added in v1.211.0

func (s *HostedAgentsServiceOp) ResumeSession(ctx context.Context, sessionID string) (*Response, error)

func (*HostedAgentsServiceOp) RollbackToCheckpoint added in v1.211.0

func (s *HostedAgentsServiceOp) RollbackToCheckpoint(ctx context.Context, sessionID, checkpointID string) (*HostedAgentSession, *Response, error)

RollbackToCheckpoint rewinds the session in place to the given checkpoint. The session_id is unchanged; the underlying sandbox is replaced. Returns the updated session.

func (*HostedAgentsServiceOp) SendInput added in v1.211.0

SendInput enqueues user text for the in-sandbox agent runtime.

func (*HostedAgentsServiceOp) StartProviderAuth added in v1.211.0

func (s *HostedAgentsServiceOp) StartProviderAuth(ctx context.Context, provider string) (*HostedAgentProviderAuthStart, *Response, error)

StartProviderAuth begins (or resumes) the team-scoped connect flow for an external provider. The server derives the team from the authenticated principal, so the POST carries an empty JSON object body.

func (*HostedAgentsServiceOp) StreamSession added in v1.211.0

StreamSession opens the SSE stream for a session. Callers MUST Close the stream.

Both reads are served by the data plane at GET .../sessions/{id}/events; the two modes differ in where the stream starts and whether it ends:

  • Live (the default) delivers forward-only from the moment of attach, preceded by whatever recent history the server decides to replay, and holds the connection open. ReplayFrom is sent as the standard Last-Event-ID header.
  • ReplayOnly adds ?replay_only=true: the server writes the session's stored event history and then ends the stream, so the read terminates on its own. ReplayFrom is sent as the replay_from query parameter, since it is an explicit pagination cursor here rather than a resume hint. Before and Limit page backwards from an event id within this mode; see HostedAgentSessionStreamOptions.Before and HasMore.

Both carry HostedAgentEventKindStreamState control frames (see HostedAgentStreamState). A replay-only read reports catching_up and then simply ends; it never reaches live.

func (*HostedAgentsServiceOp) UpdateSession added in v1.211.0

UpdateSession patches session-scoped settings and returns the updated session. Only the fields set on update are sent; the rest are left alone. A session in a terminal state (destroyed, failed) cannot be patched and the API answers 409.

func (*HostedAgentsServiceOp) UpdateTemplate added in v1.211.0

UpdateTemplate updates a team template's source and kicks a new build.

func (*HostedAgentsServiceOp) UploadWorkspace added in v1.211.0

UploadWorkspace streams a file (or tar archive) into the session workspace.

func (*HostedAgentsServiceOp) ValidatePolicy added in v1.211.0

ValidatePolicy checks a manifest's tool-permission policy against the agent's capabilities without creating a session.

type HostedEnvironment added in v1.214.0

type HostedEnvironment = HostedAgentConfig

Advertised Environment aliases. Prefer these over the HostedAgentConfig* names; the Agent Config identifiers remain as compatible aliases.

type HostedEnvironmentCreateRequest added in v1.214.0

type HostedEnvironmentCreateRequest = HostedAgentConfigCreateRequest

Advertised Environment aliases. Prefer these over the HostedAgentConfig* names; the Agent Config identifiers remain as compatible aliases.

type HostedEnvironmentCredentialSlot added in v1.214.0

type HostedEnvironmentCredentialSlot = HostedAgentConfigCredentialSlot

Advertised Environment aliases. Prefer these over the HostedAgentConfig* names; the Agent Config identifiers remain as compatible aliases.

type HostedEnvironmentListOptions added in v1.214.0

type HostedEnvironmentListOptions = HostedAgentConfigListOptions

Advertised Environment aliases. Prefer these over the HostedAgentConfig* names; the Agent Config identifiers remain as compatible aliases.

type HostedEnvironmentSummary added in v1.214.0

type HostedEnvironmentSummary = HostedAgentConfigSummary

Advertised Environment aliases. Prefer these over the HostedAgentConfig* names; the Agent Config identifiers remain as compatible aliases.

type HostedEnvironmentsListResponse added in v1.214.0

type HostedEnvironmentsListResponse = HostedAgentConfigsListResponse

Advertised Environment aliases. Prefer these over the HostedAgentConfig* names; the Agent Config identifiers remain as compatible aliases.

type Image

type Image struct {
	ID            int      `json:"id,float64,omitempty"`
	Name          string   `json:"name,omitempty"`
	Type          string   `json:"type,omitempty"`
	Distribution  string   `json:"distribution,omitempty"`
	Slug          string   `json:"slug,omitempty"`
	Public        bool     `json:"public,omitempty"`
	Regions       []string `json:"regions,omitempty"`
	MinDiskSize   int      `json:"min_disk_size,omitempty"`
	SizeGigaBytes float64  `json:"size_gigabytes,omitempty"`
	Created       string   `json:"created_at,omitempty"`
	Description   string   `json:"description,omitempty"`
	Tags          []string `json:"tags,omitempty"`
	Status        string   `json:"status,omitempty"`
	ErrorMessage  string   `json:"error_message,omitempty"`
}

Image represents a DigitalOcean Image

func (Image) String

func (i Image) String() string

type ImageActionsService

type ImageActionsService interface {
	Get(context.Context, int, int) (*Action, *Response, error)
	GetByURI(context.Context, string) (*Action, *Response, error)
	Transfer(context.Context, int, *ActionRequest) (*Action, *Response, error)
	Convert(context.Context, int) (*Action, *Response, error)
}

ImageActionsService is an interface for interfacing with the image actions endpoints of the DigitalOcean API See: https://docs.digitalocean.com/reference/api/api-reference/#tag/Image-Actions

type ImageActionsServiceOp added in v0.3.0

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

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

func (*ImageActionsServiceOp) Convert added in v1.0.0

func (i *ImageActionsServiceOp) Convert(ctx context.Context, imageID int) (*Action, *Response, error)

Convert an image to a snapshot

func (*ImageActionsServiceOp) Get added in v0.3.0

func (i *ImageActionsServiceOp) Get(ctx context.Context, imageID, actionID int) (*Action, *Response, error)

Get an action for a particular image by id.

func (*ImageActionsServiceOp) GetByURI added in v1.90.0

func (i *ImageActionsServiceOp) GetByURI(ctx context.Context, rawurl string) (*Action, *Response, error)

GetByURI gets an action for a particular image by URI.

func (*ImageActionsServiceOp) Transfer added in v0.3.0

func (i *ImageActionsServiceOp) Transfer(ctx context.Context, imageID int, transferRequest *ActionRequest) (*Action, *Response, error)

Transfer an image

type ImageGenerateParams added in v1.191.0

type ImageGenerateParams struct {
	Model             string  `json:"model"`
	Prompt            string  `json:"prompt"`
	N                 int     `json:"n"`
	Background        *string `json:"background,omitempty"`
	Moderation        *string `json:"moderation,omitempty"`
	OutputCompression *int    `json:"output_compression,omitempty"`
	OutputFormat      *string `json:"output_format,omitempty"`
	PartialImages     *int    `json:"partial_images,omitempty"`
	Quality           *string `json:"quality,omitempty"`
	Size              *string `json:"size,omitempty"`
	Stream            *bool   `json:"stream,omitempty"`
	User              *string `json:"user,omitempty"`
}

ImageGenerateParams is the request body for POST /v1/images/generations.

type ImageGenerationService added in v1.191.0

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

ImageGenerationService exposes POST /v1/images/generations

func (*ImageGenerationService) Generate added in v1.191.0

Generate creates one or more images from a text prompt.

func (*ImageGenerationService) GenerateStreaming added in v1.191.0

GenerateStreaming opens an SSE stream of partial-image then completed events. body.Stream is forced to true; callers MUST Close the returned stream.

type ImageGenerationStream added in v1.191.0

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

ImageGenerationStream is a typed iterator over a /v1/images/generations SSE stream.

func (*ImageGenerationStream) Close added in v1.191.0

func (s *ImageGenerationStream) Close() error

Close releases the underlying HTTP response body. Always call Close.

func (*ImageGenerationStream) Current added in v1.191.0

Current returns the most recent event produced by Next.

func (*ImageGenerationStream) Err added in v1.191.0

func (s *ImageGenerationStream) Err() error

Err returns any non-EOF error encountered during iteration.

func (*ImageGenerationStream) Next added in v1.191.0

func (s *ImageGenerationStream) Next() bool

Next advances the stream to the next event. Returns false on EOF or error.

type ImageGenerationStreamEvent added in v1.191.0

type ImageGenerationStreamEvent struct {
	Type              string                `json:"type"`
	CreatedAt         int64                 `json:"created_at,omitempty"`
	Size              string                `json:"size,omitempty"`
	Quality           string                `json:"quality,omitempty"`
	Background        string                `json:"background,omitempty"`
	OutputFormat      string                `json:"output_format,omitempty"`
	PartialImageIndex int                   `json:"partial_image_index,omitempty"`
	B64JSON           string                `json:"b64_json,omitempty"`
	Usage             *ImageGenerationUsage `json:"usage,omitempty"`
}

ImageGenerationStreamEvent is one streamed event from /v1/images/generations (Type is e.g. "image_generation.partial_image" or "image_generation.completed").

type ImageGenerationUsage added in v1.191.0

type ImageGenerationUsage struct {
	InputTokens        int                          `json:"input_tokens"`
	OutputTokens       int                          `json:"output_tokens"`
	TotalTokens        int                          `json:"total_tokens"`
	InputTokensDetails *ImageGenerationUsageDetails `json:"input_tokens_details,omitempty"`
}

ImageGenerationUsage is the usage block for an image-generation response.

type ImageGenerationUsageDetails added in v1.191.0

type ImageGenerationUsageDetails struct {
	ImageTokens int `json:"image_tokens"`
	TextTokens  int `json:"text_tokens"`
}

ImageGenerationUsageDetails breaks down image-generation input tokens.

type ImageSourceSpec added in v1.52.0

type ImageSourceSpec struct {
	RegistryType ImageSourceSpecRegistryType `json:"registry_type,omitempty"`
	// The registry name. Must be left empty for the `DOCR` registry type.  Required for the `DOCKER_HUB` registry type.
	Registry string `json:"registry,omitempty"`
	// The repository name.
	Repository string `json:"repository,omitempty"`
	// The repository tag. Defaults to `latest` if not provided and no digest is provided. Cannot be specified if digest is provided.
	Tag string `json:"tag,omitempty"`
	// The image digest. Cannot be specified if tag is provided.
	Digest string `json:"digest,omitempty"`
	// The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value should be used. - \"$username:$access_token\" for registries of type `DOCKER_HUB`. - \"$username:$access_token\" for registries of type `GHCR`.
	RegistryCredentials string                       `json:"registry_credentials,omitempty"`
	DeployOnPush        *ImageSourceSpecDeployOnPush `json:"deploy_on_push,omitempty"`
}

ImageSourceSpec struct for ImageSourceSpec

func (*ImageSourceSpec) GetDeployOnPush added in v1.86.0

func (i *ImageSourceSpec) GetDeployOnPush() *ImageSourceSpecDeployOnPush

GetDeployOnPush returns the DeployOnPush field.

func (*ImageSourceSpec) GetDigest added in v1.104.0

func (i *ImageSourceSpec) GetDigest() string

GetDigest returns the Digest field.

func (*ImageSourceSpec) GetRegistry added in v1.85.0

func (i *ImageSourceSpec) GetRegistry() string

GetRegistry returns the Registry field.

func (*ImageSourceSpec) GetRegistryCredentials added in v1.107.0

func (i *ImageSourceSpec) GetRegistryCredentials() string

GetRegistryCredentials returns the RegistryCredentials field.

func (*ImageSourceSpec) GetRegistryType added in v1.85.0

func (i *ImageSourceSpec) GetRegistryType() ImageSourceSpecRegistryType

GetRegistryType returns the RegistryType field.

func (*ImageSourceSpec) GetRepository added in v1.85.0

func (i *ImageSourceSpec) GetRepository() string

GetRepository returns the Repository field.

func (*ImageSourceSpec) GetTag added in v1.85.0

func (i *ImageSourceSpec) GetTag() string

GetTag returns the Tag field.

func (*ImageSourceSpec) GetType added in v1.85.0

func (s *ImageSourceSpec) GetType() AppSourceType

GetType returns the Image source type.

type ImageSourceSpecDeployOnPush added in v1.86.0

type ImageSourceSpecDeployOnPush struct {
	// Automatically deploy new images. Only for DOCR images. Can't be enabled when a specific digest is specified.
	Enabled bool `json:"enabled,omitempty"`
}

ImageSourceSpecDeployOnPush struct for ImageSourceSpecDeployOnPush

func (*ImageSourceSpecDeployOnPush) GetEnabled added in v1.86.0

func (i *ImageSourceSpecDeployOnPush) GetEnabled() bool

GetEnabled returns the Enabled field.

type ImageSourceSpecRegistryType added in v1.52.0

type ImageSourceSpecRegistryType string

ImageSourceSpecRegistryType - DOCR: The DigitalOcean container registry type. - DOCKER_HUB: The DockerHub container registry type. - GHCR: The GitHub container registry type.

const (
	ImageSourceSpecRegistryType_Unspecified ImageSourceSpecRegistryType = "UNSPECIFIED"
	ImageSourceSpecRegistryType_DOCR        ImageSourceSpecRegistryType = "DOCR"
	ImageSourceSpecRegistryType_DockerHub   ImageSourceSpecRegistryType = "DOCKER_HUB"
	ImageSourceSpecRegistryType_Ghcr        ImageSourceSpecRegistryType = "GHCR"
)

List of ImageSourceSpecRegistryType

type ImageUpdateRequest added in v0.9.0

type ImageUpdateRequest struct {
	Name         string `json:"name,omitempty"`
	Distribution string `json:"distribution,omitempty"`
	Description  string `json:"description,omitempty"`
}

ImageUpdateRequest represents a request to update an image.

type ImagesResponse added in v1.191.0

type ImagesResponse struct {
	Created      int64                 `json:"created"`
	Data         []GeneratedImage      `json:"data"`
	Background   string                `json:"background,omitempty"`
	OutputFormat string                `json:"output_format,omitempty"`
	Quality      string                `json:"quality,omitempty"`
	Size         string                `json:"size,omitempty"`
	Usage        *ImageGenerationUsage `json:"usage,omitempty"`
}

ImagesResponse is returned by POST /v1/images/generations when stream is false.

type ImagesService

type ImagesService interface {
	List(context.Context, *ListOptions) ([]Image, *Response, error)
	ListDistribution(ctx context.Context, opt *ListOptions) ([]Image, *Response, error)
	ListApplication(ctx context.Context, opt *ListOptions) ([]Image, *Response, error)
	ListUser(ctx context.Context, opt *ListOptions) ([]Image, *Response, error)
	ListByTag(ctx context.Context, tag string, opt *ListOptions) ([]Image, *Response, error)
	GetByID(context.Context, int) (*Image, *Response, error)
	GetBySlug(context.Context, string) (*Image, *Response, error)
	Create(context.Context, *CustomImageCreateRequest) (*Image, *Response, error)
	Update(context.Context, int, *ImageUpdateRequest) (*Image, *Response, error)
	Delete(context.Context, int) (*Response, error)
}

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

type ImagesServiceOp added in v0.3.0

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

ImagesServiceOp handles communication with the image related methods of the DigitalOcean API.

func (*ImagesServiceOp) Create added in v1.7.1

func (s *ImagesServiceOp) Create(ctx context.Context, createRequest *CustomImageCreateRequest) (*Image, *Response, error)

Create a new image

func (*ImagesServiceOp) Delete added in v0.9.0

func (s *ImagesServiceOp) Delete(ctx context.Context, imageID int) (*Response, error)

Delete an image.

func (*ImagesServiceOp) GetByID added in v0.9.0

func (s *ImagesServiceOp) GetByID(ctx context.Context, imageID int) (*Image, *Response, error)

GetByID retrieves an image by id.

func (*ImagesServiceOp) GetBySlug added in v0.9.0

func (s *ImagesServiceOp) GetBySlug(ctx context.Context, slug string) (*Image, *Response, error)

GetBySlug retrieves an image by slug.

func (*ImagesServiceOp) List added in v0.3.0

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

List lists all the images available.

func (*ImagesServiceOp) ListApplication added in v0.9.0

func (s *ImagesServiceOp) ListApplication(ctx context.Context, opt *ListOptions) ([]Image, *Response, error)

ListApplication lists all the application images.

func (*ImagesServiceOp) ListByTag added in v1.7.1

func (s *ImagesServiceOp) ListByTag(ctx context.Context, tag string, opt *ListOptions) ([]Image, *Response, error)

ListByTag lists all images with a specific tag applied.

func (*ImagesServiceOp) ListDistribution added in v0.9.0

func (s *ImagesServiceOp) ListDistribution(ctx context.Context, opt *ListOptions) ([]Image, *Response, error)

ListDistribution lists all the distribution images.

func (*ImagesServiceOp) ListUser added in v0.9.0

func (s *ImagesServiceOp) ListUser(ctx context.Context, opt *ListOptions) ([]Image, *Response, error)

ListUser lists all the user images.

func (*ImagesServiceOp) Update added in v0.9.0

func (s *ImagesServiceOp) Update(ctx context.Context, imageID int, updateRequest *ImageUpdateRequest) (*Image, *Response, error)

Update an image name.

type InactivitySleepLoadingPage added in v1.174.0

type InactivitySleepLoadingPage struct {
	// Whether to show a loading page while the service is waking up from sleep. Defaults to false. If this is enabled and there is a request header `Accept` containing `text/html`, then the app will show a loading page with a 503 status code until the service is woken up.
	Enabled bool `json:"enabled,omitempty"`
	// A custom loading page to display when the service is woken up from sleep. If not provided, a default loading page will be shown.
	CustomURL string `json:"custom_url,omitempty"`
}

InactivitySleepLoadingPage struct for InactivitySleepLoadingPage

func (*InactivitySleepLoadingPage) GetCustomURL added in v1.174.0

func (i *InactivitySleepLoadingPage) GetCustomURL() string

GetCustomURL returns the CustomURL field.

func (*InactivitySleepLoadingPage) GetEnabled added in v1.174.0

func (i *InactivitySleepLoadingPage) GetEnabled() bool

GetEnabled returns the Enabled field.

type InboundRule added in v1.1.0

type InboundRule struct {
	Protocol  string             `json:"protocol,omitempty"`
	PortRange string             `json:"ports,omitempty"`
	Sources   *Sources           `json:"sources"`
	Action    FirewallRuleAction `json:"action,omitempty"`
}

InboundRule represents a DigitalOcean Firewall inbound rule.

type IndexReplication added in v1.121.0

type IndexReplication struct {
	LeaderIndex   string `json:"leader_index,omitempty"`
	LeaderProject string `json:"leader_project,omitempty"`
	LeaderService string `json:"leader_service,omitempty"`
}

type IndexedDataSource added in v1.165.0

type IndexedDataSource struct {
	CompletedAt       *Timestamp `json:"completed_at,omitempty"`
	DataSourceUuid    string     `json:"data_source_uuid,omitempty"`
	ErrorDetails      string     `json:"error_details,omitempty"`
	ErrorMsg          string     `json:"error_msg,omitempty"`
	FailedItemCount   string     `json:"failed_item_count,omitempty"`
	IndexedFileCount  string     `json:"indexed_file_count,omitempty"`
	IndexedItemCount  string     `json:"indexed_item_count,omitempty"`
	RemovedItemCount  string     `json:"removed_item_count,omitempty"`
	SkippedItemCount  string     `json:"skipped_item_count,omitempty"`
	StartedAt         *Timestamp `json:"started_at,omitempty"`
	Status            string     `json:"status,omitempty"`
	TotalBytes        string     `json:"total_bytes,omitempty"`
	TotalBytesIndexed string     `json:"total_bytes_indexed,omitempty"`
	TotalFileCount    string     `json:"total_file_count,omitempty"`
}

IndexedDataSource represents a data source within an indexing job

type IndexingJobDataSourcesResponse added in v1.165.0

type IndexingJobDataSourcesResponse struct {
	IndexedDataSources []IndexedDataSource `json:"indexed_data_sources"`
}

IndexingJobDataSourcesResponse represents the response from listing data sources for an indexing job

func (IndexingJobDataSourcesResponse) String added in v1.165.0

type IndexingJobResponse added in v1.165.0

type IndexingJobResponse struct {
	Job LastIndexingJob `json:"job"`
}

IndexingJobResponse represents the response from retrieving a single indexing job

func (IndexingJobResponse) String added in v1.165.0

func (a IndexingJobResponse) String() string

type IndexingJobsResponse added in v1.164.0

type IndexingJobsResponse struct {
	Jobs  []LastIndexingJob `json:"jobs"`
	Links *Links            `json:"links,omitempty"`
	Meta  *Meta             `json:"meta,omitempty"`
}

IndexingJobsResponse represents the response from listing indexing jobs

type InferenceError added in v1.191.0

type InferenceError struct {
	Type  string `json:"type"`
	Error struct {
		Type    string `json:"type"`
		Message string `json:"message"`
	} `json:"error"`
}

InferenceError is the error envelope returned by the /v1/messages endpoint for client-side validation failures (HTTP 400).

type InferenceModel added in v1.191.0

type InferenceModel struct {
	ID      string `json:"id"`
	Object  string `json:"object"`
	Created int64  `json:"created"`
	OwnedBy string `json:"owned_by"`
}

InferenceModel is a single model entry returned by GET /v1/models.

type InferenceRouter added in v1.194.1

type InferenceRouter struct {
	UUID        string                 `json:"uuid,omitempty"`
	Name        string                 `json:"name,omitempty"`
	Description string                 `json:"description,omitempty"`
	CreatedAt   *Timestamp             `json:"created_at,omitempty"`
	UpdatedAt   *Timestamp             `json:"updated_at,omitempty"`
	Config      *InferenceRouterConfig `json:"config,omitempty"`
}

InferenceRouter represents a GenAI inference router resource.

func (InferenceRouter) String added in v1.194.1

func (r InferenceRouter) String() string

type InferenceRouterConfig added in v1.194.1

type InferenceRouterConfig struct {
	FallbackModels []string        `json:"fallback_models,omitempty"`
	Policies       json.RawMessage `json:"policies,omitempty"`
}

InferenceRouterConfig holds routing configuration for an inference router.

func (InferenceRouterConfig) String added in v1.194.1

func (r InferenceRouterConfig) String() string

type InferenceRouterCreateRequest added in v1.194.1

type InferenceRouterCreateRequest struct {
	Name           string          `json:"name"`
	Description    string          `json:"description,omitempty"`
	Policies       json.RawMessage `json:"policies,omitempty"`
	FallbackModels []string        `json:"fallback_models"`
}

InferenceRouterCreateRequest defines the body for creating an inference router. Field names match POST /v2/gen-ai/models/routers (see DigitalOcean API / pydo.genai.create_model_router). FallbackModels must contain at least one non-empty model name (enforced by CreateInferenceRouter).

type InferenceRouterDeleteResponse added in v1.194.1

type InferenceRouterDeleteResponse struct {
	UUID string `json:"uuid,omitempty"`
}

InferenceRouterDeleteResponse is returned when deleting an inference router.

func (InferenceRouterDeleteResponse) String added in v1.194.1

type InferenceRouterSummary added in v1.194.1

type InferenceRouterSummary struct {
	UUID        string `json:"uuid,omitempty"`
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

InferenceRouterSummary is a compact inference router returned from list operations.

func (InferenceRouterSummary) String added in v1.194.1

func (r InferenceRouterSummary) String() string

type InferenceRouterTaskPreset added in v1.194.1

type InferenceRouterTaskPreset struct {
	TaskSlug    string   `json:"task_slug,omitempty"`
	Name        string   `json:"name,omitempty"`
	Category    string   `json:"category,omitempty"`
	Description string   `json:"description,omitempty"`
	Models      []string `json:"models,omitempty"`
	Tags        []string `json:"tags,omitempty"`
}

InferenceRouterTaskPreset is a catalog preset task for inference router policies (use TaskSlug in policy JSON). See GET /v2/gen-ai/models/routers/tasks/presets.

type InferenceRouterUpdateRequest added in v1.194.1

type InferenceRouterUpdateRequest struct {
	Name           string           `json:"name,omitempty"`
	Description    string           `json:"description,omitempty"`
	Policies       *json.RawMessage `json:"policies,omitempty"`
	FallbackModels []string         `json:"fallback_models,omitempty"`
}

InferenceRouterUpdateRequest defines the body for updating an inference router.

type InferenceStream added in v1.191.0

type InferenceStream struct {
	*SSEReader
	// contains filtered or unexported fields
}

InferenceStream is the live SSE stream returned by every *Streaming method; caller must Close.

func (*InferenceStream) Close added in v1.191.0

func (s *InferenceStream) Close() error

Close releases the underlying HTTP response body.

type InferenceTag added in v1.191.0

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

InferenceTag is a free-form key/value tag attached to an inference request.

type IngressVPC added in v1.148.0

type IngressVPC struct {
	VpcUUID        string `json:"vpc_uuid"`
	SubnetUUID     string `json:"subnet_uuid,omitempty"`
	GatewayIP      string `json:"gateway_ip,omitempty"`
	DefaultGateway bool   `json:"default_gateway,omitempty"`
}

IngressVPC defines the ingress configs supported by a VPC NAT Gateway

type InsightsLogRecord added in v1.219.0

type InsightsLogRecord struct {
	Timestamp      time.Time         `json:"timestamp"`
	SeverityNumber int32             `json:"severity_number,omitempty"`
	SeverityText   string            `json:"severity_text,omitempty"`
	Body           string            `json:"body,omitempty"`
	TraceID        string            `json:"trace_id,omitempty"`
	SpanID         string            `json:"span_id,omitempty"`
	ServiceName    string            `json:"service_name,omitempty"`
	Resource       map[string]string `json:"resource,omitempty"`
	Attributes     map[string]string `json:"attributes,omitempty"`
}

InsightsLogRecord is a single log record returned by an Insights logs search.

type InsightsService added in v1.218.0

type InsightsService interface {
	ListNotificationChannels(context.Context, *ListOptions) ([]NotificationChannel, *Response, error)
	GetNotificationChannel(context.Context, string) (*NotificationChannel, *Response, error)
	CreateNotificationChannel(context.Context, *NotificationChannelRequest) (*NotificationChannel, *Response, error)
	UpdateNotificationChannel(context.Context, string, *NotificationChannelRequest) (*NotificationChannel, *Response, error)
	DeleteNotificationChannel(context.Context, string) (*Response, error)

	ListAlertRules(context.Context, *AlertRuleListOptions) ([]AlertRule, *Response, error)
	GetAlertRule(context.Context, string) (*AlertRule, *Response, error)
	CreateAlertRule(context.Context, *AlertRuleRequest) (*AlertRule, *Response, error)
	UpdateAlertRule(context.Context, string, *AlertRuleRequest) (*AlertRule, *Response, error)
	DeleteAlertRule(context.Context, string) (*Response, error)

	ListAlertInstances(context.Context, *AlertInstanceListOptions) ([]AlertInstance, *Response, error)
	GetAlertInstance(context.Context, string) (*AlertInstance, *Response, error)

	// Query evaluates a PromQL expression at one timestamp (GET).
	Query(context.Context, string, *PromQueryOptions) (*PromQueryResponse, *Response, error)
	// PostQuery is the form-encoded POST form of Query, for expressions that do not fit in a URL.
	PostQuery(context.Context, string, *PromQueryOptions) (*PromQueryResponse, *Response, error)
	QueryRange(context.Context, string, *PromQueryRangeOptions) (*PromQueryRangeResponse, *Response, error)
	PostQueryRange(context.Context, string, *PromQueryRangeOptions) (*PromQueryRangeResponse, *Response, error)
	Series(context.Context, string, *PromSelectorOptions) (*PromSeriesResponse, *Response, error)
	PostSeries(context.Context, string, *PromSelectorOptions) (*PromSeriesResponse, *Response, error)
	Labels(context.Context, string, *PromSelectorOptions) (*PromLabelsResponse, *Response, error)
	PostLabels(context.Context, string, *PromSelectorOptions) (*PromLabelsResponse, *Response, error)
	LabelValues(context.Context, string, string, *PromSelectorOptions) (*PromLabelsResponse, *Response, error)

	SearchLogs(context.Context, string, *LogsSearchRequest) (*LogsSearchResponse, *Response, error)
}

InsightsService manages Insights notification channels, alert rules, alert instances, PromQL queries, and logs searches.

type InsightsServiceOp added in v1.218.0

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

InsightsServiceOp handles communication with Insights methods of the DigitalOcean API.

func (*InsightsServiceOp) CreateAlertRule added in v1.218.0

func (s *InsightsServiceOp) CreateAlertRule(ctx context.Context, create *AlertRuleRequest) (*AlertRule, *Response, error)

CreateAlertRule creates an alert rule.

func (*InsightsServiceOp) CreateNotificationChannel added in v1.218.0

func (s *InsightsServiceOp) CreateNotificationChannel(ctx context.Context, create *NotificationChannelRequest) (*NotificationChannel, *Response, error)

CreateNotificationChannel creates a notification channel.

func (*InsightsServiceOp) DeleteAlertRule added in v1.218.0

func (s *InsightsServiceOp) DeleteAlertRule(ctx context.Context, id string) (*Response, error)

DeleteAlertRule deletes an alert rule.

func (*InsightsServiceOp) DeleteNotificationChannel added in v1.218.0

func (s *InsightsServiceOp) DeleteNotificationChannel(ctx context.Context, id string) (*Response, error)

DeleteNotificationChannel deletes a notification channel. Deleting a channel that alert rules still reference returns 409 Conflict.

func (*InsightsServiceOp) GetAlertInstance added in v1.218.0

func (s *InsightsServiceOp) GetAlertInstance(ctx context.Context, id string) (*AlertInstance, *Response, error)

GetAlertInstance retrieves an alert instance.

func (*InsightsServiceOp) GetAlertRule added in v1.218.0

func (s *InsightsServiceOp) GetAlertRule(ctx context.Context, id string) (*AlertRule, *Response, error)

GetAlertRule retrieves an alert rule.

func (*InsightsServiceOp) GetNotificationChannel added in v1.218.0

func (s *InsightsServiceOp) GetNotificationChannel(ctx context.Context, id string) (*NotificationChannel, *Response, error)

GetNotificationChannel retrieves a notification channel. Secret fields are masked.

func (*InsightsServiceOp) LabelValues added in v1.218.0

func (s *InsightsServiceOp) LabelValues(ctx context.Context, region, name string, opt *PromSelectorOptions) (*PromLabelsResponse, *Response, error)

LabelValues lists values for a label name.

func (*InsightsServiceOp) Labels added in v1.218.0

Labels lists label names.

func (*InsightsServiceOp) ListAlertInstances added in v1.218.0

func (s *InsightsServiceOp) ListAlertInstances(ctx context.Context, opt *AlertInstanceListOptions) ([]AlertInstance, *Response, error)

ListAlertInstances lists alert instances, newest trigger first.

func (*InsightsServiceOp) ListAlertRules added in v1.218.0

func (s *InsightsServiceOp) ListAlertRules(ctx context.Context, opt *AlertRuleListOptions) ([]AlertRule, *Response, error)

ListAlertRules lists alert rules.

func (*InsightsServiceOp) ListNotificationChannels added in v1.218.0

func (s *InsightsServiceOp) ListNotificationChannels(ctx context.Context, opt *ListOptions) ([]NotificationChannel, *Response, error)

ListNotificationChannels lists notification channels.

func (*InsightsServiceOp) PostLabels added in v1.218.0

PostLabels lists label names using a form body.

func (*InsightsServiceOp) PostQuery added in v1.218.0

PostQuery evaluates a PromQL expression at a single timestamp using a form body.

func (*InsightsServiceOp) PostQueryRange added in v1.218.0

PostQueryRange evaluates a PromQL expression over a time range using a form body.

func (*InsightsServiceOp) PostSeries added in v1.218.0

PostSeries finds series matching label selectors using a form body.

func (*InsightsServiceOp) Query added in v1.218.0

Query evaluates a PromQL expression at a single timestamp.

func (*InsightsServiceOp) QueryRange added in v1.218.0

QueryRange evaluates a PromQL expression over a time range.

func (*InsightsServiceOp) SearchLogs added in v1.219.0

func (s *InsightsServiceOp) SearchLogs(ctx context.Context, region string, search *LogsSearchRequest) (*LogsSearchResponse, *Response, error)

SearchLogs searches log records in a region. Cursor pagination requires ordering by timestamp alone; other sort orders return HasMore as false.

func (*InsightsServiceOp) Series added in v1.218.0

Series finds series matching label selectors.

func (*InsightsServiceOp) UpdateAlertRule added in v1.218.0

func (s *InsightsServiceOp) UpdateAlertRule(ctx context.Context, id string, update *AlertRuleRequest) (*AlertRule, *Response, error)

UpdateAlertRule updates an alert rule. Omitted status, re-alert duration, and notification channel bindings are left unchanged.

func (*InsightsServiceOp) UpdateNotificationChannel added in v1.218.0

func (s *InsightsServiceOp) UpdateNotificationChannel(ctx context.Context, id string, update *NotificationChannelRequest) (*NotificationChannel, *Response, error)

UpdateNotificationChannel replaces a notification channel's name and config.

type InstallKubernetesAppsRequest added in v1.38.0

type InstallKubernetesAppsRequest struct {
	Slugs       []string `json:"addon_slugs"`
	ClusterUUID string   `json:"cluster_uuid"`
}

InstallKubernetesAppsRequest represents a request required to install 1-click kubernetes apps

type InstallKubernetesAppsResponse added in v1.38.0

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

InstallKubernetesAppsResponse is the response of a kubernetes 1-click install request

type Invoice added in v1.31.0

type Invoice struct {
	InvoiceItems []InvoiceItem `json:"invoice_items"`
	Links        *Links        `json:"links"`
	Meta         *Meta         `json:"meta"`
}

Invoice represents a DigitalOcean Invoice

func (Invoice) String added in v1.31.0

func (i Invoice) String() string

type InvoiceItem added in v1.31.0

type InvoiceItem struct {
	Product          string    `json:"product"`
	ResourceID       string    `json:"resource_id"`
	ResourceUUID     string    `json:"resource_uuid"`
	GroupDescription string    `json:"group_description"`
	Description      string    `json:"description"`
	Amount           string    `json:"amount"`
	Duration         string    `json:"duration"`
	DurationUnit     string    `json:"duration_unit"`
	StartTime        time.Time `json:"start_time"`
	EndTime          time.Time `json:"end_time"`
	ProjectName      string    `json:"project_name"`
	Category         string    `json:"category"`
}

InvoiceItem represents a line-item on a DigitalOcean Invoice

type InvoiceList added in v1.31.0

type InvoiceList struct {
	Invoices       []InvoiceListItem `json:"invoices"`
	InvoicePreview InvoiceListItem   `json:"invoice_preview"`
	Links          *Links            `json:"links"`
	Meta           *Meta             `json:"meta"`
}

InvoiceList contains a paginated list of all of a customer's invoices. The InvoicePreview is the month-to-date usage generated by DigitalOcean.

type InvoiceListItem added in v1.31.0

type InvoiceListItem struct {
	InvoiceUUID   string    `json:"invoice_uuid"`
	Amount        string    `json:"amount"`
	InvoicePeriod string    `json:"invoice_period"`
	UpdatedAt     time.Time `json:"updated_at"`
}

InvoiceListItem contains a small list of information about a customer's invoice. More information can be found in the Invoice or InvoiceSummary

type InvoiceSummary added in v1.31.0

type InvoiceSummary struct {
	InvoiceUUID           string                  `json:"invoice_uuid"`
	BillingPeriod         string                  `json:"billing_period"`
	Amount                string                  `json:"amount"`
	UserName              string                  `json:"user_name"`
	UserBillingAddress    Address                 `json:"user_billing_address"`
	UserCompany           string                  `json:"user_company"`
	UserEmail             string                  `json:"user_email"`
	ProductCharges        InvoiceSummaryBreakdown `json:"product_charges"`
	Overages              InvoiceSummaryBreakdown `json:"overages"`
	Taxes                 InvoiceSummaryBreakdown `json:"taxes"`
	CreditsAndAdjustments InvoiceSummaryBreakdown `json:"credits_and_adjustments"`
}

InvoiceSummary contains metadata and summarized usage for an invoice generated by DigitalOcean

type InvoiceSummaryBreakdown added in v1.31.0

type InvoiceSummaryBreakdown struct {
	Name   string                        `json:"name"`
	Amount string                        `json:"amount"`
	Items  []InvoiceSummaryBreakdownItem `json:"items"`
}

InvoiceSummaryBreakdown is a grouped set of InvoiceItems from an invoice

type InvoiceSummaryBreakdownItem added in v1.31.0

type InvoiceSummaryBreakdownItem struct {
	Name   string `json:"name"`
	Amount string `json:"amount"`
	Count  string `json:"count"`
}

InvoiceSummaryBreakdownItem further breaks down the InvoiceSummary by product

type InvoicesService added in v1.31.0

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

type InvoicesServiceOp added in v1.31.0

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

InvoicesServiceOp handles communication with the Invoice related methods of the DigitalOcean API.

func (*InvoicesServiceOp) Get added in v1.31.0

func (s *InvoicesServiceOp) Get(ctx context.Context, invoiceUUID string, opt *ListOptions) (*Invoice, *Response, error)

Get detailed invoice items for an Invoice

func (*InvoicesServiceOp) GetCSV added in v1.31.0

func (s *InvoicesServiceOp) GetCSV(ctx context.Context, invoiceUUID string) ([]byte, *Response, error)

GetCSV returns the csv for an Invoice

func (*InvoicesServiceOp) GetPDF added in v1.31.0

func (s *InvoicesServiceOp) GetPDF(ctx context.Context, invoiceUUID string) ([]byte, *Response, error)

GetPDF returns the pdf for an Invoice

func (*InvoicesServiceOp) GetSummary added in v1.31.0

func (s *InvoicesServiceOp) GetSummary(ctx context.Context, invoiceUUID string) (*InvoiceSummary, *Response, error)

GetSummary returns a summary of metadata and summarized usage for an Invoice

func (*InvoicesServiceOp) List added in v1.31.0

List invoices for a customer

type JobInvocation added in v1.165.1

type JobInvocation struct {
	ID           string                `json:"id,omitempty"`
	JobName      string                `json:"job_name,omitempty"`
	DeploymentID string                `json:"deployment_id,omitempty"`
	Phase        JobInvocationPhase    `json:"phase,omitempty"`
	Trigger      *JobInvocationTrigger `json:"trigger,omitempty"`
	CreatedAt    time.Time             `json:"created_at,omitempty"`
	StartedAt    time.Time             `json:"started_at,omitempty"`
	CompletedAt  time.Time             `json:"completed_at,omitempty"`
}

JobInvocation struct for JobInvocation

func (*JobInvocation) GetCompletedAt added in v1.165.1

func (j *JobInvocation) GetCompletedAt() time.Time

GetCompletedAt returns the CompletedAt field.

func (*JobInvocation) GetCreatedAt added in v1.165.1

func (j *JobInvocation) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field.

func (*JobInvocation) GetDeploymentID added in v1.165.1

func (j *JobInvocation) GetDeploymentID() string

GetDeploymentID returns the DeploymentID field.

func (*JobInvocation) GetID added in v1.165.1

func (j *JobInvocation) GetID() string

GetID returns the ID field.

func (*JobInvocation) GetJobName added in v1.165.1

func (j *JobInvocation) GetJobName() string

GetJobName returns the JobName field.

func (*JobInvocation) GetPhase added in v1.165.1

func (j *JobInvocation) GetPhase() JobInvocationPhase

GetPhase returns the Phase field.

func (*JobInvocation) GetStartedAt added in v1.165.1

func (j *JobInvocation) GetStartedAt() time.Time

GetStartedAt returns the StartedAt field.

func (*JobInvocation) GetTrigger added in v1.165.1

func (j *JobInvocation) GetTrigger() *JobInvocationTrigger

GetTrigger returns the Trigger field.

type JobInvocationPhase added in v1.165.1

type JobInvocationPhase string

JobInvocationPhase the model 'JobInvocationPhase'

const (
	JOBINVOCATIONPHASE_Unknown   JobInvocationPhase = "UNKNOWN"
	JOBINVOCATIONPHASE_Pending   JobInvocationPhase = "PENDING"
	JOBINVOCATIONPHASE_Running   JobInvocationPhase = "RUNNING"
	JOBINVOCATIONPHASE_Succeeded JobInvocationPhase = "SUCCEEDED"
	JOBINVOCATIONPHASE_Failed    JobInvocationPhase = "FAILED"
	JOBINVOCATIONPHASE_Canceled  JobInvocationPhase = "CANCELED"
	JOBINVOCATIONPHASE_Skipped   JobInvocationPhase = "SKIPPED"
)

List of JobInvocationPhase

type JobInvocationTrigger added in v1.165.1

type JobInvocationTrigger struct {
	Type      JobInvocationTriggerType  `json:"type,omitempty"`
	Scheduled *TriggerMetadataScheduled `json:"scheduled,omitempty"`
	Manual    *TriggerMetadataManual    `json:"manual,omitempty"`
}

JobInvocationTrigger struct for JobInvocationTrigger

func (*JobInvocationTrigger) GetManual added in v1.165.1

GetManual returns the Manual field.

func (*JobInvocationTrigger) GetScheduled added in v1.165.1

GetScheduled returns the Scheduled field.

func (*JobInvocationTrigger) GetType added in v1.165.1

GetType returns the Type field.

type JobInvocationTriggerType added in v1.165.1

type JobInvocationTriggerType string

JobInvocationTriggerType the model 'JobInvocationTriggerType'

const (
	JOBINVOCATIONTRIGGERTYPE_Unknown   JobInvocationTriggerType = "UNKNOWN"
	JOBINVOCATIONTRIGGERTYPE_Scheduled JobInvocationTriggerType = "SCHEDULED"
	JOBINVOCATIONTRIGGERTYPE_Manual    JobInvocationTriggerType = "MANUAL"
)

List of JobInvocationTriggerType

type KafkaACL added in v1.103.0

type KafkaACL struct {
	ID         string `json:"id,omitempty"`
	Permission string `json:"permission,omitempty"`
	Topic      string `json:"topic,omitempty"`
}

KafkaACL contains Kafka specific user access control information

type KafkaConfig added in v1.126.0

type KafkaConfig struct {
	GroupInitialRebalanceDelayMs       *int     `json:"group_initial_rebalance_delay_ms,omitempty"`
	GroupMinSessionTimeoutMs           *int     `json:"group_min_session_timeout_ms,omitempty"`
	GroupMaxSessionTimeoutMs           *int     `json:"group_max_session_timeout_ms,omitempty"`
	MessageMaxBytes                    *int     `json:"message_max_bytes,omitempty"`
	LogCleanerDeleteRetentionMs        *int64   `json:"log_cleaner_delete_retention_ms,omitempty"`
	LogCleanerMinCompactionLagMs       *uint64  `json:"log_cleaner_min_compaction_lag_ms,omitempty"`
	LogFlushIntervalMs                 *uint64  `json:"log_flush_interval_ms,omitempty"`
	LogIndexIntervalBytes              *int     `json:"log_index_interval_bytes,omitempty"`
	LogMessageDownconversionEnable     *bool    `json:"log_message_downconversion_enable,omitempty"`
	LogMessageTimestampDifferenceMaxMs *uint64  `json:"log_message_timestamp_difference_max_ms,omitempty"`
	LogPreallocate                     *bool    `json:"log_preallocate,omitempty"`
	LogRetentionBytes                  *big.Int `json:"log_retention_bytes,omitempty"`
	LogRetentionHours                  *int     `json:"log_retention_hours,omitempty"`
	LogRetentionMs                     *big.Int `json:"log_retention_ms,omitempty"`
	LogRollJitterMs                    *uint64  `json:"log_roll_jitter_ms,omitempty"`
	LogSegmentDeleteDelayMs            *int     `json:"log_segment_delete_delay_ms,omitempty"`
	AutoCreateTopicsEnable             *bool    `json:"auto_create_topics_enable,omitempty"`
}

KafkaConfig holds advanced configurations for Kafka database clusters.

type Kernel added in v0.9.0

type Kernel struct {
	ID      int    `json:"id,float64,omitempty"`
	Name    string `json:"name,omitempty"`
	Version string `json:"version,omitempty"`
}

Kernel object

type Key

type Key struct {
	ID          int    `json:"id,float64,omitempty"`
	Name        string `json:"name,omitempty"`
	Fingerprint string `json:"fingerprint,omitempty"`
	PublicKey   string `json:"public_key,omitempty"`
}

Key represents a DigitalOcean Key.

func (Key) String

func (s Key) String() string

type KeyCreateRequest

type KeyCreateRequest struct {
	Name      string `json:"name"`
	PublicKey string `json:"public_key"`
}

KeyCreateRequest represents a request to create a new SSH key.

type KeyUpdateRequest added in v0.9.0

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

KeyUpdateRequest represents a request to update an SSH key stored in a DigitalOcean account.

type KeysService

type KeysService interface {
	List(context.Context, *ListOptions) ([]Key, *Response, error)
	GetByID(context.Context, int) (*Key, *Response, error)
	GetByFingerprint(context.Context, string) (*Key, *Response, error)
	Create(context.Context, *KeyCreateRequest) (*Key, *Response, error)
	UpdateByID(context.Context, int, *KeyUpdateRequest) (*Key, *Response, error)
	UpdateByFingerprint(context.Context, string, *KeyUpdateRequest) (*Key, *Response, error)
	DeleteByID(context.Context, int) (*Response, error)
	DeleteByFingerprint(context.Context, string) (*Response, error)
}

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

type KeysServiceOp added in v0.3.0

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

KeysServiceOp handles communication with SSH key related method of the DigitalOcean API.

func (*KeysServiceOp) Create added in v0.3.0

func (s *KeysServiceOp) Create(ctx context.Context, createRequest *KeyCreateRequest) (*Key, *Response, error)

Create an SSH key using a KeyCreateRequest

func (*KeysServiceOp) DeleteByFingerprint added in v0.3.0

func (s *KeysServiceOp) DeleteByFingerprint(ctx context.Context, fingerprint string) (*Response, error)

DeleteByFingerprint deletes an SSH key by its fingerprint

func (*KeysServiceOp) DeleteByID added in v0.3.0

func (s *KeysServiceOp) DeleteByID(ctx context.Context, keyID int) (*Response, error)

DeleteByID deletes an SSH key by its id

func (*KeysServiceOp) GetByFingerprint added in v0.3.0

func (s *KeysServiceOp) GetByFingerprint(ctx context.Context, fingerprint string) (*Key, *Response, error)

GetByFingerprint gets an SSH key by its fingerprint

func (*KeysServiceOp) GetByID added in v0.3.0

func (s *KeysServiceOp) GetByID(ctx context.Context, keyID int) (*Key, *Response, error)

GetByID gets an SSH key by its ID

func (*KeysServiceOp) List added in v0.3.0

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

List all SSH keys

func (*KeysServiceOp) UpdateByFingerprint added in v0.9.0

func (s *KeysServiceOp) UpdateByFingerprint(ctx context.Context, fingerprint string, updateRequest *KeyUpdateRequest) (*Key, *Response, error)

UpdateByFingerprint updates an SSH key name by fingerprint.

func (*KeysServiceOp) UpdateByID added in v0.9.0

func (s *KeysServiceOp) UpdateByID(ctx context.Context, keyID int, updateRequest *KeyUpdateRequest) (*Key, *Response, error)

UpdateByID updates an SSH key name by ID.

type KnowledgeBase added in v1.149.0

type KnowledgeBase struct {
	AddedToAgentAt     *Timestamp       `json:"added_to_agent_at,omitempty"`
	CreatedAt          *Timestamp       `json:"created_at,omitempty"`
	DatabaseId         string           `json:"database_id,omitempty"`
	EmbeddingModelUuid string           `json:"embedding_model_uuid,omitempty"`
	IsPublic           bool             `json:"is_public,omitempty"`
	LastIndexingJob    *LastIndexingJob `json:"last_indexing_job,omitempty"`
	Name               string           `json:"name,omitempty"`
	ProjectId          string           `json:"project_id,omitempty"`
	Region             string           `json:"region,omitempty"`
	Tags               []string         `json:"tags,omitempty"`
	UpdatedAt          *Timestamp       `json:"updated_at,omitempty"`
	UserId             string           `json:"user_id,omitempty"`
	Uuid               string           `json:"uuid,omitempty"`
	IsDeleted          bool             `json:"is_deleted,omitempty"`
}

KnowledgeBase represents an Agent Platform Knowledge Base

func (KnowledgeBase) String added in v1.152.0

func (a KnowledgeBase) String() string

type KnowledgeBaseCreateRequest added in v1.152.0

type KnowledgeBaseCreateRequest struct {
	DatabaseID         string                    `json:"database_id"`
	DataSources        []KnowledgeBaseDataSource `json:"datasources"`
	EmbeddingModelUuid string                    `json:"embedding_model_uuid"`
	Name               string                    `json:"name"`
	ProjectID          string                    `json:"project_id"`
	Region             string                    `json:"region"`
	Tags               []string                  `json:"tags"`
	VPCUuid            string                    `json:"vpc_uuid"`
}

type KnowledgeBaseDataSource added in v1.152.0

type KnowledgeBaseDataSource struct {
	CreatedAt            *Timestamp            `json:"created_at,omitempty"`
	FileUploadDataSource *FileUploadDataSource `json:"file_upload_data_source,omitempty"`
	LastIndexingJob      *LastIndexingJob      `json:"last_indexing_job,omitempty"`
	SpacesDataSource     *SpacesDataSource     `json:"spaces_data_source,omitempty"`
	UpdatedAt            *Timestamp            `json:"updated_at,omitempty"`
	Uuid                 string                `json:"uuid,omitempty"`
	WebCrawlerDataSource *WebCrawlerDataSource `json:"web_crawler_data_source,omitempty"`
}

KnowledgeBaseDataSource represents an Agent Platform Knowledge Base Data Source

func (KnowledgeBaseDataSource) String added in v1.152.0

func (a KnowledgeBaseDataSource) String() string

type KnowledgeBaseDataSourcesRoot added in v1.152.0

type KnowledgeBaseDataSourcesRoot struct {
	KnowledgeBaseDatasources []KnowledgeBaseDataSource `json:"knowledge_base_data_sources"`
	Links                    *Links                    `json:"links"`
	Meta                     *Meta                     `json:"meta"`
}

type KubernetesAmdGpuDeviceMetricsExporterPlugin added in v1.160.0

type KubernetesAmdGpuDeviceMetricsExporterPlugin struct {
	Enabled *bool `json:"enabled"`
}

KubernetesAmdGpuDeviceMetricsExporterPlugin represents information about the AMD GPU Device Metrics Exporter cluster plugin.

type KubernetesAmdGpuDevicePlugin added in v1.160.0

type KubernetesAmdGpuDevicePlugin struct {
	Enabled *bool `json:"enabled"`
}

KubernetesAmdGpuDevicePlugin represents information about the AMD GPU Device Plugin cluster plugin. If a cluster has a node pool with an AMD GPU it will be enabled by default.

type KubernetesAmdGpuDraDriver added in v1.202.0

type KubernetesAmdGpuDraDriver struct {
	Enabled *bool `json:"enabled"`
}

KubernetesAmdGpuDraDriver represents information about the AMD GPU DRA Driver cluster plugin. Mutually exclusive with the AMD GPU Device Plugin.

type KubernetesAssociatedResources added in v1.57.0

type KubernetesAssociatedResources struct {
	Volumes         []*AssociatedResource `json:"volumes"`
	VolumeSnapshots []*AssociatedResource `json:"volume_snapshots"`
	LoadBalancers   []*AssociatedResource `json:"load_balancers"`
}

KubernetesAssociatedResources represents a cluster's associated resources

type KubernetesCluster added in v1.7.0

type KubernetesCluster struct {
	ID               string   `json:"id,omitempty"`
	Name             string   `json:"name,omitempty"`
	RegionSlug       string   `json:"region,omitempty"`
	VersionSlug      string   `json:"version,omitempty"`
	ClusterSubnet    string   `json:"cluster_subnet,omitempty"`
	ServiceSubnet    string   `json:"service_subnet,omitempty"`
	IPv4             string   `json:"ipv4,omitempty"`
	Endpoint         string   `json:"endpoint,omitempty"`
	Tags             []string `json:"tags,omitempty"`
	VPCUUID          string   `json:"vpc_uuid,omitempty"`
	WorkerSubnetUUID string   `json:"worker_subnet_uuid,omitempty"`

	// Cluster runs a highly available control plane
	HA bool `json:"ha,omitempty"`

	NodePools []*KubernetesNodePool `json:"node_pools,omitempty"`

	MaintenancePolicy                 *KubernetesMaintenancePolicy                 `json:"maintenance_policy,omitempty"`
	AutoUpgrade                       bool                                         `json:"auto_upgrade,omitempty"`
	SurgeUpgrade                      bool                                         `json:"surge_upgrade,omitempty"`
	RegistryEnabled                   bool                                         `json:"registry_enabled,omitempty"`
	ControlPlaneFirewall              *KubernetesControlPlaneFirewall              `json:"control_plane_firewall,omitempty"`
	ClusterAutoscalerConfiguration    *KubernetesClusterAutoscalerConfiguration    `json:"cluster_autoscaler_configuration,omitempty"`
	RoutingAgent                      *KubernetesRoutingAgent                      `json:"routing_agent,omitempty"`
	AmdGpuDevicePlugin                *KubernetesAmdGpuDevicePlugin                `json:"amd_gpu_device_plugin,omitempty"`
	AmdGpuDeviceMetricsExporterPlugin *KubernetesAmdGpuDeviceMetricsExporterPlugin `json:"amd_gpu_device_metrics_exporter_plugin,omitempty"`
	NvidiaGpuDevicePlugin             *KubernetesNvidiaGpuDevicePlugin             `json:"nvidia_gpu_device_plugin,omitempty"`
	NvidiaGpuDraDriver                *KubernetesNvidiaGpuDraDriver                `json:"nvidia_gpu_dra_driver,omitempty"`
	AmdGpuDraDriver                   *KubernetesAmdGpuDraDriver                   `json:"amd_gpu_dra_driver,omitempty"`
	RdmaSharedDevicePlugin            *KubernetesRdmaSharedDevicePlugin            `json:"rdma_shared_dev_plugin,omitempty"`
	CorednsAutoscaler                 *KubernetesCorednsAutoscaler                 `json:"coredns_autoscaler,omitempty"`
	SSO                               *KubernetesClusterSSO                        `json:"sso,omitempty"`
	P2pOciRegistryPlugin              *KubernetesP2pOciRegistry                    `json:"p2p_oci_registry_plugin,omitempty"`
	NfsCsiPlugin                      *KubernetesNfsCsiPlugin                      `json:"nfs_csi_plugin,omitempty"`
	IsolatedWorkers                   bool                                         `json:"isolated_workers,omitempty"`

	Status    *KubernetesClusterStatus `json:"status,omitempty"`
	CreatedAt time.Time                `json:"created_at,omitempty"`
	UpdatedAt time.Time                `json:"updated_at,omitempty"`
}

KubernetesCluster represents a Kubernetes cluster.

func (KubernetesCluster) URN added in v1.60.0

func (kc KubernetesCluster) URN() string

URN returns the Kubernetes cluster's ID in the format of DigitalOcean URN.

type KubernetesClusterAutoscalerConfiguration added in v1.135.0

type KubernetesClusterAutoscalerConfiguration struct {
	ScaleDownUtilizationThreshold *float64 `json:"scale_down_utilization_threshold"`
	ScaleDownUnneededTime         *string  `json:"scale_down_unneeded_time"`
	Expanders                     []string `json:"expanders"`
}

KubernetesClusterAutoscalerConfiguration represents Kubernetes cluster autoscaler configuration.

type KubernetesClusterConfig added in v1.7.0

type KubernetesClusterConfig struct {
	KubeconfigYAML []byte
}

KubernetesClusterConfig is the content of a Kubernetes config file, which can be used to interact with your Kubernetes cluster using `kubectl`. See: https://kubernetes.io/docs/tasks/tools/install-kubectl/

type KubernetesClusterCreateRequest added in v1.7.0

type KubernetesClusterCreateRequest struct {
	Name             string   `json:"name,omitempty"`
	RegionSlug       string   `json:"region,omitempty"`
	VersionSlug      string   `json:"version,omitempty"`
	Tags             []string `json:"tags,omitempty"`
	VPCUUID          string   `json:"vpc_uuid,omitempty"`
	WorkerSubnetUUID string   `json:"worker_subnet_uuid,omitempty"`
	ClusterSubnet    string   `json:"cluster_subnet,omitempty"`
	ServiceSubnet    string   `json:"service_subnet,omitempty"`

	// HA enables a highly available control plane. When omitted, the API applies
	// version-based defaults: false for versions < 1.36, true for versions >= 1.36.
	HA *bool `json:"ha,omitempty"`

	NodePools []*KubernetesNodePoolCreateRequest `json:"node_pools,omitempty"`

	MaintenancePolicy                 *KubernetesMaintenancePolicy                 `json:"maintenance_policy"`
	AutoUpgrade                       bool                                         `json:"auto_upgrade"`
	SurgeUpgrade                      bool                                         `json:"surge_upgrade"`
	ControlPlaneFirewall              *KubernetesControlPlaneFirewall              `json:"control_plane_firewall,omitempty"`
	ClusterAutoscalerConfiguration    *KubernetesClusterAutoscalerConfiguration    `json:"cluster_autoscaler_configuration,omitempty"`
	RoutingAgent                      *KubernetesRoutingAgent                      `json:"routing_agent,omitempty"`
	AmdGpuDevicePlugin                *KubernetesAmdGpuDevicePlugin                `json:"amd_gpu_device_plugin,omitempty"`
	AmdGpuDeviceMetricsExporterPlugin *KubernetesAmdGpuDeviceMetricsExporterPlugin `json:"amd_gpu_device_metrics_exporter_plugin,omitempty"`
	NvidiaGpuDevicePlugin             *KubernetesNvidiaGpuDevicePlugin             `json:"nvidia_gpu_device_plugin,omitempty"`
	NvidiaGpuDraDriver                *KubernetesNvidiaGpuDraDriver                `json:"nvidia_gpu_dra_driver,omitempty"`
	AmdGpuDraDriver                   *KubernetesAmdGpuDraDriver                   `json:"amd_gpu_dra_driver,omitempty"`
	RdmaSharedDevicePlugin            *KubernetesRdmaSharedDevicePlugin            `json:"rdma_shared_dev_plugin,omitempty"`
	CorednsAutoscaler                 *KubernetesCorednsAutoscaler                 `json:"coredns_autoscaler,omitempty"`
	SSO                               *KubernetesClusterSSO                        `json:"sso,omitempty"`
	P2pOciRegistryPlugin              *KubernetesP2pOciRegistry                    `json:"p2p_oci_registry_plugin,omitempty"`
	NfsCsiPlugin                      *KubernetesNfsCsiPlugin                      `json:"nfs_csi_plugin,omitempty"`
	// IsolatedWorkers enables isolated worker nodes. When true, the cluster's VPC
	// must already have a NAT gateway attached, or the create request fails with a
	// 422. This can only be set at creation time.
	IsolatedWorkers bool `json:"isolated_workers,omitempty"`
}

KubernetesClusterCreateRequest represents a request to create a Kubernetes cluster.

type KubernetesClusterCredentials added in v1.22.0

type KubernetesClusterCredentials struct {
	Server                   string    `json:"server"`
	CertificateAuthorityData []byte    `json:"certificate_authority_data"`
	ClientCertificateData    []byte    `json:"client_certificate_data"`
	ClientKeyData            []byte    `json:"client_key_data"`
	Token                    string    `json:"token"`
	ExpiresAt                time.Time `json:"expires_at"`
}

KubernetesClusterCredentials represents Kubernetes cluster credentials.

type KubernetesClusterCredentialsGetRequest added in v1.22.0

type KubernetesClusterCredentialsGetRequest struct {
	ExpirySeconds *int `json:"expiry_seconds,omitempty"`
}

KubernetesClusterCredentialsGetRequest is a request to get cluster credentials.

type KubernetesClusterDeleteSelectiveRequest added in v1.57.0

type KubernetesClusterDeleteSelectiveRequest struct {
	Volumes         []string `json:"volumes"`
	VolumeSnapshots []string `json:"volume_snapshots"`
	LoadBalancers   []string `json:"load_balancers"`
}

KubernetesClusterDeleteSelectiveRequest represents a delete selective request to delete a cluster and it's associated resources.

type KubernetesClusterKubeconfigGetRequest added in v1.187.0

type KubernetesClusterKubeconfigGetRequest struct {
	Type string `json:"type,omitempty"`
}

KubernetesClusterKubeconfigGetRequest is a request to get cluster kubeconfig.

type KubernetesClusterRegistryRequest added in v1.47.0

type KubernetesClusterRegistryRequest struct {
	ClusterUUIDs []string `json:"cluster_uuids,omitempty"`
}

KubernetesClusterRegistryRequest represents clusters to integrate with docr registry

type KubernetesClusterSSO added in v1.178.0

type KubernetesClusterSSO struct {
	Enabled   bool   `json:"enabled"`
	Required  bool   `json:"required"`
	IssuerURL string `json:"issuer_url,omitempty"`
	ClientID  string `json:"client_id,omitempty"`
}

KubernetesClusterSSO configures Single Sign-On (SSO) for a Kubernetes cluster.

type KubernetesClusterStatus added in v1.7.0

type KubernetesClusterStatus struct {
	State   KubernetesClusterStatusState `json:"state,omitempty"`
	Message string                       `json:"message,omitempty"`
}

KubernetesClusterStatus describes the status of a cluster.

type KubernetesClusterStatusMessage added in v1.141.0

type KubernetesClusterStatusMessage struct {
	Message   string    `json:"message"`
	Timestamp time.Time `json:"timestamp"`
}

type KubernetesClusterStatusState added in v1.7.1

type KubernetesClusterStatusState string

KubernetesClusterStatusState represents states for a cluster.

func (*KubernetesClusterStatusState) UnmarshalText added in v1.7.1

func (s *KubernetesClusterStatusState) UnmarshalText(text []byte) error

UnmarshalText unmarshals the state.

type KubernetesClusterUpdateRequest added in v1.7.0

type KubernetesClusterUpdateRequest struct {
	Name                              string                                       `json:"name,omitempty"`
	Tags                              []string                                     `json:"tags,omitempty"`
	MaintenancePolicy                 *KubernetesMaintenancePolicy                 `json:"maintenance_policy,omitempty"`
	AutoUpgrade                       *bool                                        `json:"auto_upgrade,omitempty"`
	SurgeUpgrade                      bool                                         `json:"surge_upgrade,omitempty"`
	ControlPlaneFirewall              *KubernetesControlPlaneFirewall              `json:"control_plane_firewall,omitempty"`
	ClusterAutoscalerConfiguration    *KubernetesClusterAutoscalerConfiguration    `json:"cluster_autoscaler_configuration,omitempty"`
	RoutingAgent                      *KubernetesRoutingAgent                      `json:"routing_agent,omitempty"`
	AmdGpuDevicePlugin                *KubernetesAmdGpuDevicePlugin                `json:"amd_gpu_device_plugin,omitempty"`
	AmdGpuDeviceMetricsExporterPlugin *KubernetesAmdGpuDeviceMetricsExporterPlugin `json:"amd_gpu_device_metrics_exporter_plugin,omitempty"`
	NvidiaGpuDevicePlugin             *KubernetesNvidiaGpuDevicePlugin             `json:"nvidia_gpu_device_plugin,omitempty"`
	NvidiaGpuDraDriver                *KubernetesNvidiaGpuDraDriver                `json:"nvidia_gpu_dra_driver,omitempty"`
	AmdGpuDraDriver                   *KubernetesAmdGpuDraDriver                   `json:"amd_gpu_dra_driver,omitempty"`
	RdmaSharedDevicePlugin            *KubernetesRdmaSharedDevicePlugin            `json:"rdma_shared_dev_plugin,omitempty"`
	CorednsAutoscaler                 *KubernetesCorednsAutoscaler                 `json:"coredns_autoscaler,omitempty"`
	SSO                               *KubernetesClusterSSO                        `json:"sso,omitempty"`
	P2pOciRegistryPlugin              *KubernetesP2pOciRegistry                    `json:"p2p_oci_registry_plugin,omitempty"`
	NfsCsiPlugin                      *KubernetesNfsCsiPlugin                      `json:"nfs_csi_plugin,omitempty"`

	// Convert cluster to run highly available control plane
	HA *bool `json:"ha,omitempty"`
}

KubernetesClusterUpdateRequest represents a request to update a Kubernetes cluster.

type KubernetesClusterUpgradeRequest added in v1.14.0

type KubernetesClusterUpgradeRequest struct {
	VersionSlug string `json:"version,omitempty"`
}

KubernetesClusterUpgradeRequest represents a request to upgrade a Kubernetes cluster.

type KubernetesClusterUser added in v1.20.0

type KubernetesClusterUser struct {
	ID       string   `json:"id,omitempty"`
	Username string   `json:"username,omitempty"`
	Groups   []string `json:"groups,omitempty"`
}

KubernetesClusterUser represents a Kubernetes cluster user.

type KubernetesControlPlaneFirewall added in v1.118.0

type KubernetesControlPlaneFirewall struct {
	Enabled          *bool    `json:"enabled"`
	AllowedAddresses []string `json:"allowed_addresses"`
}

KubernetesControlPlaneFirewall represents Kubernetes cluster control plane firewall.

type KubernetesCorednsAutoscaler added in v1.194.1

type KubernetesCorednsAutoscaler struct {
	Enabled *bool `json:"enabled"`
}

KubernetesCorednsAutoscaler represents information about the CoreDNS Cluster Proportional Autoscaler cluster plugin.

type KubernetesGetClusterStatusMessagesRequest added in v1.141.0

type KubernetesGetClusterStatusMessagesRequest struct {
	Since *time.Time `json:"since"`
}

type KubernetesGetClusterlintRequest added in v1.53.0

type KubernetesGetClusterlintRequest struct {
	RunId string `json:"run_id"`
}

type KubernetesMaintenancePolicy added in v1.12.0

type KubernetesMaintenancePolicy struct {
	StartTime string                         `json:"start_time"`
	Duration  string                         `json:"duration"`
	Day       KubernetesMaintenancePolicyDay `json:"day"`
}

KubernetesMaintenancePolicy is a configuration to set the maintenance window of a cluster

type KubernetesMaintenancePolicyDay added in v1.12.0

type KubernetesMaintenancePolicyDay int

KubernetesMaintenancePolicyDay represents the possible days of a maintenance window

const (
	// KubernetesMaintenanceDayAny sets the KubernetesMaintenancePolicyDay to any
	// day of the week
	KubernetesMaintenanceDayAny KubernetesMaintenancePolicyDay = iota

	// KubernetesMaintenanceDayMonday sets the KubernetesMaintenancePolicyDay to
	// Monday
	KubernetesMaintenanceDayMonday

	// KubernetesMaintenanceDayTuesday sets the KubernetesMaintenancePolicyDay to
	// Tuesday
	KubernetesMaintenanceDayTuesday

	// KubernetesMaintenanceDayWednesday sets the KubernetesMaintenancePolicyDay to
	// Wednesday
	KubernetesMaintenanceDayWednesday

	// KubernetesMaintenanceDayThursday sets the KubernetesMaintenancePolicyDay to
	// Thursday
	KubernetesMaintenanceDayThursday

	// KubernetesMaintenanceDayFriday sets the KubernetesMaintenancePolicyDay to
	// Friday
	KubernetesMaintenanceDayFriday

	// KubernetesMaintenanceDaySaturday sets the KubernetesMaintenancePolicyDay to
	// Saturday
	KubernetesMaintenanceDaySaturday

	// KubernetesMaintenanceDaySunday sets the KubernetesMaintenancePolicyDay to
	// Sunday
	KubernetesMaintenanceDaySunday
)

func KubernetesMaintenanceToDay added in v1.12.0

func KubernetesMaintenanceToDay(day string) (KubernetesMaintenancePolicyDay, error)

KubernetesMaintenanceToDay returns the appropriate KubernetesMaintenancePolicyDay for the given string.

func (KubernetesMaintenancePolicyDay) MarshalJSON added in v1.12.0

func (k KubernetesMaintenancePolicyDay) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON string for KubernetesMaintenancePolicyDay

func (KubernetesMaintenancePolicyDay) String added in v1.12.0

func (*KubernetesMaintenancePolicyDay) UnmarshalJSON added in v1.12.0

func (k *KubernetesMaintenancePolicyDay) UnmarshalJSON(data []byte) error

UnmarshalJSON parses the JSON string into KubernetesMaintenancePolicyDay

type KubernetesNfsCsiPlugin added in v1.213.0

type KubernetesNfsCsiPlugin struct {
	Enabled *bool `json:"enabled"`
}

KubernetesNfsCsiPlugin represents information about the NFS CSI driver cluster plugin.

type KubernetesNode added in v1.7.0

type KubernetesNode struct {
	ID        string                `json:"id,omitempty"`
	Name      string                `json:"name,omitempty"`
	Status    *KubernetesNodeStatus `json:"status,omitempty"`
	DropletID string                `json:"droplet_id,omitempty"`

	CreatedAt time.Time `json:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`
}

KubernetesNode represents a Node in a node pool in a Kubernetes cluster.

type KubernetesNodeDeleteRequest added in v1.16.0

type KubernetesNodeDeleteRequest struct {
	// Replace will cause a new node to be created to replace the deleted node.
	Replace bool `json:"replace,omitempty"`

	// SkipDrain skips draining the node before deleting it.
	SkipDrain bool `json:"skip_drain,omitempty"`
}

KubernetesNodeDeleteRequest is a request to delete a specific node in a node pool.

type KubernetesNodePool added in v1.7.0

type KubernetesNodePool struct {
	ID               string            `json:"id,omitempty"`
	Name             string            `json:"name,omitempty"`
	Size             string            `json:"size,omitempty"`
	Count            int               `json:"count,omitempty"`
	Tags             []string          `json:"tags,omitempty"`
	Labels           map[string]string `json:"labels,omitempty"`
	Taints           []Taint           `json:"taints,omitempty"`
	AutoScale        bool              `json:"auto_scale,omitempty"`
	MinNodes         int               `json:"min_nodes,omitempty"`
	MaxNodes         int               `json:"max_nodes,omitempty"`
	GPUPartitionMode string            `json:"gpu_partition_mode,omitempty"`

	Nodes []*KubernetesNode `json:"nodes,omitempty"`
}

KubernetesNodePool represents a node pool in a Kubernetes cluster.

type KubernetesNodePoolCreateRequest added in v1.7.0

type KubernetesNodePoolCreateRequest struct {
	Name             string            `json:"name,omitempty"`
	Size             string            `json:"size,omitempty"`
	Count            int               `json:"count,omitempty"`
	Tags             []string          `json:"tags,omitempty"`
	Labels           map[string]string `json:"labels,omitempty"`
	Taints           []Taint           `json:"taints,omitempty"`
	AutoScale        bool              `json:"auto_scale,omitempty"`
	MinNodes         int               `json:"min_nodes,omitempty"`
	MaxNodes         int               `json:"max_nodes,omitempty"`
	GPUPartitionMode string            `json:"gpu_partition_mode,omitempty"`
}

KubernetesNodePoolCreateRequest represents a request to create a node pool for a Kubernetes cluster.

type KubernetesNodePoolGPUResources added in v1.168.0

type KubernetesNodePoolGPUResources struct {
	Vendor string `json:"vendor"`
	Model  string `json:"model"`
	Count  int64  `json:"count"`
}

KubernetesNodePoolGPUResources exposes model and GPU count of a node pool template

type KubernetesNodePoolRecycleNodesRequest added in v1.7.0

type KubernetesNodePoolRecycleNodesRequest struct {
	Nodes []string `json:"nodes,omitempty"`
}

KubernetesNodePoolRecycleNodesRequest is DEPRECATED please use DeleteNode The type will be removed in godo 2.0.

type KubernetesNodePoolResources added in v1.137.0

type KubernetesNodePoolResources struct {
	CPU           int64  `json:"cpu,omitempty"` // deprecated in favor of cpuMilliCores
	CpuMilliCores int64  `json:"cpu_milli_cores,omitempty"`
	Memory        string `json:"memory,omitempty"`
	Pods          int64  `json:"pods,omitempty"`
}

KubernetesNodePoolResources represents the resources within a given template for a node pool This follows https://pkg.go.dev/k8s.io/kubernetes@v1.32.1/pkg/scheduler/framework#Resource to represent node resources within the node object.

type KubernetesNodePoolTemplate added in v1.137.0

type KubernetesNodePoolTemplate struct {
	Template *KubernetesNodeTemplate
}

KubernetesNodePool represents the node pool template data for a given pool.

type KubernetesNodePoolUpdateRequest added in v1.7.0

type KubernetesNodePoolUpdateRequest struct {
	Name      string            `json:"name,omitempty"`
	Count     *int              `json:"count,omitempty"`
	Tags      []string          `json:"tags,omitempty"`
	Labels    map[string]string `json:"labels,omitempty"`
	Taints    *[]Taint          `json:"taints,omitempty"`
	AutoScale *bool             `json:"auto_scale,omitempty"`
	MinNodes  *int              `json:"min_nodes,omitempty"`
	MaxNodes  *int              `json:"max_nodes,omitempty"`
}

KubernetesNodePoolUpdateRequest represents a request to update a node pool in a Kubernetes cluster.

type KubernetesNodeSize added in v1.7.2

type KubernetesNodeSize struct {
	Name string `json:"name"`
	Slug string `json:"slug"`
}

KubernetesNodeSize is a node sizes supported for Kubernetes clusters.

type KubernetesNodeStatus added in v1.7.0

type KubernetesNodeStatus struct {
	State   string `json:"state,omitempty"`
	Message string `json:"message,omitempty"`
}

KubernetesNodeStatus represents the status of a particular Node in a Kubernetes cluster.

type KubernetesNodeTemplate added in v1.139.0

type KubernetesNodeTemplate struct {
	ClusterUUID string                          `json:"cluster_uuid,omitempty"`
	Name        string                          `json:"name,omitempty"`
	Slug        string                          `json:"slug,omitempty"`
	Labels      map[string]string               `json:"labels,omitempty"`
	Taints      []string                        `json:"taints,omitempty"`
	Capacity    *KubernetesNodePoolResources    `json:"capacity,omitempty"`
	Allocatable *KubernetesNodePoolResources    `json:"allocatable,omitempty"`
	Gpu         *KubernetesNodePoolGPUResources `json:"gpu,omitempty"`
}

KubernetesNodeTemplate represents a template in a node pool in a Kubernetes cluster.

type KubernetesNvidiaGpuDevicePlugin added in v1.168.0

type KubernetesNvidiaGpuDevicePlugin struct {
	Enabled *bool `json:"enabled"`
}

KubernetesNvidiaGpuDevicePlugin represents information about the NVIDIA GPU Device Plugin cluster plugin. If a cluster has a node pool with an NVIDIA GPU it will be enabled by default.

type KubernetesNvidiaGpuDraDriver added in v1.202.0

type KubernetesNvidiaGpuDraDriver struct {
	Enabled *bool `json:"enabled"`
}

KubernetesNvidiaGpuDraDriver represents information about the NVIDIA GPU DRA Driver cluster plugin. Mutually exclusive with the NVIDIA GPU Device Plugin.

type KubernetesOptions added in v1.7.0

type KubernetesOptions struct {
	Versions []*KubernetesVersion  `json:"versions,omitempty"`
	Regions  []*KubernetesRegion   `json:"regions,omitempty"`
	Sizes    []*KubernetesNodeSize `json:"sizes,omitempty"`
}

KubernetesOptions represents options available for creating Kubernetes clusters.

type KubernetesP2pOciRegistry added in v1.199.0

type KubernetesP2pOciRegistry struct {
	Enabled *bool `json:"enabled"`
}

KubernetesP2pOciRegistry represents information about the Peer-to-peer OCI registry cluster plugin.

type KubernetesRdmaSharedDevicePlugin added in v1.168.0

type KubernetesRdmaSharedDevicePlugin struct {
	Enabled *bool `json:"enabled"`
}

KubernetesRdmaSharedDevicePlugin represents information about the rdma-shared-dev cluster plugin. If a cluster has a multi-node GPU ready slug it will be enabled by default.

type KubernetesRegion added in v1.7.2

type KubernetesRegion struct {
	Name string `json:"name"`
	Slug string `json:"slug"`
}

KubernetesRegion is a region usable by Kubernetes clusters.

type KubernetesRoutingAgent added in v1.138.0

type KubernetesRoutingAgent struct {
	Enabled *bool `json:"enabled"`
}

KubernetesRoutingAgent represents information about the routing-agent cluster plugin.

type KubernetesRunClusterlintRequest added in v1.53.0

type KubernetesRunClusterlintRequest struct {
	IncludeGroups []string `json:"include_groups"`
	ExcludeGroups []string `json:"exclude_groups"`
	IncludeChecks []string `json:"include_checks"`
	ExcludeChecks []string `json:"exclude_checks"`
}

type KubernetesService added in v1.7.0

type KubernetesService interface {
	Create(context.Context, *KubernetesClusterCreateRequest) (*KubernetesCluster, *Response, error)
	Get(context.Context, string) (*KubernetesCluster, *Response, error)
	GetUser(context.Context, string) (*KubernetesClusterUser, *Response, error)
	GetUpgrades(context.Context, string) ([]*KubernetesVersion, *Response, error)
	GetKubeConfig(context.Context, string, *KubernetesClusterKubeconfigGetRequest) (*KubernetesClusterConfig, *Response, error)
	GetKubeConfigWithExpiry(context.Context, string, int64) (*KubernetesClusterConfig, *Response, error)
	GetCredentials(context.Context, string, *KubernetesClusterCredentialsGetRequest) (*KubernetesClusterCredentials, *Response, error)
	List(context.Context, *ListOptions) ([]*KubernetesCluster, *Response, error)
	Update(context.Context, string, *KubernetesClusterUpdateRequest) (*KubernetesCluster, *Response, error)
	Upgrade(context.Context, string, *KubernetesClusterUpgradeRequest) (*Response, error)
	Delete(context.Context, string) (*Response, error)
	DeleteSelective(context.Context, string, *KubernetesClusterDeleteSelectiveRequest) (*Response, error)
	DeleteDangerous(context.Context, string) (*Response, error)
	ListAssociatedResourcesForDeletion(context.Context, string) (*KubernetesAssociatedResources, *Response, error)

	CreateNodePool(ctx context.Context, clusterID string, req *KubernetesNodePoolCreateRequest) (*KubernetesNodePool, *Response, error)
	GetNodePool(ctx context.Context, clusterID, poolID string) (*KubernetesNodePool, *Response, error)
	GetNodePoolTemplate(ctx context.Context, clusterID string, nodePoolName string) (*KubernetesNodePoolTemplate, *Response, error)
	ListNodePools(ctx context.Context, clusterID string, opts *ListOptions) ([]*KubernetesNodePool, *Response, error)
	UpdateNodePool(ctx context.Context, clusterID, poolID string, req *KubernetesNodePoolUpdateRequest) (*KubernetesNodePool, *Response, error)
	// RecycleNodePoolNodes is DEPRECATED please use DeleteNode
	// The method will be removed in godo 2.0.
	RecycleNodePoolNodes(ctx context.Context, clusterID, poolID string, req *KubernetesNodePoolRecycleNodesRequest) (*Response, error)
	DeleteNodePool(ctx context.Context, clusterID, poolID string) (*Response, error)
	DeleteNode(ctx context.Context, clusterID, poolID, nodeID string, req *KubernetesNodeDeleteRequest) (*Response, error)

	GetOptions(context.Context) (*KubernetesOptions, *Response, error)
	AddRegistry(ctx context.Context, req *KubernetesClusterRegistryRequest) (*Response, error)
	RemoveRegistry(ctx context.Context, req *KubernetesClusterRegistryRequest) (*Response, error)

	RunClusterlint(ctx context.Context, clusterID string, req *KubernetesRunClusterlintRequest) (string, *Response, error)
	GetClusterlintResults(ctx context.Context, clusterID string, req *KubernetesGetClusterlintRequest) ([]*ClusterlintDiagnostic, *Response, error)

	GetClusterStatusMessages(ctx context.Context, clusterID string, req *KubernetesGetClusterStatusMessagesRequest) ([]*KubernetesClusterStatusMessage, *Response, error)
}

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

type KubernetesServiceOp added in v1.7.0

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

KubernetesServiceOp handles communication with Kubernetes methods of the DigitalOcean API.

func (*KubernetesServiceOp) AddRegistry added in v1.47.0

AddRegistry integrates docr registry with all the specified clusters

func (*KubernetesServiceOp) Create added in v1.7.0

Create creates a Kubernetes cluster.

func (*KubernetesServiceOp) CreateNodePool added in v1.7.0

CreateNodePool creates a new node pool in an existing Kubernetes cluster.

func (*KubernetesServiceOp) Delete added in v1.7.0

func (svc *KubernetesServiceOp) Delete(ctx context.Context, clusterID string) (*Response, error)

Delete deletes a Kubernetes cluster. There is no way to recover a cluster once it has been destroyed.

func (*KubernetesServiceOp) DeleteDangerous added in v1.57.0

func (svc *KubernetesServiceOp) DeleteDangerous(ctx context.Context, clusterID string) (*Response, error)

DeleteDangerous deletes a Kubernetes cluster and all its associated resources. There is no way to recover a cluster or it's associated resources once destroyed.

func (*KubernetesServiceOp) DeleteNode added in v1.16.0

func (svc *KubernetesServiceOp) DeleteNode(ctx context.Context, clusterID, poolID, nodeID string, deleteReq *KubernetesNodeDeleteRequest) (*Response, error)

DeleteNode deletes a specific node in a node pool.

func (*KubernetesServiceOp) DeleteNodePool added in v1.7.0

func (svc *KubernetesServiceOp) DeleteNodePool(ctx context.Context, clusterID, poolID string) (*Response, error)

DeleteNodePool deletes a node pool, and subsequently all the nodes in that pool.

func (*KubernetesServiceOp) DeleteSelective added in v1.57.0

func (svc *KubernetesServiceOp) DeleteSelective(ctx context.Context, clusterID string, request *KubernetesClusterDeleteSelectiveRequest) (*Response, error)

DeleteSelective deletes a Kubernetes cluster and the specified associated resources. Users can choose to delete specific volumes, volume snapshots or load balancers along with the cluster There is no way to recover a cluster or the specified resources once destroyed.

func (*KubernetesServiceOp) Get added in v1.7.0

func (svc *KubernetesServiceOp) Get(ctx context.Context, clusterID string) (*KubernetesCluster, *Response, error)

Get retrieves the details of a Kubernetes cluster.

func (*KubernetesServiceOp) GetClusterStatusMessages added in v1.141.0

func (*KubernetesServiceOp) GetClusterlintResults added in v1.53.0

func (svc *KubernetesServiceOp) GetClusterlintResults(ctx context.Context, clusterID string, req *KubernetesGetClusterlintRequest) ([]*ClusterlintDiagnostic, *Response, error)

GetClusterlintResults fetches the diagnostics after clusterlint run completes

func (*KubernetesServiceOp) GetCredentials added in v1.22.0

GetCredentials returns a Kubernetes API server credentials for the specified cluster.

func (*KubernetesServiceOp) GetKubeConfig added in v1.7.0

GetKubeConfig returns a Kubernetes config file for the specified cluster.

func (*KubernetesServiceOp) GetKubeConfigWithExpiry added in v1.47.0

func (svc *KubernetesServiceOp) GetKubeConfigWithExpiry(ctx context.Context, clusterID string, expirySeconds int64) (*KubernetesClusterConfig, *Response, error)

GetKubeConfigWithExpiry returns a Kubernetes config file for the specified cluster with expiry_seconds. Expiry only makes sense for token-based kubeconfigs.

func (*KubernetesServiceOp) GetNodePool added in v1.7.0

func (svc *KubernetesServiceOp) GetNodePool(ctx context.Context, clusterID, poolID string) (*KubernetesNodePool, *Response, error)

GetNodePool retrieves an existing node pool in a Kubernetes cluster.

func (*KubernetesServiceOp) GetNodePoolTemplate added in v1.137.0

func (svc *KubernetesServiceOp) GetNodePoolTemplate(ctx context.Context, clusterID string, nodePoolName string) (*KubernetesNodePoolTemplate, *Response, error)

GetNodePoolTemplate retrieves the template used for a given node pool to scale up from zero.

func (*KubernetesServiceOp) GetOptions added in v1.7.0

GetOptions returns options about the Kubernetes service, such as the versions available for cluster creation.

func (*KubernetesServiceOp) GetUpgrades added in v1.14.0

func (svc *KubernetesServiceOp) GetUpgrades(ctx context.Context, clusterID string) ([]*KubernetesVersion, *Response, error)

GetUpgrades retrieves versions a Kubernetes cluster can be upgraded to. An upgrade can be requested using `Upgrade`.

func (*KubernetesServiceOp) GetUser added in v1.20.0

func (svc *KubernetesServiceOp) GetUser(ctx context.Context, clusterID string) (*KubernetesClusterUser, *Response, error)

GetUser retrieves the details of a Kubernetes cluster user.

func (*KubernetesServiceOp) List added in v1.7.0

List returns a list of the Kubernetes clusters visible with the caller's API token.

func (*KubernetesServiceOp) ListAssociatedResourcesForDeletion added in v1.57.0

func (svc *KubernetesServiceOp) ListAssociatedResourcesForDeletion(ctx context.Context, clusterID string) (*KubernetesAssociatedResources, *Response, error)

ListAssociatedResourcesForDeletion lists a Kubernetes cluster's resources that can be selected for deletion along with the cluster. See DeleteSelective Associated resources include volumes, volume snapshots and load balancers.

func (*KubernetesServiceOp) ListNodePools added in v1.7.0

func (svc *KubernetesServiceOp) ListNodePools(ctx context.Context, clusterID string, opts *ListOptions) ([]*KubernetesNodePool, *Response, error)

ListNodePools lists all the node pools found in a Kubernetes cluster.

func (*KubernetesServiceOp) RecycleNodePoolNodes added in v1.7.0

func (svc *KubernetesServiceOp) RecycleNodePoolNodes(ctx context.Context, clusterID, poolID string, recycle *KubernetesNodePoolRecycleNodesRequest) (*Response, error)

RecycleNodePoolNodes is DEPRECATED please use DeleteNode The method will be removed in godo 2.0.

func (*KubernetesServiceOp) RemoveRegistry added in v1.47.0

RemoveRegistry removes docr registry support for all the specified clusters

func (*KubernetesServiceOp) RunClusterlint added in v1.53.0

func (svc *KubernetesServiceOp) RunClusterlint(ctx context.Context, clusterID string, req *KubernetesRunClusterlintRequest) (string, *Response, error)

RunClusterlint schedules a clusterlint run for the specified cluster

func (*KubernetesServiceOp) Update added in v1.7.0

Update updates a Kubernetes cluster's properties.

func (*KubernetesServiceOp) UpdateNodePool added in v1.7.0

func (svc *KubernetesServiceOp) UpdateNodePool(ctx context.Context, clusterID, poolID string, update *KubernetesNodePoolUpdateRequest) (*KubernetesNodePool, *Response, error)

UpdateNodePool updates the details of an existing node pool.

func (*KubernetesServiceOp) Upgrade added in v1.14.0

func (svc *KubernetesServiceOp) Upgrade(ctx context.Context, clusterID string, upgrade *KubernetesClusterUpgradeRequest) (*Response, error)

Upgrade upgrades a Kubernetes cluster to a new version. Valid upgrade versions for a given cluster can be retrieved with `GetUpgrades`.

type KubernetesVersion added in v1.7.0

type KubernetesVersion struct {
	Slug              string   `json:"slug,omitempty"`
	KubernetesVersion string   `json:"kubernetes_version,omitempty"`
	SupportedFeatures []string `json:"supported_features,omitempty"`
}

KubernetesVersion is a DigitalOcean Kubernetes release.

type LBDomain added in v1.111.0

type LBDomain struct {
	// Name defines the domain fqdn
	Name string `json:"name"`
	// IsManaged indicates if the domain is DO-managed
	IsManaged bool `json:"is_managed"`
	// CertificateID indicates ID of a TLS certificate
	CertificateID string `json:"certificate_id,omitempty"`
	// Status indicates the domain validation status
	Status string `json:"status,omitempty"`
	// VerificationErrorReasons indicates any domain verification errors
	VerificationErrorReasons []string `json:"verification_error_reasons,omitempty"`
	// SSLValidationErrorReasons indicates any domain SSL validation errors
	SSLValidationErrorReasons []string `json:"ssl_validation_error_reasons,omitempty"`
}

LBDomain defines domain names required to ingress traffic to a Global LB

func (LBDomain) String added in v1.111.0

func (d LBDomain) String() string

String creates a human-readable description of a LBDomain

type LBFirewall added in v1.92.0

type LBFirewall struct {
	Allow []string `json:"allow,omitempty"`
	Deny  []string `json:"deny,omitempty"`
}

LBFirewall holds the allow and deny rules for a loadbalancer's firewall. Currently, allow and deny rules support cidrs and ips. Please use the helper methods (IPSourceFirewall/CIDRSourceFirewall) to format the allow/deny rules.

func (LBFirewall) String added in v1.92.0

func (f LBFirewall) String() string

String creates a human-readable description of an LBFirewall instance.

type LastIndexingJob added in v1.149.0

type LastIndexingJob struct {
	CompletedDatasources int        `json:"completed_datasources,omitempty"`
	CreatedAt            *Timestamp `json:"created_at,omitempty"`
	DataSourceUuids      []string   `json:"data_source_uuids,omitempty"`
	FinishedAt           *Timestamp `json:"finished_at,omitempty"`
	KnowledgeBaseUuid    string     `json:"knowledge_base_uuid,omitempty"`
	Phase                string     `json:"phase,omitempty"`
	StartedAt            *Timestamp `json:"started_at,omitempty"`
	Status               string     `json:"status,omitempty"`
	Tokens               int        `json:"tokens,omitempty"`
	TotalDatasources     int        `json:"total_datasources,omitempty"`
	TotalItemsFailed     string     `json:"total_items_failed,omitempty"`
	TotalItemsIndexed    string     `json:"total_items_indexed,omitempty"`
	TotalItemsSkipped    string     `json:"total_items_skipped,omitempty"`
	UpdatedAt            *Timestamp `json:"updated_at,omitempty"`
	Uuid                 string     `json:"uuid,omitempty"`
}

LastIndexingJob represents the last indexing job description of an Agent Platform Knowledge Base

type LatencyMetrics added in v1.194.1

type LatencyMetrics struct {
	AvgE2ELatencyMs float64 `json:"avg_e2e_latency_ms,omitempty"`
	MaxE2ELatencyMs float64 `json:"max_e2e_latency_ms,omitempty"`
	MinE2ELatencyMs float64 `json:"min_e2e_latency_ms,omitempty"`
	P50LatencyMs    float64 `json:"p50_latency_ms,omitempty"`
	P90LatencyMs    float64 `json:"p90_latency_ms,omitempty"`
	P95LatencyMs    float64 `json:"p95_latency_ms,omitempty"`
}

LatencyMetrics contains latency metrics for candidate model invocations, expressed in milliseconds.

type LinkAction added in v0.3.0

type LinkAction struct {
	ID   int    `json:"id,omitempty"`
	Rel  string `json:"rel,omitempty"`
	HREF string `json:"href,omitempty"`
}

LinkAction is a pointer to an action

func (*LinkAction) Get added in v0.3.0

func (la *LinkAction) Get(ctx context.Context, client *Client) (*Action, *Response, error)

Get a link action by id.

type Links struct {
	Pages   *Pages       `json:"pages,omitempty"`
	Actions []LinkAction `json:"actions,omitempty"`
}

Links manages links that are returned along with a List

func (*Links) CurrentPage added in v0.3.0

func (l *Links) CurrentPage() (int, error)

CurrentPage is current page of the list

func (*Links) IsLastPage added in v0.3.0

func (l *Links) IsLastPage() bool

IsLastPage returns true if the current page is the last

func (*Links) NextPageToken added in v1.73.0

func (l *Links) NextPageToken() (string, error)

NextPageToken is the page token to request the next page of the list

func (*Links) PrevPageToken added in v1.73.0

func (l *Links) PrevPageToken() (string, error)

PrevPageToken is the page token to request the previous page of the list

type ListBatchesOptions added in v1.187.0

type ListBatchesOptions struct {
	After  string `url:"after,omitempty"`
	Limit  int    `url:"limit,omitempty"`
	Status string `url:"status,omitempty"`
}

ListBatchesOptions specifies optional query parameters for listing batch jobs.

type ListBatchesResponse added in v1.187.0

type ListBatchesResponse struct {
	Edges    []BatchEdge   `json:"edges"`
	PageInfo BatchPageInfo `json:"page_info"`
}

ListBatchesResponse is returned by GET /v1/batches. Uses Relay-style cursor pagination.

type ListBuildpacksResponse added in v1.98.0

type ListBuildpacksResponse struct {
	// List of the available buildpacks on App Platform.
	Buildpacks []*Buildpack `json:"buildpacks,omitempty"`
}

ListBuildpacksResponse struct for ListBuildpacksResponse

func (*ListBuildpacksResponse) GetBuildpacks added in v1.98.0

func (l *ListBuildpacksResponse) GetBuildpacks() []*Buildpack

GetBuildpacks returns the Buildpacks field.

type ListDatabaseEvents added in v1.112.0

type ListDatabaseEvents struct {
	Events []DatabaseEvent `json:"events"`
}

ListDatabaseEvents contains a list of project events.

type ListDatabaseEventsRoot added in v1.112.0

type ListDatabaseEventsRoot struct {
	Events []DatabaseEvent `json:"events"`
}

type ListDatabaseKafkaSchemaRegistrySubjectsRoot added in v1.163.0

type ListDatabaseKafkaSchemaRegistrySubjectsRoot struct {
	Subjects []DatabaseKafkaSchemaRegistrySubject `json:"subjects"`
}

type ListEventsOptions added in v1.177.0

type ListEventsOptions struct {
	Page    int `url:"page,omitempty"`
	PerPage int `url:"per_page,omitempty"`
	// EventTypes filters events by type (e.g. DEPLOYMENT, AUTOSCALING).
	EventTypes []string `url:"event_types,omitempty"`
	// DeploymentTypes filters deployment events by deployment cause type.
	DeploymentTypes []string `url:"deployment_types,omitempty"`
}

ListEventsOptions specifies the optional parameters to the ListEvents method.

type ListFindingAffectedResourcesRequest added in v1.175.0

type ListFindingAffectedResourcesRequest struct {
	ScanUUID    string
	FindingUUID string
}

ListFindingAffectedResourcesRequest contains the fields to list the affected resources for a scan finding.

type ListJobInvocationsOptions added in v1.165.1

type ListJobInvocationsOptions struct {
	// For paginated result sets, page of results to retrieve.
	Page int `url:"page,omitempty"`
	// For paginated result sets, the number of results to include per page.
	PerPage int `url:"per_page,omitempty"`
	// DeploymentID is an optional paramerter. This is used to filter job invocations to a specific deployment.
	DeploymentID string `url:"deployment_id,omitempty"`
	// JobNames is an optional parameter. This is used to filter job invocations by job names.
	JobNames []string `url:"job_names,omitempty"`
}

type ListMicroVMCheckpointsOptions added in v1.210.0

type ListMicroVMCheckpointsOptions struct {
	ListOptions
	MicroVMID string `url:"microvm_id,omitempty"`
}

ListMicroVMCheckpointsOptions are the optional parameters for listing checkpoints. MicroVMID filters to checkpoints captured from that MicroVM; omit it to list all checkpoints for the team.

type ListMicroVMsOptions added in v1.213.0

type ListMicroVMsOptions struct {
	ListOptions
	Region  string `url:"region,omitempty"`
	Name    string `url:"name,omitempty"`
	TagName string `url:"tag_name,omitempty"`
}

ListMicroVMsOptions filters GET /v2/microvms. Pagination lives on the embedded ListOptions. Region, Name, and TagName are omitted when empty and combine: the API ANDs whichever are set.

type ListOptions

type ListOptions struct {
	// For paginated result sets, page of results to retrieve.
	Page int `url:"page,omitempty"`

	// For paginated result sets, the number of results to include per page.
	PerPage int `url:"per_page,omitempty"`

	// Whether App responses should include project_id fields. The field will be empty if false or if omitted. (ListApps)
	WithProjects bool `url:"with_projects,omitempty"`

	// This parameter is used to only list agents that are deployed in the response.
	Deployed bool `url:"only_deployed,omitempty"`

	// This parameter is used to include models that are publicly available.
	PublicOnly bool `url:"public_only,omitempty"`

	// This parameter is used to include models according to the use cases.
	Usecases []string `url:"usecases,omitempty"`
}

ListOptions specifies the optional parameters to various List methods that support pagination.

type ListVolumeParams added in v1.0.0

type ListVolumeParams struct {
	Region      string       `json:"region"`
	Name        string       `json:"name"`
	ListOptions *ListOptions `json:"list_options,omitempty"`
}

ListVolumeParams stores the options you can set for a ListVolumeCall

type LoadBalancer added in v1.0.0

type LoadBalancer struct {
	ID   string `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
	IP   string `json:"ip,omitempty"`
	IPv6 string `json:"ipv6,omitempty"`
	// SizeSlug is mutually exclusive with SizeUnit. Only one should be specified
	SizeSlug string `json:"size,omitempty"`
	// SizeUnit is mutually exclusive with SizeSlug. Only one should be specified
	SizeUnit                     uint32           `json:"size_unit,omitempty"`
	Type                         string           `json:"type,omitempty"`
	Algorithm                    string           `json:"algorithm,omitempty"`
	Status                       string           `json:"status,omitempty"`
	Created                      string           `json:"created_at,omitempty"`
	ForwardingRules              []ForwardingRule `json:"forwarding_rules,omitempty"`
	HealthCheck                  *HealthCheck     `json:"health_check,omitempty"`
	StickySessions               *StickySessions  `json:"sticky_sessions,omitempty"`
	Region                       *Region          `json:"region,omitempty"`
	DropletIDs                   []int            `json:"droplet_ids,omitempty"`
	Tag                          string           `json:"tag,omitempty"`
	Tags                         []string         `json:"tags,omitempty"`
	RedirectHttpToHttps          bool             `json:"redirect_http_to_https,omitempty"`
	EnableProxyProtocol          bool             `json:"enable_proxy_protocol,omitempty"`
	EnableBackendKeepalive       bool             `json:"enable_backend_keepalive,omitempty"`
	VPCUUID                      string           `json:"vpc_uuid,omitempty"`
	VPCSubnetUUID                string           `json:"subnet_uuid,omitempty"`
	DisableLetsEncryptDNSRecords *bool            `json:"disable_lets_encrypt_dns_records,omitempty"`
	ValidateOnly                 bool             `json:"validate_only,omitempty"`
	ProjectID                    string           `json:"project_id,omitempty"`
	HTTPIdleTimeoutSeconds       *uint64          `json:"http_idle_timeout_seconds,omitempty"`
	Firewall                     *LBFirewall      `json:"firewall,omitempty"`
	Domains                      []*LBDomain      `json:"domains,omitempty"`
	GLBSettings                  *GLBSettings     `json:"glb_settings,omitempty"`
	TargetLoadBalancerIDs        []string         `json:"target_load_balancer_ids,omitempty"`
	Network                      string           `json:"network,omitempty"`
	NetworkStack                 string           `json:"network_stack,omitempty"`
	TLSCipherPolicy              string           `json:"tls_cipher_policy,omitempty"`
}

LoadBalancer represents a DigitalOcean load balancer configuration. Tags can only be provided upon the creation of a Load Balancer.

func (LoadBalancer) AsRequest added in v1.1.1

func (l LoadBalancer) AsRequest() *LoadBalancerRequest

AsRequest creates a LoadBalancerRequest that can be submitted to Update with the current values of the LoadBalancer. Modifying the returned LoadBalancerRequest will not modify the original LoadBalancer.

func (LoadBalancer) String added in v1.0.0

func (l LoadBalancer) String() string

String creates a human-readable description of a LoadBalancer.

func (LoadBalancer) URN added in v1.6.0

func (l LoadBalancer) URN() string

URN returns the load balancer ID in a valid DO API URN form.

type LoadBalancerMetricsRequest added in v1.128.0

type LoadBalancerMetricsRequest struct {
	LoadBalancerID string
	Start          time.Time
	End            time.Time
}

LoadBalancerMetricsRequest holds the information needed to retrieve Load Balancer various metrics.

type LoadBalancerRequest added in v1.0.0

type LoadBalancerRequest struct {
	Name      string `json:"name,omitempty"`
	Algorithm string `json:"algorithm,omitempty"`
	Region    string `json:"region,omitempty"`
	// SizeSlug is mutually exclusive with SizeUnit. Only one should be specified
	SizeSlug string `json:"size,omitempty"`
	// SizeUnit is mutually exclusive with SizeSlug. Only one should be specified
	SizeUnit                     uint32           `json:"size_unit,omitempty"`
	Type                         string           `json:"type,omitempty"`
	ForwardingRules              []ForwardingRule `json:"forwarding_rules,omitempty"`
	HealthCheck                  *HealthCheck     `json:"health_check,omitempty"`
	StickySessions               *StickySessions  `json:"sticky_sessions,omitempty"`
	DropletIDs                   []int            `json:"droplet_ids,omitempty"`
	Tag                          string           `json:"tag,omitempty"`
	Tags                         []string         `json:"tags,omitempty"`
	RedirectHttpToHttps          bool             `json:"redirect_http_to_https,omitempty"`
	EnableProxyProtocol          bool             `json:"enable_proxy_protocol,omitempty"`
	EnableBackendKeepalive       bool             `json:"enable_backend_keepalive,omitempty"`
	VPCUUID                      string           `json:"vpc_uuid,omitempty"`
	VPCSubnetUUID                string           `json:"subnet_uuid,omitempty"`
	DisableLetsEncryptDNSRecords *bool            `json:"disable_lets_encrypt_dns_records,omitempty"`
	ValidateOnly                 bool             `json:"validate_only,omitempty"`
	ProjectID                    string           `json:"project_id,omitempty"`
	HTTPIdleTimeoutSeconds       *uint64          `json:"http_idle_timeout_seconds,omitempty"`
	Firewall                     *LBFirewall      `json:"firewall,omitempty"`
	Domains                      []*LBDomain      `json:"domains,omitempty"`
	GLBSettings                  *GLBSettings     `json:"glb_settings,omitempty"`
	TargetLoadBalancerIDs        []string         `json:"target_load_balancer_ids,omitempty"`
	Network                      string           `json:"network,omitempty"`
	NetworkStack                 string           `json:"network_stack,omitempty"`
	TLSCipherPolicy              string           `json:"tls_cipher_policy,omitempty"`
	// IP is an optional BYOIP address to assign on create. When omitted, a
	// system-allocated floating IP is provisioned. Create-only; not used on update.
	IP string `json:"ip,omitempty"`
}

LoadBalancerRequest represents the configuration to be applied to an existing or a new load balancer.

func (LoadBalancerRequest) String added in v1.0.0

func (l LoadBalancerRequest) String() string

String creates a human-readable description of a LoadBalancerRequest.

type LoadBalancersService added in v1.0.0

type LoadBalancersService interface {
	Get(context.Context, string) (*LoadBalancer, *Response, error)
	List(context.Context, *ListOptions) ([]LoadBalancer, *Response, error)
	ListByNames(context.Context, []string, *ListOptions) ([]LoadBalancer, *Response, error)
	ListByUUIDs(context.Context, []string, *ListOptions) ([]LoadBalancer, *Response, error)
	Create(context.Context, *LoadBalancerRequest) (*LoadBalancer, *Response, error)
	Update(ctx context.Context, lbID string, lbr *LoadBalancerRequest) (*LoadBalancer, *Response, error)
	Delete(ctx context.Context, lbID string) (*Response, error)
	AddDroplets(ctx context.Context, lbID string, dropletIDs ...int) (*Response, error)
	RemoveDroplets(ctx context.Context, lbID string, dropletIDs ...int) (*Response, error)
	AddForwardingRules(ctx context.Context, lbID string, rules ...ForwardingRule) (*Response, error)
	RemoveForwardingRules(ctx context.Context, lbID string, rules ...ForwardingRule) (*Response, error)
	PurgeCache(ctx context.Context, lbID string) (*Response, error)
}

LoadBalancersService is an interface for managing load balancers with the DigitalOcean API. See: https://docs.digitalocean.com/reference/api/api-reference/#tag/Load-Balancers

type LoadBalancersServiceOp added in v1.0.0

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

LoadBalancersServiceOp handles communication with load balancer-related methods of the DigitalOcean API.

func (*LoadBalancersServiceOp) AddDroplets added in v1.0.0

func (l *LoadBalancersServiceOp) AddDroplets(ctx context.Context, lbID string, dropletIDs ...int) (*Response, error)

AddDroplets adds droplets to a load balancer.

func (*LoadBalancersServiceOp) AddForwardingRules added in v1.0.0

func (l *LoadBalancersServiceOp) AddForwardingRules(ctx context.Context, lbID string, rules ...ForwardingRule) (*Response, error)

AddForwardingRules adds forwarding rules to a load balancer.

func (*LoadBalancersServiceOp) Create added in v1.0.0

Create a new load balancer with a given configuration.

func (*LoadBalancersServiceOp) Delete added in v1.0.0

func (l *LoadBalancersServiceOp) Delete(ctx context.Context, ldID string) (*Response, error)

Delete a load balancer by its identifier.

func (*LoadBalancersServiceOp) Get added in v1.0.0

Get an existing load balancer by its identifier.

func (*LoadBalancersServiceOp) List added in v1.0.0

List load balancers, with optional pagination.

func (*LoadBalancersServiceOp) ListByNames added in v1.138.0

func (l *LoadBalancersServiceOp) ListByNames(ctx context.Context, names []string, opt *ListOptions) ([]LoadBalancer, *Response, error)

ListByNames lists load balancers filtered by resource names, with optional pagination.

func (*LoadBalancersServiceOp) ListByUUIDs added in v1.138.0

func (l *LoadBalancersServiceOp) ListByUUIDs(ctx context.Context, uuids []string, opt *ListOptions) ([]LoadBalancer, *Response, error)

ListByUUIDs lists load balancers filtered by resource UUIDs, with optional pagination.

func (*LoadBalancersServiceOp) PurgeCache added in v1.111.0

func (l *LoadBalancersServiceOp) PurgeCache(ctx context.Context, ldID string) (*Response, error)

PurgeCache purges the CDN cache of a global load balancer by its identifier.

func (*LoadBalancersServiceOp) RemoveDroplets added in v1.0.0

func (l *LoadBalancersServiceOp) RemoveDroplets(ctx context.Context, lbID string, dropletIDs ...int) (*Response, error)

RemoveDroplets removes droplets from a load balancer.

func (*LoadBalancersServiceOp) RemoveForwardingRules added in v1.0.0

func (l *LoadBalancersServiceOp) RemoveForwardingRules(ctx context.Context, lbID string, rules ...ForwardingRule) (*Response, error)

RemoveForwardingRules removes forwarding rules from a load balancer.

func (*LoadBalancersServiceOp) Update added in v1.0.0

Update an existing load balancer with new configuration.

type LogsFieldRef added in v1.219.0

type LogsFieldRef struct {
	Name  string `json:"name"`
	Scope string `json:"scope,omitempty"`
}

LogsFieldRef identifies an intrinsic field or an attribute.

type LogsFilterCondition added in v1.219.0

type LogsFilterCondition struct {
	Field    LogsFieldRef     `json:"field"`
	Operator string           `json:"operator"`
	Value    *LogsFilterValue `json:"value,omitempty"`
}

LogsFilterCondition is a single field comparison.

type LogsFilterExpression added in v1.219.0

type LogsFilterExpression struct {
	Condition  *LogsFilterCondition  `json:"condition,omitempty"`
	And        *LogsFilterGroup      `json:"and,omitempty"`
	Or         *LogsFilterGroup      `json:"or,omitempty"`
	Not        *LogsFilterExpression `json:"not,omitempty"`
	TextSearch *LogsTextSearch       `json:"text_search,omitempty"`
}

LogsFilterExpression is a boolean filter tree. Set exactly one expression node.

type LogsFilterGroup added in v1.219.0

type LogsFilterGroup struct {
	Expressions []LogsFilterExpression `json:"expressions"`
}

LogsFilterGroup combines nested logs filter expressions.

type LogsFilterValue added in v1.219.0

type LogsFilterValue struct {
	StringValue      *string               `json:"string_value,omitempty"`
	NumberValue      *float64              `json:"number_value,omitempty"`
	BoolValue        *bool                 `json:"bool_value,omitempty"`
	StringArrayValue *LogsStringArrayValue `json:"string_array_value,omitempty"`
	NumberArrayValue *LogsNumberArrayValue `json:"number_array_value,omitempty"`
}

LogsFilterValue is a typed filter literal. Set exactly one value. Scalar fields use pointers so zero, false, and an empty string can be sent.

type LogsNumberArrayValue added in v1.219.0

type LogsNumberArrayValue struct {
	Values []float64 `json:"values"`
}

LogsNumberArrayValue is a number-list filter value.

type LogsOrderBy added in v1.219.0

type LogsOrderBy struct {
	Field     LogsFieldRef `json:"field"`
	Direction string       `json:"direction,omitempty"`
}

LogsOrderBy is a logs search sort clause. Cursor pagination is available only when ordering by timestamp alone.

type LogsPaginationRequest added in v1.219.0

type LogsPaginationRequest struct {
	// Limit defaults to 100 and is clamped to 1000 by the API.
	Limit  int    `json:"limit,omitempty"`
	Cursor string `json:"cursor,omitempty"`
}

LogsPaginationRequest configures cursor pagination for a logs search.

type LogsPaginationResponse added in v1.219.0

type LogsPaginationResponse struct {
	HasMore    bool   `json:"has_more"`
	NextCursor string `json:"next_cursor,omitempty"`
}

LogsPaginationResponse describes the next page of logs search results.

type LogsSearchRequest added in v1.219.0

type LogsSearchRequest struct {
	TimeRange  LogsTimeRange          `json:"time_range"`
	Filter     *LogsFilterExpression  `json:"filter,omitempty"`
	OrderBy    []LogsOrderBy          `json:"order_by,omitempty"`
	Pagination *LogsPaginationRequest `json:"pagination,omitempty"`
}

LogsSearchRequest describes an Insights logs search. TimeRange must not exceed seven days.

type LogsSearchResponse added in v1.219.0

type LogsSearchResponse struct {
	Data       []InsightsLogRecord     `json:"data,omitempty"`
	Pagination *LogsPaginationResponse `json:"pagination,omitempty"`
}

LogsSearchResponse contains matching log records and pagination state.

type LogsStringArrayValue added in v1.219.0

type LogsStringArrayValue struct {
	Values []string `json:"values"`
}

LogsStringArrayValue is a string-list filter value.

type LogsTextSearch added in v1.219.0

type LogsTextSearch struct {
	Query string `json:"query"`
}

LogsTextSearch searches for a substring across the log body, service name, and resource URN.

type LogsTimeInstant added in v1.219.0

type LogsTimeInstant struct {
	Absolute string `json:"absolute,omitempty"`
	Relative string `json:"relative,omitempty"`
	UnixNano string `json:"unix_nano,omitempty"`
}

LogsTimeInstant identifies a point in time. Set exactly one of Absolute, Relative, or UnixNano.

type LogsTimeRange added in v1.219.0

type LogsTimeRange struct {
	From LogsTimeInstant `json:"from"`
	To   LogsTimeInstant `json:"to"`
}

LogsTimeRange is an inclusive logs query time window.

type Message added in v1.191.0

type Message struct {
	ID           string                `json:"id"`
	Type         string                `json:"type"`
	Role         string                `json:"role"`
	Model        string                `json:"model"`
	Content      []MessageContentBlock `json:"content"`
	StopReason   *string               `json:"stop_reason"`
	StopSequence *string               `json:"stop_sequence,omitempty"`
	Usage        MessageUsage          `json:"usage"`
}

Message is returned by POST /v1/messages when stream is false.

type MessageContentBlock added in v1.191.0

type MessageContentBlock struct {
	Type  string                 `json:"type"`
	Text  string                 `json:"text,omitempty"`
	ID    string                 `json:"id,omitempty"`
	Name  string                 `json:"name,omitempty"`
	Input map[string]interface{} `json:"input,omitempty"`
}

MessageContentBlock is one assistant output block ("text" or "tool_use").

type MessageNewParams added in v1.191.0

type MessageNewParams struct {
	Model           string                    `json:"model"`
	MaxTokens       int                       `json:"max_tokens"`
	Messages        []MessageParam            `json:"messages"`
	Metadata        *MessageNewParamsMetadata `json:"metadata,omitempty"`
	ReasoningEffort *string                   `json:"reasoning_effort,omitempty"`
	Speed           *string                   `json:"speed,omitempty"`
	StopSequences   []string                  `json:"stop_sequences,omitempty"`
	Stream          *bool                     `json:"stream,omitempty"`
	System          json.RawMessage           `json:"system,omitempty"`
	Temperature     *float64                  `json:"temperature,omitempty"`
	Thinking        *MessageNewParamsThinking `json:"thinking,omitempty"`
	ToolChoice      json.RawMessage           `json:"tool_choice,omitempty"`
	Tools           []MessageNewParamsTool    `json:"tools,omitempty"`
	TopK            *int                      `json:"top_k,omitempty"`
	TopP            *float64                  `json:"top_p,omitempty"`
}

MessageNewParams is the request body for POST /v1/messages. System and ToolChoice are json.RawMessage to accept either a string or a structured value.

type MessageNewParamsMetadata added in v1.191.0

type MessageNewParamsMetadata struct {
	UserID string `json:"user_id,omitempty"`
}

MessageNewParamsMetadata is the optional metadata block on a /v1/messages request.

type MessageNewParamsSystemBlock added in v1.191.0

type MessageNewParamsSystemBlock struct {
	Type string `json:"type"`
	Text string `json:"text"`
}

MessageNewParamsSystemBlock is a single block in a structured system prompt.

type MessageNewParamsThinking added in v1.191.0

type MessageNewParamsThinking struct {
	Type string `json:"type"`
}

MessageNewParamsThinking configures extended-thinking behavior on supported models.

type MessageNewParamsTool added in v1.191.0

type MessageNewParamsTool struct {
	Name        string                 `json:"name"`
	Description string                 `json:"description,omitempty"`
	InputSchema map[string]interface{} `json:"input_schema"`
}

MessageNewParamsTool is a tool definition for the /v1/messages endpoint.

type MessageNewParamsToolChoice added in v1.191.0

type MessageNewParamsToolChoice struct {
	Type string `json:"type"`
	Name string `json:"name,omitempty"`
}

MessageNewParamsToolChoice selects how the model uses tools.

type MessageParam added in v1.191.0

type MessageParam struct {
	Role    string          `json:"role"`
	Content json.RawMessage `json:"content"`
}

MessageParam is a single turn; Content is a string or an array of content blocks.

type MessageService added in v1.191.0

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

MessageService exposes POST /v1/messages (Anthropic-style conversational messages).

func (*MessageService) New added in v1.191.0

New creates a non-streaming message.

func (*MessageService) NewStreaming added in v1.191.0

func (s *MessageService) NewStreaming(ctx context.Context, body *MessageNewParams) (*MessageStream, *Response, error)

NewStreaming opens an SSE stream of /v1/messages events; body.Stream is forced to true. Callers MUST Close the returned stream.

type MessageStream added in v1.191.0

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

MessageStream is a typed iterator over a /v1/messages SSE stream.

func (*MessageStream) Close added in v1.191.0

func (s *MessageStream) Close() error

Close releases the underlying HTTP response body. Always call Close.

func (*MessageStream) Current added in v1.191.0

func (s *MessageStream) Current() MessageStreamEvent

Current returns the most recent event produced by Next.

func (*MessageStream) Err added in v1.191.0

func (s *MessageStream) Err() error

Err returns any non-EOF error encountered during iteration.

func (*MessageStream) Next added in v1.191.0

func (s *MessageStream) Next() bool

Next advances the stream to the next event. Returns false on EOF or error.

type MessageStreamEvent added in v1.191.0

type MessageStreamEvent struct {
	Type         string                  `json:"type"`
	Index        int                     `json:"index,omitempty"`
	Message      *Message                `json:"message,omitempty"`
	ContentBlock *MessageContentBlock    `json:"content_block,omitempty"`
	Delta        MessageStreamEventDelta `json:"delta,omitempty"`
	Usage        *MessageUsage           `json:"usage,omitempty"`
}

MessageStreamEvent is one Anthropic-style SSE event from /v1/messages (message_start, content_block_start, content_block_delta, content_block_stop, message_delta, message_stop, ping).

type MessageStreamEventDelta added in v1.191.0

type MessageStreamEventDelta struct {
	Type         string  `json:"type,omitempty"`
	Text         string  `json:"text,omitempty"`
	PartialJSON  string  `json:"partial_json,omitempty"`
	StopReason   *string `json:"stop_reason,omitempty"`
	StopSequence *string `json:"stop_sequence,omitempty"`
}

MessageStreamEventDelta carries the incremental fields in a /v1/messages SSE event.

type MessageUsage added in v1.191.0

type MessageUsage struct {
	InputTokens              int     `json:"input_tokens"`
	OutputTokens             int     `json:"output_tokens"`
	CacheCreationInputTokens int     `json:"cache_creation_input_tokens,omitempty"`
	CacheReadInputTokens     int     `json:"cache_read_input_tokens,omitempty"`
	Speed                    *string `json:"speed,omitempty"`
}

MessageUsage holds token usage for a non-streaming /v1/messages response.

type Meta added in v1.29.0

type Meta struct {
	Page  int `json:"page,,omitempty"`
	Pages int `json:"pages,,omitempty"`
	Total int `json:"total"`
}

Meta describes generic information about a response.

type MetricResultSummary added in v1.194.1

type MetricResultSummary struct {
	AvgAtKPercent  float64 `json:"avg_at_k_percent,omitempty"`
	ConsAtKPercent float64 `json:"cons_at_k_percent,omitempty"`
	Description    string  `json:"description,omitempty"`
	FailCount      uint32  `json:"fail_count,omitempty"`
	FailPercent    float64 `json:"fail_percent,omitempty"`
	MetricName     string  `json:"metric_name,omitempty"`
	MetricUuid     string  `json:"metric_uuid,omitempty"`
	PassAtKPercent float64 `json:"pass_at_k_percent,omitempty"`
	PassCount      uint32  `json:"pass_count,omitempty"`
	PassPercent    float64 `json:"pass_percent,omitempty"`
	SkipPercent    float64 `json:"skip_percent,omitempty"`
	SkippedCount   uint32  `json:"skipped_count,omitempty"`
}

MetricResultSummary represents per-metric aggregated pass/fail statistics across all prompts in an evaluation run.

type MetricsData added in v1.70.0

type MetricsData struct {
	ResultType string                 `json:"resultType"`
	Result     []metrics.SampleStream `json:"result"`
}

MetricsData holds the data portion of a Metrics response.

type MetricsResponse added in v1.70.0

type MetricsResponse struct {
	Status string      `json:"status"`
	Data   MetricsData `json:"data"`
}

MetricsResponse holds a Metrics query response.

type MicroVM added in v1.210.0

type MicroVM struct {
	ID            string              `json:"id,omitempty"`
	Name          string              `json:"name,omitempty"`
	Region        string              `json:"region,omitempty"`
	State         MicroVMState        `json:"state,omitempty"`
	Size          *MicroVMSize        `json:"size,omitempty"`
	URLs          []MicroVMURL        `json:"urls,omitempty"`
	Ports         []uint32            `json:"ports,omitempty"`
	FailureReason string              `json:"failure_reason,omitempty"`
	Networking    MicroVMNetworking   `json:"networking,omitempty"`
	Source        *MicroVMSource      `json:"source,omitempty"`
	AutoPause     *AutoPauseConfig    `json:"auto_pause,omitempty"`
	AutoResume    *bool               `json:"auto_resume,omitempty"`
	HTTPProtocol  MicroVMHTTPProtocol `json:"http_protocol,omitempty"`
	Created       string              `json:"created_at,omitempty"`
	Tags          []string            `json:"tags,omitempty"`
}

MicroVM represents a DigitalOcean MicroVM.

func (MicroVM) String added in v1.210.0

func (m MicroVM) String() string

String returns a human-readable description of a MicroVM.

func (MicroVM) URN added in v1.210.0

func (m MicroVM) URN() string

URN returns the MicroVM ID in a valid DO API URN form.

type MicroVMAccountLimits added in v1.210.0

type MicroVMAccountLimits struct {
	MaxConcurrentRunning  uint64 `json:"max_concurrent_running,omitempty"`
	MaxTotalCount         uint64 `json:"max_total_count,omitempty"`
	MaxMemoryBytes        uint64 `json:"max_memory_bytes,omitempty"`
	MaxDiskBytes          uint64 `json:"max_disk_bytes,omitempty"`
	MaxIdleTimeoutSeconds uint64 `json:"max_idle_timeout_seconds,omitempty"`
}

MicroVMAccountLimits are the team's effective MicroVM limits.

type MicroVMCheckpoint added in v1.210.0

type MicroVMCheckpoint struct {
	ID          string `json:"id,omitempty"`
	MicroVMID   string `json:"microvm_id,omitempty"`
	MicroVMName string `json:"microvm_name,omitempty"`
	Name        string `json:"name,omitempty"`
	Region      string `json:"region,omitempty"`
	// Size is the guest shape this checkpoint restores at. Omitted when the
	// checkpoint does not record one; a create from it must then name a size.
	Size        *MicroVMSize            `json:"size,omitempty"`
	Status      MicroVMCheckpointStatus `json:"status,omitempty"`
	MemoryBytes uint64                  `json:"memory_bytes,omitempty"`
	DiskBytes   uint64                  `json:"disk_bytes,omitempty"`
	Created     string                  `json:"created_at,omitempty"`
}

MicroVMCheckpoint represents a checkpoint of a MicroVM (persisted memory + disk state).

func (MicroVMCheckpoint) String added in v1.210.0

func (c MicroVMCheckpoint) String() string

String returns a human-readable description of a MicroVMCheckpoint.

type MicroVMCheckpointCreateRequest added in v1.210.0

type MicroVMCheckpointCreateRequest struct {
	Name string `json:"name,omitempty"`
}

MicroVMCheckpointCreateRequest represents a request to create a checkpoint.

type MicroVMCheckpointStatus added in v1.210.0

type MicroVMCheckpointStatus string

MicroVMCheckpointStatus represents the status of a MicroVM checkpoint.

type MicroVMConsoleControl added in v1.212.0

type MicroVMConsoleControl struct {
	Error  *MicroVMConsoleError  `json:"error,omitempty"`
	Exit   *MicroVMConsoleExit   `json:"exit,omitempty"`
	Status *MicroVMConsoleStatus `json:"status,omitempty"`
}

MicroVMConsoleControl is a decoded server → client text control frame. Exactly one of Error, Exit, or Status is set for a well-formed frame.

func ParseMicroVMConsoleControl added in v1.212.0

func ParseMicroVMConsoleControl(data []byte) (*MicroVMConsoleControl, error)

ParseMicroVMConsoleControl decodes a server → client text control frame (error, exit, or status). Binary frames are raw PTY stdout and should not be passed here. Returns an error if the payload is not valid JSON or does not contain any recognized control field.

type MicroVMConsoleError added in v1.212.0

type MicroVMConsoleError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

MicroVMConsoleError is the payload of an {"error":...} control frame.

type MicroVMConsoleExit added in v1.212.0

type MicroVMConsoleExit struct {
	Code int32 `json:"code"`
}

MicroVMConsoleExit is the payload of an {"exit":...} control frame.

type MicroVMConsoleOptions added in v1.212.0

type MicroVMConsoleOptions struct {
	Rows uint32
	Cols uint32
}

MicroVMConsoleOptions sets the initial PTY size for ConsoleURL. The server defaults to 24 rows by 80 columns when either is zero / unset.

type MicroVMConsoleStatus added in v1.212.0

type MicroVMConsoleStatus struct {
	State string `json:"state"`
}

MicroVMConsoleStatus is the payload of a {"status":...} control frame (e.g. state "resuming" while a paused MicroVM is auto-resumed).

type MicroVMCreateOptions added in v1.210.0

type MicroVMCreateOptions struct {
	DefaultRegion string                 `json:"default_region,omitempty"`
	Sizes         []MicroVMSizeOption    `json:"sizes,omitempty"`
	Features      []MicroVMFeatureOption `json:"features,omitempty"`
	AccountLimits *MicroVMAccountLimits  `json:"account_limits,omitempty"`
}

MicroVMCreateOptions is the response from GET /v2/microvms/options.

type MicroVMCreateRequest added in v1.210.0

type MicroVMCreateRequest struct {
	Name         string              `json:"name"`
	Region       string              `json:"region,omitempty"`
	Size         *MicroVMSizeRequest `json:"size,omitempty"`
	Source       *MicroVMSource      `json:"source"`
	Networking   MicroVMNetworking   `json:"networking,omitempty"`
	VPCUUID      string              `json:"vpc_uuid,omitempty"`
	AutoPause    *AutoPauseConfig    `json:"auto_pause,omitempty"`
	AutoResume   *bool               `json:"auto_resume,omitempty"`
	HTTPPort     uint32              `json:"http_port,omitempty"`
	HTTPProtocol MicroVMHTTPProtocol `json:"http_protocol,omitempty"`
	Ports        []uint32            `json:"ports,omitempty"`
	Environment  map[string]string   `json:"environment,omitempty"`
	Tags         []string            `json:"tags,omitempty"`
}

MicroVMCreateRequest represents a request to create a MicroVM. Size and Region may be omitted when restoring from a checkpoint so the API can inherit them from the checkpoint (api-v2 C6).

func (MicroVMCreateRequest) String added in v1.210.0

func (r MicroVMCreateRequest) String() string

String returns a human-readable description of a MicroVMCreateRequest.

type MicroVMExecRequest added in v1.212.0

type MicroVMExecRequest struct {
	Argv []string `json:"argv"`
	Cwd  string   `json:"cwd,omitempty"`
}

MicroVMExecRequest is a one-shot, non-PTY command run in a MicroVM's workload container. Argv must be non-empty (e.g. ["echo", "hi"]).

type MicroVMExecResult added in v1.212.0

type MicroVMExecResult struct {
	Stdout    string `json:"stdout"`
	Stderr    string `json:"stderr"`
	ExitCode  int32  `json:"exit_code"`
	Truncated bool   `json:"truncated,omitempty"`
}

MicroVMExecResult is the outcome of a one-shot exec. A non-zero ExitCode is not a client error — the API returns HTTP 200 with the exit code set. Truncated is true when the server clipped stdout/stderr to its output bound.

type MicroVMFeatureOption added in v1.210.0

type MicroVMFeatureOption struct {
	Name    string `json:"name,omitempty"`
	Enabled bool   `json:"enabled"`
}

MicroVMFeatureOption is one product feature gate for the team.

type MicroVMHTTPProtocol added in v1.210.0

type MicroVMHTTPProtocol string

MicroVMHTTPProtocol represents the HTTP protocol option for a MicroVM.

type MicroVMNetworking added in v1.210.0

type MicroVMNetworking string

MicroVMNetworking represents the networking mode of a MicroVM.

type MicroVMSize added in v1.210.0

type MicroVMSize struct {
	CPU    uint32 `json:"cpu,omitempty"`
	Memory uint32 `json:"memory,omitempty"`
	Disk   uint64 `json:"disk,omitempty"`
}

MicroVMSize is the compute capacity reported on a MicroVM.

type MicroVMSizeOption added in v1.210.0

type MicroVMSizeOption struct {
	CPU       uint32              `json:"cpu"`
	Memory    uint32              `json:"memory"`
	Disk      uint64              `json:"disk"`
	Available bool                `json:"available"`
	Regions   []string            `json:"regions"`
	Pricing   *MicroVMSizePricing `json:"pricing,omitempty"`
}

MicroVMSizeOption is one supported size evaluated for the team. Regions holds the slugs where the team can create this size; a region it cannot use is absent rather than listed as unavailable.

type MicroVMSizePricing added in v1.210.0

type MicroVMSizePricing struct {
	PricePerHour  float64 `json:"price_per_hour"`
	PricePerMonth float64 `json:"price_per_month"`
}

MicroVMSizePricing is the USD price of one size.

type MicroVMSizeRequest added in v1.210.0

type MicroVMSizeRequest struct {
	CPU    uint32 `json:"cpu"`
	Memory uint32 `json:"memory"`
}

MicroVMSizeRequest is the compute capacity requested at create time. Disk is provisioned with the size and is not requested.

type MicroVMSource added in v1.210.0

type MicroVMSource struct {
	OCIRef       string `json:"oci_ref,omitempty"`
	CheckpointID string `json:"checkpoint_id,omitempty"`
}

MicroVMSource names what a MicroVM runs. Exactly one of OCIRef or CheckpointID must be set on create; the API rejects both or neither.

type MicroVMState added in v1.210.0

type MicroVMState string

MicroVMState represents the lifecycle state of a MicroVM.

type MicroVMURL added in v1.210.0

type MicroVMURL struct {
	Hostname string           `json:"hostname,omitempty"`
	Port     int              `json:"port,omitempty"`
	Default  bool             `json:"default,omitempty"`
	Status   MicroVMURLStatus `json:"status,omitempty"`
}

MicroVMURL is one ingress URL attached to a MicroVM.

type MicroVMURLStatus added in v1.210.0

type MicroVMURLStatus string

MicroVMURLStatus represents the lifecycle of a MicroVM URL.

type MicroVMsService added in v1.210.0

type MicroVMsService interface {
	List(ctx context.Context, opt *ListOptions) ([]MicroVM, *Response, error)
	ListByRegion(ctx context.Context, region string, opt *ListOptions) ([]MicroVM, *Response, error)
	ListByName(ctx context.Context, name string, opt *ListOptions) ([]MicroVM, *Response, error)
	ListByTag(ctx context.Context, tag string, opt *ListOptions) ([]MicroVM, *Response, error)
	ListFiltered(ctx context.Context, opt *ListMicroVMsOptions) ([]MicroVM, *Response, error)
	Get(ctx context.Context, id string) (*MicroVM, *Response, error)
	Create(ctx context.Context, createRequest *MicroVMCreateRequest) (*MicroVM, *Response, error)
	Pause(ctx context.Context, id string) (*MicroVM, *Response, error)
	Resume(ctx context.Context, id string) (*MicroVM, *Response, error)
	Delete(ctx context.Context, id string) (*Response, error)

	ListCheckpoints(ctx context.Context, opt *ListMicroVMCheckpointsOptions) ([]MicroVMCheckpoint, *Response, error)
	CreateCheckpoint(ctx context.Context, microVMID string, createRequest *MicroVMCheckpointCreateRequest) (*MicroVMCheckpoint, *Response, error)
	GetCheckpoint(ctx context.Context, id string) (*MicroVMCheckpoint, *Response, error)
	DeleteCheckpoint(ctx context.Context, id string) (*Response, error)

	GetCreateOptions(ctx context.Context) (*MicroVMCreateOptions, *Response, error)

	Exec(ctx context.Context, id string, execRequest *MicroVMExecRequest) (*MicroVMExecResult, *Response, error)
	ConsoleURL(id string, opt *MicroVMConsoleOptions) (string, error)
}

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

type MicroVMsServiceOp added in v1.210.0

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

MicroVMsServiceOp handles communication with the MicroVM related methods of the DigitalOcean API.

func (*MicroVMsServiceOp) ConsoleURL added in v1.212.0

func (s *MicroVMsServiceOp) ConsoleURL(id string, opt *MicroVMConsoleOptions) (string, error)

ConsoleURL builds the WebSocket URL for an interactive PTY console on the MicroVM (GET /v2/microvms/{id}/console). godo does not dial WebSockets; the caller supplies its own client. The bearer token lives on godo's HTTP transport and is not attached to requests built here, so the caller must set Authorization: Bearer <token> on the WebSocket handshake. Binary frames are raw terminal I/O; text frames carry resize (client→server) and error/exit/ status control (server→client) — see MarshalMicroVMConsoleResize and ParseMicroVMConsoleControl.

func (*MicroVMsServiceOp) Create added in v1.210.0

func (s *MicroVMsServiceOp) Create(ctx context.Context, createRequest *MicroVMCreateRequest) (*MicroVM, *Response, error)

Create provisions a new MicroVM with the provided configuration.

func (*MicroVMsServiceOp) CreateCheckpoint added in v1.210.0

func (s *MicroVMsServiceOp) CreateCheckpoint(ctx context.Context, microVMID string, createRequest *MicroVMCheckpointCreateRequest) (*MicroVMCheckpoint, *Response, error)

CreateCheckpoint starts an asynchronous checkpoint of a running MicroVM.

func (*MicroVMsServiceOp) Delete added in v1.210.0

func (s *MicroVMsServiceOp) Delete(ctx context.Context, id string) (*Response, error)

Delete removes a MicroVM by its ID. The DigitalOcean API returns a 204 on success and does not include a response body.

func (*MicroVMsServiceOp) DeleteCheckpoint added in v1.210.0

func (s *MicroVMsServiceOp) DeleteCheckpoint(ctx context.Context, id string) (*Response, error)

DeleteCheckpoint releases the state stored by a checkpoint. Returns a 204 on success with no response body.

func (*MicroVMsServiceOp) Exec added in v1.212.0

Exec runs a one-shot, non-PTY command in the MicroVM's workload container and returns its stdout, stderr, and exit code. Requires the exec_pty feature gate (see GetCreateOptions Features). A paused MicroVM is auto-resumed. A non-zero ExitCode is not a Go error — the API returns HTTP 200.

func (*MicroVMsServiceOp) Get added in v1.210.0

Get retrieves a MicroVM by its ID.

func (*MicroVMsServiceOp) GetCheckpoint added in v1.210.0

func (s *MicroVMsServiceOp) GetCheckpoint(ctx context.Context, id string) (*MicroVMCheckpoint, *Response, error)

GetCheckpoint retrieves a checkpoint by its ID.

func (*MicroVMsServiceOp) GetCreateOptions added in v1.210.0

func (s *MicroVMsServiceOp) GetCreateOptions(ctx context.Context) (*MicroVMCreateOptions, *Response, error)

GetCreateOptions returns the sizes, the regions each one can be created in, the feature gates, and the account limits available to the authenticated team when creating a MicroVM.

func (*MicroVMsServiceOp) List added in v1.210.0

List lists all MicroVMs, with optional pagination.

func (*MicroVMsServiceOp) ListByName added in v1.210.0

func (s *MicroVMsServiceOp) ListByName(ctx context.Context, name string, opt *ListOptions) ([]MicroVM, *Response, error)

ListByName lists MicroVMs filtered by exact name match, with optional pagination.

func (*MicroVMsServiceOp) ListByRegion added in v1.210.0

func (s *MicroVMsServiceOp) ListByRegion(ctx context.Context, region string, opt *ListOptions) ([]MicroVM, *Response, error)

ListByRegion lists MicroVMs filtered by region slug, with optional pagination.

func (*MicroVMsServiceOp) ListByTag added in v1.213.0

func (s *MicroVMsServiceOp) ListByTag(ctx context.Context, tag string, opt *ListOptions) ([]MicroVM, *Response, error)

ListByTag lists MicroVMs that carry the given resource tag. A tag that matches nothing returns an empty list rather than an error.

func (*MicroVMsServiceOp) ListCheckpoints added in v1.210.0

ListCheckpoints lists checkpoints for the authenticated team. Pass a MicroVMID on opt to filter to checkpoints captured from that MicroVM.

func (*MicroVMsServiceOp) ListFiltered added in v1.213.0

func (s *MicroVMsServiceOp) ListFiltered(ctx context.Context, opt *ListMicroVMsOptions) ([]MicroVM, *Response, error)

ListFiltered lists MicroVMs using any combination of region, name, and tag.

func (*MicroVMsServiceOp) Pause added in v1.210.0

func (s *MicroVMsServiceOp) Pause(ctx context.Context, id string) (*MicroVM, *Response, error)

Pause synchronously transitions a RUNNING MicroVM to PAUSED. It blocks until the platform has durably paused the MicroVM and returns the updated resource. The call is idempotent: pausing a MicroVM that is already PAUSED returns the current MicroVM with no side effects.

func (*MicroVMsServiceOp) Resume added in v1.210.0

func (s *MicroVMsServiceOp) Resume(ctx context.Context, id string) (*MicroVM, *Response, error)

Resume synchronously transitions a PAUSED MicroVM to RUNNING. It blocks until the platform has durably resumed the MicroVM and returns the updated resource. The call is idempotent: resuming a MicroVM that is already RUNNING returns the current MicroVM with no side effects.

type Model added in v1.149.0

type Model struct {
	Agreement         *Agreement       `json:"agreement,omitempty"`
	BenchmarkScore    json.RawMessage  `json:"benchmark_score,omitempty"`
	Capabilities      []string         `json:"capabilities,omitempty"`
	ContextWindow     string           `json:"context_window,omitempty"`
	CreatedAt         *Timestamp       `json:"created_at,omitempty"`
	Description       string           `json:"description,omitempty"`
	InferenceName     string           `json:"inference_name,omitempty"`
	InferenceVersion  string           `json:"inference_version,omitempty"`
	IsFoundational    bool             `json:"is_foundational,omitempty"`
	ModelAvailability string           `json:"model_availability,omitempty"`
	Modalities        *ModelModalities `json:"modalities,omitempty"`
	Name              string           `json:"name,omitempty"`
	ParameterCount    float64          `json:"parameter_count,omitempty"`
	ParentUuid        string           `json:"parent_uuid,omitempty"`
	Pricing           *ModelPricing    `json:"pricing,omitempty"`
	Provider          string           `json:"provider,omitempty"`
	Type              string           `json:"type,omitempty"`
	UpdatedAt         *Timestamp       `json:"updated_at,omitempty"`
	UploadComplete    bool             `json:"upload_complete,omitempty"`
	Url               string           `json:"url,omitempty"`
	Usecases          []string         `json:"usecases,omitempty"`
	Uuid              string           `json:"uuid,omitempty"`
	Version           *ModelVersion    `json:"version,omitempty"`
}

Model represents an Agent Platform Model

func (Model) String added in v1.149.0

func (m Model) String() string

type ModelEvaluationEpochAttempt added in v1.217.0

type ModelEvaluationEpochAttempt struct {
	CandidateRoutedTask string                         `json:"candidate_routed_task,omitempty"`
	MetricResults       []*ModelEvaluationMetricResult `json:"metric_results,omitempty"`
	Output              string                         `json:"output,omitempty"`
}

ModelEvaluationEpochAttempt is one epoch's attempt at a dataset row, nested under ModelEvaluationResult.EpochResults for multi-epoch runs.

type ModelEvaluationMetricListResponse added in v1.194.1

type ModelEvaluationMetricListResponse struct {
	Metrics []*EvaluationMetric `json:"metrics,omitempty"`
}

ModelEvaluationMetricListResponse is the response returned by ListModelEvaluationMetrics.

type ModelEvaluationMetricResult added in v1.194.1

type ModelEvaluationMetricResult struct {
	ErrorDescription string                       `json:"error_description,omitempty"`
	MetricName       string                       `json:"metric_name,omitempty"`
	MetricUUID       string                       `json:"metric_uuid,omitempty"`
	MetricValueType  EvaluationMetricValueType    `json:"metric_value_type,omitempty"`
	NumberValue      float64                      `json:"number_value,omitempty"`
	Reasoning        string                       `json:"reasoning,omitempty"`
	Status           EvaluationMetricResultStatus `json:"status,omitempty"`
	StringValue      string                       `json:"string_value,omitempty"`
}

ModelEvaluationMetricResult represents the per-metric score and judge reasoning for a single prompt in an evaluation run.

type ModelEvaluationPreset added in v1.194.1

type ModelEvaluationPreset struct {
	CandidateInferenceConfig *CandidateInferenceConfig `json:"candidate_inference_config,omitempty"`
	CandidateModelName       string                    `json:"candidate_model_name,omitempty"`
	CandidateModelSource     CandidateModelSource      `json:"candidate_model_source,omitempty"`
	CandidateModelUuid       string                    `json:"candidate_model_uuid,omitempty"`
	CandidateSystemPrompt    string                    `json:"candidate_system_prompt,omitempty"`
	CreatedAt                *Timestamp                `json:"created_at,omitempty"`
	DatasetName              string                    `json:"dataset_name,omitempty"`
	DatasetUuid              string                    `json:"dataset_uuid,omitempty"`
	EvalPresetUuid           string                    `json:"eval_preset_uuid,omitempty"`
	JudgeModelName           string                    `json:"judge_model_name,omitempty"`
	JudgeModelUuid           string                    `json:"judge_model_uuid,omitempty"`
	Metrics                  []*EvaluationMetric       `json:"metrics,omitempty"`
	Name                     string                    `json:"name,omitempty"`
	SavedSections            []PresetSaveSection       `json:"saved_sections,omitempty"`
	StarMetric               *StarMetric               `json:"star_metric,omitempty"`
}

ModelEvaluationPreset is a saved, reusable configuration for model evaluation runs.

type ModelEvaluationPresetDeleteResponse added in v1.193.0

type ModelEvaluationPresetDeleteResponse struct{}

ModelEvaluationPresetDeleteResponse is the response returned by DeleteModelEvaluationPreset. The underlying API returns an empty object on success; this struct exists for forward compatibility and to keep the SDK signature consistent with sibling delete operations.

type ModelEvaluationPresetGetResponse added in v1.194.1

type ModelEvaluationPresetGetResponse struct {
	Preset *ModelEvaluationPreset `json:"preset,omitempty"`
}

ModelEvaluationPresetGetResponse is the response returned by GetModelEvaluationPreset.

type ModelEvaluationPresetListResponse added in v1.194.1

type ModelEvaluationPresetListResponse struct {
	Presets []*ModelEvaluationPreset `json:"presets,omitempty"`
}

ModelEvaluationPresetListResponse is the response returned by ListModelEvaluationPresets.

type ModelEvaluationResult added in v1.194.1

type ModelEvaluationResult struct {
	CandidateModelName  string                                  `json:"candidate_model_name,omitempty"`
	CandidateModelUuid  string                                  `json:"candidate_model_uuid,omitempty"`
	CandidateRoutedTask string                                  `json:"candidate_routed_task,omitempty"`
	Epoch               uint32                                  `json:"epoch,omitempty"`
	EpochResults        map[string]*ModelEvaluationEpochAttempt `json:"epoch_results,omitempty"`
	GroundTruth         string                                  `json:"ground_truth,omitempty"`
	Input               string                                  `json:"input,omitempty"`
	MetricResults       []*ModelEvaluationMetricResult          `json:"metric_results,omitempty"`
	Output              string                                  `json:"output,omitempty"`
	RowNumber           uint32                                  `json:"row_number,omitempty"`
}

ModelEvaluationResult represents the per-prompt result for a model evaluation run.

type ModelEvaluationRunCancelResponse added in v1.193.0

type ModelEvaluationRunCancelResponse struct {
	Run *ModelEvaluationRunSummary `json:"run,omitempty"`
}

ModelEvaluationRunCancelResponse is the response returned by CancelModelEvaluationRun.

type ModelEvaluationRunCreateResponse added in v1.194.1

type ModelEvaluationRunCreateResponse struct {
	EvalRunUuid string `json:"eval_run_uuid,omitempty"`
}

ModelEvaluationRunCreateResponse is the response returned by CreateModelEvaluationRun.

type ModelEvaluationRunDeleteResponse added in v1.193.0

type ModelEvaluationRunDeleteResponse struct {
	Status DeleteModelEvaluationRunStatus `json:"status,omitempty"`
	Error  string                         `json:"error,omitempty"`
}

ModelEvaluationRunDeleteResponse is the response returned by DeleteModelEvaluationRun.

type ModelEvaluationRunDetail added in v1.194.1

type ModelEvaluationRunDetail struct {
	CandidateInferenceConfig *CandidateInferenceConfig        `json:"candidate_inference_config,omitempty"`
	CandidateModelName       string                           `json:"candidate_model_name,omitempty"`
	CandidateModelSource     CandidateModelSource             `json:"candidate_model_source,omitempty"`
	CandidateModelUuid       string                           `json:"candidate_model_uuid,omitempty"`
	CompletedAt              *Timestamp                       `json:"completed_at,omitempty"`
	CreatedAt                *Timestamp                       `json:"created_at,omitempty"`
	DatasetName              string                           `json:"dataset_name,omitempty"`
	DatasetUuid              string                           `json:"dataset_uuid,omitempty"`
	Epochs                   uint32                           `json:"epochs,omitempty"`
	ErrorDescription         string                           `json:"error_description,omitempty"`
	EvalPresetName           string                           `json:"eval_preset_name,omitempty"`
	EvalPresetUuid           string                           `json:"eval_preset_uuid,omitempty"`
	EvalRunUuid              string                           `json:"eval_run_uuid,omitempty"`
	JudgeModelName           string                           `json:"judge_model_name,omitempty"`
	JudgeModelUuid           string                           `json:"judge_model_uuid,omitempty"`
	Metrics                  []*EvaluationMetric              `json:"metrics,omitempty"`
	Name                     string                           `json:"name,omitempty"`
	Progress                 *ModelEvaluationRunProgress      `json:"progress,omitempty"`
	ResultSummary            *ModelEvaluationRunResultSummary `json:"result_summary,omitempty"`
	StarMetric               *StarMetric                      `json:"star_metric,omitempty"`
	StartedAt                *Timestamp                       `json:"started_at,omitempty"`
	Status                   ModelEvaluationRunStatus         `json:"status,omitempty"`
}

ModelEvaluationRunDetail is the full view of a model evaluation run returned when fetching a specific run.

type ModelEvaluationRunGetOptions added in v1.194.1

type ModelEvaluationRunGetOptions struct {
	Page    int `url:"page,omitempty"`
	PerPage int `url:"per_page,omitempty"`
}

ModelEvaluationRunGetOptions specifies optional pagination parameters for the per-prompt results returned by GetModelEvaluationRun.

type ModelEvaluationRunGetResponse added in v1.194.1

type ModelEvaluationRunGetResponse struct {
	Run     *ModelEvaluationRunDetail `json:"run,omitempty"`
	Results []*ModelEvaluationResult  `json:"results,omitempty"`
	Links   *Links                    `json:"links,omitempty"`
	Meta    *Meta                     `json:"meta,omitempty"`
}

ModelEvaluationRunGetResponse is the response returned by GetModelEvaluationRun. It contains the run detail and a paginated list of per-prompt evaluation results.

type ModelEvaluationRunListOptions added in v1.194.1

type ModelEvaluationRunListOptions struct {
	EvalPresetUUID string                          `url:"eval_preset_uuid,omitempty"`
	Status         ModelEvaluationRunStatus        `url:"status,omitempty"`
	Statuses       []ModelEvaluationRunStatus      `url:"statuses,omitempty"`
	CandidateTypes []CandidateModelSource          `url:"candidate_types,omitempty"`
	Search         string                          `url:"search,omitempty"`
	SortBy         ModelEvaluationRunSortField     `url:"sort_by,omitempty"`
	SortDirection  ModelEvaluationRunSortDirection `url:"sort_direction,omitempty"`
	ListOptions
}

ModelEvaluationRunListOptions specifies optional parameters for listing model evaluation runs.

type ModelEvaluationRunListResponse added in v1.194.1

type ModelEvaluationRunListResponse struct {
	AvailableCandidateTypes []CandidateModelSource       `json:"available_candidate_types,omitempty"`
	AvailableStatuses       []ModelEvaluationRunStatus   `json:"available_statuses,omitempty"`
	Runs                    []*ModelEvaluationRunSummary `json:"runs,omitempty"`
	Links                   *Links                       `json:"links,omitempty"`
	Meta                    *Meta                        `json:"meta,omitempty"`
}

ModelEvaluationRunListResponse is the response returned by ListModelEvaluationRuns.

type ModelEvaluationRunProgress added in v1.197.0

type ModelEvaluationRunProgress struct {
	// CandidateRowsEvaluated is the number of dataset rows whose candidate model
	// call has completed (success or failure).
	CandidateRowsEvaluated *int64 `json:"candidate_rows_evaluated,omitempty"`
	// JudgeRowsEvaluated is the number of candidate-success rows the judge has
	// finished (scored or skipped). It caps at the number of candidate
	// successes, which may be below TotalRows.
	JudgeRowsEvaluated *int64 `json:"judge_rows_evaluated,omitempty"`
	// TotalRows is the total number of dataset rows for the run, sourced from the
	// evaluation dataset.
	TotalRows *int64 `json:"total_rows,omitempty"`
}

ModelEvaluationRunProgress reports per-phase progress for a model evaluation run. The candidate phase invokes the candidate model once per dataset row; the judge phase scores each candidate-success row with the configured metrics. Counts grow as the run advances; compare against TotalRows to render a progress bar.

type ModelEvaluationRunResultSummary added in v1.194.1

type ModelEvaluationRunResultSummary struct {
	EndTime              *Timestamp               `json:"end_time,omitempty"`
	EpochSummary         *EpochResultSummary      `json:"epoch_summary,omitempty"`
	Epochs               uint32                   `json:"epochs,omitempty"`
	MetricSummaries      []*MetricResultSummary   `json:"metric_summaries,omitempty"`
	OverallScorePercent  float64                  `json:"overall_score_percent,omitempty"`
	PerModelSummaries    *PerModelResultSummaries `json:"per_model_summaries,omitempty"`
	PerTaskSummaries     *PerTaskResultSummaries  `json:"per_task_summaries,omitempty"`
	PerformanceMetrics   *PerformanceMetrics      `json:"performance_metrics,omitempty"`
	Pricing              *EvaluationPricing       `json:"pricing,omitempty"`
	StarMetricSummary    *StarMetricSummary       `json:"star_metric_summary,omitempty"`
	StartTime            *Timestamp               `json:"start_time,omitempty"`
	TotalDurationSeconds int64                    `json:"total_duration_seconds,omitempty"`
}

ModelEvaluationRunResultSummary contains the aggregated result summary for a completed model evaluation run.

type ModelEvaluationRunResultsDownloadURLResponse added in v1.194.1

type ModelEvaluationRunResultsDownloadURLResponse struct {
	DownloadURL string     `json:"download_url,omitempty"`
	ExpiresAt   *Timestamp `json:"expires_at,omitempty"`
}

ModelEvaluationRunResultsDownloadURLResponse is the response returned by GetModelEvaluationRunResultsDownloadURL. It contains a presigned URL pointing to the gzip-compressed JSON results file.

type ModelEvaluationRunSortDirection added in v1.194.1

type ModelEvaluationRunSortDirection string

ModelEvaluationRunSortDirection is the sort direction for model evaluation run list results.

const (
	ModelEvaluationRunSortDirectionUnspecified ModelEvaluationRunSortDirection = "SORT_DIRECTION_UNSPECIFIED"
	ModelEvaluationRunSortDirectionAsc         ModelEvaluationRunSortDirection = "SORT_DIRECTION_ASC"
	ModelEvaluationRunSortDirectionDesc        ModelEvaluationRunSortDirection = "SORT_DIRECTION_DESC"
)

type ModelEvaluationRunSortField added in v1.194.1

type ModelEvaluationRunSortField string

ModelEvaluationRunSortField is the field used to sort model evaluation run list results.

const (
	ModelEvaluationRunSortFieldUnspecified ModelEvaluationRunSortField = "MODEL_EVALUATION_RUN_SORT_FIELD_UNSPECIFIED"
	ModelEvaluationRunSortFieldCreatedAt   ModelEvaluationRunSortField = "MODEL_EVALUATION_RUN_SORT_FIELD_CREATED_AT"
	ModelEvaluationRunSortFieldStatus      ModelEvaluationRunSortField = "MODEL_EVALUATION_RUN_SORT_FIELD_STATUS"
)

type ModelEvaluationRunStatus added in v1.193.0

type ModelEvaluationRunStatus string

ModelEvaluationRunStatus represents the lifecycle status of a model evaluation run.

const (
	ModelEvaluationRunStatusUnspecified   ModelEvaluationRunStatus = "MODEL_EVALUATION_RUN_STATUS_UNSPECIFIED"
	ModelEvaluationRunQueued              ModelEvaluationRunStatus = "MODEL_EVALUATION_RUN_QUEUED"
	ModelEvaluationRunRunningDataset      ModelEvaluationRunStatus = "MODEL_EVALUATION_RUN_RUNNING_DATASET"
	ModelEvaluationRunEvaluatingResults   ModelEvaluationRunStatus = "MODEL_EVALUATION_RUN_EVALUATING_RESULTS"
	ModelEvaluationRunCancelling          ModelEvaluationRunStatus = "MODEL_EVALUATION_RUN_CANCELLING"
	ModelEvaluationRunCancelled           ModelEvaluationRunStatus = "MODEL_EVALUATION_RUN_CANCELLED"
	ModelEvaluationRunSuccessful          ModelEvaluationRunStatus = "MODEL_EVALUATION_RUN_SUCCESSFUL"
	ModelEvaluationRunPartiallySuccessful ModelEvaluationRunStatus = "MODEL_EVALUATION_RUN_PARTIALLY_SUCCESSFUL"
	ModelEvaluationRunFailed              ModelEvaluationRunStatus = "MODEL_EVALUATION_RUN_FAILED"
)

type ModelEvaluationRunSummary added in v1.193.0

type ModelEvaluationRunSummary struct {
	CandidateModelName   string                      `json:"candidate_model_name,omitempty"`
	CandidateModelSource CandidateModelSource        `json:"candidate_model_source,omitempty"`
	CandidateModelUuid   string                      `json:"candidate_model_uuid,omitempty"`
	CreatedAt            *Timestamp                  `json:"created_at,omitempty"`
	DatasetName          string                      `json:"dataset_name,omitempty"`
	DatasetUuid          string                      `json:"dataset_uuid,omitempty"`
	EvalRunUuid          string                      `json:"eval_run_uuid,omitempty"`
	JudgeModelName       string                      `json:"judge_model_name,omitempty"`
	JudgeModelUuid       string                      `json:"judge_model_uuid,omitempty"`
	Name                 string                      `json:"name,omitempty"`
	Progress             *ModelEvaluationRunProgress `json:"progress,omitempty"`
	Status               ModelEvaluationRunStatus    `json:"status,omitempty"`
}

ModelEvaluationRunSummary is a lightweight view of an evaluation run used in run history listings and the cancel response.

type ModelEvaluationRunUpdateResponse added in v1.195.0

type ModelEvaluationRunUpdateResponse struct {
	Run *ModelEvaluationRunSummary `json:"run,omitempty"`
}

ModelEvaluationRunUpdateResponse is the response returned by UpdateModelEvaluationRun.

type ModelList added in v1.191.0

type ModelList struct {
	Object string           `json:"object"`
	Data   []InferenceModel `json:"data"`
}

ModelList is returned by GET /v1/models.

type ModelModalities added in v1.183.0

type ModelModalities struct {
	Input  []string `json:"input,omitempty"`
	Output []string `json:"output,omitempty"`
}

ModelModalities represents the input and output modalities supported by a model

type ModelPricing added in v1.186.0

type ModelPricing struct {
	InputPricePerMillion               float64 `json:"input_price_per_million,omitempty"`
	OutputPricePerMillion              float64 `json:"output_price_per_million,omitempty"`
	PricePerImage                      float64 `json:"price_per_image,omitempty"`
	PricePerMegapixel                  float64 `json:"price_per_megapixel,omitempty"`
	PricePerSecond                     float64 `json:"price_per_second,omitempty"`
	PricePerVideo                      float64 `json:"price_per_video,omitempty"`
	PricePerAudio                      float64 `json:"price_per_audio,omitempty"`
	PricePerThousandCharacters         float64 `json:"price_per_thousand_characters,omitempty"`
	TextInputPricePerMillion           float64 `json:"text_input_price_per_million,omitempty"`
	TextOutputPricePerMillion          float64 `json:"text_output_price_per_million,omitempty"`
	TextCacheReadInputPricePerMillion  float64 `json:"text_cache_read_input_price_per_million,omitempty"`
	ImageInputPricePerMillion          float64 `json:"image_input_price_per_million,omitempty"`
	ImageOutputPricePerMillion         float64 `json:"image_output_price_per_million,omitempty"`
	ImageCacheReadInputPricePerMillion float64 `json:"image_cache_read_input_price_per_million,omitempty"`
}

ModelPricing represents token- and unit-based pricing for a model.

type ModelPricingEntry added in v1.194.1

type ModelPricingEntry struct {
	ModelName   string        `json:"model_name,omitempty"`
	ModelUuid   string        `json:"model_uuid,omitempty"`
	Pricing     *TokenPricing `json:"pricing,omitempty"`
	PromptCount int64         `json:"prompt_count,omitempty"`
}

ModelPricingEntry contains the pricing entry for a specific model used in an evaluation run.

type ModelService added in v1.191.0

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

ModelService exposes GET /v1/models.

func (*ModelService) List added in v1.191.0

func (s *ModelService) List(ctx context.Context) (*ModelList, *Response, error)

List returns the catalogue of models reachable from the caller's inference key.

type ModelVersion added in v1.149.0

type ModelVersion struct {
	Major int `json:"major,omitempty"`
	Minor int `json:"minor,omitempty"`
	Patch int `json:"patch,omitempty"`
}

type MongoDBConfig added in v1.125.0

type MongoDBConfig struct {
	DefaultReadConcern              *string `json:"default_read_concern,omitempty"`
	DefaultWriteConcern             *string `json:"default_write_concern,omitempty"`
	TransactionLifetimeLimitSeconds *int    `json:"transaction_lifetime_limit_seconds,omitempty"`
	SlowOpThresholdMs               *int    `json:"slow_op_threshold_ms,omitempty"`
	Verbosity                       *int    `json:"verbosity,omitempty"`
}

MongoDBConfig holds advanced configurations for MongoDB database clusters.

type MongoUserSettings added in v1.152.0

type MongoUserSettings struct {
	Databases []string `json:"databases,omitempty"`
	Role      string   `json:"role,omitempty"`
}

MongoUserSettings represents additional settings for MongoDB users.

type MonitoringService added in v1.64.0

type MonitoringService interface {
	ListAlertPolicies(context.Context, *ListOptions) ([]AlertPolicy, *Response, error)
	GetAlertPolicy(context.Context, string) (*AlertPolicy, *Response, error)
	CreateAlertPolicy(context.Context, *AlertPolicyCreateRequest) (*AlertPolicy, *Response, error)
	UpdateAlertPolicy(context.Context, string, *AlertPolicyUpdateRequest) (*AlertPolicy, *Response, error)
	DeleteAlertPolicy(context.Context, string) (*Response, error)

	GetDropletBandwidth(context.Context, *DropletBandwidthMetricsRequest) (*MetricsResponse, *Response, error)
	GetDropletAvailableMemory(context.Context, *DropletMetricsRequest) (*MetricsResponse, *Response, error)
	GetDropletCPU(context.Context, *DropletMetricsRequest) (*MetricsResponse, *Response, error)
	GetDropletFilesystemFree(context.Context, *DropletMetricsRequest) (*MetricsResponse, *Response, error)
	GetDropletFilesystemSize(context.Context, *DropletMetricsRequest) (*MetricsResponse, *Response, error)
	GetDropletLoad1(context.Context, *DropletMetricsRequest) (*MetricsResponse, *Response, error)
	GetDropletLoad5(context.Context, *DropletMetricsRequest) (*MetricsResponse, *Response, error)
	GetDropletLoad15(context.Context, *DropletMetricsRequest) (*MetricsResponse, *Response, error)
	GetDropletCachedMemory(context.Context, *DropletMetricsRequest) (*MetricsResponse, *Response, error)
	GetDropletFreeMemory(context.Context, *DropletMetricsRequest) (*MetricsResponse, *Response, error)
	GetDropletTotalMemory(context.Context, *DropletMetricsRequest) (*MetricsResponse, *Response, error)

	GetLoadBalancerFrontendHttpRequestsPerSecond(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerFrontendConnectionsCurrent(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerFrontendConnectionsLimit(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerFrontendCpuUtilization(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerFrontendNetworkThroughputHttp(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerFrontendNetworkThroughputUdp(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerFrontendNetworkThroughputTcp(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerFrontendNlbTcpNetworkThroughput(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerFrontendNlbUdpNetworkThroughput(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerFrontendFirewallDroppedBytes(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerFrontendFirewallDroppedPackets(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerFrontendHttpResponses(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerFrontendTlsConnectionsCurrent(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerFrontendTlsConnectionsLimit(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerFrontendTlsConnectionsExceedingRateLimit(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerDropletsHttpSessionDurationAvg(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerDropletsHttpSessionDuration50P(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerDropletsHttpSessionDuration95P(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerDropletsHttpResponseTimeAvg(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerDropletsHttpResponseTime50P(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerDropletsHttpResponseTime95P(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerDropletsHttpResponseTime99P(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerDropletsQueueSize(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerDropletsHttpResponses(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerDropletsConnections(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerDropletsHealthChecks(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
	GetLoadBalancerDropletsDowntime(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

	// DBaaS MySQL metrics (host-level: db_id only)
	GetDbaasMysqlCpuUsage(ctx context.Context, args *DbaasMysqlCpuUsageRequest) (*MetricsResponse, *Response, error)
	GetDbaasMysqlLoad(ctx context.Context, args *DbaasMysqlLoadRequest) (*MetricsResponse, *Response, error)
	GetDbaasMysqlMemoryUsage(ctx context.Context, args *DbaasMysqlMemoryUsageRequest) (*MetricsResponse, *Response, error)
	GetDbaasMysqlDiskUsage(ctx context.Context, args *DbaasMysqlDiskUsageRequest) (*MetricsResponse, *Response, error)
	// DBaaS MySQL metrics (service-level: db_id + service)
	GetDbaasMysqlThreadsConnected(ctx context.Context, args *DbaasMysqlServiceMetricsRequest) (*MetricsResponse, *Response, error)
	GetDbaasMysqlThreadsCreatedRate(ctx context.Context, args *DbaasMysqlServiceMetricsRequest) (*MetricsResponse, *Response, error)
	GetDbaasMysqlThreadsActive(ctx context.Context, args *DbaasMysqlServiceMetricsRequest) (*MetricsResponse, *Response, error)
	GetDbaasMysqlIndexVsSequentialReads(ctx context.Context, args *DbaasMysqlServiceMetricsRequest) (*MetricsResponse, *Response, error)
	GetDbaasMysqlOpRates(ctx context.Context, args *DbaasMysqlOpRatesRequest) (*MetricsResponse, *Response, error)
	// DBaaS MySQL metrics (schema-level: db_id + service + schema)
	GetDbaasMysqlSchemaThroughput(ctx context.Context, args *DbaasMysqlSchemaThroughputRequest) (*MetricsResponse, *Response, error)
	GetDbaasMysqlSchemaLatency(ctx context.Context, args *DbaasMysqlSchemaLatencyRequest) (*MetricsResponse, *Response, error)
}

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

type MonitoringServiceOp added in v1.64.0

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

MonitoringServiceOp handles communication with monitoring related methods of the DigitalOcean API.

func (*MonitoringServiceOp) CreateAlertPolicy added in v1.64.0

func (s *MonitoringServiceOp) CreateAlertPolicy(ctx context.Context, createRequest *AlertPolicyCreateRequest) (*AlertPolicy, *Response, error)

CreateAlertPolicy creates a new alert policy

func (*MonitoringServiceOp) DeleteAlertPolicy added in v1.64.0

func (s *MonitoringServiceOp) DeleteAlertPolicy(ctx context.Context, uuid string) (*Response, error)

DeleteAlertPolicy deletes an existing alert policy

func (*MonitoringServiceOp) GetAlertPolicy added in v1.64.0

func (s *MonitoringServiceOp) GetAlertPolicy(ctx context.Context, uuid string) (*AlertPolicy, *Response, error)

GetAlertPolicy gets a single alert policy

func (*MonitoringServiceOp) GetDbaasMysqlCpuUsage added in v1.176.0

func (s *MonitoringServiceOp) GetDbaasMysqlCpuUsage(ctx context.Context, args *DbaasMysqlCpuUsageRequest) (*MetricsResponse, *Response, error)

GetDbaasMysqlCpuUsage retrieves CPU usage (percent) for a MySQL cluster. Aggregate: avg, max, min.

func (*MonitoringServiceOp) GetDbaasMysqlDiskUsage added in v1.176.0

func (s *MonitoringServiceOp) GetDbaasMysqlDiskUsage(ctx context.Context, args *DbaasMysqlDiskUsageRequest) (*MetricsResponse, *Response, error)

GetDbaasMysqlDiskUsage retrieves disk usage (percent) for a MySQL cluster. Aggregate: avg, max, min.

func (*MonitoringServiceOp) GetDbaasMysqlIndexVsSequentialReads added in v1.176.0

func (s *MonitoringServiceOp) GetDbaasMysqlIndexVsSequentialReads(ctx context.Context, args *DbaasMysqlServiceMetricsRequest) (*MetricsResponse, *Response, error)

GetDbaasMysqlIndexVsSequentialReads retrieves index vs sequential reads ratio (percent) for a MySQL service.

func (*MonitoringServiceOp) GetDbaasMysqlLoad added in v1.176.0

GetDbaasMysqlLoad retrieves load average for a MySQL cluster. Metric: load1, load5, load15. Aggregate: avg, max.

func (*MonitoringServiceOp) GetDbaasMysqlMemoryUsage added in v1.176.0

func (s *MonitoringServiceOp) GetDbaasMysqlMemoryUsage(ctx context.Context, args *DbaasMysqlMemoryUsageRequest) (*MetricsResponse, *Response, error)

GetDbaasMysqlMemoryUsage retrieves memory usage (percent) for a MySQL cluster. Aggregate: avg, max, min.

func (*MonitoringServiceOp) GetDbaasMysqlOpRates added in v1.176.0

func (s *MonitoringServiceOp) GetDbaasMysqlOpRates(ctx context.Context, args *DbaasMysqlOpRatesRequest) (*MetricsResponse, *Response, error)

GetDbaasMysqlOpRates retrieves operations rate (select, insert, update, delete per second) for a MySQL service.

func (*MonitoringServiceOp) GetDbaasMysqlSchemaLatency added in v1.176.0

func (s *MonitoringServiceOp) GetDbaasMysqlSchemaLatency(ctx context.Context, args *DbaasMysqlSchemaLatencyRequest) (*MetricsResponse, *Response, error)

GetDbaasMysqlSchemaLatency retrieves table I/O latency (seconds) for a MySQL schema. Metric: insert, fetch, update, delete.

func (*MonitoringServiceOp) GetDbaasMysqlSchemaThroughput added in v1.176.0

func (s *MonitoringServiceOp) GetDbaasMysqlSchemaThroughput(ctx context.Context, args *DbaasMysqlSchemaThroughputRequest) (*MetricsResponse, *Response, error)

GetDbaasMysqlSchemaThroughput retrieves table I/O throughput (rows/s) for a MySQL schema. Metric: insert, fetch, update, delete.

func (*MonitoringServiceOp) GetDbaasMysqlThreadsActive added in v1.176.0

func (s *MonitoringServiceOp) GetDbaasMysqlThreadsActive(ctx context.Context, args *DbaasMysqlServiceMetricsRequest) (*MetricsResponse, *Response, error)

GetDbaasMysqlThreadsActive retrieves active (running) threads for a MySQL service.

func (*MonitoringServiceOp) GetDbaasMysqlThreadsConnected added in v1.176.0

func (s *MonitoringServiceOp) GetDbaasMysqlThreadsConnected(ctx context.Context, args *DbaasMysqlServiceMetricsRequest) (*MetricsResponse, *Response, error)

GetDbaasMysqlThreadsConnected retrieves current threads connected for a MySQL service.

func (*MonitoringServiceOp) GetDbaasMysqlThreadsCreatedRate added in v1.176.0

func (s *MonitoringServiceOp) GetDbaasMysqlThreadsCreatedRate(ctx context.Context, args *DbaasMysqlServiceMetricsRequest) (*MetricsResponse, *Response, error)

GetDbaasMysqlThreadsCreatedRate retrieves threads created rate (per second) for a MySQL service.

func (*MonitoringServiceOp) GetDropletAvailableMemory added in v1.70.0

func (s *MonitoringServiceOp) GetDropletAvailableMemory(ctx context.Context, args *DropletMetricsRequest) (*MetricsResponse, *Response, error)

GetDropletAvailableMemory retrieves Droplet available memory metrics.

func (*MonitoringServiceOp) GetDropletBandwidth added in v1.70.0

GetDropletBandwidth retrieves Droplet bandwidth metrics.

func (*MonitoringServiceOp) GetDropletCPU added in v1.70.0

GetDropletCPU retrieves Droplet CPU metrics.

func (*MonitoringServiceOp) GetDropletCachedMemory added in v1.70.0

func (s *MonitoringServiceOp) GetDropletCachedMemory(ctx context.Context, args *DropletMetricsRequest) (*MetricsResponse, *Response, error)

GetDropletCachedMemory retrieves Droplet cached memory metrics.

func (*MonitoringServiceOp) GetDropletFilesystemFree added in v1.70.0

func (s *MonitoringServiceOp) GetDropletFilesystemFree(ctx context.Context, args *DropletMetricsRequest) (*MetricsResponse, *Response, error)

GetDropletFilesystemFree retrieves Droplet filesystem free metrics.

func (*MonitoringServiceOp) GetDropletFilesystemSize added in v1.70.0

func (s *MonitoringServiceOp) GetDropletFilesystemSize(ctx context.Context, args *DropletMetricsRequest) (*MetricsResponse, *Response, error)

GetDropletFilesystemSize retrieves Droplet filesystem size metrics.

func (*MonitoringServiceOp) GetDropletFreeMemory added in v1.70.0

func (s *MonitoringServiceOp) GetDropletFreeMemory(ctx context.Context, args *DropletMetricsRequest) (*MetricsResponse, *Response, error)

GetDropletFreeMemory retrieves Droplet free memory metrics.

func (*MonitoringServiceOp) GetDropletLoad1 added in v1.70.0

GetDropletLoad1 retrieves Droplet load 1 metrics.

func (*MonitoringServiceOp) GetDropletLoad5 added in v1.70.0

GetDropletLoad5 retrieves Droplet load 5 metrics.

func (*MonitoringServiceOp) GetDropletLoad15 added in v1.70.0

GetDropletLoad15 retrieves Droplet load 15 metrics.

func (*MonitoringServiceOp) GetDropletTotalMemory added in v1.70.0

func (s *MonitoringServiceOp) GetDropletTotalMemory(ctx context.Context, args *DropletMetricsRequest) (*MetricsResponse, *Response, error)

GetDropletTotalMemory retrieves Droplet total memory metrics.

func (*MonitoringServiceOp) GetLoadBalancerDropletsConnections added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerDropletsConnections(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerDropletsConnections retrieves droplet active connections for a given load balancer.

func (*MonitoringServiceOp) GetLoadBalancerDropletsDowntime added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerDropletsDowntime(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerDropletsDowntime retrieves droplet downtime status for a given load balancer.

func (*MonitoringServiceOp) GetLoadBalancerDropletsHealthChecks added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerDropletsHealthChecks(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerDropletsHealthChecks retrieves droplet health check status for a given load balancer.

func (*MonitoringServiceOp) GetLoadBalancerDropletsHttpResponseTime50P added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerDropletsHttpResponseTime50P(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerDropletsHttpResponseTime50P retrieves droplet 50th percentile HTTP response time for a given load balancer.

func (*MonitoringServiceOp) GetLoadBalancerDropletsHttpResponseTime95P added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerDropletsHttpResponseTime95P(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerDropletsHttpResponseTime95P retrieves droplet 95th percentile HTTP response time for a given load balancer.

func (*MonitoringServiceOp) GetLoadBalancerDropletsHttpResponseTime99P added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerDropletsHttpResponseTime99P(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerDropletsHttpResponseTime99P retrieves droplet 99th percentile HTTP response time for a given load balancer.

func (*MonitoringServiceOp) GetLoadBalancerDropletsHttpResponseTimeAvg added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerDropletsHttpResponseTimeAvg(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerDropletsHttpResponseTimeAvg retrieves droplet average HTTP response time for a given load balancer.

func (*MonitoringServiceOp) GetLoadBalancerDropletsHttpResponses added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerDropletsHttpResponses(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerDropletsHttpResponses retrieves droplet HTTP rate of response code for a given load balancer.

func (*MonitoringServiceOp) GetLoadBalancerDropletsHttpSessionDuration50P added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerDropletsHttpSessionDuration50P(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerDropletsHttpSessionDuration50P retrieves droplet 50th percentile HTTP session duration for a given load balancer.

func (*MonitoringServiceOp) GetLoadBalancerDropletsHttpSessionDuration95P added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerDropletsHttpSessionDuration95P(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerDropletsHttpSessionDuration95P retrieves droplet 95th percentile HTTP session duration for a given load balancer.

func (*MonitoringServiceOp) GetLoadBalancerDropletsHttpSessionDurationAvg added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerDropletsHttpSessionDurationAvg(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerDropletsHttpSessionDurationAvg retrieves droplet average HTTP session duration for a given load balancer.

func (*MonitoringServiceOp) GetLoadBalancerDropletsQueueSize added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerDropletsQueueSize(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerDropletsQueueSize retrieves droplet queue size for a given load balancer.

func (*MonitoringServiceOp) GetLoadBalancerFrontendConnectionsCurrent added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerFrontendConnectionsCurrent(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerFrontendConnectionsCurrent retrieves frontend total current active connections for a given load balancer.

func (*MonitoringServiceOp) GetLoadBalancerFrontendConnectionsLimit added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerFrontendConnectionsLimit(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerFrontendConnectionsLimit retrieves frontend max connections limit for a given load balancer.

func (*MonitoringServiceOp) GetLoadBalancerFrontendCpuUtilization added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerFrontendCpuUtilization(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerFrontendCpuUtilization retrieves frontend average percentage cpu utilization for a given load balancer.

func (*MonitoringServiceOp) GetLoadBalancerFrontendFirewallDroppedBytes added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerFrontendFirewallDroppedBytes(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerFrontendFirewallDroppedBytes retrieves firewall dropped bytes for a given load balancer.

func (*MonitoringServiceOp) GetLoadBalancerFrontendFirewallDroppedPackets added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerFrontendFirewallDroppedPackets(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerFrontendFirewallDroppedPackets retrieves firewall dropped packets for a given load balancer.

func (*MonitoringServiceOp) GetLoadBalancerFrontendHttpRequestsPerSecond added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerFrontendHttpRequestsPerSecond(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerFrontendHttpRequestsPerSecond retrieves frontend HTTP requests per second for a given load balancer.

func (*MonitoringServiceOp) GetLoadBalancerFrontendHttpResponses added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerFrontendHttpResponses(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerFrontendHttpResponses retrieves frontend HTTP rate of response code for a given load balancer.

func (*MonitoringServiceOp) GetLoadBalancerFrontendNetworkThroughputHttp added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerFrontendNetworkThroughputHttp(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerFrontendNetworkThroughputHttp retrieves frontend HTTP throughput for a given load balancer.

func (*MonitoringServiceOp) GetLoadBalancerFrontendNetworkThroughputTcp added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerFrontendNetworkThroughputTcp(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerFrontendNetworkThroughputTcp retrieves frontend TCP throughput for a given load balancer.

func (*MonitoringServiceOp) GetLoadBalancerFrontendNetworkThroughputUdp added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerFrontendNetworkThroughputUdp(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerFrontendNetworkThroughputUdp retrieves frontend UDP throughput for a given load balancer.

func (*MonitoringServiceOp) GetLoadBalancerFrontendNlbTcpNetworkThroughput added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerFrontendNlbTcpNetworkThroughput(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerFrontendNlbTcpNetworkThroughput retrieves frontend TCP throughput for a given network load balancer.

func (*MonitoringServiceOp) GetLoadBalancerFrontendNlbUdpNetworkThroughput added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerFrontendNlbUdpNetworkThroughput(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerFrontendNlbUdpNetworkThroughput retrieves frontend UDP throughput for a given network load balancer.

func (*MonitoringServiceOp) GetLoadBalancerFrontendTlsConnectionsCurrent added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerFrontendTlsConnectionsCurrent(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerFrontendTlsConnectionsCurrent retrieves frontend current TLS connections rate for a given load balancer.

func (*MonitoringServiceOp) GetLoadBalancerFrontendTlsConnectionsExceedingRateLimit added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerFrontendTlsConnectionsExceedingRateLimit(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerFrontendTlsConnectionsExceedingRateLimit retrieves frontend closed TLS connections for exceeded rate limit for a given load balancer.

func (*MonitoringServiceOp) GetLoadBalancerFrontendTlsConnectionsLimit added in v1.128.0

func (s *MonitoringServiceOp) GetLoadBalancerFrontendTlsConnectionsLimit(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)

GetLoadBalancerFrontendTlsConnectionsLimit retrieves frontend max TLS connections limit for a given load balancer.

func (*MonitoringServiceOp) ListAlertPolicies added in v1.64.0

func (s *MonitoringServiceOp) ListAlertPolicies(ctx context.Context, opt *ListOptions) ([]AlertPolicy, *Response, error)

ListAlertPolicies all alert policies

func (*MonitoringServiceOp) UpdateAlertPolicy added in v1.64.0

func (s *MonitoringServiceOp) UpdateAlertPolicy(ctx context.Context, uuid string, updateRequest *AlertPolicyUpdateRequest) (*AlertPolicy, *Response, error)

UpdateAlertPolicy updates an existing alert policy

type MySQLConfig added in v1.82.0

type MySQLConfig struct {
	ConnectTimeout               *int     `json:"connect_timeout,omitempty"`
	DefaultTimeZone              *string  `json:"default_time_zone,omitempty"`
	InnodbLogBufferSize          *int     `json:"innodb_log_buffer_size,omitempty"`
	InnodbOnlineAlterLogMaxSize  *int     `json:"innodb_online_alter_log_max_size,omitempty"`
	InnodbLockWaitTimeout        *int     `json:"innodb_lock_wait_timeout,omitempty"`
	InteractiveTimeout           *int     `json:"interactive_timeout,omitempty"`
	MaxAllowedPacket             *int     `json:"max_allowed_packet,omitempty"`
	NetReadTimeout               *int     `json:"net_read_timeout,omitempty"`
	SortBufferSize               *int     `json:"sort_buffer_size,omitempty"`
	SQLMode                      *string  `json:"sql_mode,omitempty"`
	SQLRequirePrimaryKey         *bool    `json:"sql_require_primary_key,omitempty"`
	WaitTimeout                  *int     `json:"wait_timeout,omitempty"`
	NetWriteTimeout              *int     `json:"net_write_timeout,omitempty"`
	GroupConcatMaxLen            *int     `json:"group_concat_max_len,omitempty"`
	InformationSchemaStatsExpiry *int     `json:"information_schema_stats_expiry,omitempty"`
	InnodbFtMinTokenSize         *int     `json:"innodb_ft_min_token_size,omitempty"`
	InnodbFtServerStopwordTable  *string  `json:"innodb_ft_server_stopword_table,omitempty"`
	InnodbPrintAllDeadlocks      *bool    `json:"innodb_print_all_deadlocks,omitempty"`
	InnodbRollbackOnTimeout      *bool    `json:"innodb_rollback_on_timeout,omitempty"`
	InternalTmpMemStorageEngine  *string  `json:"internal_tmp_mem_storage_engine,omitempty"`
	MaxHeapTableSize             *int     `json:"max_heap_table_size,omitempty"`
	TmpTableSize                 *int     `json:"tmp_table_size,omitempty"`
	SlowQueryLog                 *bool    `json:"slow_query_log,omitempty"`
	LongQueryTime                *float32 `json:"long_query_time,omitempty"`
	BackupHour                   *int     `json:"backup_hour,omitempty"`
	BackupMinute                 *int     `json:"backup_minute,omitempty"`
	BinlogRetentionPeriod        *int     `json:"binlog_retention_period,omitempty"`
	InnodbChangeBufferMaxSize    *int     `json:"innodb_change_buffer_max_size,omitempty"`
	InnodbFlushNeighbors         *int     `json:"innodb_flush_neighbors,omitempty"`
	InnodbReadIoThreads          *int     `json:"innodb_read_io_threads,omitempty"`
	InnodbThreadConcurrency      *int     `json:"innodb_thread_concurrency,omitempty"`
	InnodbWriteIoThreads         *int     `json:"innodb_write_io_threads,omitempty"`
	NetBufferLength              *int     `json:"net_buffer_length,omitempty"`
	LogOutput                    *string  `json:"log_output,omitempty"`
}

MySQLConfig holds advanced configurations for MySQL database clusters.

type NestedSchema added in v1.158.0

type NestedSchema struct {
	Type        string                   `json:"type" validate:"required,oneof=string boolean number integer array object"`
	Items       *NestedSchema            `json:"items,omitempty"`
	Properties  map[string]*NestedSchema `json:"properties,omitempty"`
	Enum        []string                 `json:"enum,omitempty"`
	Description string                   `json:"description,omitempty"`
}

type NetworkV4 added in v0.6.0

type NetworkV4 struct {
	IPAddress string `json:"ip_address,omitempty"`
	Netmask   string `json:"netmask,omitempty"`
	Gateway   string `json:"gateway,omitempty"`
	Type      string `json:"type,omitempty"`
}

NetworkV4 represents a DigitalOcean IPv4 Network.

func (NetworkV4) String added in v0.6.0

func (n NetworkV4) String() string

type NetworkV6 added in v0.6.0

type NetworkV6 struct {
	IPAddress string `json:"ip_address,omitempty"`
	Netmask   int    `json:"netmask,omitempty"`
	Gateway   string `json:"gateway,omitempty"`
	Type      string `json:"type,omitempty"`
}

NetworkV6 represents a DigitalOcean IPv6 network.

func (NetworkV6) String added in v0.6.0

func (n NetworkV6) String() string

type Networks

type Networks struct {
	V4 []NetworkV4 `json:"v4,omitempty"`
	V6 []NetworkV6 `json:"v6,omitempty"`
}

Networks represents the Droplet's Networks.

type Nfs added in v1.166.0

type Nfs struct {
	// ID is the unique identifier for the NFS share
	ID string `json:"id"`
	// Name is the human-readable name for the NFS share
	Name string `json:"name"`
	// SizeGib is the size of the NFS share in gibibytes
	SizeGib int `json:"size_gib"`
	// Region is the datacenter region where the NFS share is located
	Region string `json:"region"`
	// Status represents the current state of the NFS share
	Status NfsShareStatus `json:"status"`
	// CreatedAt is the timestamp when the NFS share was created
	CreatedAt string `json:"created_at"`
	// VpcIDs is a list of VPC IDs that have access to the NFS share
	VpcIDs []string `json:"vpc_ids"`
	// Host is the IP address of the NFS server accessible from the associated VPC
	Host string `json:"host"`
	// MountPath is the path at which the share will be available
	MountPath string `json:"mount_path"`
	// PerformanceTier is the performance tier of the NFS share
	PerformanceTier string `json:"performance_tier"`
	// ManagerURN associates the share with the resource that manages it
	ManagerURN string `json:"manager_urn,omitempty"`
	// AccessPoints is the list of access points configured for the NFS share.
	AccessPoints []*NfsAccessPoint `json:"access_points,omitempty"`
}

Nfs represents a DigitalOcean NFS share

type NfsAccessPoint added in v1.197.0

type NfsAccessPoint struct {
	ID           string               `json:"id"`
	Name         string               `json:"name"`
	ShareID      string               `json:"share_id"`
	Path         string               `json:"path"`
	Status       NfsAccessPointStatus `json:"status"`
	AccessPolicy NfsAccessPolicy      `json:"access_policy"`
	CreatedAt    string               `json:"created_at"`
	UpdatedAt    string               `json:"updated_at"`
	IsDefault    bool                 `json:"is_default"`
	VpcID        *string              `json:"vpc_id,omitempty"`
	VpcIDs       []string             `json:"vpc_ids,omitempty"`
}

NfsAccessPoint represents an NFS access point.

type NfsAccessPointActionResponse added in v1.197.0

type NfsAccessPointActionResponse struct {
	AccessPoint *NfsAccessPoint `json:"access_point"`
	Action      *NfsAction      `json:"action"`
}

NfsAccessPointActionResponse represents an access point mutation response.

type NfsAccessPointStatus added in v1.197.0

type NfsAccessPointStatus string

NfsAccessPointStatus represents the status of an NFS access point.

type NfsAccessPolicy added in v1.197.0

type NfsAccessPolicy struct {
	Anonuid                    uint64                    `json:"anonuid"`
	Anongid                    uint64                    `json:"anongid"`
	Protocols                  []NfsAccessPolicyProtocol `json:"protocols"`
	SquashConfig               NfsSquashConfig           `json:"squash_config"`
	IdentityEnforcementEnabled bool                      `json:"identity_enforcement_enabled"`
}

NfsAccessPolicy represents the export policy of an NFS access point.

type NfsAccessPolicyProtocol added in v1.197.0

type NfsAccessPolicyProtocol string

NfsAccessPolicyProtocol represents an allowed protocol in an NFS access policy.

type NfsAction added in v1.167.0

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

NfsAction represents an NFS action

type NfsActionRequest added in v1.167.0

type NfsActionRequest struct {
	Type   string      `json:"type"`
	Region string      `json:"region"`
	Params interface{} `json:"params"`
}

NfsActionRequest represents a generic NFS action request

type NfsActionsService added in v1.167.0

type NfsActionsService interface {
	Resize(ctx context.Context, nfsShareId string, size uint64, region string) (*NfsAction, *Response, error)
	Snapshot(ctx context.Context, nfsShareId string, nfsSnapshotName string, region string) (*NfsAction, *Response, error)
	Attach(ctx context.Context, nfsShareId string, vpcID string, region string) (*NfsAction, *Response, error)
	Detach(ctx context.Context, nfsShareId string, vpcID string, region string) (*NfsAction, *Response, error)
	Reassign(ctx context.Context, nfsShareId, oldVpcID, newVpcID string) (*NfsAction, *Response, error)
	SwitchPerformanceTier(ctx context.Context, nfsShareId string, tier string) (*NfsAction, *Response, error)
	// Get retrieves an NFS action by ID, e.g. to poll an action to completion.
	Get(ctx context.Context, actionID string) (*NfsAction, *Response, error)
}

NfsActionsService is an interface for interacting with the NFS actions endpoints of the DigitalOcean API See: https://docs.digitalocean.com/reference/api/api-reference/#tag/NFS-Actions

type NfsActionsServiceOp added in v1.167.0

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

NfsActionsServiceOp handles communication with the NFS action related methods of the DigitalOcean API.

func (*NfsActionsServiceOp) Attach added in v1.168.0

func (s *NfsActionsServiceOp) Attach(ctx context.Context, nfsShareId, vpcID, region string) (*NfsAction, *Response, error)

Attach an NFS share

func (*NfsActionsServiceOp) Detach added in v1.168.0

func (s *NfsActionsServiceOp) Detach(ctx context.Context, nfsShareId, vpcID, region string) (*NfsAction, *Response, error)

Detach an NFS share

func (*NfsActionsServiceOp) Get added in v1.207.0

func (s *NfsActionsServiceOp) Get(ctx context.Context, actionID string) (*NfsAction, *Response, error)

Get retrieves an NFS action by ID.

func (*NfsActionsServiceOp) Reassign added in v1.181.0

func (s *NfsActionsServiceOp) Reassign(ctx context.Context, nfsShareId, oldVpcID, newVpcID string) (*NfsAction, *Response, error)

Reassign an NFS share from one VPC to another.

func (*NfsActionsServiceOp) Resize added in v1.167.0

func (s *NfsActionsServiceOp) Resize(ctx context.Context, nfsShareId string, size uint64, region string) (*NfsAction, *Response, error)

Resize an NFS share

func (*NfsActionsServiceOp) Snapshot added in v1.167.0

func (s *NfsActionsServiceOp) Snapshot(ctx context.Context, nfsShareId, nfsSnapshotName, region string) (*NfsAction, *Response, error)

Snapshot an NFS share

func (*NfsActionsServiceOp) SwitchPerformanceTier added in v1.174.0

func (s *NfsActionsServiceOp) SwitchPerformanceTier(ctx context.Context, nfsShareId string, tier string) (*NfsAction, *Response, error)

Switch performance tier of an NFS share

type NfsAttachParams added in v1.168.0

type NfsAttachParams struct {
	VpcID string `json:"vpc_id"`
}

NfsAttachParams represents parameters for attaching an NFS share to a VPC

type NfsCreateAccessPointRequest added in v1.197.0

type NfsCreateAccessPointRequest struct {
	Name         string          `json:"name"`
	Path         string          `json:"path"`
	AccessPolicy NfsAccessPolicy `json:"access_policy"`
	VpcID        string          `json:"vpc_id"`
}

NfsCreateAccessPointRequest represents a request to create an NFS access point.

type NfsCreateRequest added in v1.166.0

type NfsCreateRequest struct {
	Name            string   `json:"name"`
	SizeGib         int      `json:"size_gib"`
	Region          string   `json:"region"`
	VpcIDs          []string `json:"vpc_ids,omitempty"`
	PerformanceTier string   `json:"performance_tier,omitempty"`
	ManagerURN      string   `json:"manager_urn,omitempty"`
}

NfsCreateRequest represents a request to create an NFS share.

type NfsDeleteOptions added in v1.207.0

type NfsDeleteOptions struct {
	// Region is retained for compatibility with the existing NFS API.
	Region string `url:"region,omitempty"`
	// DeleteSnapshots deletes the share's active snapshots along with it.
	DeleteSnapshots bool `url:"delete_snapshots,omitempty"`
}

NfsDeleteOptions represents the options for deleting an NFS share.

type NfsDetachParams added in v1.168.0

type NfsDetachParams struct {
	VpcID string `json:"vpc_id"`
}

NfsDetachParams represents parameters for detaching an NFS share from a VPC

type NfsListAccessPointsOptions added in v1.197.0

type NfsListAccessPointsOptions struct {
	Status NfsAccessPointStatus `url:"status,omitempty"`
}

NfsListAccessPointsOptions represents filters for listing access points.

type NfsListOptions added in v1.207.0

type NfsListOptions struct {
	ListOptions

	// Region filters shares by region slug.
	Region string `url:"region,omitempty"`
	// Name filters shares by exact name match. Share names are not unique,
	// so a name-filtered list may return multiple shares.
	Name string `url:"name,omitempty"`
}

NfsListOptions represents the options for listing NFS shares.

type NfsOptions added in v1.207.0

type NfsOptions struct {
	// PerformanceTiers lists the performance tiers a share can be created
	// with and the size range each accepts.
	PerformanceTiers []*NfsPerformanceTierOption `json:"performance_tiers"`
	// SupportedRegions lists the region slugs where NFS is supported —
	// the same allowlist share creation validates against, so callers
	// can fail fast before creating.
	SupportedRegions []string `json:"supported_regions"`
}

NfsOptions represents the valid parameter values for creating NFS shares.

type NfsPerformanceTierOption added in v1.207.0

type NfsPerformanceTierOption struct {
	// Tier is the value accepted by NfsCreateRequest.PerformanceTier
	// (e.g. "standard", "high").
	Tier string `json:"tier"`
	// MinSizeGib is the minimum share size in GiB for this tier.
	MinSizeGib uint64 `json:"min_size_gib"`
	// MaxSizeGib is the maximum share size in GiB for this tier. May vary
	// per account.
	MaxSizeGib uint64 `json:"max_size_gib"`
}

NfsPerformanceTierOption represents a performance tier available for share creation and its accepted size range.

type NfsReassignParams added in v1.181.0

type NfsReassignParams struct {
	OldVpcID string `json:"old_vpc_id"`
	NewVpcID string `json:"new_vpc_id"`
}

NfsReassignParams represents parameters for reassigning an NFS share from one VPC to another.

type NfsResizeParams added in v1.167.0

type NfsResizeParams struct {
	SizeGib uint64 `json:"size_gib"`
}

NfsResizeParams represents parameters for resizing an NFS share

type NfsService added in v1.166.0

type NfsService interface {
	// List retrieves a list of NFS shares filtered by region.
	List(ctx context.Context, opts *ListOptions, region string) ([]*Nfs, *Response, error)
	// ListWithOptions retrieves a list of NFS shares filtered by NFS-specific
	// options, including exact-name matching.
	ListWithOptions(ctx context.Context, opts *NfsListOptions) ([]*Nfs, *Response, error)
	// Create creates a new NFS share with the provided configuration
	Create(ctx context.Context, nfsCreateRequest *NfsCreateRequest) (*Nfs, *Response, error)
	// Delete removes an NFS share by its ID and region.
	Delete(ctx context.Context, nfsShareId string, region string) (*Response, error)
	// DeleteWithOptions removes an NFS share using NFS-specific options,
	// including whether its active snapshots should also be deleted.
	DeleteWithOptions(ctx context.Context, nfsShareId string, opts *NfsDeleteOptions) (*Response, error)
	// Get retrieves a specific NFS share by its ID and region
	Get(ctx context.Context, nfsShareId string, region string) (*Nfs, *Response, error)
	// GetOptions retrieves the valid parameter values for creating NFS
	// shares: the available performance tiers with the size range each
	// tier accepts, and the regions where NFS is supported
	GetOptions(ctx context.Context) (*NfsOptions, *Response, error)
	// List retrieves a list of NFS snapshots filtered by an optional share ID and region
	ListSnapshots(ctx context.Context, opts *ListOptions, nfsShareId string, region string) ([]*NfsSnapshot, *Response, error)
	// Get retrieves a specific NFS snapshot by its ID and region
	GetSnapshot(ctx context.Context, nfsSnapshotID string, region string) (*NfsSnapshot, *Response, error)
	// Delete removes an NFS snapshot by its ID and region
	DeleteSnapshot(ctx context.Context, nfsSnapshotID string, region string) (*Response, error)
	// CreateAccessPoint creates a new access point for a share.
	CreateAccessPoint(ctx context.Context, shareID string, createRequest *NfsCreateAccessPointRequest) (*NfsAccessPointActionResponse, *Response, error)
	// GetAccessPoint retrieves an NFS access point by ID.
	GetAccessPoint(ctx context.Context, accessPointID string) (*NfsAccessPoint, *Response, error)
	// ListAccessPoints retrieves access points for a given share.
	ListAccessPoints(ctx context.Context, shareID string, opts *NfsListAccessPointsOptions) ([]*NfsAccessPoint, *Response, error)
	// DeleteAccessPoint soft-deletes an NFS access point by ID.
	DeleteAccessPoint(ctx context.Context, accessPointID string) (*NfsAccessPointActionResponse, *Response, error)
}

type NfsServiceOp added in v1.166.0

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

NfsServiceOp handles communication with the NFS related methods of the DigitalOcean API.

func (*NfsServiceOp) Create added in v1.166.0

func (s *NfsServiceOp) Create(ctx context.Context, createRequest *NfsCreateRequest) (*Nfs, *Response, error)

Create creates a new NFS share.

There is no client-side size validation: minimum and maximum sizes differ per performance tier and can change server-side, so the API is the source of truth. Use Nfs.GetOptions to read the current per-tier floors.

func (*NfsServiceOp) CreateAccessPoint added in v1.197.0

func (s *NfsServiceOp) CreateAccessPoint(ctx context.Context, shareID string, createRequest *NfsCreateAccessPointRequest) (*NfsAccessPointActionResponse, *Response, error)

CreateAccessPoint creates a new access point for a share.

func (*NfsServiceOp) Delete added in v1.166.0

func (s *NfsServiceOp) Delete(ctx context.Context, nfsShareId string, region string) (*Response, error)

Delete deletes an NFS share by ID and region using the original public method signature. It does not delete active snapshots.

func (*NfsServiceOp) DeleteAccessPoint added in v1.197.0

func (s *NfsServiceOp) DeleteAccessPoint(ctx context.Context, accessPointID string) (*NfsAccessPointActionResponse, *Response, error)

DeleteAccessPoint soft-deletes an NFS access point by ID.

func (*NfsServiceOp) DeleteSnapshot added in v1.167.0

func (s *NfsServiceOp) DeleteSnapshot(ctx context.Context, nfsSnapshotID string, region string) (*Response, error)

Delete deletes an NFS snapshot by ID and region.

func (*NfsServiceOp) DeleteWithOptions added in v1.207.0

func (s *NfsServiceOp) DeleteWithOptions(ctx context.Context, nfsShareId string, opts *NfsDeleteOptions) (*Response, error)

DeleteWithOptions deletes an NFS share. Set DeleteSnapshots to delete active snapshots with the share; otherwise the API returns 412 when snapshots exist.

func (*NfsServiceOp) Get added in v1.166.0

func (s *NfsServiceOp) Get(ctx context.Context, nfsShareId string, region string) (*Nfs, *Response, error)

Get retrieves an NFS share by ID and region.

func (*NfsServiceOp) GetAccessPoint added in v1.197.0

func (s *NfsServiceOp) GetAccessPoint(ctx context.Context, accessPointID string) (*NfsAccessPoint, *Response, error)

GetAccessPoint retrieves an NFS access point by ID.

func (*NfsServiceOp) GetOptions added in v1.207.0

func (s *NfsServiceOp) GetOptions(ctx context.Context) (*NfsOptions, *Response, error)

GetOptions retrieves the valid parameter values for creating NFS shares: the available performance tiers with the size range each tier accepts, and the regions where NFS is supported. Size bounds are per-account and can change; treat the endpoint as the source of truth rather than hard-coding values.

func (*NfsServiceOp) GetSnapshot added in v1.167.0

func (s *NfsServiceOp) GetSnapshot(ctx context.Context, nfsSnapshotID string, region string) (*NfsSnapshot, *Response, error)

Get retrieves an NFS snapshot by ID and region.

func (*NfsServiceOp) List added in v1.166.0

func (s *NfsServiceOp) List(ctx context.Context, opts *ListOptions, region string) ([]*Nfs, *Response, error)

List returns a list of NFS shares using the original public method signature. Use ListWithOptions when an NFS-specific filter is needed.

func (*NfsServiceOp) ListAccessPoints added in v1.197.0

func (s *NfsServiceOp) ListAccessPoints(ctx context.Context, shareID string, opts *NfsListAccessPointsOptions) ([]*NfsAccessPoint, *Response, error)

ListAccessPoints returns all access points for a share.

func (*NfsServiceOp) ListSnapshots added in v1.167.0

func (s *NfsServiceOp) ListSnapshots(ctx context.Context, opts *ListOptions, nfsShareId, region string) ([]*NfsSnapshot, *Response, error)

List returns a list of NFS snapshots.

func (*NfsServiceOp) ListWithOptions added in v1.207.0

func (s *NfsServiceOp) ListWithOptions(ctx context.Context, opts *NfsListOptions) ([]*Nfs, *Response, error)

ListWithOptions returns a list of NFS shares filtered by NFS-specific options, including exact-name matching.

type NfsShareStatus added in v1.167.0

type NfsShareStatus string

NfsShareStatus represents the status of an NFS share.

type NfsSnapshot added in v1.167.0

type NfsSnapshot struct {
	// ID is the unique identifier for the NFS snapshot
	ID string `json:"id"`
	// Name is the human-readable name for the NFS snapshot
	Name string `json:"name"`
	// SizeGib is the size of the NFS snapshot in gibibytes
	SizeGib int `json:"size_gib"`
	// Region is the datacenter region where the NFS snapshot is located
	Region string `json:"region"`
	// Status represents the current status of the NFS snapshot
	Status NfsSnapshotStatus `json:"status"`
	// CreatedAt is the timestamp when the NFS snapshot was created
	CreatedAt string `json:"created_at"`
	// ShareID is the unique identifier of the share from which this snapshot was created.
	ShareID string `json:"share_id"`
}

type NfsSnapshotParams added in v1.167.0

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

NfsSnapshotParams represents parameters for creating an NFS snapshot

type NfsSnapshotStatus added in v1.167.0

type NfsSnapshotStatus string

NfsSnapshotStatus represents the status of an NFS snapshot.

type NfsSquashConfig added in v1.197.0

type NfsSquashConfig string

NfsSquashConfig represents the squash mode in an NFS access policy.

type NfsSwitchPerformanceTierParams added in v1.174.0

type NfsSwitchPerformanceTierParams struct {
	PerformanceTier string `json:"performance_tier"`
}

NfsSwitchPerformanceTierParams represents parameters to switch the performance tier of an NFS share.

type NotificationChannel added in v1.218.0

type NotificationChannel struct {
	ID          string                     `json:"id"`
	Name        string                     `json:"name"`
	ChannelType string                     `json:"channel_type"`
	Email       *EmailNotificationConfig   `json:"email,omitempty"`
	Slack       *SlackNotificationConfig   `json:"slack,omitempty"`
	Webhook     *WebhookNotificationConfig `json:"webhook,omitempty"`
	Usage       *NotificationChannelUsage  `json:"usage,omitempty"`
	CreatedAt   time.Time                  `json:"created_at"`
	UpdatedAt   time.Time                  `json:"updated_at"`
}

NotificationChannel is a reusable Insights notification destination.

type NotificationChannelBinding added in v1.218.0

type NotificationChannelBinding struct {
	NotificationChannelID string   `json:"notification_channel_id"`
	NotifyOn              []string `json:"notify_on,omitempty"`
}

NotificationChannelBinding attaches a notification channel to an alert rule. An empty NotifyOn list notifies on every severity.

type NotificationChannelRequest added in v1.218.0

type NotificationChannelRequest struct {
	Name    string                     `json:"name"`
	Email   *EmailNotificationConfig   `json:"email,omitempty"`
	Slack   *SlackNotificationConfig   `json:"slack,omitempty"`
	Webhook *WebhookNotificationConfig `json:"webhook,omitempty"`
}

NotificationChannelRequest is the body for creating or updating a notification channel. Set exactly one of Email, Slack, or Webhook. Secret fields are write-only: send the full value to set or rotate one, and leave it empty on update to keep the current secret.

type NotificationChannelUsage added in v1.218.0

type NotificationChannelUsage struct {
	RuleCount int `json:"rule_count"`
}

NotificationChannelUsage counts alert rules that reference a channel.

type Notifications added in v1.94.0

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

Notifications represents a DigitalOcean Notifications configuration.

type OneClick added in v1.37.0

type OneClick struct {
	Slug string `json:"slug"`
	Type string `json:"type"`
}

OneClick is the structure of a 1-click

type OneClickService added in v1.37.0

type OneClickService interface {
	List(context.Context, string) ([]*OneClick, *Response, error)
	InstallKubernetes(context.Context, *InstallKubernetesAppsRequest) (*InstallKubernetesAppsResponse, *Response, error)
}

OneClickService is an interface for interacting with 1-clicks with the DigitalOcean API. See: https://docs.digitalocean.com/reference/api/api-reference/#tag/1-Click-Applications

type OneClickServiceOp added in v1.37.0

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

OneClickServiceOp interfaces with 1-click endpoints in the DigitalOcean API.

func (*OneClickServiceOp) InstallKubernetes added in v1.38.0

InstallKubernetes installs an addon on a kubernetes cluster

func (*OneClickServiceOp) List added in v1.37.0

func (ocs *OneClickServiceOp) List(ctx context.Context, oneClickType string) ([]*OneClick, *Response, error)

List returns a list of the available 1-click applications.

type OneClicksRoot added in v1.37.0

type OneClicksRoot struct {
	List []*OneClick `json:"1_clicks"`
}

OneClicksRoot is the root of the json payload that contains a list of 1-clicks

type OpenAIAPIKeyCreateRequest added in v1.157.0

type OpenAIAPIKeyCreateRequest struct {
	Name   string `json:"name,omitempty"`
	ApiKey string `json:"api_key,omitempty"`
}

type OpenAIAPIKeyUpdateRequest added in v1.157.0

type OpenAIAPIKeyUpdateRequest struct {
	Name       string `json:"name,omitempty"`
	ApiKey     string `json:"api_key,omitempty"`
	ApiKeyUuid string `json:"api_key_uuid,omitempty"`
}

type OpenAPIParameterSchema added in v1.158.0

type OpenAPIParameterSchema struct {
	Name        string       `json:"name" validate:"required"`
	In          string       `json:"in" validate:"omitempty,oneof=query header path cookie"`
	Schema      NestedSchema `json:"schema" validate:"required"`
	Description string       `json:"description,omitempty"`
	Required    bool         `json:"required,omitempty"`
}

type OpenAiApiKey added in v1.149.0

type OpenAiApiKey struct {
	CreatedAt *Timestamp `json:"created_at,omitempty"`
	CreatedBy string     `json:"created_by,omitempty"`
	DeletedAt *Timestamp `json:"deleted_at,omitempty"`
	Models    []*Model   `json:"models,omitempty"`
	Name      string     `json:"name,omitempty"`
	UpdatedAt *Timestamp `json:"updated_at,omitempty"`
	Uuid      string     `json:"uuid,omitempty"`
}

OpenAiApiKey represents the OpenAI API Key information

type OpenSearchACL added in v1.122.0

type OpenSearchACL struct {
	Permission string `json:"permission,omitempty"`
	Index      string `json:"index,omitempty"`
}

OpenSearchACL contains OpenSearch specific user access control information

type OpenSearchBasicAuth added in v1.117.0

type OpenSearchBasicAuth struct {
	// Username to authenticate with. Only required when `endpoint` is set. Defaults to `doadmin` when `cluster_name` is set.
	User string `json:"user,omitempty"`
	// Password for user defined in User. Is required when `endpoint` is set. Cannot be set if using a DigitalOcean DBaaS OpenSearch cluster.
	Password string `json:"password,omitempty"`
}

OpenSearchBasicAuth Configure Username and/or Password for Basic authentication.

func (*OpenSearchBasicAuth) GetPassword added in v1.117.0

func (o *OpenSearchBasicAuth) GetPassword() string

GetPassword returns the Password field.

func (*OpenSearchBasicAuth) GetUser added in v1.117.0

func (o *OpenSearchBasicAuth) GetUser() string

GetUser returns the User field.

type OpensearchConfig added in v1.127.0

type OpensearchConfig struct {
	HttpMaxContentLengthBytes                        *int     `json:"http_max_content_length_bytes,omitempty"`
	HttpMaxHeaderSizeBytes                           *int     `json:"http_max_header_size_bytes,omitempty"`
	HttpMaxInitialLineLengthBytes                    *int     `json:"http_max_initial_line_length_bytes,omitempty"`
	IndicesQueryBoolMaxClauseCount                   *int     `json:"indices_query_bool_max_clause_count,omitempty"`
	IndicesFielddataCacheSizePercentage              *int     `json:"indices_fielddata_cache_size_percentage,omitempty"`
	IndicesMemoryIndexBufferSizePercentage           *int     `json:"indices_memory_index_buffer_size_percentage,omitempty"`
	IndicesMemoryMinIndexBufferSizeMb                *int     `json:"indices_memory_min_index_buffer_size_mb,omitempty"`
	IndicesMemoryMaxIndexBufferSizeMb                *int     `json:"indices_memory_max_index_buffer_size_mb,omitempty"`
	IndicesQueriesCacheSizePercentage                *int     `json:"indices_queries_cache_size_percentage,omitempty"`
	IndicesRecoveryMaxMbPerSec                       *int     `json:"indices_recovery_max_mb_per_sec,omitempty"`
	IndicesRecoveryMaxConcurrentFileChunks           *int     `json:"indices_recovery_max_concurrent_file_chunks,omitempty"`
	ThreadPoolSearchSize                             *int     `json:"thread_pool_search_size,omitempty"`
	ThreadPoolSearchThrottledSize                    *int     `json:"thread_pool_search_throttled_size,omitempty"`
	ThreadPoolGetSize                                *int     `json:"thread_pool_get_size,omitempty"`
	ThreadPoolAnalyzeSize                            *int     `json:"thread_pool_analyze_size,omitempty"`
	ThreadPoolWriteSize                              *int     `json:"thread_pool_write_size,omitempty"`
	ThreadPoolForceMergeSize                         *int     `json:"thread_pool_force_merge_size,omitempty"`
	ThreadPoolSearchQueueSize                        *int     `json:"thread_pool_search_queue_size,omitempty"`
	ThreadPoolSearchThrottledQueueSize               *int     `json:"thread_pool_search_throttled_queue_size,omitempty"`
	ThreadPoolGetQueueSize                           *int     `json:"thread_pool_get_queue_size,omitempty"`
	ThreadPoolAnalyzeQueueSize                       *int     `json:"thread_pool_analyze_queue_size,omitempty"`
	ThreadPoolWriteQueueSize                         *int     `json:"thread_pool_write_queue_size,omitempty"`
	IsmEnabled                                       *bool    `json:"ism_enabled,omitempty"`
	IsmHistoryEnabled                                *bool    `json:"ism_history_enabled,omitempty"`
	IsmHistoryMaxAgeHours                            *int     `json:"ism_history_max_age_hours,omitempty"`
	IsmHistoryMaxDocs                                *int64   `json:"ism_history_max_docs,omitempty"`
	IsmHistoryRolloverCheckPeriodHours               *int     `json:"ism_history_rollover_check_period_hours,omitempty"`
	IsmHistoryRolloverRetentionPeriodDays            *int     `json:"ism_history_rollover_retention_period_days,omitempty"`
	SearchMaxBuckets                                 *int     `json:"search_max_buckets,omitempty"`
	ActionAutoCreateIndexEnabled                     *bool    `json:"action_auto_create_index_enabled,omitempty"`
	EnableSecurityAudit                              *bool    `json:"enable_security_audit,omitempty"`
	ActionDestructiveRequiresName                    *bool    `json:"action_destructive_requires_name,omitempty"`
	ClusterMaxShardsPerNode                          *int     `json:"cluster_max_shards_per_node,omitempty"`
	OverrideMainResponseVersion                      *bool    `json:"override_main_response_version,omitempty"`
	ScriptMaxCompilationsRate                        *string  `json:"script_max_compilations_rate,omitempty"`
	ClusterRoutingAllocationNodeConcurrentRecoveries *int     `json:"cluster_routing_allocation_node_concurrent_recoveries,omitempty"`
	ReindexRemoteWhitelist                           []string `json:"reindex_remote_whitelist,omitempty"`
	PluginsAlertingFilterByBackendRolesEnabled       *bool    `json:"plugins_alerting_filter_by_backend_roles_enabled,omitempty"`
}

OpensearchConfig holds advanced configurations for Opensearch database clusters.

type OutboundRule added in v1.1.0

type OutboundRule struct {
	Protocol     string             `json:"protocol,omitempty"`
	PortRange    string             `json:"ports,omitempty"`
	Destinations *Destinations      `json:"destinations"`
	Action       FirewallRuleAction `json:"action,omitempty"`
}

OutboundRule represents a DigitalOcean Firewall outbound rule.

type Pages added in v0.3.0

type Pages struct {
	First string `json:"first,omitempty"`
	Prev  string `json:"prev,omitempty"`
	Last  string `json:"last,omitempty"`
	Next  string `json:"next,omitempty"`
}

Pages are pages specified in Links

type PartnerAttachment added in v1.142.0

type PartnerAttachment struct {
	// ID is the generated ID of the Partner Attachment
	ID string `json:"id,omitempty"`
	// Name is the name of the Partner Attachment
	Name string `json:"name,omitempty"`
	// State is the state of the Partner Attachment
	State string `json:"state,omitempty"`
	// ConnectionBandwidthInMbps is the bandwidth of the connection in Mbps
	ConnectionBandwidthInMbps int `json:"connection_bandwidth_in_mbps,omitempty"`
	// Region is the region where the Partner Attachment is created
	Region string `json:"region,omitempty"`
	// NaaSProvider is the name of the Network as a Service provider
	NaaSProvider string `json:"naas_provider,omitempty"`
	// VPCIDs is the IDs of the VPCs to which the Partner Attachment is connected to
	VPCIDs []string `json:"vpc_ids,omitempty"`
	// BGP is the BGP configuration of the Partner Attachment
	BGP BGP `json:"bgp,omitempty"`
	// RedundancyZone is the redundancy zone of the Partner Attachment
	RedundancyZone string `json:"redundancy_zone,omitempty"`
	// CreatedAt is time when this Partner Attachment was first created
	CreatedAt time.Time `json:"created_at,omitempty"`
	// ParentUuid is the uuid of the parent Partner Attachment if there is one
	ParentUuid string `json:"parent_uuid,omitempty"`
	// Children is a slice of children Partner Attachment UUIDs associated
	// with the given Partner Attachment if there are any
	Children []string `json:"children,omitempty"`
}

PartnerAttachment represents a DigitalOcean Partner Attachment.

type PartnerAttachmentCreateRequest added in v1.142.0

type PartnerAttachmentCreateRequest struct {
	// Name is the name of the Partner Attachment
	Name string `json:"name,omitempty"`
	// ConnectionBandwidthInMbps is the bandwidth of the connection in Mbps
	ConnectionBandwidthInMbps int `json:"connection_bandwidth_in_mbps,omitempty"`
	// Region is the region where the Partner Attachment is created
	Region string `json:"region,omitempty"`
	// NaaSProvider is the name of the Network as a Service provider
	NaaSProvider string `json:"naas_provider,omitempty"`
	// VPCIDs is the IDs of the VPCs to which the Partner Attachment is connected to
	VPCIDs []string `json:"vpc_ids,omitempty"`
	// BGP is the BGP configuration of the Partner Attachment
	BGP BGP `json:"bgp,omitempty"`
	// RedundancyZone is the redundancy zone of the Partner Attachment
	RedundancyZone string `json:"redundancy_zone,omitempty"`
	// ParentUuid is the uuid of the parent Partner Attachment if there is one
	ParentUuid string `json:"parent_uuid,omitempty"`
}

PartnerAttachmentCreateRequest represents a request to create a Partner Attachment.

type PartnerAttachmentService added in v1.142.0

PartnerAttachmentService is an interface for managing Partner Attachments with the DigitalOcean API. See: https://docs.digitalocean.com/reference/api/api-reference/#tag/PartnerNetworkConnect

type PartnerAttachmentServiceOp added in v1.142.0

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

PartnerAttachmentServiceOp interfaces with the Partner Attachment endpoints in the DigitalOcean API.

func (*PartnerAttachmentServiceOp) Create added in v1.142.0

Create creates a new Partner Attachment.

func (*PartnerAttachmentServiceOp) Delete added in v1.142.0

Delete deletes a Partner Attachment.

func (*PartnerAttachmentServiceOp) Get added in v1.142.0

Get returns the details of a Partner Attachment.

func (*PartnerAttachmentServiceOp) GetBGPAuthKey added in v1.142.0

func (s *PartnerAttachmentServiceOp) GetBGPAuthKey(ctx context.Context, iaID string) (*BgpAuthKey, *Response, error)

GetBGPAuthKey returns Partner Attachment bgp auth key

func (*PartnerAttachmentServiceOp) GetServiceKey added in v1.142.0

func (s *PartnerAttachmentServiceOp) GetServiceKey(ctx context.Context, id string) (*ServiceKey, *Response, error)

func (*PartnerAttachmentServiceOp) List added in v1.142.0

List returns a list of all Partner Attachment, with optional pagination.

func (*PartnerAttachmentServiceOp) ListRoutes added in v1.142.0

ListRoutes lists all remote routes for a Partner Attachment.

func (*PartnerAttachmentServiceOp) RegenerateServiceKey added in v1.142.0

func (s *PartnerAttachmentServiceOp) RegenerateServiceKey(ctx context.Context, iaID string) (*RegenerateServiceKey, *Response, error)

RegenerateServiceKey regenerates the service key of a Partner Attachment.

func (*PartnerAttachmentServiceOp) Update added in v1.142.0

Update updates a Partner Attachment properties.

type PartnerAttachmentUpdateRequest added in v1.142.0

type PartnerAttachmentUpdateRequest struct {
	// Name is the name of the Partner Attachment
	Name string `json:"name,omitempty"`
	//VPCIDs is the IDs of the VPCs to which the Partner Attachment is connected to
	VPCIDs []string `json:"vpc_ids,omitempty"`
}

PartnerAttachmentUpdateRequest represents a request to update a Partner Attachment.

type PendingChange added in v1.1.0

type PendingChange struct {
	DropletID int    `json:"droplet_id,omitempty"`
	Removing  bool   `json:"removing,omitempty"`
	Status    string `json:"status,omitempty"`
}

PendingChange represents a DigitalOcean Firewall status details.

type PerEpochResultSummary added in v1.217.0

type PerEpochResultSummary struct {
	Epoch               uint32  `json:"epoch,omitempty"`
	OverallScorePercent float64 `json:"overall_score_percent,omitempty"`
	RowsScored          uint32  `json:"rows_scored,omitempty"`
}

PerEpochResultSummary is one epoch's standalone score for a multi-epoch run.

type PerModelResultSummaries added in v1.194.1

type PerModelResultSummaries struct {
	Summaries []*PerModelResultSummary `json:"summaries,omitempty"`
}

PerModelResultSummaries wraps the per-model summaries used inside a ModelEvaluationRunResultSummary.

type PerModelResultSummary added in v1.194.1

type PerModelResultSummary struct {
	MetricSummaries    []*MetricResultSummary `json:"metric_summaries,omitempty"`
	ModelName          string                 `json:"model_name,omitempty"`
	PerformanceMetrics *PerformanceMetrics    `json:"performance_metrics,omitempty"`
	PromptCount        int64                  `json:"prompt_count,omitempty"`
}

PerModelResultSummary represents a per-model breakdown of evaluation results for router evaluations.

type PerTaskResultSummaries added in v1.217.0

type PerTaskResultSummaries struct {
	Summaries []*PerTaskResultSummary `json:"summaries,omitempty"`
}

PerTaskResultSummaries wraps the per-task summaries used inside a ModelEvaluationRunResultSummary.

type PerTaskResultSummary added in v1.217.0

type PerTaskResultSummary struct {
	MetricSummaries    []*MetricResultSummary `json:"metric_summaries,omitempty"`
	PerformanceMetrics *PerformanceMetrics    `json:"performance_metrics,omitempty"`
	PromptCount        int64                  `json:"prompt_count,omitempty"`
	TaskName           string                 `json:"task_name,omitempty"`
}

PerTaskResultSummary is the aggregated evaluation results for a single routing task category in a router evaluation run.

type PerformanceMetrics added in v1.194.1

type PerformanceMetrics struct {
	CandidateLatency *LatencyMetrics `json:"candidate_latency,omitempty"`
	TokenUsage       *TokenUsage     `json:"token_usage,omitempty"`
}

PerformanceMetrics contains performance metrics (latency and token usage) for an evaluation run. All performance metrics are for the candidate model unless noted otherwise.

type PostgreSQLBouncerConfig added in v1.82.0

type PostgreSQLBouncerConfig struct {
	ServerResetQueryAlways  *bool     `json:"server_reset_query_always,omitempty"`
	IgnoreStartupParameters *[]string `json:"ignore_startup_parameters,omitempty"`
	MinPoolSize             *int      `json:"min_pool_size,omitempty"`
	ServerLifetime          *int      `json:"server_lifetime,omitempty"`
	ServerIdleTimeout       *int      `json:"server_idle_timeout,omitempty"`
	AutodbPoolSize          *int      `json:"autodb_pool_size,omitempty"`
	AutodbPoolMode          *string   `json:"autodb_pool_mode,omitempty"`
	AutodbMaxDbConnections  *int      `json:"autodb_max_db_connections,omitempty"`
	AutodbIdleTimeout       *int      `json:"autodb_idle_timeout,omitempty"`
}

PostgreSQLBouncerConfig configuration

type PostgreSQLConfig added in v1.82.0

type PostgreSQLConfig struct {
	AutovacuumFreezeMaxAge          *int                         `json:"autovacuum_freeze_max_age,omitempty"`
	AutovacuumMaxWorkers            *int                         `json:"autovacuum_max_workers,omitempty"`
	AutovacuumNaptime               *int                         `json:"autovacuum_naptime,omitempty"`
	AutovacuumVacuumThreshold       *int                         `json:"autovacuum_vacuum_threshold,omitempty"`
	AutovacuumAnalyzeThreshold      *int                         `json:"autovacuum_analyze_threshold,omitempty"`
	AutovacuumVacuumScaleFactor     *float32                     `json:"autovacuum_vacuum_scale_factor,omitempty"`
	AutovacuumAnalyzeScaleFactor    *float32                     `json:"autovacuum_analyze_scale_factor,omitempty"`
	AutovacuumVacuumCostDelay       *int                         `json:"autovacuum_vacuum_cost_delay,omitempty"`
	AutovacuumVacuumCostLimit       *int                         `json:"autovacuum_vacuum_cost_limit,omitempty"`
	BGWriterDelay                   *int                         `json:"bgwriter_delay,omitempty"`
	BGWriterFlushAfter              *int                         `json:"bgwriter_flush_after,omitempty"`
	BGWriterLRUMaxpages             *int                         `json:"bgwriter_lru_maxpages,omitempty"`
	BGWriterLRUMultiplier           *float32                     `json:"bgwriter_lru_multiplier,omitempty"`
	DeadlockTimeoutMillis           *int                         `json:"deadlock_timeout,omitempty"`
	DefaultToastCompression         *string                      `json:"default_toast_compression,omitempty"`
	IdleInTransactionSessionTimeout *int                         `json:"idle_in_transaction_session_timeout,omitempty"`
	JIT                             *bool                        `json:"jit,omitempty"`
	LogAutovacuumMinDuration        *int                         `json:"log_autovacuum_min_duration,omitempty"`
	LogErrorVerbosity               *string                      `json:"log_error_verbosity,omitempty"`
	LogLinePrefix                   *string                      `json:"log_line_prefix,omitempty"`
	LogMinDurationStatement         *int                         `json:"log_min_duration_statement,omitempty"`
	MaxFilesPerProcess              *int                         `json:"max_files_per_process,omitempty"`
	MaxPreparedTransactions         *int                         `json:"max_prepared_transactions,omitempty"`
	MaxPredLocksPerTransaction      *int                         `json:"max_pred_locks_per_transaction,omitempty"`
	MaxLocksPerTransaction          *int                         `json:"max_locks_per_transaction,omitempty"`
	MaxStackDepth                   *int                         `json:"max_stack_depth,omitempty"`
	MaxStandbyArchiveDelay          *int                         `json:"max_standby_archive_delay,omitempty"`
	MaxStandbyStreamingDelay        *int                         `json:"max_standby_streaming_delay,omitempty"`
	MaxReplicationSlots             *int                         `json:"max_replication_slots,omitempty"`
	MaxLogicalReplicationWorkers    *int                         `json:"max_logical_replication_workers,omitempty"`
	MaxParallelWorkers              *int                         `json:"max_parallel_workers,omitempty"`
	MaxParallelWorkersPerGather     *int                         `json:"max_parallel_workers_per_gather,omitempty"`
	MaxWorkerProcesses              *int                         `json:"max_worker_processes,omitempty"`
	PGPartmanBGWRole                *string                      `json:"pg_partman_bgw.role,omitempty"`
	PGPartmanBGWInterval            *int                         `json:"pg_partman_bgw.interval,omitempty"`
	PGStatStatementsTrack           *string                      `json:"pg_stat_statements.track,omitempty"`
	TempFileLimit                   *int                         `json:"temp_file_limit,omitempty"`
	Timezone                        *string                      `json:"timezone,omitempty"`
	TrackActivityQuerySize          *int                         `json:"track_activity_query_size,omitempty"`
	TrackCommitTimestamp            *string                      `json:"track_commit_timestamp,omitempty"`
	TrackFunctions                  *string                      `json:"track_functions,omitempty"`
	TrackIOTiming                   *string                      `json:"track_io_timing,omitempty"`
	MaxWalSenders                   *int                         `json:"max_wal_senders,omitempty"`
	WalSenderTimeout                *int                         `json:"wal_sender_timeout,omitempty"`
	WalWriterDelay                  *int                         `json:"wal_writer_delay,omitempty"`
	SharedBuffersPercentage         *float32                     `json:"shared_buffers_percentage,omitempty"`
	PgBouncer                       *PostgreSQLBouncerConfig     `json:"pgbouncer,omitempty"`
	BackupHour                      *int                         `json:"backup_hour,omitempty"`
	BackupMinute                    *int                         `json:"backup_minute,omitempty"`
	WorkMem                         *int                         `json:"work_mem,omitempty"`
	TimeScaleDB                     *PostgreSQLTimeScaleDBConfig `json:"timescaledb,omitempty"`
	SynchronousReplication          *string                      `json:"synchronous_replication,omitempty"`
	StatMonitorEnable               *bool                        `json:"stat_monitor_enable,omitempty"`
	MaxFailoverReplicationTimeLag   *int64                       `json:"max_failover_replication_time_lag,omitempty"`
}

PostgreSQLConfig holds advanced configurations for PostgreSQL database clusters.

type PostgreSQLTimeScaleDBConfig added in v1.82.0

type PostgreSQLTimeScaleDBConfig struct {
	MaxBackgroundWorkers *int `json:"max_background_workers,omitempty"`
}

PostgreSQLTimeScaleDBConfig configuration

type PrepaymentConfig added in v1.209.0

type PrepaymentConfig struct {
	SpendLimit          string    `json:"spend_limit"`
	IsAutoPrepayEnabled bool      `json:"is_auto_prepay_enabled"`
	PrepayAmount        string    `json:"prepay_amount"`
	PrepayThreshold     string    `json:"prepay_threshold"`
	CreatedAt           time.Time `json:"created_at"`
	UpdatedAt           time.Time `json:"updated_at"`
}

PrepaymentConfig represents prepayment gate configuration for an account.

type PrepaymentConfigResponse added in v1.209.0

type PrepaymentConfigResponse struct {
	Config *PrepaymentConfig `json:"config"`
	Status *PrepaymentStatus `json:"status"`
}

PrepaymentConfigResponse is the response from the public prepayment config endpoint.

func (PrepaymentConfigResponse) String added in v1.209.0

func (r PrepaymentConfigResponse) String() string

type PrepaymentService added in v1.209.0

type PrepaymentService interface {
	GetConfig(context.Context) (*PrepaymentConfigResponse, *Response, error)
	GetStatus(context.Context) (*PrepaymentStatusResponse, *Response, error)
}

PrepaymentService is an interface for interfacing with the Prepayment endpoints of the DigitalOcean API.

type PrepaymentServiceOp added in v1.209.0

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

PrepaymentServiceOp handles communication with the Prepayment related methods of the DigitalOcean API.

func (*PrepaymentServiceOp) GetConfig added in v1.209.0

GetConfig retrieves the authenticated customer's prepayment configuration and status.

func (*PrepaymentServiceOp) GetStatus added in v1.209.0

GetStatus retrieves the authenticated customer's prepayment status.

type PrepaymentStatus added in v1.209.0

type PrepaymentStatus struct {
	Balance             string `json:"balance"`
	IsAutoPrepayEnabled bool   `json:"is_auto_prepay_enabled"`
	Blocked             bool   `json:"blocked"`
	Eligible            bool   `json:"eligible"`
	MonthToDateBalance  string `json:"month_to_date_balance"`
}

PrepaymentStatus represents prepayment gate status for an account.

type PrepaymentStatusResponse added in v1.209.0

type PrepaymentStatusResponse struct {
	Status *PrepaymentStatus `json:"status"`
}

PrepaymentStatusResponse is the response from the public prepayment status endpoint.

func (PrepaymentStatusResponse) String added in v1.209.0

func (r PrepaymentStatusResponse) String() string

type PresetSaveSection added in v1.217.0

type PresetSaveSection string

PresetSaveSection names a self-contained group of fields that can be persisted when creating a model evaluation run as a reusable preset.

const (
	PresetSaveSectionUnspecified  PresetSaveSection = "PRESET_SAVE_SECTION_UNSPECIFIED"
	PresetSaveSectionCandidate    PresetSaveSection = "PRESET_SAVE_SECTION_CANDIDATE"
	PresetSaveSectionMetrics      PresetSaveSection = "PRESET_SAVE_SECTION_METRICS"
	PresetSaveSectionJudge        PresetSaveSection = "PRESET_SAVE_SECTION_JUDGE"
	PresetSaveSectionDataset      PresetSaveSection = "PRESET_SAVE_SECTION_DATASET"
	PresetSaveSectionSystemPrompt PresetSaveSection = "PRESET_SAVE_SECTION_SYSTEM_PROMPT"
)

type PresignedUrlFile added in v1.194.1

type PresignedUrlFile struct {
	FileName string `json:"file_name,omitempty"`
	FileSize string `json:"file_size,omitempty"`
}

PresignedUrlFile describes a single file for which a presigned upload URL is requested when uploading a model evaluation dataset.

type Project added in v1.6.0

type Project struct {
	ID          string `json:"id"`
	OwnerUUID   string `json:"owner_uuid"`
	OwnerID     uint64 `json:"owner_id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Purpose     string `json:"purpose"`
	Environment string `json:"environment"`
	IsDefault   bool   `json:"is_default"`
	CreatedAt   string `json:"created_at"`
	UpdatedAt   string `json:"updated_at"`
}

Project represents a DigitalOcean Project configuration.

func (Project) String added in v1.6.0

func (p Project) String() string

String creates a human-readable description of a Project.

type ProjectResource added in v1.6.0

type ProjectResource struct {
	URN        string                `json:"urn"`
	AssignedAt string                `json:"assigned_at"`
	Links      *ProjectResourceLinks `json:"links"`
	Status     string                `json:"status,omitempty"`
}

ProjectResource is the projects API's representation of a resource.

type ProjectResourceLinks struct {
	Self string `json:"self"`
}

ProjectResourceLinks specify the link for more information about the resource.

type ProjectsService added in v1.6.0

ProjectsService is an interface for creating and managing Projects with the DigitalOcean API. See: https://docs.digitalocean.com/reference/api/api-reference/#tag/Projects

type ProjectsServiceOp added in v1.6.0

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

ProjectsServiceOp handles communication with Projects methods of the DigitalOcean API.

func (*ProjectsServiceOp) AssignResources added in v1.6.0

func (p *ProjectsServiceOp) AssignResources(ctx context.Context, projectID string, resources ...interface{}) ([]ProjectResource, *Response, error)

AssignResources assigns one or more resources to a project. AssignResources accepts resources in two possible formats:

  1. The resource type, like `&Droplet{ID: 1}` or `&FloatingIP{IP: "1.2.3.4"}`
  2. A valid DO URN as a string, like "do:droplet:1234"

There is no unassign. To move a resource to another project, just assign it to that other project.

func (*ProjectsServiceOp) Create added in v1.6.0

Create a new project.

func (*ProjectsServiceOp) Delete added in v1.6.0

func (p *ProjectsServiceOp) Delete(ctx context.Context, projectID string) (*Response, error)

Delete an existing project. You cannot have any resources in a project before deleting it. See the API documentation for more details.

func (*ProjectsServiceOp) Get added in v1.6.0

func (p *ProjectsServiceOp) Get(ctx context.Context, projectID string) (*Project, *Response, error)

Get retrieves a single project by its ID.

func (*ProjectsServiceOp) GetDefault added in v1.6.0

func (p *ProjectsServiceOp) GetDefault(ctx context.Context) (*Project, *Response, error)

GetDefault project.

func (*ProjectsServiceOp) List added in v1.6.0

func (p *ProjectsServiceOp) List(ctx context.Context, opts *ListOptions) ([]Project, *Response, error)

List Projects.

func (*ProjectsServiceOp) ListResources added in v1.6.0

func (p *ProjectsServiceOp) ListResources(ctx context.Context, projectID string, opts *ListOptions) ([]ProjectResource, *Response, error)

ListResources lists all resources in a project.

func (*ProjectsServiceOp) Update added in v1.6.0

func (p *ProjectsServiceOp) Update(ctx context.Context, projectID string, ur *UpdateProjectRequest) (*Project, *Response, error)

Update an existing project.

type PromLabelsResponse added in v1.218.0

type PromLabelsResponse struct {
	Status string   `json:"status"`
	Data   []string `json:"data"`
}

PromLabelsResponse lists label names or the values of one label.

type PromMatrixResult added in v1.218.0

type PromMatrixResult struct {
	ResultType string             `json:"resultType"`
	Result     []PromMatrixSample `json:"result"`
}

PromMatrixResult is the data object of a range query.

type PromMatrixSample added in v1.218.0

type PromMatrixSample struct {
	Metric map[string]string `json:"metric"`
	Values []PromSample      `json:"values"`
}

PromMatrixSample is one series from a range result.

type PromQueryOptions added in v1.218.0

type PromQueryOptions struct {
	Query   string `url:"query"`
	Time    string `url:"time,omitempty"`
	Timeout string `url:"timeout,omitempty"`
}

PromQueryOptions are parameters for an instant PromQL query. Time and Timeout accept Prometheus timestamps and duration strings.

type PromQueryRangeOptions added in v1.218.0

type PromQueryRangeOptions struct {
	Query   string `url:"query"`
	Start   string `url:"start"`
	End     string `url:"end"`
	Step    string `url:"step"`
	Timeout string `url:"timeout,omitempty"`
}

PromQueryRangeOptions are parameters for a range PromQL query.

type PromQueryRangeResponse added in v1.218.0

type PromQueryRangeResponse struct {
	Status string           `json:"status"`
	Data   PromMatrixResult `json:"data"`
}

PromQueryRangeResponse is a successful range PromQL query. Data.ResultType is matrix.

type PromQueryResponse added in v1.218.0

type PromQueryResponse struct {
	Status     string
	ResultType string
	Vector     []PromVectorSample
	Matrix     []PromMatrixSample
	Sample     *PromSample
}

PromQueryResponse is a successful instant PromQL query. ResultType is vector, matrix, scalar, or string. Exactly one of Vector, Matrix, or Sample is set.

func (*PromQueryResponse) UnmarshalJSON added in v1.218.0

func (r *PromQueryResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes a Prometheus instant-query envelope.

type PromSample added in v1.218.0

type PromSample struct {
	Timestamp float64
	Value     string
}

PromSample is a Prometheus sample pair [timestamp_seconds, value]. Value is the raw string from the API, including non-numeric string results.

func (*PromSample) UnmarshalJSON added in v1.218.0

func (s *PromSample) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes a Prometheus [timestamp, value] sample.

type PromSelectorOptions added in v1.218.0

type PromSelectorOptions struct {
	Match []string `url:"match,brackets,omitempty"`
	Start string   `url:"start,omitempty"`
	End   string   `url:"end,omitempty"`
}

PromSelectorOptions are parameters for series, label, and label-value lookups. Match is repeated as match[] selectors.

type PromSeriesResponse added in v1.218.0

type PromSeriesResponse struct {
	Status string              `json:"status"`
	Data   []map[string]string `json:"data"`
}

PromSeriesResponse lists series matching one or more selectors.

type PromVectorSample added in v1.218.0

type PromVectorSample struct {
	Metric map[string]string `json:"metric"`
	Value  PromSample        `json:"value"`
}

PromVectorSample is one series from an instant vector result.

type PublicGateway added in v1.148.0

type PublicGateway struct {
	IPv4 string `json:"ipv4,omitempty"`
	IP   string `json:"ip,omitempty"`
}

PublicGateway defines the public egress supported by a VPC NAT Gateway. On create, set IP (preferred) or IPv4 to assign a BYOIP / reserved IP. When omitted, a system-allocated reserved IP is provisioned.

type Rate

type Rate struct {
	// The number of request per hour the client is currently limited to.
	Limit int `json:"limit"`

	// The number of remaining requests the client can make this hour.
	Remaining int `json:"remaining"`

	// The time at which the current rate limit will reset.
	Reset Timestamp `json:"reset"`
}

Rate contains the rate limit for the current client.

func (Rate) String

func (r Rate) String() string

type RedisConfig added in v1.82.0

type RedisConfig struct {
	RedisMaxmemoryPolicy               *string `json:"redis_maxmemory_policy,omitempty"`
	RedisPubsubClientOutputBufferLimit *int    `json:"redis_pubsub_client_output_buffer_limit,omitempty"`
	RedisNumberOfDatabases             *int    `json:"redis_number_of_databases,omitempty"`
	RedisIOThreads                     *int    `json:"redis_io_threads,omitempty"`
	RedisLFULogFactor                  *int    `json:"redis_lfu_log_factor,omitempty"`
	RedisLFUDecayTime                  *int    `json:"redis_lfu_decay_time,omitempty"`
	RedisSSL                           *bool   `json:"redis_ssl,omitempty"`
	RedisTimeout                       *int    `json:"redis_timeout,omitempty"`
	RedisNotifyKeyspaceEvents          *string `json:"redis_notify_keyspace_events,omitempty"`
	RedisPersistence                   *string `json:"redis_persistence,omitempty"`
	RedisACLChannelsDefault            *string `json:"redis_acl_channels_default,omitempty"`
}

RedisConfig holds advanced configurations for Redis database clusters.

type RegenerateServiceKey added in v1.138.0

type RegenerateServiceKey struct {
}

type Region

type Region struct {
	Slug      string   `json:"slug,omitempty"`
	Name      string   `json:"name,omitempty"`
	Sizes     []string `json:"sizes,omitempty"`
	Available bool     `json:"available,omitempty"`
	Features  []string `json:"features,omitempty"`
}

Region represents a DigitalOcean Region

func (Region) String

func (r Region) String() string

type RegionsService

type RegionsService interface {
	List(context.Context, *ListOptions) ([]Region, *Response, error)
}

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

type RegionsServiceOp added in v0.3.0

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

RegionsServiceOp handles communication with the region related methods of the DigitalOcean API.

func (*RegionsServiceOp) List added in v0.3.0

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

List all regions

type RegistriesCreateRequest added in v1.129.0

type RegistriesCreateRequest struct {
	Name   string `json:"name,omitempty"`
	Region string `json:"region,omitempty"`
}

RegistriesCreateRequest represents a request to create a secondary registry.

type RegistriesService added in v1.129.0

type RegistriesService interface {
	Get(context.Context, string) (*Registry, *Response, error)
	List(context.Context) ([]*Registry, *Response, error)
	ListByUUID(context.Context, string) ([]*Registry, *Response, error)
	Create(context.Context, *RegistryCreateRequest) (*Registry, *Response, error)
	Delete(context.Context, string) (*Response, error)
	DockerCredentials(context.Context, string, *RegistryDockerCredentialsRequest) (*DockerCredentials, *Response, error)
	ListRepositoriesV2(context.Context, string, *TokenListOptions) ([]*RepositoryV2, *Response, error)
	ListRepositoryTags(context.Context, string, string, *ListOptions) ([]*RepositoryTag, *Response, error)
	DeleteTag(context.Context, string, string, string) (*Response, error)
	ListRepositoryManifests(context.Context, string, string, *ListOptions) ([]*RepositoryManifest, *Response, error)
	DeleteManifest(context.Context, string, string, string) (*Response, error)
	StartGarbageCollection(context.Context, string, ...*StartGarbageCollectionRequest) (*GarbageCollection, *Response, error)
	GetGarbageCollection(context.Context, string) (*GarbageCollection, *Response, error)
	ListGarbageCollections(context.Context, string, *ListOptions) ([]*GarbageCollection, *Response, error)
	UpdateGarbageCollection(context.Context, string, string, *UpdateGarbageCollectionRequest) (*GarbageCollection, *Response, error)
	GetOptions(context.Context) (*RegistryOptions, *Response, error)
	GetSubscription(context.Context) (*RegistrySubscription, *Response, error)
	UpdateSubscription(context.Context, *RegistrySubscriptionUpdateRequest) (*RegistrySubscription, *Response, error)
	ValidateName(context.Context, *RegistryValidateNameRequest) (*Response, error)
}

RegistriesService is an interface for interfacing with the new multiple-registry endpoints of the DigitalOcean API.

type RegistriesServiceOp added in v1.129.0

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

func (*RegistriesServiceOp) Create added in v1.129.0

Create creates a new registry.

func (*RegistriesServiceOp) Delete added in v1.129.0

func (svc *RegistriesServiceOp) Delete(ctx context.Context, registry string) (*Response, error)

Delete deletes a named Registry. There is no way to recover a Registry once it has been destroyed.

func (*RegistriesServiceOp) DeleteManifest added in v1.150.0

func (svc *RegistriesServiceOp) DeleteManifest(ctx context.Context, registry, repository, digest string) (*Response, error)

DeleteManifest deletes a manifest from a repository

func (*RegistriesServiceOp) DeleteTag added in v1.150.0

func (svc *RegistriesServiceOp) DeleteTag(ctx context.Context, registry, repository, tag string) (*Response, error)

DeleteTag deletes a tag from a repository

func (*RegistriesServiceOp) DockerCredentials added in v1.129.0

func (svc *RegistriesServiceOp) DockerCredentials(ctx context.Context, registry string, request *RegistryDockerCredentialsRequest) (*DockerCredentials, *Response, error)

DockerCredentials retrieves a Docker config file containing named Registry's credentials.

func (*RegistriesServiceOp) Get added in v1.129.0

func (svc *RegistriesServiceOp) Get(ctx context.Context, registry string) (*Registry, *Response, error)

Get returns the details of a Registry identified by name or UUID.

func (*RegistriesServiceOp) GetGarbageCollection added in v1.150.0

func (svc *RegistriesServiceOp) GetGarbageCollection(ctx context.Context, registry string) (*GarbageCollection, *Response, error)

GetGarbageCollection gets the active garbage collection

func (*RegistriesServiceOp) GetOptions added in v1.150.0

func (svc *RegistriesServiceOp) GetOptions(ctx context.Context) (*RegistryOptions, *Response, error)

GetOptions gets registry options

func (*RegistriesServiceOp) GetSubscription added in v1.150.0

func (svc *RegistriesServiceOp) GetSubscription(ctx context.Context) (*RegistrySubscription, *Response, error)

GetSubscription gets subscription information

func (*RegistriesServiceOp) List added in v1.129.0

func (svc *RegistriesServiceOp) List(ctx context.Context) ([]*Registry, *Response, error)

List returns a list of the named Registries.

func (*RegistriesServiceOp) ListByUUID added in v1.208.0

func (svc *RegistriesServiceOp) ListByUUID(ctx context.Context, uuid string) ([]*Registry, *Response, error)

ListByUUID returns the Registries filtered by UUID.

func (*RegistriesServiceOp) ListGarbageCollections added in v1.150.0

func (svc *RegistriesServiceOp) ListGarbageCollections(ctx context.Context, registry string, opts *ListOptions) ([]*GarbageCollection, *Response, error)

ListGarbageCollections lists all garbage collections

func (*RegistriesServiceOp) ListRepositoriesV2 added in v1.150.0

func (svc *RegistriesServiceOp) ListRepositoriesV2(ctx context.Context, registry string, opts *TokenListOptions) ([]*RepositoryV2, *Response, error)

ListRepositoriesV2 returns a list of repositories in V2 format

func (*RegistriesServiceOp) ListRepositoryManifests added in v1.150.0

func (svc *RegistriesServiceOp) ListRepositoryManifests(ctx context.Context, registry, repository string, opts *ListOptions) ([]*RepositoryManifest, *Response, error)

ListRepositoryManifests returns a list of manifests in a repository

func (*RegistriesServiceOp) ListRepositoryTags added in v1.150.0

func (svc *RegistriesServiceOp) ListRepositoryTags(ctx context.Context, registry, repository string, opts *ListOptions) ([]*RepositoryTag, *Response, error)

ListRepositoryTags returns a list of tags in a repository

func (*RegistriesServiceOp) StartGarbageCollection added in v1.150.0

func (svc *RegistriesServiceOp) StartGarbageCollection(ctx context.Context, registry string, request ...*StartGarbageCollectionRequest) (*GarbageCollection, *Response, error)

StartGarbageCollection starts a garbage collection process

func (*RegistriesServiceOp) UpdateGarbageCollection added in v1.150.0

func (svc *RegistriesServiceOp) UpdateGarbageCollection(ctx context.Context, registry, gcUUID string, request *UpdateGarbageCollectionRequest) (*GarbageCollection, *Response, error)

UpdateGarbageCollection updates a garbage collection

func (*RegistriesServiceOp) UpdateSubscription added in v1.150.0

UpdateSubscription updates subscription information

func (*RegistriesServiceOp) ValidateName added in v1.150.0

func (svc *RegistriesServiceOp) ValidateName(ctx context.Context, request *RegistryValidateNameRequest) (*Response, error)

ValidateName validates a registry name

type Registry added in v1.25.0

type Registry struct {
	UUID                       string    `json:"uuid,omitempty"`
	Name                       string    `json:"name,omitempty"`
	StorageUsageBytes          uint64    `json:"storage_usage_bytes,omitempty"`
	StorageUsageBytesUpdatedAt time.Time `json:"storage_usage_bytes_updated_at,omitempty"`
	CreatedAt                  time.Time `json:"created_at,omitempty"`
	Region                     string    `json:"region,omitempty"`
}

Registry represents a registry.

type RegistryCreateRequest added in v1.25.0

type RegistryCreateRequest struct {
	Name                 string `json:"name,omitempty"`
	SubscriptionTierSlug string `json:"subscription_tier_slug,omitempty"`
	Region               string `json:"region,omitempty"`
}

RegistryCreateRequest represents a request to create a registry.

type RegistryDockerCredentialsRequest added in v1.25.0

type RegistryDockerCredentialsRequest struct {
	ReadWrite     bool `json:"read_write"`
	ExpirySeconds *int `json:"expiry_seconds,omitempty"`
}

RegistryDockerCredentialsRequest represents a request to retrieve docker credentials for a registry.

type RegistryOptions added in v1.51.0

type RegistryOptions struct {
	SubscriptionTiers []*RegistrySubscriptionTier `json:"subscription_tiers,omitempty"`
	AvailableRegions  []string                    `json:"available_regions"`
}

RegistryOptions are options for users when creating or updating a registry.

type RegistryService added in v1.25.0

type RegistryService interface {
	Create(context.Context, *RegistryCreateRequest) (*Registry, *Response, error)
	Get(context.Context) (*Registry, *Response, error)
	Delete(context.Context) (*Response, error)
	DockerCredentials(context.Context, *RegistryDockerCredentialsRequest) (*DockerCredentials, *Response, error)
	ListRepositories(context.Context, string, *ListOptions) ([]*Repository, *Response, error)
	ListRepositoriesV2(context.Context, string, *TokenListOptions) ([]*RepositoryV2, *Response, error)
	ListRepositoryTags(context.Context, string, string, *ListOptions) ([]*RepositoryTag, *Response, error)
	DeleteTag(context.Context, string, string, string) (*Response, error)
	ListRepositoryManifests(context.Context, string, string, *ListOptions) ([]*RepositoryManifest, *Response, error)
	DeleteManifest(context.Context, string, string, string) (*Response, error)
	StartGarbageCollection(context.Context, string, ...*StartGarbageCollectionRequest) (*GarbageCollection, *Response, error)
	GetGarbageCollection(context.Context, string) (*GarbageCollection, *Response, error)
	ListGarbageCollections(context.Context, string, *ListOptions) ([]*GarbageCollection, *Response, error)
	UpdateGarbageCollection(context.Context, string, string, *UpdateGarbageCollectionRequest) (*GarbageCollection, *Response, error)
	GetOptions(context.Context) (*RegistryOptions, *Response, error)
	GetSubscription(context.Context) (*RegistrySubscription, *Response, error)
	UpdateSubscription(context.Context, *RegistrySubscriptionUpdateRequest) (*RegistrySubscription, *Response, error)
	ValidateName(context.Context, *RegistryValidateNameRequest) (*Response, error)
}

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

NOTE: We are introducing a new RegistriesService and this one will be deprecated eventually.

type RegistryServiceOp added in v1.25.0

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

RegistryServiceOp handles communication with Registry methods of the DigitalOcean API.

func (*RegistryServiceOp) Create added in v1.25.0

Create creates a registry.

func (*RegistryServiceOp) Delete added in v1.25.0

func (svc *RegistryServiceOp) Delete(ctx context.Context) (*Response, error)

Delete deletes a registry. There is no way to recover a registry once it has been destroyed.

func (*RegistryServiceOp) DeleteManifest added in v1.35.0

func (svc *RegistryServiceOp) DeleteManifest(ctx context.Context, registry, repository, digest string) (*Response, error)

DeleteManifest deletes a manifest by its digest within a given repository.

func (*RegistryServiceOp) DeleteTag added in v1.35.0

func (svc *RegistryServiceOp) DeleteTag(ctx context.Context, registry, repository, tag string) (*Response, error)

DeleteTag deletes a tag within a given repository.

func (*RegistryServiceOp) DockerCredentials added in v1.25.0

DockerCredentials retrieves a Docker config file containing the registry's credentials.

func (*RegistryServiceOp) Get added in v1.25.0

Get retrieves the details of a Registry.

func (*RegistryServiceOp) GetGarbageCollection added in v1.50.0

func (svc *RegistryServiceOp) GetGarbageCollection(ctx context.Context, registry string) (*GarbageCollection, *Response, error)

GetGarbageCollection retrieves the currently-active garbage collection for the specified registry; if there are no active garbage collections, then return a 404/NotFound error. There can only be one active garbage collection on a registry.

func (*RegistryServiceOp) GetOptions added in v1.51.0

func (svc *RegistryServiceOp) GetOptions(ctx context.Context) (*RegistryOptions, *Response, error)

GetOptions returns options the user can use when creating or updating a registry.

func (*RegistryServiceOp) GetSubscription added in v1.51.0

func (svc *RegistryServiceOp) GetSubscription(ctx context.Context) (*RegistrySubscription, *Response, error)

GetSubscription retrieves the user's subscription.

func (*RegistryServiceOp) ListGarbageCollections added in v1.50.0

func (svc *RegistryServiceOp) ListGarbageCollections(ctx context.Context, registry string, opts *ListOptions) ([]*GarbageCollection, *Response, error)

ListGarbageCollections retrieves all garbage collections (active and inactive) for the specified registry.

func (*RegistryServiceOp) ListRepositories added in v1.35.0

func (svc *RegistryServiceOp) ListRepositories(ctx context.Context, registry string, opts *ListOptions) ([]*Repository, *Response, error)

ListRepositories returns a list of the Repositories visible with the registry's credentials.

func (*RegistryServiceOp) ListRepositoriesV2 added in v1.73.0

func (svc *RegistryServiceOp) ListRepositoriesV2(ctx context.Context, registry string, opts *TokenListOptions) ([]*RepositoryV2, *Response, error)

ListRepositoriesV2 returns a list of the Repositories in a registry.

func (*RegistryServiceOp) ListRepositoryManifests added in v1.73.0

func (svc *RegistryServiceOp) ListRepositoryManifests(ctx context.Context, registry, repository string, opts *ListOptions) ([]*RepositoryManifest, *Response, error)

ListRepositoryManifests returns a list of the RepositoryManifests available within the given repository.

func (*RegistryServiceOp) ListRepositoryTags added in v1.35.0

func (svc *RegistryServiceOp) ListRepositoryTags(ctx context.Context, registry, repository string, opts *ListOptions) ([]*RepositoryTag, *Response, error)

ListRepositoryTags returns a list of the RepositoryTags available within the given repository.

func (*RegistryServiceOp) StartGarbageCollection added in v1.50.0

func (svc *RegistryServiceOp) StartGarbageCollection(ctx context.Context, registry string, request ...*StartGarbageCollectionRequest) (*GarbageCollection, *Response, error)

StartGarbageCollection requests a garbage collection for the specified registry.

func (*RegistryServiceOp) UpdateGarbageCollection added in v1.50.0

func (svc *RegistryServiceOp) UpdateGarbageCollection(ctx context.Context, registry, gcUUID string, request *UpdateGarbageCollectionRequest) (*GarbageCollection, *Response, error)

UpdateGarbageCollection updates the specified garbage collection for the specified registry. While only the currently-active garbage collection can be updated we still require the exact garbage collection to be specified to avoid race conditions that might may arise from issuing an update to the implicit "currently-active" garbage collection. Returns the updated garbage collection.

func (*RegistryServiceOp) UpdateSubscription added in v1.52.0

UpdateSubscription updates the user's registry subscription.

func (*RegistryServiceOp) ValidateName added in v1.99.0

func (svc *RegistryServiceOp) ValidateName(ctx context.Context, request *RegistryValidateNameRequest) (*Response, error)

ValidateName validates that a container registry name is available for use.

type RegistrySubscription added in v1.51.0

type RegistrySubscription struct {
	Tier      *RegistrySubscriptionTier `json:"tier"`
	CreatedAt time.Time                 `json:"created_at"`
	UpdatedAt time.Time                 `json:"updated_at"`
}

RegistrySubscription is a user's subscription.

type RegistrySubscriptionTier added in v1.51.0

type RegistrySubscriptionTier struct {
	Name                   string `json:"name"`
	Slug                   string `json:"slug"`
	IncludedRepositories   uint64 `json:"included_repositories"`
	IncludedStorageBytes   uint64 `json:"included_storage_bytes"`
	AllowStorageOverage    bool   `json:"allow_storage_overage"`
	IncludedBandwidthBytes uint64 `json:"included_bandwidth_bytes"`
	MonthlyPriceInCents    uint64 `json:"monthly_price_in_cents"`
	Eligible               bool   `json:"eligible,omitempty"`
	// EligibilityReasons is included when Eligible is false, and indicates the
	// reasons why this tier is not available to the user.
	EligibilityReasons []string `json:"eligibility_reasons,omitempty"`
}

RegistrySubscriptionTier is a subscription tier for container registry.

type RegistrySubscriptionUpdateRequest added in v1.52.0

type RegistrySubscriptionUpdateRequest struct {
	TierSlug string `json:"tier_slug"`
}

RegistrySubscriptionUpdateRequest represents a request to update the subscription plan for a registry.

type RegistryValidateNameRequest added in v1.99.0

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

RegistryValidateNameRequest represents a request to validate that a container registry name is available for use.

type RemoteRoute added in v1.133.0

type RemoteRoute struct {
	// Cidr is the CIDR of the route
	Cidr string `json:"cidr,omitempty"`
}

RemoteRoute represents a route for a Partner Attachment.

type Repository added in v1.35.0

type Repository struct {
	RegistryName string         `json:"registry_name,omitempty"`
	Name         string         `json:"name,omitempty"`
	LatestTag    *RepositoryTag `json:"latest_tag,omitempty"`
	TagCount     uint64         `json:"tag_count,omitempty"`
}

Repository represents a repository

type RepositoryManifest added in v1.73.0

type RepositoryManifest struct {
	RegistryName        string    `json:"registry_name,omitempty"`
	Repository          string    `json:"repository,omitempty"`
	Digest              string    `json:"digest,omitempty"`
	CompressedSizeBytes uint64    `json:"compressed_size_bytes,omitempty"`
	SizeBytes           uint64    `json:"size_bytes,omitempty"`
	UpdatedAt           time.Time `json:"updated_at,omitempty"`
	Tags                []string  `json:"tags,omitempty"`
	Blobs               []*Blob   `json:"blobs,omitempty"`
}

RepositoryManifest represents a repository manifest

type RepositoryTag added in v1.35.0

type RepositoryTag struct {
	RegistryName        string    `json:"registry_name,omitempty"`
	Repository          string    `json:"repository,omitempty"`
	Tag                 string    `json:"tag,omitempty"`
	ManifestDigest      string    `json:"manifest_digest,omitempty"`
	CompressedSizeBytes uint64    `json:"compressed_size_bytes,omitempty"`
	SizeBytes           uint64    `json:"size_bytes,omitempty"`
	UpdatedAt           time.Time `json:"updated_at,omitempty"`
}

RepositoryTag represents a repository tag

type RepositoryV2 added in v1.73.0

type RepositoryV2 struct {
	RegistryName   string              `json:"registry_name,omitempty"`
	Name           string              `json:"name,omitempty"`
	TagCount       uint64              `json:"tag_count,omitempty"`
	ManifestCount  uint64              `json:"manifest_count,omitempty"`
	LatestManifest *RepositoryManifest `json:"latest_manifest,omitempty"`
}

RepositoryV2 represents a repository in the V2 format

type RequestCompletionCallback added in v0.9.0

type RequestCompletionCallback func(*http.Request, *http.Response)

RequestCompletionCallback defines the type of the request callback function

type ReservedIP added in v1.81.0

type ReservedIP struct {
	Region    *Region  `json:"region"`
	Droplet   *Droplet `json:"droplet"`
	IP        string   `json:"ip"`
	ProjectID string   `json:"project_id"`
	Locked    bool     `json:"locked"`
}

ReservedIP represents a Digital Ocean reserved IP.

func (ReservedIP) String added in v1.81.0

func (f ReservedIP) String() string

func (ReservedIP) URN added in v1.81.0

func (f ReservedIP) URN() string

URN returns the reserved IP in a valid DO API URN form.

type ReservedIPActionsService added in v1.81.0

type ReservedIPActionsService interface {
	Assign(ctx context.Context, ip string, dropletID int) (*Action, *Response, error)
	Unassign(ctx context.Context, ip string) (*Action, *Response, error)
	Get(ctx context.Context, ip string, actionID int) (*Action, *Response, error)
	List(ctx context.Context, ip string, opt *ListOptions) ([]Action, *Response, error)
}

ReservedIPActionsService is an interface for interfacing with the reserved IPs actions endpoints of the Digital Ocean API. See: https://docs.digitalocean.com/reference/api/api-reference/#tag/Reserved-IP-Actions

type ReservedIPActionsServiceOp added in v1.81.0

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

ReservedIPActionsServiceOp handles communication with the reserved IPs action related methods of the DigitalOcean API.

func (*ReservedIPActionsServiceOp) Assign added in v1.81.0

func (s *ReservedIPActionsServiceOp) Assign(ctx context.Context, ip string, dropletID int) (*Action, *Response, error)

Assign a reserved IP to a droplet.

func (*ReservedIPActionsServiceOp) Get added in v1.81.0

func (s *ReservedIPActionsServiceOp) Get(ctx context.Context, ip string, actionID int) (*Action, *Response, error)

Get an action for a particular reserved IP by id.

func (*ReservedIPActionsServiceOp) List added in v1.81.0

List the actions for a particular reserved IP.

func (*ReservedIPActionsServiceOp) Unassign added in v1.81.0

Unassign a rerserved IP from the droplet it is currently assigned to.

type ReservedIPCreateRequest added in v1.81.0

type ReservedIPCreateRequest struct {
	Region    string `json:"region,omitempty"`
	DropletID int    `json:"droplet_id,omitempty"`
	ProjectID string `json:"project_id,omitempty"`
}

ReservedIPCreateRequest represents a request to create a reserved IP. Specify DropletID to assign the reserved IP to a Droplet or Region to reserve it to the region.

type ReservedIPV6 added in v1.131.0

type ReservedIPV6 struct {
	RegionSlug string    `json:"region_slug"`
	IP         string    `json:"ip"`
	ReservedAt time.Time `json:"reserved_at"`
	Droplet    *Droplet  `json:"droplet,omitempty"`
}

ReservedIPV6 represents a Digital Ocean reserved IP.

func (ReservedIPV6) String added in v1.131.0

func (f ReservedIPV6) String() string

func (ReservedIPV6) URN added in v1.131.0

func (f ReservedIPV6) URN() string

URN returns the reserved IP in a valid DO API URN form.

type ReservedIPV6ActionsService added in v1.131.0

type ReservedIPV6ActionsService interface {
	Assign(ctx context.Context, ip string, dropletID int) (*Action, *Response, error)
	Unassign(ctx context.Context, ip string) (*Action, *Response, error)
}

ReservedIPActionsService is an interface for interfacing with the reserved IPs actions endpoints of the Digital Ocean API. See: https://docs.digitalocean.com/reference/api/api-reference/#tag/Reserved-IP-Actions

type ReservedIPV6ActionsServiceOp added in v1.131.0

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

ReservedIPActionsServiceOp handles communication with the reserved IPs action related methods of the DigitalOcean API.

func (*ReservedIPV6ActionsServiceOp) Assign added in v1.131.0

func (s *ReservedIPV6ActionsServiceOp) Assign(ctx context.Context, ip string, dropletID int) (*Action, *Response, error)

Assign a reserved IP to a droplet.

func (*ReservedIPV6ActionsServiceOp) Unassign added in v1.131.0

Unassign a rerserved IP from the droplet it is currently assigned to.

type ReservedIPV6CreateRequest added in v1.131.0

type ReservedIPV6CreateRequest struct {
	Region string `json:"region_slug,omitempty"`
}

ReservedIPV6CreateRequest represents a request to reserve a reserved IP.

type ReservedIPV6sService added in v1.131.0

ReservedIPV6sService is an interface for interfacing with the reserved IPV6s endpoints of the Digital Ocean API.

type ReservedIPV6sServiceOp added in v1.131.0

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

ReservedIPV6sServiceOp handles communication with the reserved IPs related methods of the DigitalOcean API.

func (*ReservedIPV6sServiceOp) Create added in v1.131.0

Create a new IPv6

func (*ReservedIPV6sServiceOp) Delete added in v1.131.0

func (r *ReservedIPV6sServiceOp) Delete(ctx context.Context, ip string) (*Response, error)

Delete a reserved IPv6.

func (*ReservedIPV6sServiceOp) Get added in v1.131.0

Get an individual reserved IPv6.

func (*ReservedIPV6sServiceOp) List added in v1.131.0

List all reserved IPV6s.

type ReservedIPsService added in v1.81.0

ReservedIPsService is an interface for interfacing with the reserved IPs endpoints of the Digital Ocean API. See: https://docs.digitalocean.com/reference/api/api-reference/#tag/Reserved-IPs

type ReservedIPsServiceOp added in v1.81.0

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

ReservedIPsServiceOp handles communication with the reserved IPs related methods of the DigitalOcean API.

func (*ReservedIPsServiceOp) Create added in v1.81.0

Create a reserved IP. If the DropletID field of the request is not empty, the reserved IP will also be assigned to the droplet.

func (*ReservedIPsServiceOp) Delete added in v1.81.0

func (r *ReservedIPsServiceOp) Delete(ctx context.Context, ip string) (*Response, error)

Delete a reserved IP.

func (*ReservedIPsServiceOp) Get added in v1.81.0

Get an individual reserved IP.

func (*ReservedIPsServiceOp) List added in v1.81.0

List all reserved IPs.

type ResetDatabasePasswordRequest added in v1.109.0

type ResetDatabasePasswordRequest struct {
	AppID         string `json:"app_id,omitempty"`
	ComponentName string `json:"component_name,omitempty"`
}

ResetDatabasePasswordRequest struct for ResetDatabasePasswordRequest

func (*ResetDatabasePasswordRequest) GetAppID added in v1.109.0

func (r *ResetDatabasePasswordRequest) GetAppID() string

GetAppID returns the AppID field.

func (*ResetDatabasePasswordRequest) GetComponentName added in v1.109.0

func (r *ResetDatabasePasswordRequest) GetComponentName() string

GetComponentName returns the ComponentName field.

type ResetDatabasePasswordResponse added in v1.109.0

type ResetDatabasePasswordResponse struct {
	Deployment *Deployment `json:"deployment,omitempty"`
}

ResetDatabasePasswordResponse struct for ResetDatabasePasswordResponse

func (*ResetDatabasePasswordResponse) GetDeployment added in v1.109.0

func (r *ResetDatabasePasswordResponse) GetDeployment() *Deployment

GetDeployment returns the Deployment field.

type Resource added in v1.0.0

type Resource struct {
	ID   string       `json:"resource_id,omitempty"`
	Type ResourceType `json:"resource_type,omitempty"`
}

Resource represent a single resource for associating/disassociating with tags

type ResourceType added in v1.0.0

type ResourceType string

ResourceType represents a class of resource, currently only droplet are supported

const (
	// DropletResourceType holds the string representing our ResourceType of Droplet.
	DropletResourceType ResourceType = "droplet"
	// ImageResourceType holds the string representing our ResourceType of Image.
	ImageResourceType ResourceType = "image"
	// VolumeResourceType holds the string representing our ResourceType of Volume.
	VolumeResourceType ResourceType = "volume"
	// LoadBalancerResourceType holds the string representing our ResourceType of LoadBalancer.
	LoadBalancerResourceType ResourceType = "load_balancer"
	// VolumeSnapshotResourceType holds the string representing our ResourceType for storage Snapshots.
	VolumeSnapshotResourceType ResourceType = "volume_snapshot"
	// DatabaseResourceType holds the string representing our ResourceType of Database.
	DatabaseResourceType ResourceType = "database"
)

type ResourceWithURN added in v1.6.0

type ResourceWithURN interface {
	URN() string
}

ResourceWithURN is an interface for interfacing with the types that implement the URN method.

type Response

type Response struct {
	*http.Response

	// Links that were returned with the response. These are parsed from
	// request body and not the header.
	Links *Links

	// Meta describes generic information about the response.
	Meta *Meta

	// Monitoring URI
	// Deprecated: This field is not populated. To poll for the status of a
	// newly created Droplet, use Links.Actions[0].HREF
	Monitor string

	Rate
}

Response is a DigitalOcean response. This wraps the standard http.Response returned from DigitalOcean.

type ResponseInputMessage added in v1.191.0

type ResponseInputMessage struct {
	Role    string `json:"role,omitempty"`
	Content string `json:"content"`
}

ResponseInputMessage is an input message for the Responses API.

type ResponseNewParams added in v1.191.0

type ResponseNewParams struct {
	Model           string                 `json:"model"`
	Input           interface{}            `json:"input"`
	Instructions    *string                `json:"instructions,omitempty"`
	MaxOutputTokens *int                   `json:"max_output_tokens,omitempty"`
	Metadata        map[string]string      `json:"metadata,omitempty"`
	Stop            json.RawMessage        `json:"stop,omitempty"`
	Stream          *bool                  `json:"stream,omitempty"`
	StreamOptions   *ResponseStreamOptions `json:"stream_options,omitempty"`
	Temperature     *float64               `json:"temperature,omitempty"`
	ToolChoice      json.RawMessage        `json:"tool_choice,omitempty"`
	Tools           []ResponseTool         `json:"tools,omitempty"`
	TopP            *float64               `json:"top_p,omitempty"`
	User            *string                `json:"user,omitempty"`
}

ResponseNewParams is the request body for POST /v1/responses. Input is a string, []ResponseInputMessage, or json.RawMessage. Stop and ToolChoice are json.RawMessage to accept either a string or a structured value.

type ResponseOutputContent added in v1.191.0

type ResponseOutputContent struct {
	Type string `json:"type"`
	Text string `json:"text,omitempty"`
}

ResponseOutputContent is a single content part inside a Responses output item.

type ResponseOutputItem added in v1.191.0

type ResponseOutputItem struct {
	Type      string                  `json:"type"`
	ID        string                  `json:"id,omitempty"`
	Role      *string                 `json:"role,omitempty"`
	Status    *string                 `json:"status,omitempty"`
	Content   []ResponseOutputContent `json:"content,omitempty"`
	CallID    *string                 `json:"call_id,omitempty"`
	Name      *string                 `json:"name,omitempty"`
	Arguments *string                 `json:"arguments,omitempty"`
}

ResponseOutputItem is a single output item in a Responses response.

type ResponseService added in v1.191.0

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

ResponseService exposes POST /v1/responses.

func (*ResponseService) New added in v1.191.0

New creates a non-streaming Responses API result.

func (*ResponseService) NewStreaming added in v1.191.0

func (s *ResponseService) NewStreaming(ctx context.Context, body *ResponseNewParams) (*ResponseStream, *Response, error)

NewStreaming opens an SSE stream of /v1/responses events; body.Stream is forced to true. Callers MUST Close the returned stream.

type ResponseStream added in v1.191.0

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

ResponseStream is a typed iterator over a /v1/responses SSE stream.

func (*ResponseStream) Close added in v1.191.0

func (s *ResponseStream) Close() error

Close releases the underlying HTTP response body. Always call Close.

func (*ResponseStream) Current added in v1.191.0

func (s *ResponseStream) Current() ResponseStreamEvent

Current returns the most recent event produced by Next.

func (*ResponseStream) Err added in v1.191.0

func (s *ResponseStream) Err() error

Err returns any non-EOF error encountered during iteration.

func (*ResponseStream) Next added in v1.191.0

func (s *ResponseStream) Next() bool

Next advances the stream to the next event. Returns false on EOF or error.

type ResponseStreamEvent added in v1.191.0

type ResponseStreamEvent struct {
	Type           string                 `json:"type"`
	SequenceNumber int                    `json:"sequence_number,omitempty"`
	OutputIndex    int                    `json:"output_index,omitempty"`
	ContentIndex   int                    `json:"content_index,omitempty"`
	ItemID         string                 `json:"item_id,omitempty"`
	Delta          string                 `json:"delta,omitempty"`
	Text           string                 `json:"text,omitempty"`
	Response       *ResponsesResponse     `json:"response,omitempty"`
	Item           *ResponseOutputItem    `json:"item,omitempty"`
	Part           *ResponseOutputContent `json:"part,omitempty"`
}

ResponseStreamEvent is one SSE event from /v1/responses (response.created, response.output_text.delta, response.output_text.done, response.completed, ...). Delta is populated on delta events; Text is populated on the matching .done event.

type ResponseStreamOptions added in v1.191.0

type ResponseStreamOptions struct {
	IncludeUsage *bool `json:"include_usage,omitempty"`
}

ResponseStreamOptions toggles streaming-only response options.

type ResponseTokensDetails added in v1.191.0

type ResponseTokensDetails struct {
	CachedTokens     int `json:"cached_tokens,omitempty"`
	ReasoningTokens  int `json:"reasoning_tokens,omitempty"`
	ToolOutputTokens int `json:"tool_output_tokens,omitempty"`
}

ResponseTokensDetails breaks input or output tokens into sub-categories.

type ResponseTool added in v1.191.0

type ResponseTool struct {
	Type        string                 `json:"type"`
	Name        string                 `json:"name,omitempty"`
	Description string                 `json:"description,omitempty"`
	Parameters  map[string]interface{} `json:"parameters,omitempty"`
}

ResponseTool is a tool definition for the Responses API.

type ResponseUsage added in v1.191.0

type ResponseUsage struct {
	InputTokens         int                   `json:"input_tokens"`
	OutputTokens        int                   `json:"output_tokens"`
	TotalTokens         int                   `json:"total_tokens"`
	InputTokensDetails  ResponseTokensDetails `json:"input_tokens_details"`
	OutputTokensDetails ResponseTokensDetails `json:"output_tokens_details"`
}

ResponseUsage holds usage statistics for a Responses API call.

type ResponsesResponse added in v1.191.0

type ResponsesResponse struct {
	ID                string               `json:"id"`
	Object            string               `json:"object"`
	Created           int64                `json:"created"`
	Model             string               `json:"model"`
	Output            []ResponseOutputItem `json:"output"`
	MaxOutputTokens   *int                 `json:"max_output_tokens,omitempty"`
	ParallelToolCalls *bool                `json:"parallel_tool_calls,omitempty"`
	Status            *string              `json:"status,omitempty"`
	Temperature       *float64             `json:"temperature,omitempty"`
	ToolChoice        json.RawMessage      `json:"tool_choice,omitempty"`
	Tools             []ResponseTool       `json:"tools,omitempty"`
	TopP              *float64             `json:"top_p,omitempty"`
	User              *string              `json:"user,omitempty"`
	Usage             ResponseUsage        `json:"usage"`
}

ResponsesResponse is the result of POST /v1/responses (named to avoid colliding with godo.Response). ToolChoice is json.RawMessage because the API echoes back a string or a structured object.

func (*ResponsesResponse) OutputText added in v1.191.0

func (r *ResponsesResponse) OutputText() string

OutputText concatenates every "output_text" content part across the response.

type RetryConfig added in v1.101.0

type RetryConfig struct {
	RetryMax     int
	RetryWaitMin *float64    // Minimum time to wait
	RetryWaitMax *float64    // Maximum time to wait
	Logger       interface{} // Customer logger instance. Must implement either go-retryablehttp.Logger or go-retryablehttp.LeveledLogger
}

RetryConfig sets the values used for enabling retries and backoffs for requests that fail with 429 or 500-level response codes using the go-retryablehttp client. RetryConfig.RetryMax must be configured to enable this behavior. RetryConfig.RetryWaitMin and RetryConfig.RetryWaitMax are optional, with the default values being 1.0 and 30.0, respectively.

You can use

godo.PtrTo(1.0)

to explicitly set the RetryWaitMin and RetryWaitMax values.

Note: Opting to use the go-retryablehttp client will overwrite any custom HTTP client passed into New(). Only the oauth2.TokenSource and Timeout will be maintained.

type RollbackVersionRequest added in v1.155.0

type RollbackVersionRequest struct {
	AgentUuid   string `json:"uuid,omitempty"`
	VersionHash string `json:"version_hash,omitempty"`
}

RollbackVersionRequest represents the request to rollback an Agent Platform Agent to a previous version

type Route added in v1.205.0

type Route struct {
	ID              string    `json:"id,omitempty"`
	Type            string    `json:"type,omitempty"`
	DestinationCIDR string    `json:"destination_cidr,omitempty"`
	TargetURNs      []string  `json:"target_urns,omitempty"`
	Modifiable      bool      `json:"modifiable,omitempty"`
	CreatedAt       time.Time `json:"created_at,omitempty"`
}

Route represents a DigitalOcean VPC or subnet-scoped route.

type RouteCreateRequest added in v1.205.0

type RouteCreateRequest struct {
	DestinationCIDR string   `json:"destination_cidr"`
	TargetURNs      []string `json:"target_urns"`
}

RouteCreateRequest represents a request to create a subnet-scoped static route.

type RouteUpdateRequest added in v1.205.0

type RouteUpdateRequest struct {
	TargetURNs []string `json:"target_urns"`
}

RouteUpdateRequest represents a request to update a subnet-scoped static route.

type RoutesService added in v1.205.0

type RoutesService interface {
	ListVPCRoutes(context.Context, string, *ListOptions) ([]*Route, *Response, error)
	ListSubnetRoutes(context.Context, string, string, *ListOptions) ([]*Route, *Response, error)
	CreateSubnetRoute(context.Context, string, string, *RouteCreateRequest) (*Route, *Response, error)
	UpdateSubnetRoute(context.Context, string, string, string, *RouteUpdateRequest) (*Route, *Response, error)
	DeleteSubnetRoute(context.Context, string, string, string) (*Response, error)
}

RoutesService is an interface for managing VPC and subnet scoped routes with the DigitalOcean API. See: https://docs.digitalocean.com/reference/api/api-reference/#tag/Routes

type RoutesServiceOp added in v1.205.0

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

RoutesServiceOp interfaces with Routes endpoints in the DigitalOcean API.

func (*RoutesServiceOp) CreateSubnetRoute added in v1.205.0

func (r *RoutesServiceOp) CreateSubnetRoute(ctx context.Context, vpcUUID, subnetUUID string, create *RouteCreateRequest) (*Route, *Response, error)

CreateSubnetRoute creates a customer-managed static route for a subnet.

func (*RoutesServiceOp) DeleteSubnetRoute added in v1.205.0

func (r *RoutesServiceOp) DeleteSubnetRoute(ctx context.Context, vpcUUID, subnetUUID, routeUUID string) (*Response, error)

DeleteSubnetRoute deletes a customer-managed static route for a subnet.

func (*RoutesServiceOp) ListSubnetRoutes added in v1.205.0

func (r *RoutesServiceOp) ListSubnetRoutes(ctx context.Context, vpcUUID, subnetUUID string, opt *ListOptions) ([]*Route, *Response, error)

ListSubnetRoutes lists routes for a subnet, including VPC-scoped routes propagated into the subnet's effective routing.

func (*RoutesServiceOp) ListVPCRoutes added in v1.205.0

func (r *RoutesServiceOp) ListVPCRoutes(ctx context.Context, vpcUUID string, opt *ListOptions) ([]*Route, *Response, error)

ListVPCRoutes lists VPC-scoped routes. Entries are read-only in the public API.

func (*RoutesServiceOp) UpdateSubnetRoute added in v1.205.0

func (r *RoutesServiceOp) UpdateSubnetRoute(ctx context.Context, vpcUUID, subnetUUID, routeUUID string, update *RouteUpdateRequest) (*Route, *Response, error)

UpdateSubnetRoute updates a customer-managed static route for a subnet.

type SSEEvent added in v1.191.0

type SSEEvent struct {
	Event string
	Data  []byte
	ID    string
	Retry int
}

SSEEvent is a dispatched Server-Sent Events event. Data is the joined value of all "data:" fields, separated by '\n', and is only valid until the next call to SSEReader.Next.

type SSEReader added in v1.191.0

type SSEReader struct {
	// OnComment, when set, is called with the text of each comment line
	// (after the leading ':' and one optional space). Comments are still
	// never dispatched as events; this only makes them observable, for
	// servers that carry out-of-band metadata on comment lines. The slice
	// is only valid for the duration of the call.
	OnComment func(comment []byte)
	// contains filtered or unexported fields
}

SSEReader parses a "text/event-stream" byte stream into SSEEvents. Bare-CR line terminators are not supported. Not safe for concurrent use.

func NewSSEReader added in v1.191.0

func NewSSEReader(r io.Reader) *SSEReader

NewSSEReader returns an SSEReader that reads from r.

func (*SSEReader) Next added in v1.191.0

func (s *SSEReader) Next() (*SSEEvent, error)

Next returns the next dispatched event, or io.EOF when the stream ends. A final event without a trailing blank line is dispatched on the call that hits EOF; the subsequent call returns io.EOF.

type Scan added in v1.175.0

type Scan struct {
	ID        string         `json:"id,omitempty"`
	Status    string         `json:"status,omitempty"`
	CreatedAt string         `json:"created_at,omitempty"`
	Findings  []*ScanFinding `json:"findings,omitempty"`
}

Scan represents a CSPM scan.

func (*Scan) Completed added in v1.175.0

func (s *Scan) Completed() bool

type ScanFinding added in v1.175.0

type ScanFinding struct {
	RuleUUID               string                `json:"rule_uuid,omitempty"`
	Name                   string                `json:"name,omitempty"`
	Details                string                `json:"details,omitempty"`
	FoundAt                string                `json:"found_at,omitempty"`
	Severity               string                `json:"severity,omitempty"`
	BusinessImpact         string                `json:"business_impact,omitempty"`
	TechnicalDetails       string                `json:"technical_details,omitempty"`
	MitigationSteps        []*ScanMitigationStep `json:"mitigation_steps,omitempty"`
	AffectedResourcesCount int                   `json:"affected_resources_count,omitempty"`
}

ScanFinding represents a finding within a scan.

type ScanFindingsOptions added in v1.175.0

type ScanFindingsOptions struct {
	ListOptions
	Type     string `url:"type,omitempty"`
	Severity string `url:"severity,omitempty"`
}

ScanFindingsOptions contains the query parameters for paginating and filtering scan findings.

type ScanMitigationStep added in v1.175.0

type ScanMitigationStep struct {
	Step        int    `json:"step,omitempty"`
	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
}

ScanMitigationStep represents a mitigation step for a scan finding.

type Scenario added in v1.206.0

type Scenario struct {
	ScenarioUUID      string   `json:"scenario_uuid,omitempty"`
	Name              string   `json:"name,omitempty"`
	Description       string   `json:"description,omitempty"`
	UserPersona       string   `json:"user_persona,omitempty"`
	StoppingCriteria  []string `json:"stopping_criteria,omitempty"`
	MaxTurns          uint32   `json:"max_turns,omitempty"`
	ExplorationBudget uint32   `json:"exploration_budget,omitempty"`
}

Scenario is a single unit of what to test within a scenario set.

type ScenarioLibraryEntry added in v1.206.0

type ScenarioLibraryEntry struct {
	LibraryScenarioUUID string                     `json:"library_scenario_uuid,omitempty"`
	Name                string                     `json:"name,omitempty"`
	Description         string                     `json:"description,omitempty"`
	GoalDescription     string                     `json:"goal_description,omitempty"`
	Category            string                     `json:"category,omitempty"`
	ScenarioCount       uint32                     `json:"scenario_count,omitempty"`
	Status              ScenarioLibraryEntryStatus `json:"status,omitempty"`
	CreatedAt           *Timestamp                 `json:"created_at,omitempty"`
	UpdatedAt           *Timestamp                 `json:"updated_at,omitempty"`
}

ScenarioLibraryEntry is a platform-curated scenario set from the common library.

type ScenarioLibraryEntryStatus added in v1.206.0

type ScenarioLibraryEntryStatus string

ScenarioLibraryEntryStatus is the lifecycle status of a scenario library entry.

const (
	ScenarioLibraryEntryStatusUnspecified ScenarioLibraryEntryStatus = "SCENARIO_LIBRARY_ENTRY_STATUS_UNSPECIFIED"
	ScenarioLibraryEntryStatusActive      ScenarioLibraryEntryStatus = "SCENARIO_LIBRARY_ENTRY_STATUS_ACTIVE"
	ScenarioLibraryEntryStatusArchived    ScenarioLibraryEntryStatus = "SCENARIO_LIBRARY_ENTRY_STATUS_ARCHIVED"
)

type ScenarioLibraryListOptions added in v1.206.0

type ScenarioLibraryListOptions struct {
	Category      string                   `url:"category,omitempty"`
	Search        string                   `url:"search,omitempty"`
	SortBy        ScenarioLibrarySortField `url:"sort_by,omitempty"`
	SortDirection GenAISortDirection       `url:"sort_direction,omitempty"`
	ListOptions
}

ScenarioLibraryListOptions specifies optional parameters for listing the scenario library.

type ScenarioLibraryListResponse added in v1.206.0

type ScenarioLibraryListResponse struct {
	Scenarios               []*ScenarioLibraryEntry    `json:"scenarios,omitempty"`
	Links                   *Links                     `json:"links,omitempty"`
	Meta                    *Meta                      `json:"meta,omitempty"`
	AvailableCategories     []string                   `json:"available_categories,omitempty"`
	AvailableSortBy         []ScenarioLibrarySortField `json:"available_sort_by,omitempty"`
	AvailableSortDirections []GenAISortDirection       `json:"available_sort_directions,omitempty"`
}

ScenarioLibraryListResponse is returned by ListScenarioLibrary.

type ScenarioLibrarySortField added in v1.206.0

type ScenarioLibrarySortField string

ScenarioLibrarySortField is a sortable field for ListScenarioLibrary.

const (
	ScenarioLibrarySortFieldUnspecified ScenarioLibrarySortField = "SCENARIO_LIBRARY_SORT_FIELD_UNSPECIFIED"
	ScenarioLibrarySortFieldName        ScenarioLibrarySortField = "SCENARIO_LIBRARY_SORT_FIELD_NAME"
	ScenarioLibrarySortFieldCreatedAt   ScenarioLibrarySortField = "SCENARIO_LIBRARY_SORT_FIELD_CREATED_AT"
)

type ScenarioListOptions added in v1.206.0

type ScenarioListOptions struct {
	Search        string             `url:"search,omitempty"`
	SortBy        ScenarioSortField  `url:"sort_by,omitempty"`
	SortDirection GenAISortDirection `url:"sort_direction,omitempty"`
	ListOptions
}

ScenarioListOptions specifies optional parameters for listing scenarios.

type ScenarioListResponse added in v1.206.0

type ScenarioListResponse struct {
	Scenarios               []*Scenario          `json:"scenarios,omitempty"`
	Links                   *Links               `json:"links,omitempty"`
	Meta                    *Meta                `json:"meta,omitempty"`
	AvailableSortBy         []ScenarioSortField  `json:"available_sort_by,omitempty"`
	AvailableSortDirections []GenAISortDirection `json:"available_sort_directions,omitempty"`
}

ScenarioListResponse is returned by ListScenarios and ListScenarioLibraryScenarios.

type ScenarioSet added in v1.206.0

type ScenarioSet struct {
	ScenarioSetUUID       string                `json:"scenario_set_uuid,omitempty"`
	Name                  string                `json:"name,omitempty"`
	Description           string                `json:"description,omitempty"`
	Status                ScenarioSetStatus     `json:"status,omitempty"`
	SourceKind            ScenarioSetSourceKind `json:"source_kind,omitempty"`
	ScenarioCount         uint32                `json:"scenario_count,omitempty"`
	BucketName            string                `json:"bucket_name,omitempty"`
	BucketRegion          string                `json:"bucket_region,omitempty"`
	SpacesKey             string                `json:"spaces_key,omitempty"`
	FailureReason         string                `json:"failure_reason,omitempty"`
	SourceGoalDescription string                `json:"source_goal_description,omitempty"`
	GeneratorModelUUID    string                `json:"generator_model_uuid,omitempty"`
	WorkflowUUID          string                `json:"workflow_uuid,omitempty"`
	LibraryScenarioUUID   string                `json:"library_scenario_uuid,omitempty"`
	SourceExportID        string                `json:"source_export_id,omitempty"`
	CreatedAt             *Timestamp            `json:"created_at,omitempty"`
	UpdatedAt             *Timestamp            `json:"updated_at,omitempty"`
	DeletedAt             *Timestamp            `json:"deleted_at,omitempty"`
}

ScenarioSet is a team-owned pool of scenarios backed by a canonical JSONL file.

type ScenarioSetDeleteResponse added in v1.206.0

type ScenarioSetDeleteResponse struct {
	ScenarioSetUUID string `json:"scenario_set_uuid,omitempty"`
}

ScenarioSetDeleteResponse is returned by DeleteScenarioSet.

type ScenarioSetDownloadURLResponse added in v1.206.0

type ScenarioSetDownloadURLResponse struct {
	DownloadURL string     `json:"download_url,omitempty"`
	ExpiresAt   *Timestamp `json:"expires_at,omitempty"`
}

ScenarioSetDownloadURLResponse is returned by GetScenarioSetDownloadURL.

type ScenarioSetListOptions added in v1.206.0

type ScenarioSetListOptions struct {
	Statuses      []ScenarioSetStatus     `url:"statuses,omitempty"`
	SourceKinds   []ScenarioSetSourceKind `url:"source_kinds,omitempty"`
	Search        string                  `url:"search,omitempty"`
	SortBy        ScenarioSetSortField    `url:"sort_by,omitempty"`
	SortDirection GenAISortDirection      `url:"sort_direction,omitempty"`
	ListOptions
}

ScenarioSetListOptions specifies optional parameters for listing scenario sets.

type ScenarioSetListResponse added in v1.206.0

type ScenarioSetListResponse struct {
	ScenarioSets            []*ScenarioSet          `json:"scenario_sets,omitempty"`
	Links                   *Links                  `json:"links,omitempty"`
	Meta                    *Meta                   `json:"meta,omitempty"`
	AvailableStatuses       []ScenarioSetStatus     `json:"available_statuses,omitempty"`
	AvailableSourceKinds    []ScenarioSetSourceKind `json:"available_source_kinds,omitempty"`
	AvailableSortBy         []ScenarioSetSortField  `json:"available_sort_by,omitempty"`
	AvailableSortDirections []GenAISortDirection    `json:"available_sort_directions,omitempty"`
}

ScenarioSetListResponse is returned by ListScenarioSets.

type ScenarioSetSortField added in v1.206.0

type ScenarioSetSortField string

ScenarioSetSortField is a sortable field for ListScenarioSets.

const (
	ScenarioSetSortFieldUnspecified   ScenarioSetSortField = "SCENARIO_SET_SORT_FIELD_UNSPECIFIED"
	ScenarioSetSortFieldCreatedAt     ScenarioSetSortField = "SCENARIO_SET_SORT_FIELD_CREATED_AT"
	ScenarioSetSortFieldName          ScenarioSetSortField = "SCENARIO_SET_SORT_FIELD_NAME"
	ScenarioSetSortFieldStatus        ScenarioSetSortField = "SCENARIO_SET_SORT_FIELD_STATUS"
	ScenarioSetSortFieldScenarioCount ScenarioSetSortField = "SCENARIO_SET_SORT_FIELD_SCENARIO_COUNT"
	ScenarioSetSortFieldUpdatedAt     ScenarioSetSortField = "SCENARIO_SET_SORT_FIELD_UPDATED_AT"
)

type ScenarioSetSourceKind added in v1.206.0

type ScenarioSetSourceKind string

ScenarioSetSourceKind describes how a scenario set was created.

const (
	ScenarioSetSourceKindUnspecified     ScenarioSetSourceKind = "SCENARIO_SET_SOURCE_KIND_UNSPECIFIED"
	ScenarioSetSourceKindUserUpload      ScenarioSetSourceKind = "SCENARIO_SET_SOURCE_KIND_USER_UPLOAD"
	ScenarioSetSourceKindGoalGenerated   ScenarioSetSourceKind = "SCENARIO_SET_SOURCE_KIND_GOAL_GENERATED"
	ScenarioSetSourceKindLibrary         ScenarioSetSourceKind = "SCENARIO_SET_SOURCE_KIND_LIBRARY"
	ScenarioSetSourceKindSignalGenerated ScenarioSetSourceKind = "SCENARIO_SET_SOURCE_KIND_SIGNAL_GENERATED"
)

type ScenarioSetStatus added in v1.206.0

type ScenarioSetStatus string

ScenarioSetStatus is the lifecycle status of a scenario set.

const (
	ScenarioSetStatusUnspecified ScenarioSetStatus = "SCENARIO_SET_STATUS_UNSPECIFIED"
	ScenarioSetStatusGenerating  ScenarioSetStatus = "SCENARIO_SET_STATUS_GENERATING"
	ScenarioSetStatusReady       ScenarioSetStatus = "SCENARIO_SET_STATUS_READY"
	ScenarioSetStatusFailed      ScenarioSetStatus = "SCENARIO_SET_STATUS_FAILED"
	ScenarioSetStatusCancelled   ScenarioSetStatus = "SCENARIO_SET_STATUS_CANCELLED"
)

type ScenarioSortField added in v1.206.0

type ScenarioSortField string

ScenarioSortField is a sortable field for ListScenarios.

const (
	ScenarioSortFieldUnspecified ScenarioSortField = "SCENARIO_SORT_FIELD_UNSPECIFIED"
	ScenarioSortFieldFileOrder   ScenarioSortField = "SCENARIO_SORT_FIELD_FILE_ORDER"
	ScenarioSortFieldName        ScenarioSortField = "SCENARIO_SORT_FIELD_NAME"
	ScenarioSortFieldDescription ScenarioSortField = "SCENARIO_SORT_FIELD_DESCRIPTION"
)

type Secret added in v1.197.0

type Secret struct {
	Name              string            `json:"secret"`
	Region            string            `json:"region,omitempty"`
	Version           int               `json:"version"`
	Values            map[string]string `json:"values,omitempty"`
	CreatedAt         string            `json:"created_at"`
	UpdatedAt         string            `json:"updated_at,omitempty"`
	DeleteRequestedAt *string           `json:"delete_requested_at,omitempty"`
}

Secret represents a DigitalOcean secret.

type SecretCreateRequest added in v1.197.0

type SecretCreateRequest struct {
	Name   string            `json:"name"`
	Region string            `json:"region"`
	Values map[string]string `json:"values"`
}

SecretCreateRequest represents a request to create a secret.

type SecretUpdateRequest added in v1.197.0

type SecretUpdateRequest struct {
	Region  string            `json:"region"`
	Version int               `json:"version"`
	Values  map[string]string `json:"values"`
}

SecretUpdateRequest represents a request to update a secret.

type SecretVersion added in v1.197.0

type SecretVersion struct {
	Version   int    `json:"version"`
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at,omitempty"`
}

SecretVersion represents a version of a secret.

type SecretWriteResult added in v1.197.0

type SecretWriteResult struct {
	Name    string `json:"name"`
	Region  string `json:"region"`
	Version int    `json:"version"`
}

SecretWriteResult represents the response from creating or updating a secret.

type SecretsList added in v1.197.0

type SecretsList struct {
	Secrets            []*Secret
	UnavailableRegions []string
}

SecretsList holds the result of a list secrets request.

type SecretsService added in v1.197.0

SecretsService is an interface for interacting with the Secrets endpoints of the DigitalOcean API.

type SecretsServiceOp added in v1.197.0

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

SecretsServiceOp handles communication with Secrets related methods of the DigitalOcean API.

func (*SecretsServiceOp) Create added in v1.197.0

Create creates a new secret.

func (*SecretsServiceOp) Delete added in v1.197.0

func (s *SecretsServiceOp) Delete(ctx context.Context, name, region string) (*Response, error)

Delete schedules a secret for soft deletion.

func (*SecretsServiceOp) Get added in v1.197.0

func (s *SecretsServiceOp) Get(ctx context.Context, name, region string) (*Secret, *Response, error)

Get retrieves a secret by name and region.

func (*SecretsServiceOp) List added in v1.197.0

List returns a paginated list of secrets across all regions.

func (*SecretsServiceOp) ListVersions added in v1.197.0

func (s *SecretsServiceOp) ListVersions(ctx context.Context, name, region string) ([]*SecretVersion, *Response, error)

ListVersions returns all versions of a secret.

func (*SecretsServiceOp) Restore added in v1.197.0

func (s *SecretsServiceOp) Restore(ctx context.Context, name, region string) (*Response, error)

Restore restores a secret that was scheduled for deletion.

func (*SecretsServiceOp) Update added in v1.197.0

func (s *SecretsServiceOp) Update(ctx context.Context, name string, updateRequest *SecretUpdateRequest) (*SecretWriteResult, *Response, error)

Update updates an existing secret.

type SecurityService added in v1.175.0

type SecurityService interface {
	CreateScan(context.Context, *CreateScanRequest) (*Scan, *Response, error)
	ListScans(context.Context, *ListOptions) ([]*Scan, *Response, error)
	GetScan(context.Context, string, *ScanFindingsOptions) (*Scan, *Response, error)
	GetLatestScan(context.Context, *ScanFindingsOptions) (*Scan, *Response, error)
	ListFindingAffectedResources(context.Context, *ListFindingAffectedResourcesRequest, *ListOptions) ([]*AffectedResource, *Response, error)
}

SecurityService is an interface for interacting with the CSPM endpoints of the DigitalOcean API.

type SecurityServiceOp added in v1.175.0

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

SecurityServiceOp handles communication with security scan related methods of the DigitalOcean API.

func (*SecurityServiceOp) CreateScan added in v1.175.0

func (s *SecurityServiceOp) CreateScan(ctx context.Context, createScanRequest *CreateScanRequest) (*Scan, *Response, error)

CreateScan initiates a new CSPM scan.

func (*SecurityServiceOp) GetLatestScan added in v1.175.0

func (s *SecurityServiceOp) GetLatestScan(ctx context.Context, opts *ScanFindingsOptions) (*Scan, *Response, error)

GetLatestScan retrieves the latest scan with optional findings filters.

func (*SecurityServiceOp) GetScan added in v1.175.0

func (s *SecurityServiceOp) GetScan(ctx context.Context, scanUUID string, opts *ScanFindingsOptions) (*Scan, *Response, error)

GetScan retrieves a scan by its UUID with optional findings filters.

func (*SecurityServiceOp) ListFindingAffectedResources added in v1.175.0

func (s *SecurityServiceOp) ListFindingAffectedResources(ctx context.Context, listFindingAffectedResourcesRequest *ListFindingAffectedResourcesRequest, opts *ListOptions) ([]*AffectedResource, *Response, error)

ListFindingAffectedResources lists the affected resources for a scan finding.

func (*SecurityServiceOp) ListScans added in v1.175.0

func (s *SecurityServiceOp) ListScans(ctx context.Context, opts *ListOptions) ([]*Scan, *Response, error)

ListScans lists all CSPM scans.

type ServiceAddress added in v1.110.0

type ServiceAddress struct {
	Host string `json:"host"`
	Port int    `json:"port"`
}

ServiceAddress represents a host:port for a generic service (e.g. metrics endpoint)

type ServiceKey added in v1.133.0

type ServiceKey struct {
	Value     string    `json:"value,omitempty"`
	State     string    `json:"state,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`
}

ServiceKey represents the service key of a Partner Attachment.

type ServingProtocol added in v1.128.0

type ServingProtocol string

ServingProtocol - HTTP: The app is serving the HTTP protocol. Default. - HTTP2: The app is serving the HTTP/2 protocol. Currently, this needs to be implemented in the service by serving HTTP/2 with prior knowledge.

const (
	SERVINGPROTOCOL_HTTP  ServingProtocol = "HTTP"
	SERVINGPROTOCOL_HTTP2 ServingProtocol = "HTTP2"
)

List of ServingProtocol

type SignalsAgentConsent added in v1.218.0

type SignalsAgentConsent struct {
	TeamID    int64  `json:"team_id"`
	Source    string `json:"source,omitempty"`
	AgentID   string `json:"agent_id"`
	Enabled   bool   `json:"enabled"`
	ID        int64  `json:"id,omitempty"`
	UpdatedAt string `json:"updated_at,omitempty"`
}

SignalsAgentConsent is GET /v1/consent/{agent_id} (consent-gateway). enabled is the only customer-facing consent toggle; allowed is an internal check-endpoint concept and is not returned on this public route.

type SignalsConsentRecord added in v1.218.0

type SignalsConsentRecord struct {
	ID        int64  `json:"id"`
	TeamID    int64  `json:"team_id"`
	Source    string `json:"source,omitempty"`
	AgentID   string `json:"agent_id"`
	Enabled   bool   `json:"enabled"`
	UpdatedAt string `json:"updated_at,omitempty"`
}

SignalsConsentRecord is a consents row as returned by PUT /v1/consent/{agent_id} and PUT /v1/consent?source=inference. Source is "agent" or "inference"; AgentID is empty for inference (team-level) rows.

type SignalsCreateDeletionRequest added in v1.221.0

type SignalsCreateDeletionRequest struct {
	// Type is SignalsDeletionTypeAgent or SignalsDeletionTypeInference.
	// Required by the server (omitting type is 400). godo also requires it so a
	// missing AgentID can never be mistaken for a team-wide inference deletion.
	Type string `json:"type"`
	// TeamID is the numeric team id; it must match the authenticated team.
	TeamID int64 `json:"team_id"`
	// AgentID is required for agent and must be empty for inference.
	// Omitted from the JSON body when empty.
	AgentID string `json:"agent_id,omitempty"`
}

SignalsCreateDeletionRequest is the body for POST /v1/signals/deletions. JSON keys match CreateDeletionRequest in signals-api OpenAPI: required type + team_id; agent_id only for agent (omit for inference).

type SignalsCreateExportRequest added in v1.218.0

type SignalsCreateExportRequest struct {
	AgentID string `json:"agent_id"`
	// SessionIDs optionally narrows the export to a session cohort (OR within
	// the list). Omit or leave empty to export all sessions owned by the team.
	SessionIDs []string `json:"session_ids,omitempty"`
	SignalType []string `json:"signal_type,omitempty"`
	StartTime  *int64   `json:"start_time,omitempty"`
	EndTime    *int64   `json:"end_time,omitempty"`
}

SignalsCreateExportRequest is the body for POST /v1/signals/exports.

type SignalsCursorPageOptions added in v1.218.0

type SignalsCursorPageOptions struct {
	Limit int    `url:"limit,omitempty"`
	After string `url:"after,omitempty"`
}

SignalsCursorPageOptions is shared limit/after paging.

type SignalsDeletionEdge added in v1.221.0

type SignalsDeletionEdge struct {
	Cursor string             `json:"cursor"`
	Node   SignalsDeletionJob `json:"node"`
}

SignalsDeletionEdge is one edge in a deletion list.

type SignalsDeletionJob added in v1.221.0

type SignalsDeletionJob struct {
	TeamID       int64   `json:"team_id"`
	DeletionID   string  `json:"deletion_id"`
	Type         string  `json:"type"`
	AgentID      string  `json:"agent_id,omitempty"`
	Status       string  `json:"status"`
	ErrorMessage *string `json:"error_message"`
	CreatedAt    int64   `json:"created_at"`
	StartedAt    *int64  `json:"started_at"`
	CompletedAt  *int64  `json:"completed_at"`
}

SignalsDeletionJob is one deletion job (POST/GET /v1/signals/deletions...). Wire shape matches DeletionJob: team_id, deletion_id, type, agent_id (omitted for inference), status, error_message, created_at, started_at, completed_at. Timestamps are Unix seconds UTC. Status/Type are plain strings so new server-side values keep decoding.

type SignalsDialogue added in v1.218.0

type SignalsDialogue struct {
	ID          int64             `json:"id"`
	RunID       string            `json:"run_id"`
	CreatedAt   string            `json:"created_at"`
	Sequence    int               `json:"sequence"`
	UserMessage string            `json:"user_message"`
	Steps       []json.RawMessage `json:"steps"`
	RunStatus   string            `json:"run_status"`
	FailureCode *string           `json:"failure_code,omitempty"`
}

SignalsDialogue is one user/assistant turn.

type SignalsExportDownload added in v1.218.0

type SignalsExportDownload struct {
	DownloadURL string `json:"download_url"`
	ExpiresAt   int64  `json:"expires_at"`
}

SignalsExportDownload is GET /exports/{export_id}/download.

type SignalsExportEdge added in v1.218.0

type SignalsExportEdge struct {
	Cursor string           `json:"cursor"`
	Node   SignalsExportJob `json:"node"`
}

SignalsExportEdge is one edge in an export list.

type SignalsExportFilterOptions added in v1.218.0

type SignalsExportFilterOptions struct {
	SignalType []string `json:"signal_type"`
}

SignalsExportFilterOptions is the static detector catalog.

type SignalsExportFilters added in v1.218.0

type SignalsExportFilters struct {
	SessionIDs     []string `json:"session_ids,omitempty"`
	SignalType     []string `json:"signal_type,omitempty"`
	SignalCategory string   `json:"signal_category,omitempty"`
	SignalLayer    string   `json:"signal_layer,omitempty"`
	Concerning     *bool    `json:"concerning,omitempty"`
	StartTime      *int64   `json:"start_time,omitempty"`
	EndTime        *int64   `json:"end_time,omitempty"`
}

SignalsExportFilters is the snapshot stored on an export job.

type SignalsExportJob added in v1.218.0

type SignalsExportJob struct {
	ExportID     string               `json:"export_id"`
	AgentID      string               `json:"agent_id,omitempty"`
	Status       string               `json:"status"`
	Filters      SignalsExportFilters `json:"filters"`
	CreatedAt    int64                `json:"created_at"`
	CompletedAt  *int64               `json:"completed_at,omitempty"`
	ErrorMessage *string              `json:"error_message,omitempty"`
	ExpiresAt    *int64               `json:"expires_at,omitempty"`
}

SignalsExportJob is GET /exports/{export_id} (and list nodes).

type SignalsExportOptions added in v1.218.0

type SignalsExportOptions struct {
	Filters SignalsExportFilterOptions `json:"filters"`
}

SignalsExportOptions is GET /exports/options.

type SignalsInstance added in v1.218.0

type SignalsInstance struct {
	SignalType string  `json:"signal_type"`
	Label      string  `json:"label"`
	RunUUID    string  `json:"run_uuid"`
	StepIndex  int     `json:"step_index"`
	Confidence float64 `json:"confidence"`
	Snippet    *string `json:"snippet,omitempty"`
	Layer      string  `json:"layer"`
	Category   string  `json:"category"`
}

SignalsInstance is one detector hit on a dialogue.

type SignalsListAgentSessionsOptions added in v1.218.0

type SignalsListAgentSessionsOptions struct {
	SignalsCursorPageOptions
	StartTime  *int64   `url:"start_time,omitempty"`
	EndTime    *int64   `url:"end_time,omitempty"`
	SignalType []string `url:"signal_type,omitempty"`
}

SignalsListAgentSessionsOptions are query params for GET /agents/{id}/sessions.

type SignalsListAgentSessionsResponse added in v1.218.0

type SignalsListAgentSessionsResponse struct {
	Edges    []SignalsSessionEdge `json:"edges"`
	PageInfo SignalsPageInfo      `json:"page_info"`
}

SignalsListAgentSessionsResponse is GET /agents/{agent_id}/sessions.

type SignalsListConsentsOptions added in v1.223.0

type SignalsListConsentsOptions struct {
	// Source restricts the listing to one consent source ("agent" or
	// "inference"). Empty returns all sources.
	Source string `url:"source,omitempty"`
}

SignalsListConsentsOptions filters GET /v1/consent.

type SignalsListConsentsResponse added in v1.218.0

type SignalsListConsentsResponse struct {
	TeamID   int64                  `json:"team_id"`
	Source   string                 `json:"source,omitempty"`
	Consents []SignalsConsentRecord `json:"consents"`
}

SignalsListConsentsResponse is GET /v1/consent (consent-gateway). Source is echoed back when the listing was filtered by source.

type SignalsListDeletionsOptions added in v1.221.0

type SignalsListDeletionsOptions struct {
	SignalsCursorPageOptions
}

SignalsListDeletionsOptions are query params for GET /v1/signals/deletions.

type SignalsListDeletionsResponse added in v1.221.0

type SignalsListDeletionsResponse struct {
	Edges    []SignalsDeletionEdge `json:"edges"`
	PageInfo SignalsPageInfo       `json:"page_info"`
}

SignalsListDeletionsResponse is GET /v1/signals/deletions.

type SignalsListDialoguesOptions added in v1.218.0

type SignalsListDialoguesOptions struct {
	SignalsCursorPageOptions
	Before          string   `url:"before,omitempty"`
	ContinueSession bool     `url:"continue_session,omitempty"`
	SignalType      []string `url:"signal_type,omitempty"`
	StartTime       *int64   `url:"start_time,omitempty"`
	EndTime         *int64   `url:"end_time,omitempty"`
}

SignalsListDialoguesOptions are query params for GET /sessions/{id}/dialogues.

type SignalsListExportsOptions added in v1.218.0

type SignalsListExportsOptions struct {
	SignalsCursorPageOptions
	AgentID string `url:"agent_id,omitempty"`
}

SignalsListExportsOptions are query params for GET /exports.

type SignalsListExportsResponse added in v1.218.0

type SignalsListExportsResponse struct {
	Edges    []SignalsExportEdge `json:"edges"`
	PageInfo SignalsPageInfo     `json:"page_info"`
}

SignalsListExportsResponse is GET /exports.

type SignalsPageInfo added in v1.218.0

type SignalsPageInfo struct {
	HasNextPage bool   `json:"has_next_page"`
	HasPrevPage bool   `json:"has_prev_page,omitempty"`
	StartCursor string `json:"start_cursor,omitempty"`
	EndCursor   string `json:"end_cursor,omitempty"`
}

SignalsPageInfo is Relay-style cursor paging from signals-api.

type SignalsService added in v1.218.0

type SignalsService interface {
	ListConsents(context.Context) (*SignalsListConsentsResponse, *Response, error)
	ListConsentsWithOptions(context.Context, *SignalsListConsentsOptions) (*SignalsListConsentsResponse, *Response, error)
	GetAgentConsent(context.Context, string) (*SignalsAgentConsent, *Response, error)
	SetAgentConsent(context.Context, string, bool) (*SignalsConsentRecord, *Response, error)
	GetInferenceConsent(context.Context) (*SignalsConsentRecord, *Response, error)
	SetInferenceConsent(context.Context, bool) (*SignalsConsentRecord, *Response, error)
	ListAgentSessions(context.Context, string, *SignalsListAgentSessionsOptions) (*SignalsListAgentSessionsResponse, *Response, error)
	ListSessionDialogues(context.Context, string, *SignalsListDialoguesOptions) (*SignalsSessionDialoguesResponse, *Response, error)
	CreateExport(context.Context, *SignalsCreateExportRequest) (*SignalsExportJob, *Response, error)
	ListExports(context.Context, *SignalsListExportsOptions) (*SignalsListExportsResponse, *Response, error)
	GetExport(context.Context, string) (*SignalsExportJob, *Response, error)
	GetExportDownload(context.Context, string) (*SignalsExportDownload, *Response, error)
	GetExportOptions(context.Context) (*SignalsExportOptions, *Response, error)
	CreateDeletion(context.Context, *SignalsCreateDeletionRequest) (*SignalsDeletionJob, *Response, error)
	GetDeletion(context.Context, string) (*SignalsDeletionJob, *Response, error)
	ListDeletions(context.Context, *SignalsListDeletionsOptions) (*SignalsListDeletionsResponse, *Response, error)
}

SignalsService is the MCP v1 client: GETs on /v1/signals plus consent enable/disable on /v1/consent (consent-gateway), and on-demand data deletion jobs on /v1/signals/deletions.

type SignalsServiceOp added in v1.218.0

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

SignalsServiceOp communicates with the Signals consumption API.

func (*SignalsServiceOp) CreateDeletion added in v1.221.0

CreateDeletion starts an on-demand data deletion job (POST /v1/signals/deletions).

Status codes from the server:

  • 202 — new job created (queued)
  • 200 — active job for the same fingerprint reused (queued/running)
  • 400 — invalid body (type/agent_id rules, unknown fields, bad UUID)
  • 401 — missing team auth
  • 403 — body team_id does not match authenticated team
  • 404 — agent unknown for this team
  • 429 — too many active deletion jobs for this team (inflight cap)
  • 500 — internal error

Check Response.StatusCode to tell 200 vs 202 apart. For SignalsDeletionTypeAgent AgentID is required; for SignalsDeletionTypeInference it must be empty (and is omitted from JSON).

If the client retries requests (for example one built with WithRetryAndBackoffs), a repeated POST while the first job is still active returns that same job, but a repeat after the first job has finished starts a new job.

func (*SignalsServiceOp) CreateExport added in v1.218.0

CreateExport starts a bulk signal export job (POST /v1/signals/exports). The create is idempotent: if an active export already exists for the same parameters the server returns it instead of creating a duplicate.

func (*SignalsServiceOp) GetAgentConsent added in v1.218.0

func (s *SignalsServiceOp) GetAgentConsent(ctx context.Context, agentID string) (*SignalsAgentConsent, *Response, error)

GetAgentConsent returns collection consent for one agent (default deny if no row). Uses GET /v1/consent/{agent_id} on consent-gateway (same public path as Cloud UI / SetAgentConsent).

func (*SignalsServiceOp) GetDeletion added in v1.221.0

func (s *SignalsServiceOp) GetDeletion(ctx context.Context, deletionID string) (*SignalsDeletionJob, *Response, error)

GetDeletion returns one deletion job (GET /v1/signals/deletions/{deletion_id}). The server returns 404 both for unknown ids and for jobs owned by another team (and for path values that are not storable, e.g. "." / "..").

func (*SignalsServiceOp) GetExport added in v1.218.0

func (s *SignalsServiceOp) GetExport(ctx context.Context, exportID string) (*SignalsExportJob, *Response, error)

GetExport polls one export job.

func (*SignalsServiceOp) GetExportDownload added in v1.218.0

func (s *SignalsServiceOp) GetExportDownload(ctx context.Context, exportID string) (*SignalsExportDownload, *Response, error)

GetExportDownload returns a 15-minute Spaces presign for a completed export.

func (*SignalsServiceOp) GetExportOptions added in v1.218.0

func (s *SignalsServiceOp) GetExportOptions(ctx context.Context) (*SignalsExportOptions, *Response, error)

GetExportOptions returns the static signal_type catalog.

func (*SignalsServiceOp) GetInferenceConsent added in v1.223.0

func (s *SignalsServiceOp) GetInferenceConsent(ctx context.Context) (*SignalsConsentRecord, *Response, error)

GetInferenceConsent returns the team-level consent for serverless inference traffic. There is at most one such row per team; when none exists the returned record has Enabled=false and ID=0 (default deny), mirroring GetAgentConsent. Uses GET /v1/consent?source=inference.

func (*SignalsServiceOp) ListAgentSessions added in v1.218.0

ListAgentSessions lists sessions for an agent.

func (*SignalsServiceOp) ListConsents added in v1.218.0

ListConsents returns all consent records (every source) for the authenticated team. Uses GET /v1/consent on consent-gateway.

func (*SignalsServiceOp) ListConsentsWithOptions added in v1.223.0

ListConsentsWithOptions returns consent records for the authenticated team, optionally filtered by source. Uses GET /v1/consent[?source=...].

func (*SignalsServiceOp) ListDeletions added in v1.221.0

ListDeletions lists deletion jobs for the team, newest first (GET /v1/signals/deletions). Limit and After are passed through. When Limit is 0 the server uses its default page size (20) and it caps larger values at 100. Invalid After cursors return 400.

func (*SignalsServiceOp) ListExports added in v1.218.0

ListExports lists export jobs (no download URLs).

func (*SignalsServiceOp) ListSessionDialogues added in v1.218.0

ListSessionDialogues lists replay dialogues for a session.

func (*SignalsServiceOp) SetAgentConsent added in v1.218.0

func (s *SignalsServiceOp) SetAgentConsent(ctx context.Context, agentID string, enabled bool) (*SignalsConsentRecord, *Response, error)

SetAgentConsent enables or disables collection for one agent (PUT /v1/consent/{id}). Requires IAM signals:update. Oceanus routes this to consent-gateway, not signals-api.

func (*SignalsServiceOp) SetInferenceConsent added in v1.223.0

func (s *SignalsServiceOp) SetInferenceConsent(ctx context.Context, enabled bool) (*SignalsConsentRecord, *Response, error)

SetInferenceConsent enables or disables Signals collection for all serverless inference traffic of the authenticated team (PUT /v1/consent?source=inference). Requires IAM signals:update.

type SignalsSession added in v1.218.0

type SignalsSession struct {
	SessionID       string `json:"session_id"`
	TotalTurns      int    `json:"total_turns"`
	StartedAt       string `json:"started_at"`
	DurationSeconds int    `json:"duration_seconds"`
	SignalCount     int    `json:"signal_count"`
}

SignalsSession is a session list node.

type SignalsSessionDialogue added in v1.218.0

type SignalsSessionDialogue struct {
	SignalsDialogue
	Signals []SignalsInstance `json:"signals,omitempty"`
}

SignalsSessionDialogue is a dialogue plus session-scoped chips.

type SignalsSessionDialogueEdge added in v1.218.0

type SignalsSessionDialogueEdge struct {
	Cursor string                 `json:"cursor"`
	Node   SignalsSessionDialogue `json:"node"`
}

SignalsSessionDialogueEdge is one edge in a session dialogue list.

type SignalsSessionDialoguesResponse added in v1.218.0

type SignalsSessionDialoguesResponse struct {
	SessionID string                       `json:"session_id"`
	Edges     []SignalsSessionDialogueEdge `json:"edges"`
	PageInfo  SignalsPageInfo              `json:"page_info"`
}

SignalsSessionDialoguesResponse is GET /sessions/{session_id}/dialogues.

type SignalsSessionEdge added in v1.218.0

type SignalsSessionEdge struct {
	Cursor string         `json:"cursor"`
	Node   SignalsSession `json:"node"`
}

SignalsSessionEdge is one edge in a session list.

type SimulationEvaluationConfig added in v1.206.0

type SimulationEvaluationConfig struct {
	MetricUUIDs []string    `json:"metric_uuids,omitempty"`
	StarMetric  *StarMetric `json:"star_metric,omitempty"`
}

SimulationEvaluationConfig opts a simulation run into an attached evaluation.

type SimulationJourney added in v1.206.0

type SimulationJourney struct {
	JourneyUUID            string                   `json:"journey_uuid,omitempty"`
	RunUUID                string                   `json:"run_uuid,omitempty"`
	ScenarioUUID           string                   `json:"scenario_uuid,omitempty"`
	JourneyIndex           uint32                   `json:"journey_index,omitempty"`
	SessionID              string                   `json:"session_id,omitempty"`
	Status                 SimulationJourneyStatus  `json:"status,omitempty"`
	Verdict                SimulationJourneyVerdict `json:"verdict,omitempty"`
	TrajectoryBucketName   string                   `json:"trajectory_bucket_name,omitempty"`
	TrajectoryBucketRegion string                   `json:"trajectory_bucket_region,omitempty"`
	TrajectorySpacesKey    string                   `json:"trajectory_spaces_key,omitempty"`
	TokenUsage             *SimulationTokenUsage    `json:"token_usage,omitempty"`
	DurationSec            string                   `json:"duration_sec,omitempty"`
	JudgeReasoning         string                   `json:"judge_reasoning,omitempty"`
	FailureReason          string                   `json:"failure_reason,omitempty"`
	CreatedAt              *Timestamp               `json:"created_at,omitempty"`
	UpdatedAt              *Timestamp               `json:"updated_at,omitempty"`
}

SimulationJourney is one independent execution within a simulation run.

type SimulationJourneyCounts added in v1.206.0

type SimulationJourneyCounts struct {
	SuccessCount      uint32 `json:"success_count,omitempty"`
	FailureCount      uint32 `json:"failure_count,omitempty"`
	InconclusiveCount uint32 `json:"inconclusive_count,omitempty"`
}

SimulationJourneyCounts is a breakdown of journey outcomes by verdict.

type SimulationJourneyListOptions added in v1.206.0

type SimulationJourneyListOptions struct {
	ScenarioUUID  string                     `url:"scenario_uuid,omitempty"`
	Statuses      []SimulationJourneyStatus  `url:"statuses,omitempty"`
	Verdicts      []SimulationJourneyVerdict `url:"verdicts,omitempty"`
	Search        string                     `url:"search,omitempty"`
	SortBy        SimulationJourneySortField `url:"sort_by,omitempty"`
	SortDirection GenAISortDirection         `url:"sort_direction,omitempty"`
	ListOptions
}

SimulationJourneyListOptions specifies optional parameters for listing simulation journeys.

type SimulationJourneyListResponse added in v1.206.0

type SimulationJourneyListResponse struct {
	Journeys                []*SimulationJourney         `json:"journeys,omitempty"`
	Links                   *Links                       `json:"links,omitempty"`
	Meta                    *Meta                        `json:"meta,omitempty"`
	AvailableStatuses       []SimulationJourneyStatus    `json:"available_statuses,omitempty"`
	AvailableVerdicts       []SimulationJourneyVerdict   `json:"available_verdicts,omitempty"`
	AvailableSortBy         []SimulationJourneySortField `json:"available_sort_by,omitempty"`
	AvailableSortDirections []GenAISortDirection         `json:"available_sort_directions,omitempty"`
}

SimulationJourneyListResponse is returned by ListSimulationJourneys.

type SimulationJourneySortField added in v1.206.0

type SimulationJourneySortField string

SimulationJourneySortField is a sortable field for ListSimulationJourneys.

const (
	SimulationJourneySortFieldUnspecified SimulationJourneySortField = "SIMULATION_JOURNEY_SORT_FIELD_UNSPECIFIED"
	SimulationJourneySortFieldScenario    SimulationJourneySortField = "SIMULATION_JOURNEY_SORT_FIELD_SCENARIO"
	SimulationJourneySortFieldCreatedAt   SimulationJourneySortField = "SIMULATION_JOURNEY_SORT_FIELD_CREATED_AT"
	SimulationJourneySortFieldStatus      SimulationJourneySortField = "SIMULATION_JOURNEY_SORT_FIELD_STATUS"
	SimulationJourneySortFieldVerdict     SimulationJourneySortField = "SIMULATION_JOURNEY_SORT_FIELD_VERDICT"
)

type SimulationJourneyStatus added in v1.206.0

type SimulationJourneyStatus string

SimulationJourneyStatus is the lifecycle status of a simulation journey.

const (
	SimulationJourneyStatusUnspecified SimulationJourneyStatus = "SIMULATION_JOURNEY_STATUS_UNSPECIFIED"
	SimulationJourneyStatusRunning     SimulationJourneyStatus = "SIMULATION_JOURNEY_STATUS_RUNNING"
	SimulationJourneyStatusFinished    SimulationJourneyStatus = "SIMULATION_JOURNEY_STATUS_FINISHED"
	SimulationJourneyStatusFailed      SimulationJourneyStatus = "SIMULATION_JOURNEY_STATUS_FAILED"
	SimulationJourneyStatusPreparing   SimulationJourneyStatus = "SIMULATION_JOURNEY_STATUS_PREPARING"
)

type SimulationJourneyTrajectoryURLResponse added in v1.206.0

type SimulationJourneyTrajectoryURLResponse struct {
	DownloadURL string     `json:"download_url,omitempty"`
	ExpiresAt   *Timestamp `json:"expires_at,omitempty"`
}

SimulationJourneyTrajectoryURLResponse is returned by GetSimulationJourneyTrajectoryURL.

type SimulationJourneyVerdict added in v1.206.0

type SimulationJourneyVerdict string

SimulationJourneyVerdict is the judge verdict for a journey.

const (
	SimulationJourneyVerdictUnspecified  SimulationJourneyVerdict = "SIMULATION_JOURNEY_VERDICT_UNSPECIFIED"
	SimulationJourneyVerdictSuccess      SimulationJourneyVerdict = "SIMULATION_JOURNEY_VERDICT_SUCCESS"
	SimulationJourneyVerdictFailure      SimulationJourneyVerdict = "SIMULATION_JOURNEY_VERDICT_FAILURE"
	SimulationJourneyVerdictInconclusive SimulationJourneyVerdict = "SIMULATION_JOURNEY_VERDICT_INCONCLUSIVE"
)

type SimulationRun added in v1.206.0

type SimulationRun struct {
	RunUUID                string                      `json:"run_uuid,omitempty"`
	Name                   string                      `json:"name,omitempty"`
	ScenarioSetUUID        string                      `json:"scenario_set_uuid,omitempty"`
	AgentConfig            *CandidateAgentConfig       `json:"agent_config,omitempty"`
	Status                 SimulationRunStatus         `json:"status,omitempty"`
	UserSimulatorModelUUID string                      `json:"user_simulator_model_uuid,omitempty"`
	JudgeModelUUID         string                      `json:"judge_model_uuid,omitempty"`
	UserSimulatorConfig    map[string]interface{}      `json:"user_simulator_config,omitempty"`
	ScenarioCount          uint32                      `json:"scenario_count,omitempty"`
	TotalJourneys          uint32                      `json:"total_journeys,omitempty"`
	JourneysFinished       uint32                      `json:"journeys_finished,omitempty"`
	ResultSummary          *SimulationRunResultSummary `json:"result_summary,omitempty"`
	WorkflowUUID           string                      `json:"workflow_uuid,omitempty"`
	ExplorationBudget      uint32                      `json:"exploration_budget,omitempty"`
	MaxTurns               uint32                      `json:"max_turns,omitempty"`
	FailureReason          string                      `json:"failure_reason,omitempty"`
	CreatedAt              *Timestamp                  `json:"created_at,omitempty"`
	UpdatedAt              *Timestamp                  `json:"updated_at,omitempty"`
	DeletedAt              *Timestamp                  `json:"deleted_at,omitempty"`
	UserSimulatorModelName string                      `json:"user_simulator_model_name,omitempty"`
	JudgeModelName         string                      `json:"judge_model_name,omitempty"`
	CreatedByUserID        string                      `json:"created_by_user_id,omitempty"`
	CreatedByUserEmail     string                      `json:"created_by_user_email,omitempty"`
	EvaluationRunUUID      string                      `json:"evaluation_run_uuid,omitempty"`
}

SimulationRun is one execution of a scenario set against a candidate agent.

type SimulationRunDeleteResponse added in v1.206.0

type SimulationRunDeleteResponse struct {
	RunUUID string `json:"run_uuid,omitempty"`
}

SimulationRunDeleteResponse is returned by DeleteSimulationRun.

type SimulationRunGetResponse added in v1.206.0

type SimulationRunGetResponse struct {
	SimulationRun   *SimulationRun              `json:"simulation_run,omitempty"`
	ScenarioResults []*SimulationScenarioResult `json:"scenario_results,omitempty"`
}

SimulationRunGetResponse is returned by GetSimulationRun.

type SimulationRunListOptions added in v1.206.0

type SimulationRunListOptions struct {
	ScenarioSetUUID string                 `url:"scenario_set_uuid,omitempty"`
	Statuses        []SimulationRunStatus  `url:"statuses,omitempty"`
	Search          string                 `url:"search,omitempty"`
	SortBy          SimulationRunSortField `url:"sort_by,omitempty"`
	SortDirection   GenAISortDirection     `url:"sort_direction,omitempty"`
	ListOptions
}

SimulationRunListOptions specifies optional parameters for listing simulation runs.

type SimulationRunListResponse added in v1.206.0

type SimulationRunListResponse struct {
	SimulationRuns          []*SimulationRun         `json:"simulation_runs,omitempty"`
	Links                   *Links                   `json:"links,omitempty"`
	Meta                    *Meta                    `json:"meta,omitempty"`
	AvailableStatuses       []SimulationRunStatus    `json:"available_statuses,omitempty"`
	AvailableSortBy         []SimulationRunSortField `json:"available_sort_by,omitempty"`
	AvailableSortDirections []GenAISortDirection     `json:"available_sort_directions,omitempty"`
}

SimulationRunListResponse is returned by ListSimulationRuns.

type SimulationRunResultSummary added in v1.206.0

type SimulationRunResultSummary struct {
	VerdictCounts    *SimulationJourneyCounts `json:"verdict_counts,omitempty"`
	TokenUsage       *SimulationTokenUsage    `json:"token_usage,omitempty"`
	TotalDurationSec string                   `json:"total_duration_sec,omitempty"`
}

SimulationRunResultSummary is the aggregated final result of a simulation run.

type SimulationRunSortField added in v1.206.0

type SimulationRunSortField string

SimulationRunSortField is a sortable field for ListSimulationRuns.

const (
	SimulationRunSortFieldUnspecified SimulationRunSortField = "SIMULATION_RUN_SORT_FIELD_UNSPECIFIED"
	SimulationRunSortFieldCreatedAt   SimulationRunSortField = "SIMULATION_RUN_SORT_FIELD_CREATED_AT"
	SimulationRunSortFieldName        SimulationRunSortField = "SIMULATION_RUN_SORT_FIELD_NAME"
	SimulationRunSortFieldStatus      SimulationRunSortField = "SIMULATION_RUN_SORT_FIELD_STATUS"
	SimulationRunSortFieldUpdatedAt   SimulationRunSortField = "SIMULATION_RUN_SORT_FIELD_UPDATED_AT"
)

type SimulationRunStatus added in v1.206.0

type SimulationRunStatus string

SimulationRunStatus is the lifecycle status of a simulation run.

const (
	SimulationRunStatusUnspecified         SimulationRunStatus = "SIMULATION_RUN_STATUS_UNSPECIFIED"
	SimulationRunStatusPending             SimulationRunStatus = "SIMULATION_RUN_STATUS_PENDING"
	SimulationRunStatusRunning             SimulationRunStatus = "SIMULATION_RUN_STATUS_RUNNING"
	SimulationRunStatusSucceeded           SimulationRunStatus = "SIMULATION_RUN_STATUS_SUCCEEDED"
	SimulationRunStatusFailed              SimulationRunStatus = "SIMULATION_RUN_STATUS_FAILED"
	SimulationRunStatusCancelled           SimulationRunStatus = "SIMULATION_RUN_STATUS_CANCELLED"
	SimulationRunStatusEvaluating          SimulationRunStatus = "SIMULATION_RUN_STATUS_EVALUATING"
	SimulationRunStatusPartiallySuccessful SimulationRunStatus = "SIMULATION_RUN_STATUS_PARTIALLY_SUCCESSFUL"
)

type SimulationScenarioResult added in v1.206.0

type SimulationScenarioResult struct {
	ScenarioUUID     string                   `json:"scenario_uuid,omitempty"`
	TotalJourneys    uint32                   `json:"total_journeys,omitempty"`
	JourneysFinished uint32                   `json:"journeys_finished,omitempty"`
	VerdictCounts    *SimulationJourneyCounts `json:"verdict_counts,omitempty"`
}

SimulationScenarioResult is a per-scenario rollup of journey outcomes within a run.

type SimulationTokenUsage added in v1.206.0

type SimulationTokenUsage struct {
	SimulatorTokens      string `json:"simulator_tokens,omitempty"`
	JudgeTokens          string `json:"judge_tokens,omitempty"`
	CandidateAgentTokens string `json:"candidate_agent_tokens,omitempty"`
	GeneratorTokens      string `json:"generator_tokens,omitempty"`
	TotalTokens          string `json:"total_tokens,omitempty"`
}

SimulationTokenUsage is per-actor token accounting for a run or journey.

type SimulationTrajectory added in v1.206.0

type SimulationTrajectory struct {
	AgentID           string                           `json:"agent_id,omitempty"`
	CompletedAt       string                           `json:"completed_at,omitempty"`
	DurationSec       string                           `json:"duration_sec,omitempty"`
	EvaluationMetrics []*EvaluationMetricResult        `json:"evaluation_metrics,omitempty"`
	FailureReason     string                           `json:"failure_reason,omitempty"`
	JourneyIndex      uint32                           `json:"journey_index,omitempty"`
	JourneyUUID       string                           `json:"journey_uuid,omitempty"`
	Judge             *SimulationTrajectoryJudgeResult `json:"judge,omitempty"`
	MaxTurns          uint32                           `json:"max_turns,omitempty"`
	Messages          []*SimulationTrajectoryMessage   `json:"messages,omitempty"`
	RunUUID           string                           `json:"run_uuid,omitempty"`
	ScenarioUUID      string                           `json:"scenario_uuid,omitempty"`
	SessionID         string                           `json:"session_id,omitempty"`
	StartedAt         string                           `json:"started_at,omitempty"`
	Status            SimulationTrajectoryStatus       `json:"status,omitempty"`
	TokenUsage        *SimulationTokenUsage            `json:"token_usage,omitempty"`
	TurnCount         uint32                           `json:"turn_count,omitempty"`
	Verdict           SimulationJourneyVerdict         `json:"verdict,omitempty"`
}

SimulationTrajectory is the canonical trajectory JSON for one journey.

type SimulationTrajectoryJudgeCriterion added in v1.206.0

type SimulationTrajectoryJudgeCriterion struct {
	Criterion string `json:"criterion,omitempty"`
	Passed    bool   `json:"passed,omitempty"`
	Reasoning string `json:"reasoning,omitempty"`
}

SimulationTrajectoryJudgeCriterion is a per-criterion judge evaluation.

type SimulationTrajectoryJudgeResult added in v1.206.0

type SimulationTrajectoryJudgeResult struct {
	Verdict          SimulationJourneyVerdict              `json:"verdict,omitempty"`
	Reasoning        string                                `json:"reasoning,omitempty"`
	CriteriaPassFail []*SimulationTrajectoryJudgeCriterion `json:"criteria_pass_fail,omitempty"`
}

SimulationTrajectoryJudgeResult is judge output embedded in a trajectory.

type SimulationTrajectoryMessage added in v1.206.0

type SimulationTrajectoryMessage struct {
	TurnIndex   uint32                             `json:"turn_index,omitempty"`
	Role        string                             `json:"role,omitempty"`
	Content     string                             `json:"content,omitempty"`
	StartedAt   string                             `json:"started_at,omitempty"`
	CompletedAt string                             `json:"completed_at,omitempty"`
	ToolCalls   []*SimulationTrajectoryToolCall    `json:"tool_calls,omitempty"`
	Tokens      *SimulationTrajectoryMessageTokens `json:"tokens,omitempty"`
}

SimulationTrajectoryMessage is one user or assistant message in a trajectory.

type SimulationTrajectoryMessageTokens added in v1.206.0

type SimulationTrajectoryMessageTokens struct {
	Input  uint32 `json:"input,omitempty"`
	Output uint32 `json:"output,omitempty"`
}

SimulationTrajectoryMessageTokens is token usage for a single assistant message.

type SimulationTrajectoryStatus added in v1.206.0

type SimulationTrajectoryStatus string

SimulationTrajectoryStatus is the lifecycle status of a trajectory JSON object.

const (
	SimulationTrajectoryStatusUnspecified SimulationTrajectoryStatus = "SIMULATION_TRAJECTORY_STATUS_UNSPECIFIED"
	SimulationTrajectoryStatusRunning     SimulationTrajectoryStatus = "SIMULATION_TRAJECTORY_STATUS_RUNNING"
	SimulationTrajectoryStatusCompleted   SimulationTrajectoryStatus = "SIMULATION_TRAJECTORY_STATUS_COMPLETED"
	SimulationTrajectoryStatusFailed      SimulationTrajectoryStatus = "SIMULATION_TRAJECTORY_STATUS_FAILED"
	SimulationTrajectoryStatusCancelled   SimulationTrajectoryStatus = "SIMULATION_TRAJECTORY_STATUS_CANCELLED"
)

type SimulationTrajectoryToolCall added in v1.206.0

type SimulationTrajectoryToolCall struct {
	Name            string                 `json:"name,omitempty"`
	Description     string                 `json:"description,omitempty"`
	InputParameters map[string]interface{} `json:"input_parameters,omitempty"`
	Output          interface{}            `json:"output,omitempty"`
	ToolCallID      string                 `json:"tool_call_id,omitempty"`
	Ok              bool                   `json:"ok,omitempty"`
}

SimulationTrajectoryToolCall is a tool call recorded on an assistant turn.

type SingleKnowledgeBaseDataSourceRoot added in v1.152.0

type SingleKnowledgeBaseDataSourceRoot struct {
	KnowledgeBaseDatasource *KnowledgeBaseDataSource `json:"knowledge_base_data_source"`
	Links                   *Links                   `json:"links"`
	Meta                    *Meta                    `json:"meta"`
}

type Size

type Size struct {
	Slug         string     `json:"slug,omitempty"`
	Memory       int        `json:"memory,omitempty"`
	Vcpus        int        `json:"vcpus,omitempty"`
	Disk         int        `json:"disk,omitempty"`
	PriceMonthly float64    `json:"price_monthly,omitempty"`
	PriceHourly  float64    `json:"price_hourly,omitempty"`
	Regions      []string   `json:"regions,omitempty"`
	Available    bool       `json:"available,omitempty"`
	Transfer     float64    `json:"transfer,omitempty"`
	Description  string     `json:"description,omitempty"`
	GPUInfo      *GPUInfo   `json:"gpu_info,omitempty"`
	DiskInfo     []DiskInfo `json:"disk_info,omitempty"`
}

Size represents a DigitalOcean Size

func (Size) String

func (s Size) String() string

type SizesService

type SizesService interface {
	List(context.Context, *ListOptions) ([]Size, *Response, error)
}

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

type SizesServiceOp added in v0.3.0

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

SizesServiceOp handles communication with the size related methods of the DigitalOcean API.

func (*SizesServiceOp) List added in v0.3.0

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

List all images

type SlackDetails added in v1.64.0

type SlackDetails struct {
	URL     string `json:"url"`
	Channel string `json:"channel"`
}

SlackDetails represents the details required to send a slack alert

type SlackNotificationConfig added in v1.218.0

type SlackNotificationConfig struct {
	WebhookURL string `json:"webhook_url,omitempty"`
	Channel    string `json:"channel"`
}

SlackNotificationConfig is a Slack notification channel. WebhookURL is write-only: reads return a masked value, and an empty WebhookURL on update keeps the existing URL.

type Snapshot added in v1.0.0

type Snapshot struct {
	ID            string   `json:"id,omitempty"`
	Name          string   `json:"name,omitempty"`
	ResourceID    string   `json:"resource_id,omitempty"`
	ResourceType  string   `json:"resource_type,omitempty"`
	Regions       []string `json:"regions,omitempty"`
	MinDiskSize   int      `json:"min_disk_size,omitempty"`
	SizeGigaBytes float64  `json:"size_gigabytes,omitempty"`
	Created       string   `json:"created_at,omitempty"`
	Tags          []string `json:"tags,omitempty"`
}

Snapshot represents a DigitalOcean Snapshot

func (Snapshot) String added in v1.0.0

func (s Snapshot) String() string

type SnapshotCreateRequest added in v1.0.0

type SnapshotCreateRequest struct {
	VolumeID    string   `json:"volume_id"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Tags        []string `json:"tags"`
}

SnapshotCreateRequest represents a request to create a block store volume.

type SnapshotsService added in v1.0.0

type SnapshotsService interface {
	List(context.Context, *ListOptions) ([]Snapshot, *Response, error)
	ListVolume(context.Context, *ListOptions) ([]Snapshot, *Response, error)
	ListVolumeSnapshotByRegion(context.Context, string, *ListOptions) ([]Snapshot, *Response, error)
	ListDroplet(context.Context, *ListOptions) ([]Snapshot, *Response, error)
	Get(context.Context, string) (*Snapshot, *Response, error)
	Delete(context.Context, string) (*Response, error)
}

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

type SnapshotsServiceOp added in v1.0.0

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

SnapshotsServiceOp handles communication with the snapshot related methods of the DigitalOcean API.

func (*SnapshotsServiceOp) Delete added in v1.0.0

func (s *SnapshotsServiceOp) Delete(ctx context.Context, snapshotID string) (*Response, error)

Delete an snapshot.

func (*SnapshotsServiceOp) Get added in v1.0.0

func (s *SnapshotsServiceOp) Get(ctx context.Context, snapshotID string) (*Snapshot, *Response, error)

Get retrieves a snapshot by id.

func (*SnapshotsServiceOp) List added in v1.0.0

List lists all the snapshots available.

func (*SnapshotsServiceOp) ListDroplet added in v1.0.0

func (s *SnapshotsServiceOp) ListDroplet(ctx context.Context, opt *ListOptions) ([]Snapshot, *Response, error)

ListDroplet lists all the Droplet snapshots.

func (*SnapshotsServiceOp) ListVolume added in v1.0.0

func (s *SnapshotsServiceOp) ListVolume(ctx context.Context, opt *ListOptions) ([]Snapshot, *Response, error)

ListVolume lists all the volume snapshots.

func (*SnapshotsServiceOp) ListVolumeSnapshotByRegion added in v1.141.0

func (s *SnapshotsServiceOp) ListVolumeSnapshotByRegion(ctx context.Context, region string, opt *ListOptions) ([]Snapshot, *Response, error)

ListVolumeSnapshotByRegion lists all the volume snapshot for given region

type SourceSpec added in v1.85.0

type SourceSpec interface {
	GetType() AppSourceType
}

SourceSpec represents a source.

type Sources added in v1.1.0

type Sources struct {
	Addresses        []string `json:"addresses,omitempty"`
	Tags             []string `json:"tags,omitempty"`
	DropletIDs       []int    `json:"droplet_ids,omitempty"`
	LoadBalancerUIDs []string `json:"load_balancer_uids,omitempty"`
	KubernetesIDs    []string `json:"kubernetes_ids,omitempty"`
}

Sources represents a DigitalOcean Firewall InboundRule sources.

type SpacesDataSource added in v1.152.0

type SpacesDataSource struct {
	BucketName string `json:"bucket_name,omitempty"`
	ItemPath   string `json:"item_path,omitempty"`
	Region     string `json:"region,omitempty"`
}

SpacesDataSource represents the spaces data source information

type SpacesKey added in v1.134.0

type SpacesKey struct {
	Name      string   `json:"name"`
	AccessKey string   `json:"access_key"`
	SecretKey string   `json:"secret_key"`
	Grants    []*Grant `json:"grants"`
	CreatedAt string   `json:"created_at"`
}

SpacesKey represents a DigitalOcean Spaces key

type SpacesKeyCreateRequest added in v1.134.0

type SpacesKeyCreateRequest struct {
	Name   string   `json:"name"`
	Grants []*Grant `json:"grants"`
}

SpacesKeyCreateRequest represents a request to create a Spaces key.

type SpacesKeyPermission added in v1.134.0

type SpacesKeyPermission string

SpacesKeyPermission represents a permission for a Spaces grant

const (
	// SpacesKeyRead grants read-only access to the Spaces bucket
	SpacesKeyRead SpacesKeyPermission = "read"
	// SpacesKeyReadWrite grants read and write access to the Spaces bucket
	SpacesKeyReadWrite SpacesKeyPermission = "readwrite"
	// SpacesKeyFullAccess grants full access to the Spaces bucket
	SpacesKeyFullAccess SpacesKeyPermission = "fullaccess"
)

type SpacesKeyUpdateRequest added in v1.134.0

type SpacesKeyUpdateRequest struct {
	Name   string   `json:"name"`
	Grants []*Grant `json:"grants"`
}

SpacesKeyUpdateRequest represents a request to update a Spaces key.

type SpacesKeysService added in v1.134.0

SpacesKeysService is an interface for managing Spaces keys with the DigitalOcean API.

type SpacesKeysServiceOp added in v1.134.0

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

SpacesKeysServiceOp handles communication with the Spaces key related methods of the DigitalOcean API.

func (*SpacesKeysServiceOp) Create added in v1.134.0

func (s *SpacesKeysServiceOp) Create(ctx context.Context, createRequest *SpacesKeyCreateRequest) (*SpacesKey, *Response, error)

Create creates a new Spaces key.

func (*SpacesKeysServiceOp) Delete added in v1.134.0

func (s *SpacesKeysServiceOp) Delete(ctx context.Context, accessKey string) (*Response, error)

Delete deletes a Spaces key.

func (*SpacesKeysServiceOp) Get added in v1.140.0

func (s *SpacesKeysServiceOp) Get(ctx context.Context, accessKey string) (*SpacesKey, *Response, error)

Get retrieves a Spaces key.

func (*SpacesKeysServiceOp) List added in v1.134.0

List returns a list of Spaces keys.

func (*SpacesKeysServiceOp) Update added in v1.134.0

func (s *SpacesKeysServiceOp) Update(ctx context.Context, accessKey string, updateRequest *SpacesKeyUpdateRequest) (*SpacesKey, *Response, error)

Update updates a Spaces key.

type StarMetric added in v1.171.0

type StarMetric struct {
	MetricUUID          string   `json:"metric_uuid,omitempty"`
	Name                string   `json:"name,omitempty"`
	SuccessThresholdPct *int32   `json:"success_threshold_pct,omitempty"` // Deprecated
	SuccessThreshold    *float32 `json:"success_threshold,omitempty"`
}

StarMetric represents a star metric configuration.

type StarMetricSummary added in v1.194.1

type StarMetricSummary struct {
	MetricName string  `json:"metric_name,omitempty"`
	MetricUuid string  `json:"metric_uuid,omitempty"`
	Threshold  float32 `json:"threshold,omitempty"`
}

StarMetricSummary contains the star metric summary with identifying details and threshold for an evaluation run.

type StartGarbageCollectionRequest added in v1.54.0

type StartGarbageCollectionRequest struct {
	Type GarbageCollectionType `json:"type"`
}

StartGarbageCollectionRequest represents options to a garbage collection start request.

type StickySessions added in v1.0.0

type StickySessions struct {
	Type             string `json:"type,omitempty"`
	CookieName       string `json:"cookie_name,omitempty"`
	CookieTtlSeconds int    `json:"cookie_ttl_seconds,omitempty"`
}

StickySessions represents optional load balancer session affinity rules.

func (StickySessions) String added in v1.0.0

func (s StickySessions) String() string

String creates a human-readable description of a StickySessions instance.

type StorageActionsService added in v1.0.0

type StorageActionsService interface {
	Attach(ctx context.Context, volumeID string, dropletID int) (*Action, *Response, error)
	DetachByDropletID(ctx context.Context, volumeID string, dropletID int) (*Action, *Response, error)
	Get(ctx context.Context, volumeID string, actionID int) (*Action, *Response, error)
	List(ctx context.Context, volumeID string, opt *ListOptions) ([]Action, *Response, error)
	Resize(ctx context.Context, volumeID string, sizeGigabytes int, regionSlug string) (*Action, *Response, error)
}

StorageActionsService is an interface for interfacing with the storage actions endpoints of the Digital Ocean API. See: https://docs.digitalocean.com/reference/api/api-reference/#tag/Block-Storage-Actions

type StorageActionsServiceOp added in v1.0.0

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

StorageActionsServiceOp handles communication with the storage volumes action related methods of the DigitalOcean API.

func (*StorageActionsServiceOp) Attach added in v1.0.0

func (s *StorageActionsServiceOp) Attach(ctx context.Context, volumeID string, dropletID int) (*Action, *Response, error)

Attach a storage volume to a Droplet.

func (*StorageActionsServiceOp) DetachByDropletID added in v1.0.0

func (s *StorageActionsServiceOp) DetachByDropletID(ctx context.Context, volumeID string, dropletID int) (*Action, *Response, error)

DetachByDropletID a storage volume from a Droplet by Droplet ID.

func (*StorageActionsServiceOp) Get added in v1.0.0

func (s *StorageActionsServiceOp) Get(ctx context.Context, volumeID string, actionID int) (*Action, *Response, error)

Get an action for a particular storage volume by id.

func (*StorageActionsServiceOp) List added in v1.0.0

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

List the actions for a particular storage volume.

func (*StorageActionsServiceOp) Resize added in v1.0.0

func (s *StorageActionsServiceOp) Resize(ctx context.Context, volumeID string, sizeGigabytes int, regionSlug string) (*Action, *Response, error)

Resize a storage volume.

type StorageAttachment added in v1.0.0

type StorageAttachment struct {
	DropletID int `json:"droplet_id"`
}

StorageAttachment represents the attachment of a block storage volume to a specific Droplet under the device name.

type StorageService added in v1.0.0

type StorageService interface {
	ListVolumes(context.Context, *ListVolumeParams) ([]Volume, *Response, error)
	GetVolume(context.Context, string) (*Volume, *Response, error)
	CreateVolume(context.Context, *VolumeCreateRequest) (*Volume, *Response, error)
	DeleteVolume(context.Context, string) (*Response, error)
	ListSnapshots(ctx context.Context, volumeID string, opts *ListOptions) ([]Snapshot, *Response, error)
	GetSnapshot(context.Context, string) (*Snapshot, *Response, error)
	CreateSnapshot(context.Context, *SnapshotCreateRequest) (*Snapshot, *Response, error)
	DeleteSnapshot(context.Context, string) (*Response, error)
}

StorageService is an interface for interfacing with the storage endpoints of the Digital Ocean API. See: https://docs.digitalocean.com/reference/api/api-reference/#tag/Block-Storage

type StorageServiceOp added in v1.0.0

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

StorageServiceOp handles communication with the storage volumes related methods of the DigitalOcean API.

func (*StorageServiceOp) CreateSnapshot added in v1.0.0

func (svc *StorageServiceOp) CreateSnapshot(ctx context.Context, createRequest *SnapshotCreateRequest) (*Snapshot, *Response, error)

CreateSnapshot creates a snapshot of a storage volume.

func (*StorageServiceOp) CreateVolume added in v1.0.0

func (svc *StorageServiceOp) CreateVolume(ctx context.Context, createRequest *VolumeCreateRequest) (*Volume, *Response, error)

CreateVolume creates a storage volume. The name must be unique.

func (*StorageServiceOp) DeleteSnapshot added in v1.0.0

func (svc *StorageServiceOp) DeleteSnapshot(ctx context.Context, id string) (*Response, error)

DeleteSnapshot deletes a snapshot.

func (*StorageServiceOp) DeleteVolume added in v1.0.0

func (svc *StorageServiceOp) DeleteVolume(ctx context.Context, id string) (*Response, error)

DeleteVolume deletes a storage volume.

func (*StorageServiceOp) GetSnapshot added in v1.0.0

func (svc *StorageServiceOp) GetSnapshot(ctx context.Context, id string) (*Snapshot, *Response, error)

GetSnapshot retrieves an individual snapshot.

func (*StorageServiceOp) GetVolume added in v1.0.0

func (svc *StorageServiceOp) GetVolume(ctx context.Context, id string) (*Volume, *Response, error)

GetVolume retrieves an individual storage volume.

func (*StorageServiceOp) ListSnapshots added in v1.0.0

func (svc *StorageServiceOp) ListSnapshots(ctx context.Context, volumeID string, opt *ListOptions) ([]Snapshot, *Response, error)

ListSnapshots lists all snapshots related to a storage volume.

func (*StorageServiceOp) ListVolumes added in v1.0.0

func (svc *StorageServiceOp) ListVolumes(ctx context.Context, params *ListVolumeParams) ([]Volume, *Response, error)

ListVolumes lists all storage volumes.

type SupportedBackupPolicy added in v1.129.0

type SupportedBackupPolicy struct {
	Name                 string   `json:"name,omitempty"`
	PossibleWindowStarts []int    `json:"possible_window_starts,omitempty"`
	WindowLengthHours    int      `json:"window_length_hours,omitempty"`
	RetentionPeriodDays  int      `json:"retention_period_days,omitempty"`
	PossibleDays         []string `json:"possible_days,omitempty"`
}

type Tag added in v1.0.0

type Tag struct {
	Name      string           `json:"name,omitempty"`
	Resources *TaggedResources `json:"resources,omitempty"`
}

Tag represent DigitalOcean tag

type TagCreateRequest added in v1.0.0

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

TagCreateRequest represents the JSON structure of a request of that type.

type TagResourcesRequest added in v1.0.0

type TagResourcesRequest struct {
	Resources []Resource `json:"resources"`
}

TagResourcesRequest represents the JSON structure of a request of that type.

type TaggedDatabasesResources added in v1.29.0

type TaggedDatabasesResources TaggedResourcesData

TaggedDatabasesResources represent the database resources a tag is attached to

type TaggedDropletsResources added in v1.0.0

type TaggedDropletsResources struct {
	Count         int      `json:"count,float64,omitempty"`
	LastTagged    *Droplet `json:"last_tagged,omitempty"`
	LastTaggedURI string   `json:"last_tagged_uri,omitempty"`
}

TaggedDropletsResources represent the droplet resources a tag is attached to

type TaggedImagesResources added in v1.5.0

type TaggedImagesResources TaggedResourcesData

TaggedImagesResources represent the image resources a tag is attached to

type TaggedResources added in v1.0.0

type TaggedResources struct {
	Count           int                             `json:"count"`
	LastTaggedURI   string                          `json:"last_tagged_uri,omitempty"`
	Droplets        *TaggedDropletsResources        `json:"droplets,omitempty"`
	Images          *TaggedImagesResources          `json:"images"`
	Volumes         *TaggedVolumesResources         `json:"volumes"`
	VolumeSnapshots *TaggedVolumeSnapshotsResources `json:"volume_snapshots"`
	Databases       *TaggedDatabasesResources       `json:"databases"`
}

TaggedResources represent the set of resources a tag is attached to

type TaggedResourcesData added in v1.7.5

type TaggedResourcesData struct {
	Count         int    `json:"count,float64,omitempty"`
	LastTaggedURI string `json:"last_tagged_uri,omitempty"`
}

TaggedResourcesData represent the generic resources a tag is attached to

type TaggedVolumeSnapshotsResources added in v1.29.0

type TaggedVolumeSnapshotsResources TaggedResourcesData

TaggedVolumeSnapshotsResources represent the volume snapshot resources a tag is attached to

type TaggedVolumesResources added in v1.7.5

type TaggedVolumesResources TaggedResourcesData

TaggedVolumesResources represent the volume resources a tag is attached to

type TagsService added in v1.0.0

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

type TagsServiceOp added in v1.0.0

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

TagsServiceOp handles communication with tag related method of the DigitalOcean API.

func (*TagsServiceOp) Create added in v1.0.0

func (s *TagsServiceOp) Create(ctx context.Context, createRequest *TagCreateRequest) (*Tag, *Response, error)

Create a new tag

func (*TagsServiceOp) Delete added in v1.0.0

func (s *TagsServiceOp) Delete(ctx context.Context, name string) (*Response, error)

Delete an existing tag

func (*TagsServiceOp) Get added in v1.0.0

func (s *TagsServiceOp) Get(ctx context.Context, name string) (*Tag, *Response, error)

Get a single tag

func (*TagsServiceOp) List added in v1.0.0

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

List all tags

func (*TagsServiceOp) TagResources added in v1.0.0

func (s *TagsServiceOp) TagResources(ctx context.Context, name string, tagRequest *TagResourcesRequest) (*Response, error)

TagResources associates resources with a given Tag.

func (*TagsServiceOp) UntagResources added in v1.0.0

func (s *TagsServiceOp) UntagResources(ctx context.Context, name string, untagRequest *UntagResourcesRequest) (*Response, error)

UntagResources dissociates resources with a given Tag.

type Taint added in v1.45.0

type Taint struct {
	Key    string
	Value  string
	Effect string
}

Taint represents a Kubernetes taint that can be associated with a node pool (and, transitively, with all nodes of that pool).

func (Taint) String added in v1.45.0

func (t Taint) String() string

type TeamInfo added in v1.81.0

type TeamInfo struct {
	Name string `json:"name,omitempty"`
	UUID string `json:"uuid,omitempty"`
}

TeamInfo contains information about the currently team context.

type Timestamp

type Timestamp struct {
	time.Time
}

Timestamp represents a time that can be unmarshalled from a JSON string formatted as either an RFC3339 or Unix timestamp. All exported methods of time.Time can be called on Timestamp.

func (Timestamp) Equal

func (t Timestamp) Equal(u Timestamp) bool

Equal reports whether t and u are equal based on time.Equal

func (Timestamp) String

func (t Timestamp) String() string

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface. Time is expected in RFC3339 or Unix format.

type ToggleDatabaseTrustedSourceOptions added in v1.109.0

type ToggleDatabaseTrustedSourceOptions struct {
	// Enable, if true, indicates the database should enable the trusted sources firewall.
	Enable bool
}

ToggleDatabaseTrustedSourceOptions provides optional parameters for ToggleDatabaseTrustedSource.

type ToggleDatabaseTrustedSourceRequest added in v1.109.0

type ToggleDatabaseTrustedSourceRequest struct {
	AppID         string `json:"app_id,omitempty"`
	ComponentName string `json:"component_name,omitempty"`
	Enable        bool   `json:"enable,omitempty"`
}

ToggleDatabaseTrustedSourceRequest struct for ToggleDatabaseTrustedSourceRequest

func (*ToggleDatabaseTrustedSourceRequest) GetAppID added in v1.109.0

GetAppID returns the AppID field.

func (*ToggleDatabaseTrustedSourceRequest) GetComponentName added in v1.109.0

func (t *ToggleDatabaseTrustedSourceRequest) GetComponentName() string

GetComponentName returns the ComponentName field.

func (*ToggleDatabaseTrustedSourceRequest) GetEnable added in v1.109.0

GetEnable returns the Enable field.

type ToggleDatabaseTrustedSourceResponse added in v1.109.0

type ToggleDatabaseTrustedSourceResponse struct {
	IsEnabled bool `json:"is_enabled,omitempty"`
}

ToggleDatabaseTrustedSourceResponse struct for ToggleDatabaseTrustedSourceResponse

func (*ToggleDatabaseTrustedSourceResponse) GetIsEnabled added in v1.109.0

func (t *ToggleDatabaseTrustedSourceResponse) GetIsEnabled() bool

GetIsEnabled returns the IsEnabled field.

type TokenListOptions added in v1.73.0

type TokenListOptions struct {
	// For paginated result sets, page of results to retrieve.
	Page int `url:"page,omitempty"`

	// For paginated result sets, the number of results to include per page.
	PerPage int `url:"per_page,omitempty"`

	// For paginated result sets which support tokens, the token provided by the last set
	// of results in order to retrieve the next set of results. This is expected to be faster
	// than incrementing or decrementing the page number.
	Token string `url:"page_token,omitempty"`
}

TokenListOptions specifies the optional parameters to various List methods that support token pagination.

type TokenPricing added in v1.194.1

type TokenPricing struct {
	InputCost  float64 `json:"input_cost,omitempty"`
	OutputCost float64 `json:"output_cost,omitempty"`
	TotalCost  float64 `json:"total_cost,omitempty"`
}

TokenPricing contains the token pricing breakdown for a single model.

type TokenUsage added in v1.194.1

type TokenUsage struct {
	TotalCandidateInputTokens  string `json:"total_candidate_input_tokens,omitempty"`
	TotalCandidateOutputTokens string `json:"total_candidate_output_tokens,omitempty"`
	TotalCandidateTokens       string `json:"total_candidate_tokens,omitempty"`
	TotalJudgeInputTokens      string `json:"total_judge_input_tokens,omitempty"`
	TotalJudgeOutputTokens     string `json:"total_judge_output_tokens,omitempty"`
	TotalJudgeTokens           string `json:"total_judge_tokens,omitempty"`
}

TokenUsage contains aggregated token usage statistics for an evaluation run.

type TopicConfig added in v1.103.0

type TopicConfig struct {
	CleanupPolicy                   string   `json:"cleanup_policy,omitempty"`
	CompressionType                 string   `json:"compression_type,omitempty"`
	DeleteRetentionMS               *uint64  `json:"delete_retention_ms,omitempty"`
	FileDeleteDelayMS               *uint64  `json:"file_delete_delay_ms,omitempty"`
	FlushMessages                   *uint64  `json:"flush_messages,omitempty"`
	FlushMS                         *uint64  `json:"flush_ms,omitempty"`
	IndexIntervalBytes              *uint64  `json:"index_interval_bytes,omitempty"`
	MaxCompactionLagMS              *uint64  `json:"max_compaction_lag_ms,omitempty"`
	MaxMessageBytes                 *uint64  `json:"max_message_bytes,omitempty"`
	MessageDownConversionEnable     *bool    `json:"message_down_conversion_enable,omitempty"`
	MessageFormatVersion            string   `json:"message_format_version,omitempty"`
	MessageTimestampDifferenceMaxMS *uint64  `json:"message_timestamp_difference_max_ms,omitempty"`
	MessageTimestampType            string   `json:"message_timestamp_type,omitempty"`
	MinCleanableDirtyRatio          *float32 `json:"min_cleanable_dirty_ratio,omitempty"`
	MinCompactionLagMS              *uint64  `json:"min_compaction_lag_ms,omitempty"`
	MinInsyncReplicas               *uint32  `json:"min_insync_replicas,omitempty"`
	Preallocate                     *bool    `json:"preallocate,omitempty"`
	RetentionBytes                  *int64   `json:"retention_bytes,omitempty"`
	RetentionMS                     *int64   `json:"retention_ms,omitempty"`
	SegmentBytes                    *uint64  `json:"segment_bytes,omitempty"`
	SegmentIndexBytes               *uint64  `json:"segment_index_bytes,omitempty"`
	SegmentJitterMS                 *uint64  `json:"segment_jitter_ms,omitempty"`
	SegmentMS                       *uint64  `json:"segment_ms,omitempty"`
}

TopicConfig represents all configurable options for a Kafka topic

type TopicConsumerGroup added in v1.105.0

type TopicConsumerGroup struct {
	Name   string `json:"name,omitempty"`
	Offset uint64 `json:"offset,omitempty"`
}

TopicConsumerGroup represents a consumer group for a particular Kafka topic

type TopicPartition added in v1.105.0

type TopicPartition struct {
	EarliestOffset uint64                `json:"earliest_offset,omitempty"`
	InSyncReplicas uint32                `json:"in_sync_replicas,omitempty"`
	Id             uint32                `json:"id,omitempty"`
	Size           uint64                `json:"size,omitempty"`
	ConsumerGroups []*TopicConsumerGroup `json:"consumer_groups,omitempty"`
}

TopicPartition represents the state of a Kafka topic partition

type TriggerMetadataManual added in v1.165.1

type TriggerMetadataManual struct {
	User *DeploymentCauseDetailsDigitalOceanUser `json:"user,omitempty"`
}

TriggerMetadataManual struct for TriggerMetadataManual

func (*TriggerMetadataManual) GetUser added in v1.165.1

GetUser returns the User field.

type TriggerMetadataScheduled added in v1.165.1

type TriggerMetadataScheduled struct {
	Schedule *AppJobSpecSchedule `json:"schedule,omitempty"`
}

TriggerMetadataScheduled struct for TriggerMetadataScheduled

func (*TriggerMetadataScheduled) GetSchedule added in v1.165.1

func (t *TriggerMetadataScheduled) GetSchedule() *AppJobSpecSchedule

GetSchedule returns the Schedule field.

type TriggerScheduledDetails added in v1.92.0

type TriggerScheduledDetails struct {
	Cron string                 `json:"cron,omitempty"`
	Body map[string]interface{} `json:"body,omitempty"`
}

type TriggerScheduledRuns added in v1.92.0

type TriggerScheduledRuns struct {
	LastRunAt time.Time `json:"last_run_at,omitempty"`
	NextRunAt time.Time `json:"next_run_at,omitempty"`
}

type UntagResourcesRequest added in v1.0.0

type UntagResourcesRequest struct {
	Resources []Resource `json:"resources"`
}

UntagResourcesRequest represents the JSON structure of a request of that type.

type UpdateCustomEvaluationMetricRequest added in v1.198.0

type UpdateCustomEvaluationMetricRequest struct {
	MetricUUID  string                        `json:"metric_uuid,omitempty"`
	MetricName  string                        `json:"metric_name,omitempty"`
	Description string                        `json:"description,omitempty"`
	Config      *CustomEvaluationMetricConfig `json:"config,omitempty"`
}

UpdateCustomEvaluationMetricRequest is the request payload for updating a custom evaluation metric.

type UpdateGarbageCollectionRequest added in v1.50.0

type UpdateGarbageCollectionRequest struct {
	Cancel bool `json:"cancel"`
}

UpdateGarbageCollectionRequest represents a request to update a garbage collection.

type UpdateKnowledgeBaseRequest added in v1.152.0

type UpdateKnowledgeBaseRequest struct {
	DatabaseID         string   `json:"database_id"`
	EmbeddingModelUuid string   `json:"embedding_model_uuid"`
	Name               string   `json:"name"`
	ProjectID          string   `json:"project_id"`
	Tags               []string `json:"tags"`
	KnowledgeBaseUUID  string   `json:"uuid"`
}

type UpdateModelEvaluationRunRequest added in v1.195.0

type UpdateModelEvaluationRunRequest struct {
	Name string `json:"name,omitempty"`
}

UpdateModelEvaluationRunRequest represents the request payload for updating a model evaluation run. Currently only the run's display name can be updated.

type UpdateProjectRequest added in v1.6.0

type UpdateProjectRequest struct {
	Name        interface{}
	Description interface{}
	Purpose     interface{}
	Environment interface{}
	IsDefault   interface{}
}

UpdateProjectRequest represents the request to update project information. This type expects certain attribute types, but is built this way to allow nil values as well. See `updateProjectRequest` for the "real" types.

func (*UpdateProjectRequest) MarshalJSON added in v1.6.0

func (upr *UpdateProjectRequest) MarshalJSON() ([]byte, error)

MarshalJSON takes an UpdateRequest and converts it to the "typed" request which is sent to the projects API. This is a PATCH request, which allows partial attributes, so `null` values are OK.

type UpdateScenarioSetRequest added in v1.206.0

type UpdateScenarioSetRequest struct {
	ScenarioSetUUID string      `json:"scenario_set_uuid,omitempty"`
	Name            string      `json:"name,omitempty"`
	Scenarios       []*Scenario `json:"scenarios,omitempty"`
}

UpdateScenarioSetRequest updates a scenario set name and/or replaces its scenarios.

type UpdateSimulationRunRequest added in v1.206.0

type UpdateSimulationRunRequest struct {
	RunUUID string `json:"run_uuid,omitempty"`
	Name    string `json:"name,omitempty"`
}

UpdateSimulationRunRequest renames a simulation run.

type UpdateUptimeAlertRequest added in v1.94.0

type UpdateUptimeAlertRequest struct {
	Name          string          `json:"name"`
	Type          string          `json:"type"`
	Threshold     int             `json:"threshold"`
	Comparison    UptimeAlertComp `json:"comparison"`
	Notifications *Notifications  `json:"notifications"`
	Period        string          `json:"period"`
}

UpdateUptimeAlertRequest represents the request to update an alert.

type UpdateUptimeCheckRequest added in v1.94.0

type UpdateUptimeCheckRequest struct {
	Name    string   `json:"name"`
	Type    string   `json:"type"`
	Target  string   `json:"target"`
	Regions []string `json:"regions"`
	Enabled bool     `json:"enabled"`
}

UpdateUptimeCheckRequest represents the request to update uptime check information.

type UpgradeBuildpackOptions added in v1.88.0

type UpgradeBuildpackOptions struct {
	// The ID of the buildpack to upgrade.
	BuildpackID string `json:"buildpack_id,omitempty"`
	// The Major Version to upgrade the buildpack to. If omitted, the latest available major version will be used.
	MajorVersion int32 `json:"major_version,omitempty"`
	// Whether or not to trigger a deployment for the app after upgrading the buildpack.
	TriggerDeployment bool `json:"trigger_deployment,omitempty"`
}

UpgradeBuildpackOptions struct for UpgradeBuildpackOptions

type UpgradeBuildpackResponse added in v1.85.0

type UpgradeBuildpackResponse struct {
	// The components that were affected by the upgrade.
	AffectedComponents []string    `json:"affected_components,omitempty"`
	Deployment         *Deployment `json:"deployment,omitempty"`
}

UpgradeBuildpackResponse struct for UpgradeBuildpackResponse

func (*UpgradeBuildpackResponse) GetAffectedComponents added in v1.85.0

func (u *UpgradeBuildpackResponse) GetAffectedComponents() []string

GetAffectedComponents returns the AffectedComponents field.

func (*UpgradeBuildpackResponse) GetDeployment added in v1.85.0

func (u *UpgradeBuildpackResponse) GetDeployment() *Deployment

GetDeployment returns the Deployment field.

type UpgradeVersionRequest added in v1.95.0

type UpgradeVersionRequest struct {
	Version string `json:"version"`
}

type UptimeAlert added in v1.94.0

type UptimeAlert struct {
	ID            string          `json:"id"`
	Name          string          `json:"name"`
	Type          string          `json:"type"`
	Threshold     int             `json:"threshold"`
	Comparison    UptimeAlertComp `json:"comparison"`
	Notifications *Notifications  `json:"notifications"`
	Period        string          `json:"period"`
}

UptimeAlert represents a DigitalOcean Uptime Alert configuration.

type UptimeAlertComp added in v1.104.0

type UptimeAlertComp string

UptimeAlertComp represents an uptime alert comparison operation

const (

	// UptimeAlertGreaterThan is the comparison >
	UptimeAlertGreaterThan UptimeAlertComp = "greater_than"
	// UptimeAlertLessThan is the comparison <
	UptimeAlertLessThan UptimeAlertComp = "less_than"
)

type UptimeCheck added in v1.94.0

type UptimeCheck struct {
	ID      string   `json:"id"`
	Name    string   `json:"name"`
	Type    string   `json:"type"`
	Target  string   `json:"target"`
	Regions []string `json:"regions"`
	Enabled bool     `json:"enabled"`
}

UptimeCheck represents a DigitalOcean UptimeCheck configuration.

type UptimeCheckState added in v1.94.0

type UptimeCheckState struct {
	Regions        map[string]UptimeRegion `json:"regions"`
	PreviousOutage UptimePreviousOutage    `json:"previous_outage"`
}

UptimeCheckState represents a DigitalOcean Uptime Check's state configuration.

type UptimeChecksServiceOp added in v1.94.0

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

UptimeChecksServiceOp handles communication with Uptime Check methods of the DigitalOcean API.

func (*UptimeChecksServiceOp) Create added in v1.94.0

Create a new uptime check.

func (*UptimeChecksServiceOp) CreateAlert added in v1.94.0

func (p *UptimeChecksServiceOp) CreateAlert(ctx context.Context, uptimeCheckID string, cr *CreateUptimeAlertRequest) (*UptimeAlert, *Response, error)

CreateAlert creates a new check alert.

func (*UptimeChecksServiceOp) Delete added in v1.94.0

func (p *UptimeChecksServiceOp) Delete(ctx context.Context, uptimeCheckID string) (*Response, error)

Delete an existing uptime check.

func (*UptimeChecksServiceOp) DeleteAlert added in v1.94.0

func (p *UptimeChecksServiceOp) DeleteAlert(ctx context.Context, uptimeCheckID string, alertID string) (*Response, error)

DeleteAlert deletes an existing check's alert.

func (*UptimeChecksServiceOp) Get added in v1.94.0

func (p *UptimeChecksServiceOp) Get(ctx context.Context, uptimeCheckID string) (*UptimeCheck, *Response, error)

Get retrieves a single uptime check by its ID.

func (*UptimeChecksServiceOp) GetAlert added in v1.94.0

func (p *UptimeChecksServiceOp) GetAlert(ctx context.Context, uptimeCheckID string, alertID string) (*UptimeAlert, *Response, error)

GetAlert retrieves a single uptime check alert by its ID.

func (*UptimeChecksServiceOp) GetState added in v1.94.0

func (p *UptimeChecksServiceOp) GetState(ctx context.Context, uptimeCheckID string) (*UptimeCheckState, *Response, error)

GetState of uptime check.

func (*UptimeChecksServiceOp) List added in v1.94.0

List Checks.

func (*UptimeChecksServiceOp) ListAlerts added in v1.94.0

func (p *UptimeChecksServiceOp) ListAlerts(ctx context.Context, uptimeCheckID string, opts *ListOptions) ([]UptimeAlert, *Response, error)

ListAlerts lists alerts for a check.

func (*UptimeChecksServiceOp) Update added in v1.94.0

Update an uptime check.

func (*UptimeChecksServiceOp) UpdateAlert added in v1.94.0

func (p *UptimeChecksServiceOp) UpdateAlert(ctx context.Context, uptimeCheckID string, alertID string, ur *UpdateUptimeAlertRequest) (*UptimeAlert, *Response, error)

UpdateAlert updates an check's alert.

type UptimePreviousOutage added in v1.94.0

type UptimePreviousOutage struct {
	Region          string `json:"region"`
	StartedAt       string `json:"started_at"`
	EndedAt         string `json:"ended_at"`
	DurationSeconds int    `json:"duration_seconds"`
}

UptimePreviousOutage represents a DigitalOcean Uptime Check's previous outage configuration.

type UptimeRegion added in v1.94.0

type UptimeRegion struct {
	Status                    string  `json:"status"`
	StatusChangedAt           string  `json:"status_changed_at"`
	ThirtyDayUptimePercentage float32 `json:"thirty_day_uptime_percentage"`
}

type VCSSourceSpec added in v1.85.0

type VCSSourceSpec interface {
	SourceSpec
	GetRepo() string
	GetBranch() string
}

VCSSourceSpec represents a VCS source.

type VPC added in v1.11.0

type VPC struct {
	ID          string    `json:"id,omitempty"`
	URN         string    `json:"urn"`
	Name        string    `json:"name,omitempty"`
	Description string    `json:"description,omitempty"`
	IPRange     string    `json:"ip_range,omitempty"`
	RegionSlug  string    `json:"region,omitempty"`
	CreatedAt   time.Time `json:"created_at,omitempty"`
	Default     bool      `json:"default,omitempty"`
}

VPC represents a DigitalOcean Virtual Private Cloud configuration.

type VPCCreateRequest added in v1.11.0

type VPCCreateRequest struct {
	Name        string `json:"name,omitempty"`
	RegionSlug  string `json:"region,omitempty"`
	Description string `json:"description,omitempty"`
	IPRange     string `json:"ip_range,omitempty"`
}

VPCCreateRequest represents a request to create a Virtual Private Cloud.

type VPCListMembersRequest added in v1.59.0

type VPCListMembersRequest struct {
	ResourceType string `url:"resource_type,omitempty"`
}

type VPCMember added in v1.59.0

type VPCMember struct {
	URN       string    `json:"urn,omitempty"`
	Name      string    `json:"name,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`
}

type VPCNATGateway added in v1.149.0

type VPCNATGateway struct {
	ID                 string        `json:"id"`
	Name               string        `json:"name"`
	Type               string        `json:"type"`
	State              string        `json:"state"`
	Region             string        `json:"region"`
	Size               uint32        `json:"size"`
	VPCs               []*IngressVPC `json:"vpcs"`
	Egresses           *Egresses     `json:"egresses,omitempty"`
	UDPTimeoutSeconds  uint32        `json:"udp_timeout_seconds,omitempty"`
	ICMPTimeoutSeconds uint32        `json:"icmp_timeout_seconds,omitempty"`
	TCPTimeoutSeconds  uint32        `json:"tcp_timeout_seconds,omitempty"`
	CreatedAt          time.Time     `json:"created_at"`
	UpdatedAt          time.Time     `json:"updated_at"`
	ProjectID          string        `json:"project_id,omitempty"`
}

VPCNATGateway represents a DigitalOcean VPC NAT Gateway resource

type VPCNATGatewayRequest added in v1.149.0

type VPCNATGatewayRequest struct {
	Name               string        `json:"name"`
	Type               string        `json:"type"`
	Region             string        `json:"region"`
	Size               uint32        `json:"size"`
	VPCs               []*IngressVPC `json:"vpcs"`
	Egresses           *Egresses     `json:"egresses,omitempty"`
	UDPTimeoutSeconds  uint32        `json:"udp_timeout_seconds,omitempty"`
	ICMPTimeoutSeconds uint32        `json:"icmp_timeout_seconds,omitempty"`
	TCPTimeoutSeconds  uint32        `json:"tcp_timeout_seconds,omitempty"`
	ProjectID          string        `json:"project_id,omitempty"`
}

VPCNATGatewayRequest represents a DigitalOcean VPC NAT Gateway create/update request

type VPCNATGatewaysListOptions added in v1.149.0

type VPCNATGatewaysListOptions struct {
	ListOptions
	State  []string `url:"state,omitempty"`
	Region []string `url:"region,omitempty"`
	Type   []string `url:"type,omitempty"`
	Name   []string `url:"name,omitempty"`
}

VPCNATGatewaysListOptions define custom options for listing VPC NAT Gateways

type VPCNATGatewaysService added in v1.149.0

VPCNATGatewaysService defines an interface for managing VPC NAT Gateways through the DigitalOcean API

type VPCNATGatewaysServiceOp added in v1.149.0

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

VPCNATGatewaysServiceOp handles communication with VPC NAT Gateway methods of the DigitalOcean API

func (*VPCNATGatewaysServiceOp) Create added in v1.149.0

Create a new VPC NAT Gateway

func (*VPCNATGatewaysServiceOp) Delete added in v1.149.0

Delete an existing VPC NAT Gateway

func (*VPCNATGatewaysServiceOp) Get added in v1.149.0

Get an existing VPC NAT Gateway

func (*VPCNATGatewaysServiceOp) List added in v1.149.0

List all active VPC NAT Gateways

func (*VPCNATGatewaysServiceOp) Update added in v1.149.0

Update an existing VPC NAT Gateway

type VPCPeering added in v1.116.0

type VPCPeering struct {
	// ID is the generated ID of the VPC Peering
	ID string `json:"id"`
	// Name is the name of the VPC Peering
	Name string `json:"name"`
	// VPCIDs is the IDs of the pair of VPCs between which a peering is created
	VPCIDs []string `json:"vpc_ids"`
	// CreatedAt is time when this VPC Peering was first created
	CreatedAt time.Time `json:"created_at"`
	// Status is the status of the VPC Peering
	Status string `json:"status"`
}

VPCPeering represents a DigitalOcean Virtual Private Cloud Peering configuration.

type VPCPeeringCreateRequest added in v1.116.0

type VPCPeeringCreateRequest struct {
	// Name is the name of the VPC Peering
	Name string `json:"name"`
	// VPCIDs is the IDs of the pair of VPCs between which a peering is created
	VPCIDs []string `json:"vpc_ids"`
}

VPCPeeringCreateRequest represents a request to create a Virtual Private Cloud Peering for a list of associated VPC IDs.

type VPCPeeringCreateRequestByVPCID added in v1.116.0

type VPCPeeringCreateRequestByVPCID struct {
	// Name is the name of the VPC Peering
	Name string `json:"name"`
	// VPCID is the ID of one of the VPCs with which the peering has to be created
	VPCID string `json:"vpc_id"`
}

VPCPeeringCreateRequestByVPCID represents a request to create a Virtual Private Cloud Peering for an associated VPC ID.

type VPCPeeringUpdateRequest added in v1.116.0

type VPCPeeringUpdateRequest struct {
	// Name is the name of the VPC Peering
	Name string `json:"name"`
}

VPCPeeringUpdateRequest represents a request to update a Virtual Private Cloud Peering.

type VPCSetDescription added in v1.34.0

type VPCSetDescription string

VPCSetDescription is used when one want to set the `description` field of a VPC. Ex.: VPCs.Set(..., VPCSetDescription("vpc description"))

type VPCSetField added in v1.11.0

type VPCSetField interface {
	// contains filtered or unexported methods
}

VPCSetField allows one to set individual fields within a VPC configuration.

func VPCSetDefault added in v1.50.0

func VPCSetDefault() VPCSetField

VPCSetDefault is used when one wants to enable the `default` field of a VPC, to set a VPC as the default one in the region Ex.: VPCs.Set(..., VPCSetDefault())

type VPCSetName added in v1.11.0

type VPCSetName string

VPCSetName is used when one want to set the `name` field of a VPC. Ex.: VPCs.Set(..., VPCSetName("new-name"))

type VPCSubnet added in v1.207.0

type VPCSubnet struct {
	ID        string    `json:"id,omitempty"`
	VPCID     string    `json:"vpc_id,omitempty"`
	Name      string    `json:"name,omitempty"`
	IPRange   string    `json:"ip_range,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`
	Default   bool      `json:"default,omitempty"`
	Type      string    `json:"type,omitempty"`
	URN       string    `json:"urn,omitempty"`
	Region    string    `json:"region,omitempty"`
}

VPCSubnet represents a subnet within a VPC.

type VPCSubnetCreateRequest added in v1.207.0

type VPCSubnetCreateRequest struct {
	Name    string `json:"name"`
	IPRange string `json:"ip_range,omitempty"`
}

VPCSubnetCreateRequest represents a request to create a subnet within a VPC.

type VPCSubnetUpdateRequest added in v1.207.0

type VPCSubnetUpdateRequest struct {
	Name string `json:"name,omitempty"`
}

VPCSubnetUpdateRequest represents a request to update a subnet.

type VPCUpdateRequest added in v1.11.0

type VPCUpdateRequest struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	Default     *bool  `json:"default,omitempty"`
}

VPCUpdateRequest represents a request to update a Virtual Private Cloud.

type VPCsService added in v1.11.0

type VPCsService interface {
	Create(context.Context, *VPCCreateRequest) (*VPC, *Response, error)
	Get(context.Context, string) (*VPC, *Response, error)
	List(context.Context, *ListOptions) ([]*VPC, *Response, error)
	ListMembers(context.Context, string, *VPCListMembersRequest, *ListOptions) ([]*VPCMember, *Response, error)
	Update(context.Context, string, *VPCUpdateRequest) (*VPC, *Response, error)
	Set(context.Context, string, ...VPCSetField) (*VPC, *Response, error)
	Delete(context.Context, string) (*Response, error)
	CreateSubnet(context.Context, string, *VPCSubnetCreateRequest) (*VPCSubnet, *Response, error)
	GetSubnet(context.Context, string, string) (*VPCSubnet, *Response, error)
	ListSubnets(context.Context, string, *ListOptions) ([]*VPCSubnet, *Response, error)
	UpdateSubnet(context.Context, string, string, *VPCSubnetUpdateRequest) (*VPCSubnet, *Response, error)
	DeleteSubnet(context.Context, string, string) (*Response, error)
	CreateVPCPeering(context.Context, *VPCPeeringCreateRequest) (*VPCPeering, *Response, error)
	GetVPCPeering(context.Context, string) (*VPCPeering, *Response, error)
	ListVPCPeerings(context.Context, *ListOptions) ([]*VPCPeering, *Response, error)
	UpdateVPCPeering(context.Context, string, *VPCPeeringUpdateRequest) (*VPCPeering, *Response, error)
	DeleteVPCPeering(context.Context, string) (*Response, error)
	CreateVPCPeeringByVPCID(context.Context, string, *VPCPeeringCreateRequestByVPCID) (*VPCPeering, *Response, error)
	ListVPCPeeringsByVPCID(context.Context, string, *ListOptions) ([]*VPCPeering, *Response, error)
	UpdateVPCPeeringByVPCID(context.Context, string, string, *VPCPeeringUpdateRequest) (*VPCPeering, *Response, error)
}

VPCsService is an interface for managing Virtual Private Cloud configurations with the DigitalOcean API. See: https://docs.digitalocean.com/reference/api/api-reference/#tag/VPCs

type VPCsServiceOp added in v1.11.0

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

VPCsServiceOp interfaces with VPC endpoints in the DigitalOcean API.

func (*VPCsServiceOp) Create added in v1.11.0

func (v *VPCsServiceOp) Create(ctx context.Context, create *VPCCreateRequest) (*VPC, *Response, error)

Create creates a new Virtual Private Cloud.

func (*VPCsServiceOp) CreateSubnet added in v1.207.0

func (v *VPCsServiceOp) CreateSubnet(ctx context.Context, vpcID string, create *VPCSubnetCreateRequest) (*VPCSubnet, *Response, error)

CreateSubnet creates a new subnet within a VPC.

func (*VPCsServiceOp) CreateVPCPeering added in v1.116.0

func (v *VPCsServiceOp) CreateVPCPeering(ctx context.Context, create *VPCPeeringCreateRequest) (*VPCPeering, *Response, error)

CreateVPCPeering creates a new Virtual Private Cloud Peering.

func (*VPCsServiceOp) CreateVPCPeeringByVPCID added in v1.116.0

func (v *VPCsServiceOp) CreateVPCPeeringByVPCID(ctx context.Context, id string, create *VPCPeeringCreateRequestByVPCID) (*VPCPeering, *Response, error)

CreateVPCPeeringByVPCID creates a new Virtual Private Cloud Peering for requested VPC ID.

func (*VPCsServiceOp) Delete added in v1.11.0

func (v *VPCsServiceOp) Delete(ctx context.Context, id string) (*Response, error)

Delete deletes a Virtual Private Cloud. There is no way to recover a VPC once it has been destroyed.

func (*VPCsServiceOp) DeleteSubnet added in v1.207.0

func (v *VPCsServiceOp) DeleteSubnet(ctx context.Context, vpcID string, subnetID string) (*Response, error)

DeleteSubnet deletes a subnet from a VPC.

func (*VPCsServiceOp) DeleteVPCPeering added in v1.116.0

func (v *VPCsServiceOp) DeleteVPCPeering(ctx context.Context, id string) (*Response, error)

DeleteVPCPeering deletes a Virtual Private Cloud Peering.

func (*VPCsServiceOp) Get added in v1.11.0

func (v *VPCsServiceOp) Get(ctx context.Context, id string) (*VPC, *Response, error)

Get returns the details of a Virtual Private Cloud.

func (*VPCsServiceOp) GetSubnet added in v1.207.0

func (v *VPCsServiceOp) GetSubnet(ctx context.Context, vpcID string, subnetID string) (*VPCSubnet, *Response, error)

GetSubnet retrieves a specific subnet by ID.

func (*VPCsServiceOp) GetVPCPeering added in v1.116.0

func (v *VPCsServiceOp) GetVPCPeering(ctx context.Context, id string) (*VPCPeering, *Response, error)

GetVPCPeering retrieves a Virtual Private Cloud Peering.

func (*VPCsServiceOp) List added in v1.11.0

func (v *VPCsServiceOp) List(ctx context.Context, opt *ListOptions) ([]*VPC, *Response, error)

List returns a list of the caller's VPCs, with optional pagination.

func (*VPCsServiceOp) ListMembers added in v1.59.0

func (v *VPCsServiceOp) ListMembers(ctx context.Context, id string, request *VPCListMembersRequest, opt *ListOptions) ([]*VPCMember, *Response, error)

func (*VPCsServiceOp) ListSubnets added in v1.207.0

func (v *VPCsServiceOp) ListSubnets(ctx context.Context, vpcID string, opt *ListOptions) ([]*VPCSubnet, *Response, error)

ListSubnets lists all subnets within a VPC.

func (*VPCsServiceOp) ListVPCPeerings added in v1.116.0

func (v *VPCsServiceOp) ListVPCPeerings(ctx context.Context, opt *ListOptions) ([]*VPCPeering, *Response, error)

ListVPCPeerings lists all Virtual Private Cloud Peerings.

func (*VPCsServiceOp) ListVPCPeeringsByVPCID added in v1.116.0

func (v *VPCsServiceOp) ListVPCPeeringsByVPCID(ctx context.Context, id string, opt *ListOptions) ([]*VPCPeering, *Response, error)

ListVPCPeeringsByVPCID lists all Virtual Private Cloud Peerings for requested VPC ID.

func (*VPCsServiceOp) Set added in v1.11.0

func (v *VPCsServiceOp) Set(ctx context.Context, id string, fields ...VPCSetField) (*VPC, *Response, error)

Set updates specific properties of a Virtual Private Cloud.

func (*VPCsServiceOp) Update added in v1.11.0

func (v *VPCsServiceOp) Update(ctx context.Context, id string, update *VPCUpdateRequest) (*VPC, *Response, error)

Update updates a Virtual Private Cloud's properties.

func (*VPCsServiceOp) UpdateSubnet added in v1.207.0

func (v *VPCsServiceOp) UpdateSubnet(ctx context.Context, vpcID string, subnetID string, update *VPCSubnetUpdateRequest) (*VPCSubnet, *Response, error)

UpdateSubnet updates a subnet's properties.

func (*VPCsServiceOp) UpdateVPCPeering added in v1.116.0

func (v *VPCsServiceOp) UpdateVPCPeering(ctx context.Context, id string, update *VPCPeeringUpdateRequest) (*VPCPeering, *Response, error)

UpdateVPCPeering updates a Virtual Private Cloud Peering.

func (*VPCsServiceOp) UpdateVPCPeeringByVPCID added in v1.116.0

func (v *VPCsServiceOp) UpdateVPCPeeringByVPCID(ctx context.Context, vpcID, peerID string, update *VPCPeeringUpdateRequest) (*VPCPeering, *Response, error)

UpdateVPCPeeringByVPCID updates a Virtual Private Cloud Peering for requested VPC ID.

type VRAM added in v1.129.0

type VRAM struct {
	Amount int    `json:"amount,omitempty"`
	Unit   string `json:"unit,omitempty"`
}

VRAM provides information about the amount of VRAM available to the GPU.

type ValkeyConfig added in v1.162.0

type ValkeyConfig struct {
	ValkeyMaxmemoryPolicy               *string `json:"valkey_maxmemory_policy,omitempty"`
	ValkeyIOThreads                     *int    `json:"valkey_io_threads,omitempty"`
	ValkeyLFULogFactor                  *int    `json:"valkey_lfu_log_factor,omitempty"`
	ValkeyLFUDecayTime                  *int    `json:"valkey_lfu_decay_time,omitempty"`
	ValkeySSL                           *bool   `json:"valkey_ssl,omitempty"`
	ValkeyTimeout                       *int    `json:"valkey_timeout,omitempty"`
	ValkeyNotifyKeyspaceEvents          *string `json:"valkey_notify_keyspace_events,omitempty"`
	ValkeyPersistence                   *string `json:"valkey_persistence,omitempty"`
	ValkeyACLChannelsDefault            *string `json:"valkey_acl_channels_default,omitempty"`
	FrequentSnapshots                   *bool   `json:"frequent_snapshots,omitempty"`
	ValkeyActiveExpireEffort            *int    `json:"valkey_active_expire_effort,omitempty"`
	ValkeyPubSubClientOutputBufferLimit *int    `json:"valkey_pubsub_client_output_buffer_limit,omitempty"`
	ValkeyNumberOfDatabases             *int    `json:"valkey_number_of_databases,omitempty"`
}

ValkeyConfig holds advanced configurations for Valkey database clusters.

type VectorDB added in v1.193.0

type VectorDB struct {
	ID        string             `json:"id,omitempty"`
	Name      string             `json:"name,omitempty"`
	Region    string             `json:"region,omitempty"`
	OwnerUUID string             `json:"owner_uuid,omitempty"`
	Status    string             `json:"status,omitempty"`
	Config    *VectorDBConfig    `json:"config,omitempty"`
	CreatedAt time.Time          `json:"created_at,omitempty"`
	UpdatedAt time.Time          `json:"updated_at,omitempty"`
	Endpoints *VectorDBEndpoints `json:"endpoints,omitempty"`
	Size      string             `json:"size,omitempty"`
	Tags      []string           `json:"tags,omitempty"`
}

VectorDB represents a provisioned vector database instance.

type VectorDBAdminCredentials added in v1.193.0

type VectorDBAdminCredentials struct {
	UserID   string `json:"user_id,omitempty"`
	APIToken string `json:"api_token,omitempty"`
}

VectorDBAdminCredentials represents admin credentials for a vector database.

type VectorDBBackup added in v1.193.0

type VectorDBBackup struct {
	BackupID    string    `json:"backup_id,omitempty"`
	Status      string    `json:"status,omitempty"`
	StartedAt   time.Time `json:"started_at,omitempty"`
	CompletedAt time.Time `json:"completed_at,omitempty"`
}

VectorDBBackup represents a single backup of a vector database.

type VectorDBConfig added in v1.193.0

type VectorDBConfig struct {
	DefaultQuantization string `json:"default_quantization,omitempty"`
	EnableAutoSchema    bool   `json:"enable_auto_schema,omitempty"`
	WeaviateVersion     string `json:"weaviate_version,omitempty"`
}

VectorDBConfig holds optional, advanced cluster settings.

type VectorDBCreateRequest added in v1.193.0

type VectorDBCreateRequest struct {
	Name      string   `json:"name,omitempty"`
	Region    string   `json:"region,omitempty"`
	Size      string   `json:"size,omitempty"`
	Tags      []string `json:"tags,omitempty"`
	ProjectID string   `json:"project_id,omitempty"`
}

VectorDBCreateRequest represents a request to create a vector database.

type VectorDBEndpoints added in v1.193.0

type VectorDBEndpoints struct {
	HTTP string `json:"http,omitempty"`
	GRPC string `json:"grpc,omitempty"`
}

VectorDBEndpoints contains the connection endpoints for a vector database instance.

type VectorDBResizeRequest added in v1.193.0

type VectorDBResizeRequest struct {
	ID   string `json:"id,omitempty"`
	Size string `json:"size,omitempty"`
}

VectorDBResizeRequest represents a request to resize a vector database.

type VectorDBRestoreBackupRequest added in v1.193.0

type VectorDBRestoreBackupRequest struct {
	ID       string `json:"id,omitempty"`
	BackupID string `json:"backup_id,omitempty"`
}

VectorDBRestoreBackupRequest represents a request to restore a vector database from a backup.

type VectorDBRestoreBackupResponse added in v1.193.0

type VectorDBRestoreBackupResponse struct {
	BackupID string `json:"backup_id,omitempty"`
	Status   string `json:"status,omitempty"`
}

VectorDBRestoreBackupResponse represents the initial response from a restore operation.

type VectorDBRestoreStatus added in v1.193.0

type VectorDBRestoreStatus struct {
	BackupID string `json:"backup_id,omitempty"`
	Status   string `json:"status,omitempty"`
	Error    string `json:"error,omitempty"`
}

VectorDBRestoreStatus represents the current status of a restore operation.

type VectorDBUpdateRequest added in v1.193.0

type VectorDBUpdateRequest struct {
	ID     string          `json:"id,omitempty"`
	Config *VectorDBConfig `json:"config,omitempty"`
}

VectorDBUpdateRequest represents a request to update a vector database.

type VectorDBUpdateTagsRequest added in v1.193.0

type VectorDBUpdateTagsRequest struct {
	ID   string   `json:"id,omitempty"`
	Tags []string `json:"tags,omitempty"`
}

VectorDBUpdateTagsRequest represents a request to update tags on a vector database.

type VectorDBsServiceOp added in v1.193.0

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

VectorDBsServiceOp handles communication with the Vector DB related methods of the DigitalOcean API.

func (*VectorDBsServiceOp) Create added in v1.193.0

Create creates a vector database.

func (*VectorDBsServiceOp) Delete added in v1.193.0

func (svc *VectorDBsServiceOp) Delete(ctx context.Context, id string) (*Response, error)

Delete deletes a vector database. There is no way to recover an instance once it has been destroyed.

func (*VectorDBsServiceOp) Get added in v1.193.0

Get retrieves the details of a vector database.

func (*VectorDBsServiceOp) GetCredentials added in v1.193.0

func (svc *VectorDBsServiceOp) GetCredentials(ctx context.Context, id string) (*VectorDBAdminCredentials, *Response, error)

GetCredentials retrieves admin credentials for a vector database.

func (*VectorDBsServiceOp) GetRestoreStatus added in v1.193.0

func (svc *VectorDBsServiceOp) GetRestoreStatus(ctx context.Context, id, backupID string) (*VectorDBRestoreStatus, *Response, error)

GetRestoreStatus returns the current status of a restore operation.

func (*VectorDBsServiceOp) List added in v1.193.0

func (svc *VectorDBsServiceOp) List(ctx context.Context, opts *ListOptions) ([]VectorDB, *Response, error)

List returns a list of vector databases visible with the caller's API token.

func (*VectorDBsServiceOp) ListBackups added in v1.193.0

func (svc *VectorDBsServiceOp) ListBackups(ctx context.Context, id string) ([]VectorDBBackup, *Response, error)

ListBackups returns the available backups for a vector database. Only backups with status SUCCESS are returned.

func (*VectorDBsServiceOp) Resize added in v1.193.0

Resize resizes a vector database to a new resource tier.

func (*VectorDBsServiceOp) RestoreBackup added in v1.193.0

RestoreBackup initiates a restore from a backup. The restore is performed asynchronously; use GetRestoreStatus to monitor progress.

func (*VectorDBsServiceOp) Update added in v1.193.0

Update updates a vector database's configuration.

func (*VectorDBsServiceOp) UpdateTags added in v1.193.0

func (svc *VectorDBsServiceOp) UpdateTags(ctx context.Context, id string, update *VectorDBUpdateTagsRequest) (*VectorDB, *Response, error)

UpdateTags replaces all tags on a vector database.

type Volume added in v1.0.0

type Volume struct {
	ID              string    `json:"id"`
	Region          *Region   `json:"region"`
	Name            string    `json:"name"`
	SizeGigaBytes   int64     `json:"size_gigabytes"`
	Description     string    `json:"description"`
	DropletIDs      []int     `json:"droplet_ids"`
	CreatedAt       time.Time `json:"created_at"`
	FilesystemType  string    `json:"filesystem_type"`
	FilesystemLabel string    `json:"filesystem_label"`
	Tags            []string  `json:"tags"`
}

Volume represents a Digital Ocean block store volume.

func (Volume) String added in v1.0.0

func (f Volume) String() string

func (Volume) URN added in v1.6.0

func (f Volume) URN() string

URN returns the volume ID as a valid DO API URN

type VolumeCreateRequest added in v1.0.0

type VolumeCreateRequest struct {
	Region          string   `json:"region"`
	Name            string   `json:"name"`
	Description     string   `json:"description"`
	SizeGigaBytes   int64    `json:"size_gigabytes"`
	SnapshotID      string   `json:"snapshot_id"`
	FilesystemType  string   `json:"filesystem_type"`
	FilesystemLabel string   `json:"filesystem_label"`
	Tags            []string `json:"tags"`
}

VolumeCreateRequest represents a request to create a block store volume.

type WebCrawlerDataSource added in v1.152.0

type WebCrawlerDataSource struct {
	BaseUrl        string `json:"base_url,omitempty"`
	CrawlingOption string `json:"crawling_option,omitempty"`
	EmbedMedia     bool   `json:"embed_media,omitempty"`
}

WebCrawlerDataSource represents the web crawler data source information

type WebhookBasicAuth added in v1.218.0

type WebhookBasicAuth struct {
	Username string `json:"username"`
	Password string `json:"password,omitempty"`
}

WebhookBasicAuth is HTTP basic auth for a webhook. Password is write-only.

type WebhookBearerToken added in v1.218.0

type WebhookBearerToken struct {
	Token string `json:"token,omitempty"`
}

WebhookBearerToken is bearer auth for a webhook. Token is write-only.

type WebhookNotificationConfig added in v1.218.0

type WebhookNotificationConfig struct {
	URL         string                  `json:"url"`
	BasicAuth   *WebhookBasicAuth       `json:"basic_auth,omitempty"`
	BearerToken *WebhookBearerToken     `json:"bearer_token,omitempty"`
	Headers     map[string]string       `json:"headers,omitempty"`
	Signature   *WebhookSignatureConfig `json:"signature,omitempty"`
}

WebhookNotificationConfig is an HTTPS webhook notification channel. URL is returned in full on read. Credential fields are write-only and masked on read; leave a secret empty on update to keep the existing value. Set BasicAuth or BearerToken, not both.

type WebhookSignatureConfig added in v1.218.0

type WebhookSignatureConfig struct {
	Secret string `json:"secret,omitempty"`
}

WebhookSignatureConfig is the HMAC signing secret for a webhook. Secret is write-only.

type Workspace added in v1.171.0

type Workspace struct {
	UUID                string                `json:"uuid,omitempty"`
	Name                string                `json:"name,omitempty"`
	Description         string                `json:"description,omitempty"`
	CreatedByEmail      string                `json:"created_by_email,omitempty"`
	CreatedBy           string                `json:"created_by,omitempty"`
	CreatedAt           *Timestamp            `json:"created_at,omitempty"`
	UpdatedAt           *Timestamp            `json:"updated_at,omitempty"`
	DeletedAt           *Timestamp            `json:"deleted_at,omitempty"`
	Agents              []*Agent              `json:"agents,omitempty"`
	EvaluationTestCases []*EvaluationTestCase `json:"evaluation_test_cases,omitempty"`
}

Workspace represents a workspace containing agents and evaluation test cases.

Directories

Path Synopsis
examples
agent-inference/chat-completion command
Command chat-completion runs a non-streaming chat completion against a DigitalOcean Agent Inference endpoint.
Command chat-completion runs a non-streaming chat completion against a DigitalOcean Agent Inference endpoint.
agent-platform/cancel-model-evaluation-run command
Command cancel-model-evaluation-run cancels an in-progress model evaluation run via the Agent Platform API.
Command cancel-model-evaluation-run cancels an in-progress model evaluation run via the Agent Platform API.
agent-platform/create-model-eval-dataset-upload-presigned-urls command
Command create-model-eval-dataset-upload-presigned-urls creates presigned URLs that can be used to upload model evaluation dataset files via the Agent Platform API.
Command create-model-eval-dataset-upload-presigned-urls creates presigned URLs that can be used to upload model evaluation dataset files via the Agent Platform API.
agent-platform/create-model-evaluation-run command
Command create-model-evaluation-run creates a new model evaluation run via the Agent Platform API.
Command create-model-evaluation-run creates a new model evaluation run via the Agent Platform API.
agent-platform/delete-model-evaluation-preset command
Command delete-model-evaluation-preset deletes a saved model evaluation preset via the Agent Platform API.
Command delete-model-evaluation-preset deletes a saved model evaluation preset via the Agent Platform API.
agent-platform/get-model-evaluation-preset command
Command get-model-evaluation-preset retrieves a saved model evaluation preset via the Agent Platform API.
Command get-model-evaluation-preset retrieves a saved model evaluation preset via the Agent Platform API.
agent-platform/get-model-evaluation-run command
Command get-model-evaluation-run retrieves a model evaluation run, including the run summary, aggregated result metrics, and a paginated list of per-prompt results, via the Agent Platform API.
Command get-model-evaluation-run retrieves a model evaluation run, including the run summary, aggregated result metrics, and a paginated list of per-prompt results, via the Agent Platform API.
agent-platform/get-model-evaluation-run-results-download-url command
Command get-model-evaluation-run-results-download-url returns a presigned download URL for a model evaluation run's results (gzip-compressed JSON) via the Agent Platform API.
Command get-model-evaluation-run-results-download-url returns a presigned download URL for a model evaluation run's results (gzip-compressed JSON) via the Agent Platform API.
agent-platform/list-evaluation-datasets command
Command list-evaluation-datasets lists evaluation datasets via the Agent Platform API.
Command list-evaluation-datasets lists evaluation datasets via the Agent Platform API.
agent-platform/list-model-evaluation-metrics command
Command list-model-evaluation-metrics lists all available metrics that can be selected when creating a model evaluation run, via the Agent Platform API.
Command list-model-evaluation-metrics lists all available metrics that can be selected when creating a model evaluation run, via the Agent Platform API.
agent-platform/list-model-evaluation-presets command
Command list-model-evaluation-presets lists all saved model evaluation presets via the Agent Platform API.
Command list-model-evaluation-presets lists all saved model evaluation presets via the Agent Platform API.
agent-platform/list-model-evaluation-runs command
Command list-model-evaluation-runs lists model evaluation runs, optionally filtered by preset UUID, status (single or multiple), candidate model source types, and free-text search.
Command list-model-evaluation-runs lists model evaluation runs, optionally filtered by preset UUID, status (single or multiple), candidate model source types, and free-text search.
insights/smoke command
Smoke the Insights client against a live API.
Smoke the Insights client against a live API.
serverless-inference/chat-completion command
Command chat-completion runs a non-streaming chat completion via the Serverless Inference API.
Command chat-completion runs a non-streaming chat completion via the Serverless Inference API.
serverless-inference/chat-completion-streaming command
Command chat-completion-streaming streams a chat completion via the Serverless Inference API.
Command chat-completion-streaming streams a chat completion via the Serverless Inference API.
serverless-inference/embeddings command
Command embeddings creates embedding vectors via the Serverless Inference API.
Command embeddings creates embedding vectors via the Serverless Inference API.
serverless-inference/image-generation command
Command image-generation generates a single image via the Serverless Inference API and writes it to image.png.
Command image-generation generates a single image via the Serverless Inference API and writes it to image.png.
serverless-inference/image-streaming command
Command image-streaming streams partial-image events via the Serverless Inference API.
Command image-streaming streams partial-image events via the Serverless Inference API.
serverless-inference/list-models command
Command list-models lists the models reachable through the Serverless Inference API.
Command list-models lists the models reachable through the Serverless Inference API.
serverless-inference/messages command
Command messages sends a non-streaming message via the Anthropic-compatible /v1/messages endpoint of the Serverless Inference API.
Command messages sends a non-streaming message via the Anthropic-compatible /v1/messages endpoint of the Serverless Inference API.
serverless-inference/messages-streaming command
Command messages-streaming streams an Anthropic-style message from the Serverless Inference /v1/messages endpoint.
Command messages-streaming streams an Anthropic-style message from the Serverless Inference /v1/messages endpoint.
serverless-inference/responses command
Command responses runs a non-streaming /v1/responses call via the Serverless Inference API.
Command responses runs a non-streaming /v1/responses call via the Serverless Inference API.
serverless-inference/responses-streaming command
Command responses-streaming streams a /v1/responses call via the Serverless Inference API.
Command responses-streaming streams a /v1/responses call via the Serverless Inference API.
Package metrics is a minimal copy of github.com/prometheus/common/model providing types to work with the Prometheus-style results in a DigitalOcean Monitoring metrics response.
Package metrics is a minimal copy of github.com/prometheus/common/model providing types to work with the Prometheus-style results in a DigitalOcean Monitoring metrics response.

Jump to

Keyboard shortcuts

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