博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
cubes第四篇-请求
阅读量:7114 次
发布时间:2019-06-28

本文共 15160 字,大约阅读时间需要 50 分钟。

hot3.png

一。Get /info

http://192.168.31.108:5000/cubes

其它的用表格形式展示:

GET /cubes
{        "category": null,         "info": {},         "name": "webshop_sales",         "label": "Webshop / Sales"    },     {        "category": null,         "info": {},         "name": "webshop_visits",         "label": "Webshop / Visits"    }

GET /cube/<name>/model

==>

cube/webshop_sales/model

{    "name": "webshop_sales",     "info": {},     "label": "Webshop / Sales",     "aggregates": [        {            "name": "quantity_sum",             "info": {},             "label": "Quantity Sum",             "ref": "quantity_sum",             "function": "sum",             "measure": "quantity"        },         {            "name": "quantity_avg",             "info": {},             "label": "Quantity Avg",             "ref": "quantity_avg",             "function": "avg",             "measure": "quantity"        },         {            "name": "quantity_max",             "info": {},             "label": "Quantity Max",             "ref": "quantity_max",             "function": "max",             "measure": "quantity"        },         {            "name": "quantity_min",             "info": {},             "label": "Quantity Min",             "ref": "quantity_min",             "function": "min",             "measure": "quantity"        },         {            "name": "price_total_sum",             "info": {},             "label": "Price Total Sum",             "ref": "price_total_sum",             "function": "sum",             "measure": "price_total"        },         {            "name": "price_total_avg",             "info": {},             "label": "Price Total Avg",             "ref": "price_total_avg",             "function": "avg",             "measure": "price_total"        },         {            "name": "price_total_max",             "info": {},             "label": "Price Total Max",             "ref": "price_total_max",             "function": "max",             "measure": "price_total"        },         {            "name": "price_total_min",             "info": {},             "label": "Price Total Min",             "ref": "price_total_min",             "function": "min",             "measure": "price_total"        },         {            "name": "delivery_days_sum",             "info": {},             "label": "Delivery Days Sum",             "ref": "delivery_days_sum",             "function": "sum",             "measure": "delivery_days"        },         {            "name": "delivery_days_avg",             "info": {},             "label": "Delivery Days Avg",             "ref": "delivery_days_avg",             "function": "avg",             "measure": "delivery_days"        },         {            "name": "delivery_days_max",             "info": {},             "label": "Delivery Days Max",             "ref": "delivery_days_max",             "function": "max",             "measure": "delivery_days"        },         {            "name": "delivery_days_min",             "info": {},             "label": "Delivery Days Min",             "ref": "delivery_days_min",             "function": "min",             "measure": "delivery_days"        },         {            "name": "record_count",             "info": {},             "label": "Record Count",             "ref": "record_count",             "function": "count"        }    ],     "measures": [        {            "name": "quantity",             "info": {},             "label": "Quantity",             "ref": "quantity",             "aggregates": [                "sum"            ]        },         {            "name": "price_total",             "info": {},             "label": "Price Total",             "ref": "price_total",             "aggregates": [                "sum"            ]        },         {            "name": "delivery_days",             "info": {},             "label": "Delivery Days",             "ref": "delivery_days",             "aggregates": [                "sum"            ]        }    ],     "details": [],     "dimensions": [        {            "name": "date_sale",             "info": {                "cv-datefilter-hierarchy": "daily",                 "cv-datefilter": true            },             "label": "Sale Date",             "default_hierarchy_name": "daily",             "role": "time",             "levels": [                {                    "name": "year",                     "info": {},                     "label": "Year",                     "role": "year",                     "key": "year",                     "label_attribute": "year",                     "order_attribute": "year",                     "attributes": [                        {                            "name": "year",                             "info": {},                             "ref": "date_sale.year",                             "locales": []                        }                    ]                },                 {                    "name": "quarter",                     "info": {},                     "label": "Quarter",                     "role": "quarter",                     "key": "quarter",                     "label_attribute": "quarter",                     "order_attribute": "quarter",                     "attributes": [                        {                            "name": "quarter",                             "info": {},                             "ref": "date_sale.quarter",                             "locales": []                        }                    ]                },                 {                    "name": "month",                     "info": {},                     "label": "Month",                     "role": "month",                     "key": "month",                     "label_attribute": "month",                     "order_attribute": "month",                     "attributes": [                        {                            "name": "month",                             "info": {},                             "ref": "date_sale.month",                             "locales": []                        }                    ]                },                 {                    "name": "week",                     "info": {},                     "label": "Week",                     "role": "week",                     "key": "week",                     "label_attribute": "week",                     "order_attribute": "week",                     "attributes": [                        {                            "name": "week",                             "info": {},                             "ref": "date_sale.week",                             "locales": []                        }                    ]                },                 {                    "name": "day",                     "info": {},                     "label": "Day",                     "role": "day",                     "key": "day",                     "label_attribute": "day",                     "order_attribute": "day",                     "attributes": [                        {                            "name": "day",                             "info": {},                             "ref": "date_sale.day",                             "locales": []                        }                    ]                }            ],             "hierarchies": [                {                    "name": "daily",                     "info": {},                     "label": "Daily",                     "levels": [                        "year",                         "quarter",                         "month",                         "day"                    ]                },                 {                    "name": "weekly",                     "info": {},                     "label": "Weekly",                     "levels": [                        "year",                         "week"                    ]                }            ],             "is_flat": false,             "has_details": false        },         {            "name": "customer",             "info": {},             "label": "Customer",             "default_hierarchy_name": "default",             "levels": [                {                    "name": "customer",                     "info": {},                     "label": "Customer",                     "key": "id",                     "label_attribute": "name",                     "order_attribute": "id",                     "attributes": [                        {                            "name": "id",                             "info": {},                             "ref": "customer.id",                             "locales": []                        },                         {                            "name": "name",                             "info": {},                             "ref": "customer.name",                             "locales": []                        }                    ]                }            ],             "hierarchies": [                {                    "name": "default",                     "info": {},                     "levels": [                        "customer"                    ]                }            ],             "is_flat": true,             "has_details": true        },         {            "name": "product",             "info": {},             "label": "Product",             "default_hierarchy_name": "product",             "levels": [                {                    "name": "product_category",                     "info": {},                     "label": "Product Category",                     "key": "category_label",                     "label_attribute": "category_label",                     "order_attribute": "category_label",                     "attributes": [                        {                            "name": "category_label",                             "info": {},                             "ref": "product.category_label",                             "locales": []                        }                    ]                },                 {                    "name": "product_product",                     "info": {},                     "label": "Product",                     "key": "product_label",                     "label_attribute": "product_label",                     "order_attribute": "product_label",                     "attributes": [                        {                            "name": "product_label",                             "info": {},                             "ref": "product.product_label",                             "locales": []                        }                    ]                }            ],             "hierarchies": [                {                    "name": "product",                     "info": {},                     "label": "Product",                     "levels": [                        "product_category",                         "product_product"                    ]                }            ],             "is_flat": false,             "has_details": false        },         {            "name": "country",             "info": {},             "label": "Country",             "default_hierarchy_name": "contcountry",             "levels": [                {                    "name": "continent",                     "info": {},                     "label": "Continent",                     "key": "continent_code",                     "label_attribute": "continent_name",                     "order_attribute": "continent_code",                     "attributes": [                        {                            "name": "continent_code",                             "info": {},                             "ref": "country.continent_code",                             "locales": []                        },                         {                            "name": "continent_name",                             "info": {},                             "ref": "country.continent_name",                             "locales": []                        }                    ]                },                 {                    "name": "country",                     "info": {},                     "label": "Country",                     "key": "country_code",                     "label_attribute": "country_name",                     "order_attribute": "country_code",                     "attributes": [                        {                            "name": "country_code",                             "info": {},                             "ref": "country.country_code",                             "locales": []                        },                         {                            "name": "country_name",                             "info": {},                             "ref": "country.country_name",                             "locales": []                        }                    ]                }            ],             "hierarchies": [                {                    "name": "contcountry",                     "info": {},                     "label": "Country",                     "levels": [                        "continent",                         "country"                    ]                }            ],             "is_flat": false,             "has_details": true        }    ],     "key": "id",     "features": {        "post_aggregate_functions": [            "smvar",             "sms",             "smrsd",             "wma",             "smstd",             "sma"        ],         "aggregate_functions": [            "count",             "min",             "max",             "sum",             "custom",             "count_nonempty",             "stddev",             "variance",             "avg",             "count_distinct"        ],         "actions": [            "aggregate",             "fact",             "members",             "facts",             "cell"        ]    }}

/cube/<name>/aggregate==>

/cube/webshop_sales/aggregate

 

{    "summary": {        "delivery_days_max": 17,         "quantity_min": 0,         "record_count": 4550,         "quantity_sum": 9861,         "price_total_max": 4550.5,         "quantity_max": 13,         "price_total_min": 0.0,         "delivery_days_sum": 29686,         "delivery_days_avg": 6.524395604395604,         "price_total_avg": 132.4280879120853,         "price_total_sum": 602547.799999988,         "delivery_days_min": 0,         "quantity_avg": 2.167252747252747    },     "remainder": {},     "cells": [],     "aggregates": [        "quantity_sum",         "quantity_avg",         "quantity_max",         "quantity_min",         "price_total_sum",         "price_total_avg",         "price_total_max",         "price_total_min",         "delivery_days_sum",         "delivery_days_avg",         "delivery_days_max",         "delivery_days_min",         "record_count"    ],     "cell": []}
/cube/<name>/members/<dim>  
/cube/<name>/facts  
/cube/<name>/fact  
/cube/<name>/cell   
   
   
   

详细请参考:https://pythonhosted.org/cubes/server.html

转载于:https://my.oschina.net/u/3179991/blog/1615169

你可能感兴趣的文章
python numpy 教程
查看>>
手机web如何实现多平台分享
查看>>
策略模式和观察者模式
查看>>
详解CALayer 和 UIView的区别和联系
查看>>
eclipse中报错:java.lang.OutOfMemoryError: Java heap space
查看>>
Ubuntu 16.04 grub rescue 模式下修复 grub
查看>>
【Spring】24、<load-on-startup>0</load-on-startup>配置
查看>>
L0 Regularization
查看>>
使用JDBC向Kudu表插入中文数据乱码(转载)
查看>>
spf13-vim安装与使用
查看>>
字体颜色代码表
查看>>
hdu 2156 分数矩阵
查看>>
android SQLite数据库应用于草稿箱
查看>>
Android 无缝换肤深入了解与使用
查看>>
Cordova快速开始(安卓篇)
查看>>
ActiveMQ
查看>>
聚类算法(kmeans)详解和python实现
查看>>
四种遍历方法你选哪个?
查看>>
LeetCode41.缺失的第一个正数 JavaScript
查看>>
Java设计模式五——单件模式
查看>>