tags

package
v0.0.0-...-d823fe1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RequestOpts golangsdk.RequestOpts = golangsdk.RequestOpts{
	MoreHeaders: map[string]string{"Content-Type": "application/json", "X-Language": "en-us"},
}

Functions

This section is empty.

Types

type ActionResults

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

func BatchAction

func BatchAction(client *golangsdk.ServiceClient, clusterID string, opts BatchOptsBuilder) (r ActionResults)

BatchAction is used to create ,update or delete the tags of a specified instance.

func (ActionResults) Extract

func (r ActionResults) Extract() (*RespTags, error)

type ActionType

type ActionType string

ActionType specifies the type of batch operation action to be performed

var (
	// ActionCreate is used to set action operator to create
	ActionCreate ActionType = "create"
	// ActionDelete is used to set action operator to delete
	ActionDelete ActionType = "delete"
)

type BatchOpts

type BatchOpts struct {
	//List of tags to perform batch operation
	Tags []Tag `json:"tags,omitempty"`
	//Operator , Possible values are:create, update,delete
	Action ActionType `json:"action" required:"true"`
}

BatchOpts contains all the values needed to perform BatchAction on the instance tags.

func (BatchOpts) ToTagsBatchMap

func (opts BatchOpts) ToTagsBatchMap() (map[string]interface{}, error)

ToTagsBatchMap builds a BatchAction request body from BatchOpts.

type BatchOptsBuilder

type BatchOptsBuilder interface {
	ToTagsBatchMap() (map[string]interface{}, error)
}

BatchOptsBuilder allows extensions to add additional parameters to the BatchAction request.

type GetResult

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

func Get

func Get(client *golangsdk.ServiceClient, clusterID string) (r GetResult)

Get retrieves the tags of a specific instance.

func (GetResult) Extract

func (r GetResult) Extract() (*RespTags, error)

type RespTags

type RespTags struct {
	//contains list of tags, i.e.key value pair
	Tags []Tag `json:"tags"`
}

type Tag

type Tag struct {
	//tag key
	Key string `json:"key" required:"true"`
	//tag value
	Value string `json:"value" required:"true"`
}

Tag is a structure of key value pair.

Jump to

Keyboard shortcuts

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