deployments

package
v0.0.0-...-059d9f2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: MIT Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package deployments is the API v6 client for Deployments and their releases. A release is the unit that goes live: it names one version of each resource, is built like a resource version, and is then activated.

Index

Constants

View Source
const (
	BindingStrict   = "STRICT"
	BindingFlexible = "FLEXIBLE"
)

Binding policies. The CLI creates its Deployments STRICT: a Workload bound to it serves exactly the release activated on it.

View Source
const (
	RoleActive    = "ACTIVE"
	RoleCandidate = "CANDIDATE"
	RoleValidURL  = "VALID_URL"
	RoleInactive  = "INACTIVE"
)

Traffic roles a release can have.

View Source
const OriginCLI = "cli"

OriginCLI marks a release as created by the CLI.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(c *http.Client, url string, token string) *Client

func (*Client) ActivateRelease

func (c *Client) ActivateRelease(ctx context.Context, deploymentID int64, releaseID string) (Release, error)

ActivateRelease routes the Deployment's traffic to a Ready release.

func (*Client) BuildRelease

func (c *Client) BuildRelease(ctx context.Context, deploymentID int64, releaseID string) (Release, error)

BuildRelease queues the build of a release Draft.

func (*Client) CancelRelease

func (c *Client) CancelRelease(ctx context.Context, deploymentID int64, releaseID string) error

CancelRelease asks the API to stop a release build that has not settled.

func (*Client) Create

Create creates a Deployment. Its binding policy cannot change later.

func (*Client) CreateRelease

func (c *Client) CreateRelease(ctx context.Context, deploymentID int64, resources []ReleaseResource, originType string) (Release, error)

CreateRelease opens a release Draft on a Deployment.

func (*Client) DeleteRelease

func (c *Client) DeleteRelease(ctx context.Context, deploymentID int64, releaseID string) error

DeleteRelease removes a release that never went live, so failed runs do not use up the Deployment's release Drafts.

func (*Client) FindByName

func (c *Client) FindByName(ctx context.Context, name string) (Deployment, bool, error)

FindByName returns the Deployment with exactly this name, if any.

func (*Client) Get

func (c *Client) Get(ctx context.Context, id int64) (Deployment, error)

Get reads one Deployment. Waits poll it, so a failure also carries the HTTP status (version.NewStatusError) for the retry rule.

func (*Client) GetRelease

func (c *Client) GetRelease(ctx context.Context, deploymentID int64, releaseID string) (Release, error)

GetRelease reads one release. Waits poll it, so a failure also carries the HTTP status (version.NewStatusError) for the retry rule.

func (*Client) Hierarchy

func (c *Client) Hierarchy(ctx context.Context, deploymentID int64) (Hierarchy, error)

Hierarchy reads which resource versions the Deployment serves.

type Deployment

type Deployment struct {
	ID               int64
	Name             string
	BindingPolicy    string
	DeploymentPolicy string
	VersionID        string
	VersionState     version.State
}

Deployment is what the deploy needs from one.

type Hierarchy

type Hierarchy struct {
	DeploymentID    int64
	ActiveReleaseID string
	Resources       []HierarchyEntry
}

Hierarchy is what a Deployment serves: its active release and the resource versions in it.

type HierarchyEntry

type HierarchyEntry struct {
	ResourceType string
	ResourceID   string
	Version      string
}

HierarchyEntry is one resource version a Deployment serves.

type Release

type Release struct {
	ID           string
	DeploymentID int64
	State        version.State
	TrafficRole  string
	TraceID      string
	Resources    []ReleaseResource
}

Release is what the deploy needs from one.

type ReleaseResource

type ReleaseResource struct {
	ResourceID   int64
	ResourceType string
	VersionID    string
}

ReleaseResource is one resource version a release carries.

Jump to

Keyboard shortcuts

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