Elastacloud.AzureManagement.Fluent.Commands.Services.ServiceCommand.Execute C# (CSharp) Method

Execute() public method

Executes the request and waits for a response from the Service Management API Control is delegated back to the calling class when the reponse comes back which releases the WaitHandle
public Execute ( ) : void
return void
        public virtual void Execute()
        {
            _exception = null;
            var serviceManagementRequest = new ServiceManagementRequest
                                               {
                                                   BaseUri = BaseRequestUri + (IsManagement ? ":8443" : ""),
                                                   HttpVerb = HttpVerb,
                                                   OptionalData = HttpCommand,
                                                   ServiceType = ServiceType,
                                                   OperationId = OperationId,
                                                   SubscriptionId = SubscriptionId,
                                                   Body = CreatePayload(),
                                                   Certificate = Certificate,
                                                   AdditionalHeaders = AdditionalHeaders,
                                                   ContentType = ContentType,
                                                   Accept = Accept,
                                                   RequestWithoutCertificate =
                                                       !(UseCertificate.HasValue && UseCertificate.Value)
                                               };

            CurrentQueryManager = CurrentQueryManager ?? new QueryManager();
            CurrentQueryManager.MakeASyncRequest(serviceManagementRequest, ResponseCallback, ErrorResponseCallback);
            // wait for up to 30 minutes - if a deployment takes longer than that ... it's probably HPC!
            SitAndWait.WaitOne(200000);
            if(_lastFailureResponse != null)
                throw new FluentManagementException(_lastFailureResponse, "ServiceCommand");
            if (_exception != null)
                throw new FluentManagementWebException(_exception as WebException);
        }