Documentation ¶
Index ¶
- Constants
- Variables
- type AssociatedObject
- type Category
- type CategoryCreate
- type CategoryCreateSpec
- type CategoryUpdate
- type CategoryUpdateSpec
- type RestClient
- func (c *RestClient) AttachTagToObject(ctx context.Context, tagID string, objID string, objType string) error
- func (c *RestClient) CreateCategory(ctx context.Context, spec *CategoryCreateSpec) (*string, error)
- func (c *RestClient) CreateCategoryIfNotExist(ctx context.Context, name string, description string, categoryType string, ...) (*string, error)
- func (c *RestClient) CreateTag(ctx context.Context, spec *TagCreateSpec) (*string, error)
- func (c *RestClient) CreateTagIfNotExist(ctx context.Context, name string, description string, categoryID string) (*string, error)
- func (c *RestClient) DeleteCategory(ctx context.Context, id string) error
- func (c *RestClient) DeleteTag(ctx context.Context, id string) error
- func (c *RestClient) DeleteTagIfNoObjectAttached(ctx context.Context, id string) error
- func (c *RestClient) DetachTagFromObject(ctx context.Context, tagID string, objID string, objType string) error
- func (c *RestClient) GetAttachedTagsByNamePattern(ctx context.Context, namePattern string, objID string, objType string) ([]Tag, error)
- func (c *RestClient) GetCategoriesByName(ctx context.Context, name string) ([]Category, error)
- func (c *RestClient) GetCategory(ctx context.Context, id string) (*Category, error)
- func (c *RestClient) GetTag(ctx context.Context, id string) (*Tag, error)
- func (c *RestClient) GetTagByNameForCategory(ctx context.Context, name string, id string) ([]Tag, error)
- func (c *RestClient) ListAttachedObjects(ctx context.Context, tagID string) ([]AssociatedObject, error)
- func (c *RestClient) ListAttachedTags(ctx context.Context, objID string, objType string) ([]string, error)
- func (c *RestClient) ListCategories(ctx context.Context) ([]string, error)
- func (c *RestClient) ListTags(ctx context.Context) ([]string, error)
- func (c *RestClient) ListTagsForCategory(ctx context.Context, id string) ([]string, error)
- func (c *RestClient) Login(ctx context.Context) error
- func (c *RestClient) SessionID() string
- func (c *RestClient) UpdateCategory(ctx context.Context, id string, spec *CategoryUpdateSpec) error
- func (c *RestClient) UpdateTag(ctx context.Context, id string, spec *TagUpdateSpec) error
- func (c *RestClient) Valid(ctx context.Context) bool
- type Tag
- type TagAssociationSpec
- type TagCreate
- type TagCreateSpec
- type TagUpdate
- type TagUpdateSpec
Constants ¶
const ( CategoryURL = "/com/vmware/cis/tagging/category" ErrAlreadyExists = "already_exists" )
const (
RestPrefix = "/rest"
)
const (
TagAssociationURL = "/com/vmware/cis/tagging/tag-association"
)
const (
TagURL = "/com/vmware/cis/tagging/tag"
)
Variables ¶
var Logger = logrus.New()
Functions ¶
This section is empty.
Types ¶
type AssociatedObject ¶
type CategoryCreate ¶
type CategoryCreateSpec ¶
type CategoryCreateSpec struct {
CreateSpec CategoryCreate `json:"create_spec"`
}
type CategoryUpdate ¶
type CategoryUpdateSpec ¶
type CategoryUpdateSpec struct {
UpdateSpec CategoryUpdate `json:"update_spec"`
}
type RestClient ¶
func NewClientWithSessionID ¶
func NewClientWithSessionID(u *url.URL, insecure bool, thumbprint string, sessionID string) *RestClient
NewClientWithSessionID creates a new REST client with a supplied session ID to re-connect to existing sessions.
Note that the session is not checked for validity - to check for a valid session after creating the client, use the Valid method. If the session is no longer valid and the session needs to be re-saved, Login should be called again before calling SessionID to extract the new session ID. Clients created with this function function work in the exact same way as clients created with NewClient, including supporting re-login on invalid sessions on all SDK calls.
func (*RestClient) AttachTagToObject ¶
func (*RestClient) CreateCategory ¶
func (c *RestClient) CreateCategory(ctx context.Context, spec *CategoryCreateSpec) (*string, error)
func (*RestClient) CreateCategoryIfNotExist ¶
func (*RestClient) CreateTag ¶
func (c *RestClient) CreateTag(ctx context.Context, spec *TagCreateSpec) (*string, error)
func (*RestClient) CreateTagIfNotExist ¶
func (*RestClient) DeleteCategory ¶
func (c *RestClient) DeleteCategory(ctx context.Context, id string) error
func (*RestClient) DeleteTagIfNoObjectAttached ¶
func (c *RestClient) DeleteTagIfNoObjectAttached(ctx context.Context, id string) error
func (*RestClient) DetachTagFromObject ¶
func (*RestClient) GetAttachedTagsByNamePattern ¶
func (c *RestClient) GetAttachedTagsByNamePattern(ctx context.Context, namePattern string, objID string, objType string) ([]Tag, error)
Get attached tags through tag name pattern
func (*RestClient) GetCategoriesByName ¶
func (*RestClient) GetCategory ¶
func (*RestClient) GetTagByNameForCategory ¶
func (c *RestClient) GetTagByNameForCategory(ctx context.Context, name string, id string) ([]Tag, error)
Get tag through tag name and category id
func (*RestClient) ListAttachedObjects ¶
func (c *RestClient) ListAttachedObjects(ctx context.Context, tagID string) ([]AssociatedObject, error)
func (*RestClient) ListAttachedTags ¶
func (*RestClient) ListCategories ¶
func (c *RestClient) ListCategories(ctx context.Context) ([]string, error)
func (*RestClient) ListTagsForCategory ¶
func (*RestClient) SessionID ¶
func (c *RestClient) SessionID() string
SessionID returns the current session ID of the REST client. An empty string means there was no session cookie currently loaded.
func (*RestClient) UpdateCategory ¶
func (c *RestClient) UpdateCategory(ctx context.Context, id string, spec *CategoryUpdateSpec) error
func (*RestClient) UpdateTag ¶
func (c *RestClient) UpdateTag(ctx context.Context, id string, spec *TagUpdateSpec) error
type TagAssociationSpec ¶
type TagAssociationSpec struct { ObjectID *AssociatedObject `json:"object_id,omitempty"` TagID *string `json:"tag_id,omitempty"` }
type TagCreateSpec ¶
type TagCreateSpec struct {
CreateSpec TagCreate `json:"create_spec"`
}
type TagUpdateSpec ¶
type TagUpdateSpec struct {
UpdateSpec TagUpdate `json:"update_spec"`
}