github.com/argoproj/argo-events@v1.9.1/docs/eventsources/setup/sftp.md (about)

     1  # SFTP
     2  
     3  SFTP event-source polls an SFTP server to identify changes and helps sensor trigger workloads.
     4  
     5  ## Event Structure
     6  
     7  The structure of an event dispatched by the event-source over the eventbus looks like following,
     8  
     9          {
    10              "context": {
    11                "type": "type_of_event_source",
    12                "specversion": "cloud_events_version",
    13                "source": "name_of_the_event_source",
    14                "id": "unique_event_id",
    15                "time": "event_time",
    16                "datacontenttype": "type_of_data",
    17                "subject": "name_of_the_configuration_within_event_source"
    18              },
    19              "data": {
    20                  "name": "Relative path to the file or directory",
    21                  "op": "File operation that triggered the event" // Create, Remove
    22              }
    23          }
    24  
    25  ## Specification
    26  
    27  SFTP event-source specification is available [here](https://github.com/argoproj/argo-events/blob/master/api/event-source.md#sftpeventsource).
    28  
    29  ## Setup
    30  
    31  1. Create the event source by running the following command.
    32  
    33          kubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/stable/examples/event-sources/sftp.yaml
    34  
    35  1. The event source has configuration to poll the sftp server every 10 seconds for `test-data` directory and file(s) called `x.txt`.
    36  
    37  1. Create the sensor by running the following command.
    38  
    39          kubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/stable/examples/sensors/sftp.yaml
    40  
    41  1. Log into the event-source pod by running following command.
    42  
    43          kubectl -n argo-events exec -it <event-source-pod-name> -c sftp-events -- /bin/bash
    44  
    45  1. Create a file called `x.txt` under `test-data` directory on the SFTP server.
    46  
    47  1. Once you create file `x.txt`, the sensor will trigger argo workflow.  Run `argo list` to find the workflow.
    48  
    49  1. For real-world use cases, you should use PersistentVolumeClaim.
    50  
    51  ## Troubleshoot
    52  
    53  Please read the [FAQ](https://argoproj.github.io/argo-events/FAQ/).