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

v2-ui-Scheduled Jobs #1070

Merged
merged 3 commits into from
May 5, 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
246 changes: 245 additions & 1 deletion deepfence_frontend/apps/dashboard/api-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,58 @@
"security": [{ "bearer_token": [] }]
}
},
"/deepfence/database/vulnerability": {
"put": {
"tags": ["Settings"],
"summary": "Upload Vulnerability Database",
"description": "Upload Vulnerability Database for use in vulnerability scans",
"operationId": "uploadVulnerabilityDatabase",
"requestBody": {
"content": {
"multipart/form-data": {
"schema": { "$ref": "#/components/schemas/FormDataModelDBUploadRequest" }
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/ModelMessageResponse" }
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/ApiDocsBadRequestResponse" }
}
}
},
"401": { "description": "Unauthorized" },
"403": { "description": "Forbidden" },
"404": {
"description": "Not Found",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/ApiDocsFailureResponse" }
}
}
},
"500": {
"description": "Internal Server Error",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/ApiDocsFailureResponse" }
}
}
}
},
"security": [{ "bearer_token": [] }]
}
},
"/deepfence/diagnosis/agent-logs": {
"post": {
"tags": ["Diagnosis"],
Expand Down Expand Up @@ -5395,6 +5447,152 @@
"security": [{ "bearer_token": [] }]
}
},
"/deepfence/scans/bulk/delete": {
"post": {
"tags": ["Scan Results"],
"summary": "Bulk Delete Scans",
"description": "Bulk delete scans along with their results for a particular scan type",
"operationId": "bulkDeleteScans",
"requestBody": {
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/ModelBulkDeleteScansRequest" }
}
}
},
"responses": {
"200": { "description": "OK" },
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/ApiDocsBadRequestResponse" }
}
}
},
"401": { "description": "Unauthorized" },
"403": { "description": "Forbidden" },
"404": {
"description": "Not Found",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/ApiDocsFailureResponse" }
}
}
},
"500": {
"description": "Internal Server Error",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/ApiDocsFailureResponse" }
}
}
}
},
"security": [{ "bearer_token": [] }]
}
},
"/deepfence/scheduled-task": {
"get": {
"tags": ["Settings"],
"summary": "Get scheduled tasks",
"description": "Get scheduled tasks",
"operationId": "getScheduledTasks",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": { "$ref": "#/components/schemas/PostgresqlDbScheduler" }
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/ApiDocsBadRequestResponse" }
}
}
},
"401": { "description": "Unauthorized" },
"403": { "description": "Forbidden" },
"404": {
"description": "Not Found",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/ApiDocsFailureResponse" }
}
}
},
"500": {
"description": "Internal Server Error",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/ApiDocsFailureResponse" }
}
}
}
},
"security": [{ "bearer_token": [] }]
}
},
"/deepfence/scheduled-task/{id}": {
"patch": {
"tags": ["Settings"],
"summary": "Update scheduled task",
"description": "Update scheduled task",
"operationId": "updateScheduledTask",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "integer" }
}
],
"requestBody": {
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/ModelUpdateScheduledTaskRequest" }
}
}
},
"responses": {
"204": { "description": "No Content" },
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/ApiDocsBadRequestResponse" }
}
}
},
"401": { "description": "Unauthorized" },
"403": { "description": "Forbidden" },
"404": {
"description": "Not Found",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/ApiDocsFailureResponse" }
}
}
},
"500": {
"description": "Internal Server Error",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/ApiDocsFailureResponse" }
}
}
}
},
"security": [{ "bearer_token": [] }]
}
},
"/deepfence/search/cloud-compliance/scans": {
"post": {
"tags": ["Search"],
Expand Down Expand Up @@ -8303,6 +8501,13 @@
"node_type": { "enum": ["host", "cluster"], "type": "string" }
}
},
"FormDataModelDBUploadRequest": {
"required": ["database"],
"type": "object",
"properties": {
"database": { "$ref": "#/components/schemas/FormDataMultipartFile" }
}
},
"FormDataModelRegistryGCRAddReq": {
"required": ["name", "registry_url", "service_account_json"],
"type": "object",
Expand Down Expand Up @@ -8535,7 +8740,7 @@
"access_level": { "type": "string" },
"account_id": { "type": "string" },
"action": { "type": "string" },
"allow_blob_public_access": { "type": "string" },
"allow_blob_public_access": { "type": "boolean" },
"arn": { "type": "string" },
"attached_policy_arns": {},
"block_public_acls": { "type": "boolean" },
Expand Down Expand Up @@ -8897,6 +9102,23 @@
"node_type": { "type": "string" }
}
},
"ModelBulkDeleteScansRequest": {
"required": ["scan_type", "filters"],
"type": "object",
"properties": {
"filters": { "$ref": "#/components/schemas/ReportersFieldsFilters" },
"scan_type": {
"enum": [
"Secret",
"Vulnerability",
"Malware",
"Compliance",
"CloudCompliance"
],
"type": "string"
}
}
},
"ModelCloudCompliance": {
"required": [
"count",
Expand Down Expand Up @@ -10424,6 +10646,11 @@
"tags": { "type": "integer" }
}
},
"ModelUpdateScheduledTaskRequest": {
"required": ["is_enabled"],
"type": "object",
"properties": { "is_enabled": { "type": "boolean" } }
},
"ModelUpdateUserIdRequest": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -10639,6 +10866,22 @@
"user_role_id": { "type": "integer" }
}
},
"PostgresqlDbScheduler": {
"type": "object",
"properties": {
"action": { "type": "string" },
"created_at": { "type": "string", "format": "date-time" },
"cron_expr": { "type": "string" },
"description": { "type": "string" },
"id": { "type": "integer" },
"is_enabled": { "type": "boolean" },
"is_system": { "type": "boolean" },
"last_ran_at": { "$ref": "#/components/schemas/SqlNullTime" },
"payload": {},
"status": { "type": "string" },
"updated_at": { "type": "string", "format": "date-time" }
}
},
"ReportIDList": { "type": "array", "items": { "type": "string" } },
"ReportMetadata": {
"type": "object",
Expand Down Expand Up @@ -10851,6 +11094,7 @@
"window": { "$ref": "#/components/schemas/ModelFetchWindow" }
}
},
"SqlNullTime": { "type": "object" },
"UtilsAdvancedReportFilters": {
"type": "object",
"properties": {
Expand Down
2 changes: 2 additions & 0 deletions deepfence_frontend/apps/dashboard/src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,5 +296,7 @@ export function getSettingsApiClient() {
getEmailConfiguration: settingsApi.getEmailConfiguration.bind(settingsApi),
addEmailConfiguration: settingsApi.addEmailConfiguration.bind(settingsApi),
deleteEmailConfiguration: settingsApi.deleteEmailConfiguration.bind(settingsApi),
getScheduledTasks: settingsApi.getScheduledTasks.bind(settingsApi),
updateScheduledTask: settingsApi.updateScheduledTask.bind(settingsApi),
};
}
Loading