Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPSAPS-46858 Fix API version for 5.15.0 #74

Open
wants to merge 2 commits into
base: cm5-5.15.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
211 changes: 162 additions & 49 deletions java/api-docs.fmt
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@
<!-- JavaScript at the bottom for fast page loading -->

<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if necessary -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js"></script>
<script>window.jQuery || document.write("<script src='js/libs/jquery-1.5.1.min.js'>\x3C/script>")</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.js"></script>
<script>window.jQuery || document.write("<script src='/static/ext/jquery/js/jquery-2.1.1.min.js'>\x3C/script>")</script>

<!--manage the navigation menu-->
<script src="js/libs/xbreadcrumbs.js"></script>
Expand Down Expand Up @@ -1064,10 +1064,10 @@
A service is an abstract entity providing a capability in a cluster.
Examples of services are HDFS, MapReduce, YARN, and HBase. A service
is usually distributed, and contains a set of roles that physically
run on the cluster. A service has its own configuration, status,
metrics, and roles. You may issue commands against a service, or
against a set of roles in bulk. Additionally, an HDFS service has
nameservices, and a MapReduce service has activities.
run on the cluster. A service has its own configuration, status and
roles. You may issue commands against a service, or against a set
of roles in bulk. Additionally, an HDFS service has nameservices,
and a MapReduce service has activities.
<p>
All services belong to a cluster (except for the Cloudera Management
Service), and is uniquely identified by its name within a Cloudera
Expand All @@ -1083,8 +1083,8 @@
processes.) Once created, a role cannot be reassigned to a different
host. You need to delete and re-create it.
<p>
A role has its own configuration, status and metrics. API commands on
roles are always issued in bulk at the service level.
A role has its own configuration and status. API commands on roles
are always issued in bulk at the service level.
</dd>
<dt>Role Type</dt>
<dd>
Expand Down Expand Up @@ -1119,6 +1119,18 @@
The operation of this service is similar to other Hadoop services, except
that the Management Service does not belong to a cluster.
</dd>
<dt>Metrics</dt>
<dd>
<p>
A metric is a property that can be measured to quantify the state of an
entity or activity, such as the number of open file descriptors or CPU
utilization percentage. Full list of metric schema is available through
Cloudera Manager API /timeseries/schema endpoint.
<p>
Cloudera Manager enables retrieving of metric data using a launguage
called tsquery. Please see tsquery documentation for more details on
how to write a tsquery.
</dd>
</dl>

<h2>Debugging the API</h2>
Expand Down Expand Up @@ -1504,56 +1516,157 @@
}
}</code>

<h3>Metrics</h3>
<h3>Querying metric data</h3>

<p>In the Enterprise Edition, you can get metrics related to hosts,
services, roles and activities. The call by default fetches data points from
the last 5 minutes.
<p>
Getting dfs capacity metric data for service HDFS-1.
<code>
$ curl -u admin:admin \
'http://localhost:7180/api/v1/clusters/Cluster%201%20-%20CDH4/services/hdfs1/metrics?metrics=dfs_capacity_used_non_hdfs&amp;metrics=dfs_capacity'
'http://localhost:7180/api/v11/timeseries?query=select%20dfs_capacity,%20dfs_capacity_used,%20dfs_capacity_used_non_hdfs%20where%20entityName=HDFS-1'

{
"items" : [ {
"name" : "dfs_capacity_used_non_hdfs",
"context" : "hdfs1:nameservice1",
"data" : [ {
"value" : 0.0,
"timestamp" : "2012-05-06T10:25:46.000Z"
}, {
"value" : 0.0,
"timestamp" : "2012-05-06T10:26:46.000Z"
}, {
"value" : 0.0,
"timestamp" : "2012-05-06T10:27:46.000Z"
}, {
"value" : 0.0,
"timestamp" : "2012-05-06T10:28:46.000Z"
}, {
"value" : 0.0,
"timestamp" : "2012-05-06T10:29:46.000Z"
} ],
"unit" : "bytes"
}, {
"name" : "dfs_capacity",
"context" : "hdfs1:nameservice1",
"data" : [ {
"value" : 3.2103841792E10,
"timestamp" : "2012-05-06T10:25:46.000Z"
}, {
"value" : 3.2103841792E10,
"timestamp" : "2012-05-06T10:26:46.000Z"
}, {
"value" : 3.2103841792E10,
"timestamp" : "2012-05-06T10:27:46.000Z"
"timeSeries": [ {
"metadata": {
"metricName": "dfs_capacity",
"entityName": "HDFS-1",
"startTime": "2015-09-17T23:42:22.533Z",
"endTime": "2015-09-17T23:47:22.533Z",
"attributes": {
"clusterName": "Cluster 1",
"category": "SERVICE",
"clusterDisplayName": "Cluster 1",
"active": "true",
"serviceType": "HDFS",
"serviceDisplayName": "HDFS-1",
"version": "CDH 5.7.0",
"serviceName": "HDFS-1",
"entityName": "HDFS-1"
},
"unitNumerators": [
"bytes"
],
"unitDenominators": [],
"expression": "SELECT dfs_capacity WHERE entityName = \"HDFS-1\" AND category = SERVICE",
"metricCollectionFrequencyMs": 60000,
"rollupUsed": "RAW"
},
"data": [ {
"timestamp": "2015-09-17T23:43:10.599Z",
"value": 86909397813,
"type": "SAMPLE"
}, {
"timestamp": "2015-09-17T23:44:10.605Z",
"value": 86909397813,
"type": "SAMPLE"
}, {
"timestamp": "2015-09-17T23:45:10.608Z",
"value": 86909397813,
"type": "SAMPLE"
}, {
"timestamp": "2015-09-17T23:46:10.615Z",
"value": 86909397813,
"type": "SAMPLE"
}, {
"timestamp": "2015-09-17T23:47:15.613Z",
"value": 86909397813,
"type": "SAMPLE"
} ]
}, {
"value" : 3.2103841792E10,
"timestamp" : "2012-05-06T10:28:46.000Z"
"metadata": {
"metricName": "dfs_capacity_used",
"entityName": "HDFS-1",
"startTime": "2015-09-17T23:42:22.533Z",
"endTime": "2015-09-17T23:47:22.533Z",
"attributes": {
"clusterName": "Cluster 1",
"category": "SERVICE",
"clusterDisplayName": "Cluster 1",
"active": "true",
"serviceType": "HDFS",
"serviceDisplayName": "HDFS-1",
"version": "CDH 5.7.0",
"serviceName": "HDFS-1",
"entityName": "HDFS-1"
},
"unitNumerators": [
"bytes"
],
"unitDenominators": [],
"expression": "SELECT dfs_capacity_used WHERE entityName = \"HDFS-1\" AND category = SERVICE",
"metricCollectionFrequencyMs": 60000,
"rollupUsed": "RAW"
},
"data": [ {
"timestamp": "2015-09-17T23:43:10.599Z",
"value": 1728884736,
"type": "SAMPLE"
}, {
"timestamp": "2015-09-17T23:44:10.605Z",
"value": 1728884736,
"type": "SAMPLE"
}, {
"timestamp": "2015-09-17T23:45:10.608Z",
"value": 1728884736,
"type": "SAMPLE"
}, {
"timestamp": "2015-09-17T23:46:10.615Z",
"value": 1728884736,
"type": "SAMPLE"
}, {
"timestamp": "2015-09-17T23:47:15.613Z",
"value": 1728884736,
"type": "SAMPLE"
} ]
}, {
"value" : 3.2103841792E10,
"timestamp" : "2012-05-06T10:29:46.000Z"
"metadata": {
"metricName": "dfs_capacity_used_non_hdfs",
"entityName": "HDFS-1",
"startTime": "2015-09-17T23:42:22.533Z",
"endTime": "2015-09-17T23:47:22.533Z",
"attributes": {
"clusterName": "Cluster 1",
"category": "SERVICE",
"clusterDisplayName": "Cluster 1",
"active": "true",
"serviceType": "HDFS",
"serviceDisplayName": "HDFS-1",
"version": "CDH 5.7.0",
"serviceName": "HDFS-1",
"entityName": "HDFS-1"
},
"unitNumerators": [
"bytes"
],
"unitDenominators": [],
"expression": "SELECT dfs_capacity_used_non_hdfs WHERE entityName = \"HDFS-1\" AND category = SERVICE",
"metricCollectionFrequencyMs": 60000,
"rollupUsed": "RAW"
},
"data": [ {
"timestamp": "2015-09-17T23:43:10.599Z",
"value": 1610609973,
"type": "SAMPLE"
}, {
"timestamp": "2015-09-17T23:44:10.605Z",
"value": 1610609973,
"type": "SAMPLE"
}, {
"timestamp": "2015-09-17T23:45:10.608Z",
"value": 1610609973,
"type": "SAMPLE"
}, {
"timestamp": "2015-09-17T23:46:10.615Z",
"value": 1610609973,
"type": "SAMPLE"
}, {
"timestamp": "2015-09-17T23:47:15.613Z",
"value": 1610609973,
"type": "SAMPLE"
} ]
} ],
"unit" : "bytes"
"warnings": [],
"timeSeriesQuery": "select dfs_capacity, dfs_capacity_used, dfs_capacity_used_non_hdfs where entityName=HDFS-1"
} ]</code>

[/@boilerplate]
Expand Down
6 changes: 3 additions & 3 deletions java/enunciate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.27.xsd">

<api-classes>
<include pattern="com.cloudera.api.v10.*"/>
<include pattern="com.cloudera.api.v19.*"/>
</api-classes>

<services>
<rest defaultRestSubcontext="/api/v10"/>
<rest defaultRestSubcontext="/api/v19"/>
</services>

<modules>
<docs splashPackage="com.cloudera.api"
copyright="Cloudera, Inc. All rights reserved."
docsDir="apidocs"
title="Cloudera Manager API v10"
title="Cloudera Manager API v19"
groupRestResources="byPath"
freemarkerXMLProcessingTemplate="api-docs.fmt"
css="static/cms/css/api-docs.css"
Expand Down
42 changes: 38 additions & 4 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<version>5.15.0</version>

<properties>
<cxf.version>2.7.5</cxf.version>
<cxf.version>2.7.7</cxf.version>
<guava.version>14.0</guava.version>
<jackson2.version>2.1.0</jackson2.version>
<joda.version>2.1</joda.version>
Expand All @@ -21,7 +21,7 @@
<distributionManagement>
<repository>
<id>cdh.releases.repo</id>
<url>http://maven.jenkins.cloudera.com:8081/artifactory/libs-release-local</url>
<url>http://maven.jenkins.cloudera.com:8081/artifactory/cdh-staging-local</url>
<name>CDH Releases Repository</name>
</repository>
<snapshotRepository>
Expand Down Expand Up @@ -114,6 +114,36 @@
</plugins>
</build>
</profile>
<profile>
<!-- profile to use with Atlassian Clover for code coverage -->
<id>clover</id>
<properties>
<clover.version>4.0.3</clover.version>
<clover.generateHtml>true</clover.generateHtml>
<clover.generateXml>true</clover.generateXml>
</properties>
<dependencies>
<dependency>
<groupId>com.atlassian.clover</groupId>
<artifactId>clover</artifactId>
<version>${clover.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<!-- Clover plugin to enable maven to create instantiated jars that will record code coverage -->
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-clover2-plugin</artifactId>
<version>${clover.version}</version>
<configuration>
<generateHtml>${clover.generateHtml}</generateHtml>
<generateXml>${clover.generateXml}</generateXml>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
Expand Down Expand Up @@ -153,7 +183,7 @@
<pattern>com.</pattern>
<shadedPattern>${privateClassPath}.com.</shadedPattern>
<includes>
<include>com.google.guava.**</include>
<include>com.google.common.**</include>
<include>com.fasterxml.jackson.**</include>
</includes>
</relocation>
Expand Down Expand Up @@ -209,7 +239,6 @@
<additionalparam>${javadocOptions}</additionalparam>
<docfilessubdirs>true</docfilessubdirs>
<outputDirectory>${project.build.directory}/javadoc</outputDirectory>
<stylesheetfile>${basedir}/src/javadoc/javadoc.css</stylesheetfile>
<overview>${basedir}/src/javadoc/overview.html</overview>
<doctitle>Cloudera Manager API (${project.version})</doctitle>
<windowtitle>Cloudera Manager API (${project.version})</windowtitle>
Expand Down Expand Up @@ -237,6 +266,11 @@
<excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
</configuration>
</plugin>
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>1.4.3</version>
</plugin>
</plugins>
</build>
<dependencies>
Expand Down
Loading