deploymentsv1

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlueprintInstanceDestroyRequestPayload

type BlueprintInstanceDestroyRequestPayload struct {
	// The ID of the change set to use to destroy the blueprint instance.
	// When destroying a blueprint instance,
	// a change set is used instead of the destroy process re-computing the changes
	// that need to be applied.
	ChangeSetID string `json:"changeSetId" validate:"required"`
	// If true, destroying the blueprint instance will be treated as a rollback
	// for the initial deployment of the blueprint instance.
	// This will usually be set to true when rolling back a recent first time
	// deployment that needs to be rolled back due to failure in a parent
	// blueprint instance.
	Rollback bool `json:"rollback"`
	// Config values for the destroy process
	// that will be used in plugins.
	Config *types.BlueprintOperationConfig `json:"config"`
}

BlueprintInstanceDestroyRequestPayload represents the payload for destroying a blueprint instance.

type BlueprintInstanceRequestPayload

type BlueprintInstanceRequestPayload struct {
	resolve.BlueprintDocumentInfo
	// The user-defined name for the blueprint instance.
	// This is required when creating a new blueprint instance and must be unique.
	// This should be left empty when updating an existing instance.
	InstanceName string `json:"instanceName"`
	// The ID of the change set to use to deploy the blueprint instance.
	// When deploying blueprint instances,
	// a change set is used instead of the deployment process re-computing the changes
	// that need to be applied.
	// The source blueprint document is still required in addition to a change set to finish
	// resolving substitutions that can only be resolved at deploy time and for deployment
	// orchestration.
	// The source blueprint document is not used to compute changes at the deployment stage.
	ChangeSetID string `json:"changeSetId" validate:"required"`
	// If true, and a new blueprint instance is being created,
	// the creation of the blueprint instance will be treated as a rollback operation
	// for a previously destroyed blueprint instance.
	// If true, and an existing blueprint instance is being updated,
	// the update will be treated as a rollback operation for the previous state.
	Rollback bool `json:"rollback"`
	// Config values for the deployment process
	// that will be used in plugins and passed into the blueprint.
	Config *types.BlueprintOperationConfig `json:"config"`
}

BlueprintInstanceRequestPayload represents the payload for creating and updating blueprint instances which in turn starts the deployment process for new or existing blueprint instances.

type Controller

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

Controller handles deployment-related HTTP requests including change staging and deployment events over Server-Sent Events (SSE).

func NewController

func NewController(
	changesetRetentionPeriod time.Duration,
	deploymentTimeout time.Duration,
	deps *typesv1.Dependencies,
) *Controller

NewController creates a new deployments Controller instance with the provided dependencies.

func (*Controller) CleanupChangesetsHandler

func (c *Controller) CleanupChangesetsHandler(
	w http.ResponseWriter,
	r *http.Request,
)

CleanupChangesetsHandler is the handler for the POST /deployments/changes/cleanup endpoint that cleans up change sets that are older than the configured retention period.

func (*Controller) CreateBlueprintInstanceHandler

func (c *Controller) CreateBlueprintInstanceHandler(
	w http.ResponseWriter,
	r *http.Request,
)

CreateBlueprintInstanceHandler is the handler for the POST /deployments/instances endpoint that creates a new blueprint instance and begins the deployment process for the new blueprint instance.

func (*Controller) CreateChangesetHandler

func (c *Controller) CreateChangesetHandler(
	w http.ResponseWriter,
	r *http.Request,
)

CreateChangesetHandler is the handler for the POST /deployments/changes endpoint that creates a new change set and starts the change staging process.

func (*Controller) DestroyBlueprintInstanceHandler

func (c *Controller) DestroyBlueprintInstanceHandler(
	w http.ResponseWriter,
	r *http.Request,
)

DestroyBlueprintInstanceHandler is the handler for the POST /deployments/instances/{id}/destroy endpoint that destroys a blueprint instance. This is a `POST` request as the destroy operation relies on inputs including configuration values that need to be provided in the request body. The {id} path parameter can be either an instance ID or an instance name.

func (*Controller) GetBlueprintInstanceExportsHandler

func (c *Controller) GetBlueprintInstanceExportsHandler(
	w http.ResponseWriter,
	r *http.Request,
)

GetBlueprintInstanceExportsHandler is the handler for the GET /deployments/instances/{id}/exports endpoint that retrieves the exports of a blueprint instance. The {id} path parameter can be either an instance ID or an instance name.

func (*Controller) GetBlueprintInstanceHandler

func (c *Controller) GetBlueprintInstanceHandler(
	w http.ResponseWriter,
	r *http.Request,
)

GetBlueprintInstanceHandler is the handler for the GET /deployments/instances/{id} endpoint that retrieves the full state of a blueprint instance. The {id} path parameter can be either an instance ID or an instance name.

func (*Controller) GetChangesetHandler

func (c *Controller) GetChangesetHandler(
	w http.ResponseWriter,
	r *http.Request,
)

GetChangesetHandler is the handler for the GET /deployments/changes/{id} endpoint that retrieves a change set including its status and changes if available.

func (*Controller) StreamChangesetEventsHandler

func (c *Controller) StreamChangesetEventsHandler(w http.ResponseWriter, r *http.Request)

StreamChangesetEventsHandler is the handler for the GET /deployments/changes/{id}/stream endpoint that streams change staging events to the client using Server-Sent Events (SSE).

func (*Controller) StreamDeploymentEventsHandler

func (c *Controller) StreamDeploymentEventsHandler(w http.ResponseWriter, r *http.Request)

StreamDeploymentEventsHandler is the handler for the GET /deployments/instances/{id}/stream endpoint that streams deployment events to the client using Server-Sent Events (SSE). The {id} path parameter can be either an instance ID or an instance name.

func (*Controller) UpdateBlueprintInstanceHandler

func (c *Controller) UpdateBlueprintInstanceHandler(
	w http.ResponseWriter,
	r *http.Request,
)

UpdateBlueprintInstanceHandler is the handler for the PATCH /deployments/instances/{id} endpoint that updates an existing blueprint instance and begins the deployment process for the updates described in the specified change set. The {id} path parameter can be either an instance ID or an instance name.

type CreateChangesetRequestPayload

type CreateChangesetRequestPayload struct {
	resolve.BlueprintDocumentInfo
	// The ID of an existing blueprint instance to stage changes for.
	// If this is not provided and an instance name is not provided,
	// a change set for a new blueprint instance deployment will be created.
	// This should be left empty if the `instanceName` field is provided.
	InstanceID string `json:"instanceId"`
	// The user-defined name of an existing blueprint instance to stage changes for.
	// If this is not provided an an instance ID is not provided, a change set for a new
	// blueprint instance deployment will be created.
	// This should be left empty if the `instanceId` field is provided.
	InstanceName string `json:"instanceName"`
	// If true, the change set will be created for a destroy operation.
	// This will only be used if the `instanceId` or `instanceName` fields are provided.
	// If this is not provided, the default value will be false.
	Destroy bool `json:"destroy"`
	// Config values for the change staging process
	// that will be used in plugins and passed into the blueprint.
	Config *types.BlueprintOperationConfig `json:"config"`
}

CreateChangesetRequestPayload represents the payload for creating a new change set and start a new change staging process.

Jump to

Keyboard shortcuts

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