provider

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MPL-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERROR_GENERIC_CLIENT_ERROR   = "client error"
	ERROR_GENERIC_API_ERROR      = "api error"
	ERROR_AUTHENTICATION_FAILURE = "Not authorized. Check api key and secret."
	ERROR_ENDPOINT_LOOKUP        = "Could not fetch endpoints for meshStack."

	CONTENT_TYPE_PROJECT = "application/vnd.meshcloud.api.meshproject.v2.hal+json"
)

Variables

This section is empty.

Functions

func New

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

func NewBuildingBlockDataSource

func NewBuildingBlockDataSource() datasource.DataSource

func NewBuildingBlockResource

func NewBuildingBlockResource() resource.Resource

func NewProjectDataSource

func NewProjectDataSource() datasource.DataSource

func NewProjectResource

func NewProjectResource() resource.Resource

NewProjectResource is a helper function to simplify the provider implementation.

Types

type BuildingBlockResource

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

func (*BuildingBlockResource) Configure

func (*BuildingBlockResource) Create

func (*BuildingBlockResource) Delete

func (*BuildingBlockResource) ImportState

func (*BuildingBlockResource) Metadata

func (*BuildingBlockResource) Read

func (*BuildingBlockResource) Schema

func (*BuildingBlockResource) Update

type BuildingBlockResourceModel

type BuildingBlockResourceModel struct {
	Uuid              types.String `tfsdk:"uuid"`
	DefinitionUUid    types.String `tfsdk:"definition_uuid"`
	DefinitionVersion types.Int64  `tfsdk:"definition_version"`
	TenantIdentifier  types.String `tfsdk:"tenant_identifier"`
	DisplayName       types.String `tfsdk:"display_name"`
	Inputs            types.Map    `tfsdk:"inputs"`
	Parents           types.Set    `tfsdk:"parents"`
}

type MeshBuildingBlock

type MeshBuildingBlock struct {
	ApiVersion string                    `json:"apiVersion" tfsdk:"api_version"`
	Kind       string                    `json:"kind" tfsdk:"kind"`
	Metadata   MeshBuildingBlockMetadata `json:"metadata" tfsdk:"metadata"`
	Spec       MeshBuildingBlockSpec     `json:"spec" tfsdk:"spec"`
	Status     MeshBuildingBlockStatus   `json:"status" tfsdk:"status"`
}

type MeshBuildingBlockIO

type MeshBuildingBlockIO struct {
	Key       string      `json:"key" tfsdk:"key"`
	Value     interface{} `json:"value" tfsdk:"value"`
	ValueType string      `json:"valueType" tfsdk:"value_type"`
}

type MeshBuildingBlockMetadata

type MeshBuildingBlockMetadata struct {
	Uuid                string  `json:"uuid" tfsdk:"uuid"`
	DefinitionUuid      string  `json:"definitionUuid" tfsdk:"definition_uuid"`
	DefinitionVersion   int64   `json:"definitionVersion" tfsdk:"definition_version"`
	TenantIdentifier    string  `json:"tenantIdentifier" tfsdk:"tenant_identifier"`
	ForcePurge          bool    `json:"forcePurge" tfsdk:"force_purge"`
	CreatedOn           string  `json:"createdOn" tfsdk:"created_on"`
	MarkedForDeletionOn *string `json:"markedForDeletionOn" tfsdk:"marked_for_deletion_on"`
	MarkedForDeletionBy *string `json:"markedForDeletionBy" tfsdk:"marked_for_deletion_by"`
}

type MeshBuildingBlockParent

type MeshBuildingBlockParent struct {
	BuildingBlockUuid string `json:"buildingBlockUuid" tfsdk:"buildingblock_uuid"`
	DefinitionUuid    string `json:"definitionUuid" tfsdk:"definition_uuid"`
}

type MeshBuildingBlockSpec

type MeshBuildingBlockSpec struct {
	DisplayName          string                    `json:"displayName" tfsdk:"display_name"`
	Inputs               []MeshBuildingBlockIO     `json:"inputs" tfsdk:"inputs"`
	ParentBuildingBlocks []MeshBuildingBlockParent `json:"parentBuildingBlocks" tfsdk:"parent_building_blocks"`
}

type MeshBuildingBlockStatus

type MeshBuildingBlockStatus struct {
	Status  string                `json:"status" tfsdk:"status"`
	Outputs []MeshBuildingBlockIO `json:"outputs" tfsdk:"outputs"`
}

type MeshProject

type MeshProject struct {
	ApiVersion string              `json:"apiVersion" tfsdk:"api_version"`
	Kind       string              `json:"kind" tfsdk:"kind"`
	Metadata   MeshProjectMetadata `json:"metadata" tfsdk:"metadata"`
	Spec       MeshProjectSpec     `json:"spec" tfsdk:"spec"`
}

type MeshProjectCreate

type MeshProjectCreate struct {
	Metadata MeshProjectCreateMetadata `json:"metadata" tfsdk:"metadata"`
	Spec     MeshProjectSpec           `json:"spec" tfsdk:"spec"`
}

type MeshProjectCreateMetadata

type MeshProjectCreateMetadata struct {
	Name             string `json:"name" tfsdk:"name"`
	OwnedByWorkspace string `json:"ownedByWorkspace" tfsdk:"owned_by_workspace"`
}

type MeshProjectMetadata

type MeshProjectMetadata struct {
	Name             string  `json:"name" tfsdk:"name"`
	OwnedByWorkspace string  `json:"ownedByWorkspace" tfsdk:"owned_by_workspace"`
	CreatedOn        string  `json:"createdOn" tfsdk:"created_on"`
	DeletedOn        *string `json:"deletedOn" tfsdk:"deleted_on"`
}

type MeshProjectSpec

type MeshProjectSpec struct {
	DisplayName                       string              `json:"displayName" tfsdk:"display_name"`
	Tags                              map[string][]string `json:"tags" tfsdk:"tags"`
	PaymentMethodIdentifier           *string             `json:"paymentMethodIdentifier" tfsdk:"payment_method_identifier"`
	SubstitutePaymentMethodIdentifier *string             `json:"substitutePaymentMethodIdentifier" tfsdk:"substitute_payment_method_identifier"`
}

type MeshStackProvider

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

func (*MeshStackProvider) Configure

func (*MeshStackProvider) DataSources

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

func (*MeshStackProvider) Metadata

func (*MeshStackProvider) Resources

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

func (*MeshStackProvider) Schema

type MeshStackProviderClient

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

TODO this will be an abstraction that does the login call, get a token and then use this token in the Auth header.

func NewClient

func NewClient(rootUrl *url.URL, apiKey string, apiSecret string) (*MeshStackProviderClient, error)

func (*MeshStackProviderClient) CreateProject

func (c *MeshStackProviderClient) CreateProject(project *MeshProjectCreate) (*MeshProject, error)

func (*MeshStackProviderClient) DeleteProject

func (c *MeshStackProviderClient) DeleteProject(workspace string, name string) error

func (*MeshStackProviderClient) ReadBuildingBlock

func (c *MeshStackProviderClient) ReadBuildingBlock(uuid string) (*MeshBuildingBlock, error)

func (*MeshStackProviderClient) ReadProject

func (c *MeshStackProviderClient) ReadProject(workspace string, name string) (*MeshProject, error)

func (*MeshStackProviderClient) UpdateProject

func (c *MeshStackProviderClient) UpdateProject(project *MeshProjectCreate) (*MeshProject, error)

type MeshStackProviderModel

type MeshStackProviderModel struct {
	Endpoint  types.String `tfsdk:"endpoint"`
	ApiKey    types.String `tfsdk:"apikey"`
	ApiSecret types.String `tfsdk:"apisecret"`
}

Jump to

Keyboard shortcuts

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