Assets per Kelvin SmartApps™ Workload
Planning Kelvin SmartApps™
Kelvin SmartApps™ automatically deploy workloads to the edge for every Asset added to it in the Kelvin UI.
The planner feature in Kelvin SmartApps™ gives flexibility to the Platform Administrators to assign design restraints on the resource allocations.
Get Max Assets per Kelvin SmartApps™ Workload
In this example we will get the setting of the maximum assets deployable per workload for Kelvin SmartApps™ 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 Kelvin SmartApps™
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 Kelvin SmartApps™ Workload
In this example we will set the maximum assets deployable per workload for Kelvin SmartApps™ 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