Sonatype Data Retention Policies API

Set policies for automatic purging of obsolete application and Success Metrics reports. Note that IQ Server has a preset limit of purging 5000 reports in one execution of its report purging job.

OpenAPI Specification

sonatype-data-retention-policies-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Sonatype Lifecycle Public REST Advanced Search Data Retention Policies API
  version: 1.201.0-02
  description: Use the Advanced Search REST API to perform searches on Lifecycle application scan reports.
security:
- BasicAuth: []
  BearerAuth: []
tags:
- description: Set policies for automatic purging of obsolete application and Success Metrics reports. <p>Note that IQ Server has a preset limit of purging 5000 reports in one execution of its report purging job.
  name: Data Retention Policies
paths:
  /api/v2/dataRetentionPolicies/organizations/{organizationId}:
    get:
      description: 'Data retention policies help to limit the disk space consumption by removing obsolete data. Use this method to inspect the retention policies that are in effect for an organization. Application reports created by continuous monitoring are not affected by the stage retention policy. They appear separately under the key continuous-monitoring in the response JSON<p>Permissions required: View IQ Elements'
      operationId: getDataRetentionPolicies
      parameters:
      - description: The organizationId assigned by IQ Server. Use the organization REST API to retrieve the organizationId.
        in: path
        name: organizationId
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiDataRetentionPoliciesDTO'
          description: The response JSON contains the policy settings for both applicationReports and successMetrics. Policy settings for application reports are shown for each stage of development. <ul><li>inheritPolicy IS a boolean flag indicating whether the policy is inherited from a parent organization.</li><li>enablePurging IS a boolean flag indicating if automatic purging is enabled or disabled.</li><li>maxCount IS the maximum no. of reports to retain.</li><li>maxAge IS the maximum age that a report is allowed to reach before it is purged. Possible values are days, weeks, months, years.</li></ul>The latest application report is always retained, regardless of its age.
      tags:
      - Data Retention Policies
    put:
      description: 'Data retention policies help to limit the disk space consumption by removing obsolete data. Use this method to set the retention policies for an organization. Application reports created by continuous monitoring are not affected by the stage retention policy. They appear separately under the key continuous-monitoring.<p>Permissions required: Edit IQ Elements'
      operationId: setDataRetentionPolicies
      parameters:
      - description: The organizationId for the organization you want to set the data retention policy. Use the organization REST API to retrieve the organizationId.
        in: path
        name: organizationId
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiDataRetentionPoliciesDTO'
        description: "The request JSON should include the retention policy settings for both application reports and success metrics.\n\nPolicy settings for application reports can be specified for each stage of development represented in the example below by additionalProp1. \nExample values for additionalProp1 are develop, build, stage-release, release, operate & continuous monitoring. For application reports created during continuous monitoring use the key continuous-monitoring instead of the stage name. <ul><li>inheritPolicy IS a boolean flag indicating whether the policy is inherited from a parent organization.</li><li>enablePurging IS a boolean flag indicating enabled or disabled status for automatic purging. </li><li>maxCount IS the maximum no. of reports to retain.</li><li>maxAge IS the maximum age that a report is allowed to reach before it is purged. Possible values are days, weeks, months, years.</li></ul>"
        required: true
      responses:
        '200':
          description: The data retention policy has been set successfully.
      tags:
      - Data Retention Policies
  /api/v2/dataRetentionPolicies/organizations/{organizationId}/parent:
    get:
      description: 'Data retention policies help to limit the disk space consumption by removing obsolete data. Use this method to inspect the retention policies that are in effect for the parent organization of the given organization. Application reports created by continuous monitoring are not affected by the stage retention policy. They appear separately under the key continuous-monitoring.<p>Permissions required: View IQ Elements'
      operationId: getParentDataRetentionPolicies
      parameters:
      - description: The organizationId assigned by IQ Server. Use the organization REST API to retrieve the parent organizationId
        in: path
        name: organizationId
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiDataRetentionPoliciesDTO'
          description: The response JSON contains the policy settings for both applicationReports and successMetrics. Policy settings for application reports are shown for each stage of development. <ul><li>inheritPolicy IS a boolean flag indicating whether the policy is inherited from a parent organization.</li><li>enablePurging IS a boolean flag indicating if automatic purging is enabled or disabled.</li><li>maxCount IS the maximum no. of reports to retain.</li><li>maxAge IS the maximum age that a report is allowed to reach before it is purged. Possible values are days, weeks, months, years.</li></ul>The latest application report is always retained, regardless of its age.
      tags:
      - Data Retention Policies
components:
  schemas:
    ApiDataRetentionPoliciesDTO:
      properties:
        applicationReports:
          $ref: '#/components/schemas/ApiReportRetentionPoliciesDTO'
        successMetrics:
          $ref: '#/components/schemas/ApiSuccessMetricsRetentionPolicyDTO'
      type: object
    ApiReportRetentionPolicyDTO:
      properties:
        enablePurging:
          type: boolean
        inheritPolicy:
          type: boolean
        maxAge:
          type: string
        maxCount:
          format: int32
          type: integer
      type: object
    ApiReportRetentionPoliciesDTO:
      properties:
        stages:
          additionalProperties:
            $ref: '#/components/schemas/ApiReportRetentionPolicyDTO'
          type: object
      type: object
    ApiSuccessMetricsRetentionPolicyDTO:
      properties:
        enablePurging:
          type: boolean
        inheritPolicy:
          type: boolean
        maxAge:
          type: string
      type: object
  securitySchemes:
    BasicAuth:
      scheme: basic
      type: http
    BearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http