audit_logs

package
v2.0.0-beta.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditLogListParams

type AuditLogListParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	// Finds a specific log by its ID.
	ID     param.Field[string]                   `query:"id"`
	Action param.Field[AuditLogListParamsAction] `query:"action"`
	Actor  param.Field[AuditLogListParamsActor]  `query:"actor"`
	// Limits the returned results to logs older than the specified date. This can be a
	// date string `2019-04-30` or an absolute timestamp that conforms to RFC3339.
	Before param.Field[time.Time] `query:"before" format:"date-time"`
	// Changes the direction of the chronological sorting.
	Direction param.Field[AuditLogListParamsDirection] `query:"direction"`
	// Indicates that this request is an export of logs in CSV format.
	Export param.Field[bool] `query:"export"`
	// Indicates whether or not to hide user level audit logs.
	HideUserLogs param.Field[bool] `query:"hide_user_logs"`
	// Defines which page of results to return.
	Page param.Field[float64] `query:"page"`
	// Sets the number of results to return per page.
	PerPage param.Field[float64] `query:"per_page"`
	// Limits the returned results to logs newer than the specified date. This can be a
	// date string `2019-04-30` or an absolute timestamp that conforms to RFC3339.
	Since param.Field[time.Time]              `query:"since" format:"date-time"`
	Zone  param.Field[AuditLogListParamsZone] `query:"zone"`
}

func (AuditLogListParams) URLQuery

func (r AuditLogListParams) URLQuery() (v url.Values)

URLQuery serializes AuditLogListParams's query parameters as `url.Values`.

type AuditLogListParamsAction

type AuditLogListParamsAction struct {
	// Filters by the action type.
	Type param.Field[string] `query:"type"`
}

func (AuditLogListParamsAction) URLQuery

func (r AuditLogListParamsAction) URLQuery() (v url.Values)

URLQuery serializes AuditLogListParamsAction's query parameters as `url.Values`.

type AuditLogListParamsActor

type AuditLogListParamsActor struct {
	// Filters by the email address of the actor that made the change.
	Email param.Field[string] `query:"email" format:"email"`
	// Filters by the IP address of the request that made the change by specific IP
	// address or valid CIDR Range.
	IP param.Field[string] `query:"ip"`
}

func (AuditLogListParamsActor) URLQuery

func (r AuditLogListParamsActor) URLQuery() (v url.Values)

URLQuery serializes AuditLogListParamsActor's query parameters as `url.Values`.

type AuditLogListParamsDirection

type AuditLogListParamsDirection string

Changes the direction of the chronological sorting.

const (
	AuditLogListParamsDirectionDesc AuditLogListParamsDirection = "desc"
	AuditLogListParamsDirectionAsc  AuditLogListParamsDirection = "asc"
)

func (AuditLogListParamsDirection) IsKnown

func (r AuditLogListParamsDirection) IsKnown() bool

type AuditLogListParamsZone

type AuditLogListParamsZone struct {
	// Filters by the name of the zone associated to the change.
	Name param.Field[string] `query:"name"`
}

func (AuditLogListParamsZone) URLQuery

func (r AuditLogListParamsZone) URLQuery() (v url.Values)

URLQuery serializes AuditLogListParamsZone's query parameters as `url.Values`.

type AuditLogListResponse

type AuditLogListResponse struct {
	// A string that uniquely identifies the audit log.
	ID     string                     `json:"id"`
	Action AuditLogListResponseAction `json:"action"`
	Actor  AuditLogListResponseActor  `json:"actor"`
	// The source of the event.
	Interface string `json:"interface"`
	// An object which can lend more context to the action being logged. This is a
	// flexible value and varies between different actions.
	Metadata interface{} `json:"metadata"`
	// The new value of the resource that was modified.
	NewValue string `json:"newValue"`
	// The value of the resource before it was modified.
	OldValue string                       `json:"oldValue"`
	Owner    AuditLogListResponseOwner    `json:"owner"`
	Resource AuditLogListResponseResource `json:"resource"`
	// A UTC RFC3339 timestamp that specifies when the action being logged occured.
	When time.Time                `json:"when" format:"date-time"`
	JSON auditLogListResponseJSON `json:"-"`
}

func (*AuditLogListResponse) UnmarshalJSON

func (r *AuditLogListResponse) UnmarshalJSON(data []byte) (err error)

type AuditLogListResponseAction

type AuditLogListResponseAction struct {
	// A boolean that indicates if the action attempted was successful.
	Result bool `json:"result"`
	// A short string that describes the action that was performed.
	Type string                         `json:"type"`
	JSON auditLogListResponseActionJSON `json:"-"`
}

func (*AuditLogListResponseAction) UnmarshalJSON

func (r *AuditLogListResponseAction) UnmarshalJSON(data []byte) (err error)

type AuditLogListResponseActor

type AuditLogListResponseActor struct {
	// The ID of the actor that performed the action. If a user performed the action,
	// this will be their User ID.
	ID string `json:"id"`
	// The email of the user that performed the action.
	Email string `json:"email" format:"email"`
	// The IP address of the request that performed the action.
	IP string `json:"ip"`
	// The type of actor, whether a User, Cloudflare Admin, or an Automated System.
	Type AuditLogListResponseActorType `json:"type"`
	JSON auditLogListResponseActorJSON `json:"-"`
}

func (*AuditLogListResponseActor) UnmarshalJSON

func (r *AuditLogListResponseActor) UnmarshalJSON(data []byte) (err error)

type AuditLogListResponseActorType

type AuditLogListResponseActorType string

The type of actor, whether a User, Cloudflare Admin, or an Automated System.

const (
	AuditLogListResponseActorTypeUser       AuditLogListResponseActorType = "user"
	AuditLogListResponseActorTypeAdmin      AuditLogListResponseActorType = "admin"
	AuditLogListResponseActorTypeCloudflare AuditLogListResponseActorType = "Cloudflare"
)

func (AuditLogListResponseActorType) IsKnown

func (r AuditLogListResponseActorType) IsKnown() bool

type AuditLogListResponseOwner

type AuditLogListResponseOwner struct {
	// Identifier
	ID   string                        `json:"id"`
	JSON auditLogListResponseOwnerJSON `json:"-"`
}

func (*AuditLogListResponseOwner) UnmarshalJSON

func (r *AuditLogListResponseOwner) UnmarshalJSON(data []byte) (err error)

type AuditLogListResponseResource

type AuditLogListResponseResource struct {
	// An identifier for the resource that was affected by the action.
	ID string `json:"id"`
	// A short string that describes the resource that was affected by the action.
	Type string                           `json:"type"`
	JSON auditLogListResponseResourceJSON `json:"-"`
}

func (*AuditLogListResponseResource) UnmarshalJSON

func (r *AuditLogListResponseResource) UnmarshalJSON(data []byte) (err error)

type AuditLogService

type AuditLogService struct {
	Options []option.RequestOption
}

AuditLogService contains methods and other services that help with interacting with the cloudflare API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAuditLogService method instead.

func NewAuditLogService

func NewAuditLogService(opts ...option.RequestOption) (r *AuditLogService)

NewAuditLogService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AuditLogService) List

Gets a list of audit logs for an account. Can be filtered by who made the change, on which zone, and the timeframe of the change.

func (*AuditLogService) ListAutoPaging

Gets a list of audit logs for an account. Can be filtered by who made the change, on which zone, and the timeframe of the change.

type Error

type Error = apierror.Error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL