对于 AI 代理:可在 https://www.mongodb.com/zh-cn/docs/llms.txt 获取文档索引—通过在任何 URL 路径后添加 .md 可获取所有页面的 Markdown 版本。

从集群中返回排名的命名空间

返回指定集群中的命名空间子集,这些命名空间按指定时间窗口内的最高总执行时间降序排序。

基本 URL: https://cloud.mongodb.com/api/public/v1.0

GET /groups/{PROJECT-ID}/clusters/{hostClusterId}/{clusterView}/collStats/namespaces
Parameter
类型
说明

PROJECT-ID

字符串

(必需。) 唯一的 24-十六进制数字string ,用于标识包含固定命名空间的项目。

hostClusterId

字符串

(必需。) 包含固定命名空间的集群的唯一标识符。

clusterView

字符串

(必需。) 标识集群拓扑结构的名称。 值包括:

  • PRIMARY

  • SECONDARY

  • INDIVIDUAL_PROCESS

所有参数都是可选的。

名称
类型
说明
默认

pretty

布尔

指示显示正文是否应采用 prettyprint 格式。

false

envelope

布尔

指示是否要将响应封装在信封中。

false

period

字符串

采用 ISO 8601 表示法的持续时间,用于指定检索过去多久的测量值。如果指定此值,则无法指定 start 和 end。

示例,要请求最近36小时的数据,请包含以下查询参数: period=P1DT12H 。

开始

字符串

Timestamp in ISO 8601 date and time format in UTC for the beginning of the period for which to retrieve measurements. If you specify start you must also specify end and you can't specify period.

end

字符串

Timestamp in ISO 8601 date and time format in UTC for the end of the period for which to retrieve measurements. If you specify end you must also specify start and you can't specify period.

此端点不使用 HTTP 请求正文参数。

名称
类型
说明

groupId

字符串

唯一的 24-十六进制数字string ,用于标识包含命名空间的项目。

identifierId

字符串

测量所属集群的唯一标识符。

rankedNamespaces

字符串

列表,其中包含指定集群中的每个命名空间,按指定时间窗口内的最高总执行时间降序排序。

curl --user '{PUBLIC-KEY}:{PRIVATE-KEY}' --digest \ --header 'Accept: application/json' \ --include \ --request GET 'https://{CLOUD-MANAGER-HOST}:{PORT}/api/public/v1.0/groups/{PROJECT-ID}/clusters/{hostClusterId}/{clusterView}/collStats/namespaces?pretty=true&period={period}'
HTTP/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}
{ "groupId": "{PROJECT-ID}", "identifierId": "{hostClusterId}", "rankedNamespaces": [ "smol.dbA", "sample_mflix.movies", "sample_supplies.sales", "sample_mflix.theaters", "sample_guides.planets", "smol.dbD", "sample_restaurants.restaurants", "sample_mflix.embedded_movies", "sample_training.companies", "smol.floof", "sample_mflix.sessions", "smol.dbC", "sample_mflix.comments", "sample_training.trips", "sample_analytics.accounts", "sample_training.grades", "sample_airbnb.listingsAndReviews", "smol.dbB", "sample_training.posts", "sample_weatherdata.data" ]}