api

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultBaseURL is the default Control Plane API base URL.
	DefaultBaseURL = "https://api.cpln.io"

	// DefaultBillingURL is the default billing service URL.
	DefaultBillingURL = "https://billing-ng.cpln.io"

	// DefaultTimeout is the default HTTP client timeout.
	DefaultTimeout = 30 * time.Second
)

Variables

View Source
var (
	ErrNotFound      = errors.New("resource not found")
	ErrUnauthorized  = errors.New("unauthorized")
	ErrForbidden     = errors.New("forbidden")
	ErrConflict      = errors.New("resource conflict")
	ErrBadRequest    = errors.New("bad request")
	ErrInternalError = errors.New("internal server error")
)

Common errors returned by the API client.

Functions

func IsBadRequest

func IsBadRequest(err error) bool

IsBadRequest returns true if the error is a 400 Bad Request error.

func IsConflict

func IsConflict(err error) bool

IsConflict returns true if the error is a 409 Conflict error.

func IsForbidden

func IsForbidden(err error) bool

IsForbidden returns true if the error is a 403 Forbidden error.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns true if the error is a 404 Not Found error.

func IsUnauthorized

func IsUnauthorized(err error) bool

IsUnauthorized returns true if the error is a 401 Unauthorized error.

Types

type APIError

type APIError struct {
	Status  int    `json:"status"`
	Message string `json:"message,omitempty"`
	Code    string `json:"code,omitempty"`
	Details any    `json:"details,omitempty"`
	ID      string `json:"id,omitempty"`
}

APIError represents an error response from the Control Plane API.

func (*APIError) Error

func (e *APIError) Error() string

Error implements the error interface.

func (*APIError) Unwrap

func (e *APIError) Unwrap() error

Unwrap returns the underlying sentinel error based on status code.

type AcceptTOURequest

type AcceptTOURequest struct {
	TOU *TOUInput `json:"tou"`
}

AcceptTOURequest is the request body for accepting Terms of Use.

type AddKeyRequest

type AddKeyRequest struct {
	Description string `json:"description,omitempty"`
}

AddKeyRequest is the request body for adding a key to a service account.

type AddKeyResponse

type AddKeyResponse struct {
	Key string `json:"key"`
}

AddKeyResponse is the response from adding a key to a service account.

type AgentService

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

AgentService handles operations on agents.

func (*AgentService) Create

func (s *AgentService) Create(ctx context.Context, org string, a *agent.Agent) (*agent.Agent, error)

Create creates a new agent.

func (*AgentService) Delete

func (s *AgentService) Delete(ctx context.Context, org, name string) error

Delete deletes an agent by name.

func (*AgentService) Get

func (s *AgentService) Get(ctx context.Context, org, name string) (*agent.Agent, error)

Get returns an agent by name.

func (*AgentService) List

func (s *AgentService) List(ctx context.Context, org string) iter.Seq2[agent.Agent, error]

List returns an iterator over all agents in the organization.

func (*AgentService) ListAll

func (s *AgentService) ListAll(ctx context.Context, org string) ([]agent.Agent, error)

ListAll returns all agents in the organization.

func (*AgentService) ListPage

func (s *AgentService) ListPage(ctx context.Context, org, cursor string) (*ListResponse[agent.Agent], error)

ListPage returns a single page of agents.

func (*AgentService) Query

func (s *AgentService) Query(ctx context.Context, org string, q *query.Query) iter.Seq2[agent.Agent, error]

Query returns an iterator over agents matching the query.

func (*AgentService) QueryAll

func (s *AgentService) QueryAll(ctx context.Context, org string, q *query.Query) ([]agent.Agent, error)

QueryAll returns all agents matching the query.

func (*AgentService) QueryPage

func (s *AgentService) QueryPage(ctx context.Context, org string, q *query.Query) (*QueryResponse[agent.Agent], error)

QueryPage returns a single page of agents matching the query.

func (*AgentService) Update

func (s *AgentService) Update(ctx context.Context, org, name string, a *agent.Agent) (*agent.Agent, error)

Update updates an existing agent.

type AuditContextService

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

AuditContextService handles operations on audit contexts.

func (*AuditContextService) Create

Create creates a new audit context.

func (*AuditContextService) Delete

func (s *AuditContextService) Delete(ctx context.Context, org, name string) error

Delete deletes an audit context by name.

func (*AuditContextService) Get

Get returns an audit context by name.

func (*AuditContextService) List

List returns an iterator over all audit contexts in the organization.

func (*AuditContextService) ListAll

ListAll returns all audit contexts in the organization.

func (*AuditContextService) ListPage

func (s *AuditContextService) ListPage(ctx context.Context, org, cursor string) (*ListResponse[auditctx.AuditContext], error)

ListPage returns a single page of audit contexts.

func (*AuditContextService) Query

Query returns an iterator over audit contexts matching the query.

func (*AuditContextService) QueryAll

QueryAll returns all audit contexts matching the query.

func (*AuditContextService) QueryPage

QueryPage returns a single page of audit contexts matching the query.

func (*AuditContextService) Update

Update updates an existing audit context.

type BillingAccount

type BillingAccount struct {
	ID          string            `json:"id,omitempty"`
	AccountName string            `json:"fullName,omitempty"`
	Description string            `json:"accountName,omitempty"`
	Email       string            `json:"email,omitempty"`
	Enabled     bool              `json:"enabled"`
	MainOrg     string            `json:"mainOrg,omitempty"`
	OrgQuota    int               `json:"orgQuota,omitempty"`
	Created     *time.Time        `json:"created,omitempty"`
	ExtraInfo   map[string]string `json:"extraInfo,omitempty"`
}

BillingAccount represents a billing account.

type BillingAccountInput

type BillingAccountInput struct {
	AccountName string            `json:"fullName,omitempty"`
	Description string            `json:"accountName,omitempty"`
	Email       string            `json:"email,omitempty"`
	Phone       string            `json:"phone,omitempty"`
	Address     *BillingAddress   `json:"address,omitempty"`
	ExtraInfo   map[string]string `json:"extraInfo,omitempty"`
}

BillingAccountInput is the input for creating/updating a billing account.

type BillingAddress

type BillingAddress struct {
	Name       string `json:"name,omitempty"`
	Address1   string `json:"address1,omitempty"`
	Address2   string `json:"address2,omitempty"`
	City       string `json:"city,omitempty"`
	Country    string `json:"country,omitempty"`
	PostalCode string `json:"postalCode,omitempty"`
	State      string `json:"state,omitempty"`
}

BillingAddress represents a billing address.

type BillingOrg

type BillingOrg struct {
	Name        string            `json:"name,omitempty"`
	Description string            `json:"description,omitempty"`
	Tags        map[string]string `json:"tags,omitempty"`
	AccountID   string            `json:"accountId,omitempty"`
	Created     time.Time         `json:"created,omitempty"`
}

BillingOrg represents an organization in the billing system.

type BillingService

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

BillingService handles billing operations via billing-ng.

func (*BillingService) AcceptTOU

func (s *BillingService) AcceptTOU(ctx context.Context, accountID string, req *AcceptTOURequest) error

AcceptTOU accepts the Terms of Use for an account.

func (*BillingService) CreateAccount

CreateAccount creates a new billing account.

func (*BillingService) CreateOrg

func (s *BillingService) CreateOrg(ctx context.Context, accountID string, req *CreateOrgRequest) (*CreateOrgResponse, error)

CreateOrg creates a new organization in the specified account.

func (*BillingService) GetAccount

func (s *BillingService) GetAccount(ctx context.Context, accountID string) (*BillingAccount, error)

GetAccount returns account details by ID.

func (*BillingService) GetInvoiceJSON

func (s *BillingService) GetInvoiceJSON(ctx context.Context, accountID, invoiceID string) (*Invoice, error)

GetInvoiceJSON returns a specific invoice as JSON.

func (*BillingService) GetInvoicePDF

func (s *BillingService) GetInvoicePDF(ctx context.Context, accountID, invoiceID string) ([]byte, error)

GetInvoicePDF returns a specific invoice as PDF bytes.

func (*BillingService) GetOrg

func (s *BillingService) GetOrg(ctx context.Context, orgName string) (*BillingOrg, error)

GetOrg returns organization details by name.

func (*BillingService) GetOrgAccount

func (s *BillingService) GetOrgAccount(ctx context.Context, orgName string) (*BillingAccount, error)

GetOrgAccount returns the billing account for an organization.

func (*BillingService) ListInvoices

func (s *BillingService) ListInvoices(ctx context.Context, accountID string, start, end *time.Time) ([]Invoice, error)

ListInvoices returns invoices for an account.

func (*BillingService) QueryChargesByAccount

func (s *BillingService) QueryChargesByAccount(ctx context.Context, accountID string, req *ChargeQueryRequest) (*ChargeQueryResponse, error)

QueryChargesByAccount queries charges for an account.

func (*BillingService) QueryChargesByOrg

func (s *BillingService) QueryChargesByOrg(ctx context.Context, orgName string, req *ChargeQueryRequest) (*ChargeQueryResponse, error)

QueryChargesByOrg queries charges for an organization.

type ChargePeriod

type ChargePeriod struct {
	StartTime time.Time `json:"startTime"`
	EndTime   time.Time `json:"endTime"`
	Groups    []any     `json:"groups,omitempty"`
}

ChargePeriod represents charges for a time period.

type ChargeQueryRequest

type ChargeQueryRequest struct {
	StartTime time.Time `json:"startTime"`
	EndTime   time.Time `json:"endTime"`
	TimeStep  string    `json:"timeStep,omitempty"` // hour, day, week, month
	Orgs      []string  `json:"orgs,omitempty"`
	Detailed  bool      `json:"detailed,omitempty"`
}

ChargeQueryRequest is the request for querying charges.

type ChargeQueryResponse

type ChargeQueryResponse struct {
	Periods         []ChargePeriod `json:"periods,omitempty"`
	DetailedResults []any          `json:"detailedResults,omitempty"`
}

ChargeQueryResponse is the response from a charge query.

type Client

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

Client is the Control Plane API client.

func New

func New(token string, opts ...Option) *Client

New creates a new Control Plane API client.

func NewWithBaseURL

func NewWithBaseURL(baseURL, token string, opts ...Option) *Client

NewWithBaseURL creates a new Control Plane API client with a custom base URL.

func (*Client) Agents

func (c *Client) Agents() *AgentService

Agents returns the AgentService for managing agents.

func (*Client) AuditContexts

func (c *Client) AuditContexts() *AuditContextService

AuditContexts returns the AuditContextService for managing audit contexts.

func (*Client) Billing

func (c *Client) Billing() *BillingService

Billing returns the BillingService for billing operations via billing-ng.

func (*Client) CloudAccounts

func (c *Client) CloudAccounts() *CloudAccountService

CloudAccounts returns the CloudAccountService for managing cloud accounts.

func (*Client) Deployments

func (c *Client) Deployments() *DeploymentService

Deployments returns the DeploymentService for managing deployments.

func (*Client) Domains

func (c *Client) Domains() *DomainService

Domains returns the DomainService for managing domains.

func (*Client) GVCs

func (c *Client) GVCs() *GVCService

GVCs returns the GVCService for managing GVCs.

func (*Client) GetRaw

func (c *Client) GetRaw(ctx context.Context, path string, result any) error

GetRaw allows you to filter an API response to only the fields you care about

func (*Client) Groups

func (c *Client) Groups() *GroupService

Groups returns the GroupService for managing groups.

func (*Client) IPSets

func (c *Client) IPSets() *IPSetService

IPSets returns the IPSetService for managing IP sets.

func (*Client) Identities

func (c *Client) Identities() *IdentityService

Identities returns the IdentityService for managing identities.

func (*Client) Images

func (c *Client) Images() *ImageService

Images returns the ImageService for managing images.

func (*Client) Locations

func (c *Client) Locations() *LocationService

Locations returns the LocationService for managing locations.

func (*Client) Mk8s

func (c *Client) Mk8s() *Mk8sService

Mk8s returns the Mk8sService for managing managed Kubernetes clusters.

func (*Client) Org

func (c *Client) Org() string

Org returns the default organization.

func (*Client) Orgs

func (c *Client) Orgs() *OrgService

Orgs returns the OrgService for managing organizations.

func (*Client) PatchRaw

func (c *Client) PatchRaw(ctx context.Context, path string, body any) error

PatchRaw sends a raw PATCH request with arbitrary JSON body (for $drop, $append operators). This is useful when you need to send special operators that aren't part of typed structs.

func (*Client) PatchRawWithResult

func (c *Client) PatchRawWithResult(ctx context.Context, path string, body, result any) error

PatchRawWithResult sends a raw PATCH request with arbitrary JSON body and unmarshals the result.

func (*Client) Policies

func (c *Client) Policies() *PolicyService

Policies returns the PolicyService for managing policies.

func (*Client) Quotas

func (c *Client) Quotas() *QuotaService

Quotas returns the QuotaService for managing quotas.

func (*Client) Secrets

func (c *Client) Secrets() *SecretService

Secrets returns the SecretService for managing secrets.

func (*Client) ServiceAccounts

func (c *Client) ServiceAccounts() *ServiceAccountService

ServiceAccounts returns the ServiceAccountService for managing service accounts.

func (*Client) SetOrg

func (c *Client) SetOrg(org string)

SetOrg updates the default organization.

func (*Client) SetToken

func (c *Client) SetToken(token string)

SetToken updates the authentication token.

func (*Client) Tasks

func (c *Client) Tasks() *TaskService

Tasks returns the TaskService for managing tasks.

func (*Client) Users

func (c *Client) Users() *UserService

Users returns the UserService for managing users.

func (*Client) VolumeSets

func (c *Client) VolumeSets() *VolumeSetService

VolumeSets returns the VolumeSetService for managing volume sets.

func (*Client) Workloads

func (c *Client) Workloads() *WorkloadService

Workloads returns the WorkloadService for managing workloads.

type CloudAccountService

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

CloudAccountService handles operations on cloud accounts.

func (*CloudAccountService) Create

Create creates a new cloud account.

func (*CloudAccountService) Delete

func (s *CloudAccountService) Delete(ctx context.Context, org, name string) error

Delete deletes a cloud account by name.

func (*CloudAccountService) Get

Get returns a cloud account by name.

func (*CloudAccountService) List

List returns an iterator over all cloud accounts in the organization.

func (*CloudAccountService) ListAll

ListAll returns all cloud accounts in the organization.

func (*CloudAccountService) ListPage

ListPage returns a single page of cloud accounts.

func (*CloudAccountService) Query

Query returns an iterator over cloud accounts matching the query.

func (*CloudAccountService) QueryAll

QueryAll returns all cloud accounts matching the query.

func (*CloudAccountService) QueryPage

QueryPage returns a single page of cloud accounts matching the query.

func (*CloudAccountService) Update

Update updates an existing cloud account.

type CreateAccountRequest

type CreateAccountRequest struct {
	Account *BillingAccountInput `json:"account"`
	Type    string               `json:"type"`
}

CreateAccountRequest is the request body for creating a billing account.

type CreateAccountResponse

type CreateAccountResponse struct {
	BillingAccount
}

CreateAccountResponse is the response from creating an account.

type CreateOrgRequest

type CreateOrgRequest struct {
	Org      *BillingOrg `json:"org"`
	Invitees []string    `json:"invitees,omitempty"`
}

CreateOrgRequest is the request body for creating an org via billing-ng.

type CreateOrgResponse

type CreateOrgResponse struct {
	BillingOrg
	WasCreated bool `json:"Created,omitempty"` // Whether the org was newly created (vs already existed)
}

CreateOrgResponse is the response from creating an org. Note: The API embeds the Org type, so "created" is actually a timestamp, not a boolean. The boolean "Created" field from billing-ng is serialized with capital C.

type CreateVolumeSnapshotRequest

type CreateVolumeSnapshotRequest struct {
	Location               string              `json:"location"`
	VolumeIndex            float32             `json:"volumeIndex"`
	SnapshotName           string              `json:"snapshotName"`
	SnapshotExpirationDate string              `json:"snapshotExpirationDate,omitempty"`
	SnapshotTags           []map[string]string `json:"snapshotTags,omitempty"`
}

CreateVolumeSnapshotRequest is the request for creating a volume snapshot.

type CronStartRequest

type CronStartRequest struct {
	Location           string                       `json:"location"`
	ContainerOverrides []workload.ContainerOverride `json:"containerOverrides,omitempty"`
}

CronStartRequest is the request body for starting a cron workload job.

type DeleteVolumeRequest

type DeleteVolumeRequest struct {
	Location    string  `json:"location"`
	VolumeIndex float32 `json:"volumeIndex"`
}

DeleteVolumeRequest is the request for deleting a volume.

type DeleteVolumeSnapshotRequest

type DeleteVolumeSnapshotRequest struct {
	Location     string  `json:"location"`
	VolumeIndex  float32 `json:"volumeIndex"`
	SnapshotName string  `json:"snapshotName"`
}

DeleteVolumeSnapshotRequest is the request for deleting a volume snapshot.

type DeploymentService

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

DeploymentService handles operations on deployments. Deployments are read-only resources that represent the deployment state of workloads.

func (*DeploymentService) Get

func (s *DeploymentService) Get(ctx context.Context, org, gvc, workloadName, name string) (*deployment.Deployment, error)

Get returns a deployment by name.

func (*DeploymentService) List

func (s *DeploymentService) List(ctx context.Context, org, gvc, workloadName string) iter.Seq2[deployment.Deployment, error]

List returns an iterator over all deployments for a workload.

func (*DeploymentService) ListAll

func (s *DeploymentService) ListAll(ctx context.Context, org, gvc, workloadName string) ([]deployment.Deployment, error)

ListAll returns all deployments for a workload.

func (*DeploymentService) ListPage

func (s *DeploymentService) ListPage(ctx context.Context, org, gvc, workloadName, cursor string) (*ListResponse[deployment.Deployment], error)

ListPage returns a single page of deployments.

type DomainService

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

DomainService handles operations on domains.

func (*DomainService) Create

func (s *DomainService) Create(ctx context.Context, org string, d *domain.Domain) (*domain.Domain, error)

Create creates a new domain.

func (*DomainService) Delete

func (s *DomainService) Delete(ctx context.Context, org, name string) error

Delete deletes a domain by name.

func (*DomainService) Get

func (s *DomainService) Get(ctx context.Context, org, name string) (*domain.Domain, error)

Get returns a domain by name.

func (*DomainService) List

List returns an iterator over all domains in the organization.

func (*DomainService) ListAll

func (s *DomainService) ListAll(ctx context.Context, org string) ([]domain.Domain, error)

ListAll returns all domains in the organization.

func (*DomainService) ListPage

func (s *DomainService) ListPage(ctx context.Context, org, cursor string) (*ListResponse[domain.Domain], error)

ListPage returns a single page of domains.

func (*DomainService) Query

Query returns an iterator over domains matching the query.

func (*DomainService) QueryAll

func (s *DomainService) QueryAll(ctx context.Context, org string, q *query.Query) ([]domain.Domain, error)

QueryAll returns all domains matching the query.

func (*DomainService) QueryPage

func (s *DomainService) QueryPage(ctx context.Context, org string, q *query.Query) (*QueryResponse[domain.Domain], error)

QueryPage returns a single page of domains matching the query.

func (*DomainService) Update

func (s *DomainService) Update(ctx context.Context, org, name string, d *domain.Domain) (*domain.Domain, error)

Update updates an existing domain.

type ExpandVolumeRequest

type ExpandVolumeRequest struct {
	Location           string  `json:"location"`
	VolumeIndex        float32 `json:"volumeIndex"`
	NewStorageCapacity float32 `json:"newStorageCapacity"`
	TimeoutSeconds     float32 `json:"timeoutSeconds,omitempty"`
}

ExpandVolumeRequest is the request for expanding a volume.

type GVCService

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

GVCService handles operations on GVCs.

func (*GVCService) Create

func (s *GVCService) Create(ctx context.Context, org string, g *gvc.Gvc) (*gvc.Gvc, error)

Create creates a new GVC.

func (*GVCService) Delete

func (s *GVCService) Delete(ctx context.Context, org, name string) error

Delete deletes a GVC by name.

func (*GVCService) Get

func (s *GVCService) Get(ctx context.Context, org, name string) (*gvc.Gvc, error)

Get returns a GVC by name.

func (*GVCService) List

func (s *GVCService) List(ctx context.Context, org string) iter.Seq2[gvc.Gvc, error]

List returns an iterator over all GVCs in the organization.

func (*GVCService) ListAll

func (s *GVCService) ListAll(ctx context.Context, org string) ([]gvc.Gvc, error)

ListAll returns all GVCs in the organization.

func (*GVCService) ListPage

func (s *GVCService) ListPage(ctx context.Context, org, cursor string) (*ListResponse[gvc.Gvc], error)

ListPage returns a single page of GVCs.

func (*GVCService) Query

func (s *GVCService) Query(ctx context.Context, org string, q *query.Query) iter.Seq2[gvc.Gvc, error]

Query returns an iterator over GVCs matching the query.

func (*GVCService) QueryAll

func (s *GVCService) QueryAll(ctx context.Context, org string, q *query.Query) ([]gvc.Gvc, error)

QueryAll returns all GVCs matching the query.

func (*GVCService) QueryPage

func (s *GVCService) QueryPage(ctx context.Context, org string, q *query.Query) (*QueryResponse[gvc.Gvc], error)

QueryPage returns a single page of GVCs matching the query.

func (*GVCService) Update

func (s *GVCService) Update(ctx context.Context, org, name string, g *gvc.Gvc) (*gvc.Gvc, error)

Update updates an existing GVC.

type GroupService

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

GroupService handles operations on groups.

func (*GroupService) Create

func (s *GroupService) Create(ctx context.Context, org string, g *group.Group) (*group.Group, error)

Create creates a new group.

func (*GroupService) Delete

func (s *GroupService) Delete(ctx context.Context, org, name string) error

Delete deletes a group by name.

func (*GroupService) Get

func (s *GroupService) Get(ctx context.Context, org, name string) (*group.Group, error)

Get returns a group by name.

func (*GroupService) List

func (s *GroupService) List(ctx context.Context, org string) iter.Seq2[group.Group, error]

List returns an iterator over all groups in the organization.

func (*GroupService) ListAll

func (s *GroupService) ListAll(ctx context.Context, org string) ([]group.Group, error)

ListAll returns all groups in the organization.

func (*GroupService) ListPage

func (s *GroupService) ListPage(ctx context.Context, org, cursor string) (*ListResponse[group.Group], error)

ListPage returns a single page of groups.

func (*GroupService) Query

func (s *GroupService) Query(ctx context.Context, org string, q *query.Query) iter.Seq2[group.Group, error]

Query returns an iterator over groups matching the query.

func (*GroupService) QueryAll

func (s *GroupService) QueryAll(ctx context.Context, org string, q *query.Query) ([]group.Group, error)

QueryAll returns all groups matching the query.

func (*GroupService) QueryPage

func (s *GroupService) QueryPage(ctx context.Context, org string, q *query.Query) (*QueryResponse[group.Group], error)

QueryPage returns a single page of groups matching the query.

func (*GroupService) Update

func (s *GroupService) Update(ctx context.Context, org, name string, g *group.Group) (*group.Group, error)

Update updates an existing group.

type IPSetService

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

IPSetService handles operations on IP sets.

func (*IPSetService) Create

func (s *IPSetService) Create(ctx context.Context, org string, i *ipSet.IpSet) (*ipSet.IpSet, error)

Create creates a new IP set.

func (*IPSetService) Delete

func (s *IPSetService) Delete(ctx context.Context, org, name string) error

Delete deletes an IP set by name.

func (*IPSetService) Get

func (s *IPSetService) Get(ctx context.Context, org, name string) (*ipSet.IpSet, error)

Get returns an IP set by name.

func (*IPSetService) List

func (s *IPSetService) List(ctx context.Context, org string) iter.Seq2[ipSet.IpSet, error]

List returns an iterator over all IP sets in the organization.

func (*IPSetService) ListAll

func (s *IPSetService) ListAll(ctx context.Context, org string) ([]ipSet.IpSet, error)

ListAll returns all IP sets in the organization.

func (*IPSetService) ListPage

func (s *IPSetService) ListPage(ctx context.Context, org, cursor string) (*ListResponse[ipSet.IpSet], error)

ListPage returns a single page of IP sets.

func (*IPSetService) Query

func (s *IPSetService) Query(ctx context.Context, org string, q *query.Query) iter.Seq2[ipSet.IpSet, error]

Query returns an iterator over IP sets matching the query.

func (*IPSetService) QueryAll

func (s *IPSetService) QueryAll(ctx context.Context, org string, q *query.Query) ([]ipSet.IpSet, error)

QueryAll returns all IP sets matching the query.

func (*IPSetService) QueryPage

func (s *IPSetService) QueryPage(ctx context.Context, org string, q *query.Query) (*QueryResponse[ipSet.IpSet], error)

QueryPage returns a single page of IP sets matching the query.

func (*IPSetService) Update

func (s *IPSetService) Update(ctx context.Context, org, name string, i *ipSet.IpSet) (*ipSet.IpSet, error)

Update updates an existing IP set.

type IdentityService

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

IdentityService handles operations on identities.

func (*IdentityService) Create

func (s *IdentityService) Create(ctx context.Context, org, gvc string, i *identity.Identity) (*identity.Identity, error)

Create creates a new identity.

func (*IdentityService) Delete

func (s *IdentityService) Delete(ctx context.Context, org, gvc, name string) error

Delete deletes an identity by name.

func (*IdentityService) Get

func (s *IdentityService) Get(ctx context.Context, org, gvc, name string) (*identity.Identity, error)

Get returns an identity by name.

func (*IdentityService) List

List returns an iterator over all identities in the GVC.

func (*IdentityService) ListAll

func (s *IdentityService) ListAll(ctx context.Context, org, gvc string) ([]identity.Identity, error)

ListAll returns all identities in the GVC.

func (*IdentityService) ListPage

func (s *IdentityService) ListPage(ctx context.Context, org, gvc, cursor string) (*ListResponse[identity.Identity], error)

ListPage returns a single page of identities.

func (*IdentityService) Query

Query returns an iterator over identities matching the query. Note: Identity queries are org-level, not GVC-scoped.

func (*IdentityService) QueryAll

func (s *IdentityService) QueryAll(ctx context.Context, org string, q *query.Query) ([]identity.Identity, error)

QueryAll returns all identities matching the query. Note: Identity queries are org-level, not GVC-scoped.

func (*IdentityService) QueryPage

QueryPage returns a single page of identities matching the query. Note: Identity queries are org-level, not GVC-scoped.

func (*IdentityService) Update

func (s *IdentityService) Update(ctx context.Context, org, gvc, name string, i *identity.Identity) (*identity.Identity, error)

Update updates an existing identity.

type ImageService

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

ImageService handles operations on images.

func (*ImageService) Delete

func (s *ImageService) Delete(ctx context.Context, org, name string) error

Delete deletes an image by name.

func (*ImageService) Get

func (s *ImageService) Get(ctx context.Context, org, name string) (*image.Image, error)

Get returns an image by name.

func (*ImageService) List

func (s *ImageService) List(ctx context.Context, org string) iter.Seq2[image.Image, error]

List returns an iterator over all images in the organization.

func (*ImageService) ListAll

func (s *ImageService) ListAll(ctx context.Context, org string) ([]image.Image, error)

ListAll returns all images in the organization.

func (*ImageService) ListPage

func (s *ImageService) ListPage(ctx context.Context, org, cursor string) (*ListResponse[image.Image], error)

ListPage returns a single page of images.

func (*ImageService) Query

func (s *ImageService) Query(ctx context.Context, org string, q *query.Query) iter.Seq2[image.Image, error]

Query returns an iterator over images matching the query.

func (*ImageService) QueryAll

func (s *ImageService) QueryAll(ctx context.Context, org string, q *query.Query) ([]image.Image, error)

QueryAll returns all images matching the query.

func (*ImageService) QueryPage

func (s *ImageService) QueryPage(ctx context.Context, org string, q *query.Query) (*QueryResponse[image.Image], error)

QueryPage returns a single page of images matching the query.

type InviteRequest

type InviteRequest struct {
	Email string `json:"email"`
}

InviteRequest is the request body for inviting a user.

type Invoice

type Invoice struct {
	ID        string     `json:"id,omitempty"`
	AccountID string     `json:"accountId,omitempty"`
	Status    string     `json:"status,omitempty"`
	Total     float64    `json:"total,omitempty"`
	StartTime *time.Time `json:"startTime,omitempty"`
	EndTime   *time.Time `json:"endTime,omitempty"`
	Created   *time.Time `json:"created,omitempty"`
}

Invoice represents a billing invoice.

type ListOption

type ListOption func(*listOptions)

ListOption is a functional option for list operations.

func WithLimit

func WithLimit(limit int) ListOption

WithLimit sets the maximum number of items to return per page.

type ListResponse

type ListResponse[T any] struct {
	Kind     string      `json:"kind"`
	ItemKind string      `json:"itemKind"`
	Items    []T         `json:"items"`
	Links    []base.Link `json:"links"`
	// contains filtered or unexported fields
}

ListResponse represents a paginated list response from the API.

func (*ListResponse[T]) HasNext

func (r *ListResponse[T]) HasNext() bool

HasNext returns true if there are more pages available.

func (r *ListResponse[T]) NextLink() string

NextLink returns the URL for the next page, or empty string if no more pages.

func (*ListResponse[T]) NextPage

func (r *ListResponse[T]) NextPage(ctx context.Context) (*ListResponse[T], error)

NextPage fetches the next page of results. Returns nil, nil if there are no more pages.

type LocationService

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

LocationService handles operations on locations.

func (*LocationService) Get

func (s *LocationService) Get(ctx context.Context, org, name string) (*location.Location, error)

Get returns a location by name.

func (*LocationService) List

List returns an iterator over all locations in the organization.

func (*LocationService) ListAll

func (s *LocationService) ListAll(ctx context.Context, org string) ([]location.Location, error)

ListAll returns all locations in the organization.

func (*LocationService) ListPage

func (s *LocationService) ListPage(ctx context.Context, org, cursor string) (*ListResponse[location.Location], error)

ListPage returns a single page of locations.

func (*LocationService) Query

Query returns an iterator over locations matching the query.

func (*LocationService) QueryAll

func (s *LocationService) QueryAll(ctx context.Context, org string, q *query.Query) ([]location.Location, error)

QueryAll returns all locations matching the query.

func (*LocationService) QueryPage

QueryPage returns a single page of locations matching the query.

type Mk8sService

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

Mk8sService handles operations on managed Kubernetes clusters.

func (*Mk8sService) Create

func (s *Mk8sService) Create(ctx context.Context, org string, m *mk8s.Mk8sCluster) (*mk8s.Mk8sCluster, error)

Create creates a new managed Kubernetes cluster.

func (*Mk8sService) Delete

func (s *Mk8sService) Delete(ctx context.Context, org, name string) error

Delete deletes a managed Kubernetes cluster by name.

func (*Mk8sService) Get

func (s *Mk8sService) Get(ctx context.Context, org, name string) (*mk8s.Mk8sCluster, error)

Get returns a managed Kubernetes cluster by name.

func (*Mk8sService) List

List returns an iterator over all managed Kubernetes clusters in the organization.

func (*Mk8sService) ListAll

func (s *Mk8sService) ListAll(ctx context.Context, org string) ([]mk8s.Mk8sCluster, error)

ListAll returns all managed Kubernetes clusters in the organization.

func (*Mk8sService) ListPage

func (s *Mk8sService) ListPage(ctx context.Context, org, cursor string) (*ListResponse[mk8s.Mk8sCluster], error)

ListPage returns a single page of managed Kubernetes clusters.

func (*Mk8sService) Query

Query returns an iterator over managed Kubernetes clusters matching the query.

func (*Mk8sService) QueryAll

func (s *Mk8sService) QueryAll(ctx context.Context, org string, q *query.Query) ([]mk8s.Mk8sCluster, error)

QueryAll returns all managed Kubernetes clusters matching the query.

func (*Mk8sService) QueryPage

func (s *Mk8sService) QueryPage(ctx context.Context, org string, q *query.Query) (*QueryResponse[mk8s.Mk8sCluster], error)

QueryPage returns a single page of managed Kubernetes clusters matching the query.

func (*Mk8sService) Update

func (s *Mk8sService) Update(ctx context.Context, org, name string, m *mk8s.Mk8sCluster) (*mk8s.Mk8sCluster, error)

Update updates an existing managed Kubernetes cluster.

type Option

type Option func(*Client)

Option is a functional option for configuring the Client.

func WithBillingURL

func WithBillingURL(url string) Option

WithBillingURL overrides the default billing service URL (billing-ng). This is typically only needed for local development or testing.

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) Option

WithHTTPClient sets a custom HTTP client.

func WithHeader

func WithHeader(key, value string) Option

WithHeader adds a custom header to all requests.

func WithHeaders

func WithHeaders(headers http.Header) Option

WithHeaders sets multiple custom headers for all requests.

func WithOrg

func WithOrg(org string) Option

WithOrg sets the default organization for all API calls.

func WithTimeout

func WithTimeout(d time.Duration) Option

WithTimeout sets the HTTP client timeout.

func WithUserAgent

func WithUserAgent(userAgent string) Option

WithUserAgent sets a custom User-Agent header.

type OrgService

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

OrgService handles operations on organizations.

func (*OrgService) Get

func (s *OrgService) Get(ctx context.Context, name string) (*org.Org, error)

Get returns an organization by name.

func (*OrgService) List

func (s *OrgService) List(ctx context.Context) iter.Seq2[org.Org, error]

List returns an iterator over all organizations the user has access to.

func (*OrgService) ListAll

func (s *OrgService) ListAll(ctx context.Context) ([]org.Org, error)

ListAll returns all organizations the user has access to.

func (*OrgService) ListPage

func (s *OrgService) ListPage(ctx context.Context, cursor string) (*ListResponse[org.Org], error)

ListPage returns a single page of organizations.

func (*OrgService) Query

func (s *OrgService) Query(ctx context.Context, q *query.Query) iter.Seq2[org.Org, error]

Query returns an iterator over organizations matching the query.

func (*OrgService) QueryAll

func (s *OrgService) QueryAll(ctx context.Context, q *query.Query) ([]org.Org, error)

QueryAll returns all organizations matching the query.

func (*OrgService) QueryPage

func (s *OrgService) QueryPage(ctx context.Context, q *query.Query) (*QueryResponse[org.Org], error)

QueryPage returns a single page of organizations matching the query.

func (*OrgService) Update

func (s *OrgService) Update(ctx context.Context, name string, o *org.Org) (*org.Org, error)

Update updates an existing organization.

type PolicyService

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

PolicyService handles operations on policies.

func (*PolicyService) Create

func (s *PolicyService) Create(ctx context.Context, org string, p *policy.Policy) (*policy.Policy, error)

Create creates a new policy.

func (*PolicyService) Delete

func (s *PolicyService) Delete(ctx context.Context, org, name string) error

Delete deletes a policy by name.

func (*PolicyService) Get

func (s *PolicyService) Get(ctx context.Context, org, name string) (*policy.Policy, error)

Get returns a policy by name.

func (*PolicyService) List

List returns an iterator over all policies in the organization.

func (*PolicyService) ListAll

func (s *PolicyService) ListAll(ctx context.Context, org string) ([]policy.Policy, error)

ListAll returns all policies in the organization.

func (*PolicyService) ListPage

func (s *PolicyService) ListPage(ctx context.Context, org, cursor string) (*ListResponse[policy.Policy], error)

ListPage returns a single page of policies.

func (*PolicyService) Query

Query returns an iterator over policies matching the query.

func (*PolicyService) QueryAll

func (s *PolicyService) QueryAll(ctx context.Context, org string, q *query.Query) ([]policy.Policy, error)

QueryAll returns all policies matching the query.

func (*PolicyService) QueryPage

func (s *PolicyService) QueryPage(ctx context.Context, org string, q *query.Query) (*QueryResponse[policy.Policy], error)

QueryPage returns a single page of policies matching the query.

func (*PolicyService) Update

func (s *PolicyService) Update(ctx context.Context, org, name string, p *policy.Policy) (*policy.Policy, error)

Update updates an existing policy.

type QueryResponse

type QueryResponse[T any] struct {
	Kind     query.QueryResultKind `json:"kind,omitempty"`
	ItemKind base.Kind             `json:"itemKind,omitempty"`
	Items    []T                   `json:"items"`
	Links    []base.Link           `json:"links"`
	Query    query.Query           `json:"query,omitempty"`
	// contains filtered or unexported fields
}

QueryResponse represents a query result with typed items.

func (*QueryResponse[T]) HasNext

func (r *QueryResponse[T]) HasNext() bool

HasNext returns true if there are more pages available.

func (r *QueryResponse[T]) NextLink() string

NextLink returns the URL for the next page, or empty string if no more pages.

func (*QueryResponse[T]) NextPage

func (r *QueryResponse[T]) NextPage(ctx context.Context) (*QueryResponse[T], error)

NextPage fetches the next page of query results. Returns nil, nil if there are no more pages. Note: Subsequent pages use GET (not POST), so the original query is not re-sent.

type QuotaService

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

QuotaService handles operations on quotas.

func (*QuotaService) Create

func (s *QuotaService) Create(ctx context.Context, org string, q *quota.Quota) (*quota.Quota, error)

Create creates a new quota.

func (*QuotaService) Delete

func (s *QuotaService) Delete(ctx context.Context, org, name string) error

Delete deletes a quota by name.

func (*QuotaService) Get

func (s *QuotaService) Get(ctx context.Context, org, name string) (*quota.Quota, error)

Get returns a quota by name.

func (*QuotaService) List

func (s *QuotaService) List(ctx context.Context, org string) iter.Seq2[quota.Quota, error]

List returns an iterator over all quotas in the organization.

func (*QuotaService) ListAll

func (s *QuotaService) ListAll(ctx context.Context, org string) ([]quota.Quota, error)

ListAll returns all quotas in the organization.

func (*QuotaService) ListPage

func (s *QuotaService) ListPage(ctx context.Context, org, cursor string) (*ListResponse[quota.Quota], error)

ListPage returns a single page of quotas.

func (*QuotaService) Query

func (s *QuotaService) Query(ctx context.Context, org string, q *query.Query) iter.Seq2[quota.Quota, error]

Query returns an iterator over quotas matching the query.

func (*QuotaService) QueryAll

func (s *QuotaService) QueryAll(ctx context.Context, org string, q *query.Query) ([]quota.Quota, error)

QueryAll returns all quotas matching the query.

func (*QuotaService) QueryPage

func (s *QuotaService) QueryPage(ctx context.Context, org string, q *query.Query) (*QueryResponse[quota.Quota], error)

QueryPage returns a single page of quotas matching the query.

func (*QuotaService) Update

func (s *QuotaService) Update(ctx context.Context, org, name string, q *quota.Quota) (*quota.Quota, error)

Update updates an existing quota.

type RestoreVolumeRequest

type RestoreVolumeRequest struct {
	Location     string  `json:"location"`
	VolumeIndex  float32 `json:"volumeIndex"`
	SnapshotName string  `json:"snapshotName"`
	Zone         string  `json:"zone,omitempty"`
}

RestoreVolumeRequest is the request for restoring a volume from a snapshot.

type SecretService

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

SecretService handles operations on secrets.

func (*SecretService) Create

func (s *SecretService) Create(ctx context.Context, org string, sec *secret.Secret) (*secret.Secret, error)

Create creates a new secret.

func (*SecretService) Delete

func (s *SecretService) Delete(ctx context.Context, org, name string) error

Delete deletes a secret by name.

func (*SecretService) Get

func (s *SecretService) Get(ctx context.Context, org, name string) (*secret.Secret, error)

Get returns a secret by name.

func (*SecretService) List

List returns an iterator over all secrets in the organization.

func (*SecretService) ListAll

func (s *SecretService) ListAll(ctx context.Context, org string) ([]secret.Secret, error)

ListAll returns all secrets in the organization.

func (*SecretService) ListPage

func (s *SecretService) ListPage(ctx context.Context, org, cursor string) (*ListResponse[secret.Secret], error)

ListPage returns a single page of secrets.

func (*SecretService) Query

Query returns an iterator over secrets matching the query.

func (*SecretService) QueryAll

func (s *SecretService) QueryAll(ctx context.Context, org string, q *query.Query) ([]secret.Secret, error)

QueryAll returns all secrets matching the query.

func (*SecretService) QueryPage

func (s *SecretService) QueryPage(ctx context.Context, org string, q *query.Query) (*QueryResponse[secret.Secret], error)

QueryPage returns a single page of secrets matching the query.

func (*SecretService) Reveal

func (s *SecretService) Reveal(ctx context.Context, org, name string) (*secret.Secret, error)

Reveal returns the secret with its data revealed. This requires the 'reveal' permission on the secret.

func (*SecretService) Update

func (s *SecretService) Update(ctx context.Context, org, name string, sec *secret.Secret) (*secret.Secret, error)

Update updates an existing secret.

type ServiceAccountService

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

ServiceAccountService handles operations on service accounts.

func (*ServiceAccountService) AddKey

func (s *ServiceAccountService) AddKey(ctx context.Context, org, name string, req *AddKeyRequest) (*AddKeyResponse, error)

AddKey adds a new key to a service account.

func (*ServiceAccountService) Create

Create creates a new service account.

func (*ServiceAccountService) Delete

func (s *ServiceAccountService) Delete(ctx context.Context, org, name string) error

Delete deletes a service account by name.

func (*ServiceAccountService) Get

Get returns a service account by name.

func (*ServiceAccountService) List

List returns an iterator over all service accounts in the organization.

func (*ServiceAccountService) ListAll

ListAll returns all service accounts in the organization.

func (*ServiceAccountService) ListPage

ListPage returns a single page of service accounts.

func (*ServiceAccountService) Query

Query returns an iterator over service accounts matching the query.

func (*ServiceAccountService) QueryAll

QueryAll returns all service accounts matching the query.

func (*ServiceAccountService) QueryPage

QueryPage returns a single page of service accounts matching the query.

func (*ServiceAccountService) Update

Update updates an existing service account.

type TOUInput

type TOUInput struct {
	CustomerName string `json:"customerName"`
	Accepted     bool   `json:"accepted"`
}

TOUInput is the input for accepting Terms of Use.

type TaskService

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

TaskService handles operations on tasks.

func (*TaskService) Get

func (s *TaskService) Get(ctx context.Context, org, name string) (*task.Task, error)

Get returns a task by name.

func (*TaskService) List

func (s *TaskService) List(ctx context.Context, org string) iter.Seq2[task.Task, error]

List returns an iterator over all tasks in the organization.

func (*TaskService) ListAll

func (s *TaskService) ListAll(ctx context.Context, org string) ([]task.Task, error)

ListAll returns all tasks in the organization.

func (*TaskService) ListPage

func (s *TaskService) ListPage(ctx context.Context, org, cursor string) (*ListResponse[task.Task], error)

ListPage returns a single page of tasks.

func (*TaskService) Query

func (s *TaskService) Query(ctx context.Context, org string, q *query.Query) iter.Seq2[task.Task, error]

Query returns an iterator over tasks matching the query.

func (*TaskService) QueryAll

func (s *TaskService) QueryAll(ctx context.Context, org string, q *query.Query) ([]task.Task, error)

QueryAll returns all tasks matching the query.

func (*TaskService) QueryPage

func (s *TaskService) QueryPage(ctx context.Context, org string, q *query.Query) (*QueryResponse[task.Task], error)

QueryPage returns a single page of tasks matching the query.

type UserService

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

UserService handles operations on users.

func (*UserService) Delete

func (s *UserService) Delete(ctx context.Context, org, name string) error

Delete removes a user from the organization.

func (*UserService) Get

func (s *UserService) Get(ctx context.Context, org, name string) (*user.User, error)

Get returns a user by name.

func (*UserService) Invite

func (s *UserService) Invite(ctx context.Context, org string, req *InviteRequest) error

Invite invites a user to the organization.

func (*UserService) List

func (s *UserService) List(ctx context.Context, org string) iter.Seq2[user.User, error]

List returns an iterator over all users in the organization.

func (*UserService) ListAll

func (s *UserService) ListAll(ctx context.Context, org string) ([]user.User, error)

ListAll returns all users in the organization.

func (*UserService) ListPage

func (s *UserService) ListPage(ctx context.Context, org, cursor string) (*ListResponse[user.User], error)

ListPage returns a single page of users.

func (*UserService) Query

func (s *UserService) Query(ctx context.Context, org string, q *query.Query) iter.Seq2[user.User, error]

Query returns an iterator over users matching the query.

func (*UserService) QueryAll

func (s *UserService) QueryAll(ctx context.Context, org string, q *query.Query) ([]user.User, error)

QueryAll returns all users matching the query.

func (*UserService) QueryPage

func (s *UserService) QueryPage(ctx context.Context, org string, q *query.Query) (*QueryResponse[user.User], error)

QueryPage returns a single page of users matching the query.

type VolumeSetService

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

VolumeSetService handles operations on volume sets.

func (*VolumeSetService) Create

Create creates a new volume set.

func (*VolumeSetService) CreateCommand

func (s *VolumeSetService) CreateCommand(ctx context.Context, org, gvc, volumeSetName string, cmd *command.Command) (*command.Command, error)

CreateCommand creates a new command for a volume set.

func (*VolumeSetService) CreateVolumeSnapshot

func (s *VolumeSetService) CreateVolumeSnapshot(ctx context.Context, org, gvc, volumeSetName string, req *CreateVolumeSnapshotRequest) (*command.Command, error)

CreateVolumeSnapshot creates a createVolumeSnapshot command.

func (*VolumeSetService) Delete

func (s *VolumeSetService) Delete(ctx context.Context, org, gvc, name string) error

Delete deletes a volume set by name.

func (*VolumeSetService) DeleteCommand

func (s *VolumeSetService) DeleteCommand(ctx context.Context, org, gvc, volumeSetName, commandID string) error

DeleteCommand deletes a command by ID.

func (*VolumeSetService) DeleteVolume

func (s *VolumeSetService) DeleteVolume(ctx context.Context, org, gvc, volumeSetName string, req *DeleteVolumeRequest) (*command.Command, error)

DeleteVolume creates a deleteVolume command to delete a volume.

func (*VolumeSetService) DeleteVolumeSnapshot

func (s *VolumeSetService) DeleteVolumeSnapshot(ctx context.Context, org, gvc, volumeSetName string, req *DeleteVolumeSnapshotRequest) (*command.Command, error)

DeleteVolumeSnapshot creates a deleteVolumeSnapshot command to delete a volume snapshot.

func (*VolumeSetService) ExpandVolume

func (s *VolumeSetService) ExpandVolume(ctx context.Context, org, gvc, volumeSetName string, req *ExpandVolumeRequest) (*command.Command, error)

ExpandVolume creates an expandVolume command to increase volume capacity.

func (*VolumeSetService) Get

func (s *VolumeSetService) Get(ctx context.Context, org, gvc, name string) (*volumeSet.VolumeSet, error)

Get returns a volume set by name.

func (*VolumeSetService) GetCommand

func (s *VolumeSetService) GetCommand(ctx context.Context, org, gvc, volumeSetName, commandID string) (*command.Command, error)

GetCommand returns a command by ID.

func (*VolumeSetService) List

List returns an iterator over all volume sets in the GVC.

func (*VolumeSetService) ListAll

func (s *VolumeSetService) ListAll(ctx context.Context, org, gvc string) ([]volumeSet.VolumeSet, error)

ListAll returns all volume sets in the GVC.

func (*VolumeSetService) ListCommands

func (s *VolumeSetService) ListCommands(ctx context.Context, org, gvc, volumeSetName string) iter.Seq2[command.Command, error]

ListCommands returns an iterator over all commands for a volume set.

func (*VolumeSetService) ListCommandsAll

func (s *VolumeSetService) ListCommandsAll(ctx context.Context, org, gvc, volumeSetName string) ([]command.Command, error)

ListCommandsAll returns all commands for a volume set.

func (*VolumeSetService) ListPage

func (s *VolumeSetService) ListPage(ctx context.Context, org, gvc, cursor string) (*ListResponse[volumeSet.VolumeSet], error)

ListPage returns a single page of volume sets.

func (*VolumeSetService) Query

Query returns an iterator over volume sets matching the query. Note: VolumeSet queries are org-level, not GVC-scoped.

func (*VolumeSetService) QueryAll

func (s *VolumeSetService) QueryAll(ctx context.Context, org string, q *query.Query) ([]volumeSet.VolumeSet, error)

QueryAll returns all volume sets matching the query. Note: VolumeSet queries are org-level, not GVC-scoped.

func (*VolumeSetService) QueryCommands

func (s *VolumeSetService) QueryCommands(ctx context.Context, org, gvc, volumeSetName string, q *query.Query) iter.Seq2[command.Command, error]

QueryCommands returns an iterator over commands for a volume set matching the query.

func (*VolumeSetService) QueryCommandsAll

func (s *VolumeSetService) QueryCommandsAll(ctx context.Context, org, gvc, volumeSetName string, q *query.Query) ([]command.Command, error)

QueryCommandsAll returns all commands for a volume set matching the query.

func (*VolumeSetService) QueryCommandsPage

func (s *VolumeSetService) QueryCommandsPage(ctx context.Context, org, gvc, volumeSetName string, q *query.Query) (*QueryResponse[command.Command], error)

QueryCommandsPage returns a single page of commands for a volume set matching the query.

func (*VolumeSetService) QueryPage

QueryPage returns a single page of volume sets matching the query. Note: VolumeSet queries are org-level, not GVC-scoped.

func (*VolumeSetService) RestoreVolume

func (s *VolumeSetService) RestoreVolume(ctx context.Context, org, gvc, volumeSetName string, req *RestoreVolumeRequest) (*command.Command, error)

RestoreVolume creates a restoreVolume command to restore a volume from a snapshot.

func (*VolumeSetService) Update

func (s *VolumeSetService) Update(ctx context.Context, org, gvc, name string, v *volumeSet.VolumeSet) (*volumeSet.VolumeSet, error)

Update updates an existing volume set.

func (*VolumeSetService) UpdateCommand

func (s *VolumeSetService) UpdateCommand(ctx context.Context, org, gvc, volumeSetName, commandID string, cmd *command.Command) (*command.Command, error)

UpdateCommand updates an existing command.

type WorkloadService

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

WorkloadService handles operations on workloads.

func (*WorkloadService) Create

func (s *WorkloadService) Create(ctx context.Context, org, gvc string, w *workload.Workload) (*workload.Workload, error)

Create creates a new workload.

func (*WorkloadService) CreateCommand

func (s *WorkloadService) CreateCommand(ctx context.Context, org, gvc, workloadName string, cmd *command.Command) (*command.Command, error)

CreateCommand creates a new command for a workload.

func (*WorkloadService) CronStart

func (s *WorkloadService) CronStart(ctx context.Context, org, gvc, name string, req *CronStartRequest) (*command.Command, error)

CronStart manually triggers a cron workload job by creating a runCronWorkload command.

func (*WorkloadService) Delete

func (s *WorkloadService) Delete(ctx context.Context, org, gvc, name string) error

Delete deletes a workload by name.

func (*WorkloadService) DeleteCommand

func (s *WorkloadService) DeleteCommand(ctx context.Context, org, gvc, workloadName, commandID string) error

DeleteCommand deletes a command by ID.

func (*WorkloadService) ForceRedeploy

func (s *WorkloadService) ForceRedeploy(ctx context.Context, org, gvc, name string) error

ForceRedeploy forces a workload to redeploy by setting the cpln/deployTimestamp tag.

func (*WorkloadService) Get

func (s *WorkloadService) Get(ctx context.Context, org, gvc, name string) (*workload.Workload, error)

Get returns a workload by name.

func (*WorkloadService) GetCommand

func (s *WorkloadService) GetCommand(ctx context.Context, org, gvc, workloadName, commandID string) (*command.Command, error)

GetCommand returns a command by ID.

func (*WorkloadService) List

List returns an iterator over all workloads in the GVC.

func (*WorkloadService) ListAll

func (s *WorkloadService) ListAll(ctx context.Context, org, gvc string) ([]workload.Workload, error)

ListAll returns all workloads in the GVC.

func (*WorkloadService) ListCommands

func (s *WorkloadService) ListCommands(ctx context.Context, org, gvc, workloadName string) iter.Seq2[command.Command, error]

ListCommands returns an iterator over all commands for a workload.

func (*WorkloadService) ListCommandsAll

func (s *WorkloadService) ListCommandsAll(ctx context.Context, org, gvc, workloadName string) ([]command.Command, error)

ListCommandsAll returns all commands for a workload.

func (*WorkloadService) ListPage

func (s *WorkloadService) ListPage(ctx context.Context, org, gvc, cursor string) (*ListResponse[workload.Workload], error)

ListPage returns a single page of workloads.

func (*WorkloadService) Query

Query returns an iterator over workloads matching the query. Note: Workload queries are org-level, not GVC-scoped.

func (*WorkloadService) QueryAll

func (s *WorkloadService) QueryAll(ctx context.Context, org string, q *query.Query) ([]workload.Workload, error)

QueryAll returns all workloads matching the query. Note: Workload queries are org-level, not GVC-scoped.

func (*WorkloadService) QueryCommands

func (s *WorkloadService) QueryCommands(ctx context.Context, org, gvc, workloadName string, q *query.Query) iter.Seq2[command.Command, error]

QueryCommands returns an iterator over commands for a workload matching the query.

func (*WorkloadService) QueryCommandsAll

func (s *WorkloadService) QueryCommandsAll(ctx context.Context, org, gvc, workloadName string, q *query.Query) ([]command.Command, error)

QueryCommandsAll returns all commands for a workload matching the query.

func (*WorkloadService) QueryCommandsPage

func (s *WorkloadService) QueryCommandsPage(ctx context.Context, org, gvc, workloadName string, q *query.Query) (*QueryResponse[command.Command], error)

QueryCommandsPage returns a single page of commands for a workload matching the query.

func (*WorkloadService) QueryPage

QueryPage returns a single page of workloads matching the query. Note: Workload queries are org-level, not GVC-scoped.

func (*WorkloadService) RunCronWorkload

func (s *WorkloadService) RunCronWorkload(ctx context.Context, org, gvc, workloadName string, spec *command.RunCronWorkloadSpec) (*command.Command, error)

RunCronWorkload creates a runCronWorkload command to manually trigger a cron workload.

func (*WorkloadService) StopReplica

func (s *WorkloadService) StopReplica(ctx context.Context, org, gvc, workloadName string, spec *command.StopReplicaSpec) (*command.Command, error)

StopReplica creates a stopReplica command to stop a specific replica.

func (*WorkloadService) Update

func (s *WorkloadService) Update(ctx context.Context, org, gvc, name string, w *workload.Workload) (*workload.Workload, error)

Update updates an existing workload.

func (*WorkloadService) UpdateCommand

func (s *WorkloadService) UpdateCommand(ctx context.Context, org, gvc, workloadName, commandID string, cmd *command.Command) (*command.Command, error)

UpdateCommand updates an existing command.

Jump to

Keyboard shortcuts

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