ArafatKhan2198 commented on code in PR #4585: URL: https://github.com/apache/ozone/pull/4585#discussion_r1173484795
########## hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/OMEndpoint.java: ########## @@ -0,0 +1,173 @@ +/* + * 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 + * <p> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p> + * 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.hadoop.ozone.recon.api; + +import org.apache.hadoop.ozone.OzoneAcl; +import org.apache.hadoop.ozone.om.helpers.OmBucketInfo; +import org.apache.hadoop.ozone.om.helpers.OmVolumeArgs; +import org.apache.hadoop.ozone.recon.api.types.AclMetadata; +import org.apache.hadoop.ozone.recon.api.types.BucketMetadata; +import org.apache.hadoop.ozone.recon.api.types.BucketsResponse; +import org.apache.hadoop.ozone.recon.api.types.VolumeMetadata; +import org.apache.hadoop.ozone.recon.api.types.VolumesResponse; +import org.apache.hadoop.ozone.recon.recovery.ReconOMMetadataManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.inject.Inject; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import java.io.IOException; +import java.time.Instant; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * Endpoint to fetch details about volume. + */ +@Path("/om") +@Produces(MediaType.APPLICATION_JSON) +@AdminOnly +public class OMEndpoint { + + private static final Logger LOG = + LoggerFactory.getLogger(OMEndpoint.class); + + @Inject + private ReconOMMetadataManager omMetadataManager; + + @Inject + public OMEndpoint(ReconOMMetadataManager omMetadataManager) { + this.omMetadataManager = omMetadataManager; + } + + @GET + @Path("/volumes") + public Response getVolumes() throws IOException { Review Comment: @ivandika3 we have implemented this pagination logic in the other Recon API's as well. Please go through [this](https://github.com/apache/ozone/pull/4182#issuecomment-1485840652) to understand how we implemented pagination. I believe if we could implement pagination rather than displaying all the buckets and volumes would be a great thing. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
