public AzureHDInsightRuntimeScriptAction(RuntimeScriptAction runtimeScriptAction)
 {
     Name = runtimeScriptAction.Name;
     Uri = runtimeScriptAction.Uri;
     Parameters = runtimeScriptAction.Parameters;
     NodeTypes = runtimeScriptAction.Roles.ToArray();
     ApplicationName = runtimeScriptAction.ApplicationName;
 }
        public AzureHDInsightRuntimeScriptActionOperationResource(RuntimeScriptAction runtimeScriptAction, OperationResource operationResource)
            : base(runtimeScriptAction)
        {
            if (operationResource.ErrorInfo != null)
            {
                ErrorMessage = operationResource.ErrorInfo.Message;
            }

            OperationState = operationResource.State.ToString();
        }
        public override void ExecuteCmdlet()
        {
            if (ResourceGroupName == null)
            {
                ResourceGroupName = GetResourceGroupByAccountName(ClusterName);
            }

            var scriptAction = new RuntimeScriptAction
            {
                Name = Name,
                Parameters = Parameters,
                Roles = NodeTypes.Select(n => n.ToString()).ToList(),
                Uri = Uri,
                ApplicationName = ApplicationName
            };

            var scriptActions = new List<RuntimeScriptAction> { scriptAction };

            var executeScriptActionParameters = new ExecuteScriptActionParameters
            {
                ScriptActions = scriptActions,
                PersistOnSuccess = PersistOnSuccess.IsPresent
            };

            var operationResource = HDInsightManagementClient.ExecuteScriptActions(ResourceGroupName, ClusterName, executeScriptActionParameters);
            WriteObject(new AzureHDInsightRuntimeScriptActionOperationResource(scriptAction, operationResource));
        }
예제 #4
0
 private static bool CompareScriptActions(RuntimeScriptAction scriptA, RuntimeScriptAction scriptB)
 {
     return CompareScriptActions(new AzureHDInsightRuntimeScriptAction(scriptA), new AzureHDInsightRuntimeScriptAction(scriptB));
 }