-
Notifications
You must be signed in to change notification settings - Fork 3
/
README.txt
391 lines (243 loc) · 10.3 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
The DeepMap Command Line Interface
A CLI that provides a convenient method of making requests to the DeepMap API.
Using the API requires a Bearer JWT token, which can be obtained in two ways:
1. Through an http PUT request to the '/api/auth/v1/login' endpoint of the
relevant API. Requires a body with string fields "username" and "password".
However, this endpoint will be deprecated, and replaced with an Auth0 PKCE
login, accessible through an online portal, for improved security.
Once this method has been used, method #2 is most likely preferable for
convenience.
2. Using the Login command. This requires a valid API access token, which is
returned by the 'Create API Token Subcommand', but requires method #1 for
first time login.
Once an API access token has been created, it can be used to login until
it is deleted by the creator.
_______________________________________________________________________________
Installation
Pull from GitHub with 'git clone https://github.com/deepmap/cli.git'.
If installing from pulled source code, run 'pip install .' on the directory
containing 'setup.py'. Then, the CLI is accessible with 'deepmap' in a
terminal.
Also requires the 'deepmap-sdk' python package, which can be pulled with
'git clone https://github.com/deepmap/sdk.git'.
Both will eventually be published to the PyPI, and installable with
'pip install deepmap-cli' and 'pip install deepmap-sdk'.
_______________________________________________________________________________
Help Information
Use the -h flag for help information.
For example, for general help, run "deepmap -h"
For help on using a command, run: "deepmap <command> -h", replacing <command>
with the specific command e.g. "deepmap login -h" for login command help.
Also, prefix abbreviations are allowed for parameter names,
as long as the abbreviation is unique e.g. --u or --user or --usern for
--username in the login command.
_______________________________________________________________________________
Possible commands are:
login
Receives and stores an authentication token for the api.
reset_password
Reset a password for an account.
create
Create a new access token, or session token from an access token.
download
{feature_tile, distribution, tile}
Downloads the specified files and pipes output to stdout.
list
{users, maps, tokens, feature_tiles}
List valid users, maps, tokens, or tiles.
get
{user}
Get an object, like a user's information.
invite
Invite a user to join your account.
edit
{user}
Edit the email or admin permissions of a user.
delete
{user, token}
Delete a user or token from your account.
_______________________________________________________________________________
Login Command
usage: deepmap login [-h] [--server_url SERVER_URL] token
Login to receive an authorization token using an API access token.
positional arguments:
token An API access token.
optional arguments:
--server_url SERVER_URL
The base url of the api server requested. Will persist
if not reset with a new --server_url.
_______________________________________________________________________________
Reset Password Command
usage: deepmap reset_password [-h] email
Trigger a password reset.
positional arguments:
email The email of the account to reset password.
_______________________________________________________________________________
Create Command
usage: deepmap create [-h] {token,session} ...
Create an access token or session token.
positional arguments:
{token,session}
...............................................................................
Create Token Subcommand
usage: deepmap create token [-h] {vehicle,api} ...
Create an access token.
positional arguments:
{vehicle,api}
...............................................................................
Create API Token Subcommand
usage: deepmap create token api [-h] description
Create an API access token.
positional arguments:
description User-provided description for the token user.
...............................................................................
Create Vehicle Token Subcommand
usage: deepmap create token vehicle [-h] vehicle_id description
Create a vehicle access token.
positional arguments:
vehicle_id User-provided id for the vehicle.
description User-provided description for the vehicle.
...............................................................................
Create Session Subcommand
usage: deepmap create session [-h] {vehicle,api} ...
Create a session token.
positional arguments:
{vehicle,api}
...............................................................................
Create API Session Subcommand
usage: deepmap create session api [-h] token
Create an API session token.
positional arguments:
token A valid API access token.
...............................................................................
Create Vehicle Session Subcommand
usage: deepmap create session vehicle [-h] token
Create a vehicle session token.
positional arguments:
token A valid vehicle access token.
_______________________________________________________________________________
List Command
usage: deepmap list [-h] {maps,feature_tiles,tokens,users} ...
List the target objects.
positional arguments:
{maps,feature_tiles,tokens,users}
...............................................................................
List Maps Subcommand
usage: deepmap list maps [-h]
List maps.
...............................................................................
List Users Subcommand
usage: deepmap list users [-h]
List users.
...............................................................................
List Feature Tiles Subcommand
usage: deepmap list feature_tiles [-h] id
List feature tiles for a map.
positional arguments:
id Id of the map.
...............................................................................
List Tokens Subcommand
usage: deepmap list tokens [-h] {api,vehicle} ...
List tokens.
positional arguments:
{api,vehicle}
...............................................................................
List API Tokens Subcommand
usage: deepmap list tokens api [-h]
List issued API access tokens.
................................................................................
List Vehicle Tokens Subcommand
usage: deepmap list tokens vehicle [-h]
List issued vehicle access tokens.
_______________________________________________________________________________
Download Command
usage: deepmap download [-h] {feature_tile,distribution} ...
Download data.
positional arguments:
{feature_tile,distribution}
feature_tile Download a feature tile of a map.
distribution Download a map distribution.
...............................................................................
Download Feature Tile Subcommand
usage: deepmap download feature_tile [-h] id
positional arguments:
id The id of the feature_tile to download
...............................................................................
Download Map Distribution Subcommand
usage: deepmap download distribution [-h] [--format FORMAT]
[--version VERSION]
id
positional arguments:
id The id of the map distribution to download
optional arguments:
--format FORMAT Format of the distribution to download. Required if
multiple formats are available.
--version VERSION Optional: Version of the map to download. Otherwise
latest version is downloaded.
_______________________________________________________________________________
Invite Command
usage: deepmap invite [-h] [--admin {True,False}] email
Invite a user to join your account.
positional arguments:
email The email of the user to invite.
optional arguments:
--admin {True,False} Optional: True if the user should be an admin.
_______________________________________________________________________________
Get Command
usage: deepmap get [-h] {user} ...
Get information about an object.
positional arguments:
{user}
...............................................................................
Get User Subcommand
usage: deepmap get user [-h] id
Get user information.
positional arguments:
id The id of the user.
_______________________________________________________________________________
Edit Command
usage: deepmap edit [-h] {user} ...
Edit something.
positional arguments:
{user}
...............................................................................
Edit User Subcommand
usage: deepmap edit user [-h] [--email EMAIL] [--admin {True,False}] id
Edit a user's information.
positional arguments:
id The target user to edit.
optional arguments:
--email EMAIL Optional: The user's new email.
--admin {True,False} Optional: True or False, if the user is to be an
admin.
_______________________________________________________________________________
Delete Command
usage: deepmap delete [-h] {user,token} ...
Delete something.
positional arguments:
{user,token}
...............................................................................
Delete User Subcommand
usage: deepmap delete user [-h] id
Delete a user.
positional arguments:
id The id of the user.
...............................................................................
Delete Token Subcommand
usage: deepmap delete token [-h] {api,vehicle} ...
Delete a token.
positional arguments:
{api,vehicle}
...............................................................................
Delete API Token Subcommand
usage: deepmap delete token api [-h] id
Delete an issued API access token.
positional arguments:
id The id of the API token.
...............................................................................
Delete Vehicle Token Subcommand
usage: deepmap delete token vehicle [-h] id
Delete an issued vehicle access token.
positional arguments:
id The id of the vehicle token.
_______________________________________________________________________________