Edit

Share via


Submit-AzHDInsightScriptAction

Submits a new script action to an Azure HDInsight cluster.

Syntax

Default (Default)

Submit-AzHDInsightScriptAction
    [-ClusterName] <String>
    [-Name] <String>
    [-Uri] <Uri>
    [-NodeTypes] <RuntimeScriptActionClusterNodeType[]>
    [[-Parameters] <String>]
    [[-ApplicationName] <String>]
    [-PersistOnSuccess]
    [-ResourceGroupName <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

The Submit-AzHDInsightScriptAction cmdlet submits a new script action to an Azure HDInsight cluster. Use PersistOnSuccess to have the script action run each time the cluster is scaled up, as long as the script action initially succeeds.

Examples

Example 1: Submit a new script action to a running HDInsight cluster

Submit-AzHDInsightScriptAction `
            -ClusterName "your-hadoop-001" `
            -Name "scriptaction" `
            -Uri "<script action URI>" `
            -NodeTypes Worker -PersistOnSuccess

This command submits a script action to a running HDInsight cluster.

Parameters

-ApplicationName

Specifies the application name for the script action. When ApplicationName is specified, PersistOnSuccess should be set to False, nodes must contain only edgenode, and script action count should equal 1.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:5
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ClusterName

Specifies the name of the cluster.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specifies the name of the script action.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-NodeTypes

Specifies the node types on which to run the script action.

Parameter properties

Type:

RuntimeScriptActionClusterNodeType[]

Default value:None
Accepted values:HeadNode, WorkerNode, ZookeeperNode, EdgeNode
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:3
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Parameters

Specifies the parameters for the script action.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:4
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-PersistOnSuccess

Indicates that the script action should run each time the cluster is scaled up. This switch parameter is ignored if the script action initially fails.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:6
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceGroupName

Specifies the name of the resource group.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Uri

Specifies the public URI for the script action (a PowerShell or Bash script).

Parameter properties

Type:Uri
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

Uri

RuntimeScriptActionClusterNodeType

Outputs

AzureHDInsightRuntimeScriptActionOperationResource