呼叫 ModifySiteMonitor 介面修改站點監控任務。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
cms:ModifySiteMonitor |
update |
*All Resource
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| Address |
string |
否 |
監控任務的 URL 或 IP 位址。 |
http://www.aliyun.com |
| TaskId |
string |
是 |
監控任務 ID。 |
2c8dbdf9-a3ab-46a1-85a4-f094965e**** |
| TaskName |
string |
否 |
監控任務名稱。長度 4~100 個字元,取值可包含英文字母、數字、底線(_)和漢字。 |
HanZhou_ECS2 |
| Interval |
string |
否 |
監控頻率。取值:1、5、15。單位:分鐘。預設值:1。 |
1 |
| IspCities |
string |
否 |
探針資訊。格式為 JSONArray,例如: 說明
您可以透過 DescribeSiteMonitorISPCityList 介面取得探測點資訊,請參見 DescribeSiteMonitorISPCityList 。如果該參數取值為空,則系統隨機選擇 3 個探測點。 |
[{"city":"546","isp":"465"},{"city":"572","isp":"465"},{"city":"738","isp":"465"}] |
| OptionsJson |
string |
否 |
監控任務對應協議類型的進階擴充選項。不同監控任務的協議類型對應不同的擴充選項。 |
{"time_out":5000} |
| AlertIds |
string |
否 |
警示規則 ID。雲端監控中已存在的警示規則 ID,可透過 DescribeMetricRuleList 介面查詢,請參見 DescribeMetricRuleList 。 |
49f7c317-7645-4cc9-94fd-ea42e122**** |
| IntervalUnit |
string |
否 |
監控指標的單位。 單位:毫秒(ms)。 |
ms |
| CustomSchedule |
string |
否 |
自訂探測週期。只能選擇週一至週日的某個時間段進行探測。 |
{"start_hour":0,"end_hour":24, "days":[0], "time_zone":"Local"} |
站點監控支援以下 8 種任務類型,每種任務類型對應的擴充參數(OptionsJson)如下表所示。
HTTP。
| 名稱 | 類型 | 描述 |
| http_method | String | HTTP 請求方式,支援三種:GET、POST、HEAD。預設值:GET。 |
| header | String | 換行符(\n)分隔的自訂 HTTP header。 每行 header 格式需符合 HTTP 協議(使用英文冒號分隔的鍵值)。 |
| cookie | String | cookie 和 HTTP 請求標準的寫法一致。 |
| request_content | String | 請求內容。支援兩種格式:JSON 和表單。不提供時,請求中不含正文。 |
| response_content | String | 期望的回應內容。探測時會在 HTTP 伺服器傳回的前 64 個位元組進行檢查。 |
| match_rule | String | 0:回應中不含 response_content 時,探測成功。 1:回應中含 response_content 時,探測成功。 |
| username | String | 如果提供 username,則會在 HTTP 請求中攜帶 BasicAuth header。 |
| password | String | HTTP 請求驗證密碼。 |
| time_out | int | 逾時時間。單位:毫秒。預設值:5。 |
| max_redirect | int | 最大跳轉次數。ECS 探針預設 5 次,營運商探針預設 2 次。 如果需要禁止跳轉,則將該參數設定為:0。 取值範圍:0~50。 |
PING。
| 名稱 | 類型 | 描述 |
| failure_rate | int | 當 PING 失敗率超過該參數時,探測失敗,傳回 610(PingAllFail)或 615(PingPartialFail)。 預設值:0.1。 |
| ping_num | int | PING 次數,預設值:20。 取值範圍:1~100。 |
DNS。
| 名稱 | 類型 | 描述 |
| dns_server | string | DNS 伺服器位址,可以為網域名稱或 IP 位址。 |
| dns_type | string | DNS 查詢類型。取值:A、NS、CNAME、MX、TXT、ANY。 |
| expect_value | string | 英文空白符分隔的期望值列表。 |
| match_rule | string | 期望值列表與 DNS 列表的關係,當不滿足指定關係時,探測失敗。 空字串或 IN_DNS:期望值列表是 DNS 列表的子集。 DNS_IN:DNS 列表是期望值列表的子集。 EQUAL:DNS 列表與期望值列表相等。 ANY:DNS 列表與期望值列表有交集(交集不為空)。 |
FTP。
| 名稱 | 類型 | 描述 |
| port | int | FTP 伺服器連接埠號。如果不提供,則使用預設值。FTP 預設值:21,FTPs 預設值:990。 |
| username | string | FTP 使用者名稱。如果未提供,則匿名登入。 |
| password | string | FTP 密碼。 |
POP3/SMTP。
| 名稱 | 類型 | 描述 |
| port | int | POP3 伺服器連接埠號。POP3 預設值:110,POP3s 預設值:995。 |
| username | string | POP3/SMTP 的使用者名稱。 |
| password | string | POP3/SMTP 的密碼。 |
TCP/UDP。
| 名稱 | 類型 | 描述 |
| port | int | TCP/UDP 伺服器的連接埠。 |
| request_content | string | 請求內容。當 request_format 為 hex 時,request_content 內容為十六進位緊湊格式。 |
| request_format | string | 當 request_format 為其他值時,request_content 作為普通字串傳送給 TCP/UDP 伺服器。 |
| response_content | string | 回應內容。當 TCP/UDP 伺服器傳回的內容中不含 response_content 時,探測失敗。 當 response_format 為 hex 時,response_content 中的內容為十六進位緊湊格式。 當 response_content 為其他值時,response_content 為普通字串。 |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| Code |
string |
狀態碼。 說明
200 表示成功。 |
200 |
| Message |
string |
傳回資訊。 |
successful |
| RequestId |
string |
請求 ID。 |
68192f5d-0d45-4b98-9724-892813f86c71 |
| Success |
string |
操作是否成功。取值:
|
true |
| Data |
object |
修改任務結果詳情。 |
|
| count |
integer |
監控任務數。 |
1 |
樣本
正常返回樣本
JSON格式
{
"Code": "200",
"Message": "successful",
"RequestId": "68192f5d-0d45-4b98-9724-892813f86c71",
"Success": "true",
"Data": {
"count": 1
}
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | InvalidQueryParameter | %s | |
| 400 | IllegalAddress | Illegal HTTP address | |
| 400 | OperationError | Operation failed | |
| 400 | TaskNotExists | Task does not exist | |
| 400 | OperatorInvalid | %s | |
| 400 | NameRepeat | Task name repeat | |
| 400 | CreateAlarmError | Create alarm error | |
| 400 | NameNotExists | Task name not exists | |
| 400 | OperatorCityInvalid | Invalid Isp. | |
| 401 | AccessDeniedException | You donot have sufficient access to perform this action. | |
| 500 | InternalError | %s | |
| 500 | InternetServerError | System internal error. | |
| 402 | LimitExceeded | The quota for this customer had been reached. | |
| 403 | Forbidden | You are not authorized to operate the specified resource. | |
| 403 | RestrictedUser | The user's operation is restricted, please register NAAM product code. | |
| 403 | UnauthorizedTasks | You are not permitted to operate the specified tasks. | |
| 404 | TaskNotExist | The specified task does not exist. | |
| 406 | ExceedingQuota | Exceeding quota limits. | |
| 429 | ThrottlingException | The request was denied due to request throttling. | |
| 409 | %s | %s |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。