Skip to content

Latest commit

 

History

History
632 lines (406 loc) · 24.3 KB

AlertConfigurationsApi.md

File metadata and controls

632 lines (406 loc) · 24.3 KB

\AlertConfigurationsApi

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

CreateAlertConfiguration

GroupAlertsConfig CreateAlertConfiguration(ctx, groupId, groupAlertsConfig GroupAlertsConfig).Execute()

Create One Alert Configuration in One Project

Example

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)
}

Path Parameters

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

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. |

Return type

GroupAlertsConfig

Authorization

DigestAuth

HTTP request headers

  • 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

DeleteAlertConfiguration(ctx, groupId, alertConfigId).Execute()

Remove One Alert Configuration from One Project

Example

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)
    }
}

Path Parameters

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

Other parameters are passed through a pointer to a apiDeleteAlertConfigurationRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

DigestAuth

HTTP request headers

  • 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]

GetAlertConfiguration

GroupAlertsConfig GetAlertConfiguration(ctx, groupId, alertConfigId).Execute()

Return One Alert Configuration from One Project

Experimental

This operation is marked as experimental. It might be changed in the future without compatibility guarantees. For more information see ExperimentalMethods

Example

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)
}

Path Parameters

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

Other parameters are passed through a pointer to a apiGetAlertConfigurationRequest struct via the builder pattern

Name Type Description Notes

Return type

GroupAlertsConfig

Authorization

DigestAuth

HTTP request headers

  • 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]

ListAlertConfigurationMatchersFieldNames

[]string ListAlertConfigurationMatchersFieldNames(ctx).Execute()

Get All Alert Configuration Matchers Field Names

Example

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)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiListAlertConfigurationMatchersFieldNamesRequest struct via the builder pattern

Return type

[]string

Authorization

DigestAuth

HTTP request headers

  • 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]

ListAlertConfigurations

PaginatedAlertConfig ListAlertConfigurations(ctx, groupId).IncludeCount(includeCount).ItemsPerPage(itemsPerPage).PageNum(pageNum).Execute()

Return All Alert Configurations for One Project

Example

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)
}

Path Parameters

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

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]

Return type

PaginatedAlertConfig

Authorization

DigestAuth

HTTP request headers

  • 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]

ListAlertConfigurationsByAlertId

PaginatedAlertConfig ListAlertConfigurationsByAlertId(ctx, groupId, alertId).IncludeCount(includeCount).ItemsPerPage(itemsPerPage).PageNum(pageNum).Execute()

Return All Alert Configurations Set for One Alert

Experimental

This operation is marked as experimental. It might be changed in the future without compatibility guarantees. For more information see ExperimentalMethods

Example

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)
}

Path Parameters

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

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]

Return type

PaginatedAlertConfig

Authorization

DigestAuth

HTTP request headers

  • 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]

ToggleAlertConfiguration

GroupAlertsConfig ToggleAlertConfiguration(ctx, groupId, alertConfigId, alertsToggle AlertsToggle).Execute()

Toggle One State of One Alert Configuration in One Project

Example

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)
}

Path Parameters

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

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. |

Return type

GroupAlertsConfig

Authorization

DigestAuth

HTTP request headers

  • 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]

UpdateAlertConfiguration

GroupAlertsConfig UpdateAlertConfiguration(ctx, groupId, alertConfigId, groupAlertsConfig GroupAlertsConfig).Execute()

Update One Alert Configuration for One Project

Example

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)
}

Path Parameters

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

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. |

Return type

GroupAlertsConfig

Authorization

DigestAuth

HTTP request headers

  • 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]