/// <summary> /// Initiates the asynchronous execution of the DescribeNotificationConfigurations operation. /// <seealso cref="Amazon.AutoScaling.IAmazonAutoScaling.DescribeNotificationConfigurations"/> /// </summary> /// /// <param name="describeNotificationConfigurationsRequest">Container for the necessary parameters to execute the /// DescribeNotificationConfigurations operation on AmazonAutoScaling.</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 /// EndDescribeNotificationConfigurations operation.</returns> public IAsyncResult BeginDescribeNotificationConfigurations(DescribeNotificationConfigurationsRequest describeNotificationConfigurationsRequest, AsyncCallback callback, object state) { return invokeDescribeNotificationConfigurations(describeNotificationConfigurationsRequest, callback, state, false); }
IAsyncResult invokeDescribeNotificationConfigurations(DescribeNotificationConfigurationsRequest describeNotificationConfigurationsRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DescribeNotificationConfigurationsRequestMarshaller().Marshall(describeNotificationConfigurationsRequest); var unmarshaller = DescribeNotificationConfigurationsResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
internal DescribeNotificationConfigurationsPaginator(IAmazonAutoScaling client, DescribeNotificationConfigurationsRequest request) { this._client = client; this._request = request; }
/// <summary> /// <para> Returns a list of notification actions associated with Auto Scaling groups for specified events. </para> /// </summary> /// /// <param name="describeNotificationConfigurationsRequest">Container for the necessary parameters to execute the /// DescribeNotificationConfigurations service method on AmazonAutoScaling.</param> /// /// <returns>The response from the DescribeNotificationConfigurations service method, as returned by AmazonAutoScaling.</returns> /// /// <exception cref="InvalidNextTokenException"/> public DescribeNotificationConfigurationsResponse DescribeNotificationConfigurations(DescribeNotificationConfigurationsRequest describeNotificationConfigurationsRequest) { IAsyncResult asyncResult = invokeDescribeNotificationConfigurations(describeNotificationConfigurationsRequest, null, null, true); return EndDescribeNotificationConfigurations(asyncResult); }
/// <summary> /// <para> Returns a list of notification actions associated with Auto Scaling groups for specified events. </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the /// DescribeNotificationConfigurations service method on AmazonAutoScaling.</param> /// /// <returns>The response from the DescribeNotificationConfigurations service method, as returned by AmazonAutoScaling.</returns> /// /// <exception cref="T:Amazon.AutoScaling.Model.InvalidNextTokenException" /> public DescribeNotificationConfigurationsResponse DescribeNotificationConfigurations(DescribeNotificationConfigurationsRequest request) { var task = DescribeNotificationConfigurationsAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Initiates the asynchronous execution of the DescribeNotificationConfigurations operation. /// <seealso cref="Amazon.AutoScaling.IAmazonAutoScaling.DescribeNotificationConfigurations"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeNotificationConfigurations 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<DescribeNotificationConfigurationsResponse> DescribeNotificationConfigurationsAsync(DescribeNotificationConfigurationsRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeNotificationConfigurationsRequestMarshaller(); var unmarshaller = DescribeNotificationConfigurationsResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DescribeNotificationConfigurationsRequest, DescribeNotificationConfigurationsResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Paginator for DescribeNotificationConfigurations operation ///</summary> public IDescribeNotificationConfigurationsPaginator DescribeNotificationConfigurations(DescribeNotificationConfigurationsRequest request) { return(new DescribeNotificationConfigurationsPaginator(this.client, request)); }
internal DescribeNotificationConfigurationsResponse DescribeNotificationConfigurations(DescribeNotificationConfigurationsRequest request) { var task = DescribeNotificationConfigurationsAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
private Amazon.AutoScaling.Model.DescribeNotificationConfigurationsResponse CallAWSServiceOperation(IAmazonAutoScaling client, Amazon.AutoScaling.Model.DescribeNotificationConfigurationsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Auto Scaling", "DescribeNotificationConfigurations"); try { #if DESKTOP return(client.DescribeNotificationConfigurations(request)); #elif CORECLR return(client.DescribeNotificationConfigurationsAsync(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> /// Load auto scaling groups to view model with AWS data based on region selected and EC2 classic/vpc /// </summary> private void LoadAutoScalingGroups(AmazonAutoScalingClient asClient) { try { DescribeAutoScalingGroupsRequest asreq = new DescribeAutoScalingGroupsRequest(); DescribeAutoScalingGroupsResponse asresp = asClient.DescribeAutoScalingGroups(asreq); Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => { vm.AutoScalingGroups.Clear(); })); foreach (AutoScalingGroup asg in asresp.DescribeAutoScalingGroupsResult.AutoScalingGroups) { if (vm.IsVpc) { if (!string.IsNullOrEmpty(asg.VPCZoneIdentifier) && vm.SelectedVpc != null) { foreach (Models.ConsoleSubnet subnet in vm.SelectedVpc.Subnets) { if (asg.VPCZoneIdentifier.Contains(subnet.Subnet.SubnetId)) { //vm.AutoScalingGroups.Add(asg); Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => { vm.AutoScalingGroups.Add(new Models.ConsoleASG() { AutoScalingGroup = asg }); })); break; } } } } else { if (string.IsNullOrEmpty(asg.VPCZoneIdentifier)) { Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => { vm.AutoScalingGroups.Add(new Models.ConsoleASG() { AutoScalingGroup = asg }); })); } } } Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => { for (int i = 0; i < vm.AutoScalingGroups.Count(); i++) { DescribeNotificationConfigurationsRequest nreq = new DescribeNotificationConfigurationsRequest(); nreq.WithAutoScalingGroupNames(vm.AutoScalingGroups[i].AutoScalingGroup.AutoScalingGroupName); DescribeNotificationConfigurationsResponse nresp = asClient.DescribeNotificationConfigurations(nreq); vm.AutoScalingGroups[i].NotificationConfigurations = new List<NotificationConfiguration>(); foreach (NotificationConfiguration nc in nresp.DescribeNotificationConfigurationsResult.NotificationConfigurations) { vm.AutoScalingGroups[i].NotificationConfigurations.Add(nc); } } })); } catch (Exception ex) { LogManager.LogEntry(ex.Message); LogManager.LogEntry(ex.StackTrace); throw new DataLoadingException("Error occurred loading auto scaling groups for region and environment type"); } }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; var useParameterSelect = this.Select.StartsWith("^") || this.PassThru.IsPresent; // create request and set iteration invariants var request = new Amazon.AutoScaling.Model.DescribeNotificationConfigurationsRequest(); if (cmdletContext.AutoScalingGroupName != null) { request.AutoScalingGroupNames = cmdletContext.AutoScalingGroupName; } // Initialize loop variants and commence piping System.String _nextToken = null; int? _emitLimit = null; int _retrievedSoFar = 0; if (AutoIterationHelpers.HasValue(cmdletContext.NextToken)) { _nextToken = cmdletContext.NextToken; } if (AutoIterationHelpers.HasValue(cmdletContext.MaxRecord)) { _emitLimit = cmdletContext.MaxRecord; } var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.NextToken)); var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); do { request.NextToken = _nextToken; if (_emitLimit.HasValue) { request.MaxRecords = AutoIterationHelpers.ConvertEmitLimitToInt32(_emitLimit.Value); } CmdletOutput output; try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; if (!useParameterSelect) { pipelineOutput = cmdletContext.Select(response, this); } output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; int _receivedThisCall = response.NotificationConfigurations.Count; _nextToken = response.NextToken; _retrievedSoFar += _receivedThisCall; if (_emitLimit.HasValue) { _emitLimit -= _receivedThisCall; } } catch (Exception e) { if (_retrievedSoFar == 0 || !_emitLimit.HasValue) { output = new CmdletOutput { ErrorResponse = e }; } else { break; } } ProcessOutput(output); } while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken) && (!_emitLimit.HasValue || _emitLimit.Value >= 1)); if (useParameterSelect) { WriteObject(cmdletContext.Select(null, this)); } return(null); }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute var useParameterSelect = this.Select.StartsWith("^") || this.PassThru.IsPresent; #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute // create request and set iteration invariants var request = new Amazon.AutoScaling.Model.DescribeNotificationConfigurationsRequest(); if (cmdletContext.AutoScalingGroupName != null) { request.AutoScalingGroupNames = cmdletContext.AutoScalingGroupName; } if (cmdletContext.MaxRecord != null) { request.MaxRecords = AutoIterationHelpers.ConvertEmitLimitToServiceTypeInt32(cmdletContext.MaxRecord.Value); } // Initialize loop variant and commence piping var _nextToken = cmdletContext.NextToken; var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.NextToken)); var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); do { request.NextToken = _nextToken; CmdletOutput output; try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; if (!useParameterSelect) { pipelineOutput = cmdletContext.Select(response, this); } output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; _nextToken = response.NextToken; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } ProcessOutput(output); } while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken)); if (useParameterSelect) { WriteObject(cmdletContext.Select(null, this)); } return(null); }
/// <summary> /// <para> Returns a list of notification actions associated with Auto Scaling groups for specified events. </para> /// </summary> /// /// <param name="describeNotificationConfigurationsRequest">Container for the necessary parameters to execute the /// DescribeNotificationConfigurations service method on AmazonAutoScaling.</param> /// /// <returns>The response from the DescribeNotificationConfigurations service method, as returned by AmazonAutoScaling.</returns> /// /// <exception cref="InvalidNextTokenException"/> public DescribeNotificationConfigurationsResponse DescribeNotificationConfigurations(DescribeNotificationConfigurationsRequest describeNotificationConfigurationsRequest) { IRequest<DescribeNotificationConfigurationsRequest> request = new DescribeNotificationConfigurationsRequestMarshaller().Marshall(describeNotificationConfigurationsRequest); DescribeNotificationConfigurationsResponse response = Invoke<DescribeNotificationConfigurationsRequest, DescribeNotificationConfigurationsResponse> (request, this.signer, DescribeNotificationConfigurationsResponseUnmarshaller.GetInstance()); return response; }
internal DescribeNotificationConfigurationsResponse DescribeNotificationConfigurations(DescribeNotificationConfigurationsRequest request) { var marshaller = new DescribeNotificationConfigurationsRequestMarshaller(); var unmarshaller = DescribeNotificationConfigurationsResponseUnmarshaller.Instance; return Invoke<DescribeNotificationConfigurationsRequest,DescribeNotificationConfigurationsResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the DescribeNotificationConfigurations operation. /// <seealso cref="Amazon.AutoScaling.IAmazonAutoScaling"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeNotificationConfigurations operation on AmazonAutoScalingClient.</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 EndDescribeNotificationConfigurations /// operation.</returns> public IAsyncResult BeginDescribeNotificationConfigurations(DescribeNotificationConfigurationsRequest request, AsyncCallback callback, object state) { var marshaller = new DescribeNotificationConfigurationsRequestMarshaller(); var unmarshaller = DescribeNotificationConfigurationsResponseUnmarshaller.Instance; return BeginInvoke<DescribeNotificationConfigurationsRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Initiates the asynchronous execution of the DescribeNotificationConfigurations operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeNotificationConfigurations 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<DescribeNotificationConfigurationsResponse> DescribeNotificationConfigurationsAsync(DescribeNotificationConfigurationsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeNotificationConfigurationsRequestMarshaller(); var unmarshaller = DescribeNotificationConfigurationsResponseUnmarshaller.Instance; return InvokeAsync<DescribeNotificationConfigurationsRequest,DescribeNotificationConfigurationsResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the DescribeNotificationConfigurations operation. /// <seealso cref="Amazon.AutoScaling.IAmazonAutoScaling.DescribeNotificationConfigurations"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeNotificationConfigurations 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 async Task<DescribeNotificationConfigurationsResponse> DescribeNotificationConfigurationsAsync(DescribeNotificationConfigurationsRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeNotificationConfigurationsRequestMarshaller(); var unmarshaller = DescribeNotificationConfigurationsResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, DescribeNotificationConfigurationsRequest, DescribeNotificationConfigurationsResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }