Documentation
¶
Index ¶
- type Account
- type Client
- func (c *Client) CreateDroplet(req CreateDropletRequest) (*Droplet, error)
- func (c *Client) GetAccount() (*Account, error)
- func (c *Client) GetDroplet(dropletID int) (*Droplet, error)
- func (c *Client) ListActions(resourceType string) ([]DOAction, error)
- func (c *Client) ListImages(imageType string) ([]Image, error)
- func (c *Client) ListRegions() ([]Region, error)
- func (c *Client) ListSizes() ([]Size, error)
- type Configuration
- type CreateDroplet
- func (c *CreateDroplet) Actions() []core.Action
- func (c *CreateDroplet) Cancel(ctx core.ExecutionContext) error
- func (c *CreateDroplet) Cleanup(ctx core.SetupContext) error
- func (c *CreateDroplet) Color() string
- func (c *CreateDroplet) Configuration() []configuration.Field
- func (c *CreateDroplet) Description() string
- func (c *CreateDroplet) Documentation() string
- func (c *CreateDroplet) ExampleOutput() map[string]any
- func (c *CreateDroplet) Execute(ctx core.ExecutionContext) error
- func (c *CreateDroplet) HandleAction(ctx core.ActionContext) error
- func (c *CreateDroplet) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
- func (c *CreateDroplet) Icon() string
- func (c *CreateDroplet) Label() string
- func (c *CreateDroplet) Name() string
- func (c *CreateDroplet) OutputChannels(configuration any) []core.OutputChannel
- func (c *CreateDroplet) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (c *CreateDroplet) Setup(ctx core.SetupContext) error
- type CreateDropletRequest
- type CreateDropletSpec
- type DOAPIError
- type DOAction
- type DigitalOcean
- func (d *DigitalOcean) Actions() []core.Action
- func (d *DigitalOcean) Cleanup(ctx core.IntegrationCleanupContext) error
- func (d *DigitalOcean) Components() []core.Component
- func (d *DigitalOcean) Configuration() []configuration.Field
- func (d *DigitalOcean) Description() string
- func (d *DigitalOcean) HandleAction(ctx core.IntegrationActionContext) error
- func (d *DigitalOcean) HandleRequest(ctx core.HTTPRequestContext)
- func (d *DigitalOcean) Icon() string
- func (d *DigitalOcean) Instructions() string
- func (d *DigitalOcean) Label() string
- func (d *DigitalOcean) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
- func (d *DigitalOcean) Name() string
- func (d *DigitalOcean) Sync(ctx core.SyncContext) error
- func (d *DigitalOcean) Triggers() []core.Trigger
- type Droplet
- type DropletImage
- type DropletNetworkV4
- type DropletNetworks
- type DropletRegion
- type Image
- type Metadata
- type Region
- type Size
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
Email string `json:"email"`
UUID string `json:"uuid"`
Status string `json:"status"`
DropletLimit int `json:"droplet_limit"`
}
Account represents a DigitalOcean account
type Client ¶
func NewClient ¶
func NewClient(http core.HTTPContext, ctx core.IntegrationContext) (*Client, error)
func (*Client) CreateDroplet ¶
func (c *Client) CreateDroplet(req CreateDropletRequest) (*Droplet, error)
CreateDroplet creates a new droplet
func (*Client) GetAccount ¶
GetAccount validates the API token by fetching account info
func (*Client) GetDroplet ¶
GetDroplet retrieves a droplet by its ID
func (*Client) ListActions ¶
ListActions retrieves actions filtered by resource type. The DigitalOcean /v2/actions API does not support resource_type as a query parameter, so we fetch all recent actions and filter client-side.
func (*Client) ListImages ¶
ListImages retrieves images of a given type (e.g., "distribution")
func (*Client) ListRegions ¶
ListRegions retrieves all available regions
type Configuration ¶
type Configuration struct {
APIToken string `json:"apiToken"`
}
type CreateDroplet ¶
type CreateDroplet struct{}
func (*CreateDroplet) Actions ¶
func (c *CreateDroplet) Actions() []core.Action
func (*CreateDroplet) Cancel ¶
func (c *CreateDroplet) Cancel(ctx core.ExecutionContext) error
func (*CreateDroplet) Cleanup ¶
func (c *CreateDroplet) Cleanup(ctx core.SetupContext) error
func (*CreateDroplet) Color ¶
func (c *CreateDroplet) Color() string
func (*CreateDroplet) Configuration ¶
func (c *CreateDroplet) Configuration() []configuration.Field
func (*CreateDroplet) Description ¶
func (c *CreateDroplet) Description() string
func (*CreateDroplet) Documentation ¶
func (c *CreateDroplet) Documentation() string
func (*CreateDroplet) ExampleOutput ¶
func (c *CreateDroplet) ExampleOutput() map[string]any
func (*CreateDroplet) Execute ¶
func (c *CreateDroplet) Execute(ctx core.ExecutionContext) error
func (*CreateDroplet) HandleAction ¶
func (c *CreateDroplet) HandleAction(ctx core.ActionContext) error
func (*CreateDroplet) HandleWebhook ¶
func (c *CreateDroplet) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
func (*CreateDroplet) Icon ¶
func (c *CreateDroplet) Icon() string
func (*CreateDroplet) Label ¶
func (c *CreateDroplet) Label() string
func (*CreateDroplet) Name ¶
func (c *CreateDroplet) Name() string
func (*CreateDroplet) OutputChannels ¶
func (c *CreateDroplet) OutputChannels(configuration any) []core.OutputChannel
func (*CreateDroplet) ProcessQueueItem ¶
func (c *CreateDroplet) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
func (*CreateDroplet) Setup ¶
func (c *CreateDroplet) Setup(ctx core.SetupContext) error
type CreateDropletRequest ¶
type CreateDropletRequest struct {
Name string `json:"name"`
Region string `json:"region"`
Size string `json:"size"`
Image string `json:"image"`
SSHKeys []string `json:"ssh_keys,omitempty"`
Tags []string `json:"tags,omitempty"`
UserData string `json:"user_data,omitempty"`
}
CreateDropletRequest is the payload for creating a droplet
type CreateDropletSpec ¶
type DOAPIError ¶
func (*DOAPIError) Error ¶
func (e *DOAPIError) Error() string
type DOAction ¶
type DOAction struct {
ID int `json:"id"`
Status string `json:"status"`
Type string `json:"type"`
StartedAt string `json:"started_at"`
CompletedAt string `json:"completed_at"`
ResourceID int `json:"resource_id"`
ResourceType string `json:"resource_type"`
RegionSlug string `json:"region_slug"`
}
DOAction represents a DigitalOcean action
type DigitalOcean ¶
type DigitalOcean struct{}
func (*DigitalOcean) Actions ¶
func (d *DigitalOcean) Actions() []core.Action
func (*DigitalOcean) Cleanup ¶
func (d *DigitalOcean) Cleanup(ctx core.IntegrationCleanupContext) error
func (*DigitalOcean) Components ¶
func (d *DigitalOcean) Components() []core.Component
func (*DigitalOcean) Configuration ¶
func (d *DigitalOcean) Configuration() []configuration.Field
func (*DigitalOcean) Description ¶
func (d *DigitalOcean) Description() string
func (*DigitalOcean) HandleAction ¶
func (d *DigitalOcean) HandleAction(ctx core.IntegrationActionContext) error
func (*DigitalOcean) HandleRequest ¶
func (d *DigitalOcean) HandleRequest(ctx core.HTTPRequestContext)
func (*DigitalOcean) Icon ¶
func (d *DigitalOcean) Icon() string
func (*DigitalOcean) Instructions ¶
func (d *DigitalOcean) Instructions() string
func (*DigitalOcean) Label ¶
func (d *DigitalOcean) Label() string
func (*DigitalOcean) ListResources ¶
func (d *DigitalOcean) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
func (*DigitalOcean) Name ¶
func (d *DigitalOcean) Name() string
func (*DigitalOcean) Sync ¶
func (d *DigitalOcean) Sync(ctx core.SyncContext) error
func (*DigitalOcean) Triggers ¶
func (d *DigitalOcean) Triggers() []core.Trigger
type Droplet ¶
type Droplet struct {
ID int `json:"id"`
Name string `json:"name"`
Memory int `json:"memory"`
VCPUs int `json:"vcpus"`
Disk int `json:"disk"`
Status string `json:"status"`
Region DropletRegion `json:"region"`
Image DropletImage `json:"image"`
SizeSlug string `json:"size_slug"`
Networks DropletNetworks `json:"networks"`
Tags []string `json:"tags"`
}
Droplet represents a DigitalOcean droplet
type DropletImage ¶
type DropletNetworkV4 ¶
type DropletNetworks ¶
type DropletNetworks struct {
V4 []DropletNetworkV4 `json:"v4"`
}
type DropletRegion ¶
type Image ¶
type Image struct {
ID int `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Type string `json:"type"`
Distribution string `json:"distribution"`
}
Image represents a DigitalOcean image