Module Expr Str ImportFrom alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Str Assign NameStore Num Assign NameStore Num Assign NameStore Num FunctionDef arguments args defaults body Expr Str If Call AttributeLoad AttributeLoad NameLoad attr attr body Return NameLoad Return TupleLoad NameLoad Str decorator_list FunctionDef arguments args defaults body Expr Str Return Call NameLoad ListComp NameLoad comprehension NameStore Call NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Return Call NameLoad ListComp NameLoad comprehension NameStore Call NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return CompareIn NameLoad Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return CompareNotIn NameLoad Call NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore ListLoad Str Str Str Str Str Str Str Call NameLoad NameLoad Assign NameStore Call AttributeLoad Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad attr For NameStore NameLoad body If CompareIn Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Num If UnaryOpNot CompareGt Call NameLoad NameLoad Num body Continue Expr Call AttributeLoad NameLoad attr Call AttributeLoad SubscriptLoad NameLoad Index Num attr Return Call NameLoad NameLoad decorator_list FunctionDef arguments args defaults vararg body Expr Str Assign NameStore Dict Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore ListLoad Str Str Str Str Str Str Str Call NameLoad NameLoad Assign NameStore Call AttributeLoad Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad attr For NameStore NameLoad body If CompareIn Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Num If UnaryOpNot CompareGt Call NameLoad NameLoad Num body Continue Expr Call AttributeLoad NameLoad attr Call AttributeLoad SubscriptLoad NameLoad Index Num attr If CompareIn Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Num If UnaryOpNot CompareGt Call NameLoad NameLoad Num body Continue Expr Call AttributeLoad NameLoad attr Call AttributeLoad SubscriptLoad NameLoad Index Num attr If CompareEq Call NameLoad NameLoad Call NameLoad NameLoad body Assign NameStore Call NameLoad Call NameLoad NameLoad NameLoad orelse Return Str If CompareEq Call NameLoad NameLoad Num body Return NameLoad For NameStore NameLoad body If CompareIn NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Str Str NameLoad Return UnaryOpNot Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Str Str NameLoad Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad If CompareIn Str NameLoad body Return NameLoad For NameStore Call NameLoad NameLoad body If UnaryOpNot Call NameLoad NameLoad body Return NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareIn Str NameLoad body Expr Call NameLoad Return Call NameLoad Return BoolOpAnd Call NameLoad NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Str Assign NameStore Str Return Call SubscriptLoad NameLoad Index Str keyword Str keyword Str keyword NameLoad keyword Str keyword NameLoad keyword NameLoad keyword Str keyword Str keyword Str decorator_list FunctionDef arguments args defaults body Expr Str Return Call SubscriptLoad NameLoad Index Str keyword Str decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore ListLoad Str Str NameLoad Assign NameStore Call AttributeLoad Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad attr For NameStore NameLoad body If CompareIn Str NameLoad body Return NameLoad orelse If CompareIn Str NameLoad body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Str Str NameLoad Assign NameStore Call AttributeLoad Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad attr For NameStore NameLoad body If CompareIn Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Num TryExcept body Return Call AttributeLoad SubscriptLoad NameLoad Index Num attr handlers ExceptHandler type TupleLoad NameLoad NameLoad body Return NameLoad decorator_list FunctionDef arguments args NameParam defaults kwarg body Expr Str Assign NameStore ListLoad Str Str NameLoad Str Str Return UnaryOpNot Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults kwarg body Expr Str Assign NameStore ListLoad Str Str NameLoad Str Str Return UnaryOpNot Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults kwarg body Expr Str Assign NameStore ListLoad Str Str NameLoad Assign NameStore Call AttributeLoad Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad attr For NameStore NameLoad body If CompareIn Str NameLoad body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Str Str NameLoad Assign NameStore Call AttributeLoad Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad attr For NameStore NameLoad body If CompareIn Str NameLoad body Return NameLoad orelse If CompareIn Str NameLoad body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str Str Str NameLoad Str NameLoad NameLoad NameLoad kwarg body Expr Str Assign NameStore ListLoad Str Str NameLoad Str NameLoad Str NameLoad Str NameLoad Str NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad Str NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad Str NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad Str NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad Str NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad Str NameLoad Return UnaryOpNot Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad kwarg body Expr Str Assign NameStore ListLoad Str Str NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad Str NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad Str NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad Str NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad Str NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad Str NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad Str NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad Str NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad Str NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad Str NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad Str NameLoad Return UnaryOpNot Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Str Str NameLoad Return UnaryOpNot Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad decorator_list
N/A N/A 
Windows Service module.
 __future__ absolute_import N/A salt.utils N/A time N/A logging salt.ext.six.moves zip salt.ext.six.moves range N/A log N/A N/A logging getLogger __name__ N/A __virtualname__ service N/A BUFFSIZE 5000 N/A SERVICE_STOP_DELAY_SECONDS 15 N/A SERVICE_STOP_POLL_MAX_ATTEMPTS 5 __virtual__ N/A N/A N/A N/A N/A 
    Only works on Windows systems
     N/A N/A N/A N/A salt utils is_windows N/A N/A __virtualname__ N/A N/A False Module win_service: module only works on Windows systems N/A get_enabled N/A N/A N/A N/A N/A 
    Return the enabled services

    CLI Example:

    .. code-block:: bash

        salt '*' service.get_enabled
     N/A N/A sorted N/A service N/A service N/A get_all N/A enabled service N/A get_disabled N/A N/A N/A N/A N/A 
    Return the disabled services

    CLI Example:

    .. code-block:: bash

        salt '*' service.get_disabled
     N/A N/A sorted N/A service N/A service N/A get_all N/A disabled service N/A available N/A N/A name N/A N/A N/A 
    Returns ``True`` if the specified service is available, otherwise returns
    ``False``.

    CLI Example:

    .. code-block:: bash

        salt '*' service.available <service name>
     N/A N/A name N/A get_all N/A missing N/A N/A name N/A N/A N/A 
    The inverse of service.available.
    Returns ``True`` if the specified service is not available, otherwise returns
    ``False``.

    CLI Example:

    .. code-block:: bash

        salt '*' service.missing <service name>
     N/A N/A name N/A get_all N/A get_all N/A N/A N/A N/A N/A 
    Return all installed services

    CLI Example:

    .. code-block:: bash

        salt '*' service.get_all
     N/A ret N/A set N/A cmd N/A sc query type= service state= all bufsize= N/A str BUFFSIZE N/A lines N/A N/A N/A N/A __salt__ N/A cmd.run cmd python_shell False splitlines N/A line lines N/A N/A N/A SERVICE_NAME: line N/A N/A comps N/A N/A line split : 1 N/A N/A N/A N/A len comps 1 N/A N/A N/A N/A N/A ret add N/A N/A N/A comps N/A 1 strip N/A N/A sorted ret N/A get_service_name N/A N/A N/A args N/A N/A 
    The Display Name is what is displayed in Windows when services.msc is
    executed.  Each Display Name has an associated Service Name which is the
    actual name of the service.  This function allows you to discover the
    Service Name by returning a dictionary of Display Names and Service Names,
    or filter by adding arguments of Display Names.

    If no args are passed, return a dict of all services where the keys are the
    service Display Names and the values are the Service Names.

    If arguments are passed, create a dict of Display Names and Service Names

    CLI Example:

    .. code-block:: bash

        salt '*' service.get_service_name
        salt '*' service.get_service_name 'Google Update Service (gupdate)' 'DHCP Client'
     N/A ret N/A N/A services N/A N/A display_names N/A N/A cmd N/A sc query type= service state= all bufsize= N/A str BUFFSIZE N/A lines N/A N/A N/A N/A __salt__ N/A cmd.run cmd python_shell False splitlines N/A line lines N/A N/A N/A SERVICE_NAME: line N/A N/A comps N/A N/A line split : 1 N/A N/A N/A N/A len comps 1 N/A N/A N/A N/A N/A services append N/A N/A N/A comps N/A 1 strip N/A N/A DISPLAY_NAME: line N/A N/A comps N/A N/A line split : 1 N/A N/A N/A N/A len comps 1 N/A N/A N/A N/A N/A display_names append N/A N/A N/A comps N/A 1 strip N/A N/A N/A len services N/A len display_names N/A N/A service_dict N/A dict N/A zip display_names services N/A N/A Service Names and Display Names mismatch N/A N/A N/A len args 0 N/A N/A service_dict N/A arg args N/A N/A N/A arg service_dict N/A N/A N/A ret N/A arg N/A service_dict N/A arg N/A ret N/A start N/A N/A name N/A N/A N/A 
    Start the specified service

    CLI Example:

    .. code-block:: bash

        salt '*' service.start <service name>
     N/A cmd N/A net start name N/A N/A N/A N/A __salt__ N/A cmd.retcode cmd python_shell False N/A stop N/A N/A name N/A N/A N/A 
    Stop the specified service

    CLI Example:

    .. code-block:: bash

        salt '*' service.stop <service name>
     N/A cmd N/A net stop name N/A res N/A N/A __salt__ N/A cmd.run cmd python_shell False N/A N/A service was stopped res N/A N/A True N/A attempt N/A range SERVICE_STOP_POLL_MAX_ATTEMPTS N/A N/A N/A N/A status name N/A N/A True N/A N/A N/A log debug Waiting for %s to stop name N/A N/A N/A time sleep SERVICE_STOP_DELAY_SECONDS N/A N/A N/A log warning Giving up on waiting for service `%s` to stop name N/A False N/A restart N/A N/A name N/A N/A N/A 
    Restart the named service

    CLI Example:

    .. code-block:: bash

        salt '*' service.restart <service name>
     N/A N/A salt-minion name N/A N/A N/A create_win_salt_restart_task N/A N/A execute_salt_restart_task N/A N/A N/A stop name N/A start name N/A create_win_salt_restart_task N/A N/A N/A N/A N/A 
    Create a task in Windows task scheduler to enable restarting the salt-minion

    CLI Example:

    .. code-block:: bash

        salt '*' service.create_win_salt_restart_task()
     N/A cmd cmd N/A args /c ping -n 3 127.0.0.1 && net stop salt-minion && net start salt-minion N/A N/A N/A __salt__ N/A task.create_task name restart-salt-minion user_name System force True action_type Execute cmd cmd arguments args trigger_type Once start_date 1975-01-01 start_time 01:00 N/A execute_salt_restart_task N/A N/A N/A N/A N/A 
    Run the Windows Salt restart task

    CLI Example:

    .. code-block:: bash

        salt '*' service.execute_salt_restart_task()
     N/A N/A N/A __salt__ N/A task.run name restart-salt-minion N/A status N/A N/A name sig N/A None N/A N/A 
    Return the status for a service, returns the PID or an empty string if the
    service is running or not, pass a signature to use to find the service via
    ps

    CLI Example:

    .. code-block:: bash

        salt '*' service.status <service name> [service signature]
     N/A cmd N/A sc query name N/A statuses N/A N/A N/A N/A __salt__ N/A cmd.run cmd python_shell False splitlines N/A line statuses N/A N/A N/A RUNNING line N/A N/A True N/A N/A N/A STOP_PENDING line N/A N/A True N/A False N/A getsid N/A N/A name N/A N/A N/A 
    Return the sid for this windows service

    CLI Example:

    .. code-block:: bash

        salt '*' service.getsid <service name>
     N/A cmd N/A sc showsid name N/A lines N/A N/A N/A N/A __salt__ N/A cmd.run cmd python_shell False splitlines N/A line lines N/A N/A N/A SERVICE SID: line N/A N/A comps N/A N/A line split : 1 N/A N/A N/A N/A N/A N/A comps N/A 1 strip N/A N/A N/A N/A AttributeError IndexError N/A N/A None N/A enable N/A N/A name N/A kwargs N/A N/A 
    Enable the named service to start at boot

    CLI Example:

    .. code-block:: bash

        salt '*' service.enable <service name>
     N/A cmd N/A sc config name start= auto N/A N/A N/A N/A __salt__ N/A cmd.retcode cmd python_shell False N/A disable N/A N/A name N/A kwargs N/A N/A 
    Disable the named service to start at boot

    CLI Example:

    .. code-block:: bash

        salt '*' service.disable <service name>
     N/A cmd N/A sc config name start= disabled N/A N/A N/A N/A __salt__ N/A cmd.retcode cmd python_shell False N/A enabled N/A N/A name N/A kwargs N/A N/A 
    Check to see if the named service is enabled to start on boot

    CLI Example:

    .. code-block:: bash

        salt '*' service.enabled <service name>
     N/A cmd N/A sc qc name N/A lines N/A N/A N/A N/A __salt__ N/A cmd.run cmd python_shell False splitlines N/A line lines N/A N/A N/A AUTO_START line N/A N/A True N/A False N/A disabled N/A N/A name N/A N/A N/A 
    Check to see if the named service is disabled to start on boot

    CLI Example:

    .. code-block:: bash

        salt '*' service.disabled <service name>
     N/A cmd N/A sc qc name N/A lines N/A N/A N/A N/A __salt__ N/A cmd.run cmd python_shell False splitlines N/A line lines N/A N/A N/A DEMAND_START line N/A N/A True N/A N/A N/A DISABLED line N/A N/A True N/A False N/A create N/A N/A name binpath DisplayName type start error group tag depend obj password N/A None own demand normal None no None None None kwargs N/A N/A 
    Create the named service.

    .. versionadded:: 2015.8.0

    Required parameters:

    :param name: Specifies the service name returned by the getkeyname operation

    :param binpath: Specifies the path to the service binary file, backslashes must be escaped
      - eg: C:\\path\\to\\binary.exe

    Optional parameters:

    :param DisplayName: the name to be displayed in the service manager

    :param type: Specifies the service type, default is own
      - own (default): Service runs in its own process
      - share: Service runs as a shared process
      - interact: Service can interact with the desktop
      - kernel: Service is a driver
      - filesys: Service is a system driver
      - rec: Service is a file system-recognized driver that identifies filesystems on the computer

    :param start: Specifies the start type for the service
      - boot: Device driver that is loaded by the boot loader
      - system: Device driver that is started during kernel initialization
      - auto: Service that automatically starts
      - demand (default): Service must be started manually
      - disabled: Service cannot be started
      - delayed-auto: Service starts automatically after other auto-services start

    :param error: Specifies the severity of the error
      - normal (default): Error is logged and a message box is displayed
      - severe: Error is logged and computer attempts a restart with last known good configuration
      - critical: Error is logged, computer attempts to restart with last known good configuration, system halts on failure
      - ignore: Error is logged and startup continues, no notification is given to the user

    :param group: Specifies the name of the group of which this service is a member

    :param tag: Specifies whether or not to obtain a TagID from the CreateService call. For boot-start and system-start drivers
      - yes/no

    :param depend: Specifies the names of services or groups that myust start before this service. The names are separated by forward slashes.

    :param obj: Specifies the name of an account in which a service will run. Default is LocalSystem

    :param password: Specifies a password. Required if other than LocalSystem account is used.

    CLI Example:

    .. code-block:: bash

        salt '*' service.create <service name> <path to exe> display_name='<display name>'
     N/A cmd N/A sc create name binpath= binpath type= type start= start error= error N/A N/A DisplayName None N/A N/A N/A N/A cmd extend N/A DisplayName= DisplayName N/A N/A group None N/A N/A N/A N/A cmd extend N/A group= group N/A N/A depend None N/A N/A N/A N/A cmd extend N/A depend= depend N/A N/A obj None N/A N/A N/A N/A cmd extend N/A obj= obj N/A N/A password None N/A N/A N/A N/A cmd extend N/A password= password N/A N/A N/A N/A __salt__ N/A cmd.retcode cmd python_shell False N/A config N/A N/A name bin_path display_name svc_type start_type error group tag depend obj password N/A None None None None None None None None None None kwargs N/A N/A 
    Modify the named service.

    .. versionadded:: 2015.8.8

    Required parameters:

    :param str name: Specifies the service name returned by the getkeyname
    operation


    Optional parameters:

    :param str bin_path: Specifies the path to the service binary file,
    backslashes must be escaped
    - eg: C:\\path\\to\\binary.exe

    :param str display_name: the name to be displayed in the service manager
    Specifies a more descriptive name for identifying the service in user
    interface programs.

    :param str svc_type: Specifies the service type. Acceptable values are:
      - own (default): Service runs in its own process
      - share: Service runs as a shared process
      - interact: Service can interact with the desktop
      - kernel: Service is a driver
      - filesys: Service is a system driver
      - rec: Service is a file system-recognized driver that identifies
        filesystems on the computer
      - adapt: Service is an adapter driver that identifies hardware such as
        keyboards, mice and disk drives

    :param str start_type: Specifies the start type for the service.
    Acceptable values are:
      - boot: Device driver that is loaded by the boot loader
      - system: Device driver that is started during kernel initialization
      - auto: Service that automatically starts
      - demand (default): Service must be started manually
      - disabled: Service cannot be started
      - delayed-auto: Service starts automatically after other auto-services
        start

    :param str error: Specifies the severity of the error if the service
    fails to start. Acceptable values are:
      - normal (default): Error is logged and a message box is displayed
      - severe: Error is logged and computer attempts a restart with last known
        good configuration
      - critical: Error is logged, computer attempts to restart with last known
        good configuration, system halts on failure
      - ignore: Error is logged and startup continues, no notification is given
        to the user

    :param str group: Specifies the name of the group of which this service is a
    member. The list of groups is stored in the registry, in the
    HKLM\System\CurrentControlSet\Control\ServiceGroupOrder subkey. The default
    is null.

    :param str tag: Specifies whether or not to obtain a TagID from the
    CreateService call. For boot-start and system-start drivers only.
    Acceptable values are:
      - yes/no

    :param str depend: Specifies the names of services or groups that must start
    before this service. The names are separated by forward slashes.

    :param str obj: Specifies the name of an account in which a service will run
    or specifies a name of the Windows driver object in which the driver will
    run. Default is LocalSystem

    :param str password: Specifies a password. Required if other than
    LocalSystem account is used.

    :return: True if successful, False if not
    :rtype: bool

    CLI Example:

    .. code-block:: bash

        salt '*' service.config <service name> <path to exe> display_name='<display name>'
     N/A cmd N/A sc config name N/A N/A bin_path None N/A N/A N/A N/A cmd extend N/A binpath= bin_path N/A N/A svc_type None N/A N/A N/A N/A cmd extend N/A type= svc_type N/A N/A start_type None N/A N/A N/A N/A cmd extend N/A start= start_type N/A N/A error None N/A N/A N/A N/A cmd extend N/A error= error N/A N/A display_name None N/A N/A N/A N/A cmd extend N/A DisplayName= display_name N/A N/A group None N/A N/A N/A N/A cmd extend N/A group= group N/A N/A tag None N/A N/A N/A N/A cmd extend N/A tag= tag N/A N/A depend None N/A N/A N/A N/A cmd extend N/A depend= depend N/A N/A obj None N/A N/A N/A N/A cmd extend N/A obj= obj N/A N/A password None N/A N/A N/A N/A cmd extend N/A password= password N/A N/A N/A N/A __salt__ N/A cmd.retcode cmd python_shell False N/A delete N/A N/A name N/A N/A N/A 
    Delete the named service

    CLI Example:

    .. code-block:: bash

        salt '*' service.delete <service name>
     N/A cmd N/A sc delete name N/A N/A N/A N/A __salt__ N/A cmd.retcode cmd python_shell False N/A