Documentation ¶
Index ¶
- Constants
- Variables
- func NewDataSource() datasource.DataSource
- func NewResource() resource.Resource
- type DataSource
- type ImageModel
- type Resource
- 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) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *Resource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type ResourceModel
Constants ¶
View Source
const (
DefaultVolumeCreateTimeout = 30 * time.Minute
)
Variables ¶
View Source
var ImageAttributes = map[string]schema.Attribute{ "id": schema.StringAttribute{ Description: "The unique ID assigned to this Image.", Required: true, }, "label": schema.StringAttribute{ Description: "A short description of the Image. Labels cannot contain special characters.", Computed: true, }, "capabilities": schema.SetAttribute{ Description: "The capabilities of this Image.", ElementType: types.StringType, Computed: true, }, "description": schema.StringAttribute{ Description: "A detailed description of this Image.", Computed: true, }, "created": schema.StringAttribute{ Description: "When this Image was created.", Computed: true, }, "created_by": schema.StringAttribute{ Description: "The name of the User who created this Image.", Computed: true, }, "deprecated": schema.BoolAttribute{ Description: "Whether or not this Image is deprecated. Will only be True for deprecated public Images.", Computed: true, }, "is_public": schema.BoolAttribute{ Description: "True if the Image is public.", Computed: true, }, "size": schema.Int64Attribute{ Description: "The minimum size this Image needs to deploy. Size is in MB.", Computed: true, }, "status": schema.StringAttribute{ Description: "The current status of this Image.", Computed: true, }, "type": schema.StringAttribute{ Description: "How the Image was created. 'Manual' Images can be created at any time. 'Automatic' " + "images are created automatically from a deleted Linode.", Computed: true, }, "expiry": schema.StringAttribute{ Description: "Only Images created automatically (from a deleted Linode; type=automatic) will expire.", Computed: true, }, "vendor": schema.StringAttribute{ Description: "The upstream distribution vendor. Nil for private Images.", Computed: true, }, }
Functions ¶
func NewDataSource ¶
func NewDataSource() datasource.DataSource
func NewResource ¶ added in v2.19.0
Types ¶
type DataSource ¶
type DataSource struct {
helper.BaseDataSource
}
func (*DataSource) Read ¶
func (d *DataSource) Read( ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse, )
type ImageModel ¶
type ImageModel struct { ID types.String `tfsdk:"id"` Label types.String `tfsdk:"label"` Description types.String `tfsdk:"description"` Capabilities []types.String `tfsdk:"capabilities"` Created types.String `tfsdk:"created"` CreatedBy types.String `tfsdk:"created_by"` Deprecated types.Bool `tfsdk:"deprecated"` IsPublic types.Bool `tfsdk:"is_public"` Size types.Int64 `tfsdk:"size"` Status types.String `tfsdk:"status"` Type types.String `tfsdk:"type"` Expiry types.String `tfsdk:"expiry"` Vendor types.String `tfsdk:"vendor"` }
ImageModel describes the Terraform resource data model to match the resource schema.
func (*ImageModel) ParseImage ¶
func (data *ImageModel) ParseImage( image *linodego.Image, )
type Resource ¶
type Resource struct {
helper.BaseResource
}
func (*Resource) Create ¶ added in v2.19.0
func (r *Resource) Create( ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse, )
func (*Resource) Delete ¶ added in v2.19.0
func (r *Resource) Delete( ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse, )
func (*Resource) Read ¶ added in v2.19.0
func (r *Resource) Read( ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse, )
func (*Resource) Update ¶ added in v2.19.0
func (r *Resource) Update( ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse, )
type ResourceModel ¶ added in v2.19.0
type ResourceModel struct { ID types.String `tfsdk:"id"` Label types.String `tfsdk:"label"` DiskID types.Int64 `tfsdk:"disk_id"` LinodeID types.Int64 `tfsdk:"linode_id"` FilePath types.String `tfsdk:"file_path"` Region types.String `tfsdk:"region"` FileHash types.String `tfsdk:"file_hash"` Description types.String `tfsdk:"description"` CloudInit types.Bool `tfsdk:"cloud_init"` Capabilities types.List `tfsdk:"capabilities"` Created timetypes.RFC3339 `tfsdk:"created"` CreatedBy types.String `tfsdk:"created_by"` Deprecated types.Bool `tfsdk:"deprecated"` IsPublic types.Bool `tfsdk:"is_public"` Size types.Int64 `tfsdk:"size"` Status types.String `tfsdk:"status"` Type types.String `tfsdk:"type"` Expiry timetypes.RFC3339 `tfsdk:"expiry"` Vendor types.String `tfsdk:"vendor"` Timeouts timeouts.Value `tfsdk:"timeouts"` }
func (*ResourceModel) CopyFrom ¶ added in v2.19.0
func (data *ResourceModel) CopyFrom(other ResourceModel, preserveKnown bool)
func (*ResourceModel) FlattenImage ¶ added in v2.19.0
func (data *ResourceModel) FlattenImage(image *linodego.Image, preserveKnown bool, diags *diag.Diagnostics)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.