Container for the parameters to the CreateMicrosoftAD operation. Creates a Microsoft AD in the AWS cloud.

Before you call CreateMicrosoftAD, ensure that all of the required permissions have been explicitly granted through a policy. For details about what permissions are required to run the CreateMicrosoftAD operation, see AWS Directory Service API Permissions: Actions, Resources, and Conditions Reference.

Inheritance: AmazonDirectoryServiceRequest
        /// <summary>
        /// Initiates the asynchronous execution of the CreateMicrosoftAD operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateMicrosoftAD operation on AmazonDirectoryServiceClient.</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 EndCreateMicrosoftAD
        ///         operation.</returns>
        public IAsyncResult BeginCreateMicrosoftAD(CreateMicrosoftADRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new CreateMicrosoftADRequestMarshaller();
            var unmarshaller = CreateMicrosoftADResponseUnmarshaller.Instance;

            return BeginInvoke<CreateMicrosoftADRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
        /// <summary>
        /// Creates a Microsoft AD in the AWS cloud.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the CreateMicrosoftAD service method.</param>
        /// 
        /// <returns>The response from the CreateMicrosoftAD service method, as returned by DirectoryService.</returns>
        /// <exception cref="Amazon.DirectoryService.Model.ClientException">
        /// A client exception has occurred.
        /// </exception>
        /// <exception cref="Amazon.DirectoryService.Model.DirectoryLimitExceededException">
        /// The maximum number of directories in the region has been reached. You can use the
        /// <a>GetDirectoryLimits</a> operation to determine your directory limits in the region.
        /// </exception>
        /// <exception cref="Amazon.DirectoryService.Model.InvalidParameterException">
        /// One or more parameters are not valid.
        /// </exception>
        /// <exception cref="Amazon.DirectoryService.Model.ServiceException">
        /// An exception has occurred in AWS Directory Service.
        /// </exception>
        /// <exception cref="Amazon.DirectoryService.Model.UnsupportedOperationException">
        /// The operation is not supported.
        /// </exception>
        public CreateMicrosoftADResponse CreateMicrosoftAD(CreateMicrosoftADRequest request)
        {
            var marshaller = new CreateMicrosoftADRequestMarshaller();
            var unmarshaller = CreateMicrosoftADResponseUnmarshaller.Instance;

            return Invoke<CreateMicrosoftADRequest,CreateMicrosoftADResponse>(request, marshaller, unmarshaller);
        }
示例#3
0
 private Amazon.DirectoryService.Model.CreateMicrosoftADResponse CallAWSServiceOperation(IAmazonDirectoryService client, Amazon.DirectoryService.Model.CreateMicrosoftADRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Directory Service", "CreateMicrosoftAD");
     try
     {
         #if DESKTOP
         return(client.CreateMicrosoftAD(request));
         #elif CORECLR
         return(client.CreateMicrosoftADAsync(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>
        /// Initiates the asynchronous execution of the CreateMicrosoftAD operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateMicrosoftAD 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<CreateMicrosoftADResponse> CreateMicrosoftADAsync(CreateMicrosoftADRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateMicrosoftADRequestMarshaller();
            var unmarshaller = CreateMicrosoftADResponseUnmarshaller.Instance;

            return InvokeAsync<CreateMicrosoftADRequest,CreateMicrosoftADResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
示例#5
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.DirectoryService.Model.CreateMicrosoftADRequest();

            if (cmdletContext.Description != null)
            {
                request.Description = cmdletContext.Description;
            }
            if (cmdletContext.Edition != null)
            {
                request.Edition = cmdletContext.Edition;
            }
            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }
            if (cmdletContext.Password != null)
            {
                request.Password = cmdletContext.Password;
            }
            if (cmdletContext.ShortName != null)
            {
                request.ShortName = cmdletContext.ShortName;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }

            // populate VpcSettings
            var requestVpcSettingsIsNull = true;

            request.VpcSettings = new Amazon.DirectoryService.Model.DirectoryVpcSettings();
            List <System.String> requestVpcSettings_vpcSettings_SubnetId = null;

            if (cmdletContext.VpcSettings_SubnetId != null)
            {
                requestVpcSettings_vpcSettings_SubnetId = cmdletContext.VpcSettings_SubnetId;
            }
            if (requestVpcSettings_vpcSettings_SubnetId != null)
            {
                request.VpcSettings.SubnetIds = requestVpcSettings_vpcSettings_SubnetId;
                requestVpcSettingsIsNull      = false;
            }
            System.String requestVpcSettings_vpcSettings_VpcId = null;
            if (cmdletContext.VpcSettings_VpcId != null)
            {
                requestVpcSettings_vpcSettings_VpcId = cmdletContext.VpcSettings_VpcId;
            }
            if (requestVpcSettings_vpcSettings_VpcId != null)
            {
                request.VpcSettings.VpcId = requestVpcSettings_vpcSettings_VpcId;
                requestVpcSettingsIsNull  = false;
            }
            // determine if request.VpcSettings should be set to null
            if (requestVpcSettingsIsNull)
            {
                request.VpcSettings = null;
            }

            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);
        }