Container for the parameters to the GetHostedZone operation. Retrieves the delegation set for a hosted zone, including the four name servers assigned to the hosted zone. Send a GET request to the /Amazon Route 53 API version/hostedzone/hosted zone ID resource.
Inheritance: AmazonRoute53Request
Exemplo n.º 1
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.Route53.Model.GetHostedZoneRequest();

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

            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>
        /// <para> To retrieve the delegation set for a hosted zone, send a <c>GET</c> request to the <c>2013-04-01/hostedzone/hosted zone ID </c>
        /// resource. The delegation set is the four Route 53 name servers that were assigned to the hosted zone when you created it.</para>
        /// </summary>
        /// 
        /// <param name="getHostedZoneRequest">Container for the necessary parameters to execute the GetHostedZone service method on
        /// AmazonRoute53.</param>
        /// 
        /// <returns>The response from the GetHostedZone service method, as returned by AmazonRoute53.</returns>
        /// 
        /// <exception cref="T:Amazon.Route53.Model.NoSuchHostedZoneException" />
        /// <exception cref="T:Amazon.Route53.Model.InvalidInputException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<GetHostedZoneResponse> GetHostedZoneAsync(GetHostedZoneRequest getHostedZoneRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new GetHostedZoneRequestMarshaller();
            var unmarshaller = GetHostedZoneResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, GetHostedZoneRequest, GetHostedZoneResponse>(getHostedZoneRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
		internal GetHostedZoneResponse GetHostedZone(GetHostedZoneRequest request)
        {
            var task = GetHostedZoneAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
Exemplo n.º 4
0
 private Amazon.Route53.Model.GetHostedZoneResponse CallAWSServiceOperation(IAmazonRoute53 client, Amazon.Route53.Model.GetHostedZoneRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Route 53", "GetHostedZone");
     try
     {
         #if DESKTOP
         return(client.GetHostedZone(request));
         #elif CORECLR
         return(client.GetHostedZoneAsync(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;
     }
 }
Exemplo n.º 5
0
        /// <summary>
        /// <para> To retrieve the delegation set for a hosted zone, send a <c>GET</c> request to the <c>2012-12-12/hostedzone/hosted zone ID </c>
        /// resource. The delegation set is the four Route 53 name servers that were assigned to the hosted zone when you created it.</para>
        /// </summary>
        /// 
        /// <param name="getHostedZoneRequest">Container for the necessary parameters to execute the GetHostedZone service method on
        /// AmazonRoute53.</param>
        /// 
        /// <returns>The response from the GetHostedZone service method, as returned by AmazonRoute53.</returns>
        /// 
        /// <exception cref="T:Amazon.Route53.Model.InvalidInputException" />
        /// <exception cref="T:Amazon.Route53.Model.NoSuchHostedZoneException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public async Task<GetHostedZoneResponse> GetHostedZoneAsync(GetHostedZoneRequest getHostedZoneRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new GetHostedZoneRequestMarshaller();
            var unmarshaller = GetHostedZoneResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, GetHostedZoneRequest, GetHostedZoneResponse>(getHostedZoneRequest, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
        /// <summary>
        /// Initiates the asynchronous execution of the GetHostedZone operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetHostedZone 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<GetHostedZoneResponse> GetHostedZoneAsync(GetHostedZoneRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new GetHostedZoneRequestMarshaller();
            var unmarshaller = GetHostedZoneResponseUnmarshaller.Instance;

            return InvokeAsync<GetHostedZoneRequest,GetHostedZoneResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
Exemplo n.º 7
0
		internal GetHostedZoneResponse GetHostedZone(GetHostedZoneRequest request)
        {
            var task = GetHostedZoneAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
        /// <summary>
        /// To retrieve the delegation set for a hosted zone, send a <code>GET</code> request
        /// to the <code>2013-04-01/hostedzone/<i>hosted zone ID</i></code> resource. The delegation
        /// set is the four Route 53 name servers that were assigned to the hosted zone when you
        /// created it.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the GetHostedZone service method.</param>
        /// 
        /// <returns>The response from the GetHostedZone service method, as returned by Route53.</returns>
        /// <exception cref="Amazon.Route53.Model.InvalidInputException">
        /// Some value specified in the request is invalid or the XML document is malformed.
        /// </exception>
        /// <exception cref="Amazon.Route53.Model.NoSuchHostedZoneException">
        /// 
        /// </exception>
        public GetHostedZoneResponse GetHostedZone(GetHostedZoneRequest request)
        {
            var marshaller = new GetHostedZoneRequestMarshaller();
            var unmarshaller = GetHostedZoneResponseUnmarshaller.Instance;

            return Invoke<GetHostedZoneRequest,GetHostedZoneResponse>(request, marshaller, unmarshaller);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the GetHostedZone operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetHostedZone operation on AmazonRoute53Client.</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 EndGetHostedZone
        ///         operation.</returns>
        public IAsyncResult BeginGetHostedZone(GetHostedZoneRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new GetHostedZoneRequestMarshaller();
            var unmarshaller = GetHostedZoneResponseUnmarshaller.Instance;

            return BeginInvoke<GetHostedZoneRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
Exemplo n.º 10
0
 IAsyncResult invokeGetHostedZone(GetHostedZoneRequest getHostedZoneRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new GetHostedZoneRequestMarshaller().Marshall(getHostedZoneRequest);
     var unmarshaller = GetHostedZoneResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
Exemplo n.º 11
0
 /// <summary>
 /// <para> To retrieve the delegation set for a hosted zone, send a <c>GET</c> request to the <c>2011-05-05/hostedzone/hosted zone ID </c>
 /// resource. The delegation set is the four Route 53 name servers that were assigned to the hosted zone when you created it.</para>
 /// </summary>
 /// 
 /// <param name="getHostedZoneRequest">Container for the necessary parameters to execute the GetHostedZone service method on
 ///          AmazonRoute53.</param>
 /// 
 /// <returns>The response from the GetHostedZone service method, as returned by AmazonRoute53.</returns>
 /// 
 /// <exception cref="InvalidInputException"/>
 public GetHostedZoneResponse GetHostedZone(GetHostedZoneRequest getHostedZoneRequest)
 {
     IAsyncResult asyncResult = invokeGetHostedZone(getHostedZoneRequest, null, null, true);
     return EndGetHostedZone(asyncResult);
 }
Exemplo n.º 12
0
 /// <summary>
 /// Initiates the asynchronous execution of the GetHostedZone operation.
 /// <seealso cref="Amazon.Route53.AmazonRoute53.GetHostedZone"/>
 /// </summary>
 /// 
 /// <param name="getHostedZoneRequest">Container for the necessary parameters to execute the GetHostedZone operation on AmazonRoute53.</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 EndGetHostedZone
 ///         operation.</returns>
 public IAsyncResult BeginGetHostedZone(GetHostedZoneRequest getHostedZoneRequest, AsyncCallback callback, object state)
 {
     return invokeGetHostedZone(getHostedZoneRequest, callback, state, false);
 }