Search in sources :

Example 1 with V3VersionCaps

use of org.ovirt.engine.api.v3.types.V3VersionCaps in project ovirt-engine by oVirt.

the class V3CapabilitiesServer method get.

@GET
@Path("/{id}")
public V3VersionCaps get(@PathParam("id") String id) {
    V3Capabilities capabilities = list();
    Optional<V3VersionCaps> caps = capabilities.getVersions().stream().filter(x -> x.getId().equals(id)).findFirst();
    if (caps.isPresent()) {
        return caps.get();
    }
    throw new WebApplicationException(Response.Status.NOT_FOUND);
}
Also used : V3VersionCaps(org.ovirt.engine.api.v3.types.V3VersionCaps) DOMSource(javax.xml.transform.dom.DOMSource) PathParam(javax.ws.rs.PathParam) XPathExpressionException(javax.xml.xpath.XPathExpressionException) Produces(javax.ws.rs.Produces) XPath(javax.xml.xpath.XPath) GET(javax.ws.rs.GET) VersionSource(org.ovirt.engine.api.restapi.invocation.VersionSource) XPathConstants(javax.xml.xpath.XPathConstants) Path(javax.ws.rs.Path) CurrentManager(org.ovirt.engine.api.restapi.invocation.CurrentManager) Document(org.w3c.dom.Document) Node(org.w3c.dom.Node) JAXB(javax.xml.bind.JAXB) V3Capabilities(org.ovirt.engine.api.v3.types.V3Capabilities) V3VersionCaps(org.ovirt.engine.api.v3.types.V3VersionCaps) NodeList(org.w3c.dom.NodeList) Current(org.ovirt.engine.api.restapi.invocation.Current) XPathFactory(javax.xml.xpath.XPathFactory) Element(org.w3c.dom.Element) Response(javax.ws.rs.core.Response) DocumentBuilder(javax.xml.parsers.DocumentBuilder) Optional(java.util.Optional) WebApplicationException(javax.ws.rs.WebApplicationException) DocumentBuilderFactory(javax.xml.parsers.DocumentBuilderFactory) InputStream(java.io.InputStream) WebApplicationException(javax.ws.rs.WebApplicationException) V3Capabilities(org.ovirt.engine.api.v3.types.V3Capabilities) XPath(javax.xml.xpath.XPath) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Aggregations

InputStream (java.io.InputStream)1 Optional (java.util.Optional)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 PathParam (javax.ws.rs.PathParam)1 Produces (javax.ws.rs.Produces)1 WebApplicationException (javax.ws.rs.WebApplicationException)1 Response (javax.ws.rs.core.Response)1 JAXB (javax.xml.bind.JAXB)1 DocumentBuilder (javax.xml.parsers.DocumentBuilder)1 DocumentBuilderFactory (javax.xml.parsers.DocumentBuilderFactory)1 DOMSource (javax.xml.transform.dom.DOMSource)1 XPath (javax.xml.xpath.XPath)1 XPathConstants (javax.xml.xpath.XPathConstants)1 XPathExpressionException (javax.xml.xpath.XPathExpressionException)1 XPathFactory (javax.xml.xpath.XPathFactory)1 Current (org.ovirt.engine.api.restapi.invocation.Current)1 CurrentManager (org.ovirt.engine.api.restapi.invocation.CurrentManager)1 VersionSource (org.ovirt.engine.api.restapi.invocation.VersionSource)1 V3Capabilities (org.ovirt.engine.api.v3.types.V3Capabilities)1