controlplanes

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// ConfigurationIDParam is the name of the Configuration UUID query parameter.
	ConfigurationIDParam = "configurationId"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*up.Config
}

Client is a control planes client.

func NewClient

func NewClient(cfg *up.Config) *Client

NewClient build a control planes client from the passed config.

func (*Client) Create

Create a control plane on Upbound.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, account, name string) error

Delete a control plane on Upbound.

func (*Client) Get

func (c *Client) Get(ctx context.Context, account, name string) (*ControlPlaneResponse, error)

Get a control plane on Upbound.

func (*Client) List added in v0.2.0

func (c *Client) List(ctx context.Context, account string, opts ...common.ListOption) (*ControlPlaneListResponse, error)

List all control planes in the given account on Upbound.

type ConfigurationStatus added in v0.2.0

type ConfigurationStatus string

ConfigurationStatus represents the different states of a Configuration relative to a Managed Control Plane.

const (
	// ConfigurationInstallationQueued means queued to begin installation in a Managed Control Plane
	ConfigurationInstallationQueued ConfigurationStatus = "installationQueued"
	// ConfigurationUpgradeQueued means queued to upgrade to a specified version in a Managed Control Plane
	ConfigurationUpgradeQueued ConfigurationStatus = "upgradeQueued"
	// ConfigurationInstalling means currently installing into the Managed Control Plane
	ConfigurationInstalling ConfigurationStatus = "installing"
	// ConfigurationReady means ready for use in the Managed Control Plane
	ConfigurationReady ConfigurationStatus = "ready"
	// ConfigurationUpgrading means currently upgrading to a specified version in the Managed Control Plane
	ConfigurationUpgrading ConfigurationStatus = "upgrading"
)

type ControlPlane

type ControlPlane struct {
	ID            uuid.UUID                  `json:"id,omitempty"`
	Name          string                     `json:"name,omitempty"`
	Description   string                     `json:"description,omitempty"`
	CreatorID     uint                       `json:"creatorId,omitempty"`
	Reserved      bool                       `json:"reserved"`
	CreatedAt     *time.Time                 `json:"createdAt,omitempty"`
	UpdatedAt     *time.Time                 `json:"updatedAt,omitempty"`
	ExpiresAt     time.Time                  `json:"expiresAt"`
	Configuration *ControlPlaneConfiguration `json:"configuration,omitempty"`
}

ControlPlane describes a control plane.

type ControlPlaneConfiguration added in v0.2.0

type ControlPlaneConfiguration struct {
	ID             uuid.UUID           `json:"id"`
	Name           *string             `json:"name"`
	CurrentVersion *string             `json:"currentVersion"`
	DesiredVersion *string             `json:"desiredVersion"`
	Status         ConfigurationStatus `json:"status"`
	SyncedAt       *time.Time          `json:"syncedAt,omitempty"`
	DeployedAt     *time.Time          `json:"deployedAt,omitempty"`
}

ControlPlaneConfiguration represents an instance of a Configuration associated with a Managed Control Plane on Upbound.

type ControlPlaneCreateParameters

type ControlPlaneCreateParameters struct {
	ConfigurationID *uuid.UUID `json:"configurationId,omitempty"`
	Name            string     `json:"name"`
	Description     string     `json:"description"`
}

ControlPlaneCreateParameters are the parameters for creating a control plane.

type ControlPlaneListOption added in v0.2.0

type ControlPlaneListOption common.ListOption

ControlPlaneListOption modifies a control plane list request, specifically.

func WithConfiguration added in v0.2.0

func WithConfiguration(id uuid.UUID) ControlPlaneListOption

WithConfiguration sets the configurationId to filter the list response.

type ControlPlaneListResponse added in v0.2.0

type ControlPlaneListResponse struct {
	ControlPlanes []ControlPlaneResponse `json:"controlPlanes"`
	Size          int                    `json:"size"`
	Page          int                    `json:"page"`
	Count         int                    `json:"count"`
}

ControlPlaneListResponse is the HTTP body returned when listing control planes.

type ControlPlaneResponse

type ControlPlaneResponse struct {
	ControlPlane ControlPlane    `json:"controlPlane"`
	Status       Status          `json:"controlPlanestatus,omitempty"`
	Permission   PermissionGroup `json:"controlPlanePermission,omitempty"`
}

ControlPlaneResponse is the HTTP body returned by the Upbound API when fetching control planes.

type PermissionGroup

type PermissionGroup string

PermissionGroup describes control plane permissions for the authenticated user.

const (
	// PermissionMember has the ability to read the basic environment of the
	// team.
	PermissionMember PermissionGroup = "member"
	// PermissionOwner has the ability to modify any object in a linked control
	// plane, including deleting the control plane.
	PermissionOwner PermissionGroup = "owner"
	// PermissionNone has no permissions on the control plane.
	PermissionNone PermissionGroup = "none"
)

type Status

type Status string

Status is the status of a control plane on Upbound.

const (
	StatusProvisioning Status = "provisioning"
	StatusUpdating     Status = "updating"
	StatusReady        Status = "ready"
	StatusDeleting     Status = "deleting"
)

A control plane will always be in one of the following phases.

Jump to

Keyboard shortcuts

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