RDEReportFile

GraphViz

Schema

The considered APS type (download) looks as follows:

{
  "name": "RDEReportFile",
  "id": "http://www.odin.com/rde/report-file/1.6",
  "apsVersion": "2.0",
  "implements": [
    "http://aps-standard.org/abstract/types/unlimited-resource/1.0"
  ],
  "relations": {
    "reportTemplate": {
      "type": "http://www.odin.com/rde/report-template/1.5"
    },
    "tenant": {
      "type": "http://www.odin.com/rde/tenant/2.2",
      "required": true
    },
    "customization": {
      "type": "http://www.odin.com/rde/base-report-customization/1.1"
    },
    "dataSet": {
      "type": "http://www.odin.com/rde/data-set/1.0"
    }
  },
  "properties": {
    "name": {
      "type": "string"
    },
    "parameters": {
      "type": "ReportParameters"
    },
    "format": {
      "type": "string",
      "enum": [
        "CSV",
        "XML",
        "XLSX",
        "JSON"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "PENDING",
        "IN_PROGRESS",
        "READY",
        "FAILED"
      ]
    },
    "filePath": {
      "type": "string"
    },
    "tmpPath": {
      "type": "string"
    },
    "generateDate": {
      "type": "string",
      "format": "date-time"
    },
    "downloadsCounter": {
      "type": "integer"
    },
    "eventType": {
      "type": "string",
      "enum": [
        "PERIODIC",
        "DAILY",
        "MONTHLY",
        "ONETIME",
        "ON_INVOICE"
      ]
    },
    "sourceType": {
      "type": "string",
      "default": "API",
      "enum": [
        "API",
        "UX1"
      ]
    },
    "accountId": {
      "type": "string"
    },
    "accountLevel": {
      "type": "string"
    }
  },
  "operations": {
    "handleReportFileStatusChanged": {
      "path": "report-file-available",
      "verb": "POST",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "event": {
          "kind": "body",
          "type": "http://aps-standard.org/types/core/resource/1.0#Notification",
          "required": true
        }
      }
    },
    "downloadReport": {
      "path": "download/{chuckNumber}",
      "verb": "GET",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "id": {
          "kind": "path",
          "type": "string"
        },
        "chuckNumber": {
          "kind": "path",
          "type": "integer"
        }
      }
    }
  },
  "structures": {
    "ReportParameters": {
      "type": "object",
      "properties": {
        "startDate": {
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "format": "date-time"
        },
        "period": {
          "type": "string",
          "enum": [
            "P1D",
            "P1M"
          ]
        },
        "invoice": {
          "type": "Invoice"
        }
      }
    },
    "Invoice": {
      "type": "object",
      "properties": {
        "invoiceId": {
          "type": "integer"
        },
        "invoiceNumber": {
          "type": "string"
        },
        "customerAccountId": {
          "type": "integer"
        },
        "customerAccountUUID": {
          "type": "string"
        },
        "invoiceDate": {
          "type": "string",
          "format": "date-time"
        },
        "invoiceDueDate": {
          "type": "string",
          "format": "date-time"
        },
        "invoiceTotal": {
          "type": "number"
        },
        "invoiceTaxTotal": {
          "type": "number"
        },
        "charges": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}

The APS type is used to manage a collection of APS resources. To get a list of resources from that collection, use the following API call:

GET  /aps/2/collections/rde-report-files?<RQL-filter>

Properties

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

name

String

Not Required

parameters

ReportParameters

Not Required

format

Enum

Not Required

status

Enum

Not Required

filePath

String

Not Required

tmpPath

String

Not Required

generateDate

String

Not Required

downloadsCounter

Integer

Not Required

eventType

Enum

Not Required

sourceType

Enum

Not Required

API

accountId

String

Not Required

accountLevel

String

Not Required

Relationship

NAME

TYPE

REQUIRED

DESCRIPTION

reportTemplate

RDEReportTemplate

No

tenant

RDETenant

Yes

customization

RDEBaseReportCustomization

No

dataSet

RDEDataSet

No

Custom Operations

OPERATION

VERB

PATH

RETURNS

Description

handleReportFileStatusChanged

POST

/report-file-available

downloadReport

GET

/download/{chuckNumber}

handleReportFileStatusChanged

HTTP Request

POST /aps/2/resources/{aps-id}/report-file-available

Description

Parameters

PARAMETER

TYPE

DESCRIPTION

event

Http://aps-standard.org/types/core/resource/1.0#Notification

Returns

downloadReport

HTTP Request

GET /aps/2/resources/{aps-id}/download/{chuckNumber}

Description

Parameters

PARAMETER

TYPE

DESCRIPTION

id

String

chuckNumber

Integer

Returns

Structures

ReportParameters

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

startDate

String

Not Required

endDate

String

Not Required

period

Enum

Not Required

invoice

Invoice

Not Required

Invoice

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

invoiceId

Integer

Not Required

invoiceNumber

String

Not Required

customerAccountId

Integer

Not Required

customerAccountUUID

String

Not Required

invoiceDate

String

Not Required

invoiceDueDate

String

Not Required

invoiceTotal

Number

Not Required

invoiceTaxTotal

Number

Not Required

charges

Array of String

Not Required

Examples

This section illustrates some typical operations with report APS resources based on the considered APS type. Use these operations after RDE reports are generated as demonstrated in the RDEReportTemplate examples. Typical scenarios are in the Reporting and Data Export document.

Get List of generated Reports

To get a list of all generated RDE reports, the management system must issue the following request:

GET /aps/2/collections/rde-report-files

The list of reports in the response will look like this:

HTTP/1.1 200 OK

[
   {
      "aps": {
         "modified": "2018-09-04T15:01:45Z",
         "id": "f67959b8-3d9b-43f7-857e-22820f4580f0",
         "type": "http://www.odin.com/rde/report-file/1.1",
         "status": "aps:ready",
         "revision": 6
      },
      "generateDate": "2018-09-04T15:01:10Z",
      "filePath": "https://rde2.blob.core.windows.net/rdecontainer/NW%20Finance%3E.f67959b8-3d9b-43f7-857e-22820f4580f0.2018-09-04.15-01-11.060+0000.json.gz?sig=2u3v8am84RhztJtGpoMkeSfHdXKYnoADK9MiYC5AOHg%3D&api-version=2016-05-31&st=2018-09-04T14%3A51%3A12Z&se=2018-12-03T14%3A51%3A12Z&sv=2016-05-31&sp=rwd&sr=b",
      "format": "JSON",
      "name": "NW Finance",
      "eventType": "ONETIME",
      "parameters": {
         "endDate": "2018-09-05T23:59:59Z",
         "startDate": "2018-09-04T00:00:00Z"
      },
      "status": "READY",
      "tmpPath": "https://rde2.blob.core.windows.net/rdecontainer/NW%20Finance%3E.f67959b8-3d9b-43f7-857e-22820f4580f0.2018-09-04.15-01-11.060+0000.json.gz?sig=DfDt%2Fp3HjIjBxEGoy3xaek5EoVLczyUwNP06%2FbDLr3k%3D&api-version=2016-05-31&st=2018-09-04T15%3A01%3A12Z&se=2018-09-06T15%3A01%3A12Z&sv=2016-05-31&sp=r&sr=b"
   }
]

It must contain links to files exported to a cloud storage.

Get Parameters of certain Report

To get parameters of a report, in the GET request specify the APS ID of that report APS ID:

GET /aps/2/resources/bb92eda5-7214-4766-945b-b07a65ec03e6

The response will look like this:

HTTP/1.1 200 OK

{
   "aps": {
      "schema": "/aps/2/types/206",
      "package": {
         "id": "2a1f2c8e-02a6-48c1-874d-e7617bc247bf",
         "href": "/aps/2/packages/2a1f2c8e-02a6-48c1-874d-e7617bc247bf"
      },
      "modified": "2018-10-09T09:06:08Z",
      "id": "bb92eda5-7214-4766-945b-b07a65ec03e6",
      "type": "http://www.odin.com/rde/report-file/1.1",
      "status": "aps:ready",
      "revision": 6
   },
   "name": "NW Finance",
   "parameters": {
      "endDate": "2018-10-05T23:59:59Z",
      "startDate": "2018-09-09T00:00:00Z"
   },
   "tenant": {
      "aps": {
         "link": "strong",
         "href": "/aps/2/resources/18b57549-da3e-4e16-bd10-254aec5c2118",
         "id": "18b57549-da3e-4e16-bd10-254aec5c2118"
      }
   },
   "generateDate": "2018-10-09T09:05:39Z",
   "eventType": "ONETIME",
   "reportTemplate": {
      "aps": {
         "link": "weak",
         "href": "/aps/2/resources/82c11092-4705-43e1-bb2d-1bb6dc610312",
         "id": "82c11092-4705-43e1-bb2d-1bb6dc610312"
      }
   },
   "format": "JSON",
   "status": "READY",
   "tmpPath": "https://rde4.blob.core.windows.net/rdecontainer/NW%20Finance.bb92eda5-7214-4766-945b-b07a65ec03e6.2018-10-09.09-05-40.161+0000.json.gz?sig=OFX5EwrQiZa75TS18zC8FUom3D3I%2FE4mbfDLXkS6fDQ%3D&api-version=2016-05-31&st=2018-10-09T09%3A05%3A40Z&se=2018-10-11T09%3A05%3A40Z&sv=2016-05-31&sp=r&sr=b",
   "filePath": "https://rde4.blob.core.windows.net/rdecontainer/NW%20Finance.bb92eda5-7214-4766-945b-b07a65ec03e6.2018-10-09.09-05-40.161+0000.json.gz?sig=a2ZK8ZO3zx2Ov7BrgK5PTJ7KA3xnv%2FC0WT6vHI4mnNw%3D&api-version=2016-05-31&st=2018-10-09T08%3A55%3A40Z&se=2019-01-07T08%3A55%3A40Z&sv=2016-05-31&sp=rwd&sr=b"
}