provider

package
v0.0.0-...-b228686 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

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

func NewExampleDataSource

func NewExampleDataSource() datasource.DataSource

func NewImageResource

func NewImageResource() resource.Resource

func NewVmResource

func NewVmResource() resource.Resource

Types

type ImageDataSource

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

ImageDataSource defines the data source implementation.

func (*ImageDataSource) Configure

func (*ImageDataSource) Metadata

func (*ImageDataSource) Read

func (*ImageDataSource) Schema

type ImageDataSourceModel

type ImageDataSourceModel struct {
	Name      types.String `tfsdk:"name"`
	ImgType   types.String `tfsdk:"img_type"`
	Platform  types.String `tfsdk:"platform"`
	Id        types.String `tfsdk:"id"`
	Sha256    types.String `tfsdk:"sha256"`
	OsVariant types.String `tfsdk:"os_variant"`
	Filters   types.Map    `tfsdk:"filters"`
}

ImageDataSourceModel describes the data source data model.

type ImageResource

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

ImageResource defines the resource implementation.

func (*ImageResource) Configure

func (*ImageResource) Create

func (*ImageResource) Delete

func (*ImageResource) ImportState

func (*ImageResource) Metadata

func (*ImageResource) Read

func (*ImageResource) Schema

func (*ImageResource) Update

type ImageResourceModel

type ImageResourceModel struct {
	Name        types.String `tfsdk:"name"`
	ImgType     types.String `tfsdk:"img_type"`
	Platform    types.String `tfsdk:"platform"`
	Hash        types.String `tfsdk:"hash"`
	Id          types.String `tfsdk:"id"`
	Sha256      types.String `tfsdk:"sha256"`
	KeepLocally types.Bool   `tfsdk:"keep_locally"`
	RepoType    types.String `tfsdk:"repo_type"`
}

ImageResourceModel describes the resource data model.

type SayaExecutionCtx

type SayaExecutionCtx struct {
	SayaExe    string        // saya executable command or path, default to saya
	Config     string        // saya yaml config path
	Forge      string        // forge(local image store+ work directory, etc.) path
	LicenseKey opaque.String // License key
	LogLevel   string
	// contains filtered or unexported fields
}

func (*SayaExecutionCtx) HttpRepo

func (exeCtx *SayaExecutionCtx) HttpRepo() *saya.HttpRepo

func (*SayaExecutionCtx) S3Repo

func (exeCtx *SayaExecutionCtx) S3Repo() *saya.S3Repo

func (*SayaExecutionCtx) ToRequestSayaCtx

func (exeCtx *SayaExecutionCtx) ToRequestSayaCtx() saya.RequestSayaCtx

type SayaProvider

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

SayaProvider defines the provider implementation.

func (*SayaProvider) Configure

func (*SayaProvider) DataSources

func (p *SayaProvider) DataSources(ctx context.Context) []func() datasource.DataSource

func (*SayaProvider) Metadata

func (*SayaProvider) Resources

func (p *SayaProvider) Resources(ctx context.Context) []func() resource.Resource

func (*SayaProvider) Schema

type SayaProviderModel

type SayaProviderModel struct {
	Exe        types.String `tfsdk:"exe"`
	Config     types.String `tfsdk:"config"`
	Forge      types.String `tfsdk:"forge"`
	LicenseKey types.String `tfsdk:"license_key"`

	HttpRepo types.Object `tfsdk:"http_repo"`
	S3Repo   types.Object `tfsdk:"s3_repo"`
}

SayaProviderModel describes the provider data model. @mind no LogLevel because terraform sets it throw environment variable so we are following the lead.

type SayaProviderModelHttpAuthBasic

type SayaProviderModelHttpAuthBasic struct {
	Username string `tfsdk:"username"`
	Pwd      string `tfsdk:"password"`
}

type SayaProviderModelHttpRepo

type SayaProviderModelHttpRepo struct {
	RepoUrl        string                         `tfsdk:"url"`
	BasePath       string                         `tfsdk:"base_path"`
	UploadStrategy string                         `tfsdk:"upload_strategy"`
	AuthHttpBasic  SayaProviderModelHttpAuthBasic `tfsdk:"basic_auth"`
}

func (SayaProviderModelHttpRepo) NormalizeToNil

type SayaProviderModelS3Repo

type SayaProviderModelS3Repo struct {
	Bucket       string                       `tfsdk:"bucket"`
	BaseKey      string                       `tfsdk:"base_key"`
	EpUrlS3      string                       `tfsdk:"ep_url_s3"`
	Region       string                       `tfsdk:"region"`
	UsePathStyle bool                         `tfsdk:"use_path_style"`
	Credentials  *SayaProviderModelS3RepoCred `tfsdk:"credentials"`
}

type SayaProviderModelS3RepoCred

type SayaProviderModelS3RepoCred struct {
	AccessKeyID     string `tfsdk:"access_key_id"`
	SecretAccessKey string `tfsdk:"secret_access_key"`
	SessionToken    string `tfsdk:"session_token"`
	Source          string `tfsdk:"source"`
	CanExpire       bool   `tfsdk:"can_expire"`
	Expires         string `tfsdk:"expires"`
}

func (*SayaProviderModelS3RepoCred) AsSayaCred

func (credTf *SayaProviderModelS3RepoCred) AsSayaCred() (*saya.AwsCredentials, error)

type VmResource

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

VmResource defines the resource implementation.

func (*VmResource) Configure

func (*VmResource) Create

func (*VmResource) Delete

func (*VmResource) ImportState

func (*VmResource) Metadata

func (*VmResource) Read

func (*VmResource) Schema

func (*VmResource) Update

type VmResourceModel

type VmResourceModel struct {
	Name        types.String `tfsdk:"name"`
	Image       types.String `tfsdk:"image"`
	ComputeType types.String `tfsdk:"compute_type"`
	Id          types.String `tfsdk:"id"`
	State       types.String `tfsdk:"state"` // steady state of the vm; started | stopped (what about hibernate e.g. for aws)
	OsVariant   types.String `tfsdk:"os_variant"`

	KeepOnDelete types.Bool `tfsdk:"keep_on_delete"` // true if vm is not to be delete even vm double in terraform state will
}

VmResourceModel describes the resource data model.

Jump to

Keyboard shortcuts

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