customattribute

package
v0.0.0-...-26687db Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigKey = "custom_attributes"

ConfigKey is the string that should always be used as the key for specifying custom attribute values for a resource. Various resource custom attribute helpers will depend on this value being consistent across resources.

When adding custom attributes to a resource schema, the easiest way to do that (for now) will be to use the following line:

customattribute.ConfigKey: customattribute.ConfigSchema(),

This will ensure that the correct key and schema is used across all resources.

Variables

This section is empty.

Functions

func ConfigSchema

func ConfigSchema() *schema.Schema

ConfigSchema returns the schema for custom attribute configuration for each resource that needs it.

The key should be set to the ConfigKey constant and should be a map of custom attribute ids to values.

func IsSupported

func IsSupported(client *govmomi.Client) bool

func ReadFromResource

func ReadFromResource(entity *mo.ManagedEntity, d *schema.ResourceData)

ReadFromResource reads the custom attributes from an object and saves the data into the supplied ResourceData.

TODO: Add error handling and reporting to this method.

func VerifySupport

func VerifySupport(client *govmomi.Client) error

Types

type DiffProcessor

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

func GetDiffProcessorIfAttributesDefined

func GetDiffProcessorIfAttributesDefined(client *govmomi.Client, d *schema.ResourceData) (*DiffProcessor, error)

func (*DiffProcessor) ProcessDiff

func (p *DiffProcessor) ProcessDiff(subject object.Reference) error

Jump to

Keyboard shortcuts

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