Skip to content

Commit c4726a8

Browse files
ODM-11357: sdk bearer token support (#25)
1 parent 94dcbd3 commit c4726a8

File tree

7 files changed

+47
-15
lines changed

7 files changed

+47
-15
lines changed

docs/usage/tools/odm-sdk/configuration.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
### Configure
1010

11-
1. Obtain a token by logging in to ODM and clicking on the profile link under the username.
11+
1. Retrieve an Access (Bearer) Token, or obtain an API token by logging into ODM and clicking the profile link under
12+
the username.
1213

1314
See an example for Public user below:
1415

@@ -25,11 +26,12 @@
2526

2627
3. Type ‘add’ to enter a new user, enter an alias for the user.
2728
4. Enter the host name, which should be of the format: https://domain_name/.
28-
5. Then select authentication method by token (1) and input the content of the token you received in step 2:
29+
5. Then select suitable authentication method (1 or 2) and input the content of the token you received in step 1:
2930

3031
```shell
3132
1) by token
32-
2) by email and password
33+
2) by access token
34+
3) by email and password
3335
Select authentication: 1
3436
Host: https://domain_name/
3537
Please specify Genestack API token for "my_user":

docs/usage/tools/odm-sdk/terminal/dictionaries-and-ontologies/loading-new-ontology.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This article explains how to load custom dictionaries (ontologies) in ODM.
77
## Requirements
88

99
- Configured odm-sdk. See [Configured odm-sdk](../../configuration.md)
10+
- User should have Bearer Token or API token. See [Getting a Genestack API token](https://odm-user-guide.readthedocs.io/en/latest/doc-odm-user-guide/getting-a-genestack-api-token.html#token-label)
1011
- A file describing dictionaries, e.g.: [dictionaries.json](loading-new-ontology/dictionaries.json)
1112
- One or more dictionaries in CSV, JSON, OWL, OBO or TTL formats, hosted at FTP or HTTP web addresses, see [dictionary example](http://purl.obolibrary.org/obo/go.owl)
1213

@@ -28,6 +29,12 @@ Multiple dictionaries can be supplied by repeating the section in curly brackets
2829

2930
## Running the command to import dictionaries
3031

32+
To explore the full list of supported arguments use the following command:
33+
34+
```bash
35+
odm-update-dictionary -h
36+
```
37+
3138
Run the following command from your terminal:
3239

3340
```shell

docs/usage/tools/odm-sdk/terminal/study/curation-script.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,19 @@ assist in the matching process.
1010
## Requirements
1111

1212
- Configured odm-sdk. See [Configured odm-sdk](../../configuration.md)
13-
- The user should be a member of Curator group and have API token. See [Getting a Genestack API token](https://odm-user-guide.readthedocs.io/en/latest/doc-odm-user-guide/getting-a-genestack-api-token.html#token-label)
13+
- The user should be a member of Curator group and have Bearer Token or API token. See [Getting a Genestack API token](https://odm-user-guide.readthedocs.io/en/latest/doc-odm-user-guide/getting-a-genestack-api-token.html#token-label)
1414
- File with curation rules. How to correctly write such file is described [below](#metadata-mapping-rules).
1515

1616
**Example**: [rules.json](curation-script/rules.json) written for sample metadata [samples.tsv](curation-script/samples.tsv).
1717

1818
## Curation script usage
1919

20+
To explore the full list of supported arguments use the following command:
21+
22+
```bash
23+
odm-curate-study -h
24+
```
25+
2026
Curation can be carried out by running the Python metadata curation script `odm-curate-study`.
2127
This can be used to perform automated curation of metadata associated with experiments and assays on Genestack.
2228
The script takes as input the accessions of Genestack study or studies which should contain the samples to be curated.
@@ -34,14 +40,6 @@ Space is used as a separator in case of multiple studies. Example:
3440
odm-curate-study --rules rules.json GSF000100 GSF000200 -H GENESTACK_ENDPOINT_ADDR
3541
```
3642

37-
If the template specified for the curation differs from the template already associated with the study then the study is
38-
not curated and a warning is given in the logs.
39-
To explore the full list of supported arguments use the following command:
40-
41-
```bash
42-
odm-curate-study -h
43-
```
44-
4543
You can test a curation rule before applying it with the --dry-run parameter. This will connect to the server and report
4644
matches in the task output log (see later) but not actually change any data.
4745

docs/usage/tools/odm-sdk/terminal/study/deleting-study.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@
33
## Requirements
44

55
- Configured odm-sdk. See [Configured odm-sdk](../../configuration.md)
6-
- The user should have the "Manage organisation permission and have API token. See [Getting a Genestack API token](https://odm-user-guide.readthedocs.io/en/latest/doc-odm-user-guide/getting-a-genestack-api-token.html#token-label)
6+
- The user should have the "Manage organisation" permission and have Bearer Token or API token. See [Getting a Genestack API token](https://odm-user-guide.readthedocs.io/en/latest/doc-odm-user-guide/getting-a-genestack-api-token.html#token-label)
77

88
## Instructions
99

10+
To explore the full list of supported arguments use the following command:
11+
12+
```bash
13+
odm-delete-study -h
14+
```
15+
1016
!!!warning Warning
1117

1218
1. Only users with the “Manage organisation” permission can delete studies.

docs/usage/tools/odm-sdk/terminal/study/sharing-study.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@
33
## Requirements
44

55
- Configured odm-sdk. See [Configured odm-sdk](../../configuration.md)
6-
- The user should be a member of Curator group and have API token. See [Getting a Genestack API token](https://odm-user-guide.readthedocs.io/en/latest/doc-odm-user-guide/getting-a-genestack-api-token.html#token-label)
6+
- The user should be a member of Curator group and have Bearer Token or API token. See [Getting a Genestack API token](https://odm-user-guide.readthedocs.io/en/latest/doc-odm-user-guide/getting-a-genestack-api-token.html#token-label)
77

88
## Instructions
99

10+
To explore the full list of supported arguments use the following command:
11+
12+
```bash
13+
odm-share-study -h
14+
```
15+
1016
!!!note "Please note that there are several limitations:"
1117

1218
1. The script should be launched under the study owner user.

docs/usage/tools/odm-sdk/terminal/templates/create-or-update-template.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,18 @@ Loaded templates are available to all users on the instance.
77
## Requirements
88

99
- Configured odm-sdk. See [Configured odm-sdk](../../configuration.md)
10-
- The user should have the "Set up templates" permission and API token. See [Getting a Genestack API token](https://odm-user-guide.readthedocs.io/en/latest/doc-odm-user-guide/getting-a-genestack-api-token.html#token-label)
10+
- The user should have the "Set up templates" permission and Bearer Token or API token. See [Getting a Genestack API token](https://odm-user-guide.readthedocs.io/en/latest/doc-odm-user-guide/getting-a-genestack-api-token.html#token-label)
1111
- A template settings json file, e.g.: [default_ODM_template_settings.json](default_ODM_template_settings.json)
1212
- A template json file, e.g.: [Default_ODM_Template.json](Default_ODM_Template.json)
1313

1414
## Instructions
1515

16+
To explore the full list of supported arguments use the following command:
17+
18+
```bash
19+
odm-update-template -h
20+
```
21+
1622
1. Download or create a template json file (see Requirements). Templates are collections of fields with rules determining whether the field is required, which dictionary to use (if any) etc.
1723

1824
```text

docs/usage/tools/odm-sdk/terminal/templates/delete-template.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ This article describes how to delete templates in ODM.
55
## Requirements
66

77
- Configured odm-sdk. See [Configured odm-sdk](../../configuration.md)
8+
- The user should have the "Manage organisation" permission and have Bearer Token or API token. See [Getting a Genestack API token](https://odm-user-guide.readthedocs.io/en/latest/doc-odm-user-guide/getting-a-genestack-api-token.html#token-label)
89

910
!!!warning
1011

@@ -15,6 +16,12 @@ This article describes how to delete templates in ODM.
1516

1617
## Instructions
1718

19+
To explore the full list of supported arguments use the following command:
20+
21+
```bash
22+
odm-delete-template -h
23+
```
24+
1825
1. Before a template deletion all the studies which have this template set should be manually changed: another template which is not going to be deleted should be applied (for example, Default template). Apply template manually via the UI.
1926
2. Run delete template script and follow its login instructions, replacing the host name with the name of the instance the script will apply to. The script will print “Success” or an error stacktrace in case of an error.
2027

0 commit comments

Comments
 (0)