This Improvement request (usability, performance, tech debt, etc.) affects these Traffic Control components:
Current behavior:
When attempting to create a "REFETCH" Content Invalidation Job when no refetch_enabled Parameter exists (or is not set to a case-insensitive "true") yields the error:
{
"alerts": [
{
"text": "InvalidationType is invalid",
"level": "error"
}
]
}
Similarly, if you try to change the Invalidation Type of an existing Content Invalidation Job to "REFETCH" when it's disallowed, the message incorrectly reports that "REFRESH" is not allowed:
PUT /api/4.0/jobs?id=1 HTTP/1.1
User-Agent: python-requests/2.25.1
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Cookie: mojolicious=...
Content-Length: 191
{
"deliveryService": "demo1",
"ttlHours": 72,
"startTime": "2021-11-09T01:02:03Z",
"assetUrl": "http://origin.infra.ciab.test/.+",
"createdBy": "admin",
"id": 1,
"invalidationType": "REFETCH"
}
Response:
{
"alerts": [
{
"text": "Invalidation Type REFRESH is disallowed",
"level": "error"
}
]
}
New behavior:
Firstly, the field is called "invalidationType", not "InvalidationType" - but that's less important than that the value "REFETCH" is actually valid, just not allowed, and the error message doesn't give the user enough information to know what will cause the request to succeed.
Also, the response from a PUT request should not lie to the user.
This Improvement request (usability, performance, tech debt, etc.) affects these Traffic Control components:
Current behavior:
When attempting to create a "REFETCH" Content Invalidation Job when no
refetch_enabledParameter exists (or is not set to a case-insensitive "true") yields the error:{ "alerts": [ { "text": "InvalidationType is invalid", "level": "error" } ] }Similarly, if you try to change the Invalidation Type of an existing Content Invalidation Job to "REFETCH" when it's disallowed, the message incorrectly reports that "REFRESH" is not allowed:
Response:
{ "alerts": [ { "text": "Invalidation Type REFRESH is disallowed", "level": "error" } ] }New behavior:
Firstly, the field is called "invalidationType", not "InvalidationType" - but that's less important than that the value "REFETCH" is actually valid, just not allowed, and the error message doesn't give the user enough information to know what will cause the request to succeed.
Also, the response from a PUT request should not lie to the user.