provider

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TiDBCloudPublicKey  string = "TIDBCLOUD_PUBLIC_KEY"
	TiDBCloudPrivateKey string = "TIDBCLOUD_PRIVATE_KEY"
	TiDBCloudHOST       string = "TIDBCLOUD_HOST"
	TiDBCloudProjectID  string = "TIDBCLOUD_PROJECT_ID"
	TiDBCloudClusterID  string = "TIDBCLOUD_CLUSTER_ID"
	UserAgent           string = "terraform-provider-tidbcloud"
)

Variables

NewClient overrides the NewClientDelegate method for testing.

Functions

func GenerateRandomString added in v0.2.0

func GenerateRandomString(n int) string

func HookGlobal added in v0.2.0

func HookGlobal[T any](ptr *T, val T) func()

HookGlobal sets `*ptr = val` and returns a closure for restoring `*ptr` to its original value. A runtime panic will occur if `val` is not assignable to `*ptr`.

func New

func New(version string) func() provider.Provider

func NewBackupResource added in v0.2.0

func NewBackupResource() resource.Resource

func NewBackupsDataSource added in v0.2.0

func NewBackupsDataSource() datasource.DataSource

func NewClusterResource added in v0.2.0

func NewClusterResource() resource.Resource

func NewClusterSpecsDataSource added in v0.2.0

func NewClusterSpecsDataSource() datasource.DataSource

func NewClustersDataSource added in v0.2.0

func NewClustersDataSource() datasource.DataSource

func NewImportResource added in v0.2.0

func NewImportResource() resource.Resource

func NewProjectsDataSource added in v0.2.0

func NewProjectsDataSource() datasource.DataSource

func NewRestoreResource added in v0.2.0

func NewRestoreResource() resource.Resource

func NewRestoresDataSource added in v0.2.0

func NewRestoresDataSource() datasource.DataSource

func Ptr added in v0.2.0

func Ptr[T any](v T) *T

Types

type ImportAllCompletedTable added in v0.2.0

type ImportAllCompletedTable struct {
	TableName types.String `tfsdk:"table_name"`
	Result    types.String `tfsdk:"result"`
	Message   types.String `tfsdk:"message"`
}

type ImportCustomCSVFormat added in v0.2.0

type ImportCustomCSVFormat struct {
	// backslash escape
	BackslashEscape types.Bool `tfsdk:"backslash_escape"`
	// delimiter
	Delimiter types.String `tfsdk:"delimiter"`
	// header
	Header types.Bool `tfsdk:"header"`
	// separator
	Separator types.String `tfsdk:"separator"`
	// trim last separator
	TrimLastSeparator types.Bool `tfsdk:"trim_last_separator"`
}

type ImportResource added in v0.2.0

type ImportResource struct {
	// contains filtered or unexported fields
}

ImportResource defines the resource implementation.

func (*ImportResource) Configure added in v0.2.0

func (*ImportResource) Create added in v0.2.0

func (*ImportResource) Delete added in v0.2.0

func (*ImportResource) Metadata added in v0.2.0

func (*ImportResource) Read added in v0.2.0

func (*ImportResource) Schema added in v0.2.0

func (*ImportResource) Update added in v0.2.0

type ImportResourceModel added in v0.2.0

type ImportResourceModel struct {
	Id        types.String `tfsdk:"id"`
	ClusterId types.String `tfsdk:"cluster_id"`
	ProjectId types.String `tfsdk:"project_id"`
	// The type of data source. Required: true
	Type types.String `tfsdk:"type"`
	// The format of data to import. Required: true
	DataFormat types.String `tfsdk:"data_format"`
	// The CSV configuration.
	CsvFormat *ImportCustomCSVFormat `tfsdk:"csv_format"`

	/*
		used for importing from local file
	*/
	// The file name returned by generating upload url.
	FileName types.String `tfsdk:"file_name"`
	// The target db and table to import data.
	TargetTable *ImportTargetTable `tfsdk:"target_table"`
	NewFileName types.String       `tfsdk:"new_file_name"`

	/*
		used for importing from S3
	*/
	// The arn of AWS IAM role.
	AwsRoleArn types.String `tfsdk:"aws_role_arn"`
	// The full s3 path that contains data to import.
	SourceURL types.String `tfsdk:"source_url"`

	// computed fields
	CreatedAt                  types.String `tfsdk:"created_at"`
	Status                     types.String `tfsdk:"status"`
	TotalSize                  types.String `tfsdk:"total_size"`
	TotalFiles                 types.Int64  `tfsdk:"total_files"`
	CompletedTables            types.Int64  `tfsdk:"completed_tables"`
	PendingTables              types.Int64  `tfsdk:"pending_tables"`
	CompletedPercent           types.Int64  `tfsdk:"completed_percent"`
	Message                    types.String `tfsdk:"message"`
	ElapsedTimeSeconds         types.Int64  `tfsdk:"elapsed_time_seconds"`
	ProcessedSourceDataSize    types.String `tfsdk:"processed_source_data_size"`
	TotalTablesCount           types.Int64  `tfsdk:"total_tables_count"`
	PostImportCompletedPercent types.Int64  `tfsdk:"post_import_completed_percent"`
	AllCompletedTables         types.List   `tfsdk:"all_completed_tables"`
}

ImportResourceModel describes the resource data model.

type ImportTargetTable added in v0.2.0

type ImportTargetTable struct {
	// database
	Database types.String `tfsdk:"database"`
	// table
	Table types.String `tfsdk:"table"`
}

Jump to

Keyboard shortcuts

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