Documentation ¶
Index ¶
- func NewCachedImageResource() resource.Resource
- func NewPublishImageResource() resource.Resource
- func ToAliasList(ctx context.Context, aliasSet types.Set) ([]string, diag.Diagnostics)
- func ToAliasSetType(ctx context.Context, aliases []string) (types.Set, diag.Diagnostics)
- type CachedImageModel
- type CachedImageResource
- func (r *CachedImageResource) Configure(_ context.Context, req resource.ConfigureRequest, ...)
- func (r CachedImageResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r CachedImageResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r CachedImageResource) Metadata(_ context.Context, req resource.MetadataRequest, ...)
- func (r CachedImageResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r CachedImageResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r CachedImageResource) SyncState(ctx context.Context, tfState *tfsdk.State, server incus.InstanceServer, ...) diag.Diagnostics
- func (r CachedImageResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type PublishImageModel
- type PublishImageResource
- func (r *PublishImageResource) Configure(_ context.Context, req resource.ConfigureRequest, ...)
- func (r PublishImageResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r PublishImageResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r PublishImageResource) Metadata(_ context.Context, req resource.MetadataRequest, ...)
- func (r PublishImageResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r PublishImageResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse)
- func (_ PublishImageResource) SyncState(ctx context.Context, tfState *tfsdk.State, server incus.InstanceServer, ...) diag.Diagnostics
- func (r PublishImageResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCachedImageResource ¶
NewCachedImageResource return new cached image resource.
func NewPublishImageResource ¶
NewPublishImageResource return new publish image resource.
func ToAliasList ¶
ToAliasList converts aliases of type types.Set into a slice of strings.
func ToAliasSetType ¶
ToAliasSetType converts slice of strings into aliases of type types.Set.
Types ¶
type CachedImageModel ¶
type CachedImageModel 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"` }
CachedImageModel resource data model that matches the schema.
type CachedImageResource ¶
type CachedImageResource struct {
// contains filtered or unexported fields
}
CachedImageResource represent Incus cached image resource.
func (*CachedImageResource) Configure ¶
func (r *CachedImageResource) Configure(_ context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
func (CachedImageResource) Create ¶
func (r CachedImageResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
func (CachedImageResource) Delete ¶
func (r CachedImageResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
func (CachedImageResource) Metadata ¶
func (r CachedImageResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
func (CachedImageResource) Read ¶
func (r CachedImageResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
func (CachedImageResource) Schema ¶
func (r CachedImageResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse)
func (CachedImageResource) SyncState ¶
func (r CachedImageResource) SyncState(ctx context.Context, tfState *tfsdk.State, server incus.InstanceServer, m CachedImageModel) 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 (CachedImageResource) Update ¶
func (r CachedImageResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
type PublishImageModel ¶
type PublishImageModel 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"` }
PublishImageModel resource data model that matches the schema.
type PublishImageResource ¶
type PublishImageResource struct {
// contains filtered or unexported fields
}
PublishImageResource represent Incus publish image resource.
func (*PublishImageResource) Configure ¶
func (r *PublishImageResource) Configure(_ context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
func (PublishImageResource) Create ¶
func (r PublishImageResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
func (PublishImageResource) Delete ¶
func (r PublishImageResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
func (PublishImageResource) Metadata ¶
func (r PublishImageResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
func (PublishImageResource) Read ¶
func (r PublishImageResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
func (PublishImageResource) Schema ¶
func (r PublishImageResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse)
func (PublishImageResource) SyncState ¶
func (_ PublishImageResource) SyncState(ctx context.Context, tfState *tfsdk.State, server incus.InstanceServer, m PublishImageModel) 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 (PublishImageResource) Update ¶
func (r PublishImageResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)