Assets per Application Workload
Planning Applications
Applications automatically deploy workloads to the edge for every Asset added to it in the Kelvin UI.
The planner feature in Applications gives flexibility to the Platform Administrators to assign design restraints on the resource allocations.
Get Max Assets per Application Workload
In this example we will get the setting of the maximum assets deployable per workload for the Application pcp-optimization.
It is not possible to manage this feature in Kelvin UI.
curl -X 'GET' \
'https://<url.kelvin.ai>/api/v4/app-manager/app/pcp-optimization/planner-rules/get' \
-H 'Authorization: Bearer <Your Current Token>' \
-H 'accept: application/json'
The response will look like this;
{
"cluster": "sales-01-cluster",
"max_resources": 50
}
from kelvin.api.client import Client
# Login
client = Client(config={"url": "https://<url.kelvin.ai>", "username": "<your_username>"})
client.login(password="<your_password>")
# Get Max Assets per Workload for an Application
response = client.app_manager.get_app_manager_app_planner_rules(app_name="pcp-optimization")
print(response)
The output will be;
cluster='sales-01-cluster' max_resources=50
Set Max Assets per Application Workload
In this example we will set the maximum assets deployable per workload for the Application pcp-optimization to 55 Assets.
It is not possible to manage this feature in Kelvin UI.
curl -X 'POST' \
'https://<url.kelvin.ai>/api/v4/app-manager/app/pcp-optimization/planner-rules/update' \
-H 'Authorization: Bearer <Your Current Token>' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"cluster": "sales-01-cluster",
"max_resources": 55
}'
The response will look like this;
{
"cluster": "sales-01-cluster",
"max_resources": 55
}
from kelvin.api.client import Client
# Login
client = Client(config={"url": "https://<url.kelvin.ai>", "username": "<your_username>"})
client.login(password="<your_password>")
response = client.app_manager.update_app_manager_app_planner_rules(
app_name='pcp-optimization',
data={
"cluster": "sales-01-cluster",
"max_resources": 55
}
)
print(response)
The output will be;
cluster='sales-01-cluster' max_resources=55