将一个维护窗口更新为未来的结束日期。
所需角色
您可以使用以下任何分配的角色成功调用此端点:
请求
基本 URL: https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0
PATCH /groups/{PROJECT-ID}/maintenanceWindows/{MW-ID}请求路径参数
名称 | 类型 | 说明 |
|---|---|---|
| 字符串 | 项目的唯一标识符。 |
| 字符串 | 要更新的维护窗口的唯一标识符。 |
请求查询参数
名称 | 类型 | 必要性 | 说明 | 默认 |
|---|---|---|---|---|
pretty | 布尔 | Optional | 指示响应正文是否采用 pretty-print 格式的标志。 |
|
envelope | 布尔 | Optional | 指示是否将响应包装在信封中的标志。 某些 API 客户端无法访问 HTTP 响应标头或状态代码。要解决这个问题,可在查询中设置 envelope=true。 对于返回一个结果的端点,响应体包括:
|
|
请求正文参数
请求正文必须至少包含以下字段之一:
正文参数 | 类型 | 必要性 | 说明 |
|---|---|---|---|
| 字符串数组 | 必需 | 在维护窗口期间保持静默的警报类型。 例如: |
| 字符串 | 必需 | Timestamp in ISO 8601 date and time format in UTC when the maintenance window starts. |
| 字符串 | 必需 | Timestamp in ISO 8601 date and time format in UTC when the maintenance window ends. |
| 字符串 | Optional | 维护窗口的描述。 |
响应
名称 | 类型 | 说明 |
|---|---|---|
| 字符串 | 维护窗口的唯一标识符。 |
| 字符串 | 此维护窗口适用的项目的唯一标识符。 |
| 字符串 | Timestamp in ISO 8601 date and time format in UTC when the maintenance window was created. |
| 字符串 | Timestamp in ISO 8601 date and time format in UTC when the maintenance window was last updated. |
| 字符串 | Timestamp in ISO 8601 date and time format in UTC when the maintenance window starts. |
| 字符串 | Timestamp in ISO 8601 date and time format in UTC when the maintenance window ends. |
| 字符串数组 | 在维护窗口期间保持静默的警报类型。 例如: |
| 字符串 | 维护窗口的说明。仅当您提供维护窗口的说明时,才会显示此字段。 |
请求示例
curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --include \ --request PATCH "https://<OpsManagerHost>:<Port>/api/public/v1.0/groups/{PROJECT-ID}/maintenanceWindows/{MW-ID}" \ --data ' { "alertTypeNames" : [ "HOST", "REPLICA_SET" ] }'响应示例
响应标头
HTTP/1.1 401 UnauthorizedContent-Type: application/json;charset=ISO-8859-1Date: {dateInUnixFormat}WWW-Authenticate: Digest realm="MMS Public API", domain="", nonce="{nonce}", algorithm=MD5, op="auth", stale=falseContent-Length: {requestLengthInBytes}Connection: keep-aliveHTTP/1.1 201 CreatedVary: Accept-EncodingContent-Type: application/jsonStrict-Transport-Security: max-age=300Date: {dateInUnixFormat}Connection: keep-aliveContent-Length: {requestLengthInBytes}X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}响应体
{ "alertTypeNames" : [ "HOST", "REPLICA_SET" ], "created" : "2015-10-22T20:49:35Z", "description" : "my description", "endDate" : "2015-10-23T23:30:00Z", "groupId" : "{PROJECT-ID}", "id" : "56294bdfd4c643eef5176b73", "startDate" : "2015-10-23T22:00:00Z", "updated" : "2015-10-22T20:49:35Z", "links" : []}