Skip to content

Latest commit

 

History

History
158 lines (100 loc) · 5.31 KB

AuditingApi.md

File metadata and controls

158 lines (100 loc) · 5.31 KB

\AuditingApi

All URIs are relative to https://cloud.mongodb.com

Method HTTP request Description
GetAuditingConfiguration Get /api/atlas/v2/groups/{groupId}/auditLog Return the Auditing Configuration for One Project
UpdateAuditingConfiguration Patch /api/atlas/v2/groups/{groupId}/auditLog Update Auditing Configuration for One Project

GetAuditingConfiguration

AuditLog GetAuditingConfiguration(ctx, groupId).Execute()

Return the Auditing 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 | 

    resp, r, err := sdk.AuditingApi.GetAuditingConfiguration(context.Background(), groupId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `AuditingApi.GetAuditingConfiguration``: %v\n", err)
        apiError := admin.AsError(err)
        fmt.Fprintf(os.Stderr, "Error obj: %v\n", apiError)
    }
    // response from `GetAuditingConfiguration`: AuditLog
    fmt.Fprintf(os.Stdout, "Response from `AuditingApi.GetAuditingConfiguration`: %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 apiGetAuditingConfigurationRequest struct via the builder pattern

Name Type Description Notes

Return type

AuditLog

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]

UpdateAuditingConfiguration

AuditLog UpdateAuditingConfiguration(ctx, groupId, auditLog AuditLog).Execute()

Update Auditing 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 | 
    auditLog := *openapiclient.NewAuditLog() // AuditLog | 

    resp, r, err := sdk.AuditingApi.UpdateAuditingConfiguration(context.Background(), groupId, &auditLog).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `AuditingApi.UpdateAuditingConfiguration``: %v\n", err)
        apiError := admin.AsError(err)
        fmt.Fprintf(os.Stderr, "Error obj: %v\n", apiError)
    }
    // response from `UpdateAuditingConfiguration`: AuditLog
    fmt.Fprintf(os.Stdout, "Response from `AuditingApi.UpdateAuditingConfiguration`: %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 apiUpdateAuditingConfigurationRequest struct via the builder pattern

Name Type Description Notes

auditLog | AuditLog | Updated auditing configuration for the specified project. |

Return type

AuditLog

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]