1// +build go1.13 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// Code generated by Microsoft (R) AutoRest Code Generator. 6// Changes may cause incorrect behavior and will be lost if the code is regenerated. 7 8package armmonitor 9 10import ( 11 "encoding/json" 12 "github.com/Azure/azure-sdk-for-go/sdk/azcore" 13 "reflect" 14 "time" 15) 16 17// ActionClassification provides polymorphic access to related types. 18// Call the interface's GetAction() method to access the common type. 19// Use a type switch to determine the concrete type. The possible types are: 20// - *Action, *AlertingAction, *LogToMetricAction 21type ActionClassification interface { 22 // GetAction returns the Action content of the underlying type. 23 GetAction() *Action 24} 25 26// Action descriptor. 27type Action struct { 28 // REQUIRED; Specifies the action. Supported values - AlertingAction, LogToMetricAction 29 OdataType *string `json:"odata.type,omitempty"` 30} 31 32// GetAction implements the ActionClassification interface for type Action. 33func (a *Action) GetAction() *Action { return a } 34 35// UnmarshalJSON implements the json.Unmarshaller interface for type Action. 36func (a *Action) UnmarshalJSON(data []byte) error { 37 var rawMsg map[string]json.RawMessage 38 if err := json.Unmarshal(data, &rawMsg); err != nil { 39 return err 40 } 41 return a.unmarshalInternal(rawMsg) 42} 43 44func (a Action) marshalInternal(discValue string) map[string]interface{} { 45 objectMap := make(map[string]interface{}) 46 a.OdataType = &discValue 47 objectMap["odata.type"] = a.OdataType 48 return objectMap 49} 50 51func (a *Action) unmarshalInternal(rawMsg map[string]json.RawMessage) error { 52 for key, val := range rawMsg { 53 var err error 54 switch key { 55 case "odata.type": 56 err = unpopulate(val, &a.OdataType) 57 delete(rawMsg, key) 58 } 59 if err != nil { 60 return err 61 } 62 } 63 return nil 64} 65 66// ActionGroup - An Azure action group. 67type ActionGroup struct { 68 // REQUIRED; Indicates whether this action group is enabled. If an action group is not enabled, then none of its receivers will receive communications. 69 Enabled *bool `json:"enabled,omitempty"` 70 71 // REQUIRED; The short name of the action group. This will be used in SMS messages. 72 GroupShortName *string `json:"groupShortName,omitempty"` 73 74 // The list of ARM role receivers that are part of this action group. Roles are Azure RBAC roles and only built-in roles are supported. 75 ArmRoleReceivers []*ArmRoleReceiver `json:"armRoleReceivers,omitempty"` 76 77 // The list of AutomationRunbook receivers that are part of this action group. 78 AutomationRunbookReceivers []*AutomationRunbookReceiver `json:"automationRunbookReceivers,omitempty"` 79 80 // The list of AzureAppPush receivers that are part of this action group. 81 AzureAppPushReceivers []*AzureAppPushReceiver `json:"azureAppPushReceivers,omitempty"` 82 83 // The list of azure function receivers that are part of this action group. 84 AzureFunctionReceivers []*AzureFunctionReceiver `json:"azureFunctionReceivers,omitempty"` 85 86 // The list of email receivers that are part of this action group. 87 EmailReceivers []*EmailReceiver `json:"emailReceivers,omitempty"` 88 89 // The list of ITSM receivers that are part of this action group. 90 ItsmReceivers []*ItsmReceiver `json:"itsmReceivers,omitempty"` 91 92 // The list of logic app receivers that are part of this action group. 93 LogicAppReceivers []*LogicAppReceiver `json:"logicAppReceivers,omitempty"` 94 95 // The list of SMS receivers that are part of this action group. 96 SmsReceivers []*SmsReceiver `json:"smsReceivers,omitempty"` 97 98 // The list of voice receivers that are part of this action group. 99 VoiceReceivers []*VoiceReceiver `json:"voiceReceivers,omitempty"` 100 101 // The list of webhook receivers that are part of this action group. 102 WebhookReceivers []*WebhookReceiver `json:"webhookReceivers,omitempty"` 103} 104 105// MarshalJSON implements the json.Marshaller interface for type ActionGroup. 106func (a ActionGroup) MarshalJSON() ([]byte, error) { 107 objectMap := make(map[string]interface{}) 108 populate(objectMap, "armRoleReceivers", a.ArmRoleReceivers) 109 populate(objectMap, "automationRunbookReceivers", a.AutomationRunbookReceivers) 110 populate(objectMap, "azureAppPushReceivers", a.AzureAppPushReceivers) 111 populate(objectMap, "azureFunctionReceivers", a.AzureFunctionReceivers) 112 populate(objectMap, "emailReceivers", a.EmailReceivers) 113 populate(objectMap, "enabled", a.Enabled) 114 populate(objectMap, "groupShortName", a.GroupShortName) 115 populate(objectMap, "itsmReceivers", a.ItsmReceivers) 116 populate(objectMap, "logicAppReceivers", a.LogicAppReceivers) 117 populate(objectMap, "smsReceivers", a.SmsReceivers) 118 populate(objectMap, "voiceReceivers", a.VoiceReceivers) 119 populate(objectMap, "webhookReceivers", a.WebhookReceivers) 120 return json.Marshal(objectMap) 121} 122 123// ActionGroupList - A list of action groups. 124type ActionGroupList struct { 125 // Provides the link to retrieve the next set of elements. 126 NextLink *string `json:"nextLink,omitempty"` 127 128 // The list of action groups. 129 Value []*ActionGroupResource `json:"value,omitempty"` 130} 131 132// MarshalJSON implements the json.Marshaller interface for type ActionGroupList. 133func (a ActionGroupList) MarshalJSON() ([]byte, error) { 134 objectMap := make(map[string]interface{}) 135 populate(objectMap, "nextLink", a.NextLink) 136 populate(objectMap, "value", a.Value) 137 return json.Marshal(objectMap) 138} 139 140// ActionGroupPatch - An Azure action group for patch operations. 141type ActionGroupPatch struct { 142 // Indicates whether this action group is enabled. If an action group is not enabled, then none of its actions will be activated. 143 Enabled *bool `json:"enabled,omitempty"` 144} 145 146// ActionGroupPatchBody - An action group object for the body of patch operations. 147type ActionGroupPatchBody struct { 148 // The action group settings for an update operation. 149 Properties *ActionGroupPatch `json:"properties,omitempty"` 150 151 // Resource tags 152 Tags map[string]*string `json:"tags,omitempty"` 153} 154 155// MarshalJSON implements the json.Marshaller interface for type ActionGroupPatchBody. 156func (a ActionGroupPatchBody) MarshalJSON() ([]byte, error) { 157 objectMap := make(map[string]interface{}) 158 populate(objectMap, "properties", a.Properties) 159 populate(objectMap, "tags", a.Tags) 160 return json.Marshal(objectMap) 161} 162 163// ActionGroupResource - An action group resource. 164type ActionGroupResource struct { 165 AzureResource 166 // The action groups properties of the resource. 167 Properties *ActionGroup `json:"properties,omitempty"` 168} 169 170// MarshalJSON implements the json.Marshaller interface for type ActionGroupResource. 171func (a ActionGroupResource) MarshalJSON() ([]byte, error) { 172 objectMap := a.AzureResource.marshalInternal() 173 populate(objectMap, "properties", a.Properties) 174 return json.Marshal(objectMap) 175} 176 177// ActionGroupsCreateOrUpdateOptions contains the optional parameters for the ActionGroups.CreateOrUpdate method. 178type ActionGroupsCreateOrUpdateOptions struct { 179 // placeholder for future optional parameters 180} 181 182// ActionGroupsDeleteOptions contains the optional parameters for the ActionGroups.Delete method. 183type ActionGroupsDeleteOptions struct { 184 // placeholder for future optional parameters 185} 186 187// ActionGroupsEnableReceiverOptions contains the optional parameters for the ActionGroups.EnableReceiver method. 188type ActionGroupsEnableReceiverOptions struct { 189 // placeholder for future optional parameters 190} 191 192// ActionGroupsGetOptions contains the optional parameters for the ActionGroups.Get method. 193type ActionGroupsGetOptions struct { 194 // placeholder for future optional parameters 195} 196 197// ActionGroupsListByResourceGroupOptions contains the optional parameters for the ActionGroups.ListByResourceGroup method. 198type ActionGroupsListByResourceGroupOptions struct { 199 // placeholder for future optional parameters 200} 201 202// ActionGroupsListBySubscriptionIDOptions contains the optional parameters for the ActionGroups.ListBySubscriptionID method. 203type ActionGroupsListBySubscriptionIDOptions struct { 204 // placeholder for future optional parameters 205} 206 207// ActionGroupsUpdateOptions contains the optional parameters for the ActionGroups.Update method. 208type ActionGroupsUpdateOptions struct { 209 // placeholder for future optional parameters 210} 211 212// ActivityLogAlert - An Azure activity log alert. 213type ActivityLogAlert struct { 214 // REQUIRED; The actions that will activate when the condition is met. 215 Actions *ActivityLogAlertActionList `json:"actions,omitempty"` 216 217 // REQUIRED; The condition that will cause this alert to activate. 218 Condition *ActivityLogAlertAllOfCondition `json:"condition,omitempty"` 219 220 // REQUIRED; A list of resourceIds that will be used as prefixes. The alert will only apply to activityLogs with resourceIds that fall under one of these 221 // prefixes. This list must include at least one item. 222 Scopes []*string `json:"scopes,omitempty"` 223 224 // A description of this activity log alert. 225 Description *string `json:"description,omitempty"` 226 227 // Indicates whether this activity log alert is enabled. If an activity log alert is not enabled, then none of its actions will be activated. 228 Enabled *bool `json:"enabled,omitempty"` 229} 230 231// MarshalJSON implements the json.Marshaller interface for type ActivityLogAlert. 232func (a ActivityLogAlert) MarshalJSON() ([]byte, error) { 233 objectMap := make(map[string]interface{}) 234 populate(objectMap, "actions", a.Actions) 235 populate(objectMap, "condition", a.Condition) 236 populate(objectMap, "description", a.Description) 237 populate(objectMap, "enabled", a.Enabled) 238 populate(objectMap, "scopes", a.Scopes) 239 return json.Marshal(objectMap) 240} 241 242// ActivityLogAlertActionGroup - A pointer to an Azure Action Group. 243type ActivityLogAlertActionGroup struct { 244 // REQUIRED; The resourceId of the action group. This cannot be null or empty. 245 ActionGroupID *string `json:"actionGroupId,omitempty"` 246 247 // the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. 248 WebhookProperties map[string]*string `json:"webhookProperties,omitempty"` 249} 250 251// MarshalJSON implements the json.Marshaller interface for type ActivityLogAlertActionGroup. 252func (a ActivityLogAlertActionGroup) MarshalJSON() ([]byte, error) { 253 objectMap := make(map[string]interface{}) 254 populate(objectMap, "actionGroupId", a.ActionGroupID) 255 populate(objectMap, "webhookProperties", a.WebhookProperties) 256 return json.Marshal(objectMap) 257} 258 259// ActivityLogAlertActionList - A list of activity log alert actions. 260type ActivityLogAlertActionList struct { 261 // The list of activity log alerts. 262 ActionGroups []*ActivityLogAlertActionGroup `json:"actionGroups,omitempty"` 263} 264 265// MarshalJSON implements the json.Marshaller interface for type ActivityLogAlertActionList. 266func (a ActivityLogAlertActionList) MarshalJSON() ([]byte, error) { 267 objectMap := make(map[string]interface{}) 268 populate(objectMap, "actionGroups", a.ActionGroups) 269 return json.Marshal(objectMap) 270} 271 272// ActivityLogAlertAllOfCondition - An Activity Log alert condition that is met when all its member conditions are met. 273type ActivityLogAlertAllOfCondition struct { 274 // REQUIRED; The list of activity log alert conditions. 275 AllOf []*ActivityLogAlertLeafCondition `json:"allOf,omitempty"` 276} 277 278// MarshalJSON implements the json.Marshaller interface for type ActivityLogAlertAllOfCondition. 279func (a ActivityLogAlertAllOfCondition) MarshalJSON() ([]byte, error) { 280 objectMap := make(map[string]interface{}) 281 populate(objectMap, "allOf", a.AllOf) 282 return json.Marshal(objectMap) 283} 284 285// ActivityLogAlertLeafCondition - An Activity Log alert condition that is met by comparing an activity log field and value. 286type ActivityLogAlertLeafCondition struct { 287 // REQUIRED; The field value will be compared to this value (case-insensitive) to determine if the condition is met. 288 Equals *string `json:"equals,omitempty"` 289 290 // REQUIRED; The name of the field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 291 // 'caller', 'level', 'operationName', 'resourceGroup', 292 // 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties.'. 293 Field *string `json:"field,omitempty"` 294} 295 296// ActivityLogAlertList - A list of activity log alerts. 297type ActivityLogAlertList struct { 298 // Provides the link to retrieve the next set of elements. 299 NextLink *string `json:"nextLink,omitempty"` 300 301 // The list of activity log alerts. 302 Value []*ActivityLogAlertResource `json:"value,omitempty"` 303} 304 305// MarshalJSON implements the json.Marshaller interface for type ActivityLogAlertList. 306func (a ActivityLogAlertList) MarshalJSON() ([]byte, error) { 307 objectMap := make(map[string]interface{}) 308 populate(objectMap, "nextLink", a.NextLink) 309 populate(objectMap, "value", a.Value) 310 return json.Marshal(objectMap) 311} 312 313// ActivityLogAlertPatch - An Azure activity log alert for patch operations. 314type ActivityLogAlertPatch struct { 315 // Indicates whether this activity log alert is enabled. If an activity log alert is not enabled, then none of its actions will be activated. 316 Enabled *bool `json:"enabled,omitempty"` 317} 318 319// ActivityLogAlertPatchBody - An activity log alert object for the body of patch operations. 320type ActivityLogAlertPatchBody struct { 321 // The activity log alert settings for an update operation. 322 Properties *ActivityLogAlertPatch `json:"properties,omitempty"` 323 324 // Resource tags 325 Tags map[string]*string `json:"tags,omitempty"` 326} 327 328// MarshalJSON implements the json.Marshaller interface for type ActivityLogAlertPatchBody. 329func (a ActivityLogAlertPatchBody) MarshalJSON() ([]byte, error) { 330 objectMap := make(map[string]interface{}) 331 populate(objectMap, "properties", a.Properties) 332 populate(objectMap, "tags", a.Tags) 333 return json.Marshal(objectMap) 334} 335 336// ActivityLogAlertResource - An activity log alert resource. 337type ActivityLogAlertResource struct { 338 Resource 339 // The activity log alert properties of the resource. 340 Properties *ActivityLogAlert `json:"properties,omitempty"` 341} 342 343// MarshalJSON implements the json.Marshaller interface for type ActivityLogAlertResource. 344func (a ActivityLogAlertResource) MarshalJSON() ([]byte, error) { 345 objectMap := a.Resource.marshalInternal() 346 populate(objectMap, "properties", a.Properties) 347 return json.Marshal(objectMap) 348} 349 350// ActivityLogAlertsCreateOrUpdateOptions contains the optional parameters for the ActivityLogAlerts.CreateOrUpdate method. 351type ActivityLogAlertsCreateOrUpdateOptions struct { 352 // placeholder for future optional parameters 353} 354 355// ActivityLogAlertsDeleteOptions contains the optional parameters for the ActivityLogAlerts.Delete method. 356type ActivityLogAlertsDeleteOptions struct { 357 // placeholder for future optional parameters 358} 359 360// ActivityLogAlertsGetOptions contains the optional parameters for the ActivityLogAlerts.Get method. 361type ActivityLogAlertsGetOptions struct { 362 // placeholder for future optional parameters 363} 364 365// ActivityLogAlertsListByResourceGroupOptions contains the optional parameters for the ActivityLogAlerts.ListByResourceGroup method. 366type ActivityLogAlertsListByResourceGroupOptions struct { 367 // placeholder for future optional parameters 368} 369 370// ActivityLogAlertsListBySubscriptionIDOptions contains the optional parameters for the ActivityLogAlerts.ListBySubscriptionID method. 371type ActivityLogAlertsListBySubscriptionIDOptions struct { 372 // placeholder for future optional parameters 373} 374 375// ActivityLogAlertsUpdateOptions contains the optional parameters for the ActivityLogAlerts.Update method. 376type ActivityLogAlertsUpdateOptions struct { 377 // placeholder for future optional parameters 378} 379 380// ActivityLogsListOptions contains the optional parameters for the ActivityLogs.List method. 381type ActivityLogsListOptions struct { 382 // Used to fetch events with only the given properties.<br>The **$select** argument is a comma separated list of property names to be returned. Possible 383 // values are: *authorization*, *claims*, *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, *operationId*, 384 // *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, *status*, *submissionTimestamp*, *subStatus*, *subscriptionId* 385 Select *string 386} 387 388// AlertRule - An alert rule. 389type AlertRule struct { 390 // REQUIRED; the condition that results in the alert rule being activated. 391 Condition RuleConditionClassification `json:"condition,omitempty"` 392 393 // REQUIRED; the flag that indicates whether the alert rule is enabled. 394 IsEnabled *bool `json:"isEnabled,omitempty"` 395 396 // REQUIRED; the name of the alert rule. 397 Name *string `json:"name,omitempty"` 398 399 // action that is performed when the alert rule becomes active, and when an alert condition is resolved. 400 Action RuleActionClassification `json:"action,omitempty"` 401 402 // the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. 403 Actions []RuleActionClassification `json:"actions,omitempty"` 404 405 // the description of the alert rule that will be included in the alert email. 406 Description *string `json:"description,omitempty"` 407 408 // the provisioning state. 409 ProvisioningState *string `json:"provisioningState,omitempty"` 410 411 // READ-ONLY; Last time the rule was updated in ISO8601 format. 412 LastUpdatedTime *time.Time `json:"lastUpdatedTime,omitempty" azure:"ro"` 413} 414 415// MarshalJSON implements the json.Marshaller interface for type AlertRule. 416func (a AlertRule) MarshalJSON() ([]byte, error) { 417 objectMap := make(map[string]interface{}) 418 populate(objectMap, "action", a.Action) 419 populate(objectMap, "actions", a.Actions) 420 populate(objectMap, "condition", a.Condition) 421 populate(objectMap, "description", a.Description) 422 populate(objectMap, "isEnabled", a.IsEnabled) 423 populate(objectMap, "lastUpdatedTime", (*timeRFC3339)(a.LastUpdatedTime)) 424 populate(objectMap, "name", a.Name) 425 populate(objectMap, "provisioningState", a.ProvisioningState) 426 return json.Marshal(objectMap) 427} 428 429// UnmarshalJSON implements the json.Unmarshaller interface for type AlertRule. 430func (a *AlertRule) UnmarshalJSON(data []byte) error { 431 var rawMsg map[string]json.RawMessage 432 if err := json.Unmarshal(data, &rawMsg); err != nil { 433 return err 434 } 435 for key, val := range rawMsg { 436 var err error 437 switch key { 438 case "action": 439 a.Action, err = unmarshalRuleActionClassification(val) 440 delete(rawMsg, key) 441 case "actions": 442 a.Actions, err = unmarshalRuleActionClassificationArray(val) 443 delete(rawMsg, key) 444 case "condition": 445 a.Condition, err = unmarshalRuleConditionClassification(val) 446 delete(rawMsg, key) 447 case "description": 448 err = unpopulate(val, &a.Description) 449 delete(rawMsg, key) 450 case "isEnabled": 451 err = unpopulate(val, &a.IsEnabled) 452 delete(rawMsg, key) 453 case "lastUpdatedTime": 454 var aux timeRFC3339 455 err = unpopulate(val, &aux) 456 a.LastUpdatedTime = (*time.Time)(&aux) 457 delete(rawMsg, key) 458 case "name": 459 err = unpopulate(val, &a.Name) 460 delete(rawMsg, key) 461 case "provisioningState": 462 err = unpopulate(val, &a.ProvisioningState) 463 delete(rawMsg, key) 464 } 465 if err != nil { 466 return err 467 } 468 } 469 return nil 470} 471 472// AlertRuleIncidentsGetOptions contains the optional parameters for the AlertRuleIncidents.Get method. 473type AlertRuleIncidentsGetOptions struct { 474 // placeholder for future optional parameters 475} 476 477// AlertRuleIncidentsListByAlertRuleOptions contains the optional parameters for the AlertRuleIncidents.ListByAlertRule method. 478type AlertRuleIncidentsListByAlertRuleOptions struct { 479 // placeholder for future optional parameters 480} 481 482// AlertRuleResource - The alert rule resource. 483type AlertRuleResource struct { 484 Resource 485 // REQUIRED; The alert rule properties of the resource. 486 Properties *AlertRule `json:"properties,omitempty"` 487} 488 489// MarshalJSON implements the json.Marshaller interface for type AlertRuleResource. 490func (a AlertRuleResource) MarshalJSON() ([]byte, error) { 491 objectMap := a.Resource.marshalInternal() 492 populate(objectMap, "properties", a.Properties) 493 return json.Marshal(objectMap) 494} 495 496// AlertRuleResourceCollection - Represents a collection of alert rule resources. 497type AlertRuleResourceCollection struct { 498 // the values for the alert rule resources. 499 Value []*AlertRuleResource `json:"value,omitempty"` 500} 501 502// MarshalJSON implements the json.Marshaller interface for type AlertRuleResourceCollection. 503func (a AlertRuleResourceCollection) MarshalJSON() ([]byte, error) { 504 objectMap := make(map[string]interface{}) 505 populate(objectMap, "value", a.Value) 506 return json.Marshal(objectMap) 507} 508 509// AlertRuleResourcePatch - The alert rule object for patch operations. 510type AlertRuleResourcePatch struct { 511 // The properties of an alert rule. 512 Properties *AlertRule `json:"properties,omitempty"` 513 514 // Resource tags 515 Tags map[string]*string `json:"tags,omitempty"` 516} 517 518// MarshalJSON implements the json.Marshaller interface for type AlertRuleResourcePatch. 519func (a AlertRuleResourcePatch) MarshalJSON() ([]byte, error) { 520 objectMap := make(map[string]interface{}) 521 populate(objectMap, "properties", a.Properties) 522 populate(objectMap, "tags", a.Tags) 523 return json.Marshal(objectMap) 524} 525 526// AlertRulesCreateOrUpdateOptions contains the optional parameters for the AlertRules.CreateOrUpdate method. 527type AlertRulesCreateOrUpdateOptions struct { 528 // placeholder for future optional parameters 529} 530 531// AlertRulesDeleteOptions contains the optional parameters for the AlertRules.Delete method. 532type AlertRulesDeleteOptions struct { 533 // placeholder for future optional parameters 534} 535 536// AlertRulesGetOptions contains the optional parameters for the AlertRules.Get method. 537type AlertRulesGetOptions struct { 538 // placeholder for future optional parameters 539} 540 541// AlertRulesListByResourceGroupOptions contains the optional parameters for the AlertRules.ListByResourceGroup method. 542type AlertRulesListByResourceGroupOptions struct { 543 // placeholder for future optional parameters 544} 545 546// AlertRulesListBySubscriptionOptions contains the optional parameters for the AlertRules.ListBySubscription method. 547type AlertRulesListBySubscriptionOptions struct { 548 // placeholder for future optional parameters 549} 550 551// AlertRulesUpdateOptions contains the optional parameters for the AlertRules.Update method. 552type AlertRulesUpdateOptions struct { 553 // placeholder for future optional parameters 554} 555 556// AlertingAction - Specify action need to be taken when rule type is Alert 557type AlertingAction struct { 558 Action 559 // REQUIRED; Severity of the alert 560 Severity *AlertSeverity `json:"severity,omitempty"` 561 562 // REQUIRED; The trigger condition that results in the alert rule being. 563 Trigger *TriggerCondition `json:"trigger,omitempty"` 564 565 // Azure action group reference. 566 AznsAction *AzNsActionGroup `json:"aznsAction,omitempty"` 567 568 // time (in minutes) for which Alerts should be throttled or suppressed. 569 ThrottlingInMin *int32 `json:"throttlingInMin,omitempty"` 570} 571 572// MarshalJSON implements the json.Marshaller interface for type AlertingAction. 573func (a AlertingAction) MarshalJSON() ([]byte, error) { 574 objectMap := a.Action.marshalInternal("Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction") 575 populate(objectMap, "aznsAction", a.AznsAction) 576 populate(objectMap, "severity", a.Severity) 577 populate(objectMap, "throttlingInMin", a.ThrottlingInMin) 578 populate(objectMap, "trigger", a.Trigger) 579 return json.Marshal(objectMap) 580} 581 582// UnmarshalJSON implements the json.Unmarshaller interface for type AlertingAction. 583func (a *AlertingAction) UnmarshalJSON(data []byte) error { 584 var rawMsg map[string]json.RawMessage 585 if err := json.Unmarshal(data, &rawMsg); err != nil { 586 return err 587 } 588 for key, val := range rawMsg { 589 var err error 590 switch key { 591 case "aznsAction": 592 err = unpopulate(val, &a.AznsAction) 593 delete(rawMsg, key) 594 case "severity": 595 err = unpopulate(val, &a.Severity) 596 delete(rawMsg, key) 597 case "throttlingInMin": 598 err = unpopulate(val, &a.ThrottlingInMin) 599 delete(rawMsg, key) 600 case "trigger": 601 err = unpopulate(val, &a.Trigger) 602 delete(rawMsg, key) 603 } 604 if err != nil { 605 return err 606 } 607 } 608 return a.Action.unmarshalInternal(rawMsg) 609} 610 611// ArmRoleReceiver - An arm role receiver. 612type ArmRoleReceiver struct { 613 // REQUIRED; The name of the arm role receiver. Names must be unique across all receivers within an action group. 614 Name *string `json:"name,omitempty"` 615 616 // REQUIRED; The arm role id. 617 RoleID *string `json:"roleId,omitempty"` 618 619 // Indicates whether to use common alert schema. 620 UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"` 621} 622 623// AutomationRunbookReceiver - The Azure Automation Runbook notification receiver. 624type AutomationRunbookReceiver struct { 625 // REQUIRED; The Azure automation account Id which holds this runbook and authenticate to Azure resource. 626 AutomationAccountID *string `json:"automationAccountId,omitempty"` 627 628 // REQUIRED; Indicates whether this instance is global runbook. 629 IsGlobalRunbook *bool `json:"isGlobalRunbook,omitempty"` 630 631 // REQUIRED; The name for this runbook. 632 RunbookName *string `json:"runbookName,omitempty"` 633 634 // REQUIRED; The resource id for webhook linked to this runbook. 635 WebhookResourceID *string `json:"webhookResourceId,omitempty"` 636 637 // Indicates name of the webhook. 638 Name *string `json:"name,omitempty"` 639 640 // The URI where webhooks should be sent. 641 ServiceURI *string `json:"serviceUri,omitempty"` 642 643 // Indicates whether to use common alert schema. 644 UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"` 645} 646 647// AutoscaleNotification - Autoscale notification. 648type AutoscaleNotification struct { 649 // REQUIRED; the operation associated with the notification and its value must be "scale" 650 Operation *string `json:"operation,omitempty"` 651 652 // the email notification. 653 Email *EmailNotification `json:"email,omitempty"` 654 655 // the collection of webhook notifications. 656 Webhooks []*WebhookNotification `json:"webhooks,omitempty"` 657} 658 659// MarshalJSON implements the json.Marshaller interface for type AutoscaleNotification. 660func (a AutoscaleNotification) MarshalJSON() ([]byte, error) { 661 objectMap := make(map[string]interface{}) 662 populate(objectMap, "email", a.Email) 663 populate(objectMap, "operation", a.Operation) 664 populate(objectMap, "webhooks", a.Webhooks) 665 return json.Marshal(objectMap) 666} 667 668// AutoscaleProfile - Autoscale profile. 669type AutoscaleProfile struct { 670 // REQUIRED; the number of instances that can be used during this profile. 671 Capacity *ScaleCapacity `json:"capacity,omitempty"` 672 673 // REQUIRED; the name of the profile. 674 Name *string `json:"name,omitempty"` 675 676 // REQUIRED; the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. 677 Rules []*ScaleRule `json:"rules,omitempty"` 678 679 // the specific date-time for the profile. This element is not used if the Recurrence element is used. 680 FixedDate *TimeWindow `json:"fixedDate,omitempty"` 681 682 // the repeating times at which this profile begins. This element is not used if the FixedDate element is used. 683 Recurrence *Recurrence `json:"recurrence,omitempty"` 684} 685 686// MarshalJSON implements the json.Marshaller interface for type AutoscaleProfile. 687func (a AutoscaleProfile) MarshalJSON() ([]byte, error) { 688 objectMap := make(map[string]interface{}) 689 populate(objectMap, "capacity", a.Capacity) 690 populate(objectMap, "fixedDate", a.FixedDate) 691 populate(objectMap, "name", a.Name) 692 populate(objectMap, "recurrence", a.Recurrence) 693 populate(objectMap, "rules", a.Rules) 694 return json.Marshal(objectMap) 695} 696 697// AutoscaleSetting - A setting that contains all of the configuration for the automatic scaling of a resource. 698type AutoscaleSetting struct { 699 // REQUIRED; the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles 700 // can be specified. 701 Profiles []*AutoscaleProfile `json:"profiles,omitempty"` 702 703 // the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'true'. 704 Enabled *bool `json:"enabled,omitempty"` 705 706 // the name of the autoscale setting. 707 Name *string `json:"name,omitempty"` 708 709 // the collection of notifications. 710 Notifications []*AutoscaleNotification `json:"notifications,omitempty"` 711 712 // the location of the resource that the autoscale setting should be added to. 713 TargetResourceLocation *string `json:"targetResourceLocation,omitempty"` 714 715 // the resource identifier of the resource that the autoscale setting should be added to. 716 TargetResourceURI *string `json:"targetResourceUri,omitempty"` 717} 718 719// MarshalJSON implements the json.Marshaller interface for type AutoscaleSetting. 720func (a AutoscaleSetting) MarshalJSON() ([]byte, error) { 721 objectMap := make(map[string]interface{}) 722 populate(objectMap, "enabled", a.Enabled) 723 populate(objectMap, "name", a.Name) 724 populate(objectMap, "notifications", a.Notifications) 725 populate(objectMap, "profiles", a.Profiles) 726 populate(objectMap, "targetResourceLocation", a.TargetResourceLocation) 727 populate(objectMap, "targetResourceUri", a.TargetResourceURI) 728 return json.Marshal(objectMap) 729} 730 731// AutoscaleSettingResource - The autoscale setting resource. 732type AutoscaleSettingResource struct { 733 Resource 734 // REQUIRED; The autoscale setting of the resource. 735 Properties *AutoscaleSetting `json:"properties,omitempty"` 736} 737 738// MarshalJSON implements the json.Marshaller interface for type AutoscaleSettingResource. 739func (a AutoscaleSettingResource) MarshalJSON() ([]byte, error) { 740 objectMap := a.Resource.marshalInternal() 741 populate(objectMap, "properties", a.Properties) 742 return json.Marshal(objectMap) 743} 744 745// AutoscaleSettingResourceCollection - Represents a collection of autoscale setting resources. 746type AutoscaleSettingResourceCollection struct { 747 // REQUIRED; the values for the autoscale setting resources. 748 Value []*AutoscaleSettingResource `json:"value,omitempty"` 749 750 // URL to get the next set of results. 751 NextLink *string `json:"nextLink,omitempty"` 752} 753 754// MarshalJSON implements the json.Marshaller interface for type AutoscaleSettingResourceCollection. 755func (a AutoscaleSettingResourceCollection) MarshalJSON() ([]byte, error) { 756 objectMap := make(map[string]interface{}) 757 populate(objectMap, "nextLink", a.NextLink) 758 populate(objectMap, "value", a.Value) 759 return json.Marshal(objectMap) 760} 761 762// AutoscaleSettingResourcePatch - The autoscale setting object for patch operations. 763type AutoscaleSettingResourcePatch struct { 764 // The autoscale setting properties of the update operation. 765 Properties *AutoscaleSetting `json:"properties,omitempty"` 766 767 // Resource tags 768 Tags map[string]*string `json:"tags,omitempty"` 769} 770 771// MarshalJSON implements the json.Marshaller interface for type AutoscaleSettingResourcePatch. 772func (a AutoscaleSettingResourcePatch) MarshalJSON() ([]byte, error) { 773 objectMap := make(map[string]interface{}) 774 populate(objectMap, "properties", a.Properties) 775 populate(objectMap, "tags", a.Tags) 776 return json.Marshal(objectMap) 777} 778 779// AutoscaleSettingsCreateOrUpdateOptions contains the optional parameters for the AutoscaleSettings.CreateOrUpdate method. 780type AutoscaleSettingsCreateOrUpdateOptions struct { 781 // placeholder for future optional parameters 782} 783 784// AutoscaleSettingsDeleteOptions contains the optional parameters for the AutoscaleSettings.Delete method. 785type AutoscaleSettingsDeleteOptions struct { 786 // placeholder for future optional parameters 787} 788 789// AutoscaleSettingsGetOptions contains the optional parameters for the AutoscaleSettings.Get method. 790type AutoscaleSettingsGetOptions struct { 791 // placeholder for future optional parameters 792} 793 794// AutoscaleSettingsListByResourceGroupOptions contains the optional parameters for the AutoscaleSettings.ListByResourceGroup method. 795type AutoscaleSettingsListByResourceGroupOptions struct { 796 // placeholder for future optional parameters 797} 798 799// AutoscaleSettingsListBySubscriptionOptions contains the optional parameters for the AutoscaleSettings.ListBySubscription method. 800type AutoscaleSettingsListBySubscriptionOptions struct { 801 // placeholder for future optional parameters 802} 803 804// AutoscaleSettingsUpdateOptions contains the optional parameters for the AutoscaleSettings.Update method. 805type AutoscaleSettingsUpdateOptions struct { 806 // placeholder for future optional parameters 807} 808 809// AzNsActionGroup - Azure action group 810type AzNsActionGroup struct { 811 // Azure Action Group reference. 812 ActionGroup []*string `json:"actionGroup,omitempty"` 813 814 // Custom payload to be sent for all webhook URI in Azure action group 815 CustomWebhookPayload *string `json:"customWebhookPayload,omitempty"` 816 817 // Custom subject override for all email ids in Azure action group 818 EmailSubject *string `json:"emailSubject,omitempty"` 819} 820 821// MarshalJSON implements the json.Marshaller interface for type AzNsActionGroup. 822func (a AzNsActionGroup) MarshalJSON() ([]byte, error) { 823 objectMap := make(map[string]interface{}) 824 populate(objectMap, "actionGroup", a.ActionGroup) 825 populate(objectMap, "customWebhookPayload", a.CustomWebhookPayload) 826 populate(objectMap, "emailSubject", a.EmailSubject) 827 return json.Marshal(objectMap) 828} 829 830// AzureAppPushReceiver - The Azure mobile App push notification receiver. 831type AzureAppPushReceiver struct { 832 // REQUIRED; The email address registered for the Azure mobile app. 833 EmailAddress *string `json:"emailAddress,omitempty"` 834 835 // REQUIRED; The name of the Azure mobile app push receiver. Names must be unique across all receivers within an action group. 836 Name *string `json:"name,omitempty"` 837} 838 839// AzureFunctionReceiver - An azure function receiver. 840type AzureFunctionReceiver struct { 841 // REQUIRED; The azure resource id of the function app. 842 FunctionAppResourceID *string `json:"functionAppResourceId,omitempty"` 843 844 // REQUIRED; The function name in the function app. 845 FunctionName *string `json:"functionName,omitempty"` 846 847 // REQUIRED; The http trigger url where http request sent to. 848 HTTPTriggerURL *string `json:"httpTriggerUrl,omitempty"` 849 850 // REQUIRED; The name of the azure function receiver. Names must be unique across all receivers within an action group. 851 Name *string `json:"name,omitempty"` 852 853 // Indicates whether to use common alert schema. 854 UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"` 855} 856 857// AzureMonitorMetricsDestination - Azure Monitor Metrics destination. 858type AzureMonitorMetricsDestination struct { 859 // A friendly name for the destination. This name should be unique across all destinations (regardless of type) within the data collection rule. 860 Name *string `json:"name,omitempty"` 861} 862 863// AzureMonitorPrivateLinkScope - An Azure Monitor PrivateLinkScope definition. 864type AzureMonitorPrivateLinkScope struct { 865 PrivateLinkScopesResource 866 // REQUIRED; Properties that define a Azure Monitor PrivateLinkScope resource. 867 Properties *AzureMonitorPrivateLinkScopeProperties `json:"properties,omitempty"` 868} 869 870// MarshalJSON implements the json.Marshaller interface for type AzureMonitorPrivateLinkScope. 871func (a AzureMonitorPrivateLinkScope) MarshalJSON() ([]byte, error) { 872 objectMap := a.PrivateLinkScopesResource.marshalInternal() 873 populate(objectMap, "properties", a.Properties) 874 return json.Marshal(objectMap) 875} 876 877// AzureMonitorPrivateLinkScopeListResult - Describes the list of Azure Monitor PrivateLinkScope resources. 878type AzureMonitorPrivateLinkScopeListResult struct { 879 // REQUIRED; List of Azure Monitor PrivateLinkScope definitions. 880 Value []*AzureMonitorPrivateLinkScope `json:"value,omitempty"` 881 882 // The URI to get the next set of Azure Monitor PrivateLinkScope definitions if too many PrivateLinkScopes where returned in the result set. 883 NextLink *string `json:"nextLink,omitempty"` 884} 885 886// MarshalJSON implements the json.Marshaller interface for type AzureMonitorPrivateLinkScopeListResult. 887func (a AzureMonitorPrivateLinkScopeListResult) MarshalJSON() ([]byte, error) { 888 objectMap := make(map[string]interface{}) 889 populate(objectMap, "nextLink", a.NextLink) 890 populate(objectMap, "value", a.Value) 891 return json.Marshal(objectMap) 892} 893 894// AzureMonitorPrivateLinkScopeProperties - Properties that define a Azure Monitor PrivateLinkScope resource. 895type AzureMonitorPrivateLinkScopeProperties struct { 896 // READ-ONLY; List of private endpoint connections. 897 PrivateEndpointConnections []*PrivateEndpointConnection `json:"privateEndpointConnections,omitempty" azure:"ro"` 898 899 // READ-ONLY; Current state of this PrivateLinkScope: whether or not is has been provisioned within the resource group it is defined. Users cannot change 900 // this value but are able to read from it. Values will include 901 // Provisioning ,Succeeded, Canceled and Failed. 902 ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` 903} 904 905// MarshalJSON implements the json.Marshaller interface for type AzureMonitorPrivateLinkScopeProperties. 906func (a AzureMonitorPrivateLinkScopeProperties) MarshalJSON() ([]byte, error) { 907 objectMap := make(map[string]interface{}) 908 populate(objectMap, "privateEndpointConnections", a.PrivateEndpointConnections) 909 populate(objectMap, "provisioningState", a.ProvisioningState) 910 return json.Marshal(objectMap) 911} 912 913// AzureResource - An azure resource object 914type AzureResource struct { 915 // REQUIRED; Resource location 916 Location *string `json:"location,omitempty"` 917 918 // Resource tags 919 Tags map[string]*string `json:"tags,omitempty"` 920 921 // READ-ONLY; Azure resource Id 922 ID *string `json:"id,omitempty" azure:"ro"` 923 924 // READ-ONLY; Azure resource identity 925 Identity *string `json:"identity,omitempty" azure:"ro"` 926 927 // READ-ONLY; Azure resource kind 928 Kind *string `json:"kind,omitempty" azure:"ro"` 929 930 // READ-ONLY; Azure resource name 931 Name *string `json:"name,omitempty" azure:"ro"` 932 933 // READ-ONLY; Azure resource type 934 Type *string `json:"type,omitempty" azure:"ro"` 935} 936 937// MarshalJSON implements the json.Marshaller interface for type AzureResource. 938func (a AzureResource) MarshalJSON() ([]byte, error) { 939 objectMap := a.marshalInternal() 940 return json.Marshal(objectMap) 941} 942 943func (a AzureResource) marshalInternal() map[string]interface{} { 944 objectMap := make(map[string]interface{}) 945 populate(objectMap, "id", a.ID) 946 populate(objectMap, "identity", a.Identity) 947 populate(objectMap, "kind", a.Kind) 948 populate(objectMap, "location", a.Location) 949 populate(objectMap, "name", a.Name) 950 populate(objectMap, "tags", a.Tags) 951 populate(objectMap, "type", a.Type) 952 return objectMap 953} 954 955// BaselineMetadata - Represents a baseline metadata value. 956type BaselineMetadata struct { 957 // REQUIRED; Name of the baseline metadata. 958 Name *string `json:"name,omitempty"` 959 960 // REQUIRED; Value of the baseline metadata. 961 Value *string `json:"value,omitempty"` 962} 963 964// BaselinesListOptions contains the optional parameters for the Baselines.List method. 965type BaselinesListOptions struct { 966 // The list of aggregation types (comma separated) to retrieve. 967 Aggregation *string 968 // The **$filter** is used to reduce the set of metric data returned. Example: Metric contains metadata A, B and C. - Return all time series of C where 969 // A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' 970 // or B = 'b2'** This is invalid because the logical or operator cannot separate two different metadata names. - Return all time series where A = a1, B 971 // = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return all time series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. 972 // Special case: When dimension name or dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using $filter= "dim 973 // (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim (test) 3** and dimension value is **dim3 (test) val** 974 // Instead of using $filter= "dim (test) 3 eq 'dim3 (test) val' " use **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "** 975 Filter *string 976 // The interval (i.e. timegrain) of the query. 977 Interval *string 978 // The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' 979 // should be **'Metric%2Name1'** 980 Metricnames *string 981 // Metric namespace to query metric definitions for. 982 Metricnamespace *string 983 // Allows retrieving only metadata of the baseline. On data request all information is retrieved. 984 ResultType *ResultType 985 // The list of sensitivities (comma separated) to retrieve. 986 Sensitivities *string 987 // The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'. 988 Timespan *string 989} 990 991// ConfigurationAccessEndpointSpec - Definition of the endpoint used for accessing configuration. 992type ConfigurationAccessEndpointSpec struct { 993 // READ-ONLY; The endpoint. This property is READ-ONLY. 994 Endpoint *string `json:"endpoint,omitempty" azure:"ro"` 995} 996 997// Criteria - Specifies the criteria for converting log to metric. 998type Criteria struct { 999 // REQUIRED; Name of the metric 1000 MetricName *string `json:"metricName,omitempty"` 1001 1002 // List of Dimensions for creating metric 1003 Dimensions []*Dimension `json:"dimensions,omitempty"` 1004} 1005 1006// MarshalJSON implements the json.Marshaller interface for type Criteria. 1007func (c Criteria) MarshalJSON() ([]byte, error) { 1008 objectMap := make(map[string]interface{}) 1009 populate(objectMap, "dimensions", c.Dimensions) 1010 populate(objectMap, "metricName", c.MetricName) 1011 return json.Marshal(objectMap) 1012} 1013 1014// DataCollectionEndpoint - Definition of data collection endpoint. 1015type DataCollectionEndpoint struct { 1016 // The endpoint used by agents to access their configuration. 1017 ConfigurationAccess *DataCollectionEndpointConfigurationAccess `json:"configurationAccess,omitempty"` 1018 1019 // Description of the data collection endpoint. 1020 Description *string `json:"description,omitempty"` 1021 1022 // The immutable ID of this data collection endpoint resource. This property is READ-ONLY. 1023 ImmutableID *string `json:"immutableId,omitempty"` 1024 1025 // The endpoint used by clients to ingest logs. 1026 LogsIngestion *DataCollectionEndpointLogsIngestion `json:"logsIngestion,omitempty"` 1027 1028 // Network access control rules for the endpoints. 1029 NetworkACLs *DataCollectionEndpointNetworkACLs `json:"networkAcls,omitempty"` 1030 1031 // READ-ONLY; The resource provisioning state. This property is READ-ONLY. 1032 ProvisioningState *KnownDataCollectionEndpointProvisioningState `json:"provisioningState,omitempty" azure:"ro"` 1033} 1034 1035// DataCollectionEndpointConfigurationAccess - The endpoint used by agents to access their configuration. 1036type DataCollectionEndpointConfigurationAccess struct { 1037 ConfigurationAccessEndpointSpec 1038} 1039 1040// DataCollectionEndpointLogsIngestion - The endpoint used by clients to ingest logs. 1041type DataCollectionEndpointLogsIngestion struct { 1042 LogsIngestionEndpointSpec 1043} 1044 1045// DataCollectionEndpointNetworkACLs - Network access control rules for the endpoints. 1046type DataCollectionEndpointNetworkACLs struct { 1047 NetworkRuleSet 1048} 1049 1050// DataCollectionEndpointResource - Definition of ARM tracked top level resource. 1051type DataCollectionEndpointResource struct { 1052 // REQUIRED; The geo-location where the resource lives. 1053 Location *string `json:"location,omitempty"` 1054 1055 // The kind of the resource. 1056 Kind *KnownDataCollectionEndpointResourceKind `json:"kind,omitempty"` 1057 1058 // Resource properties. 1059 Properties *DataCollectionEndpointResourceProperties `json:"properties,omitempty"` 1060 1061 // Resource tags. 1062 Tags map[string]*string `json:"tags,omitempty"` 1063 1064 // READ-ONLY; Resource entity tag (ETag). 1065 Etag *string `json:"etag,omitempty" azure:"ro"` 1066 1067 // READ-ONLY; Fully qualified ID of the resource. 1068 ID *string `json:"id,omitempty" azure:"ro"` 1069 1070 // READ-ONLY; The name of the resource. 1071 Name *string `json:"name,omitempty" azure:"ro"` 1072 1073 // READ-ONLY; Metadata pertaining to creation and last modification of the resource. 1074 SystemData *DataCollectionEndpointResourceSystemData `json:"systemData,omitempty" azure:"ro"` 1075 1076 // READ-ONLY; The type of the resource. 1077 Type *string `json:"type,omitempty" azure:"ro"` 1078} 1079 1080// MarshalJSON implements the json.Marshaller interface for type DataCollectionEndpointResource. 1081func (d DataCollectionEndpointResource) MarshalJSON() ([]byte, error) { 1082 objectMap := make(map[string]interface{}) 1083 populate(objectMap, "etag", d.Etag) 1084 populate(objectMap, "id", d.ID) 1085 populate(objectMap, "kind", d.Kind) 1086 populate(objectMap, "location", d.Location) 1087 populate(objectMap, "name", d.Name) 1088 populate(objectMap, "properties", d.Properties) 1089 populate(objectMap, "systemData", d.SystemData) 1090 populate(objectMap, "tags", d.Tags) 1091 populate(objectMap, "type", d.Type) 1092 return json.Marshal(objectMap) 1093} 1094 1095// DataCollectionEndpointResourceListResult - A pageable list of resources. 1096type DataCollectionEndpointResourceListResult struct { 1097 // REQUIRED; A list of resources. 1098 Value []*DataCollectionEndpointResource `json:"value,omitempty"` 1099 1100 // The URL to use for getting the next set of results. 1101 NextLink *string `json:"nextLink,omitempty"` 1102} 1103 1104// MarshalJSON implements the json.Marshaller interface for type DataCollectionEndpointResourceListResult. 1105func (d DataCollectionEndpointResourceListResult) MarshalJSON() ([]byte, error) { 1106 objectMap := make(map[string]interface{}) 1107 populate(objectMap, "nextLink", d.NextLink) 1108 populate(objectMap, "value", d.Value) 1109 return json.Marshal(objectMap) 1110} 1111 1112// DataCollectionEndpointResourceProperties - Resource properties. 1113type DataCollectionEndpointResourceProperties struct { 1114 DataCollectionEndpoint 1115} 1116 1117// DataCollectionEndpointResourceSystemData - Metadata pertaining to creation and last modification of the resource. 1118type DataCollectionEndpointResourceSystemData struct { 1119 SystemData 1120} 1121 1122// DataCollectionEndpointsCreateOptions contains the optional parameters for the DataCollectionEndpoints.Create method. 1123type DataCollectionEndpointsCreateOptions struct { 1124 // The payload 1125 Body *DataCollectionEndpointResource 1126} 1127 1128// DataCollectionEndpointsDeleteOptions contains the optional parameters for the DataCollectionEndpoints.Delete method. 1129type DataCollectionEndpointsDeleteOptions struct { 1130 // placeholder for future optional parameters 1131} 1132 1133// DataCollectionEndpointsGetOptions contains the optional parameters for the DataCollectionEndpoints.Get method. 1134type DataCollectionEndpointsGetOptions struct { 1135 // placeholder for future optional parameters 1136} 1137 1138// DataCollectionEndpointsListByResourceGroupOptions contains the optional parameters for the DataCollectionEndpoints.ListByResourceGroup method. 1139type DataCollectionEndpointsListByResourceGroupOptions struct { 1140 // placeholder for future optional parameters 1141} 1142 1143// DataCollectionEndpointsListBySubscriptionOptions contains the optional parameters for the DataCollectionEndpoints.ListBySubscription method. 1144type DataCollectionEndpointsListBySubscriptionOptions struct { 1145 // placeholder for future optional parameters 1146} 1147 1148// DataCollectionEndpointsUpdateOptions contains the optional parameters for the DataCollectionEndpoints.Update method. 1149type DataCollectionEndpointsUpdateOptions struct { 1150 // The payload 1151 Body *ResourceForUpdate 1152} 1153 1154// DataCollectionRule - Definition of what monitoring data to collect and where that data should be sent. 1155type DataCollectionRule struct { 1156 // The specification of data flows. 1157 DataFlows []*DataFlow `json:"dataFlows,omitempty"` 1158 1159 // The specification of data sources. This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint. 1160 DataSources *DataCollectionRuleDataSources `json:"dataSources,omitempty"` 1161 1162 // Description of the data collection rule. 1163 Description *string `json:"description,omitempty"` 1164 1165 // The specification of destinations. 1166 Destinations *DataCollectionRuleDestinations `json:"destinations,omitempty"` 1167 1168 // READ-ONLY; The immutable ID of this data collection rule. This property is READ-ONLY. 1169 ImmutableID *string `json:"immutableId,omitempty" azure:"ro"` 1170 1171 // READ-ONLY; The resource provisioning state. 1172 ProvisioningState *KnownDataCollectionRuleProvisioningState `json:"provisioningState,omitempty" azure:"ro"` 1173} 1174 1175// MarshalJSON implements the json.Marshaller interface for type DataCollectionRule. 1176func (d DataCollectionRule) MarshalJSON() ([]byte, error) { 1177 objectMap := d.marshalInternal() 1178 return json.Marshal(objectMap) 1179} 1180 1181func (d DataCollectionRule) marshalInternal() map[string]interface{} { 1182 objectMap := make(map[string]interface{}) 1183 populate(objectMap, "dataFlows", d.DataFlows) 1184 populate(objectMap, "dataSources", d.DataSources) 1185 populate(objectMap, "description", d.Description) 1186 populate(objectMap, "destinations", d.Destinations) 1187 populate(objectMap, "immutableId", d.ImmutableID) 1188 populate(objectMap, "provisioningState", d.ProvisioningState) 1189 return objectMap 1190} 1191 1192// DataCollectionRuleAssociation - Definition of association of a data collection rule with a monitored Azure resource. 1193type DataCollectionRuleAssociation struct { 1194 // The resource ID of the data collection endpoint that is to be associated. 1195 DataCollectionEndpointID *string `json:"dataCollectionEndpointId,omitempty"` 1196 1197 // The resource ID of the data collection rule that is to be associated. 1198 DataCollectionRuleID *string `json:"dataCollectionRuleId,omitempty"` 1199 1200 // Description of the association. 1201 Description *string `json:"description,omitempty"` 1202 1203 // READ-ONLY; The resource provisioning state. 1204 ProvisioningState *KnownDataCollectionRuleAssociationProvisioningState `json:"provisioningState,omitempty" azure:"ro"` 1205} 1206 1207// DataCollectionRuleAssociationProxyOnlyResource - Definition of generic ARM proxy resource. 1208type DataCollectionRuleAssociationProxyOnlyResource struct { 1209 // Resource properties. 1210 Properties *DataCollectionRuleAssociationProxyOnlyResourceProperties `json:"properties,omitempty"` 1211 1212 // READ-ONLY; Resource entity tag (ETag). 1213 Etag *string `json:"etag,omitempty" azure:"ro"` 1214 1215 // READ-ONLY; Fully qualified ID of the resource. 1216 ID *string `json:"id,omitempty" azure:"ro"` 1217 1218 // READ-ONLY; The name of the resource. 1219 Name *string `json:"name,omitempty" azure:"ro"` 1220 1221 // READ-ONLY; Metadata pertaining to creation and last modification of the resource. 1222 SystemData *DataCollectionRuleAssociationProxyOnlyResourceSystemData `json:"systemData,omitempty" azure:"ro"` 1223 1224 // READ-ONLY; The type of the resource. 1225 Type *string `json:"type,omitempty" azure:"ro"` 1226} 1227 1228// DataCollectionRuleAssociationProxyOnlyResourceListResult - A pageable list of resources. 1229type DataCollectionRuleAssociationProxyOnlyResourceListResult struct { 1230 // REQUIRED; A list of resources. 1231 Value []*DataCollectionRuleAssociationProxyOnlyResource `json:"value,omitempty"` 1232 1233 // The URL to use for getting the next set of results. 1234 NextLink *string `json:"nextLink,omitempty"` 1235} 1236 1237// MarshalJSON implements the json.Marshaller interface for type DataCollectionRuleAssociationProxyOnlyResourceListResult. 1238func (d DataCollectionRuleAssociationProxyOnlyResourceListResult) MarshalJSON() ([]byte, error) { 1239 objectMap := make(map[string]interface{}) 1240 populate(objectMap, "nextLink", d.NextLink) 1241 populate(objectMap, "value", d.Value) 1242 return json.Marshal(objectMap) 1243} 1244 1245// DataCollectionRuleAssociationProxyOnlyResourceProperties - Resource properties. 1246type DataCollectionRuleAssociationProxyOnlyResourceProperties struct { 1247 DataCollectionRuleAssociation 1248} 1249 1250// DataCollectionRuleAssociationProxyOnlyResourceSystemData - Metadata pertaining to creation and last modification of the resource. 1251type DataCollectionRuleAssociationProxyOnlyResourceSystemData struct { 1252 SystemData 1253} 1254 1255// DataCollectionRuleAssociationsCreateOptions contains the optional parameters for the DataCollectionRuleAssociations.Create method. 1256type DataCollectionRuleAssociationsCreateOptions struct { 1257 // The payload 1258 Body *DataCollectionRuleAssociationProxyOnlyResource 1259} 1260 1261// DataCollectionRuleAssociationsDeleteOptions contains the optional parameters for the DataCollectionRuleAssociations.Delete method. 1262type DataCollectionRuleAssociationsDeleteOptions struct { 1263 // placeholder for future optional parameters 1264} 1265 1266// DataCollectionRuleAssociationsGetOptions contains the optional parameters for the DataCollectionRuleAssociations.Get method. 1267type DataCollectionRuleAssociationsGetOptions struct { 1268 // placeholder for future optional parameters 1269} 1270 1271// DataCollectionRuleAssociationsListByResourceOptions contains the optional parameters for the DataCollectionRuleAssociations.ListByResource method. 1272type DataCollectionRuleAssociationsListByResourceOptions struct { 1273 // placeholder for future optional parameters 1274} 1275 1276// DataCollectionRuleAssociationsListByRuleOptions contains the optional parameters for the DataCollectionRuleAssociations.ListByRule method. 1277type DataCollectionRuleAssociationsListByRuleOptions struct { 1278 // placeholder for future optional parameters 1279} 1280 1281// DataCollectionRuleDataSources - The specification of data sources. This property is optional and can be omitted if the rule is meant to be used via direct 1282// calls to the provisioned endpoint. 1283type DataCollectionRuleDataSources struct { 1284 DataSourcesSpec 1285} 1286 1287// DataCollectionRuleDestinations - The specification of destinations. 1288type DataCollectionRuleDestinations struct { 1289 DestinationsSpec 1290} 1291 1292// DataCollectionRuleResource - Definition of ARM tracked top level resource. 1293type DataCollectionRuleResource struct { 1294 // REQUIRED; The geo-location where the resource lives. 1295 Location *string `json:"location,omitempty"` 1296 1297 // The kind of the resource. 1298 Kind *KnownDataCollectionRuleResourceKind `json:"kind,omitempty"` 1299 1300 // Resource properties. 1301 Properties *DataCollectionRuleResourceProperties `json:"properties,omitempty"` 1302 1303 // Resource tags. 1304 Tags map[string]*string `json:"tags,omitempty"` 1305 1306 // READ-ONLY; Resource entity tag (ETag). 1307 Etag *string `json:"etag,omitempty" azure:"ro"` 1308 1309 // READ-ONLY; Fully qualified ID of the resource. 1310 ID *string `json:"id,omitempty" azure:"ro"` 1311 1312 // READ-ONLY; The name of the resource. 1313 Name *string `json:"name,omitempty" azure:"ro"` 1314 1315 // READ-ONLY; Metadata pertaining to creation and last modification of the resource. 1316 SystemData *DataCollectionRuleResourceSystemData `json:"systemData,omitempty" azure:"ro"` 1317 1318 // READ-ONLY; The type of the resource. 1319 Type *string `json:"type,omitempty" azure:"ro"` 1320} 1321 1322// MarshalJSON implements the json.Marshaller interface for type DataCollectionRuleResource. 1323func (d DataCollectionRuleResource) MarshalJSON() ([]byte, error) { 1324 objectMap := make(map[string]interface{}) 1325 populate(objectMap, "etag", d.Etag) 1326 populate(objectMap, "id", d.ID) 1327 populate(objectMap, "kind", d.Kind) 1328 populate(objectMap, "location", d.Location) 1329 populate(objectMap, "name", d.Name) 1330 populate(objectMap, "properties", d.Properties) 1331 populate(objectMap, "systemData", d.SystemData) 1332 populate(objectMap, "tags", d.Tags) 1333 populate(objectMap, "type", d.Type) 1334 return json.Marshal(objectMap) 1335} 1336 1337// DataCollectionRuleResourceListResult - A pageable list of resources. 1338type DataCollectionRuleResourceListResult struct { 1339 // REQUIRED; A list of resources. 1340 Value []*DataCollectionRuleResource `json:"value,omitempty"` 1341 1342 // The URL to use for getting the next set of results. 1343 NextLink *string `json:"nextLink,omitempty"` 1344} 1345 1346// MarshalJSON implements the json.Marshaller interface for type DataCollectionRuleResourceListResult. 1347func (d DataCollectionRuleResourceListResult) MarshalJSON() ([]byte, error) { 1348 objectMap := make(map[string]interface{}) 1349 populate(objectMap, "nextLink", d.NextLink) 1350 populate(objectMap, "value", d.Value) 1351 return json.Marshal(objectMap) 1352} 1353 1354// DataCollectionRuleResourceProperties - Resource properties. 1355type DataCollectionRuleResourceProperties struct { 1356 DataCollectionRule 1357} 1358 1359// DataCollectionRuleResourceSystemData - Metadata pertaining to creation and last modification of the resource. 1360type DataCollectionRuleResourceSystemData struct { 1361 SystemData 1362} 1363 1364// DataCollectionRulesCreateOptions contains the optional parameters for the DataCollectionRules.Create method. 1365type DataCollectionRulesCreateOptions struct { 1366 // The payload 1367 Body *DataCollectionRuleResource 1368} 1369 1370// DataCollectionRulesDeleteOptions contains the optional parameters for the DataCollectionRules.Delete method. 1371type DataCollectionRulesDeleteOptions struct { 1372 // placeholder for future optional parameters 1373} 1374 1375// DataCollectionRulesGetOptions contains the optional parameters for the DataCollectionRules.Get method. 1376type DataCollectionRulesGetOptions struct { 1377 // placeholder for future optional parameters 1378} 1379 1380// DataCollectionRulesListByResourceGroupOptions contains the optional parameters for the DataCollectionRules.ListByResourceGroup method. 1381type DataCollectionRulesListByResourceGroupOptions struct { 1382 // placeholder for future optional parameters 1383} 1384 1385// DataCollectionRulesListBySubscriptionOptions contains the optional parameters for the DataCollectionRules.ListBySubscription method. 1386type DataCollectionRulesListBySubscriptionOptions struct { 1387 // placeholder for future optional parameters 1388} 1389 1390// DataCollectionRulesUpdateOptions contains the optional parameters for the DataCollectionRules.Update method. 1391type DataCollectionRulesUpdateOptions struct { 1392 // The payload 1393 Body *ResourceForUpdate 1394} 1395 1396// DataContainer - Information about a container with data for a given resource. 1397type DataContainer struct { 1398 // REQUIRED; Log Analytics workspace information. 1399 Workspace *WorkspaceInfo `json:"workspace,omitempty"` 1400} 1401 1402// DataFlow - Definition of which streams are sent to which destinations. 1403type DataFlow struct { 1404 // List of destinations for this data flow. 1405 Destinations []*string `json:"destinations,omitempty"` 1406 1407 // List of streams for this data flow. 1408 Streams []*KnownDataFlowStreams `json:"streams,omitempty"` 1409} 1410 1411// MarshalJSON implements the json.Marshaller interface for type DataFlow. 1412func (d DataFlow) MarshalJSON() ([]byte, error) { 1413 objectMap := make(map[string]interface{}) 1414 populate(objectMap, "destinations", d.Destinations) 1415 populate(objectMap, "streams", d.Streams) 1416 return json.Marshal(objectMap) 1417} 1418 1419// DataSourcesSpec - Specification of data sources that will be collected. 1420type DataSourcesSpec struct { 1421 // The list of Azure VM extension data source configurations. 1422 Extensions []*ExtensionDataSource `json:"extensions,omitempty"` 1423 1424 // The list of performance counter data source configurations. 1425 PerformanceCounters []*PerfCounterDataSource `json:"performanceCounters,omitempty"` 1426 1427 // The list of Syslog data source configurations. 1428 Syslog []*SyslogDataSource `json:"syslog,omitempty"` 1429 1430 // The list of Windows Event Log data source configurations. 1431 WindowsEventLogs []*WindowsEventLogDataSource `json:"windowsEventLogs,omitempty"` 1432} 1433 1434// MarshalJSON implements the json.Marshaller interface for type DataSourcesSpec. 1435func (d DataSourcesSpec) MarshalJSON() ([]byte, error) { 1436 objectMap := d.marshalInternal() 1437 return json.Marshal(objectMap) 1438} 1439 1440func (d DataSourcesSpec) marshalInternal() map[string]interface{} { 1441 objectMap := make(map[string]interface{}) 1442 populate(objectMap, "extensions", d.Extensions) 1443 populate(objectMap, "performanceCounters", d.PerformanceCounters) 1444 populate(objectMap, "syslog", d.Syslog) 1445 populate(objectMap, "windowsEventLogs", d.WindowsEventLogs) 1446 return objectMap 1447} 1448 1449// DestinationsSpec - Specification of destinations that can be used in data flows. 1450type DestinationsSpec struct { 1451 // Azure Monitor Metrics destination. 1452 AzureMonitorMetrics *DestinationsSpecAzureMonitorMetrics `json:"azureMonitorMetrics,omitempty"` 1453 1454 // List of Log Analytics destinations. 1455 LogAnalytics []*LogAnalyticsDestination `json:"logAnalytics,omitempty"` 1456} 1457 1458// MarshalJSON implements the json.Marshaller interface for type DestinationsSpec. 1459func (d DestinationsSpec) MarshalJSON() ([]byte, error) { 1460 objectMap := d.marshalInternal() 1461 return json.Marshal(objectMap) 1462} 1463 1464func (d DestinationsSpec) marshalInternal() map[string]interface{} { 1465 objectMap := make(map[string]interface{}) 1466 populate(objectMap, "azureMonitorMetrics", d.AzureMonitorMetrics) 1467 populate(objectMap, "logAnalytics", d.LogAnalytics) 1468 return objectMap 1469} 1470 1471// DestinationsSpecAzureMonitorMetrics - Azure Monitor Metrics destination. 1472type DestinationsSpecAzureMonitorMetrics struct { 1473 AzureMonitorMetricsDestination 1474} 1475 1476// DiagnosticSettings - The diagnostic settings. 1477type DiagnosticSettings struct { 1478 // The resource Id for the event hub authorization rule. 1479 EventHubAuthorizationRuleID *string `json:"eventHubAuthorizationRuleId,omitempty"` 1480 1481 // The name of the event hub. If none is specified, the default event hub will be selected. 1482 EventHubName *string `json:"eventHubName,omitempty"` 1483 1484 // A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type constructed 1485 // as follows: _. Possible values are: 1486 // Dedicated and null (null is default.) 1487 LogAnalyticsDestinationType *string `json:"logAnalyticsDestinationType,omitempty"` 1488 1489 // The list of logs settings. 1490 Logs []*LogSettings `json:"logs,omitempty"` 1491 1492 // The list of metric settings. 1493 Metrics []*MetricSettings `json:"metrics,omitempty"` 1494 1495 // The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility. 1496 ServiceBusRuleID *string `json:"serviceBusRuleId,omitempty"` 1497 1498 // The resource ID of the storage account to which you would like to send Diagnostic Logs. 1499 StorageAccountID *string `json:"storageAccountId,omitempty"` 1500 1501 // The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: 1502 // /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 1503 WorkspaceID *string `json:"workspaceId,omitempty"` 1504} 1505 1506// MarshalJSON implements the json.Marshaller interface for type DiagnosticSettings. 1507func (d DiagnosticSettings) MarshalJSON() ([]byte, error) { 1508 objectMap := make(map[string]interface{}) 1509 populate(objectMap, "eventHubAuthorizationRuleId", d.EventHubAuthorizationRuleID) 1510 populate(objectMap, "eventHubName", d.EventHubName) 1511 populate(objectMap, "logAnalyticsDestinationType", d.LogAnalyticsDestinationType) 1512 populate(objectMap, "logs", d.Logs) 1513 populate(objectMap, "metrics", d.Metrics) 1514 populate(objectMap, "serviceBusRuleId", d.ServiceBusRuleID) 1515 populate(objectMap, "storageAccountId", d.StorageAccountID) 1516 populate(objectMap, "workspaceId", d.WorkspaceID) 1517 return json.Marshal(objectMap) 1518} 1519 1520// DiagnosticSettingsCategory - The diagnostic settings Category. 1521type DiagnosticSettingsCategory struct { 1522 // The type of the diagnostic settings category. 1523 CategoryType *CategoryType `json:"categoryType,omitempty"` 1524} 1525 1526// DiagnosticSettingsCategoryGetOptions contains the optional parameters for the DiagnosticSettingsCategory.Get method. 1527type DiagnosticSettingsCategoryGetOptions struct { 1528 // placeholder for future optional parameters 1529} 1530 1531// DiagnosticSettingsCategoryListOptions contains the optional parameters for the DiagnosticSettingsCategory.List method. 1532type DiagnosticSettingsCategoryListOptions struct { 1533 // placeholder for future optional parameters 1534} 1535 1536// DiagnosticSettingsCategoryResource - The diagnostic settings category resource. 1537type DiagnosticSettingsCategoryResource struct { 1538 ProxyOnlyResource 1539 // The properties of a Diagnostic Settings Category. 1540 Properties *DiagnosticSettingsCategory `json:"properties,omitempty"` 1541} 1542 1543// DiagnosticSettingsCategoryResourceCollection - Represents a collection of diagnostic setting category resources. 1544type DiagnosticSettingsCategoryResourceCollection struct { 1545 // The collection of diagnostic settings category resources. 1546 Value []*DiagnosticSettingsCategoryResource `json:"value,omitempty"` 1547} 1548 1549// MarshalJSON implements the json.Marshaller interface for type DiagnosticSettingsCategoryResourceCollection. 1550func (d DiagnosticSettingsCategoryResourceCollection) MarshalJSON() ([]byte, error) { 1551 objectMap := make(map[string]interface{}) 1552 populate(objectMap, "value", d.Value) 1553 return json.Marshal(objectMap) 1554} 1555 1556// DiagnosticSettingsCreateOrUpdateOptions contains the optional parameters for the DiagnosticSettings.CreateOrUpdate method. 1557type DiagnosticSettingsCreateOrUpdateOptions struct { 1558 // placeholder for future optional parameters 1559} 1560 1561// DiagnosticSettingsDeleteOptions contains the optional parameters for the DiagnosticSettings.Delete method. 1562type DiagnosticSettingsDeleteOptions struct { 1563 // placeholder for future optional parameters 1564} 1565 1566// DiagnosticSettingsGetOptions contains the optional parameters for the DiagnosticSettings.Get method. 1567type DiagnosticSettingsGetOptions struct { 1568 // placeholder for future optional parameters 1569} 1570 1571// DiagnosticSettingsListOptions contains the optional parameters for the DiagnosticSettings.List method. 1572type DiagnosticSettingsListOptions struct { 1573 // placeholder for future optional parameters 1574} 1575 1576// DiagnosticSettingsResource - The diagnostic setting resource. 1577type DiagnosticSettingsResource struct { 1578 ProxyOnlyResource 1579 // Properties of a Diagnostic Settings Resource. 1580 Properties *DiagnosticSettings `json:"properties,omitempty"` 1581} 1582 1583// DiagnosticSettingsResourceCollection - Represents a collection of alert rule resources. 1584type DiagnosticSettingsResourceCollection struct { 1585 // The collection of diagnostic settings resources;. 1586 Value []*DiagnosticSettingsResource `json:"value,omitempty"` 1587} 1588 1589// MarshalJSON implements the json.Marshaller interface for type DiagnosticSettingsResourceCollection. 1590func (d DiagnosticSettingsResourceCollection) MarshalJSON() ([]byte, error) { 1591 objectMap := make(map[string]interface{}) 1592 populate(objectMap, "value", d.Value) 1593 return json.Marshal(objectMap) 1594} 1595 1596// Dimension - Specifies the criteria for converting log to metric. 1597type Dimension struct { 1598 // REQUIRED; Name of the dimension 1599 Name *string `json:"name,omitempty"` 1600 1601 // REQUIRED; Operator for dimension values 1602 Operator *Operator `json:"operator,omitempty"` 1603 1604 // REQUIRED; List of dimension values 1605 Values []*string `json:"values,omitempty"` 1606} 1607 1608// MarshalJSON implements the json.Marshaller interface for type Dimension. 1609func (d Dimension) MarshalJSON() ([]byte, error) { 1610 objectMap := make(map[string]interface{}) 1611 populate(objectMap, "name", d.Name) 1612 populate(objectMap, "operator", d.Operator) 1613 populate(objectMap, "values", d.Values) 1614 return json.Marshal(objectMap) 1615} 1616 1617// DynamicMetricCriteria - Criterion for dynamic threshold. 1618type DynamicMetricCriteria struct { 1619 MultiMetricCriteria 1620 // REQUIRED; The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern. 1621 AlertSensitivity *DynamicThresholdSensitivity `json:"alertSensitivity,omitempty"` 1622 1623 // REQUIRED; The minimum number of violations required within the selected lookback time window required to raise an alert. 1624 FailingPeriods *DynamicThresholdFailingPeriods `json:"failingPeriods,omitempty"` 1625 1626 // REQUIRED; The operator used to compare the metric value against the threshold. 1627 Operator *DynamicThresholdOperator `json:"operator,omitempty"` 1628 1629 // Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format) 1630 IgnoreDataBefore *time.Time `json:"ignoreDataBefore,omitempty"` 1631} 1632 1633// MarshalJSON implements the json.Marshaller interface for type DynamicMetricCriteria. 1634func (d DynamicMetricCriteria) MarshalJSON() ([]byte, error) { 1635 objectMap := d.MultiMetricCriteria.marshalInternal(CriterionTypeDynamicThresholdCriterion) 1636 populate(objectMap, "alertSensitivity", d.AlertSensitivity) 1637 populate(objectMap, "failingPeriods", d.FailingPeriods) 1638 populate(objectMap, "ignoreDataBefore", (*timeRFC3339)(d.IgnoreDataBefore)) 1639 populate(objectMap, "operator", d.Operator) 1640 return json.Marshal(objectMap) 1641} 1642 1643// UnmarshalJSON implements the json.Unmarshaller interface for type DynamicMetricCriteria. 1644func (d *DynamicMetricCriteria) UnmarshalJSON(data []byte) error { 1645 var rawMsg map[string]json.RawMessage 1646 if err := json.Unmarshal(data, &rawMsg); err != nil { 1647 return err 1648 } 1649 for key, val := range rawMsg { 1650 var err error 1651 switch key { 1652 case "alertSensitivity": 1653 err = unpopulate(val, &d.AlertSensitivity) 1654 delete(rawMsg, key) 1655 case "failingPeriods": 1656 err = unpopulate(val, &d.FailingPeriods) 1657 delete(rawMsg, key) 1658 case "ignoreDataBefore": 1659 var aux timeRFC3339 1660 err = unpopulate(val, &aux) 1661 d.IgnoreDataBefore = (*time.Time)(&aux) 1662 delete(rawMsg, key) 1663 case "operator": 1664 err = unpopulate(val, &d.Operator) 1665 delete(rawMsg, key) 1666 } 1667 if err != nil { 1668 return err 1669 } 1670 } 1671 return d.MultiMetricCriteria.unmarshalInternal(rawMsg) 1672} 1673 1674// DynamicThresholdFailingPeriods - The minimum number of violations required within the selected lookback time window required to raise an alert. 1675type DynamicThresholdFailingPeriods struct { 1676 // REQUIRED; The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. 1677 MinFailingPeriodsToAlert *float32 `json:"minFailingPeriodsToAlert,omitempty"` 1678 1679 // REQUIRED; The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the 1680 // selected number of aggregated points. 1681 NumberOfEvaluationPeriods *float32 `json:"numberOfEvaluationPeriods,omitempty"` 1682} 1683 1684// EmailNotification - Email notification of an autoscale event. 1685type EmailNotification struct { 1686 // the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. 1687 CustomEmails []*string `json:"customEmails,omitempty"` 1688 1689 // a value indicating whether to send email to subscription administrator. 1690 SendToSubscriptionAdministrator *bool `json:"sendToSubscriptionAdministrator,omitempty"` 1691 1692 // a value indicating whether to send email to subscription co-administrators. 1693 SendToSubscriptionCoAdministrators *bool `json:"sendToSubscriptionCoAdministrators,omitempty"` 1694} 1695 1696// MarshalJSON implements the json.Marshaller interface for type EmailNotification. 1697func (e EmailNotification) MarshalJSON() ([]byte, error) { 1698 objectMap := make(map[string]interface{}) 1699 populate(objectMap, "customEmails", e.CustomEmails) 1700 populate(objectMap, "sendToSubscriptionAdministrator", e.SendToSubscriptionAdministrator) 1701 populate(objectMap, "sendToSubscriptionCoAdministrators", e.SendToSubscriptionCoAdministrators) 1702 return json.Marshal(objectMap) 1703} 1704 1705// EmailReceiver - An email receiver. 1706type EmailReceiver struct { 1707 // REQUIRED; The email address of this receiver. 1708 EmailAddress *string `json:"emailAddress,omitempty"` 1709 1710 // REQUIRED; The name of the email receiver. Names must be unique across all receivers within an action group. 1711 Name *string `json:"name,omitempty"` 1712 1713 // Indicates whether to use common alert schema. 1714 UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"` 1715 1716 // READ-ONLY; The receiver status of the e-mail. 1717 Status *ReceiverStatus `json:"status,omitempty" azure:"ro"` 1718} 1719 1720// EnableRequest - Describes a receiver that should be resubscribed. 1721type EnableRequest struct { 1722 // REQUIRED; The name of the receiver to resubscribe. 1723 ReceiverName *string `json:"receiverName,omitempty"` 1724} 1725 1726// Error details. 1727type Error struct { 1728 // REQUIRED; Error code identifying the specific error. 1729 Code *string `json:"code,omitempty"` 1730 1731 // Error message in the caller's locale. 1732 Message *string `json:"message,omitempty"` 1733} 1734 1735// ErrorAdditionalInfo - The resource management error additional info. 1736type ErrorAdditionalInfo struct { 1737 // READ-ONLY; The additional info. 1738 Info map[string]interface{} `json:"info,omitempty" azure:"ro"` 1739 1740 // READ-ONLY; The additional info type. 1741 Type *string `json:"type,omitempty" azure:"ro"` 1742} 1743 1744// ErrorContract - Describes the format of Error response. 1745// Implements the error and azcore.HTTPResponse interfaces. 1746type ErrorContract struct { 1747 raw string 1748 // The error details. 1749 InnerError *ErrorResponse `json:"error,omitempty"` 1750} 1751 1752// Error implements the error interface for type ErrorContract. 1753// The contents of the error text are not contractual and subject to change. 1754func (e ErrorContract) Error() string { 1755 return e.raw 1756} 1757 1758// ErrorDetail - The error detail. 1759type ErrorDetail struct { 1760 // READ-ONLY; The error additional info. 1761 AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"` 1762 1763 // READ-ONLY; The error code. 1764 Code *string `json:"code,omitempty" azure:"ro"` 1765 1766 // READ-ONLY; The error details. 1767 Details []*ErrorDetail `json:"details,omitempty" azure:"ro"` 1768 1769 // READ-ONLY; The error message. 1770 Message *string `json:"message,omitempty" azure:"ro"` 1771 1772 // READ-ONLY; The error target. 1773 Target *string `json:"target,omitempty" azure:"ro"` 1774} 1775 1776// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. 1777func (e ErrorDetail) MarshalJSON() ([]byte, error) { 1778 objectMap := make(map[string]interface{}) 1779 populate(objectMap, "additionalInfo", e.AdditionalInfo) 1780 populate(objectMap, "code", e.Code) 1781 populate(objectMap, "details", e.Details) 1782 populate(objectMap, "message", e.Message) 1783 populate(objectMap, "target", e.Target) 1784 return json.Marshal(objectMap) 1785} 1786 1787// ErrorResponse - Describes the format of Error response. 1788// Implements the error and azcore.HTTPResponse interfaces. 1789type ErrorResponse struct { 1790 raw string 1791 // Error code 1792 Code *string `json:"code,omitempty"` 1793 1794 // Error message indicating why the operation failed. 1795 Message *string `json:"message,omitempty"` 1796} 1797 1798// Error implements the error interface for type ErrorResponse. 1799// The contents of the error text are not contractual and subject to change. 1800func (e ErrorResponse) Error() string { 1801 return e.raw 1802} 1803 1804// ErrorResponseCommon - The resource management error response. 1805type ErrorResponseCommon struct { 1806 ErrorResponse 1807 // READ-ONLY; The error additional info. 1808 AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"` 1809 1810 // READ-ONLY; The error details. 1811 Details []*ErrorResponseCommon `json:"details,omitempty" azure:"ro"` 1812} 1813 1814// ErrorResponseCommonV2 - Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the 1815// OData error response format.). 1816// Implements the error and azcore.HTTPResponse interfaces. 1817type ErrorResponseCommonV2 struct { 1818 raw string 1819 // The error object. 1820 InnerError *ErrorDetail `json:"error,omitempty"` 1821} 1822 1823// Error implements the error interface for type ErrorResponseCommonV2. 1824// The contents of the error text are not contractual and subject to change. 1825func (e ErrorResponseCommonV2) Error() string { 1826 return e.raw 1827} 1828 1829// EventCategoriesListOptions contains the optional parameters for the EventCategories.List method. 1830type EventCategoriesListOptions struct { 1831 // placeholder for future optional parameters 1832} 1833 1834// EventCategoryCollection - A collection of event categories. Currently possible values are: Administrative, Security, ServiceHealth, Alert, Recommendation, 1835// Policy. 1836type EventCategoryCollection struct { 1837 // REQUIRED; the list that includes the Azure event categories. 1838 Value []*LocalizableString `json:"value,omitempty"` 1839} 1840 1841// MarshalJSON implements the json.Marshaller interface for type EventCategoryCollection. 1842func (e EventCategoryCollection) MarshalJSON() ([]byte, error) { 1843 objectMap := make(map[string]interface{}) 1844 populate(objectMap, "value", e.Value) 1845 return json.Marshal(objectMap) 1846} 1847 1848// EventData - The Azure event log entries are of type EventData 1849type EventData struct { 1850 // READ-ONLY; The sender authorization information. 1851 Authorization *SenderAuthorization `json:"authorization,omitempty" azure:"ro"` 1852 1853 // READ-ONLY; the email address of the user who has performed the operation, the UPN claim or SPN claim based on availability. 1854 Caller *string `json:"caller,omitempty" azure:"ro"` 1855 1856 // READ-ONLY; the event category. 1857 Category *LocalizableString `json:"category,omitempty" azure:"ro"` 1858 1859 // READ-ONLY; key value pairs to identify ARM permissions. 1860 Claims map[string]*string `json:"claims,omitempty" azure:"ro"` 1861 1862 // READ-ONLY; the correlation Id, usually a GUID in the string format. The correlation Id is shared among the events that belong to the same uber operation. 1863 CorrelationID *string `json:"correlationId,omitempty" azure:"ro"` 1864 1865 // READ-ONLY; the description of the event. 1866 Description *string `json:"description,omitempty" azure:"ro"` 1867 1868 // READ-ONLY; the event data Id. This is a unique identifier for an event. 1869 EventDataID *string `json:"eventDataId,omitempty" azure:"ro"` 1870 1871 // READ-ONLY; the event name. This value should not be confused with OperationName. For practical purposes, OperationName might be more appealing to end 1872 // users. 1873 EventName *LocalizableString `json:"eventName,omitempty" azure:"ro"` 1874 1875 // READ-ONLY; the timestamp of when the event was generated by the Azure service processing the request corresponding the event. It in ISO 8601 format. 1876 EventTimestamp *time.Time `json:"eventTimestamp,omitempty" azure:"ro"` 1877 1878 // READ-ONLY; the HTTP request info. Usually includes the 'clientRequestId', 'clientIpAddress' (IP address of the user who initiated the event) and 'method' 1879 // (HTTP method e.g. PUT). 1880 HTTPRequest *HTTPRequestInfo `json:"httpRequest,omitempty" azure:"ro"` 1881 1882 // READ-ONLY; the Id of this event as required by ARM for RBAC. It contains the EventDataID and a timestamp information. 1883 ID *string `json:"id,omitempty" azure:"ro"` 1884 1885 // READ-ONLY; the event level 1886 Level *EventLevel `json:"level,omitempty" azure:"ro"` 1887 1888 // READ-ONLY; It is usually a GUID shared among the events corresponding to single operation. This value should not be confused with EventName. 1889 OperationID *string `json:"operationId,omitempty" azure:"ro"` 1890 1891 // READ-ONLY; the operation name. 1892 OperationName *LocalizableString `json:"operationName,omitempty" azure:"ro"` 1893 1894 // READ-ONLY; the set of pairs (usually a Dictionary) that includes details about the event. 1895 Properties map[string]*string `json:"properties,omitempty" azure:"ro"` 1896 1897 // READ-ONLY; the resource group name of the impacted resource. 1898 ResourceGroupName *string `json:"resourceGroupName,omitempty" azure:"ro"` 1899 1900 // READ-ONLY; the resource uri that uniquely identifies the resource that caused this event. 1901 ResourceID *string `json:"resourceId,omitempty" azure:"ro"` 1902 1903 // READ-ONLY; the resource provider name of the impacted resource. 1904 ResourceProviderName *LocalizableString `json:"resourceProviderName,omitempty" azure:"ro"` 1905 1906 // READ-ONLY; the resource type 1907 ResourceType *LocalizableString `json:"resourceType,omitempty" azure:"ro"` 1908 1909 // READ-ONLY; a string describing the status of the operation. Some typical values are: Started, In progress, Succeeded, Failed, Resolved. 1910 Status *LocalizableString `json:"status,omitempty" azure:"ro"` 1911 1912 // READ-ONLY; the event sub status. Most of the time, when included, this captures the HTTP status code of the REST call. Common values are: OK (HTTP Status 1913 // Code: 200), Created (HTTP Status Code: 201), Accepted 1914 // (HTTP Status Code: 202), No Content (HTTP Status Code: 204), Bad Request(HTTP Status Code: 400), Not Found (HTTP Status Code: 404), Conflict (HTTP Status 1915 // Code: 409), Internal Server Error (HTTP Status 1916 // Code: 500), Service Unavailable (HTTP Status Code:503), Gateway Timeout (HTTP Status Code: 504) 1917 SubStatus *LocalizableString `json:"subStatus,omitempty" azure:"ro"` 1918 1919 // READ-ONLY; the timestamp of when the event became available for querying via this API. It is in ISO 8601 format. This value should not be confused eventTimestamp. 1920 // As there might be a delay between the occurrence 1921 // time of the event, and the time that the event is submitted to the Azure logging infrastructure. 1922 SubmissionTimestamp *time.Time `json:"submissionTimestamp,omitempty" azure:"ro"` 1923 1924 // READ-ONLY; the Azure subscription Id usually a GUID. 1925 SubscriptionID *string `json:"subscriptionId,omitempty" azure:"ro"` 1926 1927 // READ-ONLY; the Azure tenant Id 1928 TenantID *string `json:"tenantId,omitempty" azure:"ro"` 1929} 1930 1931// MarshalJSON implements the json.Marshaller interface for type EventData. 1932func (e EventData) MarshalJSON() ([]byte, error) { 1933 objectMap := make(map[string]interface{}) 1934 populate(objectMap, "authorization", e.Authorization) 1935 populate(objectMap, "caller", e.Caller) 1936 populate(objectMap, "category", e.Category) 1937 populate(objectMap, "claims", e.Claims) 1938 populate(objectMap, "correlationId", e.CorrelationID) 1939 populate(objectMap, "description", e.Description) 1940 populate(objectMap, "eventDataId", e.EventDataID) 1941 populate(objectMap, "eventName", e.EventName) 1942 populate(objectMap, "eventTimestamp", (*timeRFC3339)(e.EventTimestamp)) 1943 populate(objectMap, "httpRequest", e.HTTPRequest) 1944 populate(objectMap, "id", e.ID) 1945 populate(objectMap, "level", e.Level) 1946 populate(objectMap, "operationId", e.OperationID) 1947 populate(objectMap, "operationName", e.OperationName) 1948 populate(objectMap, "properties", e.Properties) 1949 populate(objectMap, "resourceGroupName", e.ResourceGroupName) 1950 populate(objectMap, "resourceId", e.ResourceID) 1951 populate(objectMap, "resourceProviderName", e.ResourceProviderName) 1952 populate(objectMap, "resourceType", e.ResourceType) 1953 populate(objectMap, "status", e.Status) 1954 populate(objectMap, "subStatus", e.SubStatus) 1955 populate(objectMap, "submissionTimestamp", (*timeRFC3339)(e.SubmissionTimestamp)) 1956 populate(objectMap, "subscriptionId", e.SubscriptionID) 1957 populate(objectMap, "tenantId", e.TenantID) 1958 return json.Marshal(objectMap) 1959} 1960 1961// UnmarshalJSON implements the json.Unmarshaller interface for type EventData. 1962func (e *EventData) UnmarshalJSON(data []byte) error { 1963 var rawMsg map[string]json.RawMessage 1964 if err := json.Unmarshal(data, &rawMsg); err != nil { 1965 return err 1966 } 1967 for key, val := range rawMsg { 1968 var err error 1969 switch key { 1970 case "authorization": 1971 err = unpopulate(val, &e.Authorization) 1972 delete(rawMsg, key) 1973 case "caller": 1974 err = unpopulate(val, &e.Caller) 1975 delete(rawMsg, key) 1976 case "category": 1977 err = unpopulate(val, &e.Category) 1978 delete(rawMsg, key) 1979 case "claims": 1980 err = unpopulate(val, &e.Claims) 1981 delete(rawMsg, key) 1982 case "correlationId": 1983 err = unpopulate(val, &e.CorrelationID) 1984 delete(rawMsg, key) 1985 case "description": 1986 err = unpopulate(val, &e.Description) 1987 delete(rawMsg, key) 1988 case "eventDataId": 1989 err = unpopulate(val, &e.EventDataID) 1990 delete(rawMsg, key) 1991 case "eventName": 1992 err = unpopulate(val, &e.EventName) 1993 delete(rawMsg, key) 1994 case "eventTimestamp": 1995 var aux timeRFC3339 1996 err = unpopulate(val, &aux) 1997 e.EventTimestamp = (*time.Time)(&aux) 1998 delete(rawMsg, key) 1999 case "httpRequest": 2000 err = unpopulate(val, &e.HTTPRequest) 2001 delete(rawMsg, key) 2002 case "id": 2003 err = unpopulate(val, &e.ID) 2004 delete(rawMsg, key) 2005 case "level": 2006 err = unpopulate(val, &e.Level) 2007 delete(rawMsg, key) 2008 case "operationId": 2009 err = unpopulate(val, &e.OperationID) 2010 delete(rawMsg, key) 2011 case "operationName": 2012 err = unpopulate(val, &e.OperationName) 2013 delete(rawMsg, key) 2014 case "properties": 2015 err = unpopulate(val, &e.Properties) 2016 delete(rawMsg, key) 2017 case "resourceGroupName": 2018 err = unpopulate(val, &e.ResourceGroupName) 2019 delete(rawMsg, key) 2020 case "resourceId": 2021 err = unpopulate(val, &e.ResourceID) 2022 delete(rawMsg, key) 2023 case "resourceProviderName": 2024 err = unpopulate(val, &e.ResourceProviderName) 2025 delete(rawMsg, key) 2026 case "resourceType": 2027 err = unpopulate(val, &e.ResourceType) 2028 delete(rawMsg, key) 2029 case "status": 2030 err = unpopulate(val, &e.Status) 2031 delete(rawMsg, key) 2032 case "subStatus": 2033 err = unpopulate(val, &e.SubStatus) 2034 delete(rawMsg, key) 2035 case "submissionTimestamp": 2036 var aux timeRFC3339 2037 err = unpopulate(val, &aux) 2038 e.SubmissionTimestamp = (*time.Time)(&aux) 2039 delete(rawMsg, key) 2040 case "subscriptionId": 2041 err = unpopulate(val, &e.SubscriptionID) 2042 delete(rawMsg, key) 2043 case "tenantId": 2044 err = unpopulate(val, &e.TenantID) 2045 delete(rawMsg, key) 2046 } 2047 if err != nil { 2048 return err 2049 } 2050 } 2051 return nil 2052} 2053 2054// EventDataCollection - Represents collection of events. 2055type EventDataCollection struct { 2056 // REQUIRED; this list that includes the Azure audit logs. 2057 Value []*EventData `json:"value,omitempty"` 2058 2059 // Provides the link to retrieve the next set of events. 2060 NextLink *string `json:"nextLink,omitempty"` 2061} 2062 2063// MarshalJSON implements the json.Marshaller interface for type EventDataCollection. 2064func (e EventDataCollection) MarshalJSON() ([]byte, error) { 2065 objectMap := make(map[string]interface{}) 2066 populate(objectMap, "nextLink", e.NextLink) 2067 populate(objectMap, "value", e.Value) 2068 return json.Marshal(objectMap) 2069} 2070 2071// ExtensionDataSource - Definition of which data will be collected from a separate VM extension that integrates with the Azure Monitor Agent. Collected 2072// from either Windows and Linux machines, depending on which extension is 2073// defined. 2074type ExtensionDataSource struct { 2075 // REQUIRED; The name of the VM extension. 2076 ExtensionName *string `json:"extensionName,omitempty"` 2077 2078 // The extension settings. The format is specific for particular extension. 2079 ExtensionSettings map[string]interface{} `json:"extensionSettings,omitempty"` 2080 2081 // The list of data sources this extension needs data from. 2082 InputDataSources []*string `json:"inputDataSources,omitempty"` 2083 2084 // A friendly name for the data source. This name should be unique across all data sources (regardless of type) within the data collection rule. 2085 Name *string `json:"name,omitempty"` 2086 2087 // List of streams that this data source will be sent to. A stream indicates what schema will be used for this data and usually what table in Log Analytics 2088 // the data will be sent to. 2089 Streams []*KnownExtensionDataSourceStreams `json:"streams,omitempty"` 2090} 2091 2092// MarshalJSON implements the json.Marshaller interface for type ExtensionDataSource. 2093func (e ExtensionDataSource) MarshalJSON() ([]byte, error) { 2094 objectMap := make(map[string]interface{}) 2095 populate(objectMap, "extensionName", e.ExtensionName) 2096 populate(objectMap, "extensionSettings", e.ExtensionSettings) 2097 populate(objectMap, "inputDataSources", e.InputDataSources) 2098 populate(objectMap, "name", e.Name) 2099 populate(objectMap, "streams", e.Streams) 2100 return json.Marshal(objectMap) 2101} 2102 2103// HTTPRequestInfo - The Http request info. 2104type HTTPRequestInfo struct { 2105 // the client Ip Address 2106 ClientIPAddress *string `json:"clientIpAddress,omitempty"` 2107 2108 // the client request id. 2109 ClientRequestID *string `json:"clientRequestId,omitempty"` 2110 2111 // the Http request method. 2112 Method *string `json:"method,omitempty"` 2113 2114 // the Uri. 2115 URI *string `json:"uri,omitempty"` 2116} 2117 2118// Incident - An alert incident indicates the activation status of an alert rule. 2119type Incident struct { 2120 // READ-ONLY; The time at which the incident was activated in ISO8601 format. 2121 ActivatedTime *time.Time `json:"activatedTime,omitempty" azure:"ro"` 2122 2123 // READ-ONLY; A boolean to indicate whether the incident is active or resolved. 2124 IsActive *bool `json:"isActive,omitempty" azure:"ro"` 2125 2126 // READ-ONLY; Incident name. 2127 Name *string `json:"name,omitempty" azure:"ro"` 2128 2129 // READ-ONLY; The time at which the incident was resolved in ISO8601 format. If null, it means the incident is still active. 2130 ResolvedTime *time.Time `json:"resolvedTime,omitempty" azure:"ro"` 2131 2132 // READ-ONLY; Rule name that is associated with the incident. 2133 RuleName *string `json:"ruleName,omitempty" azure:"ro"` 2134} 2135 2136// MarshalJSON implements the json.Marshaller interface for type Incident. 2137func (i Incident) MarshalJSON() ([]byte, error) { 2138 objectMap := make(map[string]interface{}) 2139 populate(objectMap, "activatedTime", (*timeRFC3339)(i.ActivatedTime)) 2140 populate(objectMap, "isActive", i.IsActive) 2141 populate(objectMap, "name", i.Name) 2142 populate(objectMap, "resolvedTime", (*timeRFC3339)(i.ResolvedTime)) 2143 populate(objectMap, "ruleName", i.RuleName) 2144 return json.Marshal(objectMap) 2145} 2146 2147// UnmarshalJSON implements the json.Unmarshaller interface for type Incident. 2148func (i *Incident) UnmarshalJSON(data []byte) error { 2149 var rawMsg map[string]json.RawMessage 2150 if err := json.Unmarshal(data, &rawMsg); err != nil { 2151 return err 2152 } 2153 for key, val := range rawMsg { 2154 var err error 2155 switch key { 2156 case "activatedTime": 2157 var aux timeRFC3339 2158 err = unpopulate(val, &aux) 2159 i.ActivatedTime = (*time.Time)(&aux) 2160 delete(rawMsg, key) 2161 case "isActive": 2162 err = unpopulate(val, &i.IsActive) 2163 delete(rawMsg, key) 2164 case "name": 2165 err = unpopulate(val, &i.Name) 2166 delete(rawMsg, key) 2167 case "resolvedTime": 2168 var aux timeRFC3339 2169 err = unpopulate(val, &aux) 2170 i.ResolvedTime = (*time.Time)(&aux) 2171 delete(rawMsg, key) 2172 case "ruleName": 2173 err = unpopulate(val, &i.RuleName) 2174 delete(rawMsg, key) 2175 } 2176 if err != nil { 2177 return err 2178 } 2179 } 2180 return nil 2181} 2182 2183// IncidentListResult - The List incidents operation response. 2184type IncidentListResult struct { 2185 // the incident collection. 2186 Value []*Incident `json:"value,omitempty"` 2187} 2188 2189// MarshalJSON implements the json.Marshaller interface for type IncidentListResult. 2190func (i IncidentListResult) MarshalJSON() ([]byte, error) { 2191 objectMap := make(map[string]interface{}) 2192 populate(objectMap, "value", i.Value) 2193 return json.Marshal(objectMap) 2194} 2195 2196// ItsmReceiver - An Itsm receiver. 2197type ItsmReceiver struct { 2198 // REQUIRED; Unique identification of ITSM connection among multiple defined in above workspace. 2199 ConnectionID *string `json:"connectionId,omitempty"` 2200 2201 // REQUIRED; The name of the Itsm receiver. Names must be unique across all receivers within an action group. 2202 Name *string `json:"name,omitempty"` 2203 2204 // REQUIRED; Region in which workspace resides. Supported values:'centralindia','japaneast','southeastasia','australiasoutheast','uksouth','westcentralus','canadacentral','eastus','westeurope' 2205 Region *string `json:"region,omitempty"` 2206 2207 // REQUIRED; JSON blob for the configurations of the ITSM action. CreateMultipleWorkItems option will be part of this blob as well. 2208 TicketConfiguration *string `json:"ticketConfiguration,omitempty"` 2209 2210 // REQUIRED; OMS LA instance identifier. 2211 WorkspaceID *string `json:"workspaceId,omitempty"` 2212} 2213 2214// LocalizableString - The localizable string class. 2215type LocalizableString struct { 2216 // REQUIRED; the invariant value. 2217 Value *string `json:"value,omitempty"` 2218 2219 // the locale specific value. 2220 LocalizedValue *string `json:"localizedValue,omitempty"` 2221} 2222 2223// LocationThresholdRuleCondition - A rule condition based on a certain number of locations failing. 2224type LocationThresholdRuleCondition struct { 2225 RuleCondition 2226 // REQUIRED; the number of locations that must fail to activate the alert. 2227 FailedLocationCount *int32 `json:"failedLocationCount,omitempty"` 2228 2229 // the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified then it must be between 2230 // 5 minutes and 1 day. 2231 WindowSize *string `json:"windowSize,omitempty"` 2232} 2233 2234// MarshalJSON implements the json.Marshaller interface for type LocationThresholdRuleCondition. 2235func (l LocationThresholdRuleCondition) MarshalJSON() ([]byte, error) { 2236 objectMap := l.RuleCondition.marshalInternal("Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition") 2237 populate(objectMap, "failedLocationCount", l.FailedLocationCount) 2238 populate(objectMap, "windowSize", l.WindowSize) 2239 return json.Marshal(objectMap) 2240} 2241 2242// UnmarshalJSON implements the json.Unmarshaller interface for type LocationThresholdRuleCondition. 2243func (l *LocationThresholdRuleCondition) UnmarshalJSON(data []byte) error { 2244 var rawMsg map[string]json.RawMessage 2245 if err := json.Unmarshal(data, &rawMsg); err != nil { 2246 return err 2247 } 2248 for key, val := range rawMsg { 2249 var err error 2250 switch key { 2251 case "failedLocationCount": 2252 err = unpopulate(val, &l.FailedLocationCount) 2253 delete(rawMsg, key) 2254 case "windowSize": 2255 err = unpopulate(val, &l.WindowSize) 2256 delete(rawMsg, key) 2257 } 2258 if err != nil { 2259 return err 2260 } 2261 } 2262 return l.RuleCondition.unmarshalInternal(rawMsg) 2263} 2264 2265// LogAnalyticsDestination - Log Analytics destination. 2266type LogAnalyticsDestination struct { 2267 // A friendly name for the destination. This name should be unique across all destinations (regardless of type) within the data collection rule. 2268 Name *string `json:"name,omitempty"` 2269 2270 // The resource ID of the Log Analytics workspace. 2271 WorkspaceResourceID *string `json:"workspaceResourceId,omitempty"` 2272 2273 // READ-ONLY; The Customer ID of the Log Analytics workspace. 2274 WorkspaceID *string `json:"workspaceId,omitempty" azure:"ro"` 2275} 2276 2277// LogMetricTrigger - A log metrics trigger descriptor. 2278type LogMetricTrigger struct { 2279 // Evaluation of metric on a particular column 2280 MetricColumn *string `json:"metricColumn,omitempty"` 2281 2282 // Metric Trigger Type - 'Consecutive' or 'Total' 2283 MetricTriggerType *MetricTriggerType `json:"metricTriggerType,omitempty"` 2284 2285 // The threshold of the metric trigger. 2286 Threshold *float64 `json:"threshold,omitempty"` 2287 2288 // Evaluation operation for Metric -'GreaterThan' or 'LessThan' or 'Equal'. 2289 ThresholdOperator *ConditionalOperator `json:"thresholdOperator,omitempty"` 2290} 2291 2292// LogProfileCollection - Represents a collection of log profiles. 2293type LogProfileCollection struct { 2294 // REQUIRED; the values of the log profiles. 2295 Value []*LogProfileResource `json:"value,omitempty"` 2296} 2297 2298// MarshalJSON implements the json.Marshaller interface for type LogProfileCollection. 2299func (l LogProfileCollection) MarshalJSON() ([]byte, error) { 2300 objectMap := make(map[string]interface{}) 2301 populate(objectMap, "value", l.Value) 2302 return json.Marshal(objectMap) 2303} 2304 2305// LogProfileProperties - The log profile properties. 2306type LogProfileProperties struct { 2307 // REQUIRED; the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.' 2308 Categories []*string `json:"categories,omitempty"` 2309 2310 // REQUIRED; List of regions for which Activity Log events should be stored or streamed. It is a comma separated list of valid ARM locations including the 2311 // 'global' location. 2312 Locations []*string `json:"locations,omitempty"` 2313 2314 // REQUIRED; the retention policy for the events in the log. 2315 RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"` 2316 2317 // The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is 2318 // of the format: '{service bus resource 2319 // ID}/authorizationrules/{key name}'. 2320 ServiceBusRuleID *string `json:"serviceBusRuleId,omitempty"` 2321 2322 // the resource id of the storage account to which you would like to send the Activity Log. 2323 StorageAccountID *string `json:"storageAccountId,omitempty"` 2324} 2325 2326// MarshalJSON implements the json.Marshaller interface for type LogProfileProperties. 2327func (l LogProfileProperties) MarshalJSON() ([]byte, error) { 2328 objectMap := make(map[string]interface{}) 2329 populate(objectMap, "categories", l.Categories) 2330 populate(objectMap, "locations", l.Locations) 2331 populate(objectMap, "retentionPolicy", l.RetentionPolicy) 2332 populate(objectMap, "serviceBusRuleId", l.ServiceBusRuleID) 2333 populate(objectMap, "storageAccountId", l.StorageAccountID) 2334 return json.Marshal(objectMap) 2335} 2336 2337// LogProfileResource - The log profile resource. 2338type LogProfileResource struct { 2339 Resource 2340 // REQUIRED; The log profile properties of the resource. 2341 Properties *LogProfileProperties `json:"properties,omitempty"` 2342} 2343 2344// MarshalJSON implements the json.Marshaller interface for type LogProfileResource. 2345func (l LogProfileResource) MarshalJSON() ([]byte, error) { 2346 objectMap := l.Resource.marshalInternal() 2347 populate(objectMap, "properties", l.Properties) 2348 return json.Marshal(objectMap) 2349} 2350 2351// LogProfileResourcePatch - The log profile resource for patch operations. 2352type LogProfileResourcePatch struct { 2353 // The log profile properties for an update operation. 2354 Properties *LogProfileProperties `json:"properties,omitempty"` 2355 2356 // Resource tags 2357 Tags map[string]*string `json:"tags,omitempty"` 2358} 2359 2360// MarshalJSON implements the json.Marshaller interface for type LogProfileResourcePatch. 2361func (l LogProfileResourcePatch) MarshalJSON() ([]byte, error) { 2362 objectMap := make(map[string]interface{}) 2363 populate(objectMap, "properties", l.Properties) 2364 populate(objectMap, "tags", l.Tags) 2365 return json.Marshal(objectMap) 2366} 2367 2368// LogProfilesCreateOrUpdateOptions contains the optional parameters for the LogProfiles.CreateOrUpdate method. 2369type LogProfilesCreateOrUpdateOptions struct { 2370 // placeholder for future optional parameters 2371} 2372 2373// LogProfilesDeleteOptions contains the optional parameters for the LogProfiles.Delete method. 2374type LogProfilesDeleteOptions struct { 2375 // placeholder for future optional parameters 2376} 2377 2378// LogProfilesGetOptions contains the optional parameters for the LogProfiles.Get method. 2379type LogProfilesGetOptions struct { 2380 // placeholder for future optional parameters 2381} 2382 2383// LogProfilesListOptions contains the optional parameters for the LogProfiles.List method. 2384type LogProfilesListOptions struct { 2385 // placeholder for future optional parameters 2386} 2387 2388// LogProfilesUpdateOptions contains the optional parameters for the LogProfiles.Update method. 2389type LogProfilesUpdateOptions struct { 2390 // placeholder for future optional parameters 2391} 2392 2393// LogSearchRule - Log Search Rule Definition 2394type LogSearchRule struct { 2395 // REQUIRED; Action needs to be taken on rule execution. 2396 Action ActionClassification `json:"action,omitempty"` 2397 2398 // REQUIRED; Data Source against which rule will Query Data 2399 Source *Source `json:"source,omitempty"` 2400 2401 // The flag that indicates whether the alert should be automatically resolved or not. The default is false. 2402 AutoMitigate *bool `json:"autoMitigate,omitempty"` 2403 2404 // The description of the Log Search rule. 2405 Description *string `json:"description,omitempty"` 2406 2407 // The display name of the alert rule 2408 DisplayName *string `json:"displayName,omitempty"` 2409 2410 // The flag which indicates whether the Log Search rule is enabled. Value should be true or false 2411 Enabled *Enabled `json:"enabled,omitempty"` 2412 2413 // Schedule (Frequency, Time Window) for rule. Required for action type - AlertingAction 2414 Schedule *Schedule `json:"schedule,omitempty"` 2415 2416 // READ-ONLY; The api-version used when creating this alert rule 2417 CreatedWithAPIVersion *string `json:"createdWithApiVersion,omitempty" azure:"ro"` 2418 2419 // READ-ONLY; True if alert rule is legacy Log Analytic rule 2420 IsLegacyLogAnalyticsRule *bool `json:"isLegacyLogAnalyticsRule,omitempty" azure:"ro"` 2421 2422 // READ-ONLY; Last time the rule was updated in IS08601 format. 2423 LastUpdatedTime *time.Time `json:"lastUpdatedTime,omitempty" azure:"ro"` 2424 2425 // READ-ONLY; Provisioning state of the scheduled query rule 2426 ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` 2427} 2428 2429// MarshalJSON implements the json.Marshaller interface for type LogSearchRule. 2430func (l LogSearchRule) MarshalJSON() ([]byte, error) { 2431 objectMap := make(map[string]interface{}) 2432 populate(objectMap, "action", l.Action) 2433 populate(objectMap, "autoMitigate", l.AutoMitigate) 2434 populate(objectMap, "createdWithApiVersion", l.CreatedWithAPIVersion) 2435 populate(objectMap, "description", l.Description) 2436 populate(objectMap, "displayName", l.DisplayName) 2437 populate(objectMap, "enabled", l.Enabled) 2438 populate(objectMap, "isLegacyLogAnalyticsRule", l.IsLegacyLogAnalyticsRule) 2439 populate(objectMap, "lastUpdatedTime", (*timeRFC3339)(l.LastUpdatedTime)) 2440 populate(objectMap, "provisioningState", l.ProvisioningState) 2441 populate(objectMap, "schedule", l.Schedule) 2442 populate(objectMap, "source", l.Source) 2443 return json.Marshal(objectMap) 2444} 2445 2446// UnmarshalJSON implements the json.Unmarshaller interface for type LogSearchRule. 2447func (l *LogSearchRule) UnmarshalJSON(data []byte) error { 2448 var rawMsg map[string]json.RawMessage 2449 if err := json.Unmarshal(data, &rawMsg); err != nil { 2450 return err 2451 } 2452 for key, val := range rawMsg { 2453 var err error 2454 switch key { 2455 case "action": 2456 l.Action, err = unmarshalActionClassification(val) 2457 delete(rawMsg, key) 2458 case "autoMitigate": 2459 err = unpopulate(val, &l.AutoMitigate) 2460 delete(rawMsg, key) 2461 case "createdWithApiVersion": 2462 err = unpopulate(val, &l.CreatedWithAPIVersion) 2463 delete(rawMsg, key) 2464 case "description": 2465 err = unpopulate(val, &l.Description) 2466 delete(rawMsg, key) 2467 case "displayName": 2468 err = unpopulate(val, &l.DisplayName) 2469 delete(rawMsg, key) 2470 case "enabled": 2471 err = unpopulate(val, &l.Enabled) 2472 delete(rawMsg, key) 2473 case "isLegacyLogAnalyticsRule": 2474 err = unpopulate(val, &l.IsLegacyLogAnalyticsRule) 2475 delete(rawMsg, key) 2476 case "lastUpdatedTime": 2477 var aux timeRFC3339 2478 err = unpopulate(val, &aux) 2479 l.LastUpdatedTime = (*time.Time)(&aux) 2480 delete(rawMsg, key) 2481 case "provisioningState": 2482 err = unpopulate(val, &l.ProvisioningState) 2483 delete(rawMsg, key) 2484 case "schedule": 2485 err = unpopulate(val, &l.Schedule) 2486 delete(rawMsg, key) 2487 case "source": 2488 err = unpopulate(val, &l.Source) 2489 delete(rawMsg, key) 2490 } 2491 if err != nil { 2492 return err 2493 } 2494 } 2495 return nil 2496} 2497 2498// LogSearchRulePatch - Log Search Rule Definition for Patching 2499type LogSearchRulePatch struct { 2500 // The flag which indicates whether the Log Search rule is enabled. Value should be true or false 2501 Enabled *Enabled `json:"enabled,omitempty"` 2502} 2503 2504// LogSearchRuleResource - The Log Search Rule resource. 2505type LogSearchRuleResource struct { 2506 TrackedEntityResource 2507 // REQUIRED; The rule properties of the resource. 2508 Properties *LogSearchRule `json:"properties,omitempty"` 2509} 2510 2511// MarshalJSON implements the json.Marshaller interface for type LogSearchRuleResource. 2512func (l LogSearchRuleResource) MarshalJSON() ([]byte, error) { 2513 objectMap := l.TrackedEntityResource.marshalInternal() 2514 populate(objectMap, "properties", l.Properties) 2515 return json.Marshal(objectMap) 2516} 2517 2518// LogSearchRuleResourceCollection - Represents a collection of Log Search rule resources. 2519type LogSearchRuleResourceCollection struct { 2520 // The values for the Log Search Rule resources. 2521 Value []*LogSearchRuleResource `json:"value,omitempty"` 2522} 2523 2524// MarshalJSON implements the json.Marshaller interface for type LogSearchRuleResourceCollection. 2525func (l LogSearchRuleResourceCollection) MarshalJSON() ([]byte, error) { 2526 objectMap := make(map[string]interface{}) 2527 populate(objectMap, "value", l.Value) 2528 return json.Marshal(objectMap) 2529} 2530 2531// LogSearchRuleResourcePatch - The log search rule resource for patch operations. 2532type LogSearchRuleResourcePatch struct { 2533 // The log search rule properties of the resource. 2534 Properties *LogSearchRulePatch `json:"properties,omitempty"` 2535 2536 // Resource tags 2537 Tags map[string]*string `json:"tags,omitempty"` 2538} 2539 2540// MarshalJSON implements the json.Marshaller interface for type LogSearchRuleResourcePatch. 2541func (l LogSearchRuleResourcePatch) MarshalJSON() ([]byte, error) { 2542 objectMap := make(map[string]interface{}) 2543 populate(objectMap, "properties", l.Properties) 2544 populate(objectMap, "tags", l.Tags) 2545 return json.Marshal(objectMap) 2546} 2547 2548// LogSettings - Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular log. 2549type LogSettings struct { 2550 // REQUIRED; a value indicating whether this log is enabled. 2551 Enabled *bool `json:"enabled,omitempty"` 2552 2553 // Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first 2554 // perform a GET diagnostic settings operation. 2555 Category *string `json:"category,omitempty"` 2556 2557 // the retention policy for this log. 2558 RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"` 2559} 2560 2561// LogToMetricAction - Specify action need to be taken when rule type is converting log to metric 2562type LogToMetricAction struct { 2563 Action 2564 // REQUIRED; Criteria of Metric 2565 Criteria []*Criteria `json:"criteria,omitempty"` 2566} 2567 2568// MarshalJSON implements the json.Marshaller interface for type LogToMetricAction. 2569func (l LogToMetricAction) MarshalJSON() ([]byte, error) { 2570 objectMap := l.Action.marshalInternal("Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction") 2571 populate(objectMap, "criteria", l.Criteria) 2572 return json.Marshal(objectMap) 2573} 2574 2575// UnmarshalJSON implements the json.Unmarshaller interface for type LogToMetricAction. 2576func (l *LogToMetricAction) UnmarshalJSON(data []byte) error { 2577 var rawMsg map[string]json.RawMessage 2578 if err := json.Unmarshal(data, &rawMsg); err != nil { 2579 return err 2580 } 2581 for key, val := range rawMsg { 2582 var err error 2583 switch key { 2584 case "criteria": 2585 err = unpopulate(val, &l.Criteria) 2586 delete(rawMsg, key) 2587 } 2588 if err != nil { 2589 return err 2590 } 2591 } 2592 return l.Action.unmarshalInternal(rawMsg) 2593} 2594 2595// LogicAppReceiver - A logic app receiver. 2596type LogicAppReceiver struct { 2597 // REQUIRED; The callback url where http request sent to. 2598 CallbackURL *string `json:"callbackUrl,omitempty"` 2599 2600 // REQUIRED; The name of the logic app receiver. Names must be unique across all receivers within an action group. 2601 Name *string `json:"name,omitempty"` 2602 2603 // REQUIRED; The azure resource id of the logic app receiver. 2604 ResourceID *string `json:"resourceId,omitempty"` 2605 2606 // Indicates whether to use common alert schema. 2607 UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"` 2608} 2609 2610// LogsIngestionEndpointSpec - Definition of the endpoint used for ingesting logs. 2611type LogsIngestionEndpointSpec struct { 2612 // READ-ONLY; The endpoint. This property is READ-ONLY. 2613 Endpoint *string `json:"endpoint,omitempty" azure:"ro"` 2614} 2615 2616// ManagementEventAggregationCondition - How the data that is collected should be combined over time. 2617type ManagementEventAggregationCondition struct { 2618 // the condition operator. 2619 Operator *ConditionOperator `json:"operator,omitempty"` 2620 2621 // The threshold value that activates the alert. 2622 Threshold *float64 `json:"threshold,omitempty"` 2623 2624 // the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified then it must be between 2625 // 5 minutes and 1 day. 2626 WindowSize *string `json:"windowSize,omitempty"` 2627} 2628 2629// ManagementEventRuleCondition - A management event rule condition. 2630type ManagementEventRuleCondition struct { 2631 RuleCondition 2632 // How the data that is collected should be combined over time and when the alert is activated. Note that for management event alerts aggregation is optional 2633 // – if it is not provided then any event will 2634 // cause the alert to activate. 2635 Aggregation *ManagementEventAggregationCondition `json:"aggregation,omitempty"` 2636} 2637 2638// MarshalJSON implements the json.Marshaller interface for type ManagementEventRuleCondition. 2639func (m ManagementEventRuleCondition) MarshalJSON() ([]byte, error) { 2640 objectMap := m.RuleCondition.marshalInternal("Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition") 2641 populate(objectMap, "aggregation", m.Aggregation) 2642 return json.Marshal(objectMap) 2643} 2644 2645// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementEventRuleCondition. 2646func (m *ManagementEventRuleCondition) UnmarshalJSON(data []byte) error { 2647 var rawMsg map[string]json.RawMessage 2648 if err := json.Unmarshal(data, &rawMsg); err != nil { 2649 return err 2650 } 2651 for key, val := range rawMsg { 2652 var err error 2653 switch key { 2654 case "aggregation": 2655 err = unpopulate(val, &m.Aggregation) 2656 delete(rawMsg, key) 2657 } 2658 if err != nil { 2659 return err 2660 } 2661 } 2662 return m.RuleCondition.unmarshalInternal(rawMsg) 2663} 2664 2665// MetadataValue - Represents a metric metadata value. 2666type MetadataValue struct { 2667 // the name of the metadata. 2668 Name *LocalizableString `json:"name,omitempty"` 2669 2670 // the value of the metadata. 2671 Value *string `json:"value,omitempty"` 2672} 2673 2674// Metric - The result data of a query. 2675type Metric struct { 2676 // REQUIRED; the metric Id. 2677 ID *string `json:"id,omitempty"` 2678 2679 // REQUIRED; the name and the display name of the metric, i.e. it is localizable string. 2680 Name *LocalizableString `json:"name,omitempty"` 2681 2682 // REQUIRED; the time series returned when a data query is performed. 2683 Timeseries []*TimeSeriesElement `json:"timeseries,omitempty"` 2684 2685 // REQUIRED; the resource type of the metric resource. 2686 Type *string `json:"type,omitempty"` 2687 2688 // REQUIRED; The unit of the metric. 2689 Unit *MetricUnit `json:"unit,omitempty"` 2690 2691 // Detailed description of this metric. 2692 DisplayDescription *string `json:"displayDescription,omitempty"` 2693 2694 // 'Success' or the error details on query failures for this metric. 2695 ErrorCode *string `json:"errorCode,omitempty"` 2696 2697 // Error message encountered querying this specific metric. 2698 ErrorMessage *string `json:"errorMessage,omitempty"` 2699} 2700 2701// MarshalJSON implements the json.Marshaller interface for type Metric. 2702func (m Metric) MarshalJSON() ([]byte, error) { 2703 objectMap := make(map[string]interface{}) 2704 populate(objectMap, "displayDescription", m.DisplayDescription) 2705 populate(objectMap, "errorCode", m.ErrorCode) 2706 populate(objectMap, "errorMessage", m.ErrorMessage) 2707 populate(objectMap, "id", m.ID) 2708 populate(objectMap, "name", m.Name) 2709 populate(objectMap, "timeseries", m.Timeseries) 2710 populate(objectMap, "type", m.Type) 2711 populate(objectMap, "unit", m.Unit) 2712 return json.Marshal(objectMap) 2713} 2714 2715// MetricAlertAction - An alert action. 2716type MetricAlertAction struct { 2717 // the id of the action group to use. 2718 ActionGroupID *string `json:"actionGroupId,omitempty"` 2719 2720 // This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook. 2721 WebHookProperties map[string]*string `json:"webHookProperties,omitempty"` 2722} 2723 2724// MarshalJSON implements the json.Marshaller interface for type MetricAlertAction. 2725func (m MetricAlertAction) MarshalJSON() ([]byte, error) { 2726 objectMap := make(map[string]interface{}) 2727 populate(objectMap, "actionGroupId", m.ActionGroupID) 2728 populate(objectMap, "webHookProperties", m.WebHookProperties) 2729 return json.Marshal(objectMap) 2730} 2731 2732// MetricAlertCriteriaClassification provides polymorphic access to related types. 2733// Call the interface's GetMetricAlertCriteria() method to access the common type. 2734// Use a type switch to determine the concrete type. The possible types are: 2735// - *MetricAlertCriteria, *MetricAlertMultipleResourceMultipleMetricCriteria, *MetricAlertSingleResourceMultipleMetricCriteria, 2736// - *WebtestLocationAvailabilityCriteria 2737type MetricAlertCriteriaClassification interface { 2738 // GetMetricAlertCriteria returns the MetricAlertCriteria content of the underlying type. 2739 GetMetricAlertCriteria() *MetricAlertCriteria 2740} 2741 2742// MetricAlertCriteria - The rule criteria that defines the conditions of the alert rule. 2743type MetricAlertCriteria struct { 2744 // REQUIRED; specifies the type of the alert criteria. 2745 OdataType *Odatatype `json:"odata.type,omitempty"` 2746 2747 // OPTIONAL; Contains additional key/value pairs not defined in the schema. 2748 AdditionalProperties map[string]map[string]interface{} 2749} 2750 2751// GetMetricAlertCriteria implements the MetricAlertCriteriaClassification interface for type MetricAlertCriteria. 2752func (m *MetricAlertCriteria) GetMetricAlertCriteria() *MetricAlertCriteria { return m } 2753 2754// UnmarshalJSON implements the json.Unmarshaller interface for type MetricAlertCriteria. 2755func (m *MetricAlertCriteria) UnmarshalJSON(data []byte) error { 2756 var rawMsg map[string]json.RawMessage 2757 if err := json.Unmarshal(data, &rawMsg); err != nil { 2758 return err 2759 } 2760 return m.unmarshalInternal(rawMsg) 2761} 2762 2763func (m MetricAlertCriteria) marshalInternal(discValue Odatatype) map[string]interface{} { 2764 objectMap := make(map[string]interface{}) 2765 m.OdataType = &discValue 2766 objectMap["odata.type"] = m.OdataType 2767 if m.AdditionalProperties != nil { 2768 for key, val := range m.AdditionalProperties { 2769 objectMap[key] = val 2770 } 2771 } 2772 return objectMap 2773} 2774 2775func (m *MetricAlertCriteria) unmarshalInternal(rawMsg map[string]json.RawMessage) error { 2776 for key, val := range rawMsg { 2777 var err error 2778 switch key { 2779 case "odata.type": 2780 err = unpopulate(val, &m.OdataType) 2781 delete(rawMsg, key) 2782 default: 2783 if m.AdditionalProperties == nil { 2784 m.AdditionalProperties = map[string]map[string]interface{}{} 2785 } 2786 if val != nil { 2787 var aux map[string]interface{} 2788 err = json.Unmarshal(val, &aux) 2789 m.AdditionalProperties[key] = aux 2790 } 2791 delete(rawMsg, key) 2792 } 2793 if err != nil { 2794 return err 2795 } 2796 } 2797 return nil 2798} 2799 2800// MetricAlertMultipleResourceMultipleMetricCriteria - Specifies the metric alert criteria for multiple resource that has multiple metric criteria. 2801type MetricAlertMultipleResourceMultipleMetricCriteria struct { 2802 MetricAlertCriteria 2803 // the list of multiple metric criteria for this 'all of' operation. 2804 AllOf []MultiMetricCriteriaClassification `json:"allOf,omitempty"` 2805} 2806 2807// MarshalJSON implements the json.Marshaller interface for type MetricAlertMultipleResourceMultipleMetricCriteria. 2808func (m MetricAlertMultipleResourceMultipleMetricCriteria) MarshalJSON() ([]byte, error) { 2809 objectMap := m.MetricAlertCriteria.marshalInternal(OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria) 2810 populate(objectMap, "allOf", m.AllOf) 2811 return json.Marshal(objectMap) 2812} 2813 2814// UnmarshalJSON implements the json.Unmarshaller interface for type MetricAlertMultipleResourceMultipleMetricCriteria. 2815func (m *MetricAlertMultipleResourceMultipleMetricCriteria) UnmarshalJSON(data []byte) error { 2816 var rawMsg map[string]json.RawMessage 2817 if err := json.Unmarshal(data, &rawMsg); err != nil { 2818 return err 2819 } 2820 for key, val := range rawMsg { 2821 var err error 2822 switch key { 2823 case "allOf": 2824 m.AllOf, err = unmarshalMultiMetricCriteriaClassificationArray(val) 2825 delete(rawMsg, key) 2826 } 2827 if err != nil { 2828 return err 2829 } 2830 } 2831 return m.MetricAlertCriteria.unmarshalInternal(rawMsg) 2832} 2833 2834// MetricAlertProperties - An alert rule. 2835type MetricAlertProperties struct { 2836 // REQUIRED; defines the specific alert criteria information. 2837 Criteria MetricAlertCriteriaClassification `json:"criteria,omitempty"` 2838 2839 // REQUIRED; the flag that indicates whether the metric alert is enabled. 2840 Enabled *bool `json:"enabled,omitempty"` 2841 2842 // REQUIRED; how often the metric alert is evaluated represented in ISO 8601 duration format. 2843 EvaluationFrequency *string `json:"evaluationFrequency,omitempty"` 2844 2845 // REQUIRED; the list of resource id's that this metric alert is scoped to. 2846 Scopes []*string `json:"scopes,omitempty"` 2847 2848 // REQUIRED; Alert severity {0, 1, 2, 3, 4} 2849 Severity *int32 `json:"severity,omitempty"` 2850 2851 // REQUIRED; the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. 2852 WindowSize *string `json:"windowSize,omitempty"` 2853 2854 // the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. 2855 Actions []*MetricAlertAction `json:"actions,omitempty"` 2856 2857 // the flag that indicates whether the alert should be auto resolved or not. The default is true. 2858 AutoMitigate *bool `json:"autoMitigate,omitempty"` 2859 2860 // the description of the metric alert that will be included in the alert email. 2861 Description *string `json:"description,omitempty"` 2862 2863 // the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than 2864 // one resource. 2865 TargetResourceRegion *string `json:"targetResourceRegion,omitempty"` 2866 2867 // the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or 2868 // more than one resource. 2869 TargetResourceType *string `json:"targetResourceType,omitempty"` 2870 2871 // READ-ONLY; the value indicating whether this alert rule is migrated. 2872 IsMigrated *bool `json:"isMigrated,omitempty" azure:"ro"` 2873 2874 // READ-ONLY; Last time the rule was updated in ISO8601 format. 2875 LastUpdatedTime *time.Time `json:"lastUpdatedTime,omitempty" azure:"ro"` 2876} 2877 2878// MarshalJSON implements the json.Marshaller interface for type MetricAlertProperties. 2879func (m MetricAlertProperties) MarshalJSON() ([]byte, error) { 2880 objectMap := make(map[string]interface{}) 2881 populate(objectMap, "actions", m.Actions) 2882 populate(objectMap, "autoMitigate", m.AutoMitigate) 2883 populate(objectMap, "criteria", m.Criteria) 2884 populate(objectMap, "description", m.Description) 2885 populate(objectMap, "enabled", m.Enabled) 2886 populate(objectMap, "evaluationFrequency", m.EvaluationFrequency) 2887 populate(objectMap, "isMigrated", m.IsMigrated) 2888 populate(objectMap, "lastUpdatedTime", (*timeRFC3339)(m.LastUpdatedTime)) 2889 populate(objectMap, "scopes", m.Scopes) 2890 populate(objectMap, "severity", m.Severity) 2891 populate(objectMap, "targetResourceRegion", m.TargetResourceRegion) 2892 populate(objectMap, "targetResourceType", m.TargetResourceType) 2893 populate(objectMap, "windowSize", m.WindowSize) 2894 return json.Marshal(objectMap) 2895} 2896 2897// UnmarshalJSON implements the json.Unmarshaller interface for type MetricAlertProperties. 2898func (m *MetricAlertProperties) UnmarshalJSON(data []byte) error { 2899 var rawMsg map[string]json.RawMessage 2900 if err := json.Unmarshal(data, &rawMsg); err != nil { 2901 return err 2902 } 2903 for key, val := range rawMsg { 2904 var err error 2905 switch key { 2906 case "actions": 2907 err = unpopulate(val, &m.Actions) 2908 delete(rawMsg, key) 2909 case "autoMitigate": 2910 err = unpopulate(val, &m.AutoMitigate) 2911 delete(rawMsg, key) 2912 case "criteria": 2913 m.Criteria, err = unmarshalMetricAlertCriteriaClassification(val) 2914 delete(rawMsg, key) 2915 case "description": 2916 err = unpopulate(val, &m.Description) 2917 delete(rawMsg, key) 2918 case "enabled": 2919 err = unpopulate(val, &m.Enabled) 2920 delete(rawMsg, key) 2921 case "evaluationFrequency": 2922 err = unpopulate(val, &m.EvaluationFrequency) 2923 delete(rawMsg, key) 2924 case "isMigrated": 2925 err = unpopulate(val, &m.IsMigrated) 2926 delete(rawMsg, key) 2927 case "lastUpdatedTime": 2928 var aux timeRFC3339 2929 err = unpopulate(val, &aux) 2930 m.LastUpdatedTime = (*time.Time)(&aux) 2931 delete(rawMsg, key) 2932 case "scopes": 2933 err = unpopulate(val, &m.Scopes) 2934 delete(rawMsg, key) 2935 case "severity": 2936 err = unpopulate(val, &m.Severity) 2937 delete(rawMsg, key) 2938 case "targetResourceRegion": 2939 err = unpopulate(val, &m.TargetResourceRegion) 2940 delete(rawMsg, key) 2941 case "targetResourceType": 2942 err = unpopulate(val, &m.TargetResourceType) 2943 delete(rawMsg, key) 2944 case "windowSize": 2945 err = unpopulate(val, &m.WindowSize) 2946 delete(rawMsg, key) 2947 } 2948 if err != nil { 2949 return err 2950 } 2951 } 2952 return nil 2953} 2954 2955// MetricAlertPropertiesPatch - An alert rule properties for patch. 2956type MetricAlertPropertiesPatch struct { 2957 // the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. 2958 Actions []*MetricAlertAction `json:"actions,omitempty"` 2959 2960 // the flag that indicates whether the alert should be auto resolved or not. The default is true. 2961 AutoMitigate *bool `json:"autoMitigate,omitempty"` 2962 2963 // defines the specific alert criteria information. 2964 Criteria MetricAlertCriteriaClassification `json:"criteria,omitempty"` 2965 2966 // the description of the metric alert that will be included in the alert email. 2967 Description *string `json:"description,omitempty"` 2968 2969 // the flag that indicates whether the metric alert is enabled. 2970 Enabled *bool `json:"enabled,omitempty"` 2971 2972 // how often the metric alert is evaluated represented in ISO 8601 duration format. 2973 EvaluationFrequency *string `json:"evaluationFrequency,omitempty"` 2974 2975 // the list of resource id's that this metric alert is scoped to. 2976 Scopes []*string `json:"scopes,omitempty"` 2977 2978 // Alert severity {0, 1, 2, 3, 4} 2979 Severity *int32 `json:"severity,omitempty"` 2980 2981 // the region of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. 2982 TargetResourceRegion *string `json:"targetResourceRegion,omitempty"` 2983 2984 // the resource type of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. 2985 TargetResourceType *string `json:"targetResourceType,omitempty"` 2986 2987 // the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. 2988 WindowSize *string `json:"windowSize,omitempty"` 2989 2990 // READ-ONLY; the value indicating whether this alert rule is migrated. 2991 IsMigrated *bool `json:"isMigrated,omitempty" azure:"ro"` 2992 2993 // READ-ONLY; Last time the rule was updated in ISO8601 format. 2994 LastUpdatedTime *time.Time `json:"lastUpdatedTime,omitempty" azure:"ro"` 2995} 2996 2997// MarshalJSON implements the json.Marshaller interface for type MetricAlertPropertiesPatch. 2998func (m MetricAlertPropertiesPatch) MarshalJSON() ([]byte, error) { 2999 objectMap := make(map[string]interface{}) 3000 populate(objectMap, "actions", m.Actions) 3001 populate(objectMap, "autoMitigate", m.AutoMitigate) 3002 populate(objectMap, "criteria", m.Criteria) 3003 populate(objectMap, "description", m.Description) 3004 populate(objectMap, "enabled", m.Enabled) 3005 populate(objectMap, "evaluationFrequency", m.EvaluationFrequency) 3006 populate(objectMap, "isMigrated", m.IsMigrated) 3007 populate(objectMap, "lastUpdatedTime", (*timeRFC3339)(m.LastUpdatedTime)) 3008 populate(objectMap, "scopes", m.Scopes) 3009 populate(objectMap, "severity", m.Severity) 3010 populate(objectMap, "targetResourceRegion", m.TargetResourceRegion) 3011 populate(objectMap, "targetResourceType", m.TargetResourceType) 3012 populate(objectMap, "windowSize", m.WindowSize) 3013 return json.Marshal(objectMap) 3014} 3015 3016// UnmarshalJSON implements the json.Unmarshaller interface for type MetricAlertPropertiesPatch. 3017func (m *MetricAlertPropertiesPatch) UnmarshalJSON(data []byte) error { 3018 var rawMsg map[string]json.RawMessage 3019 if err := json.Unmarshal(data, &rawMsg); err != nil { 3020 return err 3021 } 3022 for key, val := range rawMsg { 3023 var err error 3024 switch key { 3025 case "actions": 3026 err = unpopulate(val, &m.Actions) 3027 delete(rawMsg, key) 3028 case "autoMitigate": 3029 err = unpopulate(val, &m.AutoMitigate) 3030 delete(rawMsg, key) 3031 case "criteria": 3032 m.Criteria, err = unmarshalMetricAlertCriteriaClassification(val) 3033 delete(rawMsg, key) 3034 case "description": 3035 err = unpopulate(val, &m.Description) 3036 delete(rawMsg, key) 3037 case "enabled": 3038 err = unpopulate(val, &m.Enabled) 3039 delete(rawMsg, key) 3040 case "evaluationFrequency": 3041 err = unpopulate(val, &m.EvaluationFrequency) 3042 delete(rawMsg, key) 3043 case "isMigrated": 3044 err = unpopulate(val, &m.IsMigrated) 3045 delete(rawMsg, key) 3046 case "lastUpdatedTime": 3047 var aux timeRFC3339 3048 err = unpopulate(val, &aux) 3049 m.LastUpdatedTime = (*time.Time)(&aux) 3050 delete(rawMsg, key) 3051 case "scopes": 3052 err = unpopulate(val, &m.Scopes) 3053 delete(rawMsg, key) 3054 case "severity": 3055 err = unpopulate(val, &m.Severity) 3056 delete(rawMsg, key) 3057 case "targetResourceRegion": 3058 err = unpopulate(val, &m.TargetResourceRegion) 3059 delete(rawMsg, key) 3060 case "targetResourceType": 3061 err = unpopulate(val, &m.TargetResourceType) 3062 delete(rawMsg, key) 3063 case "windowSize": 3064 err = unpopulate(val, &m.WindowSize) 3065 delete(rawMsg, key) 3066 } 3067 if err != nil { 3068 return err 3069 } 3070 } 3071 return nil 3072} 3073 3074// MetricAlertResource - The metric alert resource. 3075type MetricAlertResource struct { 3076 Resource 3077 // REQUIRED; The alert rule properties of the resource. 3078 Properties *MetricAlertProperties `json:"properties,omitempty"` 3079} 3080 3081// MarshalJSON implements the json.Marshaller interface for type MetricAlertResource. 3082func (m MetricAlertResource) MarshalJSON() ([]byte, error) { 3083 objectMap := m.Resource.marshalInternal() 3084 populate(objectMap, "properties", m.Properties) 3085 return json.Marshal(objectMap) 3086} 3087 3088// MetricAlertResourceCollection - Represents a collection of alert rule resources. 3089type MetricAlertResourceCollection struct { 3090 // the values for the alert rule resources. 3091 Value []*MetricAlertResource `json:"value,omitempty"` 3092} 3093 3094// MarshalJSON implements the json.Marshaller interface for type MetricAlertResourceCollection. 3095func (m MetricAlertResourceCollection) MarshalJSON() ([]byte, error) { 3096 objectMap := make(map[string]interface{}) 3097 populate(objectMap, "value", m.Value) 3098 return json.Marshal(objectMap) 3099} 3100 3101// MetricAlertResourcePatch - The metric alert resource for patch operations. 3102type MetricAlertResourcePatch struct { 3103 // The alert rule properties of the resource. 3104 Properties *MetricAlertPropertiesPatch `json:"properties,omitempty"` 3105 3106 // Resource tags 3107 Tags map[string]*string `json:"tags,omitempty"` 3108} 3109 3110// MarshalJSON implements the json.Marshaller interface for type MetricAlertResourcePatch. 3111func (m MetricAlertResourcePatch) MarshalJSON() ([]byte, error) { 3112 objectMap := make(map[string]interface{}) 3113 populate(objectMap, "properties", m.Properties) 3114 populate(objectMap, "tags", m.Tags) 3115 return json.Marshal(objectMap) 3116} 3117 3118// MetricAlertSingleResourceMultipleMetricCriteria - Specifies the metric alert criteria for a single resource that has multiple metric criteria. 3119type MetricAlertSingleResourceMultipleMetricCriteria struct { 3120 MetricAlertCriteria 3121 // The list of metric criteria for this 'all of' operation. 3122 AllOf []*MetricCriteria `json:"allOf,omitempty"` 3123} 3124 3125// MarshalJSON implements the json.Marshaller interface for type MetricAlertSingleResourceMultipleMetricCriteria. 3126func (m MetricAlertSingleResourceMultipleMetricCriteria) MarshalJSON() ([]byte, error) { 3127 objectMap := m.MetricAlertCriteria.marshalInternal(OdatatypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria) 3128 populate(objectMap, "allOf", m.AllOf) 3129 return json.Marshal(objectMap) 3130} 3131 3132// UnmarshalJSON implements the json.Unmarshaller interface for type MetricAlertSingleResourceMultipleMetricCriteria. 3133func (m *MetricAlertSingleResourceMultipleMetricCriteria) UnmarshalJSON(data []byte) error { 3134 var rawMsg map[string]json.RawMessage 3135 if err := json.Unmarshal(data, &rawMsg); err != nil { 3136 return err 3137 } 3138 for key, val := range rawMsg { 3139 var err error 3140 switch key { 3141 case "allOf": 3142 err = unpopulate(val, &m.AllOf) 3143 delete(rawMsg, key) 3144 } 3145 if err != nil { 3146 return err 3147 } 3148 } 3149 return m.MetricAlertCriteria.unmarshalInternal(rawMsg) 3150} 3151 3152// MetricAlertStatus - An alert status. 3153type MetricAlertStatus struct { 3154 // The alert rule arm id. 3155 ID *string `json:"id,omitempty"` 3156 3157 // The status name. 3158 Name *string `json:"name,omitempty"` 3159 3160 // The alert status properties of the metric alert status. 3161 Properties *MetricAlertStatusProperties `json:"properties,omitempty"` 3162 3163 // The extended resource type name. 3164 Type *string `json:"type,omitempty"` 3165} 3166 3167// MetricAlertStatusCollection - Represents a collection of alert rule resources. 3168type MetricAlertStatusCollection struct { 3169 // the values for the alert rule resources. 3170 Value []*MetricAlertStatus `json:"value,omitempty"` 3171} 3172 3173// MarshalJSON implements the json.Marshaller interface for type MetricAlertStatusCollection. 3174func (m MetricAlertStatusCollection) MarshalJSON() ([]byte, error) { 3175 objectMap := make(map[string]interface{}) 3176 populate(objectMap, "value", m.Value) 3177 return json.Marshal(objectMap) 3178} 3179 3180// MetricAlertStatusProperties - An alert status properties. 3181type MetricAlertStatusProperties struct { 3182 // An object describing the type of the dimensions. 3183 Dimensions map[string]*string `json:"dimensions,omitempty"` 3184 3185 // status value 3186 Status *string `json:"status,omitempty"` 3187 3188 // UTC time when the status was checked. 3189 Timestamp *time.Time `json:"timestamp,omitempty"` 3190} 3191 3192// MarshalJSON implements the json.Marshaller interface for type MetricAlertStatusProperties. 3193func (m MetricAlertStatusProperties) MarshalJSON() ([]byte, error) { 3194 objectMap := make(map[string]interface{}) 3195 populate(objectMap, "dimensions", m.Dimensions) 3196 populate(objectMap, "status", m.Status) 3197 populate(objectMap, "timestamp", (*timeRFC3339)(m.Timestamp)) 3198 return json.Marshal(objectMap) 3199} 3200 3201// UnmarshalJSON implements the json.Unmarshaller interface for type MetricAlertStatusProperties. 3202func (m *MetricAlertStatusProperties) UnmarshalJSON(data []byte) error { 3203 var rawMsg map[string]json.RawMessage 3204 if err := json.Unmarshal(data, &rawMsg); err != nil { 3205 return err 3206 } 3207 for key, val := range rawMsg { 3208 var err error 3209 switch key { 3210 case "dimensions": 3211 err = unpopulate(val, &m.Dimensions) 3212 delete(rawMsg, key) 3213 case "status": 3214 err = unpopulate(val, &m.Status) 3215 delete(rawMsg, key) 3216 case "timestamp": 3217 var aux timeRFC3339 3218 err = unpopulate(val, &aux) 3219 m.Timestamp = (*time.Time)(&aux) 3220 delete(rawMsg, key) 3221 } 3222 if err != nil { 3223 return err 3224 } 3225 } 3226 return nil 3227} 3228 3229// MetricAlertsCreateOrUpdateOptions contains the optional parameters for the MetricAlerts.CreateOrUpdate method. 3230type MetricAlertsCreateOrUpdateOptions struct { 3231 // placeholder for future optional parameters 3232} 3233 3234// MetricAlertsDeleteOptions contains the optional parameters for the MetricAlerts.Delete method. 3235type MetricAlertsDeleteOptions struct { 3236 // placeholder for future optional parameters 3237} 3238 3239// MetricAlertsGetOptions contains the optional parameters for the MetricAlerts.Get method. 3240type MetricAlertsGetOptions struct { 3241 // placeholder for future optional parameters 3242} 3243 3244// MetricAlertsListByResourceGroupOptions contains the optional parameters for the MetricAlerts.ListByResourceGroup method. 3245type MetricAlertsListByResourceGroupOptions struct { 3246 // placeholder for future optional parameters 3247} 3248 3249// MetricAlertsListBySubscriptionOptions contains the optional parameters for the MetricAlerts.ListBySubscription method. 3250type MetricAlertsListBySubscriptionOptions struct { 3251 // placeholder for future optional parameters 3252} 3253 3254// MetricAlertsStatusListByNameOptions contains the optional parameters for the MetricAlertsStatus.ListByName method. 3255type MetricAlertsStatusListByNameOptions struct { 3256 // placeholder for future optional parameters 3257} 3258 3259// MetricAlertsStatusListOptions contains the optional parameters for the MetricAlertsStatus.List method. 3260type MetricAlertsStatusListOptions struct { 3261 // placeholder for future optional parameters 3262} 3263 3264// MetricAlertsUpdateOptions contains the optional parameters for the MetricAlerts.Update method. 3265type MetricAlertsUpdateOptions struct { 3266 // placeholder for future optional parameters 3267} 3268 3269// MetricAvailability - Metric availability specifies the time grain (aggregation interval or frequency) and the retention period for that time grain. 3270type MetricAvailability struct { 3271 // the retention period for the metric at the specified timegrain. Expressed as a duration 'PT1M', 'P1D', etc. 3272 Retention *string `json:"retention,omitempty"` 3273 3274 // the time grain specifies the aggregation interval for the metric. Expressed as a duration 'PT1M', 'P1D', etc. 3275 TimeGrain *string `json:"timeGrain,omitempty"` 3276} 3277 3278// MetricBaselinesProperties - The response to a metric baselines query. 3279type MetricBaselinesProperties struct { 3280 // REQUIRED; The baseline for each time series that was queried. 3281 Baselines []*TimeSeriesBaseline `json:"baselines,omitempty"` 3282 3283 // REQUIRED; The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned back from what was originally 3284 // requested. This is not present if a metadata request 3285 // was made. 3286 Interval *string `json:"interval,omitempty"` 3287 3288 // REQUIRED; The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by '/'. This may be adjusted in 3289 // the future and returned back from what was originally 3290 // requested. 3291 Timespan *string `json:"timespan,omitempty"` 3292 3293 // The namespace of the metrics been queried. 3294 Namespace *string `json:"namespace,omitempty"` 3295} 3296 3297// MarshalJSON implements the json.Marshaller interface for type MetricBaselinesProperties. 3298func (m MetricBaselinesProperties) MarshalJSON() ([]byte, error) { 3299 objectMap := make(map[string]interface{}) 3300 populate(objectMap, "baselines", m.Baselines) 3301 populate(objectMap, "interval", m.Interval) 3302 populate(objectMap, "namespace", m.Namespace) 3303 populate(objectMap, "timespan", m.Timespan) 3304 return json.Marshal(objectMap) 3305} 3306 3307// MetricBaselinesResponse - A list of metric baselines. 3308type MetricBaselinesResponse struct { 3309 // The list of metric baselines. 3310 Value []*SingleMetricBaseline `json:"value,omitempty"` 3311} 3312 3313// MarshalJSON implements the json.Marshaller interface for type MetricBaselinesResponse. 3314func (m MetricBaselinesResponse) MarshalJSON() ([]byte, error) { 3315 objectMap := make(map[string]interface{}) 3316 populate(objectMap, "value", m.Value) 3317 return json.Marshal(objectMap) 3318} 3319 3320// MetricCriteria - Criterion to filter metrics. 3321type MetricCriteria struct { 3322 MultiMetricCriteria 3323 // REQUIRED; the criteria operator. 3324 Operator *Operator `json:"operator,omitempty"` 3325 3326 // REQUIRED; the criteria threshold value that activates the alert. 3327 Threshold *float64 `json:"threshold,omitempty"` 3328} 3329 3330// MarshalJSON implements the json.Marshaller interface for type MetricCriteria. 3331func (m MetricCriteria) MarshalJSON() ([]byte, error) { 3332 objectMap := m.MultiMetricCriteria.marshalInternal(CriterionTypeStaticThresholdCriterion) 3333 populate(objectMap, "operator", m.Operator) 3334 populate(objectMap, "threshold", m.Threshold) 3335 return json.Marshal(objectMap) 3336} 3337 3338// UnmarshalJSON implements the json.Unmarshaller interface for type MetricCriteria. 3339func (m *MetricCriteria) UnmarshalJSON(data []byte) error { 3340 var rawMsg map[string]json.RawMessage 3341 if err := json.Unmarshal(data, &rawMsg); err != nil { 3342 return err 3343 } 3344 for key, val := range rawMsg { 3345 var err error 3346 switch key { 3347 case "operator": 3348 err = unpopulate(val, &m.Operator) 3349 delete(rawMsg, key) 3350 case "threshold": 3351 err = unpopulate(val, &m.Threshold) 3352 delete(rawMsg, key) 3353 } 3354 if err != nil { 3355 return err 3356 } 3357 } 3358 return m.MultiMetricCriteria.unmarshalInternal(rawMsg) 3359} 3360 3361// MetricDefinition - Metric definition class specifies the metadata for a metric. 3362type MetricDefinition struct { 3363 // Custom category name for this metric. 3364 Category *string `json:"category,omitempty"` 3365 3366 // the name and the display name of the dimension, i.e. it is a localizable string. 3367 Dimensions []*LocalizableString `json:"dimensions,omitempty"` 3368 3369 // Detailed description of this metric. 3370 DisplayDescription *string `json:"displayDescription,omitempty"` 3371 3372 // the resource identifier of the metric definition. 3373 ID *string `json:"id,omitempty"` 3374 3375 // Flag to indicate whether the dimension is required. 3376 IsDimensionRequired *bool `json:"isDimensionRequired,omitempty"` 3377 3378 // the collection of what aggregation intervals are available to be queried. 3379 MetricAvailabilities []*MetricAvailability `json:"metricAvailabilities,omitempty"` 3380 3381 // The class of the metric. 3382 MetricClass *MetricClass `json:"metricClass,omitempty"` 3383 3384 // the name and the display name of the metric, i.e. it is a localizable string. 3385 Name *LocalizableString `json:"name,omitempty"` 3386 3387 // the namespace the metric belongs to. 3388 Namespace *string `json:"namespace,omitempty"` 3389 3390 // the primary aggregation type value defining how to use the values for display. 3391 PrimaryAggregationType *AggregationType `json:"primaryAggregationType,omitempty"` 3392 3393 // the resource identifier of the resource that emitted the metric. 3394 ResourceID *string `json:"resourceId,omitempty"` 3395 3396 // the collection of what aggregation types are supported. 3397 SupportedAggregationTypes []*AggregationType `json:"supportedAggregationTypes,omitempty"` 3398 3399 // The unit of the metric. 3400 Unit *MetricUnit `json:"unit,omitempty"` 3401} 3402 3403// MarshalJSON implements the json.Marshaller interface for type MetricDefinition. 3404func (m MetricDefinition) MarshalJSON() ([]byte, error) { 3405 objectMap := make(map[string]interface{}) 3406 populate(objectMap, "category", m.Category) 3407 populate(objectMap, "dimensions", m.Dimensions) 3408 populate(objectMap, "displayDescription", m.DisplayDescription) 3409 populate(objectMap, "id", m.ID) 3410 populate(objectMap, "isDimensionRequired", m.IsDimensionRequired) 3411 populate(objectMap, "metricAvailabilities", m.MetricAvailabilities) 3412 populate(objectMap, "metricClass", m.MetricClass) 3413 populate(objectMap, "name", m.Name) 3414 populate(objectMap, "namespace", m.Namespace) 3415 populate(objectMap, "primaryAggregationType", m.PrimaryAggregationType) 3416 populate(objectMap, "resourceId", m.ResourceID) 3417 populate(objectMap, "supportedAggregationTypes", m.SupportedAggregationTypes) 3418 populate(objectMap, "unit", m.Unit) 3419 return json.Marshal(objectMap) 3420} 3421 3422// MetricDefinitionCollection - Represents collection of metric definitions. 3423type MetricDefinitionCollection struct { 3424 // REQUIRED; the values for the metric definitions. 3425 Value []*MetricDefinition `json:"value,omitempty"` 3426} 3427 3428// MarshalJSON implements the json.Marshaller interface for type MetricDefinitionCollection. 3429func (m MetricDefinitionCollection) MarshalJSON() ([]byte, error) { 3430 objectMap := make(map[string]interface{}) 3431 populate(objectMap, "value", m.Value) 3432 return json.Marshal(objectMap) 3433} 3434 3435// MetricDefinitionsListOptions contains the optional parameters for the MetricDefinitions.List method. 3436type MetricDefinitionsListOptions struct { 3437 // Metric namespace to query metric definitions for. 3438 Metricnamespace *string 3439} 3440 3441// MetricDimension - Specifies a metric dimension. 3442type MetricDimension struct { 3443 // REQUIRED; Name of the dimension. 3444 Name *string `json:"name,omitempty"` 3445 3446 // REQUIRED; the dimension operator. Only 'Include' and 'Exclude' are supported 3447 Operator *string `json:"operator,omitempty"` 3448 3449 // REQUIRED; list of dimension values. 3450 Values []*string `json:"values,omitempty"` 3451} 3452 3453// MarshalJSON implements the json.Marshaller interface for type MetricDimension. 3454func (m MetricDimension) MarshalJSON() ([]byte, error) { 3455 objectMap := make(map[string]interface{}) 3456 populate(objectMap, "name", m.Name) 3457 populate(objectMap, "operator", m.Operator) 3458 populate(objectMap, "values", m.Values) 3459 return json.Marshal(objectMap) 3460} 3461 3462// MetricNamespace - Metric namespace class specifies the metadata for a metric namespace. 3463type MetricNamespace struct { 3464 // Kind of namespace 3465 Classification *NamespaceClassification `json:"classification,omitempty"` 3466 3467 // The ID of the metric namespace. 3468 ID *string `json:"id,omitempty"` 3469 3470 // The escaped name of the namespace. 3471 Name *string `json:"name,omitempty"` 3472 3473 // Properties which include the fully qualified namespace name. 3474 Properties *MetricNamespaceName `json:"properties,omitempty"` 3475 3476 // The type of the namespace. 3477 Type *string `json:"type,omitempty"` 3478} 3479 3480// MetricNamespaceCollection - Represents collection of metric namespaces. 3481type MetricNamespaceCollection struct { 3482 // REQUIRED; The values for the metric namespaces. 3483 Value []*MetricNamespace `json:"value,omitempty"` 3484} 3485 3486// MarshalJSON implements the json.Marshaller interface for type MetricNamespaceCollection. 3487func (m MetricNamespaceCollection) MarshalJSON() ([]byte, error) { 3488 objectMap := make(map[string]interface{}) 3489 populate(objectMap, "value", m.Value) 3490 return json.Marshal(objectMap) 3491} 3492 3493// MetricNamespaceName - The fully qualified metric namespace name. 3494type MetricNamespaceName struct { 3495 // The metric namespace name. 3496 MetricNamespaceName *string `json:"metricNamespaceName,omitempty"` 3497} 3498 3499// MetricNamespacesListOptions contains the optional parameters for the MetricNamespaces.List method. 3500type MetricNamespacesListOptions struct { 3501 // The ISO 8601 conform Date start time from which to query for metric namespaces. 3502 StartTime *string 3503} 3504 3505// MetricSettings - Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular metric. 3506type MetricSettings struct { 3507 // REQUIRED; a value indicating whether this category is enabled. 3508 Enabled *bool `json:"enabled,omitempty"` 3509 3510 // Name of a Diagnostic Metric category for a resource type this setting is applied to. To obtain the list of Diagnostic metric categories for a resource, 3511 // first perform a GET diagnostic settings 3512 // operation. 3513 Category *string `json:"category,omitempty"` 3514 3515 // the retention policy for this category. 3516 RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"` 3517 3518 // the timegrain of the metric in ISO8601 format. 3519 TimeGrain *string `json:"timeGrain,omitempty"` 3520} 3521 3522// MetricSingleDimension - The metric dimension name and value. 3523type MetricSingleDimension struct { 3524 // REQUIRED; Name of the dimension. 3525 Name *string `json:"name,omitempty"` 3526 3527 // REQUIRED; Value of the dimension. 3528 Value *string `json:"value,omitempty"` 3529} 3530 3531// MetricTrigger - The trigger that results in a scaling action. 3532type MetricTrigger struct { 3533 // REQUIRED; the name of the metric that defines what the rule monitors. 3534 MetricName *string `json:"metricName,omitempty"` 3535 3536 // REQUIRED; the resource identifier of the resource the rule monitors. 3537 MetricResourceURI *string `json:"metricResourceUri,omitempty"` 3538 3539 // REQUIRED; the operator that is used to compare the metric data and the threshold. 3540 Operator *ComparisonOperationType `json:"operator,omitempty"` 3541 3542 // REQUIRED; the metric statistic type. How the metrics from multiple instances are combined. 3543 Statistic *MetricStatisticType `json:"statistic,omitempty"` 3544 3545 // REQUIRED; the threshold of the metric that triggers the scale action. 3546 Threshold *float64 `json:"threshold,omitempty"` 3547 3548 // REQUIRED; time aggregation type. How the data that is collected should be combined over time. The default value is Average. 3549 TimeAggregation *TimeAggregationType `json:"timeAggregation,omitempty"` 3550 3551 // REQUIRED; the granularity of metrics the rule monitors. Must be one of the predefined values returned from metric definitions for the metric. Must be 3552 // between 12 hours and 1 minute. 3553 TimeGrain *string `json:"timeGrain,omitempty"` 3554 3555 // REQUIRED; the range of time in which instance data is collected. This value must be greater than the delay in metric collection, which can vary from 3556 // resource-to-resource. Must be between 12 hours and 5 minutes. 3557 TimeWindow *string `json:"timeWindow,omitempty"` 3558 3559 // List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. 3560 Dimensions []*ScaleRuleMetricDimension `json:"dimensions,omitempty"` 3561 3562 // a value indicating whether metric should divide per instance. 3563 DividePerInstance *bool `json:"dividePerInstance,omitempty"` 3564 3565 // the namespace of the metric that defines what the rule monitors. 3566 MetricNamespace *string `json:"metricNamespace,omitempty"` 3567 3568 // the location of the resource the rule monitors. 3569 MetricResourceLocation *string `json:"metricResourceLocation,omitempty"` 3570} 3571 3572// MarshalJSON implements the json.Marshaller interface for type MetricTrigger. 3573func (m MetricTrigger) MarshalJSON() ([]byte, error) { 3574 objectMap := make(map[string]interface{}) 3575 populate(objectMap, "dimensions", m.Dimensions) 3576 populate(objectMap, "dividePerInstance", m.DividePerInstance) 3577 populate(objectMap, "metricName", m.MetricName) 3578 populate(objectMap, "metricNamespace", m.MetricNamespace) 3579 populate(objectMap, "metricResourceLocation", m.MetricResourceLocation) 3580 populate(objectMap, "metricResourceUri", m.MetricResourceURI) 3581 populate(objectMap, "operator", m.Operator) 3582 populate(objectMap, "statistic", m.Statistic) 3583 populate(objectMap, "threshold", m.Threshold) 3584 populate(objectMap, "timeAggregation", m.TimeAggregation) 3585 populate(objectMap, "timeGrain", m.TimeGrain) 3586 populate(objectMap, "timeWindow", m.TimeWindow) 3587 return json.Marshal(objectMap) 3588} 3589 3590// MetricValue - Represents a metric value. 3591type MetricValue struct { 3592 // REQUIRED; the timestamp for the metric value in ISO 8601 format. 3593 TimeStamp *time.Time `json:"timeStamp,omitempty"` 3594 3595 // the average value in the time range. 3596 Average *float64 `json:"average,omitempty"` 3597 3598 // the number of samples in the time range. Can be used to determine the number of values that contributed to the average value. 3599 Count *float64 `json:"count,omitempty"` 3600 3601 // the greatest value in the time range. 3602 Maximum *float64 `json:"maximum,omitempty"` 3603 3604 // the least value in the time range. 3605 Minimum *float64 `json:"minimum,omitempty"` 3606 3607 // the sum of all of the values in the time range. 3608 Total *float64 `json:"total,omitempty"` 3609} 3610 3611// MarshalJSON implements the json.Marshaller interface for type MetricValue. 3612func (m MetricValue) MarshalJSON() ([]byte, error) { 3613 objectMap := make(map[string]interface{}) 3614 populate(objectMap, "average", m.Average) 3615 populate(objectMap, "count", m.Count) 3616 populate(objectMap, "maximum", m.Maximum) 3617 populate(objectMap, "minimum", m.Minimum) 3618 populate(objectMap, "timeStamp", (*timeRFC3339)(m.TimeStamp)) 3619 populate(objectMap, "total", m.Total) 3620 return json.Marshal(objectMap) 3621} 3622 3623// UnmarshalJSON implements the json.Unmarshaller interface for type MetricValue. 3624func (m *MetricValue) UnmarshalJSON(data []byte) error { 3625 var rawMsg map[string]json.RawMessage 3626 if err := json.Unmarshal(data, &rawMsg); err != nil { 3627 return err 3628 } 3629 for key, val := range rawMsg { 3630 var err error 3631 switch key { 3632 case "average": 3633 err = unpopulate(val, &m.Average) 3634 delete(rawMsg, key) 3635 case "count": 3636 err = unpopulate(val, &m.Count) 3637 delete(rawMsg, key) 3638 case "maximum": 3639 err = unpopulate(val, &m.Maximum) 3640 delete(rawMsg, key) 3641 case "minimum": 3642 err = unpopulate(val, &m.Minimum) 3643 delete(rawMsg, key) 3644 case "timeStamp": 3645 var aux timeRFC3339 3646 err = unpopulate(val, &aux) 3647 m.TimeStamp = (*time.Time)(&aux) 3648 delete(rawMsg, key) 3649 case "total": 3650 err = unpopulate(val, &m.Total) 3651 delete(rawMsg, key) 3652 } 3653 if err != nil { 3654 return err 3655 } 3656 } 3657 return nil 3658} 3659 3660// MetricsListOptions contains the optional parameters for the Metrics.List method. 3661type MetricsListOptions struct { 3662 // The list of aggregation types (comma separated) to retrieve. 3663 Aggregation *string 3664 // The **$filter** is used to reduce the set of metric data returned. Example: Metric contains metadata A, B and C. - Return all time series of C where 3665 // A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' 3666 // or B = 'b2'** This is invalid because the logical or operator cannot separate two different metadata names. - Return all time series where A = a1, B 3667 // = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return all time series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. 3668 // Special case: When dimension name or dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using $filter= "dim 3669 // (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim (test) 3** and dimension value is **dim3 (test) val** 3670 // Instead of using $filter= "dim (test) 3 eq 'dim3 (test) val' " use **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "** 3671 Filter *string 3672 // The interval (i.e. timegrain) of the query. 3673 Interval *string 3674 // The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' 3675 // should be **'Metric%2Name1'** 3676 Metricnames *string 3677 // Metric namespace to query metric definitions for. 3678 Metricnamespace *string 3679 // The aggregation to use for sorting results and the direction of the sort. 3680 // Only one order can be specified. 3681 // Examples: sum asc. 3682 Orderby *string 3683 // Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details. 3684 ResultType *ResultType 3685 // The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'. 3686 Timespan *string 3687 // The maximum number of records to retrieve. 3688 // Valid only if $filter is specified. 3689 // Defaults to 10. 3690 Top *int32 3691} 3692 3693// MultiMetricCriteriaClassification provides polymorphic access to related types. 3694// Call the interface's GetMultiMetricCriteria() method to access the common type. 3695// Use a type switch to determine the concrete type. The possible types are: 3696// - *DynamicMetricCriteria, *MetricCriteria, *MultiMetricCriteria 3697type MultiMetricCriteriaClassification interface { 3698 // GetMultiMetricCriteria returns the MultiMetricCriteria content of the underlying type. 3699 GetMultiMetricCriteria() *MultiMetricCriteria 3700} 3701 3702// MultiMetricCriteria - The types of conditions for a multi resource alert. 3703type MultiMetricCriteria struct { 3704 // REQUIRED; Specifies the type of threshold criteria 3705 CriterionType *CriterionType `json:"criterionType,omitempty"` 3706 3707 // REQUIRED; Name of the metric. 3708 MetricName *string `json:"metricName,omitempty"` 3709 3710 // REQUIRED; Name of the criteria. 3711 Name *string `json:"name,omitempty"` 3712 3713 // REQUIRED; the criteria time aggregation types. 3714 TimeAggregation *AggregationTypeEnum `json:"timeAggregation,omitempty"` 3715 3716 // OPTIONAL; Contains additional key/value pairs not defined in the schema. 3717 AdditionalProperties map[string]map[string]interface{} 3718 3719 // List of dimension conditions. 3720 Dimensions []*MetricDimension `json:"dimensions,omitempty"` 3721 3722 // Namespace of the metric. 3723 MetricNamespace *string `json:"metricNamespace,omitempty"` 3724 3725 // Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped. 3726 SkipMetricValidation *bool `json:"skipMetricValidation,omitempty"` 3727} 3728 3729// GetMultiMetricCriteria implements the MultiMetricCriteriaClassification interface for type MultiMetricCriteria. 3730func (m *MultiMetricCriteria) GetMultiMetricCriteria() *MultiMetricCriteria { return m } 3731 3732// UnmarshalJSON implements the json.Unmarshaller interface for type MultiMetricCriteria. 3733func (m *MultiMetricCriteria) UnmarshalJSON(data []byte) error { 3734 var rawMsg map[string]json.RawMessage 3735 if err := json.Unmarshal(data, &rawMsg); err != nil { 3736 return err 3737 } 3738 return m.unmarshalInternal(rawMsg) 3739} 3740 3741func (m MultiMetricCriteria) marshalInternal(discValue CriterionType) map[string]interface{} { 3742 objectMap := make(map[string]interface{}) 3743 m.CriterionType = &discValue 3744 objectMap["criterionType"] = m.CriterionType 3745 populate(objectMap, "dimensions", m.Dimensions) 3746 populate(objectMap, "metricName", m.MetricName) 3747 populate(objectMap, "metricNamespace", m.MetricNamespace) 3748 populate(objectMap, "name", m.Name) 3749 populate(objectMap, "skipMetricValidation", m.SkipMetricValidation) 3750 populate(objectMap, "timeAggregation", m.TimeAggregation) 3751 if m.AdditionalProperties != nil { 3752 for key, val := range m.AdditionalProperties { 3753 objectMap[key] = val 3754 } 3755 } 3756 return objectMap 3757} 3758 3759func (m *MultiMetricCriteria) unmarshalInternal(rawMsg map[string]json.RawMessage) error { 3760 for key, val := range rawMsg { 3761 var err error 3762 switch key { 3763 case "criterionType": 3764 err = unpopulate(val, &m.CriterionType) 3765 delete(rawMsg, key) 3766 case "dimensions": 3767 err = unpopulate(val, &m.Dimensions) 3768 delete(rawMsg, key) 3769 case "metricName": 3770 err = unpopulate(val, &m.MetricName) 3771 delete(rawMsg, key) 3772 case "metricNamespace": 3773 err = unpopulate(val, &m.MetricNamespace) 3774 delete(rawMsg, key) 3775 case "name": 3776 err = unpopulate(val, &m.Name) 3777 delete(rawMsg, key) 3778 case "skipMetricValidation": 3779 err = unpopulate(val, &m.SkipMetricValidation) 3780 delete(rawMsg, key) 3781 case "timeAggregation": 3782 err = unpopulate(val, &m.TimeAggregation) 3783 delete(rawMsg, key) 3784 default: 3785 if m.AdditionalProperties == nil { 3786 m.AdditionalProperties = map[string]map[string]interface{}{} 3787 } 3788 if val != nil { 3789 var aux map[string]interface{} 3790 err = json.Unmarshal(val, &aux) 3791 m.AdditionalProperties[key] = aux 3792 } 3793 delete(rawMsg, key) 3794 } 3795 if err != nil { 3796 return err 3797 } 3798 } 3799 return nil 3800} 3801 3802// NetworkRuleSet - Definition of the network rules. 3803type NetworkRuleSet struct { 3804 // The configuration to set whether network access from public internet to the endpoints are allowed. 3805 PublicNetworkAccess *KnownPublicNetworkAccessOptions `json:"publicNetworkAccess,omitempty"` 3806} 3807 3808// Operation - Microsoft Insights API operation definition. 3809type Operation struct { 3810 // Display metadata associated with the operation. 3811 Display *OperationDisplay `json:"display,omitempty"` 3812 3813 // Operation name: {provider}/{resource}/{operation} 3814 Name *string `json:"name,omitempty"` 3815} 3816 3817// OperationDisplay - Display metadata associated with the operation. 3818type OperationDisplay struct { 3819 // Operation type: Read, write, delete, etc. 3820 Operation *string `json:"operation,omitempty"` 3821 3822 // Service provider: Microsoft.Insights 3823 Provider *string `json:"provider,omitempty"` 3824 3825 // Resource on which the operation is performed: AlertRules, Autoscale, etc. 3826 Resource *string `json:"resource,omitempty"` 3827} 3828 3829// OperationListResult - Result of the request to list Microsoft.Insights operations. It contains a list of operations and a URL link to get the next set 3830// of results. 3831type OperationListResult struct { 3832 // URL to get the next set of operation list results if there are any. 3833 NextLink *string `json:"nextLink,omitempty"` 3834 3835 // List of operations supported by the Microsoft.Insights provider. 3836 Value []*Operation `json:"value,omitempty"` 3837} 3838 3839// MarshalJSON implements the json.Marshaller interface for type OperationListResult. 3840func (o OperationListResult) MarshalJSON() ([]byte, error) { 3841 objectMap := make(map[string]interface{}) 3842 populate(objectMap, "nextLink", o.NextLink) 3843 populate(objectMap, "value", o.Value) 3844 return json.Marshal(objectMap) 3845} 3846 3847// OperationStatus - The status of operation. 3848type OperationStatus struct { 3849 // End time of the job in standard ISO8601 format. 3850 EndTime *time.Time `json:"endTime,omitempty"` 3851 3852 // The error detail of the operation if any. 3853 Error *ErrorResponseCommon `json:"error,omitempty"` 3854 3855 // The operation Id. 3856 ID *string `json:"id,omitempty"` 3857 3858 // The operation name. 3859 Name *string `json:"name,omitempty"` 3860 3861 // Start time of the job in standard ISO8601 format. 3862 StartTime *time.Time `json:"startTime,omitempty"` 3863 3864 // The status of the operation. 3865 Status *string `json:"status,omitempty"` 3866} 3867 3868// MarshalJSON implements the json.Marshaller interface for type OperationStatus. 3869func (o OperationStatus) MarshalJSON() ([]byte, error) { 3870 objectMap := make(map[string]interface{}) 3871 populate(objectMap, "endTime", (*timeRFC3339)(o.EndTime)) 3872 populate(objectMap, "error", o.Error) 3873 populate(objectMap, "id", o.ID) 3874 populate(objectMap, "name", o.Name) 3875 populate(objectMap, "startTime", (*timeRFC3339)(o.StartTime)) 3876 populate(objectMap, "status", o.Status) 3877 return json.Marshal(objectMap) 3878} 3879 3880// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatus. 3881func (o *OperationStatus) UnmarshalJSON(data []byte) error { 3882 var rawMsg map[string]json.RawMessage 3883 if err := json.Unmarshal(data, &rawMsg); err != nil { 3884 return err 3885 } 3886 for key, val := range rawMsg { 3887 var err error 3888 switch key { 3889 case "endTime": 3890 var aux timeRFC3339 3891 err = unpopulate(val, &aux) 3892 o.EndTime = (*time.Time)(&aux) 3893 delete(rawMsg, key) 3894 case "error": 3895 err = unpopulate(val, &o.Error) 3896 delete(rawMsg, key) 3897 case "id": 3898 err = unpopulate(val, &o.ID) 3899 delete(rawMsg, key) 3900 case "name": 3901 err = unpopulate(val, &o.Name) 3902 delete(rawMsg, key) 3903 case "startTime": 3904 var aux timeRFC3339 3905 err = unpopulate(val, &aux) 3906 o.StartTime = (*time.Time)(&aux) 3907 delete(rawMsg, key) 3908 case "status": 3909 err = unpopulate(val, &o.Status) 3910 delete(rawMsg, key) 3911 } 3912 if err != nil { 3913 return err 3914 } 3915 } 3916 return nil 3917} 3918 3919// OperationsListOptions contains the optional parameters for the Operations.List method. 3920type OperationsListOptions struct { 3921 // placeholder for future optional parameters 3922} 3923 3924// PerfCounterDataSource - Definition of which performance counters will be collected and how they will be collected by this data collection rule. Collected 3925// from both Windows and Linux machines where the counter is present. 3926type PerfCounterDataSource struct { 3927 // A list of specifier names of the performance counters you want to collect. Use a wildcard (*) to collect a counter for all instances. To get a list of 3928 // performance counters on Windows, run the command 3929 // 'typeperf'. 3930 CounterSpecifiers []*string `json:"counterSpecifiers,omitempty"` 3931 3932 // A friendly name for the data source. This name should be unique across all data sources (regardless of type) within the data collection rule. 3933 Name *string `json:"name,omitempty"` 3934 3935 // The number of seconds between consecutive counter measurements (samples). 3936 SamplingFrequencyInSeconds *int32 `json:"samplingFrequencyInSeconds,omitempty"` 3937 3938 // List of streams that this data source will be sent to. A stream indicates what schema will be used for this data and usually what table in Log Analytics 3939 // the data will be sent to. 3940 Streams []*KnownPerfCounterDataSourceStreams `json:"streams,omitempty"` 3941} 3942 3943// MarshalJSON implements the json.Marshaller interface for type PerfCounterDataSource. 3944func (p PerfCounterDataSource) MarshalJSON() ([]byte, error) { 3945 objectMap := make(map[string]interface{}) 3946 populate(objectMap, "counterSpecifiers", p.CounterSpecifiers) 3947 populate(objectMap, "name", p.Name) 3948 populate(objectMap, "samplingFrequencyInSeconds", p.SamplingFrequencyInSeconds) 3949 populate(objectMap, "streams", p.Streams) 3950 return json.Marshal(objectMap) 3951} 3952 3953// PrivateEndpointConnection - A private endpoint connection 3954type PrivateEndpointConnection struct { 3955 ProxyResource 3956 // Resource properties. 3957 Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` 3958} 3959 3960// PrivateEndpointConnectionListResult - A list of private endpoint connections. 3961type PrivateEndpointConnectionListResult struct { 3962 // READ-ONLY; Link to retrieve next page of results. 3963 NextLink *string `json:"nextLink,omitempty" azure:"ro"` 3964 3965 // READ-ONLY; Array of results. 3966 Value []*PrivateEndpointConnection `json:"value,omitempty" azure:"ro"` 3967} 3968 3969// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. 3970func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { 3971 objectMap := make(map[string]interface{}) 3972 populate(objectMap, "nextLink", p.NextLink) 3973 populate(objectMap, "value", p.Value) 3974 return json.Marshal(objectMap) 3975} 3976 3977// PrivateEndpointConnectionProperties - Properties of a private endpoint connection. 3978type PrivateEndpointConnectionProperties struct { 3979 // Private endpoint which the connection belongs to. 3980 PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"` 3981 3982 // Connection state of the private endpoint connection. 3983 PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"` 3984 3985 // READ-ONLY; State of the private endpoint connection. 3986 ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` 3987} 3988 3989// PrivateEndpointConnectionsBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnections.BeginCreateOrUpdate method. 3990type PrivateEndpointConnectionsBeginCreateOrUpdateOptions struct { 3991 // placeholder for future optional parameters 3992} 3993 3994// PrivateEndpointConnectionsBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnections.BeginDelete method. 3995type PrivateEndpointConnectionsBeginDeleteOptions struct { 3996 // placeholder for future optional parameters 3997} 3998 3999// PrivateEndpointConnectionsGetOptions contains the optional parameters for the PrivateEndpointConnections.Get method. 4000type PrivateEndpointConnectionsGetOptions struct { 4001 // placeholder for future optional parameters 4002} 4003 4004// PrivateEndpointConnectionsListByPrivateLinkScopeOptions contains the optional parameters for the PrivateEndpointConnections.ListByPrivateLinkScope method. 4005type PrivateEndpointConnectionsListByPrivateLinkScopeOptions struct { 4006 // placeholder for future optional parameters 4007} 4008 4009// PrivateEndpointProperty - Private endpoint which the connection belongs to. 4010type PrivateEndpointProperty struct { 4011 // Resource id of the private endpoint. 4012 ID *string `json:"id,omitempty"` 4013} 4014 4015// PrivateLinkResource - A private link resource 4016type PrivateLinkResource struct { 4017 ProxyResource 4018 // Resource properties. 4019 Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` 4020} 4021 4022// PrivateLinkResourceListResult - A list of private link resources 4023type PrivateLinkResourceListResult struct { 4024 // READ-ONLY; Link to retrieve next page of results. 4025 NextLink *string `json:"nextLink,omitempty" azure:"ro"` 4026 4027 // READ-ONLY; Array of results. 4028 Value []*PrivateLinkResource `json:"value,omitempty" azure:"ro"` 4029} 4030 4031// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. 4032func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { 4033 objectMap := make(map[string]interface{}) 4034 populate(objectMap, "nextLink", p.NextLink) 4035 populate(objectMap, "value", p.Value) 4036 return json.Marshal(objectMap) 4037} 4038 4039// PrivateLinkResourceProperties - Properties of a private link resource. 4040type PrivateLinkResourceProperties struct { 4041 // READ-ONLY; The private link resource group id. 4042 GroupID *string `json:"groupId,omitempty" azure:"ro"` 4043 4044 // READ-ONLY; The private link resource required member names. 4045 RequiredMembers []*string `json:"requiredMembers,omitempty" azure:"ro"` 4046} 4047 4048// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. 4049func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { 4050 objectMap := make(map[string]interface{}) 4051 populate(objectMap, "groupId", p.GroupID) 4052 populate(objectMap, "requiredMembers", p.RequiredMembers) 4053 return json.Marshal(objectMap) 4054} 4055 4056// PrivateLinkResourcesGetOptions contains the optional parameters for the PrivateLinkResources.Get method. 4057type PrivateLinkResourcesGetOptions struct { 4058 // placeholder for future optional parameters 4059} 4060 4061// PrivateLinkResourcesListByPrivateLinkScopeOptions contains the optional parameters for the PrivateLinkResources.ListByPrivateLinkScope method. 4062type PrivateLinkResourcesListByPrivateLinkScopeOptions struct { 4063 // placeholder for future optional parameters 4064} 4065 4066// PrivateLinkScopeOperationStatusGetOptions contains the optional parameters for the PrivateLinkScopeOperationStatus.Get method. 4067type PrivateLinkScopeOperationStatusGetOptions struct { 4068 // placeholder for future optional parameters 4069} 4070 4071// PrivateLinkScopedResourcesBeginCreateOrUpdateOptions contains the optional parameters for the PrivateLinkScopedResources.BeginCreateOrUpdate method. 4072type PrivateLinkScopedResourcesBeginCreateOrUpdateOptions struct { 4073 // placeholder for future optional parameters 4074} 4075 4076// PrivateLinkScopedResourcesBeginDeleteOptions contains the optional parameters for the PrivateLinkScopedResources.BeginDelete method. 4077type PrivateLinkScopedResourcesBeginDeleteOptions struct { 4078 // placeholder for future optional parameters 4079} 4080 4081// PrivateLinkScopedResourcesGetOptions contains the optional parameters for the PrivateLinkScopedResources.Get method. 4082type PrivateLinkScopedResourcesGetOptions struct { 4083 // placeholder for future optional parameters 4084} 4085 4086// PrivateLinkScopedResourcesListByPrivateLinkScopeOptions contains the optional parameters for the PrivateLinkScopedResources.ListByPrivateLinkScope method. 4087type PrivateLinkScopedResourcesListByPrivateLinkScopeOptions struct { 4088 // placeholder for future optional parameters 4089} 4090 4091// PrivateLinkScopesBeginDeleteOptions contains the optional parameters for the PrivateLinkScopes.BeginDelete method. 4092type PrivateLinkScopesBeginDeleteOptions struct { 4093 // placeholder for future optional parameters 4094} 4095 4096// PrivateLinkScopesCreateOrUpdateOptions contains the optional parameters for the PrivateLinkScopes.CreateOrUpdate method. 4097type PrivateLinkScopesCreateOrUpdateOptions struct { 4098 // placeholder for future optional parameters 4099} 4100 4101// PrivateLinkScopesGetOptions contains the optional parameters for the PrivateLinkScopes.Get method. 4102type PrivateLinkScopesGetOptions struct { 4103 // placeholder for future optional parameters 4104} 4105 4106// PrivateLinkScopesListByResourceGroupOptions contains the optional parameters for the PrivateLinkScopes.ListByResourceGroup method. 4107type PrivateLinkScopesListByResourceGroupOptions struct { 4108 // placeholder for future optional parameters 4109} 4110 4111// PrivateLinkScopesListOptions contains the optional parameters for the PrivateLinkScopes.List method. 4112type PrivateLinkScopesListOptions struct { 4113 // placeholder for future optional parameters 4114} 4115 4116// PrivateLinkScopesResource - An azure resource object 4117type PrivateLinkScopesResource struct { 4118 // REQUIRED; Resource location 4119 Location *string `json:"location,omitempty"` 4120 4121 // Resource tags 4122 Tags map[string]*string `json:"tags,omitempty"` 4123 4124 // READ-ONLY; Azure resource Id 4125 ID *string `json:"id,omitempty" azure:"ro"` 4126 4127 // READ-ONLY; Azure resource name 4128 Name *string `json:"name,omitempty" azure:"ro"` 4129 4130 // READ-ONLY; Azure resource type 4131 Type *string `json:"type,omitempty" azure:"ro"` 4132} 4133 4134// MarshalJSON implements the json.Marshaller interface for type PrivateLinkScopesResource. 4135func (p PrivateLinkScopesResource) MarshalJSON() ([]byte, error) { 4136 objectMap := p.marshalInternal() 4137 return json.Marshal(objectMap) 4138} 4139 4140func (p PrivateLinkScopesResource) marshalInternal() map[string]interface{} { 4141 objectMap := make(map[string]interface{}) 4142 populate(objectMap, "id", p.ID) 4143 populate(objectMap, "location", p.Location) 4144 populate(objectMap, "name", p.Name) 4145 populate(objectMap, "tags", p.Tags) 4146 populate(objectMap, "type", p.Type) 4147 return objectMap 4148} 4149 4150// PrivateLinkScopesUpdateTagsOptions contains the optional parameters for the PrivateLinkScopes.UpdateTags method. 4151type PrivateLinkScopesUpdateTagsOptions struct { 4152 // placeholder for future optional parameters 4153} 4154 4155// PrivateLinkServiceConnectionStateProperty - State of the private endpoint connection. 4156type PrivateLinkServiceConnectionStateProperty struct { 4157 // REQUIRED; The private link service connection description. 4158 Description *string `json:"description,omitempty"` 4159 4160 // REQUIRED; The private link service connection status. 4161 Status *string `json:"status,omitempty"` 4162 4163 // READ-ONLY; The actions required for private link service connection. 4164 ActionsRequired *string `json:"actionsRequired,omitempty" azure:"ro"` 4165} 4166 4167// ProxyOnlyResource - A proxy only azure resource object 4168type ProxyOnlyResource struct { 4169 // READ-ONLY; Azure resource Id 4170 ID *string `json:"id,omitempty" azure:"ro"` 4171 4172 // READ-ONLY; Azure resource name 4173 Name *string `json:"name,omitempty" azure:"ro"` 4174 4175 // READ-ONLY; Azure resource type 4176 Type *string `json:"type,omitempty" azure:"ro"` 4177} 4178 4179// ProxyResource - An azure resource object 4180type ProxyResource struct { 4181 // READ-ONLY; Azure resource Id 4182 ID *string `json:"id,omitempty" azure:"ro"` 4183 4184 // READ-ONLY; Azure resource name 4185 Name *string `json:"name,omitempty" azure:"ro"` 4186 4187 // READ-ONLY; Azure resource type 4188 Type *string `json:"type,omitempty" azure:"ro"` 4189} 4190 4191// Recurrence - The repeating times at which this profile begins. This element is not used if the FixedDate element is used. 4192type Recurrence struct { 4193 // REQUIRED; the recurrence frequency. How often the schedule profile should take effect. This value must be Week, meaning each week will have the same 4194 // set of profiles. For example, to set a daily schedule, set 4195 // schedule to every day of the week. The frequency property specifies that the schedule is repeated weekly. 4196 Frequency *RecurrenceFrequency `json:"frequency,omitempty"` 4197 4198 // REQUIRED; the scheduling constraints for when the profile begins. 4199 Schedule *RecurrentSchedule `json:"schedule,omitempty"` 4200} 4201 4202// RecurrentSchedule - The scheduling constraints for when the profile begins. 4203type RecurrentSchedule struct { 4204 // REQUIRED; the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. 4205 Days []*string `json:"days,omitempty"` 4206 4207 // REQUIRED; A collection of hours that the profile takes effect on. Values supported are 0 to 23 on the 24-hour clock (AM/PM times are not supported). 4208 Hours []*int32 `json:"hours,omitempty"` 4209 4210 // REQUIRED; A collection of minutes at which the profile takes effect at. 4211 Minutes []*int32 `json:"minutes,omitempty"` 4212 4213 // REQUIRED; the timezone for the hours of the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan 4214 // Standard Time, Pacific Standard Time (Mexico), Pacific 4215 // Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, 4216 // Central Standard Time (Mexico), Canada Central 4217 // Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard 4218 // Time, Central Brazilian Standard Time, SA 4219 // Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard 4220 // Time, Greenland Standard Time, Montevideo 4221 // Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT 4222 // Standard Time, Greenwich Standard Time, W. 4223 // Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard 4224 // Time, Jordan Standard Time, GTB Standard 4225 // Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey 4226 // Standard Time, Israel Standard Time, 4227 // Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard 4228 // Time, Iran Standard Time, Arabian Standard 4229 // Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, 4230 // West Asia Standard Time, Ekaterinburg Standard 4231 // Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, 4232 // N. Central Asia Standard Time, Myanmar Standard 4233 // Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard 4234 // Time, Taipei Standard Time, Ulaanbaatar 4235 // Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia 4236 // Standard Time, AUS Eastern Standard Time, West 4237 // Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, 4238 // Russia Time Zone 11, New Zealand Standard Time, 4239 // UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time 4240 TimeZone *string `json:"timeZone,omitempty"` 4241} 4242 4243// MarshalJSON implements the json.Marshaller interface for type RecurrentSchedule. 4244func (r RecurrentSchedule) MarshalJSON() ([]byte, error) { 4245 objectMap := make(map[string]interface{}) 4246 populate(objectMap, "days", r.Days) 4247 populate(objectMap, "hours", r.Hours) 4248 populate(objectMap, "minutes", r.Minutes) 4249 populate(objectMap, "timeZone", r.TimeZone) 4250 return json.Marshal(objectMap) 4251} 4252 4253// Resource - An azure resource object 4254type Resource struct { 4255 // REQUIRED; Resource location 4256 Location *string `json:"location,omitempty"` 4257 4258 // Resource tags 4259 Tags map[string]*string `json:"tags,omitempty"` 4260 4261 // READ-ONLY; Azure resource Id 4262 ID *string `json:"id,omitempty" azure:"ro"` 4263 4264 // READ-ONLY; Azure resource name 4265 Name *string `json:"name,omitempty" azure:"ro"` 4266 4267 // READ-ONLY; Azure resource type 4268 Type *string `json:"type,omitempty" azure:"ro"` 4269} 4270 4271// MarshalJSON implements the json.Marshaller interface for type Resource. 4272func (r Resource) MarshalJSON() ([]byte, error) { 4273 objectMap := r.marshalInternal() 4274 return json.Marshal(objectMap) 4275} 4276 4277func (r Resource) marshalInternal() map[string]interface{} { 4278 objectMap := make(map[string]interface{}) 4279 populate(objectMap, "id", r.ID) 4280 populate(objectMap, "location", r.Location) 4281 populate(objectMap, "name", r.Name) 4282 populate(objectMap, "tags", r.Tags) 4283 populate(objectMap, "type", r.Type) 4284 return objectMap 4285} 4286 4287// ResourceForUpdate - Definition of ARM tracked top level resource properties for update operation. 4288type ResourceForUpdate struct { 4289 // Resource tags. 4290 Tags map[string]*string `json:"tags,omitempty"` 4291} 4292 4293// MarshalJSON implements the json.Marshaller interface for type ResourceForUpdate. 4294func (r ResourceForUpdate) MarshalJSON() ([]byte, error) { 4295 objectMap := make(map[string]interface{}) 4296 populate(objectMap, "tags", r.Tags) 4297 return json.Marshal(objectMap) 4298} 4299 4300// Response - The response to a metrics query. 4301type Response struct { 4302 // REQUIRED; The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by '/'. This may be adjusted in 4303 // the future and returned back from what was originally 4304 // requested. 4305 Timespan *string `json:"timespan,omitempty"` 4306 4307 // REQUIRED; the value of the collection. 4308 Value []*Metric `json:"value,omitempty"` 4309 4310 // The integer value representing the relative cost of the query. 4311 Cost *int32 `json:"cost,omitempty"` 4312 4313 // The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned back from what was originally requested. 4314 // This is not present if a metadata request 4315 // was made. 4316 Interval *string `json:"interval,omitempty"` 4317 4318 // The namespace of the metrics being queried 4319 Namespace *string `json:"namespace,omitempty"` 4320 4321 // The region of the resource being queried for metrics. 4322 Resourceregion *string `json:"resourceregion,omitempty"` 4323} 4324 4325// MarshalJSON implements the json.Marshaller interface for type Response. 4326func (r Response) MarshalJSON() ([]byte, error) { 4327 objectMap := make(map[string]interface{}) 4328 populate(objectMap, "cost", r.Cost) 4329 populate(objectMap, "interval", r.Interval) 4330 populate(objectMap, "namespace", r.Namespace) 4331 populate(objectMap, "resourceregion", r.Resourceregion) 4332 populate(objectMap, "timespan", r.Timespan) 4333 populate(objectMap, "value", r.Value) 4334 return json.Marshal(objectMap) 4335} 4336 4337// ResponseWithError - An error response from the API. 4338// Implements the error and azcore.HTTPResponse interfaces. 4339type ResponseWithError struct { 4340 raw string 4341 // REQUIRED; Error information. 4342 InnerError *Error `json:"error,omitempty"` 4343} 4344 4345// Error implements the error interface for type ResponseWithError. 4346// The contents of the error text are not contractual and subject to change. 4347func (e ResponseWithError) Error() string { 4348 return e.raw 4349} 4350 4351// RetentionPolicy - Specifies the retention policy for the log. 4352type RetentionPolicy struct { 4353 // REQUIRED; the number of days for the retention in days. A value of 0 will retain the events indefinitely. 4354 Days *int32 `json:"days,omitempty"` 4355 4356 // REQUIRED; a value indicating whether the retention policy is enabled. 4357 Enabled *bool `json:"enabled,omitempty"` 4358} 4359 4360// RuleActionClassification provides polymorphic access to related types. 4361// Call the interface's GetRuleAction() method to access the common type. 4362// Use a type switch to determine the concrete type. The possible types are: 4363// - *RuleAction, *RuleEmailAction, *RuleWebhookAction 4364type RuleActionClassification interface { 4365 // GetRuleAction returns the RuleAction content of the underlying type. 4366 GetRuleAction() *RuleAction 4367} 4368 4369// RuleAction - The action that is performed when the alert rule becomes active, and when an alert condition is resolved. 4370type RuleAction struct { 4371 // REQUIRED; specifies the type of the action. There are two types of actions: RuleEmailAction and RuleWebhookAction. 4372 OdataType *string `json:"odata.type,omitempty"` 4373} 4374 4375// GetRuleAction implements the RuleActionClassification interface for type RuleAction. 4376func (r *RuleAction) GetRuleAction() *RuleAction { return r } 4377 4378// UnmarshalJSON implements the json.Unmarshaller interface for type RuleAction. 4379func (r *RuleAction) UnmarshalJSON(data []byte) error { 4380 var rawMsg map[string]json.RawMessage 4381 if err := json.Unmarshal(data, &rawMsg); err != nil { 4382 return err 4383 } 4384 return r.unmarshalInternal(rawMsg) 4385} 4386 4387func (r RuleAction) marshalInternal(discValue string) map[string]interface{} { 4388 objectMap := make(map[string]interface{}) 4389 r.OdataType = &discValue 4390 objectMap["odata.type"] = r.OdataType 4391 return objectMap 4392} 4393 4394func (r *RuleAction) unmarshalInternal(rawMsg map[string]json.RawMessage) error { 4395 for key, val := range rawMsg { 4396 var err error 4397 switch key { 4398 case "odata.type": 4399 err = unpopulate(val, &r.OdataType) 4400 delete(rawMsg, key) 4401 } 4402 if err != nil { 4403 return err 4404 } 4405 } 4406 return nil 4407} 4408 4409// RuleConditionClassification provides polymorphic access to related types. 4410// Call the interface's GetRuleCondition() method to access the common type. 4411// Use a type switch to determine the concrete type. The possible types are: 4412// - *LocationThresholdRuleCondition, *ManagementEventRuleCondition, *RuleCondition, *ThresholdRuleCondition 4413type RuleConditionClassification interface { 4414 // GetRuleCondition returns the RuleCondition content of the underlying type. 4415 GetRuleCondition() *RuleCondition 4416} 4417 4418// RuleCondition - The condition that results in the alert rule being activated. 4419type RuleCondition struct { 4420 // REQUIRED; specifies the type of condition. This can be one of three types: ManagementEventRuleCondition (occurrences of management events), LocationThresholdRuleCondition 4421 // (based on the number of failures of a 4422 // web test), and ThresholdRuleCondition (based on the threshold of a metric). 4423 OdataType *string `json:"odata.type,omitempty"` 4424 4425 // the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource. 4426 DataSource RuleDataSourceClassification `json:"dataSource,omitempty"` 4427} 4428 4429// GetRuleCondition implements the RuleConditionClassification interface for type RuleCondition. 4430func (r *RuleCondition) GetRuleCondition() *RuleCondition { return r } 4431 4432// UnmarshalJSON implements the json.Unmarshaller interface for type RuleCondition. 4433func (r *RuleCondition) UnmarshalJSON(data []byte) error { 4434 var rawMsg map[string]json.RawMessage 4435 if err := json.Unmarshal(data, &rawMsg); err != nil { 4436 return err 4437 } 4438 return r.unmarshalInternal(rawMsg) 4439} 4440 4441func (r RuleCondition) marshalInternal(discValue string) map[string]interface{} { 4442 objectMap := make(map[string]interface{}) 4443 populate(objectMap, "dataSource", r.DataSource) 4444 r.OdataType = &discValue 4445 objectMap["odata.type"] = r.OdataType 4446 return objectMap 4447} 4448 4449func (r *RuleCondition) unmarshalInternal(rawMsg map[string]json.RawMessage) error { 4450 for key, val := range rawMsg { 4451 var err error 4452 switch key { 4453 case "dataSource": 4454 r.DataSource, err = unmarshalRuleDataSourceClassification(val) 4455 delete(rawMsg, key) 4456 case "odata.type": 4457 err = unpopulate(val, &r.OdataType) 4458 delete(rawMsg, key) 4459 } 4460 if err != nil { 4461 return err 4462 } 4463 } 4464 return nil 4465} 4466 4467// RuleDataSourceClassification provides polymorphic access to related types. 4468// Call the interface's GetRuleDataSource() method to access the common type. 4469// Use a type switch to determine the concrete type. The possible types are: 4470// - *RuleDataSource, *RuleManagementEventDataSource, *RuleMetricDataSource 4471type RuleDataSourceClassification interface { 4472 // GetRuleDataSource returns the RuleDataSource content of the underlying type. 4473 GetRuleDataSource() *RuleDataSource 4474} 4475 4476// RuleDataSource - The resource from which the rule collects its data. 4477type RuleDataSource struct { 4478 // REQUIRED; specifies the type of data source. There are two types of rule data sources: RuleMetricDataSource and RuleManagementEventDataSource 4479 OdataType *string `json:"odata.type,omitempty"` 4480 4481 // the legacy resource identifier of the resource the rule monitors. NOTE: this property cannot be updated for an existing rule. 4482 LegacyResourceID *string `json:"legacyResourceId,omitempty"` 4483 4484 // the namespace of the metric. 4485 MetricNamespace *string `json:"metricNamespace,omitempty"` 4486 4487 // the location of the resource. 4488 ResourceLocation *string `json:"resourceLocation,omitempty"` 4489 4490 // the resource identifier of the resource the rule monitors. NOTE: this property cannot be updated for an existing rule. 4491 ResourceURI *string `json:"resourceUri,omitempty"` 4492} 4493 4494// GetRuleDataSource implements the RuleDataSourceClassification interface for type RuleDataSource. 4495func (r *RuleDataSource) GetRuleDataSource() *RuleDataSource { return r } 4496 4497// UnmarshalJSON implements the json.Unmarshaller interface for type RuleDataSource. 4498func (r *RuleDataSource) UnmarshalJSON(data []byte) error { 4499 var rawMsg map[string]json.RawMessage 4500 if err := json.Unmarshal(data, &rawMsg); err != nil { 4501 return err 4502 } 4503 return r.unmarshalInternal(rawMsg) 4504} 4505 4506func (r RuleDataSource) marshalInternal(discValue string) map[string]interface{} { 4507 objectMap := make(map[string]interface{}) 4508 populate(objectMap, "legacyResourceId", r.LegacyResourceID) 4509 populate(objectMap, "metricNamespace", r.MetricNamespace) 4510 r.OdataType = &discValue 4511 objectMap["odata.type"] = r.OdataType 4512 populate(objectMap, "resourceLocation", r.ResourceLocation) 4513 populate(objectMap, "resourceUri", r.ResourceURI) 4514 return objectMap 4515} 4516 4517func (r *RuleDataSource) unmarshalInternal(rawMsg map[string]json.RawMessage) error { 4518 for key, val := range rawMsg { 4519 var err error 4520 switch key { 4521 case "legacyResourceId": 4522 err = unpopulate(val, &r.LegacyResourceID) 4523 delete(rawMsg, key) 4524 case "metricNamespace": 4525 err = unpopulate(val, &r.MetricNamespace) 4526 delete(rawMsg, key) 4527 case "odata.type": 4528 err = unpopulate(val, &r.OdataType) 4529 delete(rawMsg, key) 4530 case "resourceLocation": 4531 err = unpopulate(val, &r.ResourceLocation) 4532 delete(rawMsg, key) 4533 case "resourceUri": 4534 err = unpopulate(val, &r.ResourceURI) 4535 delete(rawMsg, key) 4536 } 4537 if err != nil { 4538 return err 4539 } 4540 } 4541 return nil 4542} 4543 4544// RuleEmailAction - Specifies the action to send email when the rule condition is evaluated. The discriminator is always RuleEmailAction in this case. 4545type RuleEmailAction struct { 4546 RuleAction 4547 // the list of administrator's custom email addresses to notify of the activation of the alert. 4548 CustomEmails []*string `json:"customEmails,omitempty"` 4549 4550 // Whether the administrators (service and co-administrators) of the service should be notified when the alert is activated. 4551 SendToServiceOwners *bool `json:"sendToServiceOwners,omitempty"` 4552} 4553 4554// MarshalJSON implements the json.Marshaller interface for type RuleEmailAction. 4555func (r RuleEmailAction) MarshalJSON() ([]byte, error) { 4556 objectMap := r.RuleAction.marshalInternal("Microsoft.Azure.Management.Insights.Models.RuleEmailAction") 4557 populate(objectMap, "customEmails", r.CustomEmails) 4558 populate(objectMap, "sendToServiceOwners", r.SendToServiceOwners) 4559 return json.Marshal(objectMap) 4560} 4561 4562// UnmarshalJSON implements the json.Unmarshaller interface for type RuleEmailAction. 4563func (r *RuleEmailAction) UnmarshalJSON(data []byte) error { 4564 var rawMsg map[string]json.RawMessage 4565 if err := json.Unmarshal(data, &rawMsg); err != nil { 4566 return err 4567 } 4568 for key, val := range rawMsg { 4569 var err error 4570 switch key { 4571 case "customEmails": 4572 err = unpopulate(val, &r.CustomEmails) 4573 delete(rawMsg, key) 4574 case "sendToServiceOwners": 4575 err = unpopulate(val, &r.SendToServiceOwners) 4576 delete(rawMsg, key) 4577 } 4578 if err != nil { 4579 return err 4580 } 4581 } 4582 return r.RuleAction.unmarshalInternal(rawMsg) 4583} 4584 4585// RuleManagementEventClaimsDataSource - The claims for a rule management event data source. 4586type RuleManagementEventClaimsDataSource struct { 4587 // the email address. 4588 EmailAddress *string `json:"emailAddress,omitempty"` 4589} 4590 4591// RuleManagementEventDataSource - A rule management event data source. The discriminator fields is always RuleManagementEventDataSource in this case. 4592type RuleManagementEventDataSource struct { 4593 RuleDataSource 4594 // the claims. 4595 Claims *RuleManagementEventClaimsDataSource `json:"claims,omitempty"` 4596 4597 // the event name. 4598 EventName *string `json:"eventName,omitempty"` 4599 4600 // the event source. 4601 EventSource *string `json:"eventSource,omitempty"` 4602 4603 // the level. 4604 Level *string `json:"level,omitempty"` 4605 4606 // The name of the operation that should be checked for. If no name is provided, any operation will match. 4607 OperationName *string `json:"operationName,omitempty"` 4608 4609 // the resource group name. 4610 ResourceGroupName *string `json:"resourceGroupName,omitempty"` 4611 4612 // the resource provider name. 4613 ResourceProviderName *string `json:"resourceProviderName,omitempty"` 4614 4615 // The status of the operation that should be checked for. If no status is provided, any status will match. 4616 Status *string `json:"status,omitempty"` 4617 4618 // the substatus. 4619 SubStatus *string `json:"subStatus,omitempty"` 4620} 4621 4622// MarshalJSON implements the json.Marshaller interface for type RuleManagementEventDataSource. 4623func (r RuleManagementEventDataSource) MarshalJSON() ([]byte, error) { 4624 objectMap := r.RuleDataSource.marshalInternal("Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource") 4625 populate(objectMap, "claims", r.Claims) 4626 populate(objectMap, "eventName", r.EventName) 4627 populate(objectMap, "eventSource", r.EventSource) 4628 populate(objectMap, "level", r.Level) 4629 populate(objectMap, "operationName", r.OperationName) 4630 populate(objectMap, "resourceGroupName", r.ResourceGroupName) 4631 populate(objectMap, "resourceProviderName", r.ResourceProviderName) 4632 populate(objectMap, "status", r.Status) 4633 populate(objectMap, "subStatus", r.SubStatus) 4634 return json.Marshal(objectMap) 4635} 4636 4637// UnmarshalJSON implements the json.Unmarshaller interface for type RuleManagementEventDataSource. 4638func (r *RuleManagementEventDataSource) UnmarshalJSON(data []byte) error { 4639 var rawMsg map[string]json.RawMessage 4640 if err := json.Unmarshal(data, &rawMsg); err != nil { 4641 return err 4642 } 4643 for key, val := range rawMsg { 4644 var err error 4645 switch key { 4646 case "claims": 4647 err = unpopulate(val, &r.Claims) 4648 delete(rawMsg, key) 4649 case "eventName": 4650 err = unpopulate(val, &r.EventName) 4651 delete(rawMsg, key) 4652 case "eventSource": 4653 err = unpopulate(val, &r.EventSource) 4654 delete(rawMsg, key) 4655 case "level": 4656 err = unpopulate(val, &r.Level) 4657 delete(rawMsg, key) 4658 case "operationName": 4659 err = unpopulate(val, &r.OperationName) 4660 delete(rawMsg, key) 4661 case "resourceGroupName": 4662 err = unpopulate(val, &r.ResourceGroupName) 4663 delete(rawMsg, key) 4664 case "resourceProviderName": 4665 err = unpopulate(val, &r.ResourceProviderName) 4666 delete(rawMsg, key) 4667 case "status": 4668 err = unpopulate(val, &r.Status) 4669 delete(rawMsg, key) 4670 case "subStatus": 4671 err = unpopulate(val, &r.SubStatus) 4672 delete(rawMsg, key) 4673 } 4674 if err != nil { 4675 return err 4676 } 4677 } 4678 return r.RuleDataSource.unmarshalInternal(rawMsg) 4679} 4680 4681// RuleMetricDataSource - A rule metric data source. The discriminator value is always RuleMetricDataSource in this case. 4682type RuleMetricDataSource struct { 4683 RuleDataSource 4684 // the name of the metric that defines what the rule monitors. 4685 MetricName *string `json:"metricName,omitempty"` 4686} 4687 4688// MarshalJSON implements the json.Marshaller interface for type RuleMetricDataSource. 4689func (r RuleMetricDataSource) MarshalJSON() ([]byte, error) { 4690 objectMap := r.RuleDataSource.marshalInternal("Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource") 4691 populate(objectMap, "metricName", r.MetricName) 4692 return json.Marshal(objectMap) 4693} 4694 4695// UnmarshalJSON implements the json.Unmarshaller interface for type RuleMetricDataSource. 4696func (r *RuleMetricDataSource) UnmarshalJSON(data []byte) error { 4697 var rawMsg map[string]json.RawMessage 4698 if err := json.Unmarshal(data, &rawMsg); err != nil { 4699 return err 4700 } 4701 for key, val := range rawMsg { 4702 var err error 4703 switch key { 4704 case "metricName": 4705 err = unpopulate(val, &r.MetricName) 4706 delete(rawMsg, key) 4707 } 4708 if err != nil { 4709 return err 4710 } 4711 } 4712 return r.RuleDataSource.unmarshalInternal(rawMsg) 4713} 4714 4715// RuleWebhookAction - Specifies the action to post to service when the rule condition is evaluated. The discriminator is always RuleWebhookAction in this 4716// case. 4717type RuleWebhookAction struct { 4718 RuleAction 4719 // the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. 4720 Properties map[string]*string `json:"properties,omitempty"` 4721 4722 // the service uri to Post the notification when the alert activates or resolves. 4723 ServiceURI *string `json:"serviceUri,omitempty"` 4724} 4725 4726// MarshalJSON implements the json.Marshaller interface for type RuleWebhookAction. 4727func (r RuleWebhookAction) MarshalJSON() ([]byte, error) { 4728 objectMap := r.RuleAction.marshalInternal("Microsoft.Azure.Management.Insights.Models.RuleWebhookAction") 4729 populate(objectMap, "properties", r.Properties) 4730 populate(objectMap, "serviceUri", r.ServiceURI) 4731 return json.Marshal(objectMap) 4732} 4733 4734// UnmarshalJSON implements the json.Unmarshaller interface for type RuleWebhookAction. 4735func (r *RuleWebhookAction) UnmarshalJSON(data []byte) error { 4736 var rawMsg map[string]json.RawMessage 4737 if err := json.Unmarshal(data, &rawMsg); err != nil { 4738 return err 4739 } 4740 for key, val := range rawMsg { 4741 var err error 4742 switch key { 4743 case "properties": 4744 err = unpopulate(val, &r.Properties) 4745 delete(rawMsg, key) 4746 case "serviceUri": 4747 err = unpopulate(val, &r.ServiceURI) 4748 delete(rawMsg, key) 4749 } 4750 if err != nil { 4751 return err 4752 } 4753 } 4754 return r.RuleAction.unmarshalInternal(rawMsg) 4755} 4756 4757// ScaleAction - The parameters for the scaling action. 4758type ScaleAction struct { 4759 // REQUIRED; the amount of time to wait since the last scaling action before this action occurs. It must be between 1 week and 1 minute in ISO 8601 format. 4760 Cooldown *string `json:"cooldown,omitempty"` 4761 4762 // REQUIRED; the scale direction. Whether the scaling action increases or decreases the number of instances. 4763 Direction *ScaleDirection `json:"direction,omitempty"` 4764 4765 // REQUIRED; the type of action that should occur when the scale rule fires. 4766 Type *ScaleType `json:"type,omitempty"` 4767 4768 // the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1. 4769 Value *string `json:"value,omitempty"` 4770} 4771 4772// ScaleCapacity - The number of instances that can be used during this profile. 4773type ScaleCapacity struct { 4774 // REQUIRED; the number of instances that will be set if metrics are not available for evaluation. The default is only used if the current instance count 4775 // is lower than the default. 4776 Default *string `json:"default,omitempty"` 4777 4778 // REQUIRED; the maximum number of instances for the resource. The actual maximum number of instances is limited by the cores that are available in the 4779 // subscription. 4780 Maximum *string `json:"maximum,omitempty"` 4781 4782 // REQUIRED; the minimum number of instances for the resource. 4783 Minimum *string `json:"minimum,omitempty"` 4784} 4785 4786// ScaleRule - A rule that provide the triggers and parameters for the scaling action. 4787type ScaleRule struct { 4788 // REQUIRED; the trigger that results in a scaling action. 4789 MetricTrigger *MetricTrigger `json:"metricTrigger,omitempty"` 4790 4791 // REQUIRED; the parameters for the scaling action. 4792 ScaleAction *ScaleAction `json:"scaleAction,omitempty"` 4793} 4794 4795// ScaleRuleMetricDimension - Specifies an auto scale rule metric dimension. 4796type ScaleRuleMetricDimension struct { 4797 // REQUIRED; Name of the dimension. 4798 DimensionName *string `json:"DimensionName,omitempty"` 4799 4800 // REQUIRED; the dimension operator. Only 'Equals' and 'NotEquals' are supported. 'Equals' being equal to any of the values. 'NotEquals' being not equal 4801 // to all of the values 4802 Operator *ScaleRuleMetricDimensionOperationType `json:"Operator,omitempty"` 4803 4804 // REQUIRED; list of dimension values. For example: ["App1","App2"]. 4805 Values []*string `json:"Values,omitempty"` 4806} 4807 4808// MarshalJSON implements the json.Marshaller interface for type ScaleRuleMetricDimension. 4809func (s ScaleRuleMetricDimension) MarshalJSON() ([]byte, error) { 4810 objectMap := make(map[string]interface{}) 4811 populate(objectMap, "DimensionName", s.DimensionName) 4812 populate(objectMap, "Operator", s.Operator) 4813 populate(objectMap, "Values", s.Values) 4814 return json.Marshal(objectMap) 4815} 4816 4817// Schedule - Defines how often to run the search and the time interval. 4818type Schedule struct { 4819 // REQUIRED; frequency (in minutes) at which rule condition should be evaluated. 4820 FrequencyInMinutes *int32 `json:"frequencyInMinutes,omitempty"` 4821 4822 // REQUIRED; Time window for which data needs to be fetched for query (should be greater than or equal to frequencyInMinutes). 4823 TimeWindowInMinutes *int32 `json:"timeWindowInMinutes,omitempty"` 4824} 4825 4826// ScheduledQueryRulesCreateOrUpdateOptions contains the optional parameters for the ScheduledQueryRules.CreateOrUpdate method. 4827type ScheduledQueryRulesCreateOrUpdateOptions struct { 4828 // placeholder for future optional parameters 4829} 4830 4831// ScheduledQueryRulesDeleteOptions contains the optional parameters for the ScheduledQueryRules.Delete method. 4832type ScheduledQueryRulesDeleteOptions struct { 4833 // placeholder for future optional parameters 4834} 4835 4836// ScheduledQueryRulesGetOptions contains the optional parameters for the ScheduledQueryRules.Get method. 4837type ScheduledQueryRulesGetOptions struct { 4838 // placeholder for future optional parameters 4839} 4840 4841// ScheduledQueryRulesListByResourceGroupOptions contains the optional parameters for the ScheduledQueryRules.ListByResourceGroup method. 4842type ScheduledQueryRulesListByResourceGroupOptions struct { 4843 // The filter to apply on the operation. For more information please see https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx 4844 Filter *string 4845} 4846 4847// ScheduledQueryRulesListBySubscriptionOptions contains the optional parameters for the ScheduledQueryRules.ListBySubscription method. 4848type ScheduledQueryRulesListBySubscriptionOptions struct { 4849 // The filter to apply on the operation. For more information please see https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx 4850 Filter *string 4851} 4852 4853// ScheduledQueryRulesUpdateOptions contains the optional parameters for the ScheduledQueryRules.Update method. 4854type ScheduledQueryRulesUpdateOptions struct { 4855 // placeholder for future optional parameters 4856} 4857 4858// ScopedResource - A private link scoped resource 4859type ScopedResource struct { 4860 ProxyResource 4861 // Resource properties. 4862 Properties *ScopedResourceProperties `json:"properties,omitempty"` 4863} 4864 4865// ScopedResourceListResult - A list of scoped resources in a private link scope. 4866type ScopedResourceListResult struct { 4867 // READ-ONLY; Link to retrieve next page of results. 4868 NextLink *string `json:"nextLink,omitempty" azure:"ro"` 4869 4870 // READ-ONLY; Array of results. 4871 Value []*ScopedResource `json:"value,omitempty" azure:"ro"` 4872} 4873 4874// MarshalJSON implements the json.Marshaller interface for type ScopedResourceListResult. 4875func (s ScopedResourceListResult) MarshalJSON() ([]byte, error) { 4876 objectMap := make(map[string]interface{}) 4877 populate(objectMap, "nextLink", s.NextLink) 4878 populate(objectMap, "value", s.Value) 4879 return json.Marshal(objectMap) 4880} 4881 4882// ScopedResourceProperties - Properties of a private link scoped resource. 4883type ScopedResourceProperties struct { 4884 // The resource id of the scoped Azure monitor resource. 4885 LinkedResourceID *string `json:"linkedResourceId,omitempty"` 4886 4887 // READ-ONLY; State of the private endpoint connection. 4888 ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` 4889} 4890 4891// SenderAuthorization - the authorization used by the user who has performed the operation that led to this event. This captures the RBAC properties of 4892// the event. These usually include the 'action', 'role' and the 'scope' 4893type SenderAuthorization struct { 4894 // the permissible actions. For instance: microsoft.support/supporttickets/write 4895 Action *string `json:"action,omitempty"` 4896 4897 // the role of the user. For instance: Subscription Admin 4898 Role *string `json:"role,omitempty"` 4899 4900 // the scope. 4901 Scope *string `json:"scope,omitempty"` 4902} 4903 4904// SingleBaseline - The baseline values for a single sensitivity value. 4905type SingleBaseline struct { 4906 // REQUIRED; The high thresholds of the baseline. 4907 HighThresholds []*float64 `json:"highThresholds,omitempty"` 4908 4909 // REQUIRED; The low thresholds of the baseline. 4910 LowThresholds []*float64 `json:"lowThresholds,omitempty"` 4911 4912 // REQUIRED; the sensitivity of the baseline. 4913 Sensitivity *BaselineSensitivity `json:"sensitivity,omitempty"` 4914} 4915 4916// MarshalJSON implements the json.Marshaller interface for type SingleBaseline. 4917func (s SingleBaseline) MarshalJSON() ([]byte, error) { 4918 objectMap := make(map[string]interface{}) 4919 populate(objectMap, "highThresholds", s.HighThresholds) 4920 populate(objectMap, "lowThresholds", s.LowThresholds) 4921 populate(objectMap, "sensitivity", s.Sensitivity) 4922 return json.Marshal(objectMap) 4923} 4924 4925// SingleMetricBaseline - The baseline results of a single metric. 4926type SingleMetricBaseline struct { 4927 // REQUIRED; The metric baseline Id. 4928 ID *string `json:"id,omitempty"` 4929 4930 // REQUIRED; The name of the metric for which the baselines were retrieved. 4931 Name *string `json:"name,omitempty"` 4932 4933 // REQUIRED; The metric baseline properties of the metric. 4934 Properties *MetricBaselinesProperties `json:"properties,omitempty"` 4935 4936 // REQUIRED; The resource type of the metric baseline resource. 4937 Type *string `json:"type,omitempty"` 4938} 4939 4940// SmsReceiver - An SMS receiver. 4941type SmsReceiver struct { 4942 // REQUIRED; The country code of the SMS receiver. 4943 CountryCode *string `json:"countryCode,omitempty"` 4944 4945 // REQUIRED; The name of the SMS receiver. Names must be unique across all receivers within an action group. 4946 Name *string `json:"name,omitempty"` 4947 4948 // REQUIRED; The phone number of the SMS receiver. 4949 PhoneNumber *string `json:"phoneNumber,omitempty"` 4950 4951 // READ-ONLY; The status of the receiver. 4952 Status *ReceiverStatus `json:"status,omitempty" azure:"ro"` 4953} 4954 4955// Source - Specifies the log search query. 4956type Source struct { 4957 // REQUIRED; The resource uri over which log search query is to be run. 4958 DataSourceID *string `json:"dataSourceId,omitempty"` 4959 4960 // List of Resource referred into query 4961 AuthorizedResources []*string `json:"authorizedResources,omitempty"` 4962 4963 // Log search query. Required for action type - AlertingAction 4964 Query *string `json:"query,omitempty"` 4965 4966 // Set value to 'ResultCount' . 4967 QueryType *QueryType `json:"queryType,omitempty"` 4968} 4969 4970// MarshalJSON implements the json.Marshaller interface for type Source. 4971func (s Source) MarshalJSON() ([]byte, error) { 4972 objectMap := make(map[string]interface{}) 4973 populate(objectMap, "authorizedResources", s.AuthorizedResources) 4974 populate(objectMap, "dataSourceId", s.DataSourceID) 4975 populate(objectMap, "query", s.Query) 4976 populate(objectMap, "queryType", s.QueryType) 4977 return json.Marshal(objectMap) 4978} 4979 4980// SyslogDataSource - Definition of which syslog data will be collected and how it will be collected. Only collected from Linux machines. 4981type SyslogDataSource struct { 4982 // The list of facility names. 4983 FacilityNames []*KnownSyslogDataSourceFacilityNames `json:"facilityNames,omitempty"` 4984 4985 // The log levels to collect. 4986 LogLevels []*KnownSyslogDataSourceLogLevels `json:"logLevels,omitempty"` 4987 4988 // A friendly name for the data source. This name should be unique across all data sources (regardless of type) within the data collection rule. 4989 Name *string `json:"name,omitempty"` 4990 4991 // List of streams that this data source will be sent to. A stream indicates what schema will be used for this data and usually what table in Log Analytics 4992 // the data will be sent to. 4993 Streams []*KnownSyslogDataSourceStreams `json:"streams,omitempty"` 4994} 4995 4996// MarshalJSON implements the json.Marshaller interface for type SyslogDataSource. 4997func (s SyslogDataSource) MarshalJSON() ([]byte, error) { 4998 objectMap := make(map[string]interface{}) 4999 populate(objectMap, "facilityNames", s.FacilityNames) 5000 populate(objectMap, "logLevels", s.LogLevels) 5001 populate(objectMap, "name", s.Name) 5002 populate(objectMap, "streams", s.Streams) 5003 return json.Marshal(objectMap) 5004} 5005 5006// SystemData - Metadata pertaining to creation and last modification of the resource. 5007type SystemData struct { 5008 // The timestamp of resource creation (UTC). 5009 CreatedAt *time.Time `json:"createdAt,omitempty"` 5010 5011 // The identity that created the resource. 5012 CreatedBy *string `json:"createdBy,omitempty"` 5013 5014 // The type of identity that created the resource. 5015 CreatedByType *CreatedByType `json:"createdByType,omitempty"` 5016 5017 // The timestamp of resource last modification (UTC) 5018 LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` 5019 5020 // The identity that last modified the resource. 5021 LastModifiedBy *string `json:"lastModifiedBy,omitempty"` 5022 5023 // The type of identity that last modified the resource. 5024 LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` 5025} 5026 5027// MarshalJSON implements the json.Marshaller interface for type SystemData. 5028func (s SystemData) MarshalJSON() ([]byte, error) { 5029 objectMap := s.marshalInternal() 5030 return json.Marshal(objectMap) 5031} 5032 5033// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. 5034func (s *SystemData) UnmarshalJSON(data []byte) error { 5035 var rawMsg map[string]json.RawMessage 5036 if err := json.Unmarshal(data, &rawMsg); err != nil { 5037 return err 5038 } 5039 return s.unmarshalInternal(rawMsg) 5040} 5041 5042func (s SystemData) marshalInternal() map[string]interface{} { 5043 objectMap := make(map[string]interface{}) 5044 populate(objectMap, "createdAt", (*timeRFC3339)(s.CreatedAt)) 5045 populate(objectMap, "createdBy", s.CreatedBy) 5046 populate(objectMap, "createdByType", s.CreatedByType) 5047 populate(objectMap, "lastModifiedAt", (*timeRFC3339)(s.LastModifiedAt)) 5048 populate(objectMap, "lastModifiedBy", s.LastModifiedBy) 5049 populate(objectMap, "lastModifiedByType", s.LastModifiedByType) 5050 return objectMap 5051} 5052 5053func (s *SystemData) unmarshalInternal(rawMsg map[string]json.RawMessage) error { 5054 for key, val := range rawMsg { 5055 var err error 5056 switch key { 5057 case "createdAt": 5058 var aux timeRFC3339 5059 err = unpopulate(val, &aux) 5060 s.CreatedAt = (*time.Time)(&aux) 5061 delete(rawMsg, key) 5062 case "createdBy": 5063 err = unpopulate(val, &s.CreatedBy) 5064 delete(rawMsg, key) 5065 case "createdByType": 5066 err = unpopulate(val, &s.CreatedByType) 5067 delete(rawMsg, key) 5068 case "lastModifiedAt": 5069 var aux timeRFC3339 5070 err = unpopulate(val, &aux) 5071 s.LastModifiedAt = (*time.Time)(&aux) 5072 delete(rawMsg, key) 5073 case "lastModifiedBy": 5074 err = unpopulate(val, &s.LastModifiedBy) 5075 delete(rawMsg, key) 5076 case "lastModifiedByType": 5077 err = unpopulate(val, &s.LastModifiedByType) 5078 delete(rawMsg, key) 5079 } 5080 if err != nil { 5081 return err 5082 } 5083 } 5084 return nil 5085} 5086 5087// TagsResource - A container holding only the Tags for a resource, allowing the user to update the tags on a PrivateLinkScope instance. 5088type TagsResource struct { 5089 // Resource tags 5090 Tags map[string]*string `json:"tags,omitempty"` 5091} 5092 5093// MarshalJSON implements the json.Marshaller interface for type TagsResource. 5094func (t TagsResource) MarshalJSON() ([]byte, error) { 5095 objectMap := make(map[string]interface{}) 5096 populate(objectMap, "tags", t.Tags) 5097 return json.Marshal(objectMap) 5098} 5099 5100// TenantActivityLogsListOptions contains the optional parameters for the TenantActivityLogs.List method. 5101type TenantActivityLogsListOptions struct { 5102 // Reduces the set of data collected. <br>The **$filter** is very restricted and allows only the following patterns.<br>- List events for a resource group: 5103 // $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and resourceGroupName eq '<ResourceGroupName>'.<br>- 5104 // List events for resource: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and resourceUri 5105 // eq '<ResourceURI>'.<br>- List events for a subscription: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels 5106 // eq 'Admin, Operation'.<br>- List events for a resource provider: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels 5107 // eq 'Admin, Operation' and resourceProvider eq '<ResourceProviderName>'.<br>- List events for a correlation Id: api-version=2014-04-01&$filter=eventTimestamp 5108 // ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and correlationId eq '<CorrelationID>'.<br>**NOTE**: 5109 // No other syntax is allowed. 5110 Filter *string 5111 // Used to fetch events with only the given properties.<br>The **$select** argument is a comma separated list of property names to be returned. Possible 5112 // values are: *authorization*, *claims*, *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, *operationId*, 5113 // *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, *status*, *submissionTimestamp*, *subStatus*, *subscriptionId* 5114 Select *string 5115} 5116 5117// ThresholdRuleCondition - A rule condition based on a metric crossing a threshold. 5118type ThresholdRuleCondition struct { 5119 RuleCondition 5120 // REQUIRED; the operator used to compare the data and the threshold. 5121 Operator *ConditionOperator `json:"operator,omitempty"` 5122 5123 // REQUIRED; the threshold value that activates the alert. 5124 Threshold *float64 `json:"threshold,omitempty"` 5125 5126 // the time aggregation operator. How the data that are collected should be combined over time. The default value is the PrimaryAggregationType of the Metric. 5127 TimeAggregation *TimeAggregationOperator `json:"timeAggregation,omitempty"` 5128 5129 // the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified then it must be between 5130 // 5 minutes and 1 day. 5131 WindowSize *string `json:"windowSize,omitempty"` 5132} 5133 5134// MarshalJSON implements the json.Marshaller interface for type ThresholdRuleCondition. 5135func (t ThresholdRuleCondition) MarshalJSON() ([]byte, error) { 5136 objectMap := t.RuleCondition.marshalInternal("Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition") 5137 populate(objectMap, "operator", t.Operator) 5138 populate(objectMap, "threshold", t.Threshold) 5139 populate(objectMap, "timeAggregation", t.TimeAggregation) 5140 populate(objectMap, "windowSize", t.WindowSize) 5141 return json.Marshal(objectMap) 5142} 5143 5144// UnmarshalJSON implements the json.Unmarshaller interface for type ThresholdRuleCondition. 5145func (t *ThresholdRuleCondition) UnmarshalJSON(data []byte) error { 5146 var rawMsg map[string]json.RawMessage 5147 if err := json.Unmarshal(data, &rawMsg); err != nil { 5148 return err 5149 } 5150 for key, val := range rawMsg { 5151 var err error 5152 switch key { 5153 case "operator": 5154 err = unpopulate(val, &t.Operator) 5155 delete(rawMsg, key) 5156 case "threshold": 5157 err = unpopulate(val, &t.Threshold) 5158 delete(rawMsg, key) 5159 case "timeAggregation": 5160 err = unpopulate(val, &t.TimeAggregation) 5161 delete(rawMsg, key) 5162 case "windowSize": 5163 err = unpopulate(val, &t.WindowSize) 5164 delete(rawMsg, key) 5165 } 5166 if err != nil { 5167 return err 5168 } 5169 } 5170 return t.RuleCondition.unmarshalInternal(rawMsg) 5171} 5172 5173// TimeSeriesBaseline - The baseline values for a single time series. 5174type TimeSeriesBaseline struct { 5175 // REQUIRED; The aggregation type of the metric. 5176 Aggregation *string `json:"aggregation,omitempty"` 5177 5178 // REQUIRED; The baseline values for each sensitivity. 5179 Data []*SingleBaseline `json:"data,omitempty"` 5180 5181 // REQUIRED; The list of timestamps of the baselines. 5182 Timestamps []*time.Time `json:"timestamps,omitempty"` 5183 5184 // The dimensions of this time series. 5185 Dimensions []*MetricSingleDimension `json:"dimensions,omitempty"` 5186 5187 // The baseline metadata values. 5188 MetadataValues []*BaselineMetadata `json:"metadataValues,omitempty"` 5189} 5190 5191// MarshalJSON implements the json.Marshaller interface for type TimeSeriesBaseline. 5192func (t TimeSeriesBaseline) MarshalJSON() ([]byte, error) { 5193 objectMap := make(map[string]interface{}) 5194 populate(objectMap, "aggregation", t.Aggregation) 5195 populate(objectMap, "data", t.Data) 5196 populate(objectMap, "dimensions", t.Dimensions) 5197 populate(objectMap, "metadataValues", t.MetadataValues) 5198 aux := make([]*timeRFC3339, len(t.Timestamps), len(t.Timestamps)) 5199 for i := 0; i < len(t.Timestamps); i++ { 5200 aux[i] = (*timeRFC3339)(t.Timestamps[i]) 5201 } 5202 populate(objectMap, "timestamps", aux) 5203 return json.Marshal(objectMap) 5204} 5205 5206// TimeSeriesElement - A time series result type. The discriminator value is always TimeSeries in this case. 5207type TimeSeriesElement struct { 5208 // An array of data points representing the metric values. This is only returned if a result type of data is specified. 5209 Data []*MetricValue `json:"data,omitempty"` 5210 5211 // the metadata values returned if $filter was specified in the call. 5212 Metadatavalues []*MetadataValue `json:"metadatavalues,omitempty"` 5213} 5214 5215// MarshalJSON implements the json.Marshaller interface for type TimeSeriesElement. 5216func (t TimeSeriesElement) MarshalJSON() ([]byte, error) { 5217 objectMap := make(map[string]interface{}) 5218 populate(objectMap, "data", t.Data) 5219 populate(objectMap, "metadatavalues", t.Metadatavalues) 5220 return json.Marshal(objectMap) 5221} 5222 5223// TimeWindow - A specific date-time for the profile. 5224type TimeWindow struct { 5225 // REQUIRED; the end time for the profile in ISO 8601 format. 5226 End *time.Time `json:"end,omitempty"` 5227 5228 // REQUIRED; the start time for the profile in ISO 8601 format. 5229 Start *time.Time `json:"start,omitempty"` 5230 5231 // the timezone of the start and end times for the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, 5232 // Alaskan Standard Time, Pacific Standard Time 5233 // (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central 5234 // Standard Time, Central Standard Time 5235 // (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay 5236 // Standard Time, Atlantic Standard Time, Central 5237 // Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard 5238 // Time, SA Eastern Standard Time, Greenland 5239 // Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco 5240 // Standard Time, UTC, GMT Standard Time, 5241 // Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa 5242 // Standard Time, Namibia Standard Time, Jordan 5243 // Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard 5244 // Time, FLE Standard Time, Turkey Standard Time, 5245 // Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard 5246 // Time, E. Africa Standard Time, Iran Standard 5247 // Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan 5248 // Standard Time, West Asia Standard Time, 5249 // Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh 5250 // Standard Time, N. Central Asia Standard 5251 // Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard 5252 // Time, W. Australia Standard Time, Taipei Standard 5253 // Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard 5254 // Time, E. Australia Standard Time, AUS Eastern 5255 // Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific 5256 // Standard Time, Russia Time Zone 11, New 5257 // Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time 5258 TimeZone *string `json:"timeZone,omitempty"` 5259} 5260 5261// MarshalJSON implements the json.Marshaller interface for type TimeWindow. 5262func (t TimeWindow) MarshalJSON() ([]byte, error) { 5263 objectMap := make(map[string]interface{}) 5264 populate(objectMap, "end", (*timeRFC3339)(t.End)) 5265 populate(objectMap, "start", (*timeRFC3339)(t.Start)) 5266 populate(objectMap, "timeZone", t.TimeZone) 5267 return json.Marshal(objectMap) 5268} 5269 5270// UnmarshalJSON implements the json.Unmarshaller interface for type TimeWindow. 5271func (t *TimeWindow) UnmarshalJSON(data []byte) error { 5272 var rawMsg map[string]json.RawMessage 5273 if err := json.Unmarshal(data, &rawMsg); err != nil { 5274 return err 5275 } 5276 for key, val := range rawMsg { 5277 var err error 5278 switch key { 5279 case "end": 5280 var aux timeRFC3339 5281 err = unpopulate(val, &aux) 5282 t.End = (*time.Time)(&aux) 5283 delete(rawMsg, key) 5284 case "start": 5285 var aux timeRFC3339 5286 err = unpopulate(val, &aux) 5287 t.Start = (*time.Time)(&aux) 5288 delete(rawMsg, key) 5289 case "timeZone": 5290 err = unpopulate(val, &t.TimeZone) 5291 delete(rawMsg, key) 5292 } 5293 if err != nil { 5294 return err 5295 } 5296 } 5297 return nil 5298} 5299 5300// TrackedEntityResource - An azure resource object 5301type TrackedEntityResource struct { 5302 // REQUIRED; Resource location 5303 Location *string `json:"location,omitempty"` 5304 5305 // Resource tags 5306 Tags map[string]*string `json:"tags,omitempty"` 5307 5308 // READ-ONLY; The etag field is not required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. 5309 // Entity tags are used for comparing two or more entities 5310 // from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and 5311 // If-Range (section 14.27) header fields. 5312 Etag *string `json:"etag,omitempty" azure:"ro"` 5313 5314 // READ-ONLY; Azure resource Id 5315 ID *string `json:"id,omitempty" azure:"ro"` 5316 5317 // READ-ONLY; Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites 5318 // type. If supported, the resource provider must 5319 // validate and persist this value. 5320 Kind *string `json:"kind,omitempty" azure:"ro"` 5321 5322 // READ-ONLY; Azure resource name 5323 Name *string `json:"name,omitempty" azure:"ro"` 5324 5325 // READ-ONLY; Azure resource type 5326 Type *string `json:"type,omitempty" azure:"ro"` 5327} 5328 5329// MarshalJSON implements the json.Marshaller interface for type TrackedEntityResource. 5330func (t TrackedEntityResource) MarshalJSON() ([]byte, error) { 5331 objectMap := t.marshalInternal() 5332 return json.Marshal(objectMap) 5333} 5334 5335func (t TrackedEntityResource) marshalInternal() map[string]interface{} { 5336 objectMap := make(map[string]interface{}) 5337 populate(objectMap, "etag", t.Etag) 5338 populate(objectMap, "id", t.ID) 5339 populate(objectMap, "kind", t.Kind) 5340 populate(objectMap, "location", t.Location) 5341 populate(objectMap, "name", t.Name) 5342 populate(objectMap, "tags", t.Tags) 5343 populate(objectMap, "type", t.Type) 5344 return objectMap 5345} 5346 5347// TriggerCondition - The condition that results in the Log Search rule. 5348type TriggerCondition struct { 5349 // REQUIRED; Result or count threshold based on which rule should be triggered. 5350 Threshold *float64 `json:"threshold,omitempty"` 5351 5352 // REQUIRED; Evaluation operation for rule - 'GreaterThan' or 'LessThan. 5353 ThresholdOperator *ConditionalOperator `json:"thresholdOperator,omitempty"` 5354 5355 // Trigger condition for metric query rule 5356 MetricTrigger *LogMetricTrigger `json:"metricTrigger,omitempty"` 5357} 5358 5359// VMInsightsGetOnboardingStatusOptions contains the optional parameters for the VMInsights.GetOnboardingStatus method. 5360type VMInsightsGetOnboardingStatusOptions struct { 5361 // placeholder for future optional parameters 5362} 5363 5364// VMInsightsOnboardingStatus - VM Insights onboarding status for a resource. 5365type VMInsightsOnboardingStatus struct { 5366 ProxyResource 5367 // Resource properties. 5368 Properties *VMInsightsOnboardingStatusProperties `json:"properties,omitempty"` 5369} 5370 5371// VMInsightsOnboardingStatusProperties - Resource properties. 5372type VMInsightsOnboardingStatusProperties struct { 5373 // REQUIRED; The status of VM Insights data from the resource. When reported as present the data array will contain information about the data containers 5374 // to which data for the specified resource is being routed. 5375 DataStatus *DataStatus `json:"dataStatus,omitempty"` 5376 5377 // REQUIRED; The onboarding status for the resource. Note that, a higher level scope, e.g., resource group or subscription, is considered onboarded if at 5378 // least one resource under it is onboarded. 5379 OnboardingStatus *OnboardingStatus `json:"onboardingStatus,omitempty"` 5380 5381 // REQUIRED; Azure Resource Manager identifier of the resource whose onboarding status is being represented. 5382 ResourceID *string `json:"resourceId,omitempty"` 5383 5384 // Containers that currently store VM Insights data for the specified resource. 5385 Data []*DataContainer `json:"data,omitempty"` 5386} 5387 5388// MarshalJSON implements the json.Marshaller interface for type VMInsightsOnboardingStatusProperties. 5389func (v VMInsightsOnboardingStatusProperties) MarshalJSON() ([]byte, error) { 5390 objectMap := make(map[string]interface{}) 5391 populate(objectMap, "data", v.Data) 5392 populate(objectMap, "dataStatus", v.DataStatus) 5393 populate(objectMap, "onboardingStatus", v.OnboardingStatus) 5394 populate(objectMap, "resourceId", v.ResourceID) 5395 return json.Marshal(objectMap) 5396} 5397 5398// VoiceReceiver - A voice receiver. 5399type VoiceReceiver struct { 5400 // REQUIRED; The country code of the voice receiver. 5401 CountryCode *string `json:"countryCode,omitempty"` 5402 5403 // REQUIRED; The name of the voice receiver. Names must be unique across all receivers within an action group. 5404 Name *string `json:"name,omitempty"` 5405 5406 // REQUIRED; The phone number of the voice receiver. 5407 PhoneNumber *string `json:"phoneNumber,omitempty"` 5408} 5409 5410// WebhookNotification - Webhook notification of an autoscale event. 5411type WebhookNotification struct { 5412 // a property bag of settings. This value can be empty. 5413 Properties map[string]*string `json:"properties,omitempty"` 5414 5415 // the service address to receive the notification. 5416 ServiceURI *string `json:"serviceUri,omitempty"` 5417} 5418 5419// MarshalJSON implements the json.Marshaller interface for type WebhookNotification. 5420func (w WebhookNotification) MarshalJSON() ([]byte, error) { 5421 objectMap := make(map[string]interface{}) 5422 populate(objectMap, "properties", w.Properties) 5423 populate(objectMap, "serviceUri", w.ServiceURI) 5424 return json.Marshal(objectMap) 5425} 5426 5427// WebhookReceiver - A webhook receiver. 5428type WebhookReceiver struct { 5429 // REQUIRED; The name of the webhook receiver. Names must be unique across all receivers within an action group. 5430 Name *string `json:"name,omitempty"` 5431 5432 // REQUIRED; The URI where webhooks should be sent. 5433 ServiceURI *string `json:"serviceUri,omitempty"` 5434 5435 // Indicates the identifier uri for aad auth. 5436 IdentifierURI *string `json:"identifierUri,omitempty"` 5437 5438 // Indicates the webhook app object Id for aad auth. 5439 ObjectID *string `json:"objectId,omitempty"` 5440 5441 // Indicates the tenant id for aad auth. 5442 TenantID *string `json:"tenantId,omitempty"` 5443 5444 // Indicates whether or not use AAD authentication. 5445 UseAADAuth *bool `json:"useAadAuth,omitempty"` 5446 5447 // Indicates whether to use common alert schema. 5448 UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"` 5449} 5450 5451// WebtestLocationAvailabilityCriteria - Specifies the metric alert rule criteria for a web test resource. 5452type WebtestLocationAvailabilityCriteria struct { 5453 MetricAlertCriteria 5454 // REQUIRED; The Application Insights resource Id. 5455 ComponentID *string `json:"componentId,omitempty"` 5456 5457 // REQUIRED; The number of failed locations. 5458 FailedLocationCount *float32 `json:"failedLocationCount,omitempty"` 5459 5460 // REQUIRED; The Application Insights web test Id. 5461 WebTestID *string `json:"webTestId,omitempty"` 5462} 5463 5464// MarshalJSON implements the json.Marshaller interface for type WebtestLocationAvailabilityCriteria. 5465func (w WebtestLocationAvailabilityCriteria) MarshalJSON() ([]byte, error) { 5466 objectMap := w.MetricAlertCriteria.marshalInternal(OdatatypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria) 5467 populate(objectMap, "componentId", w.ComponentID) 5468 populate(objectMap, "failedLocationCount", w.FailedLocationCount) 5469 populate(objectMap, "webTestId", w.WebTestID) 5470 return json.Marshal(objectMap) 5471} 5472 5473// UnmarshalJSON implements the json.Unmarshaller interface for type WebtestLocationAvailabilityCriteria. 5474func (w *WebtestLocationAvailabilityCriteria) UnmarshalJSON(data []byte) error { 5475 var rawMsg map[string]json.RawMessage 5476 if err := json.Unmarshal(data, &rawMsg); err != nil { 5477 return err 5478 } 5479 for key, val := range rawMsg { 5480 var err error 5481 switch key { 5482 case "componentId": 5483 err = unpopulate(val, &w.ComponentID) 5484 delete(rawMsg, key) 5485 case "failedLocationCount": 5486 err = unpopulate(val, &w.FailedLocationCount) 5487 delete(rawMsg, key) 5488 case "webTestId": 5489 err = unpopulate(val, &w.WebTestID) 5490 delete(rawMsg, key) 5491 } 5492 if err != nil { 5493 return err 5494 } 5495 } 5496 return w.MetricAlertCriteria.unmarshalInternal(rawMsg) 5497} 5498 5499// WindowsEventLogDataSource - Definition of which Windows Event Log events will be collected and how they will be collected. Only collected from Windows 5500// machines. 5501type WindowsEventLogDataSource struct { 5502 // A friendly name for the data source. This name should be unique across all data sources (regardless of type) within the data collection rule. 5503 Name *string `json:"name,omitempty"` 5504 5505 // List of streams that this data source will be sent to. A stream indicates what schema will be used for this data and usually what table in Log Analytics 5506 // the data will be sent to. 5507 Streams []*KnownWindowsEventLogDataSourceStreams `json:"streams,omitempty"` 5508 5509 // A list of Windows Event Log queries in XPATH format. 5510 XPathQueries []*string `json:"xPathQueries,omitempty"` 5511} 5512 5513// MarshalJSON implements the json.Marshaller interface for type WindowsEventLogDataSource. 5514func (w WindowsEventLogDataSource) MarshalJSON() ([]byte, error) { 5515 objectMap := make(map[string]interface{}) 5516 populate(objectMap, "name", w.Name) 5517 populate(objectMap, "streams", w.Streams) 5518 populate(objectMap, "xPathQueries", w.XPathQueries) 5519 return json.Marshal(objectMap) 5520} 5521 5522// WorkspaceInfo - Information about a Log Analytics Workspace. 5523type WorkspaceInfo struct { 5524 // REQUIRED; Azure Resource Manager identifier of the Log Analytics Workspace. 5525 ID *string `json:"id,omitempty"` 5526 5527 // REQUIRED; Location of the Log Analytics workspace. 5528 Location *string `json:"location,omitempty"` 5529 5530 // REQUIRED; Resource properties. 5531 Properties *WorkspaceInfoProperties `json:"properties,omitempty"` 5532} 5533 5534// WorkspaceInfoProperties - Resource properties. 5535type WorkspaceInfoProperties struct { 5536 // REQUIRED; Log Analytics workspace identifier. 5537 CustomerID *string `json:"customerId,omitempty"` 5538} 5539 5540func populate(m map[string]interface{}, k string, v interface{}) { 5541 if v == nil { 5542 return 5543 } else if azcore.IsNullValue(v) { 5544 m[k] = nil 5545 } else if !reflect.ValueOf(v).IsNil() { 5546 m[k] = v 5547 } 5548} 5549 5550func unpopulate(data json.RawMessage, v interface{}) error { 5551 if data == nil { 5552 return nil 5553 } 5554 return json.Unmarshal(data, v) 5555} 5556