raff

package module
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 9 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 (
	// 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 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 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 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
	// 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 CreateAPIKeyRequest added in v0.2.0

type CreateAPIKeyRequest = spec.CreateAPIKeyRequest

CreateAPIKeyRequest is the request body for creating an API key.

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 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 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 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 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 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 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 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 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 UpdateBackupScheduleRequest added in v0.3.0

type UpdateBackupScheduleRequest = spec.UpdateBackupScheduleRequest

UpdateBackupScheduleRequest is the request body for updating a schedule.

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