Documentation ¶
Overview ¶
* Copyright 2017-2018 IBM Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2017-2018 IBM Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2017-2018 IBM Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2017-2018 IBM Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2017-2018 IBM Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2017-2018 IBM Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2017-2018 IBM Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2017-2018 IBM Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2017-2018 IBM Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2017-2018 IBM Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2017-2018 IBM Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2017-2018 IBM Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2017-2018 IBM Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2017-2018 IBM Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2017-2018 IBM Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2017-2018 IBM Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2017-2018 IBM Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2017-2018 IBM Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2017-2018 IBM Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- Constants
- type AlertsChannel
- type AlertsChannelEntity
- type AlertsChannelLinks
- type AlertsChannelList
- type AlertsChannelListOptions
- type AlertsChannelType
- type AlertsChannelWebhookType
- type AlertsChannelsService
- func (s *AlertsChannelsService) Create(ctx context.Context, c *AlertsChannelEntity) (*AlertsChannelList, *Response, error)
- func (s *AlertsChannelsService) DeleteByID(ctx context.Context, id int64) (*Response, error)
- func (s *AlertsChannelsService) ListAll(ctx context.Context, opt *AlertsChannelListOptions) (*AlertsChannelList, *Response, error)
- func (s *AlertsChannelsService) UpdatePolicyChannels(ctx context.Context, policyId int64, channelIds []*int64) (*Response, error)
- type AlertsConditionEntity
- type AlertsConditionList
- type AlertsConditionTerm
- type AlertsConditionsOptions
- type AlertsConditionsService
- func (s *AlertsConditionsService) Create(ctx context.Context, cat ConditionCategory, c *AlertsConditionEntity, ...) (*AlertsConditionEntity, *Response, error)
- func (s *AlertsConditionsService) DeleteByID(ctx context.Context, cat ConditionCategory, conditionID int64) (*Response, error)
- func (s *AlertsConditionsService) List(ctx context.Context, opt *AlertsConditionsOptions, cat ConditionCategory) (*AlertsConditionList, *Response, error)
- func (s *AlertsConditionsService) ListAll(ctx context.Context, opt *AlertsConditionsOptions) (*AlertsConditionList, error)
- func (s *AlertsConditionsService) Update(ctx context.Context, cat ConditionCategory, c *AlertsConditionEntity, ...) (*AlertsConditionEntity, *Response, error)
- type AlertsDefaultCondition
- type AlertsDefaultConditionEntity
- type AlertsDefaultConditionList
- type AlertsDefaultConditionUserDefined
- type AlertsEventList
- type AlertsEventListOptions
- type AlertsEventService
- type AlertsExternalServiceCondition
- type AlertsExternalServiceConditionEntity
- type AlertsExternalServiceConditionList
- type AlertsIncident
- type AlertsIncidentLinks
- type AlertsIncidentList
- type AlertsIncidentListLinks
- type AlertsIncidentListOptions
- type AlertsIncidentService
- type AlertsLinks
- type AlertsNRQLCondition
- type AlertsNRQLConditionEntity
- type AlertsNRQLConditionList
- type AlertsNRQLConditionNRQL
- type AlertsPluginsCondition
- type AlertsPluginsConditionEntity
- type AlertsPluginsConditionList
- type AlertsPluginsConditionPlugin
- type AlertsPoliciesService
- func (s *AlertsPoliciesService) Create(ctx context.Context, p *AlertsPolicyEntity) (*AlertsPolicyEntity, *Response, error)
- func (s *AlertsPoliciesService) DeleteByID(ctx context.Context, id int64) (*Response, error)
- func (s *AlertsPoliciesService) ListAll(ctx context.Context, opt *AlertsPolicyListOptions) (*AlertsPolicyList, *Response, error)
- func (s *AlertsPoliciesService) Update(ctx context.Context, p *AlertsPolicyEntity, id int64) (*AlertsPolicyEntity, *Response, error)
- type AlertsPolicy
- type AlertsPolicyEntity
- type AlertsPolicyList
- type AlertsPolicyListOptions
- type AlertsSyntheticsCondition
- type AlertsSyntheticsConditionEntity
- type AlertsSyntheticsConditionList
- type AlertsViolation
- type AlertsViolationEntity
- type AlertsViolationLinks
- type AlertsViolationList
- type AlertsViolationListLinks
- type AlertsViolationListOptions
- type AlertsViolationService
- type ChannelCampfireConfig
- type ChannelEmailConfig
- type ChannelHipChatConfig
- type ChannelOpsGenieConfig
- type ChannelPagerDutyConfig
- type ChannelSlackConfig
- type ChannelUserConfig
- type ChannelVictorOpsConfig
- type ChannelWebhookConfig
- type Client
- func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*Response, error)
- func (c *Client) DoWithBytes(ctx context.Context, req *http.Request) (*Response, []byte, error)
- func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)
- func (c *Client) NewRequestForNonJSON(method, urlStr string, body string) (*http.Request, error)
- type ConditionCategory
- type CustomEventService
- type Dashboard
- type DashboardList
- type DashboardListOptions
- type DashboardService
- func (s *DashboardService) Create(ctx context.Context, dashboard string) (*Response, []byte, error)
- func (s *DashboardService) DeleteByID(ctx context.Context, id int64) (*Response, []byte, error)
- func (s *DashboardService) GetByID(ctx context.Context, id int64) (*Response, []byte, error)
- func (s *DashboardService) ListAll(ctx context.Context, opt *DashboardListOptions) (*Response, []byte, error)
- func (s *DashboardService) Update(ctx context.Context, dashboard string, id int64) (*Response, []byte, error)
- type IncidentPreferenceOption
- type Label
- type LabelEntity
- type LabelLinks
- type LabelList
- type LabelListLinks
- type LabelListOptions
- type LabelSynthetics
- type LabelsHealthStatus
- type LabelsService
- type LabelsSyntheticsService
- func (s *LabelsSyntheticsService) AddLabelToMonitor(ctx context.Context, monitorId string, monitorLabel *MonitorLabel) (*Response, error)
- func (s *LabelsSyntheticsService) DeleteLabelFromMonitor(ctx context.Context, monitorId string, label string) (*Response, error)
- func (s *LabelsSyntheticsService) GetMonitorsByLabel(ctx context.Context, opt *PageLimitOptions, label string) (*LabelSynthetics, *Response, error)
- type Metadata
- type Monitor
- type MonitorLabel
- type MonitorList
- type MonitorListOptions
- type MonitorOptions
- type MonitorRef
- type MonitorRefList
- type PageLimitOptions
- type PageOptions
- type PolicyChannelsAssociation
- type RecentEvent
- type Response
- type Script
- type ScriptService
- type SyntheticsService
- func (s *SyntheticsService) Create(ctx context.Context, monitor *Monitor) (*Monitor, *Response, error)
- func (s *SyntheticsService) DeleteByID(ctx context.Context, id *string) (*Response, error)
- func (s *SyntheticsService) GetByID(ctx context.Context, id string) (*Monitor, *Response, error)
- func (s *SyntheticsService) ListAll(ctx context.Context, opt *MonitorListOptions) (*MonitorList, *Response, error)
- func (s *SyntheticsService) Patch(ctx context.Context, monitor *Monitor, id *string) (*Response, error)
- func (s *SyntheticsService) Update(ctx context.Context, monitor *Monitor, id *string) (*Response, error)
- type User
- type UserEntity
- type UserList
- type UserListOptions
- type UsersService
Constants ¶
const ( ChannelByUser AlertsChannelType = "user" ChannelByEmail AlertsChannelType = "email" ChannelBySlack AlertsChannelType = "slack" ChannelByPagerDuty AlertsChannelType = "pagerduty" ChannelByWebhook AlertsChannelType = "webhook" ChannelByCampfire AlertsChannelType = "campfire" ChannelByHipChat AlertsChannelType = "hipchat" ChannelByOpsGenie AlertsChannelType = "opsgenie" ChannelByVictorOps AlertsChannelType = "victorops" ChannelWebhookByJSON AlertsChannelWebhookType = "application/json" ChannelWebhookByForm AlertsChannelWebhookType = "application/x-www-form-urlencoded" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertsChannel ¶
type AlertsChannel struct { ID *int64 `json:"id,omitempty"` Name *string `json:"name,omitempty"` Type AlertsChannelType `json:"type,omitempty"` Configuration interface{} `json:"configuration,omitempty"` Links *AlertsChannelLinks `json:"links,omitempty"` }
func (*AlertsChannel) UnmarshalJSON ¶
func (c *AlertsChannel) UnmarshalJSON(data []byte) error
UnmarshalJSON customizes UnmarshalJSON method so that Configuration field can be properly unmarshlled
type AlertsChannelEntity ¶
type AlertsChannelEntity struct {
AlertsChannel *AlertsChannel `json:"channel,omitempty"`
}
type AlertsChannelLinks ¶
type AlertsChannelLinks struct {
PolicyIDs []*int64 `json:"policy_ids,omitempty"`
}
AlertsChannelLinks holds the links to AlertsPolicies
type AlertsChannelList ¶
type AlertsChannelList struct { AlertsChannels []*AlertsChannel `json:"channels,omitempty"` AlertsLinks *AlertsLinks `json:"links,omitempty"` }
type AlertsChannelListOptions ¶
type AlertsChannelListOptions struct {
PageOptions
}
type AlertsChannelType ¶
type AlertsChannelType string
type AlertsChannelWebhookType ¶
type AlertsChannelWebhookType string
type AlertsChannelsService ¶
type AlertsChannelsService service
func (*AlertsChannelsService) Create ¶
func (s *AlertsChannelsService) Create(ctx context.Context, c *AlertsChannelEntity) (*AlertsChannelList, *Response, error)
Create POST a AlertsChannelEntity to create
maybe a potential bug in NewRelic side from API document, Create returns a AlertsChannel json payload but actually it returns a AlertsChannelList json {"channels":[{"id":1104874,"name":"newrelic-cli-integration-test-channel","type":"email","configuration":{"recipients":""},"links":{"policy_ids":[]}}],"links":{"channel.policy_ids":"/v2/policies/{policy_id}"}} so change returned parameter *AlertsChannelEntity to *AlertsChannelList
func (*AlertsChannelsService) DeleteByID ¶
func (*AlertsChannelsService) ListAll ¶
func (s *AlertsChannelsService) ListAll(ctx context.Context, opt *AlertsChannelListOptions) (*AlertsChannelList, *Response, error)
func (*AlertsChannelsService) UpdatePolicyChannels ¶
type AlertsConditionEntity ¶
type AlertsConditionEntity struct { *AlertsDefaultConditionEntity *AlertsExternalServiceConditionEntity *AlertsNRQLConditionEntity *AlertsPluginsConditionEntity *AlertsSyntheticsConditionEntity }
type AlertsConditionList ¶
type AlertsConditionList struct { *AlertsDefaultConditionList *AlertsExternalServiceConditionList *AlertsNRQLConditionList *AlertsPluginsConditionList *AlertsSyntheticsConditionList }
type AlertsConditionTerm ¶
type AlertsConditionsOptions ¶
type AlertsConditionsOptions struct { PolicyIDOptions string `url:"policy_id,omitempty"` PageOptions }
type AlertsConditionsService ¶
type AlertsConditionsService struct {
// contains filtered or unexported fields
}
func (*AlertsConditionsService) Create ¶
func (s *AlertsConditionsService) Create(ctx context.Context, cat ConditionCategory, c *AlertsConditionEntity, conditionID int64) (*AlertsConditionEntity, *Response, error)
func (*AlertsConditionsService) DeleteByID ¶
func (s *AlertsConditionsService) DeleteByID(ctx context.Context, cat ConditionCategory, conditionID int64) (*Response, error)
func (*AlertsConditionsService) List ¶
func (s *AlertsConditionsService) List(ctx context.Context, opt *AlertsConditionsOptions, cat ConditionCategory) (*AlertsConditionList, *Response, error)
func (*AlertsConditionsService) ListAll ¶
func (s *AlertsConditionsService) ListAll(ctx context.Context, opt *AlertsConditionsOptions) (*AlertsConditionList, error)
func (*AlertsConditionsService) Update ¶
func (s *AlertsConditionsService) Update(ctx context.Context, cat ConditionCategory, c *AlertsConditionEntity, conditionID int64) (*AlertsConditionEntity, *Response, error)
type AlertsDefaultCondition ¶
type AlertsDefaultCondition struct { ID *int64 `json:"id,omitempty"` Type *string `json:"type,omitempty"` Name *string `json:"name,omitempty"` Enabled *bool `json:"enabled,omitempty"` Entities []*string `json:"entities,omitempty"` Metric *string `json:"metric,omitempty"` GCMetric *string `json:"gc_metric,omitempty"` RunbookURL *string `json:"runbook_url,omitempty"` ConditionScope *string `json:"condition_scope,omitempty"` ViolationCloseTimer *int64 `json:"violation_close_timer,omitempty"` Terms []*AlertsConditionTerm `json:"terms,omitempty"` UserDefined *AlertsDefaultConditionUserDefined `json:"user_defined,omitempty"` }
AlertsDefaultCondition manages Conditions of * APM Application * Key Transaction * Browser application metric * Mobile application metric for your alert policies
NOTICE: API documents says Entities are integers, but it's string actually
type AlertsDefaultConditionEntity ¶
type AlertsDefaultConditionEntity struct {
AlertsDefaultCondition *AlertsDefaultCondition `json:"condition,omitempty"`
}
type AlertsDefaultConditionList ¶
type AlertsDefaultConditionList struct {
AlertsDefaultConditions []*AlertsDefaultCondition `json:"conditions,omitempty"`
}
type AlertsEventList ¶
type AlertsEventList struct {
RecentEvents []*RecentEvent `json:"recent_events,omitempty"`
}
type AlertsEventListOptions ¶
type AlertsEventListOptions struct { PageOptions Product string `url:"filter[product],omitempty"` EntityType string `url:"filter[entity_type],omitempty"` EntityGroupID int64 `url:"filter[entity_group_id],omitempty"` EntityID int64 `url:"filter[entity_id],omitempty"` EventType string `url:"filter[event_type],omitempty"` IncidentID int64 `url:"filter[incident_id],omitempty"` }
type AlertsEventService ¶
type AlertsEventService service
func (*AlertsEventService) ListAll ¶
func (s *AlertsEventService) ListAll(ctx context.Context, opt *AlertsEventListOptions) (*AlertsEventList, *Response, error)
type AlertsExternalServiceCondition ¶
type AlertsExternalServiceCondition struct { ID *int64 `json:"id,omitempty"` Type *string `json:"type,omitempty"` Name *string `json:"name,omitempty"` Enabled *bool `json:"enabled,omitempty"` Entities []*string `json:"entities,omitempty"` ExternalServiceURL *string `json:"external_service_url,omitempty"` Metric *string `json:"metric,omitempty"` RunbookURL *string `json:"runbook_url,omitempty"` Terms []*AlertsConditionTerm `json:"terms,omitempty"` }
type AlertsExternalServiceConditionEntity ¶
type AlertsExternalServiceConditionEntity struct {
AlertsExternalServiceCondition *AlertsExternalServiceCondition `json:"external_service_condition,omitempty"`
}
type AlertsExternalServiceConditionList ¶
type AlertsExternalServiceConditionList struct {
AlertsExternalServiceConditions []*AlertsExternalServiceCondition `json:"external_service_conditions,omitempty"`
}
type AlertsIncident ¶
type AlertsIncident struct { ID *int64 `json:"id,omitempty"` OpenedAt *int64 `json:"opened_at,omitempty"` IncidentPreference *string `json:"incident_preference,omitempty"` Links *AlertsIncidentLinks `json:"links,omitempty"` }
type AlertsIncidentLinks ¶
type AlertsIncidentList ¶
type AlertsIncidentList struct { Incidents []*AlertsIncident `json:"incidents,omitempty"` Links *AlertsIncidentListLinks `json:"links,omitempty"` }
type AlertsIncidentListLinks ¶
type AlertsIncidentListLinks struct {
IncidentPolicyID *string `json:"incident.policy_id,omitempty"`
}
type AlertsIncidentListOptions ¶
type AlertsIncidentListOptions struct { PageOptions OnlyOpen bool `url:"only_open,omitempty"` }
type AlertsIncidentService ¶
type AlertsIncidentService service
func (*AlertsIncidentService) ListAll ¶
func (s *AlertsIncidentService) ListAll(ctx context.Context, opt *AlertsIncidentListOptions) (*AlertsIncidentList, *Response, error)
type AlertsLinks ¶
type AlertsLinks struct {
ChannelPolicyIDs *string `json:"channel.policy_ids,omitempty"`
}
type AlertsNRQLCondition ¶
type AlertsNRQLCondition struct { ID *int64 `json:"id,omitempty"` Name *string `json:"name,omitempty"` RunbookURL *string `json:"runbook_url,omitempty"` Enabled *bool `json:"enabled,omitempty"` Terms []*AlertsConditionTerm `json:"terms,omitempty"` ValueFunction *string `json:"value_function,omitempty"` NRQL *AlertsNRQLConditionNRQL `json:"nrql,omitempty"` }
type AlertsNRQLConditionEntity ¶
type AlertsNRQLConditionEntity struct {
AlertsNRQLCondition *AlertsNRQLCondition `json:"nrql_condition,omitempty"`
}
type AlertsNRQLConditionList ¶
type AlertsNRQLConditionList struct {
AlertsNRQLConditions []*AlertsNRQLCondition `json:"nrql_conditions,omitempty"`
}
type AlertsNRQLConditionNRQL ¶
type AlertsPluginsCondition ¶
type AlertsPluginsCondition struct { ID *int64 `json:"id,omitempty"` Name *string `json:"name,omitempty"` Enabled *bool `json:"enabled,omitempty"` Entities []*int64 `json:"entities,omitempty"` MetricDescription *string `json:"metric_description,omitempty"` Metric *string `json:"metric,omitempty"` ValueFunction *string `json:"value_function,omitempty"` RunbookURL *string `json:"runbook_url,omitempty"` Terms []*AlertsConditionTerm `json:"terms,omitempty"` Plugin *AlertsPluginsConditionPlugin `json:"plugin,omitempty"` }
type AlertsPluginsConditionEntity ¶
type AlertsPluginsConditionEntity struct {
AlertsPluginsCondition *AlertsPluginsCondition `json:"plugins_condition,omitempty"`
}
type AlertsPluginsConditionList ¶
type AlertsPluginsConditionList struct {
AlertsPluginsConditions []*AlertsPluginsCondition `json:"plugins_conditions,omitempty"`
}
type AlertsPoliciesService ¶
type AlertsPoliciesService service
func (*AlertsPoliciesService) Create ¶
func (s *AlertsPoliciesService) Create(ctx context.Context, p *AlertsPolicyEntity) (*AlertsPolicyEntity, *Response, error)
Create tries to create an alerts policy CAVEAT: it's good practice to check if a `p` existed If a `p` is "Created" twice, two alerts policies will be created with same Name but different ID
func (*AlertsPoliciesService) DeleteByID ¶
func (*AlertsPoliciesService) ListAll ¶
func (s *AlertsPoliciesService) ListAll(ctx context.Context, opt *AlertsPolicyListOptions) (*AlertsPolicyList, *Response, error)
func (*AlertsPoliciesService) Update ¶
func (s *AlertsPoliciesService) Update(ctx context.Context, p *AlertsPolicyEntity, id int64) (*AlertsPolicyEntity, *Response, error)
type AlertsPolicy ¶
type AlertsPolicy struct { ID *int64 `json:"id,omitempty"` IncidentPreference IncidentPreferenceOption `json:"incident_preference,omitempty"` Name *string `json:"name,omitempty"` CreatedAt *int64 `json:"created_at,omitempty"` UpdatedAt *int64 `json:"updated_at,omitempty"` }
type AlertsPolicyEntity ¶
type AlertsPolicyEntity struct {
AlertsPolicy *AlertsPolicy `json:"policy,omitempty"`
}
type AlertsPolicyList ¶
type AlertsPolicyList struct {
AlertsPolicies []*AlertsPolicy `json:"policies,omitempty"`
}
type AlertsPolicyListOptions ¶
type AlertsPolicyListOptions struct { NameOptions string `url:"filter[name],omitempty"` PageOptions }
type AlertsSyntheticsConditionEntity ¶
type AlertsSyntheticsConditionEntity struct {
AlertsSyntheticsCondition *AlertsSyntheticsCondition `json:"synthetics_condition,omitempty"`
}
type AlertsSyntheticsConditionList ¶
type AlertsSyntheticsConditionList struct {
AlertsSyntheticsConditions []*AlertsSyntheticsCondition `json:"synthetics_conditions,omitempty"`
}
type AlertsViolation ¶
type AlertsViolation struct { ID *int64 `json:"id,omitempty"` Label *string `json:"label,omitempty"` Duration *int64 `json:"duration,omitempty"` PolicyName *string `json:"policy_name,omitempty"` ConditionName *string `json:"condition_name,omitempty"` Priority *string `json:"priority,omitempty"` OpenedAt *int64 `json:"opened_at,omitempty"` Entity *AlertsViolationEntity `json:"entity,omitempty"` Links *AlertsViolationLinks `json:"links,omitempty"` ClosedAt *int64 `json:"closed_at,omitempty"` }
type AlertsViolationEntity ¶
type AlertsViolationLinks ¶
type AlertsViolationList ¶
type AlertsViolationList struct { Violations []*AlertsViolation `json:"violations,omitempty"` Links *AlertsViolationListLinks `json:"links,omitempty"` }
type AlertsViolationListOptions ¶
type AlertsViolationListOptions struct { PageOptions OnlyOpen bool `url:"only_open,omitempty"` StartDate string `url:"start_date,omitempty"` EndDate string `url:"end_date,omitempty"` }
type AlertsViolationService ¶
type AlertsViolationService service
func (*AlertsViolationService) ListAll ¶
func (s *AlertsViolationService) ListAll(ctx context.Context, opt *AlertsViolationListOptions) (*AlertsViolationList, *Response, error)
type ChannelCampfireConfig ¶
type ChannelEmailConfig ¶
type ChannelEmailConfig struct { Recipients *string `json:"recipients,omitempty"` IncludeJSONAttachment *bool `json:"include_json_attachment,omitempty"` }
ChannelEmailConfig is struct of Email Alert Channel
type ChannelHipChatConfig ¶
type ChannelOpsGenieConfig ¶
type ChannelPagerDutyConfig ¶
type ChannelPagerDutyConfig struct {
ServiceKey *string `json:"service_key,omitempty"`
}
ChannelPagerDutyConfig is struct of Pagerduty Alert Channel
type ChannelSlackConfig ¶
type ChannelSlackConfig struct { URL *string `json:"url,omitempty"` Channel *string `json:"channel,omitempty"` }
ChannelSlackConfig is struct of Slack Alert Channel
type ChannelUserConfig ¶
type ChannelUserConfig struct {
UserID *string `json:"user_id,omitempty"`
}
ChannelUserConfig is system generated alerts channel, it's non-editable
type ChannelVictorOpsConfig ¶
type ChannelWebhookConfig ¶
type ChannelWebhookConfig struct { BaseURL *string `json:"base_url,omitempty"` AuthUsername *string `json:"auth_username,omitempty"` AuthPassword *string `json:"auth_password,omitempty"` PayloadType AlertsChannelWebhookType `json:"payload_type,omitempty"` Payload *map[string]interface{} `json:"payload,omitempty"` Headers *map[string]string `json:"headers,omitempty"` }
ChannelWebhookConfig is struct of Webhook Alert Channel
type Client ¶
type Client struct { BaseURL *url.URL UserAgent string XApiKey string ProxyAuth string Retries int Users *UsersService AlertsPolicies *AlertsPoliciesService AlertsChannels *AlertsChannelsService Labels *LabelsService AlertsIncidents *AlertsIncidentService AlertsViolations *AlertsViolationService AlertsEvents *AlertsEventService AlertsConditions *AlertsConditionsService SyntheticsMonitors *SyntheticsService SyntheticsScript *ScriptService LabelsSynthetics *LabelsSyntheticsService Dashboards *DashboardService CustomEvents *CustomEventService // contains filtered or unexported fields }
func (*Client) DoWithBytes ¶
func (*Client) NewRequest ¶
type ConditionCategory ¶
type ConditionCategory string
const ( // https://docs.newrelic.com/docs/alerts/rest-api-alerts/new-relic-alerts-rest-api/rest-api-calls-new-relic-alerts ConditionDefault ConditionCategory = "condition" ConditionPlugins ConditionCategory = "plugins_condition" ConditionExternalService ConditionCategory = "external_service_condition" ConditionSynthetics ConditionCategory = "synthetics_condition" ConditionNRQL ConditionCategory = "nrql_condition" )
type CustomEventService ¶
type CustomEventService service
type DashboardList ¶
type DashboardList struct {
Dashboards []*Dashboard `json:"dashboards,omitempty"`
}
type DashboardListOptions ¶
type DashboardListOptions struct {
PageOptions
}
type DashboardService ¶
type DashboardService service
func (*DashboardService) DeleteByID ¶
func (*DashboardService) ListAll ¶
func (s *DashboardService) ListAll(ctx context.Context, opt *DashboardListOptions) (*Response, []byte, error)
type IncidentPreferenceOption ¶
type IncidentPreferenceOption string
const ( // https://docs.newrelic.com/docs/alerts/rest-api-alerts/new-relic-alerts-rest-api/rest-api-calls-new-relic-alerts#policies-create IncidentPerPolicy IncidentPreferenceOption = "PER_POLICY" IncidentPerCondition IncidentPreferenceOption = "PER_CONDITION" IncidentPerConditionAndTaret IncidentPreferenceOption = "PER_CONDITION_AND_TARGET" )
type Label ¶
type Label struct { Key *string `json:"key,omitempty"` Category *string `json:"category,omitempty"` Name *string `json:"name,omitempty"` LabelsApplicationHealthStatus *LabelsHealthStatus `json:"application_health_status,omitempty"` LabelsServerHealthStatus *LabelsHealthStatus `json:"server_health_status,omitempty"` LabelLinks *LabelLinks `json:"links,omitempty"` }
type LabelEntity ¶
type LabelEntity struct {
Label *Label `json:"label,omitempty"`
}
type LabelLinks ¶
type LabelList ¶
type LabelList struct { Labels []*Label `json:"labels,omitempty"` LabelListLinks *LabelListLinks `json:"links,omitempty"` }
type LabelListLinks ¶
type LabelListOptions ¶
type LabelListOptions struct {
PageOptions
}
type LabelSynthetics ¶
type LabelSynthetics struct { PagedData *MonitorRefList `json:"pagedData,omitempty"` Metadata *Metadata `json:"metadata,omitempty"` }
type LabelsHealthStatus ¶
type LabelsService ¶
type LabelsService service
func (*LabelsService) Create ¶
func (s *LabelsService) Create(ctx context.Context, l *LabelEntity) (*LabelEntity, *Response, error)
func (*LabelsService) DeleteByKey ¶
func (*LabelsService) ListAll ¶
func (s *LabelsService) ListAll(ctx context.Context, opt *LabelListOptions) (*LabelList, *Response, error)
type LabelsSyntheticsService ¶
type LabelsSyntheticsService service
func (*LabelsSyntheticsService) AddLabelToMonitor ¶
func (s *LabelsSyntheticsService) AddLabelToMonitor(ctx context.Context, monitorId string, monitorLabel *MonitorLabel) (*Response, error)
func (*LabelsSyntheticsService) DeleteLabelFromMonitor ¶
func (*LabelsSyntheticsService) GetMonitorsByLabel ¶
func (s *LabelsSyntheticsService) GetMonitorsByLabel(ctx context.Context, opt *PageLimitOptions, label string) (*LabelSynthetics, *Response, error)
type Monitor ¶
type Monitor struct { ID *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` Type *string `json:"type,omitempty"` Frequency *int64 `json:"frequency,omitempty"` URI *string `json:"uri,omitempty"` Locations []*string `json:"locations,omitempty"` Status *string `json:"status,omitempty"` SLAThreshold *float64 `json:"slaThreshold,omitempty"` UserID *int64 `json:"userId,omitempty"` ApiVersion *string `json:"apiVersion,omitempty"` CreatedAt *string `json:"createdAt,omitempty"` UpdatedAt *string `json:"modifiedAt,omitempty"` Options MonitorOptions `json:"options,omitempty"` Script *Script `json:"script,omitempty"` Labels []*string `json:"labels,omitempty"` }
type MonitorLabel ¶
type MonitorList ¶
type MonitorList struct {
Monitors []*Monitor `json:"monitors,omitempty"`
}
type MonitorListOptions ¶
type MonitorListOptions struct { PageOptions PageLimitOptions }
type MonitorOptions ¶
type MonitorRef ¶
type MonitorRefList ¶
type MonitorRefList struct {
MonitorRefs []*MonitorRef `json:"monitorRefs,omitempty"`
}
type PageLimitOptions ¶
type PageOptions ¶
type PageOptions struct {
Page int `url:"page,omitempty"`
}
type RecentEvent ¶
type RecentEvent struct { ID *int64 `json:"id,omitempty"` EventType *string `json:"event_type,omitempty"` Description *string `json:"description,omitempty"` Timestamp *int64 `json:"timestamp,omitempty"` IncidentID *int64 `json:"incident_id,omitempty"` Product *string `json:"product,omitempty"` EntityType *string `json:"entity_type,omitempty"` EntityGroupID *int64 `json:"entity_group_id,omitempty"` EntityID *int64 `json:"entity_id,omitempty"` Priority *string `json:"priority,omitempty"` }
type ScriptService ¶
type ScriptService service
func (*ScriptService) UpdateByID ¶
type SyntheticsService ¶
type SyntheticsService service
func (*SyntheticsService) DeleteByID ¶
func (*SyntheticsService) ListAll ¶
func (s *SyntheticsService) ListAll(ctx context.Context, opt *MonitorListOptions) (*MonitorList, *Response, error)
type User ¶
type User struct { ID *int64 `json:"id,omitempty"` FirstName *string `json:"first_name,omitempty"` LastName *string `json:"last_name,omitempty"` Email *string `json:"email,omitempty"` Role *string `json:"role,omitempty"` }
User represents a NewRelic user.
type UserEntity ¶
type UserEntity struct {
User *User `json:"user,omitempty"`
}
UserEntity corresponds to a JSON payload returned by NewRelic API
type UserList ¶
type UserList struct {
Users []*User `json:"users,omitempty"`
}
UserList represents a collection of NewRelic users.
type UserListOptions ¶
type UserListOptions struct { IDOptions string `url:"filter[ids],omitempty"` EmailOptions string `url:"filter[email],omitempty"` PageOptions }
UserListOptions specifies optional parameters to the UsersService.ListAll method.
type UsersService ¶
type UsersService service
UsersService handles communication with the user related methods of the NewRelic API.
NewRelic API docs: https://docs.newrelic.com/docs/apis/rest-api-v2/account-examples-v2/listing-users-your-account
func (*UsersService) GetByID ¶
func (s *UsersService) GetByID(ctx context.Context, id int64) (*UserEntity, *Response, error)
GetByID returns specfic NewRelic user by given `id`
func (*UsersService) ListAll ¶
func (s *UsersService) ListAll(ctx context.Context, opt *UserListOptions) (*UserList, *Response, error)
ListAll retruns all NewRelic users under current account/NEW_RELIC_API_KEY When given `opt`, it returns fitlered resultset
Source Files ¶
- alerts_channels.go
- alerts_conditions.go
- alerts_default_conditions.go
- alerts_events.go
- alerts_external_service_conditions.go
- alerts_incidents.go
- alerts_nrql_conditions.go
- alerts_plugins_conditions.go
- alerts_policies.go
- alerts_synthetics_conditions.go
- alerts_violations.go
- base.go
- custom_events.go
- dashboards.go
- labels.go
- labels_monitors.go
- monitors.go
- script.go
- users.go