public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.ElastiCache.Model.CreateCacheParameterGroupRequest(); if (cmdletContext.CacheParameterGroupFamily != null) { request.CacheParameterGroupFamily = cmdletContext.CacheParameterGroupFamily; } if (cmdletContext.CacheParameterGroupName != null) { request.CacheParameterGroupName = cmdletContext.CacheParameterGroupName; } if (cmdletContext.Description != null) { request.Description = cmdletContext.Description; } if (cmdletContext.Tag != null) { request.Tags = cmdletContext.Tag; } 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> /// Initiates the asynchronous execution of the CreateCacheParameterGroup operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateCacheParameterGroup 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<CreateCacheParameterGroupResponse> CreateCacheParameterGroupAsync(CreateCacheParameterGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateCacheParameterGroupRequestMarshaller(); var unmarshaller = CreateCacheParameterGroupResponseUnmarshaller.Instance; return InvokeAsync<CreateCacheParameterGroupRequest,CreateCacheParameterGroupResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// The <i>CreateCacheParameterGroup</i> operation creates a new cache parameter group. /// A cache parameter group is a collection of parameters that you apply to all of the /// nodes in a cache cluster. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateCacheParameterGroup service method.</param> /// /// <returns>The response from the CreateCacheParameterGroup service method, as returned by ElastiCache.</returns> /// <exception cref="Amazon.ElastiCache.Model.CacheParameterGroupAlreadyExistsException"> /// A cache parameter group with the requested name already exists. /// </exception> /// <exception cref="Amazon.ElastiCache.Model.CacheParameterGroupQuotaExceededException"> /// The request cannot be processed because it would exceed the maximum number of cache /// security groups. /// </exception> /// <exception cref="Amazon.ElastiCache.Model.InvalidCacheParameterGroupStateException"> /// The current state of the cache parameter group does not allow the requested action /// to occur. /// </exception> /// <exception cref="Amazon.ElastiCache.Model.InvalidParameterCombinationException"> /// Two or more incompatible parameters were specified. /// </exception> /// <exception cref="Amazon.ElastiCache.Model.InvalidParameterValueException"> /// The value for a parameter is invalid. /// </exception> public CreateCacheParameterGroupResponse CreateCacheParameterGroup(CreateCacheParameterGroupRequest request) { var marshaller = new CreateCacheParameterGroupRequestMarshaller(); var unmarshaller = CreateCacheParameterGroupResponseUnmarshaller.Instance; return Invoke<CreateCacheParameterGroupRequest,CreateCacheParameterGroupResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the CreateCacheParameterGroup operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateCacheParameterGroup operation on AmazonElastiCacheClient.</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 EndCreateCacheParameterGroup /// operation.</returns> public IAsyncResult BeginCreateCacheParameterGroup(CreateCacheParameterGroupRequest request, AsyncCallback callback, object state) { var marshaller = new CreateCacheParameterGroupRequestMarshaller(); var unmarshaller = CreateCacheParameterGroupResponseUnmarshaller.Instance; return BeginInvoke<CreateCacheParameterGroupRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Initiates the asynchronous execution of the CreateCacheParameterGroup operation. /// <seealso cref="Amazon.ElastiCache.IAmazonElastiCache.CreateCacheParameterGroup"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateCacheParameterGroup 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<CreateCacheParameterGroupResponse> CreateCacheParameterGroupAsync(CreateCacheParameterGroupRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateCacheParameterGroupRequestMarshaller(); var unmarshaller = CreateCacheParameterGroupResponseUnmarshaller.GetInstance(); return Invoke<IRequest, CreateCacheParameterGroupRequest, CreateCacheParameterGroupResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para>The <i>CreateCacheParameterGroup</i> operation creates a new cache parameter group. A cache parameter group is a collection of /// parameters that you apply to all of the nodes in a cache cluster.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateCacheParameterGroup service /// method on AmazonElastiCache.</param> /// /// <returns>The response from the CreateCacheParameterGroup service method, as returned by AmazonElastiCache.</returns> /// /// <exception cref="T:Amazon.ElastiCache.Model.InvalidParameterValueException" /> /// <exception cref="T:Amazon.ElastiCache.Model.CacheParameterGroupQuotaExceededException" /> /// <exception cref="T:Amazon.ElastiCache.Model.CacheParameterGroupAlreadyExistsException" /> /// <exception cref="T:Amazon.ElastiCache.Model.InvalidParameterCombinationException" /> /// <exception cref="T:Amazon.ElastiCache.Model.InvalidCacheParameterGroupStateException" /> public CreateCacheParameterGroupResponse CreateCacheParameterGroup(CreateCacheParameterGroupRequest request) { var task = CreateCacheParameterGroupAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
IAsyncResult invokeCreateCacheParameterGroup(CreateCacheParameterGroupRequest createCacheParameterGroupRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new CreateCacheParameterGroupRequestMarshaller().Marshall(createCacheParameterGroupRequest); var unmarshaller = CreateCacheParameterGroupResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the CreateCacheParameterGroup operation. /// <seealso cref="Amazon.ElastiCache.IAmazonElastiCache.CreateCacheParameterGroup"/> /// </summary> /// /// <param name="createCacheParameterGroupRequest">Container for the necessary parameters to execute the CreateCacheParameterGroup operation on /// AmazonElastiCache.</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 /// EndCreateCacheParameterGroup operation.</returns> public IAsyncResult BeginCreateCacheParameterGroup(CreateCacheParameterGroupRequest createCacheParameterGroupRequest, AsyncCallback callback, object state) { return invokeCreateCacheParameterGroup(createCacheParameterGroupRequest, callback, state, false); }
/// <summary> /// <para>The <i>CreateCacheParameterGroup</i> operation creates a new cache parameter group. A cache parameter group is a collection of /// parameters that you apply to all of the nodes in a cache cluster.</para> /// </summary> /// /// <param name="createCacheParameterGroupRequest">Container for the necessary parameters to execute the CreateCacheParameterGroup service /// method on AmazonElastiCache.</param> /// /// <returns>The response from the CreateCacheParameterGroup service method, as returned by AmazonElastiCache.</returns> /// /// <exception cref="InvalidParameterValueException"/> /// <exception cref="CacheParameterGroupQuotaExceededException"/> /// <exception cref="CacheParameterGroupAlreadyExistsException"/> /// <exception cref="InvalidParameterCombinationException"/> /// <exception cref="InvalidCacheParameterGroupStateException"/> public CreateCacheParameterGroupResponse CreateCacheParameterGroup(CreateCacheParameterGroupRequest createCacheParameterGroupRequest) { IAsyncResult asyncResult = invokeCreateCacheParameterGroup(createCacheParameterGroupRequest, null, null, true); return EndCreateCacheParameterGroup(asyncResult); }
private Amazon.ElastiCache.Model.CreateCacheParameterGroupResponse CallAWSServiceOperation(IAmazonElastiCache client, Amazon.ElastiCache.Model.CreateCacheParameterGroupRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon ElastiCache", "CreateCacheParameterGroup"); try { #if DESKTOP return(client.CreateCacheParameterGroup(request)); #elif CORECLR return(client.CreateCacheParameterGroupAsync(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> /// <para>The <i>CreateCacheParameterGroup</i> operation creates a new cache parameter group. A cache parameter group is a collection of /// parameters that you apply to all of the nodes in a cache cluster.</para> /// </summary> /// /// <param name="createCacheParameterGroupRequest">Container for the necessary parameters to execute the CreateCacheParameterGroup service /// method on AmazonElastiCache.</param> /// /// <returns>The response from the CreateCacheParameterGroup service method, as returned by AmazonElastiCache.</returns> /// /// <exception cref="T:Amazon.ElastiCache.Model.InvalidParameterValueException" /> /// <exception cref="T:Amazon.ElastiCache.Model.CacheParameterGroupQuotaExceededException" /> /// <exception cref="T:Amazon.ElastiCache.Model.CacheParameterGroupAlreadyExistsException" /> /// <exception cref="T:Amazon.ElastiCache.Model.InvalidParameterCombinationException" /> /// <exception cref="T:Amazon.ElastiCache.Model.InvalidCacheParameterGroupStateException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<CreateCacheParameterGroupResponse> CreateCacheParameterGroupAsync(CreateCacheParameterGroupRequest createCacheParameterGroupRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateCacheParameterGroupRequestMarshaller(); var unmarshaller = CreateCacheParameterGroupResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, CreateCacheParameterGroupRequest, CreateCacheParameterGroupResponse>(createCacheParameterGroupRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
internal CreateCacheParameterGroupResponse CreateCacheParameterGroup(CreateCacheParameterGroupRequest request) { var task = CreateCacheParameterGroupAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// <para> Creates a new Cache Parameter Group. Cache Parameter groups control the parameters for a Cache Cluster.</para> /// </summary> /// /// <param name="createCacheParameterGroupRequest">Container for the necessary parameters to execute the CreateCacheParameterGroup service /// method on AmazonElastiCache.</param> /// /// <returns>The response from the CreateCacheParameterGroup service method, as returned by AmazonElastiCache.</returns> /// /// <exception cref="InvalidParameterValueException"/> /// <exception cref="CacheParameterGroupQuotaExceededException"/> /// <exception cref="CacheParameterGroupAlreadyExistsException"/> /// <exception cref="InvalidParameterCombinationException"/> /// <exception cref="InvalidCacheParameterGroupStateException"/> public CreateCacheParameterGroupResponse CreateCacheParameterGroup(CreateCacheParameterGroupRequest createCacheParameterGroupRequest) { IRequest<CreateCacheParameterGroupRequest> request = new CreateCacheParameterGroupRequestMarshaller().Marshall(createCacheParameterGroupRequest); CreateCacheParameterGroupResponse response = Invoke<CreateCacheParameterGroupRequest, CreateCacheParameterGroupResponse> (request, this.signer, CreateCacheParameterGroupResponseUnmarshaller.GetInstance()); return response; }