PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /proc/self/root/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
IP: 209.182.202.254
Choose File :

Url:
Dir : //proc/self/root/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/pagerduty_user.py

"""
Manage PagerDuty users.

Example:

    .. code-block:: yaml

    ensure bruce test user 1:
        pagerduty.user_present:
            - name: 'Bruce TestUser1'
            - email: bruce+test1@lyft.com
            - requester_id: P1GV5NT

"""


def __virtual__():
    """
    Only load if the pygerduty module is available in __salt__
    """
    if "pagerduty_util.get_resource" in __salt__:
        return "pagerduty_user"
    return (False, "pagerduty_util module could not be loaded")


def present(profile="pagerduty", subdomain=None, api_key=None, **kwargs):
    """
    Ensure pagerduty user exists.
    Arguments match those supported by
    https://developer.pagerduty.com/documentation/rest/users/create.
    """
    return __salt__["pagerduty_util.resource_present"](
        "users", ["email", "name", "id"], None, profile, subdomain, api_key, **kwargs
    )


def absent(profile="pagerduty", subdomain=None, api_key=None, **kwargs):
    """
    Ensure pagerduty user does not exist.
    Name can be pagerduty id, email address, or user name.
    """
    return __salt__["pagerduty_util.resource_absent"](
        "users", ["email", "name", "id"], profile, subdomain, api_key, **kwargs
    )