Skip to content

Commit

Permalink
add doc
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvaingaudan committed Jul 31, 2024
1 parent 0fcd802 commit 0912aab
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 32 deletions.
2 changes: 1 addition & 1 deletion arlas/cli/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def __get_fields__(origin: list[str], properties: dict[str:dict]):
return fields

def __arlas__(arlas: str, suffix, post=None, put=None, delete=None, service=Services.arlas_server):
configuration: ARLAS = Configuration.settings.arlas.get(arlas, {})
configuration: ARLAS = Configuration.settings.arlas.get(arlas, None)
if configuration is None:
print("Error: arlas configuration ({}) not found among [{}] for {}.".format(arlas, ", ".join(Configuration.settings.arlas.keys()), service.name), file=sys.stderr)
exit(1)
Expand Down
59 changes: 29 additions & 30 deletions docs/docs/arlas_cloud.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
To configure `arlas_cli` for your cloud.arlas.io account:

First, set the following environment variables:
First, set the following environment variables by changing appropriately `SET_THIS_VALUE`:
```shell
export MY_ORGANIZATION=my-organization
export ARLAS_USER=my-login
export ARLAS_PWD=my-password
export ELASTIC_ENDPOINT=http://localhost:9200
export ELASTIC_USER=my-login
export ELASTIC_PWD=my-password
export MY_ORGANIZATION=SET_THIS_VALUE
export ARLAS_USER=SET_THIS_VALUE
export ARLAS_PWD=SET_THIS_VALUE
export ELASTIC_ENDPOINT=SET_THIS_VALUE
export ELASTIC_USER=SET_THIS_VALUE
export ELASTIC_PWD=SET_THIS_VALUE
```

<!-- termynal -->
```shell
> python3.10 -m arlas.cli.cli confs \
> arlas_cli confs \
create cloud.arlas.io \
--server "https://cloud.arlas.io/arlas/server" \
--headers "arlas-org-filter:${MY_ORGANIZATION}" \
Expand All @@ -27,31 +27,30 @@ export ELASTIC_PWD=my-password
--elastic-headers "Content-Type:application/json" \
--elastic-login "${ELASTIC_USER}" \
--elastic-password "${ELASTIC_PWD}" \
--elastic-headers "Content-Type: application/json" \
--elastic-headers "Content-Type:application/json" \
--auth-headers "Content-Type:application/json;charset=utf-8" \
--persistence "https://cloud.arlas.io/arlas/persistence" \
--persistence-headers "Content-Type: application/json" \
--persistence-headers "Content-Type:application/json" \
--auth-arlas-iam
```

Check the configuration exists:
<!-- termynal -->
```shell
> arlas_cli confs list
```

python3.10 -m arlas.cli.cli --config-file /tmp/arlas_cli.yaml confs \
create cloud.arlas.io \
--server "https://cloud.arlas.io/arlas/server" \
--headers "arlas-org-filter:XXXXXXX" \
--headers "Content-Type:application/json" \
--no-allow-delete \
--auth-token-url https://cloud.arlas.io/arlas/iam/session \
--auth-login "XXXXXXX" \
--auth-password "$XXXXXXX" \
--auth-headers "Content-Type:application/json;charset=utf-8" \
--auth-org "XXXXXXX" \
--elastic "XXXXXXX" \
--elastic-headers "Content-Type:application/json" \
--elastic-login "XXXXXXX" \
--elastic-password "XXXXXXX" \
--elastic-headers "Content-Type: application/json" \
--auth-headers "Content-Type:application/json;charset=utf-8" \
--persistence "https://cloud.arlas.io/arlas/persistence" \
--persistence-headers "Content-Type: application/json" \
--auth-arlas-iam
You can now try the configuration:
<!-- termynal -->
```shell
> arlas_cli collections --config cloud.arlas.io list
```

<!-- termynal -->
```shell
> arlas_cli indices --config cloud.arlas.io list
```
<!-- termynal -->
```shell
> arlas_cli persist --config cloud.arlas.io groups config.json
```
2 changes: 1 addition & 1 deletion docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ nav:
- Persistence: persist.md
- Configurations: confs.md
- Configuration data model: model/model.md

- Configuring ARLAS Cloud: arlas_cloud.md

plugins:
- termynal:
Expand Down

0 comments on commit 0912aab

Please sign in to comment.