github.com/newrelic/newrelic-client-go@v1.1.0/pkg/servicelevel/types.go (about) 1 // Code generated by tutone: DO NOT EDIT 2 package servicelevel 3 4 import ( 5 "github.com/newrelic/newrelic-client-go/pkg/accounts" 6 "github.com/newrelic/newrelic-client-go/pkg/common" 7 "github.com/newrelic/newrelic-client-go/pkg/nrtime" 8 ) 9 10 // ServiceLevelEventsQuerySelectFunction - The function to use in the SELECT clause. 11 type ServiceLevelEventsQuerySelectFunction string 12 13 var ServiceLevelEventsQuerySelectFunctionTypes = struct { 14 // COUNT. 15 COUNT ServiceLevelEventsQuerySelectFunction 16 // SUM. 17 SUM ServiceLevelEventsQuerySelectFunction 18 }{ 19 // COUNT. 20 COUNT: "COUNT", 21 // SUM. 22 SUM: "SUM", 23 } 24 25 // ServiceLevelObjectiveRollingTimeWindowUnit - The rolling time window units. 26 type ServiceLevelObjectiveRollingTimeWindowUnit string 27 28 var ServiceLevelObjectiveRollingTimeWindowUnitTypes = struct { 29 // Day. 30 DAY ServiceLevelObjectiveRollingTimeWindowUnit 31 }{ 32 // Day. 33 DAY: "DAY", 34 } 35 36 // Actor - The `Actor` object contains fields that are scoped to the API user's access level. 37 type Actor struct { 38 // Fetch a single entity. 39 // 40 // For more details on entities, visit our [entity docs](https://docs.newrelic.com/docs/apis/graphql-api/tutorials/use-new-relic-graphql-api-query-entities). 41 Entity EntityInterface `json:"entity,omitempty"` 42 } 43 44 // Entity - The `Entity` interface allows fetching detailed entity information for a single entity. 45 // 46 // To understand more about entities and entity types, look at [our docs](https://docs.newrelic.com/docs/what-are-new-relic-entities). 47 type Entity struct { 48 // The New Relic account ID associated with this entity. 49 AccountID int `json:"accountId,omitempty"` 50 // The entity's domain 51 Domain string `json:"domain,omitempty"` 52 // The name of this entity. 53 Name string `json:"name,omitempty"` 54 // The url to the entity. 55 Permalink string `json:"permalink,omitempty"` 56 // The service level defined for the entity. 57 ServiceLevel ServiceLevelDefinition `json:"serviceLevel,omitempty"` 58 // The entity's type 59 Type string `json:"type,omitempty"` 60 } 61 62 // ServiceLevelDefinition - The service level defined for a specific entity. 63 type ServiceLevelDefinition struct { 64 // The SLIs attached to the entity. 65 Indicators []ServiceLevelIndicator `json:"indicators"` 66 } 67 68 // ServiceLevelEvents - The events that define the SLI. 69 type ServiceLevelEvents struct { 70 // The New Relic account to fetch the events from. 71 Account accounts.AccountReference `json:"account,omitempty"` 72 // The definition of bad events. 73 BadEvents *ServiceLevelEventsQuery `json:"badEvents,omitempty"` 74 // The definition of good events. 75 GoodEvents *ServiceLevelEventsQuery `json:"goodEvents,omitempty"` 76 // The definition of valid events. 77 ValidEvents *ServiceLevelEventsQuery `json:"validEvents"` 78 } 79 80 // ServiceLevelEventsCreateInput - The events that define the SLI. 81 type ServiceLevelEventsCreateInput struct { 82 // The New Relic account ID where the events are fetched from. 83 AccountID int `json:"accountId"` 84 // The definition of bad events. 85 BadEvents *ServiceLevelEventsQueryCreateInput `json:"badEvents,omitempty"` 86 // The definition of good events. 87 GoodEvents *ServiceLevelEventsQueryCreateInput `json:"goodEvents,omitempty"` 88 // The definition of valid events. 89 ValidEvents *ServiceLevelEventsQueryCreateInput `json:"validEvents,omitempty"` 90 } 91 92 // ServiceLevelEventsQuery - The query that represents the events to fetch. 93 type ServiceLevelEventsQuery struct { 94 // The NRDB event to fetch the data from. 95 From NRQL `json:"from"` 96 // The NRQL SELECT clause to aggregate events. 97 Select ServiceLevelEventsQuerySelect `json:"select,omitempty"` 98 // The NRQL condition to filter the events. 99 Where NRQL `json:"where,omitempty"` 100 } 101 102 // ServiceLevelEventsQueryCreateInput - The query that represents the events to fetch. 103 type ServiceLevelEventsQueryCreateInput struct { 104 // The NRDB event to fetch the data from. 105 From NRQL `json:"from"` 106 // The NRQL SELECT clause to aggregate events. Default is COUNT(*). 107 Select *ServiceLevelEventsQuerySelectCreateInput `json:"select,omitempty"` 108 // The NRQL condition to filter the events. 109 Where NRQL `json:"where,omitempty"` 110 } 111 112 // ServiceLevelEventsQuerySelect - The resulting NRQL SELECT clause to aggregate events. 113 type ServiceLevelEventsQuerySelect struct { 114 // The event attribute to use in the SELECT clause. 115 Attribute string `json:"attribute,omitempty"` 116 // The function to use in the SELECT clause. 117 Function ServiceLevelEventsQuerySelectFunction `json:"function"` 118 } 119 120 // ServiceLevelEventsQuerySelectCreateInput - The NRQL SELECT clause to aggregate events. 121 type ServiceLevelEventsQuerySelectCreateInput struct { 122 // The event attribute to use in the SELECT clause. 123 Attribute string `json:"attribute,omitempty"` 124 // The function to use in the SELECT clause. 125 Function ServiceLevelEventsQuerySelectFunction `json:"function"` 126 } 127 128 // ServiceLevelEventsQuerySelectUpdateInput - The NRQL SELECT clause to aggregate events. 129 type ServiceLevelEventsQuerySelectUpdateInput struct { 130 // The event attribute to use in the SELECT clause. 131 Attribute string `json:"attribute,omitempty"` 132 // The function to use in the SELECT clause. 133 Function ServiceLevelEventsQuerySelectFunction `json:"function"` 134 } 135 136 // ServiceLevelEventsQueryUpdateInput - The query that represents the events to fetch. 137 type ServiceLevelEventsQueryUpdateInput struct { 138 // The NRDB event to fetch the data from. 139 From NRQL `json:"from"` 140 // The NRQL SELECT clause to aggregate events. Default is COUNT(*). 141 Select *ServiceLevelEventsQuerySelectUpdateInput `json:"select,omitempty"` 142 // The NRQL condition to filter the events. 143 Where NRQL `json:"where,omitempty"` 144 } 145 146 // ServiceLevelEventsUpdateInput - The events that define the SLI. 147 type ServiceLevelEventsUpdateInput struct { 148 // The definition of bad events. 149 BadEvents *ServiceLevelEventsQueryUpdateInput `json:"badEvents,omitempty"` 150 // The definition of good events. 151 GoodEvents *ServiceLevelEventsQueryUpdateInput `json:"goodEvents,omitempty"` 152 // The definition of valid events. 153 ValidEvents *ServiceLevelEventsQueryUpdateInput `json:"validEvents,omitempty"` 154 } 155 156 // ServiceLevelIndicator - The definition of the SLI. 157 type ServiceLevelIndicator struct { 158 // The date when the SLI was created represented in the number of milliseconds since the Unix epoch. 159 CreatedAt *nrtime.EpochMilliseconds `json:"createdAt"` 160 // The user who created the SLI. 161 CreatedBy UserReference `json:"createdBy,omitempty"` 162 // The description of the SLI. 163 Description string `json:"description,omitempty"` 164 // The entity which the SLI is attached to. 165 EntityGUID common.EntityGUID `json:"entityGuid"` 166 // The events that define the SLI. 167 Events ServiceLevelEvents `json:"events"` 168 // The unique entity identifier of the SLI. 169 GUID common.EntityGUID `json:"guid"` 170 // The unique identifier of the SLI. 171 ID string `json:"id"` 172 // The name of the SLI. 173 Name string `json:"name"` 174 // A list of objective definitions. 175 Objectives []ServiceLevelObjective `json:"objectives"` 176 // The date when the SLI was last updated represented in the number of milliseconds since the Unix epoch. 177 UpdatedAt *nrtime.EpochMilliseconds `json:"updatedAt,omitempty"` 178 // The user who last update the SLI. 179 UpdatedBy UserReference `json:"updatedBy,omitempty"` 180 } 181 182 // ServiceLevelIndicatorCreateInput - The input object that represents the SLI that will be created. 183 type ServiceLevelIndicatorCreateInput struct { 184 // The description of the SLI. 185 Description string `json:"description,omitempty"` 186 // The events that define the SLI. 187 Events ServiceLevelEventsCreateInput `json:"events,omitempty"` 188 // The name of the SLI. 189 Name string `json:"name"` 190 // A list of objective definitions. 191 Objectives []ServiceLevelObjectiveCreateInput `json:"objectives,omitempty"` 192 } 193 194 // ServiceLevelIndicatorResultQueries - The resulting NRQL queries that help consume the metrics of the SLI. 195 type ServiceLevelIndicatorResultQueries struct { 196 // The NRQL query that measures the good events. 197 GoodEvents ServiceLevelResultQuery `json:"goodEvents"` 198 // The NRQL query that measures the value of the SLI. 199 Indicator ServiceLevelResultQuery `json:"indicator"` 200 // The NRQL query that measures the valid events. 201 ValidEvents ServiceLevelResultQuery `json:"validEvents"` 202 } 203 204 // ServiceLevelIndicatorUpdateInput - The input object that represents the SLI that will be updated. 205 type ServiceLevelIndicatorUpdateInput struct { 206 // The description of the SLI. 207 Description string `json:"description,omitempty"` 208 // The events that define the SLI. 209 Events *ServiceLevelEventsUpdateInput `json:"events,omitempty"` 210 // The name of the SLI. 211 Name string `json:"name,omitempty"` 212 // A list of objective definitions. 213 Objectives []ServiceLevelObjectiveUpdateInput `json:"objectives,omitempty"` 214 } 215 216 // ServiceLevelObjective - An objective definition. 217 type ServiceLevelObjective struct { 218 // The description of the SLO. 219 Description string `json:"description,omitempty"` 220 // The name of the SLO. 221 Name string `json:"name,omitempty"` 222 // The target percentage of the SLO. 223 Target float64 `json:"target"` 224 // The time window configuration of the SLO. 225 TimeWindow ServiceLevelObjectiveTimeWindow `json:"timeWindow"` 226 } 227 228 // ServiceLevelObjectiveCreateInput - The input object that represents an objective definition. 229 type ServiceLevelObjectiveCreateInput struct { 230 // The description of the SLO. 231 Description string `json:"description,omitempty"` 232 // The name of the SLO. 233 Name string `json:"name,omitempty"` 234 // The target percentage of the SLO. Maximum value is 100. 235 Target float64 `json:"target"` 236 // The time window configuration of the SLO. 237 TimeWindow ServiceLevelObjectiveTimeWindowCreateInput `json:"timeWindow,omitempty"` 238 } 239 240 // ServiceLevelObjectiveResultQueries - The resulting NRQL queries that help consume the metrics of the SLO. 241 type ServiceLevelObjectiveResultQueries struct { 242 // The NRQL query that measures the attainment of the SLO target. 243 Attainment ServiceLevelResultQuery `json:"attainment"` 244 } 245 246 // ServiceLevelObjectiveRollingTimeWindow - The rolling time window configuration of the SLO. 247 type ServiceLevelObjectiveRollingTimeWindow struct { 248 // The count of time units. 249 Count int `json:"count"` 250 // The time unit. 251 Unit ServiceLevelObjectiveRollingTimeWindowUnit `json:"unit"` 252 } 253 254 // ServiceLevelObjectiveRollingTimeWindowCreateInput - The rolling time window configuration of the SLO. 255 type ServiceLevelObjectiveRollingTimeWindowCreateInput struct { 256 // The count of time units. Accepted values are 1, 7 and 28 days. 257 Count int `json:"count"` 258 // The time unit. 259 Unit ServiceLevelObjectiveRollingTimeWindowUnit `json:"unit"` 260 } 261 262 // ServiceLevelObjectiveRollingTimeWindowUpdateInput - The rolling time window configuration of the SLO. 263 type ServiceLevelObjectiveRollingTimeWindowUpdateInput struct { 264 // The count of time units. Accepted values are 1, 7 and 28 days. 265 Count int `json:"count"` 266 // The time unit. 267 Unit ServiceLevelObjectiveRollingTimeWindowUnit `json:"unit"` 268 } 269 270 // ServiceLevelObjectiveTimeWindow - The time window configuration of the SLO. 271 type ServiceLevelObjectiveTimeWindow struct { 272 // The rolling time window configuration of the SLO. 273 Rolling ServiceLevelObjectiveRollingTimeWindow `json:"rolling,omitempty"` 274 } 275 276 // ServiceLevelObjectiveTimeWindowCreateInput - The time window configuration of the SLO. 277 type ServiceLevelObjectiveTimeWindowCreateInput struct { 278 // The rolling time window configuration of the SLO. 279 Rolling ServiceLevelObjectiveRollingTimeWindowCreateInput `json:"rolling,omitempty"` 280 } 281 282 // ServiceLevelObjectiveTimeWindowUpdateInput - The time window configuration of the SLO. 283 type ServiceLevelObjectiveTimeWindowUpdateInput struct { 284 // The rolling time window configuration of the SLO. 285 Rolling ServiceLevelObjectiveRollingTimeWindowUpdateInput `json:"rolling,omitempty"` 286 } 287 288 // ServiceLevelObjectiveUpdateInput - The input object that represents an objective definition. 289 type ServiceLevelObjectiveUpdateInput struct { 290 // The description of the SLO. 291 Description string `json:"description,omitempty"` 292 // The name of the SLO. 293 Name string `json:"name,omitempty"` 294 // The target percentage of the SLO. Maximum value is 100. 295 Target float64 `json:"target"` 296 // The time window configuration of the SLO. 297 TimeWindow ServiceLevelObjectiveTimeWindowUpdateInput `json:"timeWindow,omitempty"` 298 } 299 300 // ServiceLevelResultQuery - A resulting query. 301 type ServiceLevelResultQuery struct { 302 // A NRQL query. 303 NRQL NRQL `json:"nrql"` 304 } 305 306 // UserReference - The `UserReference` object provides basic identifying information about the user. 307 type UserReference struct { 308 // 309 Email string `json:"email,omitempty"` 310 // 311 Gravatar string `json:"gravatar,omitempty"` 312 // 313 ID int `json:"id,omitempty"` 314 // 315 Name string `json:"name,omitempty"` 316 } 317 318 type indicatorsResponse struct { 319 Actor Actor `json:"actor"` 320 } 321 322 // Float - The `Float` scalar type represents signed double-precision fractional 323 // values as specified by 324 // [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). 325 type Float string 326 327 // ID - The `ID` scalar type represents a unique identifier, often used to 328 // refetch an object or as key for a cache. The ID type appears in a JSON 329 // response as a String; however, it is not intended to be human-readable. 330 // When expected as an input type, any string (such as `"4"`) or integer 331 // (such as `4`) input value will be accepted as an ID. 332 type ID string 333 334 // NRQL - This scalar represents a NRQL query string. 335 // 336 // See the [NRQL Docs](https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions) for more information about NRQL syntax. 337 type NRQL string