路径参数
-
唯一的24 -十六进制数字字符串,用于标识包含项目的组织。使用 /orgs 端点检索身份验证的用户有权访问权限的所有组织。
格式应符合以下模式:
^([a-f0-9]{24})$
。
查询参数
-
指示应用程序是否将响应包装在
envelope
JSON 对象中的标志。某些 API 客户端无法访问 HTTP 响应标头或状态代码。要修复此问题,请在查询中设置 Envelope=true。返回结果列表的端点将结果对象用作 envelope。应用程序将状态参数添加到响应正文中。默认值为
false
。 -
指示响应正文是否应采用 prettyprint 格式的标记。
默认值为
false
。Prettyprint
body
必需
要更新指定组织设置的详细信息。
-
指示是否要求 API 操作源自添加到指定组织的 API 访问列表中的 IP 地址的标志。
-
指示该组织是否有权访问权限生成AI功能的标志。 此设置仅适用于Atlas商业版,并且默认处于启用状态。 开启此设置后,项目所有者也许能够在项目级别启用或禁用单个AI功能。
默认值为
true
。生成式 AI 常见问题解答 -
一个数字,表示指定组织内新的Atlas Admin API服务帐户密钥在过期之前的最长时间(以小时为单位)。
最小值为
8
,最大值为8760
。 -
指示是否要求用户在访问指定组织之前设置多重身份验证 (MFA)的标记。如需了解更多信息,请访问:https://www.mongodb.com/zh-cn/docs/atlas/security-multi-factor-authentication/。
-
该标志指示是否阻止 MongoDB 支持团队在未获得明确许可的情况下访问指定组织中任何部署的 Atlas 基础架构和集群日志。启用此设置后,您可以向 MongoDB 支持团队授予对 Atlas 部署的 24 小时旁路访问权限,以解决支持问题。如需了解更多信息,请访问:https://www.mongodb.com/zh-cn/docs/atlas/security-restrict-support-access/。
-
string字符串,为指定组织指定单个电子邮件解决,用于接收安全相关通知。指定安全联系并不授予他们授权或访问权限Atlas以进行安全决策或批准。 string空字符串有效,会清除现有安全联系(如有)。
-
指示该组织中群组的Atlas Stream Processing实例是否可以创建与同一组织中其他群组集群的连接的标志。
atlas api organizations updateOrgSettings --help
import (
"os"
"context"
"log"
sdk "go.mongodb.org/atlas-sdk/v20241113001/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.UpdateOrgSettingsApiParams{}
sdkResp, httpResp, err := client.OrganizationsApi.
UpdateOrgSettingsWithParams(ctx, params).
Execute()
}
curl --include --header "Authorization: Bearer ${ACCESS_TOKEN}" \
--header "Accept: application/vnd.atlas.2024-11-13+json" \
--header "Content-Type: application/json" \
-X PATCH "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/settings" \
-d '{ <Payload> }'
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
--digest --include \
--header "Accept: application/vnd.atlas.2024-11-13+json" \
--header "Content-Type: application/json" \
-X PATCH "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/settings" \
-d '{ <Payload> }'
{
"apiAccessListRequired": true,
"genAIFeaturesEnabled": true,
"maxServiceAccountSecretValidityInHours": 42,
"multiFactorAuthRequired": true,
"restrictEmployeeAccess": true,
"securityContact": "string",
"streamsCrossGroupEnabled": true
}
{
"apiAccessListRequired": true,
"genAIFeaturesEnabled": true,
"maxServiceAccountSecretValidityInHours": 42,
"multiFactorAuthRequired": true,
"restrictEmployeeAccess": true,
"securityContact": "string",
"streamsCrossGroupEnabled": 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": 429,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Too Many Requests",
"errorCode": "RATE_LIMITED"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}