Azure SQL 数据仓库的 REST APIREST APIs for Azure SQL Data Warehouse

用于管理 Azure Synapse Analytics 数据仓库中的计算的 REST API。REST APIs for managing compute in Azure Synapse Analytics data warehouse.

缩放计算Scale compute

若要更改数据仓库单位,请使用创建或更新数据库 REST API。To change the data warehouse units, use the Create or Update Database REST API. 以下示例将托管在服务器 MyServer 上的数据库 MySQLDW 的数据仓库单位设置为 DW1000。The following example sets the data warehouse units to DW1000 for the database MySQLDW, which is hosted on server MyServer. 该服务器位于名为 ResourceGroup1 的 Azure 资源组中。The server is in an Azure resource group named ResourceGroup1.

PATCH https://management.chinacloudapi.cn/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.Sql/servers/{server-name}/databases/{database-name}?api-version=2014-04-01-preview HTTP/1.1
Content-Type: application/json; charset=UTF-8

{
    "properties": {
        "requestedServiceObjectiveName": DW1000
    }
}

暂停计算Pause compute

若要暂停数据库,请使用暂停数据库 REST API。To pause a database, use the Pause Database REST API. 以下示例暂停 Server01 服务器上托管的 Database02 数据库。The following example pauses a database named Database02 hosted on a server named Server01. 该服务器位于名为 ResourceGroup1 的 Azure 资源组中。The server is in an Azure resource group named ResourceGroup1.

POST https://management.chinacloudapi.cn/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.Sql/servers/{server-name}/databases/{database-name}/pause?api-version=2014-04-01-preview HTTP/1.1

恢复计算Resume compute

若要启动数据库,请使用恢复数据库 REST API。To start a database, use the Resume Database REST API. 以下示例启动 Server01 服务器上托管的 Database02 数据库。The following example starts a database named Database02 hosted on a server named Server01. 该服务器位于名为 ResourceGroup1 的 Azure 资源组中。The server is in an Azure resource group named ResourceGroup1.

POST https://management.chinacloudapi.cn/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.Sql/servers/{server-name}/databases/{database-name}/resume?api-version=2014-04-01-preview HTTP/1.1

检查数据库状态Check database state

Note

当前 Check database state 可能会在数据库完成联机工作流时返回 ONLINE,从而导致连接错误。Currently Check database state might return ONLINE while the database is completing the online workflow, resulting in connection errors. 如果使用此 API 调用触发连接尝试,则可能需要在应用程序代码中添加 2 到 3 分钟的延迟。You might need to add a 2 to 3 minutes delay in your application code if you are using this API call to trigger connection attempts.

GET https://management.chinacloudapi.cn/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.Sql/servers/{server-name}/databases/{database-name}?api-version=2014-04-01 HTTP/1.1

获取维护计划Get maintenance schedule

检查已为数据仓库设置的维护计划。Check the maintenance schedule that has been set for a data warehouse.

GET https://management.chinacloudapi.cn/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.Sql/servers/{server-name}/databases/{database-name}/maintenanceWindows/current?maintenanceWindowName=current&api-version=2017-10-01-preview HTTP/1.1

设置维护计划Set maintenance schedule

设置和更新现有数据仓库的维护计划。To set and update a maintenance schedule on an existing data warehouse.

PUT https://management.chinacloudapi.cn/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.Sql/servers/{server-name}/databases/{database-name}/maintenanceWindows/current?maintenanceWindowName=current&api-version=2017-10-01-preview HTTP/1.1

{
    "properties": {
        "timeRanges": [
                {
                                "dayOfWeek": Saturday,
                                "startTime": 00:00,
                                "duration": 08:00,
                },
                {
                                "dayOfWeek": Wednesday
                                "startTime": 00:00,
                                "duration": 08:00,
                }
                ]
    }
}

后续步骤Next steps

有关详细信息,请参阅管理计算For more information, see Manage compute.