获取弹性池。
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}?api-version=2025-01-01
URI 参数
| 名称 |
在 |
必需 |
类型 |
说明 |
|
elasticPoolName
|
path |
True
|
string
|
弹性池的名称。
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
资源组的名称。 此名称不区分大小写。
|
|
serverName
|
path |
True
|
string
|
服务器的名称。
|
|
subscriptionId
|
path |
True
|
string
(uuid)
|
目标订阅的 ID。 该值必须是 UUID。
|
|
api-version
|
query |
True
|
string
minLength: 1
|
用于此作的 API 版本。
|
响应
安全性
azure_auth
Azure Active Directory OAuth2 Flow.
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 |
说明 |
|
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
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
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
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
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
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 enclave)上请求的 enclave 类型。
AvailabilityZoneType
枚举
指定数据库固定到的可用性区域。
| 值 |
说明 |
|
NoPreference
|
无偏好
|
|
1
|
1
|
|
2
|
2
|
|
3
|
3
|
createdByType
枚举
创建资源的标识的类型。
| 值 |
说明 |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
ElasticPool
对象
弹性池。
| 名称 |
类型 |
说明 |
|
id
|
string
(arm-id)
|
资源的完全限定资源 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
|
分配给弹性池的维护配置 ID。 此配置定义将发生维护更新的时间段。
|
|
properties.maxSizeBytes
|
integer
(int64)
|
数据库弹性池的存储限制(以字节为单位)。
|
|
properties.minCapacity
|
number
(double)
|
无服务器池不会缩小到的最小容量(如果未暂停)
|
|
properties.perDatabaseSettings
|
ElasticPoolPerDatabaseSettings
|
弹性池的每个数据库设置。
|
|
properties.preferredEnclaveType
|
AlwaysEncryptedEnclaveType
|
弹性池上请求的 enclave 类型。
|
|
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 资源管理器 包含 createdBy 和 modifiedBy 信息的元数据。
|
|
tags
|
object
|
资源标记。
|
|
type
|
string
|
资源类型。 例如,“Microsoft。计算/虚拟机“或”Microsoft“。存储/存储账户”
|
ElasticPoolLicenseType
枚举
要申请此弹性池的许可证类型。
| 值 |
说明 |
|
LicenseIncluded
|
包含许可
|
|
BasePrice
|
BasePrice
|
ElasticPoolPerDatabaseSettings
对象
弹性池的数据库设置。
| 名称 |
类型 |
说明 |
|
autoPauseDelay
|
integer
(int32)
|
池中每个数据库的自动暂停延迟
|
|
maxCapacity
|
number
(double)
|
任何一个数据库都可以使用的最大容量。
|
|
minCapacity
|
number
(double)
|
保证所有数据库的最小容量。
|
ElasticPoolState
枚举
弹性池的状态。
| 值 |
说明 |
|
Creating
|
创建
|
|
Ready
|
就绪
|
|
Disabled
|
已禁用
|
ErrorAdditionalInfo
对象
资源管理错误附加信息。
| 名称 |
类型 |
说明 |
|
info
|
object
|
附加信息。
|
|
type
|
string
|
附加信息类型。
|
ErrorDetail
对象
错误详细信息。
ErrorResponse
对象
错误响应
Sku
对象
ARM 资源 SKU。
| 名称 |
类型 |
说明 |
|
capacity
|
integer
(int32)
|
特定 SKU 的容量。
|
|
family
|
string
|
如果服务具有不同代的硬件(对于同一 SKU,则可以在此处捕获)。
|
|
name
|
string
|
SKU 的名称,通常为字母 + 数字代码,例如 P3。
|
|
size
|
string
|
特定 SKU 的大小
|
|
tier
|
string
|
特定 SKU 的层或版本,例如基本 SKU、高级版。
|
systemData
对象
与创建和上次修改资源相关的元数据。
| 名称 |
类型 |
说明 |
|
createdAt
|
string
(date-time)
|
资源创建时间戳(UTC)。
|
|
createdBy
|
string
|
创建资源的标识。
|
|
createdByType
|
createdByType
|
创建资源的标识的类型。
|
|
lastModifiedAt
|
string
(date-time)
|
资源上次修改的时间戳 (UTC)
|
|
lastModifiedBy
|
string
|
上次修改资源的标识。
|
|
lastModifiedByType
|
createdByType
|
上次修改资源的标识的类型。
|