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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user