Support for reboot, shutdown, etc
salt.modules.system.
get_system_date
(utc_offset=None)¶Get the system date
Parameters: | utc_offset (str) -- The utc offset in 4 digit (+0600) format with an |
---|
optional sign (+/-). Will default to None which will use the local timezone. To set the time based off of UTC use "'+0000'". Note: if being passed through the command line will need to be quoted twice to allow negative offsets. :return: Returns the system date. :rtype: str
CLI Example:
salt '*' system.get_system_date
salt.modules.system.
get_system_date_time
(utc_offset=None)¶Get the system date/time.
Parameters: | utc_offset (str) -- The utc offset in 4 digit (+0600) format with an |
---|
optional sign (+/-). Will default to None which will use the local timezone. To set the time based off of UTC use "'+0000'". Note: if being passed through the command line will need to be quoted twice to allow negative offsets. :return: Returns the system time in YYYY-MM-DD hh:mm:ss format. :rtype: str
CLI Example:
salt '*' system.get_system_date_time "'-0500'"
salt.modules.system.
get_system_time
(utc_offset=None)¶Get the system time.
Parameters: | utc_offset (str) -- The utc offset in 4 digit (+0600) format with an |
---|
optional sign (+/-). Will default to None which will use the local timezone. To set the time based off of UTC use "'+0000'". Note: if being passed through the command line will need to be quoted twice to allow negative offsets. :return: Returns the system time in HH:MM AM/PM format. :rtype: str
CLI Example:
salt '*' system.get_system_time
salt.modules.system.
halt
()¶Halt a running system
CLI Example:
salt '*' system.halt
salt.modules.system.
init
(runlevel)¶Change the system runlevel on sysV compatible systems
CLI Example:
salt '*' system.init 3
salt.modules.system.
poweroff
()¶Poweroff a running system
CLI Example:
salt '*' system.poweroff
salt.modules.system.
reboot
(at_time=None)¶Reboot the system
CLI Example:
salt '*' system.reboot
salt.modules.system.
set_system_date
(newdate, utc_offset=None)¶Set the Windows system date. Use <mm-dd-yy> format for the date.
Parameters: | newdate (str) -- The date to set. Can be any of the following formats - YYYY-MM-DD - MM-DD-YYYY - MM-DD-YY - MM/DD/YYYY - MM/DD/YY - YYYY/MM/DD |
---|
CLI Example:
salt '*' system.set_system_date '03-28-13'
salt.modules.system.
set_system_date_time
(years=None, months=None, days=None, hours=None, minutes=None, seconds=None, utc_offset=None)¶Set the system date and time. Each argument is an element of the date, but not required. If an element is not passed, the current system value for that element will be used. For example, if you don't pass the year, the current system year will be used. (Used by set_system_date and set_system_time)
Parameters: |
---|
optional sign (+/-). Will default to None which will use the local timezone. To set the time based off of UTC use "'+0000'". Note: if being passed through the command line will need to be quoted twice to allow negative offsets. :return: True if successful. Otherwise False. :rtype: bool
CLI Example:
salt '*' system.set_system_date_time 2015 5 12 11 37 53 "'-0500'"
salt.modules.system.
set_system_time
(newtime, utc_offset=None)¶Set the system time.
Parameters: |
|
---|
optional sign (+/-). Will default to None which will use the local timezone. To set the time based off of UTC use "'+0000'". Note: if being passed through the command line will need to be quoted twice to allow negative offsets. :return: Returns True if successful. Otherwise False. :rtype: bool
CLI Example:
salt '*' system.set_system_time "'11:20'"
salt.modules.system.
shutdown
(at_time=None)¶Shutdown a running system
CLI Example:
salt '*' system.shutdown 5