分析 CLI
如何使用工具箱 CLI 访问分析数据。
关于此任务
过程
- 安装工具包设置API Connect工具包
- 使用 CLI 登录。例如:
其中:apic login --server <platform api endpoint> --username <username> --realm <realm><platform api endpoint>是平台 API 端点的 FQDN 或基本 URL ,例如:platform.example.com或https://platform.example.com<username>是提供者组织所有者。 要访问云范围内的数据,请以管理用户身份登录。<realm>是指定<username>的用户注册表域。 缺省情况下,提供者组织所有者的域为provider/default-idp-2。 云管理用户的域为admin/default-idp-1。
- 使用
-m analytics -h查看可用的工具箱分析命令。示例:apic -m analytics -h... Available Commands: Creating applications and artifacts config Manage configuration variables Publishing to the cloud clustermgmt Clustermgmt operations dashboards Dashboards operations events Events operations filterparams Filterparams operations Other commands licenses Review the license for API Connect validate Validate an API or product definition version Get the API Connect toolkit version ... - 使用
events命令查看分析事件:apic -m analytics events -h Type "apic [command] --help" for help on the following related commands: events:catalogCount Count events at catalog scope. events:catalogGet Get specific event at catalog scope. events:catalogList List events at catalog scope. events:cloudCount Count events at cloud scope. events:cloudGet Get specific event at cloud scope. events:cloudList List events at cloud scope. events:orgCount Count events at organization scope. events:orgGet Get specific event at organization scope. events:orgList List events at organization scope. events:spaceCount Count events at space scope. events:spaceGet Get specific event at space scope. events:spaceList List events at space scope. # To get a count of all API events at cloud level: apic -m analytics events:cloudCount --analytics-service <analytics service name> --server <management server api endpoint> --format=json { "total": 200 } # To get all the cloud level events: apic -m analytics events:cloudList --analytics-service <analytics service name> --server <management server api endpoint> --format=json { "total": 200, "search_time": 7, "events": [ { "log_policy": "activity", ...