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
- func Bool(v bool) *bool
- func BoolValue(p *bool) bool
- func Int(v int) *int
- func IntValue(p *int) int
- func String(v string) *string
- func StringValue(p *string) string
- type APIKey
- type APIKeyListOptions
- type APIKeyService
- type APIKeyServiceOp
- func (s *APIKeyServiceOp) Create(ctx context.Context, req *CreateAPIKeyRequest) (*APIKeyWithSecret, *Response, error)
- func (s *APIKeyServiceOp) Get(ctx context.Context, keyID string) (*APIKey, *Response, error)
- func (s *APIKeyServiceOp) List(ctx context.Context, opts *APIKeyListOptions) ([]APIKey, *Response, error)
- func (s *APIKeyServiceOp) Regenerate(ctx context.Context, keyID string) (*APIKeyWithSecret, *Response, error)
- func (s *APIKeyServiceOp) Revoke(ctx context.Context, keyID string) (*Response, error)
- func (s *APIKeyServiceOp) Update(ctx context.Context, keyID string, req *UpdateAPIKeyRequest) (*APIKey, *Response, error)
- type APIKeyWithSecret
- type AddMemberRequest
- type AddProjectMemberRequest
- type AddVMTagRequest
- type AttachIPRequest
- type AttachIPResponse
- type AttachSecurityGroupRequest
- type AttachVPCRequest
- type AttachVolumeRequest
- type Backup
- type BackupListOptions
- type BackupPricingListOptions
- type BackupSchedule
- type BackupScheduleListOptions
- type BackupScheduleService
- type BackupScheduleServiceOp
- func (s *BackupScheduleServiceOp) Create(ctx context.Context, req *CreateBackupScheduleRequest) (*BackupSchedule, *Response, error)
- func (s *BackupScheduleServiceOp) Delete(ctx context.Context, scheduleID int) (*Response, error)
- func (s *BackupScheduleServiceOp) Get(ctx context.Context, scheduleID int) (*BackupSchedule, *Response, error)
- func (s *BackupScheduleServiceOp) List(ctx context.Context, opts *BackupScheduleListOptions) ([]BackupSchedule, *Response, error)
- func (s *BackupScheduleServiceOp) Update(ctx context.Context, scheduleID int, req *UpdateBackupScheduleRequest) (*BackupSchedule, *Response, error)
- type BackupService
- type BackupServiceOp
- func (s *BackupServiceOp) Create(ctx context.Context, req *CreateBackupRequest) (*Backup, *Response, error)
- func (s *BackupServiceOp) Delete(ctx context.Context, backupID string) (*Response, error)
- func (s *BackupServiceOp) DeleteSeries(ctx context.Context, backupID string) (*Response, error)
- func (s *BackupServiceOp) Get(ctx context.Context, backupID string) (*Backup, *Response, error)
- func (s *BackupServiceOp) List(ctx context.Context, opts *BackupListOptions) ([]Backup, *Response, error)
- func (s *BackupServiceOp) ResetSeries(ctx context.Context, vmID string) (*Response, error)
- func (s *BackupServiceOp) Restore(ctx context.Context, backupID string) (*Backup, *Response, error)
- type BulkDeleteVMItemResult
- type BulkDeleteVMsRequest
- type BulkDeleteVMsResult
- type CIDRSuggestion
- type CIDRSuggestionsResponse
- type ChangeIPResponse
- type Client
- type ClientOpt
- type CreateAPIKeyRequest
- type CreateBackupRequest
- type CreateBackupScheduleRequest
- type CreateInvitationRequest
- type CreateProjectRequest
- type CreateRoleRequest
- type CreateSSHKeyRequest
- type CreateSecurityGroupRequest
- type CreateSnapshotRequest
- type CreateVMRequest
- type CreateVPCRequest
- type CreateVolumeRequest
- type DeleteVMRequest
- type ErrorResponse
- type FloatingIP
- type GetVMNotesOptions
- type IPListOptions
- type IPPricing
- type IPService
- type IPServiceOp
- func (s *IPServiceOp) Change(ctx context.Context, ipID string) (*ChangeIPResponse, *Response, error)
- func (s *IPServiceOp) Get(ctx context.Context, ipID string) (*FloatingIP, *Response, error)
- func (s *IPServiceOp) List(ctx context.Context, opts *IPListOptions) ([]FloatingIP, *Response, error)
- func (s *IPServiceOp) Release(ctx context.Context, ipID string) (*Response, error)
- func (s *IPServiceOp) Reserve(ctx context.Context, req *ReserveIPRequest) (*FloatingIP, *Response, error)
- type Invitation
- type InvitationService
- type InvitationServiceOp
- func (s *InvitationServiceOp) Cancel(ctx context.Context, invitationID string) (*Response, error)
- func (s *InvitationServiceOp) CreateAccount(ctx context.Context, req *CreateInvitationRequest) (*Invitation, *Response, error)
- func (s *InvitationServiceOp) CreateProject(ctx context.Context, projectID string, req *CreateInvitationRequest) (*Invitation, *Response, error)
- type ListVMNetworksOptions
- type Member
- type MemberListOptions
- type MemberService
- type MemberServiceOp
- func (s *MemberServiceOp) Add(ctx context.Context, req *AddMemberRequest) (*Member, *Response, error)
- func (s *MemberServiceOp) Get(ctx context.Context, memberID string) (*Member, *Response, error)
- func (s *MemberServiceOp) List(ctx context.Context, opts *MemberListOptions) ([]Member, *Response, error)
- func (s *MemberServiceOp) Remove(ctx context.Context, memberID string) (*Response, error)
- func (s *MemberServiceOp) Update(ctx context.Context, memberID string, req *UpdateMemberRequest) (*Member, *Response, error)
- type MetadataService
- type MetadataServiceOp
- type Permission
- type PermissionListOptions
- type PermissionService
- type PermissionServiceOp
- type PricingService
- type PricingServiceOp
- func (s *PricingServiceOp) ListBackup(ctx context.Context, opts *BackupPricingListOptions) (*StoragePricing, *Response, error)
- func (s *PricingServiceOp) ListIP(ctx context.Context) (*IPPricing, *Response, error)
- func (s *PricingServiceOp) ListSnapshot(ctx context.Context, opts *SnapshotPricingListOptions) (*StoragePricing, *Response, error)
- func (s *PricingServiceOp) ListVM(ctx context.Context, opts *VMPricingListOptions) ([]VMPricingPlan, *Response, error)
- func (s *PricingServiceOp) ListVolume(ctx context.Context, opts *VolumePricingListOptions) (*StoragePricing, *Response, error)
- type Project
- type ProjectListOptions
- type ProjectMember
- type ProjectMemberListOptions
- type ProjectMemberService
- type ProjectMemberServiceOp
- func (s *ProjectMemberServiceOp) Add(ctx context.Context, projectID string, req *AddProjectMemberRequest) (*ProjectMember, *Response, error)
- func (s *ProjectMemberServiceOp) Get(ctx context.Context, projectID, memberID string) (*ProjectMember, *Response, error)
- func (s *ProjectMemberServiceOp) List(ctx context.Context, projectID string, opts *ProjectMemberListOptions) ([]ProjectMember, *Response, error)
- func (s *ProjectMemberServiceOp) Remove(ctx context.Context, projectID, memberID string) (*Response, error)
- func (s *ProjectMemberServiceOp) Update(ctx context.Context, projectID, memberID string, ...) (*ProjectMember, *Response, error)
- type ProjectService
- type ProjectServiceOp
- func (s *ProjectServiceOp) Create(ctx context.Context, req *CreateProjectRequest) (*Project, *Response, error)
- func (s *ProjectServiceOp) Delete(ctx context.Context, projectID string) (*Response, error)
- func (s *ProjectServiceOp) Get(ctx context.Context, projectID string) (*Project, *Response, error)
- func (s *ProjectServiceOp) List(ctx context.Context, opts *ProjectListOptions) ([]Project, *Response, error)
- func (s *ProjectServiceOp) Update(ctx context.Context, projectID string, req *UpdateProjectRequest) (*Project, *Response, error)
- type Region
- type ReinstallVMRequest
- type RenameSnapshotRequest
- type RenameVMRequest
- type ReserveIPRequest
- type ResizeResponse
- type ResizeVMDiskRequest
- type ResizeVMRequest
- type ResizeVolumeRequest
- type Response
- type Role
- type RoleListOptions
- type RoleService
- type RoleServiceOp
- func (s *RoleServiceOp) Create(ctx context.Context, req *CreateRoleRequest) (*Role, *Response, error)
- func (s *RoleServiceOp) Delete(ctx context.Context, roleID string) (*Response, error)
- func (s *RoleServiceOp) Get(ctx context.Context, roleID string) (*Role, *Response, error)
- func (s *RoleServiceOp) List(ctx context.Context, opts *RoleListOptions) ([]Role, *Response, error)
- func (s *RoleServiceOp) Update(ctx context.Context, roleID string, req *UpdateRoleRequest) (*Role, *Response, error)
- type SSHKey
- type SSHKeyService
- type SSHKeyServiceOp
- func (s *SSHKeyServiceOp) Create(ctx context.Context, req *CreateSSHKeyRequest) (*SSHKey, *Response, error)
- func (s *SSHKeyServiceOp) Delete(ctx context.Context, keyID string) (*Response, error)
- func (s *SSHKeyServiceOp) Get(ctx context.Context, keyID string) (*SSHKey, *Response, error)
- func (s *SSHKeyServiceOp) List(ctx context.Context) ([]SSHKey, *Response, error)
- func (s *SSHKeyServiceOp) Update(ctx context.Context, keyID string, req *UpdateSSHKeyRequest) (*SSHKey, *Response, error)
- type SaveImageRequest
- type SecurityGroup
- type SecurityGroupListOptions
- type SecurityGroupRule
- type SecurityGroupService
- type SecurityGroupServiceOp
- func (s *SecurityGroupServiceOp) Create(ctx context.Context, req *CreateSecurityGroupRequest) (*SecurityGroup, *Response, error)
- func (s *SecurityGroupServiceOp) Delete(ctx context.Context, sgID string) (*Response, error)
- func (s *SecurityGroupServiceOp) Get(ctx context.Context, sgID string) (*SecurityGroup, *Response, error)
- func (s *SecurityGroupServiceOp) List(ctx context.Context, opts *SecurityGroupListOptions) ([]SecurityGroup, *Response, error)
- func (s *SecurityGroupServiceOp) Templates(ctx context.Context) ([]SecurityGroupTemplate, *Response, error)
- func (s *SecurityGroupServiceOp) Update(ctx context.Context, sgID string, req *UpdateSecurityGroupRequest) (*SecurityGroup, *Response, error)
- type SecurityGroupTemplate
- type Snapshot
- type SnapshotListOptions
- type SnapshotPricingListOptions
- type SnapshotService
- type SnapshotServiceOp
- func (s *SnapshotServiceOp) Create(ctx context.Context, req *CreateSnapshotRequest) (*Snapshot, *Response, error)
- func (s *SnapshotServiceOp) Delete(ctx context.Context, snapshotID int) (*Response, error)
- func (s *SnapshotServiceOp) Get(ctx context.Context, snapshotID int) (*Snapshot, *Response, error)
- func (s *SnapshotServiceOp) List(ctx context.Context, opts *SnapshotListOptions) ([]Snapshot, *Response, error)
- func (s *SnapshotServiceOp) Rename(ctx context.Context, snapshotID int, req *RenameSnapshotRequest) (*Snapshot, *Response, error)
- func (s *SnapshotServiceOp) Restore(ctx context.Context, snapshotID int) (*Response, error)
- type StoragePricing
- type Template
- type TemplateListOptions
- type UpdateAPIKeyRequest
- type UpdateBackupScheduleRequest
- type UpdateMemberRequest
- type UpdateProjectMemberRequest
- type UpdateProjectRequest
- type UpdateRoleRequest
- type UpdateSSHKeyRequest
- type UpdateSecurityGroupRequest
- type UpdateVMTagRequest
- type UpdateVPCRequest
- type UpsertVMNoteRequest
- type VM
- type VMImage
- type VMListOptions
- type VMNetwork
- type VMNetworkType
- type VMNote
- type VMNoteType
- type VMNotesFilterType
- type VMNotesResponse
- type VMPricingListOptions
- type VMPricingPlan
- type VMService
- type VMServiceOp
- func (s *VMServiceOp) AddTag(ctx context.Context, vmID string, req *AddVMTagRequest) ([]VMTag, *Response, error)
- func (s *VMServiceOp) AppendNote(ctx context.Context, vmID string, noteType VMNoteType, ...) (*VMNote, *Response, error)
- func (s *VMServiceOp) AttachIP(ctx context.Context, vmID string, req *AttachIPRequest) (*AttachIPResponse, *Response, error)
- func (s *VMServiceOp) AttachSecurityGroup(ctx context.Context, vmID string, req *AttachSecurityGroupRequest) (*Response, error)
- func (s *VMServiceOp) AttachVPC(ctx context.Context, vmID string, req *AttachVPCRequest) (*Response, error)
- func (s *VMServiceOp) BulkDelete(ctx context.Context, req *BulkDeleteVMsRequest) (*BulkDeleteVMsResult, *Response, error)
- func (s *VMServiceOp) Create(ctx context.Context, req *CreateVMRequest) (*VM, *Response, error)
- func (s *VMServiceOp) Delete(ctx context.Context, vmID string, req *DeleteVMRequest) (*Response, error)
- func (s *VMServiceOp) DetachIP(ctx context.Context, vmID string, nicID int) (*Response, error)
- func (s *VMServiceOp) DetachSecurityGroup(ctx context.Context, vmID, securityGroupID string, nicID int) (*Response, error)
- func (s *VMServiceOp) DetachVPC(ctx context.Context, vmID string, nicID int) (*Response, error)
- func (s *VMServiceOp) FactoryReset(ctx context.Context, vmID string) (*Response, error)
- func (s *VMServiceOp) Get(ctx context.Context, vmID string) (*VM, *Response, error)
- func (s *VMServiceOp) GetNotes(ctx context.Context, vmID string, opts *GetVMNotesOptions) (*VMNotesResponse, *Response, error)
- func (s *VMServiceOp) HardReboot(ctx context.Context, vmID string) (*Response, error)
- func (s *VMServiceOp) List(ctx context.Context, opts *VMListOptions) ([]VM, *Response, error)
- func (s *VMServiceOp) ListNetworks(ctx context.Context, vmID string, opts *ListVMNetworksOptions) ([]VMNetwork, *Response, error)
- func (s *VMServiceOp) Reboot(ctx context.Context, vmID string) (*Response, error)
- func (s *VMServiceOp) Reinstall(ctx context.Context, vmID string, req *ReinstallVMRequest) (*Response, error)
- func (s *VMServiceOp) RemoveTag(ctx context.Context, vmID, tagID string) ([]VMTag, *Response, error)
- func (s *VMServiceOp) Rename(ctx context.Context, vmID string, req *RenameVMRequest) (*Response, error)
- func (s *VMServiceOp) ResetPassword(ctx context.Context, vmID string) (*Response, error)
- func (s *VMServiceOp) Resize(ctx context.Context, vmID string, req *ResizeVMRequest) (*ResizeResponse, *Response, error)
- func (s *VMServiceOp) ResizeDisk(ctx context.Context, vmID string, req *ResizeVMDiskRequest) (*ResizeResponse, *Response, error)
- func (s *VMServiceOp) SaveImage(ctx context.Context, vmID string, req *SaveImageRequest) (*VMImage, *Response, error)
- func (s *VMServiceOp) Start(ctx context.Context, vmID string) (*Response, error)
- func (s *VMServiceOp) Stop(ctx context.Context, vmID string) (*Response, error)
- func (s *VMServiceOp) UpdateNote(ctx context.Context, vmID string, noteType VMNoteType, ...) (*VMNote, *Response, error)
- func (s *VMServiceOp) UpdateTag(ctx context.Context, vmID, tagID string, req *UpdateVMTagRequest) ([]VMTag, *Response, error)
- func (s *VMServiceOp) UpsertNote(ctx context.Context, vmID string, noteType VMNoteType, ...) (*VMNote, *Response, error)
- type VMTag
- type VMTagsResponse
- type VPC
- type VPCDetail
- type VPCLease
- type VPCListOptions
- type VPCService
- type VPCServiceOp
- func (s *VPCServiceOp) CIDRSuggestions(ctx context.Context) (*CIDRSuggestionsResponse, *Response, error)
- func (s *VPCServiceOp) Create(ctx context.Context, req *CreateVPCRequest) (*VPC, *Response, error)
- func (s *VPCServiceOp) Delete(ctx context.Context, vpcID string) (*Response, error)
- func (s *VPCServiceOp) Get(ctx context.Context, vpcID string) (*VPC, *Response, error)
- func (s *VPCServiceOp) GetDetail(ctx context.Context, vpcID string) (*VPCDetail, *Response, error)
- func (s *VPCServiceOp) List(ctx context.Context, opts *VPCListOptions) ([]VPC, *Response, error)
- func (s *VPCServiceOp) Update(ctx context.Context, vpcID string, req *UpdateVPCRequest) (*VPC, *Response, error)
- type Volume
- type VolumeListOptions
- type VolumePricingListOptions
- type VolumeService
- type VolumeServiceOp
- func (s *VolumeServiceOp) Attach(ctx context.Context, volumeID int, req *AttachVolumeRequest) (*Volume, *Response, error)
- func (s *VolumeServiceOp) Create(ctx context.Context, req *CreateVolumeRequest) (*Volume, *Response, error)
- func (s *VolumeServiceOp) Delete(ctx context.Context, volumeID int) (*Response, error)
- func (s *VolumeServiceOp) Detach(ctx context.Context, volumeID int) (*Response, error)
- func (s *VolumeServiceOp) Get(ctx context.Context, volumeID int) (*Volume, *Response, error)
- func (s *VolumeServiceOp) List(ctx context.Context, opts *VolumeListOptions) ([]Volume, *Response, error)
- func (s *VolumeServiceOp) Resize(ctx context.Context, volumeID int, req *ResizeVolumeRequest) (*ResizeResponse, *Response, error)
Constants ¶
const (
// Version is the client library version.
Version = "0.3.2"
)
Variables ¶
This section is empty.
Functions ¶
func Bool ¶
Bool returns a pointer to v. Use it when constructing request types that have optional bool fields.
func Int ¶
Int returns a pointer to v. Use it when constructing request types that have optional int fields.
func String ¶
String returns a pointer to v. Use it when constructing request types that have optional string fields.
func StringValue ¶
StringValue dereferences p, returning "" if nil.
Types ¶
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 (s *APIKeyServiceOp) Create(ctx context.Context, req *CreateAPIKeyRequest) (*APIKeyWithSecret, *Response, error)
func (*APIKeyServiceOp) List ¶ added in v0.2.0
func (s *APIKeyServiceOp) List(ctx context.Context, opts *APIKeyListOptions) ([]APIKey, *Response, error)
func (*APIKeyServiceOp) Regenerate ¶ added in v0.2.0
func (s *APIKeyServiceOp) Regenerate(ctx context.Context, keyID string) (*APIKeyWithSecret, *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 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 (s *BackupScheduleServiceOp) Create(ctx context.Context, req *CreateBackupScheduleRequest) (*BackupSchedule, *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 (s *BackupScheduleServiceOp) List(ctx context.Context, opts *BackupScheduleListOptions) ([]BackupSchedule, *Response, error)
func (*BackupScheduleServiceOp) Update ¶ added in v0.3.0
func (s *BackupScheduleServiceOp) Update(ctx context.Context, scheduleID int, req *UpdateBackupScheduleRequest) (*BackupSchedule, *Response, error)
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 (s *BackupServiceOp) Create(ctx context.Context, req *CreateBackupRequest) (*Backup, *Response, error)
func (*BackupServiceOp) DeleteSeries ¶ added in v0.3.4
func (*BackupServiceOp) List ¶ added in v0.3.0
func (s *BackupServiceOp) List(ctx context.Context, opts *BackupListOptions) ([]Backup, *Response, error)
func (*BackupServiceOp) ResetSeries ¶ added in v0.3.4
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 NewFromToken ¶
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 SetProjectID ¶
SetProjectID sets the default project ID sent via X-Project-ID header for mutating operations. Each service method may override it per call.
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 ¶
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 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) 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) CreateAccount ¶ added in v0.2.0
func (s *InvitationServiceOp) CreateAccount(ctx context.Context, req *CreateInvitationRequest) (*Invitation, *Response, error)
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 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 (s *MemberServiceOp) Add(ctx context.Context, req *AddMemberRequest) (*Member, *Response, error)
func (*MemberServiceOp) List ¶ added in v0.2.0
func (s *MemberServiceOp) List(ctx context.Context, opts *MemberListOptions) ([]Member, *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 (*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
func (s *PermissionServiceOp) List(ctx context.Context, opts *PermissionListOptions) ([]Permission, *Response, error)
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 (s *PricingServiceOp) ListBackup(ctx context.Context, opts *BackupPricingListOptions) (*StoragePricing, *Response, error)
func (*PricingServiceOp) ListSnapshot ¶ added in v0.3.0
func (s *PricingServiceOp) ListSnapshot(ctx context.Context, opts *SnapshotPricingListOptions) (*StoragePricing, *Response, error)
func (*PricingServiceOp) ListVM ¶ added in v0.3.0
func (s *PricingServiceOp) ListVM(ctx context.Context, opts *VMPricingListOptions) ([]VMPricingPlan, *Response, error)
func (*PricingServiceOp) ListVolume ¶ added in v0.3.0
func (s *PricingServiceOp) ListVolume(ctx context.Context, opts *VolumePricingListOptions) (*StoragePricing, *Response, error)
type 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 (s *ProjectMemberServiceOp) Add(ctx context.Context, projectID string, req *AddProjectMemberRequest) (*ProjectMember, *Response, error)
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 (s *ProjectMemberServiceOp) List(ctx context.Context, projectID string, opts *ProjectMemberListOptions) ([]ProjectMember, *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 ¶
func (s *ProjectServiceOp) Create(ctx context.Context, req *CreateProjectRequest) (*Project, *Response, error)
Create creates a new project.
func (*ProjectServiceOp) List ¶
func (s *ProjectServiceOp) List(ctx context.Context, opts *ProjectListOptions) ([]Project, *Response, error)
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 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 ¶
Response wraps the underlying http.Response for callers that need access to status codes, headers, or pagination metadata.
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) 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 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 (s *SSHKeyServiceOp) Create(ctx context.Context, req *CreateSSHKeyRequest) (*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 ¶
type SecurityGroupService interface {
List(ctx context.Context, opts *SecurityGroupListOptions) ([]SecurityGroup, *Response, error)
Templates(ctx context.Context) ([]SecurityGroupTemplate, *Response, error)
Get(ctx context.Context, sgID string) (*SecurityGroup, *Response, error)
Create(ctx context.Context, req *CreateSecurityGroupRequest) (*SecurityGroup, *Response, error)
Update(ctx context.Context, sgID string, req *UpdateSecurityGroupRequest) (*SecurityGroup, *Response, error)
Delete(ctx context.Context, sgID string) (*Response, error)
}
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 (s *SecurityGroupServiceOp) Create(ctx context.Context, req *CreateSecurityGroupRequest) (*SecurityGroup, *Response, error)
func (*SecurityGroupServiceOp) Get ¶
func (s *SecurityGroupServiceOp) Get(ctx context.Context, sgID string) (*SecurityGroup, *Response, error)
func (*SecurityGroupServiceOp) List ¶
func (s *SecurityGroupServiceOp) List(ctx context.Context, opts *SecurityGroupListOptions) ([]SecurityGroup, *Response, error)
func (*SecurityGroupServiceOp) Templates ¶
func (s *SecurityGroupServiceOp) Templates(ctx context.Context) ([]SecurityGroupTemplate, *Response, error)
func (*SecurityGroupServiceOp) Update ¶
func (s *SecurityGroupServiceOp) Update(ctx context.Context, sgID string, req *UpdateSecurityGroupRequest) (*SecurityGroup, *Response, error)
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
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 (s *SnapshotServiceOp) Create(ctx context.Context, req *CreateSnapshotRequest) (*Snapshot, *Response, error)
func (*SnapshotServiceOp) List ¶ added in v0.3.0
func (s *SnapshotServiceOp) List(ctx context.Context, opts *SnapshotListOptions) ([]Snapshot, *Response, error)
func (*SnapshotServiceOp) Rename ¶ added in v0.3.0
func (s *SnapshotServiceOp) Rename(ctx context.Context, snapshotID int, req *RenameSnapshotRequest) (*Snapshot, *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 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 ¶
VM represents a virtual machine. Aliased to the generated spec type so new fields propagate automatically when the OpenAPI spec changes.
type VMListOptions ¶
type VMListOptions = spec.ListVMsParams
VMListOptions are the query parameters for listing VMs.
type VMNetworkType ¶
type VMNetworkType = spec.ListVMNetworksParamsType
VMNetworkType is "public", "vpc", or "ipv6", used by ListVMNetworksOptions.Type.
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 (s *VMServiceOp) BulkDelete(ctx context.Context, req *BulkDeleteVMsRequest) (*BulkDeleteVMsResult, *Response, error)
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) DetachSecurityGroup ¶
func (*VMServiceOp) FactoryReset ¶
func (*VMServiceOp) GetNotes ¶
func (s *VMServiceOp) GetNotes(ctx context.Context, vmID string, opts *GetVMNotesOptions) (*VMNotesResponse, *Response, error)
func (*VMServiceOp) HardReboot ¶
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) Reinstall ¶
func (s *VMServiceOp) Reinstall(ctx context.Context, vmID string, req *ReinstallVMRequest) (*Response, error)
func (*VMServiceOp) Rename ¶
func (s *VMServiceOp) Rename(ctx context.Context, vmID string, req *RenameVMRequest) (*Response, error)
func (*VMServiceOp) ResetPassword ¶
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) 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 VMTagsResponse ¶
type VMTagsResponse = spec.VMTagsResponse
VMTagsResponse is the response shape for tag mutations — returns the full updated tag list for the VM.
type 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 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) 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 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 (s *VolumeServiceOp) Create(ctx context.Context, req *CreateVolumeRequest) (*Volume, *Response, error)
func (*VolumeServiceOp) List ¶ added in v0.3.0
func (s *VolumeServiceOp) List(ctx context.Context, opts *VolumeListOptions) ([]Volume, *Response, error)
func (*VolumeServiceOp) Resize ¶ added in v0.3.0
func (s *VolumeServiceOp) Resize(ctx context.Context, volumeID int, req *ResizeVolumeRequest) (*ResizeResponse, *Response, error)