stackscript

package
v2.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MPL-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StackscriptAttributes = map[string]schema.Attribute{
	"id": schema.StringAttribute{
		Description: "The StackScript's unique ID.",
		Required:    true,
	},
	"label": schema.StringAttribute{
		Description: "The StackScript's label is for display purposes only.",
		Computed:    true,
	},
	"script": schema.StringAttribute{
		Description: "The script to execute when provisioning a new Linode with this StackScript.",
		Computed:    true,
	},
	"description": schema.StringAttribute{
		Description: "A description for the StackScript.",
		Computed:    true,
	},
	"rev_note": schema.StringAttribute{
		Description: "This field allows you to add notes for the set of revisions made to this StackScript.",
		Computed:    true,
	},
	"is_public": schema.BoolAttribute{
		Description: "This determines whether other users can use your StackScript. Once a StackScript is " +
			"made public, it cannot be made private.",
		Computed: true,
	},
	"images": schema.SetAttribute{
		Description: "An array of Image IDs representing the Images that this StackScript is compatible for " +
			"deploying with.",
		ElementType: types.StringType,
		Computed:    true,
	},
	"deployments_active": schema.Int64Attribute{
		Description: "Count of currently active, deployed Linodes created from this StackScript.",
		Computed:    true,
	},
	"user_gravatar_id": schema.StringAttribute{
		Description: "The Gravatar ID for the User who created the StackScript.",
		Computed:    true,
	},
	"deployments_total": schema.Int64Attribute{
		Description: "The total number of times this StackScript has been deployed.",
		Computed:    true,
	},
	"username": schema.StringAttribute{
		Description: "The User who created the StackScript.",
		Computed:    true,
	},
	"created": schema.StringAttribute{
		Description: "The date this StackScript was created.",
		CustomType:  timetypes.RFC3339Type{},
		Computed:    true,
	},
	"updated": schema.StringAttribute{
		Description: "The date this StackScript was updated.",
		CustomType:  timetypes.RFC3339Type{},
		Computed:    true,
	},
	"user_defined_fields": schema.ListAttribute{
		Description: "This is a list of fields defined with a special syntax inside this " +
			"StackScript that allow for supplying customized parameters during deployment.",
		Computed:    true,
		ElementType: udfObjectType,
	},
}

Functions

func NewDataSource

func NewDataSource() datasource.DataSource

func NewResource

func NewResource() resource.Resource

Types

type DataSource

type DataSource struct {
	helper.BaseDataSource
}

func (*DataSource) Read

type Resource

type Resource struct {
	helper.BaseResource
}

func (*Resource) Create

func (r *Resource) Create(
	ctx context.Context,
	req resource.CreateRequest,
	resp *resource.CreateResponse,
)

func (*Resource) Delete

func (r *Resource) Delete(
	ctx context.Context,
	req resource.DeleteRequest,
	resp *resource.DeleteResponse,
)

func (*Resource) Read

func (r *Resource) Read(
	ctx context.Context,
	req resource.ReadRequest,
	resp *resource.ReadResponse,
)

func (*Resource) Update

func (r *Resource) Update(
	ctx context.Context,
	req resource.UpdateRequest,
	resp *resource.UpdateResponse,
)

func (*Resource) UpgradeState added in v2.19.0

func (r *Resource) UpgradeState(context.Context) map[int64]resource.StateUpgrader

type StackScriptModel

type StackScriptModel struct {
	ID                types.String      `tfsdk:"id"`
	Label             types.String      `tfsdk:"label"`
	Script            types.String      `tfsdk:"script"`
	Description       types.String      `tfsdk:"description"`
	RevNote           types.String      `tfsdk:"rev_note"`
	IsPublic          types.Bool        `tfsdk:"is_public"`
	Images            types.Set         `tfsdk:"images"`
	DeploymentsActive types.Int64       `tfsdk:"deployments_active"`
	UserGravatarID    types.String      `tfsdk:"user_gravatar_id"`
	DeploymentsTotal  types.Int64       `tfsdk:"deployments_total"`
	Username          types.String      `tfsdk:"username"`
	Created           timetypes.RFC3339 `tfsdk:"created"`
	Updated           timetypes.RFC3339 `tfsdk:"updated"`
	UserDefinedFields types.List        `tfsdk:"user_defined_fields"`
}

StackScriptModel describes the Terraform resource data model to match the resource schema.

func (*StackScriptModel) CopyFrom added in v2.16.0

func (data *StackScriptModel) CopyFrom(other StackScriptModel, preserveKnown bool)

func (*StackScriptModel) FlattenStackScript added in v2.16.0

func (data *StackScriptModel) FlattenStackScript(
	stackscript *linodego.Stackscript,
	preserveKnown bool,
) diag.Diagnostics

type StackScriptModelV0 added in v2.19.0

type StackScriptModelV0 struct {
	ID                types.String `tfsdk:"id"`
	Label             types.String `tfsdk:"label"`
	Script            types.String `tfsdk:"script"`
	Description       types.String `tfsdk:"description"`
	RevNote           types.String `tfsdk:"rev_note"`
	IsPublic          types.Bool   `tfsdk:"is_public"`
	Images            types.Set    `tfsdk:"images"`
	DeploymentsActive types.Int64  `tfsdk:"deployments_active"`
	UserGravatarID    types.String `tfsdk:"user_gravatar_id"`
	DeploymentsTotal  types.Int64  `tfsdk:"deployments_total"`
	Username          types.String `tfsdk:"username"`
	Created           types.String `tfsdk:"created"`
	Updated           types.String `tfsdk:"updated"`
	UserDefinedFields types.List   `tfsdk:"user_defined_fields"`
}

StackScriptModel describes the older Terraform resource data model to match the resource schema of Terraform Provider for Linode v1. The only difference is the format of time for created and updated attributes

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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