Monitors - Update

Update a Monitor's configuration.

PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/monitors/{monitorId}?api-version=2018-08-31-preview

URI Parameters

Name In Required Type Description
subscriptionId
path True
  • string

The ID of the target subscription.

resourceGroupName
path True
  • string

The name of the resource group. The name is case insensitive.

Regex pattern: ^[-\w\._\(\)]+$

resourceNamespace
path True
  • string

The Namespace of the resource.

resourceType
path True
  • string

The type of the resource.

resourceName
path True
  • string

Name of the resource.

monitorId
path True
  • string

Monitor Id.

api-version
query True
  • string

The API version to use for this operation.

Responses

Name Type Description
200 OK

OK. Existing monitor is updated.

Other Status Codes

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Monitors_Update

Sample Request

PATCH https://management.azure.com/subscriptions/a7f23fdb-e626-4f95-89aa-3a360a90861e/resourceGroups/viv_rg/providers/Microsoft.Compute/virtualMachines/Canary-WLI-2/providers/Microsoft.WorkloadMonitor/monitors/1bbf53b8-2557-a521-f7c1-1023de57367a?api-version=2018-08-31-preview
{
  "properties": {
    "criteria": [
      {
        "healthState": "Warning",
        "comparisonOperator": "LessThan",
        "threshold": 2100
      },
      {
        "healthState": "Error",
        "comparisonOperator": "LessThan",
        "threshold": 1100
      }
    ],
    "alertGeneration": "Disabled"
  }
}

Sample Response

{}

Definitions

AlertGeneration

Generates alerts or not

ErrorFieldContract

Error field contract.

ErrorResponse

Error body contract.

HealthState

Target health state of the criteria

Monitor

Model for Monitor

MonitorCategory

Category of the monitor

MonitorCriteria

Criteria for monitor configuration

MonitorState

Is the monitor state enabled or disabled

MonitorType

Type of the monitor

Operator

Comparison enum on threshold of this criteria

AlertGeneration

Generates alerts or not

Name Type Description
Disabled
  • string
Enabled
  • string

ErrorFieldContract

Error field contract.

Name Type Description
code
  • string

Property level error code.

message
  • string

Human-readable representation of property-level error.

target
  • string

Property name.

ErrorResponse

Error body contract.

Name Type Description
code
  • string

Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.

details

The list of invalid fields send in request, in case of validation error.

message
  • string

Human-readable representation of the error.

HealthState

Target health state of the criteria

Name Type Description
Error
  • string
Success
  • string
Uninitialized
  • string
Unknown
  • string
Warning
  • string

Monitor

Model for Monitor

Name Type Description
etag
  • string

For optimistic concurrency control.

id
  • string

Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name
  • string

The name of the resource

properties.alertGeneration

Generates alerts or not

properties.componentTypeDisplayName
  • string

Component Type Display Name of the monitor

properties.componentTypeId
  • string

Component Type Id of monitor

properties.componentTypeName
  • string

Component Type Name of monitor

properties.criteria

Collection of MonitorCriteria. For PATCH calls, instead of partial list, complete list of expected criteria should be passed for proper updating.

properties.description
  • string

Description of the monitor

properties.documentationURL
  • string

URL pointing to the documentation of the monitor

properties.frequency
  • integer

Frequency at which monitor condition is evaluated

properties.lookbackDuration
  • integer

The duration in minutes in the past during which the monitor is evaluated

properties.monitorCategory

Category of the monitor

properties.monitorDisplayName
  • string

User friendly display name of the monitor

properties.monitorId
  • string

ID of the monitor

properties.monitorName
  • string

Name of the monitor

properties.monitorState

Is the monitor state enabled or disabled

properties.monitorType

Type of the monitor

properties.parentMonitorDisplayName
  • string

User friendly display name of the parent monitor

properties.parentMonitorName
  • string

Name of the parent monitor

properties.signalName
  • string

Name of the signal on which this monitor is configured.

properties.signalType
  • string

Type of the signal on which this monitor is configured.

type
  • string

The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.

MonitorCategory

Category of the monitor

Name Type Description
AvailabilityHealth
  • string
Configuration
  • string
EntityHealth
  • string
PerformanceHealth
  • string
Security
  • string

MonitorCriteria

Criteria for monitor configuration

Name Type Description
comparisonOperator

Comparison enum on threshold of this criteria

healthState

Target health state of the criteria

threshold
  • number

Threshold value for this criteria

MonitorState

Is the monitor state enabled or disabled

Name Type Description
Disabled
  • string
Enabled
  • string

MonitorType

Type of the monitor

Name Type Description
Aggregate
  • string
Dependency
  • string
Unit
  • string

Operator

Comparison enum on threshold of this criteria

Name Type Description
Equals
  • string
GreaterThan
  • string
GreaterThanOrEqual
  • string
LessThan
  • string
LessThanOrEqual
  • string
NotEquals
  • string