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
- type Client
- func (c *Client) ActivateRelease(ctx context.Context, deploymentID int64, releaseID string) (Release, error)
- func (c *Client) BuildRelease(ctx context.Context, deploymentID int64, releaseID string) (Release, error)
- func (c *Client) CancelRelease(ctx context.Context, deploymentID int64, releaseID string) error
- func (c *Client) Create(ctx context.Context, req sdk.DeploymentCreateRequest) (Deployment, error)
- func (c *Client) CreateRelease(ctx context.Context, deploymentID int64, resources []ReleaseResource, ...) (Release, error)
- func (c *Client) DeleteRelease(ctx context.Context, deploymentID int64, releaseID string) error
- func (c *Client) FindByName(ctx context.Context, name string) (Deployment, bool, error)
- func (c *Client) Get(ctx context.Context, id int64) (Deployment, error)
- func (c *Client) GetRelease(ctx context.Context, deploymentID int64, releaseID string) (Release, error)
- func (c *Client) Hierarchy(ctx context.Context, deploymentID int64) (Hierarchy, error)
- type Deployment
- type Hierarchy
- type HierarchyEntry
- type Release
- type ReleaseResource
Constants ¶
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.
const ( RoleActive = "ACTIVE" RoleCandidate = "CANDIDATE" RoleValidURL = "VALID_URL" RoleInactive = "INACTIVE" )
Traffic roles a release can have.
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 (*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 ¶
CancelRelease asks the API to stop a release build that has not settled.
func (*Client) Create ¶
func (c *Client) Create(ctx context.Context, req sdk.DeploymentCreateRequest) (Deployment, error)
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 ¶
DeleteRelease removes a release that never went live, so failed runs do not use up the Deployment's release Drafts.
func (*Client) FindByName ¶
FindByName returns the Deployment with exactly this name, if any.
func (*Client) Get ¶
Get reads one Deployment. Waits poll it, so a failure also carries the HTTP status (version.NewStatusError) for the retry rule.
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 ¶
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 ¶
ReleaseResource is one resource version a release carries.