Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Specify the additional files in the pipelet upload command. For Example:

    Code Block
    languagebash
    titlePipelet Upload Command
    pipelet upload \
    --data-file 'resource.txt' \
    --cluster <cluster> \
    --token <your_token> \
    'pipelet.py' \
    'TestPipelet'

    In this example, we are uploading a file "resource.txt" along with the pipelet.

  2. Access the contents of the file(s) from within the pipelet

    Code Block
    languagepy
    titlePipelet File
    from squirro.sdk import require, PipeletV1
    
    @require('files')
    class TestPipelet(PipeletV1):
    	
        def consume(self, item):
    
            with self.files.get_file('resource.txt') as f:
                data = f.read()

...