public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.RDS.Model.AddTagsToResourceRequest(); if (cmdletContext.ResourceName != null) { request.ResourceName = cmdletContext.ResourceName; } 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 AddTagsToResource operation. /// <seealso cref="Amazon.RDS.AmazonRDS.AddTagsToResource"/> /// </summary> /// /// <param name="addTagsToResourceRequest">Container for the necessary parameters to execute the AddTagsToResource operation on /// AmazonRDS.</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> public IAsyncResult BeginAddTagsToResource(AddTagsToResourceRequest addTagsToResourceRequest, AsyncCallback callback, object state) { return invokeAddTagsToResource(addTagsToResourceRequest, callback, state, false); }
IAsyncResult invokeAddTagsToResource(AddTagsToResourceRequest addTagsToResourceRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new AddTagsToResourceRequestMarshaller().Marshall(addTagsToResourceRequest); var unmarshaller = AddTagsToResourceResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para> Adds metadata tags to a DB Instance. These tags can also be used with cost allocation reporting to track cost associated with a DB /// Instance.</para> <para>For an overview on tagging DB Instances, see DB Instance Tags. </para> /// </summary> /// /// <param name="addTagsToResourceRequest">Container for the necessary parameters to execute the AddTagsToResource service method on /// AmazonRDS.</param> /// /// <exception cref="DBInstanceNotFoundException"/> /// <exception cref="DBSnapshotNotFoundException"/> public AddTagsToResourceResponse AddTagsToResource(AddTagsToResourceRequest addTagsToResourceRequest) { IAsyncResult asyncResult = invokeAddTagsToResource(addTagsToResourceRequest, null, null, true); return EndAddTagsToResource(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the AddTagsToResource operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AddTagsToResource 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<AddTagsToResourceResponse> AddTagsToResourceAsync(AddTagsToResourceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new AddTagsToResourceRequestMarshaller(); var unmarshaller = AddTagsToResourceResponseUnmarshaller.Instance; return InvokeAsync<AddTagsToResourceRequest,AddTagsToResourceResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Adds metadata tags to an Amazon RDS resource. These tags can also be used with cost /// allocation reporting to track cost associated with Amazon RDS resources, or used in /// a Condition statement in an IAM policy for Amazon RDS. /// /// /// <para> /// For an overview on tagging Amazon RDS resources, see <a href="http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.Tagging.html">Tagging /// Amazon RDS Resources</a>. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the AddTagsToResource service method.</param> /// /// <returns>The response from the AddTagsToResource service method, as returned by RDS.</returns> /// <exception cref="Amazon.RDS.Model.DBInstanceNotFoundException"> /// <i>DBInstanceIdentifier</i> does not refer to an existing DB instance. /// </exception> /// <exception cref="Amazon.RDS.Model.DBSnapshotNotFoundException"> /// <i>DBSnapshotIdentifier</i> does not refer to an existing DB snapshot. /// </exception> public AddTagsToResourceResponse AddTagsToResource(AddTagsToResourceRequest request) { var marshaller = new AddTagsToResourceRequestMarshaller(); var unmarshaller = AddTagsToResourceResponseUnmarshaller.Instance; return Invoke<AddTagsToResourceRequest,AddTagsToResourceResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the AddTagsToResource operation. /// <seealso cref="Amazon.RDS.IAmazonRDS.AddTagsToResource"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AddTagsToResource 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<AddTagsToResourceResponse> AddTagsToResourceAsync(AddTagsToResourceRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new AddTagsToResourceRequestMarshaller(); var unmarshaller = AddTagsToResourceResponseUnmarshaller.GetInstance(); return Invoke<IRequest, AddTagsToResourceRequest, AddTagsToResourceResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para> Adds metadata tags to an Amazon RDS resource. These tags can also be used with cost allocation reporting to track cost associated /// with Amazon RDS resources, or used in Condition statement in IAM policy for Amazon RDS.</para> <para>For an overview on tagging Amazon RDS /// resources, see <a href="http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.Tagging.html">Tagging Amazon RDS Resources</a> /// .</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AddTagsToResource service method on /// AmazonRDS.</param> /// /// <exception cref="T:Amazon.RDS.Model.DBInstanceNotFoundException" /> /// <exception cref="T:Amazon.RDS.Model.DBSnapshotNotFoundException" /> public AddTagsToResourceResponse AddTagsToResource(AddTagsToResourceRequest request) { var task = AddTagsToResourceAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// <para> Adds metadata tags to an Amazon RDS resource. These tags can also be used with cost allocation reporting to track cost associated /// with Amazon RDS resources, or used in Condition statement in IAM policy for Amazon RDS.</para> <para>For an overview on tagging Amazon RDS /// resources, see <a href="http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.Tagging.html">Tagging Amazon RDS Resources</a> /// .</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AddTagsToResource service method on /// AmazonRDS.</param> /// /// <exception cref="T:Amazon.RDS.Model.DBInstanceNotFoundException" /> /// <exception cref="T:Amazon.RDS.Model.DBSnapshotNotFoundException" /> public AddTagsToResourceResponse AddTagsToResource(AddTagsToResourceRequest request) { var task = AddTagsToResourceAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// <para> Adds metadata tags to an Amazon RDS resource. These tags can also be used with cost allocation reporting to track cost associated /// with Amazon RDS resources, or used in Condition statement in IAM policy for Amazon RDS.</para> <para>For an overview on tagging Amazon RDS /// resources, see <a href="http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.Tagging.html">Tagging Amazon RDS Resources</a> /// .</para> /// </summary> /// /// <param name="addTagsToResourceRequest">Container for the necessary parameters to execute the AddTagsToResource service method on /// AmazonRDS.</param> /// /// <exception cref="T:Amazon.RDS.Model.DBInstanceNotFoundException" /> /// <exception cref="T:Amazon.RDS.Model.DBSnapshotNotFoundException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<AddTagsToResourceResponse> AddTagsToResourceAsync(AddTagsToResourceRequest addTagsToResourceRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new AddTagsToResourceRequestMarshaller(); var unmarshaller = AddTagsToResourceResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, AddTagsToResourceRequest, AddTagsToResourceResponse>(addTagsToResourceRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// Initiates the asynchronous execution of the AddTagsToResource operation. /// <seealso cref="Amazon.RDS.IAmazonRDS"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AddTagsToResource operation on AmazonRDSClient.</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 EndAddTagsToResource /// operation.</returns> public IAsyncResult BeginAddTagsToResource(AddTagsToResourceRequest request, AsyncCallback callback, object state) { var marshaller = new AddTagsToResourceRequestMarshaller(); var unmarshaller = AddTagsToResourceResponseUnmarshaller.Instance; return BeginInvoke<AddTagsToResourceRequest>(request, marshaller, unmarshaller, callback, state); }
private Amazon.RDS.Model.AddTagsToResourceResponse CallAWSServiceOperation(IAmazonRDS client, Amazon.RDS.Model.AddTagsToResourceRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Relational Database Service", "AddTagsToResource"); try { #if DESKTOP return(client.AddTagsToResource(request)); #elif CORECLR return(client.AddTagsToResourceAsync(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; } }