Amazon.Route53.AmazonRoute53Client.GetChange C# (CSharp) Метод

GetChange() публичный Метод

Returns the current status of a change batch request. The status is one of the following values:
  • PENDING indicates that the changes in this request have not replicated to all Amazon Route 53 DNS servers. This is the initial status of all change batch requests.

  • INSYNC indicates that the changes have replicated to all Amazon Route 53 DNS servers.

/// The input is not valid. /// /// A change with the specified change ID does not exist. ///
public GetChange ( GetChangeRequest request ) : GetChangeResponse
request GetChangeRequest Container for the necessary parameters to execute the GetChange service method.
Результат GetChangeResponse
        public GetChangeResponse GetChange(GetChangeRequest request)
        {
            var marshaller = new GetChangeRequestMarshaller();
            var unmarshaller = GetChangeResponseUnmarshaller.Instance;

            return Invoke<GetChangeRequest,GetChangeResponse>(request, marshaller, unmarshaller);
        }

Usage Example

Пример #1
0
    public static void Route53CreateAdd(string[] args)
    {
      #region Route53CreateAdd
      string domainName = "www.example.org";

      IAmazonRoute53 route53Client = new AmazonRoute53Client();

      CreateHostedZoneRequest zoneRequest = new CreateHostedZoneRequest
      {
        Name = domainName,
        CallerReference = "my_change_request"
      };

      CreateHostedZoneResponse zoneResponse = route53Client.CreateHostedZone(zoneRequest);

      ResourceRecordSet recordSet = new ResourceRecordSet
      {
        Name = domainName,
        TTL = 60,
        Type = RRType.A,
        ResourceRecords = new List<ResourceRecord> { new ResourceRecord { Value = "192.0.2.235" } }
      };

      Change change1 = new Change
      {
        ResourceRecordSet = recordSet,
        Action = ChangeAction.CREATE
      };

      ChangeBatch changeBatch = new ChangeBatch
      {
        Changes = new List<Change> { change1 }
      };

      ChangeResourceRecordSetsRequest recordsetRequest = new ChangeResourceRecordSetsRequest
      {
        HostedZoneId = zoneResponse.HostedZone.Id,
        ChangeBatch = changeBatch
      };

      ChangeResourceRecordSetsResponse recordsetResponse = route53Client.ChangeResourceRecordSets(recordsetRequest);

      GetChangeRequest changeRequest = new GetChangeRequest
      {
        Id = recordsetResponse.ChangeInfo.Id
      };

      while (route53Client.GetChange(changeRequest).ChangeInfo.Status == ChangeStatus.PENDING)
      {
        Console.WriteLine("Change is pending.");
        Thread.Sleep(TimeSpan.FromSeconds(15));
      }
      #endregion

      Console.WriteLine("Change is complete.");
      Console.ReadKey();
    }
AmazonRoute53Client