Retention Period Validation

A TDM user can set a retention period either on the extracted data version or on the entity reservation (set a reservation period).

In both cases the retention period is a combination of a unit (Hours, Days, Weeks …) and a value. For example, populate the unit with 'Days' and the value with 2 to set a retention period of 2 days.

An admin user of the environment's owner can set an unlimited retention period by populating the value with zero.

A tester user is limited and can set a retention period that does not exceed the maximum retention period defined on extract task and entity's reservation period.

Therefore the retention period, either of the task itself or of the overridden execution parameters, must be validated for a tester user to verify that it does not exceed the maximum period.

Which Task Requires a Retention Period Validation?

Extract Task

Validate the retention period for the user whether it is set in the overridden parameters or taken from the task itself.

Load or Reserve Tasks

Validate the retention period (reservation period) if the task reserves entities on the target environment: the task's reserve_ind attribute is true or the user set the reservationInd to true in the overridden execution parameter.

Validate the retention period for the user whether it is set in the overridden parameters or taken from the task itself.

How Do I Identify a User as a Tester?

Extract Task

1. The Task's Source Environment is Overridden by the User

The getEnvironmentsForTaskAttr API returns the role_id attribute on each environment. If the role_id of the selected environment is populated by a numeric sequence value, the user is added to the environment as a tester.

2. The Task's Source Environment is not Overridden by the User

Get the task's environment id from the tasks API (environment_id attribute). Then get the role_id of this environment from the getEnvironmentsForTaskAttr output. If the role_id of the task's environment is populated by a numeric sequence value, the user is added to the environment as a tester.

Reserve Entities on the Target Environment

1. The Task's Target Environment is Overridden by the User

The getEnvironmentsForTaskAttr API returns the role_id attribute on each environment. If the role_id of the selected target environment is populated by a numeric sequence value, the user is added to the environment as a tester.

2. The Task's Target Environment is not Overridden by the User

Get the task's environment id from the tasks API (environment_id attribute). Then get the role_id of this environment from the getEnvironmentsForTaskAttr output. If the role_id of the task's environment is populated by a numeric sequence value, the user is added to the environment as a tester.

How to Validate the Tasks' Retention Period?

Validate the Retention Period on Extract Data Versioning Task

Get the maximum number of days from the retentionperiodinfo API and compare it with the task's retention period:

  • maxRetentionPeriodForExtract attribute returns the maximum number of days to be set in the retention period for extract tasks.

    Example:

    "maxRetentionPeriodForExtract": {
        "units": "Days",
        "value": 90
      }

Note that if the task's retention period is set with a different unit (that is, the unit is not set to 'Days'), the task's retention period must be converted to days to validate it.

Validate the Reservation Period

Option I

Get the maximum number of days from the retentionperiodinfo API and compare it with the task's retention period:

  • maxRetentionPeriodForReserve attribute returns the maximum number of days to be set in the retention period for Entity Reservation.

    Example:

  "maxRetentionPeriodForReserve": {
        "units": "Days",
        "value": "10"
      }

Note that if the task's retention period is set with a different unit (that is, the unit is not set to 'Days'), the task's retention period must be converted to days to validate it.

Option II

Call the validatereserveretentionperiod API to validate the reservation period of the task's entities.

API URL

/validatereserveretentionperiod

HTTP Method

POST

API Category

TDM_ReserveEntities

API Description

Validate if the given retention period on the input entity list and environment does not exceed the max retention period allowed for user. An admin user of the environment's owner can set an unlimited retention period.

If the entities are already reserved by the user, check the new expiration date against the existing start reservation date. Else, check the retention period against the current Datetime.

API Input

The validated retention period can be populated either by the combination of retentionUnit and retentionValue input parameters or by populating the newEndDateTime parameter. If the retention unit and values are populated, validate the reservation period based on these parameter. Else, validate the reservation period based on the input newEndDateTime.

Param Name

Mandatory

Valid Values

Description

retentionUnit

No
  • "Minutes"
  • "Hours"
  • "Days"
  • "Weeks"
  • "Years"
Populated with the unit type of the reservation period.

retentionValue

No

Number

The reservation period value. For example, if the retentionUnit parameter is "Days" and the retentionValue parameter is 5, the reservation period is 5 days.

newEndDateTime

No

'YYYYMMDDhh24MISS' format

New end date of the reservation period. This parameter can be set instead of the retention period unit and value parameters. If the retention unit and values parameters are populated, validate the reservation period based on these parameters. Else, validate the reservation period based on the input newEndDateTime parameter.
listOfEntities 

Yes

 

This parameter contains the following attributes of each task's entity:

  • environment_name
  • be_name
  • target_entity_id.

Note that if the entitieslist attribute is set in the overridden execution parameters, populate the listOfEntities with the entities of the entitieslist. Else, get the selection_param_value task's attribute if the task's selection_method is 'L' (entity list).

API Input Examples

{
    "retentionUnit": "Days",
    "retentionValue": 8,
    "listOfEntities": [
    {
        "environment_name": "TAR",
        "be_name": "Customer",
        "target_entity_id": "1"
    },
    {
        "environment_name": "TAR",
        "be_name": "Customer",
        "target_entity_id": "2"
    }
    ]
}
{
    "newEndDateTime": "20220218000000",
    "listOfEntities": [
    {
        "environment_name": "TAR",
    "be_name": "Customer",
    "target_entity_id": "1"
    },
    {
    "environment_name": "TAR",
    "be_name": "Customer",
    "target_entity_id": "2"
    }
    ]
}

API Output Example

{
  "result": [
    {
      "id": "1"
    },
    {
      "id": "3"
    },
    {
      "id": "4"
    }
  ],
  "errorCode": "FAILED",
  "message": "The validation had failed for the following entities: 1, 2. The new expiration date calculated exceeds the retention period allowed for a tester."    
}

Retention Period Validation

A TDM user can set a retention period either on the extracted data version or on the entity reservation (set a reservation period).

In both cases the retention period is a combination of a unit (Hours, Days, Weeks …) and a value. For example, populate the unit with 'Days' and the value with 2 to set a retention period of 2 days.

An admin user of the environment's owner can set an unlimited retention period by populating the value with zero.

A tester user is limited and can set a retention period that does not exceed the maximum retention period defined on extract task and entity's reservation period.

Therefore the retention period, either of the task itself or of the overridden execution parameters, must be validated for a tester user to verify that it does not exceed the maximum period.

Which Task Requires a Retention Period Validation?

Extract Task

Validate the retention period for the user whether it is set in the overridden parameters or taken from the task itself.

Load or Reserve Tasks

Validate the retention period (reservation period) if the task reserves entities on the target environment: the task's reserve_ind attribute is true or the user set the reservationInd to true in the overridden execution parameter.

Validate the retention period for the user whether it is set in the overridden parameters or taken from the task itself.

How Do I Identify a User as a Tester?

Extract Task

1. The Task's Source Environment is Overridden by the User

The getEnvironmentsForTaskAttr API returns the role_id attribute on each environment. If the role_id of the selected environment is populated by a numeric sequence value, the user is added to the environment as a tester.

2. The Task's Source Environment is not Overridden by the User

Get the task's environment id from the tasks API (environment_id attribute). Then get the role_id of this environment from the getEnvironmentsForTaskAttr output. If the role_id of the task's environment is populated by a numeric sequence value, the user is added to the environment as a tester.

Reserve Entities on the Target Environment

1. The Task's Target Environment is Overridden by the User

The getEnvironmentsForTaskAttr API returns the role_id attribute on each environment. If the role_id of the selected target environment is populated by a numeric sequence value, the user is added to the environment as a tester.

2. The Task's Target Environment is not Overridden by the User

Get the task's environment id from the tasks API (environment_id attribute). Then get the role_id of this environment from the getEnvironmentsForTaskAttr output. If the role_id of the task's environment is populated by a numeric sequence value, the user is added to the environment as a tester.

How to Validate the Tasks' Retention Period?

Validate the Retention Period on Extract Data Versioning Task

Get the maximum number of days from the retentionperiodinfo API and compare it with the task's retention period:

  • maxRetentionPeriodForExtract attribute returns the maximum number of days to be set in the retention period for extract tasks.

    Example:

    "maxRetentionPeriodForExtract": {
        "units": "Days",
        "value": 90
      }

Note that if the task's retention period is set with a different unit (that is, the unit is not set to 'Days'), the task's retention period must be converted to days to validate it.

Validate the Reservation Period

Option I

Get the maximum number of days from the retentionperiodinfo API and compare it with the task's retention period:

  • maxRetentionPeriodForReserve attribute returns the maximum number of days to be set in the retention period for Entity Reservation.

    Example:

  "maxRetentionPeriodForReserve": {
        "units": "Days",
        "value": "10"
      }

Note that if the task's retention period is set with a different unit (that is, the unit is not set to 'Days'), the task's retention period must be converted to days to validate it.

Option II

Call the validatereserveretentionperiod API to validate the reservation period of the task's entities.

API URL

/validatereserveretentionperiod

HTTP Method

POST

API Category

TDM_ReserveEntities

API Description

Validate if the given retention period on the input entity list and environment does not exceed the max retention period allowed for user. An admin user of the environment's owner can set an unlimited retention period.

If the entities are already reserved by the user, check the new expiration date against the existing start reservation date. Else, check the retention period against the current Datetime.

API Input

The validated retention period can be populated either by the combination of retentionUnit and retentionValue input parameters or by populating the newEndDateTime parameter. If the retention unit and values are populated, validate the reservation period based on these parameter. Else, validate the reservation period based on the input newEndDateTime.

Param Name

Mandatory

Valid Values

Description

retentionUnit

No
  • "Minutes"
  • "Hours"
  • "Days"
  • "Weeks"
  • "Years"
Populated with the unit type of the reservation period.

retentionValue

No

Number

The reservation period value. For example, if the retentionUnit parameter is "Days" and the retentionValue parameter is 5, the reservation period is 5 days.

newEndDateTime

No

'YYYYMMDDhh24MISS' format

New end date of the reservation period. This parameter can be set instead of the retention period unit and value parameters. If the retention unit and values parameters are populated, validate the reservation period based on these parameters. Else, validate the reservation period based on the input newEndDateTime parameter.
listOfEntities 

Yes

 

This parameter contains the following attributes of each task's entity:

  • environment_name
  • be_name
  • target_entity_id.

Note that if the entitieslist attribute is set in the overridden execution parameters, populate the listOfEntities with the entities of the entitieslist. Else, get the selection_param_value task's attribute if the task's selection_method is 'L' (entity list).

API Input Examples

{
    "retentionUnit": "Days",
    "retentionValue": 8,
    "listOfEntities": [
    {
        "environment_name": "TAR",
        "be_name": "Customer",
        "target_entity_id": "1"
    },
    {
        "environment_name": "TAR",
        "be_name": "Customer",
        "target_entity_id": "2"
    }
    ]
}
{
    "newEndDateTime": "20220218000000",
    "listOfEntities": [
    {
        "environment_name": "TAR",
    "be_name": "Customer",
    "target_entity_id": "1"
    },
    {
    "environment_name": "TAR",
    "be_name": "Customer",
    "target_entity_id": "2"
    }
    ]
}

API Output Example

{
  "result": [
    {
      "id": "1"
    },
    {
      "id": "3"
    },
    {
      "id": "4"
    }
  ],
  "errorCode": "FAILED",
  "message": "The validation had failed for the following entities: 1, 2. The new expiration date calculated exceeds the retention period allowed for a tester."    
}