|
| 1 | +## Export/Import Product Policy Chain |
| 2 | + |
| 3 | +Common description: |
| 4 | +* Export/Import one product's policy chain to/from yaml/json content. |
| 5 | +* Product can be referenced by `id` or `system_name`. |
| 6 | + |
| 7 | +Specific to `export` command: |
| 8 | +* Read only operation on remote product. |
| 9 | +* Command `output` can be `stdout` or file. If not specified by `-f` option, by default, content will be written on `stdout`. |
| 10 | +* Command output format can be `json` or `yaml` using `-o` option. Defaults to `yaml` |
| 11 | + |
| 12 | +Specific to `import` command: |
| 13 | +* Imported content can be `stdin` (by default), file (`-f` option) or URL (`-u` option). |
| 14 | +* Imported content can be `yaml` or `json`. No need to specify the format, the content format will be detected automatically. |
| 15 | +* Imported resource as the source of truth. The existing policy chain will be updated with the imported new one. `SET` semantics implemented. |
| 16 | +* All content validation is delegated to the 3scale API. |
| 17 | + |
| 18 | +### Export Product Policy Chain |
| 19 | + |
| 20 | +```shell |
| 21 | +NAME |
| 22 | + export - export product policy chain |
| 23 | + |
| 24 | +USAGE |
| 25 | + 3scale policies export [opts] <remote> |
| 26 | + <product> |
| 27 | + |
| 28 | +DESCRIPTION |
| 29 | + export product policy chain |
| 30 | + |
| 31 | +OPTIONS |
| 32 | + -f --file=<value> Write to file instead of stdout |
| 33 | + -o --output=<value> Output format. One of: json|yaml |
| 34 | +``` |
| 35 | + |
| 36 | +### Import Product Policy Chain |
| 37 | + |
| 38 | +```shell |
| 39 | +NAME |
| 40 | + import - import product policy chain |
| 41 | + |
| 42 | +USAGE |
| 43 | + 3scale policies import [opts] <remote> |
| 44 | + <product> |
| 45 | + |
| 46 | +DESCRIPTION |
| 47 | + import product policy chain |
| 48 | + |
| 49 | +OPTIONS |
| 50 | + -f --file=<value> Read from file |
| 51 | + -u --url=<value> Read from url |
| 52 | +``` |
| 53 | + |
| 54 | +### Export policy chain to a file in yaml |
| 55 | + |
| 56 | +```shell |
| 57 | +$ 3scale policies export -f policies.yaml -o yaml remote_name product_name |
| 58 | +``` |
| 59 | + |
| 60 | +### Import policy chain from a file |
| 61 | + |
| 62 | +```shell |
| 63 | +$ 3scale policies import -f plan.yaml remote_name product_name |
| 64 | +``` |
| 65 | + |
| 66 | +### Import policy chain from URI |
| 67 | + |
| 68 | +```shell |
| 69 | +$ 3scale policies import -f http[s]://domain/resource/path.yaml remote_name product_name |
| 70 | +``` |
0 commit comments