image

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: MPL-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewImageDataSource added in v0.2.0

func NewImageDataSource() datasource.DataSource

func NewImageResource added in v0.1.2

func NewImageResource() resource.Resource

NewImageResource return new cached image resource.

func ToAliasList

func ToAliasList(ctx context.Context, aliasSet types.Set) ([]string, diag.Diagnostics)

ToAliasList converts aliases of type types.Set into a slice of strings.

func ToAliasSetType

func ToAliasSetType(ctx context.Context, aliases []string) (types.Set, diag.Diagnostics)

ToAliasSetType converts slice of strings into aliases of type types.Set.

Types

type ImageDataSource added in v0.2.0

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

func (*ImageDataSource) Configure added in v0.2.0

func (*ImageDataSource) Metadata added in v0.2.0

func (*ImageDataSource) Read added in v0.2.0

func (*ImageDataSource) Schema added in v0.2.0

func (*ImageDataSource) ValidateConfig added in v0.2.0

type ImageDataSourceModel added in v0.2.0

type ImageDataSourceModel struct {
	Aliases      types.Set    `tfsdk:"aliases"`
	Architecture types.String `tfsdk:"architecture"`
	CreatedAt    types.Int64  `tfsdk:"created_at"`
	Fingerprint  types.String `tfsdk:"fingerprint"`
	Name         types.String `tfsdk:"name"`
	Project      types.String `tfsdk:"project"`
	Remote       types.String `tfsdk:"remote"`
	Type         types.String `tfsdk:"type"`
}

type ImageModel added in v0.1.2

type ImageModel struct {
	SourceImage    types.Object `tfsdk:"source_image"`
	SourceInstance types.Object `tfsdk:"source_instance"`
	Aliases        types.Set    `tfsdk:"aliases"`
	Project        types.String `tfsdk:"project"`
	Remote         types.String `tfsdk:"remote"`

	// Computed.
	ResourceID    types.String `tfsdk:"resource_id"`
	CreatedAt     types.Int64  `tfsdk:"created_at"`
	Fingerprint   types.String `tfsdk:"fingerprint"`
	CopiedAliases types.Set    `tfsdk:"copied_aliases"`
}

ImageModel resource data model that matches the schema.

type ImageResource added in v0.1.2

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

ImageResource represent Incus cached image resource.

func (*ImageResource) Configure added in v0.1.2

func (ImageResource) Create added in v0.1.2

func (ImageResource) Delete added in v0.1.2

func (ImageResource) Metadata added in v0.1.2

func (ImageResource) Read added in v0.1.2

func (ImageResource) Schema added in v0.1.2

func (ImageResource) SyncState added in v0.1.2

func (r ImageResource) SyncState(ctx context.Context, tfState *tfsdk.State, server incus.InstanceServer, m ImageModel) diag.Diagnostics

SyncState fetches the server's current state for a cached image and updates the provided model. It then applies this updated model as the new state in Terraform.

func (ImageResource) Update added in v0.1.2

func (ImageResource) ValidateConfig added in v0.1.4

type SourceImageModel added in v0.1.4

type SourceImageModel struct {
	Remote       types.String `tfsdk:"remote"`
	Name         types.String `tfsdk:"name"`
	Type         types.String `tfsdk:"type"`
	Architecture types.String `tfsdk:"architecture"`
	CopyAliases  types.Bool   `tfsdk:"copy_aliases"`
}

type SourceInstanceModel added in v0.1.4

type SourceInstanceModel struct {
	Name     types.String `tfsdk:"name"`
	Snapshot types.String `tfsdk:"snapshot"`
}

Jump to

Keyboard shortcuts

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