internal CreateAssociationResponse CreateAssociation(CreateAssociationRequest request)
        {
            var marshaller   = new CreateAssociationRequestMarshaller();
            var unmarshaller = CreateAssociationResponseUnmarshaller.Instance;

            return(Invoke <CreateAssociationRequest, CreateAssociationResponse>(request, marshaller, unmarshaller));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the CreateAssociation operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the CreateAssociation 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 <CreateAssociationResponse> CreateAssociationAsync(CreateAssociationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new CreateAssociationRequestMarshaller();
            var unmarshaller = CreateAssociationResponseUnmarshaller.Instance;

            return(InvokeAsync <CreateAssociationRequest, CreateAssociationResponse>(request, marshaller,
                                                                                     unmarshaller, cancellationToken));
        }
        /// <summary>
        /// Associates the specified configuration document with the specified instance.
        ///
        ///
        /// <para>
        /// When you associate a configuration document with an instance, the configuration agent
        /// on the instance processes the configuration document and configures the instance as
        /// specified.
        /// </para>
        ///
        /// <para>
        /// If you associate a configuration document with an instance that already has an associated
        /// configuration document, we replace the current configuration document with the new
        /// configuration document.
        /// </para>
        /// </summary>
        /// <param name="instanceId">The ID of the instance.</param>
        /// <param name="name">The name of the configuration document.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        ///
        /// <returns>The response from the CreateAssociation service method, as returned by SimpleSystemsManagement.</returns>
        /// <exception cref="Amazon.SimpleSystemsManagement.Model.AssociationAlreadyExistsException">
        /// The specified association already exists.
        /// </exception>
        /// <exception cref="Amazon.SimpleSystemsManagement.Model.AssociationLimitExceededException">
        /// You can have at most 2,000 active associations.
        /// </exception>
        /// <exception cref="Amazon.SimpleSystemsManagement.Model.InternalServerErrorException">
        /// An error occurred on the server side.
        /// </exception>
        /// <exception cref="Amazon.SimpleSystemsManagement.Model.InvalidDocumentException">
        /// The configuration document is not valid.
        /// </exception>
        /// <exception cref="Amazon.SimpleSystemsManagement.Model.InvalidInstanceIdException">
        /// You must specify the ID of a running instance.
        /// </exception>
        public Task <CreateAssociationResponse> CreateAssociationAsync(string instanceId, string name, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var request = new CreateAssociationRequest();

            request.InstanceId = instanceId;
            request.Name       = name;
            return(CreateAssociationAsync(request, cancellationToken));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Create(CreateAssociationRequest request)
        {
            var result = await _mediatorService.Send(request);

            return(Created("api/Associations/Id-Here", result));
        }