diff --git a/cli/Makefile b/cli/Makefile index 8bb390ebcf5..6bb0b51928e 100644 --- a/cli/Makefile +++ b/cli/Makefile @@ -1,7 +1,7 @@ SHELL := /bin/bash # Changing this value will trigger a new release -VERSION=v0.5.3 +VERSION=v0.5.4 BINARY=bin/cft GITHUB_REPO=github.com/GoogleCloudPlatform/cloud-foundation-toolkit PLATFORMS := linux windows darwin diff --git a/cli/bpmetadata/types.go b/cli/bpmetadata/types.go index e45af60cb7c..4782519842c 100644 --- a/cli/bpmetadata/types.go +++ b/cli/bpmetadata/types.go @@ -1,6 +1,8 @@ package bpmetadata -import "sigs.k8s.io/kustomize/kyaml/yaml" +import ( + "sigs.k8s.io/kustomize/kyaml/yaml" +) // BlueprintMetadata defines the overall structure for blueprint metadata details type BlueprintMetadata struct { @@ -18,18 +20,23 @@ type BlueprintMetadataSpec struct { // BlueprintInfo defines informational detail for the blueprint 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"` + 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"` } // BlueprintContent defines the detail for blueprint related content such as // related documentation, diagrams, examples etc. 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"` @@ -68,11 +75,64 @@ type BlueprintDescription struct { Architecture []string `json:"architecture,omitempty" yaml:"architecture,omitempty"` } +type BlueprintTimeEstimate struct { + ConfigurationSecs int `json:"configuration,omitempty" yaml:"configuration,omitempty"` + DeploymentSecs int `json:"deployment,omitempty" yaml:"deployment,omitempty"` +} + +type BlueprintCostEstimate struct { + Description string `json:",omitempty" yaml:",omitempty"` + Url string `json:",omitempty" yaml:",omitempty"` +} + +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 QuotaResourceType string + +const ( + GceInstance QuotaResourceType = "GCE_INSTANCE" + GceDisk QuotaResourceType = "GCE_DISK" +) + +type QuotaType string + +const ( + MachineType QuotaType = "MACHINE_TYPE" + Cpus QuotaType = "CPUs" + DiskType QuotaType = "DISK_TYPE" + DiskSizeGb QuotaType = "SIZE_GB" +) + +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 BlueprintMiscContent struct { Name string Location string } +type BlueprintArchitecture struct { + DiagramUrl string `json:"diagram,omitempty" yaml:"diagram,omitempty"` + Description string `json:"description,omitempty" yaml:"description,omitempty"` +} + // BlueprintDiagram is manually entered type BlueprintDiagram struct { Name string