예제 #1
0
class UserAttributes(BaseSchema):
    fullname = fields.String(required=True, description="The alias or full name of the user.")
    customer = gui_fields.customer_field(
        required=True,
        should_exist=True,
    )
    disable_login = fields.Boolean(
        required=False,
        description="This field indicates if the user is allowed to login to the monitoring.",
    )
    contact_options = fields.Nested(
        ConcreteUserContactOption,
        required=False,
        description="Contact settings for the user",
    )
    idle_timeout = fields.Nested(
        UserIdleOption,
        required=False,
        description="Idle timeout for the user. Per default, the global configuration is used.",
        example={"option": "global"},
    )
    roles = fields.List(
        fields.String(),
        description="The list of assigned roles to the user",
    )
    authorized_sites = fields.List(
        fields.String(),
        description="The names of the sites that this user is authorized to handle",
        required=False,
    )
    contactgroups = fields.List(
        fields.String(),
        description="The contact groups that this user is a member of",
        required=False,
    )
    pager_address = fields.String(
        required=False,
        description="",
    )
    disable_notifications = fields.Nested(
        ConcreteDisabledNotifications,
        required=False,
    )
    language = fields.String(
        required=False,
        description="The language used by the user in the user interface",
    )
    enforce_password_change = fields.Boolean(
        required=False,
        description="This field indicates if the user is forced to change the password on the "
        "next login or access.",
    )
    interface_options = fields.Nested(
        ConcreteUserInterfaceAttributes,
        required=False,
    )
예제 #2
0
class PasswordExtension(BaseSchema):
    ident = fields.String(
        example="pass",
        description="The unique identifier for the password",
    )
    title = fields.String(
        example="Kubernetes login",
        description="The title for the password",
    )
    comment = fields.String(
        example="Kommentar",
        description="A comment for the password",
    )
    documentation_url = fields.String(
        example="localhost",
        attribute="docu_url",
        description="The URL pointing to documentation or any other page.",
    )
    password = fields.String(
        required=True,
        example="password",
        description="The password string",
    )
    owned_by = fields.String(
        example="admin",
        description=
        "The owner of the password who is able to edit, delete and use existing passwords.",
    )

    shared = fields.List(
        fields.String(
            example="all",
            description="The member the password is shared with",
        ),
        example=["all"],
        attribute="shared_with",
        description="The list of members the password is shared with",
    )
    customer = gui_fields.customer_field(
        required=True,
        should_exist=True,
    )