Data Lifecycle Policy API
- Data Lifecycle Overview
- Manageable Data Types
- Data Lifecycle Policies
- Set data lifecycle policies
- Get existing data lifecycle policies
- Delete an existing data lifecycle policy
Data Lifecycle Overview
Data stored on the HeadSpin platform for your organization may be managed through lifecycle policies. These policies define conditions for automatically deleting data when appropriate. Policies contain a lifetime (a time limit after which data will be removed) and/or a size limit (a maximum size for all data, above which data will be removed). These policies are tied to specific data types so that limits for different data types may be defined independently as needed -- see the section on data types for more details.
Policies are enforced on a schedule, so once a policy is put in place for a given data type, there may be some delay before the relevant data is deleted.
Manageable Data Types
The table below details the data types currently available for lifecycle management.
Each data type is tied to a key that specifies said data type when interacting with the policy API.
Data Lifecycle Policies
Set data lifecycle policies
Request Body Parameters
The body of a single POST request can specify multiple policies. The body should map between data type keys (see the section on data types for more details) and information on the respective policies. Each policy definition consists of the following fields:
- <code class="dcode">lifetime</code>: A set of values representing the lifetime of the data type, defined by two fields.
- <code class="dcode">value</code>: The numeric value (integer or float) representing the lifetime.
- <code class="dcode">units</code>: The units associated with the value field. Currently accepts either <code class="dcode">"hours"</code> or <code class="dcode">"days"</code>.
- <code class="dcode">size_limit</code>: A set of values representing the size limit of the data type, defined by two fields.
- <code class="dcode">value</code>: The numeric value (integer or float) representing the size limit.
- <code class="dcode">units</code>: The units associated with the value field. Currently accepts either <code class="dcode">"GiB"</code> (gibibytes) or <code class="dcode">"GB"</code> (gigabytes).
- <code class="dcode">notes</code> (optional): Plaintext notes to be associated with the uploaded policy.
Note: either <code class="dcode">lifetime</code> or <code class="dcode">size_limit</code> must be provided. If both are provided, both will be enforced -- that is, data will be deleted until all remaining data is younger than the lifetime, and the total size is below the size limit.
Example: Set policies to manage APK and IPA data
Response
- <code class="dcode">HTTP 200 OK</code> if the policies are successfully uploaded.
- <code class="dcode">HTTP 400</code> for an invalid input value (data type, parameters). See the response message for more details.
Loads information on the organization's policies, and optionally filters for only the provided data types.
Optional Parameters
- <code class="dcode">include</code>: All data types to return information on. If no values are provided to <code class="dcode">include</code>, the endpoint defaults to returning all policies for the organization.
Example: Get the lifecycle policies for APK and IPA data
Response
- <code class="dcode">HTTP 200 OK</code> if the request is successful, and a body similar to the following:
- <code class="dcode">HTTP 404</code> if no policy exists for any of the given data types.
- <code class="dcode">HTTP 400</code> for an invalid data type.
Delete a lifecycle policy
Example: Delete the policy for APK data
Response
- <code class="dcode">HTTP 200 OK</code> if the policy is successfully deleted.
- <code class="dcode">HTTP 400</code> for an invalid data type.