This APS type is used to create an APS resource for every generated RDE report stored in a cloud repository. The APS resource presents parameters of that report.
In this document:
The considered APS type (download
) looks as follows:
{
"name": "RDEReportFile",
"id": "http://www.odin.com/rde/report-file/1.2",
"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.2"
},
"tenant": {
"type": "http://www.odin.com/rde/tenant/2.0",
"required": true
},
"customization": {
"type": "http://www.odin.com/rde/report-customization/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",
"ONETIME",
"ON_INVOICE"
]
}
},
"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>
NAME |
TYPE |
ATTRIBUTES |
DEFAULT |
DESCRIPTION |
---|---|---|---|---|
name |
String |
Not Required |
Human readable description of report template type, such as “Daily report template”, “Monthly report template” or “On invoice report template”. |
|
parameters |
Not Required |
Report parameters specific to a report “type”. |
||
format |
Enum |
Not Required |
Report file format that can be either JSON, XML, XLSX, CSV. |
|
status |
Enum |
Not Required |
Status of report creation that can be either PENDING, IN_PROGRESS, READY, FAILED. |
|
filePath |
String |
Not Required |
Long-live url to report in file storage, lives as long as report. |
|
tmpPath |
String |
Not Required |
Short-lived url to report in file storage, lives only 48 hours since report creation. |
|
generateDate |
String |
Not Required |
The date and time when the report creation process started. |
|
downloadsCounter |
Integer |
Not Required |
Not used. |
|
eventType |
Enum |
Not Required |
Report event type that can be either PERIODIC, ONETIME, ON_INVOICE. |
NAME |
TYPE |
REQUIRED |
DESCRIPTION |
---|---|---|---|
reportTemplate |
No |
Template which has been used to generate this report file. |
|
tenant |
Yes |
Link to account. |
|
customization |
No |
Link to report customization APS resource. |
Parameters specific to report type.
NAME |
TYPE |
ATTRIBUTES |
DEFAULT |
DESCRIPTION |
---|---|---|---|---|
startDate |
String |
Not Required |
One time report “date from” limitation. |
|
endDate |
String |
Not Required |
Onetime report “date to” limitation. |
|
period |
Enum |
Not Required |
Periodical report type that can be either P1D or P1M (daily or monthly). |
|
invoice |
Not Required |
Invoice that tirggered the generation of the report. |
NAME |
TYPE |
ATTRIBUTES |
DEFAULT |
DESCRIPTION |
---|---|---|---|---|
invoiceId |
Integer |
Not Required |
Unique internal database identifier of invoice. |
|
invoiceNumber |
String |
Not Required |
Reseller’s identifier of invoice. |
|
customerAccountId |
Integer |
Not Required |
Unique internal database identifier of customer. |
|
customerAccountUUID |
String |
Not Required |
||
invoiceDate |
String |
Not Required |
Date of invoice creation. |
|
invoiceDueDate |
String |
Not Required |
Last date of invoice payment. |
|
invoiceTotal |
Number |
Not Required |
Total sum of money of invoice. |
|
invoiceTaxTotal |
Number |
Not Required |
Tax on total sum of money of invoice. |
|
charges |
Array of String |
Not Required |
Not used. |
This section illustrates some typical operations with report APS resources based on the considered APS type. These operations makes sense after RDE reports are generated as demonstrated in the RDEReportTemplate examples. Typical scenarios are in the Reporting and Data Export document.
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.
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"
}