Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: add labels to instances (#17635)

Vincent Huang0884eb5a33fb
diff --git a/backend/api/v1/common.go b/backend/api/v1/common.go
index 78dd65fb9c..c5076b9522 100644
--- a/backend/api/v1/common.go
+++ b/backend/api/v1/common.go
@@ -47,6 +47,32 @@ func isValidResourceID(resourceID string) bool {
return resourceIDMatcher.MatchString(resourceID)
}
+// validateLabels validates labels according to the requirements.
+// Labels must follow these rules:
+// - Maximum 64 labels allowed
+// - Keys must start with lowercase letter, then contain only lowercase letters, numbers, underscores, and dashes (max 63 chars)
+// - Values can contain letters, numbers, underscores, and dashes (max 63 chars, can be empty)
+func validateLabels(labels map[string]string) error {
+ if len(labels) > 64 {
+ return errors.Errorf("maximum 64 labels allowed, got %d", len(labels))
+ }
+ // Key pattern: must start with lowercase letter, then lowercase letters, numbers, underscores, dashes (max 63 chars)
+ keyPattern := `^[a-z][a-z0-9_-]{0,62}$`
+ // Value pattern: letters, numbers, underscores, dashes (max 63 chars, can be empty)
+ valuePattern := `^[a-zA-Z0-9_-]{0,63}$`
+ keyRegex := regexp.MustCompile(keyPattern)
+ valueRegex := regexp.MustCompile(valuePattern)
+ for key, value := range labels {
+ if !keyRegex.MatchString(key) {
+ return errors.Errorf("invalid label key %q: must start with lowercase letter and contain only lowercase letters, numbers, underscores, and dashes (max 63 chars)", key)
+ }
+ if !valueRegex.MatchString(value) {
+ return errors.Errorf("invalid label value %q for key %q: must contain only letters, numbers, underscores, and dashes (max 63 chars)", value, key)
+ }
+ }
+ return nil
+}
+
// getEBNFTokens will parse the simple filter such as `project = "abc" | "def".` to {project: ["abc", "def"]} .
func getEBNFTokens(filter, filterKey string) ([]string, error) {
grammar, err := ebnf.Parse("", strings.NewReader(filter))
diff --git a/backend/api/v1/instance_service.go b/backend/api/v1/instance_service.go
index e68f310ee7..1853cbe4f6 100644
--- a/backend/api/v1/instance_service.go
+++ b/backend/api/v1/instance_service.go
@@ -88,6 +88,13 @@ func parseListInstanceFilter(filter string) (*store.ListResourceFilter, error) {
var positionalArgs []any
parseToSQL := func(variable, value any) (string, error) {
+ // Handle label filters like "labels.org_group"
+ if varStr, ok := variable.(string); ok {
+ if labelKey, ok := strings.CutPrefix(varStr, "labels."); ok {
+ return parseToLabelFilterSQL("instance.metadata", labelKey, value)
+ }
+ }
+
switch variable {
case "name":
positionalArgs = append(positionalArgs, value.(string))
@@ -142,6 +149,50 @@ func parseListInstanceFilter(filter string) (*store.ListResourceFilter, error) {
}
}
+ getSubConditionFromExpr := func(expr celast.Expr, getFilter func(expr celast.Expr) (string, error), join string) (string, error) {
+ var args []string
+ for _, arg := range expr.AsCall().Args() {
+ filter, err := getFilter(arg)
+ if err != nil {
+ return "", err
+ }
+ args = append(args, fmt.Sprintf("(%s)", filter))
+ }
+ return strings.Join(args, fmt.Sprintf(" %s ", join)), nil
+ }
+
+ parseToEngineSQL := func(expr celast.Expr, relation string) (string, error) {
+ variable, value := getVariableAndValueFromExpr(expr)
+ if variable != "engine" {
+ return "", connect.NewError(connect.CodeInvalidArgument, errors.Errorf(`only "engine" support "engine in [xx]"/"!(engine in [xx])" operator`))
+ }
+ if value == nil {
+ return "", connect.NewError(connect.CodeInvalidArgument, errors.Errorf(`empty value %v for "%s" operator`, value, relation))
+ }
+ list, ok := value.([]any)
+ if !ok {
+ return "", connect.NewError(connect.CodeInvalidArgument, errors.Errorf(`expect list, got %T, hint: filter engine in ["xx"]`, value))
+ }
+ if len(list) == 0 {
+ return "", connect.NewError(connect.CodeInvalidArgument, errors.Errorf(`empty value %v for "%s" operator`, value, relation))
+ }
+
+ var engineList []string
+ for _, raw := range list {
+ engine, ok := raw.(string)
+ if !ok {
+ return "", connect.NewError(connect.CodeInvalidArgument, errors.Errorf(`expect string, got %T for engine %v`, raw, raw))
+ }
+ v1Engine, ok := v1pb.Engine_value[engine]
+ if !ok {
+ return "", connect.NewError(connect.CodeInvalidArgument, errors.Errorf(`invalid engine filter %q`, engine))
+ }
+ storeEngine := convertEngine(v1pb.Engine(v1Engine))
+ engineList = append(engineList, fmt.Sprintf("'%s'", storeEngine))
+ }
+ return fmt.Sprintf("instance.metadata->>'engine' %s (%s)", relation, strings.Join(engineList, ",")), nil
+ }
+
getFilter = func(expr celast.Expr) (string, error) {
switch expr.Kind() {
case celast.CallKind:
@@ -180,7 +231,13 @@ func parseListInstanceFilter(filter string) (*store.ListResourceFilter, error) {
return "", connect.NewError(connect.CodeInvalidArgument, errors.Errorf("unsupport variable %q", variable))
}
case celoperators.In:
- return parseToEngineSQL(expr, "IN")
+ variable, value := getVariableAndValueFromExpr(expr)
+ if variable == "engine" {
+ return parseToEngineSQL(expr, "IN")
+ } else if labelKey, ok := strings.CutPrefix(variable, "labels."); ok {
+ return parseToLabelFilterSQL("instance.metadata", labelKey, value)
+ }
+ return "", connect.NewError(connect.CodeInvalidArgument, errors.Errorf("unsupport variable %q", variable))
case celoperators.LogicalNot:
args := expr.AsCall().Args()
if len(args) != 1 {
@@ -297,6 +354,10 @@ func (s *InstanceService) CreateInstance(ctx context.Context, req *connect.Reque
return nil, err
}
+ if err := validateLabels(req.Msg.Instance.Labels); err != nil {
+ return nil, connect.NewError(connect.CodeInvalidArgument, err)
+ }
+
instanceMessage, err := convertInstanceToInstanceMessage(req.Msg.InstanceId, req.Msg.Instance)
if err != nil {
return nil, connect.NewError(connect.CodeInvalidArgument, err)
@@ -511,6 +572,11 @@ func (s *InstanceService) UpdateInstance(ctx context.Context, req *connect.Reque
patch.Metadata.MaximumConnections = req.Msg.Instance.MaximumConnections
case "sync_databases":
patch.Metadata.SyncDatabases = req.Msg.Instance.SyncDatabases
+ case "labels":
+ if err := validateLabels(req.Msg.Instance.Labels); err != nil {
+ return nil, connect.NewError(connect.CodeInvalidArgument, err)
+ }
+ patch.Metadata.Labels = req.Msg.Instance.Labels
default:
return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf(`unsupported update_mask "%s"`, path))
}
@@ -1096,6 +1162,7 @@ func convertInstanceMessage(instance *store.InstanceMessage) *v1pb.Instance {
SyncDatabases: instance.Metadata.GetSyncDatabases(),
Roles: convertInstanceRoles(instance, instance.Metadata.GetRoles()),
LastSyncTime: instance.Metadata.GetLastSyncTime(),
+ Labels: instance.Metadata.GetLabels(),
}
}
@@ -1154,6 +1221,7 @@ func convertInstanceToInstanceMessage(instanceID string, instance *v1pb.Instance
SyncInterval: instance.GetSyncInterval(),
MaximumConnections: instance.GetMaximumConnections(),
SyncDatabases: instance.GetSyncDatabases(),
+ Labels: instance.GetLabels(),
},
}, nil
}
diff --git a/backend/api/v1/project_service.go b/backend/api/v1/project_service.go
index d8c74ebc54..52dc13963d 100644
--- a/backend/api/v1/project_service.go
+++ b/backend/api/v1/project_service.go
@@ -4,7 +4,6 @@ import (
"context"
"fmt"
"log/slog"
- "regexp"
"strconv"
"strings"
"time"
@@ -294,7 +293,7 @@ func (s *ProjectService) CreateProject(ctx context.Context, req *connect.Request
}
if req.Msg.Project != nil && req.Msg.Project.Labels != nil {
- if err := validateProjectLabels(req.Msg.Project.Labels); err != nil {
+ if err := validateLabels(req.Msg.Project.Labels); err != nil {
return nil, connect.NewError(connect.CodeInvalidArgument, err)
}
}
@@ -452,7 +451,7 @@ func (s *ProjectService) UpdateProject(ctx context.Context, req *connect.Request
projectSettings.ParallelTasksPerRollout = req.Msg.Project.ParallelTasksPerRollout
patch.Setting = projectSettings
case "labels":
- if err := validateProjectLabels(req.Msg.Project.Labels); err != nil {
+ if err := validateLabels(req.Msg.Project.Labels); err != nil {
return nil, connect.NewError(connect.CodeInvalidArgument, err)
}
projectSettings := project.Setting
@@ -1737,28 +1736,3 @@ func validateMember(member string) error {
}
return errors.Errorf("invalid user %s", member)
}
-
-// validateProjectLabels validates the project labels according to the requirements.
-func validateProjectLabels(labels map[string]string) error {
- if len(labels) > 64 {
- return errors.Errorf("maximum 64 labels allowed, got %d", len(labels))
- }
-
- // Key pattern: must start with lowercase letter, then lowercase letters, numbers, underscores, dashes (max 63 chars)
- keyPattern := `^[a-z][a-z0-9_-]{0,62}$`
- // Value pattern: letters, numbers, underscores, dashes (max 63 chars, can be empty)
- valuePattern := `^[a-zA-Z0-9_-]{0,63}$`
-
- keyRegex := regexp.MustCompile(keyPattern)
- valueRegex := regexp.MustCompile(valuePattern)
-
- for key, value := range labels {
- if !keyRegex.MatchString(key) {
- return errors.Errorf("invalid label key %q: must start with lowercase letter and contain only lowercase letters, numbers, underscores, and dashes (max 63 chars)", key)
- }
- if !valueRegex.MatchString(value) {
- return errors.Errorf("invalid label value %q for key %q: must contain only letters, numbers, underscores, and dashes (max 63 chars)", value, key)
- }
- }
- return nil
-}
diff --git a/backend/api/v1/project_service_test.go b/backend/api/v1/project_service_test.go
index a6b9b6dbe2..172a63ee89 100644
--- a/backend/api/v1/project_service_test.go
+++ b/backend/api/v1/project_service_test.go
@@ -440,7 +440,7 @@ func TestListProjectFilter(t *testing.T) {
}
}
-func TestValidateProjectLabels(t *testing.T) {
+func TestValidateLabels(t *testing.T) {
tests := []struct {
name string
labels map[string]string
@@ -524,7 +524,7 @@ func TestValidateProjectLabels(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
- err := validateProjectLabels(tt.labels)
+ err := validateLabels(tt.labels)
if tt.wantErr {
assert.Error(t, err)
if tt.errMsg != "" {
diff --git a/backend/generated-go/store/instance.pb.go b/backend/generated-go/store/instance.pb.go
index 7766ea18e2..511253b7b8 100644
--- a/backend/generated-go/store/instance.pb.go
+++ b/backend/generated-go/store/instance.pb.go
@@ -356,8 +356,11 @@ type Instance struct {
MysqlLowerCaseTableNames int32 `protobuf:"varint,10,opt,name=mysql_lower_case_table_names,json=mysqlLowerCaseTableNames,proto3" json:"mysql_lower_case_table_names,omitempty"`
LastSyncTime *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=last_sync_time,json=lastSyncTime,proto3" json:"last_sync_time,omitempty"`
Roles []*InstanceRole `protobuf:"bytes,12,rep,name=roles,proto3" json:"roles,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
+ // Labels are key-value pairs that can be attached to the instance.
+ // For example, { "org_group": "infrastructure", "environment": "production" }
+ Labels map[string]string `protobuf:"bytes,13,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *Instance) Reset() {
@@ -474,6 +477,13 @@ func (x *Instance) GetRoles() []*InstanceRole {
return nil
}
+func (x *Instance) GetLabels() map[string]string {
+ if x != nil {
+ return x.Labels
+ }
+ return nil
+}
+
// InstanceRole is the API message for instance role.
type InstanceRole struct {
state protoimpl.MessageState `protogen:"open.v1"`
@@ -1330,7 +1340,7 @@ type DataSource_AzureCredential struct {
func (x *DataSource_AzureCredential) Reset() {
*x = DataSource_AzureCredential{}
- mi := &file_store_instance_proto_msgTypes[6]
+ mi := &file_store_instance_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1342,7 +1352,7 @@ func (x *DataSource_AzureCredential) String() string {
func (*DataSource_AzureCredential) ProtoMessage() {}
func (x *DataSource_AzureCredential) ProtoReflect() protoreflect.Message {
- mi := &file_store_instance_proto_msgTypes[6]
+ mi := &file_store_instance_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1400,7 +1410,7 @@ type DataSource_AWSCredential struct {
func (x *DataSource_AWSCredential) Reset() {
*x = DataSource_AWSCredential{}
- mi := &file_store_instance_proto_msgTypes[7]
+ mi := &file_store_instance_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1412,7 +1422,7 @@ func (x *DataSource_AWSCredential) String() string {
func (*DataSource_AWSCredential) ProtoMessage() {}
func (x *DataSource_AWSCredential) ProtoReflect() protoreflect.Message {
- mi := &file_store_instance_proto_msgTypes[7]
+ mi := &file_store_instance_proto_msgTypes[8]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1480,7 +1490,7 @@ type DataSource_GCPCredential struct {
func (x *DataSource_GCPCredential) Reset() {
*x = DataSource_GCPCredential{}
- mi := &file_store_instance_proto_msgTypes[8]
+ mi := &file_store_instance_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1492,7 +1502,7 @@ func (x *DataSource_GCPCredential) String() string {
func (*DataSource_GCPCredential) ProtoMessage() {}
func (x *DataSource_GCPCredential) ProtoReflect() protoreflect.Message {
- mi := &file_store_instance_proto_msgTypes[8]
+ mi := &file_store_instance_proto_msgTypes[9]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1532,7 +1542,7 @@ type DataSource_Address struct {
func (x *DataSource_Address) Reset() {
*x = DataSource_Address{}
- mi := &file_store_instance_proto_msgTypes[9]
+ mi := &file_store_instance_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1544,7 +1554,7 @@ func (x *DataSource_Address) String() string {
func (*DataSource_Address) ProtoMessage() {}
func (x *DataSource_Address) ProtoReflect() protoreflect.Message {
- mi := &file_store_instance_proto_msgTypes[9]
+ mi := &file_store_instance_proto_msgTypes[10]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1588,7 +1598,7 @@ type DataSourceExternalSecret_AppRoleAuthOption struct {
func (x *DataSourceExternalSecret_AppRoleAuthOption) Reset() {
*x = DataSourceExternalSecret_AppRoleAuthOption{}
- mi := &file_store_instance_proto_msgTypes[11]
+ mi := &file_store_instance_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1600,7 +1610,7 @@ func (x *DataSourceExternalSecret_AppRoleAuthOption) String() string {
func (*DataSourceExternalSecret_AppRoleAuthOption) ProtoMessage() {}
func (x *DataSourceExternalSecret_AppRoleAuthOption) ProtoReflect() protoreflect.Message {
- mi := &file_store_instance_proto_msgTypes[11]
+ mi := &file_store_instance_proto_msgTypes[12]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1648,7 +1658,7 @@ var File_store_instance_proto protoreflect.FileDescriptor
const file_store_instance_proto_rawDesc = "" +
"\n" +
- "\x14store/instance.proto\x12\x0ebytebase.store\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x12store/common.proto\"\xbc\x04\n" +
+ "\x14store/instance.proto\x12\x0ebytebase.store\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x12store/common.proto\"\xb5\x05\n" +
"\bInstance\x12\x14\n" +
"\x05title\x18\x01 \x01(\tR\x05title\x12.\n" +
"\x06engine\x18\x02 \x01(\x0e2\x16.bytebase.store.EngineR\x06engine\x12\x1e\n" +
@@ -1664,7 +1674,11 @@ const file_store_instance_proto_rawDesc = "" +
"\x1cmysql_lower_case_table_names\x18\n" +
" \x01(\x05R\x18mysqlLowerCaseTableNames\x12@\n" +
"\x0elast_sync_time\x18\v \x01(\v2\x1a.google.protobuf.TimestampR\flastSyncTime\x122\n" +
- "\x05roles\x18\f \x03(\v2\x1c.bytebase.store.InstanceRoleR\x05roles\"\xce\x01\n" +
+ "\x05roles\x18\f \x03(\v2\x1c.bytebase.store.InstanceRoleR\x05roles\x12<\n" +
+ "\x06labels\x18\r \x03(\v2$.bytebase.store.Instance.LabelsEntryR\x06labels\x1a9\n" +
+ "\vLabelsEntry\x12\x10\n" +
+ "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
+ "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xce\x01\n" +
"\fInstanceRole\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name\x12.\n" +
"\x10connection_limit\x18\x02 \x01(\x05H\x00R\x0fconnectionLimit\x88\x01\x01\x12$\n" +
@@ -1828,7 +1842,7 @@ func file_store_instance_proto_rawDescGZIP() []byte {
}
var file_store_instance_proto_enumTypes = make([]protoimpl.EnumInfo, 6)
-var file_store_instance_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
+var file_store_instance_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
var file_store_instance_proto_goTypes = []any{
(DataSourceType)(0), // 0: bytebase.store.DataSourceType
(DataSource_AuthenticationType)(0), // 1: bytebase.store.DataSource.AuthenticationType
@@ -1842,42 +1856,44 @@ var file_store_instance_proto_goTypes = []any{
(*SASLConfig)(nil), // 9: bytebase.store.SASLConfig
(*KerberosConfig)(nil), // 10: bytebase.store.KerberosConfig
(*DataSourceExternalSecret)(nil), // 11: bytebase.store.DataSourceExternalSecret
- (*DataSource_AzureCredential)(nil), // 12: bytebase.store.DataSource.AzureCredential
- (*DataSource_AWSCredential)(nil), // 13: bytebase.store.DataSource.AWSCredential
- (*DataSource_GCPCredential)(nil), // 14: bytebase.store.DataSource.GCPCredential
- (*DataSource_Address)(nil), // 15: bytebase.store.DataSource.Address
- nil, // 16: bytebase.store.DataSource.ExtraConnectionParametersEntry
- (*DataSourceExternalSecret_AppRoleAuthOption)(nil), // 17: bytebase.store.DataSourceExternalSecret.AppRoleAuthOption
- (Engine)(0), // 18: bytebase.store.Engine
- (*durationpb.Duration)(nil), // 19: google.protobuf.Duration
- (*timestamppb.Timestamp)(nil), // 20: google.protobuf.Timestamp
+ nil, // 12: bytebase.store.Instance.LabelsEntry
+ (*DataSource_AzureCredential)(nil), // 13: bytebase.store.DataSource.AzureCredential
+ (*DataSource_AWSCredential)(nil), // 14: bytebase.store.DataSource.AWSCredential
+ (*DataSource_GCPCredential)(nil), // 15: bytebase.store.DataSource.GCPCredential
+ (*DataSource_Address)(nil), // 16: bytebase.store.DataSource.Address
+ nil, // 17: bytebase.store.DataSource.ExtraConnectionParametersEntry
+ (*DataSourceExternalSecret_AppRoleAuthOption)(nil), // 18: bytebase.store.DataSourceExternalSecret.AppRoleAuthOption
+ (Engine)(0), // 19: bytebase.store.Engine
+ (*durationpb.Duration)(nil), // 20: google.protobuf.Duration
+ (*timestamppb.Timestamp)(nil), // 21: google.protobuf.Timestamp
}
var file_store_instance_proto_depIdxs = []int32{
- 18, // 0: bytebase.store.Instance.engine:type_name -> bytebase.store.Engine
+ 19, // 0: bytebase.store.Instance.engine:type_name -> bytebase.store.Engine
8, // 1: bytebase.store.Instance.data_sources:type_name -> bytebase.store.DataSource
- 19, // 2: bytebase.store.Instance.sync_interval:type_name -> google.protobuf.Duration
- 20, // 3: bytebase.store.Instance.last_sync_time:type_name -> google.protobuf.Timestamp
+ 20, // 2: bytebase.store.Instance.sync_interval:type_name -> google.protobuf.Duration
+ 21, // 3: bytebase.store.Instance.last_sync_time:type_name -> google.protobuf.Timestamp
7, // 4: bytebase.store.Instance.roles:type_name -> bytebase.store.InstanceRole
- 0, // 5: bytebase.store.DataSource.type:type_name -> bytebase.store.DataSourceType
- 11, // 6: bytebase.store.DataSource.external_secret:type_name -> bytebase.store.DataSourceExternalSecret
- 1, // 7: bytebase.store.DataSource.authentication_type:type_name -> bytebase.store.DataSource.AuthenticationType
- 12, // 8: bytebase.store.DataSource.azure_credential:type_name -> bytebase.store.DataSource.AzureCredential
- 13, // 9: bytebase.store.DataSource.aws_credential:type_name -> bytebase.store.DataSource.AWSCredential
- 14, // 10: bytebase.store.DataSource.gcp_credential:type_name -> bytebase.store.DataSource.GCPCredential
- 9, // 11: bytebase.store.DataSource.sasl_config:type_name -> bytebase.store.SASLConfig
- 15, // 12: bytebase.store.DataSource.additional_addresses:type_name -> bytebase.store.DataSource.Address
- 2, // 13: bytebase.store.DataSource.redis_type:type_name -> bytebase.store.DataSource.RedisType
- 16, // 14: bytebase.store.DataSource.extra_connection_parameters:type_name -> bytebase.store.DataSource.ExtraConnectionParametersEntry
- 10, // 15: bytebase.store.SASLConfig.krb_config:type_name -> bytebase.store.KerberosConfig
- 3, // 16: bytebase.store.DataSourceExternalSecret.secret_type:type_name -> bytebase.store.DataSourceExternalSecret.SecretType
- 4, // 17: bytebase.store.DataSourceExternalSecret.auth_type:type_name -> bytebase.store.DataSourceExternalSecret.AuthType
- 17, // 18: bytebase.store.DataSourceExternalSecret.app_role:type_name -> bytebase.store.DataSourceExternalSecret.AppRoleAuthOption
- 5, // 19: bytebase.store.DataSourceExternalSecret.AppRoleAuthOption.type:type_name -> bytebase.store.DataSourceExternalSecret.AppRoleAuthOption.SecretType
- 20, // [20:20] is the sub-list for method output_type
- 20, // [20:20] is the sub-list for method input_type
- 20, // [20:20] is the sub-list for extension type_name
- 20, // [20:20] is the sub-list for extension extendee
- 0, // [0:20] is the sub-list for field type_name
+ 12, // 5: bytebase.store.Instance.labels:type_name -> bytebase.store.Instance.LabelsEntry
+ 0, // 6: bytebase.store.DataSource.type:type_name -> bytebase.store.DataSourceType
+ 11, // 7: bytebase.store.DataSource.external_secret:type_name -> bytebase.store.DataSourceExternalSecret
+ 1, // 8: bytebase.store.DataSource.authentication_type:type_name -> bytebase.store.DataSource.AuthenticationType
+ 13, // 9: bytebase.store.DataSource.azure_credential:type_name -> bytebase.store.DataSource.AzureCredential
+ 14, // 10: bytebase.store.DataSource.aws_credential:type_name -> bytebase.store.DataSource.AWSCredential
+ 15, // 11: bytebase.store.DataSource.gcp_credential:type_name -> bytebase.store.DataSource.GCPCredential
+ 9, // 12: bytebase.store.DataSource.sasl_config:type_name -> bytebase.store.SASLConfig
+ 16, // 13: bytebase.store.DataSource.additional_addresses:type_name -> bytebase.store.DataSource.Address
+ 2, // 14: bytebase.store.DataSource.redis_type:type_name -> bytebase.store.DataSource.RedisType
+ 17, // 15: bytebase.store.DataSource.extra_connection_parameters:type_name -> bytebase.store.DataSource.ExtraConnectionParametersEntry
+ 10, // 16: bytebase.store.SASLConfig.krb_config:type_name -> bytebase.store.KerberosConfig
+ 3, // 17: bytebase.store.DataSourceExternalSecret.secret_type:type_name -> bytebase.store.DataSourceExternalSecret.SecretType
+ 4, // 18: bytebase.store.DataSourceExternalSecret.auth_type:type_name -> bytebase.store.DataSourceExternalSecret.AuthType
+ 18, // 19: bytebase.store.DataSourceExternalSecret.app_role:type_name -> bytebase.store.DataSourceExternalSecret.AppRoleAuthOption
+ 5, // 20: bytebase.store.DataSourceExternalSecret.AppRoleAuthOption.type:type_name -> bytebase.store.DataSourceExternalSecret.AppRoleAuthOption.SecretType
+ 21, // [21:21] is the sub-list for method output_type
+ 21, // [21:21] is the sub-list for method input_type
+ 21, // [21:21] is the sub-list for extension type_name
+ 21, // [21:21] is the sub-list for extension extendee
+ 0, // [0:21] is the sub-list for field type_name
}
func init() { file_store_instance_proto_init() }
@@ -1905,7 +1921,7 @@ func file_store_instance_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_store_instance_proto_rawDesc), len(file_store_instance_proto_rawDesc)),
NumEnums: 6,
- NumMessages: 12,
+ NumMessages: 13,
NumExtensions: 0,
NumServices: 0,
},
diff --git a/backend/generated-go/store/instance_equal.pb.go b/backend/generated-go/store/instance_equal.pb.go
index 313607ff2a..e0a6236822 100644
--- a/backend/generated-go/store/instance_equal.pb.go
+++ b/backend/generated-go/store/instance_equal.pb.go
@@ -61,6 +61,18 @@ func (x *Instance) Equal(y *Instance) bool {
return false
}
}
+ if len(x.Labels) != len(y.Labels) {
+ return false
+ }
+ for k := range x.Labels {
+ _, ok := y.Labels[k]
+ if !ok {
+ return false
+ }
+ if x.Labels[k] != y.Labels[k] {
+ return false
+ }
+ }
return true
}
diff --git a/backend/generated-go/v1/instance_service.pb.go b/backend/generated-go/v1/instance_service.pb.go
index 623d97e08e..ee75f8df7a 100644
--- a/backend/generated-go/v1/instance_service.pb.go
+++ b/backend/generated-go/v1/instance_service.pb.go
@@ -410,6 +410,7 @@ type ListInstancesRequest struct {
// - host: the instance host, support "==" and ".matches()" operator.
// - port: the instance port, support "==" and ".matches()" operator.
// - project: the project full name in "projects/{id}" format, support "==" operator.
+ // - labels.{key}: the instance label, support "==" and "in" operators.
//
// For example:
// name == "sample instance"
@@ -426,6 +427,8 @@ type ListInstancesRequest struct {
// host.matches("127.0")
// port == "54321"
// port.matches("543")
+ // labels.org_group == "infrastructure"
+ // labels.environment in ["prod", "production"]
// project == "projects/sample-project"
// You can combine filter conditions like:
// name.matches("sample") && environment == "environments/test"
@@ -1396,7 +1399,10 @@ type Instance struct {
// Default empty, means sync all schemas & databases.
SyncDatabases []string `protobuf:"bytes,15,rep,name=sync_databases,json=syncDatabases,proto3" json:"sync_databases,omitempty"`
// The last time the instance was synced.
- LastSyncTime *timestamppb.Timestamp `protobuf:"bytes,16,opt,name=last_sync_time,json=lastSyncTime,proto3" json:"last_sync_time,omitempty"`
+ LastSyncTime *timestamppb.Timestamp `protobuf:"bytes,16,opt,name=last_sync_time,json=lastSyncTime,proto3" json:"last_sync_time,omitempty"`
+ // Labels are key-value pairs that can be attached to the instance.
+ // For example, { "org_group": "infrastructure", "environment": "production" }
+ Labels map[string]string `protobuf:"bytes,17,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@@ -1529,6 +1535,13 @@ func (x *Instance) GetLastSyncTime() *timestamppb.Timestamp {
return nil
}
+func (x *Instance) GetLabels() map[string]string {
+ if x != nil {
+ return x.Labels
+ }
+ return nil
+}
+
type DataSourceExternalSecret struct {
state protoimpl.MessageState `protogen:"open.v1"`
SecretType DataSourceExternalSecret_SecretType `protobuf:"varint,1,opt,name=secret_type,json=secretType,proto3,enum=bytebase.v1.DataSourceExternalSecret_SecretType" json:"secret_type,omitempty"`
@@ -2347,7 +2360,7 @@ type DataSourceExternalSecret_AppRoleAuthOption struct {
func (x *DataSourceExternalSecret_AppRoleAuthOption) Reset() {
*x = DataSourceExternalSecret_AppRoleAuthOption{}
- mi := &file_v1_instance_service_proto_msgTypes[24]
+ mi := &file_v1_instance_service_proto_msgTypes[25]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2359,7 +2372,7 @@ func (x *DataSourceExternalSecret_AppRoleAuthOption) String() string {
func (*DataSourceExternalSecret_AppRoleAuthOption) ProtoMessage() {}
func (x *DataSourceExternalSecret_AppRoleAuthOption) ProtoReflect() protoreflect.Message {
- mi := &file_v1_instance_service_proto_msgTypes[24]
+ mi := &file_v1_instance_service_proto_msgTypes[25]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2414,7 +2427,7 @@ type DataSource_AzureCredential struct {
func (x *DataSource_AzureCredential) Reset() {
*x = DataSource_AzureCredential{}
- mi := &file_v1_instance_service_proto_msgTypes[25]
+ mi := &file_v1_instance_service_proto_msgTypes[26]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2426,7 +2439,7 @@ func (x *DataSource_AzureCredential) String() string {
func (*DataSource_AzureCredential) ProtoMessage() {}
func (x *DataSource_AzureCredential) ProtoReflect() protoreflect.Message {
- mi := &file_v1_instance_service_proto_msgTypes[25]
+ mi := &file_v1_instance_service_proto_msgTypes[26]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2474,7 +2487,7 @@ type DataSource_AWSCredential struct {
func (x *DataSource_AWSCredential) Reset() {
*x = DataSource_AWSCredential{}
- mi := &file_v1_instance_service_proto_msgTypes[26]
+ mi := &file_v1_instance_service_proto_msgTypes[27]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2486,7 +2499,7 @@ func (x *DataSource_AWSCredential) String() string {
func (*DataSource_AWSCredential) ProtoMessage() {}
func (x *DataSource_AWSCredential) ProtoReflect() protoreflect.Message {
- mi := &file_v1_instance_service_proto_msgTypes[26]
+ mi := &file_v1_instance_service_proto_msgTypes[27]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2532,7 +2545,7 @@ type DataSource_GCPCredential struct {
func (x *DataSource_GCPCredential) Reset() {
*x = DataSource_GCPCredential{}
- mi := &file_v1_instance_service_proto_msgTypes[27]
+ mi := &file_v1_instance_service_proto_msgTypes[28]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2544,7 +2557,7 @@ func (x *DataSource_GCPCredential) String() string {
func (*DataSource_GCPCredential) ProtoMessage() {}
func (x *DataSource_GCPCredential) ProtoReflect() protoreflect.Message {
- mi := &file_v1_instance_service_proto_msgTypes[27]
+ mi := &file_v1_instance_service_proto_msgTypes[28]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2577,7 +2590,7 @@ type DataSource_Address struct {
func (x *DataSource_Address) Reset() {
*x = DataSource_Address{}
- mi := &file_v1_instance_service_proto_msgTypes[28]
+ mi := &file_v1_instance_service_proto_msgTypes[29]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2589,7 +2602,7 @@ func (x *DataSource_Address) String() string {
func (*DataSource_Address) ProtoMessage() {}
func (x *DataSource_Address) ProtoReflect() protoreflect.Message {
- mi := &file_v1_instance_service_proto_msgTypes[28]
+ mi := &file_v1_instance_service_proto_msgTypes[29]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2693,7 +2706,7 @@ const file_v1_instance_service_proto_rawDesc = "" +
"\vupdate_mask\x18\x03 \x01(\v2\x1a.google.protobuf.FieldMaskR\n" +
"updateMask\x12#\n" +
"\rvalidate_only\x18\x04 \x01(\bR\fvalidateOnly\x12#\n" +
- "\rallow_missing\x18\x05 \x01(\bR\fallowMissing\"\xbb\x05\n" +
+ "\rallow_missing\x18\x05 \x01(\bR\fallowMissing\"\xb1\x06\n" +
"\bInstance\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name\x12(\n" +
"\x05state\x18\x03 \x01(\x0e2\x12.bytebase.v1.StateR\x05state\x12\x14\n" +
@@ -2711,7 +2724,11 @@ const file_v1_instance_service_proto_rawDesc = "" +
"\rsync_interval\x18\r \x01(\v2\x19.google.protobuf.DurationR\fsyncInterval\x12/\n" +
"\x13maximum_connections\x18\x0e \x01(\x05R\x12maximumConnections\x12%\n" +
"\x0esync_databases\x18\x0f \x03(\tR\rsyncDatabases\x12E\n" +
- "\x0elast_sync_time\x18\x10 \x01(\v2\x1a.google.protobuf.TimestampB\x03\xe0A\x03R\flastSyncTime:0\xeaA-\n" +
+ "\x0elast_sync_time\x18\x10 \x01(\v2\x1a.google.protobuf.TimestampB\x03\xe0A\x03R\flastSyncTime\x129\n" +
+ "\x06labels\x18\x11 \x03(\v2!.bytebase.v1.Instance.LabelsEntryR\x06labels\x1a9\n" +
+ "\vLabelsEntry\x12\x10\n" +
+ "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
+ "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01:0\xeaA-\n" +
"\x15bytebase.com/Instance\x12\x14instances/{instance}B\x0e\n" +
"\f_environment\"\x84\a\n" +
"\x18DataSourceExternalSecret\x12Q\n" +
@@ -2879,7 +2896,7 @@ func file_v1_instance_service_proto_rawDescGZIP() []byte {
}
var file_v1_instance_service_proto_enumTypes = make([]protoimpl.EnumInfo, 6)
-var file_v1_instance_service_proto_msgTypes = make([]protoimpl.MessageInfo, 30)
+var file_v1_instance_service_proto_msgTypes = make([]protoimpl.MessageInfo, 31)
var file_v1_instance_service_proto_goTypes = []any{
(DataSourceType)(0), // 0: bytebase.v1.DataSourceType
(DataSourceExternalSecret_SecretType)(0), // 1: bytebase.v1.DataSourceExternalSecret.SecretType
@@ -2911,25 +2928,26 @@ var file_v1_instance_service_proto_goTypes = []any{
(*InstanceResource)(nil), // 27: bytebase.v1.InstanceResource
(*SASLConfig)(nil), // 28: bytebase.v1.SASLConfig
(*KerberosConfig)(nil), // 29: bytebase.v1.KerberosConfig
- (*DataSourceExternalSecret_AppRoleAuthOption)(nil), // 30: bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption
- (*DataSource_AzureCredential)(nil), // 31: bytebase.v1.DataSource.AzureCredential
- (*DataSource_AWSCredential)(nil), // 32: bytebase.v1.DataSource.AWSCredential
- (*DataSource_GCPCredential)(nil), // 33: bytebase.v1.DataSource.GCPCredential
- (*DataSource_Address)(nil), // 34: bytebase.v1.DataSource.Address
- nil, // 35: bytebase.v1.DataSource.ExtraConnectionParametersEntry
- (*fieldmaskpb.FieldMask)(nil), // 36: google.protobuf.FieldMask
- (State)(0), // 37: bytebase.v1.State
- (Engine)(0), // 38: bytebase.v1.Engine
- (*InstanceRole)(nil), // 39: bytebase.v1.InstanceRole
- (*durationpb.Duration)(nil), // 40: google.protobuf.Duration
- (*timestamppb.Timestamp)(nil), // 41: google.protobuf.Timestamp
- (*emptypb.Empty)(nil), // 42: google.protobuf.Empty
+ nil, // 30: bytebase.v1.Instance.LabelsEntry
+ (*DataSourceExternalSecret_AppRoleAuthOption)(nil), // 31: bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption
+ (*DataSource_AzureCredential)(nil), // 32: bytebase.v1.DataSource.AzureCredential
+ (*DataSource_AWSCredential)(nil), // 33: bytebase.v1.DataSource.AWSCredential
+ (*DataSource_GCPCredential)(nil), // 34: bytebase.v1.DataSource.GCPCredential
+ (*DataSource_Address)(nil), // 35: bytebase.v1.DataSource.Address
+ nil, // 36: bytebase.v1.DataSource.ExtraConnectionParametersEntry
+ (*fieldmaskpb.FieldMask)(nil), // 37: google.protobuf.FieldMask
+ (State)(0), // 38: bytebase.v1.State
+ (Engine)(0), // 39: bytebase.v1.Engine
+ (*InstanceRole)(nil), // 40: bytebase.v1.InstanceRole
+ (*durationpb.Duration)(nil), // 41: google.protobuf.Duration
+ (*timestamppb.Timestamp)(nil), // 42: google.protobuf.Timestamp
+ (*emptypb.Empty)(nil), // 43: google.protobuf.Empty
}
var file_v1_instance_service_proto_depIdxs = []int32{
24, // 0: bytebase.v1.ListInstancesResponse.instances:type_name -> bytebase.v1.Instance
24, // 1: bytebase.v1.CreateInstanceRequest.instance:type_name -> bytebase.v1.Instance
24, // 2: bytebase.v1.UpdateInstanceRequest.instance:type_name -> bytebase.v1.Instance
- 36, // 3: bytebase.v1.UpdateInstanceRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 37, // 3: bytebase.v1.UpdateInstanceRequest.update_mask:type_name -> google.protobuf.FieldMask
24, // 4: bytebase.v1.ListInstanceDatabaseRequest.instance:type_name -> bytebase.v1.Instance
13, // 5: bytebase.v1.BatchSyncInstancesRequest.requests:type_name -> bytebase.v1.SyncInstanceRequest
10, // 6: bytebase.v1.BatchUpdateInstancesRequest.requests:type_name -> bytebase.v1.UpdateInstanceRequest
@@ -2937,61 +2955,62 @@ var file_v1_instance_service_proto_depIdxs = []int32{
26, // 8: bytebase.v1.AddDataSourceRequest.data_source:type_name -> bytebase.v1.DataSource
26, // 9: bytebase.v1.RemoveDataSourceRequest.data_source:type_name -> bytebase.v1.DataSource
26, // 10: bytebase.v1.UpdateDataSourceRequest.data_source:type_name -> bytebase.v1.DataSource
- 36, // 11: bytebase.v1.UpdateDataSourceRequest.update_mask:type_name -> google.protobuf.FieldMask
- 37, // 12: bytebase.v1.Instance.state:type_name -> bytebase.v1.State
- 38, // 13: bytebase.v1.Instance.engine:type_name -> bytebase.v1.Engine
+ 37, // 11: bytebase.v1.UpdateDataSourceRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 38, // 12: bytebase.v1.Instance.state:type_name -> bytebase.v1.State
+ 39, // 13: bytebase.v1.Instance.engine:type_name -> bytebase.v1.Engine
26, // 14: bytebase.v1.Instance.data_sources:type_name -> bytebase.v1.DataSource
- 39, // 15: bytebase.v1.Instance.roles:type_name -> bytebase.v1.InstanceRole
- 40, // 16: bytebase.v1.Instance.sync_interval:type_name -> google.protobuf.Duration
- 41, // 17: bytebase.v1.Instance.last_sync_time:type_name -> google.protobuf.Timestamp
- 1, // 18: bytebase.v1.DataSourceExternalSecret.secret_type:type_name -> bytebase.v1.DataSourceExternalSecret.SecretType
- 2, // 19: bytebase.v1.DataSourceExternalSecret.auth_type:type_name -> bytebase.v1.DataSourceExternalSecret.AuthType
- 30, // 20: bytebase.v1.DataSourceExternalSecret.app_role:type_name -> bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption
- 0, // 21: bytebase.v1.DataSource.type:type_name -> bytebase.v1.DataSourceType
- 25, // 22: bytebase.v1.DataSource.external_secret:type_name -> bytebase.v1.DataSourceExternalSecret
- 4, // 23: bytebase.v1.DataSource.authentication_type:type_name -> bytebase.v1.DataSource.AuthenticationType
- 31, // 24: bytebase.v1.DataSource.azure_credential:type_name -> bytebase.v1.DataSource.AzureCredential
- 32, // 25: bytebase.v1.DataSource.aws_credential:type_name -> bytebase.v1.DataSource.AWSCredential
- 33, // 26: bytebase.v1.DataSource.gcp_credential:type_name -> bytebase.v1.DataSource.GCPCredential
- 28, // 27: bytebase.v1.DataSource.sasl_config:type_name -> bytebase.v1.SASLConfig
- 34, // 28: bytebase.v1.DataSource.additional_addresses:type_name -> bytebase.v1.DataSource.Address
- 5, // 29: bytebase.v1.DataSource.redis_type:type_name -> bytebase.v1.DataSource.RedisType
- 35, // 30: bytebase.v1.DataSource.extra_connection_parameters:type_name -> bytebase.v1.DataSource.ExtraConnectionParametersEntry
- 38, // 31: bytebase.v1.InstanceResource.engine:type_name -> bytebase.v1.Engine
- 26, // 32: bytebase.v1.InstanceResource.data_sources:type_name -> bytebase.v1.DataSource
- 29, // 33: bytebase.v1.SASLConfig.krb_config:type_name -> bytebase.v1.KerberosConfig
- 3, // 34: bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption.type:type_name -> bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption.SecretType
- 6, // 35: bytebase.v1.InstanceService.GetInstance:input_type -> bytebase.v1.GetInstanceRequest
- 7, // 36: bytebase.v1.InstanceService.ListInstances:input_type -> bytebase.v1.ListInstancesRequest
- 9, // 37: bytebase.v1.InstanceService.CreateInstance:input_type -> bytebase.v1.CreateInstanceRequest
- 10, // 38: bytebase.v1.InstanceService.UpdateInstance:input_type -> bytebase.v1.UpdateInstanceRequest
- 11, // 39: bytebase.v1.InstanceService.DeleteInstance:input_type -> bytebase.v1.DeleteInstanceRequest
- 12, // 40: bytebase.v1.InstanceService.UndeleteInstance:input_type -> bytebase.v1.UndeleteInstanceRequest
- 13, // 41: bytebase.v1.InstanceService.SyncInstance:input_type -> bytebase.v1.SyncInstanceRequest
- 14, // 42: bytebase.v1.InstanceService.ListInstanceDatabase:input_type -> bytebase.v1.ListInstanceDatabaseRequest
- 17, // 43: bytebase.v1.InstanceService.BatchSyncInstances:input_type -> bytebase.v1.BatchSyncInstancesRequest
- 19, // 44: bytebase.v1.InstanceService.BatchUpdateInstances:input_type -> bytebase.v1.BatchUpdateInstancesRequest
- 21, // 45: bytebase.v1.InstanceService.AddDataSource:input_type -> bytebase.v1.AddDataSourceRequest
- 22, // 46: bytebase.v1.InstanceService.RemoveDataSource:input_type -> bytebase.v1.RemoveDataSourceRequest
- 23, // 47: bytebase.v1.InstanceService.UpdateDataSource:input_type -> bytebase.v1.UpdateDataSourceRequest
- 24, // 48: bytebase.v1.InstanceService.GetInstance:output_type -> bytebase.v1.Instance
- 8, // 49: bytebase.v1.InstanceService.ListInstances:output_type -> bytebase.v1.ListInstancesResponse
- 24, // 50: bytebase.v1.InstanceService.CreateInstance:output_type -> bytebase.v1.Instance
- 24, // 51: bytebase.v1.InstanceService.UpdateInstance:output_type -> bytebase.v1.Instance
- 42, // 52: bytebase.v1.InstanceService.DeleteInstance:output_type -> google.protobuf.Empty
- 24, // 53: bytebase.v1.InstanceService.UndeleteInstance:output_type -> bytebase.v1.Instance
- 16, // 54: bytebase.v1.InstanceService.SyncInstance:output_type -> bytebase.v1.SyncInstanceResponse
- 15, // 55: bytebase.v1.InstanceService.ListInstanceDatabase:output_type -> bytebase.v1.ListInstanceDatabaseResponse
- 18, // 56: bytebase.v1.InstanceService.BatchSyncInstances:output_type -> bytebase.v1.BatchSyncInstancesResponse
- 20, // 57: bytebase.v1.InstanceService.BatchUpdateInstances:output_type -> bytebase.v1.BatchUpdateInstancesResponse
- 24, // 58: bytebase.v1.InstanceService.AddDataSource:output_type -> bytebase.v1.Instance
- 24, // 59: bytebase.v1.InstanceService.RemoveDataSource:output_type -> bytebase.v1.Instance
- 24, // 60: bytebase.v1.InstanceService.UpdateDataSource:output_type -> bytebase.v1.Instance
- 48, // [48:61] is the sub-list for method output_type
- 35, // [35:48] is the sub-list for method input_type
- 35, // [35:35] is the sub-list for extension type_name
- 35, // [35:35] is the sub-list for extension extendee
- 0, // [0:35] is the sub-list for field type_name
+ 40, // 15: bytebase.v1.Instance.roles:type_name -> bytebase.v1.InstanceRole
+ 41, // 16: bytebase.v1.Instance.sync_interval:type_name -> google.protobuf.Duration
+ 42, // 17: bytebase.v1.Instance.last_sync_time:type_name -> google.protobuf.Timestamp
+ 30, // 18: bytebase.v1.Instance.labels:type_name -> bytebase.v1.Instance.LabelsEntry
+ 1, // 19: bytebase.v1.DataSourceExternalSecret.secret_type:type_name -> bytebase.v1.DataSourceExternalSecret.SecretType
+ 2, // 20: bytebase.v1.DataSourceExternalSecret.auth_type:type_name -> bytebase.v1.DataSourceExternalSecret.AuthType
+ 31, // 21: bytebase.v1.DataSourceExternalSecret.app_role:type_name -> bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption
+ 0, // 22: bytebase.v1.DataSource.type:type_name -> bytebase.v1.DataSourceType
+ 25, // 23: bytebase.v1.DataSource.external_secret:type_name -> bytebase.v1.DataSourceExternalSecret
+ 4, // 24: bytebase.v1.DataSource.authentication_type:type_name -> bytebase.v1.DataSource.AuthenticationType
+ 32, // 25: bytebase.v1.DataSource.azure_credential:type_name -> bytebase.v1.DataSource.AzureCredential
+ 33, // 26: bytebase.v1.DataSource.aws_credential:type_name -> bytebase.v1.DataSource.AWSCredential
+ 34, // 27: bytebase.v1.DataSource.gcp_credential:type_name -> bytebase.v1.DataSource.GCPCredential
+ 28, // 28: bytebase.v1.DataSource.sasl_config:type_name -> bytebase.v1.SASLConfig
+ 35, // 29: bytebase.v1.DataSource.additional_addresses:type_name -> bytebase.v1.DataSource.Address
+ 5, // 30: bytebase.v1.DataSource.redis_type:type_name -> bytebase.v1.DataSource.RedisType
+ 36, // 31: bytebase.v1.DataSource.extra_connection_parameters:type_name -> bytebase.v1.DataSource.ExtraConnectionParametersEntry
+ 39, // 32: bytebase.v1.InstanceResource.engine:type_name -> bytebase.v1.Engine
+ 26, // 33: bytebase.v1.InstanceResource.data_sources:type_name -> bytebase.v1.DataSource
+ 29, // 34: bytebase.v1.SASLConfig.krb_config:type_name -> bytebase.v1.KerberosConfig
+ 3, // 35: bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption.type:type_name -> bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption.SecretType
+ 6, // 36: bytebase.v1.InstanceService.GetInstance:input_type -> bytebase.v1.GetInstanceRequest
+ 7, // 37: bytebase.v1.InstanceService.ListInstances:input_type -> bytebase.v1.ListInstancesRequest
+ 9, // 38: bytebase.v1.InstanceService.CreateInstance:input_type -> bytebase.v1.CreateInstanceRequest
+ 10, // 39: bytebase.v1.InstanceService.UpdateInstance:input_type -> bytebase.v1.UpdateInstanceRequest
+ 11, // 40: bytebase.v1.InstanceService.DeleteInstance:input_type -> bytebase.v1.DeleteInstanceRequest
+ 12, // 41: bytebase.v1.InstanceService.UndeleteInstance:input_type -> bytebase.v1.UndeleteInstanceRequest
+ 13, // 42: bytebase.v1.InstanceService.SyncInstance:input_type -> bytebase.v1.SyncInstanceRequest
+ 14, // 43: bytebase.v1.InstanceService.ListInstanceDatabase:input_type -> bytebase.v1.ListInstanceDatabaseRequest
+ 17, // 44: bytebase.v1.InstanceService.BatchSyncInstances:input_type -> bytebase.v1.BatchSyncInstancesRequest
+ 19, // 45: bytebase.v1.InstanceService.BatchUpdateInstances:input_type -> bytebase.v1.BatchUpdateInstancesRequest
+ 21, // 46: bytebase.v1.InstanceService.AddDataSource:input_type -> bytebase.v1.AddDataSourceRequest
+ 22, // 47: bytebase.v1.InstanceService.RemoveDataSource:input_type -> bytebase.v1.RemoveDataSourceRequest
+ 23, // 48: bytebase.v1.InstanceService.UpdateDataSource:input_type -> bytebase.v1.UpdateDataSourceRequest
+ 24, // 49: bytebase.v1.InstanceService.GetInstance:output_type -> bytebase.v1.Instance
+ 8, // 50: bytebase.v1.InstanceService.ListInstances:output_type -> bytebase.v1.ListInstancesResponse
+ 24, // 51: bytebase.v1.InstanceService.CreateInstance:output_type -> bytebase.v1.Instance
+ 24, // 52: bytebase.v1.InstanceService.UpdateInstance:output_type -> bytebase.v1.Instance
+ 43, // 53: bytebase.v1.InstanceService.DeleteInstance:output_type -> google.protobuf.Empty
+ 24, // 54: bytebase.v1.InstanceService.UndeleteInstance:output_type -> bytebase.v1.Instance
+ 16, // 55: bytebase.v1.InstanceService.SyncInstance:output_type -> bytebase.v1.SyncInstanceResponse
+ 15, // 56: bytebase.v1.InstanceService.ListInstanceDatabase:output_type -> bytebase.v1.ListInstanceDatabaseResponse
+ 18, // 57: bytebase.v1.InstanceService.BatchSyncInstances:output_type -> bytebase.v1.BatchSyncInstancesResponse
+ 20, // 58: bytebase.v1.InstanceService.BatchUpdateInstances:output_type -> bytebase.v1.BatchUpdateInstancesResponse
+ 24, // 59: bytebase.v1.InstanceService.AddDataSource:output_type -> bytebase.v1.Instance
+ 24, // 60: bytebase.v1.InstanceService.RemoveDataSource:output_type -> bytebase.v1.Instance
+ 24, // 61: bytebase.v1.InstanceService.UpdateDataSource:output_type -> bytebase.v1.Instance
+ 49, // [49:62] is the sub-list for method output_type
+ 36, // [36:49] is the sub-list for method input_type
+ 36, // [36:36] is the sub-list for extension type_name
+ 36, // [36:36] is the sub-list for extension extendee
+ 0, // [0:36] is the sub-list for field type_name
}
func init() { file_v1_instance_service_proto_init() }
@@ -3023,7 +3042,7 @@ func file_v1_instance_service_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_instance_service_proto_rawDesc), len(file_v1_instance_service_proto_rawDesc)),
NumEnums: 6,
- NumMessages: 30,
+ NumMessages: 31,
NumExtensions: 0,
NumServices: 1,
},
diff --git a/backend/generated-go/v1/instance_service_equal.pb.go b/backend/generated-go/v1/instance_service_equal.pb.go
index da25f75dea..f91cd1d036 100644
--- a/backend/generated-go/v1/instance_service_equal.pb.go
+++ b/backend/generated-go/v1/instance_service_equal.pb.go
@@ -398,6 +398,18 @@ func (x *Instance) Equal(y *Instance) bool {
if p, q := x.LastSyncTime, y.LastSyncTime; (p == nil && q != nil) || (p != nil && (q == nil || p.Seconds != q.Seconds || p.Nanos != q.Nanos)) {
return false
}
+ if len(x.Labels) != len(y.Labels) {
+ return false
+ }
+ for k := range x.Labels {
+ _, ok := y.Labels[k]
+ if !ok {
+ return false
+ }
+ if x.Labels[k] != y.Labels[k] {
+ return false
+ }
+ }
return true
}
diff --git a/frontend/src/components/InstanceForm/Buttons.vue b/frontend/src/components/InstanceForm/Buttons.vue
index 0b173d9d95..163d9ca2db 100644
--- a/frontend/src/components/InstanceForm/Buttons.vue
+++ b/frontend/src/components/InstanceForm/Buttons.vue
@@ -382,6 +382,9 @@ const doUpdate = async () => {
if (!isEqual(instancePatch.syncDatabases, inst.syncDatabases)) {
updateMask.push("sync_databases");
}
+ if (!isEqual(instancePatch.labels, inst.labels)) {
+ updateMask.push("labels");
+ }
if (updateMask.length === 0) {
return;
}
diff --git a/frontend/src/components/InstanceForm/Form.vue b/frontend/src/components/InstanceForm/Form.vue
index 90635f4836..2937728cdf 100644
--- a/frontend/src/components/InstanceForm/Form.vue
+++ b/frontend/src/components/InstanceForm/Form.vue
@@ -421,6 +421,20 @@
/>
</template>
</div>
+
+ <!-- Labels -->
+ <div class="sm:col-span-3 sm:col-start-1">
+ <label for="labels" class="textlabel">
+ {{ $t("common.labels") }}
+ </label>
+ <div class="mt-1">
+ <LabelListEditor
+ v-model:kv-list="labelKVList"
+ :readonly="!allowEdit"
+ :show-errors="false"
+ />
+ </div>
+ </div>
</div>
<!-- Connection Info -->
@@ -503,6 +517,7 @@ import { computed, ref } from "vue";
import { useI18n } from "vue-i18n";
import { BBAttention, BBBetaBadge } from "@/bbkit";
import { InstanceArchiveRestoreButton } from "@/components/Instance";
+import { LabelListEditor } from "@/components/Label";
import RequiredStar from "@/components/RequiredStar.vue";
import {
EnvironmentSelect,
@@ -537,6 +552,8 @@ import {
autoSubscriptionRoute,
urlfy,
supportedEngineV1List,
+ convertLabelsToKVList,
+ convertKVListToLabels,
} from "@/utils";
import LearnMoreLink from "../LearnMoreLink.vue";
import BigQueryHostInput from "./BigQueryHostInput.vue";
@@ -605,6 +622,16 @@ const resourceId = computed({
},
});
+// Convert labels to KVList format for LabelListEditor
+const labelKVList = computed({
+ get() {
+ return convertLabelsToKVList(basicInfo.value.labels, true /* sort */);
+ },
+ set(kvList) {
+ basicInfo.value.labels = convertKVListToLabels(kvList, false);
+ },
+});
+
const currentMongoDBConnectionSchema = computed(() => {
return adminDataSource.value.srv === false
? MongoDBConnectionStringSchemaList[0]
diff --git a/frontend/src/components/InstanceForm/common.ts b/frontend/src/components/InstanceForm/common.ts
index 528e97593b..89fcdb1cbc 100644
--- a/frontend/src/components/InstanceForm/common.ts
+++ b/frontend/src/components/InstanceForm/common.ts
@@ -82,6 +82,7 @@ export const extractBasicInfo = (instance: Instance | undefined): BasicInfo => {
maximumConnections: instance?.maximumConnections ?? 0,
syncDatabases: instance?.syncDatabases ?? [],
roles: instance?.roles ?? [],
+ labels: instance?.labels ?? {},
};
};
diff --git a/frontend/src/components/v2/Model/Instance/InstanceV1Table/InstanceV1Table.vue b/frontend/src/components/v2/Model/Instance/InstanceV1Table/InstanceV1Table.vue
index 5a6f2b55d9..1e2b90a6ea 100644
--- a/frontend/src/components/v2/Model/Instance/InstanceV1Table/InstanceV1Table.vue
+++ b/frontend/src/components/v2/Model/Instance/InstanceV1Table/InstanceV1Table.vue
@@ -28,6 +28,7 @@ import { computed, reactive, watch } from "vue";
import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
import { InstanceV1Name } from "@/components/v2";
+import { LabelsCell } from "@/components/v2/Model/cells";
import { useEnvironmentV1Store } from "@/store";
import { NULL_ENVIRONMENT_NAME } from "@/types";
import type { Instance } from "@/types/proto-es/v1/instance_service_pb";
@@ -178,6 +179,15 @@ const columnList = computed((): InstanceDataTableColumn[] => {
</NButton>
),
};
+ const LABELS: InstanceDataTableColumn = {
+ key: "labels",
+ title: t("common.labels"),
+ resizable: true,
+ width: 300,
+ render: (instance) => (
+ <LabelsCell labels={instance.labels} showCount={3} placeholder="-" />
+ ),
+ };
const LICENSE: InstanceDataTableColumn = {
key: "instance",
title: t("subscription.instance-assignment.license"),
@@ -186,9 +196,15 @@ const columnList = computed((): InstanceDataTableColumn[] => {
render: (instance) => (instance.activation ? "Y" : ""),
};
- return [SELECTION, NAME, ENVIRONMENT, ADDRESS, EXTERNAL_LINK, LICENSE].filter(
- (column) => !column.hide
- );
+ return [
+ SELECTION,
+ NAME,
+ ENVIRONMENT,
+ ADDRESS,
+ LABELS,
+ EXTERNAL_LINK,
+ LICENSE,
+ ].filter((column) => !column.hide);
});
const handleDataSourceToggle = (e: MouseEvent, instance: Instance) => {
diff --git a/frontend/src/store/modules/v1/instance.ts b/frontend/src/store/modules/v1/instance.ts
index 3d51cbd96b..d421bf1957 100644
--- a/frontend/src/store/modules/v1/instance.ts
+++ b/frontend/src/store/modules/v1/instance.ts
@@ -44,6 +44,7 @@ export interface InstanceFilter {
query?: string;
engines?: Engine[];
state?: State;
+ labels?: { key: string; value: string }[];
}
const getListInstanceFilter = (params: InstanceFilter) => {
@@ -78,6 +79,11 @@ const getListInstanceFilter = (params: InstanceFilter) => {
if (params.state === State.DELETED) {
list.push(`state == "${State[params.state]}"`);
}
+ if (params.labels && params.labels.length > 0) {
+ params.labels.forEach(({ key, value }) => {
+ list.push(`labels.${key} == "${value}"`);
+ });
+ }
return list.join(" && ");
};
diff --git a/frontend/src/types/proto-es/v1/instance_service_pb.d.ts b/frontend/src/types/proto-es/v1/instance_service_pb.d.ts
index 179566ee35..32810691ec 100644
--- a/frontend/src/types/proto-es/v1/instance_service_pb.d.ts
+++ b/frontend/src/types/proto-es/v1/instance_service_pb.d.ts
@@ -77,6 +77,7 @@ export declare type ListInstancesRequest = Message<"bytebase.v1.ListInstancesReq
* - host: the instance host, support "==" and ".matches()" operator.
* - port: the instance port, support "==" and ".matches()" operator.
* - project: the project full name in "projects/{id}" format, support "==" operator.
+ * - labels.{key}: the instance label, support "==" and "in" operators.
*
* For example:
* name == "sample instance"
@@ -93,6 +94,8 @@ export declare type ListInstancesRequest = Message<"bytebase.v1.ListInstancesReq
* host.matches("127.0")
* port == "54321"
* port.matches("543")
+ * labels.org_group == "infrastructure"
+ * labels.environment in ["prod", "production"]
* project == "projects/sample-project"
* You can combine filter conditions like:
* name.matches("sample") && environment == "environments/test"
@@ -614,6 +617,14 @@ export declare type Instance = Message<"bytebase.v1.Instance"> & {
* @generated from field: google.protobuf.Timestamp last_sync_time = 16;
*/
lastSyncTime?: Timestamp;
+
+ /**
+ * Labels are key-value pairs that can be attached to the instance.
+ * For example, { "org_group": "infrastructure", "environment": "production" }
+ *
+ * @generated from field: map<string, string> labels = 17;
+ */
+ labels: { [key: string]: string };
};
/**
diff --git a/frontend/src/types/proto-es/v1/instance_service_pb.js b/frontend/src/types/proto-es/v1/instance_service_pb.js
index 8bb46cb2fa..61c0d5b3b5 100644
--- a/frontend/src/types/proto-es/v1/instance_service_pb.js
+++ b/frontend/src/types/proto-es/v1/instance_service_pb.js
@@ -16,7 +16,7 @@ import { file_v1_instance_role_service } from "./instance_role_service_pb";
* Describes the file v1/instance_service.proto.
*/
export const file_v1_instance_service = /*@__PURE__*/
- fileDesc("Chl2MS9pbnN0YW5jZV9zZXJ2aWNlLnByb3RvEgtieXRlYmFzZS52MSJBChJHZXRJbnN0YW5jZVJlcXVlc3QSKwoEbmFtZRgBIAEoCUId4EEC+kEXChVieXRlYmFzZS5jb20vSW5zdGFuY2UiYwoUTGlzdEluc3RhbmNlc1JlcXVlc3QSEQoJcGFnZV9zaXplGAEgASgFEhIKCnBhZ2VfdG9rZW4YAiABKAkSFAoMc2hvd19kZWxldGVkGAMgASgIEg4KBmZpbHRlchgEIAEoCSJaChVMaXN0SW5zdGFuY2VzUmVzcG9uc2USKAoJaW5zdGFuY2VzGAEgAygLMhUuYnl0ZWJhc2UudjEuSW5zdGFuY2USFwoPbmV4dF9wYWdlX3Rva2VuGAIgASgJInEKFUNyZWF0ZUluc3RhbmNlUmVxdWVzdBIsCghpbnN0YW5jZRgBIAEoCzIVLmJ5dGViYXNlLnYxLkluc3RhbmNlQgPgQQISEwoLaW5zdGFuY2VfaWQYAiABKAkSFQoNdmFsaWRhdGVfb25seRgDIAEoCCKNAQoVVXBkYXRlSW5zdGFuY2VSZXF1ZXN0EiwKCGluc3RhbmNlGAEgASgLMhUuYnl0ZWJhc2UudjEuSW5zdGFuY2VCA+BBAhIvCgt1cGRhdGVfbWFzaxgCIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5GaWVsZE1hc2sSFQoNYWxsb3dfbWlzc2luZxgDIAEoCCJiChVEZWxldGVJbnN0YW5jZVJlcXVlc3QSKwoEbmFtZRgBIAEoCUId4EEC+kEXChVieXRlYmFzZS5jb20vSW5zdGFuY2USDQoFZm9yY2U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YW5jZXMudXBkYXRlkOowAZjqMAGC0+STAh46ASoiGS92MS9pbnN0YW5jZXM6YmF0Y2hVcGRhdGUSmQEKDUFkZERhdGFTb3VyY2USIS5ieXRlYmFzZS52MS5BZGREYXRhU291cmNlUmVxdWVzdBoVLmJ5dGViYXNlLnYxLkluc3RhbmNlIk6K6jATYmIuaW5zdGFuY2VzLnVwZGF0ZZDqMAGY6jABgtPkkwIpOgEqIiQvdjEve25hbWU9aW5zdGFuY2VzLyp9OmFkZERhdGFTb3VyY2USogEKEFJlbW92ZURhdGFTb3VyY2USJC5ieXRlYmFzZS52MS5SZW1vdmVEYXRhU291cmNlUmVxdWVzdBoVLmJ5dGViYXNlLnYxLkluc3RhbmNlIlGK6jATYmIuaW5zdGFuY2VzLnVwZGF0ZZDqMAGY6jABgtPkkwIsOgEqIicvdjEve25hbWU9aW5zdGFuY2VzLyp9OnJlbW92ZURhdGFTb3VyY2USxgEKEFVwZGF0ZURhdGFTb3VyY2USJC5ieXRlYmFzZS52MS5VcGRhdGVEYXRhU291cmNlUmVxdWVzdBoVLmJ5dGViYXNlLnYxLkluc3RhbmNlInXaQRdkYXRhX3NvdXJjZSx1cGRhdGVfbWFza4rqMBNiYi5pbnN0YW5jZXMudXBkYXRlkOowAZjqMAGC0+STAjY6C2RhdGFfc291cmNlMicvdjEve25hbWU9aW5zdGFuY2VzLyp9OnVwZGF0ZURhdGFTb3VyY2VCNlo0Z2l0aHViLmNvbS9ieXRlYmFzZS9ieXRlYmFzZS9iYWNrZW5kL2dlbmVyYXRlZC1nby92MWIGcHJvdG8z", [file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_duration, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_timestamp, file_v1_annotation, file_v1_common, file_v1_instance_role_service]);
+ fileDesc("Chl2MS9pbnN0YW5jZV9zZXJ2aWNlLnByb3RvEgtieXRlYmFzZS52MSJBChJHZXRJbnN0YW5jZVJlcXVlc3QSKw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W5zdGFuY2UiTorqMBNiYi5pbnN0YW5jZXMudXBkYXRlkOowAZjqMAGC0+STAik6ASoiJC92MS97bmFtZT1pbnN0YW5jZXMvKn06YWRkRGF0YVNvdXJjZRKiAQoQUmVtb3ZlRGF0YVNvdXJjZRIkLmJ5dGViYXNlLnYxLlJlbW92ZURhdGFTb3VyY2VSZXF1ZXN0GhUuYnl0ZWJhc2UudjEuSW5zdGFuY2UiUYrqMBNiYi5pbnN0YW5jZXMudXBkYXRlkOowAZjqMAGC0+STAiw6ASoiJy92MS97bmFtZT1pbnN0YW5jZXMvKn06cmVtb3ZlRGF0YVNvdXJjZRLGAQoQVXBkYXRlRGF0YVNvdXJjZRIkLmJ5dGViYXNlLnYxLlVwZGF0ZURhdGFTb3VyY2VSZXF1ZXN0GhUuYnl0ZWJhc2UudjEuSW5zdGFuY2UiddpBF2RhdGFfc291cmNlLHVwZGF0ZV9tYXNriuowE2JiLmluc3RhbmNlcy51cGRhdGWQ6jABmOowAYLT5JMCNjoLZGF0YV9zb3VyY2UyJy92MS97bmFtZT1pbnN0YW5jZXMvKn06dXBkYXRlRGF0YVNvdXJjZUI2WjRnaXRodWIuY29tL2J5dGViYXNlL2J5dGViYXNlL2JhY2tlbmQvZ2VuZXJhdGVkLWdvL3YxYgZwcm90bzM", [file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_duration, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_timestamp, file_v1_annotation, file_v1_common, file_v1_instance_role_service]);
/**
* Describes the message bytebase.v1.GetInstanceRequest.
diff --git a/frontend/src/views/InstanceDashboard.vue b/frontend/src/views/InstanceDashboard.vue
index 3989e93d8b..aafa58fb04 100644
--- a/frontend/src/views/InstanceDashboard.vue
+++ b/frontend/src/views/InstanceDashboard.vue
@@ -165,12 +165,23 @@ const selectedEngines = computed(() => {
});
});
+const selectedLabels = computed(() => {
+ return state.params.scopes
+ .filter((scope) => scope.id === "label")
+ .map((scope) => {
+ // Parse label value format "key:value"
+ const [key, ...valueParts] = scope.value.split(":");
+ return { key, value: valueParts.join(":") };
+ });
+});
+
const filter = computed(() => ({
environment: selectedEnvironment.value,
host: selectedHost.value,
port: selectedPort.value,
query: state.params.query,
engines: selectedEngines.value,
+ labels: selectedLabels.value,
}));
const showCreateInstanceDrawer = () => {
@@ -185,7 +196,7 @@ const showCreateInstanceDrawer = () => {
const scopeOptions = computed((): ScopeOption[] => {
return [
- ...useCommonSearchScopeOptions(["environment", "engine"]).value,
+ ...useCommonSearchScopeOptions(["environment", "engine", "label"]).value,
{
id: "host",
title: t("instance.advanced-search.scope.host.title"),
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index 3904963c2b..976f3a6d87 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -980,6 +980,7 @@ paths:
- host: the instance host, support "==" and ".matches()" operator.
- port: the instance port, support "==" and ".matches()" operator.
- project: the project full name in "projects/{id}" format, support "==" operator.
+ - labels.{key}: the instance label, support "==" and "in" operators.
For example:
name == "sample instance"
@@ -996,6 +997,8 @@ paths:
host.matches("127.0")
port == "54321"
port.matches("543")
+ labels.org_group == "infrastructure"
+ labels.environment in ["prod", "production"]
project == "projects/sample-project"
You can combine filter conditions like:
name.matches("sample") && environment == "environments/test"
@@ -10763,6 +10766,13 @@ components:
type: array
items:
$ref: '#/components/schemas/InstanceRole'
+ labels:
+ type: object
+ additionalProperties:
+ type: string
+ description: |-
+ Labels are key-value pairs that can be attached to the instance.
+ For example, { "org_group": "infrastructure", "environment": "production" }
description: Instance is the proto for instances.
InstanceResource:
type: object
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index f5c707b5f4..32c09a8bfe 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -143,6 +143,7 @@
- [DataSourceExternalSecret](#bytebase-store-DataSourceExternalSecret)
- [DataSourceExternalSecret.AppRoleAuthOption](#bytebase-store-DataSourceExternalSecret-AppRoleAuthOption)
- [Instance](#bytebase-store-Instance)
+ - [Instance.LabelsEntry](#bytebase-store-Instance-LabelsEntry)
- [InstanceRole](#bytebase-store-InstanceRole)
- [KerberosConfig](#bytebase-store-KerberosConfig)
- [SASLConfig](#bytebase-store-SASLConfig)
@@ -2591,6 +2592,23 @@ Instance is the proto for instances.
| mysql_lower_case_table_names | [int32](#int32) | | The lower_case_table_names config for MySQL instances. It is used to determine whether the table names and database names are case sensitive. |
| last_sync_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| roles | [InstanceRole](#bytebase-store-InstanceRole) | repeated | |
+| labels | [Instance.LabelsEntry](#bytebase-store-Instance-LabelsEntry) | repeated | Labels are key-value pairs that can be attached to the instance. For example, { &#34;org_group&#34;: &#34;infrastructure&#34;, &#34;environment&#34;: &#34;production&#34; } |
+
+
+
+
+
+
+<a name="bytebase-store-Instance-LabelsEntry"></a>
+
+### Instance.LabelsEntry
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| key | [string](#string) | | |
+| value | [string](#string) | | |
diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.html
index 83b31e71ce..0dacd5173f 100644
--- a/proto/gen/grpc-doc/store/index.html
+++ b/proto/gen/grpc-doc/store/index.html
@@ -742,6 +742,10 @@
<a href="#bytebase.store.Instance"><span class="badge">M</span>Instance</a>
</li>
+ <li>
+ <a href="#bytebase.store.Instance.LabelsEntry"><span class="badge">M</span>Instance.LabelsEntry</a>
+ </li>
+
<li>
<a href="#bytebase.store.InstanceRole"><span class="badge">M</span>InstanceRole</a>
</li>
@@ -7618,6 +7622,45 @@ It is used to determine whether the table names and database names are case sens
<td><p> </p></td>
</tr>
+ <tr>
+ <td>labels</td>
+ <td><a href="#bytebase.store.Instance.LabelsEntry">Instance.LabelsEntry</a></td>
+ <td>repeated</td>
+ <td><p>Labels are key-value pairs that can be attached to the instance.
+For example, { &#34;org_group&#34;: &#34;infrastructure&#34;, &#34;environment&#34;: &#34;production&#34; } </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.store.Instance.LabelsEntry">Instance.LabelsEntry</h3>
+ <p></p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>key</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>value</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
</tbody>
</table>
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index ef62952172..20310dd668 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -65,6 +65,7 @@
- [DeleteInstanceRequest](#bytebase-v1-DeleteInstanceRequest)
- [GetInstanceRequest](#bytebase-v1-GetInstanceRequest)
- [Instance](#bytebase-v1-Instance)
+ - [Instance.LabelsEntry](#bytebase-v1-Instance-LabelsEntry)
- [InstanceResource](#bytebase-v1-InstanceResource)
- [KerberosConfig](#bytebase-v1-KerberosConfig)
- [ListInstanceDatabaseRequest](#bytebase-v1-ListInstanceDatabaseRequest)
@@ -1559,6 +1560,23 @@ This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. |
| maximum_connections | [int32](#int32) | | The maximum number of connections. The default is 10 if the value is unset or zero. |
| sync_databases | [string](#string) | repeated | Enable sync for following databases. Default empty, means sync all schemas &amp; databases. |
| last_sync_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | The last time the instance was synced. |
+| labels | [Instance.LabelsEntry](#bytebase-v1-Instance-LabelsEntry) | repeated | Labels are key-value pairs that can be attached to the instance. For example, { &#34;org_group&#34;: &#34;infrastructure&#34;, &#34;environment&#34;: &#34;production&#34; } |
+
+
+
+
+
+
+<a name="bytebase-v1-Instance-LabelsEntry"></a>
+
+### Instance.LabelsEntry
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| key | [string](#string) | | |
+| value | [string](#string) | | |
@@ -1653,9 +1671,9 @@ When paginating, all other parameters provided to `ListInstances` must match the
| show_deleted | [bool](#bool) | | Show deleted instances if specified. |
| filter | [string](#string) | | Filter the instance. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
-Supported filters: - name: the instance name, support &#34;==&#34; and &#34;.matches()&#34; operator. - resource_id: the instance id, support &#34;==&#34; and &#34;.matches()&#34; operator. - environment: the environment full name in &#34;environments/{id}&#34; format, support &#34;==&#34; operator. - state: the instance state, check State enum for values, support &#34;==&#34; operator. - engine: the instance engine, check Engine enum for values. Support &#34;==&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34; operator. - host: the instance host, support &#34;==&#34; and &#34;.matches()&#34; operator. - port: the instance port, support &#34;==&#34; and &#34;.matches()&#34; operator. - project: the project full name in &#34;projects/{id}&#34; format, support &#34;==&#34; operator.
+Supported filters: - name: the instance name, support &#34;==&#34; and &#34;.matches()&#34; operator. - resource_id: the instance id, support &#34;==&#34; and &#34;.matches()&#34; operator. - environment: the environment full name in &#34;environments/{id}&#34; format, support &#34;==&#34; operator. - state: the instance state, check State enum for values, support &#34;==&#34; operator. - engine: the instance engine, check Engine enum for values. Support &#34;==&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34; operator. - host: the instance host, support &#34;==&#34; and &#34;.matches()&#34; operator. - port: the instance port, support &#34;==&#34; and &#34;.matches()&#34; operator. - project: the project full name in &#34;projects/{id}&#34; format, support &#34;==&#34; operator. - labels.{key}: the instance label, support &#34;==&#34; and &#34;in&#34; operators.
-For example: name == &#34;sample instance&#34; name.matches(&#34;sample&#34;) resource_id = &#34;sample-instance&#34; resource_id.matches(&#34;sample&#34;) state == &#34;DELETED&#34; environment == &#34;environments/test&#34; environment == &#34;&#34; (find instances which environment is not set) engine == &#34;MYSQL&#34; engine in [&#34;MYSQL&#34;, &#34;POSTGRES&#34;] !(engine in [&#34;MYSQL&#34;, &#34;POSTGRES&#34;]) host == &#34;127.0.0.1&#34; host.matches(&#34;127.0&#34;) port == &#34;54321&#34; port.matches(&#34;543&#34;) project == &#34;projects/sample-project&#34; You can combine filter conditions like: name.matches(&#34;sample&#34;) &amp;&amp; environment == &#34;environments/test&#34; host == &#34;127.0.0.1&#34; &amp;&amp; port == &#34;54321&#34; |
+For example: name == &#34;sample instance&#34; name.matches(&#34;sample&#34;) resource_id = &#34;sample-instance&#34; resource_id.matches(&#34;sample&#34;) state == &#34;DELETED&#34; environment == &#34;environments/test&#34; environment == &#34;&#34; (find instances which environment is not set) engine == &#34;MYSQL&#34; engine in [&#34;MYSQL&#34;, &#34;POSTGRES&#34;] !(engine in [&#34;MYSQL&#34;, &#34;POSTGRES&#34;]) host == &#34;127.0.0.1&#34; host.matches(&#34;127.0&#34;) port == &#34;54321&#34; port.matches(&#34;543&#34;) labels.org_group == &#34;infrastructure&#34; labels.environment in [&#34;prod&#34;, &#34;production&#34;] project == &#34;projects/sample-project&#34; You can combine filter conditions like: name.matches(&#34;sample&#34;) &amp;&amp; environment == &#34;environments/test&#34; host == &#34;127.0.0.1&#34; &amp;&amp; port == &#34;54321&#34; |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 8aa39811c6..fa4636e844 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -414,6 +414,10 @@
<a href="#bytebase.v1.Instance"><span class="badge">M</span>Instance</a>
</li>
+ <li>
+ <a href="#bytebase.v1.Instance.LabelsEntry"><span class="badge">M</span>Instance.LabelsEntry</a>
+ </li>
+
<li>
<a href="#bytebase.v1.InstanceResource"><span class="badge">M</span>InstanceResource</a>
</li>
@@ -5069,6 +5073,45 @@ Default empty, means sync all schemas &amp; databases. </p></td>
<td><p>The last time the instance was synced. </p></td>
</tr>
+ <tr>
+ <td>labels</td>
+ <td><a href="#bytebase.v1.Instance.LabelsEntry">Instance.LabelsEntry</a></td>
+ <td>repeated</td>
+ <td><p>Labels are key-value pairs that can be attached to the instance.
+For example, { &#34;org_group&#34;: &#34;infrastructure&#34;, &#34;environment&#34;: &#34;production&#34; } </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.Instance.LabelsEntry">Instance.LabelsEntry</h3>
+ <p></p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>key</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>value</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
</tbody>
</table>
@@ -5320,6 +5363,7 @@ Supported filters:
- host: the instance host, support &#34;==&#34; and &#34;.matches()&#34; operator.
- port: the instance port, support &#34;==&#34; and &#34;.matches()&#34; operator.
- project: the project full name in &#34;projects/{id}&#34; format, support &#34;==&#34; operator.
+- labels.{key}: the instance label, support &#34;==&#34; and &#34;in&#34; operators.
For example:
name == &#34;sample instance&#34;
@@ -5336,6 +5380,8 @@ host == &#34;127.0.0.1&#34;
host.matches(&#34;127.0&#34;)
port == &#34;54321&#34;
port.matches(&#34;543&#34;)
+labels.org_group == &#34;infrastructure&#34;
+labels.environment in [&#34;prod&#34;, &#34;production&#34;]
project == &#34;projects/sample-project&#34;
You can combine filter conditions like:
name.matches(&#34;sample&#34;) &amp;&amp; environment == &#34;environments/test&#34;
diff --git a/proto/store/store/instance.proto b/proto/store/store/instance.proto
index 33d191253d..ee20d233c2 100644
--- a/proto/store/store/instance.proto
+++ b/proto/store/store/instance.proto
@@ -36,6 +36,10 @@ message Instance {
google.protobuf.Timestamp last_sync_time = 11;
repeated InstanceRole roles = 12;
+
+ // Labels are key-value pairs that can be attached to the instance.
+ // For example, { "org_group": "infrastructure", "environment": "production" }
+ map<string, string> labels = 13;
}
// InstanceRole is the API message for instance role.
diff --git a/proto/v1/v1/instance_service.proto b/proto/v1/v1/instance_service.proto
index b7bbb325b4..c14b7a5ebd 100644
--- a/proto/v1/v1/instance_service.proto
+++ b/proto/v1/v1/instance_service.proto
@@ -191,6 +191,7 @@ message ListInstancesRequest {
// - host: the instance host, support "==" and ".matches()" operator.
// - port: the instance port, support "==" and ".matches()" operator.
// - project: the project full name in "projects/{id}" format, support "==" operator.
+ // - labels.{key}: the instance label, support "==" and "in" operators.
//
// For example:
// name == "sample instance"
@@ -207,6 +208,8 @@ message ListInstancesRequest {
// host.matches("127.0")
// port == "54321"
// port.matches("543")
+ // labels.org_group == "infrastructure"
+ // labels.environment in ["prod", "production"]
// project == "projects/sample-project"
// You can combine filter conditions like:
// name.matches("sample") && environment == "environments/test"
@@ -426,6 +429,10 @@ message Instance {
// The last time the instance was synced.
google.protobuf.Timestamp last_sync_time = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // Labels are key-value pairs that can be attached to the instance.
+ // For example, { "org_group": "infrastructure", "environment": "production" }
+ map<string, string> labels = 17;
}
message DataSourceExternalSecret {