Analytics Reports¶
Overview¶
Use the Analytics Reports API to schedule and publish analytics reports. You can use this API to schedule and publish a one-time or periodic analytics report, save filter information, or generate a report from saved information.
Requests¶
Examples¶
POST to schedule a report¶
The following example sends a POST request to schedule a report.
POST https://<BIG-IQ>/mgmt/shared/file/data
The JSON in the body of the POST can look similar to the following example.
{
"name": "Demo Scheduler Metadata",
"reportName": "Analytics Local Traffic Test Report",
"details": "[Some details about this report]",
"filters": "[Filters information to create the report. Only for display purpose in the report file]",
"scheduler": {
"deviceGroupName": "Test_DG",
"scheduleType": "BASIC_WITH_INTERVAL",
"interval": 1,
"intervalUnit": "DAY",
"timeToStartOn": "2020-11-11T01:00:00Z"
},
"services": {
"details": "Demo Service json",
"producer": "ANALYTICS",
"service": [{
"endpoint": {
"link": "<Link of the Service API, like https://localhost/mgmt/ap/query/v1/tenants/default/products/local-traffic/reports>"
},
"payload": "< body of above API >",
"method": "POST"
},
{
"endpoint": {
"link": "<Link of the Service API>"
},
"method": "GET"
}
]
},
"sendMail": {
"subject": "Analytics scheduled report is ready",
"toAddresses": [
"testmail@f5.com"
]
},
"fileStore": {
"extension": "PDF",
"location": "LOCAL",
"expiry": 1,
"expiryUnit": "WEEK"
}
}
Response¶
The JSON in the body of the response to the POST can look similar to the following.
{
"id": "e15f1840-102e-42be-ba69-73fec63adffa",
"name": "Demo Scheduler Metadata",
"reportName": "Analytics Local Traffic Test Report",
"details": "[as given]",
"filters": "[as given]",
"services": {
"details": "Demo Service json",
"producer": "ANALYTICS",
"service": [{
"endpoint": {
"link": "<Link of the Service API, like https://localhost/mgmt/ap/query/v1/tenants/default/products/local-traffic/reports>"
},
"payload": "< body of above API >",
"method": "POST"
},
{
"endpoint": {
"link": "<Link of the Service API>"
},
"method": "GET"
}
]
},
"sendMail": {
"toAddresses": [
"testmail@f5.com"
],
"subject": "Analytics scheduled report is ready",
"testConnectionOnly": false
},
"fileStore": {
"extension": "PDF",
"location": "LOCAL",
"expiry": 1,
"expiryUnit": "WEEK"
},
"schedulerReference": {
"link": "https://localhost/mgmt/shared/task-scheduler/scheduler/e23b354a-499f-4a44-a926-94a01486714e"
},
"generation": 1,
"lastUpdateMicros": 1600774118660523,
"kind": "shared:file:data:filtermetadatastate",
"selfLink": "https://localhost/mgmt/shared/file/data/e15f1840-102e-42be-ba69-73fec63adffa"
}
POST to save filter data¶
The following example sends a POST request to save filter data.
POST https://<BIG-IQ>/mgmt/shared/file/data
The JSON in the body of the POST can look similar to the following example.
{
"name": "Demo Scheduler Metadata",
"reportName": "Analytics Local Traffic Test Report",
"details": "[Some details about this report]",
"filters": "[Filters information to create the report. Only for display purpose in the report file]",
"saveMetadata": true,
"services": {
"details": "Demo Service json",
"producer": "ANALYTICS",
"service": [{
"endpoint": {
"link": "<Link of the Service API, like https://localhost/mgmt/ap/query/v1/tenants/default/products/local-traffic/reports>"
},
"payload": "< body of above API >",
"method": "POST"
},
{
"endpoint": {
"link": "<Link of the Service API>"
},
"method": "GET"
}
]
},
"sendMail": {
"subject": "Analytics scheduled report is ready",
"toAddresses": [
"testmail@f5.com"
]
},
"fileStore": {
"extension": "PDF",
"location": "LOCAL",
"expiry": 1,
"expiryUnit": "WEEK"
}
}
Response¶
The JSON in the body of the response to the POST can look similar to the following.
{
"id": "61f02bc2-0ed0-4253-8484-929d9cbe2689",
"name": "Demo Scheduler Metadata",
"reportName": "Analytics Local Traffic Test Report",
"details": "[as given]",
"filters": "[as given]",
"services": {
"details": "Demo Service json",
"producer": "ANALYTICS",
"service": [{
"endpoint": {
"link": "<Link of the Service API, like https://localhost/mgmt/ap/query/v1/tenants/default/products/local-traffic/reports>"
},
"payload": "< body of above API >",
"method": "POST"
},
{
"endpoint": {
"link": "<Link of the Service API>"
},
"method": "GET"
}
]
},
"sendMail": {
"toAddresses": [
"testmail@f5.com"
],
"subject": "Analytics scheduled report is ready",
"testConnectionOnly": false
},
"fileStore": {
"extension": "PDF",
"location": "LOCAL",
"expiry": 1,
"expiryUnit": "WEEK"
},
"generation": 1,
"lastUpdateMicros": 1600337232997575,
"kind": "shared:file:data:filtermetadatastate",
"selfLink": "https://localhost/mgmt/shared/file/data/61f02bc2-0ed0-4253-8484-929d9cbe2689"
}
POST to generate report from saved data¶
The following example sends a POST request to generate report from saved data.
POST https://<BIG-IQ>/mgmt/shared/file/data
The JSON in the body of the POST can look similar to the following example.
{
"id": "61f02bc2-0ed0-4253-8484-929d9cbe2689"
}
Response¶
The JSON in the body of the response to the POST can look similar to the following.
{
"id": "61f02bc2-0ed0-4253-8484-929d9cbe2689",
"generation": 1,
"lastUpdateMicros": 1600337232997575,
"kind": "shared:file:data:filtermetadatastate",
"selfLink": "https://localhost/mgmt/shared/file/data/61f02bc2-0ed0-4253-8484-929d9cbe2689"
}
POST to generate a one-time report¶
The following example sends a POST request to generate a one-time report.
POST https://<BIG-IQ>/mgmt/shared/file/data
The JSON in the body of the POST can look similar to the following example.
{
"name": "Demo Scheduler Metadata",
"reportName": "Analytics Local Traffic Test Report",
"details": "[Some details about this report]",
"filters": "[Filters information to create the report. Only for display purpose in the report file]",
"services": {
"details": "Demo Service json",
"producer": "ANALYTICS",
"service": [{
"endpoint": {
"link": "<Link of the Service API, like https://localhost/mgmt/ap/query/v1/tenants/default/products/local-traffic/reports>"
},
"payload": "< body of above API >",
"method": "POST"
},
{
"endpoint": {
"link": "<Link of the Service API>"
},
"method": "GET"
}
]
},
"sendMail": {
"subject": "Analytics scheduled report is ready",
"toAddresses": [
"testmail@f5.com"
]
},
"fileStore": {
"extension": "PDF",
"location": "LOCAL",
"expiry": 1,
"expiryUnit": "WEEK"
}
}
Response¶
The JSON in the body of the response to the POST can look similar to the following.
{
"id": "24e2ebb6-aa94-4db2-b193-47448e30fbe0",
"name": "Demo Scheduler Metadata",
"reportName": "Analytics Local Traffic Test Report",
"details": "[as given]",
"filters": "[as given]",
"services": {
"details": "Demo Service json",
"producer": "ANALYTICS",
"service": [{
"endpoint": {
"link": "<Link of the Service API, like https://localhost/mgmt/ap/query/v1/tenants/default/products/local-traffic/reports>"
},
"payload": "< body of above API >",
"method": "POST"
},
{
"endpoint": {
"link": "<Link of the Service API>"
},
"method": "GET"
}
]
},
"sendMail": {
"toAddresses": [
"testmail@f5.com"
],
"subject": "Analytics scheduled report is ready",
"testConnectionOnly": false
},
"fileStore": {
"extension": "PDF",
"location": "LOCAL",
"expiry": 1,
"expiryUnit": "WEEK"
},
"generation": 1,
"lastUpdateMicros": 1600432022871542,
"kind": "shared:file:data:filtermetadatastate",
"selfLink": "https://localhost/mgmt/shared/file/data/24e2ebb6-aa94-4db2-b193-47448e30fbe0"
}
GET to retrieve all records¶
The following example sends a GET request to retrieve all records.
GET https://<BIG-IQ>/mgmt/shared/file/data
Response¶
The JSON in the body of the response to the GET can look similar to the following.
{
"items": [{
"id": "e15f1840-102e-42be-ba69-73fec63adffa",
"name": "Demo Scheduler Metadata",
"reportName": "Analytics Local Traffic Test Report",
"details": "[as given]",
"filters": "[as given]",
"services": {
"details": "Demo Service json",
"producer": "ANALYTICS",
"service": [{
"endpoint": {
"link": "<Link of the Service API, like https://localhost/mgmt/ap/query/v1/tenants/default/products/local-traffic/reports>"
},
"payload": "< body of above API >",
"method": "POST"
},
{
"endpoint": {
"link": "<Link of the Service API>"
},
"method": "GET"
}
]
},
"sendMail": {
"toAddresses": [
"testmail@f5.com"
],
"subject": "Analytics scheduled report is ready",
"testConnectionOnly": false
},
"fileStore": {
"extension": "PDF",
"location": "LOCAL",
"expiry": 1,
"expiryUnit": "WEEK"
},
"schedulerReference": {
"link": "https://localhost/mgmt/shared/task-scheduler/scheduler/e23b354a-499f-4a44-a926-94a01486714e"
},
"generation": 1,
"lastUpdateMicros": 1600774118660523,
"kind": "shared:file:data:filtermetadatastate",
"selfLink": "https://localhost/mgmt/shared/file/data/e15f1840-102e-42be-ba69-73fec63adffa"
},
{
"id": "61f02bc2-0ed0-4253-8484-929d9cbe2689",
"name": "Demo Scheduler Metadata",
"reportName": "Analytics Local Traffic Test Report",
"details": "[as given]",
"filters": "[as given]",
"services": {
"details": "Demo Service json",
"producer": "ANALYTICS",
"service": [{
"endpoint": {
"link": "<Link of the Service API, like https://localhost/mgmt/ap/query/v1/tenants/default/products/local-traffic/reports>"
},
"payload": "< body of above API >",
"method": "POST"
},
{
"endpoint": {
"link": "<Link of the Service API>"
},
"method": "GET"
}
]
},
"sendMail": {
"toAddresses": [
"testmail@f5.com"
],
"subject": "Analytics scheduled report is ready",
"testConnectionOnly": false
},
"fileStore": {
"extension": "PDF",
"location": "LOCAL",
"expiry": 1,
"expiryUnit": "WEEK"
},
"generation": 1,
"lastUpdateMicros": 1600337232997575,
"kind": "shared:file:data:filtermetadatastate",
"selfLink": "https://localhost/mgmt/shared/file/data/61f02bc2-0ed0-4253-8484-929d9cbe2689"
}
],
"generation": 2,
"kind": "shared:file:data:dataorchestratorcollectionstate",
"lastUpdateMicros": 1600774118747059,
"selfLink": "https://localhost/mgmt/shared/file/data"
}
GET to retrieve a single record¶
The following example sends a GET request to retrieve a single record.
GET https://<BIG-IQ>/mgmt/shared/file/data/e15f1840-102e-42be-ba69-73fec63adffa
Response¶
The JSON in the body of the response to the GET can look similar to the following.
{
"id": "e15f1840-102e-42be-ba69-73fec63adffa",
"name": "Demo Scheduler Metadata",
"reportName": "Analytics Local Traffic Test Report",
"details": "[as given]",
"filters": "[as given]",
"services": {
"details": "Demo Service json",
"producer": "ANALYTICS",
"service": [{
"endpoint": {
"link": "<Link of the Service API, like https://localhost/mgmt/ap/query/v1/tenants/default/products/local-traffic/reports>"
},
"payload": "< body of above API >",
"method": "POST"
},
{
"endpoint": {
"link": "<Link of the Service API>"
},
"method": "GET"
}
]
},
"sendMail": {
"toAddresses": [
"testmail@f5.com"
],
"subject": "Analytics scheduled report is ready",
"testConnectionOnly": false
},
"fileStore": {
"extension": "PDF",
"location": "LOCAL",
"expiry": 1,
"expiryUnit": "WEEK"
},
"schedulerReference": {
"link": "https://localhost/mgmt/shared/task-scheduler/scheduler/e23b354a-499f-4a44-a926-94a01486714e"
},
"generation": 1,
"lastUpdateMicros": 1600774118660523,
"kind": "shared:file:data:filtermetadatastate",
"selfLink": "https://localhost/mgmt/shared/file/data/e15f1840-102e-42be-ba69-73fec63adffa"
}
PATCH to update a report¶
The following example sends a POST request to update a report. Patchable inputs: scheduler, services, fileStore, `sendMail, and details.
PATCH https://<BIG-IQ>/mgmt/shared/file/data/e15f1840-102e-42be-ba69-73fec63adffa
The JSON in the body of the PATCH can look similar to the following example.
{
"references": [{
"publishReference": {
"link": "https://localhost/mgmt/shared/file/publish/25ea097f-6227-4ef7-a8d1-db96fced0684"
},
"storageReference": {
"link": "https://localhost/mgmt/shared/file/store/b3e58c28-66e9-4918-a24f-1e2c6871938f"
}
}]
}
Response¶
The JSON in the body of the response to the PATCH can look similar to the following.
{
"id": "e15f1840-102e-42be-ba69-73fec63adffa",
"name": "Demo Scheduler Metadata",
"reportName": "Analytics Local Traffic Test Report",
"details": "[as given]",
"filters": "[as given]",
"services": {
"details": "Demo Service json",
"producer": "ANALYTICS",
"service": [{
"endpoint": {
"link": "<Link of the Service API, like https://localhost/mgmt/ap/query/v1/tenants/default/products/local-traffic/reports>"
},
"payload": "< body of above API >",
"method": "POST"
},
{
"endpoint": {
"link": "<Link of the Service API>"
},
"method": "GET"
}
]
},
"sendMail": {
"toAddresses": [
"testmail@f5.com"
],
"subject": "Analytics scheduled report is ready",
"testConnectionOnly": false
},
"fileStore": {
"extension": "PDF",
"location": "LOCAL",
"expiry": 1,
"expiryUnit": "WEEK"
},
"schedulerReference": {
"link": "https://localhost/mgmt/shared/task-scheduler/scheduler/e23b354a-499f-4a44-a926-94a01486714e"
},
"generation": 2,
"references": [{
"validTill": "2020-11-18T06:44:26.171Z",
"publishReference": {
"link": "https://localhost/mgmt/shared/file/publish/25ea097f-6227-4ef7-a8d1-db96fced0684"
},
"storageReference": {
"link": "https://localhost/mgmt/shared/file/store/b3e58c28-66e9-4918-a24f-1e2c6871938f"
}
}],
"lastUpdateMicros": 1600774118660523,
"kind": "shared:file:data:filtermetadatastate",
"selfLink": "https://localhost/mgmt/shared/file/data/e15f1840-102e-42be-ba69-73fec63adffa"
}
DELETE to delete a report¶
The following example sends a DELETE request to delete a report.
GET https://<BIG-IQ>/mgmt/shared/file/data/e15f1840-102e-42be-ba69-73fec63adffa
Response¶
The JSON in the body of the response to the DELETE can look similar to the following.
{
"id": "e15f1840-102e-42be-ba69-73fec63adffa",
"name": "Demo Scheduler Metadata",
"reportName": "Analytics Local Traffic Test Report",
"details": "[as given]",
"filters": "[as given]",
"services": {
"details": "Demo Service json",
"producer": "ANALYTICS",
"service": [{
"endpoint": {
"link": "<Link of the Service API, like https://localhost/mgmt/ap/query/v1/tenants/default/products/local-traffic/reports>"
},
"payload": "< body of above API >",
"method": "POST"
},
{
"endpoint": {
"link": "<Link of the Service API>"
},
"method": "GET"
}
]
},
"sendMail": {
"toAddresses": [
"testmail@f5.com"
],
"subject": "Analytics scheduled report is ready",
"testConnectionOnly": false
},
"fileStore": {
"extension": "PDF",
"location": "LOCAL",
"expiry": 1,
"expiryUnit": "WEEK"
},
"schedulerReference": {
"link": "https://localhost/mgmt/shared/task-scheduler/scheduler/e23b354a-499f-4a44-a926-94a01486714e"
},
"generation": 2,
"references": [{
"validTill": "2020-11-18T06:44:26.171Z",
"publishReference": {
"link": "https://localhost/mgmt/shared/file/publish/25ea097f-6227-4ef7-a8d1-db96fced0684"
},
"storageReference": {
"link": "https://localhost/mgmt/shared/file/store/b3e58c28-66e9-4918-a24f-1e2c6871938f"
}
}],
"lastUpdateMicros": 1600774118660523,
"kind": "shared:file:data:filtermetadatastate",
"selfLink": "https://localhost/mgmt/shared/file/data/e15f1840-102e-42be-ba69-73fec63adffa"
}