

# UpdateMonitor
<a name="API_UpdateMonitor"></a>

Updates the `aggregationPeriod` for a monitor. Monitors support an `aggregationPeriod` of either `30` or `60` seconds. This action requires the `monitorName` and `probeId` parameter. Run `ListMonitors` to get a list of monitor names. 

## Request Syntax
<a name="API_UpdateMonitor_RequestSyntax"></a>

```
PATCH /monitors/monitorName HTTP/1.1
Content-type: application/json

{
   "aggregationPeriod": number
}
```

## URI Request Parameters
<a name="API_UpdateMonitor_RequestParameters"></a>

The request uses the following URI parameters.

 ** [monitorName](#API_UpdateMonitor_RequestSyntax) **   <a name="networksyntheticmonitor-UpdateMonitor-request-uri-monitorName"></a>
The name of the monitor to update.   
Length Constraints: Minimum length of 1. Maximum length of 200.  
Pattern: `[a-zA-Z0-9_-]+`   
Required: Yes

## Request Body
<a name="API_UpdateMonitor_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [aggregationPeriod](#API_UpdateMonitor_RequestSyntax) **   <a name="networksyntheticmonitor-UpdateMonitor-request-aggregationPeriod"></a>
The aggregation time, in seconds, to change to. This must be either `30` or `60`.   
Type: Long  
Valid Range: Minimum value of 30.  
Required: Yes

## Response Syntax
<a name="API_UpdateMonitor_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "aggregationPeriod": number,
   "monitorArn": "string",
   "monitorName": "string",
   "state": "string",
   "tags": { 
      "string" : "string" 
   }
}
```

## Response Elements
<a name="API_UpdateMonitor_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [aggregationPeriod](#API_UpdateMonitor_ResponseSyntax) **   <a name="networksyntheticmonitor-UpdateMonitor-response-aggregationPeriod"></a>
The changed aggregation period.  
Type: Long  
Valid Range: Minimum value of 30.

 ** [monitorArn](#API_UpdateMonitor_ResponseSyntax) **   <a name="networksyntheticmonitor-UpdateMonitor-response-monitorArn"></a>
The ARN of the monitor that was updated.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 512.  
Pattern: `arn:.*` 

 ** [monitorName](#API_UpdateMonitor_ResponseSyntax) **   <a name="networksyntheticmonitor-UpdateMonitor-response-monitorName"></a>
The name of the monitor that was updated.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 200.  
Pattern: `[a-zA-Z0-9_-]+` 

 ** [state](#API_UpdateMonitor_ResponseSyntax) **   <a name="networksyntheticmonitor-UpdateMonitor-response-state"></a>
The state of the updated monitor.  
Type: String  
Valid Values: `PENDING | ACTIVE | INACTIVE | ERROR | DELETING` 

 ** [tags](#API_UpdateMonitor_ResponseSyntax) **   <a name="networksyntheticmonitor-UpdateMonitor-response-tags"></a>
The list of key-value pairs associated with the monitor.  
Type: String to string map  
Map Entries: Minimum number of 0 items. Maximum number of 200 items.  
Key Length Constraints: Minimum length of 1. Maximum length of 128.  
Value Length Constraints: Minimum length of 0. Maximum length of 256.

## Errors
<a name="API_UpdateMonitor_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You do not have sufficient access to perform this action.  
HTTP Status Code: 403

 ** InternalServerException **   
The request processing has failed because of an unknown error, exception or failure.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 404

 ** ServiceQuotaExceededException **   
This request exceeds a service quota.  
HTTP Status Code: 402

 ** ThrottlingException **   
The request was denied due to request throttling  
HTTP Status Code: 429

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_UpdateMonitor_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/networkmonitor-2023-08-01/UpdateMonitor) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/networkmonitor-2023-08-01/UpdateMonitor) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/networkmonitor-2023-08-01/UpdateMonitor) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/networkmonitor-2023-08-01/UpdateMonitor) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/networkmonitor-2023-08-01/UpdateMonitor) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/networkmonitor-2023-08-01/UpdateMonitor) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/networkmonitor-2023-08-01/UpdateMonitor) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/networkmonitor-2023-08-01/UpdateMonitor) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/networkmonitor-2023-08-01/UpdateMonitor) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/networkmonitor-2023-08-01/UpdateMonitor) 