configurations

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*up.Config
}

Client is a configurations client.

func NewClient

func NewClient(cfg *up.Config) *Client

NewClient builds a configurations client from the given config.

func (*Client) Create

Create a configuration on Upbound Note that when using GitHub, this will make a new repo, and that requires the GitHub app to be authorized and installed. That's a separate API, which begins with the gitsources login. The full login is implemented in the CLI (https://github.com/upbound/up).

func (*Client) Delete

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

Delete a configuration on an Upbound account by name. This operation can potentially orphan Managed Control Planes that have deployed the configuration, as they can no longer update them. The API will return an HTTP 403 status code in this case indicating that the configuration is still in use.

func (*Client) Get

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

Get a configuration for an account by name on Upbound.

func (*Client) List

func (c *Client) List(ctx context.Context, account string) (*ConfigurationListResponse, error)

List all configurations for an account on Upbound.

func (*Client) ListTemplates

func (c *Client) ListTemplates(ctx context.Context) (*ConfigurationTemplateListResponse, error)

ListTemplates all configuration Templates that can be used to make a configuration

type ConfigurationCreateParameters

type ConfigurationCreateParameters struct {
	Context    string   `json:"context"`    // Name of the GitHub account/org
	Name       string   `json:"name"`       // Name of the configuration
	Provider   Provider `json:"provider"`   // See Provider above
	Repo       string   `json:"repo"`       // Name of the repo. Usually the same as the configuration name
	TemplateID string   `json:"templateId"` // Name of the template we clone. There is no API for this today.
	Private    bool     `json:"private"`    // True if the Github repo should be private
}

ConfigurationCreateParameters are the parameters for creating a control plane.

type ConfigurationListResponse

type ConfigurationListResponse struct {
	Configurations []ConfigurationResponse `json:"configurations"`
	Count          int                     `json:"count"`
	Page           int                     `json:"page"`
	Size           int                     `json:"size"`
}

ConfigurationListResponse is a list of all configurations belonging to the account.

type ConfigurationResponse

type ConfigurationResponse struct {
	ID            uuid.UUID  `json:"id"`
	Name          *string    `json:"name"`
	LatestVersion *string    `json:"latestVersion,omitempty"`
	TemplateID    string     `json:"templateID"`
	Provider      Provider   `json:"provider"`
	Context       string     `json:"context"`
	Repo          string     `json:"repo"`
	Branch        string     `json:"branch"`
	CreatorID     uint       `json:"creatorId"`
	CreatedAt     time.Time  `json:"createdAt"`
	UpdatedAt     *time.Time `json:"updatedAt,omitempty"`
	SyncedAt      *time.Time `json:"syncedAt,omitempty"`
}

ConfigurationResponse represents the concept of a Configuration on Upbound. It is used to configure a Managed Control Plane with a set of API types and optional extensions.

type ConfigurationTemplateListResponse

type ConfigurationTemplateListResponse struct {
	Templates []ConfigurationTemplateReponse `json:"templates"`
}

ConfigurationTemplateListResponse is a list of configuration templates

type ConfigurationTemplateReponse

type ConfigurationTemplateReponse struct {
	ID       string `json:"id"`
	ImageURI string `json:"imageUri"`
	Name     string `json:"name"`
	Repo     string `json:"repo"`
}

ConfigurationTemplateReponse is a single configuration template The ID of the template is the TemplateId for the ConfigurationCreateParameters

type Provider

type Provider string

Provider is the type of Git provider, such as "github"

const (
	ProviderGitHub Provider = "github"
)

Tokens can be owned by a user, control plane, or robot.

Jump to

Keyboard shortcuts

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