github.com/newrelic/newrelic-client-go@v1.1.0/pkg/alerts/types.go (about)

     1  // Code generated by tutone: DO NOT EDIT
     2  package alerts
     3  
     4  import "github.com/newrelic/newrelic-client-go/pkg/nrtime"
     5  
     6  // AlertsDayOfWeek - The day of the week used to configure a WEEKLY scheduled MutingRule
     7  type AlertsDayOfWeek string
     8  
     9  var AlertsDayOfWeekTypes = struct {
    10  	// Friday
    11  	FRIDAY AlertsDayOfWeek
    12  	// Monday
    13  	MONDAY AlertsDayOfWeek
    14  	// Saturday
    15  	SATURDAY AlertsDayOfWeek
    16  	// Sunday
    17  	SUNDAY AlertsDayOfWeek
    18  	// Thursday
    19  	THURSDAY AlertsDayOfWeek
    20  	// Tuesday
    21  	TUESDAY AlertsDayOfWeek
    22  	// Wednesday
    23  	WEDNESDAY AlertsDayOfWeek
    24  }{
    25  	// Friday
    26  	FRIDAY: "FRIDAY",
    27  	// Monday
    28  	MONDAY: "MONDAY",
    29  	// Saturday
    30  	SATURDAY: "SATURDAY",
    31  	// Sunday
    32  	SUNDAY: "SUNDAY",
    33  	// Thursday
    34  	THURSDAY: "THURSDAY",
    35  	// Tuesday
    36  	TUESDAY: "TUESDAY",
    37  	// Wednesday
    38  	WEDNESDAY: "WEDNESDAY",
    39  }
    40  
    41  // AlertsIncidentPreference - Determines how incidents are created for critical violations of the conditions contained in the policy.
    42  type AlertsIncidentPreference string
    43  
    44  var AlertsIncidentPreferenceTypes = struct {
    45  	// A condition will create a condition-level incident when it violates its critical threshold.
    46  	// Other violating conditions will create their own incidents.
    47  	PER_CONDITION AlertsIncidentPreference
    48  	// Each target of each condition will create an entity-level incident upon critical violation.
    49  	// Other violating targets will create their own incidents (even on the same condition).
    50  	PER_CONDITION_AND_TARGET AlertsIncidentPreference
    51  	// A condition will create a policy-level incident when it violates its critical threshold.
    52  	// Other violating conditions will be grouped into this incident.
    53  	PER_POLICY AlertsIncidentPreference
    54  }{
    55  	// A condition will create a condition-level incident when it violates its critical threshold.
    56  	// Other violating conditions will create their own incidents.
    57  	PER_CONDITION: "PER_CONDITION",
    58  	// Each target of each condition will create an entity-level incident upon critical violation.
    59  	// Other violating targets will create their own incidents (even on the same condition).
    60  	PER_CONDITION_AND_TARGET: "PER_CONDITION_AND_TARGET",
    61  	// A condition will create a policy-level incident when it violates its critical threshold.
    62  	// Other violating conditions will be grouped into this incident.
    63  	PER_POLICY: "PER_POLICY",
    64  }
    65  
    66  // AlertsMutingRuleConditionGroupOperator - An operator used to combine MutingRuleConditions within a MutingRuleConditionGroup.
    67  type AlertsMutingRuleConditionGroupOperator string
    68  
    69  var AlertsMutingRuleConditionGroupOperatorTypes = struct {
    70  	// Match conditions by AND
    71  	AND AlertsMutingRuleConditionGroupOperator
    72  	// Match conditions by OR
    73  	OR AlertsMutingRuleConditionGroupOperator
    74  }{
    75  	// Match conditions by AND
    76  	AND: "AND",
    77  	// Match conditions by OR
    78  	OR: "OR",
    79  }
    80  
    81  // AlertsMutingRuleConditionOperator - The list of operators to be used in a MutingRuleCondition. Each operator is limited to one value in the `values` list unless otherwise specified.
    82  type AlertsMutingRuleConditionOperator string
    83  
    84  var AlertsMutingRuleConditionOperatorTypes = struct {
    85  	// Where attribute is any.
    86  	ANY AlertsMutingRuleConditionOperator
    87  	// Where attribute contains value.
    88  	CONTAINS AlertsMutingRuleConditionOperator
    89  	// Where attribute ends with value.
    90  	ENDS_WITH AlertsMutingRuleConditionOperator
    91  	// Where attribute equals value.
    92  	EQUALS AlertsMutingRuleConditionOperator
    93  	// Where attribute in values. (Limit 500)
    94  	IN AlertsMutingRuleConditionOperator
    95  	// Where attribute is blank.
    96  	IS_BLANK AlertsMutingRuleConditionOperator
    97  	// Where attribute is not blank.
    98  	IS_NOT_BLANK AlertsMutingRuleConditionOperator
    99  	// Where attribute does not contain value.
   100  	NOT_CONTAINS AlertsMutingRuleConditionOperator
   101  	// Where attribute does not end with value.
   102  	NOT_ENDS_WITH AlertsMutingRuleConditionOperator
   103  	// Where attribute does not equal value.
   104  	NOT_EQUALS AlertsMutingRuleConditionOperator
   105  	// Where attribute not in values. (Limit 500)
   106  	NOT_IN AlertsMutingRuleConditionOperator
   107  	// Where attribute does not start with value.
   108  	NOT_STARTS_WITH AlertsMutingRuleConditionOperator
   109  	// Where attribute starts with value.
   110  	STARTS_WITH AlertsMutingRuleConditionOperator
   111  }{
   112  	// Where attribute is any.
   113  	ANY: "ANY",
   114  	// Where attribute contains value.
   115  	CONTAINS: "CONTAINS",
   116  	// Where attribute ends with value.
   117  	ENDS_WITH: "ENDS_WITH",
   118  	// Where attribute equals value.
   119  	EQUALS: "EQUALS",
   120  	// Where attribute in values. (Limit 500)
   121  	IN: "IN",
   122  	// Where attribute is blank.
   123  	IS_BLANK: "IS_BLANK",
   124  	// Where attribute is not blank.
   125  	IS_NOT_BLANK: "IS_NOT_BLANK",
   126  	// Where attribute does not contain value.
   127  	NOT_CONTAINS: "NOT_CONTAINS",
   128  	// Where attribute does not end with value.
   129  	NOT_ENDS_WITH: "NOT_ENDS_WITH",
   130  	// Where attribute does not equal value.
   131  	NOT_EQUALS: "NOT_EQUALS",
   132  	// Where attribute not in values. (Limit 500)
   133  	NOT_IN: "NOT_IN",
   134  	// Where attribute does not start with value.
   135  	NOT_STARTS_WITH: "NOT_STARTS_WITH",
   136  	// Where attribute starts with value.
   137  	STARTS_WITH: "STARTS_WITH",
   138  }
   139  
   140  // AlertsMutingRuleScheduleRepeat - Details about if or how frequently a MutingRule's schedule repeats.
   141  type AlertsMutingRuleScheduleRepeat string
   142  
   143  var AlertsMutingRuleScheduleRepeatTypes = struct {
   144  	// Schedule repeats once per calendar day
   145  	DAILY AlertsMutingRuleScheduleRepeat
   146  	// Schedule repeats once per calendar month
   147  	MONTHLY AlertsMutingRuleScheduleRepeat
   148  	// Schedule repeats once per specified day per calendar week
   149  	WEEKLY AlertsMutingRuleScheduleRepeat
   150  }{
   151  	// Schedule repeats once per calendar day
   152  	DAILY: "DAILY",
   153  	// Schedule repeats once per calendar month
   154  	MONTHLY: "MONTHLY",
   155  	// Schedule repeats once per specified day per calendar week
   156  	WEEKLY: "WEEKLY",
   157  }
   158  
   159  // AlertsNRQLConditionTermsOperator - Operator used to compare against the threshold for NrqlConditions.
   160  type AlertsNRQLConditionTermsOperator string
   161  
   162  var AlertsNRQLConditionTermsOperatorTypes = struct {
   163  	// For comparing values above a threshold.
   164  	ABOVE AlertsNRQLConditionTermsOperator
   165  	// For comparing values above or equal to a threshold.
   166  	ABOVE_OR_EQUALS AlertsNRQLConditionTermsOperator
   167  	// For comparing values below a threshold.
   168  	BELOW AlertsNRQLConditionTermsOperator
   169  	// For comparing values below or equal to a threshold.
   170  	BELOW_OR_EQUALS AlertsNRQLConditionTermsOperator
   171  	// For comparing values equal to a threshold.
   172  	EQUALS AlertsNRQLConditionTermsOperator
   173  	// For comparing values that do not equal a threshold.
   174  	NOT_EQUALS AlertsNRQLConditionTermsOperator
   175  }{
   176  	// For comparing values above a threshold.
   177  	ABOVE: "ABOVE",
   178  	// For comparing values above or equal to a threshold.
   179  	ABOVE_OR_EQUALS: "ABOVE_OR_EQUALS",
   180  	// For comparing values below a threshold.
   181  	BELOW: "BELOW",
   182  	// For comparing values below or equal to a threshold.
   183  	BELOW_OR_EQUALS: "BELOW_OR_EQUALS",
   184  	// For comparing values equal to a threshold.
   185  	EQUALS: "EQUALS",
   186  	// For comparing values that do not equal a threshold.
   187  	NOT_EQUALS: "NOT_EQUALS",
   188  }
   189  
   190  // AlertsMutingRuleConditionGroupInput - A group of MutingRuleConditions combined by an operator.
   191  type AlertsMutingRuleConditionGroupInput struct {
   192  	// The individual MutingRuleConditions within the group.
   193  	Conditions []AlertsMutingRuleConditionInput `json:"conditions,omitempty"`
   194  	// The operator used to combine all the MutingRuleConditions within the group.
   195  	Operator AlertsMutingRuleConditionGroupOperator `json:"operator"`
   196  }
   197  
   198  // AlertsMutingRuleConditionInput - A condition which describes how to target a New Relic Alerts Violation.
   199  type AlertsMutingRuleConditionInput struct {
   200  	// The attribute on a violation. Expects one of:
   201  	//
   202  	// * **accountId** - The account id
   203  	// * **conditionId** - The alert condition id
   204  	// * **policyId** - The alert policy id
   205  	// * **policyName** - The alert policy name
   206  	// * **conditionName** - The alert condition name
   207  	// * **conditionType** - The alert condition type, such as `metric`
   208  	// * **conditionRunbookUrl** - The alert condition's runbook url
   209  	// * **product** - The target product (e.g., `SYNTHETICS`)
   210  	// * **targetId** - The ID of the alerts target
   211  	// * **targetName** - The name of the alerts target
   212  	// * **nrqlEventType** - The NRQL event type
   213  	// * **tag** - Arbitrary tags associated with some entity (e.g., FACET from a NRQL query)
   214  	// * **nrqlQuery** - The NRQL query string
   215  	Attribute string `json:"attribute"`
   216  	// The operator used to compare the attribute's value with the supplied value(s).
   217  	Operator AlertsMutingRuleConditionOperator `json:"operator"`
   218  	// The value(s) to compare against the attribute's value.
   219  	Values []string `json:"values"`
   220  }
   221  
   222  // AlertsMutingRuleInput - Input for creating MutingRules for New Relic Alerts Violations.
   223  type AlertsMutingRuleInput struct {
   224  	// The condition that defines which violations to target.
   225  	Condition AlertsMutingRuleConditionGroupInput `json:"condition,omitempty"`
   226  	// The description of the MutingRule.
   227  	Description string `json:"description,omitempty"`
   228  	// Whether the MutingRule is enabled
   229  	Enabled bool `json:"enabled"`
   230  	// The name of the MutingRule.
   231  	Name string `json:"name"`
   232  	// The time window when the MutingRule should actively mute violations.
   233  	Schedule AlertsMutingRuleScheduleInput `json:"schedule,omitempty"`
   234  }
   235  
   236  // AlertsMutingRuleScheduleInput - The time window when the MutingRule should actively mute violations.
   237  type AlertsMutingRuleScheduleInput struct {
   238  	// The datetime stamp when the MutingRule schedule should stop repeating.
   239  	// This is in local ISO 8601 format without an offset.
   240  	//
   241  	// Example: `'2020-07-10T15:00:00'`
   242  	//
   243  	// Note: Either `endRepeat` or `repeatCount` should be used to end a MutingRule schedule.
   244  	// Both fields should not be provided together.
   245  	EndRepeat nrtime.NaiveDateTime `json:"endRepeat,omitempty"`
   246  	// The datetime stamp representing when the MutingRule should end.
   247  	// This is in local ISO 8601 format without an offset.
   248  	//
   249  	// Example: `'2020-07-10T15:00:00'`
   250  	EndTime nrtime.NaiveDateTime `json:"endTime,omitempty"`
   251  	// The frequency the MutingRule schedule repeats.
   252  	// If the MutingRule repeats `WEEKLY`, be sure to set `weeklyRepeatDays`.
   253  	// If the MutingRule does not repeat, use `null`.
   254  	//
   255  	// Example: `DAILY`
   256  	Repeat AlertsMutingRuleScheduleRepeat `json:"repeat,omitempty"`
   257  	// The number of times the MutingRule schedule should repeat.
   258  	//
   259  	// Note: Either `repeatCount` or `endRepeat` should be used to end a MutingRule schedule.
   260  	// Both fields should not be provided together.
   261  	RepeatCount int `json:"repeatCount,omitempty"`
   262  	// The datetime stamp representing when the MutingRule should start.
   263  	// This is in local ISO 8601 format without an offset.
   264  	//
   265  	// Example: `'2020-07-08T14:30:00'`
   266  	StartTime nrtime.NaiveDateTime `json:"startTime,omitempty"`
   267  	// The time zone that applies to the MutingRule schedule.
   268  	//
   269  	// Example: `'America/Los_Angeles'`
   270  	//
   271  	// See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.
   272  	TimeZone string `json:"timeZone"`
   273  	// The day(s) of the week that a MutingRule should repeat when the repeat field is set to `WEEKLY`.
   274  	//
   275  	// Example: `[MONDAY, WEDNESDAY]`
   276  	WeeklyRepeatDays []AlertsDayOfWeek `json:"weeklyRepeatDays"`
   277  }
   278  
   279  // AlertsPoliciesSearchCriteriaInput - Search criteria for returning specific policies.
   280  type AlertsPoliciesSearchCriteriaInput struct {
   281  	// The list of policy ids to return.
   282  	IDs []string `json:"ids"`
   283  }
   284  
   285  // AlertsPoliciesSearchResultSet - Collection of policies with pagination information.
   286  type AlertsPoliciesSearchResultSet struct {
   287  	// Cursor pointing to the end of the current page of policy records. Null if final page.
   288  	NextCursor string `json:"nextCursor,omitempty"`
   289  	// Set of policies returned for the supplied cursor and criteria.
   290  	Policies []AlertsPolicy `json:"policies"`
   291  	// Total number of policy records for the given search criteria.
   292  	TotalCount int `json:"totalCount"`
   293  }
   294  
   295  // AlertsPolicy - Container for conditions with associated notifications channels.
   296  type AlertsPolicy struct {
   297  	// Account ID of the policy.
   298  	AccountID int `json:"accountId"`
   299  	// Primary key for policies.
   300  	ID string `json:"id"`
   301  	// Determines how incidents are created for critical violations of the conditions contained in the policy.
   302  	IncidentPreference AlertsIncidentPreference `json:"incidentPreference"`
   303  	// Description of the policy.
   304  	Name string `json:"name"`
   305  }
   306  
   307  // AlertsPolicyInput - Container for conditions with associated notifications channels.
   308  type AlertsPolicyInput struct {
   309  	// Determines how incidents are created for critical violations of the conditions contained in the policy.
   310  	IncidentPreference AlertsIncidentPreference `json:"incidentPreference"`
   311  	// Description of the policy.
   312  	Name string `json:"name"`
   313  }
   314  
   315  // AlertsPolicyUpdateInput - Policy fields to be updated.
   316  type AlertsPolicyUpdateInput struct {
   317  	// Determines how incidents are created for critical violations of the conditions contained in the policy.
   318  	IncidentPreference AlertsIncidentPreference `json:"incidentPreference,omitempty"`
   319  	// Description of the policy.
   320  	Name string `json:"name,omitempty"`
   321  }