Skip to main content
Version: LOC v0.8 (legacy)

Project, Scenario and Data Process

CLI commands for managing assets in LOC:

Also see:

info

Some commands require to be logged in the LOC server.

Do not manually edit anything under /.loc - use CLI commands to manage assets instead.

Project

loc project

A project contains a collection of scenarios.

List All Projects

loc project list|ls [--remote]
OptionDescription
--remoteList remote projects on LOC server instead. If not provided, the local projects (deployed or not) would be listed.

Create a New Project

loc project create|new [OPTIONS]
OptionDescription
--unit-id <UNIT ID>Unit ID the project to be created in
--name <NAME>*Project name
---description <DESCRIPTION>*Project description (can be blank)

*= will be prompted if not provided

Inspect a Project

loc project get [OPTIONS]

Get information of a project with either its name or ID.

OptionDescription
--project-name <NAME>*Project name
--project-id <ID>Project ID

*= will be prompted if not provided

Edit a Project

loc project edit [OPTIONS]

Edit name and description of a project.

The options, if not provided as parameters, would be prompted by CLI (by letting you select from available projects):

OptionDescription
--project-name <NAME>*Name of project to be edited
--project-id <ID>ID of project to be edited
--name <NEW NAME>*New project name
--description <NEW DESCRIPTION>*New project description
--unit-id <UNIT ID>New binding unit ID for the project

*= will be prompted if not provided

Delete a Project

loc project delete [OPTIONS] [--remote]
OptionDescription
--project-name <NAME>*Name of project to be deleted
--project-id <ID>ID of project to be deleted
--remoteDelete the deployed project on LOC server and remove its ID from local workspace. If not provided, the project would only be deleted locally.

*= will be prompted if not provided

note

A project cannot be deleted if it contains any data processes.

Deploy a Project (with its Scenarios and Data Processes)

Sync the remote project with your local version

loc project deploy

Upload and overwrite a project (will be prompted by CLI) with all its scenarios/data processes to LOC server. This action is the equivalent to Git's git commit plus git push at the project level.

info

Be noted that any changes on LOC server will be overwritten. Run loc project pull to sync your local project first.

Deploy a locally-deleted asset will sync the deletion to the remote asset.

Deploying/updating a project also won't deploy/update any logic.

Pull a Project

Sync the local project with its remote version

loc project pull

Pull a project from LOC server and sync (overwrite) to local workspace, equivalent to Git's git fetch --force at the project level (do not affect logic or logic source files). If the local project does not exist, it will be created.

warning

If you delete a remote project, scenario or data process in Studio, the local metadata will cause the pulling not working properly since the remote asset ceased to exist. You can delete the asset locally then use [loc project deploy] to sync the deletion.

Scenario

loc scenario

A scenario belongs to a project and contains a collection of data processes.

List All Scenarios

loc scenario list|ls [--remote]
OptionDescription
--remoteList remote scenarios on LOC server instead. If not provided, the local scenarios (deployed or not) would be listed.

Create a Scenario

loc scenario create|new [OPTIONS]
OptionDescription
--name <NAME>*Scenario name
--description <DESCRIPTION>*Scenario description (can be blank)
--project-name <PROJECT NAME>*Linked project name
--project-id <PROJECT ID>Linked project ID

*= will be prompted if not provided

Inspect a Scenario

loc scenario get [OPTIONS]

Get information of a scenario with either its name or ID.

OptionDescription
--scenario-name <NAME>*Scenario name (will be prompted if not provided)
--scenario-id <ID>Scenario ID

*= will be prompted if not provided

Edit a Scenario

loc scenario edit [OPTIONS]
OptionDescription
--scenario-name <NAME>*Name of scenario to be edited
--scenario-id <ID>Scenario ID
--name <NEW NAME>*New scenario ID
--description <NEW DESCRIPTION>*New scenario description (can be blank)

*= will be prompted if not provided

Delete a Scenario

loc scenario delete [OPTIONS]
OptionDescription
--scenario-name <NAME>*Name of scenario to be deleted
--scenario-id <ID>Scenario ID
---remoteDelete the deployed scenario on LOC server and remove its ID from local workspace. If not provided, only the local scenario would be deleted.

*= will be prompted if not provided

note

A scenario cannot be deleted if it contains any data processes.

Data Process

loc data-process|dp

A data process (the LOC data pipeline) belongs to a scenario and is consisted with at least one generic logic and only one aggregator logic.

List All Data Processes

loc dp list|ls [--remote]
OptionDescription
--remoteList the remote data processes on LOC server instead. If not provided, the local data process (deployed or not) would be listed.

Create a Data Process

loc dp create|new [OPTIONS]
OptionDescription
--name <NAME>*Data process name
--description <DESCRIPTION>*Data process decription (can be blank)

*= will be prompted if not provided

Inspect a Data Process

loc dp get [OPTIONS]

Get information of a data process with either its name or PID.

OptionDescription
--data-process-name <NAME>*Data process name
--data-process-permanent-identity <PID>Data process permanent ID
--remoteOnly query the remote data process on LOC server. Otherwise, a local data process (deployed or not) will be shown.

*= will be prompted if not provided

Edit a Data Process (Including Linking/Unlinking Logic)

loc dp edit [--name <DP NAME TO BE EDITED>]

Edit a data process, including link or unlink generic/aggregator logic in it.

CLI will prompt you to select a project, a scenario (if you did not select them with loc checkout) and a data process (if --name is not provided).

You can change the data process' name and description, then CLI will prompt you to press e to edit linked logic.

note

A data process can be deployed even though it has no linked logic. (However it will not be eligible to be executed.)

Only deployed logic (which have PIDs in /.loc/logic-manifest.yaml) can be linked. This also means this command requires to be logged in to access the remote logic.

If the logic has multiple revisions existing on LOC server, CLI will also prompt you to select a revision.

Delete a Data Process

loc dp delete [OPTIONS]
OptionDescription
--data-process-name <NAME>*Name of data process to be deleted
--data-process-permanent-identity <PID>Permanent ID of data process to be deleted
--remoteDelete the remote data process on LOC server and remove its PID from local workspace. If not provided, only the local data process (deployed or not) will be deleted.

*= will be prompted if not provided

note

A data process can be deleted even though it has linked logic or triggers. A warning message will be shown.

Check Out Specific Project/Scenario

loc checkout [--reset] [<PROJECT NAME> <SCENARIO NAME>]

Select a given project/scenario as shortcut for commands like loc dp create and loc dp edit, so you won't have to select project/scenario repeatly.

OptionDescription
--resetReset (unselect) current project/scenario
note

This command does not effect loc project deploy, which will still prompt you to select a project.