Documentation ¶
Index ¶
- func NewDataSource() datasource.DataSource
- func NewResource() resource.Resource
- type Datasource
- func (d *Datasource) Configure(_ context.Context, req datasource.ConfigureRequest, ...)
- func (d *Datasource) Metadata(_ context.Context, req datasource.MetadataRequest, ...)
- func (d *Datasource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
- func (d *Datasource) Schema(ctx context.Context, _ datasource.SchemaRequest, ...)
- type Model
- type Resource
- func (r *Resource) Configure(_ context.Context, req resource.ConfigureRequest, ...)
- func (r *Resource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *Resource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *Resource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *Resource) Metadata(_ context.Context, req resource.MetadataRequest, ...)
- func (r *Resource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *Resource) Schema(ctx context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *Resource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDataSource ¶ added in v0.57.1
func NewDataSource() datasource.DataSource
NewDataSource creates a new VM datasource.
func NewResource ¶ added in v0.57.1
NewResource creates a new resource for managing VMs.
Types ¶
type Datasource ¶ added in v0.57.1
type Datasource struct {
// contains filtered or unexported fields
}
Datasource is the implementation of VM datasource.
func (*Datasource) Configure ¶ added in v0.57.1
func (d *Datasource) Configure( _ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse, )
Configure sets the client for the resource.
func (*Datasource) Metadata ¶ added in v0.57.1
func (d *Datasource) Metadata( _ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse, )
Metadata defines the name of the resource.
func (*Datasource) Read ¶ added in v0.57.1
func (d *Datasource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
func (*Datasource) Schema ¶ added in v0.57.1
func (d *Datasource) Schema( ctx context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse, )
Schema defines the schema for the resource.
type Model ¶ added in v0.57.1
type Model struct { Description types.String `tfsdk:"description"` CPU cpu.Value `tfsdk:"cpu"` Clone *struct { ID types.Int64 `tfsdk:"id"` Retries types.Int64 `tfsdk:"retries"` } `tfsdk:"clone"` ID types.Int64 `tfsdk:"id"` Name types.String `tfsdk:"name"` NodeName types.String `tfsdk:"node_name"` Tags stringset.Value `tfsdk:"tags"` Template types.Bool `tfsdk:"template"` Timeouts timeouts.Value `tfsdk:"timeouts"` VGA vga.Value `tfsdk:"vga"` }
Model represents the VM model.
Note: for computed fields / blocks we have to use an Object type (or an alias), or a custom type in order to hold an unknown value.
type Resource ¶ added in v0.57.1
type Resource struct {
// contains filtered or unexported fields
}
Resource implements the resource.Resource interface for managing VMs.
func (*Resource) Configure ¶ added in v0.57.1
func (r *Resource) Configure( _ context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse, )
Configure sets the client for the resource.
func (*Resource) Create ¶ added in v0.57.1
func (r *Resource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
Create creates a new VM.
func (*Resource) Delete ¶ added in v0.57.1
func (r *Resource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
Delete deletes the VM.
func (*Resource) ImportState ¶ added in v0.57.1
func (r *Resource) ImportState( ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse, )
ImportState imports the state of the VM from the API.
func (*Resource) Metadata ¶ added in v0.57.1
func (r *Resource) Metadata( _ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse, )
Metadata defines the name of the resource.
func (*Resource) Read ¶ added in v0.57.1
func (r *Resource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
func (*Resource) Schema ¶ added in v0.57.1
func (r *Resource) Schema( ctx context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse, )
Schema defines the schema for the resource.
func (*Resource) Update ¶ added in v0.57.1
func (r *Resource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
Update updates the VM with the new configuration.