Search in sources :

Example 1 with CosmosDatabaseRequestOptions

use of com.azure.cosmos.models.CosmosDatabaseRequestOptions in project azure-cosmos-java-sql-api-samples by Azure-Samples.

the class AnalyticalContainerCRUDQuickstart method deleteADatabase.

// Database delete
private void deleteADatabase() throws Exception {
    logger.info("Last step: delete database " + databaseName + " by ID.");
    // Delete database
    CosmosDatabaseResponse dbResp = client.getDatabase(databaseName).delete(new CosmosDatabaseRequestOptions());
    logger.info("Status code for database delete: {}", dbResp.getStatusCode());
    logger.info("Done.");
}
Also used : CosmosDatabaseRequestOptions(com.azure.cosmos.models.CosmosDatabaseRequestOptions) CosmosDatabaseResponse(com.azure.cosmos.models.CosmosDatabaseResponse)

Example 2 with CosmosDatabaseRequestOptions

use of com.azure.cosmos.models.CosmosDatabaseRequestOptions in project azure-cosmos-java-sql-api-samples by Azure-Samples.

the class DocumentCRUDQuickstart method deleteADatabase.

// Database delete
private void deleteADatabase() throws Exception {
    logger.info("Last step: delete database " + databaseName + " by ID.");
    // Delete database
    CosmosDatabaseResponse dbResp = client.getDatabase(databaseName).delete(new CosmosDatabaseRequestOptions());
    logger.info("Status code for database delete: {}", dbResp.getStatusCode());
    logger.info("Done.");
}
Also used : CosmosDatabaseRequestOptions(com.azure.cosmos.models.CosmosDatabaseRequestOptions) CosmosDatabaseResponse(com.azure.cosmos.models.CosmosDatabaseResponse)

Example 3 with CosmosDatabaseRequestOptions

use of com.azure.cosmos.models.CosmosDatabaseRequestOptions in project azure-cosmos-java-sql-api-samples by Azure-Samples.

the class DatabaseCRUDQuickstart method deleteADatabase.

// Database delete
private void deleteADatabase() throws Exception {
    logger.info("Last step: delete database " + databaseName + " by ID.");
    // Delete database
    CosmosDatabaseResponse dbResp = client.getDatabase(databaseName).delete(new CosmosDatabaseRequestOptions());
    logger.info("Status code for database delete: {}", dbResp.getStatusCode());
    logger.info("Done.");
}
Also used : CosmosDatabaseRequestOptions(com.azure.cosmos.models.CosmosDatabaseRequestOptions) CosmosDatabaseResponse(com.azure.cosmos.models.CosmosDatabaseResponse)

Example 4 with CosmosDatabaseRequestOptions

use of com.azure.cosmos.models.CosmosDatabaseRequestOptions in project azure-cosmos-java-sql-api-samples by Azure-Samples.

the class CosmosDiagnosticsQuickStartAsync method deleteDatabase.

// Database delete
private void deleteDatabase() throws Exception {
    logger.info("Last step: delete database {} by ID", databaseName);
    // Delete database
    CosmosDatabaseResponse dbResp = client.getDatabase(databaseName).delete(new CosmosDatabaseRequestOptions()).block();
    logger.info("Status code for database delete: {}", dbResp.getStatusCode());
    logger.info("Done.");
}
Also used : CosmosDatabaseRequestOptions(com.azure.cosmos.models.CosmosDatabaseRequestOptions) CosmosDatabaseResponse(com.azure.cosmos.models.CosmosDatabaseResponse)

Example 5 with CosmosDatabaseRequestOptions

use of com.azure.cosmos.models.CosmosDatabaseRequestOptions in project azure-cosmos-java-sql-api-samples by Azure-Samples.

the class CosmosDiagnosticsQuickStart method deleteDatabase.

// Database delete
private void deleteDatabase() throws Exception {
    logger.info("Last step: delete database {} by ID", databaseName);
    // Delete database
    CosmosDatabaseResponse dbResp = client.getDatabase(databaseName).delete(new CosmosDatabaseRequestOptions());
    logger.info("Status code for database delete: {}", dbResp.getStatusCode());
    logger.info("Done.");
}
Also used : CosmosDatabaseRequestOptions(com.azure.cosmos.models.CosmosDatabaseRequestOptions) CosmosDatabaseResponse(com.azure.cosmos.models.CosmosDatabaseResponse)

Aggregations

CosmosDatabaseRequestOptions (com.azure.cosmos.models.CosmosDatabaseRequestOptions)8 CosmosDatabaseResponse (com.azure.cosmos.models.CosmosDatabaseResponse)8