github.com/newrelic/newrelic-client-go@v1.1.0/docs/pkg/alerts/README.md (about) 1 # alerts 2 -- 3 import "github.com/newrelic/newrelic-client-go/pkg/alerts" 4 5 6 ## Usage 7 8 #### func TestIntegrationListAlertPolicies 9 10 ```go 11 func TestIntegrationListAlertPolicies(t *testing.T) 12 ``` 13 14 #### type AlertPolicy 15 16 ```go 17 type AlertPolicy struct { 18 ID int `json:"id,omitempty"` 19 IncidentPreference string `json:"incident_preference,omitempty"` 20 Name string `json:"name,omitempty"` 21 CreatedAt int64 `json:"created_at,omitempty"` 22 UpdatedAt int64 `json:"updated_at,omitempty"` 23 } 24 ``` 25 26 AlertPolicy represents a New Relic alert policy. 27 28 #### type Alerts 29 30 ```go 31 type Alerts struct { 32 } 33 ``` 34 35 Alerts is used to communicate with New Relic Alerts. 36 37 #### func New 38 39 ```go 40 func New(config config.Config) Alerts 41 ``` 42 New is used to create a new Alerts client instance. 43 44 #### func (*Alerts) CreateAlertPolicy 45 46 ```go 47 func (alerts *Alerts) CreateAlertPolicy(policy AlertPolicy) (*AlertPolicy, error) 48 ``` 49 CreateAlertPolicy creates a new alert policy for a given account. 50 51 #### func (*Alerts) GetAlertPolicy 52 53 ```go 54 func (alerts *Alerts) GetAlertPolicy(id int) (*AlertPolicy, error) 55 ``` 56 GetAlertPolicy returns a specific alert policy by ID for a given account. 57 58 #### func (*Alerts) ListAlertPolicies 59 60 ```go 61 func (alerts *Alerts) ListAlertPolicies(params *ListAlertPoliciesParams) ([]AlertPolicy, error) 62 ``` 63 ListAlertPolicies returns a list of Alert Policies for a given account. 64 65 #### func (*Alerts) UpdateAlertPolicy 66 67 ```go 68 func (alerts *Alerts) UpdateAlertPolicy(policy AlertPolicy) (*AlertPolicy, error) 69 ``` 70 UpdateAlertPolicy update an alert policy for a given account. 71 72 #### type ListAlertPoliciesParams 73 74 ```go 75 type ListAlertPoliciesParams struct { 76 Name *string 77 } 78 ``` 79 80 ListAlertPoliciesParams represents a set of filters to be used when querying New 81 Relic alert policies.