environment

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package environment represents a cloud stack environment operations under the `/cloud/stack/environment` API endpoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a Service to work with API Jobs.

func New

func New(c *api.Client) *Client

New is an initialisation function.

func (*Client) Delete added in v0.7.0

func (s *Client) Delete(ctx context.Context, request DeleteRequest) (response DeleteResponse, err error)

Delete removes the named environment variables from a stack service via "cloud/stack/environment/delete.json". The variables to remove are passed by name; their values aren't required.

Same param shape as Update — server, project, service — with `variables[N][name]` instead of `variables[N][name]` + `variables[N][content]` pairs.

Async: the response carries a scheduler job descriptor; poll via job.Get to confirm the variables were actually removed.

func (*Client) Get

func (s *Client) Get(ctx context.Context, request GetRequest) (response GetResponse, err error)

Get returns the stack's environment variables.

func (*Client) Update

func (s *Client) Update(ctx context.Context, request UpdateRequest) (response UpdateResponse, err error)

Update applies updates to the stacks environment.

type DeleteRequest added in v0.7.0

type DeleteRequest struct {
	ServerName string   `json:"server"`
	Project    string   `json:"project"`
	Service    string   `json:"service"`
	Names      []string `json:"-"`
}

DeleteRequest removes the named environment variables from a stack service. Names lists the variable names to drop; their values aren't required (and aren't sent on the wire).

type DeleteResponse added in v0.7.0

type DeleteResponse struct {
	Return struct {
		models.Job `json:"job"`
	} `json:"return"`
	models.APIResponse
}

DeleteResponse is returned by environment/delete. Delete is async: the API queues a job and the response carries its descriptor. Poll via job.Get to confirm the variables were actually removed.

type GetRequest

type GetRequest struct {
	ServerName string `json:"server"`
	Project    string `json:"project"`
	Service    string `json:"service"`
}

GetRequest represents a request to get a stacks environment.

type GetResponse

type GetResponse struct {
	EnvironmentVariables []models.EnvironmentVariable `json:"return"`
	models.APIResponse
}

GetResponse is the response that returns a stacks environment variables.

type UpdateRequest

type UpdateRequest struct {
	ServerName           string `json:"server"`
	Project              string `json:"project"`
	Service              string `json:"service"`
	EnvironmentVariables []models.EnvironmentVariable
}

UpdateRequest represents a call to update the environment variables of a stack.

type UpdateResponse

type UpdateResponse struct {
	Return struct {
		models.Job `json:"job"`
	} `json:"return"`
	models.APIResponse
}

UpdateResponse is the result of updating an environment on a stack.

Jump to

Keyboard shortcuts

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