检索结束日期为将来的一个维护窗口。
所需角色
您可以使用任何指定角色成功调用该终结点。
请求
基本 URL: https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0
GET /groups/{PROJECT-ID}/maintenanceWindows/{MW-ID}请求路径参数
名称 | 类型 | 说明 |
|---|---|---|
| 字符串 | 项目的唯一标识符。 |
| 字符串 | 要检索的维护窗口的唯一标识符。 |
请求查询参数
名称 | 类型 | 必要性 | 说明 | 默认 |
|---|---|---|---|---|
pretty | 布尔 | Optional | 指示响应正文是否采用 pretty-print 格式的标志。 |
|
envelope | 布尔 | Optional | 指示是否将响应包装在信封中的标志。 某些 API 客户端无法访问 HTTP 响应标头或状态代码。要解决这个问题,可在查询中设置 envelope=true。 对于返回一个结果的端点,响应体包括:
|
|
请求正文参数
此端点不使用 HTTP 请求正文参数。
响应
名称 | 类型 | 说明 |
|---|---|---|
| 字符串 | 维护窗口的唯一标识符。 |
| 字符串 | 此维护窗口适用的项目的唯一标识符。 |
| 字符串 | 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://<OpsManagerHost>:<Port>/api/public/v1.0/groups/{PROJECT-ID}/maintenanceWindows/{MW-ID}"响应示例
响应标头
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}响应体
{ "alertTypeNames" : [ "AGENT", "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" : []}