Skip to content
This repository has been archived by the owner on Apr 5, 2018. It is now read-only.

leapp-to/actor-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

actor-sdk

A quick start example:

Create a python file actor.py:

from leapp.actor import actorize


@actorize(
    name='demo-actor',
    description='A demo actor to show the simplicity how to create an actor',
    inputs={'a_name': 'String'},
    outputs={'a_message', 'String'},
    tags=('demo', 'example')
)
def demo_actor_fun(channels):
    for message in channels.a_name:
        channels.a_message.push({'value': 'Greetings {}'.format(message['value'])})

Generate the YAML file:

$ python actor.py --dump-yaml > _actor.yaml

Execute the actor LeApp style:

Note: This assumes you have your inputs stored in a inputs.json file

$ cat input.json | python actor.py --leapp-run

Execute the actor Ansible style:

Note: This assumes you have your inputs stored in a inputs.json file Important: inputs.json must be the first argument to comply with the ansible non native module contract

$ python actor.py inputs.json --ansible-run

About

- This project has been archived

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages