Close
    logoCloudomation Docs

    File

    class resources.file.File

    Base class: Resource

    A file which is stored in Cloudomation.

    To store data in a file there are three additional arguments for the save() method available:

    :py:obj:flow_api.file.File

    import flow_api
    def handler(system: flow_api.System, this: flow_api.Execution):
    # store a text (utf8 string)
    system.file('my-file.txt').save_text_content('text content')
    # read as base64
    assert system.file('my-file.txt').get_base64_content() == 'dGV4dCBjb250ZW50'
    # store bytes data
    system.file('my-file.dat').save_bytes_content(b'bytes data')
    # read as text
    assert system.file('my-file.dat').get_text_content() == 'bytes data'
    # store a base64 encoded string
    system.file('my-file.ext').save_base64_content('Q2xvdWRvbWF0aW9u')
    # read as bytes
    system.file('my-file.ext').get_bytes_content() == b'Cloudomation'
    PropertyDescriptionType
    idUUID()
    contentThe binary content of the file.BYTEA()
    size_bytesBigInteger()
    Previous
    Connection
    Next
    Flow