public void ServerArrayIndexSimple() { List <ServerArray> serverarrayList = ServerArray.index(); Assert.IsNotNull(serverarrayList); Assert.IsTrue(serverarrayList.Count > 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); } }
public void ServerArrayIndexFilteredString() { List <Filter> filter = Filter.parseFilterList(filterListString); List <ServerArray> serverarrayList = ServerArray.index(filter); Assert.IsNotNull(serverarrayList); }
public void serverArrayNextInstance() { ServerArray serverarray = ServerArray.show(liveTestServerArrayID, null); Assert.IsNotNull(serverarray); Instance inst = serverarray.nextInstance; Assert.IsNotNull(inst); }
public void serverArrayAlertSpecs() { ServerArray serverarray = ServerArray.show(liveTestServerArrayID, null); Assert.IsNotNull(serverarray); List <AlertSpec> alertSpecs = serverarray.alertSpecs; Assert.IsNotNull(alertSpecs); }
public void serverArrayCloneDestroy() { string newServerArrayID = ServerArray.clone(liveTestServerArrayID); Assert.IsNotNull(newServerArrayID); bool retVal = ServerArray.destroy(newServerArrayID); Assert.IsTrue(retVal); }
public void serverArrayTags() { ServerArray serverarray = ServerArray.show(liveTestServerArrayID, null); Assert.IsNotNull(serverarray); List <Tag> tags = serverarray.tags; Assert.IsTrue(true); }
public void serverArrayCurrentInstances() { ServerArray serverarray = ServerArray.show(liveTestServerArrayID, null); Assert.IsNotNull(serverarray); List <Instance> currInstances = serverarray.currentInstances; Assert.IsNotNull(currInstances); }
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); }
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); }
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); }
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); }
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(); }
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); }
//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); }
/// <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); }
public void ServerArrayShow() { ServerArray serverarray = ServerArray.show(liveTestServerArrayID, null); Assert.IsNotNull(serverarray); }
//[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"); }