provider

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProviderName name for the provider in the Mirantis namespace.
	ProviderName = "mke"

	// TestingVersion if the provider version is this, then the provider
	//   will start in testing mode, where it never reaches the API.
	TestingVersion = "test"
)

Variables

View Source
var (
	ErrCBNotFound = errors.New("Client bundle was not found on the MKE host cluster")

	// DummyClientBundle client bundle used during unit ACC tests
	DummyClientBundle client.ClientBundle = client.ClientBundle{
		ID: "id",

		PrivateKey: "my-priv-key",
		PublicKey:  "my-pub-key",
		Cert:       "my-cert",
		CACert:     "my-ca-cert",
		Kube: &client.ClientBundleKube{
			Config:   "my-kube-yaml",
			Host:     "my-kube-host",
			Insecure: "my-kube-insecure",
		},
		Meta: client.ClientBundleMeta{
			Name:        "id",
			Description: "my-cluster",

			KubernetesHost:          "my-kube-host",
			KubernetesSkipVerifyTLS: true,

			DockerHost:          "my-docker-host",
			DockerSkipVerifyTLS: true,

			StackOrchestrator: "kubernetes",
		},
	}
)

Functions

func New

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

func NewMKEClientBundleResource

func NewMKEClientBundleResource() resource.Resource

func NewUserResource added in v0.2.1

func NewUserResource() resource.Resource

Types

type ClientBundleResourceModel

type ClientBundleResourceModel struct {
	Id types.String `tfsdk:"id"`

	Label types.String `tfsdk:"label"`

	PublicKey  types.String `tfsdk:"public_key"`
	PrivateKey types.String `tfsdk:"private_key"`
	ClientCert types.String `tfsdk:"client_cert"`
	CaCert     types.String `tfsdk:"ca_cert"`

	KubeYaml          types.String `tfsdk:"kube_yaml"`
	KubeHost          types.String `tfsdk:"kube_host"`
	KubeSkipTLSVerify types.Bool   `tfsdk:"kube_skiptlsverify"`

	DockerHost          types.String `tfsdk:"docker_host"`
	DockerSkipTLSVerify types.Bool   `tfsdk:"docker_skiptlsverify"`

	StackOrchestrator types.String `tfsdk:"orchestrator"`
}

ClientBundleResourceModel describes the resource data model.

func (*ClientBundleResourceModel) FromClientBundle

FromClientBundle interpret a client.ClientBundle to populate this model.

func (ClientBundleResourceModel) ToClientBundle

ToClientBundle convert this model to a client.ClientBundle struct.

type MKEClientBundleResource

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

func (*MKEClientBundleResource) Configure

func (*MKEClientBundleResource) Create

func (*MKEClientBundleResource) Delete

func (*MKEClientBundleResource) Metadata

func (*MKEClientBundleResource) Read

func (*MKEClientBundleResource) Schema

func (*MKEClientBundleResource) Update

type MKEProvider

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

MKEProvider defines the provider implementation.

func (*MKEProvider) Configure

func (*MKEProvider) DataSources

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

func (*MKEProvider) Metadata

func (*MKEProvider) Resources

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

func (*MKEProvider) Schema

type MKEProviderModel

type MKEProviderModel struct {
	Endpoint  types.String `tfsdk:"endpoint"`
	Username  types.String `tfsdk:"username"`
	Password  types.String `tfsdk:"password"`
	UnsafeSSL types.Bool   `tfsdk:"unsafe_ssl_client"`
	// contains filtered or unexported fields
}

MKEProviderModel describes the provider data model.

func (MKEProviderModel) Client

func (pm MKEProviderModel) Client() (client.Client, error)

Client MKE client generation.

func (MKEProviderModel) TestingMode

func (pm MKEProviderModel) TestingMode() bool

TestingMode is the provider in testing mode?

type UserResource added in v0.2.1

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

func (*UserResource) Configure added in v0.2.1

func (*UserResource) Create added in v0.2.1

func (*UserResource) Delete added in v0.2.1

func (*UserResource) ImportState added in v0.2.1

func (*UserResource) Metadata added in v0.2.1

func (*UserResource) Read added in v0.2.1

func (*UserResource) Schema added in v0.2.1

func (*UserResource) Update added in v0.2.1

type UserResourceModel added in v0.2.1

type UserResourceModel struct {
	Name     types.String `tfsdk:"name"`
	Password types.String `tfsdk:"password"`
	FullName types.String `tfsdk:"full_name"`
	IsAdmin  types.Bool   `tfsdk:"is_admin"`
	IsActive types.Bool   `tfsdk:"is_active"`
	Id       types.String `tfsdk:"id"`
}

Jump to

Keyboard shortcuts

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