Menu Docs

Get All Projects in an Organization

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

GET /orgs/{ORG-ID}/groups
Elemento do caminho
Tipo
Descrição

ORG-ID

Obrigatório.

The unique identifier for the organization whose information you want to retrieve.

Os seguintes parâmetros de query são opcionais:

Nome
Tipo
Descrição
Default

pageNum

inteiro

Número da página (com base em 1).

1

itemsPerPage

inteiro

Número de itens a serem devolvidos por página, até um máximo de 500.

100

pretty

booleano

Exibe a resposta em uma pretty-print formato.

false

envelope

booleano

Especifica se deseja ou não envolver a resposta em um envelope.

false

name

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 name, within the organization.

For example, if you specify a name query parameter of project1, Cloud Manager returns the project named project1, but would not return a project named project123.

none

Este endpoint não usa parâmetros do corpo da solicitação HTTP.

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

results

array

A array inclui um objeto para cada item detalhado na seção results Documento incorporado.

links

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.

totalCount

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.

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 links nas respostas incluem pelo menos um link chamado self. Os relacionamentos entre URLs são explicados na Especificação de links da web.

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.

curl --user "{username:apiKey}" \
--include \
--header "Content-Type: application/json" \
--digest GET "https://cloud.mongodb.com/api/public/v1.0/orgs/{ORG-ID}/groups"
HTTP/1.1 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
HTTP/1.1 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}
{
"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
}