ScriptAction Class
Note
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)
Inheritance Hierarchy
System.Object
Microsoft.WindowsAzure.Management.HDInsight.ConfigAction
Microsoft.WindowsAzure.Management.HDInsight.ScriptAction
Syntax
public class ScriptAction : ConfigAction
public ref class ScriptAction : ConfigAction
type ScriptAction =
class
inherit ConfigAction
end
Public Class ScriptAction
Inherits ConfigAction
Constructors
Name | Description | |
---|---|---|
ScriptAction(String, IEnumerable<ClusterNodeType>, Uri, String) | Initializes a new instance of the ScriptAction class. |
Properties
Name | Description | |
---|---|---|
ClusterRoleCollection | Gets the affected nodes of the config action.(Inherited from ConfigAction.) |
|
Name | Gets the name.(Inherited from ConfigAction.) |
|
Parameters | Gets the action parameters. |
|
Uri | Gets the action Uri. |
Methods
Name | Description | |
---|---|---|
Equals(Object) | Compares two ScriptActions for equality.(Overrides ConfigAction.Equals(Object).) |
|
Finalize() | (Inherited from Object.) |
|
GetHashCode() | Overrides this method for class comparison purpose.(Overrides ConfigAction.GetHashCode().) |
|
GetType() | (Inherited from Object.) |
|
MemberwiseClone() | (Inherited from Object.) |
|
ToString() | (Inherited from Object.) |
Remarks
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.
Examples
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
));
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Microsoft.WindowsAzure.Management.HDInsight Namespace
Return to top