Esempio n. 1
0
 def get_config_policy(self):
     LOG.debug("GetConfigPolicy called")
     return snap.ConfigPolicy([
         ("random"),
         [("int_max", snap.IntegerRule(default=100,
                                       minimum=1,
                                       maximum=10000)),
          ("int_min", snap.IntegerRule(default=0, minimum=0))]
     ])
Esempio n. 2
0
    def get_config_policy(self):
        LOG.debug("GetConfigPolicy called")
        policy = [("intel", "random"),
                  [("int_max",
                    snap.IntegerRule(default=100, minimum=1, maximum=10000)),
                   ("int_min", snap.IntegerRule(default=0, minimum=0))]]
        if self._args.required_config:
            policy[1].append(
                ("required_argument", snap.IntegerRule(required=True)))

        return snap.ConfigPolicy(policy)
Esempio n. 3
0
 def get_config_policy(self):
     return snap.ConfigPolicy([
         None,
         [
             ("server_protocol", snap.StringRule(default='http')),
             ("server_name", snap.StringRule(required=True)),
             ("server_port", snap.IntegerRule(required=True)),
             ("request_uri", snap.StringRule()),
             ("batch_size", snap.IntegerRule(default=1000)),
             ("plugin_running_on",
              snap.StringRule(default=socket.getfqdn())),
         ]
     ], )
Esempio n. 4
0
 def get_config_policy(self):
     policy = [("intel", "streaming", "random"),
               [
                   (
                       "stream_delay",
                       snap.IntegerRule(default=1, required=True),
                   ),
                   (
                       "password",
                       snap.StringRule(default="pass", required=True),
                   ),
               ]]
     return snap.ConfigPolicy(policy)