net.nemerosa.ontrack.kdsl.spec.admin.AdminMgt.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ontrack-kdsl Show documentation
Show all versions of ontrack-kdsl Show documentation
Ontrack module: ontrack-kdsl
package net.nemerosa.ontrack.kdsl.spec.admin
import net.nemerosa.ontrack.kdsl.connector.Connected
import net.nemerosa.ontrack.kdsl.connector.Connector
import net.nemerosa.ontrack.kdsl.connector.parse
import java.net.URLEncoder
/**
* Admin interface to Ontrack.
*/
class AdminMgt(connector: Connector) : Connected(connector) {
/**
* Gets a list of log entries
*
* @param text Filter on text message
* @param count Number of entries to return
*/
fun logEntries(text: String = "", count: Int = 1): List =
connector.get("/rest/admin/logs?count=$count&text=${URLEncoder.encode(text, "UTF-8")}")
.body
.parse()
.resources
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy