environments

package
v0.0.0-...-63319d1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MPL-2.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List(client *golangsdk.ServiceClient, instanceId string, opts ListOptsBuilder) pagination.Pager

List is a method to obtain an array of one or more groups according to the query parameters.

func ListVariables

func ListVariables(client *golangsdk.ServiceClient, instanceId string, opts ListVariablesOptsBuilder) pagination.Pager

ListVariables is a method to obtain an array of one or more variables according to the query parameters.

Types

type CreateResult

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

CreateResult represents a result of the Create method.

func Create

func Create(client *golangsdk.ServiceClient, instanceId string, opts EnvironmentOptsBuilder) (r CreateResult)

Create is a method by which to create function that create a new environment.

func (CreateResult) Extract

func (r CreateResult) Extract() (*Environment, error)

type CreateVariableOpts

type CreateVariableOpts struct {
	// Variable name, which can contain 3 to 32 characters, starting with a letter.
	// Only letters, digits, hyphens (-), and underscores (_) are allowed.
	// In the definition of an API, #Name# (case-sensitive) indicates a variable.
	// It is replaced by the actual value when the API is published in an environment.
	Name string `json:"variable_name" required:"true"`
	// Variable value, which can contain 1 to 255 characters.
	// Only letters, digits, and special characters (_-/.:) are allowed.
	Value string `json:"variable_value" required:"true"`
	// Environment ID.
	EnvId string `json:"env_id" required:"true"`
	// Group ID.
	GroupId string `json:"group_id" required:"true"`
}

CreateVariableOpts allows to create a new envirable variable for an existing group using given parameters.

func (CreateVariableOpts) ToCreateVariableOptsMap

func (opts CreateVariableOpts) ToCreateVariableOptsMap() (map[string]interface{}, error)

type CreateVariableOptsBuilder

type CreateVariableOptsBuilder interface {
	ToCreateVariableOptsMap() (map[string]interface{}, error)
}

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult represents a result of the Delete and DeleteVariable method.

func Delete

func Delete(client *golangsdk.ServiceClient, instanceId, envId string) (r DeleteResult)

Delete is a method to delete an existing group.

func DeleteVariable

func DeleteVariable(client *golangsdk.ServiceClient, instanceId, varId string) (r DeleteResult)

DeleteVariable is a method to delete an existing variable.

type Environment

type Environment struct {
	// Environment ID.
	Id string `json:"id"`
	// Environment name.
	Name string `json:"name"`
	// Description.
	Description string `json:"remark"`
	// Create time, in RFC-3339 format.
	CreateTime string `json:"create_time"`
}

func ExtractEnvironments

func ExtractEnvironments(r pagination.Page) ([]Environment, error)

type EnvironmentOpts

type EnvironmentOpts struct {
	// Environment name, which can contain 3 to 64 characters, starting with a letter.
	// Only letters, digits and underscores (_) are allowed.
	// Chinese characters must be in UTF-8 or Unicode format.
	Name string `json:"name" required:"true"`
	// Description of the environment, which can contain a maximum of 255 characters,
	// and the angle brackets (< and >) are not allowed.
	// Chinese characters must be in UTF-8 or Unicode format.
	Description *string `json:"remark,omitempty"`
}

EnvironmentOpts allows to create a new environment or update an existing environment using given parameters.

func (EnvironmentOpts) ToEnvironmentOptsMap

func (opts EnvironmentOpts) ToEnvironmentOptsMap() (map[string]interface{}, error)

type EnvironmentOptsBuilder

type EnvironmentOptsBuilder interface {
	ToEnvironmentOptsMap() (map[string]interface{}, error)
}

type EnvironmentPage

type EnvironmentPage struct {
	pagination.SinglePageBase
}

EnvironmentPage represents the response pages of the List method.

type ListOpts

type ListOpts struct {
	// Environment name.
	Name string `q:"name"`
	// Offset from which the query starts.
	// If the offset is less than 0, the value is automatically converted to 0. Default to 0.
	Offset int `q:"offset"`
	// Number of items displayed on each page. The valid values are range form 1 to 500, default to 20.
	Limit int `q:"limit"`
}

ListOpts allows to filter list data using given parameters.

func (ListOpts) ToListQuery

func (opts ListOpts) ToListQuery() (string, error)

type ListOptsBuilder

type ListOptsBuilder interface {
	ToListQuery() (string, error)
}

type ListVariablesOpts

type ListVariablesOpts struct {
	// API group ID.
	GroupId string `q:"group_id"`
	// Environment ID.
	EnvId string `q:"env_id"`
	// Variable name.
	Name string `q:"variable_name"`
	// Offset from which the query starts.
	// If the offset is less than 0, the value is automatically converted to 0. Default to 0.
	Offset int `q:"offset"`
	// Number of items displayed on each page. The valid values are range form 1 to 500, default to 20.
	Limit int `q:"limit"`
	// Parameter name for exact matching. Only API variable names are supported.
	PreciseSearch string `q:"precise_search"`
}

ListVariablesOpts allows to filter list data using given parameters.

func (ListVariablesOpts) ToListVariablesQuery

func (opts ListVariablesOpts) ToListVariablesQuery() (string, error)

type ListVariablesOptsBuilder

type ListVariablesOptsBuilder interface {
	ToListVariablesQuery() (string, error)
}

type UpdateResult

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

UpdateResult represents a result of the Update method.

func Update

func Update(client *golangsdk.ServiceClient, instanceId, envId string, opts EnvironmentOptsBuilder) (r UpdateResult)

Update is a method by which to udpate an existing environment.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*Environment, error)

type Variable

type Variable struct {
	// Environment variable ID.
	Id string `json:"id"`
	// Variable name.
	Name string `json:"variable_name"`
	// Variable value.
	Value string `json:"variable_value"`
	// API group ID.
	GroupId string `json:"group_id"`
	// Environment ID.
	EnvId string `json:"env_id"`
}

func ExtractVariables

func ExtractVariables(r pagination.Page) ([]Variable, error)

type VariableCreateResult

type VariableCreateResult struct {
	VariableResult
}

VariableCreateResult represents a result of the CreateVariable method.

func CreateVariable

func CreateVariable(client *golangsdk.ServiceClient, instanceId string,
	opts CreateVariableOptsBuilder) (r VariableCreateResult)

CreateVariable is a method by which to create function that create a new environment variable.

type VariableGetResult

type VariableGetResult struct {
	VariableResult
}

VariableGetResult represents a result of the GetVariable operation.

func GetVariable

func GetVariable(client *golangsdk.ServiceClient, instanceId, varId string) (r VariableGetResult)

GetVariable is a method to obtain the specified environment variable according to the instance id and variable id.

type VariablePage

type VariablePage struct {
	pagination.SinglePageBase
}

VariablePage represents the response pages of the List operation.

type VariableResult

type VariableResult struct {
	golangsdk.Result
}

func (VariableResult) Extract

func (r VariableResult) Extract() (*Variable, error)

Jump to

Keyboard shortcuts

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