Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DATA-3918 Data pipelines CLI commands #4906

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

n0nick
Copy link
Member

@n0nick n0nick commented Apr 10, 2025

$ go run ./cli/viam/main.go datapipelines --help
NAME:
   viam datapipelines - manage and track data pipelines

USAGE:
   viam datapipelines <command> [command options]

COMMANDS:
   list      list data pipelines for an org ID
   describe  describe a data pipeline and its status
   create    create a new data pipeline
   update    update a data pipeline
   delete    delete a data pipeline
   enable    enable a data pipeline
   disable   disable a data pipeline

OPTIONS:
   --help, -h  show help (default: false)
$ go run ./cli/viam/main.go datapipelines create --org-id=f87b919c-63b2-4d32-b676-0b55393938d7 --name=sagie-example1 --schedule="5 4 * * *" --mql-file=mql.json
sagie-example1 (ID: 9bce36de-af5a-4f0a-aacd-4da6a3e6c33d) created.
$ go run ./cli/viam/main.go datapipelines list --org-id=f87b919c-63b2-4d32-b676-0b55393938d7
	cli-pip1 (ID: 50624c13-93ec-4510-8b0c-cbeca46ede7d)
	cli-pip3 (ID: a19d041d-26ae-4ac2-adb4-1b09eb48d97b)
	cli-pipX (ID: c8393860-5eb0-4306-99af-e0bb88d0fd0b)
	sagie-example1 (ID: 9bce36de-af5a-4f0a-aacd-4da6a3e6c33d)
	sagie-repro1 (ID: 2cb930c0-d546-4cf1-8987-c39213859197)
	sagie-repro2 (ID: 5e06e5e2-1b57-42ee-b615-aade7dffe173)
	sagie-repro3 (ID: 444bce96-7bc2-46d3-991a-52294dc78828)
	sagie-test-pipeline (ID: 5a014994-e23a-4b3c-aa0b-e5334eb2dd56)
$ go run ./cli/viam/main.go datapipelines update --id=9bce36de-af5a-4f0a-aacd-4da6a3e6c33d --schedule="* * * * *"
sagie-example1 (id: 9bce36de-af5a-4f0a-aacd-4da6a3e6c33d) updated.
$ go run ./cli/viam/main.go datapipelines describe --id=9bce36de-af5a-4f0a-aacd-4da6a3e6c33d
ID: 9bce36de-af5a-4f0a-aacd-4da6a3e6c33d
Name: sagie-example1
Enabled: true
Schedule: * * * * *
MQL query: [
  {
    "$match": {
      "component_name": "dragino"
    }
  },
  {
    "$group": {
      "_id": "$part_id",
      "avgHum": {
        "$avg": "$data.readings.Hum_SHT"
      },
      "avgTemp": {
        "$avg": "$data.readings.TempC_SHT"
      },
      "count": {
        "$sum": 1
      }
    }
  }
]
Last run: 2025-04-11T19:56:06Z, Success.
$ go run ./cli/viam/main.go datapipelines disable --id=9bce36de-af5a-4f0a-aacd-4da6a3e6c33d
data pipeline (id: 9bce36de-af5a-4f0a-aacd-4da6a3e6c33d) disabled.
$ go run ./cli/viam/main.go datapipelines enable --id=9bce36de-af5a-4f0a-aacd-4da6a3e6c33d
data pipeline (id: 9bce36de-af5a-4f0a-aacd-4da6a3e6c33d) enabled.
$ go run ./cli/viam/main.go datapipelines delete --id=9bce36de-af5a-4f0a-aacd-4da6a3e6c33d
data pipeline (id: 9bce36de-af5a-4f0a-aacd-4da6a3e6c33d) deleted.

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 10, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 11, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 11, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 11, 2025
@n0nick n0nick marked this pull request as ready for review April 11, 2025 19:58
@n0nick n0nick requested a review from a team as a code owner April 11, 2025 19:58
@n0nick n0nick requested review from stuqdog and lia-viam April 11, 2025 19:58
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 11, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test This pull request is marked safe to test from a trusted zone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants