Documentation ¶
Index ¶
- func PopulateRegistryFromFiles(r Registry, files []string) error
- type AutogenSpec
- type BaseResource
- type BillingMeteringDriver
- type BillingMeteringTestConfig
- type ConnectionInfo
- type CostExpectation
- type DeploymentManagerAutogenTemplate
- type DeploymentManagerTemplate
- type Expectation
- type GceImage
- type Image
- type Metadata
- type PackageInfo
- type PackerGceImageBuilder
- type PartnerIntegrationTestConfig
- type Reference
- type Registry
- type Resource
- type SaasListingTestTemplate
- type TypeMeta
- type Unstructured
- type UsageExpectation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PopulateRegistryFromFiles ¶
PopulateRegistryFromFiles registers resources declared in list of files
Types ¶
type AutogenSpec ¶
type AutogenSpec struct { // Deployment Spec is documented in https://github.com/GoogleCloudPlatform/marketplace-tools/docs/autogen-reference.md DeploymentSpec map[string]interface{} `yaml:"deploymentSpec"` PackageInfo PackageInfo `yaml:"packageInfo"` }
AutogenSpec is defines the spec used for auto-generating deployment packages.
type BaseResource ¶
BaseResource contains fields should be present in all Resources. This struct should be embedded in types implementing the resource interface.
func (*BaseResource) GetDependencies ¶
func (rs *BaseResource) GetDependencies() (r []Reference)
GetDependencies returns the dependencies for the BaseResource
func (*BaseResource) GetReference ¶
func (rs *BaseResource) GetReference() Reference
GetReference computes the reference to the Resource.
type BillingMeteringDriver ¶
type BillingMeteringDriver struct { DriverCommand string `json:"driverCommand"` PlanID string `json:"planId"` Expectation Expectation `json:"expectation"` ConnectionInfo ConnectionInfo `json:"connectionInfo"` }
BillingMeteringDriver is the billing metering driver is executed by the test framework
type BillingMeteringTestConfig ¶
type BillingMeteringTestConfig struct {
Driver BillingMeteringDriver `json:"driver"`
}
BillingMeteringTestConfig has the parameters that are needed to run the billing metering test
type ConnectionInfo ¶
ConnectionInfo has the needed information to connect to BigQuery billing export
type CostExpectation ¶
type CostExpectation struct { Min float64 `json:"min"` Max float64 `json:"max"` Currency string `json:"currency"` }
CostExpectation has metrics that are compared by the metering validator
type DeploymentManagerAutogenTemplate ¶
type DeploymentManagerAutogenTemplate struct { BaseResource Spec AutogenSpec // contains filtered or unexported fields }
DeploymentManagerAutogenTemplate generates a deployment manager template given an autogen.yaml file.
type DeploymentManagerTemplate ¶
type DeploymentManagerTemplate struct { BaseResource DeploymentManagerRef Reference // Uploads to gcs if file path prefixed with "gs://". Otherwise will // zip to given local file path. ZipFilePath string }
DeploymentManagerTemplate saves a referenced Deployment Manager template to GCS or the local filesystem
func (*DeploymentManagerTemplate) Apply ¶
func (dm *DeploymentManagerTemplate) Apply(registry Registry, dryRun bool) error
Apply uploads a Deployment Manager template to GCS.
func (*DeploymentManagerTemplate) GetDependencies ¶
func (dm *DeploymentManagerTemplate) GetDependencies() (r []Reference)
GetDependencies returns dependencies for DeploymentManagerTemplate
type Expectation ¶
type Expectation struct { SkuID string `json:"skuId"` UsageExpectation UsageExpectation `json:"usageExpectation"` CostExpectation CostExpectation `json:"costExpectation"` }
Expectation outlines the results from running the user provided driver
type GceImage ¶
type GceImage struct { BaseResource // References another GCE Image resource ImageRef Reference // References a builder resource which handles the actual creation // of the GCE Image BuilderRef Reference Image Image }
GceImage represents a Google Compute Engine image. One of BuilderRef or ImageRef must be specified
type Image ¶
type Image struct { ProjectID string `json:"projectId"` NamePartsSeparator string NameParts []string }
Image defines the location of the GCE Image when published
type PackageInfo ¶
type PackageInfo struct { // Version of combined software components Version string // Name and version of OS OsInfo component `yaml:"osInfo"` // Names and versions of software components Components []component }
PackageInfo describes the software packaged in a deployable solution. PackageInfo is metadata displayed on the VM solution details page in the GCP marketplace console.
type PackerGceImageBuilder ¶
type PackerGceImageBuilder struct { BaseResource Builder struct { Script struct { File string } } Tests []struct { Name string Script struct { File string } } }
PackerGceImageBuilder uses Packer to create a GCEImage when applied
type PartnerIntegrationTestConfig ¶
type PartnerIntegrationTestConfig struct { Provider string `json:"provider"` ProductExternalName string `json:"productExternalName"` BillingAccount string `json:"billingAccount"` Plans []string `json:"plans"` ApproveEntitlementTimeoutSeconds int32 `json:"approveEntitlementTimeoutSeconds"` ApprovePlanChangeTimeoutSeconds int32 `json:"approvePlanChangeTimeoutSeconds"` BillingMeteringTestConfig []BillingMeteringTestConfig `json:"billingMeteringTestConfig"` }
PartnerIntegrationTestConfig has the parameters that need to go into the test container.
type Reference ¶
Reference allows a Resource to reference another Resource as part of its specification. The combination of Group, Kind, Name MUST be unique for all applied resources.
type Registry ¶
type Registry interface { RegisterResource(resource Resource, workingDirectory string) GetExecutor() exec.Interface GetResource(reference Reference) Resource ResolveFilePath(rs Resource, path string) (string, error) Apply(dryRun bool) error Test(dryRun bool) error }
Registry stores references to all resources and can apply all resources in the registry
func NewRegistry ¶
NewRegistry creates a registry that stores references to all resources
type Resource ¶
type Resource interface { Apply(registry Registry, dryRun bool) error Test(registry Registry, dryRun bool) error GetReference() Reference GetDependencies() []Reference }
Resource represents a KRM resource that can be applied
func UnstructuredToResource ¶
func UnstructuredToResource(obj Unstructured) (Resource, error)
UnstructuredToResource converts Unstructured to a specific type implementing the Resource interface, using the TypeMeta from the Unstructured object.
type SaasListingTestTemplate ¶
type SaasListingTestTemplate struct { BaseResource IntegrationTestConfig PartnerIntegrationTestConfig `yaml:"integrationTestConfig"` CredFilePath string `yaml:"credFilePath"` }
SaasListingTestTemplate has the parameters for a SaasListing integration test.
type TypeMeta ¶
TypeMeta describes an individual KRM resource with strings representing the type of the object and its API schema version.
type Unstructured ¶
type Unstructured map[string]interface{}
Unstructured is used to unmarshal json/yaml KRM Resources and extract the TypeMeta, such that the KRM Resource can be unmarshalled to a specific type implementing the Resource interface.
type UsageExpectation ¶
type UsageExpectation struct { Min float64 `json:"min"` Max float64 `json:"max"` BaseUnits string `json:"baseUnits"` }
UsageExpectation has usage metrics that are compared by the metering validator