示例#1
0
        public void serverArrayCurrentInstances()
        {
            ServerArray serverarray = ServerArray.show(liveTestServerArrayID, null);

            Assert.IsNotNull(serverarray);
            List <Instance> currInstances = serverarray.currentInstances;

            Assert.IsNotNull(currInstances);
        }
示例#2
0
        public void serverArrayTags()
        {
            ServerArray serverarray = ServerArray.show(liveTestServerArrayID, null);

            Assert.IsNotNull(serverarray);
            List <Tag> tags = serverarray.tags;

            Assert.IsTrue(true);
        }
示例#3
0
        public void serverArrayNextInstance()
        {
            ServerArray serverarray = ServerArray.show(liveTestServerArrayID, null);

            Assert.IsNotNull(serverarray);
            Instance inst = serverarray.nextInstance;

            Assert.IsNotNull(inst);
        }
示例#4
0
        public void serverArrayAlertSpecs()
        {
            ServerArray serverarray = ServerArray.show(liveTestServerArrayID, null);

            Assert.IsNotNull(serverarray);
            List <AlertSpec> alertSpecs = serverarray.alertSpecs;

            Assert.IsNotNull(alertSpecs);
        }
示例#5
0
        public void serverArrayDeployment()
        {
            ServerArray serverarray = ServerArray.show(liveTestServerArrayID, null);

            Assert.IsNotNull(serverarray);
            Deployment dep = serverarray.deployment;

            Assert.IsNotNull(dep);
            Assert.IsTrue(dep.name.Length > 0);
        }
        protected override bool PerformRightScaleTask(CodeActivityContext context)
        {
            bool retVal  = false;
            bool isReady = false;

            LogInformation("Beginning query to get status of ServerArray id: " + this.serverArrayID.Get(context));

            int operationalCount = 0;
            int minServers       = 1;

            if (this.minNumServers == null)
            {
                if (this.minNumServers.Get(context) > 0)
                {
                    minServers = this.minNumServers.Get(context);
                }
            }

            if (base.authClient(context))
            {
                ServerArray array = ServerArray.show(this.serverArrayID.Get(context), "default");
                foreach (Instance inst in array.currentInstances)
                {
                    if (inst.state.ToLower().ToString() == "operational")
                    {
                        operationalCount++;
                        if (operationalCount >= minServers)
                        {
                            isReady = true;
                            retVal  = true;
                            break;
                        }
                    }
                }
            }

            this.isOperational.Set(context, isReady);
            this.operationalCount.Set(context, operationalCount);

            LogInformation("Completed query to get status of ServerArray id: " + this.serverArrayID.Get(context) + " with isOperational = " + retVal.ToString() + " and operationalCount = " + operationalCount.ToString());
            return(retVal);
        }
示例#7
0
        public void ServerArrayShow()
        {
            ServerArray serverarray = ServerArray.show(liveTestServerArrayID, null);

            Assert.IsNotNull(serverarray);
        }