public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.CloudWatch.Model.EnableAlarmActionsRequest(); if (cmdletContext.AlarmName != null) { request.AlarmNames = cmdletContext.AlarmName; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return(output); }
/// <summary> /// <para> Enables actions for the specified alarms. </para> /// </summary> /// /// <param name="enableAlarmActionsRequest">Container for the necessary /// parameters to execute the EnableAlarmActions service method on /// AmazonCloudWatch.</param> /// public EnableAlarmActionsResponse EnableAlarmActions(EnableAlarmActionsRequest enableAlarmActionsRequest) { IRequest<EnableAlarmActionsRequest> request = new EnableAlarmActionsRequestMarshaller().Marshall(enableAlarmActionsRequest); EnableAlarmActionsResponse response = Invoke<EnableAlarmActionsRequest, EnableAlarmActionsResponse> (request, this.signer, EnableAlarmActionsResponseUnmarshaller.GetInstance()); return response; }
private Amazon.CloudWatch.Model.EnableAlarmActionsResponse CallAWSServiceOperation(IAmazonCloudWatch client, Amazon.CloudWatch.Model.EnableAlarmActionsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon CloudWatch", "EnableAlarmActions"); try { #if DESKTOP return(client.EnableAlarmActions(request)); #elif CORECLR return(client.EnableAlarmActionsAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }
/// <summary> /// Enables actions for the specified alarms. /// </summary> /// <param name="request">Container for the necessary parameters to execute the EnableAlarmActions service method.</param> /// /// <returns>The response from the EnableAlarmActions service method, as returned by CloudWatch.</returns> public EnableAlarmActionsResponse EnableAlarmActions(EnableAlarmActionsRequest request) { var marshaller = new EnableAlarmActionsRequestMarshaller(); var unmarshaller = EnableAlarmActionsResponseUnmarshaller.Instance; return Invoke<EnableAlarmActionsRequest,EnableAlarmActionsResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the EnableAlarmActions operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the EnableAlarmActions operation on AmazonCloudWatchClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndEnableAlarmActions /// operation.</returns> public IAsyncResult BeginEnableAlarmActions(EnableAlarmActionsRequest request, AsyncCallback callback, object state) { var marshaller = new EnableAlarmActionsRequestMarshaller(); var unmarshaller = EnableAlarmActionsResponseUnmarshaller.Instance; return BeginInvoke<EnableAlarmActionsRequest>(request, marshaller, unmarshaller, callback, state); }
internal EnableAlarmActionsResponse EnableAlarmActions(EnableAlarmActionsRequest request) { var task = EnableAlarmActionsAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// <para> Enables actions for the specified alarms. </para> /// </summary> /// /// <param name="enableAlarmActionsRequest">Container for the necessary parameters to execute the EnableAlarmActions service method on /// AmazonCloudWatch.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<EnableAlarmActionsResponse> EnableAlarmActionsAsync(EnableAlarmActionsRequest enableAlarmActionsRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new EnableAlarmActionsRequestMarshaller(); var unmarshaller = EnableAlarmActionsResponseUnmarshaller.GetInstance(); return Invoke<IRequest, EnableAlarmActionsRequest, EnableAlarmActionsResponse>(enableAlarmActionsRequest, marshaller, unmarshaller, signer, cancellationToken); }
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> public IAsyncResult BeginEnableAlarmActions(EnableAlarmActionsRequest enableAlarmActionsRequest, AsyncCallback callback, object state) { return invokeEnableAlarmActions(enableAlarmActionsRequest, callback, state, false); }
/// <summary> /// <para> Enables actions for the specified alarms. </para> /// </summary> /// /// <param name="enableAlarmActionsRequest">Container for the necessary parameters to execute the EnableAlarmActions service method on /// AmazonCloudWatch.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<EnableAlarmActionsResponse> EnableAlarmActionsAsync(EnableAlarmActionsRequest enableAlarmActionsRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new EnableAlarmActionsRequestMarshaller(); var unmarshaller = EnableAlarmActionsResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, EnableAlarmActionsRequest, EnableAlarmActionsResponse>(enableAlarmActionsRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
Invoke(result); return result; } #endregion #region DisableAlarmActions /// <summary> /// <para> Disables actions for the specified alarms. When an alarm's actions are disabled the alarm's state may change, but none of the alarm's
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> public IAsyncResult BeginPutMetricData(PutMetricDataRequest putMetricDataRequest, AsyncCallback callback, object state) { return invokePutMetricData(putMetricDataRequest, callback, state, false); } /// <summary> /// Finishes the asynchronous execution of the PutMetricData operation. /// <seealso cref="Amazon.CloudWatch.AmazonCloudWatch.PutMetricData"/> /// </summary>
internal EnableAlarmActionsResponse EnableAlarmActions(EnableAlarmActionsRequest request) { var task = EnableAlarmActionsAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Initiates the asynchronous execution of the EnableAlarmActions operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the EnableAlarmActions operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<EnableAlarmActionsResponse> EnableAlarmActionsAsync(EnableAlarmActionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new EnableAlarmActionsRequestMarshaller(); var unmarshaller = EnableAlarmActionsResponseUnmarshaller.Instance; return InvokeAsync<EnableAlarmActionsRequest,EnableAlarmActionsResponse>(request, marshaller, unmarshaller, cancellationToken); }
public static void CWEnableAlarmActions() { #region CWEnableAlarmActions var client = new AmazonCloudWatchClient(); var request = new EnableAlarmActionsRequest { AlarmNames = new List<string>() { "awseb-e-kkbEXAMPLE-stack-CloudwatchAlarmLow-1WVXD9EXAMPLE" } }; client.EnableAlarmActions(request); #endregion }