raff

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 13 Imported by: 0

README

raff-go

CI Go Reference

Official Go client library for the Raff Cloud API.

Used by raff-cli and terraform-provider-raff. The low-level HTTP client is generated from the public OpenAPI spec via oapi-codegen; the hand-written service wrappers in this package give you a stable Go-idiomatic API.

Latest: v0.3.3VMNetwork.Mac now exposed (per-NIC MAC address). Spec-only addition; no hand-written API change. See the API changelog for the full picture.

Install

go get github.com/rafftechnologies/raff-go

Requires Go 1.25+.

Authentication

All requests authenticate via an API key (X-API-Key header). Generate one in the dashboard at https://rafftechnologies.com under Team & Projects → API Keys.

client := raff.NewFromToken("raff_pub_xxx")

Or use a custom HTTP client and options:

client := raff.New(
    &http.Client{Timeout: 30 * time.Second},
    "raff_pub_xxx",
    raff.SetBaseURL("https://api.rafftechnologies.com"),
    raff.SetUserAgent("my-app/1.0"),
    raff.SetProjectID("project-uuid"), // sets the X-Project-ID header for project-scoped calls
)

Usage

package main

import (
    "context"
    "fmt"

    "github.com/google/uuid"
    raff "github.com/rafftechnologies/raff-go"
    "github.com/rafftechnologies/raff-go/spec"
)

func main() {
    client := raff.NewFromToken("raff_pub_xxx")
    ctx := context.Background()

    // List projects
    projects, _, err := client.Projects.List(ctx, nil)
    if err != nil {
        panic(err)
    }
    for _, p := range projects {
        fmt.Printf("%s  %s\n", p.ID, p.Name)
    }

    // Create a project
    region := spec.CreateProjectRequestDefaultRegion("us-east")
    project, _, err := client.Projects.Create(ctx, &raff.CreateProjectRequest{
        Name:          "my-project",
        Description:   raff.String("Production workloads"),
        DefaultRegion: &region,
    })
    if err != nil {
        panic(err)
    }

    // Project-scoped calls (creating VMs, VPCs, IPs, etc.) need the
    // X-Project-ID header. Construct a project-scoped client:
    pc := raff.NewFromToken("raff_pub_xxx", raff.SetProjectID(project.ID.String()))

    // Create a VM
    templateID, _ := uuid.Parse("5ac21891-32e6-41ce-8a93-b5d6ab708b0d")
    sshKeys := []string{"ssh-ed25519 AAAA... user@host"}
    vm, _, err := pc.VMs.Create(ctx, &raff.CreateVMRequest{
        Name:       "web-01",
        TemplateID: templateID,
        PricingID:  3,
        Region:     spec.CreateVMRequestRegion("us-east"),
        SSHKeys:    &sshKeys,
    })
    if err != nil {
        panic(err)
    }

    // Power actions
    pc.VMs.Stop(ctx, vm.ID.String())
    pc.VMs.Start(ctx, vm.ID.String())
    pc.VMs.Reboot(ctx, vm.ID.String())
}

See pkg.go.dev for the full API reference.

Services

Eighteen services on the client, ~115 operations — full coverage of the public OpenAPI spec.

Service Operations
Compute
client.VMs Full lifecycle (29 ops): list, create, delete, start/stop/reboot, resize, rename, reinstall, factory-reset, save-image, attach/detach VPC/IP/security-group, tags, notes
client.Volumes List, Get, Create, Delete, Resize, Attach, Detach
client.Snapshots List, Get, Create, Rename, Restore, Delete
client.Backups List, Get, Create, Restore, Delete (async on Create+Restore)
client.BackupSchedules List, Get, Create, Update, Delete
Networking
client.VPCs List, Get, GetDetail, Create, Update, Delete, CIDRSuggestions
client.IPs List, Get, Reserve, Release, Change
client.SecurityGroups List, Templates, Get, Create, Update, Delete
Identity & access
client.Projects List, Get, Create, Update, Delete
client.ProjectMembers List, Get, Add, Update, Remove (per-project)
client.Members List, Get, Add, Update, Remove (account-level)
client.Roles List, Get, Create, Update, Delete
client.Permissions List (read-only catalog)
client.Invitations CreateAccount, CreateProject, Cancel
client.APIKeys List, Get, Create, Update, Regenerate, Revoke
client.SSHKeys List, Get, Create, Update, Delete
Catalog (read-only)
client.Metadata ListRegions, ListTemplates
client.Pricing ListVM, ListVolume, ListBackup, ListSnapshot, ListIP

Versioning

This library follows Semantic Versioning. v0.x is allowed to introduce breaking changes; v1.0.0 onward implies a stable public API.

Pin a specific version:

go get github.com/rafftechnologies/raff-go@v0.3.3

The generated client (spec/spec.gen.go) is auto-synced with the public OpenAPI spec at docs/api-reference/openapi.yaml on a nightly schedule. Spec changes typically result in a PR within 24 hours.

Documentation

Contributing

PRs welcome. To regenerate the client after a spec change:

make generate

make verify enforces drift-free spec.gen.go in CI.

License

MIT

Documentation

Overview

Package raff provides a Go client library for the Raff Cloud API.

Usage:

client := raff.NewFromToken("raff_pub_xxx")
projects, _, err := client.Projects.List(ctx, nil)

The library is a thin idiomatic wrapper over types and an HTTP client generated from the public OpenAPI spec at docs/api-reference/openapi.yaml. Run `make generate` after editing the spec.

Index

Constants

View Source
const (
	K8sClusterStatusPending      = spec.K8SClusterStatusPending
	K8sClusterStatusDeploying    = spec.K8SClusterStatusDeploying
	K8sClusterStatusRunning      = spec.K8SClusterStatusRunning
	K8sClusterStatusWarning      = spec.K8SClusterStatusWarning
	K8sClusterStatusFailed       = spec.K8SClusterStatusFailed
	K8sClusterStatusDeleting     = spec.K8SClusterStatusDeleting
	K8sClusterStatusDeleteFailed = spec.K8SClusterStatusDeleteFailed
	K8sClusterStatusDeleted      = spec.K8SClusterStatusDeleted
)

Cluster lifecycle statuses.

View Source
const (
	// Version is the client library version.
	Version = "0.3.2"
)

Variables

This section is empty.

Functions

func Bool

func Bool(v bool) *bool

Bool returns a pointer to v. Use it when constructing request types that have optional bool fields.

func BoolValue

func BoolValue(p *bool) bool

BoolValue dereferences p, returning false if nil.

func Int

func Int(v int) *int

Int returns a pointer to v. Use it when constructing request types that have optional int fields.

func IntValue

func IntValue(p *int) int

IntValue dereferences p, returning 0 if nil.

func String

func String(v string) *string

String returns a pointer to v. Use it when constructing request types that have optional string fields.

func StringValue

func StringValue(p *string) string

StringValue dereferences p, returning "" if nil.

Types

type APIKey added in v0.2.0

type APIKey = spec.APIKey

APIKey represents an API key (without the secret).

type APIKeyListOptions added in v0.2.0

type APIKeyListOptions = spec.ListAPIKeysParams

APIKeyListOptions are the query parameters for listing API keys.

type APIKeyService added in v0.2.0

type APIKeyService interface {
	List(ctx context.Context, opts *APIKeyListOptions) ([]APIKey, *Response, error)
	Get(ctx context.Context, keyID string) (*APIKey, *Response, error)
	Create(ctx context.Context, req *CreateAPIKeyRequest) (*APIKeyWithSecret, *Response, error)
	Update(ctx context.Context, keyID string, req *UpdateAPIKeyRequest) (*APIKey, *Response, error)
	Regenerate(ctx context.Context, keyID string) (*APIKeyWithSecret, *Response, error)
	Revoke(ctx context.Context, keyID string) (*Response, error)
}

APIKeyService handles communication with the API key endpoints.

API keys are scoped to the account.

type APIKeyServiceOp added in v0.2.0

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

APIKeyServiceOp implements APIKeyService.

func (*APIKeyServiceOp) Create added in v0.2.0

func (*APIKeyServiceOp) Get added in v0.2.0

func (s *APIKeyServiceOp) Get(ctx context.Context, keyID string) (*APIKey, *Response, error)

func (*APIKeyServiceOp) List added in v0.2.0

func (*APIKeyServiceOp) Regenerate added in v0.2.0

func (s *APIKeyServiceOp) Regenerate(ctx context.Context, keyID string) (*APIKeyWithSecret, *Response, error)

func (*APIKeyServiceOp) Revoke added in v0.2.0

func (s *APIKeyServiceOp) Revoke(ctx context.Context, keyID string) (*Response, error)

func (*APIKeyServiceOp) Update added in v0.2.0

func (s *APIKeyServiceOp) Update(ctx context.Context, keyID string, req *UpdateAPIKeyRequest) (*APIKey, *Response, error)

type APIKeyWithSecret added in v0.2.0

type APIKeyWithSecret = spec.APIKeyWithSecret

APIKeyWithSecret is the create/regenerate response — includes the plaintext secret, which is only returned once.

type AddAppCustomDomainRequest added in v0.4.1

type AddAppCustomDomainRequest struct {
	Domain string `json:"domain"`
}

AddAppCustomDomainRequest attaches a custom domain to a web app service.

type AddK8sNodePoolRequest added in v0.4.0

type AddK8sNodePoolRequest = spec.AddK8SNodePoolJSONRequestBody

AddK8sNodePoolRequest is the request body for adding a node pool.

type AddMemberRequest added in v0.2.0

type AddMemberRequest = spec.AddMemberRequest

AddMemberRequest is the request body for adding a member to the account.

type AddProjectMemberRequest added in v0.2.0

type AddProjectMemberRequest = spec.AddProjectMemberRequest

AddProjectMemberRequest is the request body for adding a project member.

type AddVMTagRequest

type AddVMTagRequest = spec.AddVMTagRequest

AddVMTagRequest is the request body for adding a tag to a VM.

type AppBuildLogLine added in v0.4.1

type AppBuildLogLine struct {
	Timestamp string `json:"timestamp"`
	Message   string `json:"message"`
	Component string `json:"component"`
	Stream    string `json:"stream"`
}

AppBuildLogLine is one line of deployment build output.

type AppCustomDomain added in v0.4.1

type AppCustomDomain struct {
	ID                   string `json:"id"`
	ServiceID            string `json:"service_id"`
	Domain               string `json:"domain"`
	Status               string `json:"status"`
	StatusMessage        string `json:"status_message"`
	CNAMETarget          string `json:"cname_target"`
	VerificationTXTName  string `json:"verification_txt_name"`
	VerificationTXTValue string `json:"verification_txt_value"`
	CreatedAt            string `json:"created_at"`
	LastCheckedAt        string `json:"last_checked_at"`
}

AppCustomDomain is a custom hostname attached to a web app service.

type AppDeployment added in v0.4.1

type AppDeployment struct {
	ID               string `json:"id"`
	ServiceID        string `json:"service_id"`
	DeploymentNumber int    `json:"deployment_number"`
	Channel          string `json:"channel"`
	Status           string `json:"status"`
	RollbackOf       string `json:"rollback_of"`
	ImageDigest      string `json:"image_digest"`
	CommitSHA        string `json:"commit_sha"`
	CommitMessage    string `json:"commit_message"`
	Error            string `json:"error"`
	BuildDurationMS  int    `json:"build_duration_ms"`
	StartedAt        string `json:"started_at"`
	FinishedAt       string `json:"finished_at"`
	CreatedAt        string `json:"created_at"`
}

AppDeployment represents one build+rollout of an app service.

type AppEnvVar added in v0.4.1

type AppEnvVar struct {
	Key      string `json:"key"`
	Value    string `json:"value"`
	IsSecret bool   `json:"is_secret"`
	IsSystem bool   `json:"is_system"`
}

AppEnvVar is one environment variable on an app service.

type AppJobRun added in v0.4.1

type AppJobRun struct {
	ID           string `json:"id"`
	ServiceID    string `json:"service_id"`
	DeploymentID string `json:"deployment_id"`
	Trigger      string `json:"trigger"`
	Status       string `json:"status"`
	ExitCode     int    `json:"exit_code"`
	Error        string `json:"error"`
	ScheduledFor string `json:"scheduled_for"`
	StartedAt    string `json:"started_at"`
	FinishedAt   string `json:"finished_at"`
}

AppJobRun is one run of a cron or one-off job service.

type AppLogLine added in v0.4.1

type AppLogLine struct {
	Timestamp string `json:"timestamp"`
	Level     string `json:"level"`
	Message   string `json:"message"`
	Stream    string `json:"stream"`
	Component string `json:"component"`
}

AppLogLine is one runtime log line.

type AppLogOptions added in v0.4.1

type AppLogOptions struct {
	Level  string
	Search string
	Since  string
	Until  string
	Limit  int
}

AppLogOptions filters a runtime log query.

type AppMetricSeries added in v0.4.1

type AppMetricSeries struct {
	Name       string    `json:"name"`
	Values     []float64 `json:"values"`
	Timestamps []string  `json:"timestamps"`
}

AppMetricSeries is one named metric series (values aligned to timestamps).

type AppService added in v0.4.1

type AppService struct {
	ID                  string `json:"id"`
	ServiceID           string `json:"service_id"`
	ProjectID           string `json:"project_id"`
	Name                string `json:"name"`
	Slug                string `json:"slug"`
	Description         string `json:"description"`
	ServiceType         string `json:"service_type"`
	SourceType          string `json:"source_type"`
	Builder             string `json:"builder"`
	RepoFullName        string `json:"repo_full_name"`
	RepoBranch          string `json:"repo_branch"`
	RepoRootDir         string `json:"repo_root_dir"`
	DockerfilePath      string `json:"dockerfile_path"`
	ImageRef            string `json:"image_ref"`
	StartCommand        string `json:"start_command"`
	TierID              int    `json:"tier_id"`
	TierName            string `json:"tier_name"`
	Replicas            int    `json:"replicas"`
	AutoscalingEnabled  bool   `json:"autoscaling_enabled"`
	MinReplicas         int    `json:"min_replicas"`
	MaxReplicas         int    `json:"max_replicas"`
	AutoscalingMetric   string `json:"autoscaling_metric"`
	AutoscalingTarget   int    `json:"autoscaling_target"`
	ScaleToZero         bool   `json:"scale_to_zero"`
	HTTPPort            int    `json:"http_port"`
	HealthCheckPath     string `json:"health_check_path"`
	CronSchedule        string `json:"cron_schedule"`
	CronTimezone        string `json:"cron_timezone"`
	Region              string `json:"region"`
	URL                 string `json:"url"`
	InternalHost        string `json:"internal_host"`
	Status              string `json:"status"`
	StatusMessage       string `json:"status_message"`
	PausedByCap         bool   `json:"paused_by_cap"`
	BillingType         string `json:"billing_type"`
	CurrentDeploymentID string `json:"current_deployment_id"`
	CreatedAt           string `json:"created_at"`
	UpdatedAt           string `json:"updated_at"`
}

AppService represents a deployed app service (web, private, worker, cron, or job) on Raff Apps.

type AppServiceService added in v0.4.1

type AppServiceService interface {
	ListTiers(ctx context.Context) ([]AppTier, *Response, error)
	List(ctx context.Context) ([]AppService, *Response, error)
	Get(ctx context.Context, ref string) (*AppService, *Response, error)
	Create(ctx context.Context, req *CreateAppServiceRequest) (*AppService, *Response, error)
	Delete(ctx context.Context, ref string) (*Response, error)
	Pause(ctx context.Context, ref string) (*AppService, *Response, error)
	Resume(ctx context.Context, ref string) (*AppService, *Response, error)
	Scale(ctx context.Context, ref string, req *ScaleAppServiceRequest) (*AppService, *Response, error)
	RequestSourceUpload(ctx context.Context, ref string) (*AppSourceUpload, *Response, error)
	UploadSource(ctx context.Context, uploadURL string, tarData []byte) error
	ListDeployments(ctx context.Context, ref string, limit int) ([]AppDeployment, *Response, error)
	GetDeployment(ctx context.Context, deploymentID string) (*AppDeployment, *Response, error)
	CreateDeployment(ctx context.Context, ref string, req *CreateAppDeploymentRequest) (*AppDeployment, *Response, error)
	Rollback(ctx context.Context, ref string, req *RollbackAppServiceRequest) (*AppDeployment, *Response, error)
	GetDeploymentLogs(ctx context.Context, deploymentID string) ([]AppBuildLogLine, bool, *Response, error)
	ListLogs(ctx context.Context, ref string, opts *AppLogOptions) ([]AppLogLine, *Response, error)
	GetMetrics(ctx context.Context, ref, window string) ([]AppMetricSeries, *Response, error)
	ListEnvVars(ctx context.Context, ref string, reveal bool) ([]AppEnvVar, *Response, error)
	SetEnvVar(ctx context.Context, ref string, req *SetAppEnvVarRequest) ([]AppEnvVar, *Response, error)
	BulkSetEnvVars(ctx context.Context, ref string, req *BulkSetAppEnvVarsRequest) ([]AppEnvVar, *Response, error)
	DeleteEnvVar(ctx context.Context, ref, key string) ([]AppEnvVar, *Response, error)
	ListCustomDomains(ctx context.Context, ref string) ([]AppCustomDomain, *Response, error)
	AddCustomDomain(ctx context.Context, ref string, req *AddAppCustomDomainRequest) (*AppCustomDomain, *Response, error)
	DeleteCustomDomain(ctx context.Context, domainID string) (*Response, error)
	RetryDomainVerification(ctx context.Context, domainID string) (*AppCustomDomain, *Response, error)
	RunJob(ctx context.Context, ref string) (*AppJobRun, *Response, error)
	ListJobRuns(ctx context.Context, ref string) ([]AppJobRun, *Response, error)
	CancelJobRun(ctx context.Context, runID string) (*AppJobRun, *Response, error)
	GetUsage(ctx context.Context, ref string) (*AppUsage, *Response, error)
	GetSpendSettings(ctx context.Context) (*AppSpendSettings, *Response, error)
	UpdateSpendSettings(ctx context.Context, req *UpdateAppSpendSettingsRequest) (*AppSpendSettings, *Response, error)
}

AppServiceService handles communication with the Raff Apps endpoints.

type AppServiceServiceOp added in v0.4.1

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

AppServiceServiceOp implements AppServiceService.

func (*AppServiceServiceOp) AddCustomDomain added in v0.4.1

AddCustomDomain attaches a custom domain to a web app service. The returned domain carries the DNS records to create (CNAME target and verification TXT).

func (*AppServiceServiceOp) BulkSetEnvVars added in v0.4.1

func (s *AppServiceServiceOp) BulkSetEnvVars(ctx context.Context, ref string, req *BulkSetAppEnvVarsRequest) ([]AppEnvVar, *Response, error)

func (*AppServiceServiceOp) CancelJobRun added in v0.4.1

func (s *AppServiceServiceOp) CancelJobRun(ctx context.Context, runID string) (*AppJobRun, *Response, error)

func (*AppServiceServiceOp) Create added in v0.4.1

func (*AppServiceServiceOp) CreateDeployment added in v0.4.1

func (*AppServiceServiceOp) Delete added in v0.4.1

func (s *AppServiceServiceOp) Delete(ctx context.Context, ref string) (*Response, error)

Delete removes an app service (asynchronous; the name and URL are released once deletion completes).

func (*AppServiceServiceOp) DeleteCustomDomain added in v0.4.1

func (s *AppServiceServiceOp) DeleteCustomDomain(ctx context.Context, domainID string) (*Response, error)

func (*AppServiceServiceOp) DeleteEnvVar added in v0.4.1

func (s *AppServiceServiceOp) DeleteEnvVar(ctx context.Context, ref, key string) ([]AppEnvVar, *Response, error)

func (*AppServiceServiceOp) Get added in v0.4.1

func (*AppServiceServiceOp) GetDeployment added in v0.4.1

func (s *AppServiceServiceOp) GetDeployment(ctx context.Context, deploymentID string) (*AppDeployment, *Response, error)

func (*AppServiceServiceOp) GetDeploymentLogs added in v0.4.1

func (s *AppServiceServiceOp) GetDeploymentLogs(ctx context.Context, deploymentID string) ([]AppBuildLogLine, bool, *Response, error)

func (*AppServiceServiceOp) GetMetrics added in v0.4.1

func (s *AppServiceServiceOp) GetMetrics(ctx context.Context, ref, window string) ([]AppMetricSeries, *Response, error)

GetMetrics returns per-service metric series over the given window (e.g. "1h", "24h"). An empty window uses the server default.

func (*AppServiceServiceOp) GetSpendSettings added in v0.4.1

func (s *AppServiceServiceOp) GetSpendSettings(ctx context.Context) (*AppSpendSettings, *Response, error)

func (*AppServiceServiceOp) GetUsage added in v0.4.1

func (s *AppServiceServiceOp) GetUsage(ctx context.Context, ref string) (*AppUsage, *Response, error)

GetUsage returns the account's month-to-date Apps usage and estimated charge. Pass an empty ref for all services, or a service ref to scope it.

func (*AppServiceServiceOp) List added in v0.4.1

func (*AppServiceServiceOp) ListCustomDomains added in v0.4.1

func (s *AppServiceServiceOp) ListCustomDomains(ctx context.Context, ref string) ([]AppCustomDomain, *Response, error)

func (*AppServiceServiceOp) ListDeployments added in v0.4.1

func (s *AppServiceServiceOp) ListDeployments(ctx context.Context, ref string, limit int) ([]AppDeployment, *Response, error)

func (*AppServiceServiceOp) ListEnvVars added in v0.4.1

func (s *AppServiceServiceOp) ListEnvVars(ctx context.Context, ref string, reveal bool) ([]AppEnvVar, *Response, error)

ListEnvVars lists a service's environment variables. Secret values are masked unless reveal is true (which requires elevated permission).

func (*AppServiceServiceOp) ListJobRuns added in v0.4.1

func (s *AppServiceServiceOp) ListJobRuns(ctx context.Context, ref string) ([]AppJobRun, *Response, error)

func (*AppServiceServiceOp) ListLogs added in v0.4.1

func (s *AppServiceServiceOp) ListLogs(ctx context.Context, ref string, opts *AppLogOptions) ([]AppLogLine, *Response, error)

func (*AppServiceServiceOp) ListTiers added in v0.4.1

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

ListTiers returns the public Apps pricing catalog (no auth needed).

func (*AppServiceServiceOp) Pause added in v0.4.1

func (*AppServiceServiceOp) RequestSourceUpload added in v0.4.1

func (s *AppServiceServiceOp) RequestSourceUpload(ctx context.Context, ref string) (*AppSourceUpload, *Response, error)

func (*AppServiceServiceOp) Resume added in v0.4.1

func (*AppServiceServiceOp) RetryDomainVerification added in v0.4.1

func (s *AppServiceServiceOp) RetryDomainVerification(ctx context.Context, domainID string) (*AppCustomDomain, *Response, error)

func (*AppServiceServiceOp) Rollback added in v0.4.1

Rollback pins a service back to an older deployment's image (creates a new deployment from the target's digest and config snapshot).

func (*AppServiceServiceOp) RunJob added in v0.4.1

func (s *AppServiceServiceOp) RunJob(ctx context.Context, ref string) (*AppJobRun, *Response, error)

RunJob triggers a manual run of a cron or one-off job service.

func (*AppServiceServiceOp) Scale added in v0.4.1

func (*AppServiceServiceOp) SetEnvVar added in v0.4.1

func (*AppServiceServiceOp) UpdateSpendSettings added in v0.4.1

func (*AppServiceServiceOp) UploadSource added in v0.4.1

func (s *AppServiceServiceOp) UploadSource(ctx context.Context, uploadURL string, tarData []byte) error

UploadSource PUTs the source tarball to a presigned URL (no API auth involved).

type AppServiceUsage added in v0.4.1

type AppServiceUsage struct {
	ServiceID        string  `json:"service_id"`
	ServiceName      string  `json:"service_name"`
	TierID           int     `json:"tier_id"`
	ReplicaHours     float64 `json:"replica_hours"`
	EstimatedCostUSD float64 `json:"estimated_cost_usd"`
}

AppServiceUsage is one service's month-to-date usage and estimated charge.

type AppSourceUpload added in v0.4.1

type AppSourceUpload struct {
	UploadURL        string `json:"upload_url"`
	BlobKey          string `json:"blob_key"`
	ExpiresInSeconds int    `json:"expires_in_seconds"`
}

AppSourceUpload is a presigned upload slot for a source tarball.

type AppSpendSettings added in v0.4.1

type AppSpendSettings struct {
	Enabled       bool    `json:"enabled"`
	MonthlyCapUSD float64 `json:"monthly_cap_usd"`
	CapAction     string  `json:"cap_action"`
	PausedByCap   bool    `json:"paused_by_cap"`
}

AppSpendSettings is the account's Apps spend cap.

type AppTier added in v0.4.1

type AppTier struct {
	ID            int     `json:"id"`
	Name          string  `json:"name"`
	VCPU          float64 `json:"vcpu"`
	MemoryMiB     int     `json:"memory_mib"`
	EphemeralGiB  int     `json:"ephemeral_gib"`
	PricePerHour  float64 `json:"price_per_hour"`
	PricePerMonth float64 `json:"price_per_month"`
	YearlyPrice   float64 `json:"yearly_price"`
	Region        string  `json:"region"`
}

AppTier is one Apps pricing tier (compute size + price).

type AppUsage added in v0.4.1

type AppUsage struct {
	Services              []AppServiceUsage `json:"services"`
	TotalEstimatedCostUSD float64           `json:"total_estimated_cost_usd"`
	PeriodStart           string            `json:"period_start"`
	PeriodEnd             string            `json:"period_end"`
}

AppUsage is the account's Apps usage for a billing period.

type AttachIPRequest

type AttachIPRequest = spec.AttachIPRequest

AttachIPRequest is the request body for attaching a floating IP to a VM.

type AttachIPResponse

type AttachIPResponse = spec.AttachIPResponse

AttachIPResponse is the response from attaching a floating IP.

type AttachSecurityGroupRequest

type AttachSecurityGroupRequest = spec.AttachSecurityGroupRequest

AttachSecurityGroupRequest is the request body for attaching a security group.

type AttachVPCRequest

type AttachVPCRequest = spec.AttachVPCRequest

AttachVPCRequest is the request body for attaching a VM to a VPC.

type AttachVolumeRequest added in v0.3.0

type AttachVolumeRequest = spec.AttachVolumeRequest

AttachVolumeRequest is the request body for attaching a volume to a VM.

type Backup added in v0.3.0

type Backup = spec.Backup

Backup represents a managed backup of a VM or volume.

type BackupListOptions added in v0.3.0

type BackupListOptions = spec.ListBackupsParams

BackupListOptions are the query parameters for listing backups.

type BackupPricingListOptions added in v0.3.0

type BackupPricingListOptions = spec.ListBackupPricingParams

BackupPricingListOptions filters backup pricing by region.

type BackupSchedule added in v0.3.0

type BackupSchedule = spec.BackupSchedule

BackupSchedule defines a recurring backup policy.

type BackupScheduleListOptions added in v0.3.0

type BackupScheduleListOptions = spec.ListBackupSchedulesParams

BackupScheduleListOptions are the query parameters for listing schedules.

type BackupScheduleService added in v0.3.0

type BackupScheduleService interface {
	List(ctx context.Context, opts *BackupScheduleListOptions) ([]BackupSchedule, *Response, error)
	Get(ctx context.Context, scheduleID int) (*BackupSchedule, *Response, error)
	Create(ctx context.Context, req *CreateBackupScheduleRequest) (*BackupSchedule, *Response, error)
	Update(ctx context.Context, scheduleID int, req *UpdateBackupScheduleRequest) (*BackupSchedule, *Response, error)
	Delete(ctx context.Context, scheduleID int) (*Response, error)
}

BackupScheduleService handles backup schedule CRUD.

type BackupScheduleServiceOp added in v0.3.0

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

BackupScheduleServiceOp implements BackupScheduleService.

func (*BackupScheduleServiceOp) Create added in v0.3.0

func (*BackupScheduleServiceOp) Delete added in v0.3.0

func (s *BackupScheduleServiceOp) Delete(ctx context.Context, scheduleID int) (*Response, error)

func (*BackupScheduleServiceOp) Get added in v0.3.0

func (s *BackupScheduleServiceOp) Get(ctx context.Context, scheduleID int) (*BackupSchedule, *Response, error)

func (*BackupScheduleServiceOp) List added in v0.3.0

func (*BackupScheduleServiceOp) Update added in v0.3.0

type BackupService added in v0.3.0

type BackupService interface {
	List(ctx context.Context, opts *BackupListOptions) ([]Backup, *Response, error)
	Get(ctx context.Context, backupID string) (*Backup, *Response, error)
	Create(ctx context.Context, req *CreateBackupRequest) (*Backup, *Response, error)
	Restore(ctx context.Context, backupID string) (*Backup, *Response, error)
	Delete(ctx context.Context, backupID string) (*Response, error)
	// DeleteSeries removes every restore point in the series that the
	// given backup belongs to. Use when a single restore point can't be
	// removed on its own because it has older points it depends on.
	DeleteSeries(ctx context.Context, backupID string) (*Response, error)
	// ResetSeries closes the active backup series for the VM so the next
	// backup creates a fresh independent baseline. Existing restore
	// points stay restorable until explicitly deleted.
	ResetSeries(ctx context.Context, vmID string) (*Response, error)
}

BackupService handles communication with the backup endpoints. Restore is asynchronous and returns the in-progress backup record (HTTP 202).

type BackupServiceOp added in v0.3.0

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

BackupServiceOp implements BackupService.

func (*BackupServiceOp) Create added in v0.3.0

func (*BackupServiceOp) Delete added in v0.3.0

func (s *BackupServiceOp) Delete(ctx context.Context, backupID string) (*Response, error)

func (*BackupServiceOp) DeleteSeries added in v0.3.4

func (s *BackupServiceOp) DeleteSeries(ctx context.Context, backupID string) (*Response, error)

func (*BackupServiceOp) Get added in v0.3.0

func (s *BackupServiceOp) Get(ctx context.Context, backupID string) (*Backup, *Response, error)

func (*BackupServiceOp) List added in v0.3.0

func (*BackupServiceOp) ResetSeries added in v0.3.4

func (s *BackupServiceOp) ResetSeries(ctx context.Context, vmID string) (*Response, error)

func (*BackupServiceOp) Restore added in v0.3.0

func (s *BackupServiceOp) Restore(ctx context.Context, backupID string) (*Backup, *Response, error)

type BulkDeleteVMItemResult

type BulkDeleteVMItemResult = spec.BulkDeleteVMItemResult

BulkDeleteVMItemResult is the result for a single VM in bulk delete.

type BulkDeleteVMsRequest

type BulkDeleteVMsRequest = spec.DeleteVMsBulkRequest

BulkDeleteVMsRequest is the request body for bulk-deleting VMs.

type BulkDeleteVMsResult

type BulkDeleteVMsResult = spec.BulkDeleteVMsResult

BulkDeleteVMsResult is the per-VM result envelope from bulk delete.

type BulkSetAppEnvVarsRequest added in v0.4.1

type BulkSetAppEnvVarsRequest struct {
	Vars     []SetAppEnvVarRequest `json:"vars"`
	Redeploy *bool                 `json:"redeploy,omitempty"`
}

BulkSetAppEnvVarsRequest upserts many environment variables at once.

type CIDRSuggestion

type CIDRSuggestion = spec.CIDRSuggestion

CIDRSuggestion is a single CIDR suggestion entry.

type CIDRSuggestionsResponse

type CIDRSuggestionsResponse = spec.CIDRSuggestionsResponse

CIDRSuggestionsResponse contains a recommended CIDR and alternatives.

type ChangeIPResponse

type ChangeIPResponse struct {
	Success bool        `json:"success"`
	OldIP   *FloatingIP `json:"old_ip,omitempty"`
	NewIP   *FloatingIP `json:"new_ip,omitempty"`
}

ChangeIPResponse is the response shape for swapping a reserved IP.

type Client

type Client struct {

	// Services
	Projects        ProjectService
	VMs             VMService
	VPCs            VPCService
	IPs             IPService
	SecurityGroups  SecurityGroupService
	SSHKeys         SSHKeyService
	APIKeys         APIKeyService
	Members         MemberService
	ProjectMembers  ProjectMemberService
	Roles           RoleService
	Permissions     PermissionService
	Invitations     InvitationService
	Volumes         VolumeService
	Snapshots       SnapshotService
	Backups         BackupService
	BackupSchedules BackupScheduleService
	Metadata        MetadataService
	Pricing         PricingService
	Functions       FunctionService
	AppServices     AppServiceService
	Kubernetes      KubernetesService
	// contains filtered or unexported fields
}

Client manages communication with the Raff Cloud API.

func New

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

New creates a new Raff API client with a custom HTTP client.

func NewFromToken

func NewFromToken(apiKey string, opts ...ClientOpt) *Client

NewFromToken creates a new Raff API client with the given API key.

type ClientOpt

type ClientOpt func(*clientConfig, *Client)

ClientOpt is a functional option for configuring the client.

func SetBaseURL

func SetBaseURL(baseURL string) ClientOpt

SetBaseURL sets the API base URL.

func SetProjectID

func SetProjectID(id string) ClientOpt

SetProjectID sets the default project ID sent via X-Project-ID header for mutating operations. Each service method may override it per call.

func SetUserAgent

func SetUserAgent(ua string) ClientOpt

SetUserAgent sets the User-Agent header.

type ConvertLambdaRequest added in v0.4.1

type ConvertLambdaRequest struct {
	LambdaRuntime     string            `json:"lambda_runtime"`
	Files             []SourceFile      `json:"files"`
	Handler           string            `json:"handler,omitempty"`
	MemoryMB          int               `json:"memory_mb,omitempty"`
	TimeoutSeconds    int               `json:"timeout_seconds,omitempty"`
	EnvVars           map[string]string `json:"env_vars,omitempty"`
	TriggerConfigJSON string            `json:"trigger_config_json,omitempty"`
	// Mode: "rewrite" (AI, default) or "adapter" (run as-is, no AI).
	Mode string `json:"mode,omitempty"`
}

ConvertLambdaRequest is the Lambda import request (stateless conversion).

type ConvertLambdaResult added in v0.4.1

type ConvertLambdaResult struct {
	Runtime          string       `json:"runtime"`
	ConvertedFiles   []SourceFile `json:"converted_files"`
	RaffToml         string       `json:"raff_toml"`
	ProposedTriggers []string     `json:"proposed_triggers"`
	Warnings         []string     `json:"warnings"`
	OutOfScope       []string     `json:"out_of_scope"`
}

ConvertLambdaResult is the conversion output — review before deploying.

type CreateAPIKeyRequest added in v0.2.0

type CreateAPIKeyRequest = spec.CreateAPIKeyRequest

CreateAPIKeyRequest is the request body for creating an API key.

type CreateAppDeploymentRequest added in v0.4.1

type CreateAppDeploymentRequest struct {
	Channel       string `json:"channel,omitempty"`
	SourceBlobKey string `json:"source_blob_key,omitempty"`
	ImageRef      string `json:"image_ref,omitempty"`
}

CreateAppDeploymentRequest starts a deployment from staged source or a prebuilt image.

type CreateAppServiceRequest added in v0.4.1

type CreateAppServiceRequest struct {
	Name            string `json:"name"`
	Description     string `json:"description,omitempty"`
	ServiceType     string `json:"service_type"`
	SourceType      string `json:"source_type,omitempty"`
	Builder         string `json:"builder,omitempty"`
	ImageRef        string `json:"image_ref,omitempty"`
	RepoFullName    string `json:"repo_full_name,omitempty"`
	RepoBranch      string `json:"repo_branch,omitempty"`
	RepoRootDir     string `json:"repo_root_dir,omitempty"`
	DockerfilePath  string `json:"dockerfile_path,omitempty"`
	StartCommand    string `json:"start_command,omitempty"`
	TierID          int    `json:"tier_id,omitempty"`
	Replicas        int    `json:"replicas,omitempty"`
	Autoscaling     bool   `json:"autoscaling_enabled,omitempty"`
	MinReplicas     int    `json:"min_replicas,omitempty"`
	MaxReplicas     int    `json:"max_replicas,omitempty"`
	ScaleToZero     bool   `json:"scale_to_zero,omitempty"`
	HTTPPort        int    `json:"http_port,omitempty"`
	HealthCheckPath string `json:"health_check_path,omitempty"`
	CronSchedule    string `json:"cron_schedule,omitempty"`
	CronTimezone    string `json:"cron_timezone,omitempty"`
	Region          string `json:"region,omitempty"`
	// DeployNow immediately queues a build+rollout for prebuilt-image
	// services. Source-based services deploy after their source is uploaded.
	DeployNow bool `json:"deploy_now,omitempty"`
}

CreateAppServiceRequest is the request body for creating an app service.

type CreateBackupRequest added in v0.3.0

type CreateBackupRequest = spec.CreateBackupRequest

CreateBackupRequest is the request body for taking an on-demand backup.

type CreateBackupScheduleRequest added in v0.3.0

type CreateBackupScheduleRequest = spec.CreateBackupScheduleRequest

CreateBackupScheduleRequest is the request body for creating a schedule.

type CreateFunctionDeploymentRequest added in v0.4.1

type CreateFunctionDeploymentRequest struct {
	Channel       string `json:"channel,omitempty"`
	SourceBlobKey string `json:"source_blob_key,omitempty"`
	Template      string `json:"template,omitempty"`
	Message       string `json:"message,omitempty"`
}

CreateFunctionDeploymentRequest starts a deployment from staged source.

type CreateFunctionRequest added in v0.4.1

type CreateFunctionRequest struct {
	Name           string `json:"name"`
	Slug           string `json:"slug,omitempty"`
	Description    string `json:"description,omitempty"`
	Runtime        string `json:"runtime"`
	Region         string `json:"region,omitempty"`
	MemoryMB       int    `json:"memory_mb,omitempty"`
	TimeoutSeconds int    `json:"timeout_seconds,omitempty"`
	MinScale       int    `json:"min_scale,omitempty"`
	MaxScale       int    `json:"max_scale,omitempty"`
	SourceType     string `json:"source_type,omitempty"`
	// ExtendedTimeout opts into timeouts above 3600s (max 86400s / 24h).
	ExtendedTimeout bool `json:"extended_timeout,omitempty"`
}

CreateFunctionRequest is the request body for creating a function.

type CreateInvitationRequest added in v0.2.0

type CreateInvitationRequest = spec.CreateInvitationRequest

CreateInvitationRequest is the request body for both account and project invitations — same shape (email + role_id).

type CreateK8sClusterRequest added in v0.4.0

type CreateK8sClusterRequest = spec.CreateK8SClusterJSONRequestBody

CreateK8sClusterRequest is the request body for creating a cluster.

type CreateK8sClusterStorageNodeCount added in v0.4.0

type CreateK8sClusterStorageNodeCount = spec.CreateK8SClusterRequestStorageNodeCount

CreateK8sClusterStorageNodeCount is the storage-node count in a create request.

type CreateProjectRequest

type CreateProjectRequest = spec.CreateProjectRequest

CreateProjectRequest is the request body for creating a project.

type CreateRoleRequest added in v0.2.0

type CreateRoleRequest = spec.CreateRoleRequest

CreateRoleRequest is the request body for creating a custom role.

type CreateSSHKeyRequest added in v0.2.0

type CreateSSHKeyRequest = spec.CreateSSHKeyRequest

CreateSSHKeyRequest is the request body for registering an SSH key.

type CreateSecurityGroupRequest

type CreateSecurityGroupRequest = spec.CreateSecurityGroupRequest

CreateSecurityGroupRequest is the request body for creating a security group.

type CreateSnapshotRequest added in v0.3.0

type CreateSnapshotRequest = spec.CreateSnapshotRequest

CreateSnapshotRequest is the request body for creating a snapshot.

type CreateVMRequest

type CreateVMRequest = spec.CreateVMRequest

CreateVMRequest is the request body for creating a VM.

type CreateVPCRequest

type CreateVPCRequest = spec.CreateVPCRequest

CreateVPCRequest is the request body for creating a VPC.

type CreateVolumeRequest added in v0.3.0

type CreateVolumeRequest = spec.CreateVolumeRequest

CreateVolumeRequest is the request body for creating a volume.

type DeleteVMRequest

type DeleteVMRequest = spec.DeleteVMRequest

DeleteVMRequest is the optional request body for deleting a VM.

type ErrorResponse

type ErrorResponse struct {
	StatusCode int
	Message    string
	Reason     string
	Body       string
}

ErrorResponse is returned when the API returns a non-2xx status code.

func (*ErrorResponse) Error

func (e *ErrorResponse) Error() string

type FloatingIP

type FloatingIP = spec.FloatingIP

FloatingIP represents a floating public IP address.

type Function added in v0.4.1

type Function struct {
	ID                    string `json:"id"`
	FunctionID            string `json:"function_id"`
	Name                  string `json:"name"`
	Slug                  string `json:"slug"`
	Description           string `json:"description"`
	Runtime               string `json:"runtime"`
	Region                string `json:"region"`
	MemoryMB              int    `json:"memory_mb"`
	TimeoutSeconds        int    `json:"timeout_seconds"`
	ExtendedTimeout       bool   `json:"extended_timeout"`
	MinScale              int    `json:"min_scale"`
	MaxScale              int    `json:"max_scale"`
	SourceType            string `json:"source_type"`
	RepoFullName          string `json:"repo_full_name"`
	RepoBranch            string `json:"repo_branch"`
	RepoRootDir           string `json:"repo_root_dir"`
	URL                   string `json:"url"`
	Status                string `json:"status"`
	StatusMessage         string `json:"status_message"`
	CurrentRevisionNumber int    `json:"current_revision_number"`
	CreatedAt             string `json:"created_at"`
	UpdatedAt             string `json:"updated_at"`
}

Function represents a deployed serverless function.

type FunctionBuildLogLine added in v0.4.1

type FunctionBuildLogLine struct {
	Timestamp string `json:"timestamp"`
	Step      string `json:"step"`
	Message   string `json:"message"`
}

FunctionBuildLogLine is one line of build output.

type FunctionDeployment added in v0.4.1

type FunctionDeployment struct {
	ID              string `json:"id"`
	Channel         string `json:"channel"`
	Status          string `json:"status"`
	CommitSHA       string `json:"commit_sha"`
	Error           string `json:"error"`
	BuildDurationMS int    `json:"build_duration_ms"`
	CreatedAt       string `json:"created_at"`
	FinishedAt      string `json:"finished_at"`
}

FunctionDeployment represents one build+rollout of a function.

type FunctionEnvVar added in v0.4.1

type FunctionEnvVar struct {
	Key      string `json:"key"`
	Value    string `json:"value"`
	IsSecret bool   `json:"is_secret"`
	IsSystem bool   `json:"is_system"`
}

FunctionEnvVar is one environment variable on a function.

type FunctionService added in v0.4.1

type FunctionService interface {
	List(ctx context.Context) ([]Function, *Response, error)
	Get(ctx context.Context, ref string) (*Function, *Response, error)
	Create(ctx context.Context, req *CreateFunctionRequest) (*Function, *Response, error)
	Update(ctx context.Context, ref string, req *UpdateFunctionRequest) (*Function, *Response, error)
	Delete(ctx context.Context, ref string) (*Response, error)
	RequestSourceUpload(ctx context.Context, ref string) (*FunctionSourceUpload, *Response, error)
	UploadSource(ctx context.Context, uploadURL string, zipData []byte) error
	CreateDeployment(ctx context.Context, ref string, req *CreateFunctionDeploymentRequest) (*FunctionDeployment, *Response, error)
	GetDeployment(ctx context.Context, ref, deploymentID string) (*FunctionDeployment, *Response, error)
	GetDeploymentLogs(ctx context.Context, ref, deploymentID string) ([]FunctionBuildLogLine, bool, *Response, error)
	ListEnvVars(ctx context.Context, ref string, reveal bool) ([]FunctionEnvVar, *Response, error)
	SetEnvVar(ctx context.Context, ref string, req *SetFunctionEnvVarRequest) (*Response, error)
	ConvertLambda(ctx context.Context, req *ConvertLambdaRequest) (*ConvertLambdaResult, *Response, error)
}

FunctionService handles communication with the Functions endpoints.

type FunctionServiceOp added in v0.4.1

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

FunctionServiceOp implements FunctionService.

func (*FunctionServiceOp) ConvertLambda added in v0.4.1

ConvertLambda converts AWS Lambda source to a portable Raff handler. Stateless — nothing is stored; review the output, then deploy it.

func (*FunctionServiceOp) Create added in v0.4.1

func (*FunctionServiceOp) CreateDeployment added in v0.4.1

func (*FunctionServiceOp) Delete added in v0.4.1

func (s *FunctionServiceOp) Delete(ctx context.Context, ref string) (*Response, error)

Delete removes a function and all revisions (asynchronous; the name and URL are released once deletion completes).

func (*FunctionServiceOp) Get added in v0.4.1

func (*FunctionServiceOp) GetDeployment added in v0.4.1

func (s *FunctionServiceOp) GetDeployment(ctx context.Context, ref, deploymentID string) (*FunctionDeployment, *Response, error)

func (*FunctionServiceOp) GetDeploymentLogs added in v0.4.1

func (s *FunctionServiceOp) GetDeploymentLogs(ctx context.Context, ref, deploymentID string) ([]FunctionBuildLogLine, bool, *Response, error)

func (*FunctionServiceOp) List added in v0.4.1

func (*FunctionServiceOp) ListEnvVars added in v0.4.1

func (s *FunctionServiceOp) ListEnvVars(ctx context.Context, ref string, reveal bool) ([]FunctionEnvVar, *Response, error)

func (*FunctionServiceOp) RequestSourceUpload added in v0.4.1

func (s *FunctionServiceOp) RequestSourceUpload(ctx context.Context, ref string) (*FunctionSourceUpload, *Response, error)

func (*FunctionServiceOp) SetEnvVar added in v0.4.1

func (*FunctionServiceOp) Update added in v0.4.1

Update partially updates function settings; live functions get a zero-downtime config redeploy.

func (*FunctionServiceOp) UploadSource added in v0.4.1

func (s *FunctionServiceOp) UploadSource(ctx context.Context, uploadURL string, zipData []byte) error

UploadSource PUTs the source zip to a presigned URL (no API auth involved).

type FunctionSourceUpload added in v0.4.1

type FunctionSourceUpload struct {
	UploadURL        string `json:"upload_url"`
	SourceBlobKey    string `json:"source_blob_key"`
	ExpiresInSeconds int    `json:"expires_in_seconds"`
}

FunctionSourceUpload is a presigned upload slot for a source zip.

type GetVMNotesOptions

type GetVMNotesOptions = spec.GetVMNotesParams

GetVMNotesOptions are the optional filters for listing notes.

type IPListOptions

type IPListOptions = spec.ListIPsParams

IPListOptions are the query parameters for listing floating IPs.

type IPPricing added in v0.3.0

type IPPricing = spec.IPPricing

IPPricing groups IP pricing by family (ipv4, ipv6).

type IPService

type IPService interface {
	List(ctx context.Context, opts *IPListOptions) ([]FloatingIP, *Response, error)
	Get(ctx context.Context, ipID string) (*FloatingIP, *Response, error)
	Reserve(ctx context.Context, req *ReserveIPRequest) (*FloatingIP, *Response, error)
	Release(ctx context.Context, ipID string) (*Response, error)
	Change(ctx context.Context, ipID string) (*ChangeIPResponse, *Response, error)
}

IPService handles communication with the floating IP endpoints.

type IPServiceOp

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

IPServiceOp implements IPService.

func (*IPServiceOp) Change

func (s *IPServiceOp) Change(ctx context.Context, ipID string) (*ChangeIPResponse, *Response, error)

func (*IPServiceOp) Get

func (s *IPServiceOp) Get(ctx context.Context, ipID string) (*FloatingIP, *Response, error)

func (*IPServiceOp) List

func (s *IPServiceOp) List(ctx context.Context, opts *IPListOptions) ([]FloatingIP, *Response, error)

func (*IPServiceOp) Release

func (s *IPServiceOp) Release(ctx context.Context, ipID string) (*Response, error)

func (*IPServiceOp) Reserve

func (s *IPServiceOp) Reserve(ctx context.Context, req *ReserveIPRequest) (*FloatingIP, *Response, error)

type Invitation added in v0.2.0

type Invitation = spec.Invitation

Invitation represents a pending invite to join an account or project.

type InvitationService added in v0.2.0

type InvitationService interface {
	CreateAccount(ctx context.Context, req *CreateInvitationRequest) (*Invitation, *Response, error)
	CreateProject(ctx context.Context, projectID string, req *CreateInvitationRequest) (*Invitation, *Response, error)
	Cancel(ctx context.Context, invitationID string) (*Response, error)
}

InvitationService handles communication with the invitation endpoints.

The public spec exposes Create (account-scoped or project-scoped) and Cancel. There is no List endpoint — invitations are observed via the invited member appearing in the relevant Members or ProjectMembers list with status "pending".

type InvitationServiceOp added in v0.2.0

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

InvitationServiceOp implements InvitationService.

func (*InvitationServiceOp) Cancel added in v0.2.0

func (s *InvitationServiceOp) Cancel(ctx context.Context, invitationID string) (*Response, error)

func (*InvitationServiceOp) CreateAccount added in v0.2.0

func (*InvitationServiceOp) CreateProject added in v0.2.0

func (s *InvitationServiceOp) CreateProject(ctx context.Context, projectID string, req *CreateInvitationRequest) (*Invitation, *Response, error)

type K8sAvailableUpgrade added in v0.4.0

type K8sAvailableUpgrade struct {
	VersionID   int
	Version     string
	RKE2Version string
	IsMinor     bool
	IsDefault   bool
}

K8sAvailableUpgrade is one version a cluster can upgrade to.

type K8sCluster added in v0.4.0

type K8sCluster = spec.K8SCluster

K8sCluster represents a managed Kubernetes cluster.

type K8sClusterEvent added in v0.4.0

type K8sClusterEvent = spec.K8SClusterEvent

K8sClusterEvent is one lifecycle event of a cluster.

type K8sClusterListOptions added in v0.4.0

type K8sClusterListOptions = spec.ListK8SClustersParams

K8sClusterListOptions are the query parameters for listing clusters.

type K8sClusterNode added in v0.4.0

type K8sClusterNode = spec.K8SClusterNode

K8sClusterNode is one node of a cluster with live kubelet state.

type K8sClusterStatus added in v0.4.0

type K8sClusterStatus = spec.K8SClusterStatus

K8sClusterStatus is a cluster lifecycle status.

type K8sKubeconfig added in v0.4.0

type K8sKubeconfig struct {
	Kubeconfig  string
	APIEndpoint string
}

K8sKubeconfig is a cluster's kubeconfig with its API endpoint.

type K8sNodePlan added in v0.4.0

type K8sNodePlan = spec.K8SNodePlan

K8sNodePlan is a worker node plan with pricing.

type K8sNodePlans added in v0.4.0

type K8sNodePlans struct {
	Plans          []K8sNodePlan
	HAPricing      *spec.K8SHAPricing
	StoragePricing *spec.K8SStoragePricing
}

K8sNodePlans bundles worker plans with HA and storage pricing.

type K8sNodePool added in v0.4.0

type K8sNodePool = spec.K8SNodePool

K8sNodePool represents a group of identical worker nodes.

type K8sNodePoolInput added in v0.4.0

type K8sNodePoolInput = spec.K8SNodePoolInput

K8sNodePoolInput describes a node pool in a cluster create request.

type K8sUpgradeInfo added in v0.4.0

type K8sUpgradeInfo struct {
	CurrentVersion   string
	UpgradeStatus    string
	TargetVersion    string
	UpgradeMode      string
	MaintenanceDay   *int
	MaintenanceStart *int
	Available        []K8sAvailableUpgrade
}

K8sUpgradeInfo is a cluster's upgrade and maintenance state.

type K8sVersion added in v0.4.0

type K8sVersion = spec.K8SVersion

K8sVersion is an available Kubernetes version.

type KubernetesService added in v0.4.0

type KubernetesService interface {
	List(ctx context.Context, opts *K8sClusterListOptions) ([]K8sCluster, *Response, error)
	Get(ctx context.Context, clusterID string) (*K8sCluster, *Response, error)
	// Create provisions a cluster. idempotencyKey (optional, max 128 chars)
	// makes retries safe: the same key returns the same cluster instead of
	// creating a second one.
	Create(ctx context.Context, req *CreateK8sClusterRequest, idempotencyKey string) (*K8sCluster, *Response, error)
	Rename(ctx context.Context, clusterID, name string) (*Response, error)
	Delete(ctx context.Context, clusterID string) (*Response, error)
	Kubeconfig(ctx context.Context, clusterID string) (*K8sKubeconfig, *Response, error)
	KubeconfigWithTTL(ctx context.Context, clusterID string, ttlSeconds int) (*K8sKubeconfig, *Response, error)
	RotateKubeconfigAccess(ctx context.Context, clusterID string) (*Response, error)
	UpgradeHA(ctx context.Context, clusterID string) (*Response, error)

	ListNodePools(ctx context.Context, clusterID string) ([]K8sNodePool, *Response, error)
	AddNodePool(ctx context.Context, clusterID string, req *AddK8sNodePoolRequest) (*K8sNodePool, *Response, error)
	UpdateNodePool(ctx context.Context, clusterID, poolID string, req *UpdateK8sNodePoolRequest) (*K8sNodePool, *Response, error)
	ScaleNodePool(ctx context.Context, clusterID, poolID string, nodeCount int) (*Response, error)
	DeleteNodePool(ctx context.Context, clusterID, poolID string) (*Response, error)

	ListNodes(ctx context.Context, clusterID string) ([]K8sClusterNode, *Response, error)
	ListEvents(ctx context.Context, clusterID string) ([]K8sClusterEvent, *Response, error)

	Upgrades(ctx context.Context, clusterID string) (*K8sUpgradeInfo, *Response, error)
	Upgrade(ctx context.Context, clusterID string, versionID int, confirmSingleMaster bool) (*Response, error)
	SetMaintenance(ctx context.Context, clusterID, mode string, day, startHour *int) (*Response, error)

	ListVersions(ctx context.Context) ([]K8sVersion, *Response, error)
	ListNodePlans(ctx context.Context) (*K8sNodePlans, *Response, error)

	// WaitForStatus polls the cluster until it reaches the target status,
	// the cluster enters failed/delete_failed, or ctx is done. Poll interval
	// is 10 seconds. Returns the cluster in its final observed state.
	WaitForStatus(ctx context.Context, clusterID string, target K8sClusterStatus) (*K8sCluster, error)
	// WaitForDeleted polls until Get returns 404 or ctx is done.
	WaitForDeleted(ctx context.Context, clusterID string) error
}

KubernetesService handles communication with the managed Kubernetes endpoints.

type KubernetesServiceOp added in v0.4.0

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

KubernetesServiceOp implements KubernetesService.

func (*KubernetesServiceOp) AddNodePool added in v0.4.0

func (s *KubernetesServiceOp) AddNodePool(ctx context.Context, clusterID string, req *AddK8sNodePoolRequest) (*K8sNodePool, *Response, error)

func (*KubernetesServiceOp) Create added in v0.4.0

func (s *KubernetesServiceOp) Create(ctx context.Context, req *CreateK8sClusterRequest, idempotencyKey string) (*K8sCluster, *Response, error)

func (*KubernetesServiceOp) Delete added in v0.4.0

func (s *KubernetesServiceOp) Delete(ctx context.Context, clusterID string) (*Response, error)

func (*KubernetesServiceOp) DeleteNodePool added in v0.4.0

func (s *KubernetesServiceOp) DeleteNodePool(ctx context.Context, clusterID, poolID string) (*Response, error)

func (*KubernetesServiceOp) Get added in v0.4.0

func (s *KubernetesServiceOp) Get(ctx context.Context, clusterID string) (*K8sCluster, *Response, error)

func (*KubernetesServiceOp) Kubeconfig added in v0.4.0

func (s *KubernetesServiceOp) Kubeconfig(ctx context.Context, clusterID string) (*K8sKubeconfig, *Response, error)

func (*KubernetesServiceOp) KubeconfigWithTTL added in v0.5.0

func (s *KubernetesServiceOp) KubeconfigWithTTL(ctx context.Context, clusterID string, ttlSeconds int) (*K8sKubeconfig, *Response, error)

KubeconfigWithTTL returns a SHORT-LIVED kubeconfig: a bound token with the given time-to-live (10 minutes to 30 days). It expires on its own; RotateKubeconfigAccess invalidates all previously issued ones at once.

func (*KubernetesServiceOp) List added in v0.4.0

func (*KubernetesServiceOp) ListEvents added in v0.4.0

func (s *KubernetesServiceOp) ListEvents(ctx context.Context, clusterID string) ([]K8sClusterEvent, *Response, error)

func (*KubernetesServiceOp) ListNodePlans added in v0.4.0

func (s *KubernetesServiceOp) ListNodePlans(ctx context.Context) (*K8sNodePlans, *Response, error)

func (*KubernetesServiceOp) ListNodePools added in v0.4.0

func (s *KubernetesServiceOp) ListNodePools(ctx context.Context, clusterID string) ([]K8sNodePool, *Response, error)

func (*KubernetesServiceOp) ListNodes added in v0.4.0

func (s *KubernetesServiceOp) ListNodes(ctx context.Context, clusterID string) ([]K8sClusterNode, *Response, error)

func (*KubernetesServiceOp) ListVersions added in v0.4.0

func (s *KubernetesServiceOp) ListVersions(ctx context.Context) ([]K8sVersion, *Response, error)

func (*KubernetesServiceOp) Rename added in v0.4.0

func (s *KubernetesServiceOp) Rename(ctx context.Context, clusterID, name string) (*Response, error)

func (*KubernetesServiceOp) RotateKubeconfigAccess added in v0.5.0

func (s *KubernetesServiceOp) RotateKubeconfigAccess(ctx context.Context, clusterID string) (*Response, error)

RotateKubeconfigAccess invalidates every previously issued short-lived kubeconfig for the cluster, immediately. The admin kubeconfig is unaffected.

func (*KubernetesServiceOp) ScaleNodePool added in v0.4.0

func (s *KubernetesServiceOp) ScaleNodePool(ctx context.Context, clusterID, poolID string, nodeCount int) (*Response, error)

func (*KubernetesServiceOp) SetMaintenance added in v0.4.0

func (s *KubernetesServiceOp) SetMaintenance(ctx context.Context, clusterID, mode string, day, startHour *int) (*Response, error)

SetMaintenance sets the upgrade mode (manual, auto_patch, auto_minor) and optionally the weekly 4-hour maintenance window.

func (*KubernetesServiceOp) UpdateNodePool added in v0.4.0

func (s *KubernetesServiceOp) UpdateNodePool(ctx context.Context, clusterID, poolID string, req *UpdateK8sNodePoolRequest) (*K8sNodePool, *Response, error)

func (*KubernetesServiceOp) Upgrade added in v0.4.0

func (s *KubernetesServiceOp) Upgrade(ctx context.Context, clusterID string, versionID int, confirmSingleMaster bool) (*Response, error)

Upgrade starts an in-place Kubernetes version upgrade. confirmSingleMaster must be true on non-HA clusters (brief API interruption).

func (*KubernetesServiceOp) UpgradeHA added in v0.4.0

func (s *KubernetesServiceOp) UpgradeHA(ctx context.Context, clusterID string) (*Response, error)

func (*KubernetesServiceOp) Upgrades added in v0.4.0

func (s *KubernetesServiceOp) Upgrades(ctx context.Context, clusterID string) (*K8sUpgradeInfo, *Response, error)

Upgrades lists the versions a cluster can upgrade to plus its upgrade state.

func (*KubernetesServiceOp) WaitForDeleted added in v0.4.0

func (s *KubernetesServiceOp) WaitForDeleted(ctx context.Context, clusterID string) error

func (*KubernetesServiceOp) WaitForStatus added in v0.4.0

func (s *KubernetesServiceOp) WaitForStatus(ctx context.Context, clusterID string, target K8sClusterStatus) (*K8sCluster, error)

type ListVMNetworksOptions

type ListVMNetworksOptions = spec.ListVMNetworksParams

ListVMNetworksOptions are the optional filters for listing VM networks.

type Member added in v0.2.0

type Member = spec.Member

Member represents an account-level member.

type MemberListOptions added in v0.2.0

type MemberListOptions = spec.ListMembersParams

MemberListOptions are the query parameters for listing account members.

type MemberService added in v0.2.0

type MemberService interface {
	List(ctx context.Context, opts *MemberListOptions) ([]Member, *Response, error)
	Get(ctx context.Context, memberID string) (*Member, *Response, error)
	Add(ctx context.Context, req *AddMemberRequest) (*Member, *Response, error)
	Update(ctx context.Context, memberID string, req *UpdateMemberRequest) (*Member, *Response, error)
	Remove(ctx context.Context, memberID string) (*Response, error)
}

MemberService handles communication with the account-level member endpoints.

type MemberServiceOp added in v0.2.0

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

MemberServiceOp implements MemberService.

func (*MemberServiceOp) Add added in v0.2.0

func (*MemberServiceOp) Get added in v0.2.0

func (s *MemberServiceOp) Get(ctx context.Context, memberID string) (*Member, *Response, error)

func (*MemberServiceOp) List added in v0.2.0

func (*MemberServiceOp) Remove added in v0.2.0

func (s *MemberServiceOp) Remove(ctx context.Context, memberID string) (*Response, error)

func (*MemberServiceOp) Update added in v0.2.0

func (s *MemberServiceOp) Update(ctx context.Context, memberID string, req *UpdateMemberRequest) (*Member, *Response, error)

type MetadataService added in v0.3.0

type MetadataService interface {
	ListRegions(ctx context.Context) ([]Region, *Response, error)
	ListTemplates(ctx context.Context, opts *TemplateListOptions) ([]Template, *Response, error)
}

MetadataService exposes read-only catalog endpoints (templates, regions) that don't fit any one resource. They power VM/volume creation flows and the public docs.

type MetadataServiceOp added in v0.3.0

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

MetadataServiceOp implements MetadataService.

func (*MetadataServiceOp) ListRegions added in v0.3.0

func (s *MetadataServiceOp) ListRegions(ctx context.Context) ([]Region, *Response, error)

func (*MetadataServiceOp) ListTemplates added in v0.3.0

func (s *MetadataServiceOp) ListTemplates(ctx context.Context, opts *TemplateListOptions) ([]Template, *Response, error)

type Permission added in v0.2.0

type Permission = spec.Permission

Permission represents a single permission identifier (e.g. "vm.create") along with its description and applicable scope.

type PermissionListOptions added in v0.2.0

type PermissionListOptions = spec.ListPermissionsParams

PermissionListOptions are the query parameters for listing permissions.

type PermissionService added in v0.2.0

type PermissionService interface {
	List(ctx context.Context, opts *PermissionListOptions) ([]Permission, *Response, error)
}

PermissionService handles communication with the permissions catalog endpoint. Permissions themselves are read-only — they're built into the platform; only roles bind a set of permissions to members.

type PermissionServiceOp added in v0.2.0

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

PermissionServiceOp implements PermissionService.

func (*PermissionServiceOp) List added in v0.2.0

type PricingService added in v0.3.0

type PricingService interface {
	ListVM(ctx context.Context, opts *VMPricingListOptions) ([]VMPricingPlan, *Response, error)
	ListVolume(ctx context.Context, opts *VolumePricingListOptions) (*StoragePricing, *Response, error)
	ListBackup(ctx context.Context, opts *BackupPricingListOptions) (*StoragePricing, *Response, error)
	ListSnapshot(ctx context.Context, opts *SnapshotPricingListOptions) (*StoragePricing, *Response, error)
	ListIP(ctx context.Context) (*IPPricing, *Response, error)
}

PricingService exposes the public pricing catalog. All endpoints are read-only and do not require an API key — they back the marketing pricing pages and `vm create` size pickers.

type PricingServiceOp added in v0.3.0

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

PricingServiceOp implements PricingService.

func (*PricingServiceOp) ListBackup added in v0.3.0

func (*PricingServiceOp) ListIP added in v0.3.0

func (s *PricingServiceOp) ListIP(ctx context.Context) (*IPPricing, *Response, error)

func (*PricingServiceOp) ListSnapshot added in v0.3.0

func (*PricingServiceOp) ListVM added in v0.3.0

func (*PricingServiceOp) ListVolume added in v0.3.0

type Project

type Project = spec.Project

Project represents a Raff project. Aliased to the generated spec type so new fields propagate automatically when the OpenAPI spec changes.

type ProjectListOptions

type ProjectListOptions = spec.ListProjectsParams

ProjectListOptions are the query parameters for listing projects.

type ProjectMember added in v0.2.0

type ProjectMember = spec.ProjectMember

ProjectMember represents a project-level member.

type ProjectMemberListOptions added in v0.2.0

type ProjectMemberListOptions = spec.ListProjectMembersParams

ProjectMemberListOptions are the query parameters for listing project members.

type ProjectMemberService added in v0.2.0

type ProjectMemberService interface {
	List(ctx context.Context, projectID string, opts *ProjectMemberListOptions) ([]ProjectMember, *Response, error)
	Get(ctx context.Context, projectID, memberID string) (*ProjectMember, *Response, error)
	Add(ctx context.Context, projectID string, req *AddProjectMemberRequest) (*ProjectMember, *Response, error)
	Update(ctx context.Context, projectID, memberID string, req *UpdateProjectMemberRequest) (*ProjectMember, *Response, error)
	Remove(ctx context.Context, projectID, memberID string) (*Response, error)
}

ProjectMemberService handles communication with the project member endpoints.

All operations require a project ID — these are project-scoped, not account-scoped.

type ProjectMemberServiceOp added in v0.2.0

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

ProjectMemberServiceOp implements ProjectMemberService.

func (*ProjectMemberServiceOp) Add added in v0.2.0

func (*ProjectMemberServiceOp) Get added in v0.2.0

func (s *ProjectMemberServiceOp) Get(ctx context.Context, projectID, memberID string) (*ProjectMember, *Response, error)

func (*ProjectMemberServiceOp) List added in v0.2.0

func (*ProjectMemberServiceOp) Remove added in v0.2.0

func (s *ProjectMemberServiceOp) Remove(ctx context.Context, projectID, memberID string) (*Response, error)

func (*ProjectMemberServiceOp) Update added in v0.2.0

func (s *ProjectMemberServiceOp) Update(ctx context.Context, projectID, memberID string, req *UpdateProjectMemberRequest) (*ProjectMember, *Response, error)

type ProjectService

type ProjectService interface {
	List(ctx context.Context, opts *ProjectListOptions) ([]Project, *Response, error)
	Get(ctx context.Context, projectID string) (*Project, *Response, error)
	Create(ctx context.Context, req *CreateProjectRequest) (*Project, *Response, error)
	Update(ctx context.Context, projectID string, req *UpdateProjectRequest) (*Project, *Response, error)
	Delete(ctx context.Context, projectID string) (*Response, error)
}

ProjectService handles communication with the project endpoints.

type ProjectServiceOp

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

ProjectServiceOp implements ProjectService.

func (*ProjectServiceOp) Create

Create creates a new project.

func (*ProjectServiceOp) Delete

func (s *ProjectServiceOp) Delete(ctx context.Context, projectID string) (*Response, error)

Delete deletes a project.

func (*ProjectServiceOp) Get

func (s *ProjectServiceOp) Get(ctx context.Context, projectID string) (*Project, *Response, error)

Get returns a single project by ID.

func (*ProjectServiceOp) List

List returns all projects for the authenticated account.

func (*ProjectServiceOp) Update

func (s *ProjectServiceOp) Update(ctx context.Context, projectID string, req *UpdateProjectRequest) (*Project, *Response, error)

Update updates an existing project.

type Region added in v0.3.0

type Region = spec.Region

Region represents a Raff datacenter region.

type ReinstallVMRequest

type ReinstallVMRequest = spec.ReinstallVMRequest

ReinstallVMRequest is the request body for reinstalling a VM.

type RenameSnapshotRequest added in v0.3.0

type RenameSnapshotRequest = spec.RenameSnapshotRequest

RenameSnapshotRequest is the request body for renaming a snapshot.

type RenameVMRequest

type RenameVMRequest = spec.RenameVMRequest

RenameVMRequest is the request body for renaming a VM.

type ReserveIPRequest

type ReserveIPRequest = spec.ReserveIPRequest

ReserveIPRequest is the request body for reserving a floating IP.

type ResizeResponse

type ResizeResponse = spec.ResizeResponse

ResizeResponse is the response from a resize operation, including billing.

type ResizeVMDiskRequest

type ResizeVMDiskRequest = spec.ResizeVMDiskRequest

ResizeVMDiskRequest is the request body for resizing a VM's disk.

type ResizeVMRequest

type ResizeVMRequest = spec.ResizeVMRequest

ResizeVMRequest is the request body for resizing a VM.

type ResizeVolumeRequest added in v0.3.0

type ResizeVolumeRequest = spec.ResizeVolumeRequest

ResizeVolumeRequest is the request body for resizing a volume.

type Response

type Response struct {
	*http.Response
	Total int
}

Response wraps the underlying http.Response for callers that need access to status codes, headers, or pagination metadata.

type Role added in v0.2.0

type Role = spec.Role

Role represents an IAM role (account-level or project-level).

type RoleListOptions added in v0.2.0

type RoleListOptions = spec.ListRolesParams

RoleListOptions are the query parameters for listing roles.

type RoleService added in v0.2.0

type RoleService interface {
	List(ctx context.Context, opts *RoleListOptions) ([]Role, *Response, error)
	Get(ctx context.Context, roleID string) (*Role, *Response, error)
	Create(ctx context.Context, req *CreateRoleRequest) (*Role, *Response, error)
	Update(ctx context.Context, roleID string, req *UpdateRoleRequest) (*Role, *Response, error)
	Delete(ctx context.Context, roleID string) (*Response, error)
}

RoleService handles communication with the role endpoints.

System roles (Owner, Admin, Member, etc.) are immutable and cannot be updated or deleted; the Update / Delete methods will return an error from the API for system roles.

type RoleServiceOp added in v0.2.0

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

RoleServiceOp implements RoleService.

func (*RoleServiceOp) Create added in v0.2.0

func (s *RoleServiceOp) Create(ctx context.Context, req *CreateRoleRequest) (*Role, *Response, error)

func (*RoleServiceOp) Delete added in v0.2.0

func (s *RoleServiceOp) Delete(ctx context.Context, roleID string) (*Response, error)

func (*RoleServiceOp) Get added in v0.2.0

func (s *RoleServiceOp) Get(ctx context.Context, roleID string) (*Role, *Response, error)

func (*RoleServiceOp) List added in v0.2.0

func (s *RoleServiceOp) List(ctx context.Context, opts *RoleListOptions) ([]Role, *Response, error)

func (*RoleServiceOp) Update added in v0.2.0

func (s *RoleServiceOp) Update(ctx context.Context, roleID string, req *UpdateRoleRequest) (*Role, *Response, error)

type RollbackAppServiceRequest added in v0.4.1

type RollbackAppServiceRequest struct {
	TargetDeploymentID string `json:"target_deployment_id"`
}

RollbackAppServiceRequest pins a service back to an older deployment's image.

type SSHKey added in v0.2.0

type SSHKey = spec.SSHKey

SSHKey represents a registered SSH public key.

type SSHKeyService added in v0.2.0

type SSHKeyService interface {
	List(ctx context.Context) ([]SSHKey, *Response, error)
	Get(ctx context.Context, keyID string) (*SSHKey, *Response, error)
	Create(ctx context.Context, req *CreateSSHKeyRequest) (*SSHKey, *Response, error)
	Update(ctx context.Context, keyID string, req *UpdateSSHKeyRequest) (*SSHKey, *Response, error)
	Delete(ctx context.Context, keyID string) (*Response, error)
}

SSHKeyService handles communication with the SSH key endpoints.

SSH keys are scoped to the account, not to a project — list returns every key the API key's account can see.

type SSHKeyServiceOp added in v0.2.0

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

SSHKeyServiceOp implements SSHKeyService.

func (*SSHKeyServiceOp) Create added in v0.2.0

func (*SSHKeyServiceOp) Delete added in v0.2.0

func (s *SSHKeyServiceOp) Delete(ctx context.Context, keyID string) (*Response, error)

func (*SSHKeyServiceOp) Get added in v0.2.0

func (s *SSHKeyServiceOp) Get(ctx context.Context, keyID string) (*SSHKey, *Response, error)

func (*SSHKeyServiceOp) List added in v0.2.0

func (s *SSHKeyServiceOp) List(ctx context.Context) ([]SSHKey, *Response, error)

func (*SSHKeyServiceOp) Update added in v0.2.0

func (s *SSHKeyServiceOp) Update(ctx context.Context, keyID string, req *UpdateSSHKeyRequest) (*SSHKey, *Response, error)

type SaveImageRequest

type SaveImageRequest = spec.SaveImageRequest

SaveImageRequest is the request body for saving a VM disk as a custom image.

type ScaleAppServiceRequest added in v0.4.1

type ScaleAppServiceRequest struct {
	Replicas          int    `json:"replicas,omitempty"`
	AutoscalingSet    bool   `json:"autoscaling_set,omitempty"`
	Autoscaling       bool   `json:"autoscaling_enabled,omitempty"`
	MinReplicas       int    `json:"min_replicas,omitempty"`
	MaxReplicas       int    `json:"max_replicas,omitempty"`
	AutoscalingMetric string `json:"autoscaling_metric,omitempty"`
	AutoscalingTarget int    `json:"autoscaling_target,omitempty"`
	ScaleToZero       bool   `json:"scale_to_zero,omitempty"`
}

ScaleAppServiceRequest updates replicas / autoscaling / scale-to-zero.

type SecurityGroup

type SecurityGroup = spec.SecurityGroup

SecurityGroup represents a named set of network rules.

type SecurityGroupListOptions

type SecurityGroupListOptions = spec.ListSecurityGroupsParams

SecurityGroupListOptions are query params for listing security groups.

type SecurityGroupRule

type SecurityGroupRule = spec.SecurityGroupRule

SecurityGroupRule is a single inbound or outbound rule.

type SecurityGroupService

SecurityGroupService handles communication with the security group endpoints.

type SecurityGroupServiceOp

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

SecurityGroupServiceOp implements SecurityGroupService.

func (*SecurityGroupServiceOp) Create

func (*SecurityGroupServiceOp) Delete

func (s *SecurityGroupServiceOp) Delete(ctx context.Context, sgID string) (*Response, error)

func (*SecurityGroupServiceOp) Get

func (*SecurityGroupServiceOp) List

func (*SecurityGroupServiceOp) Templates

func (*SecurityGroupServiceOp) Update

type SecurityGroupTemplate

type SecurityGroupTemplate = spec.SecurityGroupTemplate

SecurityGroupTemplate is a pre-built rule set you can clone when creating a group.

type SetAppEnvVarRequest added in v0.4.1

type SetAppEnvVarRequest struct {
	Key      string `json:"key"`
	Value    string `json:"value"`
	IsSecret bool   `json:"is_secret,omitempty"`
	Redeploy *bool  `json:"redeploy,omitempty"`
}

SetAppEnvVarRequest sets one environment variable. Redeploy defaults to true (nil) — env changes roll out to running replicas.

type SetFunctionEnvVarRequest added in v0.4.1

type SetFunctionEnvVarRequest struct {
	Key      string `json:"key"`
	Value    string `json:"value"`
	IsSecret bool   `json:"is_secret,omitempty"`
}

SetFunctionEnvVarRequest sets one environment variable.

type Snapshot added in v0.3.0

type Snapshot = spec.Snapshot

Snapshot represents a point-in-time snapshot of a VM disk or volume.

type SnapshotListOptions added in v0.3.0

type SnapshotListOptions = spec.ListSnapshotsParams

SnapshotListOptions are the query parameters for listing snapshots.

type SnapshotPricingListOptions added in v0.3.0

type SnapshotPricingListOptions = spec.ListSnapshotPricingParams

SnapshotPricingListOptions filters snapshot pricing by region.

type SnapshotService added in v0.3.0

type SnapshotService interface {
	List(ctx context.Context, opts *SnapshotListOptions) ([]Snapshot, *Response, error)
	Get(ctx context.Context, snapshotID int) (*Snapshot, *Response, error)
	Create(ctx context.Context, req *CreateSnapshotRequest) (*Snapshot, *Response, error)
	Rename(ctx context.Context, snapshotID int, req *RenameSnapshotRequest) (*Snapshot, *Response, error)
	Restore(ctx context.Context, snapshotID int) (*Response, error)
	Delete(ctx context.Context, snapshotID int) (*Response, error)
}

SnapshotService handles communication with the snapshot endpoints.

type SnapshotServiceOp added in v0.3.0

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

SnapshotServiceOp implements SnapshotService.

func (*SnapshotServiceOp) Create added in v0.3.0

func (*SnapshotServiceOp) Delete added in v0.3.0

func (s *SnapshotServiceOp) Delete(ctx context.Context, snapshotID int) (*Response, error)

func (*SnapshotServiceOp) Get added in v0.3.0

func (s *SnapshotServiceOp) Get(ctx context.Context, snapshotID int) (*Snapshot, *Response, error)

func (*SnapshotServiceOp) List added in v0.3.0

func (*SnapshotServiceOp) Rename added in v0.3.0

func (s *SnapshotServiceOp) Rename(ctx context.Context, snapshotID int, req *RenameSnapshotRequest) (*Snapshot, *Response, error)

func (*SnapshotServiceOp) Restore added in v0.3.0

func (s *SnapshotServiceOp) Restore(ctx context.Context, snapshotID int) (*Response, error)

type SourceFile added in v0.4.1

type SourceFile struct {
	Name    string `json:"name"`
	Content string `json:"content"`
}

SourceFile is one source file (input or converted output).

type StoragePricing added in v0.3.0

type StoragePricing = spec.StoragePricing

StoragePricing is the per-GB storage pricing shape used by volume, backup, and snapshot pricing endpoints.

type Template added in v0.3.0

type Template = spec.Template

Template represents an OS template available for VM creation.

type TemplateListOptions added in v0.3.0

type TemplateListOptions = spec.ListTemplatesParams

TemplateListOptions are the query parameters for filtering templates.

type UpdateAPIKeyRequest added in v0.2.0

type UpdateAPIKeyRequest = spec.UpdateAPIKeyRequest

UpdateAPIKeyRequest is the request body for updating an API key.

type UpdateAppSpendSettingsRequest added in v0.4.1

type UpdateAppSpendSettingsRequest struct {
	Enabled       bool    `json:"enabled"`
	MonthlyCapUSD float64 `json:"monthly_cap_usd"`
	CapAction     string  `json:"cap_action,omitempty"`
}

UpdateAppSpendSettingsRequest saves the account's Apps spend cap.

type UpdateBackupScheduleRequest added in v0.3.0

type UpdateBackupScheduleRequest = spec.UpdateBackupScheduleRequest

UpdateBackupScheduleRequest is the request body for updating a schedule.

type UpdateFunctionRequest added in v0.4.1

type UpdateFunctionRequest struct {
	Description     *string `json:"description,omitempty"`
	MemoryMB        *int    `json:"memory_mb,omitempty"`
	TimeoutSeconds  *int    `json:"timeout_seconds,omitempty"`
	ExtendedTimeout *bool   `json:"extended_timeout,omitempty"`
	MinScale        *int    `json:"min_scale,omitempty"`
	MaxScale        *int    `json:"max_scale,omitempty"`
}

UpdateFunctionRequest partially updates runtime settings (nil = keep). Live functions roll changes out as a zero-downtime config redeploy.

type UpdateK8sNodePoolRequest added in v0.4.0

type UpdateK8sNodePoolRequest = spec.UpdateK8SNodePoolJSONRequestBody

UpdateK8sNodePoolRequest is the request body for updating a node pool.

type UpdateMemberRequest added in v0.2.0

type UpdateMemberRequest = spec.UpdateMemberRequest

UpdateMemberRequest is the request body for updating a member's role/status.

type UpdateProjectMemberRequest added in v0.2.0

type UpdateProjectMemberRequest = spec.UpdateMemberRequest

UpdateProjectMemberRequest is the request body for updating a project member. The spec reuses UpdateMemberRequest for both account and project member updates — same fields (role, status).

type UpdateProjectRequest

type UpdateProjectRequest = spec.UpdateProjectRequest

UpdateProjectRequest is the request body for updating a project.

type UpdateRoleRequest added in v0.2.0

type UpdateRoleRequest = spec.UpdateRoleRequest

UpdateRoleRequest is the request body for updating a custom role.

type UpdateSSHKeyRequest added in v0.2.0

type UpdateSSHKeyRequest = spec.UpdateSSHKeyRequest

UpdateSSHKeyRequest is the request body for renaming an SSH key.

type UpdateSecurityGroupRequest

type UpdateSecurityGroupRequest = spec.UpdateSecurityGroupRequest

UpdateSecurityGroupRequest is the request body for updating a security group.

type UpdateVMTagRequest

type UpdateVMTagRequest = spec.UpdateVMTagRequest

UpdateVMTagRequest is the request body for updating a tag.

type UpdateVPCRequest

type UpdateVPCRequest = spec.UpdateVPCRequest

UpdateVPCRequest is the request body for updating a VPC.

type UpsertVMNoteRequest

type UpsertVMNoteRequest = spec.UpsertVMNoteRequest

UpsertVMNoteRequest is the request body for creating or updating a note.

type VM

type VM = spec.VM

VM represents a virtual machine. Aliased to the generated spec type so new fields propagate automatically when the OpenAPI spec changes.

type VMImage

type VMImage = spec.VMImage

VMImage is a custom OS image saved from a VM disk.

type VMListOptions

type VMListOptions = spec.ListVMsParams

VMListOptions are the query parameters for listing VMs.

type VMNetwork

type VMNetwork = spec.VMNetwork

VMNetwork is a network interface attached to a VM.

type VMNetworkType

type VMNetworkType = spec.ListVMNetworksParamsType

VMNetworkType is "public", "vpc", or "ipv6", used by ListVMNetworksOptions.Type.

type VMNote

type VMNote = spec.VMNote

VMNote is a free-form note attached to a VM.

type VMNoteType

type VMNoteType = spec.UpsertVMNoteParamsType

VMNoteType is "personal" or "account".

type VMNotesFilterType

type VMNotesFilterType = spec.GetVMNotesParamsType

VMNotesFilterType is "personal" or "account" used by GetVMNotesOptions.Type.

type VMNotesResponse

type VMNotesResponse = spec.VMNotesResponse

VMNotesResponse holds personal and account notes for a VM.

type VMPricingListOptions added in v0.3.0

type VMPricingListOptions = spec.ListVMPricingParams

VMPricingListOptions filters VM pricing by region / type.

type VMPricingPlan added in v0.3.0

type VMPricingPlan = spec.VMPricingPlan

VMPricingPlan represents a single VM size/plan with pricing.

type VMService

type VMService interface {
	List(ctx context.Context, opts *VMListOptions) ([]VM, *Response, error)
	Get(ctx context.Context, vmID string) (*VM, *Response, error)
	Create(ctx context.Context, req *CreateVMRequest) (*VM, *Response, error)
	Delete(ctx context.Context, vmID string, req *DeleteVMRequest) (*Response, error)
	BulkDelete(ctx context.Context, req *BulkDeleteVMsRequest) (*BulkDeleteVMsResult, *Response, error)
	Start(ctx context.Context, vmID string) (*Response, error)
	Stop(ctx context.Context, vmID string) (*Response, error)
	Reboot(ctx context.Context, vmID string) (*Response, error)
	Rename(ctx context.Context, vmID string, req *RenameVMRequest) (*Response, error)
	ResetPassword(ctx context.Context, vmID string) (*Response, error)
	Reinstall(ctx context.Context, vmID string, req *ReinstallVMRequest) (*Response, error)
	FactoryReset(ctx context.Context, vmID string) (*Response, error)
	Resize(ctx context.Context, vmID string, req *ResizeVMRequest) (*ResizeResponse, *Response, error)
	ResizeDisk(ctx context.Context, vmID string, req *ResizeVMDiskRequest) (*ResizeResponse, *Response, error)
	HardReboot(ctx context.Context, vmID string) (*Response, error)
	SaveImage(ctx context.Context, vmID string, req *SaveImageRequest) (*VMImage, *Response, error)
	ListNetworks(ctx context.Context, vmID string, opts *ListVMNetworksOptions) ([]VMNetwork, *Response, error)
	AttachVPC(ctx context.Context, vmID string, req *AttachVPCRequest) (*Response, error)
	DetachVPC(ctx context.Context, vmID string, nicID int) (*Response, error)
	AttachIP(ctx context.Context, vmID string, req *AttachIPRequest) (*AttachIPResponse, *Response, error)
	DetachIP(ctx context.Context, vmID string, nicID int) (*Response, error)
	AttachSecurityGroup(ctx context.Context, vmID string, req *AttachSecurityGroupRequest) (*Response, error)
	DetachSecurityGroup(ctx context.Context, vmID, securityGroupID string, nicID int) (*Response, error)
	AddTag(ctx context.Context, vmID string, req *AddVMTagRequest) ([]VMTag, *Response, error)
	UpdateTag(ctx context.Context, vmID, tagID string, req *UpdateVMTagRequest) ([]VMTag, *Response, error)
	RemoveTag(ctx context.Context, vmID, tagID string) ([]VMTag, *Response, error)
	GetNotes(ctx context.Context, vmID string, opts *GetVMNotesOptions) (*VMNotesResponse, *Response, error)
	UpsertNote(ctx context.Context, vmID string, noteType VMNoteType, req *UpsertVMNoteRequest) (*VMNote, *Response, error)
	UpdateNote(ctx context.Context, vmID string, noteType VMNoteType, req *UpsertVMNoteRequest) (*VMNote, *Response, error)
	AppendNote(ctx context.Context, vmID string, noteType VMNoteType, req *UpsertVMNoteRequest) (*VMNote, *Response, error)
}

VMService handles communication with the VM endpoints.

type VMServiceOp

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

VMServiceOp implements VMService.

func (*VMServiceOp) AddTag

func (s *VMServiceOp) AddTag(ctx context.Context, vmID string, req *AddVMTagRequest) ([]VMTag, *Response, error)

func (*VMServiceOp) AppendNote

func (s *VMServiceOp) AppendNote(ctx context.Context, vmID string, noteType VMNoteType, req *UpsertVMNoteRequest) (*VMNote, *Response, error)

func (*VMServiceOp) AttachIP

func (s *VMServiceOp) AttachIP(ctx context.Context, vmID string, req *AttachIPRequest) (*AttachIPResponse, *Response, error)

func (*VMServiceOp) AttachSecurityGroup

func (s *VMServiceOp) AttachSecurityGroup(ctx context.Context, vmID string, req *AttachSecurityGroupRequest) (*Response, error)

func (*VMServiceOp) AttachVPC

func (s *VMServiceOp) AttachVPC(ctx context.Context, vmID string, req *AttachVPCRequest) (*Response, error)

func (*VMServiceOp) BulkDelete

func (*VMServiceOp) Create

func (s *VMServiceOp) Create(ctx context.Context, req *CreateVMRequest) (*VM, *Response, error)

func (*VMServiceOp) Delete

func (s *VMServiceOp) Delete(ctx context.Context, vmID string, req *DeleteVMRequest) (*Response, error)

func (*VMServiceOp) DetachIP

func (s *VMServiceOp) DetachIP(ctx context.Context, vmID string, nicID int) (*Response, error)

func (*VMServiceOp) DetachSecurityGroup

func (s *VMServiceOp) DetachSecurityGroup(ctx context.Context, vmID, securityGroupID string, nicID int) (*Response, error)

func (*VMServiceOp) DetachVPC

func (s *VMServiceOp) DetachVPC(ctx context.Context, vmID string, nicID int) (*Response, error)

func (*VMServiceOp) FactoryReset

func (s *VMServiceOp) FactoryReset(ctx context.Context, vmID string) (*Response, error)

func (*VMServiceOp) Get

func (s *VMServiceOp) Get(ctx context.Context, vmID string) (*VM, *Response, error)

func (*VMServiceOp) GetNotes

func (s *VMServiceOp) GetNotes(ctx context.Context, vmID string, opts *GetVMNotesOptions) (*VMNotesResponse, *Response, error)

func (*VMServiceOp) HardReboot

func (s *VMServiceOp) HardReboot(ctx context.Context, vmID string) (*Response, error)

func (*VMServiceOp) List

func (s *VMServiceOp) List(ctx context.Context, opts *VMListOptions) ([]VM, *Response, error)

func (*VMServiceOp) ListNetworks

func (s *VMServiceOp) ListNetworks(ctx context.Context, vmID string, opts *ListVMNetworksOptions) ([]VMNetwork, *Response, error)

func (*VMServiceOp) Reboot

func (s *VMServiceOp) Reboot(ctx context.Context, vmID string) (*Response, error)

func (*VMServiceOp) Reinstall

func (s *VMServiceOp) Reinstall(ctx context.Context, vmID string, req *ReinstallVMRequest) (*Response, error)

func (*VMServiceOp) RemoveTag

func (s *VMServiceOp) RemoveTag(ctx context.Context, vmID, tagID string) ([]VMTag, *Response, error)

func (*VMServiceOp) Rename

func (s *VMServiceOp) Rename(ctx context.Context, vmID string, req *RenameVMRequest) (*Response, error)

func (*VMServiceOp) ResetPassword

func (s *VMServiceOp) ResetPassword(ctx context.Context, vmID string) (*Response, error)

func (*VMServiceOp) Resize

func (s *VMServiceOp) Resize(ctx context.Context, vmID string, req *ResizeVMRequest) (*ResizeResponse, *Response, error)

func (*VMServiceOp) ResizeDisk

func (s *VMServiceOp) ResizeDisk(ctx context.Context, vmID string, req *ResizeVMDiskRequest) (*ResizeResponse, *Response, error)

func (*VMServiceOp) SaveImage

func (s *VMServiceOp) SaveImage(ctx context.Context, vmID string, req *SaveImageRequest) (*VMImage, *Response, error)

func (*VMServiceOp) Start

func (s *VMServiceOp) Start(ctx context.Context, vmID string) (*Response, error)

func (*VMServiceOp) Stop

func (s *VMServiceOp) Stop(ctx context.Context, vmID string) (*Response, error)

func (*VMServiceOp) UpdateNote

func (s *VMServiceOp) UpdateNote(ctx context.Context, vmID string, noteType VMNoteType, req *UpsertVMNoteRequest) (*VMNote, *Response, error)

func (*VMServiceOp) UpdateTag

func (s *VMServiceOp) UpdateTag(ctx context.Context, vmID, tagID string, req *UpdateVMTagRequest) ([]VMTag, *Response, error)

func (*VMServiceOp) UpsertNote

func (s *VMServiceOp) UpsertNote(ctx context.Context, vmID string, noteType VMNoteType, req *UpsertVMNoteRequest) (*VMNote, *Response, error)

type VMTag

type VMTag = spec.VMTag

VMTag is a custom tag attached to a VM.

type VMTagsResponse

type VMTagsResponse = spec.VMTagsResponse

VMTagsResponse is the response shape for tag mutations — returns the full updated tag list for the VM.

type VPC

type VPC = spec.VPC

VPC represents a virtual private cloud.

type VPCDetail

type VPCDetail = spec.VPCDetail

VPCDetail is the richer response returned by GET /api/v1/vpcs/{id}: the VPC plus its allocatable IP range and the active leases on attached NICs.

type VPCLease

type VPCLease = spec.VPCLease

VPCLease is a single IP lease on a VPC NIC.

type VPCListOptions

type VPCListOptions = spec.ListVPCsParams

VPCListOptions are the query parameters for listing VPCs.

type VPCService

type VPCService interface {
	List(ctx context.Context, opts *VPCListOptions) ([]VPC, *Response, error)
	Get(ctx context.Context, vpcID string) (*VPC, *Response, error)
	GetDetail(ctx context.Context, vpcID string) (*VPCDetail, *Response, error)
	Create(ctx context.Context, req *CreateVPCRequest) (*VPC, *Response, error)
	Update(ctx context.Context, vpcID string, req *UpdateVPCRequest) (*VPC, *Response, error)
	Delete(ctx context.Context, vpcID string) (*Response, error)
	CIDRSuggestions(ctx context.Context) (*CIDRSuggestionsResponse, *Response, error)
}

VPCService handles communication with the VPC endpoints.

type VPCServiceOp

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

VPCServiceOp implements VPCService.

func (*VPCServiceOp) CIDRSuggestions

func (s *VPCServiceOp) CIDRSuggestions(ctx context.Context) (*CIDRSuggestionsResponse, *Response, error)

func (*VPCServiceOp) Create

func (s *VPCServiceOp) Create(ctx context.Context, req *CreateVPCRequest) (*VPC, *Response, error)

func (*VPCServiceOp) Delete

func (s *VPCServiceOp) Delete(ctx context.Context, vpcID string) (*Response, error)

func (*VPCServiceOp) Get

func (s *VPCServiceOp) Get(ctx context.Context, vpcID string) (*VPC, *Response, error)

func (*VPCServiceOp) GetDetail

func (s *VPCServiceOp) GetDetail(ctx context.Context, vpcID string) (*VPCDetail, *Response, error)

func (*VPCServiceOp) List

func (s *VPCServiceOp) List(ctx context.Context, opts *VPCListOptions) ([]VPC, *Response, error)

func (*VPCServiceOp) Update

func (s *VPCServiceOp) Update(ctx context.Context, vpcID string, req *UpdateVPCRequest) (*VPC, *Response, error)

type Volume added in v0.3.0

type Volume = spec.Volume

Volume represents a block storage volume.

type VolumeListOptions added in v0.3.0

type VolumeListOptions = spec.ListVolumesParams

VolumeListOptions are the query parameters for listing volumes.

type VolumePricingListOptions added in v0.3.0

type VolumePricingListOptions = spec.ListVolumePricingParams

VolumePricingListOptions filters volume pricing by region.

type VolumeService added in v0.3.0

type VolumeService interface {
	List(ctx context.Context, opts *VolumeListOptions) ([]Volume, *Response, error)
	Get(ctx context.Context, volumeID int) (*Volume, *Response, error)
	Create(ctx context.Context, req *CreateVolumeRequest) (*Volume, *Response, error)
	Delete(ctx context.Context, volumeID int) (*Response, error)
	Resize(ctx context.Context, volumeID int, req *ResizeVolumeRequest) (*ResizeResponse, *Response, error)
	Attach(ctx context.Context, volumeID int, req *AttachVolumeRequest) (*Volume, *Response, error)
	Detach(ctx context.Context, volumeID int) (*Response, error)
}

VolumeService handles communication with the volume endpoints.

type VolumeServiceOp added in v0.3.0

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

VolumeServiceOp implements VolumeService.

func (*VolumeServiceOp) Attach added in v0.3.0

func (s *VolumeServiceOp) Attach(ctx context.Context, volumeID int, req *AttachVolumeRequest) (*Volume, *Response, error)

func (*VolumeServiceOp) Create added in v0.3.0

func (*VolumeServiceOp) Delete added in v0.3.0

func (s *VolumeServiceOp) Delete(ctx context.Context, volumeID int) (*Response, error)

func (*VolumeServiceOp) Detach added in v0.3.0

func (s *VolumeServiceOp) Detach(ctx context.Context, volumeID int) (*Response, error)

func (*VolumeServiceOp) Get added in v0.3.0

func (s *VolumeServiceOp) Get(ctx context.Context, volumeID int) (*Volume, *Response, error)

func (*VolumeServiceOp) List added in v0.3.0

func (*VolumeServiceOp) Resize added in v0.3.0

func (s *VolumeServiceOp) Resize(ctx context.Context, volumeID int, req *ResizeVolumeRequest) (*ResizeResponse, *Response, error)

Directories

Path Synopsis
Package spec contains types and an HTTP client generated from the public OpenAPI specification at docs/api-reference/openapi.yaml.
Package spec contains types and an HTTP client generated from the public OpenAPI specification at docs/api-reference/openapi.yaml.

Jump to

Keyboard shortcuts

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