Atualizar uma integração de serviços de terceiros
Updates the settings for configuring integration with one third-party service. These settings apply to all databases managed in one MongoDB Cloud project. To use this resource, the requesting Service Account or API Key must have the Organization Owner or Project Owner role. Enabling log export to S3, Splunk, and Datadog is currently in preview. Please contact your Customer Success Manager (CSM) for access.
parâmetros de caminho
-
Etiqueta legível por humanos que identifica o serviço que você deseja integrar ao MongoDB Cloud.
Os valores são
PAGER_DUTY
,SLACK
,DATADOG
,NEW_RELIC
,OPS_GENIE
,VICTOR_OPS
,WEBHOOK
,HIP_CHAT
,PROMETHEUS
ouMICROSOFT_TEAMS
. -
Sequência única de 24dígitos hexadecimais que identifica seu projeto. Use o endpoint /groups para extrair todos os projetos aos quais o usuário autenticado tem acesso.
AVISO: grupos e projetos são termos sinônimos. O ID do seu grupo é igual ao ID do seu projeto. Para grupos existentes, o ID do grupo/projeto permanece o mesmo. O recurso e os endpoints correspondentes usam o termo grupos.
O formato deve corresponder ao seguinte padrão:
^([a-f0-9]{24})$
.
parâmetros de query
-
Sinalizador que indica se o aplicativo empacota a resposta em um objeto JSON
envelope
. Alguns clientes de API não podem acessar os cabeçalhos de resposta HTTP ou o código de status. Para corrigir isso, defina envelope=true na consulta. Os endpoints que retornam uma lista de resultados usam o objeto de resultados como um envelope. O aplicativo adiciona o parâmetro de status ao corpo da resposta.O valor padrão é
false
. -
Sinalizador que indica se a resposta retorna o número total de itens (totalCount) na resposta.
O valor padrão é
true
. -
Número de itens que a resposta retorna por página.
O valor mínimo é
1
, o valor máximo é500
. O valor padrão é100
. -
Número da página que exibe o conjunto atual dos objetos totais que a resposta retorna.
O valor mínimo é
1
. O valor padrão é1
. -
Sinalizador que indica se o corpo da resposta deve estar no formato prettyprint.
O valor padrão é
false
.Prettyprint
atlas api thirdPartyIntegrations updateGroupIntegration --help
import (
"os"
"context"
"log"
sdk "go.mongodb.org/atlas-sdk/v20241023001/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.UpdateGroupIntegrationApiParams{}
sdkResp, httpResp, err := client.Third - PartyIntegrationsApi.
UpdateGroupIntegrationWithParams(ctx, params).
Execute()
}
curl --include --header "Authorization: Bearer ${ACCESS_TOKEN}" \
--header "Accept: application/vnd.atlas.2024-10-23+json" \
--header "Content-Type: application/json" \
-X PUT "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/integrations/{integrationType}" \
-d '{ <Payload> }'
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
--digest --include \
--header "Accept: application/vnd.atlas.2024-10-23+json" \
--header "Content-Type: application/json" \
-X PUT "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/integrations/{integrationType}" \
-d '{ <Payload> }'
{
"id": "string",
"type": "PAGER_DUTY",
"region": "US",
"serviceKey": "****************************7890"
}
{
"id": "string",
"type": "SLACK",
"apiToken": "**********************************************************************abcd",
"channelName": "alerts",
"teamName": "MongoDB"
}
{
"id": "string",
"type": "DATADOG",
"apiKey": "****************************a23c",
"region": "US",
"sendCollectionLatencyMetrics": false,
"sendDatabaseMetrics": false,
"sendQueryStatsMetrics": false,
"sendUserProvidedResourceTags": false
}
{
"id": "string",
"type": "NEW_RELIC",
"accountId": "bcc3c81b344a6030a3935c2527e2216535af7718",
"licenseKey": "bc3768f44193c282b2688ab39e00f8e4fc8d75ea",
"readToken": "193c96aee4a3ac640b98634562e2631f17ae0a69",
"writeToken": "a67b10e5cd7f8fb6a34b501136c409f373edc218"
}
{
"id": "string",
"type": "OPS_GENIE",
"apiKey": "********************************a111",
"region": "US"
}
{
"id": "string",
"type": "VICTOR_OPS",
"apiKey": "********************************9abc",
"routingKey": "test routing"
}
{
"id": "string",
"type": "WEBHOOK",
"secret": "string",
"url": "https://webhook.com/****"
}
{
"id": "string",
"type": "PROMETHEUS",
"enabled": true,
"password": "string",
"sendUserProvidedResourceTagsEnabled": false,
"serviceDiscovery": "http",
"username": "prom_user_618d48e05277a606ed2496fe"
}
{
"id": "string",
"type": "MICROSOFT_TEAMS",
"microsoftTeamsWebhookUrl": "https://webhook.com/****"
}
{
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"results": [
{
"id": "string",
"type": "PAGER_DUTY",
"region": "US",
"serviceKey": "****************************7890"
}
],
"totalCount": 42
}
{
"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": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}