Skip to content

Commit 79dd937

Browse files
author
mthakkar
committed
[java] Updated with v13 java source
1 parent 1591b82 commit 79dd937

10 files changed

+274
-9
lines changed

java/enunciate.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.27.xsd">
33

44
<api-classes>
5-
<include pattern="com.cloudera.api.v12.*"/>
5+
<include pattern="com.cloudera.api.v13.*"/>
66
</api-classes>
77

88
<services>
9-
<rest defaultRestSubcontext="/api/v12"/>
9+
<rest defaultRestSubcontext="/api/v13"/>
1010
</services>
1111

1212
<modules>
1313
<docs splashPackage="com.cloudera.api"
1414
copyright="Cloudera, Inc. All rights reserved."
1515
docsDir="apidocs"
16-
title="Cloudera Manager API v12"
16+
title="Cloudera Manager API v13"
1717
groupRestResources="byPath"
1818
freemarkerXMLProcessingTemplate="api-docs.fmt"
1919
css="static/cms/css/api-docs.css"

java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<groupId>com.cloudera.api</groupId>
66
<artifactId>cloudera-manager-api</artifactId>
77
<name>Cloudera Manager API</name>
8-
<version>5.7.0</version>
8+
<version>5.8.0</version>
99

1010
<properties>
1111
<cxf.version>2.7.7</cxf.version>

java/src/main/java/com/cloudera/api/ApiRootResource.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.cloudera.api.v10.RootResourceV10;
2020
import com.cloudera.api.v11.RootResourceV11;
2121
import com.cloudera.api.v12.RootResourceV12;
22+
import com.cloudera.api.v13.RootResourceV13;
2223
import com.cloudera.api.v2.RootResourceV2;
2324
import com.cloudera.api.v3.RootResourceV3;
2425
import com.cloudera.api.v4.RootResourceV4;
@@ -27,7 +28,6 @@
2728
import com.cloudera.api.v7.RootResourceV7;
2829
import com.cloudera.api.v8.RootResourceV8;
2930
import com.cloudera.api.v9.RootResourceV9;
30-
import com.cloudera.api.v12.RootResourceV12;
3131

3232
import javax.ws.rs.Consumes;
3333
import javax.ws.rs.GET;
@@ -116,6 +116,12 @@ public interface ApiRootResource {
116116
@Path("/v12")
117117
RootResourceV12 getRootV12();
118118

119+
/**
120+
* @return The v13 root resource.
121+
*/
122+
@Path("/v13")
123+
RootResourceV13 getRootV13();
124+
119125
/**
120126
* Fetch the current API version supported by the server.
121127
* <p>

java/src/main/java/com/cloudera/api/model/ApiCollectDiagnosticDataArguments.java

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public class ApiCollectDiagnosticDataArguments {
3434
private String ticketNumber;
3535
private String comments;
3636
private String clusterName;
37+
private boolean enableMonitorMetricsCollection;
3738
private List<String> roles;
3839

3940
/**
@@ -48,17 +49,21 @@ public void setBundleSize(long bundleSizeByte) {
4849
}
4950

5051
/**
51-
* This parameter is ignored as of CM 4.5.
52-
* Use endTime and bundleSize instead.
52+
* This parameter is ignored between CM 4.5 and CM 5.7 versions.
53+
* For versions from CM 4.5 to CM 5.7, use endTime and
54+
* bundleSizeBytes instead.
55+
*
56+
* For CM 5.7+ versions, startTime is an optional parameter that
57+
* is with endTime and bundleSizeBytes. This was introduced
58+
* to perform diagnostic data estimation and collection of global
59+
* diagnostics data for a certain time range.
5360
* The start time (in ISO 8601 format)
5461
* of the period to collection statistics for.
5562
*/
56-
@Deprecated
5763
public String getStartTime() {
5864
return startTime;
5965
}
6066

61-
@Deprecated
6267
public void setStartTime(String startTime) {
6368
this.startTime = startTime;
6469
}
@@ -120,6 +125,17 @@ public void setClusterName(String clusterName) {
120125
this.clusterName = clusterName;
121126
}
122127

128+
/**
129+
* Flag to enable collection of metrics for chart display.
130+
*/
131+
public boolean getEnableMonitorMetricsCollection() {
132+
return enableMonitorMetricsCollection;
133+
}
134+
135+
public void setEnableMonitorMetricsCollection(boolean enable) {
136+
this.enableMonitorMetricsCollection = enable;
137+
}
138+
123139
/**
124140
* List of roles for which to get logs and metrics.
125141
*
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// Copyright (c) 2016 Cloudera, Inc. All rights reserved.
2+
package com.cloudera.api.model;
3+
4+
import com.cloudera.api.ApiUtils;
5+
import com.google.common.base.Objects;
6+
7+
/**
8+
* The state of Hive/HDFS Replication.
9+
*/
10+
public class ApiReplicationState {
11+
private Boolean incrementalExportEnabled;
12+
13+
public ApiReplicationState() {
14+
this(false);
15+
}
16+
17+
public ApiReplicationState(Boolean incrementalExportEnabled) {
18+
this.incrementalExportEnabled = incrementalExportEnabled;
19+
}
20+
21+
/**
22+
*
23+
* returns if incremental export is enabled for the given Hive service.
24+
* Not applicable for HDFS service.
25+
*/
26+
public Boolean getIncrementalExportEnabled() {
27+
return incrementalExportEnabled;
28+
}
29+
30+
public void setIncrementalExportEnabled(Boolean incrementalExportEnabled) {
31+
this.incrementalExportEnabled = incrementalExportEnabled;
32+
}
33+
34+
@Override
35+
public String toString() {
36+
return toStringHelper().toString();
37+
}
38+
39+
protected Objects.ToStringHelper toStringHelper() {
40+
return Objects.toStringHelper(this)
41+
.add("incrementalExportEnabled", incrementalExportEnabled);
42+
}
43+
44+
@Override
45+
public boolean equals(Object o) {
46+
ApiReplicationState that = ApiUtils.baseEquals(this, o);
47+
return this == that || (that != null &&
48+
Objects.equal(incrementalExportEnabled, that.getIncrementalExportEnabled()));
49+
}
50+
51+
@Override
52+
public int hashCode() {
53+
return Objects.hashCode(incrementalExportEnabled);
54+
}
55+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Licensed to Cloudera, Inc. under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. Cloudera, Inc. licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS,
13+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
// See the License for the specific language governing permissions and
15+
// limitations under the License.
16+
package com.cloudera.api.v13;
17+
18+
import com.cloudera.api.v12.ClustersResourceV12;
19+
20+
import javax.ws.rs.Consumes;
21+
import javax.ws.rs.Path;
22+
import javax.ws.rs.PathParam;
23+
import javax.ws.rs.Produces;
24+
import javax.ws.rs.core.MediaType;
25+
26+
import static com.cloudera.api.Parameters.CLUSTER_NAME;
27+
28+
@Consumes({ MediaType.APPLICATION_JSON })
29+
@Produces({ MediaType.APPLICATION_JSON })
30+
public interface ClustersResourceV13 extends ClustersResourceV12 {
31+
32+
/**
33+
* @return The services resource handler.
34+
*/
35+
@Override
36+
@Path("/{clusterName}/services")
37+
public ServicesResourceV13 getServicesResource(
38+
@PathParam(CLUSTER_NAME) String clusterName);
39+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Licensed to Cloudera, Inc. under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. Cloudera, Inc. licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS,
13+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
// See the License for the specific language governing permissions and
15+
// limitations under the License.
16+
package com.cloudera.api.v13;
17+
18+
import com.cloudera.api.DataView;
19+
import com.cloudera.api.model.ApiReplicationState;
20+
import com.cloudera.api.v11.ReplicationsResourceV11;
21+
22+
import javax.ws.rs.DefaultValue;
23+
import javax.ws.rs.GET;
24+
import javax.ws.rs.Path;
25+
import javax.ws.rs.QueryParam;
26+
27+
import static com.cloudera.api.Parameters.DATA_VIEW;
28+
import static com.cloudera.api.Parameters.DATA_VIEW_DEFAULT;
29+
30+
public interface ReplicationsResourceV13 extends ReplicationsResourceV11 {
31+
/**
32+
* returns the replication state. for example if incremental export
33+
* is enabled, etc
34+
* @param view view to materialize
35+
* @return replicate state object.
36+
*/
37+
@GET
38+
@Path("/replicationState")
39+
public ApiReplicationState getReplicationState(
40+
@QueryParam(DATA_VIEW) @DefaultValue(DATA_VIEW_DEFAULT) DataView view);
41+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Licensed to Cloudera, Inc. under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. Cloudera, Inc. licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS,
13+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
// See the License for the specific language governing permissions and
15+
// limitations under the License.
16+
package com.cloudera.api.v13;
17+
18+
import com.cloudera.api.v12.RootResourceV12;
19+
20+
import javax.ws.rs.Path;
21+
22+
@Path("")
23+
public interface RootResourceV13 extends RootResourceV12 {
24+
/**
25+
* @return The clusters resource handler.
26+
*/
27+
@Override
28+
@Path("/clusters")
29+
public ClustersResourceV13 getClustersResource();
30+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// Licensed to Cloudera, Inc. under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. Cloudera, Inc. licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS,
13+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
// See the License for the specific language governing permissions and
15+
// limitations under the License.
16+
package com.cloudera.api.v13;
17+
18+
import static com.cloudera.api.Parameters.SERVICE_NAME;
19+
20+
import com.cloudera.api.model.ApiCommand;
21+
import com.cloudera.api.v11.ServicesResourceV11;
22+
23+
import javax.ws.rs.Consumes;
24+
import javax.ws.rs.POST;
25+
import javax.ws.rs.Path;
26+
import javax.ws.rs.PathParam;
27+
import javax.ws.rs.Produces;
28+
import javax.ws.rs.core.MediaType;
29+
30+
@Consumes({ MediaType.APPLICATION_JSON })
31+
@Produces({ MediaType.APPLICATION_JSON })
32+
public interface ServicesResourceV13 extends ServicesResourceV11 {
33+
/**
34+
* Retrieves the replication resource.
35+
* Only available with Cloudera Manager Enterprise Edition.
36+
* @param serviceName The service name.
37+
* @return The replications resource handler.
38+
*/
39+
@Path("/{serviceName}/replications")
40+
@Override
41+
public ReplicationsResourceV13 getReplicationsResource(
42+
@PathParam(SERVICE_NAME) String serviceName);
43+
44+
/**
45+
* Creates the HDFS directory where YARN container usage metrics are
46+
* stored by NodeManagers for CM to read and aggregate into app usage metrics.
47+
* <p>
48+
* Available since API v13.
49+
* </p>
50+
* @param serviceName The YARN service name.
51+
* @return Information about the submitted command.
52+
*/
53+
@POST
54+
@Path("/{serviceName}/commands/yarnCreateCmContainerUsageInputDirCommand")
55+
public ApiCommand createYarnCmContainerUsageInputDirCommand(
56+
@PathParam(SERVICE_NAME) String serviceName);
57+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Licensed to Cloudera, Inc. under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. Cloudera, Inc. licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS,
13+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
// See the License for the specific language governing permissions and
15+
// limitations under the License.
16+
17+
/**
18+
* API version 13, introduced in Cloudera Manager 5.8.0.
19+
*/
20+
21+
package com.cloudera.api.v13;

0 commit comments

Comments
 (0)