tags

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: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionResults

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

func BatchAction

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

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

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"
	// ActionUpdate is used to set action operator to update
	ActionUpdate ActionType = "update"
)

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 policy 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 CreateOpts

type CreateOpts struct {
	Tag Tag `json:"tag" required:"true"`
}

CreateOpts contains all the values needed to create or add a new tag.

func (CreateOpts) ToTagCreateMap

func (opts CreateOpts) ToTagCreateMap() (map[string]interface{}, error)

ToTagCreateMap builds a create request body from CreateOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToTagCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type CreateResult

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

func Create

func Create(client *golangsdk.ServiceClient, policyID string, opts CreateOptsBuilder) (r CreateResult)

Adds a tag to a backup policy based on the values in CreateOpts. To extract the tag object from the response, call the Extract method on the CreateResult.

func (CreateResult) Extract

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

type DeleteResult

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

func Delete

func Delete(c *golangsdk.ServiceClient, policyID string, key string) (r DeleteResult)

deletes a tag ,specified in the key for a backup policy.

func (DeleteResult) Extract

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

type GetResult

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

func Get

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

Get retrieves the tags of a specific backup policy.

func (GetResult) Extract

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

type ListOpts

type ListOpts struct {
	//Number of queried records. This parameter is not displayed if action is set to count.
	Limit string `json:"limit,omitempty"`
	//Query index,this parameter is not displayed if action is set to count.
	Offset string `json:"offset,omitempty"`
	//Backup policies with these tags will be filtered.
	// This list can have a maximum of 10 tags.
	Tags []Tags `json:"tags,omitempty"`
	//Backup policies with any tags in this list will be filtered.
	AnyTags []Tags `json:"tags_any,omitempty"`
	//Backup policies without these tags will be filtered.
	NotTags []Tags `json:"not_tags,omitempty"`
	//Backup policies without any of these tags will be filtered.
	NotAnyTags []Tags `json:"not_tags_any,omitempty"`
	//Operator. Possible values are filter and count.
	Action string `json:"action" required:"true"`
}

ListOpts contains all the values needed to ListResources the policy details based on tags.

func (ListOpts) ToTagsListMap

func (opts ListOpts) ToTagsListMap() (map[string]interface{}, error)

ToTagsListMap builds a ListResources request body from ListOpts.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToTagsListMap() (map[string]interface{}, error)
}

ListOptsBuilder allows extensions to add additional parameters to the ListResources request.

type QueryResults

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

func ListResources

func ListResources(client *golangsdk.ServiceClient, opts ListOptsBuilder) (r QueryResults)

ListResources retrives a backup policy details using tags.To extract the tag object from the response, call the ExtractResources method on the QueryResults.

func (QueryResults) Extract

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

func (QueryResults) ExtractResources

func (r QueryResults) ExtractResources() (*Resources, error)

type Resource

type Resource struct {
	//Resource name
	ResourceName string `json:"resource_name"`
	//Resource ID
	ResourceID string `json:"resource_id"`
	//List of tags
	Tags []Tag `json:"tags"`
}

type Resources

type Resources struct {
	//List of resources i.e. policies
	Resource []Resource `json:"resources"`
	//Total number of resources
	TotalCount int `json:"total_count"`
}

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, used for create , update and delete operations.

type Tags

type Tags struct {
	//Tag key
	Key string `json:"key" required:"true"`
	//list of values
	Values []string `json:"values" required:"true"`
}

Jump to

Keyboard shortcuts

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