Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateRandomString(n int) string
- func HookGlobal[T any](ptr *T, val T) func()
- func IsKnown(t Knowable) bool
- func New(version string) func() provider.Provider
- func NewBackupResource() resource.Resource
- func NewBackupsDataSource() datasource.DataSource
- func NewClusterResource() resource.Resource
- func NewClusterSpecsDataSource() datasource.DataSource
- func NewClustersDataSource() datasource.DataSource
- func NewImportResource() resource.Resource
- func NewProjectsDataSource() datasource.DataSource
- func NewRestoreResource() resource.Resource
- func NewRestoresDataSource() datasource.DataSource
- func Ptr[T any](v T) *T
- func WaitClusterReady(ctx context.Context, timeout time.Duration, interval time.Duration, ...) (*clusterApi.GetClusterOKBody, error)
- type ImportAllCompletedTable
- type ImportCustomCSVFormat
- type ImportResource
- func (r *ImportResource) Configure(_ context.Context, req resource.ConfigureRequest, ...)
- func (r *ImportResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *ImportResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *ImportResource) Metadata(_ context.Context, req resource.MetadataRequest, ...)
- func (r *ImportResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *ImportResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *ImportResource) Update(_ context.Context, _ resource.UpdateRequest, resp *resource.UpdateResponse)
- type ImportResourceModel
- type ImportTargetTable
- type Knowable
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 ¶
View Source
var NewClient = tidbcloud.NewClientDelegate
NewClient overrides the NewClientDelegate method for testing.
Functions ¶
func GenerateRandomString ¶ added in v0.2.0
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 IsKnown ¶ added in v0.3.0
IsKnown is a shortcut that checks in a value is neither null nor unknown.
func NewBackupResource ¶ added in v0.2.0
func NewBackupsDataSource ¶ added in v0.2.0
func NewBackupsDataSource() datasource.DataSource
func NewClusterResource ¶ added in v0.2.0
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 NewProjectsDataSource ¶ added in v0.2.0
func NewProjectsDataSource() datasource.DataSource
func NewRestoreResource ¶ added in v0.2.0
func NewRestoresDataSource ¶ added in v0.2.0
func NewRestoresDataSource() datasource.DataSource
func WaitClusterReady ¶ added in v0.3.0
func WaitClusterReady(ctx context.Context, timeout time.Duration, interval time.Duration, projectId, clusterId string, client tidbcloud.TiDBCloudClient) (*clusterApi.GetClusterOKBody, error)
Types ¶
type ImportAllCompletedTable ¶ added in v0.2.0
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 (r *ImportResource) Configure(_ context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
func (*ImportResource) Create ¶ added in v0.2.0
func (r *ImportResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
func (*ImportResource) Delete ¶ added in v0.2.0
func (r *ImportResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
func (*ImportResource) Metadata ¶ added in v0.2.0
func (r *ImportResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
func (*ImportResource) Read ¶ added in v0.2.0
func (r *ImportResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
func (*ImportResource) Schema ¶ added in v0.2.0
func (r *ImportResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
func (*ImportResource) Update ¶ added in v0.2.0
func (r *ImportResource) Update(_ context.Context, _ resource.UpdateRequest, resp *resource.UpdateResponse)
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
Click to show internal directories.
Click to hide internal directories.