Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change account_id to node_id #1793

Merged
merged 3 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion deepfence_frontend/apps/dashboard/api-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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" } }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ export interface GenerativeAiIntegrationVulnerabilityQueryRequest {
modelGenerativeAiIntegrationVulnerabilityRequest?: ModelGenerativeAiIntegrationVulnerabilityRequest;
}

export interface ListGenerativeAiIntegrationRequest {
integrationType?: ListGenerativeAiIntegrationIntegrationTypeEnum;
}

export interface SetDefaultGenerativeAiIntegrationRequest {
integrationId: string;
}
Expand Down Expand Up @@ -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<runtime.ApiResponse<Array<ModelGenerativeAiIntegrationListResponse>>>;
listGenerativeAiIntegrationRaw(requestParameters: ListGenerativeAiIntegrationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ModelGenerativeAiIntegrationListResponse>>>;

/**
* List all the added Generative AI Integrations
* List Generative AI Integrations
*/
listGenerativeAiIntegration(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ModelGenerativeAiIntegrationListResponse>>;
listGenerativeAiIntegration(requestParameters: ListGenerativeAiIntegrationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ModelGenerativeAiIntegrationListResponse>>;

/**
* Set Default Generative AI integration
Expand Down Expand Up @@ -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<runtime.ApiResponse<Array<ModelGenerativeAiIntegrationListResponse>>> {
async listGenerativeAiIntegrationRaw(requestParameters: ListGenerativeAiIntegrationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ModelGenerativeAiIntegrationListResponse>>> {
const queryParameters: any = {};

if (requestParameters.integrationType !== undefined) {
queryParameters['integration_type'] = requestParameters.integrationType;
}

const headerParameters: runtime.HTTPHeaders = {};

if (this.configuration && this.configuration.accessToken) {
Expand All @@ -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<Array<ModelGenerativeAiIntegrationListResponse>> {
const response = await this.listGenerativeAiIntegrationRaw(initOverrides);
async listGenerativeAiIntegration(requestParameters: ListGenerativeAiIntegrationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ModelGenerativeAiIntegrationListResponse>> {
const response = await this.listGenerativeAiIntegrationRaw(requestParameters, initOverrides);
return await response.value();
}

Expand Down Expand Up @@ -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];
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ import { exists, mapValues } from '../runtime';
* @interface UtilsAdvancedReportFilters
*/
export interface UtilsAdvancedReportFilters {
/**
*
* @type {Array<string>}
* @memberof UtilsAdvancedReportFilters
*/
account_id?: Array<string>;
/**
*
* @type {Array<string>}
Expand Down Expand Up @@ -55,6 +49,12 @@ export interface UtilsAdvancedReportFilters {
* @memberof UtilsAdvancedReportFilters
*/
masked?: Array<boolean>;
/**
*
* @type {Array<string>}
* @memberof UtilsAdvancedReportFilters
*/
node_id?: Array<string>;
/**
*
* @type {Array<string>}
Expand Down Expand Up @@ -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'],
};
Expand All @@ -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,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const action = async ({ request }: ActionFunctionArgs): Promise<ActionData> => {

const advanced_report_filters: {
masked?: boolean[];
account_id?: string[];
node_id?: string[];
host_name?: string[];
image_name?: string[];
container_name?: string[];
Expand All @@ -144,7 +144,7 @@ const action = async ({ request }: ActionFunctionArgs): Promise<ActionData> => {
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) {
Expand Down Expand Up @@ -246,7 +246,7 @@ const ReportForm = () => {
return (
<>
{!data?.success ? (
<fetcher.Form method="post" className="m-4">
<fetcher.Form method="post" className="m-4 overflow-auto">
<input
type="text"
name="_actionType"
Expand Down
Loading