创建一个维护窗口。 Cloud Manager会在您指定的时间内关闭某些警报类型的警报通知,以允许进行维护。
所需角色
您可以使用以下任何分配的角色成功调用此端点:
请求
基本 URL: https://cloud.mongodb.com/api/public/v1.0
POST /groups/{PROJECT-ID}/maintenanceWindows/
请求路径参数
名称 | 类型 | 说明 |
|---|---|---|
| 字符串 | 项目的唯一标识符。 |
请求查询参数
请求正文参数
正文参数 | 类型 | 必要性 | 说明 |
|---|---|---|---|
| 字符串数组 | 必需 | 在维护窗口期间保持静默的警报类型。 例如: |
| 字符串 | 必需 | 维护窗口启动时采用 ISO8601 日期和时间格式(UTC 时间)的时间戳。 |
| 字符串 | 必需 | 维护窗口结束时采用 ISO 8601 日期和时间格式(UTC 时间)的时间戳。 |
| 字符串 | Optional | 维护窗口的描述。 |
响应
名称 | 类型 | 说明 |
|---|---|---|
| 字符串 | 维护窗口的唯一标识符。 |
| 字符串 | 此维护窗口适用的项目的唯一标识符。 |
| 字符串 | 创建维护窗口时采用 ISO 8601 日期和时间格式(UTC 时间)的时间戳。 |
| 字符串 | 上次更新维护窗口时采用 ISO 8601 日期和时间格式(UTC 时间)的时间戳。 |
| 字符串 | 维护窗口启动时采用 ISO8601 日期和时间格式(UTC 时间)的时间戳。 |
| 字符串 | 维护窗口结束时采用 ISO 8601 日期和时间格式(UTC 时间)的时间戳。 |
| 字符串数组 | 在维护窗口期间保持静默的警报类型。 例如: |
| 字符串 | 维护窗口的描述。 仅当您提供维护窗口的说明时才会返回此字段。 |
请求示例
1 curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \ 2 --header "Accept: application/json" \ 3 --header "Content-Type: application/json" \ 4 --include \ 5 --request POST "https://cloud.mongodb.com/api/public/v1.0/groups/{PROJECT-ID}/maintenanceWindows" \ 6 --data ' 7 { 8 "startDate" :"2015-10-23T22:00:00Z", 9 "endDate" : "2015-10-23T23:30:00Z", 10 "alertTypeNames" : [ "HOST", "REPLICA_SET" ], 11 "description" : "new description" 12 }'
响应示例
响应标头
401 Unauthorized Content-Type: application/json;charset=ISO-8859-1 Date: {dateInUnixFormat} WWW-Authenticate: Digest realm="MMS Public API", domain="", nonce="{nonce}", algorithm=MD5, op="auth", stale=false Content-Length: {requestLengthInBytes} Connection: keep-alive
200 OK Vary: Accept-Encoding Content-Type: application/json Strict-Transport-Security: max-age=300 Date: {dateInUnixFormat} Connection: keep-alive Content-Length: {requestLengthInBytes} X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}
响应体
1 { 2 "alertTypeNames" : [ "REPLICA_SET" ], 3 "created" : "2015-10-22T20:49:35Z", 4 "description" : "my description", 5 "endDate" : "2015-10-23T23:30:00Z", 6 "groupId" : "{PROJECT-ID}", 7 "id" : "56294bdfd4c643eef5176b73", 8 "startDate" : "2015-10-23T22:00:00Z", 9 "updated" : "2015-10-22T20:49:35Z", 10 "links" : [] 11 }