Deleting a Domain

This section provides examples of how to delete a domain.

The following sample code snippets demonstrate deleting the MyStore domain.

Java

To run the sample

  1. Open a clean copy of DeleteDomainSample.java.

  2. Remove any comment marks from the invokeDeleteDomain(service, request); line and add the following line after // @TODO: set request parameters here:

    request.withDomainName("MyStore");
  3. Compile and run the sample.

    Amazon SimpleDB deletes MyStore.

To verify whether the domain is deleted, see Listing Domains.

C#

To run the sample

  1. Open AmazonSimpleDBSamples.cs.

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

  3. Add the following to the Delete Domain Action section:

    DeleteDomain deleteDomainAction = new DeleteDomain().WithDomainName("MyStore");
    
    DeleteDomainSample.InvokeDeleteDomain(service, deleteDomainAction);
    
  4. Run the sample.

    Amazon SimpleDB deletes MyStore.

To verify whether the domain is deleted, see Listing Domains.

Perl

To run the sample

  1. Open a clean copy of DeleteDomainSample.pl.

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

    my $request = Amazon::SimpleDB::Model::DeleteDomain->new({DomainName => "MyStore"});
  3. Run the sample.

    Amazon SimpleDB deletes MyStore.

To verify whether the domain is deleted, see Listing Domains.

PHP

To run the sample

  1. Open a clean copy of DeleteDomainSample.php.

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

     $request = new Amazon_SimpleDB_Model_DeleteDomain();
     $request->setDomainName('MyStore');
     
  3. Run the sample.

    Amazon SimpleDB deletes MyStore.

To verify whether the domain is deleted, see Listing Domains.

VB.NET

To run the sample

  1. Open AmazonSimpleDBSamples.vb.

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

  3. Add the following to the Delete Domain Action section:

    Dim deleteDomainAction As New DeleteDomain()
    deleteDomainAction.WithDomainName("MyStore")
    
    DeleteDomainSample.InvokeDeleteDomain(service, deleteDomainAction)
    
  4. Run the sample.

    Amazon SimpleDB deletes MyStore.

To verify whether the domain is deleted, see Listing Domains.

Scratchpad

To run the sample

  1. Open the scratchpad application with a web browser.

  2. Select DeleteDomain from the Explore API list box.

  3. Enter MyStore in the Domain Name field.

  4. Click Invoke Request. The scratchpad returns a signed URL

  5. Select from the following:

    • To invoke the request, click Invoke Request.

      Amazon SimpleDB returns a response.

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

      Amazon SimpleDB returns a response.

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

To verify whether the domain is deleted, see Listing Domains.