犀思云LOGO

API文档

更新时间:2025-10-27 10:00:00

公共

签名方法

1.安全凭证

SecretId:标识 API 调用者身份

SecretKey:加密签名字符串和服务器端验证签名字符串的密钥。用户应严格保管其SecretKey,避免泄露。

2.对参数排序

首先对所有请求参数按参数名做字典序升序排列(不区分大小写),所谓字典序升序排列,直观上就如同在字典中排列单词一样排序,按照字母表或数字表里递增顺序的排列次序,即先考虑第一个"字母",在相同的情况下考虑第二个"字母",依此类推。相同参数名,再按参数值排序。上述示例参数的排序结果如下:

以延伸监控参数为例
原始参数:不含Signature参数
Action=GetCxpMonitorInfo
&Nonce=59480
&SecretId=xxxx
&SignatureMethod=HmacMD5
&Timestamp=1560325242914
&monitorType=endpoint_losrtt
&resourceUuid=xxxx
&start=1683611383
&end=1683614983

排序后:
Action=GetCxpMonitorInfo
&end=1683614983
&monitorType=endpoint_losrtt
&Nonce=59480
&resourceUuid=xxxx
&SecretId=xxxx
&SignatureMethod=HmacMD5
&start=1683611383
&Timestamp=1560325242914

3. 生成签名串

首先使用 HmacMD5 算法对上一步中获得的签名原文字符串进行签,然后将生成的签名串使用 Base64 进行编码,即可获得最终的签名串。

public class HMAC {
    private final static String KEY_MAC_DEFAULT = "HmacMD5";
    private static final Charset UTF8_CHARSET = Charset.forName("UTF-8");

    public HMAC() {
    }

    public static String encryptBase64(String key) {
        return Base64.getEncoder().encodeToString(encodeUTF8(key));
    }

    public static byte[] encryptHMAC(byte[] data, String key, String algorithm) {
        SecretKey secretKey;
        byte[] bytes = null;
        try {
            byte[] srcBytes = encodeUTF8(key);
            secretKey = new SecretKeySpec(srcBytes, algorithm);
            Mac mac = Mac.getInstance(secretKey.getAlgorithm());
            mac.init(secretKey);
            bytes = mac.doFinal(data);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return bytes;
    }

    public static String encryptHMACString(String data, String key, String algorithm) {
        if (data == null || data.length() == 0) {
            return null;
        }
        byte[] bytes = encryptHMAC(data.getBytes(), key, algorithm);
        return byte2hex(bytes);
    }

    private static byte[] encodeUTF8(String string) {
        return string.getBytes(UTF8_CHARSET);
    }

    private static String byte2hex(final byte[] b) {
        StringBuilder hs = new StringBuilder();
        for (int n = 0; n < b.length; n++) {
            String stmp = Integer.toHexString(b[n] & 0xFF);
            if (stmp.length() == 1) {
                hs.append("0");
            }
            hs.append(stmp);
        }
        return hs.toString();
    }

    public static void main(String[] args){

        String secretKey = "MmX4b8ySs5wHrFPTKeFYfUOHB";
        String srcStr = "Action=GetCxpMonitorInfo&end=1683614983&monitorType=endpoint_losrtt&Nonce=59480&resourceUuid=xxxx&SecretId=xxxx&SignatureMethod=HmacMD5&start=1683611383&Timestamp=1560325242914";

        String hmac = HMAC.encryptHMACString(srcStr, secretKey, "HmacMD5");
        String Signature = HMAC.encryptBase64(hmac);
    }
}

4. 加上签名串生成URL

https://api.syscxp.com/monitor-query/v1?
Action=GetCxpMonitorInfo
&end=1683614983
&monitorType=endpoint_losrtt
&Nonce=59480
&resourceUuid=xxxx
&SecretId=xxxx
&SignatureMethod=HmacMD5
&start=1683611383
&Timestamp=1560325242914
&Signature=MDc3ZmNlMDAwZmE2ZTJkZTJlZGZmOTUwNWZiZjM0M2I=

云专线/云网络

延伸监控

GET请求,URL格式如下

https://api.syscxp.com/monitor-query/v1?
Action=GetCxpMonitorInfo
&Nonce=59480
&SecretId=xxxx
&SignatureMethod=HmacMD5
&Timestamp=1560325242914
&monitorType=endpoint_losrtt
&resourceUuid=xxxx
&start=1683611383
&end=1683614983
&Signature=MDc3ZmNlMDAwZmE2ZTJkZTJlZGZmOTUwNWZiZjM0M2I=

请求参数说明

参数名称类型必选描述
Actionstring接口名称,这里是固定值:GetCxpMonitorInfo
NonceUInt随机正整数
SecretIdstring标识 API 调用者身份
SignatureMethodstring签名方式,这里是固定值:HmacMD5
Signaturestring生成的签名串, 签名方式详见【公共-签名方法.md】
Timestamplong当前UNIX时间戳,单位毫秒,签名后的API有效时间10分钟
monitorTypestring监控类型, 这里是固定值:endpoint_losrtt
resourceUuidstring延伸监控uuid
startlong监控数据开始时间UNIX时间戳,单位秒
endlong监控数据结束时间UNIX时间戳,单位秒

成功返回结果示例

{
  "result": "{\"monitorResult\":{\"metrics\":[\"ext_rtt\",\"ext_lost\"],\"dps\":[[1708914924,25,0],[1708914955,25,0],[1708914986,25,0]]}}",
  "code": "OK",
  "message": "success"
}
返回结果 monitorResult 说明

1. metrics 为监控指标,ext_rtt:延时(单位:ms) ext_lost:丢包(单位:%)。

2. dps 为监控数据,按时间排序,元素第一列为时间(时间戳 秒),从第二项开始按 metrics 的元素顺序一一对应。

失败返回结果示例

{
  "code": "1001",
  "message": "Signature校验失败"
}

云网络丢包

GET请求,URL格式如下

https://api.syscxp.com/monitor-query/v1?
Action=GetCxpMonitorInfo
&Nonce=59480
&SecretId=xxxx
&SignatureMethod=HmacMD5
&Timestamp=1560325242914
&monitorType=l3network_losrtt
&resourceUuid=xxxx
&endpointUuid=xxxx
&dstEndpointUuid=xxxx
&start=1708916387
&end=1708919987
&Signature=MDc3ZmNlMDAwZmE2ZTJkZTJlZGZmOTUwNWZiZjM0M2I=

请求参数说明

参数名称类型必选描述
Actionstring接口名称,这里是固定值:GetCxpMonitorInfo
NonceUInt随机正整数
SecretIdstring标识 API 调用者身份
SignatureMethodstring签名方式,这里是固定值:HmacMD5
Signaturestring生成的签名串, 签名方式详见【公共-签名方法.md】
Timestamplong当前UNIX时间戳,单位毫秒,签名后的API有效时间10分钟
monitorTypestring监控类型, 这里是固定值:l3network_losrtt
resourceUuidstring云网络uuid
endpointUuidstring云网络站点uuid
dstEndpointUuidstring云网络对端站点uuid
startlong监控数据开始时间UNIX时间戳,单位秒
endlong监控数据结束时间UNIX时间戳,单位秒

成功返回结果示例

{
  "result":  "{\"monitorResult\":{\"metrics\":[\"vpn_lost\",\"vpn_rtt\"],\"dps\":[[1708919899,100,0],[1708919931,100,0],[1708919963,100,0]]}}",
  "code":  "OK",
  "message":  "success"
}
返回结果 monitorResult 说明

1. metrics 为监控指标,vpn_rtt:延时(单位:ms) vpn_lost:丢包(单位:%)。

2. dps 为监控数据,按时间排序,元素第一列为时间(时间戳 秒),从第二项开始按 metrics 的元素顺序一一对应。

失败返回结果示例

{
  "code": "1001",
  "message": "Signature校验失败"
}

云网络流量

GET请求,URL格式如下

https://api.syscxp.com/monitor-query/v1?
Action=GetCxpMonitorInfo
&Nonce=59480
&SecretId=xxxx
&SignatureMethod=HmacMD5
&Timestamp=1560325242914
&monitorType=l3network_traffic
&resourceUuid=xxxx
&endpointUuid=xxxx
&start=1708916387
&end=1708919987
&Signature=MDc3ZmNlMDAwZmE2ZTJkZTJlZGZmOTUwNWZiZjM0M2I=

请求参数说明

参数名称类型必选描述
Actionstring接口名称,这里是固定值:GetCxpMonitorInfo
NonceUInt随机正整数
SecretIdstring标识 API 调用者身份
SignatureMethodstring签名方式,这里是固定值:HmacMD5
Signaturestring生成的签名串, 签名方式详见【公共-签名方法.md】
Timestamplong当前UNIX时间戳,单位毫秒,签名后的API有效时间10分钟
monitorTypestring监控类型, 这里是固定值:l3network_traffic
resourceUuidstring云网络uuid
endpointUuidstring云网络站点uuid
startlong监控数据开始时间UNIX时间戳,单位秒
endlong监控数据结束时间UNIX时间戳,单位秒

成功返回结果示例

{
  "result":  "{\"monitorResult\":{\"metrics\":[\"in_rate\",\"out_rate\"],\"dps\":[[1708919917,30245,27446],[1708919947,30245,27588],[1708919977,30104,27842]]}}",
  "code":  "OK",
  "message":  "success"
}
返回结果 monitorResult 说明

1. metrics 为监控指标,in_rate:下行速率(单位:bps) out_rate:上行速率(单位:bps)。

2. dps 为监控数据,按时间排序,元素第一列为时间(时间戳 秒),从第二项开始按 metrics 的元素顺序一一对应。

失败返回结果示例

{
  "code": "1001",
  "message": "Signature校验失败"
}

云专线丢包

GET请求,URL格式如下

https://api.syscxp.com/monitor-query/v1?
Action=GetCxpMonitorInfo
&Nonce=59480
&SecretId=xxxx
&SignatureMethod=HmacMD5
&Timestamp=1560325242914
&monitorType=tunnel_losrtt
&resourceUuid=xxxx
&endpointUuid=xxxx
&start=1708916387
&end=1708919987
&Signature=MDc3ZmNlMDAwZmE2ZTJkZTJlZGZmOTUwNWZiZjM0M2I=

请求参数说明

参数名称类型必选描述
Actionstring接口名称,这里是固定值:GetCxpMonitorInfo
NonceUInt随机正整数
SecretIdstring标识 API 调用者身份
SignatureMethodstring签名方式,这里是固定值:HmacMD5
Signaturestring生成的签名串, 签名方式详见【公共-签名方法.md】
Timestamplong当前UNIX时间戳,单位毫秒,签名后的API有效时间10分钟
monitorTypestring监控类型, 这里是固定值:tunnel_losrtt
resourceUuidstring云专线uuid
endpointUuidstring云专线一端连接点uuid
startlong监控数据开始时间UNIX时间戳,单位秒
endlong监控数据结束时间UNIX时间戳,单位秒

成功返回结果示例

{
  "result":  "{\"monitorResult\":{\"metrics\":[\"vsi_lost\",\"vsi_rtt\"],\"dps\":[[1708919898,0,2],[1708919929,0,2],[1708919959,0,2]]}}",
  "code":  "OK",
  "message":  "success"
}
返回结果 monitorResult 说明

1. metrics 为监控指标,vsi_rtt:延时(单位:ms) vsi_lost:丢包(单位:%)。

2. dps 为监控数据,按时间排序,元素第一列为时间(时间戳 秒),从第二项开始按 metrics 的元素顺序一一对应。

失败返回结果示例

{
  "code": "1001",
  "message": "Signature校验失败"
}

云专线流量

GET请求,URL格式如下

https://api.syscxp.com/monitor-query/v1?
Action=GetCxpMonitorInfo
&Nonce=59480
&SecretId=xxxx
&SignatureMethod=HmacMD5
&Timestamp=1560325242914
&monitorType=tunnel_traffic
&resourceUuid=xxxx
&endpointUuid=xxxx
&start=1708916387
&end=1708919987
&Signature=MDc3ZmNlMDAwZmE2ZTJkZTJlZGZmOTUwNWZiZjM0M2I=

请求参数说明

参数名称类型必选描述
Actionstring接口名称,这里是固定值:GetCxpMonitorInfo
NonceUInt随机正整数
SecretIdstring标识 API 调用者身份
SignatureMethodstring签名方式,这里是固定值:HmacMD5
Signaturestring生成的签名串, 签名方式详见【公共-签名方法.md】
Timestamplong当前UNIX时间戳,单位毫秒,签名后的API有效时间10分钟
monitorTypestring监控类型, 这里是固定值:tunnel_traffic
resourceUuidstring云专线uuid
endpointUuidstring云专线一端连接点uuid
startlong监控数据开始时间UNIX时间戳,单位秒
endlong监控数据结束时间UNIX时间戳,单位秒

成功返回结果示例

{
  "result":  "{\"monitorResult\":{\"metrics\":[\"in_rate\",\"out_rate\"],\"dps\":[[1708919908,5632,5632],[1708919938,5449,5394],[1708919968,5444,5529]]}}",
  "code":  "OK",
  "message":  "success"
}
返回结果 monitorResult 说明

1. metrics 为监控指标,in_rate:下行速率(单位:bps) out_rate:上行速率(单位:bps)。

2. dps 为监控数据,按时间排序,元素第一列为时间(时间戳 秒),从第二项开始按 metrics 的元素顺序一一对应。

失败返回结果示例

{
  "code": "1001",
  "message": "Signature校验失败"
}

HybridWAN

CPE链路丢包

GET请求,URL格式如下

https://api.syscxp.com/monitor-query/v1?
Action=GetHybridwanMonitorInfo
&Nonce=59480
&SecretId=xxxx
&SignatureMethod=HmacMD5
&Timestamp=1560325242914
&monitorType=cpe_link_losrtt
&esn=xxxx
&linkID=xxxx
&start=1708916387
&end=1708919987
&Signature=MDc3ZmNlMDAwZmE2ZTJkZTJlZGZmOTUwNWZiZjM0M2I=

请求参数说明

参数名称类型必选描述
Actionstring接口名称,这里是固定值:GetHybridwanMonitorInfo
NonceUInt随机正整数
SecretIdstring标识 API 调用者身份
SignatureMethodstring签名方式,这里是固定值:HmacMD5
Signaturestring生成的签名串, 签名方式详见【公共-签名方法.md】
Timestamplong当前UNIX时间戳,单位毫秒,签名后的API有效时间10分钟
monitorTypestring监控类型, 这里是固定值:cpe_link_losrtt
esnstringCPE ESN号
linkIDlongCPE链路序号
startlong监控数据开始时间UNIX时间戳,单位秒
endlong监控数据结束时间UNIX时间戳,单位秒

成功返回结果示例

{
  "result": "{\"monitorResult\":{\"metrics\":[\"loss\",\"rtt\"],\"dps\":[[1708919901,0,2],[1708919931,0,2],[1708919961,0,2]]}}",
  "code": "OK",
  "message": "success"
}
返回结果 monitorResult 说明

1. metrics 为监控指标,rtt:延时(单位:ms) loss:丢包(单位:%)。

2. dps 为监控数据,按时间排序,元素第一列为时间(时间戳 秒),从第二项开始按 metrics 的元素顺序一一对应。

失败返回结果示例

{
  "code": "1001",
  "message": "Signature校验失败"
}

CPE链路流量

GET请求,URL格式如下

https://api.syscxp.com/monitor-query/v1?
Action=GetHybridwanMonitorInfo
&Nonce=59480
&SecretId=xxxx
&SignatureMethod=HmacMD5
&Timestamp=1560325242914
&monitorType=cpe_link_traffic
&esn=xxxx
&linkID=xxxx
&start=1708916387
&end=1708919987
&Signature=MDc3ZmNlMDAwZmE2ZTJkZTJlZGZmOTUwNWZiZjM0M2I=

请求参数说明

参数名称类型必选描述
Actionstring接口名称,这里是固定值:GetHybridwanMonitorInfo
NonceUInt随机正整数
SecretIdstring标识 API 调用者身份
SignatureMethodstring签名方式,这里是固定值:HmacMD5
Signaturestring生成的签名串, 签名方式详见【公共-签名方法.md】
Timestamplong当前UNIX时间戳,单位毫秒,签名后的API有效时间10分钟
monitorTypestring监控类型, 这里是固定值:cpe_link_traffic
esnstringCPE ESN号
linkIDlongCPE链路序号
startlong监控数据开始时间UNIX时间戳,单位秒
endlong监控数据结束时间UNIX时间戳,单位秒

成功返回结果示例

{
  "result":  "{\"monitorResult\":{\"metrics\":[\"in_rate\",\"out_rate\"],\"dps\":[[1708919900,2952,2973],[1708919930,3053,3056],[1708919960,46237,17740]]}}",
  "code":  "OK",
  "message":  "success"
}
返回结果 monitorResult 说明

1. metrics 为监控指标,in_rate:下行速率(单位:bps) out_rate:上行速率(单位:bps)。

2. dps 为监控数据,按时间排序,元素第一列为时间(时间戳 秒),从第二项开始按 metrics 的元素顺序一一对应。

失败返回结果示例

{
  "code": "1001",
  "message": "Signature校验失败"
}

产品顾问

售前咨询

售前咨询,定制化解决方案