instanceinfo

package
v0.0.0-...-2a50bf3 Latest Latest
Warning

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

Go to latest
Published: May 29, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package instanceinfo provides functionality for interfacing with the compute API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeviceType

func DeviceType(diskType string) string

DeviceType returns a formatted device type for a given disk type and name. The returned device type will be formatted as: "LOCAL-SSD" or "PERSISTENT-SSD". "OTHER" if another disk type

Types

type Disks

type Disks struct {
	DeviceName string
	DiskType   string
	Mapping    string
}

Disks contains information about a device name and the disk type

type Reader

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

Reader handles the retrieval of instance properties from a compute client instance.

func New

func New(gceService gceInterface) *Reader

New instantiates a Reader with default instance properties.

func NewReader

func NewReader(gceService gceInterface) *Reader

NewReader instantiates a Reader with gceService

func (*Reader) AllDisks

func (r *Reader) AllDisks(ctx context.Context, projectID, zone, instanceID string) ([]*Disks, error)

AllDisks returns all possible disks with data from compute instance call Returns nil with error if the service account is missing Compute Viewer IAM role.

Jump to

Keyboard shortcuts

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