provider

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MPL-2.0 Imports: 26 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"
	CONTENT_TYPE_TENANT  = "application/vnd.meshcloud.api.meshtenant.v3.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.

func NewTenantDataSource added in v0.2.0

func NewTenantDataSource() datasource.DataSource

func NewTenantResource added in v0.2.0

func NewTenantResource() resource.Resource

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) CreateTenant added in v0.2.0

func (c *MeshStackProviderClient) CreateTenant(tenant *MeshTenantCreate) (*MeshTenant, error)

func (*MeshStackProviderClient) DeleteProject

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

func (*MeshStackProviderClient) DeleteTenant added in v0.2.0

func (c *MeshStackProviderClient) DeleteTenant(workspace string, project string, platform 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) ReadTenant added in v0.2.0

func (c *MeshStackProviderClient) ReadTenant(workspace string, project string, platform string) (*MeshTenant, 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"`
}

type MeshTenant added in v0.2.0

type MeshTenant struct {
	ApiVersion string             `json:"apiVersion" tfsdk:"api_version"`
	Kind       string             `json:"kind" tfsdk:"kind"`
	Metadata   MeshTenantMetadata `json:"metadata" tfsdk:"metadata"`
	Spec       MeshTenantSpec     `json:"spec" tfsdk:"spec"`
}

type MeshTenantCreate added in v0.2.0

type MeshTenantCreate struct {
	Metadata MeshTenantCreateMetadata `json:"metadata" tfsdk:"metadata"`
	Spec     MeshTenantCreateSpec     `json:"spec" tfsdk:"spec"`
}

type MeshTenantCreateMetadata added in v0.2.0

type MeshTenantCreateMetadata struct {
	OwnedByProject     string `json:"ownedByProject" tfsdk:"owned_by_project"`
	OwnedByWorkspace   string `json:"ownedByWorkspace" tfsdk:"owned_by_workspace"`
	PlatformIdentifier string `json:"platformIdentifier" tfsdk:"platform_identifier"`
}

type MeshTenantCreateSpec added in v0.2.0

type MeshTenantCreateSpec struct {
	LocalId               *string            `json:"localId" tfsdk:"local_id"`
	LandingZoneIdentifier *string            `json:"landingZoneIdentifier" tfsdk:"landing_zone_identifier"`
	Quotas                *[]MeshTenantQuota `json:"quotas" tfsdk:"quotas"`
}

type MeshTenantMetadata added in v0.2.0

type MeshTenantMetadata struct {
	OwnedByProject     string              `json:"ownedByProject" tfsdk:"owned_by_project"`
	OwnedByWorkspace   string              `json:"ownedByWorkspace" tfsdk:"owned_by_workspace"`
	PlatformIdentifier string              `json:"platformIdentifier" tfsdk:"platform_identifier"`
	AssignedTags       map[string][]string `json:"assignedTags" tfsdk:"assigned_tags"`
	DeletedOn          *string             `json:"deletedOn" tfsdk:"deleted_on"`
}

type MeshTenantQuota added in v0.2.0

type MeshTenantQuota struct {
	Key   string `json:"key" tfsdk:"key"`
	Value int64  `json:"value" tfsdk:"value"`
}

type MeshTenantSpec added in v0.2.0

type MeshTenantSpec struct {
	LocalId               *string           `json:"localId" tfsdk:"local_id"`
	LandingZoneIdentifier string            `json:"landingZoneIdentifier" tfsdk:"landing_zone_identifier"`
	Quotas                []MeshTenantQuota `json:"quotas" tfsdk:"quotas"`
}

Jump to

Keyboard shortcuts

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