diff --git "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\345\205\254\345\205\261\345\217\202\346\225\260.md" "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\345\205\254\345\205\261\345\217\202\346\225\260.md" index 22f19a1534c..e7c8117baf6 100644 --- "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\345\205\254\345\205\261\345\217\202\346\225\260.md" +++ "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\345\205\254\345\205\261\345\217\202\346\225\260.md" @@ -20,7 +20,7 @@ HTTP GET 请求结构示例: ``` https://cvm.tencentcloudapi.com/?Limit=10&Offset=0 -Authorization: TC3-HMAC-SHA256 Credential=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE/2018-10-09/cvm/tc3_request, SignedHeaders=content-type;host, Signature=5da7a33f6993f0614b047e5df4582db9e9bf4672ba50567dba16c6ccf174c474 +Authorization: TC3-HMAC-SHA256 Credential=AKID**********************0123456789EXAMPLE/2018-10-09/cvm/tc3_request, SignedHeaders=content-type;host, Signature=5da7a33f6993f0614b047e5df4582db9e9bf4672ba50567dba16c6ccf174c474 Content-Type: application/x-www-form-urlencoded Host: cvm.tencentcloudapi.com X-TC-Action: DescribeInstances diff --git "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\345\205\254\345\205\261\345\217\202\346\225\260_intl_jp.md" "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\345\205\254\345\205\261\345\217\202\346\225\260_intl_jp.md" index 1ae511e4e7c..6e174247218 100644 --- "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\345\205\254\345\205\261\345\217\202\346\225\260_intl_jp.md" +++ "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\345\205\254\345\205\261\345\217\202\346\225\260_intl_jp.md" @@ -20,7 +20,7 @@ HTTP GETリクエスト構造例: ``` https://cvm.tencentcloudapi.com/?Limit=10&Offset=0 -Authorization: TC3-HMAC-SHA256 Credential=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE/2018-10-09/cvm/tc3_request, SignedHeaders=content-type;host, Signature=5da7a33f6993f0614b047e5df4582db9e9bf4672ba50567dba16c6ccf174c474 +Authorization: TC3-HMAC-SHA256 Credential=AKID**********************0123456789EXAMPLE/2018-10-09/cvm/tc3_request, SignedHeaders=content-type;host, Signature=5da7a33f6993f0614b047e5df4582db9e9bf4672ba50567dba16c6ccf174c474 Content-Type: application/x-www-form-urlencoded Host: cvm.tencentcloudapi.com X-TC-Action: DescribeInstances diff --git "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\345\205\254\345\205\261\345\217\202\346\225\260_intl_ko.md" "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\345\205\254\345\205\261\345\217\202\346\225\260_intl_ko.md" index 02451441525..8340ad9cca1 100644 --- "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\345\205\254\345\205\261\345\217\202\346\225\260_intl_ko.md" +++ "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\345\205\254\345\205\261\345\217\202\346\225\260_intl_ko.md" @@ -20,7 +20,7 @@ HTTP GET 요청 구조 예시: ``` https://cvm.tencentcloudapi.com/?Limit=10&Offset=0 -Authorization: TC3-HMAC-SHA256 Credential=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE/2018-10-09/cvm/tc3_request, SignedHeaders=content-type;host, Signature=5da7a33f6993f0614b047e5df4582db9e9bf4672ba50567dba16c6ccf174c474 +Authorization: TC3-HMAC-SHA256 Credential=AKID**********************0123456789EXAMPLE/2018-10-09/cvm/tc3_request, SignedHeaders=content-type;host, Signature=5da7a33f6993f0614b047e5df4582db9e9bf4672ba50567dba16c6ccf174c474 Content-Type: application/x-www-form-urlencoded Host: cvm.tencentcloudapi.com X-TC-Action: DescribeInstances diff --git "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203 v3.md" "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203 v3.md" index aa895481e70..fd13d6cbe29 100644 --- "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203 v3.md" +++ "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203 v3.md" @@ -22,7 +22,7 @@ 下面以云服务器查询广州区实例列表作为例子,分步骤介绍签名的计算过程。我们仅用到了查询实例列表的两个参数:Limit 和 Offset,使用 GET 方法调用。 -假设用户的 SecretId 和 SecretKey 分别是:AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE 和 Gu5t9xGARNpq86cd98joQYCN3EXAMPLE +假设用户的 SecretId 和 SecretKey 分别是:AKID**********************0123456789EXAMPLE 和 sk0123456789********************EXAMPLE ### 1. 拼接规范请求串 @@ -135,7 +135,7 @@ TC3-HMAC-SHA256 Credential=AKIDEXAMPLE/Date/service/tc3_request, SignedHeaders=c ``` https://cvm.tencentcloudapi.com/?Limit=10&Offset=0 -Authorization: TC3-HMAC-SHA256 Credential=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE/2018-10-09/cvm/tc3_request, SignedHeaders=content-type;host, Signature=5da7a33f6993f0614b047e5df4582db9e9bf4672ba50567dba16c6ccf174c474 +Authorization: TC3-HMAC-SHA256 Credential=AKID**********************0123456789EXAMPLE/2018-10-09/cvm/tc3_request, SignedHeaders=content-type;host, Signature=5da7a33f6993f0614b047e5df4582db9e9bf4672ba50567dba16c6ccf174c474 Content-Type: application/x-www-form-urlencoded Host: cvm.tencentcloudapi.com X-TC-Action: DescribeInstances @@ -169,8 +169,8 @@ public class TencentCloudAPITC3Demo { private final static String CHARSET = "UTF-8"; private final static String ENDPOINT = "cvm.tencentcloudapi.com"; private final static String PATH = "/"; - private final static String SECRET_ID = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE"; - private final static String SECRET_KEY = "Gu5t9xGARNpq86cd98joQYCN3EXAMPLE"; + private final static String SECRET_ID = "AKID**********************0123456789EXAMPLE"; + private final static String SECRET_KEY = "sk0123456789********************EXAMPLE"; private final static String CT_X_WWW_FORM_URLENCODED = "application/x-www-form-urlencoded"; private final static String CT_JSON = "application/json"; private final static String CT_FORM_DATA = "multipart/form-data"; @@ -245,8 +245,8 @@ import hashlib, hmac, json, os, sys, time from datetime import datetime # 密钥参数 -secret_id = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE" -secret_key = "Gu5t9xGARNpq86cd98joQYCN3EXAMPLE" +secret_id = "AKID**********************0123456789EXAMPLE" +secret_key = "sk0123456789********************EXAMPLE" service = "cvm" host = "cvm.tencentcloudapi.com" diff --git "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203 v3_intl_jp.md" "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203 v3_intl_jp.md" index c5e72439980..54b130286f6 100644 --- "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203 v3_intl_jp.md" +++ "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203 v3_intl_jp.md" @@ -22,7 +22,7 @@ Tencent Cloud APIは、各アクセスリクエストを認証します。つま これからは、CVMが広州区インスタンスリストを照合することを一例として、署名計算プロセスをステップバイステップで紹介します。インスタンスリストを照合する2つのパラメータ、LimitとOffsetのみを使用しました。GET方法で呼び出します。 -例えば、ユーザーのSecretIdとSecretKeyがAKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLEとGu5t9xGARNpq86cd98joQYCN3EXAMPLEです +例えば、ユーザーのSecretIdとSecretKeyがAKID**********************0123456789EXAMPLEとGu5t9xGARNpq86cd98joQYCN3EXAMPLEです ### 1. 正規リクエスト列のつなぎ合わせ @@ -135,7 +135,7 @@ TC3-HMAC-SHA256 Credential=AKIDEXAMPLE/Date/service/tc3_request, SignedHeaders=c ``` https://cvm.tencentcloudapi.com/?Limit=10&Offset=0 -Authorization: TC3-HMAC-SHA256 Credential=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE/2018-10-09/cvm/tc3_request, SignedHeaders=content-type;host, Signature=5da7a33f6993f0614b047e5df4582db9e9bf4672ba50567dba16c6ccf174c474 +Authorization: TC3-HMAC-SHA256 Credential=AKID**********************0123456789EXAMPLE/2018-10-09/cvm/tc3_request, SignedHeaders=content-type;host, Signature=5da7a33f6993f0614b047e5df4582db9e9bf4672ba50567dba16c6ccf174c474 Content-Type: application/x-www-form-urlencoded Host: cvm.tencentcloudapi.com X-TC-Action: DescribeInstances @@ -169,8 +169,8 @@ public class TencentCloudAPITC3Demo { private final static String CHARSET = "UTF-8"; private final static String ENDPOINT = "cvm.tencentcloudapi.com"; private final static String PATH = "/"; - private final static String SECRET_ID = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE"; - private final static String SECRET_KEY = "Gu5t9xGARNpq86cd98joQYCN3EXAMPLE"; + private final static String SECRET_ID = "AKID**********************0123456789EXAMPLE"; + private final static String SECRET_KEY = "sk0123456789********************EXAMPLE"; private final static String CT_X_WWW_FORM_URLENCODED = "application/x-www-form-urlencoded"; private final static String CT_JSON = "application/json"; private final static String CT_FORM_DATA = "multipart/form-data"; @@ -245,8 +245,8 @@ import hashlib, hmac, json, os, sys, time from datetime import datetime # 暗号鍵パラメータ -secret_id = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE" -secret_key = "Gu5t9xGARNpq86cd98joQYCN3EXAMPLE" +secret_id = "AKID**********************0123456789EXAMPLE" +secret_key = "sk0123456789********************EXAMPLE" service = "cvm" host = "cvm.tencentcloudapi.com" diff --git "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203 v3_intl_ko.md" "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203 v3_intl_ko.md" index 51e95644a9a..a11563b80bc 100644 --- "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203 v3_intl_ko.md" +++ "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203 v3_intl_ko.md" @@ -22,7 +22,7 @@ Tencent Cloud API는 각 액세스 요청에 대해 자격 증명을 진행하 다음에서 CVM으로 광저우 지역 인스턴스 리스트를 조회하는 예를 들어 서명 컴퓨팅 프로세스를 단계별로 소개합니다. 인스턴스 리스트 조회의 Limit 및 Offset의 두 가지 매개변수를 사용했고, GET 방법으로 호출했습니다. -사용자의 SecretId와 SecretKey는 각각 다음과 같습니다. AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE 및 Gu5t9xGARNpq86cd98joQYCN3EXAMPLE. +사용자의 SecretId와 SecretKey는 각각 다음과 같습니다. AKID**********************0123456789EXAMPLE 및 sk0123456789********************EXAMPLE. ### 1. 정규 요청 문자열 합치기 @@ -135,7 +135,7 @@ TC3-HMAC-SHA256 Credential=AKIDEXAMPLE/Date/service/tc3_request, SignedHeaders=c ``` https://cvm.tencentcloudapi.com/?Limit=10&Offset=0 -Authorization: TC3-HMAC-SHA256 Credential=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE/2018-10-09/cvm/tc3_request, SignedHeaders=content-type;host, Signature=5da7a33f6993f0614b047e5df4582db9e9bf4672ba50567dba16c6ccf174c474 +Authorization: TC3-HMAC-SHA256 Credential=AKID**********************0123456789EXAMPLE/2018-10-09/cvm/tc3_request, SignedHeaders=content-type;host, Signature=5da7a33f6993f0614b047e5df4582db9e9bf4672ba50567dba16c6ccf174c474 Content-Type: application/x-www-form-urlencoded Host: cvm.tencentcloudapi.com X-TC-Action: DescribeInstances @@ -169,8 +169,8 @@ public class TencentCloudAPITC3Demo { private final static String CHARSET = "UTF-8"; private final static String ENDPOINT = "cvm.tencentcloudapi.com"; private final static String PATH = "/"; - private final static String SECRET_ID = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE"; - private final static String SECRET_KEY = "Gu5t9xGARNpq86cd98joQYCN3EXAMPLE"; + private final static String SECRET_ID = "AKID**********************0123456789EXAMPLE"; + private final static String SECRET_KEY = "sk0123456789********************EXAMPLE"; private final static String CT_X_WWW_FORM_URLENCODED = "application/x-www-form-urlencoded"; private final static String CT_JSON = "application/json"; private final static String CT_FORM_DATA = "multipart/form-data"; @@ -245,8 +245,8 @@ import hashlib, hmac, json, os, sys, time from datetime import datetime # 키 매개변수 -secret_id = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE" -secret_key = "Gu5t9xGARNpq86cd98joQYCN3EXAMPLE" +secret_id = "AKID**********************0123456789EXAMPLE" +secret_key = "sk0123456789********************EXAMPLE" service = "cvm" host = "cvm.tencentcloudapi.com" diff --git "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203.md" "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203.md" index c196615e981..f503b683d5c 100644 --- "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203.md" +++ "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203.md" @@ -22,8 +22,8 @@ 假设用户的 SecretId 和 SecretKey 分别是: -* SecretId: AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE -* SecretKey: Gu5t9xGARNpq86cd98joQYCN3EXAMPLE +* SecretId: AKID**********************0123456789EXAMPLE +* SecretKey: sk0123456789********************EXAMPLE **注意:这里只是示例,请根据用户实际申请的 SecretId 和 SecretKey 进行后续操作!** @@ -32,7 +32,7 @@ | 参数名称 | 中文 | 参数值| |---------|---------|---------| | Action | 方法名| DescribeInstances | -| SecretId | 密钥Id | AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE | +| SecretId | 密钥Id | AKID**********************0123456789EXAMPLE | | Timestamp | 当前时间戳 | 1465185768 | | Nonce | 随机正整数 | 11886 | | Region | 实例所在区域 | ap-guangzhou | @@ -54,7 +54,7 @@ 'Nonce' : 11886, 'Offset' : 0, 'Region' : 'ap-guangzhou', - 'SecretId' : 'AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE', + 'SecretId' : 'AKID**********************0123456789EXAMPLE', 'Timestamp' : 1465185768, 'Version': '2017-03-12', } @@ -70,7 +70,7 @@ 然后将格式化后的各个参数用"&"拼接在一起,最终生成的请求字符串为: ``` -Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Timestamp=1465185768&Version=2017-03-12 +Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************01234567893EXAMPLE&Timestamp=1465185768&Version=2017-03-12 ``` ### 2.3. 拼接签名原文字符串 @@ -87,7 +87,7 @@ Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset= 示例的拼接结果为: ``` -GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Timestamp=1465185768&Version=2017-03-12 +GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Timestamp=1465185768&Version=2017-03-12 ``` ### 2.4. 生成签名串 @@ -97,8 +97,8 @@ GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg& 具体代码如下,以 PHP 语言为例: ``` -$secretKey = 'Gu5t9xGARNpq86cd98joQYCN3EXAMPLE'; -$srcStr = 'GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Timestamp=1465185768&Version=2017-03-12'; +$secretKey = 'sk0123456789********************EXAMPLE'; +$srcStr = 'GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Timestamp=1465185768&Version=2017-03-12'; $signStr = base64_encode(hash_hmac('sha1', $srcStr, $secretKey, true)); echo $signStr; ``` @@ -147,7 +147,7 @@ EliP9YW3pW28FpsEdkXt/+WcGeI= 为了更清楚的解释签名过程,下面以实际编程语言为例,将上述的签名过程具体实现。请求的域名、调用的接口和参数的取值都以上述签名过程为准,代码只为解释签名过程,并不具备通用性,实际开发请尽量使用 SDK 。 -最终输出的 url 可能为:`https://cvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Signature=EliP9YW3pW28FpsEdkXt%2F%2BWcGeI%3D&Timestamp=1465185768&Version=2017-03-12` +最终输出的 url 可能为:`https://cvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Signature=EliP9YW3pW28FpsEdkXt%2F%2BWcGeI%3D&Timestamp=1465185768&Version=2017-03-12` 注意:由于示例中的密钥是虚构的,时间戳也不是系统当前时间,因此如果将此 url 在浏览器中打开或者用 curl 等命令调用时会返回鉴权错误:签名过期。为了得到一个可以正常返回的 url ,需要修改示例中的 SecretId 和 SecretKey 为真实的密钥,并使用系统当前时间戳作为 Timestamp 。 @@ -202,14 +202,14 @@ public class TencentCloudAPIDemo { params.put("Nonce", 11886); // 公共参数 // 实际调用时应当使用系统当前时间,例如: params.put("Timestamp", System.currentTimeMillis() / 1000); params.put("Timestamp", 1465185768); // 公共参数 - params.put("SecretId", "AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE"); // 公共参数 + params.put("SecretId", "AKID**********************0123456789EXAMPLE"); // 公共参数 params.put("Action", "DescribeInstances"); // 公共参数 params.put("Version", "2017-03-12"); // 公共参数 params.put("Region", "ap-guangzhou"); // 公共参数 params.put("Limit", 20); // 业务参数 params.put("Offset", 0); // 业务参数 params.put("InstanceIds.0", "ins-09dx96dg"); // 业务参数 - params.put("Signature", sign(getStringToSign(params), "Gu5t9xGARNpq86cd98joQYCN3EXAMPLE", "HmacSHA1")); // 公共参数 + params.put("Signature", sign(getStringToSign(params), "sk0123456789********************EXAMPLE", "HmacSHA1")); // 公共参数 System.out.println(getUrl(params)); } } @@ -228,8 +228,8 @@ import time import requests -secret_id = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE" -secret_key = "Gu5t9xGARNpq86cd98joQYCN3EXAMPLE" +secret_id = "AKID**********************0123456789EXAMPLE" +secret_key = "sk0123456789********************EXAMPLE" def get_string_to_sign(method, endpoint, params): s = method + endpoint + "/?" diff --git "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203_intl.md" "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203_intl.md" index 19aa10fb4b5..cf392c79182 100644 --- "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203_intl.md" +++ "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203_intl.md" @@ -24,8 +24,8 @@ Apply for security credentials by following the steps below: With the SecretId and SecretKey, a signature string can be generated. The following shows how to generate a signature string: Suppose that you have the following SecretId and SecretKey: -> SecretId: AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE -> SecretKey: Gu5t9xGARNpq86cd98joQYCN3EXAMPLE +> SecretId: AKID**********************0123456789EXAMPLE +> SecretKey: sk0123456789********************EXAMPLE **Note: This information is only for demonstration purpose. Make sure you proceed with your actual SecretId and SecretKey.** @@ -34,7 +34,7 @@ For example, if you call the API "View CVM Instance List" (DescribeInstances), t | Parameter Name | Description | Parameter Value | |---------|---------|---------| | Action | Method name | DescribeInstances | -| SecretId | Key ID | AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE | +| SecretId | Key ID | AKID**********************0123456789EXAMPLE | | Timestamp | Current timestamp | 1465185768 | | Nonce | A random positive integer | 11886 | | Region | The region where the instance resides | ap-guangzhou | @@ -56,7 +56,7 @@ First, sort all the request parameters in an ascending lexicographical order (AS 'Nonce' : 11886, 'Offset' : 0, 'Region' : 'ap-guangzhou', - 'SecretId' : 'AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE', + 'SecretId' : 'AKID**********************0123456789EXAMPLE', 'Timestamp' : 1465185768, 'Version': '2017-03-12', } @@ -72,7 +72,7 @@ Format the request parameters sorted in the previous step as "parameter name"="p Then, join the formatted parameters together with "&" to generate the final request string: ``` -Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Timestamp=1465185768&Version=2017-03-12 +Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Timestamp=1465185768&Version=2017-03-12 ``` ### 2.3. Generate the original signature string @@ -90,7 +90,7 @@ The original signature string is constructed as follows: The resulting string is: ``` -GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Timestamp=1465185768&Version=2017-03-12 +GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Timestamp=1465185768&Version=2017-03-12 ``` ### 2.4. Generate the signature string @@ -100,8 +100,8 @@ Sign the **original signature string** obtained in the previous step using HMAC- For example, the code is as follows if written in PHP: ``` -$secretKey = 'Gu5t9xGARNpq86cd98joQYCN3EXAMPLE'; -$srcStr = 'GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Timestamp=1465185768&Version=2017-03-12'; +$secretKey = 'sk0123456789********************EXAMPLE'; +$srcStr = 'GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Timestamp=1465185768&Version=2017-03-12'; $signStr = base64_encode(hash_hmac('sha1', $srcStr, $secretKey, true)); echo $signStr; ``` @@ -192,20 +192,20 @@ public class TencentCloudAPIDemo { params.put("Nonce", 11886); // Common parameters // The current system time should be used for the actual call, for example: params.put("Timestamp", System.currentTimeMillis() / 1000); params.put("Timestamp", 1465185768); // Common parameters - params.put("SecretId", "AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE"); // Common parameters + params.put("SecretId", "AKID**********************0123456789EXAMPLE"); // Common parameters params.put("Action", "DescribeInstances"); // Common parameters params.put("Version", "2017-03-12"); // Common parameters params.put("Region", "ap-guangzhou"); // Common parameters params.put("Limit", 20); // Business parameters params.put("Offset", 0); // Business parameters params.put("InstanceIds.0", "ins-09dx96dg"); // Business parameters - params.put("Signature", sign(getStringToSign(params), "Gu5t9xGARNpq86cd98joQYCN3EXAMPLE", "HmacSHA1")); // Common parameters + params.put("Signature", sign(getStringToSign(params), "sk0123456789********************EXAMPLE", "HmacSHA1")); // Common parameters System.out.println(getUrl(params)); } } ``` -The resulting URL: `https://cvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Signature=EliP9YW3pW28FpsEdkXt%2F%2BWcGeI%3D&Timestamp=1465185768&Version=2017-03-12` +The resulting URL: `https://cvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Signature=EliP9YW3pW28FpsEdkXt%2F%2BWcGeI%3D&Timestamp=1465185768&Version=2017-03-12` Note: Since the key in the example is fictitious and the timestamp is not the current system time, the authentication error "The signature expired" will be returned when you open this URL in a browser or call it with a command, such as curl. To get a URL that can be returned normally, replace the SecretId and SecretKey in the example with the real key, and use the current system timestamp as the Timestamp. diff --git "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203_intl_jp.md" "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203_intl_jp.md" index e0ef05ed6a7..d552c3e7c9b 100644 --- "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203_intl_jp.md" +++ "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203_intl_jp.md" @@ -22,8 +22,8 @@ Tencent Cloud APIは、各アクセスリクエストを認証します。つま 例えば、ユーザーのSecretIdとSecretKeyが次のようになるとします。 -* SecretId: AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE -* SecretKey: Gu5t9xGARNpq86cd98joQYCN3EXAMPLE +* SecretId: AKID**********************0123456789EXAMPLE +* SecretKey: sk0123456789********************EXAMPLE **注意:これは一例に過ぎません。ユーザーの実際申請したSecretIdとSecretKeyによって操作を続けてください!** @@ -32,7 +32,7 @@ CVMのインスタンスリスト表示(DescribeInstances)リクエストを | パラメータ名称 | 日本語 | パラメータ値| |---------|---------|---------| | Action | メソッド名| DescribeInstances | -| SecretId | 暗号鍵ID | AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE | +| SecretId | 暗号鍵ID | AKID**********************0123456789EXAMPLE | | Timestamp | 現在のタイムスタンプ | 1465185768 | | Nonce | ランダムな正の整数 | 11886 | | Region | インスタンスの所属地域 | ap-guangzhou | @@ -54,7 +54,7 @@ CVMのインスタンスリスト表示(DescribeInstances)リクエストを 'Nonce' : 11886, 'Offset' : 0, 'Region' : 'ap-guangzhou', - 'SecretId' : 'AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE', + 'SecretId' : 'AKID**********************0123456789EXAMPLE', 'Timestamp' : 1465185768, 'Version': '2017-03-12', } @@ -70,7 +70,7 @@ CVMのインスタンスリスト表示(DescribeInstances)リクエストを それから、フォーマットされた各パラメータを「&」でつなぎ合わせて、最後に生成されたリクエスト文字列は次のとおりです: ``` -Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Timestamp=1465185768&Version=2017-03-12 +Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Timestamp=1465185768&Version=2017-03-12 ``` ### 2.3. 署名原文文字列のつなぎ合わせ @@ -87,7 +87,7 @@ Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset= 例のつなぎ合わせ結果: ``` -GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Timestamp=1465185768&Version=2017-03-12 +GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Timestamp=1465185768&Version=2017-03-12 ``` ### 2.4. 署名文字列の生成 @@ -97,8 +97,8 @@ GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg& 具体的なコードは次のとおりです。PHP言語を例とします: ``` -$secretKey = 'Gu5t9xGARNpq86cd98joQYCN3EXAMPLE'; -$srcStr = 'GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Timestamp=1465185768&Version=2017-03-12'; +$secretKey = 'sk0123456789********************EXAMPLE'; +$srcStr = 'GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Timestamp=1465185768&Version=2017-03-12'; $signStr = base64_encode(hash_hmac('sha1', $srcStr, $secretKey, true)); echo $signStr; ``` @@ -147,7 +147,7 @@ EliP9YW3pW28FpsEdkXt/+WcGeI= 署名プロセスをより明確に説明するために、実際のプログラミング言語を例として上述の署名プロセスを具体的に実施します。リクエストのドメイン名、呼び出すAPI、およびパラメータの値は、上記の署名プロセスのとおりです。コードは署名プロセスを説明するためのものであり、汎用性がありません。実際の開発ではできるだけSDKを使用してください。 -最終に出力されたURLは以下である可能性があります:`https://cvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Signature=EliP9YW3pW28FpsEdkXt%2F%2BWcGeI%3D&Timestamp=1465185768&Version=2017-03-12` +最終に出力されたURLは以下である可能性があります:`https://cvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Signature=EliP9YW3pW28FpsEdkXt%2F%2BWcGeI%3D&Timestamp=1465185768&Version=2017-03-12` 注意:例の暗号鍵は仮想のものであるため、タイムスタンプはシステムの現在時刻ではないので、このURLをブラウザで開くか、curlなどのコマンドで呼び出されると、認証エラー(署名期限切れ)が返されます。通常返されることができるURLを得るために、SecretIdとSecretKeyを本当の暗号鍵に変更して、システムの現在のタイムスタンプをTimestampとして使う必要があります。 @@ -202,14 +202,14 @@ public class TencentCloudAPIDemo { params.put("Nonce", 11886); // 共通パラメータ // 実際に呼び出すときはシステム現在時間を使うべきです。例えば: params.put("Timestamp", System.currentTimeMillis() / 1000); params.put("Timestamp", 1465185768); // 共通パラメータ - params.put("SecretId", "AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE"); // 共通パラメータ + params.put("SecretId", "AKID**********************0123456789EXAMPLE"); // 共通パラメータ params.put("Action", "DescribeInstances"); // 共通パラメータ params.put("Version", "2017-03-12"); // 共通パラメータ params.put("Region", "ap-guangzhou"); // 共通パラメータ params.put("Limit", 20); // 業務パラメータ params.put("Offset", 0); // 業務パラメータ params.put("InstanceIds.0", "ins-09dx96dg"); // 業務パラメータ - params.put("Signature", sign(getStringToSign(params), "Gu5t9xGARNpq86cd98joQYCN3EXAMPLE", "HmacSHA1")); // 共通パラメータ + params.put("Signature", sign(getStringToSign(params), "sk0123456789********************EXAMPLE", "HmacSHA1")); // 共通パラメータ System.out.println(getUrl(params)); } } @@ -228,8 +228,8 @@ import time import requests -secret_id = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE" -secret_key = "Gu5t9xGARNpq86cd98joQYCN3EXAMPLE" +secret_id = "AKID**********************0123456789EXAMPLE" +secret_key = "sk0123456789********************EXAMPLE" def get_string_to_sign(method, endpoint, params): s = method + endpoint + "/?" diff --git "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203_intl_ko.md" "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203_intl_ko.md" index 0fbffa02348..f956e9afa1d 100644 --- "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203_intl_ko.md" +++ "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 MySQL/cdb-2017-03-20/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203_intl_ko.md" @@ -22,8 +22,8 @@ Tencent Cloud API는 각 액세스 요청에 대해 자격 증명을 진행하 사용자의 SecretId와 SecretKey는 각각 다음과 같습니다. -* SecretId: AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE -* SecretKey: Gu5t9xGARNpq86cd98joQYCN3EXAMPLE +* SecretId: AKID**********************0123456789EXAMPLE +* SecretKey: sk0123456789********************EXAMPLE **주의: 이것은 단지 예시일 뿐입니다. 사용자는 실제 신청한 SecretId와 SecretKey에 따라 후속 작업을 수행하십시오!** @@ -32,7 +32,7 @@ CVM으로 인스턴스 리스트 조회(DescribeInstances) 요청을 예로 들 | 매개변수 이름 | 한국어 | 매개변수 값 | |---------|---------|---------| | Action | 방법명 | DescribeInstances | -| SecretId | 키 ID | AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE | +| SecretId | 키 ID | AKID**********************0123456789EXAMPLE | | Timestamp | 현재 타임스탬프 | 1465185768 | | Nonce | 랜덤 양의 정수 | 11886 | | Region | 인스턴스 소재 지역 | ap-guangzhou | @@ -54,7 +54,7 @@ CVM으로 인스턴스 리스트 조회(DescribeInstances) 요청을 예로 들 'Nonce' : 11886, 'Offset' : 0, 'Region' : 'ap-guangzhou', - 'SecretId' : 'AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE', + 'SecretId' : 'AKID**********************0123456789EXAMPLE', 'Timestamp' : 1465185768, 'Version': '2017-03-12', } @@ -70,7 +70,7 @@ CVM으로 인스턴스 리스트 조회(DescribeInstances) 요청을 예로 들 형식화된 각 매개변수를 "&"로 연결하여, 최종 생성된 요청 문자열은 다음과 같습니다. ``` -Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Timestamp=1465185768&Version=2017-03-12 +Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Timestamp=1465185768&Version=2017-03-12 ``` ### 2.3. 서명 원문 문자열 합치기 @@ -87,7 +87,7 @@ Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset= 예시의 합치기 결과: ``` -GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Timestamp=1465185768&Version=2017-03-12 +GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Timestamp=1465185768&Version=2017-03-12 ``` ### 2.4. 서명 문자열 생성 @@ -97,8 +97,8 @@ GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg& 구체적인 코드는 PHP 언어를 예로 들면 다음과 같습니다. ``` -$secretKey = 'Gu5t9xGARNpq86cd98joQYCN3EXAMPLE'; -$srcStr = 'GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Timestamp=1465185768&Version=2017-03-12'; +$secretKey = 'sk0123456789********************EXAMPLE'; +$srcStr = 'GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Timestamp=1465185768&Version=2017-03-12'; $signStr = base64_encode(hash_hmac('sha1', $srcStr, $secretKey, true)); echo $signStr; ``` @@ -147,7 +147,7 @@ EliP9YW3pW28FpsEdkXt/+WcGeI= 서명 프로세스를 더 명확하게 설명하기 위해, 다음에서는 실제 프로그래밍 언어를 예로 들어 위에서 설명한 서명 프로세스를 구체적으로 구현해보겠습니다. 요청 도메인 이름, 호출한 API 및 매개변수의 선택 값은 모두 위에서 설명한 서명 프로세스를 기준으로 합니다. 코드는 서명 프로세스를 설명하기 위한 것이며 범용이 아닙니다. 실제 개발 시에는 최대한 SDK를 사용하십시오. -가능한 최종 출력 url: `https://cvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Signature=EliP9YW3pW28FpsEdkXt%2F%2BWcGeI%3D&Timestamp=1465185768&Version=2017-03-12` +가능한 최종 출력 url: `https://cvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Signature=EliP9YW3pW28FpsEdkXt%2F%2BWcGeI%3D&Timestamp=1465185768&Version=2017-03-12` 주의: 예시의 키는 가상이므로, 타임스탬프도 시스템 현재 시간이 아니며, 이 URL을 브라우저에서 열거나 curl과 같은 명령으로 호출하면 "서명 만료"의 인증 오류가 반환됩니다. 정상적으로 반환되는 URL을 얻으려면, 예시의 SecretId 및 SecretKey를 실제 키로 수정하고 시스템 현재 타임스탬프를 Timestamp로 사용해야 합니다. @@ -202,14 +202,14 @@ public class TencentCloudAPIDemo { params.put("Nonce", 11886); // 공통 매개변수 // 실제 호출 시 시스템 현재 시간을 사용해야 합니다. 예: params.put("Timestamp", System.currentTimeMillis() / 1000). params.put("Timestamp", 1465185768); // 공통 매개변수 - params.put("SecretId", "AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE"); // 공통 매개변수 + params.put("SecretId", "AKID**********************0123456789EXAMPLE"); // 공통 매개변수 params.put("Action", "DescribeInstances"); // 공통 매개변수 params.put("Version", "2017-03-12"); // 공통 매개변수 params.put("Region", "ap-guangzhou"); // 공통 매개변수 params.put("Limit", 20); // 비즈니스 매개변수 params.put("Offset", 0); // 비즈니스 매개변수 params.put("InstanceIds.0", "ins-09dx96dg"); // 비즈니스 매개변수 - params.put("Signature", sign(getStringToSign(params), "Gu5t9xGARNpq86cd98joQYCN3EXAMPLE", "HmacSHA1")); // 공통 매개변수 + params.put("Signature", sign(getStringToSign(params), "sk0123456789********************EXAMPLE", "HmacSHA1")); // 공통 매개변수 System.out.println(getUrl(params)); } } @@ -228,8 +228,8 @@ import time import requests -secret_id = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE" -secret_key = "Gu5t9xGARNpq86cd98joQYCN3EXAMPLE" +secret_id = "AKID**********************0123456789EXAMPLE" +secret_key = "sk0123456789********************EXAMPLE" def get_string_to_sign(method, endpoint, params): s = method + endpoint + "/?" diff --git "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 SQL Server/sqlserver-2018-03-28/\350\260\203\347\224\250\346\226\271\345\274\217/\345\205\254\345\205\261\345\217\202\346\225\260.md" "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 SQL Server/sqlserver-2018-03-28/\350\260\203\347\224\250\346\226\271\345\274\217/\345\205\254\345\205\261\345\217\202\346\225\260.md" index fb73d774329..98469a1d737 100644 --- "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 SQL Server/sqlserver-2018-03-28/\350\260\203\347\224\250\346\226\271\345\274\217/\345\205\254\345\205\261\345\217\202\346\225\260.md" +++ "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 SQL Server/sqlserver-2018-03-28/\350\260\203\347\224\250\346\226\271\345\274\217/\345\205\254\345\205\261\345\217\202\346\225\260.md" @@ -20,7 +20,7 @@ HTTP GET 请求结构示例: ``` https://cvm.tencentcloudapi.com/?Limit=10&Offset=0 -Authorization: TC3-HMAC-SHA256 Credential=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE/2018-10-09/cvm/tc3_request, SignedHeaders=content-type;host, Signature=5da7a33f6993f0614b047e5df4582db9e9bf4672ba50567dba16c6ccf174c474 +Authorization: TC3-HMAC-SHA256 Credential=AKID**********************0123456789EXAMPLE/2018-10-09/cvm/tc3_request, SignedHeaders=content-type;host, Signature=5da7a33f6993f0614b047e5df4582db9e9bf4672ba50567dba16c6ccf174c474 Content-Type: application/x-www-form-urlencoded Host: cvm.tencentcloudapi.com X-TC-Action: DescribeInstances diff --git "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 SQL Server/sqlserver-2018-03-28/\350\260\203\347\224\250\346\226\271\345\274\217/\345\205\254\345\205\261\345\217\202\346\225\260_intl.md" "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 SQL Server/sqlserver-2018-03-28/\350\260\203\347\224\250\346\226\271\345\274\217/\345\205\254\345\205\261\345\217\202\346\225\260_intl.md" index a6e19380233..2e90f2294d3 100644 --- "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 SQL Server/sqlserver-2018-03-28/\350\260\203\347\224\250\346\226\271\345\274\217/\345\205\254\345\205\261\345\217\202\346\225\260_intl.md" +++ "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 SQL Server/sqlserver-2018-03-28/\350\260\203\347\224\250\346\226\271\345\274\217/\345\205\254\345\205\261\345\217\202\346\225\260_intl.md" @@ -10,7 +10,7 @@ When using TC3-HMAC-SHA256 to sign your requests, you should include all common | X-TC-Region | String | Yes | A parameter for specifying the region of the operated data. For the valid regions, see the description of the common input parameter "Region" in the API documentation. Note: This parameter is not required by some APIs and will not be in effect when using these APIs. You can find the detailed information about optional parameters in the API documentation. | | X-TC-Timestamp | Integer | Yes | The current UNIX timestamp. It records the time when an API request is initiated. For example, 1529223702. Note: A greater-than-5-minute difference between your local current time and the API server time can cause your signature to expire. | | X-TC-Version | String | Yes | API version of the action. For the valid values, see the description of the common input parameter "Version" in the API documentation. For example, the version of CVM is 2017-03-12. | -| Authorization | String | Yes | The HTTP authentication request header, for example:
TC3-HMAC-SHA256 Credential=AKIDEXAMPLE/Date/service/tc3_request, SignedHeaders=content-type;host, Signature=fe5f80f77d5fa3beca038a248ff027d0445342fe2855ddc963176630326f1024
Here,
- TC3-HMAC-SHA256: Signature method, currently fixed as this value;
- Credential: Signature credential; AKIDEXAMPLE is the SecretId; Date is a date in UTC time, and this value must be matched the value of X-TC-Timestamp (a common parameter) in UTC time format; service is the name of the product/service (e.g., cvm) you called;
- SignedHeaders: The headers that contains the authentication information; content-type and host are the required headers;
- Signature: Signature digest. | +| Authorization | String | Yes | The HTTP authentication request header, for example:
TC3-HMAC-SHA256 Credential=AKIDEXAMPLE/Date/service/tc3_request, SignedHeaders=content-type;host, Signature=fe5f80f77d5fa3beca038a248ff027d0445342fe2855ddc963176630326f1024
Here,
- TC3-HMAC-SHA256: Signature method, currently fixed as this value;
- Credential: Signature credential; EXAMPLE is the SecretId; Date is a date in UTC time, and this value must be matched the value of X-TC-Timestamp (a common parameter) in UTC time format; service is the name of the product/service (e.g., cvm) you called;
- SignedHeaders: The headers that contains the authentication information; content-type and host are the required headers;
- Signature: Signature digest. | | X-TC-Token | String | No | The token used for a temporary certificate. It must be used with a temporary key. You can obtain the temporary key and token by calling a CAM API. No token is required for a long-term key. | Assume that you want to query the list of Cloud Virtual Machine instances in the Guangzhou region, structure a request that consists of the request URL, the request header and request body as follows: @@ -20,7 +20,7 @@ Sample of an HTTP GET request structure: ``` https://cvm.tencentcloudapi.com/?Limit=10&Offset=0 -Authorization: TC3-HMAC-SHA256 Credential=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE/2018-10-09/cvm/tc3_request, SignedHeaders=content-type;host, Signature=5da7a33f6993f0614b047e5df4582db9e9bf4672ba50567dba16c6ccf174c474 +Authorization: TC3-HMAC-SHA256 Credential=AKID**********************0123456789EXAMPLE/2018-10-09/cvm/tc3_request, SignedHeaders=content-type;host, Signature=5da7a33f6993f0614b047e5df4582db9e9bf4672ba50567dba16c6ccf174c474 Content-Type: application/x-www-form-urlencoded Host: cvm.tencentcloudapi.com X-TC-Action: DescribeInstances diff --git "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 SQL Server/sqlserver-2018-03-28/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203 v3.md" "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 SQL Server/sqlserver-2018-03-28/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203 v3.md" index d34b3e2a3f7..94fe7600bf8 100644 --- "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 SQL Server/sqlserver-2018-03-28/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203 v3.md" +++ "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 SQL Server/sqlserver-2018-03-28/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203 v3.md" @@ -32,11 +32,11 @@ TC3-HMAC-SHA256 签名方法相比以前的 HmacSHA1 和 HmacSHA256 签名方法 在示例中,不论公共参数或者接口的参数,我们尽量选择容易犯错的情况。在实际调用接口时,请根据实际情况来,每个接口的参数并不相同,不要照抄这个例子的参数和值。 -假设用户的 SecretId 和 SecretKey 分别是:AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE 和 Gu5t9xGARNpq86cd98joQYCN3EXAMPLE。用户想查看广州区云服务器名为“未命名”的主机状态,只返回一条数据。则请求可能为: +假设用户的 SecretId 和 SecretKey 分别是:AKID**********************0123456789EXAMPLE 和 sk0123456789********************EXAMPLE。用户想查看广州区云服务器名为“未命名”的主机状态,只返回一条数据。则请求可能为: ``` curl -X POST https://cvm.tencentcloudapi.com \ --H "Authorization: TC3-HMAC-SHA256 Credential=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE/2019-02-25/cvm/tc3_request, SignedHeaders=content-type;host, Signature=72e494ea809ad7a8c8f7a4507b9bddcbaa8e581f516e8da2f66e2c5a96525168" \ +-H "Authorization: TC3-HMAC-SHA256 Credential=AKID**********************0123456789EXAMPLE/2019-02-25/cvm/tc3_request, SignedHeaders=content-type;host, Signature=72e494ea809ad7a8c8f7a4507b9bddcbaa8e581f516e8da2f66e2c5a96525168" \ -H "Content-Type: application/json; charset=utf-8" \ -H "Host: cvm.tencentcloudapi.com" \ -H "X-TC-Action: DescribeInstances" \ @@ -154,7 +154,7 @@ Authorization = | 字段名称 | 解释 | |-|-| | Algorithm | 签名方法,固定为 `TC3-HMAC-SHA256`。 | -| SecretId | 密钥对中的 SecretId,即 `AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE`。 | +| SecretId | 密钥对中的 SecretId,即 `AKID**********************0123456789EXAMPLE`。 | | CredentialScope | 见上文,凭证范围。此示例计算结果是 `2019-02-25/cvm/tc3_request`。 | | SignedHeaders | 见上文,参与签名的头部信息。此示例取值为 `content-type;host`。 | | Signature | 签名值。此示例计算结果是 `72e494ea809ad7a8c8f7a4507b9bddcbaa8e581f516e8da2f66e2c5a96525168`。 | @@ -162,14 +162,14 @@ Authorization = 根据以上规则,示例中得到的值为: ``` -TC3-HMAC-SHA256 Credential=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE/2019-02-25/cvm/tc3_request, SignedHeaders=content-type;host, Signature=72e494ea809ad7a8c8f7a4507b9bddcbaa8e581f516e8da2f66e2c5a96525168 +TC3-HMAC-SHA256 Credential=AKID**********************0123456789EXAMPLE/2019-02-25/cvm/tc3_request, SignedHeaders=content-type;host, Signature=72e494ea809ad7a8c8f7a4507b9bddcbaa8e581f516e8da2f66e2c5a96525168 ``` 最终完整的调用信息如下: ``` POST https://cvm.tencentcloudapi.com/ -Authorization: TC3-HMAC-SHA256 Credential=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE/2019-02-25/cvm/tc3_request, SignedHeaders=content-type;host, Signature=72e494ea809ad7a8c8f7a4507b9bddcbaa8e581f516e8da2f66e2c5a96525168 +Authorization: TC3-HMAC-SHA256 Credential=AKID**********************0123456789EXAMPLE/2019-02-25/cvm/tc3_request, SignedHeaders=content-type;host, Signature=72e494ea809ad7a8c8f7a4507b9bddcbaa8e581f516e8da2f66e2c5a96525168 Content-Type: application/json; charset=utf-8 Host: cvm.tencentcloudapi.com X-TC-Action: DescribeInstances @@ -198,8 +198,8 @@ import javax.xml.bind.DatatypeConverter; public class TencentCloudAPITC3Demo { private final static Charset UTF8 = StandardCharsets.UTF_8; - private final static String SECRET_ID = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE"; - private final static String SECRET_KEY = "Gu5t9xGARNpq86cd98joQYCN3EXAMPLE"; + private final static String SECRET_ID = "AKID**********************0123456789EXAMPLE"; + private final static String SECRET_KEY = "sk0123456789********************"; private final static String CT_JSON = "application/json; charset=utf-8"; public static byte[] hmac256(byte[] key, String msg) throws Exception { @@ -292,8 +292,8 @@ import hashlib, hmac, json, os, sys, time from datetime import datetime # 密钥参数 -secret_id = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE" -secret_key = "Gu5t9xGARNpq86cd98joQYCN3EXAMPLE" +secret_id = "AKID**********************0123456789EXAMPLE" +secret_key = "sk0123456789********************EXAMPLE" service = "cvm" host = "cvm.tencentcloudapi.com" diff --git "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 SQL Server/sqlserver-2018-03-28/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203 v3_intl.md" "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 SQL Server/sqlserver-2018-03-28/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203 v3_intl.md" index d3a94e6db8e..1c30434d2ad 100644 --- "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 SQL Server/sqlserver-2018-03-28/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203 v3_intl.md" +++ "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 SQL Server/sqlserver-2018-03-28/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203 v3_intl.md" @@ -32,11 +32,11 @@ The following uses querying the list of CVM instances in the Guangzhou region as In the example, we try to choose common parameters and API parameters that are prone to mistakes. When you actually call an API, please use parameters based on the actual conditions. The parameters vary by API. Do not copy the parameters and values in this example. -Assuming that your SecretId and SecretKey are AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE and Gu5t9xGARNpq86cd98joQYCN3EXAMPLE, respectively, if you want to view the status of the CVM instance named "unnamed" in the Guangzhou region and have only one data entry returned, then the request may be: +Assuming that your SecretId and SecretKey are AKID**********************0123456789EXAMPLE and sk0123456789********************EXAMPLE, respectively, if you want to view the status of the CVM instance named "unnamed" in the Guangzhou region and have only one data entry returned, then the request may be: ``` curl -X POST https://cvm.tencentcloudapi.com \ --H "Authorization: TC3-HMAC-SHA256 Credential=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE/2019-02-25/cvm/tc3_request, SignedHeaders=content-type;host, Signature=72e494ea809ad7a8c8f7a4507b9bddcbaa8e581f516e8da2f66e2c5a96525168" \ +-H "Authorization: TC3-HMAC-SHA256 Credential=AKID**********************0123456789EXAMPLE/2019-02-25/cvm/tc3_request, SignedHeaders=content-type;host, Signature=72e494ea809ad7a8c8f7a4507b9bddcbaa8e581f516e8da2f66e2c5a96525168" \ -H "Content-Type: application/json; charset=utf-8" \ -H "Host: cvm.tencentcloudapi.com" \ -H "X-TC-Action: DescribeInstances" \ @@ -154,7 +154,7 @@ Authorization = | Field Name | Explanation | |-|-| | Algorithm | Signature algorithm, which is always `TC3-HMAC-SHA256`. | -| SecretId | The SecretId in the key pair, i.e., `AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE`. | +| SecretId | The SecretId in the key pair, i.e., `AKID**********************0123456789EXAMPLE`. | | CredentialScope | Credential scope (see above). The calculation result in this example is `2019-02-25/cvm/tc3_request`. | | SignedHeaders | Header information for signature calculation (see above), such as `content-type;host` in this example. | | Signature | Signature value. The calculation result in this example is `72e494ea809ad7a8c8f7a4507b9bddcbaa8e581f516e8da2f66e2c5a96525168`. | @@ -162,14 +162,14 @@ Authorization = Based on the rules above, the value in the example is: ``` -TC3-HMAC-SHA256 Credential=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE/2019-02-25/cvm/tc3_request, SignedHeaders=content-type;host, Signature=72e494ea809ad7a8c8f7a4507b9bddcbaa8e581f516e8da2f66e2c5a96525168 +TC3-HMAC-SHA256 Credential=AKID**********************0123456789EXAMPLE/2019-02-25/cvm/tc3_request, SignedHeaders=content-type;host, Signature=72e494ea809ad7a8c8f7a4507b9bddcbaa8e581f516e8da2f66e2c5a96525168 ``` The final complete call information is as follows: ``` POST https://cvm.tencentcloudapi.com/ -Authorization: TC3-HMAC-SHA256 Credential=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE/2019-02-25/cvm/tc3_request, SignedHeaders=content-type;host, Signature=72e494ea809ad7a8c8f7a4507b9bddcbaa8e581f516e8da2f66e2c5a96525168 +Authorization: TC3-HMAC-SHA256 Credential=AKID**********************0123456789EXAMPLE/2019-02-25/cvm/tc3_request, SignedHeaders=content-type;host, Signature=72e494ea809ad7a8c8f7a4507b9bddcbaa8e581f516e8da2f66e2c5a96525168 Content-Type: application/json; charset=utf-8 Host: cvm.tencentcloudapi.com X-TC-Action: DescribeInstances @@ -198,8 +198,8 @@ import javax.xml.bind.DatatypeConverter; public class TencentCloudAPITC3Demo { private final static Charset UTF8 = StandardCharsets.UTF_8; - private final static String SECRET_ID = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE"; - private final static String SECRET_KEY = "Gu5t9xGARNpq86cd98joQYCN3EXAMPLE"; + private final static String SECRET_ID = "AKID**********************0123456789EXAMPLE"; + private final static String SECRET_KEY = "sk0123456789********************EXAMPLE"; private final static String CT_JSON = "application/json; charset=utf-8"; public static byte[] hmac256(byte[] key, String msg) throws Exception { @@ -292,8 +292,8 @@ import hashlib, hmac, json, os, sys, time from datetime import datetime # Key parameters -secret_id = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE" -secret_key = "Gu5t9xGARNpq86cd98joQYCN3EXAMPLE" +secret_id = "AKID**********************0123456789EXAMPLE" +secret_key = "sk0123456789********************EXAMPLE" service = "cvm" host = "cvm.tencentcloudapi.com" diff --git "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 SQL Server/sqlserver-2018-03-28/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203.md" "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 SQL Server/sqlserver-2018-03-28/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203.md" index 480e32dada4..60495826f13 100644 --- "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 SQL Server/sqlserver-2018-03-28/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203.md" +++ "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 SQL Server/sqlserver-2018-03-28/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203.md" @@ -22,8 +22,8 @@ 假设用户的 SecretId 和 SecretKey 分别是: -* SecretId: AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE -* SecretKey: Gu5t9xGARNpq86cd98joQYCN3EXAMPLE +* SecretId: AKID**********************0123456789EXAMPLE +* SecretKey: sk0123456789********************EXAMPLE **注意:这里只是示例,请根据用户实际申请的 SecretId 和 SecretKey 进行后续操作!** @@ -32,7 +32,7 @@ | 参数名称 | 中文 | 参数值| |---------|---------|---------| | Action | 方法名| DescribeInstances | -| SecretId | 密钥Id | AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE | +| SecretId | 密钥Id | AKID**********************0123456789EXAMPLE | | Timestamp | 当前时间戳 | 1465185768 | | Nonce | 随机正整数 | 11886 | | Region | 实例所在区域 | ap-guangzhou | @@ -54,7 +54,7 @@ 'Nonce' : 11886, 'Offset' : 0, 'Region' : 'ap-guangzhou', - 'SecretId' : 'AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE', + 'SecretId' : 'AKID**********************0123456789EXAMPLE', 'Timestamp' : 1465185768, 'Version': '2017-03-12', } @@ -70,7 +70,7 @@ 然后将格式化后的各个参数用"&"拼接在一起,最终生成的请求字符串为: ``` -Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Timestamp=1465185768&Version=2017-03-12 +Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Timestamp=1465185768&Version=2017-03-12 ``` ### 2.3. 拼接签名原文字符串 @@ -87,7 +87,7 @@ Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset= 示例的拼接结果为: ``` -GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Timestamp=1465185768&Version=2017-03-12 +GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Timestamp=1465185768&Version=2017-03-12 ``` ### 2.4. 生成签名串 @@ -97,8 +97,8 @@ GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg& 具体代码如下,以 PHP 语言为例: ``` -$secretKey = 'Gu5t9xGARNpq86cd98joQYCN3EXAMPLE'; -$srcStr = 'GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Timestamp=1465185768&Version=2017-03-12'; +$secretKey = 'sk0123456789********************EXAMPLE'; +$srcStr = 'GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Timestamp=1465185768&Version=2017-03-12'; $signStr = base64_encode(hash_hmac('sha1', $srcStr, $secretKey, true)); echo $signStr; ``` @@ -147,7 +147,7 @@ EliP9YW3pW28FpsEdkXt/+WcGeI= 为了更清楚的解释签名过程,下面以实际编程语言为例,将上述的签名过程具体实现。请求的域名、调用的接口和参数的取值都以上述签名过程为准,代码只为解释签名过程,并不具备通用性,实际开发请尽量使用 SDK 。 -最终输出的 url 可能为:`https://cvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Signature=EliP9YW3pW28FpsEdkXt%2F%2BWcGeI%3D&Timestamp=1465185768&Version=2017-03-12`。 +最终输出的 url 可能为:`https://cvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Signature=EliP9YW3pW28FpsEdkXt%2F%2BWcGeI%3D&Timestamp=1465185768&Version=2017-03-12`。 注意:由于示例中的密钥是虚构的,时间戳也不是系统当前时间,因此如果将此 url 在浏览器中打开或者用 curl 等命令调用时会返回鉴权错误:签名过期。为了得到一个可以正常返回的 url ,需要修改示例中的 SecretId 和 SecretKey 为真实的密钥,并使用系统当前时间戳作为 Timestamp 。 @@ -202,14 +202,14 @@ public class TencentCloudAPIDemo { params.put("Nonce", 11886); // 公共参数 // 实际调用时应当使用系统当前时间,例如: params.put("Timestamp", System.currentTimeMillis() / 1000); params.put("Timestamp", 1465185768); // 公共参数 - params.put("SecretId", "AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE"); // 公共参数 + params.put("SecretId", "AKID**********************0123456789EXAMPLE"); // 公共参数 params.put("Action", "DescribeInstances"); // 公共参数 params.put("Version", "2017-03-12"); // 公共参数 params.put("Region", "ap-guangzhou"); // 公共参数 params.put("Limit", 20); // 业务参数 params.put("Offset", 0); // 业务参数 params.put("InstanceIds.0", "ins-09dx96dg"); // 业务参数 - params.put("Signature", sign(getStringToSign(params), "Gu5t9xGARNpq86cd98joQYCN3EXAMPLE", "HmacSHA1")); // 公共参数 + params.put("Signature", sign(getStringToSign(params), "sk0123456789********************EXAMPLE", "HmacSHA1")); // 公共参数 System.out.println(getUrl(params)); } } @@ -228,8 +228,8 @@ import time import requests -secret_id = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE" -secret_key = "Gu5t9xGARNpq86cd98joQYCN3EXAMPLE" +secret_id = "AKID**********************0123456789EXAMPLE" +secret_key = "sk0123456789********************EXAMPLE" def get_string_to_sign(method, endpoint, params): s = method + endpoint + "/?" diff --git "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 SQL Server/sqlserver-2018-03-28/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203_intl.md" "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 SQL Server/sqlserver-2018-03-28/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203_intl.md" index 104a2138291..267e3baa3a4 100644 --- "a/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 SQL Server/sqlserver-2018-03-28/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203_intl.md" +++ "b/API/API 3.0/\344\272\221\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223 SQL Server/sqlserver-2018-03-28/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203_intl.md" @@ -22,8 +22,8 @@ With the SecretId and SecretKey, a signature string can be generated. The follow Assume that the SecretId and SecretKey are: -* SecretId: AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE -* SecretKey: Gu5t9xGARNpq86cd98joQYCN3EXAMPLE +* SecretId: AKID**********************0123456789EXAMPLE +* SecretKey: sk0123456789********************EXAMPLE **Note: This is just a sample. For actual operations, use your real SecretId and SecretKey!** @@ -32,7 +32,7 @@ Take the Cloud Virtual Machine's request to view the instance list (DescribeInst | Parameter name | English | Parameter value | |---------|---------|---------| | Action | Method name | DescribeInstances | -| SecretId | Key ID | AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE | +| SecretId | Key ID | AKID**********************0123456789EXAMPLE | | Timestamp | Current timestamp | 1465185768 | | Nonce | Random positive integer | 11886 | | Region | Region where the instance is located | ap-guangzhou | @@ -54,7 +54,7 @@ First, sort all the request parameters in an ascending lexicographical order (AS 'Nonce' : 11886, 'Offset' : 0, 'Region' : 'ap-guangzhou', - 'SecretId' : 'AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE', + 'SecretId' : 'AKID**********************0123456789EXAMPLE', 'Timestamp' : 1465185768, 'Version': '2017-03-12', } @@ -70,7 +70,7 @@ Format the request parameters sorted in the previous step into the form of "para Then, concatenate the formatted parameters with "&". The resulting request string is as follows: ``` -Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Timestamp=1465185768&Version=2017-03-12 +Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Timestamp=1465185768&Version=2017-03-12 ``` ### 2.3. Concatenating the Signature Original String @@ -87,7 +87,7 @@ The concatenation rule of the signature original string is: Request method + req The concatenation result of the sample is: ``` -GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Timestamp=1465185768&Version=2017-03-12 +GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Timestamp=1465185768&Version=2017-03-12 ``` ### 2.4. Generating the Signature String @@ -97,8 +97,8 @@ First, use the HMAC-SHA1 algorithm to sign the **signature original string** obt The specific code is as follows with the PHP language as an example: ``` -$secretKey = 'Gu5t9xGARNpq86cd98joQYCN3EXAMPLE'; -$srcStr = 'GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Timestamp=1465185768&Version=2017-03-12'; +$secretKey = 'sk0123456789********************EXAMPLE'; +$srcStr = 'GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Timestamp=1465185768&Version=2017-03-12'; $signStr = base64_encode(hash_hmac('sha1', $srcStr, $secretKey, true)); echo $signStr; ``` @@ -147,7 +147,7 @@ When calling API 3.0, you are recommended to use the corresponding Tencent Cloud In order to explain the signing process more clearly, the process described above is implemented below with a real-world programming language as an example. The request domain name, called API and parameter values in the sample are used here. The code here is only for explaining the signature process and not universal. For actual development, please use the SDK as much as possible. -The final output URL might be: `https://cvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Signature=EliP9YW3pW28FpsEdkXt%2F%2BWcGeI%3D&Timestamp=1465185768&Version=2017-03-12`. +The final output URL might be: `https://cvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Signature=EliP9YW3pW28FpsEdkXt%2F%2BWcGeI%3D&Timestamp=1465185768&Version=2017-03-12`. Note: The key in the example is fictitious, and the timestamp is not the current time of the system, so if this URL is opened in the browser or called using commands such as curl, an authentication error will be returned: Signature expired. In order to get a URL that can work properly, you need to replace the SecretId and SecretKey in the example with your real credentials and use the current time of the system as the Timestamp. @@ -202,14 +202,14 @@ public class TencentCloudAPIDemo { params.put("Nonce", 11886); // Common parameter // The current time of the system should be used when actually calling, for example: params.put("Timestamp", System.currentTimeMillis() / 1000); params.put("Timestamp", 1465185768); // Common parameter - params.put("SecretId", "AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE"); // Common parameter + params.put("SecretId", "AKID**********************0123456789EXAMPLE"); // Common parameter params.put("Action", "DescribeInstances"); // Common parameter params.put("Version", "2017-03-12"); // Common parameter params.put("Region", "ap-guangzhou"); // Common parameter params.put("Limit", 20); // Business parameter params.put("Offset", 0); // Business parameter params.put("InstanceIds.0", "ins-09dx96dg"); // Business parameter - params.put("Signature", sign(getStringToSign(params), "Gu5t9xGARNpq86cd98joQYCN3EXAMPLE", "HmacSHA1")); // Common parameter + params.put("Signature", sign(getStringToSign(params), "sk0123456789********************EXAMPLE", "HmacSHA1")); // Common parameter System.out.println(getUrl(params)); } } @@ -228,8 +228,8 @@ import time import requests -secret_id = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE" -secret_key = "Gu5t9xGARNpq86cd98joQYCN3EXAMPLE" +secret_id = "AKID**********************0123456789EXAMPLE" +secret_key = "sk0123456789********************EXAMPLE" def get_string_to_sign(method, endpoint, params): s = method + endpoint + "/?" diff --git "a/product/\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223MySQL/API \347\277\273\350\257\221\346\226\207\346\241\243/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203_intl.md" "b/product/\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223MySQL/API \347\277\273\350\257\221\346\226\207\346\241\243/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203_intl.md" index 19aa10fb4b5..cf392c79182 100644 --- "a/product/\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223MySQL/API \347\277\273\350\257\221\346\226\207\346\241\243/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203_intl.md" +++ "b/product/\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223MySQL/API \347\277\273\350\257\221\346\226\207\346\241\243/\350\260\203\347\224\250\346\226\271\345\274\217/\346\216\245\345\217\243\351\211\264\346\235\203_intl.md" @@ -24,8 +24,8 @@ Apply for security credentials by following the steps below: With the SecretId and SecretKey, a signature string can be generated. The following shows how to generate a signature string: Suppose that you have the following SecretId and SecretKey: -> SecretId: AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE -> SecretKey: Gu5t9xGARNpq86cd98joQYCN3EXAMPLE +> SecretId: AKID**********************0123456789EXAMPLE +> SecretKey: sk0123456789********************EXAMPLE **Note: This information is only for demonstration purpose. Make sure you proceed with your actual SecretId and SecretKey.** @@ -34,7 +34,7 @@ For example, if you call the API "View CVM Instance List" (DescribeInstances), t | Parameter Name | Description | Parameter Value | |---------|---------|---------| | Action | Method name | DescribeInstances | -| SecretId | Key ID | AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE | +| SecretId | Key ID | AKID**********************0123456789EXAMPLE | | Timestamp | Current timestamp | 1465185768 | | Nonce | A random positive integer | 11886 | | Region | The region where the instance resides | ap-guangzhou | @@ -56,7 +56,7 @@ First, sort all the request parameters in an ascending lexicographical order (AS 'Nonce' : 11886, 'Offset' : 0, 'Region' : 'ap-guangzhou', - 'SecretId' : 'AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE', + 'SecretId' : 'AKID**********************0123456789EXAMPLE', 'Timestamp' : 1465185768, 'Version': '2017-03-12', } @@ -72,7 +72,7 @@ Format the request parameters sorted in the previous step as "parameter name"="p Then, join the formatted parameters together with "&" to generate the final request string: ``` -Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Timestamp=1465185768&Version=2017-03-12 +Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Timestamp=1465185768&Version=2017-03-12 ``` ### 2.3. Generate the original signature string @@ -90,7 +90,7 @@ The original signature string is constructed as follows: The resulting string is: ``` -GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Timestamp=1465185768&Version=2017-03-12 +GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Timestamp=1465185768&Version=2017-03-12 ``` ### 2.4. Generate the signature string @@ -100,8 +100,8 @@ Sign the **original signature string** obtained in the previous step using HMAC- For example, the code is as follows if written in PHP: ``` -$secretKey = 'Gu5t9xGARNpq86cd98joQYCN3EXAMPLE'; -$srcStr = 'GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Timestamp=1465185768&Version=2017-03-12'; +$secretKey = 'sk0123456789********************EXAMPLE'; +$srcStr = 'GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Timestamp=1465185768&Version=2017-03-12'; $signStr = base64_encode(hash_hmac('sha1', $srcStr, $secretKey, true)); echo $signStr; ``` @@ -192,20 +192,20 @@ public class TencentCloudAPIDemo { params.put("Nonce", 11886); // Common parameters // The current system time should be used for the actual call, for example: params.put("Timestamp", System.currentTimeMillis() / 1000); params.put("Timestamp", 1465185768); // Common parameters - params.put("SecretId", "AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE"); // Common parameters + params.put("SecretId", "AKID**********************0123456789EXAMPLE"); // Common parameters params.put("Action", "DescribeInstances"); // Common parameters params.put("Version", "2017-03-12"); // Common parameters params.put("Region", "ap-guangzhou"); // Common parameters params.put("Limit", 20); // Business parameters params.put("Offset", 0); // Business parameters params.put("InstanceIds.0", "ins-09dx96dg"); // Business parameters - params.put("Signature", sign(getStringToSign(params), "Gu5t9xGARNpq86cd98joQYCN3EXAMPLE", "HmacSHA1")); // Common parameters + params.put("Signature", sign(getStringToSign(params), "sk0123456789********************EXAMPLE", "HmacSHA1")); // Common parameters System.out.println(getUrl(params)); } } ``` -The resulting URL: `https://cvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Signature=EliP9YW3pW28FpsEdkXt%2F%2BWcGeI%3D&Timestamp=1465185768&Version=2017-03-12` +The resulting URL: `https://cvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789EXAMPLE&Signature=EliP9YW3pW28FpsEdkXt%2F%2BWcGeI%3D&Timestamp=1465185768&Version=2017-03-12` Note: Since the key in the example is fictitious and the timestamp is not the current system time, the authentication error "The signature expired" will be returned when you open this URL in a browser or call it with a command, such as curl. To get a URL that can be returned normally, replace the SecretId and SecretKey in the example with the real key, and use the current system timestamp as the Timestamp. diff --git "a/product/\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223MySQL/API\350\260\203\347\224\250DEMO_intl_cn.md" "b/product/\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223MySQL/API\350\260\203\347\224\250DEMO_intl_cn.md" index b77d6a83155..731f302abe1 100644 --- "a/product/\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223MySQL/API\350\260\203\347\224\250DEMO_intl_cn.md" +++ "b/product/\346\225\260\346\215\256\345\272\223/\344\272\221\346\225\260\346\215\256\345\272\223MySQL/API\350\260\203\347\224\250DEMO_intl_cn.md" @@ -14,7 +14,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-guangzhou") @@ -54,7 +54,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-shanghai") @@ -87,7 +87,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-shanghai") @@ -121,7 +121,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-shanghai") @@ -156,7 +156,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-shanghai") @@ -191,7 +191,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-shanghai") @@ -224,7 +224,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-shanghai") @@ -256,7 +256,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-shanghai") @@ -293,7 +293,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-shanghai") @@ -325,7 +325,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-shanghai") @@ -359,7 +359,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-beijing") @@ -406,7 +406,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-shanghai") @@ -438,7 +438,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-shanghai") @@ -472,7 +472,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-shanghai") @@ -504,7 +504,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-shanghai") @@ -537,7 +537,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-shanghai") @@ -573,7 +573,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-beijing") @@ -608,7 +608,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-beijing") @@ -640,7 +640,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-beijing") @@ -673,7 +673,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-shanghai") @@ -705,7 +705,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-shanghai") @@ -739,7 +739,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-chengdu") @@ -774,7 +774,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-shanghai") @@ -811,7 +811,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-shanghai") @@ -845,7 +845,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-beijing") @@ -880,7 +880,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-beijing") @@ -914,7 +914,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-beijing") @@ -949,7 +949,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-beijing") @@ -982,7 +982,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-beijing") @@ -1018,7 +1018,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-beijing") @@ -1053,7 +1053,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-beijing") @@ -1088,7 +1088,7 @@ from tencentcloud.cdb.v20170320 import cdb_client, models try: # 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") #实例化要请求产品(以cdb为例)的client对象 client = cdb_client.CdbClient(cred, "ap-beijing") @@ -1127,8 +1127,8 @@ action = 'GetMonitorData' config = { 'Region': 'sh', - 'secretId': 'AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz', - 'secretKey': 'eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE', + 'secretId': 'AKID**********************0123456789', + 'secretKey': 'sk0123456789********************', 'method': 'get', } @@ -1177,8 +1177,8 @@ action = 'DescribeBaseMetrics' config = { 'Region': 'sh', - 'secretId': 'AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz', - 'secretKey': 'eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE', + 'secretId': 'AKID**********************0123456789', + 'secretKey': 'sk0123456789********************', 'method': 'get', } @@ -1226,8 +1226,8 @@ action = 'SendCustomAlarmMsg' config = { 'Region': 'sh', - 'secretId': 'AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz', - 'secretKey': 'eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE', + 'secretId': 'AKID**********************0123456789', + 'secretKey': 'sk0123456789********************', 'method': 'get', } @@ -1271,7 +1271,7 @@ from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentClo from tencentcloud.dts.v20180330 import dts_client, models def returnClient(): - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") client = dts_client.DtsClient(cred, "ap-guangzhou") return client @@ -1485,7 +1485,7 @@ from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentClo from tencentcloud.dts.v20180330 import dts_client, models def returnClient(): - cred = credential.Credential("AKIDrY4UwCdhewLbhdG7f2DmDT4eFftKtWIz", "eGl4KUSEsmaFiyEKFID0bzFKNFvPh2EE") + cred = credential.Credential("AKID**********************0123456789", "sk0123456789********************") client = dts_client.DtsClient(cred, "ap-guangzhou") return client