diff --git a/deepfence_frontend/apps/dashboard/api-spec.json b/deepfence_frontend/apps/dashboard/api-spec.json index a612baeb7b..e47f781ae8 100644 --- a/deepfence_frontend/apps/dashboard/api-spec.json +++ b/deepfence_frontend/apps/dashboard/api-spec.json @@ -1884,6 +1884,13 @@ "summary": "List Generative AI Integrations", "description": "List all the added Generative AI Integrations", "operationId": "listGenerativeAiIntegration", + "parameters": [ + { + "name": "integration_type", + "in": "query", + "schema": { "enum": ["openai", "amazon-bedrock"], "type": "string" } + } + ], "responses": { "200": { "description": "OK", @@ -14604,12 +14611,12 @@ "UtilsAdvancedReportFilters": { "type": "object", "properties": { - "account_id": { "type": "array", "items": { "type": "string" } }, "container_name": { "type": "array", "items": { "type": "string" } }, "host_name": { "type": "array", "items": { "type": "string" } }, "image_name": { "type": "array", "items": { "type": "string" } }, "kubernetes_cluster_name": { "type": "array", "items": { "type": "string" } }, "masked": { "type": "array", "items": { "type": "boolean" } }, + "node_id": { "type": "array", "items": { "type": "string" } }, "pod_name": { "type": "array", "items": { "type": "string" } }, "scan_status": { "type": "array", "items": { "type": "string" } } } diff --git a/deepfence_frontend/apps/dashboard/src/api/generated/apis/GenerativeAIApi.ts b/deepfence_frontend/apps/dashboard/src/api/generated/apis/GenerativeAIApi.ts index 2bd5d929ff..7659c1053f 100644 --- a/deepfence_frontend/apps/dashboard/src/api/generated/apis/GenerativeAIApi.ts +++ b/deepfence_frontend/apps/dashboard/src/api/generated/apis/GenerativeAIApi.ts @@ -91,6 +91,10 @@ export interface GenerativeAiIntegrationVulnerabilityQueryRequest { modelGenerativeAiIntegrationVulnerabilityRequest?: ModelGenerativeAiIntegrationVulnerabilityRequest; } +export interface ListGenerativeAiIntegrationRequest { + integrationType?: ListGenerativeAiIntegrationIntegrationTypeEnum; +} + export interface SetDefaultGenerativeAiIntegrationRequest { integrationId: string; } @@ -249,17 +253,18 @@ export interface GenerativeAIApiInterface { /** * List all the added Generative AI Integrations * @summary List Generative AI Integrations + * @param {'openai' | 'amazon-bedrock'} [integrationType] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof GenerativeAIApiInterface */ - listGenerativeAiIntegrationRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>>; + listGenerativeAiIntegrationRaw(requestParameters: ListGenerativeAiIntegrationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>>; /** * List all the added Generative AI Integrations * List Generative AI Integrations */ - listGenerativeAiIntegration(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; + listGenerativeAiIntegration(requestParameters: ListGenerativeAiIntegrationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Set Default Generative AI integration @@ -639,9 +644,13 @@ export class GenerativeAIApi extends runtime.BaseAPI implements GenerativeAIApiI * List all the added Generative AI Integrations * List Generative AI Integrations */ - async listGenerativeAiIntegrationRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + async listGenerativeAiIntegrationRaw(requestParameters: ListGenerativeAiIntegrationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { const queryParameters: any = {}; + if (requestParameters.integrationType !== undefined) { + queryParameters['integration_type'] = requestParameters.integrationType; + } + const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { @@ -666,8 +675,8 @@ export class GenerativeAIApi extends runtime.BaseAPI implements GenerativeAIApiI * List all the added Generative AI Integrations * List Generative AI Integrations */ - async listGenerativeAiIntegration(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const response = await this.listGenerativeAiIntegrationRaw(initOverrides); + async listGenerativeAiIntegration(requestParameters: ListGenerativeAiIntegrationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.listGenerativeAiIntegrationRaw(requestParameters, initOverrides); return await response.value(); } @@ -711,3 +720,12 @@ export class GenerativeAIApi extends runtime.BaseAPI implements GenerativeAIApiI } } + +/** + * @export + */ +export const ListGenerativeAiIntegrationIntegrationTypeEnum = { + Openai: 'openai', + AmazonBedrock: 'amazon-bedrock' +} as const; +export type ListGenerativeAiIntegrationIntegrationTypeEnum = typeof ListGenerativeAiIntegrationIntegrationTypeEnum[keyof typeof ListGenerativeAiIntegrationIntegrationTypeEnum]; diff --git a/deepfence_frontend/apps/dashboard/src/api/generated/models/UtilsAdvancedReportFilters.ts b/deepfence_frontend/apps/dashboard/src/api/generated/models/UtilsAdvancedReportFilters.ts index 824ecfb602..3a15c82890 100644 --- a/deepfence_frontend/apps/dashboard/src/api/generated/models/UtilsAdvancedReportFilters.ts +++ b/deepfence_frontend/apps/dashboard/src/api/generated/models/UtilsAdvancedReportFilters.ts @@ -19,12 +19,6 @@ import { exists, mapValues } from '../runtime'; * @interface UtilsAdvancedReportFilters */ export interface UtilsAdvancedReportFilters { - /** - * - * @type {Array} - * @memberof UtilsAdvancedReportFilters - */ - account_id?: Array; /** * * @type {Array} @@ -55,6 +49,12 @@ export interface UtilsAdvancedReportFilters { * @memberof UtilsAdvancedReportFilters */ masked?: Array; + /** + * + * @type {Array} + * @memberof UtilsAdvancedReportFilters + */ + node_id?: Array; /** * * @type {Array} @@ -88,12 +88,12 @@ export function UtilsAdvancedReportFiltersFromJSONTyped(json: any, ignoreDiscrim } return { - 'account_id': !exists(json, 'account_id') ? undefined : json['account_id'], 'container_name': !exists(json, 'container_name') ? undefined : json['container_name'], 'host_name': !exists(json, 'host_name') ? undefined : json['host_name'], 'image_name': !exists(json, 'image_name') ? undefined : json['image_name'], 'kubernetes_cluster_name': !exists(json, 'kubernetes_cluster_name') ? undefined : json['kubernetes_cluster_name'], 'masked': !exists(json, 'masked') ? undefined : json['masked'], + 'node_id': !exists(json, 'node_id') ? undefined : json['node_id'], 'pod_name': !exists(json, 'pod_name') ? undefined : json['pod_name'], 'scan_status': !exists(json, 'scan_status') ? undefined : json['scan_status'], }; @@ -108,12 +108,12 @@ export function UtilsAdvancedReportFiltersToJSON(value?: UtilsAdvancedReportFilt } return { - 'account_id': value.account_id, 'container_name': value.container_name, 'host_name': value.host_name, 'image_name': value.image_name, 'kubernetes_cluster_name': value.kubernetes_cluster_name, 'masked': value.masked, + 'node_id': value.node_id, 'pod_name': value.pod_name, 'scan_status': value.scan_status, }; diff --git a/deepfence_frontend/apps/dashboard/src/features/integrations/pages/CreateReport.tsx b/deepfence_frontend/apps/dashboard/src/features/integrations/pages/CreateReport.tsx index d50326b5ca..26664299b1 100644 --- a/deepfence_frontend/apps/dashboard/src/features/integrations/pages/CreateReport.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/integrations/pages/CreateReport.tsx @@ -135,7 +135,7 @@ const action = async ({ request }: ActionFunctionArgs): Promise => { const advanced_report_filters: { masked?: boolean[]; - account_id?: string[]; + node_id?: string[]; host_name?: string[]; image_name?: string[]; container_name?: string[]; @@ -144,7 +144,7 @@ const action = async ({ request }: ActionFunctionArgs): Promise => { scan_status?: string[]; } = {}; if (accountIds.length > 0) { - advanced_report_filters.account_id = accountIds as string[]; + advanced_report_filters.node_id = accountIds as string[]; } if (hostIds.length > 0) { @@ -246,7 +246,7 @@ const ReportForm = () => { return ( <> {!data?.success ? ( - +