bpmetadata

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:   "metadata",
	Short: "Generates blueprint metatda",
	Long:  `Generates metadata.yaml for specified blueprint`,
	Args:  cobra.NoArgs,
	RunE:  generate,
}
View Source
var Log = log.New()

bpmetadata log15 handler

Functions

func WriteMetadata

func WriteMetadata(obj *BlueprintMetadata, bpPath string) error

Types

type BlueprintActuationTool

type BlueprintActuationTool struct {
	Flavor  string `json:"type,omitempty" yaml:"type,omitempty"`
	Version string `json:",omitempty" yaml:",omitempty"`
}

type BlueprintArchitecture added in v0.5.4

type BlueprintArchitecture struct {
	DiagramUrl  string `json:"diagram,omitempty" yaml:"diagram,omitempty"`
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
}

type BlueprintCloudProduct added in v0.5.4

type BlueprintCloudProduct struct {
	ProductId   string `json:",omitempty" yaml:",omitempty"`
	PageUrl     string `json:",omitempty" yaml:",omitempty"`
	Label       string `json:",omitempty" yaml:",omitempty"`
	LocationKey bool   `json:",omitempty" yaml:",omitempty"`
}

type BlueprintContent

type BlueprintContent struct {
	// Diagrams are manually entered
	Architecture  BlueprintArchitecture  `json:"architecture,omitempty" yaml:"architecture,omitempty"`
	Diagrams      []BlueprintDiagram     `json:",omitempty" yaml:",omitempty"`
	Documentation []BlueprintListContent `json:",omitempty" yaml:",omitempty"`
	SubBlueprints []BlueprintMiscContent `json:"subBlueprints,omitempty" yaml:"subBlueprints,omitempty"`
	Examples      []BlueprintMiscContent `json:",omitempty" yaml:",omitempty"`
}

BlueprintContent defines the detail for blueprint related content such as related documentation, diagrams, examples etc.

type BlueprintCostEstimate added in v0.5.4

type BlueprintCostEstimate struct {
	Description string `json:",omitempty" yaml:",omitempty"`
	Url         string `json:",omitempty" yaml:",omitempty"`
}

type BlueprintDescription

type BlueprintDescription struct {
	Tagline      string   `json:",omitempty" yaml:",omitempty"`
	Detailed     string   `json:",omitempty" yaml:",omitempty"`
	PreDeploy    string   `json:"preDeploy,omitempty" yaml:"preDeploy,omitempty"`
	Architecture []string `json:"architecture,omitempty" yaml:"architecture,omitempty"`
}

type BlueprintDiagram

type BlueprintDiagram struct {
	Name        string
	AltText     string `json:"altText,omitempty" yaml:"altText,omitempty"`
	Description string `json:",omitempty" yaml:",omitempty"`
}

BlueprintDiagram is manually entered

type BlueprintInfo

type BlueprintInfo struct {
	Title          string
	Source         *BlueprintRepoDetail
	Version        string                  `json:",omitempty" yaml:",omitempty"`
	ActuationTool  BlueprintActuationTool  `json:"actuationTool,omitempty" yaml:"actuationTool,omitempty"`
	Description    *BlueprintDescription   `json:",omitempty" yaml:",omitempty"`
	Icon           string                  `json:",omitempty" yaml:",omitempty"`
	DeploymentTime BlueprintTimeEstimate   `json:"deploymentTime,omitempty" yaml:"deploymentTime,omitempty"`
	CostEstimate   BlueprintCostEstimate   `json:",omitempty" yaml:",omitempty"`
	CloudProducts  []BlueprintCloudProduct `json:",omitempty" yaml:",omitempty"`
	QuotaDetails   []BlueprintQuotaDetail  `json:",omitempty" yaml:",omitempty"`
}

BlueprintInfo defines informational detail for the blueprint

type BlueprintInterface

type BlueprintInterface struct {
	Variables []BlueprintVariable `json:",omitempty" yaml:",omitempty"`
	// VariableGroups are manually entered
	VariableGroups []BlueprintVariableGroup `json:"variableGroups,omitempty" yaml:"variableGroups,omitempty"`
	Outputs        []BlueprintOutput        `json:",omitempty" yaml:",omitempty"`
}

BlueprintInterface the input and output variables for the blueprint

type BlueprintListContent

type BlueprintListContent struct {
	Title string
	Url   string `json:",omitempty" yaml:",omitempty"`
}

type BlueprintMetadata

type BlueprintMetadata struct {
	Meta yaml.ResourceMeta `json:",inline" yaml:",inline"`
	Spec BlueprintMetadataSpec
}

BlueprintMetadata defines the overall structure for blueprint metadata details

func CreateBlueprintMetadata

func CreateBlueprintMetadata(bpPath string, bpMetadataObj *BlueprintMetadata) (*BlueprintMetadata, error)

func UnmarshalMetadata

func UnmarshalMetadata(bpPath string) (*BlueprintMetadata, error)

type BlueprintMetadataSpec

type BlueprintMetadataSpec struct {
	Info         BlueprintInfo         `json:",inline" yaml:",inline"`
	Content      BlueprintContent      `json:",inline" yaml:",inline"`
	Interfaces   BlueprintInterface    `json:",inline" yaml:",inline"`
	Requirements BlueprintRequirements `json:",inline" yaml:",inline"`
}

BlueprintMetadataSpec defines the spec portion of the blueprint metadata

type BlueprintMiscContent

type BlueprintMiscContent struct {
	Name     string
	Location string
}

type BlueprintOutput

type BlueprintOutput struct {
	Name        string
	Description string `json:",omitempty" yaml:",omitempty"`
}

type BlueprintQuotaDetail added in v0.5.4

type BlueprintQuotaDetail struct {
	// DynamicVariable, if provided, associates the provided input variable
	// with the corresponding resource and quota type. In its absence, the quota
	// detail is assumed to be fixed.
	DynamicVariable string `json:"variable,omitempty" yaml:"variable,omitempty"`

	// ResourceType is the type of resource the quota will be applied to i.e.
	// GCE Instance or Disk etc.
	ResourceType QuotaResourceType `json:"type" yaml:"type"`

	// QuotaType is a key/value pair of the actual quotas an their corresponding
	// values.
	QuotaType map[QuotaType]string `json:"quotaType" yaml:"quotaType"`
}

type BlueprintRepoDetail

type BlueprintRepoDetail struct {
	Repo       string
	SourceType string `json:"sourceType" yaml:"sourceType"`
}

type BlueprintRequirements

type BlueprintRequirements struct {
	Roles    []BlueprintRoles
	Services []string
}

BlueprintRequirements defines the roles required and the assocaited services that need to be enabled to provision blueprint resources

type BlueprintRoles

type BlueprintRoles struct {
	Level string
	Roles []string
}

type BlueprintTimeEstimate added in v0.5.4

type BlueprintTimeEstimate struct {
	ConfigurationSecs int `json:"configuration,omitempty" yaml:"configuration,omitempty"`
	DeploymentSecs    int `json:"deployment,omitempty" yaml:"deployment,omitempty"`
}

type BlueprintVariable

type BlueprintVariable struct {
	Name        string
	Description string      `json:",omitempty" yaml:",omitempty"`
	VarType     string      `yaml:"type"`
	Default     interface{} `json:",omitempty" yaml:",omitempty"`
	Required    bool
}

type BlueprintVariableGroup

type BlueprintVariableGroup struct {
	Name        string
	Description string `json:",omitempty" yaml:",omitempty"`
	Variables   []string
}

BlueprintVariableGroup is manually entered

type QuotaResourceType added in v0.5.4

type QuotaResourceType string
const (
	GceInstance QuotaResourceType = "GCE_INSTANCE"
	GceDisk     QuotaResourceType = "GCE_DISK"
)

type QuotaType added in v0.5.4

type QuotaType string
const (
	MachineType QuotaType = "MACHINE_TYPE"
	Cpus        QuotaType = "CPUs"
	DiskType    QuotaType = "DISK_TYPE"
	DiskSizeGb  QuotaType = "SIZE_GB"
)

Jump to

Keyboard shortcuts

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