circle-info
Squadcast is now SolarWinds Incident Response

AuditLogs

Overview

Available Operations

  • List - List all Audit Logs

  • Export - Initiate an asynchronous export of audit logs based on the provided filters. The export file will be generated and available for download. Use 'Get details of Audit Logs export history by ID' API to retrieve the download URL.

  • ListExportHistory - List all Audit Logs export history

  • GetExportHistoryByID - Get details of Audit Logs export history by ID

  • GetByID - Get audit log by ID

List

List all Audit Logs Returns array of audit logs for given team and filters

Example Usage

package main

import(
	"context"
	"os"
	squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
	"github.com/solarwinds/squadcast-sdk-go/types"
	"github.com/solarwinds/squadcast-sdk-go/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := squadcastsdk.New(
        squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_BEARER_AUTH")),
    )

    res, err := s.AuditLogs.List(ctx, operations.AuditLogsListAuditLogsRequest{
        PageSize: 832442,
        PageNumber: 555332,
        StartDate: types.MustDateFromString("2023-03-04"),
        EndDate: types.MustDateFromString("2024-08-07"),
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.V3AuditLogsListAuditLogsResponse != nil {
        for {
            // handle items

            res, err = res.Next()

            if err != nil {
                // handle error
            }

            if res == nil {
                break
            }
        }
    }
}

Parameters

Parameter
Type
Required
Description

ctx

✔️

The context to use for the request.

request

✔️

The request object to use for the request.

opts

The options for this request.

Response

*operations.AuditLogsListAuditLogsResponse, error

Errors

Error Type
Status Code
Content Type

apierrors.BadRequestError

400

application/json

apierrors.UnauthorizedError

401

application/json

apierrors.PaymentRequiredError

402

application/json

apierrors.ForbiddenError

403

application/json

apierrors.NotFoundError

404

application/json

apierrors.ConflictError

409

application/json

apierrors.UnprocessableEntityError

422

application/json

apierrors.InternalServerError

500

application/json

apierrors.BadGatewayError

502

application/json

apierrors.ServiceUnavailableError

503

application/json

apierrors.GatewayTimeoutError

504

application/json

apierrors.APIError

4XX, 5XX

*/*

Export

Export Audit logs Initiates export of audit logs based on provided filters

Example Usage

Parameters

Parameter
Type
Required
Description

ctx

✔️

The context to use for the request.

request

✔️

The request object to use for the request.

opts

The options for this request.

Response

*operations.AuditLogsExportAuditLogsResponse, error

Errors

Error Type
Status Code
Content Type

apierrors.BadRequestError

400

application/json

apierrors.UnauthorizedError

401

application/json

apierrors.PaymentRequiredError

402

application/json

apierrors.ForbiddenError

403

application/json

apierrors.NotFoundError

404

application/json

apierrors.ConflictError

409

application/json

apierrors.UnprocessableEntityError

422

application/json

apierrors.InternalServerError

500

application/json

apierrors.BadGatewayError

502

application/json

apierrors.ServiceUnavailableError

503

application/json

apierrors.GatewayTimeoutError

504

application/json

apierrors.APIError

4XX, 5XX

*/*

ListExportHistory

List all Audit Logs export history Returns array of audit logs export history

Example Usage

Parameters

Parameter
Type
Required
Description

ctx

✔️

The context to use for the request.

pageSize

int64

✔️

N/A

pageNumber

int64

✔️

N/A

opts

The options for this request.

Response

*operations.AuditLogsListAuditLogsExportHistoryResponse, error

Errors

Error Type
Status Code
Content Type

apierrors.BadRequestError

400

application/json

apierrors.UnauthorizedError

401

application/json

apierrors.PaymentRequiredError

402

application/json

apierrors.ForbiddenError

403

application/json

apierrors.NotFoundError

404

application/json

apierrors.ConflictError

409

application/json

apierrors.UnprocessableEntityError

422

application/json

apierrors.InternalServerError

500

application/json

apierrors.BadGatewayError

502

application/json

apierrors.ServiceUnavailableError

503

application/json

apierrors.GatewayTimeoutError

504

application/json

apierrors.APIError

4XX, 5XX

*/*

GetExportHistoryByID

Get details of Audit Logs export history by ID Returns audit log export history details for the specified ID

Example Usage

Parameters

Parameter
Type
Required
Description

ctx

✔️

The context to use for the request.

id

string

✔️

N/A

opts

The options for this request.

Response

*operations.AuditLogsGetAuditLogsExportHistoryByIDResponse, error

Errors

Error Type
Status Code
Content Type

apierrors.BadRequestError

400

application/json

apierrors.UnauthorizedError

401

application/json

apierrors.PaymentRequiredError

402

application/json

apierrors.ForbiddenError

403

application/json

apierrors.NotFoundError

404

application/json

apierrors.ConflictError

409

application/json

apierrors.UnprocessableEntityError

422

application/json

apierrors.InternalServerError

500

application/json

apierrors.BadGatewayError

502

application/json

apierrors.ServiceUnavailableError

503

application/json

apierrors.GatewayTimeoutError

504

application/json

apierrors.APIError

4XX, 5XX

*/*

GetByID

Get audit log by ID Returns audit log details for the specified ID

Example Usage

Parameters

Parameter
Type
Required
Description

ctx

✔️

The context to use for the request.

id

string

✔️

N/A

opts

The options for this request.

Response

*operations.AuditLogsGetAuditLogByIDResponse, error

Errors

Error Type
Status Code
Content Type

apierrors.BadRequestError

400

application/json

apierrors.UnauthorizedError

401

application/json

apierrors.PaymentRequiredError

402

application/json

apierrors.ForbiddenError

403

application/json

apierrors.NotFoundError

404

application/json

apierrors.ConflictError

409

application/json

apierrors.UnprocessableEntityError

422

application/json

apierrors.InternalServerError

500

application/json

apierrors.BadGatewayError

502

application/json

apierrors.ServiceUnavailableError

503

application/json

apierrors.GatewayTimeoutError

504

application/json

apierrors.APIError

4XX, 5XX

*/*

Last updated