mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix docs, formatting
This commit is contained in:
parent
b17495c9c8
commit
19f34bda55
1 changed files with 90 additions and 66 deletions
|
@ -188,23 +188,29 @@ def list_update(name, download=False, install=False):
|
|||
'''
|
||||
.. deprecated:: 2017.7.0
|
||||
Use :func:`get` instead
|
||||
|
||||
Returns details for all updates that match the search criteria
|
||||
|
||||
Args:
|
||||
name (str): The name of the update you're searching for. This can be the
|
||||
GUID, a KB number, or any part of the name of the update. GUIDs and
|
||||
KBs are preferred. Run ``list_updates`` to get the GUID for the update
|
||||
you're looking for.
|
||||
|
||||
download (bool): Download the update returned by this function. Run this
|
||||
function first to see if the update exists, then set ``download=True``
|
||||
to download the update.
|
||||
name (str):
|
||||
The name of the update you're searching for. This can be the GUID, a
|
||||
KB number, or any part of the name of the update. GUIDs and KBs are
|
||||
preferred. Run ``list_updates`` to get the GUID for the update
|
||||
you're looking for.
|
||||
|
||||
install (bool): Install the update returned by this function. Run this
|
||||
function first to see if the update exists, then set ``install=True`` to
|
||||
install the update.
|
||||
download (bool):
|
||||
Download the update returned by this function. Run this function
|
||||
first to see if the update exists, then set ``download=True`` to
|
||||
download the update.
|
||||
|
||||
install (bool):
|
||||
Install the update returned by this function. Run this function
|
||||
first to see if the update exists, then set ``install=True`` to
|
||||
install the update.
|
||||
|
||||
Returns:
|
||||
|
||||
dict: Returns a dict containing a list of updates that match the name if
|
||||
download and install are both set to False. Should usually be a single
|
||||
update, but can return multiple if a partial name is given.
|
||||
|
@ -263,9 +269,10 @@ def get(name, download=False, install=False):
|
|||
'''
|
||||
.. versionadded:: 2017.7.0
|
||||
|
||||
Returns details for all updates that match the search criteria
|
||||
Returns details for the named update
|
||||
|
||||
Args:
|
||||
|
||||
name (str):
|
||||
The name of the update you're searching for. This can be the GUID, a
|
||||
KB number, or any part of the name of the update. GUIDs and KBs are
|
||||
|
@ -283,6 +290,7 @@ def get(name, download=False, install=False):
|
|||
install the update.
|
||||
|
||||
Returns:
|
||||
|
||||
dict: Returns a dict containing a list of updates that match the name if
|
||||
download and install are both set to False. Should usually be a single
|
||||
update, but can return multiple if a partial name is given.
|
||||
|
@ -365,30 +373,35 @@ def list_updates(software=True,
|
|||
install is True the same list will be downloaded and/or installed.
|
||||
|
||||
Args:
|
||||
software (bool): Include software updates in the results (default is
|
||||
True)
|
||||
|
||||
drivers (bool): Include driver updates in the results (default is False)
|
||||
software (bool):
|
||||
Include software updates in the results (default is True)
|
||||
|
||||
drivers (bool):
|
||||
Include driver updates in the results (default is False)
|
||||
|
||||
summary (bool):
|
||||
- True: Return a summary of updates available for each category.
|
||||
- False (default): Return a detailed list of available updates.
|
||||
- True: Return a summary of updates available for each category.
|
||||
- False (default): Return a detailed list of available updates.
|
||||
|
||||
skip_installed (bool): Skip installed updates in the results (default is
|
||||
False)
|
||||
skip_installed (bool):
|
||||
Skip installed updates in the results (default is False)
|
||||
|
||||
download (bool): (Overrides reporting functionality) Download the list
|
||||
of updates returned by this function. Run this function first with
|
||||
``download=False`` to see what will be downloaded, then set
|
||||
``download=True`` to download the updates.
|
||||
download (bool):
|
||||
(Overrides reporting functionality) Download the list of updates
|
||||
returned by this function. Run this function first with
|
||||
``download=False`` to see what will be downloaded, then set
|
||||
``download=True`` to download the updates.
|
||||
|
||||
install (bool): (Overrides reporting functionality) Install the list of
|
||||
updates returned by this function. Run this function first with
|
||||
``install=False`` to see what will be installed, then set
|
||||
``install=True`` to install the updates.
|
||||
install (bool):
|
||||
(Overrides reporting functionality) Install the list of updates
|
||||
returned by this function. Run this function first with
|
||||
``install=False`` to see what will be installed, then set
|
||||
``install=True`` to install the updates.
|
||||
|
||||
categories (list): Specify the categories to list. Must be passed as a
|
||||
list. All categories returned by default.
|
||||
categories (list):
|
||||
Specify the categories to list. Must be passed as a list. All
|
||||
categories returned by default.
|
||||
|
||||
Categories include the following:
|
||||
|
||||
|
@ -406,8 +419,9 @@ def list_updates(software=True,
|
|||
* Windows 8.1 and later drivers
|
||||
* Windows Defender
|
||||
|
||||
severities (list): Specify the severities to include. Must be passed as
|
||||
a list. All severities returned by default.
|
||||
severities (list):
|
||||
Specify the severities to include. Must be passed as a list. All
|
||||
severities returned by default.
|
||||
|
||||
Severities include the following:
|
||||
|
||||
|
@ -494,6 +508,7 @@ def list(software=True,
|
|||
install is True the same list will be downloaded and/or installed.
|
||||
|
||||
Args:
|
||||
|
||||
software (bool):
|
||||
Include software updates in the results (default is True)
|
||||
|
||||
|
@ -638,13 +653,16 @@ def download_update(name):
|
|||
|
||||
Args:
|
||||
|
||||
name (str): The name of the update to download. This can be a GUID, a KB
|
||||
number, or any part of the name. To ensure a single item is matched the
|
||||
GUID is preferred.
|
||||
name (str):
|
||||
The name of the update to download. This can be a GUID, a KB number,
|
||||
or any part of the name. To ensure a single item is matched the GUID
|
||||
is preferred.
|
||||
|
||||
.. note:: If more than one result is returned an error will be raised.
|
||||
.. note::
|
||||
If more than one result is returned an error will be raised.
|
||||
|
||||
Returns:
|
||||
|
||||
dict: A dictionary containing the results of the download
|
||||
|
||||
CLI Examples:
|
||||
|
@ -654,7 +672,6 @@ def download_update(name):
|
|||
salt '*' win_wua.download_update 12345678-abcd-1234-abcd-1234567890ab
|
||||
|
||||
salt '*' win_wua.download_update KB12312321
|
||||
|
||||
'''
|
||||
salt.utils.warn_until(
|
||||
'Fluorine',
|
||||
|
@ -673,8 +690,9 @@ def download_updates(names):
|
|||
|
||||
Args:
|
||||
|
||||
names (list): A list of updates to download. This can be any combination
|
||||
of GUIDs, KB numbers, or names. GUIDs or KBs are preferred.
|
||||
names (list):
|
||||
A list of updates to download. This can be any combination of GUIDs,
|
||||
KB numbers, or names. GUIDs or KBs are preferred.
|
||||
|
||||
Returns:
|
||||
|
||||
|
@ -685,7 +703,7 @@ def download_updates(names):
|
|||
.. code-block:: bash
|
||||
|
||||
# Normal Usage
|
||||
salt '*' win_wua.download guid=['12345678-abcd-1234-abcd-1234567890ab', 'KB2131233']
|
||||
salt '*' win_wua.download_updates guid=['12345678-abcd-1234-abcd-1234567890ab', 'KB2131233']
|
||||
'''
|
||||
salt.utils.warn_until(
|
||||
'Fluorine',
|
||||
|
@ -759,10 +777,12 @@ def install_update(name):
|
|||
number, or any part of the name. To ensure a single item is matched the
|
||||
GUID is preferred.
|
||||
|
||||
.. note:: If no results or more than one result is returned an error
|
||||
will be raised.
|
||||
.. note::
|
||||
If no results or more than one result is returned an error will be
|
||||
raised.
|
||||
|
||||
Returns:
|
||||
|
||||
dict: A dictionary containing the results of the install
|
||||
|
||||
CLI Examples:
|
||||
|
@ -926,34 +946,37 @@ def set_wu_settings(level=None,
|
|||
Update settings are read-only. See MSDN documentation:
|
||||
https://msdn.microsoft.com/en-us/library/aa385829(v=vs.85).aspx
|
||||
|
||||
:param int level:
|
||||
Number from 1 to 4 indicating the update level:
|
||||
Args:
|
||||
|
||||
level (int):
|
||||
Number from 1 to 4 indicating the update level:
|
||||
|
||||
1. Never check for updates
|
||||
2. Check for updates but let me choose whether to download and install them
|
||||
3. Download updates but let me choose whether to install them
|
||||
4. Install updates automatically
|
||||
|
||||
:param bool recommended:
|
||||
Boolean value that indicates whether to include optional or recommended
|
||||
updates when a search for updates and installation of updates is
|
||||
performed.
|
||||
recommended (bool):
|
||||
Boolean value that indicates whether to include optional or
|
||||
recommended updates when a search for updates and installation of
|
||||
updates is performed.
|
||||
|
||||
:param bool featured:
|
||||
Boolean value that indicates whether to display notifications for
|
||||
featured updates.
|
||||
featured (bool):
|
||||
Boolean value that indicates whether to display notifications for
|
||||
featured updates.
|
||||
|
||||
:param bool elevated:
|
||||
Boolean value that indicates whether non-administrators can perform some
|
||||
update-related actions without administrator approval.
|
||||
elevated (bool):
|
||||
Boolean value that indicates whether non-administrators can perform
|
||||
some update-related actions without administrator approval.
|
||||
|
||||
:param bool msupdate:
|
||||
Boolean value that indicates whether to turn on Microsoft Update for
|
||||
other Microsoft products
|
||||
msupdate (bool):
|
||||
Boolean value that indicates whether to turn on Microsoft Update for
|
||||
other Microsoft products
|
||||
|
||||
day (str):
|
||||
Days of the week on which Automatic Updates installs or uninstalls
|
||||
updates. Accepted values:
|
||||
|
||||
:param str day:
|
||||
Days of the week on which Automatic Updates installs or uninstalls
|
||||
updates.
|
||||
Accepted values:
|
||||
- Everyday
|
||||
- Monday
|
||||
- Tuesday
|
||||
|
@ -962,18 +985,20 @@ def set_wu_settings(level=None,
|
|||
- Friday
|
||||
- Saturday
|
||||
|
||||
:param str time:
|
||||
Time at which Automatic Updates installs or uninstalls updates. Must be
|
||||
in the ##:## 24hr format, eg. 3:00 PM would be 15:00
|
||||
time (str):
|
||||
Time at which Automatic Updates installs or uninstalls updates. Must
|
||||
be in the ##:## 24hr format, eg. 3:00 PM would be 15:00. Must be in
|
||||
1 hour increments.
|
||||
|
||||
:return: Returns a dictionary containing the results.
|
||||
Returns:
|
||||
|
||||
dict: Returns a dictionary containing the results.
|
||||
|
||||
CLI Examples:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' win_wua.set_wu_settings level=4 recommended=True featured=False
|
||||
|
||||
'''
|
||||
# The AutomaticUpdateSettings.Save() method used in this function does not
|
||||
# work on Windows 10 / Server 2016. It is called in throughout this function
|
||||
|
@ -1255,13 +1280,12 @@ def get_needs_reboot():
|
|||
|
||||
Returns:
|
||||
|
||||
bool: True if the system requires a reboot, False if not
|
||||
bool: True if the system requires a reboot, otherwise False
|
||||
|
||||
CLI Examples:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' win_wua.get_needs_reboot
|
||||
|
||||
'''
|
||||
return salt.utils.win_update.needs_reboot()
|
||||
|
|
Loading…
Add table
Reference in a new issue