{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/oracle/json-schema/oracle-long-term-backup-schema.json",
  "title": "LongTermBackup",
  "description": "The details of a Long Term Backup.\n",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/oracle-databaserecovery-api-openapi.yml#/components/schemas/LongTermBackup",
  "properties": {
    "compartmentId": {
      "description": "The OCID of the compartment containing the long-term backup.",
      "type": "string"
    },
    "databaseIdentifier": {
      "description": "The Oracle Database ID, which identifies an Oracle Database located outside of Oracle Cloud.",
      "type": "string"
    },
    "databaseSizeInGBs": {
      "description": "The size of the database, in gigabytes.",
      "type": "integer"
    },
    "definedTags": {
      "additionalProperties": {
        "additionalProperties": {
          "description": "The value of the tag. Only string, integer and boolean types are supported.\n",
          "type": "object"
        },
        "description": "Key-value pair representing predefined tags' keys and values scoped to a namespace.\nExample: `{\"bar-key\": \"value\"}`\n",
        "type": "object"
      },
      "description": "Defined tags for this resource. Each key is predefined and scoped to a namespace.\nExample: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`. For more information, see [Resource Tags](https://docs.oracle.com/en-us/iaas/Content/General/Concepts/resourcetags.htm)\n",
      "type": "object"
    },
    "displayName": {
      "description": "The user-provided name for the long-term backup. You can change the displayName. Avoid entering confidential information.",
      "type": "string"
    },
    "freeformTags": {
      "additionalProperties": {
        "type": "string"
      },
      "description": "Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only.\nExample: `{\"bar-key\": \"value\"}`\n",
      "type": "object"
    },
    "id": {
      "description": "The OCID of the long-term backup.",
      "type": "string"
    },
    "lifecycleDetails": {
      "description": "A detailed message about the current lifecycle state of the long-term backup. For example, it can be used to provide actionable information for a resource in a Failed state.",
      "type": "string"
    },
    "lifecycleState": {
      "description": "The current state of the long term backup.\n",
      "enum": [
        "CREATING",
        "UPDATING",
        "ACTIVE",
        "DELETING",
        "DELETED",
        "FAILED",
        "CANCELING",
        "CANCELED"
      ],
      "type": "string"
    },
    "lifecycleSubstate": {
      "description": "More details on the state of the backup when it is in Creating lifecycleState.\n",
      "enum": [
        "WAITING_FOR_BACKUP_FROM_DB",
        "SCHEDULED_FOR_ARCHIVAL",
        "ARCHIVAL_IN_PROGRESS"
      ],
      "type": "string"
    },
    "protectedDatabaseId": {
      "description": "The OCID of the protected database associated with the long-term backup.",
      "type": "string"
    },
    "retentionPeriod": {
      "description": "The maximum number of DAYS or YEARS to store the long-term backup. You can retain a long-term backup for a period ranging from 90-3650 days or 1-10 years.",
      "items": {
        "$ref": "#/$defs/RetentionPeriodValue"
      },
      "maxItems": 1,
      "type": "array"
    },
    "retentionPointInTime": {
      "description": "An RFC3339 formatted datetime string that indicates the target point in time until which the long-term backup is consistent. For example, '2020-05-22T21:10:29.600Z'.",
      "format": "date-time",
      "type": "string"
    },
    "retentionScn": {
      "description": "The unique system change number (SCN) or the target point in the database until which the long-term backup is consistent.",
      "type": "integer"
    },
    "retentionUntilDateTime": {
      "description": "Indicates that Recovery Service must retain the backup for the specified long-term retention period.",
      "format": "date-time",
      "type": "string"
    },
    "rmanTag": {
      "description": "Recovery Manager (RMAN) assigned unique identifier for the long-term backup.",
      "maxLength": 255,
      "minLength": 1,
      "type": "string"
    },
    "systemTags": {
      "additionalProperties": {
        "additionalProperties": {
          "description": "The value of the tag. Only string, integer and boolean types are supported.\n",
          "type": "object"
        },
        "description": "Key-value pair representing system tags' keys and values scoped to a namespace.\nExample: `{\"bar-key\": \"value\"}`\n",
        "type": "object"
      },
      "description": "Usage of system tag keys. These predefined keys are scoped to namespaces.\nExample: `{\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}`. For more information, see [Resource Tags](https://docs.oracle.com/en-us/iaas/Content/General/Concepts/resourcetags.htm)\n",
      "type": "object"
    },
    "timeBackupCompleted": {
      "description": "An RFC3339 formatted datetime string that indicates the time when the long-term backup completed. For example, '2020-05-22T21:10:29.600Z'.",
      "format": "date-time",
      "type": "string"
    },
    "timeBackupInitiated": {
      "description": "An RFC3339 formatted datetime string that indicates the time when the long-term backup was created. For example, '2020-05-22T21:10:29.600Z'.",
      "format": "date-time",
      "type": "string"
    },
    "timeCreated": {
      "description": "An RFC3339 formatted datetime string that indicates the time when the long-term backup was created. For example: '2020-05-22T21:10:29.600Z'.\n",
      "format": "date-time",
      "type": "string"
    },
    "timeUpdated": {
      "description": "An RFC3339 formatted datetime string that indicates the time when the long term backup was last updated. For example: '2020-05-22T21:10:29.600Z'.\n",
      "format": "date-time",
      "type": "string"
    }
  },
  "required": [
    "id",
    "compartmentId",
    "protectedDatabaseId",
    "retentionPeriod",
    "retentionUntilDateTime",
    "lifecycleState"
  ],
  "type": "object",
  "$defs": {
    "RetentionPeriodValue": {
      "description": "Specifies the retention period for the long-term backup.\n",
      "properties": {
        "retentionCount": {
          "description": "Specifies the duration (in days or years) to retain the long-term backup. If you have chosen the retentionPeriodType as 'DAYS', then specify a duration ranging from 90 days to 3650 days. If you have chosen the retentionPeriodType as 'YEARS', then specify a duration ranging from 1 year to 10 years.",
          "type": "integer"
        },
        "retentionPeriodType": {
          "description": "Specifies the retention period type for the long-term backup. Allowed values are DAYS or YEARS.",
          "enum": [
            "YEAR",
            "DAY"
          ],
          "type": "string"
        }
      },
      "required": [
        "retentionPeriodType",
        "retentionCount"
      ],
      "type": "object"
    }
  }
}