protected override void ProcessRecord() { AmazonSimpleDB client = base.GetClient(); Amazon.SimpleDB.Model.DeleteDomainRequest request = new Amazon.SimpleDB.Model.DeleteDomainRequest(); request.DomainName = this._DomainName; Amazon.SimpleDB.Model.DeleteDomainResponse response = client.DeleteDomain(request); }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack) { CheckIfFacebookAppIsSetupCorrectly(); var auth = new CanvasAuthorizer { Permissions = new[] { "user_about_me" } }; if (auth.Authorize()) { ShowFacebookContent(); } } else { AmazonSimpleDB sdb = GetSDB(); // Should I clean out the AWS domain state? if (Page.Request.Params["delaws"] == "1") { //Deleting a domain DeleteDomainRequest deleteDomainAction = new DeleteDomainRequest().WithDomainName("ZigMeRecos"); sdb.DeleteDomain(deleteDomainAction); } // Now read from the AWS domain and populate the dropdown list // First check to see if a domain contain service types exists. if not then create it and populate it // Listing domains /*ListDomainsResponse sdbListDomainsResponse = sdb.ListDomains(new ListDomainsRequest()); if (sdbListDomainsResponse.IsSetListDomainsResult()) { ListDomainsResult listDomainsResult = sdbListDomainsResponse.ListDomainsResult; if (!listDomainsResult.DomainName.Contains("ZigMeServiceTypes")) { } else { String selectExpression = "Select * From ZigMeServiceTypes"; SelectRequest selectRequestAction = new SelectRequest().WithSelectExpression(selectExpression); SelectResponse selectResponse = sdb.Select(selectRequestAction); if (selectResponse.IsSetSelectResult()) { SelectResult selectResult = selectResponse.SelectResult; foreach (Item item in selectResult.Item) { foreach (Amazon.SimpleDB.Model.Attribute attribute in item.Attribute) { if (attribute.IsSetName() && attribute.IsSetValue()) { } } } } } }*/ } }
DeleteDomainResponse AmazonSimpleDB.DeleteDomain(DeleteDomainRequest request) { throw new NotImplementedException(); }
IAsyncResult AmazonSimpleDB.BeginDeleteDomain(DeleteDomainRequest request, AsyncCallback callback, object state) { throw new NotImplementedException(); }
public static void Main(string[] args) { AmazonSimpleDB sdb = AWSClientFactory.CreateAmazonSimpleDBClient(RegionEndpoint.USWest2); try { Console.WriteLine("==========================================="); Console.WriteLine("Getting Started with Amazon SimpleDB"); Console.WriteLine("===========================================\n"); // Creating a domain Console.WriteLine("Creating domain called MyStore.\n"); String domainName = "MyStore"; CreateDomainRequest createDomain = (new CreateDomainRequest()).WithDomainName(domainName); sdb.CreateDomain(createDomain); // Listing domains ListDomainsResponse sdbListDomainsResponse = sdb.ListDomains(new ListDomainsRequest()); if (sdbListDomainsResponse.IsSetListDomainsResult()) { ListDomainsResult listDomainsResult = sdbListDomainsResponse.ListDomainsResult; Console.WriteLine("List of domains:\n"); foreach (String domain in listDomainsResult.DomainName) { Console.WriteLine(" " + domain); } } Console.WriteLine(); // Putting data into a domain Console.WriteLine("Putting data into MyStore domain.\n"); String itemNameOne = "Item_01"; PutAttributesRequest putAttributesActionOne = new PutAttributesRequest().WithDomainName(domainName).WithItemName(itemNameOne); List<ReplaceableAttribute> attributesOne = putAttributesActionOne.Attribute; attributesOne.Add(new ReplaceableAttribute().WithName("Category").WithValue("Clothes")); attributesOne.Add(new ReplaceableAttribute().WithName("Subcategory").WithValue("Sweater")); attributesOne.Add(new ReplaceableAttribute().WithName("Name").WithValue("Cathair Sweater")); attributesOne.Add(new ReplaceableAttribute().WithName("Color").WithValue("Siamese")); attributesOne.Add(new ReplaceableAttribute().WithName("Size").WithValue("Small")); attributesOne.Add(new ReplaceableAttribute().WithName("Size").WithValue("Medium")); attributesOne.Add(new ReplaceableAttribute().WithName("Size").WithValue("Large")); sdb.PutAttributes(putAttributesActionOne); String itemNameTwo = "Item_02"; PutAttributesRequest putAttributesActionTwo = new PutAttributesRequest().WithDomainName(domainName).WithItemName(itemNameTwo); List<ReplaceableAttribute> attributesTwo = putAttributesActionTwo.Attribute; attributesTwo.Add(new ReplaceableAttribute().WithName("Category").WithValue("Clothes")); attributesTwo.Add(new ReplaceableAttribute().WithName("Subcategory").WithValue("Pants")); attributesTwo.Add(new ReplaceableAttribute().WithName("Name").WithValue("Designer Jeans")); attributesTwo.Add(new ReplaceableAttribute().WithName("Color").WithValue("Paisley Acid Wash")); attributesTwo.Add(new ReplaceableAttribute().WithName("Size").WithValue("30x32")); attributesTwo.Add(new ReplaceableAttribute().WithName("Size").WithValue("32x32")); attributesTwo.Add(new ReplaceableAttribute().WithName("Size").WithValue("32x34")); sdb.PutAttributes(putAttributesActionTwo); String itemNameThree = "Item_03"; PutAttributesRequest putAttributesActionThree = new PutAttributesRequest().WithDomainName(domainName).WithItemName(itemNameThree); List<ReplaceableAttribute> attributesThree = putAttributesActionThree.Attribute; attributesThree.Add(new ReplaceableAttribute().WithName("Category").WithValue("Clothes")); attributesThree.Add(new ReplaceableAttribute().WithName("Subcategory").WithValue("Pants")); attributesThree.Add(new ReplaceableAttribute().WithName("Name").WithValue("Sweatpants")); attributesThree.Add(new ReplaceableAttribute().WithName("Color").WithValue("Blue")); attributesThree.Add(new ReplaceableAttribute().WithName("Color").WithValue("Yellow")); attributesThree.Add(new ReplaceableAttribute().WithName("Color").WithValue("Pink")); attributesThree.Add(new ReplaceableAttribute().WithName("Size").WithValue("Large")); attributesThree.Add(new ReplaceableAttribute().WithName("Year").WithValue("2006")); attributesThree.Add(new ReplaceableAttribute().WithName("Year").WithValue("2007")); sdb.PutAttributes(putAttributesActionThree); String itemNameFour = "Item_04"; PutAttributesRequest putAttributesActionFour = new PutAttributesRequest().WithDomainName(domainName).WithItemName(itemNameFour); List<ReplaceableAttribute> attributesFour = putAttributesActionFour.Attribute; attributesFour.Add(new ReplaceableAttribute().WithName("Category").WithValue("Car Parts")); attributesFour.Add(new ReplaceableAttribute().WithName("Subcategory").WithValue("Engine")); attributesFour.Add(new ReplaceableAttribute().WithName("Name").WithValue("Turbos")); attributesFour.Add(new ReplaceableAttribute().WithName("Make").WithValue("Audi")); attributesFour.Add(new ReplaceableAttribute().WithName("Model").WithValue("S4")); attributesFour.Add(new ReplaceableAttribute().WithName("Year").WithValue("2000")); attributesFour.Add(new ReplaceableAttribute().WithName("Year").WithValue("2001")); attributesFour.Add(new ReplaceableAttribute().WithName("Year").WithValue("2002")); sdb.PutAttributes(putAttributesActionFour); String itemNameFive = "Item_05"; PutAttributesRequest putAttributesActionFive = new PutAttributesRequest().WithDomainName(domainName).WithItemName(itemNameFive); List<ReplaceableAttribute> attributesFive = putAttributesActionFive.Attribute; attributesFive.Add(new ReplaceableAttribute().WithName("Category").WithValue("Car Parts")); attributesFive.Add(new ReplaceableAttribute().WithName("Subcategory").WithValue("Emissions")); attributesFive.Add(new ReplaceableAttribute().WithName("Name").WithValue("O2 Sensor")); attributesFive.Add(new ReplaceableAttribute().WithName("Make").WithValue("Audi")); attributesFive.Add(new ReplaceableAttribute().WithName("Model").WithValue("S4")); attributesFive.Add(new ReplaceableAttribute().WithName("Year").WithValue("2000")); attributesFive.Add(new ReplaceableAttribute().WithName("Year").WithValue("2001")); attributesFive.Add(new ReplaceableAttribute().WithName("Year").WithValue("2002")); sdb.PutAttributes(putAttributesActionFive); // Getting data from a domain Console.WriteLine("Print attributes with the attribute Category that contain the value Clothes.\n"); String selectExpression = "Select * From MyStore Where Category = 'Clothes'"; SelectRequest selectRequestAction = new SelectRequest().WithSelectExpression(selectExpression); SelectResponse selectResponse = sdb.Select(selectRequestAction); if (selectResponse.IsSetSelectResult()) { SelectResult selectResult = selectResponse.SelectResult; foreach (Item item in selectResult.Item) { Console.WriteLine(" Item"); if (item.IsSetName()) { Console.WriteLine(" Name: {0}", item.Name); } foreach (Amazon.SimpleDB.Model.Attribute attribute in item.Attribute) { Console.WriteLine(" Attribute"); if (attribute.IsSetName()) { Console.WriteLine(" Name: {0}", attribute.Name); } if (attribute.IsSetValue()) { Console.WriteLine(" Value: {0}", attribute.Value); } } } } Console.WriteLine(); // Deleting values from an attribute Console.WriteLine("Deleting Blue attributes in Item_O3.\n"); Amazon.SimpleDB.Model.Attribute deleteValueAttribute = new Amazon.SimpleDB.Model.Attribute().WithName("Color").WithValue("Blue"); DeleteAttributesRequest deleteValueAction = new DeleteAttributesRequest().WithDomainName("MyStore").WithItemName("Item_03").WithAttribute(deleteValueAttribute); sdb.DeleteAttributes(deleteValueAction); //Deleting an attribute Console.WriteLine("Deleting attribute Year in Item_O3.\n"); Amazon.SimpleDB.Model.Attribute deleteAttribute = new Amazon.SimpleDB.Model.Attribute().WithName("Year"); DeleteAttributesRequest deleteAttributeAction = new DeleteAttributesRequest().WithDomainName("MyStore").WithItemName("Item_03").WithAttribute(deleteAttribute); sdb.DeleteAttributes(deleteAttributeAction); //Replacing an attribute Console.WriteLine("Replace Size of Item_03 with Medium.\n"); ReplaceableAttribute replaceableAttribute = new ReplaceableAttribute().WithName("Size").WithValue("Medium").WithReplace(true); PutAttributesRequest replaceAction = new PutAttributesRequest().WithDomainName("MyStore").WithItemName("Item_03").WithAttribute(replaceableAttribute); sdb.PutAttributes(replaceAction); //Deleting an item Console.WriteLine("Deleting Item_03 item.\n"); DeleteAttributesRequest deleteItemAction = new DeleteAttributesRequest().WithDomainName("MyStore").WithItemName("Item_03"); sdb.DeleteAttributes(deleteAttributeAction); //Deleting a domain Console.WriteLine("Deleting MyStore domain.\n"); DeleteDomainRequest deleteDomainAction = new DeleteDomainRequest().WithDomainName("MyStore"); sdb.DeleteDomain(deleteDomainAction); } catch (AmazonSimpleDBException ex) { Console.WriteLine("Caught Exception: " + ex.Message); Console.WriteLine("Response Status Code: " + ex.StatusCode); Console.WriteLine("Error Code: " + ex.ErrorCode); Console.WriteLine("Error Type: " + ex.ErrorType); Console.WriteLine("Request ID: " + ex.RequestId); Console.WriteLine("XML: " + ex.XML); } Console.WriteLine("Press Enter to continue..."); Console.Read(); }
/// <summary> /// Initiates the asynchronous execution of the DeleteDomain operation. /// <seealso cref="Amazon.SimpleDB.IAmazonSimpleDB"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteDomain 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<DeleteDomainResponse> DeleteDomainAsync(DeleteDomainRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteDomainRequestMarshaller(); var unmarshaller = DeleteDomainResponseUnmarshaller.Instance; return InvokeAsync<DeleteDomainRequest,DeleteDomainResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the DeleteDomain operation. /// <seealso cref="Amazon.SimpleDB.IAmazonSimpleDB"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteDomain operation on AmazonSimpleDBClient.</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 EndDeleteDomain /// operation.</returns> public IAsyncResult BeginDeleteDomain(DeleteDomainRequest request, AsyncCallback callback, object state) { var marshaller = new DeleteDomainRequestMarshaller(); var unmarshaller = DeleteDomainResponseUnmarshaller.Instance; return BeginInvoke<DeleteDomainRequest>(request, marshaller, unmarshaller, callback, state); }
internal DeleteDomainResponse DeleteDomain(DeleteDomainRequest request) { var task = DeleteDomainAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
IAsyncResult invokeDeleteDomain(DeleteDomainRequest deleteDomainRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DeleteDomainRequestMarshaller().Marshall(deleteDomainRequest); var unmarshaller = DeleteDomainResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the DeleteDomain operation. /// <seealso cref="Amazon.SimpleDB.IAmazonSimpleDB.DeleteDomain"/> /// </summary> /// /// <param name="deleteDomainRequest">Container for the necessary parameters to execute the DeleteDomain operation on AmazonSimpleDB.</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> public IAsyncResult BeginDeleteDomain(DeleteDomainRequest deleteDomainRequest, AsyncCallback callback, object state) { return invokeDeleteDomain(deleteDomainRequest, callback, state, false); }
/// <summary> /// <para> The <c>DeleteDomain</c> operation deletes a domain. Any items (and their attributes) in the domain are deleted as well. The /// <c>DeleteDomain</c> operation might take 10 or more seconds to complete. </para> <para><b>NOTE:</b> Running DeleteDomain on a domain that /// does not exist or running the function multiple times using the same domain name will not result in an error response. </para> /// </summary> /// /// <param name="deleteDomainRequest">Container for the necessary parameters to execute the DeleteDomain service method on /// AmazonSimpleDB.</param> /// /// <exception cref="MissingParameterException"/> public DeleteDomainResponse DeleteDomain(DeleteDomainRequest deleteDomainRequest) { IAsyncResult asyncResult = invokeDeleteDomain(deleteDomainRequest, null, null, true); return EndDeleteDomain(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the DeleteDomain operation. /// <seealso cref="Amazon.SimpleDB.IAmazonSimpleDB.DeleteDomain"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteDomain 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<DeleteDomainResponse> DeleteDomainAsync(DeleteDomainRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteDomainRequestMarshaller(); var unmarshaller = DeleteDomainResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DeleteDomainRequest, DeleteDomainResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para> The <c>DeleteDomain</c> operation deletes a domain. Any items (and their attributes) in the domain are deleted as well. The /// <c>DeleteDomain</c> operation might take 10 or more seconds to complete. </para> <para><b>NOTE:</b> Running DeleteDomain on a domain that /// does not exist or running the function multiple times using the same domain name will not result in an error response. </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteDomain service method on /// AmazonSimpleDB.</param> /// /// <exception cref="T:Amazon.SimpleDB.Model.MissingParameterException" /> public DeleteDomainResponse DeleteDomain(DeleteDomainRequest request) { var task = DeleteDomainAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
public void Flush(string storeIdentifier) { var deleteDomainAction = new DeleteDomainRequest().WithDomainName(storeIdentifier); _simpleDb.DeleteDomain(deleteDomainAction); }
public void DeleteDomain(string domainName) { DeleteDomainRequest request = new DeleteDomainRequest {DomainName = domainName}; DeleteDomainResponse response = Service.DeleteDomain(request); }
/// <summary> /// Deletes the simpleDB Domain /// </summary> /// <param name="domainName"></param> public void DeleteDomain(string domainName) { var request = new DeleteDomainRequest { DomainName = domainName }; Client.DeleteDomain(request); }
public void DeleteDomain(string domainName) { var request = new DeleteDomainRequest().WithDomainName(domainName); var response = _service.DeleteDomain(request); }
/// <summary> /// The <code>DeleteDomain</code> operation deletes a domain. Any items (and their attributes) /// in the domain are deleted as well. The <code>DeleteDomain</code> operation might take /// 10 or more seconds to complete. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteDomain service method.</param> /// /// <returns>The response from the DeleteDomain service method, as returned by SimpleDB.</returns> /// <exception cref="MissingParameterException"> /// The request must contain the specified missing parameter. /// </exception> public DeleteDomainResponse DeleteDomain(DeleteDomainRequest request) { var marshaller = new DeleteDomainRequestMarshaller(); var unmarshaller = DeleteDomainResponseUnmarshaller.Instance; return Invoke<DeleteDomainRequest,DeleteDomainResponse>(request, marshaller, unmarshaller); }
/// <summary> /// <para> The <c>DeleteDomain</c> operation deletes a domain. Any items (and their attributes) in the domain are deleted as well. The /// <c>DeleteDomain</c> operation might take 10 or more seconds to complete. </para> <para><b>NOTE:</b> Running DeleteDomain on a domain that /// does not exist or running the function multiple times using the same domain name will not result in an error response. </para> /// </summary> /// /// <param name="deleteDomainRequest">Container for the necessary parameters to execute the DeleteDomain service method on /// AmazonSimpleDB.</param> /// /// <exception cref="T:Amazon.SimpleDB.Model.MissingParameterException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<DeleteDomainResponse> DeleteDomainAsync(DeleteDomainRequest deleteDomainRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteDomainRequestMarshaller(); var unmarshaller = DeleteDomainResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, DeleteDomainRequest, DeleteDomainResponse>(deleteDomainRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
private void DeleteDomainButton_Click(object sender, RoutedEventArgs e) { SimpleDB.Client.OnSimpleDBResponse += DeleteDomainWebResponse; DeleteDomainRequest request = new DeleteDomainRequest() { DomainName = this.DomainName }; this.DomainDeleteMessage = "Please wait..."; SimpleDB.Client.BeginDeleteDomain(request); }