Get All Projects in an Organization
Nesta página
- A autenticação OAuth 2.0 para acesso programático ao Cloud Manager está disponível como um recurso de visualização.
- O recurso e a documentação correspondente podem mudar a qualquer momento durante o período de Pré-visualização. Para usar a 2.0 autenticação OAuth, crie uma conta de serviço para usar em suas solicitações para a API pública do Cloud Manager .
URL base: https://cloud.mongodb.com/api/public/v1.0
Resource
GET /orgs/{ORG-ID}/groups
Parâmetros da solicitação
Parâmetros do caminho da solicitação
Elemento do caminho | Tipo | Descrição |
---|---|---|
ORG-ID | Obrigatório. | The unique identifier for the organization whose information you want to retrieve. |
Solicitar parâmetros de query
Os seguintes parâmetros de query são opcionais:
Nome | Tipo | Descrição | Default |
---|---|---|---|
| inteiro | Número da página (com base em 1). |
|
| inteiro | Número de itens a serem devolvidos por página, até um máximo de 500. |
|
| booleano | Exibe a resposta em uma pretty-print formato. |
|
| booleano | Especifica se deseja ou não envolver a resposta em um envelope. |
|
| string | Human-readable label of the project to use to filter the returned
list. Performs a case-insensitive search for a project, which is
prefixed by the specified For example, if you specify a | none |
Parâmetros do corpo da solicitação
Este endpoint não usa parâmetros do corpo da solicitação HTTP.
Resposta
documento de resposta
O documento JSON de resposta inclui uma array de objetos result , uma array de objetos link e uma contagem do número total de objetos result recuperados.
Nome | Tipo | Descrição |
---|---|---|
| array | A array inclui um objeto para cada item detalhado na seção |
| array | A array inclui um ou mais links para sub-recursos e/ou recursos relacionados. As relações entre URLs são explicadas na Especificação de links da web. |
| número | Contagem de números inteiros do número total de itens no conjunto de resultados. Pode ser maior que o número de objetos na array results se todo o conjunto de resultados for paginado. |
results
documento incorporado
Cada resultado é um projeto.
Nome | Tipo | Descrição |
---|---|---|
ActiveAgentCount | inteiro | The number of active monitoring, automation, and Backups in the project. |
hostCounts | Document | Describes the host types and number of each host type for the cluster. |
hostCounts.arbiter | inteiro | The number of arbiter hosts in the cluster. |
hostCounts.config | inteiro | The number of sharded cluster configuration server hosts in the cluster. |
hostCounts.mongos | inteiro | The number of mongos hosts in the cluster. |
hostCounts.primary | inteiro | The number of primary hosts in the cluster. |
hostCounts.secondary | inteiro | The number of secondary hosts in the cluster. |
id | string | The unique identifier for the project. |
links | array de objetos | Um ou mais links para sub-recursos e/ou recursos relacionados. Todas as arrays |
name | string | The name of the cluster. |
orgId | string | The unique identifier for the parent organization of the project. |
publicApiEnabled | booleano | The status of API access to the cluster. |
replicaSetCount | inteiro | The number of replica sets in the cluster. |
shardCount | inteiro | The number of shards in the cluster. |
Exemplo de solicitação
curl --user "{username:apiKey}" \ --include \ --header "Content-Type: application/json" \ --digest GET "https://cloud.mongodb.com/api/public/v1.0/orgs/{ORG-ID}/groups"
Exemplo de resposta
Cabeçalho de resposta
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}
Corpo de resposta
{ "links": [{ }], "results": [{ "activeAgentCount": 0, "hostCounts": { "arbiter": 0, "config": 0, "mongos": 0, "primary": 1, "secondary": 2 }, "id": "{PROJECT-ID}", "links": [{ }], "name": "Production Cluster", "orgId": "{ORG-ID}", "publicApiEnabled": true, "replicaSetCount": 1, "shardCount": 0 }, { "activeAgentCount": 0, "hostCounts": { "arbiter": 0, "config": 0, "mongos": 0, "primary": 1, "secondary": 2 }, "id": "{PROJECT-ID}", "lastActiveAgent": "2017-10-26T02:39:59Z", "links": [{ }], "name": "Staging Cluster", "orgId": "{ORG-ID}", "publicApiEnabled": true, "replicaSetCount": 1, "shardCount": 0 } ], "totalCount": 2 }