コード例 #1
0
        public void ServerArrayIndexSimple()
        {
            List <ServerArray> serverarrayList = ServerArray.index();

            Assert.IsNotNull(serverarrayList);
            Assert.IsTrue(serverarrayList.Count > 0);
        }
コード例 #2
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            try
            {
                if (serverarrayID != null)
                {
                    ServerArray rsServerArray = RightScale.netClient.ServerArray.show(serverarrayID, view);
                    WriteObject(rsServerArray);
                }
                else
                {
                    List <Filter> lstFilter = new List <Filter>();

                    if (filter != null)
                    {
                        Filter fltFilter = Filter.parseFilter(filter);
                        lstFilter.Add(fltFilter);
                    }

                    List <ServerArray> rsServerArrays = RightScale.netClient.ServerArray.index(lstFilter, view);
                    WriteObject(rsServerArrays);
                }
            }
            catch (RightScaleAPIException rex)
            {
                WriteObject(rex.Message);
                WriteObject(rex.ErrorData);
            }
        }
コード例 #3
0
        public void ServerArrayIndexFilteredString()
        {
            List <Filter> filter = Filter.parseFilterList(filterListString);

            List <ServerArray> serverarrayList = ServerArray.index(filter);

            Assert.IsNotNull(serverarrayList);
        }
コード例 #4
0
        public void serverArrayNextInstance()
        {
            ServerArray serverarray = ServerArray.show(liveTestServerArrayID, null);

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

            Assert.IsNotNull(inst);
        }
コード例 #5
0
        public void serverArrayAlertSpecs()
        {
            ServerArray serverarray = ServerArray.show(liveTestServerArrayID, null);

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

            Assert.IsNotNull(alertSpecs);
        }
コード例 #6
0
        public void serverArrayCloneDestroy()
        {
            string newServerArrayID = ServerArray.clone(liveTestServerArrayID);

            Assert.IsNotNull(newServerArrayID);
            bool retVal = ServerArray.destroy(newServerArrayID);

            Assert.IsTrue(retVal);
        }
コード例 #7
0
        public void serverArrayTags()
        {
            ServerArray serverarray = ServerArray.show(liveTestServerArrayID, null);

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

            Assert.IsTrue(true);
        }
コード例 #8
0
        public void serverArrayCurrentInstances()
        {
            ServerArray serverarray = ServerArray.show(liveTestServerArrayID, null);

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

            Assert.IsNotNull(currInstances);
        }
コード例 #9
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);
        }
コード例 #10
0
        public void serverArrayCreateDestroyAlert()
        {
            string array_type = "alert";
            List <ElasticityParam> elasticityParams = new List <ElasticityParam>();

            elasticityParams.Add(new ElasticityParam(new AlertSpecificParam("voterTagPredicate", "80"), new Bound(1, 2), new Pacing(1, 1, 15), new List <ScheduleEntry>()));
            string newArrayID = ServerArray.create(array_type, new List <DataCenterPolicy>(), elasticityParams, cloudID, liveTestDeploymentID, serverTemplateID, "API Test Array", "disabled");

            Assert.IsNotNull(newArrayID);
            Assert.IsTrue(newArrayID.Length > 0);
            bool isDeleted = ServerArray.destroy(newArrayID);

            Assert.IsTrue(isDeleted);
        }
コード例 #11
0
        protected override bool PerformRightScaleTask(CodeActivityContext context)
        {
            bool retVal = false;

            LogInformation("Beginning update ServerArray id: " + this.serverArrayID.Get(context));

            if (base.authClient(context))
            {
                retVal = ServerArray.update(serverArrayID.Get(context), arrayType.Get(context), dataCenterPolicies.Get(context), deploymentID.Get(context), description.Get(context), elasticityParams.Get(context), cloudID.Get(context), dataCenterID.Get(context), inputs.Get(context), instanceTypeID.Get(context), imageID.Get(context), kernelImageID.Get(context), multiCloudImageID.Get(context), ramdiskImageID.Get(context), securityGroupIDs.Get(context), serverTemplateID.Get(context), sshKeyID.Get(context), userData.Get(context), name.Get(context), optimized.Get(context), state.Get(context));
                this.isUpdated.Set(context, retVal);
            }

            LogInformation("Completed update ServerArray id: " + this.serverArrayID.Get(context) + " with isUpdated = " + this.isUpdated.Get(context));
            return(retVal);
        }
コード例 #12
0
        protected override bool PerformRightScaleTask(CodeActivityContext context)
        {
            bool retVal = false;

            LogInformation("Beginning call to disable ServerArray " + this.serverArrayID.Get(context));

            if (base.authClient(context))
            {
                bool setDisabled = ServerArray.setDisabled(this.serverArrayID.Get(context));
                isDisabled.Set(context, setDisabled);
                retVal = true;
            }

            LogInformation("Completed call to disable ServerArray " + this.serverArrayID.Get(context) + " with return value of " + this.isDisabled.Get(context).ToString());
            return(retVal);
        }
コード例 #13
0
ファイル: ConfigExport.cs プロジェクト: BIRD-COMMAND/RconTool
        public ConfigExport()
        {
            FormBorderStyle = FormBorderStyle.FixedSingle;
            MaximizeBox     = false;

            InitializeComponent();

            ServerArray sA = new ServerArray();

            for (int x = 0; x < App.connectionList.Count; x++)
            {
                Connection c = App.connectionList[x];
                sA.servers.Add(c.Settings);
            }
            textBox1.Text = sA.ToBase64();
        }
コード例 #14
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);
        }
コード例 #15
0
        //this is just a cleanup method--leaving it in place so that if/when I need to clean out a bunch of extra arrays from my acct it's here.
        //[TestMethod]
        public void cleanOutOldServerArrays()
        {
            int i = 0;
            List <ServerArray> serverArrays = ServerArray.index();

            foreach (ServerArray sa in serverArrays)
            {
                if (sa.name.Contains("API Testing ST"))
                {
                    if (ServerArray.destroy(sa.ID))
                    {
                        i++;
                    }
                    else
                    {
                    }
                }
            }
            Assert.IsTrue(i > 0);
        }
コード例 #16
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        protected override bool PerformRightScaleTask(CodeActivityContext context)
        {
            LogInformation("Starting process of launching a single server in the array");

            bool retVal = false;

            if (base.authClient(context))
            {
                string newServerID = ServerArray.launch(serverArrayID.Get(context));
                this.serverID.Set(context, newServerID);
                if (!string.IsNullOrWhiteSpace(newServerID))
                {
                    retVal = true;
                }
                isLaunched.Set(context, retVal);
            }
            string completeMessage = "Completed process of launching a single server in the array id: " + this.serverArrayID.Get(context) + " with result of " + this.isLaunched.Get(context);

            LogInformation(completeMessage);

            return(retVal);
        }
コード例 #17
0
        public void ServerArrayShow()
        {
            ServerArray serverarray = ServerArray.show(liveTestServerArrayID, null);

            Assert.IsNotNull(serverarray);
        }
コード例 #18
0
 //[TestMethod]
 public void ServerArrayUpdate()
 {
     bool isUpdated = ServerArray.update("220543001", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, false, "enabled");
 }