coolelephant/aliyun-tsdbapi

阿里云时序数据库HTTP请求接口, 阿里云TSDB云API, 阿里云TSDB HTTP请求API

v1.6.2 2020-08-11 06:40 UTC

This package is auto-updated.

Last update: 2024-09-11 15:49:20 UTC


README

阿里云时序数据库HTTP请求API接口封装,由于公司项目急需使用,暂时以可用性为主,后期会不断完善更新(仍在调试中,请勿使用)

安装方法

composer require coolelephant/aliyun-tsdbapi

使用方法

本方法支持命名空间,如您的项目支持自动加载,直接实例化即可

$aliyunCloud = new \CoolElephant\AliCloudTSDB\AliCloudTSDB('username','password','ts-xxx.hitsdb.rds.aliyuncs.com:8242');
$response = $aliyunCloud->method('POST')->api('/api/suggest')->param(['type'=>'metrics'])->request();

如您的项目不支持自动加载,则需要在此基础上引入

require_once('../vendor/autoload.php');

返回结果已进行处理,以数组形式输出

[
    'resultcode'        =>  0,
    'resultdesc'        =>  'Success',
    'subscriptionId'    =>  'f36934ad-74b3-4666-85bc-05f0fbcb46f5',
    'relationNum'       =>  '+8616558940111',
    'callDirection'     =>  0,
    'duration'          =>  120,
    'maxDuration'       =>  1
];

具体返回值请查看官方接口

点击查看官方文档