2
0
mirror of https://github.com/VinylDNS/vinyldns synced 2025-08-30 22:05:21 +00:00

updated the get generated zone

Signed-off-by: Jay07GIT <jeyraj931@gmail.com>
This commit is contained in:
Jay07GIT
2025-05-05 19:24:14 +05:30
parent dea0e46053
commit ed63cd5725

View File

@@ -151,38 +151,40 @@ class ZoneRoute(
complete(StatusCodes.Accepted -> response)
}
} ~
(get & monitor("Endpoint.listGeneratedZones")) {
parameters(
"nameFilter".?,
"startFrom".as[String].?,
"maxItems".as[Int].?(DEFAULT_MAX_ITEMS),
"searchByAdminGroup".as[Boolean].?(false),
"ignoreAccess".as[Boolean].?(false)
) {
(
nameFilter: Option[String],
startFrom: Option[String],
maxItems: Int,
searchByAdminGroup: Boolean,
ignoreAccess: Boolean
) => {
handleRejections(invalidQueryHandler) {
validate(
0 < maxItems && maxItems <= MAX_ITEMS_LIMIT,
s"maxItems was $maxItems, maxItems must be between 0 and $MAX_ITEMS_LIMIT"
) {
authenticateAndExecute(
zoneService
.listGeneratedZones(_, nameFilter, startFrom, maxItems, searchByAdminGroup, ignoreAccess)
) { result =>
complete(StatusCodes.OK, result)
path("zones" / "generate" / "info") {
(get & monitor("Endpoint.listGeneratedZones")) {
parameters(
"nameFilter".?,
"startFrom".as[String].?,
"maxItems".as[Int].?(DEFAULT_MAX_ITEMS),
"searchByAdminGroup".as[Boolean].?(false),
"ignoreAccess".as[Boolean].?(false)
) {
(
nameFilter: Option[String],
startFrom: Option[String],
maxItems: Int,
searchByAdminGroup: Boolean,
ignoreAccess: Boolean
) => {
handleRejections(invalidQueryHandler) {
validate(
0 < maxItems && maxItems <= MAX_ITEMS_LIMIT,
s"maxItems was $maxItems, maxItems must be between 0 and $MAX_ITEMS_LIMIT"
) {
authenticateAndExecute(
zoneService
.listGeneratedZones(_, nameFilter, startFrom, maxItems, searchByAdminGroup, ignoreAccess)
) { result =>
complete(StatusCodes.OK, result)
}
}
}
}
}
}
}
}~
} ~
path("zones" /"generate"/ "name" / Segment) { zoneName =>
authenticateAndExecute(zoneService.getGenerateZoneByName(zoneName, _)) { zone =>
complete(StatusCodes.OK, zone)