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.
Reference:
| Field | Option | Description |
|---|---|---|
| max_resources | Integer | Maximum number of assets that a single workload can have. |
| cluster_sel_method | none or static | Number |
| cluster | Text | Name of the cluster where the workload will be deployed. |
| reuse_workloads | Boolean | Whether to add Assets to existing workloads or create new workloads when adding extra Assets to the SmartApp. |
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": "beta-cluster-01",
"max_resources": 50,
"cluster_sel_method": "static",
"reuse_workloads": true
}
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/event-detection/planner-rules/update" \
-H "Authorization: Bearer <Your Current Token>" \
-H 'Content-Type: application/json' \
-d '{
"cluster_sel_method": "static",
"cluster": "beta-cluster-01",
"max_resources": 50,
"reuse_workloads": true
}'
The response will look like this;
{
"cluster": "beta-cluster-01",
"max_resources": 50,
"cluster_sel_method": "static",
"reuse_workloads": true
}
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