Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
--file and --json-file documentation
  • Loading branch information
outscale-mgo committed Mar 28, 2024
1 parent 01e8e67 commit 94987da
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,28 @@ show debug information (HTTP info, and json send to the api)
oapi-cli --verbose ReadVms
```

For complex argument, you can store argument in file using `--file`:
```bash
echo -n false > false.txt
./oapi-cli ReadVms --DryRun --file false.txt
```
Here `-DryRun` argument will be "false", as it is what is inside false.txt.


For CreatePolicy, you should use `--jsonstr-file`.

As CreatePolicy require Document to be a string contaning a jsons, if you want to pass the policy directly to oapi-cli, `--Document` argument should look like this:
```
"Document": "{\"Statement\": [ {\"Effect\": \"Allow\", \"Action\": [\"*\"], \"Resource\": [\"*\"]} ]}"
```

With `--jsonstr-file`, you can simply create a json containing your policy, and pass it to oapi-cli:

```bash
CreatePolicy --PolicyName please --Document --jsonstr-file ./policy.json
```


*Note that with osc-cli, you need to add `api`, here, as we only support outscale api, this is remove*

# Autocompletion
Expand Down

0 comments on commit 94987da

Please sign in to comment.