github.com/axw/juju@v0.0.0-20161005053422-4bd6544d08d4/core/actions/actions.go (about)

     1  // Copyright 2016 Canonical Ltd.
     2  // Copyright 2016 Cloudbase Solutions SRL
     3  // Licensed under the AGPLv3, see LICENCE file for details.
     4  
     5  package actions
     6  
     7  import (
     8  	"gopkg.in/juju/charm.v6-unstable"
     9  )
    10  
    11  // JujuRunActionName defines the action name used by juju-run.
    12  const JujuRunActionName = "juju-run"
    13  
    14  // PredefinedActionsSpec defines a spec for each predefined action.
    15  var PredefinedActionsSpec = map[string]charm.ActionSpec{
    16  	JujuRunActionName: charm.ActionSpec{
    17  		Description: "predefined juju-run action",
    18  		Params: map[string]interface{}{
    19  			"type":        "object",
    20  			"title":       JujuRunActionName,
    21  			"description": "predefined juju-run action params",
    22  			"required":    []interface{}{"command", "timeout"},
    23  			"properties": map[string]interface{}{
    24  				"command": map[string]interface{}{
    25  					"type":        "string",
    26  					"description": "command to be ran under juju-run",
    27  				},
    28  				"timeout": map[string]interface{}{
    29  					"type":        "number",
    30  					"description": "timeout for command execution",
    31  				},
    32  			},
    33  		},
    34  	},
    35  }