In order to provide programmers with the ability to programmatically scale up/down application components, Apprenda offers a ScalingAPI which allows you to retrieve information about the different policies, workloads and components and perform different actions against them. The ScalingAPI is included as part of the Apprenda SDK in the Apprenda.API.Application dll.
Example - Deploy a New Component
The first step when using the API is to create an ApplicationManager object for your application. You can do that using the following line of code, where applicationAlias is the alias of your application.
var applicationManager = new ApplicationManager("applicationAlias");
After you have the applicationManager object, you can query it to receive a list of the components that the application has. You can then select a component an instruct a deploy or undeploy.
var component = applicationManager.GetComponents().Single(c => c.Name.Equals("Component Name")); component.Deploy(1);
The full API information can be found at: http://docs.apprenda.com/api/namespace_apprenda_1_1_a_p_i_1_1_application.html
Let us know if you have any questions.
Comments