Container for the parameters to the DeleteTable operation.

The DeleteTable operation deletes a table and all of its items. After a DeleteTable request, the specified table is in the DELETING state until Amazon DynamoDB completes the deletion. If the table is in the ACTIVE state, you can delete it. If a table is in CREATING or UPDATING states, then Amazon DynamoDB returns a ResourceInUseException . If the specified table does not exist, Amazon DynamoDB returns a ResourceNotFoundException . If table is already in the DELETING state, no error is returned.

NOTE: Amazon DynamoDB might continue to accept data read and write operations, such as GetItem and PutItem, on a table in the DELETING state until the table deletion is complete.

When you delete a table, any local secondary indexes on that table are also deleted.

Use the DescribeTable API to check the status of the table.

상속: AmazonDynamoDBv2Request
예제 #1
0
 public async Task DeleteTable()
 {
     var request = new DynamoDBv2Model.DeleteTableRequest
     {
         TableName = _tableName
     };
     await _dbService.DbClient.DeleteTableAsync(request);
 }
예제 #2
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.DynamoDBv2.Model.DeleteTableRequest();

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

            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>
 /// Initiates the asynchronous execution of the DeleteTable operation.
 /// <seealso cref="Amazon.DynamoDBv2.AmazonDynamoDB.DeleteTable"/>
 /// </summary>
 /// 
 /// <param name="deleteTableRequest">Container for the necessary parameters to execute the DeleteTable operation on AmazonDynamoDBv2.</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 EndDeleteTable
 ///         operation.</returns>
 public IAsyncResult BeginDeleteTable(DeleteTableRequest deleteTableRequest, AsyncCallback callback, object state)
 {
     return invokeDeleteTable(deleteTableRequest, callback, state, false);
 }
 IAsyncResult invokeDeleteTable(DeleteTableRequest deleteTableRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new DeleteTableRequestMarshaller().Marshall(deleteTableRequest);
     var unmarshaller = DeleteTableResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
 /// <summary>
 /// The <i>DeleteTable</i> operation deletes a table and all of its items. After a <i>DeleteTable</i>
 /// request, the specified table is in the <code>DELETING</code> state until DynamoDB
 /// completes the deletion. If the table is in the <code>ACTIVE</code> state, you can
 /// delete it. If a table is in <code>CREATING</code> or <code>UPDATING</code> states,
 /// then DynamoDB returns a <i>ResourceInUseException</i>. If the specified table does
 /// not exist, DynamoDB returns a <i>ResourceNotFoundException</i>. If table is already
 /// in the <code>DELETING</code> state, no error is returned. 
 /// 
 ///  <note> 
 /// <para>
 /// DynamoDB might continue to accept data read and write operations, such as <i>GetItem</i>
 /// and <i>PutItem</i>, on a table in the <code>DELETING</code> state until the table
 /// deletion is complete.
 /// </para>
 ///  </note> 
 /// <para>
 /// When you delete a table, any indexes on that table are also deleted.
 /// </para>
 ///  
 /// <para>
 /// Use the <i>DescribeTable</i> API to check the status of the table. 
 /// </para>
 /// </summary>
 /// <param name="tableName"> The name of the table to delete.</param>
 /// 
 /// <returns>The response from the DeleteTable service method, as returned by DynamoDB.</returns>
 /// <exception cref="Amazon.DynamoDBv2.Model.InternalServerErrorException">
 /// An error occurred on the server side.
 /// </exception>
 /// <exception cref="Amazon.DynamoDBv2.Model.LimitExceededException">
 /// The number of concurrent table requests (cumulative number of tables in the <code>CREATING</code>,
 /// <code>DELETING</code> or <code>UPDATING</code> state) exceeds the maximum allowed
 /// of 10.
 /// 
 ///  
 /// <para>
 /// Also, for tables with secondary indexes, only one of those tables can be in the <code>CREATING</code>
 /// state at any point in time. Do not attempt to create more than one such table simultaneously.
 /// </para>
 ///  
 /// <para>
 /// The total limit of tables in the <code>ACTIVE</code> state is 250.
 /// </para>
 /// </exception>
 /// <exception cref="Amazon.DynamoDBv2.Model.ResourceInUseException">
 /// The operation conflicts with the resource's availability. For example, you attempted
 /// to recreate an existing table, or tried to delete a table currently in the <code>CREATING</code>
 /// state.
 /// </exception>
 /// <exception cref="Amazon.DynamoDBv2.Model.ResourceNotFoundException">
 /// The operation tried to access a nonexistent table or index. The resource might not
 /// be specified correctly, or its status might not be <code>ACTIVE</code>.
 /// </exception>
 public DeleteTableResponse DeleteTable(string tableName)
 {
     var request = new DeleteTableRequest();
     request.TableName = tableName;
     return DeleteTable(request);
 }
 internal static Task<DeleteTableResponse> DeleteTableAsync(this Amazon.DynamoDBv2.AmazonDynamoDB client, DeleteTableRequest request)
 {
     return Task.Factory.FromAsync(client.BeginDeleteTable, (Func<IAsyncResult, DeleteTableResponse>)client.EndDeleteTable, request, null);
 }
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteTable operation.
        /// <seealso cref="Amazon.DynamoDBv2.IAmazonDynamoDB"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DeleteTable 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<DeleteTableResponse> DeleteTableAsync(DeleteTableRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DeleteTableRequestMarshaller();
            var unmarshaller = DeleteTableResponseUnmarshaller.Instance;

            return InvokeAsync<DeleteTableRequest,DeleteTableResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
예제 #8
0
		internal DeleteTableResponse DeleteTable(DeleteTableRequest request)
        {
            var task = DeleteTableAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteTable operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DeleteTable operation on AmazonDynamoDBClient.</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 EndDeleteTable
        ///         operation.</returns>
        public IAsyncResult BeginDeleteTable(DeleteTableRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new DeleteTableRequestMarshaller();
            var unmarshaller = DeleteTableResponseUnmarshaller.Instance;

            return BeginInvoke<DeleteTableRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
예제 #10
0
        public void DataPlaneSamples()
        {
            {
                #region CreateTable Sample

                // Create a client
                AmazonDynamoDBClient client = new AmazonDynamoDBClient();

                // Define table schema:
                //  Table has a hash-key "Author" and a range-key "Title"
                List<KeySchemaElement> schema = new List<KeySchemaElement>
                {
                    new KeySchemaElement
                    {
                        AttributeName = "Author", KeyType = "HASH"
                    },
                    new KeySchemaElement
                    {
                        AttributeName = "Title", KeyType = "RANGE"
                    }
                };

                // Define key attributes:
                //  The key attributes "Author" and "Title" are string types
                List<AttributeDefinition> definitions = new List<AttributeDefinition>
                {
                    new AttributeDefinition
                    {
                        AttributeName = "Author", AttributeType = "S"
                    },
                    new AttributeDefinition
                    {
                        AttributeName = "Title", AttributeType = "S"
                    }
                };

                // Define table throughput:
                //  Table has capacity of 20 reads and 50 writes
                ProvisionedThroughput throughput = new ProvisionedThroughput
                {
                    ReadCapacityUnits = 20,
                    WriteCapacityUnits = 50
                };

                // Configure the CreateTable request
                CreateTableRequest request = new CreateTableRequest
                {
                    TableName = "SampleTable",
                    KeySchema = schema,
                    ProvisionedThroughput = throughput,
                    AttributeDefinitions = definitions
                };

                // View new table properties
                TableDescription tableDescription = client.CreateTable(request).TableDescription;
                Console.WriteLine("Table name: {0}", tableDescription.TableName);
                Console.WriteLine("Creation time: {0}", tableDescription.CreationDateTime);
                Console.WriteLine("Item count: {0}", tableDescription.ItemCount);
                Console.WriteLine("Table size (bytes): {0}", tableDescription.TableSizeBytes);
                Console.WriteLine("Table status: {0}", tableDescription.TableStatus);

                // List table key schema
                List<KeySchemaElement> tableSchema = tableDescription.KeySchema;
                for (int i = 0; i < tableSchema.Count; i++)
                {
                    KeySchemaElement element = tableSchema[i];
                    Console.WriteLine("Key: Name = {0}, KeyType = {1}",
                        element.AttributeName, element.KeyType);
                }

                // List attribute definitions
                List<AttributeDefinition> attributeDefinitions = tableDescription.AttributeDefinitions;
                for (int i = 0; i < attributeDefinitions.Count; i++)
                {
                    AttributeDefinition definition = attributeDefinitions[i];
                    Console.WriteLine("Attribute: Name = {0}, Type = {1}",
                        definition.AttributeName, definition.AttributeType);
                }

                Console.WriteLine("Throughput: Reads = {0}, Writes = {1}",
                    tableDescription.ProvisionedThroughput.ReadCapacityUnits,
                    tableDescription.ProvisionedThroughput.WriteCapacityUnits);

                #endregion
            }

            {
                #region DescribeTable Sample

                // Create a client
                AmazonDynamoDBClient client = new AmazonDynamoDBClient();

                // Create DescribeTable request
                DescribeTableRequest request = new DescribeTableRequest
                {
                    TableName = "SampleTable"
                };

                // Issue DescribeTable request and retrieve the table description
                TableDescription tableDescription = client.DescribeTable(request).Table;

                // View new table properties
                Console.WriteLine("Table name: {0}", tableDescription.TableName);
                Console.WriteLine("Creation time: {0}", tableDescription.CreationDateTime);
                Console.WriteLine("Item count: {0}", tableDescription.ItemCount);
                Console.WriteLine("Table size (bytes): {0}", tableDescription.TableSizeBytes);
                Console.WriteLine("Table status: {0}", tableDescription.TableStatus);
                // List table key schema
                List<KeySchemaElement> tableSchema = tableDescription.KeySchema;
                for (int i = 0; i < tableSchema.Count; i++)
                {
                    KeySchemaElement element = tableSchema[i];
                    Console.WriteLine("Key: Name = {0}, KeyType = {1}",
                        element.AttributeName, element.KeyType);
                }

                // List attribute definitions
                List<AttributeDefinition> attributeDefinitions = tableDescription.AttributeDefinitions;
                for (int i = 0; i < attributeDefinitions.Count; i++)
                {
                    AttributeDefinition definition = attributeDefinitions[i];
                    Console.WriteLine("Attribute: Name = {0}, Type = {1}",
                        definition.AttributeName, definition.AttributeType);
                }
                Console.WriteLine("Throughput: Reads = {0}, Writes = {1}",
                    tableDescription.ProvisionedThroughput.ReadCapacityUnits,
                    tableDescription.ProvisionedThroughput.WriteCapacityUnits);

                #endregion
            }

            {
                #region ListTables Paging Sample

                // Create a client
                AmazonDynamoDBClient client = new AmazonDynamoDBClient();

                string startTableName = null;
                do
                {
                    // Configure ListTables request with the marker value
                    ListTablesRequest request = new ListTablesRequest
                    {
                        ExclusiveStartTableName = startTableName,
                    };

                    // Issue call
                    ListTablesResult result = client.ListTables(request);

                    // List retrieved tables
                    List<string> tables = result.TableNames;
                    Console.WriteLine("Retrieved tables: {0}",
                        string.Join(", ", tables));

                    // Update marker value from the result
                    startTableName = result.LastEvaluatedTableName;

                } while (!string.IsNullOrEmpty(startTableName)); // Test marker value

                #endregion
            }

            {
                #region ListTables NonPaging Sample

                // Create a client
                AmazonDynamoDBClient client = new AmazonDynamoDBClient();

                // Issue call
                ListTablesResult result = client.ListTables();

                // List retrieved tables
                List<string> tables = result.TableNames;
                Console.WriteLine("Retrieved tables: {0}",
                    string.Join(", ", tables));

                #endregion
            }

            TableUtils.WaitUntilTableActive("SampleTable", TestClient);

            {
                #region UpdateTable Sample

                // Create a client
                AmazonDynamoDBClient client = new AmazonDynamoDBClient();

                // Define new table throughput:
                //  Table will now have capacity of 40 reads and 50 writes
                ProvisionedThroughput throughput = new ProvisionedThroughput
                {
                    ReadCapacityUnits = 40,
                    WriteCapacityUnits = 50
                };

                // Compose the UpdateTable request
                UpdateTableRequest request = new UpdateTableRequest
                {
                    TableName = "SampleTable",
                    ProvisionedThroughput = throughput
                };

                // View new table properties
                TableDescription tableDescription = client.UpdateTable(request).TableDescription;
                Console.WriteLine("Table name: {0}", tableDescription.TableName);
                Console.WriteLine("Throughput: Reads = {0}, Writes = {1}",
                    tableDescription.ProvisionedThroughput.ReadCapacityUnits,
                    tableDescription.ProvisionedThroughput.WriteCapacityUnits);

                #endregion
            }

            TableUtils.WaitUntilTableActive("SampleTable", TestClient);

            {
                #region DeleteTable Sample

                // Create a client
                AmazonDynamoDBClient client = new AmazonDynamoDBClient();

                // Configure the DeleteTable request
                DeleteTableRequest request = new DeleteTableRequest
                {
                    TableName = "SampleTable"
                };

                // Issue DeleteTable request and retrieve the table description
                TableDescription tableDescription = client.DeleteTable(request).TableDescription;
                Console.WriteLine("Table name: {0}", tableDescription.TableName);
                Console.WriteLine("Table status: {0}", tableDescription.TableStatus);

                #endregion
            }

        }
예제 #11
0
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteTable operation.
        /// <seealso cref="Amazon.DynamoDBv2.IAmazonDynamoDB.DeleteTable"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DeleteTable 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 async Task<DeleteTableResponse> DeleteTableAsync(DeleteTableRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DeleteTableRequestMarshaller();
            var unmarshaller = DeleteTableResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, DeleteTableRequest, DeleteTableResponse>(request, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
 /// <summary>
 /// Initiates the asynchronous execution of the DeleteTable operation.
 /// </summary>
 /// 
 /// <param name="request">Container for the necessary parameters to execute the DeleteTable operation on AmazonDynamoDBClient.</param>
 /// <param name="callback">An Action delegate that is invoked when the operation completes.</param>
 /// <param name="options">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 void DeleteTableAsync(DeleteTableRequest request, AmazonServiceCallback<DeleteTableRequest, DeleteTableResponse> callback, AsyncOptions options = null)
 {
     options = options == null?new AsyncOptions():options;
     var marshaller = new DeleteTableRequestMarshaller();
     var unmarshaller = DeleteTableResponseUnmarshaller.Instance;
     Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
     if(callback !=null )
         callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { 
             AmazonServiceResult<DeleteTableRequest,DeleteTableResponse> responseObject 
                     = new AmazonServiceResult<DeleteTableRequest,DeleteTableResponse>((DeleteTableRequest)req, (DeleteTableResponse)res, ex , ao.State);    
                 callback(responseObject); 
         };
     BeginInvoke<DeleteTableRequest>(request, marshaller, unmarshaller, options, callbackHelper);
 }
 /// <summary>
 /// The <i>DeleteTable</i> operation deletes a table and all of its items. After a <i>DeleteTable</i>
 /// request, the specified table is in the <code>DELETING</code> state until DynamoDB
 /// completes the deletion. If the table is in the <code>ACTIVE</code> state, you can
 /// delete it. If a table is in <code>CREATING</code> or <code>UPDATING</code> states,
 /// then DynamoDB returns a <i>ResourceInUseException</i>. If the specified table does
 /// not exist, DynamoDB returns a <i>ResourceNotFoundException</i>. If table is already
 /// in the <code>DELETING</code> state, no error is returned. 
 /// 
 ///  <note> 
 /// <para>
 /// DynamoDB might continue to accept data read and write operations, such as <i>GetItem</i>
 /// and <i>PutItem</i>, on a table in the <code>DELETING</code> state until the table
 /// deletion is complete.
 /// </para>
 ///  </note> 
 /// <para>
 /// When you delete a table, any indexes on that table are also deleted.
 /// </para>
 ///  
 /// <para>
 /// Use the <i>DescribeTable</i> API to check the status of the table. 
 /// </para>
 /// </summary>
 /// <param name="tableName"> The name of the table to delete.</param>
 /// 
 /// <returns>The response from the DeleteTable service method, as returned by DynamoDB.</returns>
 /// <exception cref="Amazon.DynamoDBv2.Model.InternalServerErrorException">
 /// An error occurred on the server side.
 /// </exception>
 /// <exception cref="Amazon.DynamoDBv2.Model.LimitExceededException">
 /// The number of concurrent table requests (cumulative number of tables in the <code>CREATING</code>,
 /// <code>DELETING</code> or <code>UPDATING</code> state) exceeds the maximum allowed
 /// of 10.
 /// 
 ///  
 /// <para>
 /// Also, for tables with secondary indexes, only one of those tables can be in the <code>CREATING</code>
 /// state at any point in time. Do not attempt to create more than one such table simultaneously.
 /// </para>
 ///  
 /// <para>
 /// The total limit of tables in the <code>ACTIVE</code> state is 250.
 /// </para>
 /// </exception>
 /// <exception cref="Amazon.DynamoDBv2.Model.ResourceInUseException">
 /// The operation conflicts with the resource's availability. For example, you attempted
 /// to recreate an existing table, or tried to delete a table currently in the <code>CREATING</code>
 /// state.
 /// </exception>
 /// <exception cref="Amazon.DynamoDBv2.Model.ResourceNotFoundException">
 /// The operation tried to access a nonexistent table or index. The resource might not
 /// be specified correctly, or its status might not be <code>ACTIVE</code>.
 /// </exception>
 public void DeleteTableAsync(string tableName, AmazonServiceCallback<DeleteTableRequest, DeleteTableResponse> callback, AsyncOptions options = null)
 {
     var request = new DeleteTableRequest();
     request.TableName = tableName;
     DeleteTableAsync(request, callback, options);
 }
예제 #14
0
        public virtual void DeleteTable(AmazonDynamoDBClient ddbClient, string tableName)
        {
            switch (GetTableStatus(ddbClient, tableName))
            {
                case "ACTIVE":
                    _Default.LogMessageToPage("Deleting pre-existing table.");
                    var deleteTableRequest = new DeleteTableRequest { TableName = tableName };
                    ddbClient.DeleteTable(deleteTableRequest);
                    WaitForStatus(ddbClient, tableName, "NOTFOUND");

                    _Default.LogMessageToPage("Table deletion confirmed.");
                    break;
                case "NOTFOUND":
                    _Default.LogMessageToPage("Skipped deletion operation. Table not found.");
                    break;
                default:
                    _Default.LogMessageToPage("Skipped deletion operation. Table not in correct state.");
                    break;
            }
        }
 /// <summary>
 /// <para>The <i>DeleteTable</i> operation deletes a table and all of its items. After a <i>DeleteTable</i> request, the specified table is in
 /// the <c>DELETING</c> state until Amazon DynamoDB completes the deletion. If the table is in the <c>ACTIVE</c> state, you can delete it. If a
 /// table is in <c>CREATING</c> or <c>UPDATING</c> states, then Amazon DynamoDB returns a
 /// <i>ResourceInUseException</i> . If the specified table does not exist, Amazon DynamoDB returns a
 /// <i>ResourceNotFoundException</i> . If table is already in the <c>DELETING</c> state, no error is returned. </para> <para><b>NOTE:</b> Amazon
 /// DynamoDB might continue to accept data read and write operations, such as GetItem and PutItem, on a table in the DELETING state until the
 /// table deletion is complete. </para> <para>Tables are unique among those associated with the AWS Account issuing the request, and the AWS
 /// region that receives the request (such as dynamodb.us-east-1.amazonaws.com). Each Amazon DynamoDB endpoint is entirely independent. For
 /// example, if you have two tables called "MyTable," one in dynamodb.us-east-1.amazonaws.com and one in dynamodb.us-west-1.amazonaws.com, they
 /// are completely independent and do not share any data; deleting one does not delete the other.</para> <para>When you delete a table, any
 /// local secondary indexes on that table are also deleted.</para> <para>Use the <i>DescribeTable</i> API to check the status of the table.
 /// </para>
 /// </summary>
 /// 
 /// <param name="deleteTableRequest">Container for the necessary parameters to execute the DeleteTable service method on
 ///          AmazonDynamoDBv2.</param>
 /// 
 /// <returns>The response from the DeleteTable service method, as returned by AmazonDynamoDBv2.</returns>
 /// 
 /// <exception cref="ResourceInUseException"/>
 /// <exception cref="ResourceNotFoundException"/>
 /// <exception cref="LimitExceededException"/>
 /// <exception cref="InternalServerErrorException"/>
 public DeleteTableResponse DeleteTable(DeleteTableRequest deleteTableRequest)
 {
     IAsyncResult asyncResult = invokeDeleteTable(deleteTableRequest, null, null, true);
     return EndDeleteTable(asyncResult);
 }
예제 #16
0
 /// <summary>
 /// The <i>DeleteTable</i> operation deletes a table and all of its items. After a <i>DeleteTable</i>
 /// request, the specified table is in the <code>DELETING</code> state until DynamoDB
 /// completes the deletion. If the table is in the <code>ACTIVE</code> state, you can
 /// delete it. If a table is in <code>CREATING</code> or <code>UPDATING</code> states,
 /// then DynamoDB returns a <i>ResourceInUseException</i>. If the specified table does
 /// not exist, DynamoDB returns a <i>ResourceNotFoundException</i>. If table is already
 /// in the <code>DELETING</code> state, no error is returned. 
 /// 
 ///  <note> 
 /// <para>
 /// DynamoDB might continue to accept data read and write operations, such as <i>GetItem</i>
 /// and <i>PutItem</i>, on a table in the <code>DELETING</code> state until the table
 /// deletion is complete.
 /// </para>
 ///  </note> 
 /// <para>
 /// When you delete a table, any indexes on that table are also deleted.
 /// </para>
 ///  
 /// <para>
 /// If you have DynamoDB Streams enabled on the table, then the corresponding stream on
 /// that table goes into the <code>DISABLED</code> state, and the stream is automatically
 /// deleted after 24 hours.
 /// </para>
 ///  
 /// <para>
 /// Use the <i>DescribeTable</i> API to check the status of the table. 
 /// </para>
 /// </summary>
 /// <param name="tableName"> The name of the table to delete.</param>
 /// <param name="cancellationToken">
 ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
 /// </param>
 /// 
 /// <returns>The response from the DeleteTable service method, as returned by DynamoDB.</returns>
 /// <exception cref="Amazon.DynamoDBv2.Model.InternalServerErrorException">
 /// An error occurred on the server side.
 /// </exception>
 /// <exception cref="Amazon.DynamoDBv2.Model.LimitExceededException">
 /// The number of concurrent table requests (cumulative number of tables in the <code>CREATING</code>,
 /// <code>DELETING</code> or <code>UPDATING</code> state) exceeds the maximum allowed
 /// of 10.
 /// 
 ///  
 /// <para>
 /// Also, for tables with secondary indexes, only one of those tables can be in the <code>CREATING</code>
 /// state at any point in time. Do not attempt to create more than one such table simultaneously.
 /// </para>
 ///  
 /// <para>
 /// The total limit of tables in the <code>ACTIVE</code> state is 250.
 /// </para>
 /// </exception>
 /// <exception cref="Amazon.DynamoDBv2.Model.ResourceInUseException">
 /// The operation conflicts with the resource's availability. For example, you attempted
 /// to recreate an existing table, or tried to delete a table currently in the <code>CREATING</code>
 /// state.
 /// </exception>
 /// <exception cref="Amazon.DynamoDBv2.Model.ResourceNotFoundException">
 /// The operation tried to access a nonexistent table or index. The resource might not
 /// be specified correctly, or its status might not be <code>ACTIVE</code>.
 /// </exception>
 public Task<DeleteTableResponse> DeleteTableAsync(string tableName, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new DeleteTableRequest();
     request.TableName = tableName;
     return DeleteTableAsync(request, cancellationToken);
 }
        internal DeleteTableResponse DeleteTable(DeleteTableRequest request)
        {
            var marshaller = new DeleteTableRequestMarshaller();
            var unmarshaller = DeleteTableResponseUnmarshaller.Instance;

            return Invoke<DeleteTableRequest,DeleteTableResponse>(request, marshaller, unmarshaller);
        }
		internal DeleteTableResponse DeleteTable(DeleteTableRequest request)
        {
            var task = DeleteTableAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
예제 #19
0
        void DeleteTableListener()
        {
            resultText.text = ("\n*** Deleting table ***\n");
            var request = new DeleteTableRequest
            {
                TableName = @"ProductCatalog"
            };
            Client.DeleteTableAsync(request, (result) =>
            {
                if (result.Exception != null)
                {
                    resultText.text += result.Exception.Message;
                    return;
                }
                var response = result.Response;

                resultText.text += ("Table " + response.TableDescription.TableName + " is being deleted...!");
            });
        }
        /// <summary>
        /// <para>The <i>DeleteTable</i> operation deletes a table and all of its items. After a <i>DeleteTable</i> request, the specified table is in
        /// the <c>DELETING</c> state until DynamoDB completes the deletion. If the table is in the <c>ACTIVE</c> state, you can delete it. If a table
        /// is in <c>CREATING</c> or <c>UPDATING</c> states, then DynamoDB returns a
        /// <i>ResourceInUseException</i> . If the specified table does not exist, DynamoDB returns a
        /// <i>ResourceNotFoundException</i> . If table is already in the <c>DELETING</c> state, no error is returned. </para> <para><b>NOTE:</b>
        /// DynamoDB might continue to accept data read and write operations, such as GetItem and PutItem, on a table in the DELETING state until the
        /// table deletion is complete. </para> <para>When you delete a table, any indexes on that table are also deleted.</para> <para>Use the
        /// <i>DescribeTable</i> API to check the status of the table. </para>
        /// </summary>
        /// 
        /// <param name="deleteTableRequest">Container for the necessary parameters to execute the DeleteTable service method on
        /// AmazonDynamoDBv2.</param>
        /// 
        /// <returns>The response from the DeleteTable service method, as returned by AmazonDynamoDBv2.</returns>
        /// 
        /// <exception cref="T:Amazon.DynamoDBv2.Model.ResourceInUseException" />
        /// <exception cref="T:Amazon.DynamoDBv2.Model.ResourceNotFoundException" />
        /// <exception cref="T:Amazon.DynamoDBv2.Model.LimitExceededException" />
        /// <exception cref="T:Amazon.DynamoDBv2.Model.InternalServerErrorException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<DeleteTableResponse> DeleteTableAsync(DeleteTableRequest deleteTableRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DeleteTableRequestMarshaller();
            var unmarshaller = DeleteTableResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, DeleteTableRequest, DeleteTableResponse>(deleteTableRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
예제 #21
0
 private Amazon.DynamoDBv2.Model.DeleteTableResponse CallAWSServiceOperation(IAmazonDynamoDB client, Amazon.DynamoDBv2.Model.DeleteTableRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon DynamoDB", "DeleteTable");
     try
     {
         #if DESKTOP
         return(client.DeleteTable(request));
         #elif CORECLR
         return(client.DeleteTableAsync(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;
     }
 }
예제 #22
0
 public void Cleanup()
 {
     try
     {
         var request = new DeleteTableRequest { TableName = _tableName };
         var response = _client.DeleteTable(request);
     }
     catch { }
 }