Documentation ¶
Index ¶
- Constants
- Variables
- func CreateAuthenticator(apiKey string, isIAMApiEndpoint string) (*core.IamAuthenticator, error)
- func CreateVpcService(apiKey string, isApiEndpoint string, isIAMApiEndpoint string) (*vpcv1.VpcV1, error)
- func CreateVpcServiceFromEnv(env E.Environment) (*vpcv1.VpcV1, error)
- func EnvFromDotEnv(root string) (env.Environment, error)
- func FindInstance(service *vpcv1.VpcV1, name string) (*vpcv1.Instance, error)
- func FindLatestStockImage(service *vpcv1.VpcV1) (string, error)
- func Findimage(service *vpcv1.VpcV1, name string) (string, error)
- func GetDefaultIBMCloudApiEndpoint(region string) string
- func GetIBMCloudApiEndpoint(env E.Environment, defEndpoint string) string
- func GetIBMCloudApiKey(env E.Environment) (string, error)
- func GetIBMCloudGtApiEndpoint(env E.Environment) string
- func GetIBMCloudIAMApiEndpoint(env E.Environment, defEndpoint string) string
- func GetRegion(env E.Environment) string
- func UnmarshalAttachTagsResponse(m map[string]json.RawMessage, result any) (err error)
- func UnmarshalTag(m map[string]json.RawMessage, result any) (err error)
- func UnmarshalTagCollection(m map[string]json.RawMessage, result any) (err error)
- func UnmarshalTagCollectionFirst(m map[string]json.RawMessage, result any) (err error)
- func UnmarshalTagCollectionNext(m map[string]json.RawMessage, result any) (err error)
- func UnmarshalTagResultsItem(m map[string]json.RawMessage, result any) (err error)
- type AttachTagsBody
- type AttachTagsOptions
- type AttachTagsResponse
- type GlobalTagging
- func (service *GlobalTagging) AttachTags(attachTagsOptions *AttachTagsOptions, payload *AttachTagsBody) (result *AttachTagsResponse, response *core.DetailedResponse, err error)
- func (service *GlobalTagging) AttachTagsContext(ctx context.Context, attachTagsOptions *AttachTagsOptions, ...) (result *AttachTagsResponse, response *core.DetailedResponse, err error)
- func (service *GlobalTagging) GetEnableGzipCompression() bool
- func (service *GlobalTagging) ListTags(listTagsOptions *ListTagsOptions) (result *TagCollection, response *core.DetailedResponse, err error)
- func (service *GlobalTagging) ListTagsWithContext(ctx context.Context, listTagsOptions *ListTagsOptions) (result *TagCollection, response *core.DetailedResponse, err error)
- func (service *GlobalTagging) NewTagsPager(options *ListTagsOptions) (pager *TagsPager, err error)
- type GlobalTaggingOptions
- type Image
- type ListTagsOptions
- type Resource
- type Tag
- type TagCollection
- type TagCollectionFirst
- type TagCollectionNext
- type TagResultsItem
- type TagsPager
- func (pager *TagsPager) GetAll() (allItems []Tag, err error)
- func (pager *TagsPager) GetAllWithContext(ctx context.Context) (allItems []Tag, err error)
- func (pager *TagsPager) GetNext() (page []Tag, err error)
- func (pager *TagsPager) GetNextWithContext(ctx context.Context) (page []Tag, err error)
- func (pager *TagsPager) HasNext() bool
Constants ¶
const ( DefaultIBMCloudIAMApiEndpoint = "https://iam.cloud.ibm.com" KeyIBMCloudIAMApiEndpoint = "IBMCLOUD_IAM_API_ENDPOINT" KeyIBMCloudApiKey = "IBMCLOUD_API_KEY" // #nosec )
const ( DefaultRegion = "us-south" KeyIBMCloudRegion = "IBMCLOUD_REGION" )
const ( KeyIBMCloudGtApiEndpoint = "IBMCLOUD_GT_API_ENDPOINT" DefaultIBMCloudGtApiEndpoint = "https://tags.global-search-tagging.cloud.ibm.com" )
const ( AttachTagsOptionsTagTypeService = "service" AttachTagsOptionsTagTypeUser = "user" )
const (
KeyIBMCloudIsApiEndpoint = "IBMCLOUD_IS_API_ENDPOINT"
)
Variables ¶
var ErrorStockImageNotFound = errors.New("stock image was not found")
var InstanceNotFound = errors.New("instance was not found")
Functions ¶
func CreateAuthenticator ¶
func CreateAuthenticator(apiKey string, isIAMApiEndpoint string) (*core.IamAuthenticator, error)
func CreateVpcService ¶
func CreateVpcServiceFromEnv ¶
func CreateVpcServiceFromEnv(env E.Environment) (*vpcv1.VpcV1, error)
func EnvFromDotEnv ¶
func EnvFromDotEnv(root string) (env.Environment, error)
func GetIBMCloudApiEndpoint ¶
func GetIBMCloudApiEndpoint(env E.Environment, defEndpoint string) string
func GetIBMCloudApiKey ¶
func GetIBMCloudApiKey(env E.Environment) (string, error)
func GetIBMCloudGtApiEndpoint ¶
func GetIBMCloudGtApiEndpoint(env E.Environment) string
func GetIBMCloudIAMApiEndpoint ¶
func GetIBMCloudIAMApiEndpoint(env E.Environment, defEndpoint string) string
func GetRegion ¶
func GetRegion(env E.Environment) string
func UnmarshalAttachTagsResponse ¶
func UnmarshalAttachTagsResponse(m map[string]json.RawMessage, result any) (err error)
UnmarshalAttachTagsResponse unmarshals an instance of VPC from the specified map of raw messages.
func UnmarshalTag ¶
func UnmarshalTag(m map[string]json.RawMessage, result any) (err error)
UnmarshalTag unmarshals an instance of Instance from the specified map of raw messages.
func UnmarshalTagCollection ¶
func UnmarshalTagCollection(m map[string]json.RawMessage, result any) (err error)
UnmarshalTagCollection unmarshals an instance of TagCollection from the specified map of raw messages.
func UnmarshalTagCollectionFirst ¶
func UnmarshalTagCollectionFirst(m map[string]json.RawMessage, result any) (err error)
UnmarshalTagCollectionFirst unmarshals an instance of TagCollectionFirst from the specified map of raw messages.
func UnmarshalTagCollectionNext ¶
func UnmarshalTagCollectionNext(m map[string]json.RawMessage, result any) (err error)
UnmarshalTagCollectionNext unmarshals an instance of TagCollectionNext from the specified map of raw messages.
func UnmarshalTagResultsItem ¶
func UnmarshalTagResultsItem(m map[string]json.RawMessage, result any) (err error)
UnmarshalTagResultsItem unmarshals an instance of VPC from the specified map of raw messages.
Types ¶
type AttachTagsBody ¶
type AttachTagsOptions ¶
type AttachTagsOptions struct { // The type of the tag. Supported values are user, service and access. service and access are not supported for IMS resources. TagType *string `json:"tag_type,omitempty"` // Allows users to set headers on API requests Headers map[string]string }
AttachTagsOptions : The AttachTags options.
type AttachTagsResponse ¶
type AttachTagsResponse struct {
Results []TagResultsItem `json:"results"`
}
type GlobalTagging ¶
type GlobalTagging struct { Service *core.BaseService // The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2022-09-13` // and today's date (UTC). Version *string // contains filtered or unexported fields }
func CreateGlobalTagging ¶
func CreateGlobalTagging(options *GlobalTaggingOptions) (service *GlobalTagging, err error)
CreateGlobalTagging : constructs an Tag of GlobalTagging with passed in options.
func CreateTaggingServiceFromEnv ¶
func CreateTaggingServiceFromEnv(env E.Environment) (*GlobalTagging, error)
func (*GlobalTagging) AttachTags ¶
func (service *GlobalTagging) AttachTags(attachTagsOptions *AttachTagsOptions, payload *AttachTagsBody) (result *AttachTagsResponse, response *core.DetailedResponse, err error)
ListTags : List all Tags This request lists all Tags in the region.
func (*GlobalTagging) AttachTagsContext ¶
func (service *GlobalTagging) AttachTagsContext(ctx context.Context, attachTagsOptions *AttachTagsOptions, payload *AttachTagsBody) (result *AttachTagsResponse, response *core.DetailedResponse, err error)
AttachTagsContext is an alternate form of the AttachTags method which supports a Context parameter
func (*GlobalTagging) GetEnableGzipCompression ¶
func (service *GlobalTagging) GetEnableGzipCompression() bool
GetEnableGzipCompression returns the service's EnableGzipCompression field
func (*GlobalTagging) ListTags ¶
func (service *GlobalTagging) ListTags(listTagsOptions *ListTagsOptions) (result *TagCollection, response *core.DetailedResponse, err error)
ListTags : List all Tags This request lists all Tags in the region.
func (*GlobalTagging) ListTagsWithContext ¶
func (service *GlobalTagging) ListTagsWithContext(ctx context.Context, listTagsOptions *ListTagsOptions) (result *TagCollection, response *core.DetailedResponse, err error)
ListTagsWithContext is an alternate form of the ListTags method which supports a Context parameter
func (*GlobalTagging) NewTagsPager ¶
func (service *GlobalTagging) NewTagsPager(options *ListTagsOptions) (pager *TagsPager, err error)
NewTagsPager returns a new TagsPager Tag.
type GlobalTaggingOptions ¶
type GlobalTaggingOptions struct { URL string Authenticator core.Authenticator // The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2022-09-13` // and today's date (UTC). Version *string }
type ListTagsOptions ¶
type ListTagsOptions struct { // A server-provided token determining what resource to start the page on. Start *string `json:"start,omitempty"` // The number of resources to return on a page. Limit *int64 `json:"limit,omitempty"` // The type of the tag you want to list. Supported values are user, service and access. TagType *string `json:"tag_type,omitempty"` // If you want to return only the list of tags that are attached to a specified resource, pass the ID of the resource on this parameter. For resources that are onboarded to Global Search and Tagging, the resource ID is the CRN; for IMS resources, it is the IMS ID. When using this parameter, you must specify the appropriate provider (ims or ghost). AttachedTo *string `json:"attached_to,omitempty"` // Select a provider. Supported values are ghost and ims. To list both Global Search and Tagging tags and infrastructure tags, use ghost,ims. service and access tags can only be attached to resources that are onboarded to Global Search and Tagging, so you should not set this parameter to list them. Providers []string `json:"providers,omitempty"` // Allows users to set headers on API requests Headers map[string]string }
ListTagsOptions : The ListTags options.
type TagCollection ¶
type TagCollection struct { // A link to the first page of resources. First *TagCollectionFirst `json:"first" validate:"required"` // Collection of virtual server Tags. Tags []Tag `json:"Tags" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` // A link to the next page of resources. This property is present for all pages // except the last page. Next *TagCollectionNext `json:"next,omitempty"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` }
TagCollection : TagCollection struct
type TagCollectionFirst ¶
type TagCollectionFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` }
TagCollectionFirst : A link to the first page of resources.
type TagCollectionNext ¶
type TagCollectionNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` }
TagCollectionNext : A link to the next page of resources. This property is present for all pages except the last page.
type TagResultsItem ¶
type TagsPager ¶
type TagsPager struct {
// contains filtered or unexported fields
}
TagsPager can be used to simplify the use of the "ListTags" method.
func (*TagsPager) GetAll ¶
GetAll invokes GetAllWithContext() using context.Background() as the Context parameter.
func (*TagsPager) GetAllWithContext ¶
GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly until all pages of results have been retrieved.
func (*TagsPager) GetNext ¶
GetNext invokes GetNextWithContext() using context.Background() as the Context parameter.
func (*TagsPager) GetNextWithContext ¶
GetNextWithContext returns the next page of results using the specified Context.