Inheritance: Microsoft.WindowsAzure.Management.ServiceManagement.Test.FunctionalTests.PowershellCore.CmdletsInfo
コード例 #1
0
        public static AddAzureEndpointCmdletInfo BuildNoLoadBalancedCmdletInfo(AzureEndPointConfigInfo endPointConfig)
        {
            var result = new AddAzureEndpointCmdletInfo();

            result.cmdletParams.Add(new CmdletParam("Name", endPointConfig.EndpointName));
            result.cmdletParams.Add(new CmdletParam("LocalPort", endPointConfig.InternalPort));
            result.cmdletParams.Add(new CmdletParam("PublicPort", endPointConfig.ExternalPort));
            result.cmdletParams.Add(new CmdletParam("Protocol", endPointConfig.Protocol.ToString()));
            result.cmdletParams.Add(new CmdletParam("VM", endPointConfig.Vm));
            return result;
        }
コード例 #2
0
        private PersistentVM SetAzureEndPoint(AzureEndPointConfigInfo endPointConfig)
        {
            if (null != endPointConfig)
            {
                AddAzureEndpointCmdletInfo addAzureEndpointCmdletInfo = new AddAzureEndpointCmdletInfo(endPointConfig);
                WindowsAzurePowershellCmdlet addAzureEndpointCmdlet = new WindowsAzurePowershellCmdlet(addAzureEndpointCmdletInfo);

                Collection<PSObject> result = addAzureEndpointCmdlet.Run();
                if (result.Count == 1)
                {
                    return (PersistentVM)result[0].BaseObject;
                }
            }
            return null;
        }