internal

package
v0.20.3 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Path              = "/rest/com/vmware"
	SessionPath       = "/cis/session"
	CategoryPath      = "/cis/tagging/category"
	TagPath           = "/cis/tagging/tag"
	AssociationPath   = "/cis/tagging/tag-association"
	SessionCookieName = "vmware-api-session-id"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AssociatedObject

type AssociatedObject struct {
	Type  string `json:"type"`
	Value string `json:"id"`
}

AssociatedObject is the same structure as types.ManagedObjectReference, just with a different field name (ID instead of Value). In the API we use mo.Reference, this type is only used for wire transfer.

func (AssociatedObject) Reference

Reference implements mo.Reference

type Association

type Association struct {
	ObjectID *AssociatedObject `json:"object_id,omitempty"`
}

Association for tag-association requests.

func NewAssociation

func NewAssociation(ref mo.Reference) Association

NewAssociation returns an Association, converting ref to an AssociatedObject.

type CloneURL

type CloneURL interface {
	URL() *url.URL
}

type Resource

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

Resource wraps url.URL with helpers

func URL

func URL(c CloneURL, path string) *Resource

func (*Resource) Request

func (r *Resource) Request(method string, body ...interface{}) *http.Request

Request returns a new http.Request for the given method. An optional body can be provided for POST and PATCH methods.

func (*Resource) WithAction

func (r *Resource) WithAction(action string) *Resource

WithAction sets adds action to the URL.RawQuery

func (*Resource) WithID

func (r *Resource) WithID(id string) *Resource

WithID appends id to the URL.Path

Jump to

Keyboard shortcuts

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