image

package
v0.1.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewImagePublishResource added in v0.1.2

func NewImagePublishResource() resource.Resource

NewImagePublishResource return new publish image resource.

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 ImageModel added in v0.1.2

type ImageModel struct {
	SourceImage  types.String `tfsdk:"source_image"`
	SourceRemote types.String `tfsdk:"source_remote"`
	Aliases      types.Set    `tfsdk:"aliases"`
	CopyAliases  types.Bool   `tfsdk:"copy_aliases"`
	Type         types.String `tfsdk:"type"`
	Project      types.String `tfsdk:"project"`
	Remote       types.String `tfsdk:"remote"`

	// Computed.
	ResourceID    types.String `tfsdk:"resource_id"`
	Architecture  types.String `tfsdk:"architecture"`
	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 ImagePublishModel added in v0.1.2

type ImagePublishModel struct {
	Instance       types.String `tfsdk:"instance"`
	Aliases        types.Set    `tfsdk:"aliases"`
	Properties     types.Map    `tfsdk:"properties"`
	Public         types.Bool   `tfsdk:"public"`
	Filename       types.String `tfsdk:"filename"`
	CompressionAlg types.String `tfsdk:"compression_algorithm"`
	Triggers       types.List   `tfsdk:"triggers"`
	Project        types.String `tfsdk:"project"`
	Remote         types.String `tfsdk:"remote"`

	// Computed.
	ResourceID   types.String `tfsdk:"resource_id"`
	Architecture types.String `tfsdk:"architecture"`
	Fingerprint  types.String `tfsdk:"fingerprint"`
	CreatedAt    types.Int64  `tfsdk:"created_at"`
}

ImagePublishModel resource data model that matches the schema.

type ImagePublishResource added in v0.1.2

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

ImagePublishResource represent Incus publish image resource.

func (*ImagePublishResource) Configure added in v0.1.2

func (ImagePublishResource) Create added in v0.1.2

func (ImagePublishResource) Delete added in v0.1.2

func (ImagePublishResource) Metadata added in v0.1.2

func (ImagePublishResource) Read added in v0.1.2

func (ImagePublishResource) Schema added in v0.1.2

func (ImagePublishResource) SyncState added in v0.1.2

func (_ ImagePublishResource) SyncState(ctx context.Context, tfState *tfsdk.State, server incus.InstanceServer, m ImagePublishModel) diag.Diagnostics

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

func (ImagePublishResource) Update added in v0.1.2

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

Jump to

Keyboard shortcuts

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