Skip to content
Snippets Groups Projects
Commit d26c4298 authored by Jakob Odersky's avatar Jakob Odersky Committed by Andrew Or
Browse files

[SPARK-10570][CORE] Add version info to json api

Add a new api endpoint `/api/v1/version` to retrieve various version info. This PR only adds support for finding the current spark version, however other version info such as jvm or scala versions can easily be added.

Author: Jakob Odersky <jodersky@gmail.com>

Closes #10760 from jodersky/SPARK-10570.
parent 15c0b000
No related branches found
No related tags found
No related merge requests found
...@@ -177,6 +177,12 @@ private[v1] class ApiRootResource extends UIRootFromServletContext { ...@@ -177,6 +177,12 @@ private[v1] class ApiRootResource extends UIRootFromServletContext {
@PathParam("attemptId") attemptId: String): EventLogDownloadResource = { @PathParam("attemptId") attemptId: String): EventLogDownloadResource = {
new EventLogDownloadResource(uiRoot, appId, Some(attemptId)) new EventLogDownloadResource(uiRoot, appId, Some(attemptId))
} }
@Path("version")
def getVersion(): VersionResource = {
new VersionResource(uiRoot)
}
} }
private[spark] object ApiRootResource { private[spark] object ApiRootResource {
......
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.spark.status.api.v1
import javax.ws.rs._
import javax.ws.rs.core.MediaType
@Produces(Array(MediaType.APPLICATION_JSON))
private[v1] class VersionResource(ui: UIRoot) {
@GET
def getVersionInfo(): VersionInfo = new VersionInfo(
org.apache.spark.SPARK_VERSION
)
}
...@@ -237,3 +237,6 @@ class AccumulableInfo private[spark]( ...@@ -237,3 +237,6 @@ class AccumulableInfo private[spark](
val name: String, val name: String,
val update: Option[String], val update: Option[String],
val value: String) val value: String)
class VersionInfo private[spark](
val spark: String)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment