分析 CLI

如何使用工具箱 CLI 访问分析数据。

关于本任务

工具包 CLI 提供用于查看分析数据的命令。 要查看组织范围内的事件数据,请使用提供方组织的用户凭据登录工具包 CLI

过程

  1. 安装工具包设置 API Connect 工具包
  2. 使用 CLI 登录。
    例如:
    apic login --server platform-api-host-name --sso
    其中 <platform-api-host-name> 是托管 API 管理器("管理服务器")的服务器的主机名部分 URL。 要确定主机名,请在浏览器中打开 API 管理器,然后在地址栏中复制 URL 中的主机名(从 " https:// "之后开始,到"/manager "之前结束),如下例所示:
    https://platform-api.us-east-1.d-r01.apic.cloud.ibm.com/manager
    
    工具箱提示输入上下文时,输入 provider 并按 Enter 键:
    Context? provider
    有关工具包 CLI 的更多信息,请参阅设置 API Connect 工具包
  3. 使用 -m analytics -h 查看可用的工具包分析命令。
  4. 使用 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: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.
    
    注: 提及 "云 "的命令不适用于 API Connect Enterprise as a Service。