install.py
def install_openwhisk_action_sequences(available_actions):
    """
    Create a list of action sequences.  The command line equivalent of:

    $ wsk action create fetch-aws-keys-write-doc --sequence fetch-aws-keys,write-doc
    """

    # Dictionary of action sequences
    # Key: name of action sequence
    # Value: ordered list of actions that comprise the sequence
    action_sequences = {

        # Nested sequence for aggregating active AWS keys and writing to DB
        "fetch-aws-keys-write-doc": [
            "fetch-aws-keys",
            "write-doc",
        ],

        # Nested sequence for aggregating github org users and writing to DB
        "github-user-aggregator-write-doc": [
            "github-user-aggregator",
            "write-doc",
        ],

        # Nested sequence for doing the post-nuke-notifying and writing to DB
        "post-nuke-notifier-write-doc": [
            "post-nuke-notifier",
            "write-doc",
        ],

        # Main sequence
        "github-user-events-scanner-nuker": [
            "fetch-aws-keys-write-doc",
            "github-user-aggregator-write-doc",
            "lookup-github-users-aws-keys",
            "github-user-events-scanner",
            "nuke-leaked-aws-keys",
            "post-nuke-notifier-write-doc",
        ]

    }

    for action_sequence, actions in action_sequences.iteritems():

        # Make sure all the actions in this sequence are valid.  This protects
        # against bugs due to renaming actions, and forgetting to update the action_sequences dictionary
        # Every action in an action sequence must either be present in available_actions or action_sequences
        for action in actions:
            if action not in available_actions and action not in action_sequences:
                raise Exception("Cannot create action sequence that contains invalid action: {}".format(action))

        # If the action sequence already exists, delete it
        if openwhisk_action_exists(action_sequence):
            delete_openwhisk_action(action_sequence)

        # Get the actions list as a comma delimed string, eg: fetch-aws-keys,write-doc
        comma_delimited_actions = ",".join(actions)

        # Default the action timeout to 5 minutes, which is the max value on the hosted IBM bluemix platform
        command = "{} action create {} --timeout 300000 --sequence {}".format(
            WSK_CMD,
            action_sequence,
            comma_delimited_actions,
        )
        
        subprocess.check_call(command, shell=True)


    return action_sequences.keys()

    Create a list of action sequences.  The command line equivalent of:

    $ wsk action create fetch-aws-keys-write-doc --sequence fetch-aws-keys,write-doc
    
Create a list of action sequences.
Create a list of action sequences .
def install_openwhisk_action_sequences(available_actions):
    action_sequences = {
        "fetch-aws-keys-write-doc": [
            "fetch-aws-keys",
            "write-doc",
        ],
        "github-user-aggregator-write-doc": [
            "github-user-aggregator",
            "write-doc",
        ],
        "post-nuke-notifier-write-doc": [
            "post-nuke-notifier",
            "write-doc",
        ],
        "github-user-events-scanner-nuker": [
            "fetch-aws-keys-write-doc",
            "github-user-aggregator-write-doc",
            "lookup-github-users-aws-keys",
            "github-user-events-scanner",
            "nuke-leaked-aws-keys",
            "post-nuke-notifier-write-doc",
        ]
    }
    for action_sequence, actions in action_sequences.iteritems():
        for action in actions:
            if action not in available_actions and action not in action_sequences:
                raise Exception("Cannot create action sequence that contains invalid action: {}".format(action))
        if openwhisk_action_exists(action_sequence):
            delete_openwhisk_action(action_sequence)
        comma_delimited_actions = ",".join(actions)
        command = "{} action create {} --timeout 300000 --sequence {}".format(
            WSK_CMD,
            action_sequence,
            comma_delimited_actions,
        )
        subprocess.check_call(command, shell=True)
    return action_sequences.keys()
def install_openwhisk_action_sequences ( available_actions ) : action_sequences = { "fetch-aws-keys-write-doc" : [ "fetch-aws-keys" , "write-doc" , ] , "github-user-aggregator-write-doc" : [ "github-user-aggregator" , "write-doc" , ] , "post-nuke-notifier-write-doc" : [ "post-nuke-notifier" , "write-doc" , ] , "github-user-events-scanner-nuker" : [ "fetch-aws-keys-write-doc" , "github-user-aggregator-write-doc" , "lookup-github-users-aws-keys" , "github-user-events-scanner" , "nuke-leaked-aws-keys" , "post-nuke-notifier-write-doc" , ] } for action_sequence , actions in action_sequences . iteritems ( ) : for action in actions : if action not in available_actions and action not in action_sequences : raise Exception ( "Cannot create action sequence that contains invalid action: {}" . format ( action ) ) if openwhisk_action_exists ( action_sequence ) : delete_openwhisk_action ( action_sequence ) comma_delimited_actions = "," . join ( actions ) command = "{} action create {} --timeout 300000 --sequence {}" . format ( WSK_CMD , action_sequence , comma_delimited_actions , ) subprocess . check_call ( command , shell = True ) return action_sequences . keys ( )
Create a list of action sequences.
Create a list of action sequences .
"""
    Create a list of action sequences.  The command line equivalent of:

    $ wsk action create fetch-aws-keys-write-doc --sequence fetch-aws-keys,write-doc
    """ # Dictionary of action sequences # Key: name of action sequence # Value: ordered list of actions that comprise the sequence # Nested sequence for aggregating active AWS keys and writing to DB # Nested sequence for aggregating github org users and writing to DB # Nested sequence for doing the post-nuke-notifying and writing to DB # Main sequence # Make sure all the actions in this sequence are valid.  This protects # against bugs due to renaming actions, and forgetting to update the action_sequences dictionary # Every action in an action sequence must either be present in available_actions or action_sequences # If the action sequence already exists, delete it # Get the actions list as a comma delimed string, eg: fetch-aws-keys,write-doc # Default the action timeout to 5 minutes, which is the max value on the hosted IBM bluemix platform
available_actions