All URIs are relative to https://cloud.mongodb.com
Method | HTTP request | Description |
---|---|---|
CreateAlertConfiguration | Post /api/atlas/v2/groups/{groupId}/alertConfigs | Create One Alert Configuration in One Project |
DeleteAlertConfiguration | Delete /api/atlas/v2/groups/{groupId}/alertConfigs/{alertConfigId} | Remove One Alert Configuration from One Project |
GetAlertConfiguration | Get /api/atlas/v2/groups/{groupId}/alertConfigs/{alertConfigId} | Return One Alert Configuration from One Project |
ListAlertConfigurationMatchersFieldNames | Get /api/atlas/v2/alertConfigs/matchers/fieldNames | Get All Alert Configuration Matchers Field Names |
ListAlertConfigurations | Get /api/atlas/v2/groups/{groupId}/alertConfigs | Return All Alert Configurations for One Project |
ListAlertConfigurationsByAlertId | Get /api/atlas/v2/groups/{groupId}/alerts/{alertId}/alertConfigs | Return All Alert Configurations Set for One Alert |
ToggleAlertConfiguration | Patch /api/atlas/v2/groups/{groupId}/alertConfigs/{alertConfigId} | Toggle One State of One Alert Configuration in One Project |
UpdateAlertConfiguration | Put /api/atlas/v2/groups/{groupId}/alertConfigs/{alertConfigId} | Update One Alert Configuration for One Project |
GroupAlertsConfig CreateAlertConfiguration(ctx, groupId, groupAlertsConfig GroupAlertsConfig).Execute()
Create One Alert Configuration in One Project
package main
import (
"context"
"fmt"
"os"
"go.mongodb.org/atlas-sdk/v20231115008/admin"
)
func main() {
apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY")
apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY")
sdk := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret))
groupId := "32b6e34b3d91647abb20e7b8" // string |
groupAlertsConfig := *openapiclient.NewGroupAlertsConfig() // GroupAlertsConfig |
resp, r, err := sdk.AlertConfigurationsApi.CreateAlertConfiguration(context.Background(), groupId, &groupAlertsConfig).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AlertConfigurationsApi.CreateAlertConfiguration``: %v\n", err)
apiError := admin.AsError(err)
fmt.Fprintf(os.Stderr, "Error obj: %v\n", apiError)
}
// response from `CreateAlertConfiguration`: GroupAlertsConfig
fmt.Fprintf(os.Stdout, "Response from `AlertConfigurationsApi.CreateAlertConfiguration`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
groupId | string | Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access. NOTE: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. |
Other parameters are passed through a pointer to a apiCreateAlertConfigurationRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
groupAlertsConfig | GroupAlertsConfig | Creates one alert configuration for the specified project. |
- Content-Type: application/vnd.atlas.2023-01-01+json
- Accept: application/vnd.atlas.2023-01-01+json, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteAlertConfiguration(ctx, groupId, alertConfigId).Execute()
Remove One Alert Configuration from One Project
package main
import (
"context"
"fmt"
"os"
"go.mongodb.org/atlas-sdk/v20231115008/admin"
)
func main() {
apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY")
apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY")
sdk := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret))
groupId := "32b6e34b3d91647abb20e7b8" // string |
alertConfigId := "32b6e34b3d91647abb20e7b8" // string |
r, err := sdk.AlertConfigurationsApi.DeleteAlertConfiguration(context.Background(), groupId, alertConfigId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AlertConfigurationsApi.DeleteAlertConfiguration``: %v\n", err)
apiError := admin.AsError(err)
fmt.Fprintf(os.Stderr, "Error obj: %v\n", apiError)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
groupId | string | Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access. NOTE: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. | |
alertConfigId | string | Unique 24-hexadecimal digit string that identifies the alert configuration. Use the /alertConfigs endpoint to retrieve all alert configurations to which the authenticated user has access. |
Other parameters are passed through a pointer to a apiDeleteAlertConfigurationRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: application/vnd.atlas.2023-01-01+json, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GroupAlertsConfig GetAlertConfiguration(ctx, groupId, alertConfigId).Execute()
Return One Alert Configuration from One Project
This operation is marked as experimental. It might be changed in the future without compatibility guarantees. For more information see ExperimentalMethods
package main
import (
"context"
"fmt"
"os"
"go.mongodb.org/atlas-sdk/v20231115008/admin"
)
func main() {
apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY")
apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY")
sdk := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret))
groupId := "32b6e34b3d91647abb20e7b8" // string |
alertConfigId := "32b6e34b3d91647abb20e7b8" // string |
resp, r, err := sdk.AlertConfigurationsApi.GetAlertConfiguration(context.Background(), groupId, alertConfigId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AlertConfigurationsApi.GetAlertConfiguration``: %v\n", err)
apiError := admin.AsError(err)
fmt.Fprintf(os.Stderr, "Error obj: %v\n", apiError)
}
// response from `GetAlertConfiguration`: GroupAlertsConfig
fmt.Fprintf(os.Stdout, "Response from `AlertConfigurationsApi.GetAlertConfiguration`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
groupId | string | Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access. NOTE: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. | |
alertConfigId | string | Unique 24-hexadecimal digit string that identifies the alert configuration. Use the /alertConfigs endpoint to retrieve all alert configurations to which the authenticated user has access. |
Other parameters are passed through a pointer to a apiGetAlertConfigurationRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/vnd.atlas.2023-01-01+json, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]string ListAlertConfigurationMatchersFieldNames(ctx).Execute()
Get All Alert Configuration Matchers Field Names
package main
import (
"context"
"fmt"
"os"
"go.mongodb.org/atlas-sdk/v20231115008/admin"
)
func main() {
apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY")
apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY")
sdk := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret))
resp, r, err := sdk.AlertConfigurationsApi.ListAlertConfigurationMatchersFieldNames(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AlertConfigurationsApi.ListAlertConfigurationMatchersFieldNames``: %v\n", err)
apiError := admin.AsError(err)
fmt.Fprintf(os.Stderr, "Error obj: %v\n", apiError)
}
// response from `ListAlertConfigurationMatchersFieldNames`: []string
fmt.Fprintf(os.Stdout, "Response from `AlertConfigurationsApi.ListAlertConfigurationMatchersFieldNames`: %v\n", resp)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiListAlertConfigurationMatchersFieldNamesRequest struct via the builder pattern
[]string
- Content-Type: Not defined
- Accept: application/vnd.atlas.2023-01-01+json, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PaginatedAlertConfig ListAlertConfigurations(ctx, groupId).IncludeCount(includeCount).ItemsPerPage(itemsPerPage).PageNum(pageNum).Execute()
Return All Alert Configurations for One Project
package main
import (
"context"
"fmt"
"os"
"go.mongodb.org/atlas-sdk/v20231115008/admin"
)
func main() {
apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY")
apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY")
sdk := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret))
groupId := "32b6e34b3d91647abb20e7b8" // string |
includeCount := true // bool | (optional) (default to true)
itemsPerPage := int(100) // int | (optional) (default to 100)
pageNum := int(1) // int | (optional) (default to 1)
resp, r, err := sdk.AlertConfigurationsApi.ListAlertConfigurations(context.Background(), groupId).IncludeCount(includeCount).ItemsPerPage(itemsPerPage).PageNum(pageNum).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AlertConfigurationsApi.ListAlertConfigurations``: %v\n", err)
apiError := admin.AsError(err)
fmt.Fprintf(os.Stderr, "Error obj: %v\n", apiError)
}
// response from `ListAlertConfigurations`: PaginatedAlertConfig
fmt.Fprintf(os.Stdout, "Response from `AlertConfigurationsApi.ListAlertConfigurations`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
groupId | string | Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access. NOTE: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. |
Other parameters are passed through a pointer to a apiListAlertConfigurationsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
includeCount | bool | Flag that indicates whether the response returns the total number of items (totalCount) in the response. | [default to true] itemsPerPage | int | Number of items that the response returns per page. | [default to 100] pageNum | int | Number of the page that displays the current set of the total objects that the response returns. | [default to 1]
- Content-Type: Not defined
- Accept: application/vnd.atlas.2023-01-01+json, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PaginatedAlertConfig ListAlertConfigurationsByAlertId(ctx, groupId, alertId).IncludeCount(includeCount).ItemsPerPage(itemsPerPage).PageNum(pageNum).Execute()
Return All Alert Configurations Set for One Alert
This operation is marked as experimental. It might be changed in the future without compatibility guarantees. For more information see ExperimentalMethods
package main
import (
"context"
"fmt"
"os"
"go.mongodb.org/atlas-sdk/v20231115008/admin"
)
func main() {
apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY")
apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY")
sdk := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret))
groupId := "32b6e34b3d91647abb20e7b8" // string |
alertId := "alertId_example" // string |
includeCount := true // bool | (optional) (default to true)
itemsPerPage := int(100) // int | (optional) (default to 100)
pageNum := int(1) // int | (optional) (default to 1)
resp, r, err := sdk.AlertConfigurationsApi.ListAlertConfigurationsByAlertId(context.Background(), groupId, alertId).IncludeCount(includeCount).ItemsPerPage(itemsPerPage).PageNum(pageNum).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AlertConfigurationsApi.ListAlertConfigurationsByAlertId``: %v\n", err)
apiError := admin.AsError(err)
fmt.Fprintf(os.Stderr, "Error obj: %v\n", apiError)
}
// response from `ListAlertConfigurationsByAlertId`: PaginatedAlertConfig
fmt.Fprintf(os.Stdout, "Response from `AlertConfigurationsApi.ListAlertConfigurationsByAlertId`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
groupId | string | Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access. NOTE: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. | |
alertId | string | Unique 24-hexadecimal digit string that identifies the alert. Use the /alerts endpoint to retrieve all alerts to which the authenticated user has access. |
Other parameters are passed through a pointer to a apiListAlertConfigurationsByAlertIdRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
includeCount | bool | Flag that indicates whether the response returns the total number of items (totalCount) in the response. | [default to true] itemsPerPage | int | Number of items that the response returns per page. | [default to 100] pageNum | int | Number of the page that displays the current set of the total objects that the response returns. | [default to 1]
- Content-Type: Not defined
- Accept: application/vnd.atlas.2023-01-01+json, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GroupAlertsConfig ToggleAlertConfiguration(ctx, groupId, alertConfigId, alertsToggle AlertsToggle).Execute()
Toggle One State of One Alert Configuration in One Project
package main
import (
"context"
"fmt"
"os"
"go.mongodb.org/atlas-sdk/v20231115008/admin"
)
func main() {
apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY")
apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY")
sdk := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret))
groupId := "32b6e34b3d91647abb20e7b8" // string |
alertConfigId := "32b6e34b3d91647abb20e7b8" // string |
alertsToggle := *openapiclient.NewAlertsToggle() // AlertsToggle |
resp, r, err := sdk.AlertConfigurationsApi.ToggleAlertConfiguration(context.Background(), groupId, alertConfigId, &alertsToggle).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AlertConfigurationsApi.ToggleAlertConfiguration``: %v\n", err)
apiError := admin.AsError(err)
fmt.Fprintf(os.Stderr, "Error obj: %v\n", apiError)
}
// response from `ToggleAlertConfiguration`: GroupAlertsConfig
fmt.Fprintf(os.Stdout, "Response from `AlertConfigurationsApi.ToggleAlertConfiguration`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
groupId | string | Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access. NOTE: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. | |
alertConfigId | string | Unique 24-hexadecimal digit string that identifies the alert configuration that triggered this alert. Use the /alertConfigs endpoint to retrieve all alert configurations to which the authenticated user has access. |
Other parameters are passed through a pointer to a apiToggleAlertConfigurationRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
alertsToggle | AlertsToggle | Enables or disables the specified alert configuration in the specified project. |
- Content-Type: application/vnd.atlas.2023-01-01+json
- Accept: application/vnd.atlas.2023-01-01+json, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GroupAlertsConfig UpdateAlertConfiguration(ctx, groupId, alertConfigId, groupAlertsConfig GroupAlertsConfig).Execute()
Update One Alert Configuration for One Project
package main
import (
"context"
"fmt"
"os"
"go.mongodb.org/atlas-sdk/v20231115008/admin"
)
func main() {
apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY")
apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY")
sdk := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret))
groupId := "32b6e34b3d91647abb20e7b8" // string |
alertConfigId := "32b6e34b3d91647abb20e7b8" // string |
groupAlertsConfig := *openapiclient.NewGroupAlertsConfig() // GroupAlertsConfig |
resp, r, err := sdk.AlertConfigurationsApi.UpdateAlertConfiguration(context.Background(), groupId, alertConfigId, &groupAlertsConfig).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AlertConfigurationsApi.UpdateAlertConfiguration``: %v\n", err)
apiError := admin.AsError(err)
fmt.Fprintf(os.Stderr, "Error obj: %v\n", apiError)
}
// response from `UpdateAlertConfiguration`: GroupAlertsConfig
fmt.Fprintf(os.Stdout, "Response from `AlertConfigurationsApi.UpdateAlertConfiguration`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
groupId | string | Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access. NOTE: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. | |
alertConfigId | string | Unique 24-hexadecimal digit string that identifies the alert configuration. Use the /alertConfigs endpoint to retrieve all alert configurations to which the authenticated user has access. |
Other parameters are passed through a pointer to a apiUpdateAlertConfigurationRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
groupAlertsConfig | GroupAlertsConfig | Updates one alert configuration in the specified project. |
- Content-Type: application/vnd.atlas.2023-01-01+json
- Accept: application/vnd.atlas.2023-01-01+json, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]