取得彈性集區。
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}?api-version=2025-01-01
URI 參數
| 名稱 |
位於 |
必要 |
類型 |
Description |
|
elasticPoolName
|
path |
True
|
string
|
彈性集區的名稱。
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
資源群組的名稱。 名稱不區分大小寫。
|
|
serverName
|
path |
True
|
string
|
伺服器的名稱。
|
|
subscriptionId
|
path |
True
|
string
(uuid)
|
目標訂用帳戶的標識碼。 此值必須是 UUID。
|
|
api-version
|
query |
True
|
string
minLength: 1
|
用於此作業的 API 版本。
|
回應
安全性
azure_auth
Azure Active Directory OAuth2 Flow.
類型:
oauth2
Flow:
implicit
授權 URL:
https://login.microsoftonline.com/common/oauth2/authorize
範圍
| 名稱 |
Description |
|
user_impersonation
|
模擬您的用戶帳戶
|
範例
Get a Hyperscale elastic pool
範例要求
GET https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102?api-version=2025-01-01
/**
* Samples for ElasticPools Get.
*/
public final class Main {
/*
* x-ms-original-file: 2025-01-01/HyperscaleElasticPoolGet.json
*/
/**
* Sample code: Get a Hyperscale elastic pool.
*
* @param manager Entry point to SqlServerManager.
*/
public static void getAHyperscaleElasticPool(com.azure.resourcemanager.sql.SqlServerManager manager) {
manager.serviceClient().getElasticPools().getWithResponse("sqlcrudtest-2369", "sqlcrudtest-8069",
"sqlcrudtest-8102", com.azure.core.util.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
from azure.identity import DefaultAzureCredential
from azure.mgmt.sql import SqlManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-sql
# USAGE
python hyperscale_elastic_pool_get.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 = SqlManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.elastic_pools.get(
resource_group_name="sqlcrudtest-2369",
server_name="sqlcrudtest-8069",
elastic_pool_name="sqlcrudtest-8102",
)
print(response)
# x-ms-original-file: 2025-01-01/HyperscaleElasticPoolGet.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SqlManagementClient } = require("@azure/arm-sql");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to gets an elastic pool.
*
* @summary gets an elastic pool.
* x-ms-original-file: 2025-01-01/HyperscaleElasticPoolGet.json
*/
async function getAHyperscaleElasticPool() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new SqlManagementClient(credential, subscriptionId);
const result = await client.elasticPools.get(
"sqlcrudtest-2369",
"sqlcrudtest-8069",
"sqlcrudtest-8102",
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Sql.Models;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/HyperscaleElasticPoolGet.json
// this example is just showing the usage of "ElasticPools_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SqlServerResource created on azure
// for more information of creating SqlServerResource, please refer to the document of SqlServerResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "sqlcrudtest-2369";
string serverName = "sqlcrudtest-8069";
ResourceIdentifier sqlServerResourceId = SqlServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName);
SqlServerResource sqlServer = client.GetSqlServerResource(sqlServerResourceId);
// get the collection of this ElasticPoolResource
ElasticPoolCollection collection = sqlServer.GetElasticPools();
// invoke the operation
string elasticPoolName = "sqlcrudtest-8102";
NullableResponse<ElasticPoolResource> response = await collection.GetIfExistsAsync(elasticPoolName);
ElasticPoolResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine("Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ElasticPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
範例回覆
{
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"kind": "vcore,pool",
"location": "Japan East",
"properties": {
"creationDate": "2021-08-26T03:46:20.57Z",
"highAvailabilityReplicaCount": 2,
"licenseType": "LicenseIncluded",
"maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default",
"maxSizeBytes": 0,
"perDatabaseSettings": {
"maxCapacity": 4,
"minCapacity": 0
},
"state": "Ready",
"zoneRedundant": false
},
"sku": {
"name": "HS_Gen5",
"capacity": 4,
"family": "Gen5",
"tier": "Hyperscale"
}
}
Get an elastic pool
範例要求
GET https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102?api-version=2025-01-01
/**
* Samples for ElasticPools Get.
*/
public final class Main {
/*
* x-ms-original-file: 2025-01-01/ElasticPoolGet.json
*/
/**
* Sample code: Get an elastic pool.
*
* @param manager Entry point to SqlServerManager.
*/
public static void getAnElasticPool(com.azure.resourcemanager.sql.SqlServerManager manager) {
manager.serviceClient().getElasticPools().getWithResponse("sqlcrudtest-2369", "sqlcrudtest-8069",
"sqlcrudtest-8102", com.azure.core.util.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
from azure.identity import DefaultAzureCredential
from azure.mgmt.sql import SqlManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-sql
# USAGE
python elastic_pool_get.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 = SqlManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.elastic_pools.get(
resource_group_name="sqlcrudtest-2369",
server_name="sqlcrudtest-8069",
elastic_pool_name="sqlcrudtest-8102",
)
print(response)
# x-ms-original-file: 2025-01-01/ElasticPoolGet.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SqlManagementClient } = require("@azure/arm-sql");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to gets an elastic pool.
*
* @summary gets an elastic pool.
* x-ms-original-file: 2025-01-01/ElasticPoolGet.json
*/
async function getAnElasticPool() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new SqlManagementClient(credential, subscriptionId);
const result = await client.elasticPools.get(
"sqlcrudtest-2369",
"sqlcrudtest-8069",
"sqlcrudtest-8102",
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Sql.Models;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolGet.json
// this example is just showing the usage of "ElasticPools_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SqlServerResource created on azure
// for more information of creating SqlServerResource, please refer to the document of SqlServerResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "sqlcrudtest-2369";
string serverName = "sqlcrudtest-8069";
ResourceIdentifier sqlServerResourceId = SqlServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName);
SqlServerResource sqlServer = client.GetSqlServerResource(sqlServerResourceId);
// get the collection of this ElasticPoolResource
ElasticPoolCollection collection = sqlServer.GetElasticPools();
// invoke the operation
string elasticPoolName = "sqlcrudtest-8102";
NullableResponse<ElasticPoolResource> response = await collection.GetIfExistsAsync(elasticPoolName);
ElasticPoolResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine("Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ElasticPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
範例回覆
{
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"kind": null,
"location": "Japan East",
"properties": {
"creationDate": "2017-10-10T01:25:25.033Z",
"licenseType": "LicenseIncluded",
"maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_1",
"maxSizeBytes": 5242880000,
"perDatabaseSettings": {
"maxCapacity": 1,
"minCapacity": 0.25
},
"state": "Ready",
"zoneRedundant": true
},
"sku": {
"name": "GP_Gen5_2",
"capacity": 2,
"tier": "GeneralPurpose"
}
}
Get an elastic pool with Availability Zone
範例要求
GET https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102?api-version=2025-01-01
/**
* Samples for ElasticPools Get.
*/
public final class Main {
/*
* x-ms-original-file: 2025-01-01/GetElasticPoolWithAvailabilityZone.json
*/
/**
* Sample code: Get an elastic pool with Availability Zone.
*
* @param manager Entry point to SqlServerManager.
*/
public static void getAnElasticPoolWithAvailabilityZone(com.azure.resourcemanager.sql.SqlServerManager manager) {
manager.serviceClient().getElasticPools().getWithResponse("sqlcrudtest-2369", "sqlcrudtest-8069",
"sqlcrudtest-8102", com.azure.core.util.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
from azure.identity import DefaultAzureCredential
from azure.mgmt.sql import SqlManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-sql
# USAGE
python get_elastic_pool_with_availability_zone.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 = SqlManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.elastic_pools.get(
resource_group_name="sqlcrudtest-2369",
server_name="sqlcrudtest-8069",
elastic_pool_name="sqlcrudtest-8102",
)
print(response)
# x-ms-original-file: 2025-01-01/GetElasticPoolWithAvailabilityZone.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SqlManagementClient } = require("@azure/arm-sql");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to gets an elastic pool.
*
* @summary gets an elastic pool.
* x-ms-original-file: 2025-01-01/GetElasticPoolWithAvailabilityZone.json
*/
async function getAnElasticPoolWithAvailabilityZone() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new SqlManagementClient(credential, subscriptionId);
const result = await client.elasticPools.get(
"sqlcrudtest-2369",
"sqlcrudtest-8069",
"sqlcrudtest-8102",
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Sql.Models;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetElasticPoolWithAvailabilityZone.json
// this example is just showing the usage of "ElasticPools_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SqlServerResource created on azure
// for more information of creating SqlServerResource, please refer to the document of SqlServerResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "sqlcrudtest-2369";
string serverName = "sqlcrudtest-8069";
ResourceIdentifier sqlServerResourceId = SqlServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName);
SqlServerResource sqlServer = client.GetSqlServerResource(sqlServerResourceId);
// get the collection of this ElasticPoolResource
ElasticPoolCollection collection = sqlServer.GetElasticPools();
// invoke the operation
string elasticPoolName = "sqlcrudtest-8102";
NullableResponse<ElasticPoolResource> response = await collection.GetIfExistsAsync(elasticPoolName);
ElasticPoolResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine("Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ElasticPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
範例回覆
{
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"kind": null,
"location": "Japan East",
"properties": {
"availabilityZone": "1",
"creationDate": "2017-10-10T01:25:25.033Z",
"licenseType": "LicenseIncluded",
"maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_1",
"maxSizeBytes": 5242880000,
"perDatabaseSettings": {
"maxCapacity": 1,
"minCapacity": 0.25
},
"state": "Ready",
"zoneRedundant": true
},
"sku": {
"name": "GP_Gen5_2",
"capacity": 2,
"tier": "GeneralPurpose"
}
}
Get an elastic pool with preferred enclave type parameter
範例要求
GET https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102?api-version=2025-01-01
/**
* Samples for ElasticPools Get.
*/
public final class Main {
/*
* x-ms-original-file: 2025-01-01/ElasticPoolGetWithPreferredEnclaveType.json
*/
/**
* Sample code: Get an elastic pool with preferred enclave type parameter.
*
* @param manager Entry point to SqlServerManager.
*/
public static void
getAnElasticPoolWithPreferredEnclaveTypeParameter(com.azure.resourcemanager.sql.SqlServerManager manager) {
manager.serviceClient().getElasticPools().getWithResponse("sqlcrudtest-2369", "sqlcrudtest-8069",
"sqlcrudtest-8102", com.azure.core.util.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
from azure.identity import DefaultAzureCredential
from azure.mgmt.sql import SqlManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-sql
# USAGE
python elastic_pool_get_with_preferred_enclave_type.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 = SqlManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.elastic_pools.get(
resource_group_name="sqlcrudtest-2369",
server_name="sqlcrudtest-8069",
elastic_pool_name="sqlcrudtest-8102",
)
print(response)
# x-ms-original-file: 2025-01-01/ElasticPoolGetWithPreferredEnclaveType.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SqlManagementClient } = require("@azure/arm-sql");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to gets an elastic pool.
*
* @summary gets an elastic pool.
* x-ms-original-file: 2025-01-01/ElasticPoolGetWithPreferredEnclaveType.json
*/
async function getAnElasticPoolWithPreferredEnclaveTypeParameter() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new SqlManagementClient(credential, subscriptionId);
const result = await client.elasticPools.get(
"sqlcrudtest-2369",
"sqlcrudtest-8069",
"sqlcrudtest-8102",
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Sql.Models;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolGetWithPreferredEnclaveType.json
// this example is just showing the usage of "ElasticPools_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SqlServerResource created on azure
// for more information of creating SqlServerResource, please refer to the document of SqlServerResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "sqlcrudtest-2369";
string serverName = "sqlcrudtest-8069";
ResourceIdentifier sqlServerResourceId = SqlServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName);
SqlServerResource sqlServer = client.GetSqlServerResource(sqlServerResourceId);
// get the collection of this ElasticPoolResource
ElasticPoolCollection collection = sqlServer.GetElasticPools();
// invoke the operation
string elasticPoolName = "sqlcrudtest-8102";
NullableResponse<ElasticPoolResource> response = await collection.GetIfExistsAsync(elasticPoolName);
ElasticPoolResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine("Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ElasticPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
範例回覆
{
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"kind": "vcore,pool",
"location": "Japan East",
"properties": {
"creationDate": "2022-08-26T03:46:20.57Z",
"highAvailabilityReplicaCount": 2,
"licenseType": "LicenseIncluded",
"maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default",
"maxSizeBytes": 0,
"perDatabaseSettings": {
"maxCapacity": 4,
"minCapacity": 0
},
"preferredEnclaveType": "VBS",
"state": "Ready",
"zoneRedundant": false
},
"sku": {
"name": "GP_Gen5",
"capacity": 4,
"family": "Gen5",
"tier": "GeneralPurpose"
}
}
Get an elastic pool with serverless properties
範例要求
GET https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102?api-version=2025-01-01
/**
* Samples for ElasticPools Get.
*/
public final class Main {
/*
* x-ms-original-file: 2025-01-01/GetElasticPoolWithServerlessProperties.json
*/
/**
* Sample code: Get an elastic pool with serverless properties.
*
* @param manager Entry point to SqlServerManager.
*/
public static void
getAnElasticPoolWithServerlessProperties(com.azure.resourcemanager.sql.SqlServerManager manager) {
manager.serviceClient().getElasticPools().getWithResponse("sqlcrudtest-2369", "sqlcrudtest-8069",
"sqlcrudtest-8102", com.azure.core.util.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
from azure.identity import DefaultAzureCredential
from azure.mgmt.sql import SqlManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-sql
# USAGE
python get_elastic_pool_with_serverless_properties.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 = SqlManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.elastic_pools.get(
resource_group_name="sqlcrudtest-2369",
server_name="sqlcrudtest-8069",
elastic_pool_name="sqlcrudtest-8102",
)
print(response)
# x-ms-original-file: 2025-01-01/GetElasticPoolWithServerlessProperties.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SqlManagementClient } = require("@azure/arm-sql");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to gets an elastic pool.
*
* @summary gets an elastic pool.
* x-ms-original-file: 2025-01-01/GetElasticPoolWithServerlessProperties.json
*/
async function getAnElasticPoolWithServerlessProperties() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new SqlManagementClient(credential, subscriptionId);
const result = await client.elasticPools.get(
"sqlcrudtest-2369",
"sqlcrudtest-8069",
"sqlcrudtest-8102",
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Sql.Models;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetElasticPoolWithServerlessProperties.json
// this example is just showing the usage of "ElasticPools_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SqlServerResource created on azure
// for more information of creating SqlServerResource, please refer to the document of SqlServerResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "sqlcrudtest-2369";
string serverName = "sqlcrudtest-8069";
ResourceIdentifier sqlServerResourceId = SqlServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName);
SqlServerResource sqlServer = client.GetSqlServerResource(sqlServerResourceId);
// get the collection of this ElasticPoolResource
ElasticPoolCollection collection = sqlServer.GetElasticPools();
// invoke the operation
string elasticPoolName = "sqlcrudtest-8102";
NullableResponse<ElasticPoolResource> response = await collection.GetIfExistsAsync(elasticPoolName);
ElasticPoolResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine("Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ElasticPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
範例回覆
{
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"kind": null,
"location": "Japan East",
"properties": {
"autoPauseDelay": 60,
"creationDate": "2017-10-10T01:25:25.033Z",
"licenseType": "LicenseIncluded",
"maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_1",
"maxSizeBytes": 5242880000,
"minCapacity": 0.5,
"perDatabaseSettings": {
"autoPauseDelay": 60,
"maxCapacity": 1,
"minCapacity": 0
},
"state": "Ready",
"zoneRedundant": true
},
"sku": {
"name": "GP_S_Gen5_2",
"capacity": 2,
"tier": "GeneralPurpose"
}
}
定義
AlwaysEncryptedEnclaveType
列舉型別
資料庫上要求的記憶體保護區類型,也就是預設或 VBS記憶體保護區。
| 值 |
Description |
|
Default
|
預設值
|
|
VBS
|
VBS
|
AvailabilityZoneType
列舉型別
指定資料庫釘選到的可用性區域。
| 值 |
Description |
|
NoPreference
|
無偏好
|
|
1
|
1
|
|
2
|
2
|
|
3
|
3
|
createdByType
列舉型別
建立資源的身分識別類型。
| 值 |
Description |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
ElasticPool
Object
彈性集區。
| 名稱 |
類型 |
Description |
|
id
|
string
(arm-id)
|
資源的完整資源標識碼。 例如,“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}”
|
|
kind
|
string
|
彈性集區種類。 這是用於 Azure 入口網站體驗的元資料。
|
|
location
|
string
|
資源所在的地理位置
|
|
name
|
string
|
資源的名稱
|
|
properties.autoPauseDelay
|
integer
(int32)
|
彈性集區自動暫停的分鐘數。 -1 值表示已停用自動暫停
|
|
properties.availabilityZone
|
AvailabilityZoneType
|
指定集區主要複本釘選到的可用性區域。
|
|
properties.creationDate
|
string
(date-time)
|
彈性集區的建立日期(ISO8601格式)。
|
|
properties.highAvailabilityReplicaCount
|
integer
(int32)
|
與商務關鍵、進階或超大規模資料庫版本彈性集區相關聯的次要複本數目,這些復本可用來提供高可用性。 僅適用於超大規模彈性集區。
|
|
properties.licenseType
|
ElasticPoolLicenseType
|
要套用此彈性集區的授權類型。
|
|
properties.maintenanceConfigurationId
|
string
|
指派給彈性集區的維護組態標識碼。 此組態會定義將發生維護更新的期間。
|
|
properties.maxSizeBytes
|
integer
(int64)
|
資料庫彈性集區的記憶體限制,以位元組為單位。
|
|
properties.minCapacity
|
number
(double)
|
如果未暫停,無伺服器集區的最小容量將不會縮小到下方
|
|
properties.perDatabaseSettings
|
ElasticPoolPerDatabaseSettings
|
彈性集區的每個資料庫設定。
|
|
properties.preferredEnclaveType
|
AlwaysEncryptedEnclaveType
|
彈性集區上要求的記憶體保護區類型。
|
|
properties.state
|
ElasticPoolState
|
彈性集區的狀態。
|
|
properties.zoneRedundant
|
boolean
|
此彈性集區是否為區域備援,這表示此彈性集區的複本會分散到多個可用性區域。
|
|
sku
|
Sku
|
彈性集區 SKU。
SKU 清單可能會因區域和支援供應項目而異。 要確定在Azure區域內訂閱可用的 SKU(包括 SKU 名稱、層級/版本、家族及容量),請使用 Capabilities_ListByLocation REST API 或以下指令:
az sql elastic-pool list-editions -l <location> -o table
|
|
systemData
|
systemData
|
Azure Resource Manager 包含 createdBy 與 modifiedBy 資訊的元資料。
|
|
tags
|
object
|
資源標籤。
|
|
type
|
string
|
資源的類型。 例如:「Microsoft。運算/虛擬機器」或「Microsoft」。儲存/儲存帳號」
|
ElasticPoolLicenseType
列舉型別
要套用此彈性集區的授權類型。
| 值 |
Description |
|
LicenseIncluded
|
授權包含
|
|
BasePrice
|
BasePrice
|
ElasticPoolPerDatabaseSettings
Object
彈性集區的每個資料庫設定。
| 名稱 |
類型 |
Description |
|
autoPauseDelay
|
integer
(int32)
|
集區內每個資料庫的自動暫停延遲
|
|
maxCapacity
|
number
(double)
|
任何一個資料庫都可以取用的最大容量。
|
|
minCapacity
|
number
(double)
|
保證所有資料庫的最小容量。
|
ElasticPoolState
列舉型別
彈性集區的狀態。
| 值 |
Description |
|
Creating
|
建立中
|
|
Ready
|
Ready
|
|
Disabled
|
Disabled
|
ErrorAdditionalInfo
Object
資源管理錯誤附加資訊。
| 名稱 |
類型 |
Description |
|
info
|
object
|
附加資訊。
|
|
type
|
string
|
其他資訊類型。
|
ErrorDetail
Object
錯誤詳細資料。
ErrorResponse
Object
錯誤回應
Sku
Object
ARM 資源 SKU。
| 名稱 |
類型 |
Description |
|
capacity
|
integer
(int32)
|
特定 SKU 的容量。
|
|
family
|
string
|
如果服務有不同世代的硬體,針對相同的 SKU,則可以在這裡擷取。
|
|
name
|
string
|
SKU 的名稱,通常是字母 + 數位碼,例如 P3。
|
|
size
|
string
|
特定 SKU 的大小
|
|
tier
|
string
|
特定 SKU 的階層或版本,例如基本、進階。
|
systemData
Object
與建立和上次修改資源相關的元數據。
| 名稱 |
類型 |
Description |
|
createdAt
|
string
(date-time)
|
資源建立的時間戳(UTC)。
|
|
createdBy
|
string
|
建立資源的身分識別。
|
|
createdByType
|
createdByType
|
建立資源的身分識別類型。
|
|
lastModifiedAt
|
string
(date-time)
|
資源上次修改的時間戳記 (UTC)
|
|
lastModifiedBy
|
string
|
上次修改資源的身分識別。
|
|
lastModifiedByType
|
createdByType
|
上次修改資源的身分識別類型。
|