Devuelve detalles sobre el proyecto especificado. Los proyectos agrupan clústeres en colecciones lógicas que admiten un entorno de aplicación, una carga de trabajo o ambos. Cada proyecto puede tener sus propios usuarios, equipos, seguridad, etiquetas y configuración de alertas. Para usar este recurso, la cuenta de servicio o la clave API solicitantes deben tener el rol de solo lectura del proyecto.
Parámetros de ruta
-
Etiqueta legible por humanos que identifica este proyecto.
La longitud mínima es
1, la longitud máxima es64.
Parámetros de consulta
-
Indicador que indica si la aplicación encapsula la respuesta en un objeto JSON
envelope. Algunos clientes de la API no pueden acceder a los encabezados de respuesta HTTP ni al código de estado. Para solucionar esto, configure envelope=true en la consulta. Los endpoints que devuelven una lista de resultados utilizan el objeto de resultados como encapsulado. La aplicación añade el parámetro de estado al cuerpo de la respuesta.El valor predeterminado es
false. -
Bandera que indica si el cuerpo de la respuesta debe estar en formato prettyprint.
El valor predeterminado es
false.Impresión bonita
atlas api projects getGroupByName --help
import (
"os"
"context"
"log"
sdk "go.mongodb.org/atlas-sdk/v20250219001/admin"
)
func main() {
ctx := context.Background()
clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")
// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth
client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))
if err != nil {
log.Fatalf("Error: %v", err)
}
params = &sdk.GetGroupByNameApiParams{}
sdkResp, httpResp, err := client.ProjectsApi.
GetGroupByNameWithParams(ctx, params).
Execute()
}
curl --include --header "Authorization: Bearer ${ACCESS_TOKEN}" \
--header "Accept: application/vnd.atlas.2025-02-19+json" \
-X GET "https://cloud.mongodb.com/api/atlas/v2/groups/byName/{groupName}?pretty=true"
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
--digest --include \
--header "Accept: application/vnd.atlas.2025-02-19+json" \
-X GET "https://cloud.mongodb.com/api/atlas/v2/groups/byName/{groupName}?pretty=true"
{
"clusterCount": 42,
"created": "2026-05-04T09:42:00Z",
"id": "32b6e34b3d91647abb20e7b8",
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"name": "string",
"orgId": "32b6e34b3d91647abb20e7b8",
"regionUsageRestrictions": "COMMERCIAL_FEDRAMP_REGIONS_ONLY",
"tags": [
{
"key": "string",
"value": "string"
}
],
"withDefaultAlertsSettings": true
}
{
"error": 400,
"detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
"reason": "Bad Request",
"errorCode": "VALIDATION_ERROR"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"error": 404,
"detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
"reason": "Not Found",
"errorCode": "RESOURCE_NOT_FOUND"
}
{
"error": 409,
"detail": "(This is just an example, the exception may not be related to this endpoint) Cannot delete organization link while there is active migration in following project ids: 60c4fd418ebe251047c50554",
"reason": "Conflict",
"errorCode": "CANNOT_DELETE_ORG_ACTIVE_LIVE_MIGRATION_ATLAS_ORG_LINK"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}