api

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCloudPodNotFound = errors.New("cloud pod not found")

ErrCloudPodNotFound is returned by GetCloudPod when the platform reports the requested pod does not exist (HTTP 404).

Functions

This section is empty.

Types

type AuthRequest

type AuthRequest struct {
	ID            string `json:"id"`
	Code          string `json:"code"`
	ExchangeToken string `json:"exchange_token"`
}

type CloudPod added in v0.12.0

type CloudPod struct {
	Name        string
	Version     int
	LastChanged *time.Time
}

type CloudPodDetails added in v0.13.0

type CloudPodDetails struct {
	Name              string
	Version           int
	Created           *time.Time
	Size              int64
	LocalStackVersion string
	Message           string
	Services          []string
	Resources         []CloudPodResource
}

CloudPodDetails is the metadata for a single cloud snapshot, taken from its latest version. Resources is empty when the platform has no resource breakdown for the snapshot (e.g. it was saved without resource indexing enabled).

type CloudPodResource added in v0.13.0

type CloudPodResource struct {
	Service string
	Counts  []CloudPodResourceCount
}

CloudPodResource groups the resource counts of a single service.

type CloudPodResourceCount added in v0.13.0

type CloudPodResourceCount struct {
	Noun  string
	Count int
}

CloudPodResourceCount is a count of a single resource kind within a service, e.g. {Noun: "buckets", Count: 3}.

type CredentialsInfo

type CredentialsInfo struct {
	Token string `json:"token"`
}

type LicenseError added in v0.5.0

type LicenseError struct {
	Status           int
	Message          string
	Detail           string
	IsUnsupportedTag bool
}

LicenseError is returned when license validation fails. Message is user-friendly; Detail contains the raw server response for debugging. IsUnsupportedTag is set when the server rejects the image tag format (a 400 whose detail carries the licensing.license.format error code). It means "the server cannot judge this tag", not that the license was rejected — the start pre-flight skips validation entirely on it and defers to the container's own license check, so keep the detection narrow: widening it widens that bypass.

func (*LicenseError) Error added in v0.5.0

func (e *LicenseError) Error() string

type LicenseRequest

type LicenseRequest struct {
	Product     ProductInfo     `json:"product"`
	Credentials CredentialsInfo `json:"credentials"`
	Machine     MachineInfo     `json:"machine"`
}

type LicenseResponse added in v0.5.7

type LicenseResponse struct {
	LicenseType string          `json:"license_type"`
	RawBytes    json.RawMessage `json:"-"`
}

func (*LicenseResponse) PlanDisplayName added in v0.5.7

func (r *LicenseResponse) PlanDisplayName() string

PlanDisplayName returns a human-readable plan name for the license type. Returns an empty string for a nil receiver or unknown types.

type MachineInfo

type MachineInfo struct {
	Hostname        string `json:"hostname,omitempty"`
	Platform        string `json:"platform,omitempty"`
	PlatformRelease string `json:"platform_release,omitempty"`
}

type PlatformAPI

type PlatformAPI interface {
	CreateAuthRequest(ctx context.Context) (*AuthRequest, error)
	CheckAuthRequestConfirmed(ctx context.Context, id, exchangeToken string) (bool, error)
	ExchangeAuthRequest(ctx context.Context, id, exchangeToken string) (string, error)
	GetLicenseToken(ctx context.Context, bearerToken string) (string, error)
	GetLicense(ctx context.Context, req *LicenseRequest) (*LicenseResponse, error)
}

type PlatformClient

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

func NewPlatformClient

func NewPlatformClient(apiEndpoint string, logger log.Logger) *PlatformClient

func (*PlatformClient) CheckAuthRequestConfirmed

func (c *PlatformClient) CheckAuthRequestConfirmed(ctx context.Context, id, exchangeToken string) (bool, error)

func (*PlatformClient) CreateAuthRequest

func (c *PlatformClient) CreateAuthRequest(ctx context.Context) (*AuthRequest, error)

func (*PlatformClient) ExchangeAuthRequest

func (c *PlatformClient) ExchangeAuthRequest(ctx context.Context, id, exchangeToken string) (string, error)

func (*PlatformClient) GetCloudPod added in v0.13.0

func (c *PlatformClient) GetCloudPod(ctx context.Context, authToken, podName string) (*CloudPodDetails, error)

GetCloudPod fetches metadata for a single cloud snapshot from the platform. It returns ErrCloudPodNotFound when the pod does not exist.

func (*PlatformClient) GetLicense

func (c *PlatformClient) GetLicense(ctx context.Context, licReq *LicenseRequest) (*LicenseResponse, error)

func (*PlatformClient) GetLicenseToken

func (c *PlatformClient) GetLicenseToken(ctx context.Context, bearerToken string) (string, error)

func (*PlatformClient) ListCloudPods added in v0.12.0

func (c *PlatformClient) ListCloudPods(ctx context.Context, authToken, creator string) ([]CloudPod, error)

type ProductInfo

type ProductInfo struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

Jump to

Keyboard shortcuts

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