Container for the parameters to the CheckDomainAvailability operation. This operation checks the availability of one domain name. Note that if the availability status of a domain is pending, you must submit another request to determine the availability of the domain name.
Inheritance: AmazonRoute53DomainsRequest
コード例 #1
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.Route53Domains.Model.CheckDomainAvailabilityRequest();

            if (cmdletContext.DomainName != null)
            {
                request.DomainName = cmdletContext.DomainName;
            }
            if (cmdletContext.IdnLangCode != null)
            {
                request.IdnLangCode = cmdletContext.IdnLangCode;
            }

            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);
        }
コード例 #2
0
        /// <summary>
        /// Initiates the asynchronous execution of the CheckDomainAvailability operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CheckDomainAvailability 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<CheckDomainAvailabilityResponse> CheckDomainAvailabilityAsync(CheckDomainAvailabilityRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CheckDomainAvailabilityRequestMarshaller();
            var unmarshaller = CheckDomainAvailabilityResponseUnmarshaller.Instance;

            return InvokeAsync<CheckDomainAvailabilityRequest,CheckDomainAvailabilityResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
コード例 #3
0
        internal CheckDomainAvailabilityResponse CheckDomainAvailability(CheckDomainAvailabilityRequest request)
        {
            var marshaller = new CheckDomainAvailabilityRequestMarshaller();
            var unmarshaller = CheckDomainAvailabilityResponseUnmarshaller.Instance;

            return Invoke<CheckDomainAvailabilityRequest,CheckDomainAvailabilityResponse>(request, marshaller, unmarshaller);
        }
コード例 #4
0
 private Amazon.Route53Domains.Model.CheckDomainAvailabilityResponse CallAWSServiceOperation(IAmazonRoute53Domains client, Amazon.Route53Domains.Model.CheckDomainAvailabilityRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Route 53 Domains", "CheckDomainAvailability");
     try
     {
         #if DESKTOP
         return(client.CheckDomainAvailability(request));
         #elif CORECLR
         return(client.CheckDomainAvailabilityAsync(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;
     }
 }
コード例 #5
0
        /// <summary>
        /// Initiates the asynchronous execution of the CheckDomainAvailability operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CheckDomainAvailability operation on AmazonRoute53DomainsClient.</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 EndCheckDomainAvailability
        ///         operation.</returns>
        public IAsyncResult BeginCheckDomainAvailability(CheckDomainAvailabilityRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new CheckDomainAvailabilityRequestMarshaller();
            var unmarshaller = CheckDomainAvailabilityResponseUnmarshaller.Instance;

            return BeginInvoke<CheckDomainAvailabilityRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
コード例 #6
0
ファイル: DomainChecker.cs プロジェクト: volkanx/domchk53
        public DomainCheckResult CheckSingleDomainSingleTld(string domainName, string tld)
        {
            var domainCheckResult = new DomainCheckResult()
            {
                Domain = domainName,
                Tld = tld,
                CheckDate = DateTime.UtcNow
            };

            var response = new CheckDomainAvailabilityResponse();
            var request = new CheckDomainAvailabilityRequest() { DomainName = $"{domainName}.{tld}" };

            try
            {
                response = _amazonRoute53DomainsClient.CheckDomainAvailability(request);

                domainCheckResult.Availability = response.Availability;
                domainCheckResult.RequestResult = response.HttpStatusCode.ToString();
            }
            catch (Exception ex)
            {
                domainCheckResult.RequestResult = response.HttpStatusCode.ToString();
                domainCheckResult.ErrorMessage = ex.Message;

                Console.WriteLine($"ERROR {domainCheckResult.Domain} --> {domainCheckResult.ErrorMessage}");
            }

            Console.WriteLine($"{request.DomainName} --> {domainCheckResult.Availability}");

            return domainCheckResult;
        }