v1

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: Apache-2.0 Imports: 12 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListTags added in v0.4.4

func ListTags(ctx context.Context, a types.API, obj types.IdentifiedObject) ([]string, error)

ListTags retrieves tags of given object

func Tag added in v0.4.4

func Tag(ctx context.Context, a types.API, obj types.IdentifiedObject, tags ...string) error

Tag adds tags to an object resource

func Untag added in v0.4.4

func Untag(ctx context.Context, a types.API, obj types.IdentifiedObject, tags ...string) error

Untag removes tags from an object resource

Types

type Location added in v0.4.1

type Location struct {
	Identifier  string  `json:"identifier" anxcloud:"identifier"`
	Code        string  `json:"code"`
	Name        string  `json:"name"`
	CountryCode string  `json:"country"`
	CityCode    string  `json:"city_code"`
	Latitude    *string `json:"lat"`
	Longitude   *string `json:"lon"`
}

Location describes a Anexia site where resources can be deployed.

func (*Location) EndpointURL added in v0.4.1

func (l *Location) EndpointURL(ctx context.Context) (*url.URL, error)

EndpointURL returns the default URL for core location operations. It supports Get by-code if `Code` is set and `Identifier` is not.

func (*Location) GetIdentifier added in v0.4.5

func (l *Location) GetIdentifier(ctx context.Context) (string, error)

GetIdentifier returns the objects identifier

type Resource added in v0.4.2

type Resource struct {
	Identifier string          `json:"identifier" anxcloud:"identifier"`
	Name       string          `json:"name"`
	Type       Type            `json:"resource_type"`
	Tags       []string        `json:"tags"`
	Attributes json.RawMessage `json:"attributes"`
}

Resource contains all information about a resource.

func (*Resource) DecodeAPIResponse added in v0.4.2

func (r *Resource) DecodeAPIResponse(ctx context.Context, data io.Reader) error

func (Resource) EndpointURL added in v0.4.2

func (r Resource) EndpointURL(ctx context.Context) (*url.URL, error)

func (*Resource) GetIdentifier added in v0.4.5

func (o *Resource) GetIdentifier(ctx context.Context) (string, error)

GetIdentifier returns the primary identifier of a Resource object

type ResourceWithTag added in v0.4.2

type ResourceWithTag struct {
	// Identifier of the Resource which tags to change
	Identifier string `anxcloud:"identifier"`

	// Name of the Tag to add or remove from the resource
	Tag string
}

ResourceWithTag is a virtual Object used to add (Create) or remove (Destroy) a tag to/from a Resource.

func (ResourceWithTag) EndpointURL added in v0.4.2

func (rwt ResourceWithTag) EndpointURL(ctx context.Context) (*url.URL, error)

func (ResourceWithTag) FilterAPIRequestBody added in v0.4.3

func (rwt ResourceWithTag) FilterAPIRequestBody(ctx context.Context) (interface{}, error)

func (ResourceWithTag) FilterAPIResponse added in v0.4.2

func (rwt ResourceWithTag) FilterAPIResponse(ctx context.Context, res *http.Response) (*http.Response, error)

func (ResourceWithTag) FilterRequestURL added in v0.4.3

func (rwt ResourceWithTag) FilterRequestURL(ctx context.Context, url *url.URL) (*url.URL, error)

func (*ResourceWithTag) GetIdentifier added in v0.4.5

func (o *ResourceWithTag) GetIdentifier(ctx context.Context) (string, error)

GetIdentifier returns the primary identifier of a ResourceWithTag object

type Type

type Type struct {
	Identifier string `json:"identifier"`
	Name       string `json:"name"`
}

Type is part of info.

Directories

Path Synopsis
Package helper exists to break a circular-dependency between pkg/api and pkg/apis/core/v1, that was introduced when adding the AutoTag option to the generic client.
Package helper exists to break a circular-dependency between pkg/api and pkg/apis/core/v1, that was introduced when adding the AutoTag option to the generic client.

Jump to

Keyboard shortcuts

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