Firewall Rules - Delete
删除 PostgreSQL 服务器防火墙规则。
DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}?api-version=2021-06-01
URI 参数
| 名称 |
在 |
必需 |
类型 |
说明 |
|
firewallRuleName
|
path |
True
|
string
|
服务器防火墙规则的名称。
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
资源组的名称。 此名称不区分大小写。
|
|
serverName
|
path |
True
|
string
|
服务器的名称。
|
|
subscriptionId
|
path |
True
|
string
minLength: 1
|
目标订阅的 ID。
|
|
api-version
|
query |
True
|
string
minLength: 1
|
用于此操作的 API 版本。
|
响应
| 名称 |
类型 |
说明 |
|
200 OK
|
|
好的
|
|
202 Accepted
|
|
已接受
|
|
204 No Content
|
|
无内容
|
|
Other Status Codes
|
CloudError
|
描述作失败的原因的错误响应。
|
安全性
azure_auth
Azure Active Directory OAuth2 流
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 |
说明 |
|
user_impersonation
|
模拟用户帐户
|
示例
FirewallRuleDelete
示例请求
DELETE https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/firewallRules/rule1?api-version=2021-06-01
import com.azure.core.util.Context;
/** Samples for FirewallRules Delete. */
public final class Main {
/*
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-01/examples/FirewallRuleDelete.json
*/
/**
* Sample code: FirewallRuleDelete.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void firewallRuleDelete(
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
manager.firewallRules().delete("testrg", "testserver", "rule1", 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/FirewallRuleDelete.json
func ExampleFirewallRulesClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewFirewallRulesClient("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",
"rule1",
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 PostgreSQL server firewall rule.
*
* @summary Deletes a PostgreSQL server firewall rule.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-01/examples/FirewallRuleDelete.json
*/
async function firewallRuleDelete() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg";
const serverName = "testserver";
const firewallRuleName = "rule1";
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.firewallRules.beginDeleteAndWait(
resourceGroupName,
serverName,
firewallRuleName
);
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
定义
CloudError
Object
Batch 服务的错误响应。
| 名称 |
类型 |
说明 |
|
error
|
ErrorResponse
|
错误响应
所有 Azure 资源管理器 API 的常见错误响应,以返回失败作的错误详细信息。 (这也遵循 OData 错误响应格式。)
|
ErrorAdditionalInfo
Object
资源管理错误附加信息。
| 名称 |
类型 |
说明 |
|
info
|
object
|
其他信息。
|
|
type
|
string
|
其他信息类型。
|
ErrorResponse
Object
错误响应