globaltaggingv1

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: Apache-2.0 Imports: 6 Imported by: 18

Documentation

Overview

Package globaltaggingv1 : Operations and models for the GlobalTaggingV1 service

Index

Constants

View Source
const (
	DeleteTagAllOptions_Providers_Ghost = "ghost"
	DeleteTagAllOptions_Providers_Ims   = "ims"
)

Constants associated with the DeleteTagAllOptions.Providers property. Select a provider. Supported values are `ghost` and `ims`.

View Source
const (
	DeleteTagOptions_Providers_Ghost = "ghost"
	DeleteTagOptions_Providers_Ims   = "ims"
)

Constants associated with the DeleteTagOptions.Providers property.

View Source
const (
	DeleteTagResultsItem_Provider_Ghost = "ghost"
	DeleteTagResultsItem_Provider_Ims   = "ims"
)

Constants associated with the DeleteTagResultsItem.Provider property. The provider of the tag.

View Source
const (
	ListTagsOptions_Providers_Ghost = "ghost"
	ListTagsOptions_Providers_Ims   = "ims"
)

Constants associated with the ListTagsOptions.Providers property.

View Source
const (
	ListTagsOptions_OrderByName_Asc  = "asc"
	ListTagsOptions_OrderByName_Desc = "desc"
)

Constants associated with the ListTagsOptions.OrderByName property. Order the output by tag name.

View Source
const DefaultServiceName = "global_tagging"

DefaultServiceName is the default key used to find external configuration information.

View Source
const DefaultServiceURL = "https://tags.global-search-tagging.cloud.ibm.com/"

DefaultServiceURL is the default URL to make service requests to.

Variables

This section is empty.

Functions

func UnmarshalDeleteTagResults

func UnmarshalDeleteTagResults(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalDeleteTagResults unmarshals an instance of DeleteTagResults from the specified map of raw messages.

func UnmarshalDeleteTagResultsItem

func UnmarshalDeleteTagResultsItem(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalDeleteTagResultsItem unmarshals an instance of DeleteTagResultsItem from the specified map of raw messages.

func UnmarshalDeleteTagsResult

func UnmarshalDeleteTagsResult(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalDeleteTagsResult unmarshals an instance of DeleteTagsResult from the specified map of raw messages.

func UnmarshalDeleteTagsResultItem

func UnmarshalDeleteTagsResultItem(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalDeleteTagsResultItem unmarshals an instance of DeleteTagsResultItem from the specified map of raw messages.

func UnmarshalResource added in v0.3.0

func UnmarshalResource(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalResource unmarshals an instance of Resource from the specified map of raw messages.

func UnmarshalTag

func UnmarshalTag(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalTag unmarshals an instance of Tag from the specified map of raw messages.

func UnmarshalTagList

func UnmarshalTagList(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalTagList unmarshals an instance of TagList from the specified map of raw messages.

func UnmarshalTagResults

func UnmarshalTagResults(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalTagResults unmarshals an instance of TagResults from the specified map of raw messages.

func UnmarshalTagResultsItem

func UnmarshalTagResultsItem(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalTagResultsItem unmarshals an instance of TagResultsItem from the specified map of raw messages.

Types

type AttachTagOptions

type AttachTagOptions struct {
	// List of resources on which the tag or tags should be attached.
	Resources []Resource `json:"resources" validate:"required"`

	// The name of the tag to attach.
	TagName *string `json:"tag_name,omitempty"`

	// An array of tag names to attach.
	TagNames []string `json:"tag_names,omitempty"`

	// Allows users to set headers on API requests
	Headers map[string]string
}

AttachTagOptions : The AttachTag options.

func (*AttachTagOptions) SetHeaders

func (options *AttachTagOptions) SetHeaders(param map[string]string) *AttachTagOptions

SetHeaders : Allow user to set Headers

func (*AttachTagOptions) SetResources

func (options *AttachTagOptions) SetResources(resources []Resource) *AttachTagOptions

SetResources : Allow user to set Resources

func (*AttachTagOptions) SetTagName

func (options *AttachTagOptions) SetTagName(tagName string) *AttachTagOptions

SetTagName : Allow user to set TagName

func (*AttachTagOptions) SetTagNames

func (options *AttachTagOptions) SetTagNames(tagNames []string) *AttachTagOptions

SetTagNames : Allow user to set TagNames

type DeleteTagAllOptions

type DeleteTagAllOptions struct {
	// Select a provider. Supported values are `ghost` and `ims`.
	Providers *string `json:"providers,omitempty"`

	// Allows users to set headers on API requests
	Headers map[string]string
}

DeleteTagAllOptions : The DeleteTagAll options.

func (*DeleteTagAllOptions) SetHeaders

func (options *DeleteTagAllOptions) SetHeaders(param map[string]string) *DeleteTagAllOptions

SetHeaders : Allow user to set Headers

func (*DeleteTagAllOptions) SetProviders

func (options *DeleteTagAllOptions) SetProviders(providers string) *DeleteTagAllOptions

SetProviders : Allow user to set Providers

type DeleteTagOptions

type DeleteTagOptions struct {
	// The name of tag to be deleted.
	TagName *string `json:"tag_name" validate:"required"`

	// Select a provider. Supported values are `ghost` and `ims`. To delete tag both in GhoST in IMS, use `ghost,ims`.
	Providers []string `json:"providers,omitempty"`

	// Allows users to set headers on API requests
	Headers map[string]string
}

DeleteTagOptions : The DeleteTag options.

func (*DeleteTagOptions) SetHeaders

func (options *DeleteTagOptions) SetHeaders(param map[string]string) *DeleteTagOptions

SetHeaders : Allow user to set Headers

func (*DeleteTagOptions) SetProviders

func (options *DeleteTagOptions) SetProviders(providers []string) *DeleteTagOptions

SetProviders : Allow user to set Providers

func (*DeleteTagOptions) SetTagName

func (options *DeleteTagOptions) SetTagName(tagName string) *DeleteTagOptions

SetTagName : Allow user to set TagName

type DeleteTagResults

type DeleteTagResults struct {
	// Array of results of a delete_tag request.
	Results []DeleteTagResultsItem `json:"results,omitempty"`
}

DeleteTagResults : Results of a delete_tag request.

type DeleteTagResultsItem

type DeleteTagResultsItem struct {
	// The provider of the tag.
	Provider *string `json:"provider,omitempty"`

	// It is `true` if the operation exits with an error.
	IsError *bool `json:"is_error,omitempty"`
	// contains filtered or unexported fields
}

DeleteTagResultsItem : Result of a delete_tag request.

func (*DeleteTagResultsItem) GetProperties

func (o *DeleteTagResultsItem) GetProperties() map[string]interface{}

GetProperties allows the user to retrieve the map of arbitrary properties from an instance of DeleteTagResultsItem

func (*DeleteTagResultsItem) GetProperty

func (o *DeleteTagResultsItem) GetProperty(key string) interface{}

GetProperty allows the user to retrieve an arbitrary property from an instance of DeleteTagResultsItem

func (*DeleteTagResultsItem) MarshalJSON

func (o *DeleteTagResultsItem) MarshalJSON() (buffer []byte, err error)

MarshalJSON performs custom serialization for instances of DeleteTagResultsItem

func (*DeleteTagResultsItem) SetProperty

func (o *DeleteTagResultsItem) SetProperty(key string, value interface{})

SetProperty allows the user to set an arbitrary property on an instance of DeleteTagResultsItem

type DeleteTagsResult

type DeleteTagsResult struct {
	// The number of tags deleted in the account.
	TotalCount *int64 `json:"total_count,omitempty"`

	// An indicator that is set to true if there was an error deleting some of the tags.
	Errors *bool `json:"errors,omitempty"`

	Items []DeleteTagsResultItem `json:"items,omitempty"`
}

DeleteTagsResult : The results of a deleting unattatched tags.

type DeleteTagsResultItem

type DeleteTagsResultItem struct {
	// The name of the tag that was deleted.
	TagName *string `json:"tag_name,omitempty"`

	// An indicator that is set to true if there was an error deleting the tag.
	IsError *bool `json:"is_error,omitempty"`
}

DeleteTagsResultItem : Result of deleting one unattached tag.

type DetachTagOptions

type DetachTagOptions struct {
	// List of resources on which the tag or tags should be detached.
	Resources []Resource `json:"resources" validate:"required"`

	// The name of the tag to detach.
	TagName *string `json:"tag_name,omitempty"`

	// An array of tag names to detach.
	TagNames []string `json:"tag_names,omitempty"`

	// Allows users to set headers on API requests
	Headers map[string]string
}

DetachTagOptions : The DetachTag options.

func (*DetachTagOptions) SetHeaders

func (options *DetachTagOptions) SetHeaders(param map[string]string) *DetachTagOptions

SetHeaders : Allow user to set Headers

func (*DetachTagOptions) SetResources

func (options *DetachTagOptions) SetResources(resources []Resource) *DetachTagOptions

SetResources : Allow user to set Resources

func (*DetachTagOptions) SetTagName

func (options *DetachTagOptions) SetTagName(tagName string) *DetachTagOptions

SetTagName : Allow user to set TagName

func (*DetachTagOptions) SetTagNames

func (options *DetachTagOptions) SetTagNames(tagNames []string) *DetachTagOptions

SetTagNames : Allow user to set TagNames

type GlobalTaggingV1

type GlobalTaggingV1 struct {
	Service *core.BaseService
}

GlobalTaggingV1 : Manage your tags with the Tagging API in IBM Cloud. You can attach, detach, delete a tag or list all tags in your billing account with the Tagging API. The tag name must be unique within a billing account. You can create tags in two formats: `key:value` or `label`.

Version: 1.0.3

func NewGlobalTaggingV1

func NewGlobalTaggingV1(options *GlobalTaggingV1Options) (service *GlobalTaggingV1, err error)

NewGlobalTaggingV1 : constructs an instance of GlobalTaggingV1 with passed in options.

func NewGlobalTaggingV1UsingExternalConfig

func NewGlobalTaggingV1UsingExternalConfig(options *GlobalTaggingV1Options) (globalTagging *GlobalTaggingV1, err error)

NewGlobalTaggingV1UsingExternalConfig : constructs an instance of GlobalTaggingV1 with passed in options and external configuration.

func (*GlobalTaggingV1) AttachTag

func (globalTagging *GlobalTaggingV1) AttachTag(attachTagOptions *AttachTagOptions) (result *TagResults, response *core.DetailedResponse, err error)

AttachTag : Attach one or more tags Attaches one or more tags to one or more resources. To attach a tag to a resource managed by the Resource Controller, you must be an editor on the resource. To attach a tag to a Cloud Foundry resource, you must have space developer role. To attach a tag to IMS resources, depending on the resource, you need either `view hardware details`, `view virtual server details` or `manage storage` permission.

func (*GlobalTaggingV1) DeleteTag

func (globalTagging *GlobalTaggingV1) DeleteTag(deleteTagOptions *DeleteTagOptions) (result *DeleteTagResults, response *core.DetailedResponse, err error)

DeleteTag : Delete a tag Delete an existing tag. A tag can be deleted only if it is not attached to any resource.

func (*GlobalTaggingV1) DeleteTagAll

func (globalTagging *GlobalTaggingV1) DeleteTagAll(deleteTagAllOptions *DeleteTagAllOptions) (result *DeleteTagsResult, response *core.DetailedResponse, err error)

DeleteTagAll : Delete unused tags Delete the tags that are not attatched to any resource.

func (*GlobalTaggingV1) DetachTag

func (globalTagging *GlobalTaggingV1) DetachTag(detachTagOptions *DetachTagOptions) (result *TagResults, response *core.DetailedResponse, err error)

DetachTag : Detach one or more tags Detach one or more tags from one or more resources. To detach a tag from a Resource Controller managed resource, you must be an editor on the resource. To detach a tag to a Cloud Foundry resource, you must have `space developer` role.

To detach a tag to IMS resources, depending on the resource, you need either `view hardware details`, `view virtual

server details` or `storage manage` permission.

func (*GlobalTaggingV1) ListTags

func (globalTagging *GlobalTaggingV1) ListTags(listTagsOptions *ListTagsOptions) (result *TagList, response *core.DetailedResponse, err error)

ListTags : Get all tags Lists all tags in a billing account. Use the `attached_to` parameter to return the list of tags attached to the specified resource.

func (*GlobalTaggingV1) NewAttachTagOptions

func (*GlobalTaggingV1) NewAttachTagOptions(resources []Resource) *AttachTagOptions

NewAttachTagOptions : Instantiate AttachTagOptions

func (*GlobalTaggingV1) NewDeleteTagAllOptions

func (*GlobalTaggingV1) NewDeleteTagAllOptions() *DeleteTagAllOptions

NewDeleteTagAllOptions : Instantiate DeleteTagAllOptions

func (*GlobalTaggingV1) NewDeleteTagOptions

func (*GlobalTaggingV1) NewDeleteTagOptions(tagName string) *DeleteTagOptions

NewDeleteTagOptions : Instantiate DeleteTagOptions

func (*GlobalTaggingV1) NewDetachTagOptions

func (*GlobalTaggingV1) NewDetachTagOptions(resources []Resource) *DetachTagOptions

NewDetachTagOptions : Instantiate DetachTagOptions

func (*GlobalTaggingV1) NewListTagsOptions

func (*GlobalTaggingV1) NewListTagsOptions() *ListTagsOptions

NewListTagsOptions : Instantiate ListTagsOptions

func (*GlobalTaggingV1) NewResource

func (*GlobalTaggingV1) NewResource(resourceID string) (model *Resource, err error)

NewResource : Instantiate Resource (Generic Model Constructor)

func (*GlobalTaggingV1) SetServiceURL

func (globalTagging *GlobalTaggingV1) SetServiceURL(url string) error

SetServiceURL sets the service URL

type GlobalTaggingV1Options

type GlobalTaggingV1Options struct {
	ServiceName   string
	URL           string
	Authenticator core.Authenticator
}

GlobalTaggingV1Options : Service options

type ListTagsOptions

type ListTagsOptions struct {
	// Select a provider. Supported values are `ghost` and `ims`. To list GhoST tags and infrastructure tags use
	// `ghost,ims`.
	Providers []string `json:"providers,omitempty"`

	// If you want to return only the list of tags attached to a specified resource, pass here the ID of the resource. For
	// GhoST onboarded resources, the resource ID is the CRN; for IMS resources, it is the IMS ID. When using this
	// parameter it is mandatory to specify the appropriate provider (`ims` or `ghost`).
	AttachedTo *string `json:"attached_to,omitempty"`

	// If set to `true`, this query returns the provider, `ghost`, `ims` or `ghost,ims`, where the tag exists and the
	// number of attached resources.
	FullData *bool `json:"full_data,omitempty"`

	// The offset is the index of the item from which you want to start returning data from.
	Offset *int64 `json:"offset,omitempty"`

	// The number of tags to return.
	Limit *int64 `json:"limit,omitempty"`

	// Order the output by tag name.
	OrderByName *string `json:"order_by_name,omitempty"`

	// The search timeout bounds the search request to be executed within the specified time value. It returns the hits
	// accumulated until time runs out.
	Timeout *int64 `json:"timeout,omitempty"`

	// Filter on attached tags. If true, returns only tags that are attached to one or more resources. If false returns all
	// tags.
	AttachedOnly *bool `json:"attached_only,omitempty"`

	// Allows users to set headers on API requests
	Headers map[string]string
}

ListTagsOptions : The ListTags options.

func (*ListTagsOptions) SetAttachedOnly

func (options *ListTagsOptions) SetAttachedOnly(attachedOnly bool) *ListTagsOptions

SetAttachedOnly : Allow user to set AttachedOnly

func (*ListTagsOptions) SetAttachedTo

func (options *ListTagsOptions) SetAttachedTo(attachedTo string) *ListTagsOptions

SetAttachedTo : Allow user to set AttachedTo

func (*ListTagsOptions) SetFullData

func (options *ListTagsOptions) SetFullData(fullData bool) *ListTagsOptions

SetFullData : Allow user to set FullData

func (*ListTagsOptions) SetHeaders

func (options *ListTagsOptions) SetHeaders(param map[string]string) *ListTagsOptions

SetHeaders : Allow user to set Headers

func (*ListTagsOptions) SetLimit

func (options *ListTagsOptions) SetLimit(limit int64) *ListTagsOptions

SetLimit : Allow user to set Limit

func (*ListTagsOptions) SetOffset

func (options *ListTagsOptions) SetOffset(offset int64) *ListTagsOptions

SetOffset : Allow user to set Offset

func (*ListTagsOptions) SetOrderByName

func (options *ListTagsOptions) SetOrderByName(orderByName string) *ListTagsOptions

SetOrderByName : Allow user to set OrderByName

func (*ListTagsOptions) SetProviders

func (options *ListTagsOptions) SetProviders(providers []string) *ListTagsOptions

SetProviders : Allow user to set Providers

func (*ListTagsOptions) SetTimeout

func (options *ListTagsOptions) SetTimeout(timeout int64) *ListTagsOptions

SetTimeout : Allow user to set Timeout

type Resource

type Resource struct {
	// The CRN or IMS ID of the resource.
	ResourceID *string `json:"resource_id" validate:"required"`

	// The IMS resource type of the resource.
	ResourceType *string `json:"resource_type,omitempty"`
}

Resource : A resource that may have attached tags.

type Tag

type Tag struct {
	// This is the name of the tag.
	Name *string `json:"name" validate:"required"`
}

Tag : A tag.

type TagList

type TagList struct {
	// The number of tags defined in the account.
	TotalCount *int64 `json:"total_count,omitempty"`

	// The offset specific at input time.
	Offset *int64 `json:"offset,omitempty"`

	// The limit specified at input time.
	Limit *int64 `json:"limit,omitempty"`

	// This is an array of output results.
	Items []Tag `json:"items,omitempty"`
}

TagList : A list of tags.

type TagResults

type TagResults struct {
	// Array of results of an attach_tag or detach_tag request.
	Results []TagResultsItem `json:"results,omitempty"`
}

TagResults : Results of an attach_tag or detach_tag request.

type TagResultsItem

type TagResultsItem struct {
	// The CRN or IMS ID of the resource.
	ResourceID *string `json:"resource_id" validate:"required"`

	// It is `true` if the operation exits with an error.
	IsError *bool `json:"is_error,omitempty"`
}

TagResultsItem : Result of an attach_tag or detach_tag request for a tagged resource.

Jump to

Keyboard shortcuts

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