Skip to content

Commit

Permalink
connections and related proto changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bharathkkb committed Jul 1, 2024
1 parent 4b68110 commit 32e80f4
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
56 changes: 56 additions & 0 deletions cli/bpmetadata/proto/bpmetadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,21 @@ message BlueprintRequirements {
// Gen: auto-generated - all services required for the blueprint in test/setup/main.tf
// as "activate_apis" in the project module.
repeated string services = 2; // @gotags: json:"services,omitempty" yaml:"services,omitempty"

// Required provider versions.
// Gen: auto-generated from required providers block.
repeated ProviderVersion provider_versions = 3; // @gotags: json:"versions,omitempty" yaml:"providerVersions,omitempty"
}

// ProviderVersion defines the required version for a provider.
message ProviderVersion {
// Provider source of form [hostname]/namespace/name.
// Hostname is optional defaulting to Terraform registry.
// Gen: auto-generated from required providers block.
string source = 1; // @gotags: json:"source,omitempty" yaml:"source,omitempty"
// Version constraint string.
// Gen: auto-generated from required providers block.
string version = 2; // @gotags: json:"version,omitempty" yaml:"version,omitempty"
}

// BlueprintUI is the top-level structure for holding UI specific metadata.
Expand Down Expand Up @@ -453,6 +468,43 @@ message BlueprintVariable {
string var_type = 3; // @gotags: json:"varType,omitempty" yaml:"varType,omitempty"
google.protobuf.Value default_value = 4; // @gotags: json:"defaultValue,omitempty" yaml:"defaultValue,omitempty"
bool required = 5; // @gotags: json:"required,omitempty" yaml:"required,omitempty"
// Incoming connections to this variable.
// Gen: manually-authored.
repeated BlueprintConnection connections = 6; // @gotags: json:"connections,omitempty" yaml:"connections,omitempty"
}

// Defines an incoming connection from a blueprint.
message BlueprintConnection {
// Source of the connection.
// Gen: manually-authored.
ConnectionSource source = 1; // @gotags: json:"source,omitempty" yaml:"source,omitempty"
// Connection specifications.
// Gen: manually-authored.
ConnectionSpec spec = 2; // @gotags: json:"spec,omitempty" yaml:"spec,omitempty"
}

// Defines the source of a connection.
message ConnectionSource {
// Source of the connection. Defined using the same format as module source
// of form [hostname]/namespace/name/provider for registry references and
// unprefixed github.com URLs for github references.
// Gen: manually-authored.
string source = 1; // @gotags: json:"source,omitempty" yaml:"source,omitempty"
// Version constraint syntax using the same format as module version
// constraints.
// Gen: manually-authored.
string version = 2; // @gotags: json:"version,omitempty" yaml:"version,omitempty"
}

// Defines the specifications of a connection.
message ConnectionSpec {
// Output expression identifying output being connected to variable.
// This can be the output name or more complex expression like attribuite notation.
// Gen: manually-authored.
string output_expr = 1; // @gotags: json:"outputExpr,omitempty" yaml:"outputExpr,omitempty"
// Optional dot separated attribuite notation to connect to a specific object field of the input variable.
// Gen: manually-authored.
optional string input_path = 2; // @gotags: json:"inputPath,omitempty" yaml:"inputPath,omitempty"
}

// BlueprintVariableGroup is manually entered.
Expand All @@ -465,6 +517,10 @@ message BlueprintVariableGroup {
message BlueprintOutput {
string name = 1; // @gotags: json:"name" yaml:"name"
string description = 2; // @gotags: json:"description,omitempty" yaml:"description,omitempty"
// Serialized type representation of the output value.
// Gen: manually-authored but will be automated in the future.
optional google.protobuf.Value type = 3; // @gotags: json:"type,omitempty" yaml:"type,omitempty"

}

message BlueprintRoles {
Expand Down
27 changes: 27 additions & 0 deletions cli/bpmetadata/proto/bpmetadata_ui.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ syntax = "proto3";

package google.cloud.config.bpmetadata;

import "google/protobuf/struct.proto";
import "bpmetadata_ui_ext.proto";

// TODO: update copybara configuration for go to java package transformation
Expand Down Expand Up @@ -126,6 +127,22 @@ message DisplayVariable {
// Optional.
// Gen: manually-authored
string boolean_group = 20; // @gotags: json:"booleanGroup,omitempty" yaml:"booleanGroup,omitempty"

// Alternate default value.
// Gen: manually-authored.
message AlternateDefault {
// Type of the alternate default.
enum AlternateType {
// Default
ALTERNATE_TYPE_UNSPECIFIED = 0;
// A more secure default.
ALTERNATE_TYPE_SECURITY = 1;
}
AlternateType type = 1; // @gotags: json:"type,omitempty" yaml:"type,omitempty"
// Value of the alternate default.
google.protobuf.Value value = 2; // @gotags: json:"value,omitempty" yaml:"value,omitempty"
}
repeated AlternateDefault alt_defaults = 21; // @gotags: json:"altDefaults,omitempty" yaml:"altDefaults,omitempty"
}

message ValueLabel {
Expand Down Expand Up @@ -248,4 +265,14 @@ message DisplayOutput {
// label to display on the Output action button
// Gen: manually-authored
string label = 3; // @gotags: json:"label,omitempty" yaml:"label,omitEmpty"

// Visibility defines how the output is exposed.
// Gen: manually-authored.
enum Visibility {
// Default
VISIBILITY_UNSPECIFIED = 0;
// Expose output as root module output.
VISIBILITY_ROOT = 1;
}
Visibility visibility = 4; // @gotags: json:"visibility,omitempty" yaml:"visibility,omitEmpty"
}

0 comments on commit 32e80f4

Please sign in to comment.