Documentation ¶
Overview ¶
Package api provides test helpers to interact with the Datadog API
Index ¶
- func WaitAppLogs(apiClient *Client, query string) (*datadog.LogAttributes, error)
- func WaitAppSignal(apiClient *Client, query string) (*datadog.SecurityMonitoringSignalAttributes, error)
- type Attributes
- type Client
- func (c *Client) CreateCWSAgentRule(name string, msg string, secl string) (*datadog.CloudWorkloadSecurityAgentRuleResponse, error)
- func (c *Client) CreateCwsSignalRule(name string, msg string, agentRuleID string, tags []string) (*datadog.SecurityMonitoringRuleResponse, error)
- func (c *Client) DeleteAgentRule(ruleID string) error
- func (c *Client) DeleteSignalRule(ruleID string) error
- func (c *Client) GetAppLog(query string) (*datadog.LogsListResponse, error)
- func (c *Client) GetAppSignal(query string) (*datadog.SecurityMonitoringSignalsListResponse, error)
- type Column
- type DDSQLClient
- type DDSQLTableQueryParams
- type DDSQLTableResponse
- type DataEntry
- type JSONAPIPayload
- type JSONAPIPayloadData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WaitAppLogs ¶
func WaitAppLogs(apiClient *Client, query string) (*datadog.LogAttributes, error)
WaitAppLogs waits for the app log corresponding to the query
func WaitAppSignal ¶
func WaitAppSignal(apiClient *Client, query string) (*datadog.SecurityMonitoringSignalAttributes, error)
WaitAppSignal waits for the signal corresponding to the query
Types ¶
type Attributes ¶
type Attributes struct {
Columns []Column `json:"columns"`
}
Attributes is a struct that represents the attributes of a data entry in a DDSQL table response
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents the datadog API context
func (*Client) CreateCWSAgentRule ¶
func (c *Client) CreateCWSAgentRule(name string, msg string, secl string) (*datadog.CloudWorkloadSecurityAgentRuleResponse, error)
CreateCWSAgentRule creates a cws agent rule
func (*Client) CreateCwsSignalRule ¶
func (c *Client) CreateCwsSignalRule(name string, msg string, agentRuleID string, tags []string) (*datadog.SecurityMonitoringRuleResponse, error)
CreateCwsSignalRule creates a cws signal rule
func (*Client) DeleteAgentRule ¶
DeleteAgentRule deletes an agent rule
func (*Client) DeleteSignalRule ¶
DeleteSignalRule deletes a signal rule
func (*Client) GetAppLog ¶
func (c *Client) GetAppLog(query string) (*datadog.LogsListResponse, error)
GetAppLog returns the logs corresponding to the query
func (*Client) GetAppSignal ¶
func (c *Client) GetAppSignal(query string) (*datadog.SecurityMonitoringSignalsListResponse, error)
GetAppSignal returns the signal corresponding to the query
type Column ¶
type Column struct { Name string `json:"name"` Type string `json:"type"` Values []interface{} `json:"values"` }
Column is a struct that represents a column of a data entry in a DDSQL table response
type DDSQLClient ¶
type DDSQLClient struct {
// contains filtered or unexported fields
}
DDSQLClient is a struct that represents a DDSQL client
func NewDDSQLClient ¶
func NewDDSQLClient(apiKey, appKey string) *DDSQLClient
NewDDSQLClient returns a new DDSQL client
func (*DDSQLClient) Do ¶
func (c *DDSQLClient) Do(query string) (*DDSQLTableResponse, error)
Do executes a DDSQL query, returning a DDSQL table response
type DDSQLTableQueryParams ¶
type DDSQLTableQueryParams struct { DefaultStart int `json:"default_start"` DefaultEnd int `json:"default_end"` DefaultInterval int `json:"default_interval"` Query string `json:"query"` }
DDSQLTableQueryParams is a struct that represents a DDSQL table query
type DDSQLTableResponse ¶
type DDSQLTableResponse struct {
Data []DataEntry `json:"data"`
}
DDSQLTableResponse is a struct that represents a DDSQL table response
type DataEntry ¶
type DataEntry struct { Type string `json:"type"` Attributes Attributes `json:"attributes"` }
DataEntry is a struct that represents a data entry in a DDSQL table response
type JSONAPIPayload ¶ added in v0.52.1
type JSONAPIPayload[Attr any] struct { Data JSONAPIPayloadData[Attr] `json:"data"` }
JSONAPIPayload is a struct that represents the body of a JSON API request
type JSONAPIPayloadData ¶ added in v0.52.1
type JSONAPIPayloadData[Attr any] struct { Type string `json:"type"` Attribute Attr `json:"attributes"` }
JSONAPIPayloadData is a struct that represents the data field of a JSON API request