Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Problem Statement

As part of opening of DIKSHA Infrastructure to wider ecosystem, there is a need to provide access to open anonymized data to third party ecosystem players to develop custom solutions on top of DIKSHA.


Current Implementation

  • Currently, Sunbird Observation supports Reports Service API to list and access all published reports. However, only metadata of a report is accessible through this API. There are associated data files that contain the detailed data of a given report. These are currently not accessible through API.

  • There is an internal endpoint at the portal backend layer which downloads the respective datasets from the azure reports container. This endpoint is accessible only by the logged in person(session based) having roles (REPORT_ADMIN , REPORT_VIEWER, ORG_ADMIN).

  • Moreover, there is a slug based validation so that they do not access other tenant’s data.

  • For parameterized reports, respective endpoints are injected based on the logged in user’s context.

  • As part of current implementation datasets cannot be accessed by non logged in person or any third party.

  • Supported parameters

    • $slug

    • $channel

    • $state

    • $board


Current Api Structure

 GET- /report/get/:reportId

This API is associated with viewing and reading out the specific report on the Sunbird Platform. It returns only the metadata information for the report.

Response

{
  "id": "string",
  "ver": "string",
  "params": {
    "resmsgid": "string",
    "msgid": "string",
    "status": "success",
    "err": "string",
    "errmsg": "string"
  },
  "responseCode": "OK",
  "result": {
    "reports": [
      {
        "reportid": "string",
        "title": "string",
        "description": "string",
        "authorizedroles": [
          "string"
        ],
        "status": "string",
        "type": "string",
        "reportaccessurl": "string",
        "createdon": "string",
        "updatedon": "string",
        "createdby": "string",
        "reportconfig": {
          "id": "string",
          "label": "string",
          "table": [
            {
              "name": "string",
              "valuesExpr": "string",
              "columnsExpr": "string"
            }
          ],
          "title": "string",
          "charts": [
            {
              "colors": [
                {
                  "borderColor": "string",
                  "backgroundColor": "string"
                }
              ],
              "options": {
                "title": {
                  "text": "string",
                  "display": true,
                  "fontSize": 16
                },
                "legend": {
                  "display": false
                },
                "scales": {
                  "xAxes": [
                    {
                      "scaleLabel": {
                        "display": true,
                        "labelString": "string"
                      }
                    }
                  ],
                  "yAxes": [
                    {
                      "scaleLabel": {
                        "display": true,
                        "labelString": "string"
                      }
                    }
                  ]
                },
                "tooltips": {
                  "mode": "string",
                  "intersect": false,
                  "bodySpacing": 5,
                  "titleSpacing": 5
                },
                "responsive": true
              },
              "datasets": [
                {
                  "label": "string",
                  "dataExpr": "string"
                }
              ],
              "chartType": "string",
              "labelsExpr": "string",
              "dataSource": {
                "ids": [
                  "parameterizedPath"
                ],
                "commonDimension": "string"
              }
            }
          ],
          "dataSource": [
            {
              "id": "parameterizedPath",
              "path": "/reports/$state/abc.json"
            },
            {
            "id": "nonParameterizedPath",
            "path": "/reports/tn/abc.json"
            }
          ],
          "description": "string",
          "downloadUrl": "string"
        },
        "slug": "string",
        "reportgenerateddate": "string",
        "reportduration": {
          "enddate": "string",
          "startdate": "string"
        },
        "tags": [
          "string"
        ],
        "updatefrequency": "string",
        "parameters": [
          "string"
        ],
        "report_type": "string"
      }
    ],
    "count": 1
  }
}

Datasource Schema :-

id -: job_id

path -: endpoint to the portal-backend layer which download the dataset file - the path can be both parameterized and non parameterized . Portal backend populates the parameters using logged in user context details and downloads the respective file.


Proposed Solution

There is a need to create API in report service that will provide access to the meta data as well as the report data files that are used to generate the reports in the 'Admin dashboards' page on the Sunbird portal with certain access controls.

Proposed API Structure to get the metadata + datasets.

METHOD - GET

URL: /report/datasets/get/:reportId

 API to get meta data + datasets

Proposed response structure - for both parameterized and non paramterized reports path.

{
    "id": "string",
    "ver": "string",
    "params": {
      "resmsgid": "string",
      "msgid": "string",
      "status": "success",
      "err": "string",
      "errmsg": "string"
    },
    "responseCode": "OK",
    "result": {
        "metadata": {... similar to above API},
        "datasets": {
            "dataset_one_example": {
                "isParameterized": true,
                "parameters": ["$state"],
                "data": {
                    "rj": {
                        "signedUrl": "url"
                    },
                    "tn": {
                        "signedUrl": "url"
                    }
                }
            },
            "dataset_two_example": {
                "isParameterized": false,
                "parameters": null,
                "data": {
                    "default": {
                        "signedUrl": "url"
                    }
                }
            }
        }
    }
}

Access Controls - << DRAFT State >>

Visibility - Public or Private

Authorized Roles - Report_ADMIN , REPORT_VIEWER, ORG_ADMIN or combinations.

Slug/Tenant based checks.

Access Control spec from questionset API - // TODO

Can the report be assessible via Admin Dashboard or not ?

Who is downloading reports and when ?


Resources

  • No labels