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: 2

Documentation

Overview

Package tags enables management and retrieval of Tags BMS service.

Example to Create a Tag

createOpts := tags.CreateOpts{
	Tag: []string{"__type_baremetal"},

}

tag, err := tags.Create(bmsClient, createOpts).Extract()
if err != nil {
	panic(err)
}

Example to Delete a Tag

serverID := "4e8e5957-649f-477b-9e5b-f1f75b21c03c"
err := tags.Delete(bmsClient, serverID).ExtractErr()
if err != nil {
	panic(err)
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateOpts

type CreateOpts struct {
	Tag []string `json:"tags" required:"true"`
}

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

func (CreateOpts) ToTagsCreateMap

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

ToTagsCreateMap builds a create request body from CreateOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToTagsCreateMap() (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
}

CreateResult represents the result of an create operation. Call its Extract method to interpret it as a Tag.

func Create

func Create(c *golangsdk.ServiceClient, serverId string, opts CreateOptsBuilder) (r CreateResult)

Create will create a new Tag 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() (*Tags, error)

Extract interprets any commonResult as a Tags.

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult represents the result of a delete operation. Call its ExtractErr method to determine if the request succeeded or failed.

func Delete

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

Delete will permanently delete a particular tag based on its unique ID.

type GetResult

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

GetResult represents the result of a get operation. Call its Extract method to interpret it as a Tag.

func Get

func Get(c *golangsdk.ServiceClient, serverId string) (r GetResult)

Get retrieves a particular tag based on its unique ID.

func (GetResult) Extract

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

Extract interprets any commonResult as a Tags.

type Tags

type Tags struct {
	//Specifies the tags of a BMS
	Tags []string `json:"tags"`
}

Jump to

Keyboard shortcuts

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