StackStorm / StackStorm/st2

Request for graceful rule export to file system

Open
#3,827 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
6.5k
Forks
787
PR merge metrics
No merged PRs in 30d

Description

Requesting an elegant way to export a rule from the operational environment to the file system.

It looks like the user would need to delete the 'extra' stuff (id, ref, uid...) in order to save the rule output to a file?

root@u16:/opt/stackstorm/packs/default/rules# st2 rule get -y core.beagleTag
action:
    parameters:
        description: '{{trigger.body.description}}'
        gpio: '{{trigger.body.gpio}}'
        hostname: '{{trigger.body.hostname}}'
        ipaddress: '{{trigger.body.ipaddress}}'
        password: $password$
        trigger: '{{trigger.body.trigger}}'
        username: user
        value: '{{trigger.body.value}}'
    ref: default.beagleTagEnableNetworking
criteria: {}
description: Start the BeagleTag Workflow
enabled: true
**id: 59a46f89de59a4051d69096d**
name: beagleTag
pack: core
ref: core.beagleTag
tags: []
trigger:
    parameters:
        url: beagleTag
    **ref: core.c9603188-8c7a-41fd-9738-94cad5e90138**
    type: core.st2.webhook
type:
    parameters: {}
    ref: standard
**uid: rule:core:beagleTag**
 
root@u16:/opt/stackstorm/packs/default/rules#

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the st2 rule get -y CLI output shown in the issue and trace how a rule is serialized for filesystem use. Done means an export path that produces a reusable rule without operational fields such as the id, uid, or generated references.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.