Tyk Sync Commands
Last updated:
In this document, we will cover the various commands available in Tyk Sync.
Dump Command
| Aspect | Details |
|---|---|
| Command | tyk-sync dump |
| Usage | tyk-sync dump -d DASHBOARD_URL [-s SECRET] [-t PATH] |
| Flags | -d, --dashboard DASHBOARD_URL: Tyk Dashboard URL (required)-h, --help: Help for the dump command-t, --target PATH: Target directory for output files (optional)-s, --secret SECRET: API secret for Dashboard access (optional)--apis IDS: Specific API IDs to dump--oas-apis IDS: Specific OAS API IDs to dump--policies IDS: Specific policy IDs to dump--templates IDS: Specific template IDs to dump |
| Example | tyk-sync dump --dashboard http://tyk-dashboard:3000 --secret your-secret |
| Example | tyk-sync dump --dashboard http://tyk-dashboard:3000 --secret your-secret --target /path/to/backup --apis c2ltcGxlLWdyYXBoLWRldi90eWthcGktc2NoZW1h,baa5d2b65f1b45385dac3aeb658fa04c |
Examples Command
| Aspect | Details |
|---|---|
| Command | tyk-sync examples |
| Usage | tyk-sync examples [flags]tyk-sync examples [command] |
| Subcommands | publish: Publish a specific exampleshow: Show details of a specific example |
| Flags | -h, --help: Help for examples command |
| Example | tyk-sync examples |
Examples Show Command
| Aspect | Details |
|---|---|
| Command | tyk-sync examples show |
| Usage | tyk-sync examples show [flags] |
| Flags | -h, --help: Help for show command-l, --location string: Location of the example |
| Example | tyk-sync examples show --location="udg/vat-checker" |
Examples Publish Command
| Aspect | Details |
|---|---|
| Command | tyk-sync examples publish |
| Usage | tyk-sync examples publish [flags] |
| Flags | -b, --branch string: Branch to use (default “refs/heads/main”)-d, --dashboard string: Dashboard target URL-g, --gateway string: Gateway target URL-h, --help: Help for publish command-k, --key string: Key file location for auth-l, --location string: Location of the example-s, --secret string: API secret--test: Use test publisher, output to stdio |
| Example | tyk-sync examples publish -d="http://localhost:3000" -s="b2d420ca5302442b6f20100f76de7d83" -l="udg/vat-checker" |
Publish Command
| Aspect | Details |
|---|---|
| Command | tyk-sync publish |
| Usage | tyk-sync publish {-d DASHBOARD_URL | -g GATEWAY_URL} [-s SECRET] [-b BRANCH] [-k SSHKEY] [-o ORG_ID] REPOSITORY_URLtyk-sync publish {-d DASHBOARD_URL | -g GATEWAY_URL} [-s SECRET] [-o ORG_ID] -p PATH |
| Flags | -b, --branch BRANCH: Git branch (default “refs/heads/master”)-d, --dashboard DASHBOARD_URL: Dashboard URL-g, --gateway GATEWAY_URL: Gateway URL-h, --help: Help for publish command-k, --key SSHKEY: SSH key file location-p, --path PATH: Source file directory-s, --secret SECRET: API secret--no-delete: Skip deletion of resources during synchronisation --test: Use test publisher--allow-duplicate-listenpaths: Allow duplicate listen paths--apis IDS: Specific API IDs to publish--oas-apis IDS: Specific OAS API IDs to publish--policies IDS: Specific policy IDs to publish--templates IDS: Specific template IDs to publish |
| Example | tyk-sync publish -d http://tyk-dashboard:3000 -s your-secret -p /app/data --apis 726e705e6afc432742867e1bd898cb23 |
| Example | tyk-sync publish -d http://tyk-dashboard:3000 -s your-secret -b develop https://github.com/your-repo/your-apis |
Sync Command
| Aspect | Details |
|---|---|
| Command | tyk-sync sync |
| Usage | tyk-sync sync {-d DASHBOARD_URL | -g GATEWAY_URL} [-s SECRET] [-b BRANCH] [-k SSHKEY] [-o ORG_ID] REPOSITORY_URLtyk-sync sync {-d DASHBOARD_URL | -g GATEWAY_URL} [-s SECRET] [-o ORG_ID] -p PATH |
| Flags | -b, --branch BRANCH: Git branch (default “refs/heads/master”)-d, --dashboard DASHBOARD_URL: Dashboard URL-g, --gateway GATEWAY_URL: Gateway URL-h, --help: Help for sync command-k, --key SSHKEY: SSH key file location-o, --org ORG_ID: Override organization ID-p, --path PATH: Source file directory-s, --secret SECRET: API secret--test: Use test publisher--apis IDS: Specific API IDs to sync (to be deprecated)--policies IDS: Specific policy IDs to sync (to be deprecated) |
| Example | tyk-sync sync -d http://tyk-dashboard:3000 -s your-secret https://github.com/your-repo/your-apis |
| Example | tyk-sync sync -d http://tyk-dashboard:3000 -s your-secret -p /path/to/your/apis |
Update Command
| Aspect | Details |
|---|---|
| Command | tyk-sync update |
| Usage | tyk-sync update {-d DASHBOARD_URL | -g GATEWAY_URL} [-s SECRET] [-b BRANCH] [-k SSHKEY] [-o ORG_ID] REPOSITORY_URLtyk-sync update {-d DASHBOARD_URL | -g GATEWAY_URL} [-s SECRET] [-o ORG_ID] -p PATH |
| Flags | -b, --branch BRANCH: Git branch (default “refs/heads/master”)-d, --dashboard DASHBOARD_URL: Dashboard URL-g, --gateway GATEWAY_URL: Gateway URL-h, --help: Help for update command-k, --key SSHKEY: SSH key file location-p, --path PATH: Source file directory-s, --secret SECRET: API secret--test: Use test publisher--apis IDS: Specific API IDs to update--oas-apis IDS: Specific OAS API IDs to update--policies IDS: Specific policy IDs to update--templates IDS: Specific template IDs to update |
| Example | tyk-sync update -d http://tyk-dashboard:3000 -s your-secret -p /app/data --apis 726e705e6afc432742867e1bd898cb23 |
| Example | tyk-sync update -d http://tyk-dashboard:3000 -s your-secret -b develop https://github.com/your-repo/your-apis |