Servers - Delete
Deletes a server.
DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}?api-version=2021-06-01
URI Parameters
Name
In
Required
Type
Description
resourceGroupName
path
True
string
minLength: 1 maxLength: 90
The name of the resource group. The name is case insensitive.
serverName
path
True
string
The name of the server.
subscriptionId
path
True
string
minLength: 1
The ID of the target subscription.
api-version
query
True
string
minLength: 1
The API version to use for this operation.
Responses
Name
Type
Description
200 OK
OK
202 Accepted
Accepted
204 No Content
NoContent
Other Status Codes
CloudError
Error response describing why the operation failed.
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name
Description
user_impersonation
impersonate your user account
Examples
ServerDelete
Sample request
DELETE https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver?api-version=2021-06-01
import com.azure.core.util.Context;
/** Samples for Servers Delete. */
public final class Main {
/*
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-01/examples/ServerDelete.json
*/
/**
* Sample code: ServerDelete.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void serverDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
manager.servers().delete("testrg", "testserver", Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation . To provide feedback on this code sample, open a GitHub issue
package armpostgresqlflexibleservers_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-01/examples/ServerDelete.json
func ExampleServersClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewServersClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginDelete(ctx,
"testrg",
"testserver",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
To use the Azure SDK library in your project, see this documentation . To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Deletes a server.
*
* @summary Deletes a server.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-01/examples/ServerDelete.json
*/
async function serverDelete() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg";
const serverName = "testserver";
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.servers.beginDeleteAndWait(resourceGroupName, serverName);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation . To provide feedback on this code sample, open a GitHub issue
Definitions
CloudError
Object
An error response from the Batch service.
Name
Type
Description
error
ErrorResponse
Error Response
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)
ErrorAdditionalInfo
Object
The resource management error additional info.
Name
Type
Description
info
object
The additional info.
type
string
The additional info type.
ErrorResponse
Object
Error Response
Name
Type
Description
additionalInfo
ErrorAdditionalInfo []
The error additional info.
code
string
The error code.
details
ErrorResponse []
The error details.
message
string
The error message.
target
string
The error target.