ConoHaNet.OpenStackMember.ListServers C# (CSharp) Method

ListServers() public method

public ListServers ( string imageId = null, string flavorId = null, string name = null, ServerState status = null, string markerId = null, int limit = null, DateTimeOffset changesSince = null ) : IEnumerable
imageId string
flavorId string
name string
status ServerState
markerId string
limit int
changesSince DateTimeOffset
return IEnumerable
        public IEnumerable<SimpleServer> ListServers(string imageId = null, string flavorId = null, string name = null, ServerState status = null, string markerId = null, int? limit = null, DateTimeOffset? changesSince = null)
        {
            return ServersProvider.ListServers(imageId, flavorId, name, status, markerId, limit, changesSince, 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::ListServers
OpenStackMember