Skip to content

Commit d26e38d

Browse files
committed
Updated cli and README
1 parent c729c8e commit d26e38d

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

README.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This code is intended to be illustrative and is **not** guaranteed to perform we
1313
## Dependencies
1414

1515
- Python 2.7 or 3.3+
16-
- ElasticSearch 1.7 (to match Travis-CI)
16+
- ElasticSearch 2.x
1717

1818

1919
## Quickstart
@@ -43,7 +43,7 @@ This code is intended to be illustrative and is **not** guaranteed to perform we
4343
mme-server quickstart
4444
```
4545
46-
1. Run tests:
46+
1. Run tests (must run quickstart first):
4747
4848
```sh
4949
mme-server test
@@ -52,7 +52,7 @@ This code is intended to be illustrative and is **not** guaranteed to perform we
5252
1. Authorize an incoming server:
5353
5454
```sh
55-
mme-server auth add client_server in --label "My Client" --key "<CLIENT_AUTH_TOKEN>"
55+
mme-server clients add myclient --label "My Client" --key "<CLIENT_AUTH_TOKEN>"
5656
```
5757
5858
Leave off the `--key` option to have a secure key randomly generated for you.
@@ -129,18 +129,21 @@ Custom patient data can be indexed by the server in two ways (if a patient 'id'
129129
1. Batch index from the Python interface:
130130

131131
```py
132-
>>> from mme_server.models import DatastoreConnection
133-
>>> db = DatastoreConnection()
134-
>>> db.patients.index('/path/to/patients.json')
132+
>>> from mme_server.backend import get_backend
133+
>>> db = get_backend()
134+
>>> patients = db.get_manager('patients')
135+
>>> patients.index('/path/to/patients.json')
135136
```
136137

137138
1. Single patient index the Python interface:
138139

139140
```py
140-
>>> from mme_server.models import Patient, DatastoreConnection
141-
>>> db = DatastoreConnection()
141+
>>> from mme_server.backend import get_backend
142+
>>> db = get_backend()
143+
>>> patients = db.get_manager('patients')
144+
>>> from mme_server.models import Patient
142145
>>> patient = Patient.from_api({...})
143-
>>> db.patients.index_patient(patient)
146+
>>> patients.index_patient(patient)
144147
```
145148

146149

@@ -154,8 +157,3 @@ If you have any questions, feel free to post an issue on GitHub.
154157
This repository is managed by the Matchmaker Exchange technical team. You can reach us via GitHub or by [email](mailto:[email protected]).
155158

156159
Contributions are most welcome! Post an issue, submit a bugfix, or just try it out. We hope you find it useful.
157-
158-
159-
## Implementations
160-
161-
We don't know of any organizations using this code in a production setting just yet. If you are, please let us know! We'd love to list you here.

mme_server/cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,12 @@ def add_server_subcommands(parser, direction):
134134
subparsers = parser.add_subparsers(title='subcommands')
135135
subparser = subparsers.add_parser('add', description="Add {} authorization".format(server_type))
136136
subparser.add_argument("id", help="A unique {} identifier".format(server_type))
137+
if server_type == 'server':
138+
subparser.add_argument("base_url", help="The base HTTPS URL for sending API requests to the server (e.g., <base-url>/match should be a valid endpoint).")
139+
137140
subparser.add_argument("--key", help="The secret key used to authenticate requests to/from the {} (default: randomly generate a secure key)".format(server_type))
138141
subparser.add_argument("--label", help="The display name for the {}".format(server_type))
139142
if server_type == 'server':
140-
subparser.add_argument("--base-url", dest="base_url", help="The base URL for sending API requests to the server (e.g., <base-url>/match should be a valid endpoint). Must be specified for outgoing requests")
141143
subparser.set_defaults(function=add_server)
142144
else:
143145
subparser.set_defaults(function=add_client)

0 commit comments

Comments
 (0)