recipecontext

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RecipeContextParamKey represents the key for the recipe context object parameter.
	RecipeContextParamKey = "context"
)

Variables

View Source
var (
	ErrParseFormat = "failed to parse %s: %q while building the recipe context parameter %w"
)

Functions

This section is empty.

Types

type AzureResourceGroup

type AzureResourceGroup struct {
	// Name represents the resource name.
	Name string `json:"name"`
	// ID represents fully qualified resource group name.
	ID string `json:"id"`
}

AzureResourceGroup contains Azure Resource Group provider information.

type AzureSubscription

type AzureSubscription struct {
	// SubscriptionID represents the id of subscription.
	SubscriptionID string `json:"subscriptionId"`
	// ID represents fully qualified subscription id.
	ID string `json:"id"`
}

AzureSubscription contains Azure Subscription provider information.

type Context

type Context struct {
	// Resource represents the resource information of the deploying recipe resource.
	Resource Resource `json:"resource,omitempty"`
	// Application represents environment resource information.
	Application ResourceInfo `json:"application,omitempty"`
	// Environment represents environment resource information.
	Environment ResourceInfo `json:"environment,omitempty"`
	// Runtime represents Kubernetes Runtime configuration.
	Runtime recipes.RuntimeConfiguration `json:"runtime,omitempty"`
	// Azure represents Azure provider scope.
	Azure *ProviderAzure `json:"azure,omitempty"`
	// AWS represents AWS provider scope.
	AWS *ProviderAWS `json:"aws,omitempty"`
}

Context represents the context information which accesses portable resource properties. Recipe template authors can leverage the RecipeContext parameter to access portable resource properties to generate name and properties that are unique for the portable resource calling the recipe.

func New

func New(metadata *recipes.ResourceMetadata, config *recipes.Configuration) (*Context, error)

New creates the context parameter for the recipe with the portable resource, environment, and application info

type ProviderAWS

type ProviderAWS struct {
	// Region represents the region of the AWS account.
	Region string `json:"region"`
	// Account represents the account id of the AWS account.
	Account string `json:"account"`
}

ProviderAWS contains AWS Account provider scope for recipe context.

type ProviderAzure

type ProviderAzure struct {
	// ResourceGroup represents the resource group information.
	ResourceGroup AzureResourceGroup `json:"resourceGroup,omitempty"`
	// Subscription represents the subscription information.
	Subscription AzureSubscription `json:"subscription,omitempty"`
}

ProviderAzure contains Azure provider scope for recipe context.

type Resource

type Resource struct {
	// ResourceInfo represents name and id of the resource
	ResourceInfo
	// Type represents the resource type, this will be a namespace/type combo. Ex. Applications.Core/Environment
	Type string `json:"type"`
}

Resource contains the information needed to deploy a recipe. In the case the resource is a portable resource, it represents the resource's id, name and type.

type ResourceInfo

type ResourceInfo struct {
	// Name represents the resource name.
	Name string `json:"name"`
	// ID represents fully qualified resource id.
	ID string `json:"id"`
}

ResourceInfo represents name and id of the resource

Jump to

Keyboard shortcuts

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