全部產品
Search
文件中心

Cloud Monitor:ModifySiteMonitor

更新時間:Jun 13, 2026

呼叫 ModifySiteMonitor 介面修改站點監控任務。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

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,例如:[{"city":"546","isp":"465"},{"city":"572","isp":"465"},{"city":"738","isp":"465"}]city分別對應北京、杭州和青島。

說明

您可以透過 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_methodStringHTTP 請求方式,支援三種:GET、POST、HEAD。預設值:GET。
headerString換行符(\n)分隔的自訂 HTTP header。
每行 header 格式需符合 HTTP 協議(使用英文冒號分隔的鍵值)。
cookieStringcookie 和 HTTP 請求標準的寫法一致。
request_contentString請求內容。支援兩種格式:JSON 和表單。不提供時,請求中不含正文。
response_contentString期望的回應內容。探測時會在 HTTP 伺服器傳回的前 64 個位元組進行檢查。
match_ruleString0:回應中不含 response_content 時,探測成功。
1:回應中含 response_content 時,探測成功。
usernameString如果提供 username,則會在 HTTP 請求中攜帶 BasicAuth header。
passwordStringHTTP 請求驗證密碼。
time_outint逾時時間。單位:毫秒。預設值:5。
max_redirectint最大跳轉次數。ECS 探針預設 5 次,營運商探針預設 2 次。
如果需要禁止跳轉,則將該參數設定為:0。
取值範圍:0~50。
  • PING。

名稱類型描述
failure_rateint當 PING 失敗率超過該參數時,探測失敗,傳回 610(PingAllFail)或 615(PingPartialFail)。
預設值:0.1。
ping_numintPING 次數,預設值:20。
取值範圍:1~100。
  • DNS。

名稱類型描述
dns_serverstringDNS 伺服器位址,可以為網域名稱或 IP 位址。
dns_typestringDNS 查詢類型。取值:A、NS、CNAME、MX、TXT、ANY。
expect_valuestring英文空白符分隔的期望值列表。
match_rulestring期望值列表與 DNS 列表的關係,當不滿足指定關係時,探測失敗。
空字串或 IN_DNS:期望值列表是 DNS 列表的子集。
DNS_IN:DNS 列表是期望值列表的子集。
EQUAL:DNS 列表與期望值列表相等。
ANY:DNS 列表與期望值列表有交集(交集不為空)。
  • FTP。

名稱類型描述
portintFTP 伺服器連接埠號。如果不提供,則使用預設值。FTP 預設值:21,FTPs 預設值:990。
usernamestringFTP 使用者名稱。如果未提供,則匿名登入。
passwordstringFTP 密碼。
  • POP3/SMTP。

名稱類型描述
portintPOP3 伺服器連接埠號。POP3 預設值:110,POP3s 預設值:995。
usernamestringPOP3/SMTP 的使用者名稱。
passwordstringPOP3/SMTP 的密碼。
  • TCP/UDP。

名稱類型描述
portintTCP/UDP 伺服器的連接埠。
request_contentstring請求內容。當 request_format 為 hex 時,request_content 內容為十六進位緊湊格式。
request_formatstring當 request_format 為其他值時,request_content 作為普通字串傳送給 TCP/UDP 伺服器。
response_contentstring回應內容。當 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:成功。

  • false:失敗。

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

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情