Basic Parameters

Parameter

Type

Required

Default Value

Description

Rules

nameStringYes-Policy Name

API must be unique in Proxy

descriptionStringNo-Policy Description-
actionTypeEnumNoRESTRICTRestriction type-
zoneIdStringNo+03:00Time FrameMust be valid time frame
restrictionListList<Rule>Yes[ ]Time Restriction RulesMust contain at least one rule

actionType Values

Value

Description

ALLOWAllow at specified times, block at other times
RESTRICT

Block at specified times, allow at other times

Rule (Time Contraints) Parameters

Parameter

Type

Required

Default Value

Description

Rules

descriptionStringNo-Rule explanation-
dayTypeEnum YesWEEKDay Type-
enumWeekDayListList<Enum>Conditional[ ]Days of the weekRequired if dayType=WEEK
dayIntegerConditional-Day of the monthRequired if dayType=CUSTOM, between 0-31
monthIntegerConditional-monthRequired if dayType=CUSTOM, between 0-12
wholeDayBooleanNofalseAll day application-
startHourIntegerConditional-Start timeRequired if wholeDay=false, between 0-24
startMinuteIntegerConditional-Start minuteRequired if wholeDay=false, between 0-60
startSecondIntegerConditional-Start secondRequired if wholeDay=false, between 0-60
endHourIntegerConditional-End timeRequired if wholeDay=false, between 0-24
endMinuteIntegerConditional-End minuteRequired if wholeDay=false, between 0-60
endSecondIntegerConditional-End secondRequired if wholeDay=false, between 0-60

dayTypeValues

Value

Description

WEEKRestriction by days of the week
CUSTOMCustom date-based restriction (day/month)

enumWeekDayList Values

Value

MONDAY
TUESDAY
WEDNESDAY
THURSDAY
FRIDAY
SATURDAY
SUNDAY
ALL

Example JSON Structures

1. Weekday Working Hours Restriction

{
  "operationMetadata" : {
    "targetScope" : "ALL",
    "targetPipeline" : "REQUEST",
    "deploy" : true,
    "deployTargetEnvironmentNameList": [
      "test", "prod"
    ],
    "order" : 1
  },
  "policy" : {
    "type" : "policy-time-restriction",
    "name" : "Restriction on Working Hours",
    "description" : "Allow access between 09:00-18:00 on weekdays",
    "actionType" : "ALLOW",
    "zoneId" : "+03:00",
    "restrictionList" : [ {
      "description" : "Working hours on weekdays",
      "dayType" : "WEEK",
      "enumWeekDayList" : [ "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY" ],
      "wholeDay" : false,
      "startHour" : 9,
      "startMinute" : 0,
      "startSecond" : 0,
      "endHour" : 18,
      "endMinute" : 0,
      "endSecond" : 0
    } ]
  }
}


2. Special Day Restriction

{
  "operationMetadata" : {
    "targetScope" : "ALL",
    "targetPipeline" : "REQUEST",
    "deploy" : true,
    "deployTargetEnvironmentNameList": [
      "test", "prod"
    ],
    "order" : 1
  },
  "policy" : {
    "type" : "policy-time-restriction",
    "name" : "SpecialDayRestriction",
    "description" : "Block access for maintenance on the 1st and 15th of each month",
    "actionType" : "RESTRICT",
    "restrictionList" : [
        {
             "description" : "1st of the month",
             "dayType" : "CUSTOM",
             "day" : 1,
             "month" : 0,
             "wholeDay" : true
      }, {
             "description" : "15th of the month",
             "dayType" : "CUSTOM",
             "day" : 15,
             "month" : 0,
             "wholeDay" : true
      }
    ]
  }
}

3. Mixed Restriction

{
  "operationMetadata" : {
    "targetScope" : "ALL",
    "targetPipeline" : "REQUEST",
    "deploy" : true,
    "deployTargetEnvironmentNameList": [
      "test", "prod"
    ],
    "order" : 1
  },
  "policy" : {
    "type" : "policy-time-restriction",
    "name" : "KarmaRestriction",
    "description" : "Block full day weekend and weekday night access",
    "actionType" : "RESTRICT",
    "restrictionList" : [
        {
          "description" : "Weekend restriction",
             "dayType" : "WEEK",
             "enumWeekDayList" : [ "SATURDAY", "SUNDAY" ],
             "wholeDay" : true
      },
        {
             "description" : "Weekday night restriction",
             "dayType" : "WEEK",
             "enumWeekDayList" : [ "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY" ],
             "wholeDay" : false,
             "startHour" : 22,
             "startMinute" : 0,
             "startSecond" : 0,
             "endHour" : 6,
             "endMinute" : 0,
             "endSecond" : 0
      }
    ]
  }
}