def get_config_policy(self):
     """
     Creates snap plugin policy
     @return: snap policy
     """
     LOG.debug("GetConfigPolicy called")
     return snap.ConfigPolicy()
 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))]
     ])
Exemple #3
0
    def get_config_policy(self):
        """Get's the config policy

        The config policy for this plugin defines a string configuration item
        `instance-id` with the default value of `xyz-abc-qwerty`.
        """
        return snap.ConfigPolicy([
            None, [("instance-id", snap.StringRule(default="xyz-abc-qwerty"))]
        ])
 def get_config_policy(self):
     return snap.ConfigPolicy(
         [
             ("diamond"),
             [
                 ("config", snap.StringRule(required=True)),
                 ("collectors_path", snap.StringRule())
             ]
         ]
     )
Exemple #5
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)
Exemple #6
0
 def get_config_policy(self):
     return snap.ConfigPolicy(
         [
             None,
             [
                 (
                     "some-config",
                     snap.StringRule(default="some-value")
                 )
             ]
         ],
     )
Exemple #7
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)
 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())),
         ]
     ], )
Exemple #9
0
 def get_config_policy(self):
     LOG.debug("GetConfigPolicy called")
     return snap.ConfigPolicy(
         [
             ("ironic-cups"),
             [
                 (
                     "transport_url",
                     snap.StringRule(
                         default='rabbit://*****:*****@rabbit:5672/',
                         required=True)
                 ),
             ]
         ]
     )
Exemple #10
0
    def get_config_policy(self):
        policy = [("acme", "sk8", "matix"),
                  [
                      (
                          "password",
                          snap.StringRule(default="grace", required=True),
                      ),
                      (
                          "user",
                          snap.StringRule(default="kristy", required=True),
                      ),
                  ]]

        if self._args.require_config:
            policy[1].append(("database", snap.StringRule(required=True)))

        return snap.ConfigPolicy(policy)
Exemple #11
0
    def get_config_policy(self):
        """As the name suggests this method returns the config policy for the
        plugin.

        This method is called by the Snap deamon when the plugin is loaded.
        A config policy describes the configuration key/value pairs that are
        required, optional, what the value type is and if there is a default
        value.

        In this example we returning a config policy that contains a `string`
        config item describing the location of the file that will be published
        to.  The 'file' config item has a default which the user may choose to
        override.

        Returns:
            `snap_plugin.v1.GetConfigPolicyReply`

        """
        LOG.debug("GetConfigPolicy called")
        return snap.ConfigPolicy(
            [None, [("file", snap.StringRule(default="/tmp/snap-py.out"))]], )
 def get_config_policy(self):
     LOG.debug("GetConfigPolicy called")
     return snap.ConfigPolicy()
 def get_config_policy(self):
     return snap.ConfigPolicy()