/// <summary> /// Get all Smart Groups within a specified subscription /// </summary> /// <remarks> /// List all the Smart Groups within a specified subscription. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <SmartGroup> > GetAllNextAsync(this ISmartGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Get the history a smart group, which captures any Smart Group state changes /// (New/Acknowledged/Closed) . /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='smartGroupId'> /// Smart group unique id. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <SmartGroupModification> GetHistoryAsync(this ISmartGroupsOperations operations, string smartGroupId, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetHistoryWithHttpMessagesAsync(smartGroupId, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Change the state of a Smart Group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='smartGroupId'> /// Smart group unique id. /// </param> /// <param name='newState'> /// New state of the alert. Possible values include: 'New', 'Acknowledged', /// 'Closed' /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <SmartGroup> ChangeStateAsync(this ISmartGroupsOperations operations, string smartGroupId, string newState, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ChangeStateWithHttpMessagesAsync(smartGroupId, newState, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Get all Smart Groups within a specified subscription /// </summary> /// <remarks> /// List all the Smart Groups within a specified subscription. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='targetResource'> /// Filter by target resource( which is full ARM ID) Default value is select /// all. /// </param> /// <param name='targetResourceGroup'> /// Filter by target resource group name. Default value is select all. /// </param> /// <param name='targetResourceType'> /// Filter by target resource type. Default value is select all. /// </param> /// <param name='monitorService'> /// Filter by monitor service which generates the alert instance. Default value /// is select all. Possible values include: 'Application Insights', /// 'ActivityLog Administrative', 'ActivityLog Security', 'ActivityLog /// Recommendation', 'ActivityLog Policy', 'ActivityLog Autoscale', 'Log /// Analytics', 'Nagios', 'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', /// 'VM Insights', 'Zabbix' /// </param> /// <param name='monitorCondition'> /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default /// value is to select all. Possible values include: 'Fired', 'Resolved' /// </param> /// <param name='severity'> /// Filter by severity. Default value is select all. Possible values include: /// 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' /// </param> /// <param name='smartGroupState'> /// Filter by state of the smart group. Default value is to select all. /// Possible values include: 'New', 'Acknowledged', 'Closed' /// </param> /// <param name='timeRange'> /// Filter by time range by below listed values. Default value is 1 day. /// Possible values include: '1h', '1d', '7d', '30d' /// </param> /// <param name='pageCount'> /// Determines number of alerts returned per page in response. Permissible /// value is between 1 to 250. When the "includeContent" filter is selected, /// maximum value allowed is 25. Default value is 25. /// </param> /// <param name='sortBy'> /// Sort the query results by input field. Default value is sort by /// 'lastModifiedDateTime'. Possible values include: 'alertsCount', 'state', /// 'severity', 'startDateTime', 'lastModifiedDateTime' /// </param> /// <param name='sortOrder'> /// Sort the query results order in either ascending or descending. Default /// value is 'desc' for time fields and 'asc' for others. Possible values /// include: 'asc', 'desc' /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <SmartGroup> > GetAllAsync(this ISmartGroupsOperations operations, string targetResource = default(string), string targetResourceGroup = default(string), string targetResourceType = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string smartGroupState = default(string), string timeRange = default(string), int?pageCount = default(int?), string sortBy = default(string), string sortOrder = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetAllWithHttpMessagesAsync(targetResource, targetResourceGroup, targetResourceType, monitorService, monitorCondition, severity, smartGroupState, timeRange, pageCount, sortBy, sortOrder, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { AlertProcessingRules = new AlertProcessingRulesOperations(this); Operations = new Operations(this); Alerts = new AlertsOperations(this); SmartGroups = new SmartGroupsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; SerializationSettings = new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; SerializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <Recurrence>("recurrenceType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <Recurrence>("recurrenceType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <Action>("actionType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <Action>("actionType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <AlertsMetaDataProperties>("metadataIdentifier")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <AlertsMetaDataProperties>("metadataIdentifier")); CustomInitialize(); DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); }
/// <summary> /// Get all Smart Groups within a specified subscription /// </summary> /// <remarks> /// List all the Smart Groups within a specified subscription. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='targetResource'> /// Filter by target resource( which is full ARM ID) Default value is select /// all. /// </param> /// <param name='targetResourceGroup'> /// Filter by target resource group name. Default value is select all. /// </param> /// <param name='targetResourceType'> /// Filter by target resource type. Default value is select all. /// </param> /// <param name='monitorService'> /// Filter by monitor service which generates the alert instance. Default value /// is select all. Possible values include: 'Application Insights', /// 'ActivityLog Administrative', 'ActivityLog Security', 'ActivityLog /// Recommendation', 'ActivityLog Policy', 'ActivityLog Autoscale', 'Log /// Analytics', 'Nagios', 'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', /// 'VM Insights', 'Zabbix' /// </param> /// <param name='monitorCondition'> /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default /// value is to select all. Possible values include: 'Fired', 'Resolved' /// </param> /// <param name='severity'> /// Filter by severity. Default value is select all. Possible values include: /// 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' /// </param> /// <param name='smartGroupState'> /// Filter by state of the smart group. Default value is to select all. /// Possible values include: 'New', 'Acknowledged', 'Closed' /// </param> /// <param name='timeRange'> /// Filter by time range by below listed values. Default value is 1 day. /// Possible values include: '1h', '1d', '7d', '30d' /// </param> /// <param name='pageCount'> /// Determines number of alerts returned per page in response. Permissible /// value is between 1 to 250. When the "includeContent" filter is selected, /// maximum value allowed is 25. Default value is 25. /// </param> /// <param name='sortBy'> /// Sort the query results by input field. Default value is sort by /// 'lastModifiedDateTime'. Possible values include: 'alertsCount', 'state', /// 'severity', 'startDateTime', 'lastModifiedDateTime' /// </param> /// <param name='sortOrder'> /// Sort the query results order in either ascending or descending. Default /// value is 'desc' for time fields and 'asc' for others. Possible values /// include: 'asc', 'desc' /// </param> public static IPage <SmartGroup> GetAll(this ISmartGroupsOperations operations, string targetResource = default(string), string targetResourceGroup = default(string), string targetResourceType = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string smartGroupState = default(string), string timeRange = default(string), int?pageCount = default(int?), string sortBy = default(string), string sortOrder = default(string)) { return(operations.GetAllAsync(targetResource, targetResourceGroup, targetResourceType, monitorService, monitorCondition, severity, smartGroupState, timeRange, pageCount, sortBy, sortOrder).GetAwaiter().GetResult()); }
/// <summary> /// Get all Smart Groups within a specified subscription /// </summary> /// <remarks> /// List all the Smart Groups within a specified subscription. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> public static IPage <SmartGroup> GetAllNext(this ISmartGroupsOperations operations, string nextPageLink) { return(operations.GetAllNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// Get the history a smart group, which captures any Smart Group state changes /// (New/Acknowledged/Closed) . /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='smartGroupId'> /// Smart group unique id. /// </param> public static SmartGroupModification GetHistory(this ISmartGroupsOperations operations, string smartGroupId) { return(operations.GetHistoryAsync(smartGroupId).GetAwaiter().GetResult()); }
/// <summary> /// Change the state of a Smart Group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='smartGroupId'> /// Smart group unique id. /// </param> /// <param name='newState'> /// New state of the alert. Possible values include: 'New', 'Acknowledged', /// 'Closed' /// </param> public static SmartGroup ChangeState(this ISmartGroupsOperations operations, string smartGroupId, string newState) { return(operations.ChangeStateAsync(smartGroupId, newState).GetAwaiter().GetResult()); }
/// <summary> /// Get information related to a specific Smart Group. /// </summary> /// <remarks> /// Get information related to a specific Smart Group. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='smartGroupId'> /// Smart group unique id. /// </param> public static SmartGroup GetById(this ISmartGroupsOperations operations, string smartGroupId) { return(operations.GetByIdAsync(smartGroupId).GetAwaiter().GetResult()); }