ScriptAction Class

 
System_CAPS_noteNote

This version of the HDInsight .NET SDK is deprecated and will be removed by January 1, 2017. You are encouraged to use the newer ARM-based version of HDInsight .NET SDK going forward. For instructions on how to use the new HDInsight .NET SDK to create a cluster, see Create HDInsight Linux clusters using .NET SDK. For instructions on how to submit jobs using the new .NET SDK and other approaches, see Submit jobs to an HDInsight cluster. The HDInsight SDK reference for the newer version is available at HDInsight .NET SDK Reference.

Represents the script action for an HDInsight cluster.

Namespace:   Microsoft.WindowsAzure.Management.HDInsight
Assembly:  Microsoft.WindowsAzure.Management.HDInsight (in Microsoft.WindowsAzure.Management.HDInsight.dll)

System.Object
  Microsoft.WindowsAzure.Management.HDInsight.ConfigAction
    Microsoft.WindowsAzure.Management.HDInsight.ScriptAction

public class ScriptAction : ConfigAction

NameDescription
System_CAPS_pubmethodScriptAction(String, IEnumerable<ClusterNodeType>, Uri, String)

Initializes a new instance of the ScriptAction class.

NameDescription
System_CAPS_pubpropertyClusterRoleCollection

Gets the affected nodes of the config action.(Inherited from ConfigAction.)

System_CAPS_pubpropertyName

Gets the name.(Inherited from ConfigAction.)

System_CAPS_pubpropertyParameters

Gets the action parameters.

System_CAPS_pubpropertyUri

Gets the action Uri.

NameDescription
System_CAPS_pubmethodEquals(Object)

Compares two ScriptActions for equality.(Overrides ConfigAction.Equals(Object).)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Overrides this method for class comparison purpose.(Overrides ConfigAction.GetHashCode().)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodToString()

(Inherited from Object.)

Script actions can be run from a .NET application using a ScriptAction object. These script actions provide Azure HDInsight functionality that is used to install additional software or to change the configuration of applications running on an Hadoop cluster using PowerShell scripts. Script actions are scripts that run on the cluster nodes when HDInsight clusters are deployed and they are executed once nodes in the cluster complete HDInsight configuration. The ScriptAction is executed under system admin account privileges and provide full access rights to the cluster nodes. Each cluster can be provided with a list of script actions to execute that will be executed in the order in which they are specified.

This example shows how to use a Script Action object to install R on a cluster.

For an explanation of the context and preliminary steps needed to use this code snippet, see the Install R on HDInsight using the .NET SDK section in Install and use R on HDInsight Hadoop clusters.

// ADD THE SCRIPT ACTION TO INSTALL R

clusterInfo.ConfigActions.Add(new ScriptAction(
    "Install R",
    new ClusterNodeType[] { ClusterNodeType.HeadNode, ClusterNodeType.DataNode },
    new Uri("https://hdiconfigactions.blob.core.windows.net/rconfigactionv01/r-installer-v01.ps1"), null
    ));

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: