云服务器内容精选

  • 调用API获取项目ID 项目ID可以通过调用查询指定条件下的项目列表API获取。 获取项目ID的接口为“GET https://{Endpoint}/v3/projects”,其中{Endpoint}为IAM的终端节点,可以从地区和终端节点获取。接口的认证鉴权请参见认证鉴权。 响应示例如下,其中projects下的“id”即为项目ID。 { "projects": [ { "domain_id": "65ewtrgaggshhk1223245sghjlse684b", "is_domain": false, "parent_id": "65ewtrgaggshhk1223245sghjlse684b", "name": "project_name", "description": "", "links": { "next": null, "previous": null, "self": "https://www.example.com/v3/projects/a4adasfjljaaaakla12334jklga9sasfg" }, "id": "a4adasfjljaaaakla12334jklga9sasfg", "enabled": true } ], "links": { "next": null, "previous": null, "self": "https://www.example.com/v3/projects" } }
  • 监控指标 表1 DDS推荐的监控指标 指标ID 指标名称 指标含义 取值范围 测量对象 监控周期(原始指标) mongo007_connections_usage 当前活动连接数百分比 该指标用于统计试图连接到实例节点的连接数占可用连接数百分比,以百分比为单位。 0~100% 文档数据库集群实例下的dds mongos节点 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 5秒 mongo032_mem_usage 内存使用率 该指标用于统计测量对象的内存利用率,以百分比为单位。 0~100% 文档数据库集群实例下的dds mongos节点 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 5秒 mongo031_cpu_usage CPU使用率 该指标用于统计测量对象的CPU利用率,以百分比为单位。 0~100% 文档数据库集群实例下的dds mongos节点 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 5秒 mongo035_disk_usage 磁盘利用率 该指标用于统计测量对象的磁盘利用率,以百分比为单位。 0~100% 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 表2 DDS支持的监控指标 指标ID 指标名称 指标含义 取值范围 测量对象 监控周期(原始指标) mongo001_command_ps command执行频率 该指标用于统计平均每秒command语句在节点上执行次数,以次数/秒为单位。 ≥ 0 Executions/s 文档数据库实例 文档数据库集群实例下的dds mongos节点 文档数据库副本集实例下的只读节点 文档数据库实例下的主节点 文档数据库实例下的备节点 文档数据库实例下的隐藏节点 1分钟 5秒 mongo002_delete_ps delete语句执行频率 该指标用于统计平均每秒delete语句在节点上执行次数,以次数/秒为单位。 ≥ 0 Executions/s 文档数据库实例 文档数据库集群实例下的dds mongos节点 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 5秒 mongo003_insert_ps insert语句执行频率 该指标用于统计平均每秒insert语句在节点上执行次数,以次数/秒为单位。 ≥ 0 Executions/s 文档数据库实例 文档数据库集群实例下的dds mongos节点 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 5秒 mongo004_query_ps query语句执行频率 该指标用于统计平均每秒query语句在节点上执行次数,以次数/秒为单位。 ≥ 0 Executions/s 文档数据库实例 文档数据库集群实例下的dds mongos节点 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 5秒 mongo005_update_ps update语句执行频率 该指标用于统计平均每秒update语句在节点上执行次数,以次数/秒为单位。 ≥ 0 Executions/s 文档数据库实例 文档数据库集群实例下的dds mongos节点 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 5秒 mongo006_getmore_ps getmore语句执行频率 该指标用于统计平均每秒getmore语句在节点上执行次数,以次数/秒为单位。 ≥ 0 Executions/s 文档数据库实例 文档数据库集群实例下的dds mongos节点 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 5秒 mongo007_chunk_num1 分片一的chunk数 该指标用于统计分片一的chunk个数,以个数为单位。 0~64 Counts 文档数据库集群实例 1分钟 mongo007_chunk_num2 分片二的chunk数 该指标用于统计分片二的chunk个数,以个数为单位。 0~64 Counts 文档数据库集群实例 1分钟 mongo007_chunk_num3 分片三的chunk数 该指标用于统计分片三的chunk个数,以个数为单位。 0~64 Counts 文档数据库集群实例 1分钟 mongo007_chunk_num4 分片四的chunk数 该指标用于统计分片四的chunk个数,以个数为单位。 0~64 Counts 文档数据库集群实例 1分钟 mongo007_chunk_num5 分片五的chunk数 该指标用于统计分片五的chunk个数,以个数为单位。 0~64 Counts 文档数据库集群实例 1分钟 mongo007_chunk_num6 分片六的chunk数 该指标用于统计分片六的chunk个数,以个数为单位。 0~64 Counts 文档数据库集群实例 1分钟 mongo007_chunk_num7 分片七的chunk数 该指标用于统计分片七的chunk个数,以个数为单位。 0~64 Counts 文档数据库集群实例 1分钟 mongo007_chunk_num8 分片八的chunk数 该指标用于统计分片八的chunk个数,以个数为单位。 0~64 Counts 文档数据库集群实例 1分钟 mongo007_chunk_num9 分片九的chunk数 该指标用于统计分片九的chunk个数,以个数为单位。 0~64 Counts 文档数据库集群实例 1分钟 mongo007_chunk_num10 分片十的chunk数 该指标用于统计分片十的chunk个数,以个数为单位。 0~64 Counts 文档数据库集群实例 1分钟 mongo007_chunk_num11 分片十一的chunk数 该指标用于统计分片十一的chunk个数,以个数为单位。 0~64 Counts 文档数据库集群实例 1分钟 mongo007_chunk_num12 分片十二的chunk数 该指标用于统计分片十二的chunk个数,以个数为单位。 0~64 Counts 文档数据库集群实例 1分钟 mongo008_connections 实例当前活动连接数 该指标用于统计试图连接到DDS实例的总连接数,以个数为单位。 0~200 Counts 文档数据库实例 1分钟 mongo009_migFail_num 过去一天块迁移的失败次数 该指标用于统计过去一天中块迁移失败的次数,以次数为单位。 ≥ 0 Counts 文档数据库集群实例 1分钟 mongo007_connections 当前活动连接数 该指标用于统计试图连接到DDS实例节点的总连接数,以个数为单位。 0~200 Counts 文档数据库集群实例下的dds mongos节点 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 5秒 mongo007_connections_usage 当前活动连接数百分比 该指标用于统计试图连接到实例节点的连接数占可用连接数百分比,以百分比为单位。 0~100% 文档数据库集群实例下的dds mongos节点 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 5秒 mongo008_mem_resident 驻留内存 该指标用于统计当前驻留内存的大小,以兆字节为单位。 ≥ 0 MB 文档数据库集群实例下的dds mongos节点 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo009_mem_virtual 虚拟内存 该指标用于统计当前虚拟内存的大小,以兆字节为单位。 ≥ 0 MB 文档数据库集群实例下的dds mongos节点 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo010_regular_asserts_ps 常规断言频率 该指标用于统计常规断言频率,以次数/秒为单位。 ≥ 0 Executions/s 文档数据库集群实例下的dds mongos节点 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo011_warning_asserts_ps 警告频率 该指标用于统计警告频率,以次数/秒为单位。 ≥ 0 Executions/s 文档数据库集群实例下的dds mongos节点 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo012_msg_asserts_ps 消息断言频率 该指标用于统计消息断言频率,以次数/秒为单位。 ≥ 0 Executions/s 文档数据库集群实例下的dds mongos节点 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo013_user_asserts_ps 用户断言频率 该指标用于统计用户断言频率,以次数/秒为单位。 ≥ 0 Executions/s 文档数据库集群实例下的dds mongos节点 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo014_queues_total 等待锁的操作数 该指标用于统计当前等待锁的操作数,以个数为单位。 ≥ 0 Counts 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo015_queues_readers 等待读锁的操作数 该指标用于统计当前等待读锁的操作数,以个数为单位。 ≥ 0 Counts 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo016_queues_writers 等待写锁的操作数 该指标用于统计当前等待写锁的操作数,以个数为单位。 ≥ 0 Counts 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo017_page_faults 缺页错误数 该指标用于统计当前节点上的缺页错误数,以个数为单位。 ≥ 0 Counts 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo018_porfling_num 慢查询数 该指标用于统计当前节点上的慢查询数,以个数为单位。 ≥ 0 Counts 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo019_cursors_open 当前维护游标数 该指标用于统计当前节点上的维护游标数,以个数为单位。 ≥ 0 Counts 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo020_cursors_timeOut 服务超时游标数 该指标用于统计当前节点上的服务超时游标数,以个数为单位。 ≥ 0 Counts 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo021_wt_cahe_usage 内存中数据量(WiredTiger引擎) 该指标用于统计当前内存中数据量(WiredTiger引擎),以兆字节为单位。 ≥ 0 MB 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo022_wt_cahe_dirty 内存中脏数据量(WiredTiger引擎) 该指标用于统计当前内存中脏数据量(WiredTiger引擎),以兆字节为单位。 ≥ 0 MB 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo023_wInto_wtCache 写入WiredTiger内存的频率 该指标用于统计当前内存中写入频率(WiredTiger引擎),字节/秒为单位。 ≥ 0 Bytes/s 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo024_wFrom_wtCache 从WiredTiger内存写入磁盘频率 该指标用于统计当前内存写入磁盘频率(WiredTiger引擎),字节/秒为单位。 ≥ 0 Bytes/s 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo025_repl_oplog_win 主节点的Oplog中可用时间 该指标用于统计当前实例下的主节点的Oplog中可用时间,以小时为单位。 ≥ 0 Hours 文档数据库实例下的主节点 1分钟 mongo026_oplog_size_ph 主节点生成Oplog的速率 该指标用于统计当前实例下的主节点生成Oplog的速率,以兆字节/小时为单位。 ≥ 0 MB/Hour 文档数据库实例下的主节点 1分钟 mongo025_repl_headroom 主备Oplog重叠时长 该指标用于统计实例下的主节点和Secondary节点之间Oplog重叠时长,以秒为单位。 ≥ 0 Seconds 文档数据库实例下的备节点 1分钟 mongo026_repl_lag 主备延时 该指标用于统计实例下的主节点和Secondary节点之间的复制延时,以秒为单位。 ≥ 0 Seconds 文档数据库实例下的备节点 1分钟 mongo027_repl_command_ps 备节点复制的command执行频率 该指标用于统计平均每秒Secondary节点复制的command语句执行次数,以次/秒为单位。 ≥ 0 Executions/s 文档数据库实例下的备节点 1分钟 mongo028_repl_update_ps 备节点复制的update语句执行频率 该指标用于统计平均每秒Secondary节点复制的update语句执行次数,以次/秒为单位。 ≥ 0 Executions/s 文档数据库实例下的备节点 1分钟 mongo029_repl_delete_ps 备节点复制的delete语句执行频率 该指标用于统计平均每秒Secondary节点复制的delete语句执行次数,以次/秒为单位。 ≥ 0 Executions/s 文档数据库实例下的备节点 1分钟 mongo030_repl_insert_ps 备节点复制的insert语句执行频率 该指标用于统计平均每秒Secondary节点复制的insert语句执行次数,以次/秒为单位。 ≥ 0 Executions/s 文档数据库实例下的备节点 1分钟 mongo031_cpu_usage CPU使用率 该指标用于统计测量对象的CPU利用率,以百分比为单位。 0~100% 文档数据库集群实例下的dds mongos节点 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 5秒 mongo032_mem_usage 内存使用率 该指标用于统计测量对象的内存利用率,以百分比为单位。 0~100% 文档数据库集群实例下的dds mongos节点 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 5秒 mongo033_bytes_out 网络输出吞吐量 该指标用于统计平均每秒从测量对象的所有网络适配器输出的流量,以字节/秒为单位。 ≥ 0 Bytes/s 文档数据库集群实例下的dds mongos节点 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 5秒 mongo034_bytes_in 网络输入吞吐量 该指标用于统计平均每秒从测量对象的所有网络适配器输入的流量,以字节/秒为单位。 ≥ 0 Bytes/s 文档数据库集群实例下的dds mongos节点 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 5秒 mongo035_disk_usage 磁盘利用率 该指标用于统计测量对象的磁盘利用率,以百分比为单位。 0~100% 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo036_iops IOPS 该指标用于统计当前实例节点,单位时间内系统处理的I/O请求数量(平均值),以请求/秒为单位。 ≥ 0 Counts/s 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo037_read_throughput 硬盘读吞吐量 硬盘平均每秒读字节数,以字节/秒为单位。 ≥ 0 Bytes/s 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo038_write_throughput 硬盘写吞吐量 硬盘平均每秒写字节数,以字节/秒为单位。 ≥ 0 bytes/s 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo039_avg_disk_sec_per_read 硬盘读耗时 该指标用于统计某段时间平均每次读取硬盘所耗时间,以秒为单位。 ≥ 0 Seconds 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo040_avg_disk_sec_per_write 硬盘写耗时 该指标用于统计某段时间平均每次写入硬盘所耗时间,以秒为单位。 ≥ 0 Seconds 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo042_disk_total_size 磁盘总大小 该指标用于统计测量对象的磁盘总大小,以吉字节为单位。 0~1000 GB 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo043_disk_used_size 磁盘使用量 该指标用于统计测量对象的磁盘已使用总大小,以吉字节为单位。 0~1000 GB 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo044_swap_usage SWAP利用率 交换内存SWAP使用率百分数,以百分比为单位。 0~100% 文档数据库集群实例下的dds mongos节点 文档数据库实例下的备节点 1分钟 mongo050_top_total_time 集合花费的总时间 Mongotop-total time指标,集合操作花费的时间总和,以毫秒为单位。 ≥ 0 Milliseconds 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo051_top_read_time 集合读花费的总时间 Mongotop-read time指标,集合读操作花费的时间总和,以毫秒为单位。 ≥ 0 Milliseconds 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo052_top_write_time 集合写花费的总时间 Mongotop-write time指标,集合写操作花费的时间总和,以毫秒为单位。 ≥ 0 Milliseconds 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo053_wt_flushes_status 周期Checkpoint的触发次数 WiredTiger一个轮询间隔期间checkpoint的触发次数,记录周期内发生的次数单位。 ≥ 0 Counts 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo054_wt_cache_used_percent Wiredtiger使用中的缓存百分比 Wiredtiger使用中的缓存大小百分数,以百分比为单位。 0~100% 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo055_wt_cache_dirty_percent Wiredtiger脏数据的缓存百分比 Wiredtiger脏数据的缓存大小百分数,以百分比为单位。 0~100% 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo070_rocks_active_memtable memtable中的数据大小 采集当前活动memtable中的数据大小 0~100 GB 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo071_rocks_oplogcf_active_memtable oplogcf上memtable中的数据大小 采集当前用于oplogcf上活动memtable中的数据大小 0~100 GB 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo072_rocks_all_memtable memtable和immutable-mem中的总数据大小 采集当前memtable和immutable-mem中的总数据大小 0~100 GB 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo073_rocks_oplogcf_all_memtable oplogcf上memtable和immutable-mem中的总数据大小 采集当前用于oplogcf上memtable和immutable-mem中的总数据大小 0~100 GB 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo074_rocks_snapshots 未释放的snapshot的数量 采集当前未释放的snapshot的数量 ≥ 0 Counts 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo075_rocks_oplogcf_snapshots oplogcf上未释放的snapshot的数量 采集当前oplogcf上未释放的snapshot的数量 ≥ 0 Counts 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo076_rocks_live_versions 活动的版本数量 采集当前活动的版本数量 ≥ 0 Counts 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo077_rocks_oplogcf_live_versions oplogcf上活动的版本数量 采集当前oplogcf上活动的版本数量 ≥ 0 Counts 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo078_rocks_block_cache 驻留在blockcache中的数据大小 采集当前驻留在blockcache中的数据大小 0~100 GB 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo079_rocks_background_errors 后台累积错误数量 采集记录后台累积错误数量 ≥ 0 Counts 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo080_rocks_oplogcf_background_errors oplogcf上后台累积错误数量 采集记录oplogcf上后台累积错误数量 ≥ 0 Counts 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo081_rocks_conflict_bytes_usage 事务写写冲突处理缓冲区使用率 采集事务写中写冲突处理缓冲区使用率 0~100% 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo082_rocks_uncommitted_keys 未提交的key的数量 采集当前未提交的key的数量 ≥ 0 Counts 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo083_rocks_committed_keys 提交的key的数量 采集当前已提交的key的数量 ≥ 0 Counts 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo084_rocks_alive_txn 活跃事务链表的长度 采集记录活跃事务链表的长度 ≥ 0 Counts 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo085_rocks_read_queue 读队列的长度 采集当前读队列的长度 ≥ 0 Counts 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo086_rocks_commit_queue 提交队列的长度 采集当前提交队列的长度 ≥ 0 Counts 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo087_rocks_ct_write_out 已使用并发写事务数 采集当前已使用并发写事务数 ≥ 0 Counts 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo088_rocks_ct_write_available 剩余可用并发写事务数 采集当前剩余可用并发写事务数 ≥ 0 Counts 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo089_rocks_ct_read_out 已使用并发读事务数 采集当前已使用并发读事务数 ≥ 0 Counts 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo090_rocks_ct_read_available 剩余可用并发读事务数 采集当前剩余可用并发读事务数 ≥ 0 Counts 文档数据库实例下的主节点 文档数据库实例下的备节点 1分钟 mongo091_active_session_count 周期活跃会话数 该指标用于统计自上次刷新周期以来Mongo实例在内存中缓存的所有活跃本地会话的数目 ≥ 0 Counts 文档数据库实例 文档数据库副本集实例下的只读节点 文档数据库实例下的主节点 文档数据库实例下的备节点 文档数据库实例下的隐藏节点 1分钟 mongo092_rx_errors 接收报文错误率 该指标用于统计监控周期内接收报文中错误报文数量与全部接收报文比值。 0~100% 文档数据库实例 1分钟 5秒 mongo093_rx_dropped 接收报文丢包率 该指标用于监控周期内统计接收报文中丢失报文数量与全部接收报文比值。 0~100% 文档数据库实例 1分钟 5秒 mongo094_tx_errors 发送报文错误率 该指标用于监控周期内统计发送报文中错误报文数量与全部发送报文比值。 0~100% 文档数据库实例 1分钟 5秒 mongo095_tx_dropped 发送报文丢包率 该指标用于监控周期内统计发送报文中丢失报文数量与全部发送报文比值。 0~100% 文档数据库实例 1分钟 5秒 mongo096_retrans_segs 重传包数目 该指标用于监控周期内统计重传包数目。 ≥ 0 Counts 文档数据库实例 1分钟 5秒 mongo097_retrans_rate 重传比例 该指标用于监控周期内统计重传包比例。 0~100% 文档数据库实例 1分钟 5秒 mongo098_out_rsts_nums 发送RST数目 该指标用于监控周期内统计RST数目。 ≥ 0 Counts 文档数据库实例 1分钟 5秒 指标ID中含有“rocks”的监控指标均用于监测4.2版本的实例或实例节点。
  • 不同协议消息说明 不同的订阅协议接收到的消息包含的内容可能有所不同。 邮件和HTTP(S)终端收到的消息包含:消息主题、消息内容和取消订阅的链接。 短信终端接收到的消息只包含消息内容。 FunctionGraph(函数)终端收到的消息包含消息属性、消息标题、消息内容、主题URN等信息。消息样例类似如下。字段说明如表1所示。 { "record": [{ "event_version": "1.0", "smn": { "message_attributes": "", "subject": "Welcome", "message_id": "e6fa59c6b3e0424c9c02cbed35b680e7", "topic_urn": "urn:smn:regionId:66e0f4622d6f4e3fb2db2e495298a61a:smn_123", "type": "notification", "message": "Hello", "timestamp": "2017-08-17T10:07:14Z" }, "event_source": "smn", "event_subscription_urn": "urn:cff:regionId:66e0f4622d6f4e3fb2db2e495298a61a:function:DEFAULT:mytest:latest" }] } 表1 字段说明 字段配置项 类型 说明 record JSON对象 消息列表 event_version String 版本 message_attributes String 消息属性 subject String 消息标题 message_id String 消息ID topic_urn String 主题URN type String 消息类型 message String 消息内容 timestamp String 时间戳 event_source String 消息来源 event_subscription_urn String 订阅URN FunctionGraph(工作流)终端收到的消息包含消息标题、消息内容、主题URN等信息。消息样例类似如下。字段说明如表2所示。 { "records":[{ "event_version":"1.0", "smn":{ "topic_urn":"urn:smn:regionId:995960e6a6094fdeb00b7c9991d35791:11-16", "type":"notification", "message":"Hello", "timestamp":"2017-11-27T09:53:41Z", "subject":"test_1127", "message_id":"27d6e9e1249240288b47817bf637192b" }, "event_source":"SMN", "event_subscription_urn":"urn:smn:regionId:995960e6a6094fdeb00b7c9991d35791:11-16:dcd78adcb194431587d4992c374f8465"}] } 表2 字段说明 字段配置项 类型 说明 records JSON对象 消息列表 event_version String 版本 topic_urn String 主题URN type String 消息类型 message String 消息内容 timestamp String 时间戳 subject String 消息标题 message_id String 消息ID event_source String 消息来源 event_subscription_urn String 订阅URN 父主题: 附录
  • 上传校验 调用上传检验接口时,点播服务会根据媒资的MD5值来检查是否已有重复的媒资文件。MD5值的生成方式是取媒资文件的1024字节,并进行MD5计算,示例代码如下所示: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 import java.io.File; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.SeekableByteChannel; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardOpenOption; import org.apache.commons.codec.digest.DigestUtils; public class VodDemoDuplicateCheckMd5 { public static String computeMd5ByFile(String fileUrl) { String md5Content = null; Path targetFile = Paths.get(fileUrl); try (SeekableByteChannel channel = Files.newByteChannel(targetFile, StandardOpenOption.READ)) { ByteBuffer byteBuffer = ByteBuffer.allocate(1025); channel.read(byteBuffer); byteBuffer.flip(); byte[] data = new byte[byteBuffer.limit()]; byteBuffer.get(data); md5Content = DigestUtils.md5Hex(data); } catch (IOException e) { throw new RuntimeException(String.format("Read file %s failed.", fileUrl)); } return md5Content; } }
  • 参考文档 《Scrum精髓》,Kenneth S. Rubin 《用户故事与敏捷方法》,Mike Cohn 2019年中国DevOps行业现状报告:中国信息通信研究院、华为云DevCloud、南京大学联合发布 《用户故事实战》,Mike Cohn 《成为技术领导者》,杰拉尔德·温伯格 《复盘+:把经验转化为能力》,邱昭良 Scrum指南(2017-Scrum-Guide-Chinese-Simplified),2017年11月版 Kenneth S. Rubin. Scrum精髓[M].北京:清华大学出版社 Scrum指南2007版 Mark C. Layton. 敏捷项目管理[M].北京:人民邮电出版社 Should Team Member Sign Up for Tasks During Sprint Planning? Lyssa Adkins. 如何构建敏捷项目管理团队[M].北京:电子工业出版社 父主题: 附录
  • 调用API获取项目ID 项目ID还用通过调用查询指定条件下的项目信息API获取。 获取项目ID的接口为“GET https://{Endpoint}/v3/projects/”,其中{Endpoint}为IAM的终端节点,可以从终端节点获取。接口的认证鉴权请参见认证鉴权。 响应示例如下,其中“projects”下的“id”即为项目ID。 { "projects": [ { "domain_id": "65382450e8f64ac0870cd180d14e684b", "is_domain": false, "parent_id": "65382450e8f64ac0870cd180d14e684b", "name": "xxxxxxxx", "description": "", "links": { "next": null, "previous": null, "self": "https://www.example.com/v3/projects/a4a5d4098fb4474fa22cd05f897d6b99" }, "id": "a4a5d4098fb4474fa22cd05f897d6b99", "enabled": true } ], "links": { "next": null, "previous": null, "self": "https://www.example.com/v3/projects" } }
  • 错误码 当您调用API时,如果遇到“APIGW”开头的错误码,请参见API网关错误码进行处理。 类型 状态码 错误码 错误信息 描述 处理措施 访问方式 500 CAE.01500101 Remote creates access failed. 访问方式创建失败 需要联系技术支持工程师,检查报错具体内容。 500 CAE.01500102 Remote updates access failed. 访问方式更新失败 需要联系技术支持工程师,检查报错具体内容。 500 CAE.01500103 Remote deletes access failed. 访问方式删除失败 需要联系技术支持工程师,检查报错具体内容。 500 CAE.01500104 Delete ip group failed. 删除ip地址组失败 需要联系技术支持工程师,检查依赖服务是否正常。 500 CAE.01500107 ELB service connect failed. 访问ELB连接失败 需要联系技术支持工程师,检查依赖服务是否正常。 组件 500 CAE.01500201 Update component status failed. 更新组件状态失败 重试,组件状态展示正常。若有异常,联系技术支持工程师。 500 CAE.01500202 Execute component action failed. 操作组件失败 联系技术支持工程师,检查组件基本信息。 500 CAE.01500203 Get component config failed. 获取组件配置失败 联系技术支持工程师,一般为报文解析异常 500 CAE.01500204 Get component event failed. 获取组件事件失败 联系技术支持工程师,检查依赖服务是否正常。 400 CAE.01500206 The component name is invalid. 组件名称非法 根据要求修改组件名称。 400 CAE.01500205 The input component name already exists in the application. 当前应用存在同名组件 同一应用不能存在同名组件,根据要求修改组件名称。 400 CAE.01500211 Data type of imported configuration variable is not string. 下发组件配置类型非法 根据要求修改组件配置类型。 400 CAE.01500208 Component not exist. 组件不存在 确认操作组件是否正确,根据要求修改组件ID。 400 CAE.01500207 Component instance is exist. 组件实例有残留 删除组件实例失败,联系技术支持工程师。 应用 400 CAE.01500212 There are components under application, delete operation is forbidden. 当前应用存在组件,禁止删除应用 需删除所有组件才能删除应用。 404 CAE.01500213 App not exist. 应用不存在 确认操作应用是否正确,联系技术支持工程师。 环境 400 CAE.01500303 Engine with basic not found. 环境基础信息未找到 联系技术支持工程师。 500 CAE.01500301 Engine status is unavailable. 环境状态不可用 联系技术支持工程师。 400 CAE.01500311 Engine is already exist. 环境已存在 联系技术支持工程师。 500 CAE.01500302 Create engine failed. 创建环境失败 联系技术支持工程师。 500 CAE.01500401 Create environment failed. 创建环境失败 联系技术支持工程师。 500 CAE.01500402 Delete environment failed. 删除环境失败 联系技术支持工程师。 500 CAE.01500403 Env is deleting. 环境正在被删除 等待环境删除完成。 500 CAE.01500404 Environment not found. 环境不存在 查询环境是否存在。 400 CAE.01500405 The environment has unbound cloud storage resource. 环境存在未绑定的云存储资源 联系技术支持工程师。 400 CAE.01500406 There are applications under environment, delete operation is forbidden. 环境下存在应用,不允许删除环境。 删除应用后再删除环境。 400 CAE.01500407 The environment cannot be deleted because the event notice rule still exists. 环境存在事件通知规则。 删除事件通知规则后重试。 400 CAE.01500408 Environment cannot be deleted, as there are un-deleted network configurations in system settings. 环境下系统设置中存在系统网络配置,不允许删除环境。 删除系统设置下的系统网络配置,再删除环境。 400 CAE.01500409 VPC id is inconsistent with the vpc id of environment. vpc ingress/egress配置的vpc id和环境选择的vpc id不一致。不允许创建系统网络配置。 在CAE概览界面查看环境所在VPC(虚拟私有云),选择一致的VPC再创建系统网络配置。 400 CAE.01500410 VPC ingress can not be deleted, as some components is using vpc access. 系统网络配置下的"VPC访问CAE环境"不允许删除,因为还有组件在使用。 确认组件是否还需要继续使用,如果需要则不允许删除,如果不需要则在组件配置中删除后重试。 400 CAE.01500411 Current environment is too old, can not retry, you can delete the environment and create a new environment. 创建环境时报错:当前环境版本过低,不允许重试。请删除环境后重新创建新环境。 删除环境后重新创建。 500 CAE.01500412 Get embedded cidrs failed. 创建"CAE环境访问VPC"配置,获取内置网段失败。 联系技术支持工程师。 400 CAE.01500413 The environment cannot be deleted because it still has sub environments. 环境不能删除,因为还有其他子环境未删除。 删除子环境后再删除当前环境。 任务 500 CAE.01500501 Retry job failed. 重试任务失败 查看任务状态,任务状态失败或者超时方可重试。 云存储 500 CAE.01500601 Creates volume failed. 创建磁盘挂载失败 联系技术支持工程师。 500 CAE.01500602 Deletes volume failed. 删除磁盘挂载失败 联系技术支持工程师。 400 CAE.01500603 Conflicts with another volume or log path under component. 与同组件下云存储配置路径或日志采集路径冲突。 检查云存储配置路径或日志采集路径,修改冲突路径。 400 CAE.01500604 AK SK is invalid. ak sk无效 刷新页面重试。若仍然有异常,联系技术支持工程师。 配额 400 CAE.01500712 Quota is insufficient. 配额不足 联系技术支持工程师添加配额。 500 CAE.01500701 Increase used failed. 配额使用量增加修改失败 联系技术支持工程师。 500 CAE.01500702 Decrease used failed. 配额使用量减少修改失败 联系技术支持工程师。 500 CAE.01500703 Get quota failed. 获取配额失败 联系技术支持工程师。 委托 500 CAE.01500801 Service domain error, get service token failed. 获取服务token失败 联系技术支持工程师,检查服务依赖服务及配置项。 500 CAE.01500802 Switch token error, check iam service status. 转换token失败 重试,仍然失败则联系技术支持工程师,检查服务依赖服务及配置项。 500 CAE.01500803 Grant agency roles error, check iam service status or iam strategy. 授权失败 联系技术支持工程师,检查服务依赖服务及配置项。 500 CAE.01500804 Create or update agency failed, check if iam is ok. 创建或更新委托时失败 联系技术支持工程师,检查服务依赖服务IAM及相关配置项。 401 CAE.01500805 Get token by agency failed, agency is not exist. 项目里缺少委托或角色 联系技术支持工程师,检查IAM中委托及角色。 401 CAE.01500806 Not a domain user, or no security administrator role. 账号权限不足 检查当前IAM账号权限。 403 CAE.01500807 Roles in the agency for cae not enough, please re-create cae agency. CAE的委托中缺少部分部分服务访问权限 检查CAE相关委托中是否包含所有服务访问权限,可通过删除委托重建解决。 资源租户 500 CAE.01500901 Get resource tenant token failed, check if iam is ok. 获取资源租户token失败 联系技术支持工程师,检查服务依赖服务及配置项。 计费 500 CAE.01501001 List bills error,raw data fails to be aggregated or the charging process is abnormal. 获取账单失败 联系技术支持工程师。 账号冻结 401 CAE.01501101 User is restricted, can not execute create operation. 此账号因余额不足受限,请检查账号状态 账号充值后解冻。 401 CAE.01501102 User is suspended, can not execute any operation, except view. 此账号被冻结,请检查账号状态 联系技术支持工程师。 域名、证书 400 CAE.01501201 The domain has already existed. 域名配置冲突 配置了重复的域名,检查该域名是否已经配置。 500 CAE.01501203 Delete zone failed, check dns service status or component config. 域名正在被组件使用,不能删除 检查已有组件,查看是否有组件正在使用该域名。 500 CAE.01501205 Create tls certificate failed in k8s. 证书创建失败 联系技术支持工程师,检查服务依赖服务及配置项。 500 CAE.01501206 Update tls certificate failed in k8s. 证书更新失败 联系技术支持工程师,检查服务依赖服务及配置项。 500 CAE.01501207 Delete tls certificate failed, check cluster status or component config. 证书删除失败 联系技术支持工程师,检查服务依赖服务及配置项。 400 CAE.01501208 The certificate format is invalid or the certificate private key does not match. 操作证书时请求体错误 检查操作证书的请求体是否与api规则内容一致 资源 404 CAE.01501301 Resource not exist. 请求的资源不存在 确认该资源是否仍然存在 400 CAE.01501302 Resource already exist. 资源已存在。 确认是否已创建过同一资源。 配置 400 CAE.01501401 The component access configuration parameter is not valid, please check your parameter. 访问方式配置有错误,可能的原因有 端口数字超过限制、端口冲突 修改端口至[1,65535]范围,且检查可能涉及的配置(cae的组件占用的端口、所使用的独享型elb的监听器),保证端口占用不冲突。 400 CAE.01501404 The path of access configuration is invalid. 不符合url的正则规则 应在访问方式配置项里填写符合url正则规则的路径。 400 CAE.01501402 The input port will result in port conflict. 所选elb的端口已被占用 使用其他端口,如果使用的是独享型ELB,可检查该端口对应监听器使用情况,删除该监听器后,组件即可正常使用该端口。 400 CAE.01501403 The port of ingress rule conflicts. 七层访问方式策略冲突 修改域名、端口、elb、url中的任意一项,使【域名+监听端口+elb+url】不完全相同。 400 CAE.01501405 There is no monitor system config under environment, please create first. 创建性能管理配置,未配置系统设置-监控系统。 先配置在系统设置-监控系统配置监控系统,再创建组件性能管理配置。 权限 403 CAE.01501700 Not authorized for create. 缺少权限 添加对应权限,联系技术支持工程师。 403 CAE.01501701 Not real name authorized. 认证失败 联系技术支持工程师。 参数 400 CAE.01501800 The project in request url and the user token is not matched. url中project id与当前用户token不匹配 检查url中project id或当前token是否正确。 400 CAE.01501801 The input time should be at least 2 mins later than now. 配置启停规则时间距离当前时间太近 配置距离当前时间超过2分钟的启停规则执行时间。 400 CAE.01501802 Timer rule conflicts with scaling rule. 启停规则与生效范围内组件弹性伸缩策略冲突。 解决同一组件启停规则与弹性伸缩策略冲突,关闭其中一个。 400 CAE.01501803 Scaling rule conflicts with timer rule. 组件弹性策略与作用于该组件的启停策略冲突。 解决同一组件启停规则与弹性伸缩策略冲突,关闭其中一个。 400 CAE.01501804 Scaling rule unique param duplicate. 伸缩策略中时间配置冲突 检查伸缩策略中配置的时间策略。 400 CAE.01501805 VPC cidr conflict with embedded cidrs. vpc网段与CAE环境内置网段冲突 联系技术支持工程师。 400 CAE.01501806 Monitor system agent version is invalid. 监控系统探针版本无效 填写有效的监控系统探针版本。 400 CAE.01500108 Cannot modify health check protocol, please switch off first. 修改访问方式-健康检查协议失败 先关闭访问方式-健康检查后配置需切换的健康检查协议。 事件通知 400 CAE.01501901 The maximum number of noticeRules is 50. 事件通知规则上限50条 联系技术支持工程师。 403 CAE.01501902 Your account does not have the SMN permission. 账号无SMN权限 联系账号管理员配置权限。 DEW凭据 400 CAE.01502000 The maximum number of DEW secrets is 20. DEW凭据上线20条 联系技术支持工程师。 400 CAE.01502001 There are components using the secret. 有组件正在使用此凭据 请取消组件的相应的配置后重试。 403 CAE.01502002 You do not have permissions to get secret info, please check your current agency roles. 当前没有权限获取DEW凭据信息,请检查您当前账号下的权限 请增加DEW服务相应权限后再次重试。 集群 500 CAE.01502101 The cluster cannot be operated in the current state. CAE底层集群无法操作 联系技术支持工程师。 父主题: 附录
  • SQL20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 select i_item_id ,i_item_desc ,i_category ,i_class ,i_current_price ,sum(cs_ext_sales_price) as itemrevenue ,sum(cs_ext_sales_price)*100/sum(sum(cs_ext_sales_price)) over (partition by i_class) as revenueratio from catalog_sales ,item ,date_dim where cs_item_sk = i_item_sk and i_category in ('Sports', 'Shoes', 'Women') and cs_sold_date_sk = d_date_sk and d_date between cast('2001-03-21' as date) and (cast('2001-03-21' as date) + 30) group by i_item_id ,i_item_desc ,i_category ,i_class ,i_current_price order by i_category ,i_class ,i_item_id ,i_item_desc ,revenueratio limit 100;
  • SQL18 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 select i_item_id, ca_country, ca_state, ca_county, avg( cast(cs_quantity as decimal(12,2))) agg1, avg( cast(cs_list_price as decimal(12,2))) agg2, avg( cast(cs_coupon_amt as decimal(12,2))) agg3, avg( cast(cs_sales_price as decimal(12,2))) agg4, avg( cast(cs_net_profit as decimal(12,2))) agg5, avg( cast(c_birth_year as decimal(12,2))) agg6, avg( cast(cd1.cd_dep_count as decimal(12,2))) agg7 from catalog_sales, customer_demographics cd1, customer_demographics cd2, customer, customer_address, date_dim, item where cs_sold_date_sk = d_date_sk and cs_item_sk = i_item_sk and cs_bill_cdemo_sk = cd1.cd_demo_sk and cs_bill_customer_sk = c_customer_sk and cd1.cd_gender = 'M' and cd1.cd_education_status = 'Primary' and c_current_cdemo_sk = cd2.cd_demo_sk and c_current_addr_sk = ca_address_sk and c_birth_month in (10,1,8,7,3,5) and d_year = 1998 and ca_state in ('NE','OK','NC' ,'CO','ID','AR','MO') group by rollup (i_item_id, ca_country, ca_state, ca_county) order by ca_country, ca_state, ca_county, i_item_id limit 100;
  • SQL13 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 select avg(ss_quantity) ,avg(ss_ext_sales_price) ,avg(ss_ext_wholesale_cost) ,sum(ss_ext_wholesale_cost) from store_sales ,store ,customer_demographics ,household_demographics ,customer_address ,date_dim where s_store_sk = ss_store_sk and ss_sold_date_sk = d_date_sk and d_year = 2001 and((ss_hdemo_sk=hd_demo_sk and cd_demo_sk = ss_cdemo_sk and cd_marital_status = 'U' and cd_education_status = '4 yr Degree' and ss_sales_price between 100.00 and 150.00 and hd_dep_count = 3 )or (ss_hdemo_sk=hd_demo_sk and cd_demo_sk = ss_cdemo_sk and cd_marital_status = 'D' and cd_education_status = '2 yr Degree' and ss_sales_price between 50.00 and 100.00 and hd_dep_count = 1 ) or (ss_hdemo_sk=hd_demo_sk and cd_demo_sk = ss_cdemo_sk and cd_marital_status = 'S' and cd_education_status = 'Advanced Degree' and ss_sales_price between 150.00 and 200.00 and hd_dep_count = 1 )) and((ss_addr_sk = ca_address_sk and ca_country = 'United States' and ca_state in ('IL', 'WI', 'TN') and ss_net_profit between 100 and 200 ) or (ss_addr_sk = ca_address_sk and ca_country = 'United States' and ca_state in ('MO', 'OK', 'WA') and ss_net_profit between 150 and 300 ) or (ss_addr_sk = ca_address_sk and ca_country = 'United States' and ca_state in ('NE', 'VA', 'GA') and ss_net_profit between 50 and 250 )) ;
  • SQL17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 select i_item_id ,i_item_desc ,s_state ,count(ss_quantity) as store_sales_quantitycount ,avg(ss_quantity) as store_sales_quantityave ,stddev_samp(ss_quantity) as store_sales_quantitystdev ,stddev_samp(ss_quantity)/avg(ss_quantity) as store_sales_quantitycov ,count(sr_return_quantity) as store_returns_quantitycount ,avg(sr_return_quantity) as store_returns_quantityave ,stddev_samp(sr_return_quantity) as store_returns_quantitystdev ,stddev_samp(sr_return_quantity)/avg(sr_return_quantity) as store_returns_quantitycov ,count(cs_quantity) as catalog_sales_quantitycount ,avg(cs_quantity) as catalog_sales_quantityave ,stddev_samp(cs_quantity) as catalog_sales_quantitystdev ,stddev_samp(cs_quantity)/avg(cs_quantity) as catalog_sales_quantitycov from store_sales ,store_returns ,catalog_sales ,date_dim d1 ,date_dim d2 ,date_dim d3 ,store ,item where d1.d_quarter_name = '2000Q1' and d1.d_date_sk = ss_sold_date_sk and i_item_sk = ss_item_sk and s_store_sk = ss_store_sk and ss_customer_sk = sr_customer_sk and ss_item_sk = sr_item_sk and ss_ticket_number = sr_ticket_number and sr_returned_date_sk = d2.d_date_sk and d2.d_quarter_name in ('2000Q1','2000Q2','2000Q3') and sr_customer_sk = cs_bill_customer_sk and sr_item_sk = cs_item_sk and cs_sold_date_sk = d3.d_date_sk and d3.d_quarter_name in ('2000Q1','2000Q2','2000Q3') group by i_item_id ,i_item_desc ,s_state order by i_item_id ,i_item_desc ,s_state limit 100;
  • SQL10 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 select cd_gender, cd_marital_status, cd_education_status, count(*) cnt1, cd_purchase_estimate, count(*) cnt2, cd_credit_rating, count(*) cnt3, cd_dep_count, count(*) cnt4, cd_dep_employed_count, count(*) cnt5, cd_dep_college_count, count(*) cnt6 from customer c,customer_address ca,customer_demographics where c.c_current_addr_sk = ca.ca_address_sk and ca_county in ('Clark County','Richardson County','Tom Green County','Sullivan County','Cass County') and cd_demo_sk = c.c_current_cdemo_sk and exists (select * from store_sales,date_dim where c.c_customer_sk = ss_customer_sk and ss_sold_date_sk = d_date_sk and d_year = 2000 and d_moy between 1 and 1+3) and (exists (select * from web_sales,date_dim where c.c_customer_sk = ws_bill_customer_sk and ws_sold_date_sk = d_date_sk and d_year = 2000 and d_moy between 1 ANd 1+3) or exists (select * from catalog_sales,date_dim where c.c_customer_sk = cs_ship_customer_sk and cs_sold_date_sk = d_date_sk and d_year = 2000 and d_moy between 1 and 1+3)) group by cd_gender, cd_marital_status, cd_education_status, cd_purchase_estimate, cd_credit_rating, cd_dep_count, cd_dep_employed_count, cd_dep_college_count order by cd_gender, cd_marital_status, cd_education_status, cd_purchase_estimate, cd_credit_rating, cd_dep_count, cd_dep_employed_count, cd_dep_college_count limit 100;
  • SQL12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 select i_item_id ,i_item_desc ,i_category ,i_class ,i_current_price ,sum(ws_ext_sales_price) as itemrevenue ,sum(ws_ext_sales_price)*100/sum(sum(ws_ext_sales_price)) over (partition by i_class) as revenueratio from web_sales ,item ,date_dim where ws_item_sk = i_item_sk and i_category in ('Music', 'Shoes', 'Children') and ws_sold_date_sk = d_date_sk and d_date between cast('2000-05-14' as date) and (cast('2000-05-14' as date) + 30 ) group by i_item_id ,i_item_desc ,i_category ,i_class ,i_current_price order by i_category ,i_class ,i_item_id ,i_item_desc ,revenueratio limit 100;
  • SQL7 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 select i_item_id, avg(ss_quantity) agg1, avg(ss_list_price) agg2, avg(ss_coupon_amt) agg3, avg(ss_sales_price) agg4 from store_sales, customer_demographics, date_dim, item, promotion where ss_sold_date_sk = d_date_sk and ss_item_sk = i_item_sk and ss_cdemo_sk = cd_demo_sk and ss_promo_sk = p_promo_sk and cd_gender = 'M' and cd_marital_status = 'U' and cd_education_status = 'College' and (p_channel_email = 'N' or p_channel_event = 'N') and d_year = 1999 group by i_item_id order by i_item_id limit 100;
  • SQL5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 with ssr as (select s_store_id, sum(sales_price) as sales, sum(profit) as profit, sum(return_amt) as returns, sum(net_loss) as profit_loss from ( select ss_store_sk as store_sk, ss_sold_date_sk as date_sk, ss_ext_sales_price as sales_price, ss_net_profit as profit, cast(0 as decimal(7,2)) as return_amt, cast(0 as decimal(7,2)) as net_loss from store_sales union all select sr_store_sk as store_sk, sr_returned_date_sk as date_sk, cast(0 as decimal(7,2)) as sales_price, cast(0 as decimal(7,2)) as profit, sr_return_amt as return_amt, sr_net_loss as net_loss from store_returns ) salesreturns, date_dim, store where date_sk = d_date_sk and d_date between cast('2002-08-05' as date) and (cast('2002-08-05' as date) + 14 ) and store_sk = s_store_sk group by s_store_id) , csr as (select cp_catalog_page_id, sum(sales_price) as sales, sum(profit) as profit, sum(return_amt) as returns, sum(net_loss) as profit_loss from ( select cs_catalog_page_sk as page_sk, cs_sold_date_sk as date_sk, cs_ext_sales_price as sales_price, cs_net_profit as profit, cast(0 as decimal(7,2)) as return_amt, cast(0 as decimal(7,2)) as net_loss from catalog_sales union all select cr_catalog_page_sk as page_sk, cr_returned_date_sk as date_sk, cast(0 as decimal(7,2)) as sales_price, cast(0 as decimal(7,2)) as profit, cr_return_amount as return_amt, cr_net_loss as net_loss from catalog_returns ) salesreturns, date_dim, catalog_page where date_sk = d_date_sk and d_date between cast('2002-08-05' as date) and (cast('2002-08-05' as date) + 14 ) and page_sk = cp_catalog_page_sk group by cp_catalog_page_id) , wsr as (select web_site_id, sum(sales_price) as sales, sum(profit) as profit, sum(return_amt) as returns, sum(net_loss) as profit_loss from ( select ws_web_site_sk as wsr_web_site_sk, ws_sold_date_sk as date_sk, ws_ext_sales_price as sales_price, ws_net_profit as profit, cast(0 as decimal(7,2)) as return_amt, cast(0 as decimal(7,2)) as net_loss from web_sales union all select ws_web_site_sk as wsr_web_site_sk, wr_returned_date_sk as date_sk, cast(0 as decimal(7,2)) as sales_price, cast(0 as decimal(7,2)) as profit, wr_return_amt as return_amt, wr_net_loss as net_loss from web_returns left outer join web_sales on ( wr_item_sk = ws_item_sk and wr_order_number = ws_order_number) ) salesreturns, date_dim, web_site where date_sk = d_date_sk and d_date between cast('2002-08-05' as date) and (cast('2002-08-05' as date) + 14 ) and wsr_web_site_sk = web_site_sk group by web_site_id) select channel , id , sum(sales) as sales , sum(returns) as returns , sum(profit) as profit from (select 'store channel' as channel , 'store' || s_store_id as id , sales , returns , (profit - profit_loss) as profit from ssr union all select 'catalog channel' as channel , 'catalog_page' || cp_catalog_page_id as id , sales , returns , (profit - profit_loss) as profit from csr union all select 'web channel' as channel , 'web_site' || web_site_id as id , sales , returns , (profit - profit_loss) as profit from wsr ) x group by rollup (channel, id) order by channel ,id limit 100;