diff --git a/services/alertsmanagement/mgmt/2018-05-05/alertsmanagement/CHANGELOG.md b/services/alertsmanagement/mgmt/2018-05-05/alertsmanagement/CHANGELOG.md index 52911e4cc5e4..c03be195b56f 100644 --- a/services/alertsmanagement/mgmt/2018-05-05/alertsmanagement/CHANGELOG.md +++ b/services/alertsmanagement/mgmt/2018-05-05/alertsmanagement/CHANGELOG.md @@ -1,2 +1,14 @@ -# Change History +# Unreleased +## Additive Changes + +### Struct Changes + +#### New Structs + +1. ActionStatus + +#### New Struct Fields + +1. Essentials.ActionStatus +1. Essentials.Description diff --git a/services/alertsmanagement/mgmt/2018-05-05/alertsmanagement/_meta.json b/services/alertsmanagement/mgmt/2018-05-05/alertsmanagement/_meta.json index b49eb7cb5a25..3a1027e72dfa 100644 --- a/services/alertsmanagement/mgmt/2018-05-05/alertsmanagement/_meta.json +++ b/services/alertsmanagement/mgmt/2018-05-05/alertsmanagement/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "f07a80688b1b43cf9ffc1db1a8858a42fd3184b3", "readme": "/_/azure-rest-api-specs/specification/alertsmanagement/resource-manager/readme.md", "tag": "package-2018-05", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/alertsmanagement/mgmt/2018-05-05/alertsmanagement/models.go b/services/alertsmanagement/mgmt/2018-05-05/alertsmanagement/models.go index 2da32e2cbca0..a3dcd6dffbde 100644 --- a/services/alertsmanagement/mgmt/2018-05-05/alertsmanagement/models.go +++ b/services/alertsmanagement/mgmt/2018-05-05/alertsmanagement/models.go @@ -19,6 +19,12 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/alertsmanagement/mgmt/2018-05-05/alertsmanagement" +// ActionStatus action status +type ActionStatus struct { + // IsSuppressed - Value indicating whether alert is suppressed. + IsSuppressed *bool `json:"isSuppressed,omitempty"` +} + // Alert an alert created in alert management service. type Alert struct { autorest.Response `json:"-"` @@ -359,7 +365,10 @@ type Essentials struct { // MonitorConditionResolvedDateTime - READ-ONLY; Resolved time(ISO-8601 format) of alert instance. This will be updated when monitor service resolves the alert instance because the rule condition is no longer met. MonitorConditionResolvedDateTime *date.Time `json:"monitorConditionResolvedDateTime,omitempty"` // LastModifiedUserName - READ-ONLY; User who last modified the alert, in case of monitor service updates user would be 'system', otherwise name of the user. - LastModifiedUserName *string `json:"lastModifiedUserName,omitempty"` + LastModifiedUserName *string `json:"lastModifiedUserName,omitempty"` + ActionStatus *ActionStatus `json:"actionStatus,omitempty"` + // Description - Alert description. + Description *string `json:"description,omitempty"` } // MarshalJSON is the custom marshaler for Essentials. @@ -377,6 +386,12 @@ func (e Essentials) MarshalJSON() ([]byte, error) { if e.TargetResourceType != nil { objectMap["targetResourceType"] = e.TargetResourceType } + if e.ActionStatus != nil { + objectMap["actionStatus"] = e.ActionStatus + } + if e.Description != nil { + objectMap["description"] = e.Description + } return json.Marshal(objectMap) } diff --git a/services/alertsmanagement/mgmt/2019-03-01/alertsmanagement/CHANGELOG.md b/services/alertsmanagement/mgmt/2019-03-01/alertsmanagement/CHANGELOG.md index 52911e4cc5e4..9927fbf611c3 100644 --- a/services/alertsmanagement/mgmt/2019-03-01/alertsmanagement/CHANGELOG.md +++ b/services/alertsmanagement/mgmt/2019-03-01/alertsmanagement/CHANGELOG.md @@ -1,2 +1,40 @@ -# Change History +# Unreleased +## Breaking Changes + +### Signature Changes + +#### Funcs + +1. AlertsClient.ChangeState + - Params + - From: context.Context, string, AlertState + - To: context.Context, string, AlertState, string +1. AlertsClient.ChangeStatePreparer + - Params + - From: context.Context, string, AlertState + - To: context.Context, string, AlertState, string + +## Additive Changes + +### New Funcs + +1. *AlertRulePatchObject.UnmarshalJSON([]byte) error +1. AlertRulePatchObject.MarshalJSON() ([]byte, error) +1. SmartDetectorAlertRulesClient.Patch(context.Context, string, string, AlertRulePatchObject) (AlertRule, error) +1. SmartDetectorAlertRulesClient.PatchPreparer(context.Context, string, string, AlertRulePatchObject) (*http.Request, error) +1. SmartDetectorAlertRulesClient.PatchResponder(*http.Response) (AlertRule, error) +1. SmartDetectorAlertRulesClient.PatchSender(*http.Request) (*http.Response, error) + +### Struct Changes + +#### New Structs + +1. ActionStatus +1. AlertRulePatchObject +1. AlertRulePatchProperties + +#### New Struct Fields + +1. Essentials.ActionStatus +1. Essentials.Description diff --git a/services/alertsmanagement/mgmt/2019-03-01/alertsmanagement/_meta.json b/services/alertsmanagement/mgmt/2019-03-01/alertsmanagement/_meta.json index 6e530988ef27..6afb70b92cda 100644 --- a/services/alertsmanagement/mgmt/2019-03-01/alertsmanagement/_meta.json +++ b/services/alertsmanagement/mgmt/2019-03-01/alertsmanagement/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "f07a80688b1b43cf9ffc1db1a8858a42fd3184b3", "readme": "/_/azure-rest-api-specs/specification/alertsmanagement/resource-manager/readme.md", "tag": "package-2019-03", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/alertsmanagement/mgmt/2019-03-01/alertsmanagement/alerts.go b/services/alertsmanagement/mgmt/2019-03-01/alertsmanagement/alerts.go index 3c6d76c2824c..5e87bbc8dd1a 100644 --- a/services/alertsmanagement/mgmt/2019-03-01/alertsmanagement/alerts.go +++ b/services/alertsmanagement/mgmt/2019-03-01/alertsmanagement/alerts.go @@ -39,7 +39,8 @@ func NewAlertsClientWithBaseURI(baseURI string, scope string, subscriptionID str // Parameters: // alertID - unique ID of an alert instance. // newState - new state of the alert. -func (client AlertsClient) ChangeState(ctx context.Context, alertID string, newState AlertState) (result Alert, err error) { +// comment - reason of change alert state +func (client AlertsClient) ChangeState(ctx context.Context, alertID string, newState AlertState, comment string) (result Alert, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ChangeState") defer func() { @@ -50,7 +51,7 @@ func (client AlertsClient) ChangeState(ctx context.Context, alertID string, newS tracing.EndSpan(ctx, sc, err) }() } - req, err := client.ChangeStatePreparer(ctx, alertID, newState) + req, err := client.ChangeStatePreparer(ctx, alertID, newState, comment) if err != nil { err = autorest.NewErrorWithError(err, "alertsmanagement.AlertsClient", "ChangeState", nil, "Failure preparing request") return @@ -73,7 +74,7 @@ func (client AlertsClient) ChangeState(ctx context.Context, alertID string, newS } // ChangeStatePreparer prepares the ChangeState request. -func (client AlertsClient) ChangeStatePreparer(ctx context.Context, alertID string, newState AlertState) (*http.Request, error) { +func (client AlertsClient) ChangeStatePreparer(ctx context.Context, alertID string, newState AlertState, comment string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertId": autorest.Encode("path", alertID), "scope": client.Scope, @@ -86,10 +87,15 @@ func (client AlertsClient) ChangeStatePreparer(ctx context.Context, alertID stri } preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{scope}/providers/Microsoft.AlertsManagement/alerts/{alertId}/changestate", pathParameters), autorest.WithQueryParameters(queryParameters)) + if len(comment) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(comment)) + } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/alertsmanagement/mgmt/2019-03-01/alertsmanagement/alertsmanagementapi/interfaces.go b/services/alertsmanagement/mgmt/2019-03-01/alertsmanagement/alertsmanagementapi/interfaces.go index 15a6ef20e124..9d2858bd2db1 100644 --- a/services/alertsmanagement/mgmt/2019-03-01/alertsmanagement/alertsmanagementapi/interfaces.go +++ b/services/alertsmanagement/mgmt/2019-03-01/alertsmanagement/alertsmanagementapi/interfaces.go @@ -22,7 +22,7 @@ var _ OperationsClientAPI = (*alertsmanagement.OperationsClient)(nil) // AlertsClientAPI contains the set of methods on the AlertsClient type. type AlertsClientAPI interface { - ChangeState(ctx context.Context, alertID string, newState alertsmanagement.AlertState) (result alertsmanagement.Alert, err error) + ChangeState(ctx context.Context, alertID string, newState alertsmanagement.AlertState, comment string) (result alertsmanagement.Alert, err error) GetAll(ctx context.Context, targetResource string, targetResourceType string, targetResourceGroup string, monitorService alertsmanagement.MonitorService, monitorCondition alertsmanagement.MonitorCondition, severity alertsmanagement.Severity, alertState alertsmanagement.AlertState, alertRule string, smartGroupID string, includeContext *bool, includeEgressConfig *bool, pageCount *int32, sortBy alertsmanagement.AlertsSortByFields, sortOrder string, selectParameter string, timeRange alertsmanagement.TimeRange, customTimeRange string) (result alertsmanagement.AlertsListPage, err error) GetAllComplete(ctx context.Context, targetResource string, targetResourceType string, targetResourceGroup string, monitorService alertsmanagement.MonitorService, monitorCondition alertsmanagement.MonitorCondition, severity alertsmanagement.Severity, alertState alertsmanagement.AlertState, alertRule string, smartGroupID string, includeContext *bool, includeEgressConfig *bool, pageCount *int32, sortBy alertsmanagement.AlertsSortByFields, sortOrder string, selectParameter string, timeRange alertsmanagement.TimeRange, customTimeRange string) (result alertsmanagement.AlertsListIterator, err error) GetByID(ctx context.Context, alertID string) (result alertsmanagement.Alert, err error) @@ -42,6 +42,7 @@ type SmartDetectorAlertRulesClientAPI interface { ListComplete(ctx context.Context) (result alertsmanagement.AlertRulesListIterator, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result alertsmanagement.AlertRulesListPage, err error) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result alertsmanagement.AlertRulesListIterator, err error) + Patch(ctx context.Context, resourceGroupName string, alertRuleName string, parameters alertsmanagement.AlertRulePatchObject) (result alertsmanagement.AlertRule, err error) } var _ SmartDetectorAlertRulesClientAPI = (*alertsmanagement.SmartDetectorAlertRulesClient)(nil) diff --git a/services/alertsmanagement/mgmt/2019-03-01/alertsmanagement/models.go b/services/alertsmanagement/mgmt/2019-03-01/alertsmanagement/models.go index 06f4c6f71832..50c24f7d9384 100644 --- a/services/alertsmanagement/mgmt/2019-03-01/alertsmanagement/models.go +++ b/services/alertsmanagement/mgmt/2019-03-01/alertsmanagement/models.go @@ -29,6 +29,12 @@ type ActionGroupsInformation struct { GroupIds *[]string `json:"groupIds,omitempty"` } +// ActionStatus action status +type ActionStatus struct { + // IsSuppressed - Value indicating whether alert is suppressed. + IsSuppressed *bool `json:"isSuppressed,omitempty"` +} + // Alert an alert created in alert management service. type Alert struct { autorest.Response `json:"-"` @@ -186,6 +192,108 @@ func (ar *AlertRule) UnmarshalJSON(body []byte) error { return nil } +// AlertRulePatchObject the alert rule patch information +type AlertRulePatchObject struct { + // ID - READ-ONLY; The resource ID. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The resource type. + Type *string `json:"type,omitempty"` + // Name - READ-ONLY; The resource name. + Name *string `json:"name,omitempty"` + // Tags - The resource tags. + Tags interface{} `json:"tags,omitempty"` + // AlertRulePatchProperties - The properties of the alert rule. + *AlertRulePatchProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AlertRulePatchObject. +func (arpo AlertRulePatchObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if arpo.Tags != nil { + objectMap["tags"] = arpo.Tags + } + if arpo.AlertRulePatchProperties != nil { + objectMap["properties"] = arpo.AlertRulePatchProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AlertRulePatchObject struct. +func (arpo *AlertRulePatchObject) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + arpo.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + arpo.Type = &typeVar + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + arpo.Name = &name + } + case "tags": + if v != nil { + var tags interface{} + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + arpo.Tags = tags + } + case "properties": + if v != nil { + var alertRulePatchProperties AlertRulePatchProperties + err = json.Unmarshal(*v, &alertRulePatchProperties) + if err != nil { + return err + } + arpo.AlertRulePatchProperties = &alertRulePatchProperties + } + } + } + + return nil +} + +// AlertRulePatchProperties the alert rule properties. +type AlertRulePatchProperties struct { + // Description - The alert rule description. + Description *string `json:"description,omitempty"` + // State - The alert rule state. Possible values include: 'Enabled', 'Disabled' + State AlertRuleState `json:"state,omitempty"` + // Severity - The alert rule severity. Possible values include: 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' + Severity Severity `json:"severity,omitempty"` + // Frequency - The alert rule frequency in ISO8601 format. The time granularity must be in minutes and minimum value is 5 minutes. + Frequency *string `json:"frequency,omitempty"` + // ActionGroups - The alert rule actions. + ActionGroups *ActionGroupsInformation `json:"actionGroups,omitempty"` + // Throttling - The alert rule throttling information. + Throttling *ThrottlingInformation `json:"throttling,omitempty"` +} + // AlertRuleProperties the alert rule properties. type AlertRuleProperties struct { // Description - The alert rule description. @@ -781,7 +889,10 @@ type Essentials struct { // MonitorConditionResolvedDateTime - READ-ONLY; Resolved time(ISO-8601 format) of alert instance. This will be updated when monitor service resolves the alert instance because the rule condition is no longer met. MonitorConditionResolvedDateTime *date.Time `json:"monitorConditionResolvedDateTime,omitempty"` // LastModifiedUserName - READ-ONLY; User who last modified the alert, in case of monitor service updates user would be 'system', otherwise name of the user. - LastModifiedUserName *string `json:"lastModifiedUserName,omitempty"` + LastModifiedUserName *string `json:"lastModifiedUserName,omitempty"` + ActionStatus *ActionStatus `json:"actionStatus,omitempty"` + // Description - Alert description. + Description *string `json:"description,omitempty"` } // MarshalJSON is the custom marshaler for Essentials. @@ -799,6 +910,12 @@ func (e Essentials) MarshalJSON() ([]byte, error) { if e.TargetResourceType != nil { objectMap["targetResourceType"] = e.TargetResourceType } + if e.ActionStatus != nil { + objectMap["actionStatus"] = e.ActionStatus + } + if e.Description != nil { + objectMap["description"] = e.Description + } return json.Marshal(objectMap) } diff --git a/services/alertsmanagement/mgmt/2019-03-01/alertsmanagement/smartdetectoralertrules.go b/services/alertsmanagement/mgmt/2019-03-01/alertsmanagement/smartdetectoralertrules.go index c2355f2ad643..e4bae7394b6b 100644 --- a/services/alertsmanagement/mgmt/2019-03-01/alertsmanagement/smartdetectoralertrules.go +++ b/services/alertsmanagement/mgmt/2019-03-01/alertsmanagement/smartdetectoralertrules.go @@ -507,3 +507,85 @@ func (client SmartDetectorAlertRulesClient) ListByResourceGroupComplete(ctx cont result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) return } + +// Patch patch a specific Smart Detector alert rule. +// Parameters: +// resourceGroupName - the name of the resource group. +// alertRuleName - the name of the alert rule. +// parameters - parameters supplied to the operation. +func (client SmartDetectorAlertRulesClient) Patch(ctx context.Context, resourceGroupName string, alertRuleName string, parameters AlertRulePatchObject) (result AlertRule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SmartDetectorAlertRulesClient.Patch") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PatchPreparer(ctx, resourceGroupName, alertRuleName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "alertsmanagement.SmartDetectorAlertRulesClient", "Patch", nil, "Failure preparing request") + return + } + + resp, err := client.PatchSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "alertsmanagement.SmartDetectorAlertRulesClient", "Patch", resp, "Failure sending request") + return + } + + result, err = client.PatchResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "alertsmanagement.SmartDetectorAlertRulesClient", "Patch", resp, "Failure responding to request") + return + } + + return +} + +// PatchPreparer prepares the Patch request. +func (client SmartDetectorAlertRulesClient) PatchPreparer(ctx context.Context, resourceGroupName string, alertRuleName string, parameters AlertRulePatchObject) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertRuleName": autorest.Encode("path", alertRuleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.ID = nil + parameters.Type = nil + parameters.Name = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.alertsManagement/smartDetectorAlertRules/{alertRuleName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PatchSender sends the Patch request. The method will close the +// http.Response Body if it receives an error. +func (client SmartDetectorAlertRulesClient) PatchSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// PatchResponder handles the response to the Patch request. The method always +// closes the http.Response Body. +func (client SmartDetectorAlertRulesClient) PatchResponder(resp *http.Response) (result AlertRule, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/CHANGELOG.md b/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/CHANGELOG.md index 52911e4cc5e4..f66ceb5155e7 100644 --- a/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/CHANGELOG.md +++ b/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/CHANGELOG.md @@ -1,2 +1,15 @@ -# Change History +# Unreleased +## Additive Changes + +### Struct Changes + +#### New Structs + +1. ActionStatus + +#### New Struct Fields + +1. AlertProperties.ActionStatus +1. AlertProperties.AlertRule +1. AlertProperties.Description diff --git a/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/_meta.json b/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/_meta.json index 1363b441e666..ede2fabedb55 100644 --- a/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/_meta.json +++ b/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "f07a80688b1b43cf9ffc1db1a8858a42fd3184b3", "readme": "/_/azure-rest-api-specs/specification/alertsmanagement/resource-manager/readme.md", "tag": "package-2018-05-preview", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/models.go b/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/models.go index cd711d4bebde..4ac72a7303d3 100644 --- a/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/models.go +++ b/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/models.go @@ -19,6 +19,12 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement" +// ActionStatus action status +type ActionStatus struct { + // IsSuppressed - Value indicating whether alert is suppressed. + IsSuppressed *bool `json:"isSuppressed,omitempty"` +} + // Alert an alert created in alert management service. type Alert struct { autorest.Response `json:"-"` @@ -167,6 +173,8 @@ type AlertProperties struct { TargetResourceType *string `json:"targetResourceType,omitempty"` // MonitorService - READ-ONLY; Monitor service which is the source of the alert object. Possible values include: 'Platform', 'ApplicationInsights', 'LogAnalytics', 'InfrastructureInsights', 'ActivityLogAdministrative', 'ActivityLogSecurity', 'ActivityLogRecommendation', 'ActivityLogPolicy', 'ActivityLogAutoscale', 'ServiceHealth', 'SmartDetector', 'Zabbix', 'SCOM', 'Nagios' MonitorService MonitorService `json:"monitorService,omitempty"` + // AlertRule - READ-ONLY; Rule(monitor) which fired alert instance. Depending on the monitor service, this would be ARM id or name of the rule. + AlertRule *string `json:"alertRule,omitempty"` // SourceCreatedID - READ-ONLY; Unique Id created by monitor service SourceCreatedID *string `json:"sourceCreatedId,omitempty"` // SmartGroupID - READ-ONLY; Unique Id of the smart group @@ -180,7 +188,10 @@ type AlertProperties struct { // LastModifiedUserName - READ-ONLY; User who last modified the alert. LastModifiedUserName *string `json:"lastModifiedUserName,omitempty"` // Payload - READ-ONLY; More details which are contextual to the monitor service. - Payload interface{} `json:"payload,omitempty"` + Payload interface{} `json:"payload,omitempty"` + ActionStatus *ActionStatus `json:"actionStatus,omitempty"` + // Description - Alert description. + Description *string `json:"description,omitempty"` } // MarshalJSON is the custom marshaler for AlertProperties. @@ -198,6 +209,12 @@ func (ap AlertProperties) MarshalJSON() ([]byte, error) { if ap.TargetResourceType != nil { objectMap["targetResourceType"] = ap.TargetResourceType } + if ap.ActionStatus != nil { + objectMap["actionStatus"] = ap.ActionStatus + } + if ap.Description != nil { + objectMap["description"] = ap.Description + } return json.Marshal(objectMap) } diff --git a/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/CHANGELOG.md b/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/CHANGELOG.md index 52911e4cc5e4..7d0cbd92d52f 100644 --- a/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/CHANGELOG.md +++ b/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/CHANGELOG.md @@ -1,2 +1,71 @@ -# Change History +# Unreleased +## Breaking Changes + +### Signature Changes + +#### Funcs + +1. AlertsClient.ChangeState + - Params + - From: context.Context, string, AlertState + - To: context.Context, string, AlertState, string +1. AlertsClient.ChangeStatePreparer + - Params + - From: context.Context, string, AlertState + - To: context.Context, string, AlertState, string +1. AlertsClient.GetAll + - Params + - From: context.Context, string, string, string, MonitorService, MonitorCondition, Severity, AlertState, string, string, *bool, *bool, *int32, AlertsSortByFields, string, string, TimeRange, string + - To: context.Context, string, string, string, MonitorService, MonitorCondition, Severity, AlertState, string, string, *bool, *bool, *int64, AlertsSortByFields, SortOrder, string, TimeRange, string +1. AlertsClient.GetAllComplete + - Params + - From: context.Context, string, string, string, MonitorService, MonitorCondition, Severity, AlertState, string, string, *bool, *bool, *int32, AlertsSortByFields, string, string, TimeRange, string + - To: context.Context, string, string, string, MonitorService, MonitorCondition, Severity, AlertState, string, string, *bool, *bool, *int64, AlertsSortByFields, SortOrder, string, TimeRange, string +1. AlertsClient.GetAllPreparer + - Params + - From: context.Context, string, string, string, MonitorService, MonitorCondition, Severity, AlertState, string, string, *bool, *bool, *int32, AlertsSortByFields, string, string, TimeRange, string + - To: context.Context, string, string, string, MonitorService, MonitorCondition, Severity, AlertState, string, string, *bool, *bool, *int64, AlertsSortByFields, SortOrder, string, TimeRange, string +1. SmartGroupsClient.GetAll + - Params + - From: context.Context, string, string, string, MonitorService, MonitorCondition, Severity, AlertState, TimeRange, *int32, SmartGroupsSortByFields, string + - To: context.Context, string, string, string, MonitorService, MonitorCondition, Severity, AlertState, TimeRange, *int64, SmartGroupsSortByFields, SortOrder +1. SmartGroupsClient.GetAllComplete + - Params + - From: context.Context, string, string, string, MonitorService, MonitorCondition, Severity, AlertState, TimeRange, *int32, SmartGroupsSortByFields, string + - To: context.Context, string, string, string, MonitorService, MonitorCondition, Severity, AlertState, TimeRange, *int64, SmartGroupsSortByFields, SortOrder +1. SmartGroupsClient.GetAllPreparer + - Params + - From: context.Context, string, string, string, MonitorService, MonitorCondition, Severity, AlertState, TimeRange, *int32, SmartGroupsSortByFields, string + - To: context.Context, string, string, string, MonitorService, MonitorCondition, Severity, AlertState, TimeRange, *int64, SmartGroupsSortByFields, SortOrder + +#### Struct Fields + +1. AlertsSummaryGroup.SmartGroupsCount changed type from *int32 to *int64 +1. AlertsSummaryGroup.Total changed type from *int32 to *int64 +1. AlertsSummaryGroupItem.Count changed type from *int32 to *int64 +1. SmartGroupAggregatedProperty.Count changed type from *int32 to *int64 +1. SmartGroupProperties.AlertsCount changed type from *int32 to *int64 + +## Additive Changes + +### New Constants + +1. SortOrder.Asc +1. SortOrder.Desc + +### New Funcs + +1. PossibleSortOrderValues() []SortOrder + +### Struct Changes + +#### New Structs + +1. ActionStatus + +#### New Struct Fields + +1. Essentials.ActionStatus +1. Essentials.Description +1. Operation.Origin diff --git a/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/_meta.json b/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/_meta.json index 7a1b5337145c..0f1356012ccd 100644 --- a/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/_meta.json +++ b/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "f07a80688b1b43cf9ffc1db1a8858a42fd3184b3", "readme": "/_/azure-rest-api-specs/specification/alertsmanagement/resource-manager/readme.md", "tag": "package-preview-2019-05", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/alerts.go b/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/alerts.go index 3098f6aa8989..1284de759944 100644 --- a/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/alerts.go +++ b/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/alerts.go @@ -35,7 +35,8 @@ func NewAlertsClientWithBaseURI(baseURI string, subscriptionID string) AlertsCli // Parameters: // alertID - unique ID of an alert instance. // newState - new state of the alert. -func (client AlertsClient) ChangeState(ctx context.Context, alertID string, newState AlertState) (result Alert, err error) { +// comment - reason of change alert state +func (client AlertsClient) ChangeState(ctx context.Context, alertID string, newState AlertState, comment string) (result Alert, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ChangeState") defer func() { @@ -52,7 +53,7 @@ func (client AlertsClient) ChangeState(ctx context.Context, alertID string, newS return result, validation.NewError("alertsmanagement.AlertsClient", "ChangeState", err.Error()) } - req, err := client.ChangeStatePreparer(ctx, alertID, newState) + req, err := client.ChangeStatePreparer(ctx, alertID, newState, comment) if err != nil { err = autorest.NewErrorWithError(err, "alertsmanagement.AlertsClient", "ChangeState", nil, "Failure preparing request") return @@ -75,7 +76,7 @@ func (client AlertsClient) ChangeState(ctx context.Context, alertID string, newS } // ChangeStatePreparer prepares the ChangeState request. -func (client AlertsClient) ChangeStatePreparer(ctx context.Context, alertID string, newState AlertState) (*http.Request, error) { +func (client AlertsClient) ChangeStatePreparer(ctx context.Context, alertID string, newState AlertState, comment string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertId": autorest.Encode("path", alertID), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -88,10 +89,15 @@ func (client AlertsClient) ChangeStatePreparer(ctx context.Context, alertID stri } preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId}/changestate", pathParameters), autorest.WithQueryParameters(queryParameters)) + if len(comment) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(comment)) + } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -142,7 +148,7 @@ func (client AlertsClient) ChangeStateResponder(resp *http.Response) (result Ale // customTimeRange - filter by custom time range in the format / where time is in // (ISO-8601 format)'. Permissible values is within 30 days from query time. Either timeRange or // customTimeRange could be used but not both. Default is none. -func (client AlertsClient) GetAll(ctx context.Context, targetResource string, targetResourceType string, targetResourceGroup string, monitorService MonitorService, monitorCondition MonitorCondition, severity Severity, alertState AlertState, alertRule string, smartGroupID string, includeContext *bool, includeEgressConfig *bool, pageCount *int32, sortBy AlertsSortByFields, sortOrder string, selectParameter string, timeRange TimeRange, customTimeRange string) (result AlertsListPage, err error) { +func (client AlertsClient) GetAll(ctx context.Context, targetResource string, targetResourceType string, targetResourceGroup string, monitorService MonitorService, monitorCondition MonitorCondition, severity Severity, alertState AlertState, alertRule string, smartGroupID string, includeContext *bool, includeEgressConfig *bool, pageCount *int64, sortBy AlertsSortByFields, sortOrder SortOrder, selectParameter string, timeRange TimeRange, customTimeRange string) (result AlertsListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.GetAll") defer func() { @@ -187,7 +193,7 @@ func (client AlertsClient) GetAll(ctx context.Context, targetResource string, ta } // GetAllPreparer prepares the GetAll request. -func (client AlertsClient) GetAllPreparer(ctx context.Context, targetResource string, targetResourceType string, targetResourceGroup string, monitorService MonitorService, monitorCondition MonitorCondition, severity Severity, alertState AlertState, alertRule string, smartGroupID string, includeContext *bool, includeEgressConfig *bool, pageCount *int32, sortBy AlertsSortByFields, sortOrder string, selectParameter string, timeRange TimeRange, customTimeRange string) (*http.Request, error) { +func (client AlertsClient) GetAllPreparer(ctx context.Context, targetResource string, targetResourceType string, targetResourceGroup string, monitorService MonitorService, monitorCondition MonitorCondition, severity Severity, alertState AlertState, alertRule string, smartGroupID string, includeContext *bool, includeEgressConfig *bool, pageCount *int64, sortBy AlertsSortByFields, sortOrder SortOrder, selectParameter string, timeRange TimeRange, customTimeRange string) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -296,7 +302,7 @@ func (client AlertsClient) getAllNextResults(ctx context.Context, lastResults Al } // GetAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client AlertsClient) GetAllComplete(ctx context.Context, targetResource string, targetResourceType string, targetResourceGroup string, monitorService MonitorService, monitorCondition MonitorCondition, severity Severity, alertState AlertState, alertRule string, smartGroupID string, includeContext *bool, includeEgressConfig *bool, pageCount *int32, sortBy AlertsSortByFields, sortOrder string, selectParameter string, timeRange TimeRange, customTimeRange string) (result AlertsListIterator, err error) { +func (client AlertsClient) GetAllComplete(ctx context.Context, targetResource string, targetResourceType string, targetResourceGroup string, monitorService MonitorService, monitorCondition MonitorCondition, severity Severity, alertState AlertState, alertRule string, smartGroupID string, includeContext *bool, includeEgressConfig *bool, pageCount *int64, sortBy AlertsSortByFields, sortOrder SortOrder, selectParameter string, timeRange TimeRange, customTimeRange string) (result AlertsListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.GetAll") defer func() { diff --git a/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/alertsmanagementapi/interfaces.go b/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/alertsmanagementapi/interfaces.go index 931ecfc8e321..63c9e7affbfb 100644 --- a/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/alertsmanagementapi/interfaces.go +++ b/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/alertsmanagementapi/interfaces.go @@ -35,9 +35,9 @@ var _ OperationsClientAPI = (*alertsmanagement.OperationsClient)(nil) // AlertsClientAPI contains the set of methods on the AlertsClient type. type AlertsClientAPI interface { - ChangeState(ctx context.Context, alertID string, newState alertsmanagement.AlertState) (result alertsmanagement.Alert, err error) - GetAll(ctx context.Context, targetResource string, targetResourceType string, targetResourceGroup string, monitorService alertsmanagement.MonitorService, monitorCondition alertsmanagement.MonitorCondition, severity alertsmanagement.Severity, alertState alertsmanagement.AlertState, alertRule string, smartGroupID string, includeContext *bool, includeEgressConfig *bool, pageCount *int32, sortBy alertsmanagement.AlertsSortByFields, sortOrder string, selectParameter string, timeRange alertsmanagement.TimeRange, customTimeRange string) (result alertsmanagement.AlertsListPage, err error) - GetAllComplete(ctx context.Context, targetResource string, targetResourceType string, targetResourceGroup string, monitorService alertsmanagement.MonitorService, monitorCondition alertsmanagement.MonitorCondition, severity alertsmanagement.Severity, alertState alertsmanagement.AlertState, alertRule string, smartGroupID string, includeContext *bool, includeEgressConfig *bool, pageCount *int32, sortBy alertsmanagement.AlertsSortByFields, sortOrder string, selectParameter string, timeRange alertsmanagement.TimeRange, customTimeRange string) (result alertsmanagement.AlertsListIterator, err error) + ChangeState(ctx context.Context, alertID string, newState alertsmanagement.AlertState, comment string) (result alertsmanagement.Alert, err error) + GetAll(ctx context.Context, targetResource string, targetResourceType string, targetResourceGroup string, monitorService alertsmanagement.MonitorService, monitorCondition alertsmanagement.MonitorCondition, severity alertsmanagement.Severity, alertState alertsmanagement.AlertState, alertRule string, smartGroupID string, includeContext *bool, includeEgressConfig *bool, pageCount *int64, sortBy alertsmanagement.AlertsSortByFields, sortOrder alertsmanagement.SortOrder, selectParameter string, timeRange alertsmanagement.TimeRange, customTimeRange string) (result alertsmanagement.AlertsListPage, err error) + GetAllComplete(ctx context.Context, targetResource string, targetResourceType string, targetResourceGroup string, monitorService alertsmanagement.MonitorService, monitorCondition alertsmanagement.MonitorCondition, severity alertsmanagement.Severity, alertState alertsmanagement.AlertState, alertRule string, smartGroupID string, includeContext *bool, includeEgressConfig *bool, pageCount *int64, sortBy alertsmanagement.AlertsSortByFields, sortOrder alertsmanagement.SortOrder, selectParameter string, timeRange alertsmanagement.TimeRange, customTimeRange string) (result alertsmanagement.AlertsListIterator, err error) GetByID(ctx context.Context, alertID string) (result alertsmanagement.Alert, err error) GetHistory(ctx context.Context, alertID string) (result alertsmanagement.AlertModification, err error) GetSummary(ctx context.Context, groupby alertsmanagement.AlertsSummaryGroupByFields, includeSmartGroupsCount *bool, targetResource string, targetResourceType string, targetResourceGroup string, monitorService alertsmanagement.MonitorService, monitorCondition alertsmanagement.MonitorCondition, severity alertsmanagement.Severity, alertState alertsmanagement.AlertState, alertRule string, timeRange alertsmanagement.TimeRange, customTimeRange string) (result alertsmanagement.AlertsSummary, err error) @@ -49,8 +49,8 @@ var _ AlertsClientAPI = (*alertsmanagement.AlertsClient)(nil) // SmartGroupsClientAPI contains the set of methods on the SmartGroupsClient type. type SmartGroupsClientAPI interface { ChangeState(ctx context.Context, smartGroupID string, newState alertsmanagement.AlertState) (result alertsmanagement.SmartGroup, err error) - GetAll(ctx context.Context, targetResource string, targetResourceGroup string, targetResourceType string, monitorService alertsmanagement.MonitorService, monitorCondition alertsmanagement.MonitorCondition, severity alertsmanagement.Severity, smartGroupState alertsmanagement.AlertState, timeRange alertsmanagement.TimeRange, pageCount *int32, sortBy alertsmanagement.SmartGroupsSortByFields, sortOrder string) (result alertsmanagement.SmartGroupsListPage, err error) - GetAllComplete(ctx context.Context, targetResource string, targetResourceGroup string, targetResourceType string, monitorService alertsmanagement.MonitorService, monitorCondition alertsmanagement.MonitorCondition, severity alertsmanagement.Severity, smartGroupState alertsmanagement.AlertState, timeRange alertsmanagement.TimeRange, pageCount *int32, sortBy alertsmanagement.SmartGroupsSortByFields, sortOrder string) (result alertsmanagement.SmartGroupsListIterator, err error) + GetAll(ctx context.Context, targetResource string, targetResourceGroup string, targetResourceType string, monitorService alertsmanagement.MonitorService, monitorCondition alertsmanagement.MonitorCondition, severity alertsmanagement.Severity, smartGroupState alertsmanagement.AlertState, timeRange alertsmanagement.TimeRange, pageCount *int64, sortBy alertsmanagement.SmartGroupsSortByFields, sortOrder alertsmanagement.SortOrder) (result alertsmanagement.SmartGroupsListPage, err error) + GetAllComplete(ctx context.Context, targetResource string, targetResourceGroup string, targetResourceType string, monitorService alertsmanagement.MonitorService, monitorCondition alertsmanagement.MonitorCondition, severity alertsmanagement.Severity, smartGroupState alertsmanagement.AlertState, timeRange alertsmanagement.TimeRange, pageCount *int64, sortBy alertsmanagement.SmartGroupsSortByFields, sortOrder alertsmanagement.SortOrder) (result alertsmanagement.SmartGroupsListIterator, err error) GetByID(ctx context.Context, smartGroupID string) (result alertsmanagement.SmartGroup, err error) GetHistory(ctx context.Context, smartGroupID string) (result alertsmanagement.SmartGroupModification, err error) } diff --git a/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/enums.go b/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/enums.go index 9c4501934382..0423fb6a99b9 100644 --- a/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/enums.go +++ b/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/enums.go @@ -304,6 +304,21 @@ func PossibleSmartGroupsSortByFieldsValues() []SmartGroupsSortByFields { return []SmartGroupsSortByFields{SmartGroupsSortByFieldsAlertsCount, SmartGroupsSortByFieldsLastModifiedDateTime, SmartGroupsSortByFieldsSeverity, SmartGroupsSortByFieldsStartDateTime, SmartGroupsSortByFieldsState} } +// SortOrder enumerates the values for sort order. +type SortOrder string + +const ( + // Asc ... + Asc SortOrder = "asc" + // Desc ... + Desc SortOrder = "desc" +) + +// PossibleSortOrderValues returns an array of possible values for the SortOrder const type. +func PossibleSortOrderValues() []SortOrder { + return []SortOrder{Asc, Desc} +} + // State enumerates the values for state. type State string diff --git a/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/models.go b/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/models.go index 33a9d2494182..97cb467bfc70 100644 --- a/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/models.go +++ b/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/models.go @@ -472,6 +472,12 @@ func NewActionRulesListPage(cur ActionRulesList, getNextPage func(context.Contex } } +// ActionStatus action status +type ActionStatus struct { + // IsSuppressed - Value indicating whether alert is suppressed. + IsSuppressed *bool `json:"isSuppressed,omitempty"` +} + // Alert an alert created in alert management service. type Alert struct { autorest.Response `json:"-"` @@ -842,9 +848,9 @@ func (as AlertsSummary) MarshalJSON() ([]byte, error) { // AlertsSummaryGroup group the result set. type AlertsSummaryGroup struct { // Total - Total count of the result set. - Total *int32 `json:"total,omitempty"` + Total *int64 `json:"total,omitempty"` // SmartGroupsCount - Total count of the smart groups. - SmartGroupsCount *int32 `json:"smartGroupsCount,omitempty"` + SmartGroupsCount *int64 `json:"smartGroupsCount,omitempty"` // Groupedby - Name of the field aggregated Groupedby *string `json:"groupedby,omitempty"` // Values - List of the items @@ -856,7 +862,7 @@ type AlertsSummaryGroupItem struct { // Name - Value of the aggregated field Name *string `json:"name,omitempty"` // Count - Count of the aggregated field - Count *int32 `json:"count,omitempty"` + Count *int64 `json:"count,omitempty"` // Groupedby - Name of the field aggregated Groupedby *string `json:"groupedby,omitempty"` // Values - List of the items @@ -1017,7 +1023,10 @@ type Essentials struct { // MonitorConditionResolvedDateTime - READ-ONLY; Resolved time(ISO-8601 format) of alert instance. This will be updated when monitor service resolves the alert instance because the rule condition is no longer met. MonitorConditionResolvedDateTime *date.Time `json:"monitorConditionResolvedDateTime,omitempty"` // LastModifiedUserName - READ-ONLY; User who last modified the alert, in case of monitor service updates user would be 'system', otherwise name of the user. - LastModifiedUserName *string `json:"lastModifiedUserName,omitempty"` + LastModifiedUserName *string `json:"lastModifiedUserName,omitempty"` + ActionStatus *ActionStatus `json:"actionStatus,omitempty"` + // Description - Alert description. + Description *string `json:"description,omitempty"` } // MarshalJSON is the custom marshaler for Essentials. @@ -1035,6 +1044,12 @@ func (e Essentials) MarshalJSON() ([]byte, error) { if e.TargetResourceType != nil { objectMap["targetResourceType"] = e.TargetResourceType } + if e.ActionStatus != nil { + objectMap["actionStatus"] = e.ActionStatus + } + if e.Description != nil { + objectMap["description"] = e.Description + } return json.Marshal(objectMap) } @@ -1114,6 +1129,8 @@ type Operation struct { Name *string `json:"name,omitempty"` // Display - Properties of the operation Display *OperationDisplay `json:"display,omitempty"` + // Origin - Origin of the operation + Origin *string `json:"origin,omitempty"` } // OperationDisplay properties of the operation @@ -1448,7 +1465,7 @@ type SmartGroupAggregatedProperty struct { // Name - Name of the type. Name *string `json:"name,omitempty"` // Count - Total number of items of type. - Count *int32 `json:"count,omitempty"` + Count *int64 `json:"count,omitempty"` } // SmartGroupModification alert Modification details @@ -1515,7 +1532,7 @@ func (sgmp SmartGroupModificationProperties) MarshalJSON() ([]byte, error) { // SmartGroupProperties properties of smart group. type SmartGroupProperties struct { // AlertsCount - Total number of alerts in smart group - AlertsCount *int32 `json:"alertsCount,omitempty"` + AlertsCount *int64 `json:"alertsCount,omitempty"` // SmartGroupState - READ-ONLY; Smart group state. Possible values include: 'StateNew', 'StateAcknowledged', 'StateClosed' SmartGroupState State `json:"smartGroupState,omitempty"` // Severity - READ-ONLY; Severity of smart group is the highest(Sev0 >... > Sev4) severity of all the alerts in the group. Possible values include: 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' diff --git a/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/smartgroups.go b/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/smartgroups.go index bd3b41982b35..5cfe24db7528 100644 --- a/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/smartgroups.go +++ b/services/preview/alertsmanagement/mgmt/2019-05-05-preview/alertsmanagement/smartgroups.go @@ -129,7 +129,7 @@ func (client SmartGroupsClient) ChangeStateResponder(resp *http.Response) (resul // sortBy - sort the query results by input field. Default value is sort by 'lastModifiedDateTime'. // sortOrder - sort the query results order in either ascending or descending. Default value is 'desc' for // time fields and 'asc' for others. -func (client SmartGroupsClient) GetAll(ctx context.Context, targetResource string, targetResourceGroup string, targetResourceType string, monitorService MonitorService, monitorCondition MonitorCondition, severity Severity, smartGroupState AlertState, timeRange TimeRange, pageCount *int32, sortBy SmartGroupsSortByFields, sortOrder string) (result SmartGroupsListPage, err error) { +func (client SmartGroupsClient) GetAll(ctx context.Context, targetResource string, targetResourceGroup string, targetResourceType string, monitorService MonitorService, monitorCondition MonitorCondition, severity Severity, smartGroupState AlertState, timeRange TimeRange, pageCount *int64, sortBy SmartGroupsSortByFields, sortOrder SortOrder) (result SmartGroupsListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SmartGroupsClient.GetAll") defer func() { @@ -174,7 +174,7 @@ func (client SmartGroupsClient) GetAll(ctx context.Context, targetResource strin } // GetAllPreparer prepares the GetAll request. -func (client SmartGroupsClient) GetAllPreparer(ctx context.Context, targetResource string, targetResourceGroup string, targetResourceType string, monitorService MonitorService, monitorCondition MonitorCondition, severity Severity, smartGroupState AlertState, timeRange TimeRange, pageCount *int32, sortBy SmartGroupsSortByFields, sortOrder string) (*http.Request, error) { +func (client SmartGroupsClient) GetAllPreparer(ctx context.Context, targetResource string, targetResourceGroup string, targetResourceType string, monitorService MonitorService, monitorCondition MonitorCondition, severity Severity, smartGroupState AlertState, timeRange TimeRange, pageCount *int64, sortBy SmartGroupsSortByFields, sortOrder SortOrder) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -265,7 +265,7 @@ func (client SmartGroupsClient) getAllNextResults(ctx context.Context, lastResul } // GetAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client SmartGroupsClient) GetAllComplete(ctx context.Context, targetResource string, targetResourceGroup string, targetResourceType string, monitorService MonitorService, monitorCondition MonitorCondition, severity Severity, smartGroupState AlertState, timeRange TimeRange, pageCount *int32, sortBy SmartGroupsSortByFields, sortOrder string) (result SmartGroupsListIterator, err error) { +func (client SmartGroupsClient) GetAllComplete(ctx context.Context, targetResource string, targetResourceGroup string, targetResourceType string, monitorService MonitorService, monitorCondition MonitorCondition, severity Severity, smartGroupState AlertState, timeRange TimeRange, pageCount *int64, sortBy SmartGroupsSortByFields, sortOrder SortOrder) (result SmartGroupsListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SmartGroupsClient.GetAll") defer func() { diff --git a/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/CHANGELOG.md b/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/CHANGELOG.md index 52911e4cc5e4..7d0cbd92d52f 100644 --- a/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/CHANGELOG.md +++ b/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/CHANGELOG.md @@ -1,2 +1,71 @@ -# Change History +# Unreleased +## Breaking Changes + +### Signature Changes + +#### Funcs + +1. AlertsClient.ChangeState + - Params + - From: context.Context, string, AlertState + - To: context.Context, string, AlertState, string +1. AlertsClient.ChangeStatePreparer + - Params + - From: context.Context, string, AlertState + - To: context.Context, string, AlertState, string +1. AlertsClient.GetAll + - Params + - From: context.Context, string, string, string, MonitorService, MonitorCondition, Severity, AlertState, string, string, *bool, *bool, *int32, AlertsSortByFields, string, string, TimeRange, string + - To: context.Context, string, string, string, MonitorService, MonitorCondition, Severity, AlertState, string, string, *bool, *bool, *int64, AlertsSortByFields, SortOrder, string, TimeRange, string +1. AlertsClient.GetAllComplete + - Params + - From: context.Context, string, string, string, MonitorService, MonitorCondition, Severity, AlertState, string, string, *bool, *bool, *int32, AlertsSortByFields, string, string, TimeRange, string + - To: context.Context, string, string, string, MonitorService, MonitorCondition, Severity, AlertState, string, string, *bool, *bool, *int64, AlertsSortByFields, SortOrder, string, TimeRange, string +1. AlertsClient.GetAllPreparer + - Params + - From: context.Context, string, string, string, MonitorService, MonitorCondition, Severity, AlertState, string, string, *bool, *bool, *int32, AlertsSortByFields, string, string, TimeRange, string + - To: context.Context, string, string, string, MonitorService, MonitorCondition, Severity, AlertState, string, string, *bool, *bool, *int64, AlertsSortByFields, SortOrder, string, TimeRange, string +1. SmartGroupsClient.GetAll + - Params + - From: context.Context, string, string, string, MonitorService, MonitorCondition, Severity, AlertState, TimeRange, *int32, SmartGroupsSortByFields, string + - To: context.Context, string, string, string, MonitorService, MonitorCondition, Severity, AlertState, TimeRange, *int64, SmartGroupsSortByFields, SortOrder +1. SmartGroupsClient.GetAllComplete + - Params + - From: context.Context, string, string, string, MonitorService, MonitorCondition, Severity, AlertState, TimeRange, *int32, SmartGroupsSortByFields, string + - To: context.Context, string, string, string, MonitorService, MonitorCondition, Severity, AlertState, TimeRange, *int64, SmartGroupsSortByFields, SortOrder +1. SmartGroupsClient.GetAllPreparer + - Params + - From: context.Context, string, string, string, MonitorService, MonitorCondition, Severity, AlertState, TimeRange, *int32, SmartGroupsSortByFields, string + - To: context.Context, string, string, string, MonitorService, MonitorCondition, Severity, AlertState, TimeRange, *int64, SmartGroupsSortByFields, SortOrder + +#### Struct Fields + +1. AlertsSummaryGroup.SmartGroupsCount changed type from *int32 to *int64 +1. AlertsSummaryGroup.Total changed type from *int32 to *int64 +1. AlertsSummaryGroupItem.Count changed type from *int32 to *int64 +1. SmartGroupAggregatedProperty.Count changed type from *int32 to *int64 +1. SmartGroupProperties.AlertsCount changed type from *int32 to *int64 + +## Additive Changes + +### New Constants + +1. SortOrder.Asc +1. SortOrder.Desc + +### New Funcs + +1. PossibleSortOrderValues() []SortOrder + +### Struct Changes + +#### New Structs + +1. ActionStatus + +#### New Struct Fields + +1. Essentials.ActionStatus +1. Essentials.Description +1. Operation.Origin diff --git a/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/_meta.json b/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/_meta.json index a4dd4c24f083..57b20bba9294 100644 --- a/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/_meta.json +++ b/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/_meta.json @@ -1,5 +1,5 @@ { - "commit": "4c93f28f89435f6d244f4db61bbf810b5d20f09f", + "commit": "f07a80688b1b43cf9ffc1db1a8858a42fd3184b3", "readme": "/_/azure-rest-api-specs/specification/alertsmanagement/resource-manager/readme.md", "tag": "package-2019-06-preview", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/alerts.go b/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/alerts.go index 3098f6aa8989..1284de759944 100644 --- a/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/alerts.go +++ b/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/alerts.go @@ -35,7 +35,8 @@ func NewAlertsClientWithBaseURI(baseURI string, subscriptionID string) AlertsCli // Parameters: // alertID - unique ID of an alert instance. // newState - new state of the alert. -func (client AlertsClient) ChangeState(ctx context.Context, alertID string, newState AlertState) (result Alert, err error) { +// comment - reason of change alert state +func (client AlertsClient) ChangeState(ctx context.Context, alertID string, newState AlertState, comment string) (result Alert, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ChangeState") defer func() { @@ -52,7 +53,7 @@ func (client AlertsClient) ChangeState(ctx context.Context, alertID string, newS return result, validation.NewError("alertsmanagement.AlertsClient", "ChangeState", err.Error()) } - req, err := client.ChangeStatePreparer(ctx, alertID, newState) + req, err := client.ChangeStatePreparer(ctx, alertID, newState, comment) if err != nil { err = autorest.NewErrorWithError(err, "alertsmanagement.AlertsClient", "ChangeState", nil, "Failure preparing request") return @@ -75,7 +76,7 @@ func (client AlertsClient) ChangeState(ctx context.Context, alertID string, newS } // ChangeStatePreparer prepares the ChangeState request. -func (client AlertsClient) ChangeStatePreparer(ctx context.Context, alertID string, newState AlertState) (*http.Request, error) { +func (client AlertsClient) ChangeStatePreparer(ctx context.Context, alertID string, newState AlertState, comment string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertId": autorest.Encode("path", alertID), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -88,10 +89,15 @@ func (client AlertsClient) ChangeStatePreparer(ctx context.Context, alertID stri } preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId}/changestate", pathParameters), autorest.WithQueryParameters(queryParameters)) + if len(comment) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(comment)) + } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -142,7 +148,7 @@ func (client AlertsClient) ChangeStateResponder(resp *http.Response) (result Ale // customTimeRange - filter by custom time range in the format / where time is in // (ISO-8601 format)'. Permissible values is within 30 days from query time. Either timeRange or // customTimeRange could be used but not both. Default is none. -func (client AlertsClient) GetAll(ctx context.Context, targetResource string, targetResourceType string, targetResourceGroup string, monitorService MonitorService, monitorCondition MonitorCondition, severity Severity, alertState AlertState, alertRule string, smartGroupID string, includeContext *bool, includeEgressConfig *bool, pageCount *int32, sortBy AlertsSortByFields, sortOrder string, selectParameter string, timeRange TimeRange, customTimeRange string) (result AlertsListPage, err error) { +func (client AlertsClient) GetAll(ctx context.Context, targetResource string, targetResourceType string, targetResourceGroup string, monitorService MonitorService, monitorCondition MonitorCondition, severity Severity, alertState AlertState, alertRule string, smartGroupID string, includeContext *bool, includeEgressConfig *bool, pageCount *int64, sortBy AlertsSortByFields, sortOrder SortOrder, selectParameter string, timeRange TimeRange, customTimeRange string) (result AlertsListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.GetAll") defer func() { @@ -187,7 +193,7 @@ func (client AlertsClient) GetAll(ctx context.Context, targetResource string, ta } // GetAllPreparer prepares the GetAll request. -func (client AlertsClient) GetAllPreparer(ctx context.Context, targetResource string, targetResourceType string, targetResourceGroup string, monitorService MonitorService, monitorCondition MonitorCondition, severity Severity, alertState AlertState, alertRule string, smartGroupID string, includeContext *bool, includeEgressConfig *bool, pageCount *int32, sortBy AlertsSortByFields, sortOrder string, selectParameter string, timeRange TimeRange, customTimeRange string) (*http.Request, error) { +func (client AlertsClient) GetAllPreparer(ctx context.Context, targetResource string, targetResourceType string, targetResourceGroup string, monitorService MonitorService, monitorCondition MonitorCondition, severity Severity, alertState AlertState, alertRule string, smartGroupID string, includeContext *bool, includeEgressConfig *bool, pageCount *int64, sortBy AlertsSortByFields, sortOrder SortOrder, selectParameter string, timeRange TimeRange, customTimeRange string) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -296,7 +302,7 @@ func (client AlertsClient) getAllNextResults(ctx context.Context, lastResults Al } // GetAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client AlertsClient) GetAllComplete(ctx context.Context, targetResource string, targetResourceType string, targetResourceGroup string, monitorService MonitorService, monitorCondition MonitorCondition, severity Severity, alertState AlertState, alertRule string, smartGroupID string, includeContext *bool, includeEgressConfig *bool, pageCount *int32, sortBy AlertsSortByFields, sortOrder string, selectParameter string, timeRange TimeRange, customTimeRange string) (result AlertsListIterator, err error) { +func (client AlertsClient) GetAllComplete(ctx context.Context, targetResource string, targetResourceType string, targetResourceGroup string, monitorService MonitorService, monitorCondition MonitorCondition, severity Severity, alertState AlertState, alertRule string, smartGroupID string, includeContext *bool, includeEgressConfig *bool, pageCount *int64, sortBy AlertsSortByFields, sortOrder SortOrder, selectParameter string, timeRange TimeRange, customTimeRange string) (result AlertsListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.GetAll") defer func() { diff --git a/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/alertsmanagementapi/interfaces.go b/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/alertsmanagementapi/interfaces.go index daccf00698b8..91e300f1cd37 100644 --- a/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/alertsmanagementapi/interfaces.go +++ b/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/alertsmanagementapi/interfaces.go @@ -36,9 +36,9 @@ var _ OperationsClientAPI = (*alertsmanagement.OperationsClient)(nil) // AlertsClientAPI contains the set of methods on the AlertsClient type. type AlertsClientAPI interface { - ChangeState(ctx context.Context, alertID string, newState alertsmanagement.AlertState) (result alertsmanagement.Alert, err error) - GetAll(ctx context.Context, targetResource string, targetResourceType string, targetResourceGroup string, monitorService alertsmanagement.MonitorService, monitorCondition alertsmanagement.MonitorCondition, severity alertsmanagement.Severity, alertState alertsmanagement.AlertState, alertRule string, smartGroupID string, includeContext *bool, includeEgressConfig *bool, pageCount *int32, sortBy alertsmanagement.AlertsSortByFields, sortOrder string, selectParameter string, timeRange alertsmanagement.TimeRange, customTimeRange string) (result alertsmanagement.AlertsListPage, err error) - GetAllComplete(ctx context.Context, targetResource string, targetResourceType string, targetResourceGroup string, monitorService alertsmanagement.MonitorService, monitorCondition alertsmanagement.MonitorCondition, severity alertsmanagement.Severity, alertState alertsmanagement.AlertState, alertRule string, smartGroupID string, includeContext *bool, includeEgressConfig *bool, pageCount *int32, sortBy alertsmanagement.AlertsSortByFields, sortOrder string, selectParameter string, timeRange alertsmanagement.TimeRange, customTimeRange string) (result alertsmanagement.AlertsListIterator, err error) + ChangeState(ctx context.Context, alertID string, newState alertsmanagement.AlertState, comment string) (result alertsmanagement.Alert, err error) + GetAll(ctx context.Context, targetResource string, targetResourceType string, targetResourceGroup string, monitorService alertsmanagement.MonitorService, monitorCondition alertsmanagement.MonitorCondition, severity alertsmanagement.Severity, alertState alertsmanagement.AlertState, alertRule string, smartGroupID string, includeContext *bool, includeEgressConfig *bool, pageCount *int64, sortBy alertsmanagement.AlertsSortByFields, sortOrder alertsmanagement.SortOrder, selectParameter string, timeRange alertsmanagement.TimeRange, customTimeRange string) (result alertsmanagement.AlertsListPage, err error) + GetAllComplete(ctx context.Context, targetResource string, targetResourceType string, targetResourceGroup string, monitorService alertsmanagement.MonitorService, monitorCondition alertsmanagement.MonitorCondition, severity alertsmanagement.Severity, alertState alertsmanagement.AlertState, alertRule string, smartGroupID string, includeContext *bool, includeEgressConfig *bool, pageCount *int64, sortBy alertsmanagement.AlertsSortByFields, sortOrder alertsmanagement.SortOrder, selectParameter string, timeRange alertsmanagement.TimeRange, customTimeRange string) (result alertsmanagement.AlertsListIterator, err error) GetByID(ctx context.Context, alertID string) (result alertsmanagement.Alert, err error) GetHistory(ctx context.Context, alertID string) (result alertsmanagement.AlertModification, err error) GetSummary(ctx context.Context, groupby alertsmanagement.AlertsSummaryGroupByFields, includeSmartGroupsCount *bool, targetResource string, targetResourceType string, targetResourceGroup string, monitorService alertsmanagement.MonitorService, monitorCondition alertsmanagement.MonitorCondition, severity alertsmanagement.Severity, alertState alertsmanagement.AlertState, alertRule string, timeRange alertsmanagement.TimeRange, customTimeRange string) (result alertsmanagement.AlertsSummary, err error) @@ -50,8 +50,8 @@ var _ AlertsClientAPI = (*alertsmanagement.AlertsClient)(nil) // SmartGroupsClientAPI contains the set of methods on the SmartGroupsClient type. type SmartGroupsClientAPI interface { ChangeState(ctx context.Context, smartGroupID string, newState alertsmanagement.AlertState) (result alertsmanagement.SmartGroup, err error) - GetAll(ctx context.Context, targetResource string, targetResourceGroup string, targetResourceType string, monitorService alertsmanagement.MonitorService, monitorCondition alertsmanagement.MonitorCondition, severity alertsmanagement.Severity, smartGroupState alertsmanagement.AlertState, timeRange alertsmanagement.TimeRange, pageCount *int32, sortBy alertsmanagement.SmartGroupsSortByFields, sortOrder string) (result alertsmanagement.SmartGroupsListPage, err error) - GetAllComplete(ctx context.Context, targetResource string, targetResourceGroup string, targetResourceType string, monitorService alertsmanagement.MonitorService, monitorCondition alertsmanagement.MonitorCondition, severity alertsmanagement.Severity, smartGroupState alertsmanagement.AlertState, timeRange alertsmanagement.TimeRange, pageCount *int32, sortBy alertsmanagement.SmartGroupsSortByFields, sortOrder string) (result alertsmanagement.SmartGroupsListIterator, err error) + GetAll(ctx context.Context, targetResource string, targetResourceGroup string, targetResourceType string, monitorService alertsmanagement.MonitorService, monitorCondition alertsmanagement.MonitorCondition, severity alertsmanagement.Severity, smartGroupState alertsmanagement.AlertState, timeRange alertsmanagement.TimeRange, pageCount *int64, sortBy alertsmanagement.SmartGroupsSortByFields, sortOrder alertsmanagement.SortOrder) (result alertsmanagement.SmartGroupsListPage, err error) + GetAllComplete(ctx context.Context, targetResource string, targetResourceGroup string, targetResourceType string, monitorService alertsmanagement.MonitorService, monitorCondition alertsmanagement.MonitorCondition, severity alertsmanagement.Severity, smartGroupState alertsmanagement.AlertState, timeRange alertsmanagement.TimeRange, pageCount *int64, sortBy alertsmanagement.SmartGroupsSortByFields, sortOrder alertsmanagement.SortOrder) (result alertsmanagement.SmartGroupsListIterator, err error) GetByID(ctx context.Context, smartGroupID string) (result alertsmanagement.SmartGroup, err error) GetHistory(ctx context.Context, smartGroupID string) (result alertsmanagement.SmartGroupModification, err error) } diff --git a/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/enums.go b/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/enums.go index 3e4eda9415cf..bd346139514a 100644 --- a/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/enums.go +++ b/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/enums.go @@ -319,6 +319,21 @@ func PossibleSmartGroupsSortByFieldsValues() []SmartGroupsSortByFields { return []SmartGroupsSortByFields{SmartGroupsSortByFieldsAlertsCount, SmartGroupsSortByFieldsLastModifiedDateTime, SmartGroupsSortByFieldsSeverity, SmartGroupsSortByFieldsStartDateTime, SmartGroupsSortByFieldsState} } +// SortOrder enumerates the values for sort order. +type SortOrder string + +const ( + // Asc ... + Asc SortOrder = "asc" + // Desc ... + Desc SortOrder = "desc" +) + +// PossibleSortOrderValues returns an array of possible values for the SortOrder const type. +func PossibleSortOrderValues() []SortOrder { + return []SortOrder{Asc, Desc} +} + // State enumerates the values for state. type State string diff --git a/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/models.go b/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/models.go index 22d7cb7791bb..92fd5f29a9aa 100644 --- a/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/models.go +++ b/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/models.go @@ -482,6 +482,12 @@ func NewActionRulesListPage(cur ActionRulesList, getNextPage func(context.Contex } } +// ActionStatus action status +type ActionStatus struct { + // IsSuppressed - Value indicating whether alert is suppressed. + IsSuppressed *bool `json:"isSuppressed,omitempty"` +} + // Alert an alert created in alert management service. type Alert struct { autorest.Response `json:"-"` @@ -1234,9 +1240,9 @@ func (as AlertsSummary) MarshalJSON() ([]byte, error) { // AlertsSummaryGroup group the result set. type AlertsSummaryGroup struct { // Total - Total count of the result set. - Total *int32 `json:"total,omitempty"` + Total *int64 `json:"total,omitempty"` // SmartGroupsCount - Total count of the smart groups. - SmartGroupsCount *int32 `json:"smartGroupsCount,omitempty"` + SmartGroupsCount *int64 `json:"smartGroupsCount,omitempty"` // Groupedby - Name of the field aggregated Groupedby *string `json:"groupedby,omitempty"` // Values - List of the items @@ -1248,7 +1254,7 @@ type AlertsSummaryGroupItem struct { // Name - Value of the aggregated field Name *string `json:"name,omitempty"` // Count - Count of the aggregated field - Count *int32 `json:"count,omitempty"` + Count *int64 `json:"count,omitempty"` // Groupedby - Name of the field aggregated Groupedby *string `json:"groupedby,omitempty"` // Values - List of the items @@ -1476,7 +1482,10 @@ type Essentials struct { // MonitorConditionResolvedDateTime - READ-ONLY; Resolved time(ISO-8601 format) of alert instance. This will be updated when monitor service resolves the alert instance because the rule condition is no longer met. MonitorConditionResolvedDateTime *date.Time `json:"monitorConditionResolvedDateTime,omitempty"` // LastModifiedUserName - READ-ONLY; User who last modified the alert, in case of monitor service updates user would be 'system', otherwise name of the user. - LastModifiedUserName *string `json:"lastModifiedUserName,omitempty"` + LastModifiedUserName *string `json:"lastModifiedUserName,omitempty"` + ActionStatus *ActionStatus `json:"actionStatus,omitempty"` + // Description - Alert description. + Description *string `json:"description,omitempty"` } // MarshalJSON is the custom marshaler for Essentials. @@ -1494,6 +1503,12 @@ func (e Essentials) MarshalJSON() ([]byte, error) { if e.TargetResourceType != nil { objectMap["targetResourceType"] = e.TargetResourceType } + if e.ActionStatus != nil { + objectMap["actionStatus"] = e.ActionStatus + } + if e.Description != nil { + objectMap["description"] = e.Description + } return json.Marshal(objectMap) } @@ -1573,6 +1588,8 @@ type Operation struct { Name *string `json:"name,omitempty"` // Display - Properties of the operation Display *OperationDisplay `json:"display,omitempty"` + // Origin - Origin of the operation + Origin *string `json:"origin,omitempty"` } // OperationDisplay properties of the operation @@ -1915,7 +1932,7 @@ type SmartGroupAggregatedProperty struct { // Name - Name of the type. Name *string `json:"name,omitempty"` // Count - Total number of items of type. - Count *int32 `json:"count,omitempty"` + Count *int64 `json:"count,omitempty"` } // SmartGroupModification alert Modification details @@ -1982,7 +1999,7 @@ func (sgmp SmartGroupModificationProperties) MarshalJSON() ([]byte, error) { // SmartGroupProperties properties of smart group. type SmartGroupProperties struct { // AlertsCount - Total number of alerts in smart group - AlertsCount *int32 `json:"alertsCount,omitempty"` + AlertsCount *int64 `json:"alertsCount,omitempty"` // SmartGroupState - READ-ONLY; Smart group state. Possible values include: 'StateNew', 'StateAcknowledged', 'StateClosed' SmartGroupState State `json:"smartGroupState,omitempty"` // Severity - READ-ONLY; Severity of smart group is the highest(Sev0 >... > Sev4) severity of all the alerts in the group. Possible values include: 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' diff --git a/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/smartgroups.go b/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/smartgroups.go index bd3b41982b35..5cfe24db7528 100644 --- a/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/smartgroups.go +++ b/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement/smartgroups.go @@ -129,7 +129,7 @@ func (client SmartGroupsClient) ChangeStateResponder(resp *http.Response) (resul // sortBy - sort the query results by input field. Default value is sort by 'lastModifiedDateTime'. // sortOrder - sort the query results order in either ascending or descending. Default value is 'desc' for // time fields and 'asc' for others. -func (client SmartGroupsClient) GetAll(ctx context.Context, targetResource string, targetResourceGroup string, targetResourceType string, monitorService MonitorService, monitorCondition MonitorCondition, severity Severity, smartGroupState AlertState, timeRange TimeRange, pageCount *int32, sortBy SmartGroupsSortByFields, sortOrder string) (result SmartGroupsListPage, err error) { +func (client SmartGroupsClient) GetAll(ctx context.Context, targetResource string, targetResourceGroup string, targetResourceType string, monitorService MonitorService, monitorCondition MonitorCondition, severity Severity, smartGroupState AlertState, timeRange TimeRange, pageCount *int64, sortBy SmartGroupsSortByFields, sortOrder SortOrder) (result SmartGroupsListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SmartGroupsClient.GetAll") defer func() { @@ -174,7 +174,7 @@ func (client SmartGroupsClient) GetAll(ctx context.Context, targetResource strin } // GetAllPreparer prepares the GetAll request. -func (client SmartGroupsClient) GetAllPreparer(ctx context.Context, targetResource string, targetResourceGroup string, targetResourceType string, monitorService MonitorService, monitorCondition MonitorCondition, severity Severity, smartGroupState AlertState, timeRange TimeRange, pageCount *int32, sortBy SmartGroupsSortByFields, sortOrder string) (*http.Request, error) { +func (client SmartGroupsClient) GetAllPreparer(ctx context.Context, targetResource string, targetResourceGroup string, targetResourceType string, monitorService MonitorService, monitorCondition MonitorCondition, severity Severity, smartGroupState AlertState, timeRange TimeRange, pageCount *int64, sortBy SmartGroupsSortByFields, sortOrder SortOrder) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -265,7 +265,7 @@ func (client SmartGroupsClient) getAllNextResults(ctx context.Context, lastResul } // GetAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client SmartGroupsClient) GetAllComplete(ctx context.Context, targetResource string, targetResourceGroup string, targetResourceType string, monitorService MonitorService, monitorCondition MonitorCondition, severity Severity, smartGroupState AlertState, timeRange TimeRange, pageCount *int32, sortBy SmartGroupsSortByFields, sortOrder string) (result SmartGroupsListIterator, err error) { +func (client SmartGroupsClient) GetAllComplete(ctx context.Context, targetResource string, targetResourceGroup string, targetResourceType string, monitorService MonitorService, monitorCondition MonitorCondition, severity Severity, smartGroupState AlertState, timeRange TimeRange, pageCount *int64, sortBy SmartGroupsSortByFields, sortOrder SortOrder) (result SmartGroupsListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SmartGroupsClient.GetAll") defer func() {