Debian Codegraph @

ansible_collections/lowlydba/sqlserver/plugins/modules/rg_workload_group.py

raw
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3
4 # (c) 2022, John McCall (@lowlydba)
5 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
6
7 DOCUMENTATION = r'''
8 ---
9 module: rg_workload_group
10 short_description: Configures a workload group for use by the Resource Governor
11 description:
12 - Creates or modifies a workload group to be used by the Resource Governor. Default values are handled by the Powershell functions themselves.
13 version_added: 0.1.0
14 options:
15 workload_group:
16 description:
17 - Name of the target workload group.
18 type: str
19 required: true
20 resource_pool:
21 description:
22 - Name of the resource pool for the workload group.
23 type: str
24 required: true
25 resource_pool_type:
26 description:
27 - Specify the type of resource pool.
28 type: str
29 required: false
30 default: 'Internal'
31 choices: ['Internal', 'External']
32 group_max_requests:
33 description:
34 - Specifies the maximum number of simultaneous requests that are allowed to execute in the workload group.
35 type: int
36 required: false
37 importance:
38 description:
39 - Specifies the relative importance of a request in the workload group.
40 type: str
41 required: false
42 choices: ['Low', 'Medium', 'High']
43 max_dop:
44 description:
45 - Specifies the maximum degree of parallelism (MAXDOP) for parallel query execution.
46 type: int
47 required: false
48 request_max_cpu_time:
49 description:
50 - Specifies the maximum amount of CPU time, in seconds, that a request can use.
51 type: int
52 required: false
53 request_max_mem_grant_perc:
54 description:
55 - Specifies the maximum amount of memory that a single request can take from the pool.
56 type: int
57 required: false
58 request_mem_grant_timeout_sec:
59 description:
60 - Specifies the maximum time, in seconds, that a query can wait for a memory grant (work buffer memory) to become available.
61 type: int
62 required: false
63 author: "John McCall (@lowlydba)"
64 requirements:
65 - L(dbatools,https://www.powershellgallery.com/packages/dbatools/) PowerShell module
66 extends_documentation_fragment:
67 - lowlydba.sqlserver.sql_credentials
68 - lowlydba.sqlserver.attributes.check_mode
69 - lowlydba.sqlserver.attributes.platform_all
70 - lowlydba.sqlserver.state
71 '''
72
73 EXAMPLES = r'''
74 - name: Enable resource governor
75 lowlydba.sqlserver.resource_governor:
76 sql_instance: sql-01.myco.io
77 enabled: true
78
79 - name: Create rg resource pool
80 lowlydba.sqlserver.rg_resource_pool:
81 sql_instance: sql-01.myco.io
82 resource_pool: "rpLittle"
83 max_cpu_perc: 5
84
85 - name: Create rg workload group
86 lowlydba.sqlserver.rg_workload_group:
87 sql_instance: sql-01.myco.io
88 workload_group: rgMyGroup
89 resource_pool: rpLittle
90 resource_pool_type: Internal
91 max_dop: 2
92 state: present
93 '''
94
95 RETURN = r'''
96 data:
97 description: Output from the C(Set-DbaRgWorkloadGroup), C(New-DbaRgWorkloadGroup), or C(Remove-DbaRgWorkloadGroup) function.
98 returned: success, but not in check_mode.
99 type: dict
100 '''