deployment

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const LookupPrefix = "modm."
View Source
const LookupTagKeyPublisherPrefix = "publisher."

Variables

This section is empty.

Functions

func DryRun

func DryRun(ctx context.Context, azureDeployment *AzureDeployment) (*sdk.DryRunResult, error)

Types

type ArmDeployer added in v1.2.0

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

func (*ArmDeployer) Begin added in v1.2.0

func (deployer *ArmDeployer) Begin(ctx context.Context, azureDeployment AzureDeployment) (*BeginAzureDeploymentResult, error)

func (*ArmDeployer) Cancel added in v1.3.0

func (*ArmDeployer) Redeploy added in v1.2.0

func (deployer *ArmDeployer) Redeploy(ctx context.Context, ad AzureRedeployment) (*AzureDeploymentResult, error)

func (*ArmDeployer) Type added in v1.2.0

func (deployer *ArmDeployer) Type() DeploymentType

func (*ArmDeployer) Wait added in v1.2.0

func (deployer *ArmDeployer) Wait(ctx context.Context, resumeToken *ResumeToken) (*AzureDeploymentResult, error)

type AzureCancelDeployment added in v1.3.0

type AzureCancelDeployment struct {
	SubscriptionId    string `json:"subscriptionId"`
	Location          string `json:"location"`
	ResourceGroupName string `json:"resourceGroupName"`
	DeploymentName    string `json:"deploymentName"`
}

type AzureCancelDeploymentResult added in v1.3.0

type AzureCancelDeploymentResult struct {
	CancelSubmitted bool `json:"cancelSubmitted"`
}

type AzureDeployment

type AzureDeployment struct {
	SubscriptionId    string                  `json:"subscriptionId"`
	Location          string                  `json:"location"`
	ResourceGroupName string                  `json:"resourceGroupName"`
	DeploymentName    string                  `json:"deploymentName"`
	DeploymentType    DeploymentType          `json:"deploymentType"`
	Template          AzureTemplate           `json:"template"`
	Params            AzureTemplateParameters `json:"templateParams"`
	Tags              map[string]*string      `json:"tags"`
	ResumeToken       string                  `json:"resumeToken"`
	OperationId       uuid.UUID               `json:"operationId"` //the modm operationId that triggered the deployment
}

func (*AzureDeployment) GetDeploymentType

func (ad *AzureDeployment) GetDeploymentType() DeploymentType

func (*AzureDeployment) GetParameters added in v1.2.0

func (ad *AzureDeployment) GetParameters() map[string]interface{}

func (*AzureDeployment) GetParametersFromTemplate added in v1.2.0

func (ad *AzureDeployment) GetParametersFromTemplate() map[string]interface{}

type AzureDeploymentResult

type AzureDeploymentResult struct {
	ID                string                 `json:"id"`
	CorrelationID     string                 `json:"correlationId"`
	Duration          string                 `json:"duration"`
	Timestamp         time.Time              `json:"timestamp"`
	ProvisioningState string                 `json:"provisioningState"`
	Outputs           map[string]interface{} `json:"outputs"`
	Status            ExecutionStatus
}

type AzureRedeployment added in v0.2.1

type AzureRedeployment struct {
	SubscriptionId    string             `json:"subscriptionId"`
	Location          string             `json:"location"`
	ResourceGroupName string             `json:"resourceGroupName"`
	DeploymentName    string             `json:"deploymentName"`
	Tags              map[string]*string `json:"tags"`
	OperationId       uuid.UUID          `json:"operationId"` //the modm operationId that triggered the deployment
}

type AzureTemplate added in v1.2.0

type AzureTemplate map[string]interface{}

type AzureTemplateParameters added in v1.2.0

type AzureTemplateParameters map[string]interface{}

type BeginAzureDeploymentResult added in v1.2.0

type BeginAzureDeploymentResult struct {
	CorrelationID *string     `json:"correlationId" mapstructure:"correlationId"`
	ResumeToken   ResumeToken `json:"resumeToken" mapstructure:"resumeToken"`
}

type Deployer

type Deployer interface {
	Begin(ctx context.Context, azureDeployment AzureDeployment) (*BeginAzureDeploymentResult, error)
	Wait(ctx context.Context, resumeToken *ResumeToken) (*AzureDeploymentResult, error)

	Redeploy(ctx context.Context, d AzureRedeployment) (*AzureDeploymentResult, error)
	Cancel(ctx context.Context, d AzureCancelDeployment) (*AzureCancelDeploymentResult, error)

	// gets the template type the deployer is set to
	Type() DeploymentType
}

deploys templates to Azure

func NewDeployer added in v1.2.0

func NewDeployer(deploymentType DeploymentType, subscriptionId string) (Deployer, error)

type DeploymentType

type DeploymentType int64
const (
	DeploymentTypeARM DeploymentType = iota
	// terraform not supported yet. stubbed only
	DeploymentTypeTerraform
)

type DryRunValidationInput

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

func (DryRunValidationInput) GetParams added in v1.0.1

func (i DryRunValidationInput) GetParams() map[string]interface{}

func (DryRunValidationInput) GetTemplateParams added in v1.0.1

func (i DryRunValidationInput) GetTemplateParams() map[string]interface{}

type DryRunValidator

type DryRunValidator interface {
	// Validates dry run input
	//	returns:
	//		- dryRunError: error that will be returned if there were no runtime errors, AND the validator failed. If there were no errors
	//			and the validator passed, then this will be nil
	//		- error: runtime error, so there won't be a dry run error returned by the validator
	//
	Validate(input DryRunValidationInput) (*sdk.DryRunError, error)
}

type ExecutionStatus

type ExecutionStatus string
const (
	Started           ExecutionStatus = "Started"
	Failed            ExecutionStatus = "Failed"
	PermanentlyFailed ExecutionStatus = "PermanentlyFailed"
	Succeeded         ExecutionStatus = "Succeeded"
	Restart           ExecutionStatus = "Restart"
	Restarted         ExecutionStatus = "Restarted"
	RestartTimedOut   ExecutionStatus = "RestartTimedOut"
	Canceled          ExecutionStatus = "Canceled"
)

type LookupTag added in v1.3.4

type LookupTag struct {
	Key   LookupTagKey
	Value *string
}

type LookupTagKey

type LookupTagKey string
const (

	// The unique id for modm to identify something
	LookupTagKeyId LookupTagKey = "modm.id"

	// the unique id for an instance of any operation executed by modm against one or more resources
	LookupTagKeyOperationId LookupTagKey = "modm.operation.id"

	// the unique id for an instance of any operation executed by modm against one or more resources
	LookupTagKeyDeploymentId LookupTagKey = "modm.deployment.id"

	// whether or not to send events, if this is not set to true, then the event will not be sent
	LookupTagKeyEvents LookupTagKey = "modm.events"

	// the friendly name of the resource used for logging
	LookupTagKeyName LookupTagKey = "modm.name"

	// the stage id reference. Use is on a resource that's a child of a 1-level parent deployment
	LookupTagKeyStageId LookupTagKey = "modm.stage.id"

	// the stage id reference. Use is on a resource that's a child of a 1-level parent deployment
	LookupTagKeyRetry LookupTagKey = "modm.retry"
)

type LookupTags

type LookupTags map[LookupTagKey]*string

type ResumeToken added in v1.2.0

type ResumeToken struct {
	SubscriptionId string `json:"subscriptionId" mapstructure:"subscriptionId"`
	Value          string `json:"value" mapstructure:"value"`
}

the resume token to resume waiting for an azure operation

type ValidatorFunc added in v1.0.0

type ValidatorFunc func(input DryRunValidationInput) (*sdk.DryRunError, error)

func (ValidatorFunc) Validate added in v1.0.0

Jump to

Keyboard shortcuts

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