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 ¶
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.
type DeleteResult ¶
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.