workload_groups
Creates, updates, deletes, gets or lists a workload_groups
resource.
Overview
Name | workload_groups |
Type | Resource |
Id | azure.sql.workload_groups |
Fields
- vw_workload_groups
- workload_groups
Name | Datatype | Description |
---|---|---|
databaseName | text | field from the properties object |
importance | text | field from the properties object |
max_resource_percent | text | field from the properties object |
max_resource_percent_per_request | text | field from the properties object |
min_resource_percent | text | field from the properties object |
min_resource_percent_per_request | text | field from the properties object |
query_execution_timeout | text | field from the properties object |
resourceGroupName | text | field from the properties object |
serverName | text | field from the properties object |
subscriptionId | text | field from the properties object |
workloadGroupName | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
properties | object | Workload group definition. For more information look at sys.workload_management_workload_groups (DMV). |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | databaseName, resourceGroupName, serverName, subscriptionId, workloadGroupName | Gets a workload group |
list_by_database | SELECT | databaseName, resourceGroupName, serverName, subscriptionId | Gets the list of workload groups |
create_or_update | INSERT | databaseName, resourceGroupName, serverName, subscriptionId, workloadGroupName | Creates or updates a workload group. |
delete | DELETE | databaseName, resourceGroupName, serverName, subscriptionId, workloadGroupName | Deletes a workload group. |
SELECT
examples
Gets the list of workload groups
- vw_workload_groups
- workload_groups
SELECT
databaseName,
importance,
max_resource_percent,
max_resource_percent_per_request,
min_resource_percent,
min_resource_percent_per_request,
query_execution_timeout,
resourceGroupName,
serverName,
subscriptionId,
workloadGroupName
FROM azure.sql.vw_workload_groups
WHERE databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';
SELECT
properties
FROM azure.sql.workload_groups
WHERE databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new workload_groups
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.sql.workload_groups (
databaseName,
resourceGroupName,
serverName,
subscriptionId,
workloadGroupName,
properties
)
SELECT
'{{ databaseName }}',
'{{ resourceGroupName }}',
'{{ serverName }}',
'{{ subscriptionId }}',
'{{ workloadGroupName }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: properties
value:
- name: minResourcePercent
value: integer
- name: maxResourcePercent
value: integer
- name: minResourcePercentPerRequest
value: number
- name: maxResourcePercentPerRequest
value: number
- name: importance
value: string
- name: queryExecutionTimeout
value: integer
DELETE
example
Deletes the specified workload_groups
resource.
/*+ delete */
DELETE FROM azure.sql.workload_groups
WHERE databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND workloadGroupName = '{{ workloadGroupName }}';