@rest_initialiser(cluster_init_check=True, version_check=True)
def execute(self, opts):
    flags = sum([opts.list_events, opts.get_settings, opts.set_settings])
    if (flags != 1):
        _exit_if_errors(['One of the following is required: --list-filterable-events, --get-settings or --set'])
    if opts.list_events:
        (descriptors, errors) = self.rest.get_id_descriptors()
        _exit_if_errors(errors)
        if (opts.output == 'json'):
            print(json.dumps(descriptors, indent=4))
            return
        self.format_descriptors_in_table(descriptors)
    elif opts.get_settings:
        (audit_settings, errors) = self.rest.get_audit_settings()
        _exit_if_errors(errors)
        if (opts.output == 'json'):
            print(json.dumps(audit_settings, indent=4))
            return
        (descriptors, errors) = self.rest.get_id_descriptors()
        _exit_if_errors(errors)
        self.format_audit_settings(audit_settings, descriptors)
    elif opts.set_settings:
        if (not (opts.enabled or opts.log_path or opts.rotate_interval or opts.rotate_size or (opts.disable_events is not None) or (opts.disabled_users is not None))):
            _exit_if_errors(['At least one of [--audit-enabled, --audit-log-path, --audit-log-rotate-interval, --audit-log-rotate-size, --disabled-users, --disable-events] is required with --set'])
        if (opts.enabled == '1'):
            opts.enabled = 'true'
        elif (opts.enabled == '0'):
            opts.enabled = 'false'
        (_, errors) = self.rest.set_audit_settings(opts.enabled, opts.log_path, opts.rotate_interval, opts.rotate_size, opts.disable_events, opts.disabled_users)
        _exit_if_errors(errors)
        _success('Audit settings modified')
@rest_initialiser(cluster_init_check=True, version_check=True)
def execute(self, opts):
    flags = sum([opts.list_events, opts.get_settings, opts.set_settings])
    if (flags != 1):
        _exit_if_errors(['One of the following is required: --list-filterable-events, --get-settings or --set'])
    if opts.list_events:
        (descriptors, errors) = self.rest.get_id_descriptors()
        _exit_if_errors(errors)
        if (opts.output == 'json'):
            print(json.dumps(descriptors, indent=4))
            return
        self.format_descriptors_in_table(descriptors)
    elif opts.get_settings:
        (audit_settings, errors) = self.rest.get_audit_settings()
        _exit_if_errors(errors)
        if (opts.output == 'json'):
            print(json.dumps(audit_settings, indent=4))
            return
        (descriptors, errors) = self.rest.get_id_descriptors()
        _exit_if_errors(errors)
        self.format_audit_settings(audit_settings, descriptors)
    elif opts.set_settings:
        if (not (opts.enabled or opts.log_path or opts.rotate_interval or opts.rotate_size or (opts.disable_events is not None) or (opts.disabled_users is not None))):
            _exit_if_errors(['At least one of [--audit-enabled, --audit-log-path, --audit-log-rotate-interval, --audit-log-rotate-size, --disabled-users, --disable-events] is required with --set'])
        if (opts.enabled == '1'):
            opts.enabled = 'true'
        elif (opts.enabled == '0'):
            opts.enabled = 'false'
        (_, errors) = self.rest.set_audit_settings(opts.enabled, opts.log_path, opts.rotate_interval, opts.rotate_size, opts.disable_events, opts.disabled_users)
        _exit_if_errors(errors)
        _success('Audit settings modified')