private void Configure()
        {
            configuration = new Configuration
            {
                Username = "******",
                Password = "******",
            };

            dcApi = new DataCenterApi(configuration);
            lbApi = new LoadBalancerApi(configuration);

            //Create a datacenter.
            if (datacenter == null)
            {
                datacenter = new Datacenter
                {
                    Properties = new DatacenterProperties
                    {
                        Name        = ".Net V2 - Test " + DateTime.Now.ToShortTimeString(),
                        Description = "Unit test for .Net SDK PB REST V2",
                        Location    = "us/lasdev"
                    }
                };

                datacenter = dcApi.Create(datacenter);
            }
        }
Exemplo n.º 2
0
        private void Configure()
        {
            configuration = new Configuration
            {
                Username = "******",
                Password = "******",
            };

            dcApi     = new DataCenterApi(configuration);
            serverApi = new ServerApi(configuration);
            nicApi    = new NetworkInterfacesApi(configuration);
            lbApi     = new LoadBalancerApi(configuration);

            //Create a datacenter.
            if (datacenter == null)
            {
                datacenter = new Datacenter
                {
                    Properties = new DatacenterProperties
                    {
                        Name        = ".Net V2 - Test " + DateTime.Now.ToShortTimeString(),
                        Description = "Unit test for .Net SDK PB REST V2",
                        Location    = "us/lasdev"
                    }
                };

                datacenter = dcApi.Create(datacenter);
            }

            if (server == null)
            {
                server = new Server
                {
                    Properties = new ServerProperties
                    {
                        Name  = ".Net V2 - Test " + DateTime.Now.ToShortTimeString(),
                        Cores = 1,
                        Ram   = 256
                    }
                };

                server = serverApi.Create(datacenter.Id, server);
                DoWait(server.Request);
            }

            if (lb == null)
            {
                lb = new Loadbalancer
                {
                    Properties = new LoadbalancerProperties {
                        Name = ".Net V2 - Test " + DateTime.Now.ToShortTimeString()
                    }
                };

                lb = lbApi.Create(datacenter.Id, lb);

                DoWait(lb.Request);
            }
        }
Exemplo n.º 3
0
        private void Configure()
        {
            Configuration = new Configuration
            {
                Username = "******",
                Password = "******",
            };

            dcApi     = new DataCenterApi(configuration);
            serverApi = new ServerApi(configuration);
            nicApi    = new NetworkInterfacesApi(configuration);
            lbApi     = new LoadBalancerApi(configuration);
            fwApi     = new FirewallRuleApi(configuration);

            //Create a datacenter.
            if (datacenter == null)
            {
                datacenter = new Datacenter
                {
                    Properties = new DatacenterProperties
                    {
                        Name        = ".Net V2 - Test " + DateTime.Now.ToShortTimeString(),
                        Description = "Unit test for .Net SDK PB REST V2",
                        Location    = "us/lasdev"
                    }
                };

                datacenter = dcApi.Create(datacenter);
            }

            if (server == null)
            {
                server = new Server
                {
                    Properties = new ServerProperties
                    {
                        Name  = ".Net V2 - Test " + DateTime.Now.ToShortTimeString(),
                        Cores = 1,
                        Ram   = 256
                    }
                };

                server = serverApi.Create(datacenter.Id, server);
                DoWait(server.Request);
            }

            if (nic == null)
            {
                nic = new Nic {
                    Properties = new NicProperties {
                        Lan = 1
                    }
                };

                nic = nicApi.Create(datacenter.Id, server.Id, nic);

                DoWait(nic.Request);
            }

            bool isBusy = true;

            while (isBusy == true)
            {
                var temp = dcApi.FindById(datacenter.Id);
                if (temp.Metadata.State != "BUSY")
                {
                    isBusy = false;
                }
                Thread.Sleep(5000);
            }
        }
        private void Configure()
        {
            configuration = new Configuration
            {
                Username = "******",
                Password = "******",

            };

            dcApi = new DataCenterApi(configuration);
            lbApi = new LoadBalancerApi(configuration);

            //Create a datacenter.
            if (datacenter == null)
            {
                datacenter = new Datacenter
                {
                    Properties = new DatacenterProperties
                    {
                        Name = ".Net V2 - Test " + DateTime.Now.ToShortTimeString(),
                        Description = "Unit test for .Net SDK PB REST V2",
                        Location = "us/lasdev"
                    }
                };

                datacenter = dcApi.Create(datacenter);
            }
        }
        private void Configure()
        {
            Configuration = new Configuration
            {
                Username = "******",
                Password = "******",

            };

            dcApi = new DataCenterApi(configuration);
            serverApi = new ServerApi(configuration);
            nicApi = new NetworkInterfacesApi(configuration);
            lbApi = new LoadBalancerApi(configuration);
            fwApi = new FirewallRuleApi(configuration);

            //Create a datacenter.
            if (datacenter == null)
            {
                datacenter = new Datacenter
                {
                    Properties = new DatacenterProperties
                    {
                        Name = ".Net V2 - Test " + DateTime.Now.ToShortTimeString(),
                        Description = "Unit test for .Net SDK PB REST V2",
                        Location = "us/lasdev"
                    }
                };

                datacenter = dcApi.Create(datacenter);
            }

            if (server == null)
            {
                server = new Server
                {
                    Properties = new ServerProperties
                    {
                        Name = ".Net V2 - Test " + DateTime.Now.ToShortTimeString(),
                        Cores = 1,
                        Ram = 256
                    }
                };

                server = serverApi.Create(datacenter.Id, server);
                DoWait(server.Request);
            }

            if (nic == null)
            {
                nic = new Nic { Properties = new NicProperties { Lan = 1 } };

                nic = nicApi.Create(datacenter.Id, server.Id, nic);

                DoWait(nic.Request);
            }

            bool isBusy = true;
            while (isBusy == true)
            {
                var temp = dcApi.FindById(datacenter.Id);
                if (temp.Metadata.State != "BUSY") isBusy = false;
                Thread.Sleep(5000);
            }
        }
Exemplo n.º 6
0
        private void Configure()
        {
            configuration = new Configuration
            {
                Username = "******",
                Password = "******",

            };

            dcApi = new DataCenterApi(configuration);
            serverApi = new ServerApi(configuration);
            nicApi = new NetworkInterfacesApi(configuration);
            lbApi = new LoadBalancerApi(configuration);

            //Create a datacenter.
            if (datacenter == null)
            {
                datacenter = new Datacenter
                {
                    Properties = new DatacenterProperties
                    {
                        Name = ".Net V2 - Test " + DateTime.Now.ToShortTimeString(),
                        Description = "Unit test for .Net SDK PB REST V2",
                        Location = "us/lasdev"
                    }
                };

                datacenter = dcApi.Create(datacenter);
            }

            if(server == null)
            {
                server = new Server
                {
                    Properties = new ServerProperties
                    {
                        Name = ".Net V2 - Test " + DateTime.Now.ToShortTimeString(),
                        Cores = 1,
                        Ram = 256
                    }
                };

                server = serverApi.Create(datacenter.Id, server);
                DoWait(server.Request);
            }

            if (lb == null)
            {
                lb = new Loadbalancer
                {
                    Properties = new LoadbalancerProperties { Name = ".Net V2 - Test " + DateTime.Now.ToShortTimeString() }
                };

                lb = lbApi.Create(datacenter.Id, lb);

                DoWait(lb.Request);
            }
        }