Listing Domains

In the previous section, you created a domain. This section provides examples of how to list all domains within your account.

The following sample code snippets demonstrate listing domains.

Java

To run the sample

  1. Open a clean copy of ListDomainsSample.java.

  2. Remove any comment marks from the invokeListDomains(service, request); line.

  3. Compile and run the sample.

    Amazon SimpleDB returns the list of domains within the account, including the newly created MyStore domain.

C#

To run the sample

  1. Open AmazonSimpleDBSamples.cs.

  2. Comment out the code you added in the previous section.

  3. Replace the List Domains Action section with the following:

    ListDomains ListDomainsAction = new ListDomains();
    ListDomainsSample.InvokeListDomains(service, ListDomainsAction);
    
  4. Run the sample.

    Amazon SimpleDB returns the list of domains within the account, including the newly created MyStore domain.

Perl

To run the sample

  1. Open a clean copy of ListDomainsSample.pl.

  2. Remove any comment marks from the invokeCreateDomain($service, $request);line and add the following line after the @TODO: set request line:

    my $request = Amazon::SimpleDB::Model::ListDomains->new();
  3. Run the sample.

    Amazon SimpleDB returns the list of domains within the account, including the newly created MyStore domain.

PHP

To run the sample

  1. Open a clean copy of ListDomainsSample.php.

  2. Remove any comment marks from the invokeListDomains($service, $request); line and add the following line after the @TODO: set request line:

    $request = new Amazon_SimpleDB_Model_ListDomains();
  3. Run the sample.

    Amazon SimpleDB returns the list of domains within the account, including the newly created MyStore domain.

VB.NET

To run the sample

  1. Open AmazonSimpleDBSamples.vb.

  2. Comment out the code you added in the previous section.

  3. Replace the List Domains Action section with the following:

    Dim listDomainsAction As New ListDomains()
    
    ListDomainsSample.InvokeListDomains(service, listDomainsAction)
    
  4. Run the sample.

    Amazon SimpleDB returns the list of domains within the account, including the newly created MyStore domain.

Scratchpad

To run the sample

  1. Open the scratchpad application with a web browser.

  2. Select ListDomains from the Explore API list box.

  3. To limit the number of domains returned, enter a value in the Max Number Of Domains field.

  4. If there are more domains than you specified in the Max Number Of Domains field, Amazon SimpleDB returns a next token.

  5. To view the next page of results, enter the next token in the Next Token field.

  6. Select from the following:

    • To invoke the request, click Invoke Request.

      Amazon SimpleDB returns the list of domains within the account, including the newly created MyStore domain.

    • To view the signed URL, click Display Signed URL. Then, copy and paste the signed URL into a browser.

    • To view the string to sign, click Display String to Sign.