resources

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AggregateHosts

func AggregateHosts() *schema.Table

func Aggregates

func Aggregates() *schema.Table

func AttachmentHosts

func AttachmentHosts() *schema.Table

func Attachments

func Attachments() *schema.Table

func ExtractFlavorAccessInto

func ExtractFlavorAccessInto(r pagination.Page, v interface{}) error

func ExtractFlavorsExtraSpecsAsMap

func ExtractFlavorsExtraSpecsAsMap(r flavors.ListExtraSpecsResult) (*map[string]string, error)

func ExtractFlavorsInto

func ExtractFlavorsInto(r pagination.Page, v interface{}) error

func ExtractUsersInto

func ExtractUsersInto(r pagination.Page, v interface{}) error

func FlavorAccesses

func FlavorAccesses() *schema.Table

func FlavorExtraSpecs

func FlavorExtraSpecs() *schema.Table

func Flavors

func Flavors() *schema.Table

func Hypervisors

func Hypervisors() *schema.Table

func ImageMetadata

func ImageMetadata() *schema.Table

func ImageProperties

func ImageProperties() *schema.Table

func ImageTags

func ImageTags() *schema.Table

func Images

func Images() *schema.Table

func InstanceAddresses

func InstanceAddresses() *schema.Table

func InstanceAttachedVolumes

func InstanceAttachedVolumes() *schema.Table

func InstanceFlavorExtraSpecs

func InstanceFlavorExtraSpecs() *schema.Table

func InstanceFlavors

func InstanceFlavors() *schema.Table

func InstanceMetadata

func InstanceMetadata() *schema.Table

func InstanceSecurityGroups

func InstanceSecurityGroups() *schema.Table

func InstanceTags

func InstanceTags() *schema.Table

func Instances

func Instances() *schema.Table

func NetworkSubnets

func NetworkSubnets() *schema.Table

func NetworkTags

func NetworkTags() *schema.Table

func Networks

func Networks() *schema.Table

func Ports

func Ports() *schema.Table

func ProjectLimits

func ProjectLimits() *schema.Table

func Projects

func Projects() *schema.Table

func SecurityGroupRules

func SecurityGroupRules() *schema.Table

func SecurityGroups

func SecurityGroups() *schema.Table

func UserKeyPairs

func UserKeyPairs() *schema.Table

func Users

func Users() *schema.Table

func Volumes

func Volumes() *schema.Table

Types

type Address

type Address struct {
	Network    *string `json:"-" cq-name:"network"`
	MACAddress string  `json:"OS-EXT-IPS-MAC:mac_addr" cq-name:"mac_address"`
	IPType     string  `json:"OS-EXT-IPS:type" cq-name:"type"`
	IPAddress  string  `json:"addr" cq-name:"ip_address"`
	IPVersion  int     `json:"version" cq-name:"ip_version"`
}

type Attachment

type Attachment struct {
	ID             string `json:"id"`
	AttachedAt     Time   `json:"attached_at"`
	DetachedAt     Time   `json:"detached_at"`
	AttachmentID   string `json:"attachment_id"`
	VolumeID       string `json:"volume_id"`
	Instance       string `json:"instance" cq-name:"instance_id"`
	Status         string `json:"status"`
	AttachMode     string `json:"attach_mode"`
	ProjectID      string `json:"-" cq-name:"project_id"`
	ConnectionInfo struct {
		AccessMode       string   `json:"access_mode"`
		AttachmentID     string   `json:"attachment_id"`
		AuthEnabled      bool     `json:"auth_enabled"`
		AuthUsername     string   `json:"auth_username"`
		ClusterName      string   `json:"cluster_name"`
		Discard          bool     `json:"discard"`
		DriverVolumeType string   `json:"driver_volume_type"`
		Encrypted        bool     `json:"encrypted"`
		Hosts            []string `json:"hosts"`
		Keyring          string   `json:"keyring"`
		Name             string   `json:"name"`
		Ports            []string `json:"ports"`
		SecretType       string   `json:"secret_type"`
		SecretUUID       string   `json:"secret_uuid"`
		VolumeID         string   `json:"volume_id"`
	} `json:"connection_info"`
}

type Flavor

type Flavor struct {
	ID            *string               `json:"id,omitempty"`
	Disk          int                   `json:"disk"`
	RAM           int                   `json:"ram"`
	Name          string                `json:"name"`
	RxTxFactor    *float64              `json:"rxtx_factor"`
	Swap          int                   `json:"-"`
	VCPUs         int                   `json:"vcpus"`
	IsPublic      *bool                 `json:"os-flavor-access:is_public" cq-name:"is_public"`
	Ephemeral     int                   `json:"OS-FLV-EXT-DATA:ephemeral" cq-name:"ephemeral"`
	Description   *string               `json:"description"` // new in version 2.55
	ExtraSpecsRaw json.RawMessage       `json:"extra_specs"`
	ExtraSpecsObj *FlavorExtraSpecsData `json:"-" cq-name:"extra_specs"`
	ExtraSpecsMap *map[string]string    `json:"-"`
}

func (*Flavor) UnmarshalJSON

func (r *Flavor) UnmarshalJSON(b []byte) error

type FlavorAccess

type FlavorAccess struct {
	FlavorID string `json:"flavor_id"`
	TenantID string `json:"tenant_id" cq-name:"project_id"`
}

type FlavorExtraSpecsData

type FlavorExtraSpecsData struct {
	CPUCores        string `json:"hw:cpu_cores"`
	CPUSockets      string `json:"hw:cpu_sockets"`
	RNGAllowed      string `json:"hw_rng:allowed"`
	WatchdogAction  string `json:"hw:watchdog_action"`
	VGPUs           string `json:"resources:VGPU"`
	TraitCustomVGPU string `json:"trait:CUSTOM_VGPU"`
}

type Host

type Host struct {
	Host string `cq-name:"host"`
	Port string `cq-name:"port" cq-type:"int"`
}

type Instance

type Instance struct {
	ID           string               `json:"id"`
	TenantID     string               `json:"tenant_id"`
	UserID       string               `json:"user_id"`
	Name         string               `json:"name"`
	CreatedAt    *Time                `json:"created" cq-name:"created_at" cq-type:"timestamp"`
	LaunchedAt   *Time                `json:"OS-SRV-USG:launched_at" cq-name:"launched_at" cq-type:"timestamp"`
	UpdatedAt    *Time                `json:"updated" cq-name:"updated_at" cq-type:"timestamp"`
	TerminatedAt *Time                `json:"OS-SRV-USG:terminated_at" cq-name:"terminated_at" cq-type:"timestamp"`
	HostID       string               `json:"hostid"`
	Status       string               `json:"status"`
	Progress     int                  `json:"progress"`
	AccessIPv4   string               `json:"accessIPv4"`
	AccessIPv6   string               `json:"accessIPv6"`
	Image        any                  `json:"image"`
	Flavor       InstanceFlavor       `json:"flavor"`
	Addresses    map[string][]Address `json:"addresses"`
	Metadata     map[string]string    `json:"metadata"`
	Links        []struct {
		Href string `json:"href"`
		Rel  string `json:"rel"`
	} `json:"links"`
	KeyName        string `json:"key_name"`
	AdminPass      string `json:"adminPass"`
	SecurityGroups []struct {
		Name string `json:"name"`
	} `json:"security_groups"`
	AttachedVolumes    []servers.AttachedVolume `json:"os-extended-volumes:volumes_attached" cq-name:"attached_volumes"`
	Tags               *[]string                `json:"tags"`
	ServerGroups       *[]string                `json:"server_groups"`
	DiskConfig         string                   `json:"OS-DCF:diskConfig" cq-name:"disk_config"`
	AvailabilityZone   string                   `json:"OS-EXT-AZ:availability_zone" cq-name:"availability_zone"`
	Host               string                   `json:"OS-EXT-SRV-ATTR:host" cq-name:"host"`
	HostName           string                   `json:"OS-EXT-SRV-ATTR:hostname" cq-name:"hostname"`
	HypervisorHostname string                   `json:"OS-EXT-SRV-ATTR:hypervisor_hostname" cq-name:"hypervisor_hostname"`
	InstanceName       string                   `json:"OS-EXT-SRV-ATTR:instance_name" cq-name:"instance_name"`
	KernelID           string                   `json:"OS-EXT-SRV-ATTR:kernel_id" cq-name:"kernel_id"`
	LaunchIndex        int                      `json:"OS-EXT-SRV-ATTR:launch_index" cq-name:"launch_index"`
	RAMDiskID          string                   `json:"OS-EXT-SRV-ATTR:ramdisk_id" cq-name:"ramdisk_id"`
	ReservationID      string                   `json:"OS-EXT-SRV-ATTR:reservation_id" cq-name:"reservation_id"`
	RootDeviceName     string                   `json:"OS-EXT-SRV-ATTR:root_device_name" cq-name:"root_device_name"`
	UserData           string                   `json:"OS-EXT-SRV-ATTR:user_data" cq-name:"user_data"`
	PowerState         int                      `json:"OS-EXT-STS:power_state" cq-name:"power_state_id"`
	VMState            string                   `json:"OS-EXT-STS:vm_state" cq-name:"vm_state"`
	ConfigDrive        string                   `json:"config_drive"`
	Description        string                   `json:"description"`
}

Instance is an internal type used to unmarshal more data from the API response than would usually be possible through the ordinary gophercloud struct. OpenStack API microversions enable more response data that is not taken into account by the gophercloud library, which unmarshals only what is available at the base level for each API version, for backward compatibility. This is also why there is an ExtractInto function that allows you to pass in an arbitrary struct to marshal the response data into.

type InstanceFlavor

type InstanceFlavor struct {
	Name          string                `json:"original_name"`
	Disk          int                   `json:"disk"`
	RAM           int                   `json:"ram"`
	Swap          int                   `json:"-"`
	VCPUs         int                   `json:"vcpus"`
	Ephemeral     int                   `json:"OS-FLV-EXT-DATA:ephemeral" cq-name:"ephemeral"`
	ExtraSpecsRaw json.RawMessage       `json:"extra_specs"`
	ExtraSpecsObj *FlavorExtraSpecsData `json:"-" cq-name:"extra_specs"`
	ExtraSpecsMap *map[string]string    `json:"-"`
	// contains filtered or unexported fields
}

type KeyPair

type KeyPair struct {
	ID          *int       `json:"ID"`
	Name        string     `json:"name"`
	Fingerprint string     `json:"fingerprint"`
	PublicKey   string     `json:"public_key"`
	PrivateKey  string     `json:"private_key"`
	UserID      *string    `json:"user_id"`
	Type        string     `json:"type"`
	Deleted     bool       `json:"deleted"`
	CreatedAt   *time.Time `json:"created_at"`
	UpdatedAt   *time.Time `json:"updated_at"`
	DeletedAt   *time.Time `json:"deleted_at"`
}

type Network

type Network struct {
	// UUID for the network
	ID string `json:"id"`

	// Human-readable name for the network. Might not be unique.
	Name string `json:"name"`

	// Description for the network
	Description string `json:"description"`

	// The administrative state of network. If false (down), the network does not
	// forward packets.
	AdminStateUp bool `json:"admin_state_up"`

	// Indicates whether network is currently operational. Possible values include
	// `ACTIVE', `DOWN', `BUILD', or `ERROR'. Plug-ins might define additional
	// values.
	Status string `json:"status"`

	// Subnets associated with this network.
	Subnets []string `json:"subnets"`

	// TenantID is the project owner of the network.
	TenantID string `json:"tenant_id"`

	// UpdatedAt and CreatedAt contain ISO-8601 timestamps of when the state of the
	// network last changed, and when it was created.
	UpdatedAt time.Time `json:"-"`
	CreatedAt time.Time `json:"-"`

	// ProjectID is the project owner of the network.
	ProjectID string `json:"project_id"`

	// Specifies whether the network resource can be accessed by any tenant.
	Shared bool `json:"shared"`

	// Availability zone hints groups network nodes that run services like DHCP, L3, FW, and others.
	// Used to make network resources highly available.
	AvailabilityZoneHints []string `json:"availability_zone_hints"`

	// Tags optionally set via extensions/attributestags
	Tags []string `json:"tags"`

	// RevisionNumber optionally set via extensions/standard-attr-revisions
	RevisionNumber int `json:"revision_number"`
}

type Pair

type Pair[K comparable, V any] struct {
	Key   K `cq-name:"key"`
	Value V `cq-name:"value"`
}

type SecurityGroup

type SecurityGroup struct {
	Name string `json:"name"`
}

type Single

type Single[V any] struct {
	Name V `cq-name:"name"`
}

type Tag

type Tag struct {
	Value string `cq-name:"value"`
}

type Time

type Time time.Time

func (*Time) Format

func (t *Time) Format(format string) string

func (*Time) IsZero

func (t *Time) IsZero() bool

func (*Time) MarshalJSON

func (t *Time) MarshalJSON() ([]byte, error)

func (*Time) String

func (t *Time) String() string

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) error

type User

type User struct {
	DefaultProjectID  string                 `json:"default_project_id"`
	Description       string                 `json:"description"`
	DomainID          string                 `json:"domain_id"`
	Enabled           bool                   `json:"enabled"`
	Extra             map[string]interface{} `json:"-"`
	ID                string                 `json:"id"`
	Links             map[string]interface{} `json:"links"`
	Name              string                 `json:"name"`
	PasswordExpiresAt time.Time              `json:"-"`
	Options           struct {
		IgnoreChangePasswordUponFirstUse bool `json:"ignore_change_password_upon_first_use"`
		IgnoreLockoutFailureAttempts     bool `json:"ignore_lockout_failure_attempts"`
		IgnorePasswordExpiry             bool `json:"ignore_password_expiry"`
	} `json:"options"`
}

func (*User) UnmarshalJSON

func (r *User) UnmarshalJSON(b []byte) error

type Volume

type Volume struct {
	// Unique identifier for the volume.
	ID string `json:"id"`
	// Current status of the volume.
	Status string `json:"status"`
	// Size of the volume in GB.
	Size int `json:"size"`
	// AvailabilityZone is which availability zone the volume is in.
	AvailabilityZone string `json:"availability_zone"`
	// The date when this volume was created.
	CreatedAt Time `json:"created_at"`
	// The date when this volume was last updated
	UpdatedAt Time `json:"updated_at"`
	// Instances onto which the volume is attached.
	Attachments []volumes.Attachment `json:"attachments"`
	// Human-readable display name for the volume.
	Name string `json:"name"`
	// Human-readable description for the volume.
	Description string `json:"description"`
	// The type of volume to create, either SATA or SSD.
	VolumeType string `json:"volume_type"`
	// The ID of the snapshot from which the volume was created
	SnapshotID string `json:"snapshot_id"`
	// The ID of another block storage volume from which the current volume was created
	SourceVolID string `json:"source_volid"`
	// The backup ID, from which the volume was restored
	// This field is supported since 3.47 microversion
	BackupID *string `json:"backup_id"`
	// The group ID; this field is supported since 3.47 microversion
	GroupID *string `json:"group_id"`
	// Arbitrary key-value pairs defined by the user.
	Metadata map[string]string `json:"metadata"`
	// UserID is the id of the user who created the volume.
	UserID string `json:"user_id"`
	// Indicates whether this is a bootable volume.
	Bootable string `json:"bootable"`
	// Encrypted denotes if the volume is encrypted.
	Encrypted bool `json:"encrypted"`
	// ReplicationStatus is the status of replication.
	ReplicationStatus string `json:"replication_status"`
	// ConsistencyGroupID is the consistency group ID.
	ConsistencyGroupID string `json:"consistencygroup_id"`
	// Multiattach denotes if the volume is multi-attach capable.
	Multiattach bool `json:"multiattach"`
	// Image metadata entries, only included for volumes that were created from an image, or from a snapshot of a volume originally created from an image.
	VolumeImageMetadata map[string]string `json:"volume_image_metadata"`
	// The volume migration status
	MigrationStatus string `json:"migration_status"`

	OsVolHostAttrHost         string `json:"os-vol-host-attr:host" cq-name:"host"`
	OsVolMigStatusAttrMigstat string `json:"os-vol-mig-status-attr:migstat" cq-name:"migration_status"`
	OsVolMigStatusAttrNameID  string `json:"os-vol-mig-status-attr:name_id" cq-name:"migration_status_name"`
	OsVolTenantAttrTenantID   string `json:"os-vol-tenant-attr:tenant_id" cq-name:"migration_status_tenant"`
	ProviderID                string `json:"provider_id"`
	ServiceUUID               string `json:"service_uuid"`
	SharedTargets             bool   `json:"shared_targets"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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