{"id":18825334,"url":"https://github.com/grycap/onetrigger","last_synced_at":"2026-01-20T23:30:17.894Z","repository":{"id":57448846,"uuid":"166040325","full_name":"grycap/onetrigger","owner":"grycap","description":"Trigger webhooks by Onedata events","archived":false,"fork":false,"pushed_at":"2019-06-05T16:28:03.000Z","size":57,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-01-31T17:05:58.345Z","etag":null,"topics":["events","onedata","webhooks"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grycap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-16T12:56:20.000Z","updated_at":"2019-05-24T12:15:22.000Z","dependencies_parsed_at":"2022-09-17T16:11:11.815Z","dependency_job_id":null,"html_url":"https://github.com/grycap/onetrigger","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grycap%2Fonetrigger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grycap%2Fonetrigger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grycap%2Fonetrigger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grycap%2Fonetrigger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grycap","download_url":"https://codeload.github.com/grycap/onetrigger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239763665,"owners_count":19692800,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["events","onedata","webhooks"],"created_at":"2024-11-08T00:59:08.696Z","updated_at":"2026-01-20T23:30:17.842Z","avatar_url":"https://github.com/grycap.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OneTrigger\n\n[![Docker Build Status](https://img.shields.io/docker/cloud/build/grycap/onetrigger.svg)](https://hub.docker.com/r/grycap/onetrigger/) [![Build Status](https://travis-ci.org/grycap/onetrigger.svg?branch=master)](https://travis-ci.org/grycap/onetrigger) [![PyPi version](https://img.shields.io/pypi/v/onetrigger.svg)](https://pypi.org/project/onetrigger/) [![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)\n\nA command-line tool to detect Onedata file events in order to trigger a webhook.\n\n## Installation\n\nOneTrigger requires `python3` and the `python3-pip` tool. A package is available at the Python Package Index (PyPI) under the name `onetrigger`, so you can easily install it executing:\n\n```bash\npip3 install onetrigger\n```\n\nYou can also download a binary in the [releases](https://github.com/grycap/onetrigger/releases) section.\n\n## Usage\n\nParameters can be passed via arguments or environment variables. All available commands and his parameters are described below:\n\n### Command `run`\n\nSubscribe to file events.\n\n| Argument                             | Environment variable   | Description                                                                       |\n|--------------------------------------|------------------------|-----------------------------------------------------------------------------------|\n| `-H HOST`, `--oneprovider-host HOST` | `ONEPROVIDER_HOST`     | Oneprovider hostname or IP.                                                       |\n| `-t TOKEN`, `--token TOKEN`          | `ONEDATA_ACCESS_TOKEN` | Onedata access token.                                                             |\n| `-s SPACE`, `--space SPACE`          | `ONEDATA_SPACE`        | Onedata space.                                                                    |\n| `-w WEBHOOK`, `--webhook WEBHOOK`    | `ONETRIGGER_WEBHOOK`   | Webhook to send events.                                                           |\n| `-f FOLDER`, `--folder FOLDER`       | `ONEDATA_SPACE_FOLDER` | Folder to listen events (Optional).                                               |\n| `-i`, `--insecure`                   | `ONEPROVIDER_INSECURE` | Connect to a provider without a trusted certificate (Optional). Default: `False`. |\n\n### Command `list-spaces`\n\nList your available spaces in Oneprovider.\n\n| Argument                             | Environment variable   | Description                                                                       |\n|--------------------------------------|------------------------|-----------------------------------------------------------------------------------|\n| `-H HOST`, `--oneprovider-host HOST` | `ONEPROVIDER_HOST`     | Oneprovider hostname or IP.                                                       |\n| `-t TOKEN`, `--token TOKEN`          | `ONEDATA_ACCESS_TOKEN` | Onedata access token.                                                             |\n| `-i`, `--insecure`                   | `ONEPROVIDER_INSECURE` | Connect to a provider without a trusted certificate (Optional). Default: `False`. |\n\n### Examples\n\n#### Subscribing to file events\n\n```bash\nonetrigger run -H example.com -t xxxxx -s my-onedata-space -w http://example.com/webhook -f my-folder\n```\n\n#### Deploy on Kubernetes\n\nOneTrigger can be deployed on Kubernetes using our public Docker Hub image [grycap/onetrigger](https://hub.docker.com/r/grycap/onetrigger) by applying a YAML file like this:\n\n```yaml\napiVersion: apps/v1beta1\nkind: Deployment\nmetadata:\n  name: onetrigger\nspec:\n  replicas: 1\n    spec:\n      containers:\n      - name:  onetrigger\n        image: grycap/onetrigger:latest\n        imagePullPolicy: Always\n        env:\n        - name: ONEPROVIDER_HOST\n          value: \"example.com\"\n        - name: ONEDATA_ACCESS_TOKEN\n          value: \"xxxxx\"\n        - name: ONEDATA_SPACE\n          value: \"my-onedata-space\"\n        - name: ONETRIGGER_WEBHOOK\n          value: \"http://example.com/webhook\"\n        - name: ONEDATA_SPACE_FOLDER\n          value: \"my-folder\"\n```\n\n## Event format\n\nWhen a new file is created inside the space (or the specified folder) a JSON formatted event is sent to the webhook following the structure of the example shown below:\n\n```json\n{\n    \"Key\": \"/my-onedata-space/files/file.txt\",\n    \"Records\": [\n        {\n            \"objectKey\": \"file.txt\",\n            \"objectId\": \"0000034500046EE9C67756964233836666330363031303664303964623739666562393165336632306232613736236664323861626330656664643566313938313333336633356232333838623137\",\n            \"eventTime\": \"2019-02-07T09:51:04.347823\",\n            \"eventSource\": \"OneTrigger\"\n        }\n    ]\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrycap%2Fonetrigger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrycap%2Fonetrigger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrycap%2Fonetrigger/lists"}