检索结束日期在未来的所有维护窗口。
所需角色
您可以使用任何指定角色成功调用该终结点。
请求
基本 URL: https://cloud.mongodb.com/api/public/v1.0
GET /groups/{PROJECT-ID}/maintenanceWindows/请求路径参数
名称 | 类型 | 说明 |
|---|---|---|
| 字符串 | 项目的唯一标识符。 |
请求查询参数
名称 | 类型 | 必要性 | 说明 | 默认 |
|---|---|---|---|---|
pretty | 布尔 | Optional | 指示响应正文是否应采用 prettyprint 格式的标记。 |
|
envelope | 布尔 | Optional | 指示是否将响应包装在信封中的标志。 某些 API 客户端无法访问 HTTP 响应标头或状态代码。要解决这个问题,可在查询中设置 envelope=true。 对于返回一个结果的端点,响应体包括:
|
|
请求正文参数
此端点不使用 HTTP 请求正文参数。
响应
响应文档
响应 JSON 文档包括 result 对象数组、link 对象数组和检索到的 result 对象的总数。
名称 | 类型 | 说明 |
|---|---|---|
| 阵列 | 数组为 |
| 阵列 | 数组包含一个或多个指向子资源和/或相关资源的链接。 URL 之间的关系在 Web 链接规范中进行了解释。 |
| 数字 | 结果集中项目总数的整数计数。 如果对整个结果集进行分页,则它可能大于results数组中的对象数。 |
results 嵌入式文档
每个结果都是一个维护窗口。
名称 | 类型 | 说明 |
|---|---|---|
| 字符串 | 维护窗口的唯一标识符。 |
| 字符串 | 此维护窗口适用的项目的唯一标识符。 |
| 字符串 | 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" \ --include \ --request GET "https://cloud.mongodb.com/api/public/v1.0/groups/{PROJECT-ID}/maintenanceWindows"响应示例
响应标头
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 200 OKVary: Accept-EncodingContent-Type: application/jsonStrict-Transport-Security: max-age=300Date: {dateInUnixFormat}Connection: keep-aliveContent-Length: {requestLengthInBytes}X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}响应体
{ "results" : [ { "alertTypeNames" : [ "BACKUP" ], "created" : "2015-10-22T15:04:31Z", "description" : "new description", "endDate" : "2015-10-23T23:30:00Z", "groupId" : "{PROJECT-ID}", "id" : "5628faffd4c606594adaa3b2", "startDate" : "2015-10-23T22:00:00Z", "updated" : "2015-10-22T15:04:31Z", "links" : [] }, { "alertTypeNames" : [ "AGENT", "BACKUP" ], "created" : "2015-10-22T15:40:09Z", "endDate" : "2015-10-23T23:30:00Z", "groupId" : "{PROJECT-ID}", "id" : "56290359d4c606594adaafe8", "startDate" : "2015-10-23T22:00:00Z", "updated" : "2015-10-22T15:40:09Z", "links" : [] } ], "links" : [], "totalCount" : 2}