diff --git a/static/api-specs/idn/beta/paths/reports-cancel.yaml b/static/api-specs/idn/beta/paths/reports-cancel.yaml new file mode 100644 index 000000000..882d98da8 --- /dev/null +++ b/static/api-specs/idn/beta/paths/reports-cancel.yaml @@ -0,0 +1,32 @@ +post: + tags: + - Reports Data Extraction + description: >- + Cancels a running report. + operationId: cancelReport + summary: "Cancel Report" + security: + - oauth2: [sp:report:delete] + parameters: + - name: id + in: path + description: ID of the running Report to cancel + required: true + style: simple + explode: false + schema: + type: string + example: 'a1ed223247144cc29d23c632624b4767' + responses: + '204': + $ref: '../../v3/responses/204.yaml' + '400': + $ref: '../../v3/responses/400.yaml' + '401': + $ref: '../../v3/responses/401.yaml' + '403': + $ref: '../../v3/responses/403.yaml' + '429': + $ref: '../../v3/responses/429.yaml' + '500': + $ref: '../../v3/responses/500.yaml' diff --git a/static/api-specs/idn/beta/paths/reports-get-file.yaml b/static/api-specs/idn/beta/paths/reports-get-file.yaml new file mode 100644 index 000000000..362bcdb04 --- /dev/null +++ b/static/api-specs/idn/beta/paths/reports-get-file.yaml @@ -0,0 +1,71 @@ +get: + tags: + - Reports Data Extraction + description: >- + Gets a report in file format. + operationId: getReport + summary: "Get Report File" + security: + - oauth2: [sp:report:read] + parameters: + - in: path + name: taskResultId + schema: + type: string + required: true + description: Unique identifier of the task result which handled report + example: ef38f94347e94562b5bb8424a56397d8 + - in: path + name: fileFormat + schema: + type: string + required: true + description: Output format of the requested report file + example: 'CSV' + - in: query + name: name + required: false + schema: + type: string + example: 'Identities Details Report' + description: preferred Report file name, by default will be used report name from task result. + responses: + '200': + description: Details about running report task. + content: + application/octet-stream: + schema: + type: string + format: binary + headers: + Content-disposition: + description: The requested report's filename + schema: + type: string + example: 'attachment;filename=\"fileName"' + '400': + $ref: '../../v3/responses/400.yaml' + '401': + $ref: '../../v3/responses/401.yaml' + '403': + $ref: '../../v3/responses/403.yaml' + '404': + description: Not Found - returned if the request URL refers to a resource or object that does not exist + content: + application/json: + schema: + $ref: '../../v3/schemas/ErrorResponseDto.yaml' + examples: + "404": + summary: An example of a 404 response object + value: + detailCode: "404 Not found" + trackingId: "b21b1f7ce4da4d639f2c62a57171b427" + messages: + - locale: "en-US" + localeOrigin: "DEFAULT" + text: "

File Not Found - 404 Error

The requested file was not found." + '429': + $ref: '../../v3/responses/429.yaml' + '500': + $ref: '../../v3/responses/500.yaml' diff --git a/static/api-specs/idn/beta/paths/reports-result.yaml b/static/api-specs/idn/beta/paths/reports-result.yaml new file mode 100644 index 000000000..06f5fc4ae --- /dev/null +++ b/static/api-specs/idn/beta/paths/reports-result.yaml @@ -0,0 +1,39 @@ +post: + tags: + - Reports Data Extraction + description: >- + Get the report results for a report that was run or is running. + Returns empty report result in case there are no active task definitions with used in payload task definition name. + operationId: showReportResult + summary: "Get Report Result" + security: + - oauth2: [sp:report-result:read] + requestBody: + content: + application/json: + schema: + $ref: '../schemas/reports/ReportDetails.yaml' + examples: + identityDetailsReport: + $ref: '../schemas/reports/examples/identities-details-report-details.yaml' + required: true + responses: + '200': + description: Details about report that was run or is running. + content: + application/json: + schema: + $ref: '../schemas/reports/ReportResults.yaml' + examples: + identityDetailsReport: + $ref: '../schemas/reports/examples/identities-details-report-results.yaml' + '400': + $ref: '../../v3/responses/400.yaml' + '401': + $ref: '../../v3/responses/401.yaml' + '403': + $ref: '../../v3/responses/403.yaml' + '429': + $ref: '../../v3/responses/429.yaml' + '500': + $ref: '../../v3/responses/500.yaml' diff --git a/static/api-specs/idn/beta/paths/reports-run.yaml b/static/api-specs/idn/beta/paths/reports-run.yaml new file mode 100644 index 000000000..c0922b294 --- /dev/null +++ b/static/api-specs/idn/beta/paths/reports-run.yaml @@ -0,0 +1,43 @@ +post: + tags: + - Reports Data Extraction + description: >- + Runs a report according to input report details. + If non-concurrent task is already running then it returns, otherwise new task creates and returns. + operationId: startReport + summary: "Run Report" + security: + - oauth2: [sp:report:create] + requestBody: + content: + application/json: + schema: + $ref: '../schemas/reports/ReportDetails.yaml' + examples: + identityDetailsReport: + $ref: '../schemas/reports/examples/identities-details-report-details.yaml' + searchExportReport: + $ref: '../schemas/reports/examples/search-export-report-details.yaml' + required: true + responses: + '200': + description: Details about running report task. + content: + application/json: + schema: + $ref: '../schemas/reports/TaskResultDetails.yaml' + examples: + identityDetailsReport: + $ref: '../schemas/reports/examples/identities-details-report-task-result.yaml' + searchExportReport: + $ref: '../schemas/reports/examples/search-export-report-task-result.yaml' + '400': + $ref: '../../v3/responses/400.yaml' + '401': + $ref: '../../v3/responses/401.yaml' + '403': + $ref: '../../v3/responses/403.yaml' + '429': + $ref: '../../v3/responses/429.yaml' + '500': + $ref: '../../v3/responses/500.yaml' diff --git a/static/api-specs/idn/beta/schemas/reports/ReportDetails.yaml b/static/api-specs/idn/beta/schemas/reports/ReportDetails.yaml new file mode 100644 index 000000000..08c4b8382 --- /dev/null +++ b/static/api-specs/idn/beta/schemas/reports/ReportDetails.yaml @@ -0,0 +1,25 @@ +type : object +properties: + name: + type: string + description: >- + Name of the requesting report + example: 'Identities Details Report' + taskDefName: + type: string + description: >- + Name of the task definition which is started to process requesting report + example: 'Identities Details Report' + arguments: + type: object + description: >- + The string-object map(dictionary) with the arguments needed for report processing. + additionalProperties: + type: object + example: { "org": "org name" } + completed: + type: boolean + default: false + description: >- + Current state of the requested report + example: true diff --git a/static/api-specs/idn/beta/schemas/reports/ReportResults.yaml b/static/api-specs/idn/beta/schemas/reports/ReportResults.yaml new file mode 100644 index 000000000..bb97a425a --- /dev/null +++ b/static/api-specs/idn/beta/schemas/reports/ReportResults.yaml @@ -0,0 +1,48 @@ +type : object +description: >- + Details about report result or current state. +properties: + reportName: + type: string + description: >- + Name of the requesting report + example: 'Identities Details Report' + taskDefName: + type: string + description: >- + Name of the task definition which is started to process requesting report. Usually the same as report name + example: 'Identities Details Report' + id: + type: string + description: >- + Unique task definition identifier. + example: 'a248c16fe22222b2bd49615481311111' + date: + type: integer + format: int64 + description: >- + Report processing start date in legacy long (int64) representation. + example: 1682589075909 + status: + type: string + description: >- + Report current state or result status. + example: 'Success' + duration: + type: integer + format: int64 + description: >- + Report processing time. + example: 342 + rows: + type: integer + format: int64 + description: >- + Report size in rows. + example: 37 + availableFormats: + type: string + nullable: true + description: >- + Report request possible formats. + example: 'CSV' \ No newline at end of file diff --git a/static/api-specs/idn/beta/schemas/reports/TaskResultDetails.yaml b/static/api-specs/idn/beta/schemas/reports/TaskResultDetails.yaml new file mode 100644 index 000000000..66d047ed4 --- /dev/null +++ b/static/api-specs/idn/beta/schemas/reports/TaskResultDetails.yaml @@ -0,0 +1,146 @@ +type: object +description: >- + Details about job or task type, state and lifecycle. +properties: + type: + type: string + enum: + - QUARTZ + - QPOC + - MENTOS + - QUEUED_TASK + description: >- + Type of the job or task underlying in the report processing. It could be a quartz task, QPOC or MENTOS jobs or a + refresh/sync task. + example: 'MENTOS' + id: + type: string + description: >- + Unique task definition identifier. + example: 'a248c16fe22222b2bd49615481311111' + name: + type: string + description: >- + Name of the requesting report. + example: 'Identities Details Report' + description: + type: string + description: >- + Description of the report purpose and/or contents. + example: 'A detailed view of the identities in the system.' + parentName: + type: string + nullable: true + description: >- + Name of the parent task/report if exists. + example: 'Audit Report' + launcher: + type: string + description: >- + Name of the report processing initiator. + example: 'cloudadmin' + created: + type: integer + format: int64 + description: >- + Report creation date in legacy long (int64) representation. + example: 1688633986104 + launched: + type: integer + nullable: true + format: int64 + description: >- + Report start date in legacy long (int64) representation. + example: 1688633988104 + completed: + type: integer + nullable: true + format: int64 + description: >- + Report completion date in legacy long (int64) representation. + example: 1688633989504 + completionStatus: + type: string + nullable: true + enum: + - Success + - Warning + - Error + - Terminated + - TempError + description: >- + Report completion status. + example: 'Success' + messages: + type: array + description: >- + List of the messages dedicated to the report. + From task definition perspective here usually should be warnings or errors. + example: [] + items: + type: object + properties: + type: + type: string + description: >- + Type of the message. + enum: + - Info + - Warn + - Error + example: 'Warn' + error: + type: boolean + default: false + description: >- + Flag whether message is an error. + example: false + warning: + type: boolean + default: false + description: >- + Flag whether message is a warning. + example: true + key: + type: string + description: >- + Message string identifier. + example: 'The following account(s) failed to correlate: A,B,C' + localizedText: + type: string + description: >- + Message context with the locale based language. + example: 'The following account(s) failed to correlate: A,B,C' + returns: + type: array + description: >- + Task definition results, if necessary. + example: [] + items: + type: object + properties: + displayLabel: + type: string + description: >- + Attribute description. + example: ' ' + attributeName: + type: string + description: >- + System or database attribute name. + example: ' ' + attributes: + type: object + description: >- + Extra attributes map(dictionary) needed for the report. + example: + org: 'an-org' + pod: 'the-pod' + additionalProperties: + type: object + progress: + type: string + nullable: true + description: >- + Current report state. + example: 'Initializing...' \ No newline at end of file diff --git a/static/api-specs/idn/beta/schemas/reports/examples/identities-details-report-details.yaml b/static/api-specs/idn/beta/schemas/reports/examples/identities-details-report-details.yaml new file mode 100644 index 000000000..9932be44d --- /dev/null +++ b/static/api-specs/idn/beta/schemas/reports/examples/identities-details-report-details.yaml @@ -0,0 +1,10 @@ +summary: Identities Details Report +value: + name: 'Identities Details Report' + taskDefName: 'Identities Details Report' + arguments: + reportDefName: 'Identities Details Report' + s3bucket: 'abc-org-data-useast1' + pod: 'def-pod' + org: 'an-org' + completed: false \ No newline at end of file diff --git a/static/api-specs/idn/beta/schemas/reports/examples/identities-details-report-results.yaml b/static/api-specs/idn/beta/schemas/reports/examples/identities-details-report-results.yaml new file mode 100644 index 000000000..3b2ff1859 --- /dev/null +++ b/static/api-specs/idn/beta/schemas/reports/examples/identities-details-report-results.yaml @@ -0,0 +1,10 @@ +summary: Identities Details Report result. +value: + reportName: 'Identities Details Report' + taskDefName: 'Identities Details Report' + id: '1e01d272b8084c4fa12fcf8fa898102d' + date: 1688643627107 + status: 'Success' + duration: 3681 + rows: 193 + availableFormats: 'CSV' \ No newline at end of file diff --git a/static/api-specs/idn/beta/schemas/reports/examples/identities-details-report-task-result.yaml b/static/api-specs/idn/beta/schemas/reports/examples/identities-details-report-task-result.yaml new file mode 100644 index 000000000..452abb14c --- /dev/null +++ b/static/api-specs/idn/beta/schemas/reports/examples/identities-details-report-task-result.yaml @@ -0,0 +1,17 @@ +summary: Identities Details Report task result. +value: + name: 'Identities Details Report' + taskDefName: 'Identities Details Report' + type: 'QUARTZ' + id: 'a248c16fe22222b2bd49615481311111' + created: 1682589075909 + description: 'A detailed view of the identities in the system.' + parentName: 'Audit Report' + launcher: '9832285' + launched: 1682589076909 + completed: 1682589078909 + messages: [] + returns: [] + attributes: + org: 'an-org' + progress: 'Initializing...' \ No newline at end of file diff --git a/static/api-specs/idn/beta/schemas/reports/examples/search-export-report-details.yaml b/static/api-specs/idn/beta/schemas/reports/examples/search-export-report-details.yaml new file mode 100644 index 000000000..3d4681147 --- /dev/null +++ b/static/api-specs/idn/beta/schemas/reports/examples/search-export-report-details.yaml @@ -0,0 +1,21 @@ +summary: Search Export report +value: + name: 'Search Export' + taskDefName: 'Search Export' + arguments: + reportDefName: 'Search Export' + s3bucket: 'abc-org-data-useast1' + indices: 'identities' + columns: 'displayName,firstName,lastName,email,created,attributes.cloudLifecycleState,tags,access.spread,apps.spread,accounts.spread' + query: '704171' + sort: 'displayName' + queryParams: + columns: 'displayName,firstName,lastName,email,created,attributes.cloudLifecycleState,tags,access.spread,apps.pread,accounts.spread' + indices: 'identities' + ownerId: '95ecba5c54fa439c949aec638ce2a74d' + query: '704171' + sort: 'displayName' + queryHash: '5e12cf79c67d92e23d4d8cb3e974f87d164e86d4a4dd8d32ecf89645cacfd3f2' + pod: 'def-pod' + org: 'an-org' + completed: false diff --git a/static/api-specs/idn/beta/schemas/reports/examples/search-export-report-task-result.yaml b/static/api-specs/idn/beta/schemas/reports/examples/search-export-report-task-result.yaml new file mode 100644 index 000000000..abac5a30a --- /dev/null +++ b/static/api-specs/idn/beta/schemas/reports/examples/search-export-report-task-result.yaml @@ -0,0 +1,24 @@ +summary: Identities Details Report task result. +value: + name: 'Search Export - 1a82d67377a845f495a1300a2346196b' + taskDefName: 'Identities Details Report' + type: 'QUARTZ' + id: 'a248c16fe22222b2bd49615481311111' + created: 1682589075909 + description: 'Extract query data from ElasticSearch to CSV' + parentName: null + launcher: 'T05293' + launched: null + completed: null + messages: [] + returns: [] + attributes: + queryHash: '5e12cf79c67d92e23d4d8cb3e974f87d164e86d4a48d32ecf89645cacfd3f2' + org: 'an-org' + queryParams: + columns: 'displayName,firstName,lastName,email,created,attributes.cloudLifecycleState,tags,access.spread,apps.pread,accounts.spread' + indices: 'identities' + ownerId: '95ecba5c5444439c999aec638ce2a777' + query: '700007' + sort: 'displayName' + progress: 'Initializing...' \ No newline at end of file