Elencare tutte le regole del firewall in un determinato server.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/firewallRules?api-version=2018-06-01
Parametri dell'URI
Nome
In
Necessario
Tipo
Descrizione
resourceGroupName
path
True
string
Nome del gruppo di risorse. Per il nome non viene fatta distinzione tra maiuscole e minuscole.
GET https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMariaDB/servers/testserver/firewallRules?api-version=2018-06-01
/**
* Samples for FirewallRules ListByServer.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/FirewallRuleListByServer
* .json
*/
/**
* Sample code: FirewallRuleList.
*
* @param manager Entry point to MariaDBManager.
*/
public static void firewallRuleList(com.azure.resourcemanager.mariadb.MariaDBManager manager) {
manager.firewallRules().listByServer("TestGroup", "testserver", com.azure.core.util.Context.NONE);
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.rdbms.mariadb import MariaDBManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-rdbms
# USAGE
python firewall_rule_list_by_server.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = MariaDBManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.firewall_rules.list_by_server(
resource_group_name="TestGroup",
server_name="testserver",
)
for item in response:
print(item)
# x-ms-original-file: specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/FirewallRuleListByServer.json
if __name__ == "__main__":
main()
const { MariaDBManagementClient } = require("@azure/arm-mariadb");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to List all the firewall rules in a given server.
*
* @summary List all the firewall rules in a given server.
* x-ms-original-file: specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/FirewallRuleListByServer.json
*/
async function firewallRuleList() {
const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = "TestGroup";
const serverName = "testserver";
const credential = new DefaultAzureCredential();
const client = new MariaDBManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.firewallRules.listByServer(resourceGroupName, serverName)) {
resArray.push(item);
}
console.log(resArray);
}
firewallRuleList().catch(console.error);
Risposta di errore
Risposta di errore comune per tutte le API Resource Manager di Azure per restituire i dettagli dell'errore per le operazioni non riuscite. Segue anche il formato di risposta di errore OData.
ErrorAdditionalInfo
Informazioni aggiuntive sull'errore di gestione delle risorse.
ID di risorsa completo per la risorsa. Ad esempio - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
name
string
nome della risorsa.
properties.endIpAddress
string
Indirizzo IP finale della regola del firewall del server. Deve essere un formato IPv4.
properties.startIpAddress
string
Indirizzo IP iniziale della regola del firewall del server. Deve essere un formato IPv4.
type
string
Tipo di risorsa. Ad esempio, "Microsoft.Compute/virtualMachines" o "Microsoft.Storage/storageAccounts"