dtlpy 1.115.44__py3-none-any.whl → 1.117.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dtlpy/__init__.py +491 -491
- dtlpy/__version__.py +1 -1
- dtlpy/assets/__init__.py +26 -26
- dtlpy/assets/code_server/config.yaml +2 -2
- dtlpy/assets/code_server/installation.sh +24 -24
- dtlpy/assets/code_server/launch.json +13 -13
- dtlpy/assets/code_server/settings.json +2 -2
- dtlpy/assets/main.py +53 -53
- dtlpy/assets/main_partial.py +18 -18
- dtlpy/assets/mock.json +11 -11
- dtlpy/assets/model_adapter.py +83 -83
- dtlpy/assets/package.json +61 -61
- dtlpy/assets/package_catalog.json +29 -29
- dtlpy/assets/package_gitignore +307 -307
- dtlpy/assets/service_runners/__init__.py +33 -33
- dtlpy/assets/service_runners/converter.py +96 -96
- dtlpy/assets/service_runners/multi_method.py +49 -49
- dtlpy/assets/service_runners/multi_method_annotation.py +54 -54
- dtlpy/assets/service_runners/multi_method_dataset.py +55 -55
- dtlpy/assets/service_runners/multi_method_item.py +52 -52
- dtlpy/assets/service_runners/multi_method_json.py +52 -52
- dtlpy/assets/service_runners/single_method.py +37 -37
- dtlpy/assets/service_runners/single_method_annotation.py +43 -43
- dtlpy/assets/service_runners/single_method_dataset.py +43 -43
- dtlpy/assets/service_runners/single_method_item.py +41 -41
- dtlpy/assets/service_runners/single_method_json.py +42 -42
- dtlpy/assets/service_runners/single_method_multi_input.py +45 -45
- dtlpy/assets/voc_annotation_template.xml +23 -23
- dtlpy/caches/base_cache.py +32 -32
- dtlpy/caches/cache.py +473 -473
- dtlpy/caches/dl_cache.py +201 -201
- dtlpy/caches/filesystem_cache.py +89 -89
- dtlpy/caches/redis_cache.py +84 -84
- dtlpy/dlp/__init__.py +20 -20
- dtlpy/dlp/cli_utilities.py +367 -367
- dtlpy/dlp/command_executor.py +764 -764
- dtlpy/dlp/dlp +1 -1
- dtlpy/dlp/dlp.bat +1 -1
- dtlpy/dlp/dlp.py +128 -128
- dtlpy/dlp/parser.py +651 -651
- dtlpy/entities/__init__.py +83 -83
- dtlpy/entities/analytic.py +347 -347
- dtlpy/entities/annotation.py +1879 -1879
- dtlpy/entities/annotation_collection.py +699 -699
- dtlpy/entities/annotation_definitions/__init__.py +20 -20
- dtlpy/entities/annotation_definitions/base_annotation_definition.py +100 -100
- dtlpy/entities/annotation_definitions/box.py +195 -195
- dtlpy/entities/annotation_definitions/classification.py +67 -67
- dtlpy/entities/annotation_definitions/comparison.py +72 -72
- dtlpy/entities/annotation_definitions/cube.py +204 -204
- dtlpy/entities/annotation_definitions/cube_3d.py +149 -149
- dtlpy/entities/annotation_definitions/description.py +32 -32
- dtlpy/entities/annotation_definitions/ellipse.py +124 -124
- dtlpy/entities/annotation_definitions/free_text.py +62 -62
- dtlpy/entities/annotation_definitions/gis.py +69 -69
- dtlpy/entities/annotation_definitions/note.py +139 -139
- dtlpy/entities/annotation_definitions/point.py +117 -117
- dtlpy/entities/annotation_definitions/polygon.py +182 -182
- dtlpy/entities/annotation_definitions/polyline.py +111 -111
- dtlpy/entities/annotation_definitions/pose.py +92 -92
- dtlpy/entities/annotation_definitions/ref_image.py +86 -86
- dtlpy/entities/annotation_definitions/segmentation.py +240 -240
- dtlpy/entities/annotation_definitions/subtitle.py +34 -34
- dtlpy/entities/annotation_definitions/text.py +85 -85
- dtlpy/entities/annotation_definitions/undefined_annotation.py +74 -74
- dtlpy/entities/app.py +220 -220
- dtlpy/entities/app_module.py +107 -107
- dtlpy/entities/artifact.py +174 -174
- dtlpy/entities/assignment.py +399 -399
- dtlpy/entities/base_entity.py +214 -214
- dtlpy/entities/bot.py +113 -113
- dtlpy/entities/codebase.py +292 -292
- dtlpy/entities/collection.py +38 -38
- dtlpy/entities/command.py +169 -169
- dtlpy/entities/compute.py +449 -449
- dtlpy/entities/dataset.py +1299 -1299
- dtlpy/entities/directory_tree.py +44 -44
- dtlpy/entities/dpk.py +470 -470
- dtlpy/entities/driver.py +235 -235
- dtlpy/entities/execution.py +397 -397
- dtlpy/entities/feature.py +124 -124
- dtlpy/entities/feature_set.py +152 -145
- dtlpy/entities/filters.py +798 -798
- dtlpy/entities/gis_item.py +107 -107
- dtlpy/entities/integration.py +184 -184
- dtlpy/entities/item.py +975 -959
- dtlpy/entities/label.py +123 -123
- dtlpy/entities/links.py +85 -85
- dtlpy/entities/message.py +175 -175
- dtlpy/entities/model.py +684 -684
- dtlpy/entities/node.py +1005 -1005
- dtlpy/entities/ontology.py +810 -803
- dtlpy/entities/organization.py +287 -287
- dtlpy/entities/package.py +657 -657
- dtlpy/entities/package_defaults.py +5 -5
- dtlpy/entities/package_function.py +185 -185
- dtlpy/entities/package_module.py +113 -113
- dtlpy/entities/package_slot.py +118 -118
- dtlpy/entities/paged_entities.py +299 -299
- dtlpy/entities/pipeline.py +624 -624
- dtlpy/entities/pipeline_execution.py +279 -279
- dtlpy/entities/project.py +394 -394
- dtlpy/entities/prompt_item.py +505 -505
- dtlpy/entities/recipe.py +301 -301
- dtlpy/entities/reflect_dict.py +102 -102
- dtlpy/entities/resource_execution.py +138 -138
- dtlpy/entities/service.py +974 -963
- dtlpy/entities/service_driver.py +117 -117
- dtlpy/entities/setting.py +294 -294
- dtlpy/entities/task.py +495 -495
- dtlpy/entities/time_series.py +143 -143
- dtlpy/entities/trigger.py +426 -426
- dtlpy/entities/user.py +118 -118
- dtlpy/entities/webhook.py +124 -124
- dtlpy/examples/__init__.py +19 -19
- dtlpy/examples/add_labels.py +135 -135
- dtlpy/examples/add_metadata_to_item.py +21 -21
- dtlpy/examples/annotate_items_using_model.py +65 -65
- dtlpy/examples/annotate_video_using_model_and_tracker.py +75 -75
- dtlpy/examples/annotations_convert_to_voc.py +9 -9
- dtlpy/examples/annotations_convert_to_yolo.py +9 -9
- dtlpy/examples/convert_annotation_types.py +51 -51
- dtlpy/examples/converter.py +143 -143
- dtlpy/examples/copy_annotations.py +22 -22
- dtlpy/examples/copy_folder.py +31 -31
- dtlpy/examples/create_annotations.py +51 -51
- dtlpy/examples/create_video_annotations.py +83 -83
- dtlpy/examples/delete_annotations.py +26 -26
- dtlpy/examples/filters.py +113 -113
- dtlpy/examples/move_item.py +23 -23
- dtlpy/examples/play_video_annotation.py +13 -13
- dtlpy/examples/show_item_and_mask.py +53 -53
- dtlpy/examples/triggers.py +49 -49
- dtlpy/examples/upload_batch_of_items.py +20 -20
- dtlpy/examples/upload_items_and_custom_format_annotations.py +55 -55
- dtlpy/examples/upload_items_with_modalities.py +43 -43
- dtlpy/examples/upload_segmentation_annotations_from_mask_image.py +44 -44
- dtlpy/examples/upload_yolo_format_annotations.py +70 -70
- dtlpy/exceptions.py +125 -125
- dtlpy/miscellaneous/__init__.py +20 -20
- dtlpy/miscellaneous/dict_differ.py +95 -95
- dtlpy/miscellaneous/git_utils.py +217 -217
- dtlpy/miscellaneous/json_utils.py +14 -14
- dtlpy/miscellaneous/list_print.py +105 -105
- dtlpy/miscellaneous/zipping.py +130 -130
- dtlpy/ml/__init__.py +20 -20
- dtlpy/ml/base_feature_extractor_adapter.py +27 -27
- dtlpy/ml/base_model_adapter.py +1287 -1230
- dtlpy/ml/metrics.py +461 -461
- dtlpy/ml/predictions_utils.py +274 -274
- dtlpy/ml/summary_writer.py +57 -57
- dtlpy/ml/train_utils.py +60 -60
- dtlpy/new_instance.py +252 -252
- dtlpy/repositories/__init__.py +56 -56
- dtlpy/repositories/analytics.py +85 -85
- dtlpy/repositories/annotations.py +916 -916
- dtlpy/repositories/apps.py +383 -383
- dtlpy/repositories/artifacts.py +452 -452
- dtlpy/repositories/assignments.py +599 -599
- dtlpy/repositories/bots.py +213 -213
- dtlpy/repositories/codebases.py +559 -559
- dtlpy/repositories/collections.py +332 -332
- dtlpy/repositories/commands.py +152 -152
- dtlpy/repositories/compositions.py +61 -61
- dtlpy/repositories/computes.py +439 -439
- dtlpy/repositories/datasets.py +1585 -1504
- dtlpy/repositories/downloader.py +1157 -923
- dtlpy/repositories/dpks.py +433 -433
- dtlpy/repositories/drivers.py +482 -482
- dtlpy/repositories/executions.py +815 -815
- dtlpy/repositories/feature_sets.py +256 -226
- dtlpy/repositories/features.py +255 -255
- dtlpy/repositories/integrations.py +484 -484
- dtlpy/repositories/items.py +912 -912
- dtlpy/repositories/messages.py +94 -94
- dtlpy/repositories/models.py +1000 -1000
- dtlpy/repositories/nodes.py +80 -80
- dtlpy/repositories/ontologies.py +511 -511
- dtlpy/repositories/organizations.py +525 -525
- dtlpy/repositories/packages.py +1941 -1941
- dtlpy/repositories/pipeline_executions.py +451 -451
- dtlpy/repositories/pipelines.py +640 -640
- dtlpy/repositories/projects.py +539 -539
- dtlpy/repositories/recipes.py +429 -399
- dtlpy/repositories/resource_executions.py +137 -137
- dtlpy/repositories/schema.py +120 -120
- dtlpy/repositories/service_drivers.py +213 -213
- dtlpy/repositories/services.py +1704 -1704
- dtlpy/repositories/settings.py +339 -339
- dtlpy/repositories/tasks.py +1477 -1477
- dtlpy/repositories/times_series.py +278 -278
- dtlpy/repositories/triggers.py +536 -536
- dtlpy/repositories/upload_element.py +257 -257
- dtlpy/repositories/uploader.py +661 -661
- dtlpy/repositories/webhooks.py +249 -249
- dtlpy/services/__init__.py +22 -22
- dtlpy/services/aihttp_retry.py +131 -131
- dtlpy/services/api_client.py +1786 -1785
- dtlpy/services/api_reference.py +40 -40
- dtlpy/services/async_utils.py +133 -133
- dtlpy/services/calls_counter.py +44 -44
- dtlpy/services/check_sdk.py +68 -68
- dtlpy/services/cookie.py +115 -115
- dtlpy/services/create_logger.py +156 -156
- dtlpy/services/events.py +84 -84
- dtlpy/services/logins.py +235 -235
- dtlpy/services/reporter.py +256 -256
- dtlpy/services/service_defaults.py +91 -91
- dtlpy/utilities/__init__.py +20 -20
- dtlpy/utilities/annotations/__init__.py +16 -16
- dtlpy/utilities/annotations/annotation_converters.py +269 -269
- dtlpy/utilities/base_package_runner.py +285 -264
- dtlpy/utilities/converter.py +1650 -1650
- dtlpy/utilities/dataset_generators/__init__.py +1 -1
- dtlpy/utilities/dataset_generators/dataset_generator.py +670 -670
- dtlpy/utilities/dataset_generators/dataset_generator_tensorflow.py +23 -23
- dtlpy/utilities/dataset_generators/dataset_generator_torch.py +21 -21
- dtlpy/utilities/local_development/__init__.py +1 -1
- dtlpy/utilities/local_development/local_session.py +179 -179
- dtlpy/utilities/reports/__init__.py +2 -2
- dtlpy/utilities/reports/figures.py +343 -343
- dtlpy/utilities/reports/report.py +71 -71
- dtlpy/utilities/videos/__init__.py +17 -17
- dtlpy/utilities/videos/video_player.py +598 -598
- dtlpy/utilities/videos/videos.py +470 -470
- {dtlpy-1.115.44.data → dtlpy-1.117.6.data}/scripts/dlp +1 -1
- dtlpy-1.117.6.data/scripts/dlp.bat +2 -0
- {dtlpy-1.115.44.data → dtlpy-1.117.6.data}/scripts/dlp.py +128 -128
- {dtlpy-1.115.44.dist-info → dtlpy-1.117.6.dist-info}/METADATA +186 -186
- dtlpy-1.117.6.dist-info/RECORD +239 -0
- {dtlpy-1.115.44.dist-info → dtlpy-1.117.6.dist-info}/WHEEL +1 -1
- {dtlpy-1.115.44.dist-info → dtlpy-1.117.6.dist-info}/licenses/LICENSE +200 -200
- tests/features/environment.py +551 -551
- dtlpy/assets/__pycache__/__init__.cpython-310.pyc +0 -0
- dtlpy-1.115.44.data/scripts/dlp.bat +0 -2
- dtlpy-1.115.44.dist-info/RECORD +0 -240
- {dtlpy-1.115.44.dist-info → dtlpy-1.117.6.dist-info}/entry_points.txt +0 -0
- {dtlpy-1.115.44.dist-info → dtlpy-1.117.6.dist-info}/top_level.txt +0 -0
dtlpy/dlp/parser.py
CHANGED
|
@@ -1,651 +1,651 @@
|
|
|
1
|
-
import argparse
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def get_parser():
|
|
5
|
-
"""
|
|
6
|
-
Build the parser for CLI
|
|
7
|
-
:return: parser object
|
|
8
|
-
"""
|
|
9
|
-
parser = argparse.ArgumentParser(
|
|
10
|
-
description="CLI for Dataloop",
|
|
11
|
-
formatter_class=argparse.RawTextHelpFormatter
|
|
12
|
-
)
|
|
13
|
-
|
|
14
|
-
###############
|
|
15
|
-
# sub parsers #
|
|
16
|
-
###############
|
|
17
|
-
subparsers = parser.add_subparsers(dest="operation", help="supported operations")
|
|
18
|
-
|
|
19
|
-
########
|
|
20
|
-
# shell #
|
|
21
|
-
########
|
|
22
|
-
subparsers.add_parser("shell", help="Open interactive Dataloop shell")
|
|
23
|
-
|
|
24
|
-
########
|
|
25
|
-
# shell #
|
|
26
|
-
########
|
|
27
|
-
a = subparsers.add_parser("upgrade", help="Update dtlpy package")
|
|
28
|
-
optional = a.add_argument_group("optional named arguments")
|
|
29
|
-
optional.add_argument("-u", "--url", metavar='\b', help="Package url. default 'dtlpy'", default=None)
|
|
30
|
-
|
|
31
|
-
##################
|
|
32
|
-
# Login / Logout #
|
|
33
|
-
##################
|
|
34
|
-
subparsers.add_parser("logout", help="Logout")
|
|
35
|
-
|
|
36
|
-
subparsers.add_parser("login", help="Login using web Auth0 interface")
|
|
37
|
-
|
|
38
|
-
a = subparsers.add_parser("login-token", help="Login by passing a valid token")
|
|
39
|
-
required = a.add_argument_group("required named arguments")
|
|
40
|
-
required.add_argument(
|
|
41
|
-
"-t", "--token", metavar='\b', help="valid token", required=True
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
a = subparsers.add_parser("login-secret", help="Login client id and secret")
|
|
45
|
-
required = a.add_argument_group("required named arguments")
|
|
46
|
-
required.add_argument(
|
|
47
|
-
"-e", "--email", metavar='\b', help="user email", required=False, default=None
|
|
48
|
-
)
|
|
49
|
-
required.add_argument(
|
|
50
|
-
"-p", "--password", metavar='\b', help="user password", required=False, default=None
|
|
51
|
-
)
|
|
52
|
-
required.add_argument(
|
|
53
|
-
"-i", "--client-id", metavar='\b', help="client id", required=False, default=None
|
|
54
|
-
)
|
|
55
|
-
required.add_argument(
|
|
56
|
-
"-s", "--client-secret", metavar='\b', help="client secret", required=False, default=None
|
|
57
|
-
)
|
|
58
|
-
|
|
59
|
-
a = subparsers.add_parser("login-m2m", help="Login client id and secret")
|
|
60
|
-
required = a.add_argument_group("required named arguments")
|
|
61
|
-
required.add_argument(
|
|
62
|
-
"-e", "--email", metavar='\b', help="user email", required=False, default=None
|
|
63
|
-
)
|
|
64
|
-
required.add_argument(
|
|
65
|
-
"-p", "--password", metavar='\b', help="user password", required=False, default=None
|
|
66
|
-
)
|
|
67
|
-
required.add_argument(
|
|
68
|
-
"-i", "--client-id", metavar='\b', help="client id", required=False, default=None
|
|
69
|
-
)
|
|
70
|
-
required.add_argument(
|
|
71
|
-
"-s", "--client-secret", metavar='\b', help="client secret", required=False, default=None
|
|
72
|
-
)
|
|
73
|
-
########
|
|
74
|
-
# Init #
|
|
75
|
-
########
|
|
76
|
-
subparsers.add_parser("init", help="Initialize a .dataloop context")
|
|
77
|
-
|
|
78
|
-
##################
|
|
79
|
-
# Checkout state #
|
|
80
|
-
##################
|
|
81
|
-
subparsers.add_parser("checkout-state", help="Print checkout state")
|
|
82
|
-
|
|
83
|
-
########
|
|
84
|
-
# Help #
|
|
85
|
-
########
|
|
86
|
-
subparsers.add_parser("help", help="Get help")
|
|
87
|
-
|
|
88
|
-
###########
|
|
89
|
-
# version #
|
|
90
|
-
###########
|
|
91
|
-
parser.add_argument("-v", "--version", action="store_true", help="dtlpy version")
|
|
92
|
-
subparsers.add_parser("version", help="DTLPY SDK version")
|
|
93
|
-
|
|
94
|
-
#######
|
|
95
|
-
# API #
|
|
96
|
-
#######
|
|
97
|
-
subparser = subparsers.add_parser("api", help="Connection and environment")
|
|
98
|
-
subparser_parser = subparser.add_subparsers(dest="api", help="gate operations")
|
|
99
|
-
|
|
100
|
-
# ACTIONS #
|
|
101
|
-
|
|
102
|
-
# info
|
|
103
|
-
subparser_parser.add_parser("info", help="Print api information")
|
|
104
|
-
|
|
105
|
-
# setenv
|
|
106
|
-
a = subparser_parser.add_parser("setenv", help="Set platform environment")
|
|
107
|
-
required = a.add_argument_group("required named arguments")
|
|
108
|
-
required.add_argument("-e", "--env", metavar='\b', help="working environment", required=True)
|
|
109
|
-
|
|
110
|
-
###############
|
|
111
|
-
# Development #
|
|
112
|
-
###############
|
|
113
|
-
subparser = subparsers.add_parser(name="development", help="Start a development session")
|
|
114
|
-
subparser_parser = subparser.add_subparsers(dest="development", help="local development session")
|
|
115
|
-
local_subparser_parser = subparser_parser.add_parser(name="local",
|
|
116
|
-
help="local development using docker and code-server session")
|
|
117
|
-
remote_subparser_parser = subparser_parser.add_parser(name="remote",
|
|
118
|
-
help="remote development (dl.Service) using code-server session")
|
|
119
|
-
|
|
120
|
-
#############################
|
|
121
|
-
# Local Development Session #
|
|
122
|
-
#############################
|
|
123
|
-
# start
|
|
124
|
-
local_subparser_subparser = local_subparser_parser.add_subparsers(dest="local", help="Local development session")
|
|
125
|
-
a = local_subparser_subparser.add_parser(name="start", help="Start a local development session")
|
|
126
|
-
optional = a.add_argument_group("optional named arguments")
|
|
127
|
-
optional.add_argument("-p", "--port",
|
|
128
|
-
default=None,
|
|
129
|
-
help="Local port for the docker connection, default: 5802")
|
|
130
|
-
optional.add_argument("-d", "--docker-image",
|
|
131
|
-
default=None,
|
|
132
|
-
help="Docker image to create. default: 'dataloopai/dtlpy-agent:1.57.3.gpu.cuda11.5.py3.8.opencv'")
|
|
133
|
-
# pause
|
|
134
|
-
_ = local_subparser_subparser.add_parser(name="pause", help="Pause the local development session (container pause)")
|
|
135
|
-
# stop
|
|
136
|
-
_ = local_subparser_subparser.add_parser(name="stop", help="Stop the local development session (container kill)")
|
|
137
|
-
##############################
|
|
138
|
-
# Remote Development Session #
|
|
139
|
-
##############################
|
|
140
|
-
|
|
141
|
-
############
|
|
142
|
-
# Projects #
|
|
143
|
-
############
|
|
144
|
-
subparser = subparsers.add_parser("projects", help="Operations with projects")
|
|
145
|
-
subparser_parser = subparser.add_subparsers(dest="projects", help="projects operations")
|
|
146
|
-
|
|
147
|
-
# ACTIONS #
|
|
148
|
-
|
|
149
|
-
# list
|
|
150
|
-
subparser_parser.add_parser("ls", help="List all projects")
|
|
151
|
-
|
|
152
|
-
# create
|
|
153
|
-
a = subparser_parser.add_parser("create", help="Create a new project")
|
|
154
|
-
required = a.add_argument_group("required named arguments")
|
|
155
|
-
required.add_argument("-p", "--project-name", metavar='\b', help="project name")
|
|
156
|
-
|
|
157
|
-
# checkout
|
|
158
|
-
a = subparser_parser.add_parser("checkout", help="checkout a project")
|
|
159
|
-
required = a.add_argument_group("required named arguments")
|
|
160
|
-
required.add_argument("-p", "--project-name", metavar='\b', help="project name")
|
|
161
|
-
|
|
162
|
-
# open web
|
|
163
|
-
a = subparser_parser.add_parser("web", help="Open in web browser")
|
|
164
|
-
optional = a.add_argument_group("optional named arguments")
|
|
165
|
-
optional.add_argument("-p", "--project-name", metavar='\b', help="project name")
|
|
166
|
-
|
|
167
|
-
############
|
|
168
|
-
# Datasets #
|
|
169
|
-
############
|
|
170
|
-
subparser = subparsers.add_parser("datasets", help="Operations with datasets")
|
|
171
|
-
subparser_parser = subparser.add_subparsers(dest="datasets", help="datasets operations")
|
|
172
|
-
|
|
173
|
-
# ACTIONS #
|
|
174
|
-
# open web
|
|
175
|
-
a = subparser_parser.add_parser("web", help="Open in web browser")
|
|
176
|
-
optional = a.add_argument_group("optional named arguments")
|
|
177
|
-
optional.add_argument("-p", "--project-name", metavar='\b', help="project name")
|
|
178
|
-
optional.add_argument("-d", "--dataset-name", metavar='\b', help="dataset name")
|
|
179
|
-
|
|
180
|
-
# list
|
|
181
|
-
a = subparser_parser.add_parser("ls", help="List of datasets in project")
|
|
182
|
-
optional = a.add_argument_group("optional named arguments")
|
|
183
|
-
optional.add_argument("-p", "--project-name", metavar='\b', default=None,
|
|
184
|
-
help="project name. Default taken from checked out (if checked out)")
|
|
185
|
-
|
|
186
|
-
# create
|
|
187
|
-
a = subparser_parser.add_parser("create", help="Create a new dataset")
|
|
188
|
-
required = a.add_argument_group("required named arguments")
|
|
189
|
-
required.add_argument("-d", "--dataset-name", metavar='\b', help="dataset name", required=True)
|
|
190
|
-
optional = a.add_argument_group("optional named arguments")
|
|
191
|
-
optional.add_argument("-p", "--project-name", metavar='\b', default=None,
|
|
192
|
-
help="project name. Default taken from checked out (if checked out)")
|
|
193
|
-
optional.add_argument("-c", "--checkout", action='store_true', default=False, help="checkout the new dataset")
|
|
194
|
-
|
|
195
|
-
# checkout
|
|
196
|
-
a = subparser_parser.add_parser("checkout", help="checkout a dataset")
|
|
197
|
-
required = a.add_argument_group("required named arguments")
|
|
198
|
-
required.add_argument("-d", "--dataset-name", metavar='\b', help="dataset name")
|
|
199
|
-
optional = a.add_argument_group("optional named arguments")
|
|
200
|
-
optional.add_argument("-p", "--project-name", metavar='\b', default=None,
|
|
201
|
-
help="project name. Default taken from checked out (if checked out)")
|
|
202
|
-
|
|
203
|
-
#########
|
|
204
|
-
# items #
|
|
205
|
-
#########
|
|
206
|
-
subparser = subparsers.add_parser("items", help="Operations with items")
|
|
207
|
-
subparser_parser = subparser.add_subparsers(dest="items", help="items operations")
|
|
208
|
-
|
|
209
|
-
# ACTIONS #
|
|
210
|
-
|
|
211
|
-
a = subparser_parser.add_parser("web", help="Open in web browser")
|
|
212
|
-
required = a.add_argument_group("required named arguments")
|
|
213
|
-
required.add_argument("-r", "--remote-path", metavar='\b', help="remote path")
|
|
214
|
-
optional = a.add_argument_group("optional named arguments")
|
|
215
|
-
optional.add_argument("-p", "--project-name", metavar='\b', help="project name")
|
|
216
|
-
optional.add_argument("-d", "--dataset-name", metavar='\b', help="dataset name")
|
|
217
|
-
|
|
218
|
-
# list
|
|
219
|
-
a = subparser_parser.add_parser("ls", help="List of items in dataset")
|
|
220
|
-
optional = a.add_argument_group("optional named arguments")
|
|
221
|
-
optional.add_argument("-p", "--project-name", metavar='\b', default=None,
|
|
222
|
-
help="project name. Default taken from checked out (if checked out)")
|
|
223
|
-
optional.add_argument("-d", "--dataset-name", metavar='\b', default=None,
|
|
224
|
-
help="dataset name. Default taken from checked out (if checked out)")
|
|
225
|
-
optional.add_argument("-o", "--page", metavar='\b', help="page number (integer)", default=0)
|
|
226
|
-
optional.add_argument("-r", "--remote-path", metavar='\b', help="remote path", default=None)
|
|
227
|
-
optional.add_argument("-t", "--type", metavar='\b', help="Item type", default=None)
|
|
228
|
-
|
|
229
|
-
# upload
|
|
230
|
-
a = subparser_parser.add_parser("upload", help="Upload directory to dataset")
|
|
231
|
-
required = a.add_argument_group("required named arguments")
|
|
232
|
-
required.add_argument("-l", "--local-path", required=True, metavar='\b',
|
|
233
|
-
help="local path")
|
|
234
|
-
optional = a.add_argument_group("optional named arguments")
|
|
235
|
-
optional.add_argument("-p", "--project-name", metavar='\b', default=None,
|
|
236
|
-
help="project name. Default taken from checked out (if checked out)")
|
|
237
|
-
optional.add_argument("-d", "--dataset-name", metavar='\b', default=None,
|
|
238
|
-
help="dataset name. Default taken from checked out (if checked out)")
|
|
239
|
-
optional.add_argument("-r", "--remote-path", metavar='\b', default=None,
|
|
240
|
-
help="remote path to upload to. default: /")
|
|
241
|
-
optional.add_argument("-f", "--file-types", metavar='\b', default=None,
|
|
242
|
-
help='Comma separated list of file types to upload, e.g ".jpg,.png". default: all')
|
|
243
|
-
optional.add_argument("-lap", "--local-annotations-path", metavar='\b', default=None,
|
|
244
|
-
help="Path for local annotations to upload with items")
|
|
245
|
-
optional.add_argument("-ow", "--overwrite", dest="overwrite", action='store_true', default=False,
|
|
246
|
-
help="Overwrite existing item")
|
|
247
|
-
|
|
248
|
-
# download
|
|
249
|
-
a = subparser_parser.add_parser("download", help="Download dataset to a local directory")
|
|
250
|
-
optional = a.add_argument_group("optional named arguments")
|
|
251
|
-
optional.add_argument("-p", "--project-name", metavar='\b', default=None,
|
|
252
|
-
help="project name. Default taken from checked out (if checked out)")
|
|
253
|
-
optional.add_argument("-d", "--dataset-name", metavar='\b', default=None,
|
|
254
|
-
help="dataset name. Default taken from checked out (if checked out)")
|
|
255
|
-
optional.add_argument("-ao", "--annotation-options", metavar='\b',
|
|
256
|
-
help="which annotation to download. options: json,instance,mask", default=None)
|
|
257
|
-
optional.add_argument("-aft", "--annotation-filter-type", metavar='\b',
|
|
258
|
-
help="annotation type filter when downloading annotations. "
|
|
259
|
-
"options: box,segment,binary etc", default=None)
|
|
260
|
-
optional.add_argument("-afl", "--annotation-filter-label", metavar='\b',
|
|
261
|
-
help="labels filter when downloading annotations.", default=None)
|
|
262
|
-
optional.add_argument("-r", "--remote-path", metavar='\b', default=None,
|
|
263
|
-
help="remote path to upload to. default: /")
|
|
264
|
-
optional.add_argument("-ow", "--overwrite", action='store_true', default=False,
|
|
265
|
-
help="Overwrite existing item")
|
|
266
|
-
optional.add_argument("-t", "--not-items-folder", action='store_true', default=False,
|
|
267
|
-
help="Download WITHOUT 'items' folder")
|
|
268
|
-
optional.add_argument("-wt", "--with-text", action='store_true', default=False,
|
|
269
|
-
help="Annotations will have text in mask")
|
|
270
|
-
optional.add_argument("-th", "--thickness", metavar='\b', default="1",
|
|
271
|
-
help="Annotation line thickness")
|
|
272
|
-
optional.add_argument("-l", "--local-path", metavar='\b', default=None,
|
|
273
|
-
help="local path")
|
|
274
|
-
optional.add_argument("-wb", "--without-binaries", action='store_true', default=False,
|
|
275
|
-
help="Don't download item binaries")
|
|
276
|
-
|
|
277
|
-
##########
|
|
278
|
-
# videos #
|
|
279
|
-
##########
|
|
280
|
-
subparser = subparsers.add_parser("videos", help="Operations with videos")
|
|
281
|
-
subparser_parser = subparser.add_subparsers(dest="videos", help="videos operations")
|
|
282
|
-
|
|
283
|
-
# ACTIONS #
|
|
284
|
-
|
|
285
|
-
# play
|
|
286
|
-
a = subparser_parser.add_parser("play", help="Play video")
|
|
287
|
-
optional = a.add_argument_group("optional named arguments")
|
|
288
|
-
optional.add_argument(
|
|
289
|
-
"-l",
|
|
290
|
-
"--item-path",
|
|
291
|
-
metavar='\b',
|
|
292
|
-
default=None,
|
|
293
|
-
help="Video remote path in platform. e.g /dogs/dog.mp4",
|
|
294
|
-
)
|
|
295
|
-
optional.add_argument(
|
|
296
|
-
"-p",
|
|
297
|
-
"--project-name",
|
|
298
|
-
metavar='\b',
|
|
299
|
-
default=None,
|
|
300
|
-
help="project name. Default taken from checked out (if checked out)",
|
|
301
|
-
)
|
|
302
|
-
optional.add_argument(
|
|
303
|
-
"-d",
|
|
304
|
-
"--dataset-name",
|
|
305
|
-
metavar='\b',
|
|
306
|
-
default=None,
|
|
307
|
-
help="dataset name. Default taken from checked out (if checked out)",
|
|
308
|
-
)
|
|
309
|
-
|
|
310
|
-
# upload
|
|
311
|
-
a = subparser_parser.add_parser("upload", help="Upload a single video")
|
|
312
|
-
required = a.add_argument_group("required named arguments")
|
|
313
|
-
required.add_argument(
|
|
314
|
-
"-f", "--filename", metavar='\b', help="local filename to upload", required=True
|
|
315
|
-
)
|
|
316
|
-
required.add_argument(
|
|
317
|
-
"-p", "--project-name", metavar='\b', help="project name", required=True
|
|
318
|
-
)
|
|
319
|
-
required.add_argument(
|
|
320
|
-
"-d", "--dataset-name", metavar='\b', help="dataset name", required=True
|
|
321
|
-
)
|
|
322
|
-
optional = a.add_argument_group("optional named arguments")
|
|
323
|
-
optional.add_argument(
|
|
324
|
-
"-r", "--remote-path", metavar='\b', help="remote path", default="/"
|
|
325
|
-
)
|
|
326
|
-
|
|
327
|
-
# split video to chunks
|
|
328
|
-
optional.add_argument(
|
|
329
|
-
"-sc",
|
|
330
|
-
"--split-chunks",
|
|
331
|
-
metavar='\b',
|
|
332
|
-
default=None,
|
|
333
|
-
help="Video splitting parameter: Number of chunks to split",
|
|
334
|
-
)
|
|
335
|
-
optional.add_argument(
|
|
336
|
-
"-ss",
|
|
337
|
-
"--split-seconds",
|
|
338
|
-
metavar='\b',
|
|
339
|
-
default=None,
|
|
340
|
-
help="Video splitting parameter: Seconds of each chuck",
|
|
341
|
-
)
|
|
342
|
-
optional.add_argument(
|
|
343
|
-
"-st",
|
|
344
|
-
"--split-times",
|
|
345
|
-
metavar='\b',
|
|
346
|
-
default=None,
|
|
347
|
-
help="Video splitting parameter: List of seconds to split at. e.g 600,1800,2000",
|
|
348
|
-
)
|
|
349
|
-
# encode
|
|
350
|
-
optional.add_argument(
|
|
351
|
-
"-e",
|
|
352
|
-
"--encode",
|
|
353
|
-
action="store_true",
|
|
354
|
-
default=False,
|
|
355
|
-
help="encode video to mp4, remove bframes and upload",
|
|
356
|
-
)
|
|
357
|
-
|
|
358
|
-
###############
|
|
359
|
-
# Application #
|
|
360
|
-
###############
|
|
361
|
-
subparser = subparsers.add_parser("app", help="Operations with application")
|
|
362
|
-
subparser_parser = subparser.add_subparsers(dest="app", help="application operations")
|
|
363
|
-
|
|
364
|
-
# ACTIONS #
|
|
365
|
-
|
|
366
|
-
# init
|
|
367
|
-
a = subparser_parser.add_parser('init', help="Initialize the structure in order to deploy a dpk")
|
|
368
|
-
optional = a.add_argument_group("Optional named arguments")
|
|
369
|
-
optional.add_argument('--name', required=False, dest='name', help="the name of the app")
|
|
370
|
-
optional.add_argument('--description', required=False, dest='description', help="the description of the app")
|
|
371
|
-
optional.add_argument('--attributes', required=False, dest='attributes',
|
|
372
|
-
help="the attributes of the app (comma separated)")
|
|
373
|
-
optional.add_argument('--icon', required=False, dest='icon', help="the icon of the app")
|
|
374
|
-
optional.add_argument('--scope', required=False, dest='scope',
|
|
375
|
-
help="the scope of the app (default is organization)")
|
|
376
|
-
# add components
|
|
377
|
-
a = subparser_parser.add_parser('add', help="Add component to the dataloop json file")
|
|
378
|
-
optional = a.add_argument_group("Optional named arguments")
|
|
379
|
-
optional.add_argument('--panel', action='store_true', help="builder for panel component")
|
|
380
|
-
optional.add_argument('--module', action='store_true', help="builder for module component")
|
|
381
|
-
optional.add_argument('--toolbar', action='store_true', help="builder for toolbar component")
|
|
382
|
-
|
|
383
|
-
# pack
|
|
384
|
-
a = subparser_parser.add_parser("pack", help="Pack the project as dpk file")
|
|
385
|
-
# publish
|
|
386
|
-
a = subparser_parser.add_parser("publish", help="Publish the app")
|
|
387
|
-
optional = a.add_argument_group("Optional named arguments")
|
|
388
|
-
optional.add_argument("--project-name", dest="project_name", help="The name of the project")
|
|
389
|
-
optional.add_argument("--project-id", dest="project_id", help="The ID of the project")
|
|
390
|
-
|
|
391
|
-
# update
|
|
392
|
-
a = subparser_parser.add_parser("update", help="Update the app")
|
|
393
|
-
required = a.add_argument_group("Required named arguments")
|
|
394
|
-
required.add_argument("--app-name", dest="app_name", required=True, help="Locates the app by the name")
|
|
395
|
-
required.add_argument("--new-version", dest="new_version", required=True,
|
|
396
|
-
help="Sets the new version of the specified app")
|
|
397
|
-
optional = a.add_argument_group("Required named arguments")
|
|
398
|
-
optional.add_argument("--project-id", dest="project_id", default=None, help="The id of the project")
|
|
399
|
-
optional.add_argument("--project-name", dest="project_name", default=None, help="The name of the project")
|
|
400
|
-
|
|
401
|
-
# install
|
|
402
|
-
a = subparser_parser.add_parser("install", help="Install the app to the platform")
|
|
403
|
-
required = a.add_argument_group("Required named arguments")
|
|
404
|
-
required.add_argument("--dpk-id", dest="dpk_id", required=True, help="The id of the dpk")
|
|
405
|
-
optional = a.add_argument_group("Optional named arguments")
|
|
406
|
-
optional.add_argument("--project-id", dest="project_id", default=None, help="The id of the project")
|
|
407
|
-
optional.add_argument("--project-name", dest="project_name", default=None, help="The name of the project")
|
|
408
|
-
optional.add_argument("--org-id", dest="org_id", default=None, help="The name of the org")
|
|
409
|
-
|
|
410
|
-
# pull
|
|
411
|
-
a = subparser_parser.add_parser('pull', help="Pull the app from the marketplace")
|
|
412
|
-
required = a.add_argument_group("Required named arguments")
|
|
413
|
-
required.add_argument('--dpk-name', dest='app_name', required=True, help='The name of the dpk')
|
|
414
|
-
|
|
415
|
-
# list
|
|
416
|
-
a = subparser_parser.add_parser('list', help="List all installed apps")
|
|
417
|
-
required = a.add_argument_group("Required named arguments")
|
|
418
|
-
required.add_argument('--project-name', dest='project_name', required=False, help='The name of the project')
|
|
419
|
-
|
|
420
|
-
############
|
|
421
|
-
# Services #
|
|
422
|
-
############
|
|
423
|
-
subparser = subparsers.add_parser("services", help="Operations with services")
|
|
424
|
-
subparser_parser = subparser.add_subparsers(dest="services", help="services operations")
|
|
425
|
-
|
|
426
|
-
# ACTIONS #
|
|
427
|
-
|
|
428
|
-
# execute
|
|
429
|
-
a = subparser_parser.add_parser("execute", help="Create an execution")
|
|
430
|
-
optional = a.add_argument_group("optional named arguments")
|
|
431
|
-
optional.add_argument("-f", "--function-name", dest="function_name", default=None,
|
|
432
|
-
help="which function to run")
|
|
433
|
-
optional.add_argument("-s", "--service-name", dest="service_name", default=None,
|
|
434
|
-
help="which service to run")
|
|
435
|
-
optional.add_argument("-pr", "--project-name", dest="project_name", default=None,
|
|
436
|
-
help="Project name")
|
|
437
|
-
optional.add_argument("-as", "--async", dest="asynchronous", default=True, action='store_false',
|
|
438
|
-
help="Async execution ")
|
|
439
|
-
optional.add_argument("-i", "--item-id", dest="item_id", default=None,
|
|
440
|
-
help="Item input")
|
|
441
|
-
optional.add_argument("-d", "--dataset-id", dest="dataset_id", default=None,
|
|
442
|
-
help="Dataset input")
|
|
443
|
-
optional.add_argument("-a", "--annotation-id", dest="annotation_id", default=None,
|
|
444
|
-
help="Annotation input")
|
|
445
|
-
optional.add_argument("-in", "--inputs", dest="inputs", default='{}',
|
|
446
|
-
help="Dictionary string input")
|
|
447
|
-
|
|
448
|
-
# tear-down
|
|
449
|
-
a = subparser_parser.add_parser(
|
|
450
|
-
"tear-down", help="tear-down service of service.json file"
|
|
451
|
-
)
|
|
452
|
-
optional = a.add_argument_group("optional named arguments")
|
|
453
|
-
optional.add_argument("-l", "--local-path", dest="local_path", default=None,
|
|
454
|
-
help="path to service.json file")
|
|
455
|
-
optional.add_argument("-pr", "--project-name", dest="project_name", default=None,
|
|
456
|
-
help="Project name")
|
|
457
|
-
|
|
458
|
-
# ls
|
|
459
|
-
a = subparser_parser.add_parser("ls", help="List project's services")
|
|
460
|
-
optional = a.add_argument_group("optional named arguments")
|
|
461
|
-
optional.add_argument("-pr", "--project-name", dest="project_name", default=None,
|
|
462
|
-
help="Project name")
|
|
463
|
-
optional.add_argument("-pkg", "--package-name", dest="package_name", default=None,
|
|
464
|
-
help="Package name")
|
|
465
|
-
|
|
466
|
-
# log
|
|
467
|
-
a = subparser_parser.add_parser("log", help="Get services log")
|
|
468
|
-
optional = a.add_argument_group("required named arguments")
|
|
469
|
-
optional.add_argument("-pr", "--project-name", dest="project_name", default=None,
|
|
470
|
-
help="Project name")
|
|
471
|
-
optional.add_argument("-f", "--service-name", dest="service_name", default=None,
|
|
472
|
-
help="Project name")
|
|
473
|
-
optional.add_argument("-t", "--start", dest="start", default=None,
|
|
474
|
-
help="Log start time")
|
|
475
|
-
|
|
476
|
-
# delete
|
|
477
|
-
a = subparser_parser.add_parser("delete", help="Delete Service")
|
|
478
|
-
optional = a.add_argument_group("optional named arguments")
|
|
479
|
-
optional.add_argument("-f", "--service-name", dest="service_name", default=None,
|
|
480
|
-
help="Service name")
|
|
481
|
-
optional.add_argument("-p", "--project-name", dest="project_name", default=None,
|
|
482
|
-
help="Project name")
|
|
483
|
-
optional.add_argument("-pkg", "--package-name", dest="package_name", default=None,
|
|
484
|
-
help="Package name")
|
|
485
|
-
|
|
486
|
-
############
|
|
487
|
-
# Triggers #
|
|
488
|
-
############
|
|
489
|
-
subparser = subparsers.add_parser("triggers", help="Operations with triggers")
|
|
490
|
-
subparser_parser = subparser.add_subparsers(dest="triggers", help="triggers operations")
|
|
491
|
-
|
|
492
|
-
# ACTIONS #
|
|
493
|
-
# create
|
|
494
|
-
a = subparser_parser.add_parser("create", help="Create a Service Trigger")
|
|
495
|
-
required = a.add_argument_group("required named arguments")
|
|
496
|
-
required.add_argument("-r", "--resource", dest="resource",
|
|
497
|
-
help="Resource name", required=True)
|
|
498
|
-
required.add_argument("-a", "--actions", dest="actions", help="Actions", required=True)
|
|
499
|
-
|
|
500
|
-
optional = a.add_argument_group("optional named arguments")
|
|
501
|
-
optional.add_argument("-p", "--project-name", dest="project_name", default=None,
|
|
502
|
-
help="Project name")
|
|
503
|
-
optional.add_argument("-pkg", "--package-name", dest="package_name", default=None,
|
|
504
|
-
help="Package name")
|
|
505
|
-
optional.add_argument("-f", "--service-name", dest="service_name",
|
|
506
|
-
help="Service name", default=None)
|
|
507
|
-
optional.add_argument("-n", "--name", dest="name",
|
|
508
|
-
help="Trigger name", default=None)
|
|
509
|
-
optional.add_argument("-fl", "--filters", dest="filters", default='{}',
|
|
510
|
-
help="Json filter")
|
|
511
|
-
optional.add_argument("-fn", "--function-name", dest="function_name", default='run',
|
|
512
|
-
help="Function name")
|
|
513
|
-
|
|
514
|
-
# delete
|
|
515
|
-
a = subparser_parser.add_parser("delete", help="Delete Trigger")
|
|
516
|
-
required = a.add_argument_group("required named arguments")
|
|
517
|
-
required.add_argument("-t", "--trigger-name", dest="trigger_name", default=None,
|
|
518
|
-
help="Trigger name", required=True)
|
|
519
|
-
|
|
520
|
-
optional = a.add_argument_group("optional named arguments")
|
|
521
|
-
optional.add_argument("-f", "--service-name", dest="service_name", default=None,
|
|
522
|
-
help="Service name")
|
|
523
|
-
optional.add_argument("-p", "--project-name", dest="project_name", default=None,
|
|
524
|
-
help="Project name")
|
|
525
|
-
optional.add_argument("-pkg", "--package-name", dest="package_name", default=None,
|
|
526
|
-
help="Package name")
|
|
527
|
-
|
|
528
|
-
a = subparser_parser.add_parser("ls", help="List triggers")
|
|
529
|
-
optional = a.add_argument_group("optional named arguments")
|
|
530
|
-
optional.add_argument("-pr", "--project-name", dest="project_name", default=None,
|
|
531
|
-
help="Project name")
|
|
532
|
-
optional.add_argument("-pkg", "--package-name", dest="package_name", default=None,
|
|
533
|
-
help="Package name")
|
|
534
|
-
optional.add_argument("-s", "--service-name", dest="service_name", default=None,
|
|
535
|
-
help="Service name")
|
|
536
|
-
|
|
537
|
-
############
|
|
538
|
-
# Deploy #
|
|
539
|
-
############
|
|
540
|
-
# subparsers.add_parser("deploy", help="Login using web Auth0 interface")
|
|
541
|
-
|
|
542
|
-
a = subparsers.add_parser("deploy", help="deploy with json file")
|
|
543
|
-
required = a.add_argument_group("required named arguments")
|
|
544
|
-
required.add_argument("-f", dest="json_file", default=None,
|
|
545
|
-
help="Path to json file")
|
|
546
|
-
required.add_argument("-p", dest="project_name", default=None,
|
|
547
|
-
help="Project name")
|
|
548
|
-
|
|
549
|
-
############
|
|
550
|
-
# Generate #
|
|
551
|
-
############
|
|
552
|
-
# subparsers.add_parser("deploy", help="Login using web Auth0 interface")
|
|
553
|
-
|
|
554
|
-
a = subparsers.add_parser("generate", help="generate a json file")
|
|
555
|
-
optional = a.add_argument_group("optional named arguments")
|
|
556
|
-
optional.add_argument("--option", dest="package_type", default=None,
|
|
557
|
-
help="cataluge of examples")
|
|
558
|
-
optional.add_argument("-p", "--package-name", dest="package_name", default=None,
|
|
559
|
-
help="Package name")
|
|
560
|
-
|
|
561
|
-
############
|
|
562
|
-
# packages #
|
|
563
|
-
############
|
|
564
|
-
subparser = subparsers.add_parser("packages", help="Operations with packages")
|
|
565
|
-
subparser_parser = subparser.add_subparsers(
|
|
566
|
-
dest="packages", help="package operations"
|
|
567
|
-
)
|
|
568
|
-
|
|
569
|
-
# ACTIONS #
|
|
570
|
-
# ls
|
|
571
|
-
a = subparser_parser.add_parser("ls", help="List packages")
|
|
572
|
-
optional = a.add_argument_group("optional named arguments")
|
|
573
|
-
optional.add_argument("-p", "--project-name", dest="project_name", default=None,
|
|
574
|
-
help="Project name")
|
|
575
|
-
|
|
576
|
-
# push
|
|
577
|
-
a = subparser_parser.add_parser("push", help="Create package in platform")
|
|
578
|
-
|
|
579
|
-
optional = a.add_argument_group("optional named arguments")
|
|
580
|
-
optional.add_argument("-src", "--src-path", metavar='\b', default=None,
|
|
581
|
-
help="Revision to deploy if selected True")
|
|
582
|
-
optional.add_argument("-cid", "--codebase-id", metavar='\b', default=None,
|
|
583
|
-
help="Revision to deploy if selected True")
|
|
584
|
-
optional.add_argument("-pr", "--project-name", metavar='\b', default=None,
|
|
585
|
-
help="Project name")
|
|
586
|
-
optional.add_argument("-p", "--package-name", metavar='\b', default=None,
|
|
587
|
-
help="Package name")
|
|
588
|
-
optional.add_argument("-c", "--checkout", action='store_true', default=False, help="checkout the new package")
|
|
589
|
-
|
|
590
|
-
# deploy
|
|
591
|
-
a = subparser_parser.add_parser("deploy", help="Deploy package to platform")
|
|
592
|
-
optional = a.add_argument_group("optional named arguments")
|
|
593
|
-
optional.add_argument("-p", "--package-name", metavar='\b', default=None,
|
|
594
|
-
help="Package name")
|
|
595
|
-
optional.add_argument("-pr", "--project-name", metavar='\b', default=None,
|
|
596
|
-
help="Project name")
|
|
597
|
-
optional.add_argument("--module-name", metavar='\b', default='default_module',
|
|
598
|
-
help="Package module name")
|
|
599
|
-
optional.add_argument("-c", "--checkout", action='store_true', default=False, help="checkout the new package")
|
|
600
|
-
|
|
601
|
-
# test
|
|
602
|
-
a = subparser_parser.add_parser(
|
|
603
|
-
"test", help="Tests that Package locally using mock.json"
|
|
604
|
-
)
|
|
605
|
-
optional = a.add_argument_group("optional named arguments")
|
|
606
|
-
optional.add_argument("-c", "--concurrency", metavar='\b', default=10,
|
|
607
|
-
help="Revision to deploy if selected True")
|
|
608
|
-
optional.add_argument("-f", "--function-name", metavar='\b', default='run',
|
|
609
|
-
help="Function to test")
|
|
610
|
-
# checkout
|
|
611
|
-
a = subparser_parser.add_parser("checkout", help="checkout a package")
|
|
612
|
-
required = a.add_argument_group("required named arguments")
|
|
613
|
-
required.add_argument("-p", "--package-name", metavar='\b', help="package name")
|
|
614
|
-
|
|
615
|
-
# delete
|
|
616
|
-
a = subparser_parser.add_parser(
|
|
617
|
-
"delete", help="Delete Package"
|
|
618
|
-
)
|
|
619
|
-
optional = a.add_argument_group("optional named arguments")
|
|
620
|
-
optional.add_argument("-pkg", "--package-name", dest="package_name", default=None,
|
|
621
|
-
help="Package name")
|
|
622
|
-
|
|
623
|
-
optional.add_argument("-p", "--project-name", dest="project_name", default=None,
|
|
624
|
-
help="Project name")
|
|
625
|
-
|
|
626
|
-
#########
|
|
627
|
-
# Shell #
|
|
628
|
-
#########
|
|
629
|
-
# ls
|
|
630
|
-
subparsers.add_parser("ls", help="List directories")
|
|
631
|
-
#
|
|
632
|
-
# pwd
|
|
633
|
-
subparsers.add_parser("pwd", help="Get current working directory")
|
|
634
|
-
|
|
635
|
-
# cd
|
|
636
|
-
subparser = subparsers.add_parser("cd", help="Change current working directory")
|
|
637
|
-
subparser.add_argument(dest='dir')
|
|
638
|
-
|
|
639
|
-
# mkdir
|
|
640
|
-
subparser = subparsers.add_parser("mkdir", help="Make directory")
|
|
641
|
-
subparser.add_argument(dest='name')
|
|
642
|
-
|
|
643
|
-
# clear
|
|
644
|
-
subparsers.add_parser("clear", help="Clear shell")
|
|
645
|
-
|
|
646
|
-
########
|
|
647
|
-
# Exit #
|
|
648
|
-
########
|
|
649
|
-
subparsers.add_parser("exit", help="Exit interactive shell")
|
|
650
|
-
|
|
651
|
-
return parser
|
|
1
|
+
import argparse
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def get_parser():
|
|
5
|
+
"""
|
|
6
|
+
Build the parser for CLI
|
|
7
|
+
:return: parser object
|
|
8
|
+
"""
|
|
9
|
+
parser = argparse.ArgumentParser(
|
|
10
|
+
description="CLI for Dataloop",
|
|
11
|
+
formatter_class=argparse.RawTextHelpFormatter
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
###############
|
|
15
|
+
# sub parsers #
|
|
16
|
+
###############
|
|
17
|
+
subparsers = parser.add_subparsers(dest="operation", help="supported operations")
|
|
18
|
+
|
|
19
|
+
########
|
|
20
|
+
# shell #
|
|
21
|
+
########
|
|
22
|
+
subparsers.add_parser("shell", help="Open interactive Dataloop shell")
|
|
23
|
+
|
|
24
|
+
########
|
|
25
|
+
# shell #
|
|
26
|
+
########
|
|
27
|
+
a = subparsers.add_parser("upgrade", help="Update dtlpy package")
|
|
28
|
+
optional = a.add_argument_group("optional named arguments")
|
|
29
|
+
optional.add_argument("-u", "--url", metavar='\b', help="Package url. default 'dtlpy'", default=None)
|
|
30
|
+
|
|
31
|
+
##################
|
|
32
|
+
# Login / Logout #
|
|
33
|
+
##################
|
|
34
|
+
subparsers.add_parser("logout", help="Logout")
|
|
35
|
+
|
|
36
|
+
subparsers.add_parser("login", help="Login using web Auth0 interface")
|
|
37
|
+
|
|
38
|
+
a = subparsers.add_parser("login-token", help="Login by passing a valid token")
|
|
39
|
+
required = a.add_argument_group("required named arguments")
|
|
40
|
+
required.add_argument(
|
|
41
|
+
"-t", "--token", metavar='\b', help="valid token", required=True
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
a = subparsers.add_parser("login-secret", help="Login client id and secret")
|
|
45
|
+
required = a.add_argument_group("required named arguments")
|
|
46
|
+
required.add_argument(
|
|
47
|
+
"-e", "--email", metavar='\b', help="user email", required=False, default=None
|
|
48
|
+
)
|
|
49
|
+
required.add_argument(
|
|
50
|
+
"-p", "--password", metavar='\b', help="user password", required=False, default=None
|
|
51
|
+
)
|
|
52
|
+
required.add_argument(
|
|
53
|
+
"-i", "--client-id", metavar='\b', help="client id", required=False, default=None
|
|
54
|
+
)
|
|
55
|
+
required.add_argument(
|
|
56
|
+
"-s", "--client-secret", metavar='\b', help="client secret", required=False, default=None
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
a = subparsers.add_parser("login-m2m", help="Login client id and secret")
|
|
60
|
+
required = a.add_argument_group("required named arguments")
|
|
61
|
+
required.add_argument(
|
|
62
|
+
"-e", "--email", metavar='\b', help="user email", required=False, default=None
|
|
63
|
+
)
|
|
64
|
+
required.add_argument(
|
|
65
|
+
"-p", "--password", metavar='\b', help="user password", required=False, default=None
|
|
66
|
+
)
|
|
67
|
+
required.add_argument(
|
|
68
|
+
"-i", "--client-id", metavar='\b', help="client id", required=False, default=None
|
|
69
|
+
)
|
|
70
|
+
required.add_argument(
|
|
71
|
+
"-s", "--client-secret", metavar='\b', help="client secret", required=False, default=None
|
|
72
|
+
)
|
|
73
|
+
########
|
|
74
|
+
# Init #
|
|
75
|
+
########
|
|
76
|
+
subparsers.add_parser("init", help="Initialize a .dataloop context")
|
|
77
|
+
|
|
78
|
+
##################
|
|
79
|
+
# Checkout state #
|
|
80
|
+
##################
|
|
81
|
+
subparsers.add_parser("checkout-state", help="Print checkout state")
|
|
82
|
+
|
|
83
|
+
########
|
|
84
|
+
# Help #
|
|
85
|
+
########
|
|
86
|
+
subparsers.add_parser("help", help="Get help")
|
|
87
|
+
|
|
88
|
+
###########
|
|
89
|
+
# version #
|
|
90
|
+
###########
|
|
91
|
+
parser.add_argument("-v", "--version", action="store_true", help="dtlpy version")
|
|
92
|
+
subparsers.add_parser("version", help="DTLPY SDK version")
|
|
93
|
+
|
|
94
|
+
#######
|
|
95
|
+
# API #
|
|
96
|
+
#######
|
|
97
|
+
subparser = subparsers.add_parser("api", help="Connection and environment")
|
|
98
|
+
subparser_parser = subparser.add_subparsers(dest="api", help="gate operations")
|
|
99
|
+
|
|
100
|
+
# ACTIONS #
|
|
101
|
+
|
|
102
|
+
# info
|
|
103
|
+
subparser_parser.add_parser("info", help="Print api information")
|
|
104
|
+
|
|
105
|
+
# setenv
|
|
106
|
+
a = subparser_parser.add_parser("setenv", help="Set platform environment")
|
|
107
|
+
required = a.add_argument_group("required named arguments")
|
|
108
|
+
required.add_argument("-e", "--env", metavar='\b', help="working environment", required=True)
|
|
109
|
+
|
|
110
|
+
###############
|
|
111
|
+
# Development #
|
|
112
|
+
###############
|
|
113
|
+
subparser = subparsers.add_parser(name="development", help="Start a development session")
|
|
114
|
+
subparser_parser = subparser.add_subparsers(dest="development", help="local development session")
|
|
115
|
+
local_subparser_parser = subparser_parser.add_parser(name="local",
|
|
116
|
+
help="local development using docker and code-server session")
|
|
117
|
+
remote_subparser_parser = subparser_parser.add_parser(name="remote",
|
|
118
|
+
help="remote development (dl.Service) using code-server session")
|
|
119
|
+
|
|
120
|
+
#############################
|
|
121
|
+
# Local Development Session #
|
|
122
|
+
#############################
|
|
123
|
+
# start
|
|
124
|
+
local_subparser_subparser = local_subparser_parser.add_subparsers(dest="local", help="Local development session")
|
|
125
|
+
a = local_subparser_subparser.add_parser(name="start", help="Start a local development session")
|
|
126
|
+
optional = a.add_argument_group("optional named arguments")
|
|
127
|
+
optional.add_argument("-p", "--port",
|
|
128
|
+
default=None,
|
|
129
|
+
help="Local port for the docker connection, default: 5802")
|
|
130
|
+
optional.add_argument("-d", "--docker-image",
|
|
131
|
+
default=None,
|
|
132
|
+
help="Docker image to create. default: 'dataloopai/dtlpy-agent:1.57.3.gpu.cuda11.5.py3.8.opencv'")
|
|
133
|
+
# pause
|
|
134
|
+
_ = local_subparser_subparser.add_parser(name="pause", help="Pause the local development session (container pause)")
|
|
135
|
+
# stop
|
|
136
|
+
_ = local_subparser_subparser.add_parser(name="stop", help="Stop the local development session (container kill)")
|
|
137
|
+
##############################
|
|
138
|
+
# Remote Development Session #
|
|
139
|
+
##############################
|
|
140
|
+
|
|
141
|
+
############
|
|
142
|
+
# Projects #
|
|
143
|
+
############
|
|
144
|
+
subparser = subparsers.add_parser("projects", help="Operations with projects")
|
|
145
|
+
subparser_parser = subparser.add_subparsers(dest="projects", help="projects operations")
|
|
146
|
+
|
|
147
|
+
# ACTIONS #
|
|
148
|
+
|
|
149
|
+
# list
|
|
150
|
+
subparser_parser.add_parser("ls", help="List all projects")
|
|
151
|
+
|
|
152
|
+
# create
|
|
153
|
+
a = subparser_parser.add_parser("create", help="Create a new project")
|
|
154
|
+
required = a.add_argument_group("required named arguments")
|
|
155
|
+
required.add_argument("-p", "--project-name", metavar='\b', help="project name")
|
|
156
|
+
|
|
157
|
+
# checkout
|
|
158
|
+
a = subparser_parser.add_parser("checkout", help="checkout a project")
|
|
159
|
+
required = a.add_argument_group("required named arguments")
|
|
160
|
+
required.add_argument("-p", "--project-name", metavar='\b', help="project name")
|
|
161
|
+
|
|
162
|
+
# open web
|
|
163
|
+
a = subparser_parser.add_parser("web", help="Open in web browser")
|
|
164
|
+
optional = a.add_argument_group("optional named arguments")
|
|
165
|
+
optional.add_argument("-p", "--project-name", metavar='\b', help="project name")
|
|
166
|
+
|
|
167
|
+
############
|
|
168
|
+
# Datasets #
|
|
169
|
+
############
|
|
170
|
+
subparser = subparsers.add_parser("datasets", help="Operations with datasets")
|
|
171
|
+
subparser_parser = subparser.add_subparsers(dest="datasets", help="datasets operations")
|
|
172
|
+
|
|
173
|
+
# ACTIONS #
|
|
174
|
+
# open web
|
|
175
|
+
a = subparser_parser.add_parser("web", help="Open in web browser")
|
|
176
|
+
optional = a.add_argument_group("optional named arguments")
|
|
177
|
+
optional.add_argument("-p", "--project-name", metavar='\b', help="project name")
|
|
178
|
+
optional.add_argument("-d", "--dataset-name", metavar='\b', help="dataset name")
|
|
179
|
+
|
|
180
|
+
# list
|
|
181
|
+
a = subparser_parser.add_parser("ls", help="List of datasets in project")
|
|
182
|
+
optional = a.add_argument_group("optional named arguments")
|
|
183
|
+
optional.add_argument("-p", "--project-name", metavar='\b', default=None,
|
|
184
|
+
help="project name. Default taken from checked out (if checked out)")
|
|
185
|
+
|
|
186
|
+
# create
|
|
187
|
+
a = subparser_parser.add_parser("create", help="Create a new dataset")
|
|
188
|
+
required = a.add_argument_group("required named arguments")
|
|
189
|
+
required.add_argument("-d", "--dataset-name", metavar='\b', help="dataset name", required=True)
|
|
190
|
+
optional = a.add_argument_group("optional named arguments")
|
|
191
|
+
optional.add_argument("-p", "--project-name", metavar='\b', default=None,
|
|
192
|
+
help="project name. Default taken from checked out (if checked out)")
|
|
193
|
+
optional.add_argument("-c", "--checkout", action='store_true', default=False, help="checkout the new dataset")
|
|
194
|
+
|
|
195
|
+
# checkout
|
|
196
|
+
a = subparser_parser.add_parser("checkout", help="checkout a dataset")
|
|
197
|
+
required = a.add_argument_group("required named arguments")
|
|
198
|
+
required.add_argument("-d", "--dataset-name", metavar='\b', help="dataset name")
|
|
199
|
+
optional = a.add_argument_group("optional named arguments")
|
|
200
|
+
optional.add_argument("-p", "--project-name", metavar='\b', default=None,
|
|
201
|
+
help="project name. Default taken from checked out (if checked out)")
|
|
202
|
+
|
|
203
|
+
#########
|
|
204
|
+
# items #
|
|
205
|
+
#########
|
|
206
|
+
subparser = subparsers.add_parser("items", help="Operations with items")
|
|
207
|
+
subparser_parser = subparser.add_subparsers(dest="items", help="items operations")
|
|
208
|
+
|
|
209
|
+
# ACTIONS #
|
|
210
|
+
|
|
211
|
+
a = subparser_parser.add_parser("web", help="Open in web browser")
|
|
212
|
+
required = a.add_argument_group("required named arguments")
|
|
213
|
+
required.add_argument("-r", "--remote-path", metavar='\b', help="remote path")
|
|
214
|
+
optional = a.add_argument_group("optional named arguments")
|
|
215
|
+
optional.add_argument("-p", "--project-name", metavar='\b', help="project name")
|
|
216
|
+
optional.add_argument("-d", "--dataset-name", metavar='\b', help="dataset name")
|
|
217
|
+
|
|
218
|
+
# list
|
|
219
|
+
a = subparser_parser.add_parser("ls", help="List of items in dataset")
|
|
220
|
+
optional = a.add_argument_group("optional named arguments")
|
|
221
|
+
optional.add_argument("-p", "--project-name", metavar='\b', default=None,
|
|
222
|
+
help="project name. Default taken from checked out (if checked out)")
|
|
223
|
+
optional.add_argument("-d", "--dataset-name", metavar='\b', default=None,
|
|
224
|
+
help="dataset name. Default taken from checked out (if checked out)")
|
|
225
|
+
optional.add_argument("-o", "--page", metavar='\b', help="page number (integer)", default=0)
|
|
226
|
+
optional.add_argument("-r", "--remote-path", metavar='\b', help="remote path", default=None)
|
|
227
|
+
optional.add_argument("-t", "--type", metavar='\b', help="Item type", default=None)
|
|
228
|
+
|
|
229
|
+
# upload
|
|
230
|
+
a = subparser_parser.add_parser("upload", help="Upload directory to dataset")
|
|
231
|
+
required = a.add_argument_group("required named arguments")
|
|
232
|
+
required.add_argument("-l", "--local-path", required=True, metavar='\b',
|
|
233
|
+
help="local path")
|
|
234
|
+
optional = a.add_argument_group("optional named arguments")
|
|
235
|
+
optional.add_argument("-p", "--project-name", metavar='\b', default=None,
|
|
236
|
+
help="project name. Default taken from checked out (if checked out)")
|
|
237
|
+
optional.add_argument("-d", "--dataset-name", metavar='\b', default=None,
|
|
238
|
+
help="dataset name. Default taken from checked out (if checked out)")
|
|
239
|
+
optional.add_argument("-r", "--remote-path", metavar='\b', default=None,
|
|
240
|
+
help="remote path to upload to. default: /")
|
|
241
|
+
optional.add_argument("-f", "--file-types", metavar='\b', default=None,
|
|
242
|
+
help='Comma separated list of file types to upload, e.g ".jpg,.png". default: all')
|
|
243
|
+
optional.add_argument("-lap", "--local-annotations-path", metavar='\b', default=None,
|
|
244
|
+
help="Path for local annotations to upload with items")
|
|
245
|
+
optional.add_argument("-ow", "--overwrite", dest="overwrite", action='store_true', default=False,
|
|
246
|
+
help="Overwrite existing item")
|
|
247
|
+
|
|
248
|
+
# download
|
|
249
|
+
a = subparser_parser.add_parser("download", help="Download dataset to a local directory")
|
|
250
|
+
optional = a.add_argument_group("optional named arguments")
|
|
251
|
+
optional.add_argument("-p", "--project-name", metavar='\b', default=None,
|
|
252
|
+
help="project name. Default taken from checked out (if checked out)")
|
|
253
|
+
optional.add_argument("-d", "--dataset-name", metavar='\b', default=None,
|
|
254
|
+
help="dataset name. Default taken from checked out (if checked out)")
|
|
255
|
+
optional.add_argument("-ao", "--annotation-options", metavar='\b',
|
|
256
|
+
help="which annotation to download. options: json,instance,mask", default=None)
|
|
257
|
+
optional.add_argument("-aft", "--annotation-filter-type", metavar='\b',
|
|
258
|
+
help="annotation type filter when downloading annotations. "
|
|
259
|
+
"options: box,segment,binary etc", default=None)
|
|
260
|
+
optional.add_argument("-afl", "--annotation-filter-label", metavar='\b',
|
|
261
|
+
help="labels filter when downloading annotations.", default=None)
|
|
262
|
+
optional.add_argument("-r", "--remote-path", metavar='\b', default=None,
|
|
263
|
+
help="remote path to upload to. default: /")
|
|
264
|
+
optional.add_argument("-ow", "--overwrite", action='store_true', default=False,
|
|
265
|
+
help="Overwrite existing item")
|
|
266
|
+
optional.add_argument("-t", "--not-items-folder", action='store_true', default=False,
|
|
267
|
+
help="Download WITHOUT 'items' folder")
|
|
268
|
+
optional.add_argument("-wt", "--with-text", action='store_true', default=False,
|
|
269
|
+
help="Annotations will have text in mask")
|
|
270
|
+
optional.add_argument("-th", "--thickness", metavar='\b', default="1",
|
|
271
|
+
help="Annotation line thickness")
|
|
272
|
+
optional.add_argument("-l", "--local-path", metavar='\b', default=None,
|
|
273
|
+
help="local path")
|
|
274
|
+
optional.add_argument("-wb", "--without-binaries", action='store_true', default=False,
|
|
275
|
+
help="Don't download item binaries")
|
|
276
|
+
|
|
277
|
+
##########
|
|
278
|
+
# videos #
|
|
279
|
+
##########
|
|
280
|
+
subparser = subparsers.add_parser("videos", help="Operations with videos")
|
|
281
|
+
subparser_parser = subparser.add_subparsers(dest="videos", help="videos operations")
|
|
282
|
+
|
|
283
|
+
# ACTIONS #
|
|
284
|
+
|
|
285
|
+
# play
|
|
286
|
+
a = subparser_parser.add_parser("play", help="Play video")
|
|
287
|
+
optional = a.add_argument_group("optional named arguments")
|
|
288
|
+
optional.add_argument(
|
|
289
|
+
"-l",
|
|
290
|
+
"--item-path",
|
|
291
|
+
metavar='\b',
|
|
292
|
+
default=None,
|
|
293
|
+
help="Video remote path in platform. e.g /dogs/dog.mp4",
|
|
294
|
+
)
|
|
295
|
+
optional.add_argument(
|
|
296
|
+
"-p",
|
|
297
|
+
"--project-name",
|
|
298
|
+
metavar='\b',
|
|
299
|
+
default=None,
|
|
300
|
+
help="project name. Default taken from checked out (if checked out)",
|
|
301
|
+
)
|
|
302
|
+
optional.add_argument(
|
|
303
|
+
"-d",
|
|
304
|
+
"--dataset-name",
|
|
305
|
+
metavar='\b',
|
|
306
|
+
default=None,
|
|
307
|
+
help="dataset name. Default taken from checked out (if checked out)",
|
|
308
|
+
)
|
|
309
|
+
|
|
310
|
+
# upload
|
|
311
|
+
a = subparser_parser.add_parser("upload", help="Upload a single video")
|
|
312
|
+
required = a.add_argument_group("required named arguments")
|
|
313
|
+
required.add_argument(
|
|
314
|
+
"-f", "--filename", metavar='\b', help="local filename to upload", required=True
|
|
315
|
+
)
|
|
316
|
+
required.add_argument(
|
|
317
|
+
"-p", "--project-name", metavar='\b', help="project name", required=True
|
|
318
|
+
)
|
|
319
|
+
required.add_argument(
|
|
320
|
+
"-d", "--dataset-name", metavar='\b', help="dataset name", required=True
|
|
321
|
+
)
|
|
322
|
+
optional = a.add_argument_group("optional named arguments")
|
|
323
|
+
optional.add_argument(
|
|
324
|
+
"-r", "--remote-path", metavar='\b', help="remote path", default="/"
|
|
325
|
+
)
|
|
326
|
+
|
|
327
|
+
# split video to chunks
|
|
328
|
+
optional.add_argument(
|
|
329
|
+
"-sc",
|
|
330
|
+
"--split-chunks",
|
|
331
|
+
metavar='\b',
|
|
332
|
+
default=None,
|
|
333
|
+
help="Video splitting parameter: Number of chunks to split",
|
|
334
|
+
)
|
|
335
|
+
optional.add_argument(
|
|
336
|
+
"-ss",
|
|
337
|
+
"--split-seconds",
|
|
338
|
+
metavar='\b',
|
|
339
|
+
default=None,
|
|
340
|
+
help="Video splitting parameter: Seconds of each chuck",
|
|
341
|
+
)
|
|
342
|
+
optional.add_argument(
|
|
343
|
+
"-st",
|
|
344
|
+
"--split-times",
|
|
345
|
+
metavar='\b',
|
|
346
|
+
default=None,
|
|
347
|
+
help="Video splitting parameter: List of seconds to split at. e.g 600,1800,2000",
|
|
348
|
+
)
|
|
349
|
+
# encode
|
|
350
|
+
optional.add_argument(
|
|
351
|
+
"-e",
|
|
352
|
+
"--encode",
|
|
353
|
+
action="store_true",
|
|
354
|
+
default=False,
|
|
355
|
+
help="encode video to mp4, remove bframes and upload",
|
|
356
|
+
)
|
|
357
|
+
|
|
358
|
+
###############
|
|
359
|
+
# Application #
|
|
360
|
+
###############
|
|
361
|
+
subparser = subparsers.add_parser("app", help="Operations with application")
|
|
362
|
+
subparser_parser = subparser.add_subparsers(dest="app", help="application operations")
|
|
363
|
+
|
|
364
|
+
# ACTIONS #
|
|
365
|
+
|
|
366
|
+
# init
|
|
367
|
+
a = subparser_parser.add_parser('init', help="Initialize the structure in order to deploy a dpk")
|
|
368
|
+
optional = a.add_argument_group("Optional named arguments")
|
|
369
|
+
optional.add_argument('--name', required=False, dest='name', help="the name of the app")
|
|
370
|
+
optional.add_argument('--description', required=False, dest='description', help="the description of the app")
|
|
371
|
+
optional.add_argument('--attributes', required=False, dest='attributes',
|
|
372
|
+
help="the attributes of the app (comma separated)")
|
|
373
|
+
optional.add_argument('--icon', required=False, dest='icon', help="the icon of the app")
|
|
374
|
+
optional.add_argument('--scope', required=False, dest='scope',
|
|
375
|
+
help="the scope of the app (default is organization)")
|
|
376
|
+
# add components
|
|
377
|
+
a = subparser_parser.add_parser('add', help="Add component to the dataloop json file")
|
|
378
|
+
optional = a.add_argument_group("Optional named arguments")
|
|
379
|
+
optional.add_argument('--panel', action='store_true', help="builder for panel component")
|
|
380
|
+
optional.add_argument('--module', action='store_true', help="builder for module component")
|
|
381
|
+
optional.add_argument('--toolbar', action='store_true', help="builder for toolbar component")
|
|
382
|
+
|
|
383
|
+
# pack
|
|
384
|
+
a = subparser_parser.add_parser("pack", help="Pack the project as dpk file")
|
|
385
|
+
# publish
|
|
386
|
+
a = subparser_parser.add_parser("publish", help="Publish the app")
|
|
387
|
+
optional = a.add_argument_group("Optional named arguments")
|
|
388
|
+
optional.add_argument("--project-name", dest="project_name", help="The name of the project")
|
|
389
|
+
optional.add_argument("--project-id", dest="project_id", help="The ID of the project")
|
|
390
|
+
|
|
391
|
+
# update
|
|
392
|
+
a = subparser_parser.add_parser("update", help="Update the app")
|
|
393
|
+
required = a.add_argument_group("Required named arguments")
|
|
394
|
+
required.add_argument("--app-name", dest="app_name", required=True, help="Locates the app by the name")
|
|
395
|
+
required.add_argument("--new-version", dest="new_version", required=True,
|
|
396
|
+
help="Sets the new version of the specified app")
|
|
397
|
+
optional = a.add_argument_group("Required named arguments")
|
|
398
|
+
optional.add_argument("--project-id", dest="project_id", default=None, help="The id of the project")
|
|
399
|
+
optional.add_argument("--project-name", dest="project_name", default=None, help="The name of the project")
|
|
400
|
+
|
|
401
|
+
# install
|
|
402
|
+
a = subparser_parser.add_parser("install", help="Install the app to the platform")
|
|
403
|
+
required = a.add_argument_group("Required named arguments")
|
|
404
|
+
required.add_argument("--dpk-id", dest="dpk_id", required=True, help="The id of the dpk")
|
|
405
|
+
optional = a.add_argument_group("Optional named arguments")
|
|
406
|
+
optional.add_argument("--project-id", dest="project_id", default=None, help="The id of the project")
|
|
407
|
+
optional.add_argument("--project-name", dest="project_name", default=None, help="The name of the project")
|
|
408
|
+
optional.add_argument("--org-id", dest="org_id", default=None, help="The name of the org")
|
|
409
|
+
|
|
410
|
+
# pull
|
|
411
|
+
a = subparser_parser.add_parser('pull', help="Pull the app from the marketplace")
|
|
412
|
+
required = a.add_argument_group("Required named arguments")
|
|
413
|
+
required.add_argument('--dpk-name', dest='app_name', required=True, help='The name of the dpk')
|
|
414
|
+
|
|
415
|
+
# list
|
|
416
|
+
a = subparser_parser.add_parser('list', help="List all installed apps")
|
|
417
|
+
required = a.add_argument_group("Required named arguments")
|
|
418
|
+
required.add_argument('--project-name', dest='project_name', required=False, help='The name of the project')
|
|
419
|
+
|
|
420
|
+
############
|
|
421
|
+
# Services #
|
|
422
|
+
############
|
|
423
|
+
subparser = subparsers.add_parser("services", help="Operations with services")
|
|
424
|
+
subparser_parser = subparser.add_subparsers(dest="services", help="services operations")
|
|
425
|
+
|
|
426
|
+
# ACTIONS #
|
|
427
|
+
|
|
428
|
+
# execute
|
|
429
|
+
a = subparser_parser.add_parser("execute", help="Create an execution")
|
|
430
|
+
optional = a.add_argument_group("optional named arguments")
|
|
431
|
+
optional.add_argument("-f", "--function-name", dest="function_name", default=None,
|
|
432
|
+
help="which function to run")
|
|
433
|
+
optional.add_argument("-s", "--service-name", dest="service_name", default=None,
|
|
434
|
+
help="which service to run")
|
|
435
|
+
optional.add_argument("-pr", "--project-name", dest="project_name", default=None,
|
|
436
|
+
help="Project name")
|
|
437
|
+
optional.add_argument("-as", "--async", dest="asynchronous", default=True, action='store_false',
|
|
438
|
+
help="Async execution ")
|
|
439
|
+
optional.add_argument("-i", "--item-id", dest="item_id", default=None,
|
|
440
|
+
help="Item input")
|
|
441
|
+
optional.add_argument("-d", "--dataset-id", dest="dataset_id", default=None,
|
|
442
|
+
help="Dataset input")
|
|
443
|
+
optional.add_argument("-a", "--annotation-id", dest="annotation_id", default=None,
|
|
444
|
+
help="Annotation input")
|
|
445
|
+
optional.add_argument("-in", "--inputs", dest="inputs", default='{}',
|
|
446
|
+
help="Dictionary string input")
|
|
447
|
+
|
|
448
|
+
# tear-down
|
|
449
|
+
a = subparser_parser.add_parser(
|
|
450
|
+
"tear-down", help="tear-down service of service.json file"
|
|
451
|
+
)
|
|
452
|
+
optional = a.add_argument_group("optional named arguments")
|
|
453
|
+
optional.add_argument("-l", "--local-path", dest="local_path", default=None,
|
|
454
|
+
help="path to service.json file")
|
|
455
|
+
optional.add_argument("-pr", "--project-name", dest="project_name", default=None,
|
|
456
|
+
help="Project name")
|
|
457
|
+
|
|
458
|
+
# ls
|
|
459
|
+
a = subparser_parser.add_parser("ls", help="List project's services")
|
|
460
|
+
optional = a.add_argument_group("optional named arguments")
|
|
461
|
+
optional.add_argument("-pr", "--project-name", dest="project_name", default=None,
|
|
462
|
+
help="Project name")
|
|
463
|
+
optional.add_argument("-pkg", "--package-name", dest="package_name", default=None,
|
|
464
|
+
help="Package name")
|
|
465
|
+
|
|
466
|
+
# log
|
|
467
|
+
a = subparser_parser.add_parser("log", help="Get services log")
|
|
468
|
+
optional = a.add_argument_group("required named arguments")
|
|
469
|
+
optional.add_argument("-pr", "--project-name", dest="project_name", default=None,
|
|
470
|
+
help="Project name")
|
|
471
|
+
optional.add_argument("-f", "--service-name", dest="service_name", default=None,
|
|
472
|
+
help="Project name")
|
|
473
|
+
optional.add_argument("-t", "--start", dest="start", default=None,
|
|
474
|
+
help="Log start time")
|
|
475
|
+
|
|
476
|
+
# delete
|
|
477
|
+
a = subparser_parser.add_parser("delete", help="Delete Service")
|
|
478
|
+
optional = a.add_argument_group("optional named arguments")
|
|
479
|
+
optional.add_argument("-f", "--service-name", dest="service_name", default=None,
|
|
480
|
+
help="Service name")
|
|
481
|
+
optional.add_argument("-p", "--project-name", dest="project_name", default=None,
|
|
482
|
+
help="Project name")
|
|
483
|
+
optional.add_argument("-pkg", "--package-name", dest="package_name", default=None,
|
|
484
|
+
help="Package name")
|
|
485
|
+
|
|
486
|
+
############
|
|
487
|
+
# Triggers #
|
|
488
|
+
############
|
|
489
|
+
subparser = subparsers.add_parser("triggers", help="Operations with triggers")
|
|
490
|
+
subparser_parser = subparser.add_subparsers(dest="triggers", help="triggers operations")
|
|
491
|
+
|
|
492
|
+
# ACTIONS #
|
|
493
|
+
# create
|
|
494
|
+
a = subparser_parser.add_parser("create", help="Create a Service Trigger")
|
|
495
|
+
required = a.add_argument_group("required named arguments")
|
|
496
|
+
required.add_argument("-r", "--resource", dest="resource",
|
|
497
|
+
help="Resource name", required=True)
|
|
498
|
+
required.add_argument("-a", "--actions", dest="actions", help="Actions", required=True)
|
|
499
|
+
|
|
500
|
+
optional = a.add_argument_group("optional named arguments")
|
|
501
|
+
optional.add_argument("-p", "--project-name", dest="project_name", default=None,
|
|
502
|
+
help="Project name")
|
|
503
|
+
optional.add_argument("-pkg", "--package-name", dest="package_name", default=None,
|
|
504
|
+
help="Package name")
|
|
505
|
+
optional.add_argument("-f", "--service-name", dest="service_name",
|
|
506
|
+
help="Service name", default=None)
|
|
507
|
+
optional.add_argument("-n", "--name", dest="name",
|
|
508
|
+
help="Trigger name", default=None)
|
|
509
|
+
optional.add_argument("-fl", "--filters", dest="filters", default='{}',
|
|
510
|
+
help="Json filter")
|
|
511
|
+
optional.add_argument("-fn", "--function-name", dest="function_name", default='run',
|
|
512
|
+
help="Function name")
|
|
513
|
+
|
|
514
|
+
# delete
|
|
515
|
+
a = subparser_parser.add_parser("delete", help="Delete Trigger")
|
|
516
|
+
required = a.add_argument_group("required named arguments")
|
|
517
|
+
required.add_argument("-t", "--trigger-name", dest="trigger_name", default=None,
|
|
518
|
+
help="Trigger name", required=True)
|
|
519
|
+
|
|
520
|
+
optional = a.add_argument_group("optional named arguments")
|
|
521
|
+
optional.add_argument("-f", "--service-name", dest="service_name", default=None,
|
|
522
|
+
help="Service name")
|
|
523
|
+
optional.add_argument("-p", "--project-name", dest="project_name", default=None,
|
|
524
|
+
help="Project name")
|
|
525
|
+
optional.add_argument("-pkg", "--package-name", dest="package_name", default=None,
|
|
526
|
+
help="Package name")
|
|
527
|
+
|
|
528
|
+
a = subparser_parser.add_parser("ls", help="List triggers")
|
|
529
|
+
optional = a.add_argument_group("optional named arguments")
|
|
530
|
+
optional.add_argument("-pr", "--project-name", dest="project_name", default=None,
|
|
531
|
+
help="Project name")
|
|
532
|
+
optional.add_argument("-pkg", "--package-name", dest="package_name", default=None,
|
|
533
|
+
help="Package name")
|
|
534
|
+
optional.add_argument("-s", "--service-name", dest="service_name", default=None,
|
|
535
|
+
help="Service name")
|
|
536
|
+
|
|
537
|
+
############
|
|
538
|
+
# Deploy #
|
|
539
|
+
############
|
|
540
|
+
# subparsers.add_parser("deploy", help="Login using web Auth0 interface")
|
|
541
|
+
|
|
542
|
+
a = subparsers.add_parser("deploy", help="deploy with json file")
|
|
543
|
+
required = a.add_argument_group("required named arguments")
|
|
544
|
+
required.add_argument("-f", dest="json_file", default=None,
|
|
545
|
+
help="Path to json file")
|
|
546
|
+
required.add_argument("-p", dest="project_name", default=None,
|
|
547
|
+
help="Project name")
|
|
548
|
+
|
|
549
|
+
############
|
|
550
|
+
# Generate #
|
|
551
|
+
############
|
|
552
|
+
# subparsers.add_parser("deploy", help="Login using web Auth0 interface")
|
|
553
|
+
|
|
554
|
+
a = subparsers.add_parser("generate", help="generate a json file")
|
|
555
|
+
optional = a.add_argument_group("optional named arguments")
|
|
556
|
+
optional.add_argument("--option", dest="package_type", default=None,
|
|
557
|
+
help="cataluge of examples")
|
|
558
|
+
optional.add_argument("-p", "--package-name", dest="package_name", default=None,
|
|
559
|
+
help="Package name")
|
|
560
|
+
|
|
561
|
+
############
|
|
562
|
+
# packages #
|
|
563
|
+
############
|
|
564
|
+
subparser = subparsers.add_parser("packages", help="Operations with packages")
|
|
565
|
+
subparser_parser = subparser.add_subparsers(
|
|
566
|
+
dest="packages", help="package operations"
|
|
567
|
+
)
|
|
568
|
+
|
|
569
|
+
# ACTIONS #
|
|
570
|
+
# ls
|
|
571
|
+
a = subparser_parser.add_parser("ls", help="List packages")
|
|
572
|
+
optional = a.add_argument_group("optional named arguments")
|
|
573
|
+
optional.add_argument("-p", "--project-name", dest="project_name", default=None,
|
|
574
|
+
help="Project name")
|
|
575
|
+
|
|
576
|
+
# push
|
|
577
|
+
a = subparser_parser.add_parser("push", help="Create package in platform")
|
|
578
|
+
|
|
579
|
+
optional = a.add_argument_group("optional named arguments")
|
|
580
|
+
optional.add_argument("-src", "--src-path", metavar='\b', default=None,
|
|
581
|
+
help="Revision to deploy if selected True")
|
|
582
|
+
optional.add_argument("-cid", "--codebase-id", metavar='\b', default=None,
|
|
583
|
+
help="Revision to deploy if selected True")
|
|
584
|
+
optional.add_argument("-pr", "--project-name", metavar='\b', default=None,
|
|
585
|
+
help="Project name")
|
|
586
|
+
optional.add_argument("-p", "--package-name", metavar='\b', default=None,
|
|
587
|
+
help="Package name")
|
|
588
|
+
optional.add_argument("-c", "--checkout", action='store_true', default=False, help="checkout the new package")
|
|
589
|
+
|
|
590
|
+
# deploy
|
|
591
|
+
a = subparser_parser.add_parser("deploy", help="Deploy package to platform")
|
|
592
|
+
optional = a.add_argument_group("optional named arguments")
|
|
593
|
+
optional.add_argument("-p", "--package-name", metavar='\b', default=None,
|
|
594
|
+
help="Package name")
|
|
595
|
+
optional.add_argument("-pr", "--project-name", metavar='\b', default=None,
|
|
596
|
+
help="Project name")
|
|
597
|
+
optional.add_argument("--module-name", metavar='\b', default='default_module',
|
|
598
|
+
help="Package module name")
|
|
599
|
+
optional.add_argument("-c", "--checkout", action='store_true', default=False, help="checkout the new package")
|
|
600
|
+
|
|
601
|
+
# test
|
|
602
|
+
a = subparser_parser.add_parser(
|
|
603
|
+
"test", help="Tests that Package locally using mock.json"
|
|
604
|
+
)
|
|
605
|
+
optional = a.add_argument_group("optional named arguments")
|
|
606
|
+
optional.add_argument("-c", "--concurrency", metavar='\b', default=10,
|
|
607
|
+
help="Revision to deploy if selected True")
|
|
608
|
+
optional.add_argument("-f", "--function-name", metavar='\b', default='run',
|
|
609
|
+
help="Function to test")
|
|
610
|
+
# checkout
|
|
611
|
+
a = subparser_parser.add_parser("checkout", help="checkout a package")
|
|
612
|
+
required = a.add_argument_group("required named arguments")
|
|
613
|
+
required.add_argument("-p", "--package-name", metavar='\b', help="package name")
|
|
614
|
+
|
|
615
|
+
# delete
|
|
616
|
+
a = subparser_parser.add_parser(
|
|
617
|
+
"delete", help="Delete Package"
|
|
618
|
+
)
|
|
619
|
+
optional = a.add_argument_group("optional named arguments")
|
|
620
|
+
optional.add_argument("-pkg", "--package-name", dest="package_name", default=None,
|
|
621
|
+
help="Package name")
|
|
622
|
+
|
|
623
|
+
optional.add_argument("-p", "--project-name", dest="project_name", default=None,
|
|
624
|
+
help="Project name")
|
|
625
|
+
|
|
626
|
+
#########
|
|
627
|
+
# Shell #
|
|
628
|
+
#########
|
|
629
|
+
# ls
|
|
630
|
+
subparsers.add_parser("ls", help="List directories")
|
|
631
|
+
#
|
|
632
|
+
# pwd
|
|
633
|
+
subparsers.add_parser("pwd", help="Get current working directory")
|
|
634
|
+
|
|
635
|
+
# cd
|
|
636
|
+
subparser = subparsers.add_parser("cd", help="Change current working directory")
|
|
637
|
+
subparser.add_argument(dest='dir')
|
|
638
|
+
|
|
639
|
+
# mkdir
|
|
640
|
+
subparser = subparsers.add_parser("mkdir", help="Make directory")
|
|
641
|
+
subparser.add_argument(dest='name')
|
|
642
|
+
|
|
643
|
+
# clear
|
|
644
|
+
subparsers.add_parser("clear", help="Clear shell")
|
|
645
|
+
|
|
646
|
+
########
|
|
647
|
+
# Exit #
|
|
648
|
+
########
|
|
649
|
+
subparsers.add_parser("exit", help="Exit interactive shell")
|
|
650
|
+
|
|
651
|
+
return parser
|