This repository contains all CloudBlue Connect Reports for Devi
- POC report This report can be used as template to create other reports. It only filters by date and returns Id and Asset Id.
Report templates are configured and developed creating or editing several files.
Custom report templates can be generated using Cookiecutter for CloudBlue Connect Reports too.
This file contains information about all report templates.
This section contains all the parameters that can be used to filter data in order to generate the report.
Type | Example | Overview |
---|---|---|
“product” | { "id":"product", "type":"product", "name":"Product list", "required":true, "description":"Select the products you want to include in report" } |
This parameter type represents your product list. Use the provided example to include specified products to your report. |
“marketplace” | { "id":"mkp", "type":"marketplace", "name":"Marketplaces", "required":true, "description":"Select the marketplaces you want to include in report"} |
This parameter type defines your marketplaces. Include specified marketplaces to your report by using this example. |
"hub" | { "id":"hub", "type":"hub", "name":"Hubs", "required":true, "description":"Select the hubs you want to include in report"} |
This parameter type represents your hub list. Include selected hubs by using the provided example. |
"date_range" | { "id":"date", "type":"date_range", "name":"Report period", "description":"Provide the time period to create the report", "required": true} |
This parameter type is used to define your report date range. Specify your start date and end date by using this parameter type. Use the provided example to include and specify your report date range. |
"date" | { "id":"date", "type":"date", "name":"date", "required":true, "description":"Select the date you want"} |
This parameter type is used to specify your report date. Include a date parameter by following the provided example. |
"object" | { "id":"object", "type":"object", "name":"object", "required":true, "description":"give me a json object"} |
Use this parameter type to include a JSON object. |
"single_line" | { "id":"single_line", "type":"single_line", "name":"Single line", "required":true, "description":"Tell me how you feel today in 1 sentence"} |
Include a single line by using this particular parameter type. |
"checkbox" | { "id":"rr_type", "type":"checkbox", "name":"Types of requests", "required":true, "description":"Select the type of requests you want to include in report", "choices": [ { "value":"setup", "label":"Setup" }, { "value":"update", "label":"Update" } ] } |
This parameter type allows utilizing checkboxes. Thus, by using these checkboxes, you can include specific information within your report. Define your checkboxes within the choices array. The provided example showcases how to include tier configuration requests and setup/update checkboxes to a report. |
"choice" | { "id":"rr_status", "type":"choice", "name":"Request status", "description":"Select the status of the requests you want to include in report", "required":true, "choices": [ { "value":"tiers_setup", "label":"Tier Setup" }, { "value":"inquiring", "label":"Inquiring" }, { "value":"pending", "label":"Pending" }, { "value":"approved", "label":"Approved" }, { "value":"failed", "label":"Failed" } ] } |
Include specified information to your report and filter out unwanted data via this parameter type and specified choices. Define your filters within the choices array. The provided example demonstrates how to include fulfillment requests and their available statuses as choices to a report. |
Renderers define outpuf file type: xlsx, json, xml, csv or pdf
This python file implements parameter transformation into RQL request and data transformation from received response to file.
Reports can be generated using cli before tagging repository and uploading it to Connect. It requires Connect cli
To use connect-cli
you need a system with python 3.8 or later installed.
$ pip install --upgrade connect-cli
To install connect-cli
with homebrew run:
$ brew update
$ brew tap cloudblue/connect
$ brew install cloudblue/connect/connect-cli
An installer package is available for Windows 10 or newer. You can download its zip file from the Github Releases page.
This can be deployed over Connect or can be executed from local files.
First of all you need to add an account the connect-cli
with the CloudBlue Connect API key.
$ ccli account add "ApiKey XXXXX:YYYYY"
In order tu manage reports, 'ccli report' command shoud be used:
$ ccli report
Usage: ccli report [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
execute Execute a report.
info Get additional information for a given report.
list List available reports.
$ ccli report list
$ ccli report list -d /path/to/packages/json/cotaining/folder
$ ccli report info {id}
$ ccli report info {id} -d /path/to/packages/json/cotaining/folder
Report execution will gide you through several steps, depending on how many selections must be done to filter data:
$ ccli report execute {id}
$ ccli report execute {id} -d /path/to/packages/json/cotaining/folder
In order to add reports to Connect, you have to make a release and tag on GitHub.
Note that this step need to be done only once.
Steps:
- Access to Devi connect site and navigate to [Account > Reports > Repositories].
- Press the link
ADD REPOSITORY
to add this repository. - Fill the form:
- Git Repository URL: https://github.com/TelefonicaTC2Tech/devi-connect-reports
- Enable
Requires authorization
because the git repository is private:- Username: Add the username
- Personal Access Token: Add the personal access token with read permissions for this repository.
- Press next and choose the tag
- Complete the wizard.
Steps:
- Access to Devi connect site and navigate to [Account > Reports > Repositories].
- Press the edit button (pencil icon) to edit one of the repositories of the list.
- Complete the form as indicated in
Adding a repository
section.
Steps:
- Access to Devi connect site and navigate to [Reports].
- Press the link
CREATE REPORT
. - Select one of the templates of this repository.
- Complete the wizard specific for the selected template.
This tool access to information through Connect API.
These headers must be sent
Requests must have Authorization header with value:
ApiKey XXXX:xxxxxx
Requests must have accept header with value application/json
https://apispec.connect.cloudblue.com/public/v1/requests
Request parameters limit and offset are available in order to paginate the results:
https://api.connect.cloudblue.com/public/v1/requests?and(ge(events.created.at,2022-11-10T23:00:00+00:00),le(events.created.at,2022-11-11T23:00:00+00:00))&ordering(created)&limit=500&offset=0
ordering request parameteris available in order to sort the results:
https://api.connect.cloudblue.com/public/v1/requests?and(ge(events.created.at,2022-11-10T23:00:00+00:00),le(events.created.at,2022-11-11T23:00:00+00:00))&ordering(created)&limit=500&offset=0
RQL language is used in order to perform queries that allows us to filter the results
i.e.
and(ge(events.created.at,2022-11-10T23:00:00+00:00),le(events.created.at,2022-11-11T23:00:00+00:00),in(asset.product.id,(__product_id__)))
This query is sent as request param:
https://api.connect.cloudblue.com/public/v1/requests?and(ge(events.created.at,2022-11-10T23:00:00+00:00),le(events.created.at,2022-11-11T23:00:00+00:00))&ordering(created)&limit=500&offset=0