Debian Codegraph @

ansible_collections/lowlydba/sqlserver/plugins/modules/sp_whoisactive.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: sp_whoisactive
10 short_description: Install/update C(sp_whoisactive) by Adam Mechanic
11 description:
12 - A wrapper for C(Install-DbaWhoIsActive) to fetch the latest version of the script, or install from a local cached version.
13 version_added: 0.1.0
14 options:
15 local_file:
16 description:
17 - Specifies the path to a local file to install sp_WhoisActive from.
18 - This can be either the zip file as distributed by the website or the expanded SQL script.
19 - If this option is not specified, the latest version will be downloaded and installed from https://github.com/amachanic/sp_whoisactive/releases
20 type: str
21 required: false
22 database:
23 description:
24 - Name of the target database.
25 type: str
26 required: true
27 force:
28 description:
29 - If this switch is enabled, then C(sp_WhoisActive) will be downloaded from the internet even if previously cached.
30 type: bool
31 default: false
32 author: "John McCall (@lowlydba)"
33 requirements:
34 - L(dbatools,https://www.powershellgallery.com/packages/dbatools/) PowerShell module
35 extends_documentation_fragment:
36 - lowlydba.sqlserver.sql_credentials
37 - lowlydba.sqlserver.attributes.check_mode
38 - lowlydba.sqlserver.attributes.platform_all
39 '''
40
41 EXAMPLES = r'''
42 - name: Install/Update sp_whoisactive
43 lowlydba.sqlserver.sp_whoisactive:
44 sql_instance: sql-01.myco.io
45 database: lowlydb
46 '''
47
48 RETURN = r'''
49 data:
50 description: Output from the C(Install-DbaWhoIsActive) function.
51 returned: success, but not in check_mode.
52 type: dict
53 '''