ConoHaNet.OpenStackMember.GetVncConsole C# (CSharp) Method

GetVncConsole() public method

public GetVncConsole ( string serverId ) : VncConsole
serverId string
return VncConsole
        public VncConsole GetVncConsole(string serverId)
        {
            return ServersProvider.GetVncConsole(serverId, this.DefaultRegion, this.Identity);
        }

Usage Example

Example #1
0
        static void Main(string[] args)
        {
            string username = ""; // input your user name like gncu12345678
            string password = ""; // input your own password
            string tenantname = ""; // input your own tenant name like gnct12345678
            string tenantid = ""; // input your tenant id, which is 32 characters
            string region = "tyo1";

            var osm = new OpenStackMember(
               username,
               password,
               tenantname,
               tenantid,
               defaultregion: region,
               bLazyProviderSetting: false
               );

            var activeServer = osm.ListServers().FirstOrDefault(s => s.GetDetails().Status == ServerState.Active);
            if (activeServer != null)
            {
                Console.WriteLine(String.Format("{0} is active.", activeServer.Id));
                var console = osm.GetVncConsole(activeServer.Id);
                Console.WriteLine(console.Url);
                System.Diagnostics.Process.Start(console.Url);
            }
            else
            {
                Console.WriteLine("there is no active servers.");
            }
        }
All Usage Examples Of ConoHaNet.OpenStackMember::GetVncConsole
OpenStackMember