Documentation ¶
Index ¶
- func NewImageDataSource() datasource.DataSource
- func NewImageResource() 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 ImageDataSource
- func (d *ImageDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, ...)
- func (d *ImageDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, ...)
- func (d *ImageDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
- func (d *ImageDataSource) Schema(_ context.Context, req datasource.SchemaRequest, ...)
- func (d *ImageDataSource) ValidateConfig(ctx context.Context, req datasource.ValidateConfigRequest, ...)
- type ImageDataSourceModel
- type ImageModel
- type ImageResource
- func (r *ImageResource) Configure(_ context.Context, req resource.ConfigureRequest, ...)
- func (r ImageResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r ImageResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r ImageResource) Metadata(_ context.Context, req resource.MetadataRequest, ...)
- func (r ImageResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r ImageResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r ImageResource) SyncState(ctx context.Context, tfState *tfsdk.State, server incus.InstanceServer, ...) diag.Diagnostics
- func (r ImageResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- func (r ImageResource) ValidateConfig(ctx context.Context, req resource.ValidateConfigRequest, ...)
- type SourceImageModel
- type SourceInstanceModel
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
NewImageResource return new cached 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 ImageDataSource ¶ added in v0.2.0
type ImageDataSource struct {
// contains filtered or unexported fields
}
func (*ImageDataSource) Configure ¶ added in v0.2.0
func (d *ImageDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse)
func (*ImageDataSource) Metadata ¶ added in v0.2.0
func (d *ImageDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse)
func (*ImageDataSource) Read ¶ added in v0.2.0
func (d *ImageDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
func (*ImageDataSource) Schema ¶ added in v0.2.0
func (d *ImageDataSource) Schema(_ context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse)
func (*ImageDataSource) ValidateConfig ¶ added in v0.2.0
func (d *ImageDataSource) ValidateConfig(ctx context.Context, req datasource.ValidateConfigRequest, resp *datasource.ValidateConfigResponse)
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 (r *ImageResource) Configure(_ context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
func (ImageResource) Create ¶ added in v0.1.2
func (r ImageResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
func (ImageResource) Delete ¶ added in v0.1.2
func (r ImageResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
func (ImageResource) Metadata ¶ added in v0.1.2
func (r ImageResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
func (ImageResource) Read ¶ added in v0.1.2
func (r ImageResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
func (ImageResource) Schema ¶ added in v0.1.2
func (r ImageResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse)
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 (r ImageResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
func (ImageResource) ValidateConfig ¶ added in v0.1.4
func (r ImageResource) ValidateConfig(ctx context.Context, req resource.ValidateConfigRequest, resp *resource.ValidateConfigResponse)
type SourceImageModel ¶ added in v0.1.4
Click to show internal directories.
Click to hide internal directories.