entity

package
v0.0.0-...-0015ee9 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: AGPL-3.0, Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthGroupURL

func AuthGroupURL(groupName string) *api.URL

AuthGroupURL returns an *api.URL to a group.

func CertificateURL

func CertificateURL(fingerprint string) *api.URL

CertificateURL returns an *api.URL to a certificate.

func IdentityProviderGroupURL

func IdentityProviderGroupURL(identityProviderGroupName string) *api.URL

IdentityProviderGroupURL returns an *api.URL to an identity provider group.

func IdentityURL

func IdentityURL(authenticationMethod string, identifier string) *api.URL

IdentityURL returns an *api.URL to an identity.

func ImageAliasURL

func ImageAliasURL(projectName string, imageAliasName string) *api.URL

ImageAliasURL returns an *api.URL to an image alias.

func ImageURL

func ImageURL(projectName string, imageName string) *api.URL

ImageURL returns an *api.URL to an image.

func InstanceURL

func InstanceURL(projectName string, instanceName string) *api.URL

InstanceURL returns an *api.URL to an instance.

func NetworkACLURL

func NetworkACLURL(projectName string, networkACLName string) *api.URL

NetworkACLURL returns an *api.URL to a network ACL.

func NetworkURL

func NetworkURL(projectName string, networkName string) *api.URL

NetworkURL returns an *api.URL to a network.

func NetworkZoneURL

func NetworkZoneURL(projectName string, networkZoneName string) *api.URL

NetworkZoneURL returns an *api.URL to a network zone.

func ProfileURL

func ProfileURL(projectName string, profileName string) *api.URL

ProfileURL returns an *api.URL to a profile.

func ProjectURL

func ProjectURL(projectName string) *api.URL

ProjectURL returns an *api.URL to a Project.

func ServerURL

func ServerURL() *api.URL

ServerURL returns an *api.URL to the server.

func StorageBucketURL

func StorageBucketURL(projectName string, location string, storagePoolName string, storageBucketName string) *api.URL

StorageBucketURL returns an *api.URL to a storage bucket.

func StoragePoolURL

func StoragePoolURL(storagePoolName string) *api.URL

StoragePoolURL returns an *api.URL to a storage pool.

func StorageVolumeURL

func StorageVolumeURL(projectName string, location string, storagePoolName string, storageVolumeType string, storageVolumeName string) *api.URL

StorageVolumeURL returns an *api.URL to a storage volume.

Types

type Type

type Type string

Type represents a resource type in LXD that is addressable via the API.

const (
	// TypeContainer represents container resources.
	TypeContainer Type = "container"

	// TypeImage represents image resources.
	TypeImage Type = "image"

	// TypeProfile represents profile resources.
	TypeProfile Type = "profile"

	// TypeProject represents project resources.
	TypeProject Type = "project"

	// TypeCertificate represents certificate resources.
	TypeCertificate Type = "certificate"

	// TypeInstance represents instance resources.
	TypeInstance Type = "instance"

	// TypeInstanceBackup represents instance backup resources.
	TypeInstanceBackup Type = "instance_backup"

	// TypeInstanceSnapshot represents instance snapshot resources.
	TypeInstanceSnapshot Type = "instance_snapshot"

	// TypeNetwork represents network resources.
	TypeNetwork Type = "network"

	// TypeNetworkACL represents network acl resources.
	TypeNetworkACL Type = "network_acl"

	// TypeNode represents node resources.
	TypeNode Type = "node"

	// TypeOperation represents operation resources.
	TypeOperation Type = "operation"

	// TypeStoragePool represents storage pool resources.
	TypeStoragePool Type = "storage_pool"

	// TypeStorageVolume represents storage volume resources.
	TypeStorageVolume Type = "storage_volume"

	// TypeStorageVolumeBackup represents storage volume backup resources.
	TypeStorageVolumeBackup Type = "storage_volume_backup"

	// TypeStorageVolumeSnapshot represents storage volume snapshot resources.
	TypeStorageVolumeSnapshot Type = "storage_volume_snapshot"

	// TypeWarning represents warning resources.
	TypeWarning Type = "warning"

	// TypeClusterGroup represents cluster group resources.
	TypeClusterGroup Type = "cluster_group"

	// TypeStorageBucket represents storage bucket resources.
	TypeStorageBucket Type = "storage_bucket"

	// TypeServer represents the top level /1.0 resource.
	TypeServer Type = "server"

	// TypeImageAlias represents image alias resources.
	TypeImageAlias Type = "image_alias"

	// TypeNetworkZone represents network zone resources.
	TypeNetworkZone Type = "network_zone"

	// TypeIdentity represents identity resources.
	TypeIdentity Type = "identity"

	// TypeAuthGroup represents authorization group resources.
	TypeAuthGroup Type = "group"

	// TypeIdentityProviderGroup represents identity provider group resources.
	TypeIdentityProviderGroup Type = "identity_provider_group"
)

func ParseURL

func ParseURL(u url.URL) (entityType Type, projectName string, location string, pathArguments []string, err error)

ParseURL parses a raw URL string and returns the Type, project, location, and path arguments (mux vars).

Path arguments are returned in the order they are found in the URL. If there is no project query parameter and the Type requires a project, then api.ProjectDefaultName is returned as the project name. The returned location is the value of the "target" query parameter. All returned values are unescaped.

func (Type) RequiresProject

func (t Type) RequiresProject() (bool, error)

RequiresProject returns true if an entity of the Type can only exist within the context of a project. Operations and warnings may still be project specific but it is not an absolute requirement.

func (Type) String

func (t Type) String() string

String implements fmt.Stringer for Type.

func (Type) URL

func (t Type) URL(projectName string, location string, pathArguments ...string) (*api.URL, error)

URL returns a string URL for the Type.

If the Type is project specific and no project name is given, the project name will be set to api.ProjectDefaultName.

Warning: All arguments to this function will be URL encoded. They must not be URL encoded before calling this method.

func (Type) Validate

func (t Type) Validate() error

Validate returns an error if the Type is not in the list of allowed types. If the allowEmpty argument is set to true an empty string is allowed. This is to accommodate that warnings may not refer to a specific entity type.

Jump to

Keyboard shortcuts

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