1.3. API Endpoint - Policies¶
A policy (specifically a policy-based tiering
workflow) is an advanced data orchestration tool that automates the movement of data between storage pools or from pools to Ngenea targets. Policies are driven by conditions such as file age, size, access time, or storage pool utilization levels, enabling dynamic data management.
Difference from Workflow:
Policy: Operates vertically, automating data movement within storage tiers based on predefined conditions.
Workflow: Operates horizontally, focusing on moving data into or out of a site.
1.3.1. API Reference Location¶
All endpoints, parameters, and schemas can be explored through the interactive API documentation available at:
http(s)://<your-hub-address>/api/docs/
Note
Replace your-hub-address
with the actual IP address or domain of your Ngenea Hub instance.
1.3.2. GET
/policies/¶
Description
This endpoint allows you to retrieve a list of policies, with support for pagination. It returns a collection of policies configured in the system, including their details such as schedule, triggers, conditions, and other related configurations.
Request Parameters
Name |
Type |
Required |
Description |
---|---|---|---|
|
integer |
No |
Page number of the result set. Defaults to 1 if not specified. |
|
integer |
No |
Number of results to return per page. Must be between 20 and 100. Use 0 to return all results without pagination. Defaults to 20 if not specified or below the minimum. |
Example Request
curl -X 'GET' \
'http://your-hub-address:8000/api/policies/?page=1' \
-H 'accept: application/json' \
-H 'Authorization: Api-Key your-api-key'
Successful Response
HTTP Status Code: 200 OK
Content-Type: application/json
Example Response
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"schedule": {
"id": 1,
"timezone": "UTC",
"minute": "0",
"hour": "0",
"day_of_week": "1",
"day_of_month": "*",
"month_of_year": "*",
"time": "00:00:00",
"first_occur": false,
"start_date_time": null
},
"triggers": [
{
"id": 1,
"pool_name": "sas1",
"max_utilisation": null,
"upper_threshold": null,
"lower_threshold": null,
"premigrate_threshold": null,
"is_cloud": false
}
],
"order": {
"id": 1,
"by": "file_size",
"reverse": false
},
"condition_groups": [],
"name": "Example",
"policy_type": "MIGRATION",
"filesystem": "mmfs1",
"created": "2025-06-27T14:14:31.272573Z",
"enabled": true,
"threads": 4,
"site": 1,
"spaces": [
2
]
}
]
}
Response Fields
Field |
Description |
---|---|
|
The total number of policies available in the system (e.g., |
|
URL of the next page of results ( |
|
URL of the previous page of results ( |
|
An array of policy objects containing the policy details. |
Policy Object (Inside results Array) - Each policy object contains the following fields:
Field |
Description |
---|---|
|
The unique identifier for the policy (e.g., |
|
The schedule for when the policy should run, including timing and frequency. |
|
The conditions that trigger the policy, such as storage pool settings or thresholds. |
|
Defines how the data should be processed (e.g., by file size). |
|
Groups of conditions that must be met for the policy to be executed (e.g., |
|
The name of the policy (e.g., |
|
The type of policy (e.g., |
|
The filesystem where the policy is applied (e.g., |
|
Timestamp of when the policy was created. |
|
Whether the policy is enabled ( |
|
The number of threads used for policy execution (e.g., |
|
The site to which the policy is applied (e.g., |
|
The storage spaces involved in the policy (e.g., |
1.3.3. POST
/policies/¶
Description
This API endpoint is used to create a new policy, specifying how data should be managed, processed, or migrated between storage locations.
The policy can be scheduled to run at a specific time and trigger based on conditions like storage pool utilization, file size, and other predefined conditions.
The policy can migrate data between storage tiers or to different cloud targets based on these rules.
Request Parameters
Name |
Description |
---|---|
|
The main body of the request. This contains the configuration for the new policy. |
Example Request
curl -X 'GET' \
'http://your-hub-address:8000/api/policies/?page=1' \
-H 'accept: application/json' \
-H 'Authorization: Api-Key your-api-key'
{
"schedule": {
"timezone": "UTC",
"minute": "0",
"hour": "0",
"day_of_week": "1",
"day_of_month": "*",
"month_of_year": "*",
"time": "00:00:00",
"first_occur": false,
"start_date_time": null
},
"triggers": [
{
"pool_name": "sas1",
"max_utilisation": 0,
"lower_threshold": 0,
"upper_threshold": 0,
"premigrate_threshold": 0,
"is_cloud": true
}
],
"order": {
"by": "file_size",
"reverse": false
},
"name": "Test Policy",
"policy_type": "MIGRATION",
"filesystem": "mmfs1",
"created": "2025-06-27T14:14:31.272573Z",
"enabled": true,
"threads": 4,
"site": 1,
"spaces": [
2
]
}
Request Body Fields
schedule
: Defines when the policy should execute.
Field |
Description |
---|---|
|
The timezone to use for scheduling (set to |
|
Minute of the hour when the policy triggers (set to |
|
Hour of the day for policy execution (set to |
|
Day of the week the policy runs (set to |
|
Day of the month (set to |
|
Month of the year (set to |
|
Exact time the policy will trigger (set to |
|
Boolean flag for immediate first run (set to |
|
When the policy becomes active (set to |
Note: This configuration schedules the policy to run at midnight every Monday (UTC time).
triggers
: Specifies the conditions that activate the policy.
Field |
Description |
---|---|
|
The name of the storage pool (e.g., |
|
Max storage pool utilization (set to |
|
Lower utilization threshold (set to |
|
Upper utilization threshold (set to |
|
Threshold for pre-migration actions (set to |
|
Indicates if the pool is cloud-based (set to |
Note: This configuration triggers the policy for the cloud-based pool
sas1
regardless of utilization.
order
: Defines how files should be processed.
Field |
Description |
---|---|
|
The file order criteria (e.g., |
|
Boolean flag to reverse order (set to |
Note: Files will be processed from largest to smallest.
General Policy Fields
Field |
Description |
---|---|
|
The name of the policy (e.g., |
|
The type of policy (e.g., |
|
Filesystem where the policy applies (e.g., |
|
Timestamp of policy creation (e.g., |
|
Whether the policy is active ( |
|
Number of threads for processing (e.g., |
|
ID of the associated site (e.g., |
|
List of storage space IDs (e.g., |
Successful Response
HTTP Status Code: 201 (Created)
Content-Type: application/json
This indicates that the policy was successfully created on the server.
Example Response
{
"id": 1,
"schedule": {
"timezone": "UTC",
"minute": "0",
"hour": "0",
"day_of_week": "1",
"day_of_month": "*",
"month_of_year": "*",
"time": "00:00:00",
"first_occur": false,
"start_date_time": null
},
"triggers": [
{
"pool_name": "sas1",
"max_utilisation": 0,
"lower_threshold": 0,
"upper_threshold": 0,
"premigrate_threshold": 0,
"is_cloud": true
}
],
"order": {
"by": "file_size",
"reverse": false
},
"name": "Test Policy",
"policy_type": "MIGRATION",
"filesystem": "mmfs1",
"created": "2025-06-27T14:14:31.272573Z",
"enabled": true,
"threads": 4,
"site": 1,
"spaces": [2]
}
Response Fields
The response fields are the same as the request parameters. Please refer to the section above for a better understanding.
1.3.4. GET
/policies/{id}/¶
Description
This API endpoint retrieves detailed information about a specific policy identified by the id
parameter. It returns the policy’s configuration, including its schedule, triggers, order, and other associated details.
Request Parameters
Name |
Description |
---|---|
|
(Required) The unique identifier of the policy you want to retrieve. It is a string value and must be provided as part of the URL path. |
Example Request
curl -X 'GET' \
'http://your-hub-address:8000/api/policies/1/' \
-H 'accept: application/json' \
-H 'Authorization: Api-Key your-api-key'
Successful Response
HTTP Status Code: 200 OK
Content-Type: application/json
Example Response
{
"id": 1,
"schedule": {
"id": 1,
"timezone": "UTC",
"minute": "0",
"hour": "0",
"day_of_week": "1",
"day_of_month": "*",
"month_of_year": "*",
"time": "00:00:00",
"first_occur": false,
"start_date_time": null
},
"triggers": [
{
"id": 1,
"pool_name": "sas1",
"max_utilisation": null,
"upper_threshold": null,
"lower_threshold": null,
"premigrate_threshold": null,
"is_cloud": false
}
],
"order": {
"id": 1,
"by": "file_size",
"reverse": false
},
"condition_groups": [],
"name": "Example",
"policy_type": "MIGRATION",
"filesystem": "mmfs1",
"created": "2025-06-27T14:14:31.272573Z",
"enabled": true,
"threads": 4,
"site": 1,
"spaces": [
2
]
}
Response Fields
Field Name |
Description |
---|---|
|
The unique identifier for the policy. In this case, the policy ID is |
|
Defines when the policy should execute based on the provided time parameters. |
|
Defines the conditions that will trigger the policy. |
|
Defines how the files will be processed during policy execution. |
|
An empty list indicating that no condition groups are defined. |
|
The name of the policy (e.g., |
|
The type of policy (e.g., |
|
The filesystem to which the policy applies (e.g., |
|
The timestamp indicating when the policy was created (e.g., |
|
Boolean indicating if the policy is currently active ( |
|
Number of threads used to process files (e.g., |
|
Site ID where the policy applies (e.g., |
|
List of space IDs associated with this policy (e.g., |
Nested Field: schedule
Field Name |
Description |
---|---|
|
The unique identifier of the schedule configuration. |
|
The timezone in which the policy is scheduled (e.g., |
|
The minute of the hour when the policy triggers (e.g., |
|
The hour of the day when the policy triggers (e.g., |
|
Day of the week the policy runs (e.g., |
|
Day of the month (set to |
|
Month of the year (set to |
|
Exact time the policy will trigger (e.g., |
|
Whether to start immediately on the first occurrence ( |
|
Start date and time when the policy becomes active (set to |
Nested Field: triggers
Field Name |
Description |
---|---|
|
The unique identifier of the trigger configuration. |
|
Storage pool name for the trigger (e.g., |
|
Maximum utilization threshold (set to |
|
Upper utilization threshold (set to |
|
Lower utilization threshold (set to |
|
Pre-migration threshold (set to |
|
Whether the pool is cloud-based ( |
Nested Field: order
Field Name |
Description |
---|---|
|
The unique identifier of the order configuration. |
|
Criterion used for ordering files (e.g., |
|
Whether to reverse the order ( |
1.3.5. PATCH
/policies/{id}/¶
Description
This API endpoint allows updating an existing policy identified by its id
. The PATCH
request allows partial updates, meaning you can modify only the fields that need to be changed, such as the policy name, schedule, triggers, or other attributes.
Request Parameters
Name |
Description |
---|---|
|
(Required) The unique identifier of the policy you want to update. It should be provided as part of the URL path. |
|
(Required) A JSON object containing the updated fields of the policy. |
Example Request
curl -X 'PATCH' \
'http://your-hub-address:8000/api/policies/2/' \
-H 'accept: application/json' \
-H 'Authorization: Api-Key your-api-key' \
-H 'Content-Type: application/json'
"schedule": {
"timezone": "UTC",
"minute": "0",
"hour": "0",
"day_of_week": "1",
"day_of_month": "*",
"month_of_year": "*",
"time": "00:00:00",
"first_occur": false,
"start_date_time": null
},
"triggers": [
{
"pool_name": "sas1",
"max_utilisation": 0,
"lower_threshold": 0,
"upper_threshold": 0,
"premigrate_threshold": 0,
"is_cloud": true
}
],
"order": {
"by": "file_size",
"reverse": false
},
"name": "Test Policy Updated",
"policy_type": "MIGRATION",
"filesystem": "mmfs1",
"created": "2025-06-27T14:14:31.272573Z",
"enabled": true,
"threads": 4,
"site": 1,
"spaces": [
2
]
Note
For example purpose, we have updated only the name of the policy to Test Policy Updated
and the creation timestamp to reflect the update time (“2025-07-07T16:42:36.971472Z”).
You can modify other parameters such as the schedule, triggers, and other settings as per your specific requirements. All other configurations, including the filesystem (mmfs1
) and storage pool trigger (sas1
), remain the same or can be adjusted based on your needs.
Successful Response
HTTP Status Code: 200 OK
Content-Type: application/json
The server successfully processes the request, and the policy is updated with the new values.
Response Fields
Note
Refer to response fields under GET
/POLICES/ID.
1.3.6. DELETE
/policies/{id}/¶
Description
This API endpoint is used to delete a policy identified by its id
. The DELETE
request permanently removes the policy from the system. The deletion is typically irreversible, and once deleted, the policy cannot be restored.
Request Parameters
Name |
Description |
---|---|
|
(Required) The unique identifier of the policy that you want to delete. It should be provided as part of the URL path. |
Example Request
curl -X 'DELETE' \
'http://your-hub-address:8000/api/policies/2/' \
-H 'accept: application/json' \
-H 'Authorization: Api-Key your-api-key'
Successful Response
HTTP Status Code: 204 (No Content)
The server successfully processes the request to delete the policy. A 204 No Content
status code means that the request was successful, but there is no content to return in the response body. It indicates that the policy has been deleted.
Content-Type: application/json
1.3.6.1. POST
/policies/{id}/run/¶
Description
The POST
/policies/{id}/run/ endpoint allows you to manually trigger the execution of a policy identified by its id
. This action forces the policy to run immediately, bypassing its regular schedule. The policy will execute based on the predefined conditions and triggers that were set during its creation.
When you make this request, a unique task_id
is returned, which can be used to track the progress and status of the task.
This endpoint doesn’t require any additional parameters; the policy runs according to its current configuration.
It is particularly useful for scenarios where immediate execution is necessary, such as during urgent data migration tasks or testing, without waiting for the next scheduled trigger.
Request Parameters
Name |
Description |
---|---|
|
(Required) The ID of the policy to run. It should be provided in the URL path. |
Example Request
curl -X 'POST' \
'http://your-hub-address:8000/api/policies/1/run/' \
-H 'accept: application/json' \
-H 'Authorization: Api-Key your-api-key' \
This response indicates that the task has been successfully triggered. You can now track the task using the provided task_id
.
Example Response
{
"task_id": "ba14329f-7f77-4c60-9301-7bdfe36199b5"
}
Response Fields
Name |
Description |
---|---|
|
A unique identifier for the task initiated by this request. This ID can be used to track the progress or status of the policy execution. |