Skip to content

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

chore(anomaly): database schema drift modal (#14967)

boojackd2cc65fdcf1a
diff --git a/backend/api/v1/anomaly_service.go b/backend/api/v1/anomaly_service.go
index d9d9ea0188..881a0eb3c9 100644
--- a/backend/api/v1/anomaly_service.go
+++ b/backend/api/v1/anomaly_service.go
@@ -13,7 +13,6 @@ import (
"github.com/bytebase/bytebase/backend/common"
api "github.com/bytebase/bytebase/backend/legacyapi"
"github.com/bytebase/bytebase/backend/store"
- storepb "github.com/bytebase/bytebase/proto/generated-go/store"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
)
@@ -136,34 +135,20 @@ func (s *AnomalyService) convertToAnomaly(ctx context.Context, anomaly *store.An
pbAnomaly.Resource = fmt.Sprintf("%s%s", common.InstanceNamePrefix, anomaly.InstanceID)
}
- switch anomaly.Type {
+ pbAnomaly.Type = convertAnomalyType(anomaly.Type)
+ pbAnomaly.Severity = getSeverityFromAnomalyType(pbAnomaly.Type)
+ return pbAnomaly, nil
+}
+
+func convertAnomalyType(tp api.AnomalyType) v1pb.Anomaly_AnomalyType {
+ switch tp {
case api.AnomalyDatabaseConnection:
- detail := &storepb.AnomalyConnectionPayload{}
- if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(anomaly.Payload), detail); err != nil {
- return nil, errors.Wrapf(err, "failed to unmarshal database connection anomaly payload")
- }
- pbAnomaly.Type = v1pb.Anomaly_DATABASE_CONNECTION
- pbAnomaly.Detail = &v1pb.Anomaly_DatabaseConnectionDetail_{
- DatabaseConnectionDetail: &v1pb.Anomaly_DatabaseConnectionDetail{
- Detail: detail.Detail,
- },
- }
+ return v1pb.Anomaly_DATABASE_CONNECTION
case api.AnomalyDatabaseSchemaDrift:
- detail := &storepb.AnomalyDatabaseSchemaDriftPayload{}
- if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(anomaly.Payload), detail); err != nil {
- return nil, errors.Wrapf(err, "failed to unmarshal database schema drift anomaly payload")
- }
- pbAnomaly.Type = v1pb.Anomaly_DATABASE_SCHEMA_DRIFT
- pbAnomaly.Detail = &v1pb.Anomaly_DatabaseSchemaDriftDetail_{
- DatabaseSchemaDriftDetail: &v1pb.Anomaly_DatabaseSchemaDriftDetail{
- RecordVersion: detail.Version,
- ExpectedSchema: detail.Expect,
- ActualSchema: detail.Actual,
- },
- }
+ return v1pb.Anomaly_DATABASE_SCHEMA_DRIFT
+ default:
+ return v1pb.Anomaly_ANOMALY_TYPE_UNSPECIFIED
}
- pbAnomaly.Severity = getSeverityFromAnomalyType(pbAnomaly.Type)
- return pbAnomaly, nil
}
func getSeverityFromAnomalyType(tp v1pb.Anomaly_AnomalyType) v1pb.Anomaly_AnomalySeverity {
diff --git a/frontend/src/components/AnomalyCenter/AnomalyTable.vue b/frontend/src/components/AnomalyCenter/AnomalyTable.vue
index 6787e6ec3a..7ea70f5022 100644
--- a/frontend/src/components/AnomalyCenter/AnomalyTable.vue
+++ b/frontend/src/components/AnomalyCenter/AnomalyTable.vue
@@ -50,41 +50,22 @@
</BBTableCell>
</template>
</BBTable>
- <BBModal
- v-if="schemaDriftDetail"
- class="overflow-auto"
- :title="`'${schemaDriftDetail.database.databaseName}' schema drift - ${schemaDriftDetail.payload?.recordVersion} vs Actual`"
- @close="dismissModal"
- >
- <div
- class="space-y-4 flex flex-col overflow-hidden relative"
- style="width: calc(100vw - 10rem); height: calc(100vh - 12rem)"
- >
- <DiffEditor
- class="flex-1 w-full border rounded-md overflow-clip"
- :original="schemaDriftDetail.payload?.expectedSchema"
- :modified="schemaDriftDetail.payload?.actualSchema"
- :readonly="true"
- />
- <div class="flex justify-end">
- <NButton type="primary" @click.prevent="dismissModal">
- {{ $t("common.close") }}
- </NButton>
- </div>
- </div>
- </BBModal>
+
+ <DatabaseSchemaDriftAnomalyModal
+ v-if="state.selectedAnomaly"
+ :anomaly="state.selectedAnomaly"
+ @close="state.selectedAnomaly = undefined"
+ />
</template>
<script lang="ts" setup>
-import { NButton } from "naive-ui";
import type { PropType } from "vue";
import { computed, reactive } from "vue";
import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
-import { BBModal, BBTable, BBTableCell, BBTableHeaderCell } from "@/bbkit";
+import { BBTable, BBTableCell, BBTableHeaderCell } from "@/bbkit";
import type { BBTableSectionDataSource } from "@/bbkit/types";
import { INSTANCE_ROUTE_DETAIL } from "@/router/dashboard/instance";
-import { useDatabaseV1Store } from "@/store";
import { getTimeForPbTimestamp } from "@/types";
import type { Anomaly } from "@/types/proto/v1/anomaly_service";
import {
@@ -96,7 +77,7 @@ import {
extractDatabaseResourceName,
extractInstanceResourceName,
} from "@/utils";
-import { DiffEditor } from "../MonacoEditor";
+import DatabaseSchemaDriftAnomalyModal from "./DatabaseSchemaDriftAnomalyModal.vue";
type Action = {
onClick: () => void;
@@ -155,13 +136,14 @@ const typeName = (type: Anomaly_AnomalyType): string => {
const detail = (anomaly: Anomaly): string => {
switch (anomaly.type) {
case Anomaly_AnomalyType.DATABASE_CONNECTION: {
- return anomaly.databaseConnectionDetail?.detail ?? "";
+ return `Failed to connect to the database.`;
}
case Anomaly_AnomalyType.DATABASE_SCHEMA_DRIFT: {
- return `Recorded latest schema version ${anomaly.databaseSchemaDriftDetail?.recordVersion} is different from the actual schema.`;
+ return `Latest recorded schema is different from the actual schema.`;
}
default:
- return "";
+ // Should not reach here.
+ return "UNKOWN ANOMALY DETAIL";
}
};
@@ -186,7 +168,6 @@ const action = (anomaly: Anomaly): Action => {
return {
onClick: () => {
state.selectedAnomaly = anomaly;
- useDatabaseV1Store().getOrFetchDatabaseByName(anomaly.resource);
},
title: t("anomaly.action.view-diff"),
};
@@ -197,21 +178,4 @@ const action = (anomaly: Anomaly): Action => {
};
}
};
-
-const schemaDriftDetail = computed(() => {
- if (state.selectedAnomaly) {
- const anomaly = state.selectedAnomaly;
- const database = useDatabaseV1Store().getDatabaseByName(anomaly.resource);
- return {
- anomaly,
- payload: anomaly.databaseSchemaDriftDetail,
- database,
- };
- }
- return undefined;
-});
-
-const dismissModal = () => {
- state.selectedAnomaly = undefined;
-};
</script>
diff --git a/frontend/src/components/AnomalyCenter/DatabaseSchemaDriftAnomalyModal.vue b/frontend/src/components/AnomalyCenter/DatabaseSchemaDriftAnomalyModal.vue
new file mode 100644
index 0000000000..5406432bf8
--- /dev/null
+++ b/frontend/src/components/AnomalyCenter/DatabaseSchemaDriftAnomalyModal.vue
@@ -0,0 +1,69 @@
+<template>
+ <BBModal
+ class="overflow-auto"
+ :title="`'${database.databaseName}' schema drift - Latest recorded schema vs Actual`"
+ @close="emit('close')"
+ >
+ <div
+ class="space-y-4 flex flex-col overflow-hidden relative"
+ style="width: calc(100vw - 10rem); height: calc(100vh - 12rem)"
+ >
+ <DiffEditor
+ v-if="!isLoading"
+ class="flex-1 w-full border rounded-md overflow-clip"
+ :original="originalSchema"
+ :modified="modifiedSchema"
+ :readonly="true"
+ />
+ <div v-else class="flex justify-center items-center py-10">
+ <BBSpin />
+ </div>
+ </div>
+ </BBModal>
+</template>
+
+<script lang="ts" setup>
+import { computed, onMounted, ref } from "vue";
+import { BBModal, BBSpin } from "@/bbkit";
+import { useChangelogStore, useDatabaseV1Store } from "@/store";
+import { Anomaly } from "@/types/proto/v1/anomaly_service";
+import { ChangelogView } from "@/types/proto/v1/database_service";
+import { DiffEditor } from "../MonacoEditor";
+
+const props = defineProps<{
+ anomaly: Anomaly;
+}>();
+
+const emit = defineEmits(["close"]);
+
+const databaseStore = useDatabaseV1Store();
+const changelogStore = useChangelogStore();
+const isLoading = ref(true);
+const originalSchema = ref<string>("");
+const modifiedSchema = ref<string>("");
+
+const database = computed(() => {
+ return databaseStore.getDatabaseByName(props.anomaly.resource);
+});
+
+onMounted(async () => {
+ const database = await databaseStore.getOrFetchDatabaseByName(
+ props.anomaly.resource
+ );
+ const changelogs = await changelogStore.getOrFetchChangelogListOfDatabase(
+ database.name,
+ 1, // Only fetch the latest changelog.
+ ChangelogView.CHANGELOG_VIEW_FULL, // Needs to fetch the full schema.
+ `type = "BASELINE | MIGRATE | MIGRATE_SDL"` // Only fetch the schema related changelog.
+ );
+ if (changelogs.length > 0) {
+ const latestChangelog = changelogs[0];
+ originalSchema.value = latestChangelog.schema;
+ }
+ const schema = await databaseStore.fetchDatabaseSchema(
+ `${database.name}/schema`
+ );
+ modifiedSchema.value = schema.schema;
+ isLoading.value = false;
+});
+</script>
diff --git a/frontend/src/store/modules/v1/changelog.ts b/frontend/src/store/modules/v1/changelog.ts
index 9ebef424a1..13c25d1b0b 100644
--- a/frontend/src/store/modules/v1/changelog.ts
+++ b/frontend/src/store/modules/v1/changelog.ts
@@ -43,14 +43,21 @@ export const useChangelogStore = defineStore("changelog", () => {
await upsertChangelogsMap(parent, changelogs);
return { changelogs, nextPageToken };
};
- const getOrFetchChangelogListOfDatabase = async (databaseName: string) => {
+ const getOrFetchChangelogListOfDatabase = async (
+ databaseName: string,
+ pageSize = DEFAULT_PAGE_SIZE,
+ view = ChangelogView.CHANGELOG_VIEW_BASIC,
+ filter = ""
+ ) => {
if (changelogsMapByDatabase.has(databaseName)) {
return changelogsMapByDatabase.get(databaseName) ?? [];
}
// Fetch all changelogs of the database with max DEFAULT_PAGE_SIZE.
const { changelogs } = await fetchChangelogList({
parent: databaseName,
- pageSize: DEFAULT_PAGE_SIZE,
+ pageSize,
+ view,
+ filter,
});
return changelogs;
};
diff --git a/frontend/src/types/proto/google/protobuf/descriptor.ts b/frontend/src/types/proto/google/protobuf/descriptor.ts
index 2fdf22f5e2..ae3f877dc7 100644
--- a/frontend/src/types/proto/google/protobuf/descriptor.ts
+++ b/frontend/src/types/proto/google/protobuf/descriptor.ts
@@ -36,7 +36,7 @@ export enum Edition {
EDITION_2024 = "EDITION_2024",
/**
* EDITION_1_TEST_ONLY - Placeholder editions for testing feature resolution. These should not be
- * used or relied on outside of tests.
+ * used or relyed on outside of tests.
*/
EDITION_1_TEST_ONLY = "EDITION_1_TEST_ONLY",
EDITION_2_TEST_ONLY = "EDITION_2_TEST_ONLY",
@@ -1093,13 +1093,12 @@ export interface MessageOptions {
export interface FieldOptions {
/**
- * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead.
* The ctype option instructs the C++ code generator to use a different
* representation of the field than it normally would. See the specific
* options below. This option is only implemented to support use of
* [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of
- * type "bytes" in the open source release.
- * TODO: make ctype actually deprecated.
+ * type "bytes" in the open source release -- sorry, we'll try to include
+ * other types in a future version!
*/
ctype?:
| FieldOptions_CType
@@ -1315,7 +1314,11 @@ export function fieldOptions_JSTypeToNumber(object: FieldOptions_JSType): number
}
}
-/** If set to RETENTION_SOURCE, the option will be omitted from the binary. */
+/**
+ * If set to RETENTION_SOURCE, the option will be omitted from the binary.
+ * Note: as of January 2023, support for this is in progress and does not yet
+ * have an effect (b/264593489).
+ */
export enum FieldOptions_OptionRetention {
RETENTION_UNKNOWN = "RETENTION_UNKNOWN",
RETENTION_RUNTIME = "RETENTION_RUNTIME",
@@ -1372,7 +1375,8 @@ export function fieldOptions_OptionRetentionToNumber(object: FieldOptions_Option
/**
* This indicates the types of entities that the field may apply to when used
* as an option. If it is unset, then the field may be freely used as an
- * option on any kind of entity.
+ * option on any kind of entity. Note: as of January 2023, support for this is
+ * in progress and does not yet have an effect (b/264593489).
*/
export enum FieldOptions_OptionTargetType {
TARGET_TYPE_UNKNOWN = "TARGET_TYPE_UNKNOWN",
diff --git a/frontend/src/types/proto/v1/anomaly_service.ts b/frontend/src/types/proto/v1/anomaly_service.ts
index 0ed4b79de4..5163a38f27 100644
--- a/frontend/src/types/proto/v1/anomaly_service.ts
+++ b/frontend/src/types/proto/v1/anomaly_service.ts
@@ -22,7 +22,7 @@ export interface SearchAnomaliesRequest {
* follow the [ebnf](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form) syntax.
* Only support filter by resource and type for now.
* For example:
- * Search the anomalies of a specific resource: 'resource="instances/{instance}".'
+ * Search the anomalies of a specific resource: 'resource="instances/{instance}/databases/{database}".'
* Search the specified types of anomalies: 'type="MIGRATION_SCHEMA".'
*/
filter: string;
@@ -59,17 +59,13 @@ export interface Anomaly {
/**
* The resource that is the target of the operation.
* Format:
- * - Instance: instnaces/{instance}
- * - Database: instnaces/{instance}/databases/{database}
+ * - Database: instances/{instance}/databases/{database}
*/
resource: string;
/** type is the type of the anomaly. */
type: Anomaly_AnomalyType;
/** severity is the severity of the anomaly. */
severity: Anomaly_AnomalySeverity;
- instanceConnectionDetail?: Anomaly_InstanceConnectionDetail | undefined;
- databaseConnectionDetail?: Anomaly_DatabaseConnectionDetail | undefined;
- databaseSchemaDriftDetail?: Anomaly_DatabaseSchemaDriftDetail | undefined;
createTime: Timestamp | undefined;
updateTime: Timestamp | undefined;
}
@@ -204,36 +200,6 @@ export function anomaly_AnomalySeverityToNumber(object: Anomaly_AnomalySeverity)
}
}
-/**
- * Instance level anomaly detail.
- *
- * InstanceConnectionDetail is the detail for instance connection anomaly.
- */
-export interface Anomaly_InstanceConnectionDetail {
- /** detail is the detail of the instance connection failure. */
- detail: string;
-}
-
-/**
- * Database level anomaly detial.
- *
- * DatbaaseConnectionDetail is the detail for database connection anomaly.
- */
-export interface Anomaly_DatabaseConnectionDetail {
- /** detail is the detail of the database connection failure. */
- detail: string;
-}
-
-/** DatabaseSchemaDriftDetail is the detail for database schema drift anomaly. */
-export interface Anomaly_DatabaseSchemaDriftDetail {
- /** record_version is the record version of the database schema drift. */
- recordVersion: string;
- /** expected_schema is the expected schema in the database. */
- expectedSchema: string;
- /** actual_schema is the actual schema in the database. */
- actualSchema: string;
-}
-
function createBaseSearchAnomaliesRequest(): SearchAnomaliesRequest {
return { parent: "", filter: "", pageSize: 0, pageToken: "" };
}
@@ -425,9 +391,6 @@ function createBaseAnomaly(): Anomaly {
resource: "",
type: Anomaly_AnomalyType.ANOMALY_TYPE_UNSPECIFIED,
severity: Anomaly_AnomalySeverity.ANOMALY_SEVERITY_UNSPECIFIED,
- instanceConnectionDetail: undefined,
- databaseConnectionDetail: undefined,
- databaseSchemaDriftDetail: undefined,
createTime: undefined,
updateTime: undefined,
};
@@ -444,15 +407,6 @@ export const Anomaly: MessageFns<Anomaly> = {
if (message.severity !== Anomaly_AnomalySeverity.ANOMALY_SEVERITY_UNSPECIFIED) {
writer.uint32(24).int32(anomaly_AnomalySeverityToNumber(message.severity));
}
- if (message.instanceConnectionDetail !== undefined) {
- Anomaly_InstanceConnectionDetail.encode(message.instanceConnectionDetail, writer.uint32(34).fork()).join();
- }
- if (message.databaseConnectionDetail !== undefined) {
- Anomaly_DatabaseConnectionDetail.encode(message.databaseConnectionDetail, writer.uint32(42).fork()).join();
- }
- if (message.databaseSchemaDriftDetail !== undefined) {
- Anomaly_DatabaseSchemaDriftDetail.encode(message.databaseSchemaDriftDetail, writer.uint32(66).fork()).join();
- }
if (message.createTime !== undefined) {
Timestamp.encode(message.createTime, writer.uint32(74).fork()).join();
}
@@ -493,30 +447,6 @@ export const Anomaly: MessageFns<Anomaly> = {
message.severity = anomaly_AnomalySeverityFromJSON(reader.int32());
continue;
}
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.instanceConnectionDetail = Anomaly_InstanceConnectionDetail.decode(reader, reader.uint32());
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.databaseConnectionDetail = Anomaly_DatabaseConnectionDetail.decode(reader, reader.uint32());
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.databaseSchemaDriftDetail = Anomaly_DatabaseSchemaDriftDetail.decode(reader, reader.uint32());
- continue;
- }
case 9: {
if (tag !== 74) {
break;
@@ -551,15 +481,6 @@ export const Anomaly: MessageFns<Anomaly> = {
severity: isSet(object.severity)
? anomaly_AnomalySeverityFromJSON(object.severity)
: Anomaly_AnomalySeverity.ANOMALY_SEVERITY_UNSPECIFIED,
- instanceConnectionDetail: isSet(object.instanceConnectionDetail)
- ? Anomaly_InstanceConnectionDetail.fromJSON(object.instanceConnectionDetail)
- : undefined,
- databaseConnectionDetail: isSet(object.databaseConnectionDetail)
- ? Anomaly_DatabaseConnectionDetail.fromJSON(object.databaseConnectionDetail)
- : undefined,
- databaseSchemaDriftDetail: isSet(object.databaseSchemaDriftDetail)
- ? Anomaly_DatabaseSchemaDriftDetail.fromJSON(object.databaseSchemaDriftDetail)
- : undefined,
createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
updateTime: isSet(object.updateTime) ? fromJsonTimestamp(object.updateTime) : undefined,
};
@@ -576,15 +497,6 @@ export const Anomaly: MessageFns<Anomaly> = {
if (message.severity !== Anomaly_AnomalySeverity.ANOMALY_SEVERITY_UNSPECIFIED) {
obj.severity = anomaly_AnomalySeverityToJSON(message.severity);
}
- if (message.instanceConnectionDetail !== undefined) {
- obj.instanceConnectionDetail = Anomaly_InstanceConnectionDetail.toJSON(message.instanceConnectionDetail);
- }
- if (message.databaseConnectionDetail !== undefined) {
- obj.databaseConnectionDetail = Anomaly_DatabaseConnectionDetail.toJSON(message.databaseConnectionDetail);
- }
- if (message.databaseSchemaDriftDetail !== undefined) {
- obj.databaseSchemaDriftDetail = Anomaly_DatabaseSchemaDriftDetail.toJSON(message.databaseSchemaDriftDetail);
- }
if (message.createTime !== undefined) {
obj.createTime = fromTimestamp(message.createTime).toISOString();
}
@@ -602,18 +514,6 @@ export const Anomaly: MessageFns<Anomaly> = {
message.resource = object.resource ?? "";
message.type = object.type ?? Anomaly_AnomalyType.ANOMALY_TYPE_UNSPECIFIED;
message.severity = object.severity ?? Anomaly_AnomalySeverity.ANOMALY_SEVERITY_UNSPECIFIED;
- message.instanceConnectionDetail =
- (object.instanceConnectionDetail !== undefined && object.instanceConnectionDetail !== null)
- ? Anomaly_InstanceConnectionDetail.fromPartial(object.instanceConnectionDetail)
- : undefined;
- message.databaseConnectionDetail =
- (object.databaseConnectionDetail !== undefined && object.databaseConnectionDetail !== null)
- ? Anomaly_DatabaseConnectionDetail.fromPartial(object.databaseConnectionDetail)
- : undefined;
- message.databaseSchemaDriftDetail =
- (object.databaseSchemaDriftDetail !== undefined && object.databaseSchemaDriftDetail !== null)
- ? Anomaly_DatabaseSchemaDriftDetail.fromPartial(object.databaseSchemaDriftDetail)
- : undefined;
message.createTime = (object.createTime !== undefined && object.createTime !== null)
? Timestamp.fromPartial(object.createTime)
: undefined;
@@ -624,214 +524,6 @@ export const Anomaly: MessageFns<Anomaly> = {
},
};
-function createBaseAnomaly_InstanceConnectionDetail(): Anomaly_InstanceConnectionDetail {
- return { detail: "" };
-}
-
-export const Anomaly_InstanceConnectionDetail: MessageFns<Anomaly_InstanceConnectionDetail> = {
- encode(message: Anomaly_InstanceConnectionDetail, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.detail !== "") {
- writer.uint32(10).string(message.detail);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Anomaly_InstanceConnectionDetail {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAnomaly_InstanceConnectionDetail();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.detail = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Anomaly_InstanceConnectionDetail {
- return { detail: isSet(object.detail) ? globalThis.String(object.detail) : "" };
- },
-
- toJSON(message: Anomaly_InstanceConnectionDetail): unknown {
- const obj: any = {};
- if (message.detail !== "") {
- obj.detail = message.detail;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Anomaly_InstanceConnectionDetail>): Anomaly_InstanceConnectionDetail {
- return Anomaly_InstanceConnectionDetail.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Anomaly_InstanceConnectionDetail>): Anomaly_InstanceConnectionDetail {
- const message = createBaseAnomaly_InstanceConnectionDetail();
- message.detail = object.detail ?? "";
- return message;
- },
-};
-
-function createBaseAnomaly_DatabaseConnectionDetail(): Anomaly_DatabaseConnectionDetail {
- return { detail: "" };
-}
-
-export const Anomaly_DatabaseConnectionDetail: MessageFns<Anomaly_DatabaseConnectionDetail> = {
- encode(message: Anomaly_DatabaseConnectionDetail, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.detail !== "") {
- writer.uint32(10).string(message.detail);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Anomaly_DatabaseConnectionDetail {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAnomaly_DatabaseConnectionDetail();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.detail = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Anomaly_DatabaseConnectionDetail {
- return { detail: isSet(object.detail) ? globalThis.String(object.detail) : "" };
- },
-
- toJSON(message: Anomaly_DatabaseConnectionDetail): unknown {
- const obj: any = {};
- if (message.detail !== "") {
- obj.detail = message.detail;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Anomaly_DatabaseConnectionDetail>): Anomaly_DatabaseConnectionDetail {
- return Anomaly_DatabaseConnectionDetail.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Anomaly_DatabaseConnectionDetail>): Anomaly_DatabaseConnectionDetail {
- const message = createBaseAnomaly_DatabaseConnectionDetail();
- message.detail = object.detail ?? "";
- return message;
- },
-};
-
-function createBaseAnomaly_DatabaseSchemaDriftDetail(): Anomaly_DatabaseSchemaDriftDetail {
- return { recordVersion: "", expectedSchema: "", actualSchema: "" };
-}
-
-export const Anomaly_DatabaseSchemaDriftDetail: MessageFns<Anomaly_DatabaseSchemaDriftDetail> = {
- encode(message: Anomaly_DatabaseSchemaDriftDetail, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.recordVersion !== "") {
- writer.uint32(10).string(message.recordVersion);
- }
- if (message.expectedSchema !== "") {
- writer.uint32(18).string(message.expectedSchema);
- }
- if (message.actualSchema !== "") {
- writer.uint32(26).string(message.actualSchema);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Anomaly_DatabaseSchemaDriftDetail {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseAnomaly_DatabaseSchemaDriftDetail();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.recordVersion = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.expectedSchema = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.actualSchema = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Anomaly_DatabaseSchemaDriftDetail {
- return {
- recordVersion: isSet(object.recordVersion) ? globalThis.String(object.recordVersion) : "",
- expectedSchema: isSet(object.expectedSchema) ? globalThis.String(object.expectedSchema) : "",
- actualSchema: isSet(object.actualSchema) ? globalThis.String(object.actualSchema) : "",
- };
- },
-
- toJSON(message: Anomaly_DatabaseSchemaDriftDetail): unknown {
- const obj: any = {};
- if (message.recordVersion !== "") {
- obj.recordVersion = message.recordVersion;
- }
- if (message.expectedSchema !== "") {
- obj.expectedSchema = message.expectedSchema;
- }
- if (message.actualSchema !== "") {
- obj.actualSchema = message.actualSchema;
- }
- return obj;
- },
-
- create(base?: DeepPartial<Anomaly_DatabaseSchemaDriftDetail>): Anomaly_DatabaseSchemaDriftDetail {
- return Anomaly_DatabaseSchemaDriftDetail.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Anomaly_DatabaseSchemaDriftDetail>): Anomaly_DatabaseSchemaDriftDetail {
- const message = createBaseAnomaly_DatabaseSchemaDriftDetail();
- message.recordVersion = object.recordVersion ?? "";
- message.expectedSchema = object.expectedSchema ?? "";
- message.actualSchema = object.actualSchema ?? "";
- return message;
- },
-};
-
export type AnomalyServiceDefinition = typeof AnomalyServiceDefinition;
export const AnomalyServiceDefinition = {
name: "AnomalyService",
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index fff696c245..80ffad393e 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -8741,8 +8741,7 @@ components:
description: |-
The resource that is the target of the operation.
Format:
- - Instance: instnaces/{instance}
- - Database: instnaces/{instance}/databases/{database}
+ - Database: instances/{instance}/databases/{database}
type:
enum:
- ANOMALY_TYPE_UNSPECIFIED
@@ -8760,12 +8759,6 @@ components:
type: string
description: severity is the severity of the anomaly.
format: enum
- instanceConnectionDetail:
- $ref: '#/components/schemas/Anomaly_InstanceConnectionDetail'
- databaseConnectionDetail:
- $ref: '#/components/schemas/Anomaly_DatabaseConnectionDetail'
- databaseSchemaDriftDetail:
- $ref: '#/components/schemas/Anomaly_DatabaseSchemaDriftDetail'
createTime:
readOnly: true
type: string
@@ -8774,39 +8767,6 @@ components:
readOnly: true
type: string
format: date-time
- Anomaly_DatabaseConnectionDetail:
- type: object
- properties:
- detail:
- type: string
- description: detail is the detail of the database connection failure.
- description: |-
- Database level anomaly detial.
-
- DatbaaseConnectionDetail is the detail for database connection anomaly.
- Anomaly_DatabaseSchemaDriftDetail:
- type: object
- properties:
- recordVersion:
- type: string
- description: record_version is the record version of the database schema drift.
- expectedSchema:
- type: string
- description: expected_schema is the expected schema in the database.
- actualSchema:
- type: string
- description: actual_schema is the actual schema in the database.
- description: DatabaseSchemaDriftDetail is the detail for database schema drift anomaly.
- Anomaly_InstanceConnectionDetail:
- type: object
- properties:
- detail:
- type: string
- description: detail is the detail of the instance connection failure.
- description: |-
- Instance level anomaly detail.
-
- InstanceConnectionDetail is the detail for instance connection anomaly.
AppIMSetting:
type: object
properties:
@@ -13477,7 +13437,7 @@ components:
follow the [ebnf](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form) syntax.
Only support filter by resource and type for now.
For example:
- Search the anomalies of a specific resource: 'resource="instances/{instance}".'
+ Search the anomalies of a specific resource: 'resource="instances/{instance}/databases/{database}".'
Search the specified types of anomalies: 'type="MIGRATION_SCHEMA".'
pageSize:
type: integer
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index d91e88d082..71f03a508a 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -297,9 +297,6 @@
- [v1/anomaly_service.proto](#v1_anomaly_service-proto)
- [Anomaly](#bytebase-v1-Anomaly)
- - [Anomaly.DatabaseConnectionDetail](#bytebase-v1-Anomaly-DatabaseConnectionDetail)
- - [Anomaly.DatabaseSchemaDriftDetail](#bytebase-v1-Anomaly-DatabaseSchemaDriftDetail)
- - [Anomaly.InstanceConnectionDetail](#bytebase-v1-Anomaly-InstanceConnectionDetail)
- [SearchAnomaliesRequest](#bytebase-v1-SearchAnomaliesRequest)
- [SearchAnomaliesResponse](#bytebase-v1-SearchAnomaliesResponse)
@@ -5371,12 +5368,9 @@ The theme resources.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| resource | [string](#string) | | The resource that is the target of the operation. Format: - Instance: instnaces/{instance} - Database: instnaces/{instance}/databases/{database} |
+| resource | [string](#string) | | The resource that is the target of the operation. Format: - Database: instances/{instance}/databases/{database} |
| type | [Anomaly.AnomalyType](#bytebase-v1-Anomaly-AnomalyType) | | type is the type of the anomaly. |
| severity | [Anomaly.AnomalySeverity](#bytebase-v1-Anomaly-AnomalySeverity) | | severity is the severity of the anomaly. |
-| instance_connection_detail | [Anomaly.InstanceConnectionDetail](#bytebase-v1-Anomaly-InstanceConnectionDetail) | | |
-| database_connection_detail | [Anomaly.DatabaseConnectionDetail](#bytebase-v1-Anomaly-DatabaseConnectionDetail) | | |
-| database_schema_drift_detail | [Anomaly.DatabaseSchemaDriftDetail](#bytebase-v1-Anomaly-DatabaseSchemaDriftDetail) | | |
| create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| update_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
@@ -5385,57 +5379,6 @@ The theme resources.
-<a name="bytebase-v1-Anomaly-DatabaseConnectionDetail"></a>
-
-### Anomaly.DatabaseConnectionDetail
-Database level anomaly detial.
-
-DatbaaseConnectionDetail is the detail for database connection anomaly.
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| detail | [string](#string) | | detail is the detail of the database connection failure. |
-
-
-
-
-
-
-<a name="bytebase-v1-Anomaly-DatabaseSchemaDriftDetail"></a>
-
-### Anomaly.DatabaseSchemaDriftDetail
-DatabaseSchemaDriftDetail is the detail for database schema drift anomaly.
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| record_version | [string](#string) | | record_version is the record version of the database schema drift. |
-| expected_schema | [string](#string) | | expected_schema is the expected schema in the database. |
-| actual_schema | [string](#string) | | actual_schema is the actual schema in the database. |
-
-
-
-
-
-
-<a name="bytebase-v1-Anomaly-InstanceConnectionDetail"></a>
-
-### Anomaly.InstanceConnectionDetail
-Instance level anomaly detail.
-
-InstanceConnectionDetail is the detail for instance connection anomaly.
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| detail | [string](#string) | | detail is the detail of the instance connection failure. |
-
-
-
-
-
-
<a name="bytebase-v1-SearchAnomaliesRequest"></a>
### SearchAnomaliesRequest
@@ -5445,7 +5388,7 @@ InstanceConnectionDetail is the detail for instance connection anomaly.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| parent | [string](#string) | | The parent resource whose anomalies are to be listed. Format: projects/{project} |
-| filter | [string](#string) | | filter is the filter to apply on the search anomaly request, follow the [ebnf](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form) syntax. Only support filter by resource and type for now. For example: Search the anomalies of a specific resource: &#39;resource=&#34;instances/{instance}&#34;.&#39; Search the specified types of anomalies: &#39;type=&#34;MIGRATION_SCHEMA&#34;.&#39; |
+| filter | [string](#string) | | filter is the filter to apply on the search anomaly request, follow the [ebnf](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form) syntax. Only support filter by resource and type for now. For example: Search the anomalies of a specific resource: &#39;resource=&#34;instances/{instance}/databases/{database}&#34;.&#39; Search the specified types of anomalies: &#39;type=&#34;MIGRATION_SCHEMA&#34;.&#39; |
| page_size | [int32](#int32) | | Not used. The maximum number of anomalies to return. The service may return fewer than this value. If unspecified, at most 10 anomalies will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. |
| page_token | [string](#string) | | Not used. A page token, received from a previous `SearchAnomalies` call. Provide this to retrieve the subsequent page.
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 9933215df9..ca12cd0cab 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -1316,18 +1316,6 @@
<a href="#bytebase.v1.Anomaly"><span class="badge">M</span>Anomaly</a>
</li>
- <li>
- <a href="#bytebase.v1.Anomaly.DatabaseConnectionDetail"><span class="badge">M</span>Anomaly.DatabaseConnectionDetail</a>
- </li>
-
- <li>
- <a href="#bytebase.v1.Anomaly.DatabaseSchemaDriftDetail"><span class="badge">M</span>Anomaly.DatabaseSchemaDriftDetail</a>
- </li>
-
- <li>
- <a href="#bytebase.v1.Anomaly.InstanceConnectionDetail"><span class="badge">M</span>Anomaly.InstanceConnectionDetail</a>
- </li>
-
<li>
<a href="#bytebase.v1.SearchAnomaliesRequest"><span class="badge">M</span>SearchAnomaliesRequest</a>
</li>
@@ -15474,8 +15462,7 @@ Default to this mode.</p></td>
<td></td>
<td><p>The resource that is the target of the operation.
Format:
-- Instance: instnaces/{instance}
-- Database: instnaces/{instance}/databases/{database} </p></td>
+- Database: instances/{instance}/databases/{database} </p></td>
</tr>
<tr>
@@ -15492,27 +15479,6 @@ Format:
<td><p>severity is the severity of the anomaly. </p></td>
</tr>
- <tr>
- <td>instance_connection_detail</td>
- <td><a href="#bytebase.v1.Anomaly.InstanceConnectionDetail">Anomaly.InstanceConnectionDetail</a></td>
- <td></td>
- <td><p> </p></td>
- </tr>
-
- <tr>
- <td>database_connection_detail</td>
- <td><a href="#bytebase.v1.Anomaly.DatabaseConnectionDetail">Anomaly.DatabaseConnectionDetail</a></td>
- <td></td>
- <td><p> </p></td>
- </tr>
-
- <tr>
- <td>database_schema_drift_detail</td>
- <td><a href="#bytebase.v1.Anomaly.DatabaseSchemaDriftDetail">Anomaly.DatabaseSchemaDriftDetail</a></td>
- <td></td>
- <td><p> </p></td>
- </tr>
-
<tr>
<td>create_time</td>
<td><a href="#google.protobuf.Timestamp">google.protobuf.Timestamp</a></td>
@@ -15534,92 +15500,6 @@ Format:
- <h3 id="bytebase.v1.Anomaly.DatabaseConnectionDetail">Anomaly.DatabaseConnectionDetail</h3>
- <p>Database level anomaly detial.</p><p>DatbaaseConnectionDetail is the detail for database connection anomaly.</p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>detail</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>detail is the detail of the database connection failure. </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.v1.Anomaly.DatabaseSchemaDriftDetail">Anomaly.DatabaseSchemaDriftDetail</h3>
- <p>DatabaseSchemaDriftDetail is the detail for database schema drift anomaly.</p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>record_version</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>record_version is the record version of the database schema drift. </p></td>
- </tr>
-
- <tr>
- <td>expected_schema</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>expected_schema is the expected schema in the database. </p></td>
- </tr>
-
- <tr>
- <td>actual_schema</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>actual_schema is the actual schema in the database. </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.v1.Anomaly.InstanceConnectionDetail">Anomaly.InstanceConnectionDetail</h3>
- <p>Instance level anomaly detail.</p><p>InstanceConnectionDetail is the detail for instance connection anomaly.</p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>detail</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>detail is the detail of the instance connection failure. </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
<h3 id="bytebase.v1.SearchAnomaliesRequest">SearchAnomaliesRequest</h3>
<p></p>
@@ -15646,7 +15526,7 @@ Format: projects/{project} </p></td>
follow the [ebnf](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form) syntax.
Only support filter by resource and type for now.
For example:
-Search the anomalies of a specific resource: &#39;resource=&#34;instances/{instance}&#34;.&#39;
+Search the anomalies of a specific resource: &#39;resource=&#34;instances/{instance}/databases/{database}&#34;.&#39;
Search the specified types of anomalies: &#39;type=&#34;MIGRATION_SCHEMA&#34;.&#39; </p></td>
</tr>
diff --git a/proto/generated-go/v1/anomaly_service.pb.go b/proto/generated-go/v1/anomaly_service.pb.go
index da6eb661cf..ce46439e89 100644
--- a/proto/generated-go/v1/anomaly_service.pb.go
+++ b/proto/generated-go/v1/anomaly_service.pb.go
@@ -144,7 +144,7 @@ type SearchAnomaliesRequest struct {
// follow the [ebnf](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form) syntax.
// Only support filter by resource and type for now.
// For example:
- // Search the anomalies of a specific resource: 'resource="instances/{instance}".'
+ // Search the anomalies of a specific resource: 'resource="instances/{instance}/databases/{database}".'
// Search the specified types of anomalies: 'type="MIGRATION_SCHEMA".'
Filter string `protobuf:"bytes,2,opt,name=filter,proto3" json:"filter,omitempty"`
// Not used.
@@ -281,23 +281,14 @@ type Anomaly struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The resource that is the target of the operation.
// Format:
- // - Instance: instnaces/{instance}
- // - Database: instnaces/{instance}/databases/{database}
+ // - Database: instances/{instance}/databases/{database}
Resource string `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"`
// type is the type of the anomaly.
Type Anomaly_AnomalyType `protobuf:"varint,2,opt,name=type,proto3,enum=bytebase.v1.Anomaly_AnomalyType" json:"type,omitempty"`
// severity is the severity of the anomaly.
- Severity Anomaly_AnomalySeverity `protobuf:"varint,3,opt,name=severity,proto3,enum=bytebase.v1.Anomaly_AnomalySeverity" json:"severity,omitempty"`
- // detail is the detail of the anomaly.
- //
- // Types that are valid to be assigned to Detail:
- //
- // *Anomaly_InstanceConnectionDetail_
- // *Anomaly_DatabaseConnectionDetail_
- // *Anomaly_DatabaseSchemaDriftDetail_
- Detail isAnomaly_Detail `protobuf_oneof:"detail"`
- CreateTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
- UpdateTime *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
+ Severity Anomaly_AnomalySeverity `protobuf:"varint,3,opt,name=severity,proto3,enum=bytebase.v1.Anomaly_AnomalySeverity" json:"severity,omitempty"`
+ CreateTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
+ UpdateTime *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@@ -353,40 +344,6 @@ func (x *Anomaly) GetSeverity() Anomaly_AnomalySeverity {
return Anomaly_ANOMALY_SEVERITY_UNSPECIFIED
}
-func (x *Anomaly) GetDetail() isAnomaly_Detail {
- if x != nil {
- return x.Detail
- }
- return nil
-}
-
-func (x *Anomaly) GetInstanceConnectionDetail() *Anomaly_InstanceConnectionDetail {
- if x != nil {
- if x, ok := x.Detail.(*Anomaly_InstanceConnectionDetail_); ok {
- return x.InstanceConnectionDetail
- }
- }
- return nil
-}
-
-func (x *Anomaly) GetDatabaseConnectionDetail() *Anomaly_DatabaseConnectionDetail {
- if x != nil {
- if x, ok := x.Detail.(*Anomaly_DatabaseConnectionDetail_); ok {
- return x.DatabaseConnectionDetail
- }
- }
- return nil
-}
-
-func (x *Anomaly) GetDatabaseSchemaDriftDetail() *Anomaly_DatabaseSchemaDriftDetail {
- if x != nil {
- if x, ok := x.Detail.(*Anomaly_DatabaseSchemaDriftDetail_); ok {
- return x.DatabaseSchemaDriftDetail
- }
- }
- return nil
-}
-
func (x *Anomaly) GetCreateTime() *timestamppb.Timestamp {
if x != nil {
return x.CreateTime
@@ -401,188 +358,6 @@ func (x *Anomaly) GetUpdateTime() *timestamppb.Timestamp {
return nil
}
-type isAnomaly_Detail interface {
- isAnomaly_Detail()
-}
-
-type Anomaly_InstanceConnectionDetail_ struct {
- InstanceConnectionDetail *Anomaly_InstanceConnectionDetail `protobuf:"bytes,4,opt,name=instance_connection_detail,json=instanceConnectionDetail,proto3,oneof"`
-}
-
-type Anomaly_DatabaseConnectionDetail_ struct {
- DatabaseConnectionDetail *Anomaly_DatabaseConnectionDetail `protobuf:"bytes,5,opt,name=database_connection_detail,json=databaseConnectionDetail,proto3,oneof"`
-}
-
-type Anomaly_DatabaseSchemaDriftDetail_ struct {
- DatabaseSchemaDriftDetail *Anomaly_DatabaseSchemaDriftDetail `protobuf:"bytes,8,opt,name=database_schema_drift_detail,json=databaseSchemaDriftDetail,proto3,oneof"`
-}
-
-func (*Anomaly_InstanceConnectionDetail_) isAnomaly_Detail() {}
-
-func (*Anomaly_DatabaseConnectionDetail_) isAnomaly_Detail() {}
-
-func (*Anomaly_DatabaseSchemaDriftDetail_) isAnomaly_Detail() {}
-
-// Instance level anomaly detail.
-//
-// InstanceConnectionDetail is the detail for instance connection anomaly.
-type Anomaly_InstanceConnectionDetail struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // detail is the detail of the instance connection failure.
- Detail string `protobuf:"bytes,1,opt,name=detail,proto3" json:"detail,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *Anomaly_InstanceConnectionDetail) Reset() {
- *x = Anomaly_InstanceConnectionDetail{}
- mi := &file_v1_anomaly_service_proto_msgTypes[3]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *Anomaly_InstanceConnectionDetail) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*Anomaly_InstanceConnectionDetail) ProtoMessage() {}
-
-func (x *Anomaly_InstanceConnectionDetail) ProtoReflect() protoreflect.Message {
- mi := &file_v1_anomaly_service_proto_msgTypes[3]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use Anomaly_InstanceConnectionDetail.ProtoReflect.Descriptor instead.
-func (*Anomaly_InstanceConnectionDetail) Descriptor() ([]byte, []int) {
- return file_v1_anomaly_service_proto_rawDescGZIP(), []int{2, 0}
-}
-
-func (x *Anomaly_InstanceConnectionDetail) GetDetail() string {
- if x != nil {
- return x.Detail
- }
- return ""
-}
-
-// Database level anomaly detial.
-//
-// DatbaaseConnectionDetail is the detail for database connection anomaly.
-type Anomaly_DatabaseConnectionDetail struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // detail is the detail of the database connection failure.
- Detail string `protobuf:"bytes,1,opt,name=detail,proto3" json:"detail,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *Anomaly_DatabaseConnectionDetail) Reset() {
- *x = Anomaly_DatabaseConnectionDetail{}
- mi := &file_v1_anomaly_service_proto_msgTypes[4]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *Anomaly_DatabaseConnectionDetail) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*Anomaly_DatabaseConnectionDetail) ProtoMessage() {}
-
-func (x *Anomaly_DatabaseConnectionDetail) ProtoReflect() protoreflect.Message {
- mi := &file_v1_anomaly_service_proto_msgTypes[4]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use Anomaly_DatabaseConnectionDetail.ProtoReflect.Descriptor instead.
-func (*Anomaly_DatabaseConnectionDetail) Descriptor() ([]byte, []int) {
- return file_v1_anomaly_service_proto_rawDescGZIP(), []int{2, 1}
-}
-
-func (x *Anomaly_DatabaseConnectionDetail) GetDetail() string {
- if x != nil {
- return x.Detail
- }
- return ""
-}
-
-// DatabaseSchemaDriftDetail is the detail for database schema drift anomaly.
-type Anomaly_DatabaseSchemaDriftDetail struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // record_version is the record version of the database schema drift.
- RecordVersion string `protobuf:"bytes,1,opt,name=record_version,json=recordVersion,proto3" json:"record_version,omitempty"`
- // expected_schema is the expected schema in the database.
- ExpectedSchema string `protobuf:"bytes,2,opt,name=expected_schema,json=expectedSchema,proto3" json:"expected_schema,omitempty"`
- // actual_schema is the actual schema in the database.
- ActualSchema string `protobuf:"bytes,3,opt,name=actual_schema,json=actualSchema,proto3" json:"actual_schema,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *Anomaly_DatabaseSchemaDriftDetail) Reset() {
- *x = Anomaly_DatabaseSchemaDriftDetail{}
- mi := &file_v1_anomaly_service_proto_msgTypes[5]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *Anomaly_DatabaseSchemaDriftDetail) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*Anomaly_DatabaseSchemaDriftDetail) ProtoMessage() {}
-
-func (x *Anomaly_DatabaseSchemaDriftDetail) ProtoReflect() protoreflect.Message {
- mi := &file_v1_anomaly_service_proto_msgTypes[5]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use Anomaly_DatabaseSchemaDriftDetail.ProtoReflect.Descriptor instead.
-func (*Anomaly_DatabaseSchemaDriftDetail) Descriptor() ([]byte, []int) {
- return file_v1_anomaly_service_proto_rawDescGZIP(), []int{2, 2}
-}
-
-func (x *Anomaly_DatabaseSchemaDriftDetail) GetRecordVersion() string {
- if x != nil {
- return x.RecordVersion
- }
- return ""
-}
-
-func (x *Anomaly_DatabaseSchemaDriftDetail) GetExpectedSchema() string {
- if x != nil {
- return x.ExpectedSchema
- }
- return ""
-}
-
-func (x *Anomaly_DatabaseSchemaDriftDetail) GetActualSchema() string {
- if x != nil {
- return x.ActualSchema
- }
- return ""
-}
-
var File_v1_anomaly_service_proto protoreflect.FileDescriptor
var file_v1_anomaly_service_proto_rawDesc = []byte{
@@ -615,7 +390,7 @@ var file_v1_anomaly_service_proto_rawDesc = []byte{
0x79, 0x52, 0x09, 0x61, 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x69, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f,
0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54,
- 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xb9, 0x08, 0x0a, 0x07, 0x41, 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x79,
+ 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xe3, 0x03, 0x0a, 0x07, 0x41, 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x79,
0x12, 0x20, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,
0x63, 0x65, 0x12, 0x34, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e,
@@ -625,77 +400,39 @@ var file_v1_anomaly_service_proto_rawDesc = []byte{
0x72, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x62, 0x79, 0x74,
0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x79,
0x2e, 0x41, 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x79, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79,
- 0x52, 0x08, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x12, 0x6d, 0x0a, 0x1a, 0x69, 0x6e,
- 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f,
- 0x6e, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6e, 0x6f,
- 0x6d, 0x61, 0x6c, 0x79, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x6e,
- 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x48, 0x00, 0x52,
- 0x18, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
- 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x6d, 0x0a, 0x1a, 0x64, 0x61, 0x74,
- 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
- 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6e, 0x6f, 0x6d,
- 0x61, 0x6c, 0x79, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x6e,
- 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x48, 0x00, 0x52, 0x18,
- 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69,
- 0x6f, 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x71, 0x0a, 0x1c, 0x64, 0x61, 0x74, 0x61,
- 0x62, 0x61, 0x73, 0x65, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x64, 0x72, 0x69, 0x66,
- 0x74, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6e, 0x6f,
- 0x6d, 0x61, 0x6c, 0x79, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x53, 0x63, 0x68,
- 0x65, 0x6d, 0x61, 0x44, 0x72, 0x69, 0x66, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x48, 0x00,
- 0x52, 0x19, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61,
- 0x44, 0x72, 0x69, 0x66, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x41, 0x0a, 0x0b, 0x63,
- 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b,
- 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
- 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0xe2, 0x41,
- 0x01, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x41,
- 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42,
- 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d,
- 0x65, 0x1a, 0x32, 0x0a, 0x18, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x6e,
- 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x16, 0x0a,
- 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64,
- 0x65, 0x74, 0x61, 0x69, 0x6c, 0x1a, 0x32, 0x0a, 0x18, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,
- 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69,
- 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28,
- 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x1a, 0x90, 0x01, 0x0a, 0x19, 0x44, 0x61,
- 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x72, 0x69, 0x66,
- 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x63, 0x6f, 0x72,
- 0x64, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x0d, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x27,
- 0x0a, 0x0f, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d,
- 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65,
- 0x64, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x63, 0x74, 0x75, 0x61,
- 0x6c, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c,
- 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0x5f, 0x0a, 0x0b,
- 0x41, 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x18, 0x41,
- 0x4e, 0x4f, 0x4d, 0x41, 0x4c, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50,
- 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x44, 0x41, 0x54,
- 0x41, 0x42, 0x41, 0x53, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e,
- 0x10, 0x05, 0x12, 0x19, 0x0a, 0x15, 0x44, 0x41, 0x54, 0x41, 0x42, 0x41, 0x53, 0x45, 0x5f, 0x53,
- 0x43, 0x48, 0x45, 0x4d, 0x41, 0x5f, 0x44, 0x52, 0x49, 0x46, 0x54, 0x10, 0x06, 0x22, 0x57, 0x0a,
- 0x0f, 0x41, 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x79, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79,
- 0x12, 0x20, 0x0a, 0x1c, 0x41, 0x4e, 0x4f, 0x4d, 0x41, 0x4c, 0x59, 0x5f, 0x53, 0x45, 0x56, 0x45,
- 0x52, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44,
- 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x45, 0x44, 0x49, 0x55, 0x4d, 0x10, 0x01, 0x12, 0x08,
- 0x0a, 0x04, 0x48, 0x49, 0x47, 0x48, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x52, 0x49, 0x54,
- 0x49, 0x43, 0x41, 0x4c, 0x10, 0x03, 0x42, 0x08, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c,
- 0x32, 0xa8, 0x01, 0x0a, 0x0e, 0x41, 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x79, 0x53, 0x65, 0x72, 0x76,
- 0x69, 0x63, 0x65, 0x12, 0x95, 0x01, 0x0a, 0x0f, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x6e,
- 0x6f, 0x6d, 0x61, 0x6c, 0x69, 0x65, 0x73, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
- 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x6e, 0x6f, 0x6d,
- 0x61, 0x6c, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63,
- 0x68, 0x41, 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
- 0x73, 0x65, 0x22, 0x37, 0x90, 0xea, 0x30, 0x02, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x3a, 0x01,
- 0x2a, 0x22, 0x28, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70,
- 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x61, 0x6e, 0x6f, 0x6d, 0x61,
- 0x6c, 0x69, 0x65, 0x73, 0x3a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x42, 0x11, 0x5a, 0x0f, 0x67,
- 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x52, 0x08, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x12, 0x41, 0x0a, 0x0b, 0x63, 0x72,
+ 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
+ 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0xe2, 0x41, 0x01,
+ 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x41, 0x0a,
+ 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01,
+ 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04,
+ 0xe2, 0x41, 0x01, 0x03, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65,
+ 0x22, 0x5f, 0x0a, 0x0b, 0x41, 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12,
+ 0x1c, 0x0a, 0x18, 0x41, 0x4e, 0x4f, 0x4d, 0x41, 0x4c, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
+ 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a,
+ 0x13, 0x44, 0x41, 0x54, 0x41, 0x42, 0x41, 0x53, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43,
+ 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x05, 0x12, 0x19, 0x0a, 0x15, 0x44, 0x41, 0x54, 0x41, 0x42, 0x41,
+ 0x53, 0x45, 0x5f, 0x53, 0x43, 0x48, 0x45, 0x4d, 0x41, 0x5f, 0x44, 0x52, 0x49, 0x46, 0x54, 0x10,
+ 0x06, 0x22, 0x57, 0x0a, 0x0f, 0x41, 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x79, 0x53, 0x65, 0x76, 0x65,
+ 0x72, 0x69, 0x74, 0x79, 0x12, 0x20, 0x0a, 0x1c, 0x41, 0x4e, 0x4f, 0x4d, 0x41, 0x4c, 0x59, 0x5f,
+ 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49,
+ 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x45, 0x44, 0x49, 0x55, 0x4d,
+ 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x49, 0x47, 0x48, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08,
+ 0x43, 0x52, 0x49, 0x54, 0x49, 0x43, 0x41, 0x4c, 0x10, 0x03, 0x32, 0xa8, 0x01, 0x0a, 0x0e, 0x41,
+ 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x95, 0x01,
+ 0x0a, 0x0f, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x69, 0x65,
+ 0x73, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x69, 0x65, 0x73, 0x52,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x6e, 0x6f, 0x6d, 0x61,
+ 0x6c, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x90, 0xea,
+ 0x30, 0x02, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x3a, 0x01, 0x2a, 0x22, 0x28, 0x2f, 0x76, 0x31,
+ 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
+ 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x61, 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x69, 0x65, 0x73, 0x3a, 0x73,
+ 0x65, 0x61, 0x72, 0x63, 0x68, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -711,34 +448,28 @@ func file_v1_anomaly_service_proto_rawDescGZIP() []byte {
}
var file_v1_anomaly_service_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
-var file_v1_anomaly_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
+var file_v1_anomaly_service_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_v1_anomaly_service_proto_goTypes = []any{
- (Anomaly_AnomalyType)(0), // 0: bytebase.v1.Anomaly.AnomalyType
- (Anomaly_AnomalySeverity)(0), // 1: bytebase.v1.Anomaly.AnomalySeverity
- (*SearchAnomaliesRequest)(nil), // 2: bytebase.v1.SearchAnomaliesRequest
- (*SearchAnomaliesResponse)(nil), // 3: bytebase.v1.SearchAnomaliesResponse
- (*Anomaly)(nil), // 4: bytebase.v1.Anomaly
- (*Anomaly_InstanceConnectionDetail)(nil), // 5: bytebase.v1.Anomaly.InstanceConnectionDetail
- (*Anomaly_DatabaseConnectionDetail)(nil), // 6: bytebase.v1.Anomaly.DatabaseConnectionDetail
- (*Anomaly_DatabaseSchemaDriftDetail)(nil), // 7: bytebase.v1.Anomaly.DatabaseSchemaDriftDetail
- (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp
+ (Anomaly_AnomalyType)(0), // 0: bytebase.v1.Anomaly.AnomalyType
+ (Anomaly_AnomalySeverity)(0), // 1: bytebase.v1.Anomaly.AnomalySeverity
+ (*SearchAnomaliesRequest)(nil), // 2: bytebase.v1.SearchAnomaliesRequest
+ (*SearchAnomaliesResponse)(nil), // 3: bytebase.v1.SearchAnomaliesResponse
+ (*Anomaly)(nil), // 4: bytebase.v1.Anomaly
+ (*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp
}
var file_v1_anomaly_service_proto_depIdxs = []int32{
4, // 0: bytebase.v1.SearchAnomaliesResponse.anomalies:type_name -> bytebase.v1.Anomaly
0, // 1: bytebase.v1.Anomaly.type:type_name -> bytebase.v1.Anomaly.AnomalyType
1, // 2: bytebase.v1.Anomaly.severity:type_name -> bytebase.v1.Anomaly.AnomalySeverity
- 5, // 3: bytebase.v1.Anomaly.instance_connection_detail:type_name -> bytebase.v1.Anomaly.InstanceConnectionDetail
- 6, // 4: bytebase.v1.Anomaly.database_connection_detail:type_name -> bytebase.v1.Anomaly.DatabaseConnectionDetail
- 7, // 5: bytebase.v1.Anomaly.database_schema_drift_detail:type_name -> bytebase.v1.Anomaly.DatabaseSchemaDriftDetail
- 8, // 6: bytebase.v1.Anomaly.create_time:type_name -> google.protobuf.Timestamp
- 8, // 7: bytebase.v1.Anomaly.update_time:type_name -> google.protobuf.Timestamp
- 2, // 8: bytebase.v1.AnomalyService.SearchAnomalies:input_type -> bytebase.v1.SearchAnomaliesRequest
- 3, // 9: bytebase.v1.AnomalyService.SearchAnomalies:output_type -> bytebase.v1.SearchAnomaliesResponse
- 9, // [9:10] is the sub-list for method output_type
- 8, // [8:9] is the sub-list for method input_type
- 8, // [8:8] is the sub-list for extension type_name
- 8, // [8:8] is the sub-list for extension extendee
- 0, // [0:8] is the sub-list for field type_name
+ 5, // 3: bytebase.v1.Anomaly.create_time:type_name -> google.protobuf.Timestamp
+ 5, // 4: bytebase.v1.Anomaly.update_time:type_name -> google.protobuf.Timestamp
+ 2, // 5: bytebase.v1.AnomalyService.SearchAnomalies:input_type -> bytebase.v1.SearchAnomaliesRequest
+ 3, // 6: bytebase.v1.AnomalyService.SearchAnomalies:output_type -> bytebase.v1.SearchAnomaliesResponse
+ 6, // [6:7] is the sub-list for method output_type
+ 5, // [5:6] is the sub-list for method input_type
+ 5, // [5:5] is the sub-list for extension type_name
+ 5, // [5:5] is the sub-list for extension extendee
+ 0, // [0:5] is the sub-list for field type_name
}
func init() { file_v1_anomaly_service_proto_init() }
@@ -747,18 +478,13 @@ func file_v1_anomaly_service_proto_init() {
return
}
file_v1_annotation_proto_init()
- file_v1_anomaly_service_proto_msgTypes[2].OneofWrappers = []any{
- (*Anomaly_InstanceConnectionDetail_)(nil),
- (*Anomaly_DatabaseConnectionDetail_)(nil),
- (*Anomaly_DatabaseSchemaDriftDetail_)(nil),
- }
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_v1_anomaly_service_proto_rawDesc,
NumEnums: 2,
- NumMessages: 6,
+ NumMessages: 3,
NumExtensions: 0,
NumServices: 1,
},
diff --git a/proto/v1/anomaly_service.proto b/proto/v1/anomaly_service.proto
index e4262cbb66..7b8f7b1a72 100644
--- a/proto/v1/anomaly_service.proto
+++ b/proto/v1/anomaly_service.proto
@@ -32,7 +32,7 @@ message SearchAnomaliesRequest {
// follow the [ebnf](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form) syntax.
// Only support filter by resource and type for now.
// For example:
- // Search the anomalies of a specific resource: 'resource="instances/{instance}".'
+ // Search the anomalies of a specific resource: 'resource="instances/{instance}/databases/{database}".'
// Search the specified types of anomalies: 'type="MIGRATION_SCHEMA".'
string filter = 2;
@@ -90,8 +90,7 @@ message Anomaly {
// The resource that is the target of the operation.
// Format:
- // - Instance: instnaces/{instance}
- // - Database: instnaces/{instance}/databases/{database}
+ // - Database: instances/{instance}/databases/{database}
string resource = 1 [(google.api.field_behavior) = REQUIRED];
// type is the type of the anomaly.
@@ -100,41 +99,6 @@ message Anomaly {
// severity is the severity of the anomaly.
AnomalySeverity severity = 3;
- // Instance level anomaly detail.
- //
- // InstanceConnectionDetail is the detail for instance connection anomaly.
- message InstanceConnectionDetail {
- // detail is the detail of the instance connection failure.
- string detail = 1;
- }
-
- // Database level anomaly detial.
- //
- // DatbaaseConnectionDetail is the detail for database connection anomaly.
- message DatabaseConnectionDetail {
- // detail is the detail of the database connection failure.
- string detail = 1;
- }
-
- // DatabaseSchemaDriftDetail is the detail for database schema drift anomaly.
- message DatabaseSchemaDriftDetail {
- // record_version is the record version of the database schema drift.
- string record_version = 1;
-
- // expected_schema is the expected schema in the database.
- string expected_schema = 2;
-
- // actual_schema is the actual schema in the database.
- string actual_schema = 3;
- }
-
- // detail is the detail of the anomaly.
- oneof detail {
- InstanceConnectionDetail instance_connection_detail = 4;
- DatabaseConnectionDetail database_connection_detail = 5;
- DatabaseSchemaDriftDetail database_schema_drift_detail = 8;
- }
-
google.protobuf.Timestamp create_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
google.protobuf.Timestamp update_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY];