blob: f790d0325688705787b0bc12146ee64844066f0b [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
| Generated by Apache Maven Doxia at 2021-06-15
| Rendered using Apache Maven Stylus Skin 1.5
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Apache Hadoop 3.3.1 &#x2013; WebHDFS REST API</title>
<style type="text/css" media="all">
@import url("./css/maven-base.css");
@import url("./css/maven-theme.css");
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
<meta name="Date-Revision-yyyymmdd" content="20210615" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body class="composite">
<div id="banner">
<a href="http://hadoop.apache.org/" id="bannerLeft">
<img src="http://hadoop.apache.org/images/hadoop-logo.jpg" alt="" />
</a>
<a href="http://www.apache.org/" id="bannerRight">
<img src="http://www.apache.org/images/asf_logo_wide.png" alt="" />
</a>
<div class="clear">
<hr/>
</div>
</div>
<div id="breadcrumbs">
<div class="xleft">
<a href="http://www.apache.org/" class="externalLink">Apache</a>
&gt;
<a href="http://hadoop.apache.org/" class="externalLink">Hadoop</a>
&gt;
<a href="../index.html">Apache Hadoop Project Dist POM</a>
&gt;
<a href="index.html">Apache Hadoop 3.3.1</a>
&gt;
WebHDFS REST API
</div>
<div class="xright"> <a href="http://wiki.apache.org/hadoop" class="externalLink">Wiki</a>
|
<a href="https://gitbox.apache.org/repos/asf/hadoop.git" class="externalLink">git</a>
|
<a href="http://hadoop.apache.org/" class="externalLink">Apache Hadoop</a>
&nbsp;| Last Published: 2021-06-15
&nbsp;| Version: 3.3.1
</div>
<div class="clear">
<hr/>
</div>
</div>
<div id="leftColumn">
<div id="navcolumn">
<h5>General</h5>
<ul>
<li class="none">
<a href="../../index.html">Overview</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/SingleCluster.html">Single Node Setup</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/ClusterSetup.html">Cluster Setup</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/CommandsManual.html">Commands Reference</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/FileSystemShell.html">FileSystem Shell</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/Compatibility.html">Compatibility Specification</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/DownstreamDev.html">Downstream Developer's Guide</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/AdminCompatibilityGuide.html">Admin Compatibility Guide</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/InterfaceClassification.html">Interface Classification</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/filesystem/index.html">FileSystem Specification</a>
</li>
</ul>
<h5>Common</h5>
<ul>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/CLIMiniCluster.html">CLI Mini Cluster</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/FairCallQueue.html">Fair Call Queue</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/NativeLibraries.html">Native Libraries</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/Superusers.html">Proxy User</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/RackAwareness.html">Rack Awareness</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/SecureMode.html">Secure Mode</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/ServiceLevelAuth.html">Service Level Authorization</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/HttpAuthentication.html">HTTP Authentication</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/CredentialProviderAPI.html">Credential Provider API</a>
</li>
<li class="none">
<a href="../../hadoop-kms/index.html">Hadoop KMS</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/Tracing.html">Tracing</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/UnixShellGuide.html">Unix Shell Guide</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/registry/index.html">Registry</a>
</li>
</ul>
<h5>HDFS</h5>
<ul>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsDesign.html">Architecture</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsUserGuide.html">User Guide</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HDFSCommands.html">Commands Reference</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithQJM.html">NameNode HA With QJM</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithNFS.html">NameNode HA With NFS</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/ObserverNameNode.html">Observer NameNode</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/Federation.html">Federation</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/ViewFs.html">ViewFs</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/ViewFsOverloadScheme.html">ViewFsOverloadScheme</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsSnapshots.html">Snapshots</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsEditsViewer.html">Edits Viewer</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsImageViewer.html">Image Viewer</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsPermissionsGuide.html">Permissions and HDFS</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsQuotaAdminGuide.html">Quotas and HDFS</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/LibHdfs.html">libhdfs (C API)</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/WebHDFS.html">WebHDFS (REST API)</a>
</li>
<li class="none">
<a href="../../hadoop-hdfs-httpfs/index.html">HttpFS</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/ShortCircuitLocalReads.html">Short Circuit Local Reads</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/CentralizedCacheManagement.html">Centralized Cache Management</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsNfsGateway.html">NFS Gateway</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsRollingUpgrade.html">Rolling Upgrade</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/ExtendedAttributes.html">Extended Attributes</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/TransparentEncryption.html">Transparent Encryption</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsMultihoming.html">Multihoming</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/ArchivalStorage.html">Storage Policies</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/MemoryStorage.html">Memory Storage Support</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/SLGUserGuide.html">Synthetic Load Generator</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HDFSErasureCoding.html">Erasure Coding</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HDFSDiskbalancer.html">Disk Balancer</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsUpgradeDomain.html">Upgrade Domain</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsDataNodeAdminGuide.html">DataNode Admin</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs-rbf/HDFSRouterFederation.html">Router Federation</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsProvidedStorage.html">Provided Storage</a>
</li>
</ul>
<h5>MapReduce</h5>
<ul>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html">Tutorial</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapredCommands.html">Commands Reference</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduce_Compatibility_Hadoop1_Hadoop2.html">Compatibility with 1.x</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/EncryptedShuffle.html">Encrypted Shuffle</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/PluggableShuffleAndPluggableSort.html">Pluggable Shuffle/Sort</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/DistributedCacheDeploy.html">Distributed Cache Deploy</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/SharedCacheSupport.html">Support for YARN Shared Cache</a>
</li>
</ul>
<h5>MapReduce REST APIs</h5>
<ul>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapredAppMasterRest.html">MR Application Master</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-hs/HistoryServerRest.html">MR History Server</a>
</li>
</ul>
<h5>YARN</h5>
<ul>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/YARN.html">Architecture</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/YarnCommands.html">Commands Reference</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/CapacityScheduler.html">Capacity Scheduler</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/FairScheduler.html">Fair Scheduler</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/ResourceManagerRestart.html">ResourceManager Restart</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/ResourceManagerHA.html">ResourceManager HA</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/ResourceModel.html">Resource Model</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/NodeLabel.html">Node Labels</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/NodeAttributes.html">Node Attributes</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/WebApplicationProxy.html">Web Application Proxy</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/TimelineServer.html">Timeline Server</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/TimelineServiceV2.html">Timeline Service V.2</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/WritingYarnApplications.html">Writing YARN Applications</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/YarnApplicationSecurity.html">YARN Application Security</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/NodeManager.html">NodeManager</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/DockerContainers.html">Running Applications in Docker Containers</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/RuncContainers.html">Running Applications in runC Containers</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/NodeManagerCgroups.html">Using CGroups</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/SecureContainer.html">Secure Containers</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/ReservationSystem.html">Reservation System</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/GracefulDecommission.html">Graceful Decommission</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/OpportunisticContainers.html">Opportunistic Containers</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/Federation.html">YARN Federation</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/SharedCache.html">Shared Cache</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/UsingGpus.html">Using GPU</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/UsingFPGA.html">Using FPGA</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/PlacementConstraints.html">Placement Constraints</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/YarnUI2.html">YARN UI2</a>
</li>
</ul>
<h5>YARN REST APIs</h5>
<ul>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/WebServicesIntro.html">Introduction</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/ResourceManagerRest.html">Resource Manager</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/NodeManagerRest.html">Node Manager</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/TimelineServer.html#Timeline_Server_REST_API_v1">Timeline Server</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/TimelineServiceV2.html#Timeline_Service_v.2_REST_API">Timeline Service V.2</a>
</li>
</ul>
<h5>YARN Service</h5>
<ul>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/yarn-service/Overview.html">Overview</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/yarn-service/QuickStart.html">QuickStart</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/yarn-service/Concepts.html">Concepts</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/yarn-service/YarnServiceAPI.html">Yarn Service API</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/yarn-service/ServiceDiscovery.html">Service Discovery</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/yarn-service/SystemServices.html">System Services</a>
</li>
</ul>
<h5>Hadoop Compatible File Systems</h5>
<ul>
<li class="none">
<a href="../../hadoop-aliyun/tools/hadoop-aliyun/index.html">Aliyun OSS</a>
</li>
<li class="none">
<a href="../../hadoop-aws/tools/hadoop-aws/index.html">Amazon S3</a>
</li>
<li class="none">
<a href="../../hadoop-azure/index.html">Azure Blob Storage</a>
</li>
<li class="none">
<a href="../../hadoop-azure-datalake/index.html">Azure Data Lake Storage</a>
</li>
<li class="none">
<a href="../../hadoop-openstack/index.html">OpenStack Swift</a>
</li>
<li class="none">
<a href="../../hadoop-cos/cloud-storage/index.html">Tencent COS</a>
</li>
</ul>
<h5>Auth</h5>
<ul>
<li class="none">
<a href="../../hadoop-auth/index.html">Overview</a>
</li>
<li class="none">
<a href="../../hadoop-auth/Examples.html">Examples</a>
</li>
<li class="none">
<a href="../../hadoop-auth/Configuration.html">Configuration</a>
</li>
<li class="none">
<a href="../../hadoop-auth/BuildingIt.html">Building</a>
</li>
</ul>
<h5>Tools</h5>
<ul>
<li class="none">
<a href="../../hadoop-streaming/HadoopStreaming.html">Hadoop Streaming</a>
</li>
<li class="none">
<a href="../../hadoop-archives/HadoopArchives.html">Hadoop Archives</a>
</li>
<li class="none">
<a href="../../hadoop-archive-logs/HadoopArchiveLogs.html">Hadoop Archive Logs</a>
</li>
<li class="none">
<a href="../../hadoop-distcp/DistCp.html">DistCp</a>
</li>
<li class="none">
<a href="../../hadoop-gridmix/GridMix.html">GridMix</a>
</li>
<li class="none">
<a href="../../hadoop-rumen/Rumen.html">Rumen</a>
</li>
<li class="none">
<a href="../../hadoop-resourceestimator/ResourceEstimator.html">Resource Estimator Service</a>
</li>
<li class="none">
<a href="../../hadoop-sls/SchedulerLoadSimulator.html">Scheduler Load Simulator</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/Benchmarking.html">Hadoop Benchmarking</a>
</li>
<li class="none">
<a href="../../hadoop-dynamometer/Dynamometer.html">Dynamometer</a>
</li>
</ul>
<h5>Reference</h5>
<ul>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/release/">Changelog and Release Notes</a>
</li>
<li class="none">
<a href="../../api/index.html">Java API docs</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/UnixShellAPI.html">Unix Shell API</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/Metrics.html">Metrics</a>
</li>
</ul>
<h5>Configuration</h5>
<ul>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/core-default.xml">core-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/hdfs-default.xml">hdfs-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs-rbf/hdfs-rbf-default.xml">hdfs-rbf-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/mapred-default.xml">mapred-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-common/yarn-default.xml">yarn-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-kms/kms-default.html">kms-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-hdfs-httpfs/httpfs-default.html">httpfs-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/DeprecatedProperties.html">Deprecated Properties</a>
</li>
</ul>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img alt="Built by Maven" src="./images/logos/maven-feather.png"/>
</a>
</div>
</div>
<div id="bodyColumn">
<div id="contentBox">
<!---
Licensed 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. See accompanying LICENSE file.
-->
<h1>WebHDFS REST API</h1>
<ul>
<li><a href="#Document_Conventions">Document Conventions</a></li>
<li><a href="#Introduction">Introduction</a>
<ul>
<li><a href="#Operations">Operations</a></li>
<li><a href="#FileSystem_URIs_vs_HTTP_URLs">FileSystem URIs vs HTTP URLs</a></li>
<li><a href="#HDFS_Configuration_Options">HDFS Configuration Options</a></li></ul></li>
<li><a href="#Authentication">Authentication</a></li>
<li><a href="#SSL_Configurations_for_SWebHDFS">SSL Configurations for SWebHDFS</a></li>
<li><a href="#Proxy_Users">Proxy Users</a></li>
<li><a href="#Cross-Site_Request_Forgery_Prevention">Cross-Site Request Forgery Prevention</a></li>
<li><a href="#WebHDFS_Retry_Policy">WebHDFS Retry Policy</a></li>
<li><a href="#WebHDFS_Request_Filtering">WebHDFS Request Filtering</a></li>
<li><a href="#File_and_Directory_Operations">File and Directory Operations</a>
<ul>
<li><a href="#Create_and_Write_to_a_File">Create and Write to a File</a></li>
<li><a href="#Append_to_a_File">Append to a File</a></li>
<li><a href="#Concat_File.28s.29">Concat File(s)</a></li>
<li><a href="#Open_and_Read_a_File">Open and Read a File</a></li>
<li><a href="#Make_a_Directory">Make a Directory</a></li>
<li><a href="#Create_a_Symbolic_Link">Create a Symbolic Link</a></li>
<li><a href="#Rename_a_File.2FDirectory">Rename a File/Directory</a></li>
<li><a href="#Delete_a_File.2FDirectory">Delete a File/Directory</a></li>
<li><a href="#Truncate_a_File">Truncate a File</a></li>
<li><a href="#Status_of_a_File.2FDirectory">Status of a File/Directory</a></li>
<li><a href="#List_a_Directory">List a Directory</a></li>
<li><a href="#List_a_File">List a File</a></li>
<li><a href="#Iteratively_List_a_Directory">Iteratively List a Directory</a></li></ul></li>
<li><a href="#Other_File_System_Operations">Other File System Operations</a>
<ul>
<li><a href="#Get_Content_Summary_of_a_Directory">Get Content Summary of a Directory</a></li>
<li><a href="#Get_Quota_Usage_of_a_Directory">Get Quota Usage of a Directory</a></li>
<li><a href="#Set_Quota">Set Quota</a></li>
<li><a href="#Set_Quota_By_Storage_Type">Set Quota By Storage Type</a></li>
<li><a href="#Get_File_Checksum">Get File Checksum</a></li>
<li><a href="#Get_Home_Directory">Get Home Directory</a></li>
<li><a href="#Get_Trash_Root">Get Trash Root</a></li>
<li><a href="#Set_Permission">Set Permission</a></li>
<li><a href="#Set_Owner">Set Owner</a></li>
<li><a href="#Set_Replication_Factor">Set Replication Factor</a></li>
<li><a href="#Set_Access_or_Modification_Time">Set Access or Modification Time</a></li>
<li><a href="#Modify_ACL_Entries">Modify ACL Entries</a></li>
<li><a href="#Remove_ACL_Entries">Remove ACL Entries</a></li>
<li><a href="#Remove_Default_ACL">Remove Default ACL</a></li>
<li><a href="#Remove_ACL">Remove ACL</a></li>
<li><a href="#Set_ACL">Set ACL</a></li>
<li><a href="#Get_ACL_Status">Get ACL Status</a></li>
<li><a href="#Check_access">Check access</a></li></ul></li>
<li><a href="#Storage_Policy_Operations">Storage Policy Operations</a>
<ul>
<li><a href="#Get_all_Storage_Policies">Get all Storage Policies</a></li>
<li><a href="#Set_Storage_Policy">Set Storage Policy</a></li>
<li><a href="#Unset_Storage_Policy">Unset Storage Policy</a></li>
<li><a href="#Get_Storage_Policy">Get Storage Policy</a></li>
<li><a href="#Satisfy_Storage_Policy">Satisfy Storage Policy</a></li>
<li><a href="#Get_File_Block_Locations">Get File Block Locations</a></li></ul></li>
<li><a href="#Extended_Attributes.28XAttrs.29_Operations">Extended Attributes(XAttrs) Operations</a>
<ul>
<li><a href="#Set_XAttr">Set XAttr</a></li>
<li><a href="#Remove_XAttr">Remove XAttr</a></li>
<li><a href="#Get_an_XAttr">Get an XAttr</a></li>
<li><a href="#Get_multiple_XAttrs">Get multiple XAttrs</a></li>
<li><a href="#Get_all_XAttrs">Get all XAttrs</a></li>
<li><a href="#List_all_XAttrs">List all XAttrs</a></li></ul></li>
<li><a href="#Erasure_Coding_Operations">Erasure Coding Operations</a>
<ul>
<li><a href="#Enable_EC_Policy">Enable EC Policy</a></li>
<li><a href="#Disable_EC_Policy">Disable EC Policy</a></li>
<li><a href="#Set_EC_Policy">Set EC Policy</a></li>
<li><a href="#Get_EC_Policy">Get EC Policy</a></li>
<li><a href="#Unset_EC_Policy">Unset EC Policy</a></li></ul></li>
<li><a href="#Snapshot_Operations">Snapshot Operations</a>
<ul>
<li><a href="#Allow_Snapshot">Allow Snapshot</a></li>
<li><a href="#Disallow_Snapshot">Disallow Snapshot</a></li>
<li><a href="#Create_Snapshot">Create Snapshot</a></li>
<li><a href="#Delete_Snapshot">Delete Snapshot</a></li>
<li><a href="#Rename_Snapshot">Rename Snapshot</a></li>
<li><a href="#Get_Snapshot_Diff">Get Snapshot Diff</a></li>
<li><a href="#Get_Snapshottable_Directory_List">Get Snapshottable Directory List</a></li></ul></li>
<li><a href="#Delegation_Token_Operations">Delegation Token Operations</a>
<ul>
<li><a href="#Get_Delegation_Token">Get Delegation Token</a></li>
<li><a href="#Renew_Delegation_Token">Renew Delegation Token</a></li>
<li><a href="#Cancel_Delegation_Token">Cancel Delegation Token</a></li></ul></li>
<li><a href="#Error_Responses">Error Responses</a>
<ul>
<li><a href="#HTTP_Response_Codes">HTTP Response Codes</a>
<ul>
<li><a href="#Illegal_Argument_Exception">Illegal Argument Exception</a></li>
<li><a href="#Security_Exception">Security Exception</a></li>
<li><a href="#Access_Control_Exception">Access Control Exception</a></li>
<li><a href="#File_Not_Found_Exception">File Not Found Exception</a></li></ul></li></ul></li>
<li><a href="#JSON_Schemas">JSON Schemas</a>
<ul>
<li><a href="#ACL_Status_JSON_Schema">ACL Status JSON Schema</a></li>
<li><a href="#XAttrs_JSON_Schema">XAttrs JSON Schema</a></li>
<li><a href="#XAttrNames_JSON_Schema">XAttrNames JSON Schema</a></li>
<li><a href="#Boolean_JSON_Schema">Boolean JSON Schema</a></li>
<li><a href="#ContentSummary_JSON_Schema">ContentSummary JSON Schema</a></li>
<li><a href="#QuotaUsage_JSON_Schema">QuotaUsage JSON Schema</a></li>
<li><a href="#FileChecksum_JSON_Schema">FileChecksum JSON Schema</a></li>
<li><a href="#FileStatus_JSON_Schema">FileStatus JSON Schema</a>
<ul>
<li><a href="#FileStatus_Properties">FileStatus Properties</a></li></ul></li>
<li><a href="#FileStatuses_JSON_Schema">FileStatuses JSON Schema</a></li>
<li><a href="#DirectoryListing_JSON_Schema">DirectoryListing JSON Schema</a></li>
<li><a href="#Long_JSON_Schema">Long JSON Schema</a></li>
<li><a href="#Path_JSON_Schema">Path JSON Schema</a></li>
<li><a href="#RemoteException_JSON_Schema">RemoteException JSON Schema</a></li>
<li><a href="#Token_JSON_Schema">Token JSON Schema</a>
<ul>
<li><a href="#Token_Properties">Token Properties</a></li></ul></li>
<li><a href="#BlockStoragePolicy_JSON_Schema">BlockStoragePolicy JSON Schema</a>
<ul>
<li><a href="#BlockStoragePolicy_Properties">BlockStoragePolicy Properties</a></li></ul></li>
<li><a href="#ECPolicy_JSON_Schema">ECPolicy JSON Schema</a></li>
<li><a href="#BlockStoragePolicies_JSON_Schema">BlockStoragePolicies JSON Schema</a></li>
<li><a href="#SnapshotDiffReport_JSON_Schema">SnapshotDiffReport JSON Schema</a>
<ul>
<li><a href="#DiffReport_Entries">DiffReport Entries</a></li></ul></li>
<li><a href="#SnapshottableDirectoryList_JSON_Schema">SnapshottableDirectoryList JSON Schema</a>
<ul>
<li><a href="#SnapshottableDirectoryStatus">SnapshottableDirectoryStatus</a></li></ul></li>
<li><a href="#BlockLocations_JSON_Schema">BlockLocations JSON Schema</a></li>
<li><a href="#BlockLocation_JSON_Schema">BlockLocation JSON Schema</a>
<ul>
<li><a href="#BlockLocation_Properties">BlockLocation Properties</a></li></ul></li></ul></li>
<li><a href="#HTTP_Query_Parameter_Dictionary">HTTP Query Parameter Dictionary</a>
<ul>
<li><a href="#ACL_Spec">ACL Spec</a></li>
<li><a href="#XAttr_Name">XAttr Name</a></li>
<li><a href="#XAttr_Value">XAttr Value</a></li>
<li><a href="#XAttr_set_flag">XAttr set flag</a></li>
<li><a href="#XAttr_value_encoding">XAttr value encoding</a></li>
<li><a href="#Access_Time">Access Time</a></li>
<li><a href="#Block_Size">Block Size</a></li>
<li><a href="#Buffer_Size">Buffer Size</a></li>
<li><a href="#Create_Flag">Create Flag</a></li>
<li><a href="#Create_Parent">Create Parent</a></li>
<li><a href="#Delegation">Delegation</a></li>
<li><a href="#Destination">Destination</a></li>
<li><a href="#Do_As">Do As</a></li>
<li><a href="#Fs_Action">Fs Action</a></li>
<li><a href="#Group">Group</a></li>
<li><a href="#Length">Length</a></li>
<li><a href="#Modification_Time">Modification Time</a></li>
<li><a href="#New_Length">New Length</a></li>
<li><a href="#Offset">Offset</a></li>
<li><a href="#Old_Snapshot_Name">Old Snapshot Name</a></li>
<li><a href="#Op">Op</a></li>
<li><a href="#Overwrite">Overwrite</a></li>
<li><a href="#Owner">Owner</a></li>
<li><a href="#Permission">Permission</a></li>
<li><a href="#Recursive">Recursive</a></li>
<li><a href="#Renewer">Renewer</a></li>
<li><a href="#Replication">Replication</a></li>
<li><a href="#Snapshot_Name">Snapshot Name</a></li>
<li><a href="#Sources">Sources</a></li>
<li><a href="#Token">Token</a></li>
<li><a href="#Token_Kind">Token Kind</a></li>
<li><a href="#Token_Service">Token Service</a></li>
<li><a href="#Username">Username</a></li>
<li><a href="#NoRedirect">NoRedirect</a></li>
<li><a href="#Namespace_Quota">Namespace Quota</a></li>
<li><a href="#Storage_Space_Quota">Storage Space Quota</a></li>
<li><a href="#Storage_Type">Storage Type</a></li>
<li><a href="#Storage_Policy">Storage Policy</a></li>
<li><a href="#Erasure_Coding_Policy">Erasure Coding Policy</a></li>
<li><a href="#Start_After">Start After</a></li></ul></li></ul>
<div class="section">
<h2><a name="Document_Conventions"></a>Document Conventions</h2>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> <tt>Monospaced</tt> </th>
<th align="left"> Used for commands, HTTP request and responses and code blocks. </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> <tt>&lt;Monospaced&gt;</tt> </td>
<td align="left"> User entered values. </td></tr>
<tr class="a">
<td align="left"> <tt>[Monospaced]</tt> </td>
<td align="left"> Optional values. When the value is not specified, the default value is used. </td></tr>
<tr class="b">
<td align="left"> <i>Italics</i> </td>
<td align="left"> Important phrases and words. </td></tr>
</tbody>
</table></div>
<div class="section">
<h2><a name="Introduction"></a>Introduction</h2>
<p>The HTTP REST API supports the complete <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>/<a href="../../api/org/apache/hadoop/fs/FileContext.html">FileContext</a> interface for HDFS. The operations and the corresponding FileSystem/FileContext methods are shown in the next section. The Section <a href="#HTTP_Query_Parameter_Dictionary">HTTP Query Parameter Dictionary</a> specifies the parameter details such as the defaults and the valid values.</p>
<div class="section">
<h3><a name="Operations"></a>Operations</h3>
<ul>
<li>HTTP GET
<ul>
<li><a href="#Open_and_Read_a_File"><tt>OPEN</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.open)</li>
<li><a href="#Status_of_a_FileDirectory"><tt>GETFILESTATUS</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getFileStatus)</li>
<li><a href="#List_a_Directory"><tt>LISTSTATUS</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.listStatus)</li>
<li><a href="#Iteratively_List_a_Directory"><tt>LISTSTATUS_BATCH</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.listStatusIterator)</li>
<li><a href="#Get_Content_Summary_of_a_Directory"><tt>GETCONTENTSUMMARY</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getContentSummary)</li>
<li><a href="#Get_Quota_Usage_of_a_Directory"><tt>GETQUOTAUSAGE</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getQuotaUsage)</li>
<li><a href="#Get_File_Checksum"><tt>GETFILECHECKSUM</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getFileChecksum)</li>
<li><a href="#Get_Home_Directory"><tt>GETHOMEDIRECTORY</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getHomeDirectory)</li>
<li><a href="#Get_Delegation_Token"><tt>GETDELEGATIONTOKEN</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getDelegationToken)</li>
<li><a href="#Get_Trash_Root"><tt>GETTRASHROOT</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getTrashRoot)</li>
<li><a href="#Get_an_XAttr"><tt>GETXATTRS</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getXAttr)</li>
<li><a href="#Get_multiple_XAttrs"><tt>GETXATTRS</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getXAttrs)</li>
<li><a href="#Get_all_XAttrs"><tt>GETXATTRS</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getXAttrs)</li>
<li><a href="#List_all_XAttrs"><tt>LISTXATTRS</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.listXAttrs)</li>
<li><a href="#Check_access"><tt>CHECKACCESS</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.access)</li>
<li><a href="#Get_all_Storage_Policies"><tt>GETALLSTORAGEPOLICY</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getAllStoragePolicies)</li>
<li><a href="#Get_Storage_Policy"><tt>GETSTORAGEPOLICY</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getStoragePolicy)</li>
<li><a href="#Get_Snapshot_Diff"><tt>GETSNAPSHOTDIFF</tt></a></li>
<li><a href="#Get_Snapshottable_Directory_List"><tt>GETSNAPSHOTTABLEDIRECTORYLIST</tt></a></li>
<li><a href="#Get_File_Block_Locations"><tt>GETFILEBLOCKLOCATIONS</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getFileBlockLocations)</li>
<li><a href="#Get_EC_Policy"><tt>GETECPOLICY</tt></a> (see <a href="./HDFSErasureCoding.html#Administrative_commands">HDFSErasureCoding</a>.getErasureCodingPolicy)</li>
</ul>
</li>
<li>HTTP PUT
<ul>
<li><a href="#Create_and_Write_to_a_File"><tt>CREATE</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.create)</li>
<li><a href="#Make_a_Directory"><tt>MKDIRS</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.mkdirs)</li>
<li><a href="#Create_a_Symbolic_Link"><tt>CREATESYMLINK</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileContext.html">FileContext</a>.createSymlink)</li>
<li><a href="#Rename_a_FileDirectory"><tt>RENAME</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.rename)</li>
<li><a href="#Set_Replication_Factor"><tt>SETREPLICATION</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setReplication)</li>
<li><a href="#Set_Owner"><tt>SETOWNER</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setOwner)</li>
<li><a href="#Set_Permission"><tt>SETPERMISSION</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setPermission)</li>
<li><a href="#Set_Access_or_Modification_Time"><tt>SETTIMES</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setTimes)</li>
<li><a href="#Renew_Delegation_Token"><tt>RENEWDELEGATIONTOKEN</tt></a> (see <a href="../../api/org/apache/hadoop/security/token/delegation/web/DelegationTokenAuthenticator.html">DelegationTokenAuthenticator</a>.renewDelegationToken)</li>
<li><a href="#Cancel_Delegation_Token"><tt>CANCELDELEGATIONTOKEN</tt></a> (see <a href="../../api/org/apache/hadoop/security/token/delegation/web/DelegationTokenAuthenticator.html">DelegationTokenAuthenticator</a>.cancelDelegationToken)</li>
<li><a href="#Allow_Snapshot"><tt>ALLOWSNAPSHOT</tt></a></li>
<li><a href="#Disallow_Snapshot"><tt>DISALLOWSNAPSHOT</tt></a></li>
<li><a href="#Create_Snapshot"><tt>CREATESNAPSHOT</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.createSnapshot)</li>
<li><a href="#Rename_Snapshot"><tt>RENAMESNAPSHOT</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.renameSnapshot)</li>
<li><a href="#Set_XAttr"><tt>SETXATTR</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setXAttr)</li>
<li><a href="#Remove_XAttr"><tt>REMOVEXATTR</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.removeXAttr)</li>
<li><a href="#Set_Storage_Policy"><tt>SETSTORAGEPOLICY</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setStoragePolicy)</li>
<li><a href="#Satisfy_Storage_Policy"><tt>SATISFYSTORAGEPOLICY</tt></a> (see <a href="./ArchivalStorage.html#Satisfy_Storage_Policy">ArchivalStorage</a>.satisfyStoragePolicy)</li>
<li><a href="#Enable_EC_Policy"><tt>ENABLEECPOLICY</tt></a> (see <a href="./HDFSErasureCoding.html#Administrative_commands">HDFSErasureCoding</a>.enablePolicy)</li>
<li><a href="#Disable_EC_Policy"><tt>DISABLEECPOLICY</tt></a> (see <a href="./HDFSErasureCoding.html#Administrative_commands">HDFSErasureCoding</a>.disablePolicy)</li>
<li><a href="#Set_EC_Policy"><tt>SETECPOLICY</tt></a> (see <a href="./HDFSErasureCoding.html#Administrative_commands">HDFSErasureCoding</a>.setErasureCodingPolicy)</li>
</ul>
</li>
<li>HTTP POST
<ul>
<li><a href="#Append_to_a_File"><tt>APPEND</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.append)</li>
<li><a href="#Concat_Files"><tt>CONCAT</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.concat)</li>
<li><a href="#Truncate_a_File"><tt>TRUNCATE</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.truncate)</li>
<li><a href="#Unset_Storage_Policy"><tt>UNSETSTORAGEPOLICY</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.unsetStoragePolicy)</li>
<li><a href="#Unset_EC_Policy"><tt>UNSETECPOLICY</tt></a> (see <a href="./HDFSErasureCoding.html#Administrative_commands">HDFSErasureCoding</a>.unsetErasureCodingPolicy)</li>
</ul>
</li>
<li>HTTP DELETE
<ul>
<li><a href="#Delete_a_FileDirectory"><tt>DELETE</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.delete)</li>
<li><a href="#Delete_Snapshot"><tt>DELETESNAPSHOT</tt></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.deleteSnapshot)</li>
</ul>
</li>
</ul></div>
<div class="section">
<h3><a name="FileSystem_URIs_vs_HTTP_URLs"></a>FileSystem URIs vs HTTP URLs</h3>
<p>The FileSystem scheme of WebHDFS is &#x201c;<tt>webhdfs://</tt>&#x201d;. A WebHDFS FileSystem URI has the following format.</p>
<div>
<div>
<pre class="source"> webhdfs://&lt;HOST&gt;:&lt;HTTP_PORT&gt;/&lt;PATH&gt;
</pre></div></div>
<p>The above WebHDFS URI corresponds to the below HDFS URI.</p>
<div>
<div>
<pre class="source"> hdfs://&lt;HOST&gt;:&lt;RPC_PORT&gt;/&lt;PATH&gt;
</pre></div></div>
<p>In the REST API, the prefix &#x201c;<tt>/webhdfs/v1</tt>&#x201d; is inserted in the path and a query is appended at the end. Therefore, the corresponding HTTP URL has the following format.</p>
<div>
<div>
<pre class="source"> http://&lt;HOST&gt;:&lt;HTTP_PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=...
</pre></div></div>
<p><b>Note</b> that if WebHDFS is secured with SSL, then the scheme should be &#x201c;<tt>swebhdfs://</tt>&#x201d;.</p>
<div>
<div>
<pre class="source"> swebhdfs://&lt;HOST&gt;:&lt;HTTP_PORT&gt;/&lt;PATH&gt;
</pre></div></div>
<p>See also: <a href="#SSL_Configurations_for_SWebHDFS">SSL Configurations for SWebHDFS</a></p></div>
<div class="section">
<h3><a name="HDFS_Configuration_Options"></a>HDFS Configuration Options</h3>
<p>Below are the HDFS configuration options for WebHDFS.</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Property Name </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> <tt>dfs.web.authentication.kerberos.principal</tt> </td>
<td align="left"> The HTTP Kerberos principal used by Hadoop-Auth in the HTTP endpoint. The HTTP Kerberos principal MUST start with &#x2018;HTTP/&#x2019; per Kerberos HTTP SPNEGO specification. A value of &#x201c;*&#x201d; will use all HTTP principals found in the keytab. </td></tr>
<tr class="a">
<td align="left"> <tt>dfs.web.authentication.kerberos.keytab</tt> </td>
<td align="left"> The Kerberos keytab file with the credentials for the HTTP Kerberos principal used by Hadoop-Auth in the HTTP endpoint. </td></tr>
<tr class="b">
<td align="left"> <tt>dfs.webhdfs.socket.connect-timeout</tt> </td>
<td align="left"> How long to wait for a connection to be established before failing. Specified as a time duration, ie numerical value followed by a units symbol, eg 2m for two minutes. Defaults to 60s. </td></tr>
<tr class="a">
<td align="left"> <tt>dfs.webhdfs.socket.read-timeout</tt> </td>
<td align="left"> How long to wait for data to arrive before failing. Defaults to 60s. </td></tr>
</tbody>
</table></div></div>
<div class="section">
<h2><a name="Authentication"></a>Authentication</h2>
<p>When security is <i>off</i>, the authenticated user is the username specified in the <tt>user.name</tt> query parameter. If the <tt>user.name</tt> parameter is not set, the server may either set the authenticated user to a default web user, if there is any, or return an error response.</p>
<p>When security is <i>on</i>, authentication is performed by either Hadoop delegation token or Kerberos SPNEGO. If a token is set in the <tt>delegation</tt> query parameter, the authenticated user is the user encoded in the token. If the <tt>delegation</tt> parameter is not set, the user is authenticated by Kerberos SPNEGO.</p>
<p>Below are examples using the <tt>curl</tt> command tool.</p>
<ol style="list-style-type: decimal">
<li>
<p>Authentication when security is off:</p>
<div>
<div>
<pre class="source">curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?[user.name=&lt;USER&gt;&amp;]op=...&quot;
</pre></div></div>
</li>
<li>
<p>Authentication using Kerberos SPNEGO when security is on:</p>
<div>
<div>
<pre class="source">curl -i --negotiate -u : &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=...&quot;
</pre></div></div>
</li>
<li>
<p>Authentication using Hadoop delegation token when security is on:</p>
<div>
<div>
<pre class="source">curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?delegation=&lt;TOKEN&gt;&amp;op=...&quot;
</pre></div></div>
</li>
</ol>
<p>See also: <a href="../hadoop-common/HttpAuthentication.html">Authentication for Hadoop HTTP web-consoles</a></p>
<p>Additionally, WebHDFS supports OAuth2 on the client side. The Namenode and Datanodes do not currently support clients using OAuth2 but other backends that implement the WebHDFS REST interface may.</p>
<p>WebHDFS supports two type of OAuth2 code grants (user-provided refresh and access token or user provided credential) by default and provides a pluggable mechanism for implementing other OAuth2 authentications per the <a class="externalLink" href="https://tools.ietf.org/html/rfc6749">OAuth2 RFC</a>, or custom authentications. When using either of the provided code grant mechanisms, the WebHDFS client will refresh the access token as necessary.</p>
<p>OAuth2 should only be enabled for clients not running with Kerberos SPENGO.</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> OAuth2 code grant mechanism </th>
<th align="left"> Description </th>
<th align="left"> Value of <tt>dfs.webhdfs.oauth2.access.token.provider</tt> that implements code grant </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Authorization Code Grant </td>
<td align="left"> The user provides an initial access token and refresh token, which are then used to authenticate WebHDFS requests and obtain replacement access tokens, respectively. </td>
<td align="left"> org.apache.hadoop.hdfs.web.oauth2.ConfRefreshTokenBasedAccessTokenProvider </td></tr>
<tr class="a">
<td align="left"> Client Credentials Grant </td>
<td align="left"> The user provides a credential which is used to obtain access tokens, which are then used to authenticate WebHDFS requests. </td>
<td align="left"> org.apache.hadoop.hdfs.web.oauth2.ConfCredentialBasedAccessTokenProvider </td></tr>
</tbody>
</table>
<p>The following properties control OAuth2 authentication.</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> OAuth2 related property </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> <tt>dfs.webhdfs.oauth2.enabled</tt> </td>
<td align="left"> Boolean to enable/disable OAuth2 authentication </td></tr>
<tr class="a">
<td align="left"> <tt>dfs.webhdfs.oauth2.access.token.provider</tt> </td>
<td align="left"> Class name of an implementation of <tt>org.apache.hadoop.hdfs.web.oauth.AccessTokenProvider.</tt> Two are provided with the code, as described above, or the user may specify a user-provided implementation. The default value for this configuration key is the <tt>ConfCredentialBasedAccessTokenProvider</tt> implementation. </td></tr>
<tr class="b">
<td align="left"> <tt>dfs.webhdfs.oauth2.client.id</tt> </td>
<td align="left"> Client id used to obtain access token with either credential or refresh token </td></tr>
<tr class="a">
<td align="left"> <tt>dfs.webhdfs.oauth2.refresh.url</tt> </td>
<td align="left"> URL against which to post for obtaining bearer token with either credential or refresh token </td></tr>
<tr class="b">
<td align="left"> <tt>dfs.webhdfs.oauth2.access.token</tt> </td>
<td align="left"> (required if using ConfRefreshTokenBasedAccessTokenProvider) Initial access token with which to authenticate </td></tr>
<tr class="a">
<td align="left"> <tt>dfs.webhdfs.oauth2.refresh.token</tt> </td>
<td align="left"> (required if using ConfRefreshTokenBasedAccessTokenProvider) Initial refresh token to use to obtain new access tokens </td></tr>
<tr class="b">
<td align="left"> <tt>dfs.webhdfs.oauth2.refresh.token.expires.ms.since.epoch</tt> </td>
<td align="left"> (required if using ConfRefreshTokenBasedAccessTokenProvider) Access token expiration measured in milliseconds since Jan 1, 1970. <i>Note this is a different value than provided by OAuth providers and has been munged as described in interface to be suitable for a client application</i> </td></tr>
<tr class="a">
<td align="left"> <tt>dfs.webhdfs.oauth2.credential</tt> </td>
<td align="left"> (required if using ConfCredentialBasedAccessTokenProvider). Credential used to obtain initial and subsequent access tokens. </td></tr>
</tbody>
</table></div>
<div class="section">
<h2><a name="SSL_Configurations_for_SWebHDFS"></a>SSL Configurations for SWebHDFS</h2>
<p>To use SWebHDFS FileSystem (i.e. using the swebhdfs protocol), a SSL configuration file needs to be specified on the client side. This must specify 3 parameters:</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> SSL property </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> <tt>ssl.client.truststore.location</tt> </td>
<td align="left"> The local-filesystem location of the trust-store file, containing the certificate for the NameNode. </td></tr>
<tr class="a">
<td align="left"> <tt>ssl.client.truststore.type</tt> </td>
<td align="left"> (Optional) The format of the trust-store file. </td></tr>
<tr class="b">
<td align="left"> <tt>ssl.client.truststore.password</tt> </td>
<td align="left"> (Optional) Password for the trust-store file. </td></tr>
</tbody>
</table>
<p>The following is an example SSL configuration file (<b>ssl-client.xml</b>):</p>
<div>
<div>
<pre class="source">&lt;configuration&gt;
&lt;property&gt;
&lt;name&gt;ssl.client.truststore.location&lt;/name&gt;
&lt;value&gt;/work/keystore.jks&lt;/value&gt;
&lt;description&gt;Truststore to be used by clients. Must be specified.&lt;/description&gt;
&lt;/property&gt;
&lt;property&gt;
&lt;name&gt;ssl.client.truststore.password&lt;/name&gt;
&lt;value&gt;changeme&lt;/value&gt;
&lt;description&gt;Optional. Default value is &quot;&quot;.&lt;/description&gt;
&lt;/property&gt;
&lt;property&gt;
&lt;name&gt;ssl.client.truststore.type&lt;/name&gt;
&lt;value&gt;jks&lt;/value&gt;
&lt;description&gt;Optional. Default value is &quot;jks&quot;.&lt;/description&gt;
&lt;/property&gt;
&lt;/configuration&gt;
</pre></div></div>
<p>The SSL configuration file must be in the class-path of the client program and the filename needs to be specified in <b>core-site.xml</b>:</p>
<div>
<div>
<pre class="source">&lt;property&gt;
&lt;name&gt;hadoop.ssl.client.conf&lt;/name&gt;
&lt;value&gt;ssl-client.xml&lt;/value&gt;
&lt;description&gt;
Resource file from which ssl client keystore information will be extracted.
This file is looked up in the classpath, typically it should be in Hadoop
conf/ directory. Default value is &quot;ssl-client.xml&quot;.
&lt;/description&gt;
&lt;/property&gt;
</pre></div></div>
</div>
<div class="section">
<h2><a name="Proxy_Users"></a>Proxy Users</h2>
<p>When the proxy user feature is enabled, a proxy user <i>P</i> may submit a request on behalf of another user <i>U</i>. The username of <i>U</i> must be specified in the <tt>doas</tt> query parameter unless a delegation token is presented in authentication. In such case, the information of both users <i>P</i> and <i>U</i> must be encoded in the delegation token.</p>
<ol style="list-style-type: decimal">
<li>
<p>A proxy request when security is off:</p>
<div>
<div>
<pre class="source">curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?[user.name=&lt;USER&gt;&amp;]doas=&lt;USER&gt;&amp;op=...&quot;
</pre></div></div>
</li>
<li>
<p>A proxy request using Kerberos SPNEGO when security is on:</p>
<div>
<div>
<pre class="source">curl -i --negotiate -u : &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?doas=&lt;USER&gt;&amp;op=...&quot;
</pre></div></div>
</li>
<li>
<p>A proxy request using Hadoop delegation token when security is on:</p>
<div>
<div>
<pre class="source">curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?delegation=&lt;TOKEN&gt;&amp;op=...&quot;
</pre></div></div>
</li>
</ol></div>
<div class="section">
<h2><a name="Cross-Site_Request_Forgery_Prevention"></a>Cross-Site Request Forgery Prevention</h2>
<p>WebHDFS supports an optional, configurable mechanism for cross-site request forgery (CSRF) prevention. When enabled, WebHDFS HTTP requests to the NameNode or DataNode must include a custom HTTP header. Configuration properties allow adjusting which specific HTTP methods are protected and the name of the HTTP header. The value sent in the header is not relevant. Only the presence of a header by that name is required.</p>
<p>Enabling CSRF prevention also sets up the <tt>WebHdfsFileSystem</tt> class to send the required header. This ensures that CLI commands like <a href="./HDFSCommands.html#dfs"><tt>hdfs dfs</tt></a> and <a href="../../hadoop-distcp/DistCp.html"><tt>hadoop distcp</tt></a> continue to work correctly when used with <tt>webhdfs:</tt> URIs.</p>
<p>Enabling CSRF prevention also sets up the NameNode web UI to send the required header. After enabling CSRF prevention and restarting the NameNode, existing users of the NameNode web UI need to refresh the browser to reload the page and find the new configuration.</p>
<p>The following properties control CSRF prevention.</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Property </th>
<th align="left"> Description </th>
<th align="left"> Default Value </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> <tt>dfs.webhdfs.rest-csrf.enabled</tt> </td>
<td align="left"> If true, then enables WebHDFS protection against cross-site request forgery (CSRF). The WebHDFS client also uses this property to determine whether or not it needs to send the custom CSRF prevention header in its HTTP requests. </td>
<td align="left"> <tt>false</tt> </td></tr>
<tr class="a">
<td align="left"> <tt>dfs.webhdfs.rest-csrf.custom-header</tt> </td>
<td align="left"> The name of a custom header that HTTP requests must send when protection against cross-site request forgery (CSRF) is enabled for WebHDFS by setting dfs.webhdfs.rest-csrf.enabled to true. The WebHDFS client also uses this property to determine whether or not it needs to send the custom CSRF prevention header in its HTTP requests. </td>
<td align="left"> <tt>X-XSRF-HEADER</tt> </td></tr>
<tr class="b">
<td align="left"> <tt>dfs.webhdfs.rest-csrf.methods-to-ignore</tt> </td>
<td align="left"> A comma-separated list of HTTP methods that do not require HTTP requests to include a custom header when protection against cross-site request forgery (CSRF) is enabled for WebHDFS by setting dfs.webhdfs.rest-csrf.enabled to true. The WebHDFS client also uses this property to determine whether or not it needs to send the custom CSRF prevention header in its HTTP requests. </td>
<td align="left"> <tt>GET,OPTIONS,HEAD,TRACE</tt> </td></tr>
<tr class="a">
<td align="left"> <tt>dfs.webhdfs.rest-csrf.browser-useragents-regex</tt> </td>
<td align="left"> A comma-separated list of regular expressions used to match against an HTTP request&#x2019;s User-Agent header when protection against cross-site request forgery (CSRF) is enabled for WebHDFS by setting dfs.webhdfs.reset-csrf.enabled to true. If the incoming User-Agent matches any of these regular expressions, then the request is considered to be sent by a browser, and therefore CSRF prevention is enforced. If the request&#x2019;s User-Agent does not match any of these regular expressions, then the request is considered to be sent by something other than a browser, such as scripted automation. In this case, CSRF is not a potential attack vector, so the prevention is not enforced. This helps achieve backwards-compatibility with existing automation that has not been updated to send the CSRF prevention header. </td>
<td align="left"> <tt>^Mozilla.*,^Opera.*</tt> </td></tr>
<tr class="b">
<td align="left"> <tt>dfs.datanode.httpserver.filter.handlers</tt> </td>
<td align="left"> Comma separated list of Netty servlet-style filter handlers to inject into the Datanode WebHDFS I/O path </td>
<td align="left"> <tt>org.apache.hadoop.hdfs.server.datanode.web.RestCsrfPreventionFilterHandler</tt> </td></tr>
</tbody>
</table>
<p>The following is an example <tt>curl</tt> call that uses the <tt>-H</tt> option to include the custom header in the request.</p>
<div>
<div>
<pre class="source"> curl -i -L -X PUT -H 'X-XSRF-HEADER: &quot;&quot;' 'http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=CREATE'
</pre></div></div>
</div>
<div class="section">
<h2><a name="WebHDFS_Retry_Policy"></a>WebHDFS Retry Policy</h2>
<p>WebHDFS supports an optional, configurable retry policy for resilient copy of large files that could timeout, or copy file between HA clusters that could failover during the copy.</p>
<p>The following properties control WebHDFS retry and failover policy.</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Property </th>
<th align="left"> Description </th>
<th align="left"> Default Value </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> <tt>dfs.http.client.retry.policy.enabled</tt> </td>
<td align="left"> If &#x201c;true&#x201d;, enable the retry policy of WebHDFS client. If &#x201c;false&#x201d;, retry policy is turned off. </td>
<td align="left"> <tt>false</tt> </td></tr>
<tr class="a">
<td align="left"> <tt>dfs.http.client.retry.policy.spec</tt> </td>
<td align="left"> Specify a policy of multiple linear random retry for WebHDFS client, e.g. given pairs of number of retries and sleep time (n0, t0), (n1, t1), &#x2026;, the first n0 retries sleep t0 milliseconds on average, the following n1 retries sleep t1 milliseconds on average, and so on. </td>
<td align="left"> <tt>10000,6,60000,10</tt> </td></tr>
<tr class="b">
<td align="left"> <tt>dfs.http.client.failover.max.attempts</tt> </td>
<td align="left"> Specify the max number of failover attempts for WebHDFS client in case of network exception. </td>
<td align="left"> <tt>15</tt> </td></tr>
<tr class="a">
<td align="left"> <tt>dfs.http.client.retry.max.attempts</tt> </td>
<td align="left"> Specify the max number of retry attempts for WebHDFS client, if the difference between retried attempts and failovered attempts is larger than the max number of retry attempts, there will be no more retries. </td>
<td align="left"> <tt>10</tt> </td></tr>
<tr class="b">
<td align="left"> <tt>dfs.http.client.failover.sleep.base.millis</tt> </td>
<td align="left"> Specify the base amount of time in milliseconds upon which the exponentially increased sleep time between retries or failovers is calculated for WebHDFS client. </td>
<td align="left"> <tt>500</tt> </td></tr>
<tr class="a">
<td align="left"> <tt>dfs.http.client.failover.sleep.max.millis</tt> </td>
<td align="left"> Specify the upper bound of sleep time in milliseconds between retries or failovers for WebHDFS client. </td>
<td align="left"> <tt>15000</tt> </td></tr>
</tbody>
</table></div>
<div class="section">
<h2><a name="WebHDFS_Request_Filtering"></a>WebHDFS Request Filtering</h2>
<p>One may control directionality of data in the WebHDFS protocol allowing only writing data from insecure networks. To enable, one must ensure <tt>dfs.datanode.httpserver.filter.handlers</tt> includes <tt>org.apache.hadoop.hdfs.server.datanode.web.HostRestrictingAuthorizationFilterHandler</tt>. Configuration of the <tt>HostRestrictingAuthorizationFilter</tt> is controlled via the following properties.</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Property </th>
<th align="left"> Description </th>
<th align="left"> Default Value </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> <tt>dfs.datanode.httpserver.filter.handlers</tt> </td>
<td align="left"> Comma separated list of Netty servlet-style filter handlers to inject into the Datanode WebHDFS I/O path </td>
<td align="left"> <tt>org.apache.hadoop.hdfs.server.datanode.web.RestCsrfPreventionFilterHandler</tt> </td></tr>
<tr class="a">
<td align="left"> <tt>dfs.web.authentication.host.allow.rules</tt> </td>
<td align="left"> Rules allowing users to read files in the format of <i>user</i>,<i>network/bits</i>,<i>path glob</i> newline or <tt>|</tt>-separated. Use <tt>*</tt> for a wildcard of all <i>users</i> or <i>network/bits</i>. </td>
<td align="left"> nothing - defaults to no one may read via WebHDFS </td></tr>
</tbody>
</table></div>
<div class="section">
<h2><a name="File_and_Directory_Operations"></a>File and Directory Operations</h2>
<div class="section">
<h3><a name="Create_and_Write_to_a_File"></a>Create and Write to a File</h3>
<ul>
<li>
<p>Step 1: Submit a HTTP PUT request without automatically following redirects and without sending the file data.</p>
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=CREATE
[&amp;overwrite=&lt;true |false&gt;][&amp;blocksize=&lt;LONG&gt;][&amp;replication=&lt;SHORT&gt;]
[&amp;permission=&lt;OCTAL&gt;][&amp;buffersize=&lt;INT&gt;][&amp;noredirect=&lt;true|false&gt;]&quot;
</pre></div></div>
<p>Usually the request is redirected to a datanode where the file data is to be written.</p>
<div>
<div>
<pre class="source">HTTP/1.1 307 TEMPORARY_REDIRECT
Location: http://&lt;DATANODE&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=CREATE...
Content-Length: 0
</pre></div></div>
<p>However, if you do not want to be automatically redirected, you can set the noredirect flag.</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
{&quot;Location&quot;:&quot;http://&lt;DATANODE&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=CREATE...&quot;}
</pre></div></div>
</li>
<li>
<p>Step 2: Submit another HTTP PUT request using the URL in the <tt>Location</tt> header (or the returned response in case you specified noredirect) with the file data to be written.</p>
<div>
<div>
<pre class="source">curl -i -X PUT -T &lt;LOCAL_FILE&gt; &quot;http://&lt;DATANODE&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=CREATE...&quot;
</pre></div></div>
<p>The client receives a <tt>201 Created</tt> response with zero content length and the WebHDFS URI of the file in the <tt>Location</tt> header:</p>
<div>
<div>
<pre class="source">HTTP/1.1 201 Created
Location: webhdfs://&lt;HOST&gt;:&lt;PORT&gt;/&lt;PATH&gt;
Content-Length: 0
</pre></div></div>
<p>If no permissions are specified, the newly created file will be assigned with default 644 permission. No umask mode will be applied from server side (so &#x201c;fs.permissions.umask-mode&#x201d; value configuration set on Namenode side will have no effect).</p>
</li>
</ul>
<p><b>Note</b> that the reason of having two-step create/append is for preventing clients to send out data before the redirect. This issue is addressed by the &#x201c;<tt>Expect: 100-continue</tt>&#x201d; header in HTTP/1.1; see <a class="externalLink" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.2.3">RFC 2616, Section 8.2.3</a>. Unfortunately, there are software library bugs (e.g. Jetty 6 HTTP server and Java 6 HTTP client), which do not correctly implement &#x201c;<tt>Expect: 100-continue</tt>&#x201d;. The two-step create/append is a temporary workaround for the software library bugs.</p>
<p>See also: <a href="#Overwrite"><tt>overwrite</tt></a>, <a href="#Block_Size"><tt>blocksize</tt></a>, <a href="#Replication"><tt>replication</tt></a>, <a href="#Permission"><tt>permission</tt></a>, <a href="#Buffer_Size"><tt>buffersize</tt></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.create</p></div>
<div class="section">
<h3><a name="Append_to_a_File"></a>Append to a File</h3>
<ul>
<li>Step 1: Submit a HTTP POST request without automatically following redirects and without sending the file data.
<div>
<div>
<pre class="source">curl -i -X POST &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=APPEND[&amp;buffersize=&lt;INT&gt;][&amp;noredirect=&lt;true|false&gt;]&quot;
</pre></div></div>
<p>Usually the request is redirected to a datanode where the file data is to be appended:</p>
<div>
<div>
<pre class="source">HTTP/1.1 307 TEMPORARY_REDIRECT
Location: http://&lt;DATANODE&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=APPEND...
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>However, if you do not want to be automatically redirected, you can set the noredirect flag.</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/json
{&quot;Location&quot;:&quot;http://&lt;DATANODE&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=APPEND...&quot;}
</pre></div></div>
<ul>
<li>Step 2: Submit another HTTP POST request using the URL in the <tt>Location</tt> header (or the returned response in case you specified noredirect) with the file data to be appended.
<div>
<div>
<pre class="source">curl -i -X POST -T &lt;LOCAL_FILE&gt; &quot;http://&lt;DATANODE&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=APPEND...&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See the note in the previous section for the description of why this operation requires two steps.</p>
<p>See also: <a href="#Buffer_Size"><tt>buffersize</tt></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.append</p></div>
<div class="section">
<h3><a name="Concat_File.28s.29"></a>Concat File(s)</h3>
<ul>
<li>Submit a HTTP POST request.
<div>
<div>
<pre class="source">curl -i -X POST &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=CONCAT&amp;sources=&lt;PATHS&gt;&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="#Sources"><tt>sources</tt></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.concat</p></div>
<div class="section">
<h3><a name="Open_and_Read_a_File"></a>Open and Read a File</h3>
<ul>
<li>Submit a HTTP GET request with automatically following redirects.
<div>
<div>
<pre class="source">curl -i -L &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=OPEN
[&amp;offset=&lt;LONG&gt;][&amp;length=&lt;LONG&gt;][&amp;buffersize=&lt;INT&gt;][&amp;noredirect=&lt;true|false&gt;]&quot;
</pre></div></div>
<p>Usually the request is redirected to a datanode where the file data can be read:</p>
<div>
<div>
<pre class="source">HTTP/1.1 307 TEMPORARY_REDIRECT
Location: http://&lt;DATANODE&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=OPEN...
Content-Length: 0
</pre></div></div>
<p>However if you do not want to be automatically redirected, you can set the noredirect flag.</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
{&quot;Location&quot;:&quot;http://&lt;DATANODE&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=OPEN...&quot;}
</pre></div></div>
<p>The client follows the redirect to the datanode and receives the file data:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Length: 22
Hello, webhdfs user!
</pre></div></div>
</li>
</ul>
<p>See also: <a href="#Offset"><tt>offset</tt></a>, <a href="#Length"><tt>length</tt></a>, <a href="#Buffer_Size"><tt>buffersize</tt></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.open</p></div>
<div class="section">
<h3><a name="Make_a_Directory"></a>Make a Directory</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=MKDIRS[&amp;permission=&lt;OCTAL&gt;]&quot;
</pre></div></div>
<p>The client receives a response with a <a href="#Boolean_JSON_Schema"><tt>boolean</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{&quot;boolean&quot;: true}
</pre></div></div>
<p>If no permissions are specified, the newly created directory will have 755 permission as default. No umask mode will be applied from server side (so &#x201c;fs.permissions.umask-mode&#x201d; value configuration set on Namenode side will have no effect).</p></li>
</ul>
<p>See also: <a href="#Permission"><tt>permission</tt></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.mkdirs</p></div>
<div class="section">
<h3><a name="Create_a_Symbolic_Link"></a>Create a Symbolic Link</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=CREATESYMLINK
&amp;destination=&lt;PATH&gt;[&amp;createParent=&lt;true |false&gt;]&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="#Destination"><tt>destination</tt></a>, <a href="#Create_Parent"><tt>createParent</tt></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.createSymlink</p></div>
<div class="section">
<h3><a name="Rename_a_File.2FDirectory"></a>Rename a File/Directory</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=RENAME&amp;destination=&lt;PATH&gt;&quot;
</pre></div></div>
<p>The client receives a response with a <a href="#Boolean_JSON_Schema"><tt>boolean</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{&quot;boolean&quot;: true}
</pre></div></div>
</li>
</ul>
<p>See also: <a href="#Destination"><tt>destination</tt></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.rename</p></div>
<div class="section">
<h3><a name="Delete_a_File.2FDirectory"></a>Delete a File/Directory</h3>
<ul>
<li>Submit a HTTP DELETE request.
<div>
<div>
<pre class="source">curl -i -X DELETE &quot;http://&lt;host&gt;:&lt;port&gt;/webhdfs/v1/&lt;path&gt;?op=DELETE
[&amp;recursive=&lt;true |false&gt;]&quot;
</pre></div></div>
<p>The client receives a response with a <a href="#Boolean_JSON_Schema"><tt>boolean</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{&quot;boolean&quot;: true}
</pre></div></div>
</li>
</ul>
<p>See also: <a href="#Recursive"><tt>recursive</tt></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.delete</p></div>
<div class="section">
<h3><a name="Truncate_a_File"></a>Truncate a File</h3>
<ul>
<li>Submit a HTTP POST request.
<div>
<div>
<pre class="source">curl -i -X POST &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=TRUNCATE&amp;newlength=&lt;LONG&gt;&quot;
</pre></div></div>
<p>The client receives a response with a <a href="#Boolean_JSON_Schema"><tt>boolean</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{&quot;boolean&quot;: true}
</pre></div></div>
</li>
</ul>
<p>See also: <a href="#New_Length"><tt>newlength</tt></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.truncate</p></div>
<div class="section">
<h3><a name="Status_of_a_File.2FDirectory"></a>Status of a File/Directory</h3>
<ul>
<li>Submit a HTTP GET request.
<div>
<div>
<pre class="source">curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETFILESTATUS&quot;
</pre></div></div>
<p>The client receives a response with a <a href="#FileStatus_JSON_Schema"><tt>FileStatus</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{
&quot;FileStatus&quot;:
{
&quot;accessTime&quot; : 0,
&quot;blockSize&quot; : 0,
&quot;group&quot; : &quot;supergroup&quot;,
&quot;length&quot; : 0, //in bytes, zero for directories
&quot;modificationTime&quot;: 1320173277227,
&quot;owner&quot; : &quot;webuser&quot;,
&quot;pathSuffix&quot; : &quot;&quot;,
&quot;permission&quot; : &quot;777&quot;,
&quot;replication&quot; : 0,
&quot;snapshotEnabled&quot; : true
&quot;type&quot; : &quot;DIRECTORY&quot; //enum {FILE, DIRECTORY, SYMLINK}
}
}
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getFileStatus</p></div>
<div class="section">
<h3><a name="List_a_Directory"></a>List a Directory</h3>
<ul>
<li>Submit a HTTP GET request.
<div>
<div>
<pre class="source">curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=LISTSTATUS&quot;
</pre></div></div>
<p>The client receives a response with a <a href="#FileStatuses_JSON_Schema"><tt>FileStatuses</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 427
{
&quot;FileStatuses&quot;:
{
&quot;FileStatus&quot;:
[
{
&quot;accessTime&quot; : 1320171722771,
&quot;blockSize&quot; : 33554432,
&quot;childrenNum&quot; : 0,
&quot;fileId&quot; : 16388,
&quot;group&quot; : &quot;supergroup&quot;,
&quot;length&quot; : 24930,
&quot;modificationTime&quot;: 1320171722771,
&quot;owner&quot; : &quot;webuser&quot;,
&quot;pathSuffix&quot; : &quot;a.patch&quot;,
&quot;permission&quot; : &quot;644&quot;,
&quot;replication&quot; : 1,
&quot;storagePolicy&quot; : 0,
&quot;type&quot; : &quot;FILE&quot;
},
{
&quot;accessTime&quot; : 0,
&quot;blockSize&quot; : 0,
&quot;childrenNum&quot; : 0,
&quot;fileId&quot; : 16389,
&quot;group&quot; : &quot;supergroup&quot;,
&quot;length&quot; : 0,
&quot;modificationTime&quot;: 1320895981256,
&quot;owner&quot; : &quot;username&quot;,
&quot;pathSuffix&quot; : &quot;bar&quot;,
&quot;permission&quot; : &quot;711&quot;,
&quot;replication&quot; : 0,
&quot;snapshotEnabled&quot; : true
&quot;type&quot; : &quot;DIRECTORY&quot;
},
...
]
}
}
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.listStatus</p></div>
<div class="section">
<h3><a name="List_a_File"></a>List a File</h3>
<ul>
<li>Submit a HTTP GET request.
<div>
<div>
<pre class="source">curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=LISTSTATUS&quot;
</pre></div></div>
<p>The client receives a response with a <a href="#FileStatuses_JSON_Schema"><tt>FileStatuses</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 427
{
&quot;FileStatuses&quot;:
{
&quot;FileStatus&quot;:
[
{
&quot;accessTime&quot; : 1320171722771,
&quot;blockSize&quot; : 33554432,
&quot;childrenNum&quot; : 0,
&quot;fileId&quot; : 16390,
&quot;group&quot; : &quot;supergroup&quot;,
&quot;length&quot; : 1366,
&quot;modificationTime&quot;: 1501770633062,
&quot;owner&quot; : &quot;webuser&quot;,
&quot;pathSuffix&quot; : &quot;&quot;,
&quot;permission&quot; : &quot;644&quot;,
&quot;replication&quot; : 1,
&quot;storagePolicy&quot; : 0,
&quot;type&quot; : &quot;FILE&quot;
}
]
}
}
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.listStatus</p></div>
<div class="section">
<h3><a name="Iteratively_List_a_Directory"></a>Iteratively List a Directory</h3>
<ul>
<li>Submit a HTTP GET request.
<div>
<div>
<pre class="source">curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=LISTSTATUS_BATCH&amp;startAfter=&lt;CHILD&gt;&quot;
</pre></div></div>
<p>The client receives a response with a <a href="#DirectoryListing_JSON_Schema"><tt>DirectoryListing</tt> JSON object</a>, which contains a <a href="#FileStatuses_JSON_Schema"><tt>FileStatuses</tt> JSON object</a>, as well as iteration information:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Cache-Control: no-cache
Expires: Thu, 08 Sep 2016 03:40:38 GMT
Date: Thu, 08 Sep 2016 03:40:38 GMT
Pragma: no-cache
Expires: Thu, 08 Sep 2016 03:40:38 GMT
Date: Thu, 08 Sep 2016 03:40:38 GMT
Pragma: no-cache
Content-Type: application/json
X-FRAME-OPTIONS: SAMEORIGIN
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
{
&quot;DirectoryListing&quot;: {
&quot;partialListing&quot;: {
&quot;FileStatuses&quot;: {
&quot;FileStatus&quot;: [
{
&quot;accessTime&quot;: 0,
&quot;blockSize&quot;: 0,
&quot;childrenNum&quot;: 0,
&quot;fileId&quot;: 16387,
&quot;group&quot;: &quot;supergroup&quot;,
&quot;length&quot;: 0,
&quot;modificationTime&quot;: 1473305882563,
&quot;owner&quot;: &quot;andrew&quot;,
&quot;pathSuffix&quot;: &quot;bardir&quot;,
&quot;permission&quot;: &quot;755&quot;,
&quot;replication&quot;: 0,
&quot;storagePolicy&quot;: 0,
&quot;type&quot;: &quot;DIRECTORY&quot;
},
{
&quot;accessTime&quot;: 1473305896945,
&quot;blockSize&quot;: 1024,
&quot;childrenNum&quot;: 0,
&quot;fileId&quot;: 16388,
&quot;group&quot;: &quot;supergroup&quot;,
&quot;length&quot;: 0,
&quot;modificationTime&quot;: 1473305896965,
&quot;owner&quot;: &quot;andrew&quot;,
&quot;pathSuffix&quot;: &quot;bazfile&quot;,
&quot;permission&quot;: &quot;644&quot;,
&quot;replication&quot;: 3,
&quot;storagePolicy&quot;: 0,
&quot;type&quot;: &quot;FILE&quot;
}
]
}
},
&quot;remainingEntries&quot;: 2
}
}
</pre></div></div>
</li>
</ul>
<p>If <tt>remainingEntries</tt> is non-zero, there are additional entries in the directory. To query the next batch, set the <tt>startAfter</tt> parameter to the <tt>pathSuffix</tt> of the last item returned in the current batch. For example:</p>
<div>
<div>
<pre class="source"> curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=LISTSTATUS_BATCH&amp;startAfter=bazfile&quot;
</pre></div></div>
<p>Which will return the next batch of directory entries:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Cache-Control: no-cache
Expires: Thu, 08 Sep 2016 03:43:20 GMT
Date: Thu, 08 Sep 2016 03:43:20 GMT
Pragma: no-cache
Expires: Thu, 08 Sep 2016 03:43:20 GMT
Date: Thu, 08 Sep 2016 03:43:20 GMT
Pragma: no-cache
Content-Type: application/json
X-FRAME-OPTIONS: SAMEORIGIN
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
{
&quot;DirectoryListing&quot;: {
&quot;partialListing&quot;: {
&quot;FileStatuses&quot;: {
&quot;FileStatus&quot;: [
{
&quot;accessTime&quot;: 0,
&quot;blockSize&quot;: 0,
&quot;childrenNum&quot;: 0,
&quot;fileId&quot;: 16386,
&quot;group&quot;: &quot;supergroup&quot;,
&quot;length&quot;: 0,
&quot;modificationTime&quot;: 1473305878951,
&quot;owner&quot;: &quot;andrew&quot;,
&quot;pathSuffix&quot;: &quot;foodir&quot;,
&quot;permission&quot;: &quot;755&quot;,
&quot;replication&quot;: 0,
&quot;storagePolicy&quot;: 0,
&quot;type&quot;: &quot;DIRECTORY&quot;
},
{
&quot;accessTime&quot;: 1473305902864,
&quot;blockSize&quot;: 1024,
&quot;childrenNum&quot;: 0,
&quot;fileId&quot;: 16389,
&quot;group&quot;: &quot;supergroup&quot;,
&quot;length&quot;: 0,
&quot;modificationTime&quot;: 1473305902878,
&quot;owner&quot;: &quot;andrew&quot;,
&quot;pathSuffix&quot;: &quot;quxfile&quot;,
&quot;permission&quot;: &quot;644&quot;,
&quot;replication&quot;: 3,
&quot;storagePolicy&quot;: 0,
&quot;type&quot;: &quot;FILE&quot;
}
]
}
},
&quot;remainingEntries&quot;: 0
}
}
</pre></div></div>
<p>Batch size is controlled by the <tt>dfs.ls.limit</tt> option on the NameNode.</p>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.listStatusIterator</p></div></div>
<div class="section">
<h2><a name="Other_File_System_Operations"></a>Other File System Operations</h2>
<div class="section">
<h3><a name="Get_Content_Summary_of_a_Directory"></a>Get Content Summary of a Directory</h3>
<ul>
<li>Submit a HTTP GET request.
<div>
<div>
<pre class="source">curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETCONTENTSUMMARY&quot;
</pre></div></div>
<p>The client receives a response with a <a href="#ContentSummary_JSON_Schema"><tt>ContentSummary</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{
&quot;ContentSummary&quot;:
{
&quot;directoryCount&quot;: 2,
&quot;ecPolicy&quot; : &quot;RS-6-3-1024k&quot;,
&quot;fileCount&quot; : 1,
&quot;length&quot; : 24930,
&quot;quota&quot; : -1,
&quot;spaceConsumed&quot; : 24930,
&quot;spaceQuota&quot; : -1,
&quot;typeQuota&quot;:
{
&quot;ARCHIVE&quot;:
{
&quot;consumed&quot;: 500,
&quot;quota&quot;: 10000
},
&quot;DISK&quot;:
{
&quot;consumed&quot;: 500,
&quot;quota&quot;: 10000
},
&quot;SSD&quot;:
{
&quot;consumed&quot;: 500,
&quot;quota&quot;: 10000
}
}
}
}
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getContentSummary</p></div>
<div class="section">
<h3><a name="Get_Quota_Usage_of_a_Directory"></a>Get Quota Usage of a Directory</h3>
<ul>
<li>Submit a HTTP GET request.
<div>
<div>
<pre class="source">curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETQUOTAUSAGE&quot;
</pre></div></div>
<p>The client receives a response with a <a href="#QuotaUsage_JSON_Schema"><tt>QuotaUsage</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{
&quot;QuotaUsage&quot;:
{
&quot;fileAndDirectoryCount&quot;: 1,
&quot;quota&quot; : 100,
&quot;spaceConsumed&quot; : 24930,
&quot;spaceQuota&quot; : 100000,
&quot;typeQuota&quot;:
{
&quot;ARCHIVE&quot;:
{
&quot;consumed&quot;: 500,
&quot;quota&quot;: 10000
},
&quot;DISK&quot;:
{
&quot;consumed&quot;: 500,
&quot;quota&quot;: 10000
},
&quot;SSD&quot;:
{
&quot;consumed&quot;: 500,
&quot;quota&quot;: 10000
}
}
}
}
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getQuotaUsage</p></div>
<div class="section">
<h3><a name="Set_Quota"></a>Set Quota</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=SETQUOTA
&amp;namespacequota=&lt;QUOTA&gt;[&amp;storagespacequota=&lt;QUOTA&gt;]&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setQuota</p></div>
<div class="section">
<h3><a name="Set_Quota_By_Storage_Type"></a>Set Quota By Storage Type</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=SETQUOTABYSTORAGETYPE
&amp;storagetype=&lt;STORAGETYPE&gt;&amp;storagespacequota=&lt;QUOTA&gt;&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setQuotaByStorageType</p></div>
<div class="section">
<h3><a name="Get_File_Checksum"></a>Get File Checksum</h3>
<ul>
<li>Submit a HTTP GET request.
<div>
<div>
<pre class="source">curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETFILECHECKSUM&quot;
</pre></div></div>
<p>Usually the request is redirected to a datanode:</p>
<div>
<div>
<pre class="source">HTTP/1.1 307 TEMPORARY_REDIRECT
Location: http://&lt;DATANODE&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETFILECHECKSUM...
Content-Length: 0
</pre></div></div>
<p>However, if you do not want to be automatically redirected, you can set the noredirect flag.</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
{&quot;Location&quot;:&quot;http://&lt;DATANODE&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETFILECHECKSUM...&quot;}
</pre></div></div>
<p>The client follows the redirect to the datanode and receives a <a href="#FileChecksum_JSON_Schema"><tt>FileChecksum</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{
&quot;FileChecksum&quot;:
{
&quot;algorithm&quot;: &quot;MD5-of-1MD5-of-512CRC32&quot;,
&quot;bytes&quot; : &quot;eadb10de24aa315748930df6e185c0d ...&quot;,
&quot;length&quot; : 28
}
}
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getFileChecksum</p></div>
<div class="section">
<h3><a name="Get_Home_Directory"></a>Get Home Directory</h3>
<ul>
<li>Submit a HTTP GET request.
<div>
<div>
<pre class="source">curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/?op=GETHOMEDIRECTORY&quot;
</pre></div></div>
<p>The client receives a response with a <a href="#Path_JSON_Schema"><tt>Path</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{&quot;Path&quot;: &quot;/user/username&quot;}
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getHomeDirectory</p></div>
<div class="section">
<h3><a name="Get_Trash_Root"></a>Get Trash Root</h3>
<ul>
<li>Submit a HTTP GET request.
<div>
<div>
<pre class="source">curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETTRASHROOT&quot;
</pre></div></div>
<p>The client receives a response with a <a href="#Path_JSON_Schema"><tt>Path</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{&quot;Path&quot;: &quot;/user/username/.Trash&quot;}
</pre></div></div>
<p>if the path is an encrypted zone path and user has permission of the path, the client receives a response like this:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{&quot;Path&quot;: &quot;/PATH/.Trash/username&quot;}
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getTrashRoot</p>
<p>For more details about trash root in an encrypted zone, please refer to <a href="./TransparentEncryption.html#Rename_and_Trash_considerations">Transparent Encryption Guide</a>.</p></div>
<div class="section">
<h3><a name="Set_Permission"></a>Set Permission</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=SETPERMISSION
[&amp;permission=&lt;OCTAL&gt;]&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="#Permission"><tt>permission</tt></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setPermission</p></div>
<div class="section">
<h3><a name="Set_Owner"></a>Set Owner</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=SETOWNER
[&amp;owner=&lt;USER&gt;][&amp;group=&lt;GROUP&gt;]&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="#Owner"><tt>owner</tt></a>, <a href="#Group"><tt>group</tt></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setOwner</p></div>
<div class="section">
<h3><a name="Set_Replication_Factor"></a>Set Replication Factor</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=SETREPLICATION
[&amp;replication=&lt;SHORT&gt;]&quot;
</pre></div></div>
<p>The client receives a response with a <a href="#Boolean_JSON_Schema"><tt>boolean</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{&quot;boolean&quot;: true}
</pre></div></div>
</li>
</ul>
<p>See also: <a href="#Replication"><tt>replication</tt></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setReplication</p></div>
<div class="section">
<h3><a name="Set_Access_or_Modification_Time"></a>Set Access or Modification Time</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=SETTIMES
[&amp;modificationtime=&lt;TIME&gt;][&amp;accesstime=&lt;TIME&gt;]&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="#Modification_Time"><tt>modificationtime</tt></a>, <a href="#Access_Time"><tt>accesstime</tt></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setTimes</p></div>
<div class="section">
<h3><a name="Modify_ACL_Entries"></a>Modify ACL Entries</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=MODIFYACLENTRIES
&amp;aclspec=&lt;ACLSPEC&gt;&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.modifyAclEntries</p></div>
<div class="section">
<h3><a name="Remove_ACL_Entries"></a>Remove ACL Entries</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=REMOVEACLENTRIES
&amp;aclspec=&lt;ACLSPEC&gt;&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.removeAclEntries</p></div>
<div class="section">
<h3><a name="Remove_Default_ACL"></a>Remove Default ACL</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=REMOVEDEFAULTACL&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.removeDefaultAcl</p></div>
<div class="section">
<h3><a name="Remove_ACL"></a>Remove ACL</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=REMOVEACL&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.removeAcl</p></div>
<div class="section">
<h3><a name="Set_ACL"></a>Set ACL</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=SETACL
&amp;aclspec=&lt;ACLSPEC&gt;&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setAcl</p></div>
<div class="section">
<h3><a name="Get_ACL_Status"></a>Get ACL Status</h3>
<ul>
<li>Submit a HTTP GET request.
<div>
<div>
<pre class="source">curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETACLSTATUS&quot;
</pre></div></div>
<p>The client receives a response with a <a href="#ACL_Status_JSON_Schema"><tt>AclStatus</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{
&quot;AclStatus&quot;: {
&quot;entries&quot;: [
&quot;user:carla:rw-&quot;,
&quot;group::r-x&quot;
],
&quot;group&quot;: &quot;supergroup&quot;,
&quot;owner&quot;: &quot;hadoop&quot;,
&quot;permission&quot;:&quot;775&quot;,
&quot;stickyBit&quot;: false
}
}
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getAclStatus</p></div>
<div class="section">
<h3><a name="Check_access"></a>Check access</h3>
<ul>
<li>Submit a HTTP GET request.
<div>
<div>
<pre class="source">curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=CHECKACCESS
&amp;fsaction=&lt;FSACTION&gt;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.access</p></div></div>
<div class="section">
<h2><a name="Storage_Policy_Operations"></a>Storage Policy Operations</h2>
<div class="section">
<h3><a name="Get_all_Storage_Policies"></a>Get all Storage Policies</h3>
<ul>
<li>Submit a HTTP GET request.
<div>
<div>
<pre class="source">curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1?op=GETALLSTORAGEPOLICY&quot;
</pre></div></div>
<p>The client receives a response with a <a href="#BlockStoragePolicies_JSON_Schema"><tt>BlockStoragePolicies</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{
&quot;BlockStoragePolicies&quot;: {
&quot;BlockStoragePolicy&quot;: [
{
&quot;copyOnCreateFile&quot;: false,
&quot;creationFallbacks&quot;: [],
&quot;id&quot;: 2,
&quot;name&quot;: &quot;COLD&quot;,
&quot;replicationFallbacks&quot;: [],
&quot;storageTypes&quot;: [&quot;ARCHIVE&quot;]
},
{
&quot;copyOnCreateFile&quot;: false,
&quot;creationFallbacks&quot;: [&quot;DISK&quot;,&quot;ARCHIVE&quot;],
&quot;id&quot;: 5,
&quot;name&quot;: &quot;WARM&quot;,
&quot;replicationFallbacks&quot;: [&quot;DISK&quot;,&quot;ARCHIVE&quot;],
&quot;storageTypes&quot;: [&quot;DISK&quot;,&quot;ARCHIVE&quot;]
},
{
&quot;copyOnCreateFile&quot;: false,
&quot;creationFallbacks&quot;: [],
&quot;id&quot;: 7,
&quot;name&quot;: &quot;HOT&quot;,
&quot;replicationFallbacks&quot;: [&quot;ARCHIVE&quot;],
&quot;storageTypes&quot;: [&quot;DISK&quot;]
},
{
&quot;copyOnCreateFile&quot;: false,
&quot;creationFallbacks&quot;: [&quot;SSD&quot;,&quot;DISK&quot;],
&quot;id&quot;: 10,&quot;name&quot;: &quot;ONE_SSD&quot;,
&quot;replicationFallbacks&quot;: [&quot;SSD&quot;,&quot;DISK&quot;],
&quot;storageTypes&quot;: [&quot;SSD&quot;,&quot;DISK&quot;]
},
{
&quot;copyOnCreateFile&quot;: false,
&quot;creationFallbacks&quot;: [&quot;DISK&quot;],
&quot;id&quot;: 12,
&quot;name&quot;: &quot;ALL_SSD&quot;,
&quot;replicationFallbacks&quot;: [&quot;DISK&quot;],
&quot;storageTypes&quot;: [&quot;SSD&quot;]
},
{
&quot;copyOnCreateFile&quot;: true,
&quot;creationFallbacks&quot;: [&quot;DISK&quot;],
&quot;id&quot;: 15,
&quot;name&quot;: &quot;LAZY_PERSIST&quot;,
&quot;replicationFallbacks&quot;: [&quot;DISK&quot;],
&quot;storageTypes&quot;: [&quot;RAM_DISK&quot;,&quot;DISK&quot;]
}
]
}
}
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getAllStoragePolicies</p></div>
<div class="section">
<h3><a name="Set_Storage_Policy"></a>Set Storage Policy</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=SETSTORAGEPOLICY
&amp;storagepolicy=&lt;policy&gt;&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setStoragePolicy</p></div>
<div class="section">
<h3><a name="Unset_Storage_Policy"></a>Unset Storage Policy</h3>
<ul>
<li>Submit a HTTP POT request.
<div>
<div>
<pre class="source">curl -i -X POST &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=UNSETSTORAGEPOLICY&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.unsetStoragePolicy</p></div>
<div class="section">
<h3><a name="Get_Storage_Policy"></a>Get Storage Policy</h3>
<ul>
<li>Submit a HTTP GET request.
<div>
<div>
<pre class="source">curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETSTORAGEPOLICY&quot;
</pre></div></div>
<p>The client receives a response with a <a href="#BlockStoragePolicy_JSON_Schema"><tt>BlockStoragePolicy</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{
&quot;BlockStoragePolicy&quot;: {
&quot;copyOnCreateFile&quot;: false,
&quot;creationFallbacks&quot;: [],
&quot;id&quot;:7,
&quot;name&quot;:&quot;HOT&quot;,
&quot;replicationFallbacks&quot;:[&quot;ARCHIVE&quot;],
&quot;storageTypes&quot;:[&quot;DISK&quot;]
}
}
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getStoragePolicy</p></div>
<div class="section">
<h3><a name="Satisfy_Storage_Policy"></a>Satisfy Storage Policy</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=SATISFYSTORAGEPOLICY&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="./ArchivalStorage.html#Satisfy_Storage_Policy">ArchivalStorage</a>.satisfyStoragePolicy</p></div>
<div class="section">
<h3><a name="Get_File_Block_Locations"></a>Get File Block Locations</h3>
<ul>
<li>Submit a HTTP GET request.
<div>
<div>
<pre class="source">curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETFILEBLOCKLOCATIONS
</pre></div></div>
<p>The client receives a response with a <a href="#Block_Locations_JSON_Schema"><tt>BlockLocations</tt> JSON Object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{
&quot;BlockLocations&quot; :
{
&quot;BlockLocation&quot;:
[
{
&quot;cachedHosts&quot; : [],
&quot;corrupt&quot; : false,
&quot;hosts&quot; : [&quot;host&quot;],
&quot;length&quot; : 134217728, // length of this block
&quot;names&quot; : [&quot;host:ip&quot;],
&quot;offset&quot; : 0, // offset of the block in the file
&quot;storageTypes&quot; : [&quot;DISK&quot;], // enum {RAM_DISK, SSD, DISK, ARCHIVE}
&quot;topologyPaths&quot; : [&quot;/default-rack/hostname:ip&quot;]
}, {
&quot;cachedHosts&quot; : [],
&quot;corrupt&quot; : false,
&quot;hosts&quot; : [&quot;host&quot;],
&quot;length&quot; : 62599364,
&quot;names&quot; : [&quot;host:ip&quot;],
&quot;offset&quot; : 134217728,
&quot;storageTypes&quot; : [&quot;DISK&quot;],
&quot;topologyPaths&quot; : [&quot;/default-rack/hostname:ip&quot;]
},
...
]
}
}
</pre></div></div>
</li>
</ul>
<p>See also: <a href="#Offset"><tt>offset</tt></a>, <a href="#Length"><tt>length</tt></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getFileBlockLocations</p></div></div>
<div class="section">
<h2><a name="Extended_Attributes.28XAttrs.29_Operations"></a>Extended Attributes(XAttrs) Operations</h2>
<div class="section">
<h3><a name="Set_XAttr"></a>Set XAttr</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=SETXATTR
&amp;xattr.name=&lt;XATTRNAME&gt;&amp;xattr.value=&lt;XATTRVALUE&gt;
&amp;flag=&lt;FLAG&gt;&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setXAttr</p></div>
<div class="section">
<h3><a name="Remove_XAttr"></a>Remove XAttr</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=REMOVEXATTR
&amp;xattr.name=&lt;XATTRNAME&gt;&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.removeXAttr</p></div>
<div class="section">
<h3><a name="Get_an_XAttr"></a>Get an XAttr</h3>
<ul>
<li>Submit a HTTP GET request.
<div>
<div>
<pre class="source">curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETXATTRS
&amp;xattr.name=&lt;XATTRNAME&gt;&amp;encoding=&lt;ENCODING&gt;&quot;
</pre></div></div>
<p>The client receives a response with a <a href="#XAttrs_JSON_Schema"><tt>XAttrs</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{
&quot;XAttrs&quot;: [
{
&quot;name&quot;:&quot;XATTRNAME&quot;,
&quot;value&quot;:&quot;XATTRVALUE&quot;
}
]
}
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getXAttr</p></div>
<div class="section">
<h3><a name="Get_multiple_XAttrs"></a>Get multiple XAttrs</h3>
<ul>
<li>Submit a HTTP GET request.
<div>
<div>
<pre class="source">curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETXATTRS
&amp;xattr.name=&lt;XATTRNAME1&gt;&amp;xattr.name=&lt;XATTRNAME2&gt;
&amp;encoding=&lt;ENCODING&gt;&quot;
</pre></div></div>
<p>The client receives a response with a <a href="#XAttrs_JSON_Schema"><tt>XAttrs</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{
&quot;XAttrs&quot;: [
{
&quot;name&quot;:&quot;XATTRNAME1&quot;,
&quot;value&quot;:&quot;XATTRVALUE1&quot;
},
{
&quot;name&quot;:&quot;XATTRNAME2&quot;,
&quot;value&quot;:&quot;XATTRVALUE2&quot;
}
]
}
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getXAttrs</p></div>
<div class="section">
<h3><a name="Get_all_XAttrs"></a>Get all XAttrs</h3>
<ul>
<li>Submit a HTTP GET request.
<div>
<div>
<pre class="source">curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETXATTRS
&amp;encoding=&lt;ENCODING&gt;&quot;
</pre></div></div>
<p>The client receives a response with a <a href="#XAttrs_JSON_Schema"><tt>XAttrs</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{
&quot;XAttrs&quot;: [
{
&quot;name&quot;:&quot;XATTRNAME1&quot;,
&quot;value&quot;:&quot;XATTRVALUE1&quot;
},
{
&quot;name&quot;:&quot;XATTRNAME2&quot;,
&quot;value&quot;:&quot;XATTRVALUE2&quot;
},
{
&quot;name&quot;:&quot;XATTRNAME3&quot;,
&quot;value&quot;:&quot;XATTRVALUE3&quot;
}
]
}
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getXAttrs</p></div>
<div class="section">
<h3><a name="List_all_XAttrs"></a>List all XAttrs</h3>
<ul>
<li>Submit a HTTP GET request.
<div>
<div>
<pre class="source">curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=LISTXATTRS&quot;
</pre></div></div>
<p>The client receives a response with a <a href="#XAttrNames_JSON_Schema"><tt>XAttrNames</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{
&quot;XAttrNames&quot;:&quot;[\&quot;XATTRNAME1\&quot;,\&quot;XATTRNAME2\&quot;,\&quot;XATTRNAME3\&quot;]&quot;
}
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.listXAttrs</p></div></div>
<div class="section">
<h2><a name="Erasure_Coding_Operations"></a>Erasure Coding Operations</h2>
<div class="section">
<h3><a name="Enable_EC_Policy"></a>Enable EC Policy</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/?op=ENABLEECPOLICY
&amp;ecpolicy=&lt;policy&gt;&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="./HDFSErasureCoding.html#Administrative_commands">HDFSErasureCoding</a>.enablePolicy</p></div>
<div class="section">
<h3><a name="Disable_EC_Policy"></a>Disable EC Policy</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/?op=DISABLEECPOLICY
&amp;ecpolicy=&lt;policy&gt;&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="./HDFSErasureCoding.html#Administrative_commands">HDFSErasureCoding</a>.disablePolicy</p></div>
<div class="section">
<h3><a name="Set_EC_Policy"></a>Set EC Policy</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=SETECPOLICY
&amp;ecpolicy=&lt;policy&gt;&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="./HDFSErasureCoding.html#Administrative_commands">HDFSErasureCoding</a>.setErasureCodingPolicy</p></div>
<div class="section">
<h3><a name="Get_EC_Policy"></a>Get EC Policy</h3>
<ul>
<li>Submit a HTTP GET request.
<div>
<div>
<pre class="source">curl -i -X GET &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETECPOLICY
&quot;
</pre></div></div>
</li>
</ul>
<p>The client receives a response with a <a href="#ECPolicy_JSON_Schema"><tt>ECPolicy</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source"> {
&quot;name&quot;: &quot;RS-10-4-1024k&quot;,
&quot;schema&quot;:
{
&quot;codecName&quot;: &quot;rs&quot;,
&quot;numDataUnits&quot;: 10,
&quot;numParityUnits&quot;: 4,
&quot;extraOptions&quot;: {}
}
&quot;cellSize&quot;: 1048576,
&quot;id&quot;:5,
&quot;codecname&quot;:&quot;rs&quot;,
&quot;numDataUnits&quot;: 10,
&quot;numParityUnits&quot;: 4,
&quot;replicationpolicy&quot;:false,
&quot;systemPolicy&quot;:true
}
</pre></div></div>
<p>See also: <a href="./HDFSErasureCoding.html#Administrative_commands">HDFSErasureCoding</a>.getErasureCodingPolicy</p></div>
<div class="section">
<h3><a name="Unset_EC_Policy"></a>Unset EC Policy</h3>
<ul>
<li>Submit a HTTP POST request.
<div>
<div>
<pre class="source">curl -i -X POST &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=UNSETECPOLICY
&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="./HDFSErasureCoding.html#Administrative_commands">HDFSErasureCoding</a>.unsetErasureCodingPolicy</p></div></div>
<div class="section">
<h2><a name="Snapshot_Operations"></a>Snapshot Operations</h2>
<div class="section">
<h3><a name="Allow_Snapshot"></a>Allow Snapshot</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=ALLOWSNAPSHOT&quot;
</pre></div></div>
<p>The client receives a response with zero content length on success:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul></div>
<div class="section">
<h3><a name="Disallow_Snapshot"></a>Disallow Snapshot</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=DISALLOWSNAPSHOT&quot;
</pre></div></div>
<p>The client receives a response with zero content length on success:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul></div>
<div class="section">
<h3><a name="Create_Snapshot"></a>Create Snapshot</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=CREATESNAPSHOT[&amp;snapshotname=&lt;SNAPSHOTNAME&gt;]&quot;
</pre></div></div>
<p>The client receives a response with a <a href="#Path_JSON_Schema"><tt>Path</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{&quot;Path&quot;: &quot;/user/username/.snapshot/s1&quot;}
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.createSnapshot</p></div>
<div class="section">
<h3><a name="Delete_Snapshot"></a>Delete Snapshot</h3>
<ul>
<li>Submit a HTTP DELETE request.
<div>
<div>
<pre class="source">curl -i -X DELETE &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=DELETESNAPSHOT&amp;snapshotname=&lt;SNAPSHOTNAME&gt;&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.deleteSnapshot</p></div>
<div class="section">
<h3><a name="Rename_Snapshot"></a>Rename Snapshot</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=RENAMESNAPSHOT
&amp;oldsnapshotname=&lt;SNAPSHOTNAME&gt;&amp;snapshotname=&lt;SNAPSHOTNAME&gt;&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.renameSnapshot</p></div>
<div class="section">
<h3><a name="Get_Snapshot_Diff"></a>Get Snapshot Diff</h3>
<ul>
<li>Submit a HTTP GET request.
<div>
<div>
<pre class="source">curl -i GET &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETSNAPSHOTDIFF
&amp;oldsnapshotname=&lt;SNAPSHOTNAME&gt;&amp;snapshotname=&lt;SNAPSHOTNAME&gt;&quot;
</pre></div></div>
<p>The client receives a response with a <a href="#SnapshotDiffReport_JSON_Schema"><tt>SnapshotDiffReport</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{&quot;SnapshotDiffReport&quot;:{&quot;diffList&quot;:[],&quot;fromSnapshot&quot;:&quot;s3&quot;,&quot;snapshotRoot&quot;:&quot;/foo&quot;,&quot;toSnapshot&quot;:&quot;s4&quot;}}
</pre></div></div>
</li>
</ul></div>
<div class="section">
<h3><a name="Get_Snapshottable_Directory_List"></a>Get Snapshottable Directory List</h3>
<ul>
<li>Submit a HTTP GET request.
<div>
<div>
<pre class="source">curl -i GET &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/?user.name=&lt;USER&gt;&amp;op=GETSNAPSHOTTABLEDIRECTORYLIST&quot;
</pre></div></div>
<p>If the USER is not the hdfs super user, the call lists only the snapshottable directories owned by the user. If the USER is the hdfs super user, the call lists all the snapshottable directories. The client receives a response with a <a href="#SnapshottableDirectoryList_JSON_Schema"><tt>SnapshottableDirectoryList</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{
&quot;SnapshottableDirectoryList&quot;:
[
{
&quot;dirStatus&quot;:
{
&quot;accessTime&quot;:0,
&quot;blockSize&quot;:0,
&quot;childrenNum&quot;:0,
&quot;fileId&quot;:16386,
&quot;group&quot;:&quot;hadoop&quot;,
&quot;length&quot;:0,
&quot;modificationTime&quot;:1520761889225,
&quot;owner&quot;:&quot;random&quot;,
&quot;pathSuffix&quot;:&quot;bar&quot;,
&quot;permission&quot;:&quot;755&quot;,
&quot;replication&quot;:0,
&quot;storagePolicy&quot;:0,
&quot;type&quot;:&quot;DIRECTORY&quot;
},
&quot;parentFullPath&quot;:&quot;/&quot;,
&quot;snapshotNumber&quot;:0,
&quot;snapshotQuota&quot;:65536
}
]
}
</pre></div></div>
</li>
</ul></div></div>
<div class="section">
<h2><a name="Delegation_Token_Operations"></a>Delegation Token Operations</h2>
<div class="section">
<h3><a name="Get_Delegation_Token"></a>Get Delegation Token</h3>
<ul>
<li>Submit a HTTP GET request.
<div>
<div>
<pre class="source">curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/?op=GETDELEGATIONTOKEN
[&amp;renewer=&lt;USER&gt;][&amp;service=&lt;SERVICE&gt;][&amp;kind=&lt;KIND&gt;]&quot;
</pre></div></div>
<p>The client receives a response with a <a href="#Token_JSON_Schema"><tt>Token</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{
&quot;Token&quot;:
{
&quot;urlString&quot;: &quot;JQAIaG9y...&quot;
}
}
</pre></div></div>
</li>
</ul>
<p>See also: <a href="#Renewer"><tt>renewer</tt></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getDelegationToken, <a href="#Token_Kind"><tt>kind</tt></a>, <a href="#Token_Service"><tt>service</tt></a></p></div>
<div class="section">
<h3><a name="Renew_Delegation_Token"></a>Renew Delegation Token</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/?op=RENEWDELEGATIONTOKEN&amp;token=&lt;TOKEN&gt;&quot;
</pre></div></div>
<p>The client receives a response with a <a href="#Long_JSON_Schema"><tt>long</tt> JSON object</a>:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{&quot;long&quot;: 1320962673997} //the new expiration time
</pre></div></div>
</li>
</ul>
<p>See also: <a href="#Token"><tt>token</tt></a>, <a href="../../api/org/apache/hadoop/security/token/delegation/web/DelegationTokenAuthenticator.html">DelegationTokenAuthenticator</a>.renewDelegationToken</p></div>
<div class="section">
<h3><a name="Cancel_Delegation_Token"></a>Cancel Delegation Token</h3>
<ul>
<li>Submit a HTTP PUT request.
<div>
<div>
<pre class="source">curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/?op=CANCELDELEGATIONTOKEN&amp;token=&lt;TOKEN&gt;&quot;
</pre></div></div>
<p>The client receives a response with zero content length:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Length: 0
</pre></div></div>
</li>
</ul>
<p>See also: <a href="#Token"><tt>token</tt></a>, <a href="../../api/org/apache/hadoop/security/token/delegation/web/DelegationTokenAuthenticator.html">DelegationTokenAuthenticator</a>.cancelDelegationToken</p></div></div>
<div class="section">
<h2><a name="Error_Responses"></a>Error Responses</h2>
<p>When an operation fails, the server may throw an exception. The JSON schema of error responses is defined in <a href="#RemoteException_JSON_Schema">RemoteException JSON Schema</a>. The table below shows the mapping from exceptions to HTTP response codes.</p>
<div class="section">
<h3><a name="HTTP_Response_Codes"></a>HTTP Response Codes</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Exceptions </th>
<th align="left"> HTTP Response Codes </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> <tt>IllegalArgumentException</tt> </td>
<td align="left"> <tt>400 Bad Request</tt> </td></tr>
<tr class="a">
<td align="left"> <tt>UnsupportedOperationException</tt> </td>
<td align="left"> <tt>400 Bad Request</tt> </td></tr>
<tr class="b">
<td align="left"> <tt>SecurityException</tt> </td>
<td align="left"> <tt>401 Unauthorized</tt> </td></tr>
<tr class="a">
<td align="left"> <tt>IOException</tt> </td>
<td align="left"> <tt>403 Forbidden</tt> </td></tr>
<tr class="b">
<td align="left"> <tt>FileNotFoundException</tt> </td>
<td align="left"> <tt>404 Not Found</tt> </td></tr>
<tr class="a">
<td align="left"> <tt>RuntimeException</tt> </td>
<td align="left"> <tt>500 Internal Server Error</tt> </td></tr>
</tbody>
</table>
<p>Below are examples of exception responses.</p>
<div class="section">
<h4><a name="Illegal_Argument_Exception"></a>Illegal Argument Exception</h4>
<div>
<div>
<pre class="source">HTTP/1.1 400 Bad Request
Content-Type: application/json
Transfer-Encoding: chunked
{
&quot;RemoteException&quot;:
{
&quot;exception&quot; : &quot;IllegalArgumentException&quot;,
&quot;javaClassName&quot;: &quot;java.lang.IllegalArgumentException&quot;,
&quot;message&quot; : &quot;Invalid value for webhdfs parameter \&quot;permission\&quot;: ...&quot;
}
}
</pre></div></div>
</div>
<div class="section">
<h4><a name="Security_Exception"></a>Security Exception</h4>
<div>
<div>
<pre class="source">HTTP/1.1 401 Unauthorized
Content-Type: application/json
Transfer-Encoding: chunked
{
&quot;RemoteException&quot;:
{
&quot;exception&quot; : &quot;SecurityException&quot;,
&quot;javaClassName&quot;: &quot;java.lang.SecurityException&quot;,
&quot;message&quot; : &quot;Failed to obtain user group information: ...&quot;
}
}
</pre></div></div>
</div>
<div class="section">
<h4><a name="Access_Control_Exception"></a>Access Control Exception</h4>
<div>
<div>
<pre class="source">HTTP/1.1 403 Forbidden
Content-Type: application/json
Transfer-Encoding: chunked
{
&quot;RemoteException&quot;:
{
&quot;exception&quot; : &quot;AccessControlException&quot;,
&quot;javaClassName&quot;: &quot;org.apache.hadoop.security.AccessControlException&quot;,
&quot;message&quot; : &quot;Permission denied: ...&quot;
}
}
</pre></div></div>
</div>
<div class="section">
<h4><a name="File_Not_Found_Exception"></a>File Not Found Exception</h4>
<div>
<div>
<pre class="source">HTTP/1.1 404 Not Found
Content-Type: application/json
Transfer-Encoding: chunked
{
&quot;RemoteException&quot;:
{
&quot;exception&quot; : &quot;FileNotFoundException&quot;,
&quot;javaClassName&quot;: &quot;java.io.FileNotFoundException&quot;,
&quot;message&quot; : &quot;File does not exist: /foo/a.patch&quot;
}
}
</pre></div></div>
</div></div></div>
<div class="section">
<h2><a name="JSON_Schemas"></a>JSON Schemas</h2>
<p>All operations, except for <a href="#Open_and_Read_a_File"><tt>OPEN</tt></a>, either return a zero-length response or a JSON response. For <a href="#Open_and_Read_a_File"><tt>OPEN</tt></a>, the response is an octet-stream. The JSON schemas are shown below. See <a class="externalLink" href="http://tools.ietf.org/id/draft-zyp-json-schema-03.html">draft-zyp-json-schema-03</a> for the syntax definitions of the JSON schemas.</p>
<p><b>Note</b> that the default value of <a class="externalLink" href="http://tools.ietf.org/id/draft-zyp-json-schema-03.html#additionalProperties"><tt>additionalProperties</tt></a> is an empty schema which allows any value for additional properties. Therefore, all WebHDFS JSON responses allow any additional property. However, if additional properties are included in the responses, they are considered as optional properties in order to maintain compatibility.</p>
<div class="section">
<h3><a name="ACL_Status_JSON_Schema"></a>ACL Status JSON Schema</h3>
<div>
<div>
<pre class="source">{
&quot;name&quot; : &quot;AclStatus&quot;,
&quot;properties&quot;:
{
&quot;AclStatus&quot;:
{
&quot;type&quot; : &quot;object&quot;,
&quot;properties&quot;:
{
&quot;entries&quot;:
{
&quot;type&quot;: &quot;array&quot;,
&quot;items&quot;:
{
&quot;description&quot;: &quot;ACL entry.&quot;,
&quot;type&quot;: &quot;string&quot;
}
},
&quot;group&quot;:
{
&quot;description&quot;: &quot;The group owner.&quot;,
&quot;type&quot; : &quot;string&quot;,
&quot;required&quot; : true
},
&quot;owner&quot;:
{
&quot;description&quot;: &quot;The user who is the owner.&quot;,
&quot;type&quot; : &quot;string&quot;,
&quot;required&quot; : true
},
&quot;stickyBit&quot;:
{
&quot;description&quot;: &quot;True if the sticky bit is on.&quot;,
&quot;type&quot; : &quot;boolean&quot;,
&quot;required&quot; : true
}
}
}
}
}
</pre></div></div>
</div>
<div class="section">
<h3><a name="XAttrs_JSON_Schema"></a>XAttrs JSON Schema</h3>
<div>
<div>
<pre class="source">{
&quot;name&quot; : &quot;XAttrs&quot;,
&quot;properties&quot;:
{
&quot;XAttrs&quot;:
{
&quot;type&quot; : &quot;array&quot;,
&quot;items&quot;:
{
&quot;type&quot; : &quot;object&quot;,
&quot;properties&quot;:
{
&quot;name&quot;:
{
&quot;description&quot;: &quot;XAttr name.&quot;,
&quot;type&quot; : &quot;string&quot;,
&quot;required&quot; : true
},
&quot;value&quot;:
{
&quot;description&quot;: &quot;XAttr value.&quot;,
&quot;type&quot; : &quot;string&quot;
}
}
}
}
}
}
</pre></div></div>
</div>
<div class="section">
<h3><a name="XAttrNames_JSON_Schema"></a>XAttrNames JSON Schema</h3>
<div>
<div>
<pre class="source">{
&quot;name&quot; : &quot;XAttrNames&quot;,
&quot;properties&quot;:
{
&quot;XAttrNames&quot;:
{
&quot;description&quot;: &quot;XAttr names.&quot;,
&quot;type&quot; : &quot;string&quot;,
&quot;required&quot; : true
}
}
}
</pre></div></div>
</div>
<div class="section">
<h3><a name="Boolean_JSON_Schema"></a>Boolean JSON Schema</h3>
<div>
<div>
<pre class="source">{
&quot;name&quot; : &quot;boolean&quot;,
&quot;properties&quot;:
{
&quot;boolean&quot;:
{
&quot;description&quot;: &quot;A boolean value&quot;,
&quot;type&quot; : &quot;boolean&quot;,
&quot;required&quot; : true
}
}
}
</pre></div></div>
<p>See also: <a href="#Make_a_Directory"><tt>MKDIRS</tt></a>, <a href="#Rename_a_FileDirectory"><tt>RENAME</tt></a>, <a href="#Delete_a_FileDirectory"><tt>DELETE</tt></a>, <a href="#Set_Replication_Factor"><tt>SETREPLICATION</tt></a></p></div>
<div class="section">
<h3><a name="ContentSummary_JSON_Schema"></a>ContentSummary JSON Schema</h3>
<div>
<div>
<pre class="source">{
&quot;name&quot; : &quot;ContentSummary&quot;,
&quot;properties&quot;:
{
&quot;ContentSummary&quot;:
{
&quot;type&quot; : &quot;object&quot;,
&quot;properties&quot;:
{
&quot;directoryCount&quot;:
{
&quot;description&quot;: &quot;The number of directories.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
},
&quot;fileCount&quot;:
{
&quot;description&quot;: &quot;The number of files.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
},
&quot;length&quot;:
{
&quot;description&quot;: &quot;The number of bytes used by the content.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
},
&quot;quota&quot;:
{
&quot;description&quot;: &quot;The namespace quota of this directory.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
},
&quot;spaceConsumed&quot;:
{
&quot;description&quot;: &quot;The disk space consumed by the content.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
},
&quot;spaceQuota&quot;:
{
&quot;description&quot;: &quot;The disk space quota.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
},
&quot;typeQuota&quot;:
{
&quot;type&quot; : &quot;object&quot;,
&quot;properties&quot;:
{
&quot;ARCHIVE&quot;:
{
&quot;type&quot; : &quot;object&quot;,
&quot;properties&quot;:
{
&quot;consumed&quot;:
{
&quot;description&quot;: &quot;The storage type space consumed.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
},
&quot;quota&quot;:
{
&quot;description&quot;: &quot;The storage type quota.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
}
}
},
&quot;DISK&quot;:
{
&quot;type&quot; : &quot;object&quot;,
&quot;properties&quot;:
{
&quot;consumed&quot;:
{
&quot;description&quot;: &quot;The storage type space consumed.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
},
&quot;quota&quot;:
{
&quot;description&quot;: &quot;The storage type quota.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
}
}
},
&quot;SSD&quot;:
{
&quot;type&quot; : &quot;object&quot;,
&quot;properties&quot;:
{
&quot;consumed&quot;:
{
&quot;description&quot;: &quot;The storage type space consumed.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
},
&quot;quota&quot;:
{
&quot;description&quot;: &quot;The storage type quota.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
}
}
}
}
}
}
}
}
}
</pre></div></div>
<p>See also: <a href="#Get_Content_Summary_of_a_Directory"><tt>GETCONTENTSUMMARY</tt></a></p></div>
<div class="section">
<h3><a name="QuotaUsage_JSON_Schema"></a>QuotaUsage JSON Schema</h3>
<div>
<div>
<pre class="source">{
&quot;name&quot; : &quot;QuotaUsage&quot;,
&quot;properties&quot;:
{
&quot;QuotaUsage&quot;:
{
&quot;type&quot; : &quot;object&quot;,
&quot;properties&quot;:
{
&quot;fileAndDirectoryCount&quot;:
{
&quot;description&quot;: &quot;The number of files and directories.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
},
&quot;quota&quot;:
{
&quot;description&quot;: &quot;The namespace quota of this directory.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
},
&quot;spaceConsumed&quot;:
{
&quot;description&quot;: &quot;The disk space consumed by the content.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
},
&quot;spaceQuota&quot;:
{
&quot;description&quot;: &quot;The disk space quota.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
},
&quot;typeQuota&quot;:
{
&quot;type&quot; : &quot;object&quot;,
&quot;properties&quot;:
{
&quot;ARCHIVE&quot;:
{
&quot;type&quot; : &quot;object&quot;,
&quot;properties&quot;:
{
&quot;consumed&quot;:
{
&quot;description&quot;: &quot;The storage type space consumed.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
},
&quot;quota&quot;:
{
&quot;description&quot;: &quot;The storage type quota.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
}
}
},
&quot;DISK&quot;:
{
&quot;type&quot; : &quot;object&quot;,
&quot;properties&quot;:
{
&quot;consumed&quot;:
{
&quot;description&quot;: &quot;The storage type space consumed.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
},
&quot;quota&quot;:
{
&quot;description&quot;: &quot;The storage type quota.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
}
}
},
&quot;SSD&quot;:
{
&quot;type&quot; : &quot;object&quot;,
&quot;properties&quot;:
{
&quot;consumed&quot;:
{
&quot;description&quot;: &quot;The storage type space consumed.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
},
&quot;quota&quot;:
{
&quot;description&quot;: &quot;The storage type quota.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
}
}
}
}
}
}
}
}
}
</pre></div></div>
<p>See also: <a href="#Get_Quota_Usage_of_a_Directory"><tt>GETQUOTAUSAGE</tt></a></p></div>
<div class="section">
<h3><a name="FileChecksum_JSON_Schema"></a>FileChecksum JSON Schema</h3>
<div>
<div>
<pre class="source">{
&quot;name&quot; : &quot;FileChecksum&quot;,
&quot;properties&quot;:
{
&quot;FileChecksum&quot;:
{
&quot;type&quot; : &quot;object&quot;,
&quot;properties&quot;:
{
&quot;algorithm&quot;:
{
&quot;description&quot;: &quot;The name of the checksum algorithm.&quot;,
&quot;type&quot; : &quot;string&quot;,
&quot;required&quot; : true
},
&quot;bytes&quot;:
{
&quot;description&quot;: &quot;The byte sequence of the checksum in hexadecimal.&quot;,
&quot;type&quot; : &quot;string&quot;,
&quot;required&quot; : true
},
&quot;length&quot;:
{
&quot;description&quot;: &quot;The length of the bytes (not the length of the string).&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
}
}
}
}
}
</pre></div></div>
</div>
<div class="section">
<h3><a name="FileStatus_JSON_Schema"></a>FileStatus JSON Schema</h3>
<div>
<div>
<pre class="source">{
&quot;name&quot; : &quot;FileStatus&quot;,
&quot;properties&quot;:
{
&quot;FileStatus&quot;: fileStatusProperties //See FileStatus Properties
}
}
</pre></div></div>
<p>See also: <a href="#FileStatus_Properties"><tt>FileStatus</tt> Properties</a>, <a href="#Status_of_a_FileDirectory"><tt>GETFILESTATUS</tt></a>, <a href="../../api/org/apache/hadoop/fs/FileStatus.html">FileStatus</a></p>
<div class="section">
<h4><a name="FileStatus_Properties"></a>FileStatus Properties</h4>
<p>JavaScript syntax is used to define <tt>fileStatusProperties</tt> so that it can be referred in both <tt>FileStatus</tt> and <tt>FileStatuses</tt> JSON schemas.</p>
<div>
<div>
<pre class="source">var fileStatusProperties =
{
&quot;type&quot; : &quot;object&quot;,
&quot;properties&quot;:
{
&quot;accessTime&quot;:
{
&quot;description&quot;: &quot;The access time.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
},
&quot;blockSize&quot;:
{
&quot;description&quot;: &quot;The block size of a file.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
},
&quot;group&quot;:
{
&quot;description&quot;: &quot;The group owner.&quot;,
&quot;type&quot; : &quot;string&quot;,
&quot;required&quot; : true
},
&quot;length&quot;:
{
&quot;description&quot;: &quot;The number of bytes in a file.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
},
&quot;modificationTime&quot;:
{
&quot;description&quot;: &quot;The modification time.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
},
&quot;owner&quot;:
{
&quot;description&quot;: &quot;The user who is the owner.&quot;,
&quot;type&quot; : &quot;string&quot;,
&quot;required&quot; : true
},
&quot;pathSuffix&quot;:
{
&quot;description&quot;: &quot;The path suffix.&quot;,
&quot;type&quot; : &quot;string&quot;,
&quot;required&quot; : true
},
&quot;permission&quot;:
{
&quot;description&quot;: &quot;The permission represented as a octal string.&quot;,
&quot;type&quot; : &quot;string&quot;,
&quot;required&quot; : true
},
&quot;replication&quot;:
{
&quot;description&quot;: &quot;The number of replication of a file.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
},
&quot;symlink&quot;: //an optional property
{
&quot;description&quot;: &quot;The link target of a symlink.&quot;,
&quot;type&quot; : &quot;string&quot;
},
&quot;type&quot;:
{
&quot;description&quot;: &quot;The type of the path object.&quot;,
&quot;enum&quot; : [&quot;FILE&quot;, &quot;DIRECTORY&quot;, &quot;SYMLINK&quot;],
&quot;required&quot; : true
}
}
};
</pre></div></div>
</div></div>
<div class="section">
<h3><a name="FileStatuses_JSON_Schema"></a>FileStatuses JSON Schema</h3>
<p>A <tt>FileStatuses</tt> JSON object represents an array of <tt>FileStatus</tt> JSON objects.</p>
<div>
<div>
<pre class="source">{
&quot;name&quot; : &quot;FileStatuses&quot;,
&quot;properties&quot;:
{
&quot;FileStatuses&quot;:
{
&quot;type&quot; : &quot;object&quot;,
&quot;properties&quot;:
{
&quot;FileStatus&quot;:
{
&quot;description&quot;: &quot;An array of FileStatus&quot;,
&quot;type&quot; : &quot;array&quot;,
&quot;items&quot; : fileStatusProperties //See FileStatus Properties
}
}
}
}
}
</pre></div></div>
<p>See also: <a href="#FileStatus_Properties"><tt>FileStatus</tt> Properties</a>, <a href="#List_a_Directory"><tt>LISTSTATUS</tt></a>, <a href="../../api/org/apache/hadoop/fs/FileStatus.html">FileStatus</a></p></div>
<div class="section">
<h3><a name="DirectoryListing_JSON_Schema"></a>DirectoryListing JSON Schema</h3>
<p>A <tt>DirectoryListing</tt> JSON object represents a batch of directory entries while iteratively listing a directory. It contains a <tt>FileStatuses</tt> JSON object as well as iteration information.</p>
<div>
<div>
<pre class="source">{
&quot;name&quot; : &quot;DirectoryListing&quot;,
&quot;properties&quot;:
{
&quot;DirectoryListing&quot;:
{
&quot;type&quot; : &quot;object&quot;,
&quot;properties&quot;:
{
&quot;partialListing&quot;:
{
&quot;description&quot;: &quot;A partial directory listing&quot;,
&quot;type&quot; : &quot;object&quot;, // A FileStatuses object
&quot;required&quot; : true
},
&quot;remainingEntries&quot;:
{
&quot;description&quot;: &quot;Number of remaining entries&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
}
}
}
}
}
</pre></div></div>
<p>See also: <a href="#FileStatuses_JSON_Schema"><tt>FileStatuses</tt> JSON Schema</a>, <a href="#Iteratively_List_a_Directory"><tt>LISTSTATUS_BATCH</tt></a>, <a href="../../api/org/apache/hadoop/fs/FileStatus.html">FileStatus</a></p></div>
<div class="section">
<h3><a name="Long_JSON_Schema"></a>Long JSON Schema</h3>
<div>
<div>
<pre class="source">{
&quot;name&quot; : &quot;long&quot;,
&quot;properties&quot;:
{
&quot;long&quot;:
{
&quot;description&quot;: &quot;A long integer value&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
}
}
}
</pre></div></div>
<p>See also: <a href="#Renew_Delegation_Token"><tt>RENEWDELEGATIONTOKEN</tt></a>,</p></div>
<div class="section">
<h3><a name="Path_JSON_Schema"></a>Path JSON Schema</h3>
<div>
<div>
<pre class="source">{
&quot;name&quot; : &quot;Path&quot;,
&quot;properties&quot;:
{
&quot;Path&quot;:
{
&quot;description&quot;: &quot;The string representation a Path.&quot;,
&quot;type&quot; : &quot;string&quot;,
&quot;required&quot; : true
}
}
}
</pre></div></div>
<p>See also: <a href="#Get_Home_Directory"><tt>GETHOMEDIRECTORY</tt></a>, <a href="../../api/org/apache/hadoop/fs/Path.html">Path</a></p></div>
<div class="section">
<h3><a name="RemoteException_JSON_Schema"></a>RemoteException JSON Schema</h3>
<div>
<div>
<pre class="source">{
&quot;name&quot; : &quot;RemoteException&quot;,
&quot;properties&quot;:
{
&quot;RemoteException&quot;:
{
&quot;type&quot; : &quot;object&quot;,
&quot;properties&quot;:
{
&quot;exception&quot;:
{
&quot;description&quot;: &quot;Name of the exception&quot;,
&quot;type&quot; : &quot;string&quot;,
&quot;required&quot; : true
},
&quot;message&quot;:
{
&quot;description&quot;: &quot;Exception message&quot;,
&quot;type&quot; : &quot;string&quot;,
&quot;required&quot; : true
},
&quot;javaClassName&quot;: //an optional property
{
&quot;description&quot;: &quot;Java class name of the exception&quot;,
&quot;type&quot; : &quot;string&quot;
}
}
}
}
}
</pre></div></div>
<p>See also: <a href="#Error_Responses">Error Responses</a></p></div>
<div class="section">
<h3><a name="Token_JSON_Schema"></a>Token JSON Schema</h3>
<div>
<div>
<pre class="source">{
&quot;name&quot; : &quot;Token&quot;,
&quot;properties&quot;:
{
&quot;Token&quot;: tokenProperties //See Token Properties
}
}
</pre></div></div>
<p>See also: <a href="#Token_Properties"><tt>Token</tt> Properties</a>, <a href="#Get_Delegation_Token"><tt>GETDELEGATIONTOKEN</tt></a>, the note in <a href="#Delegation">Delegation</a>.</p>
<div class="section">
<h4><a name="Token_Properties"></a>Token Properties</h4>
<p>JavaScript syntax is used to define <tt>tokenProperties</tt> so that it can be referred in <tt>Token</tt> JSON schema.</p>
<div>
<div>
<pre class="source">var tokenProperties =
{
&quot;type&quot; : &quot;object&quot;,
&quot;properties&quot;:
{
&quot;urlString&quot;:
{
&quot;description&quot;: &quot;A delegation token encoded as a URL safe string.&quot;,
&quot;type&quot; : &quot;string&quot;,
&quot;required&quot; : true
}
}
}
</pre></div></div>
<p>See also: <a href="#Token_Properties"><tt>Token</tt> Properties</a>, the note in <a href="#Delegation">Delegation</a>.</p></div></div>
<div class="section">
<h3><a name="BlockStoragePolicy_JSON_Schema"></a>BlockStoragePolicy JSON Schema</h3>
<div>
<div>
<pre class="source">{
&quot;name&quot; : &quot;BlockStoragePolicy&quot;,
&quot;properties&quot;:
{
&quot;BlockStoragePolicy&quot;: blockStoragePolicyProperties //See BlockStoragePolicy Properties
}
}
</pre></div></div>
<p>See also: <a href="#BlockStoragePolicy_Properties"><tt>BlockStoragePolicy</tt> Properties</a>, <a href="#Get_Storage_Policy"><tt>GETSTORAGEPOLICY</tt></a></p>
<div class="section">
<h4><a name="BlockStoragePolicy_Properties"></a>BlockStoragePolicy Properties</h4>
<p>JavaScript syntax is used to define <tt>blockStoragePolicyProperties</tt> so that it can be referred in both <tt>BlockStoragePolicy</tt> and <tt>BlockStoragePolicies</tt> JSON schemas.</p>
<div>
<div>
<pre class="source">var blockStoragePolicyProperties =
{
&quot;type&quot; : &quot;object&quot;,
&quot;properties&quot;:
{
&quot;id&quot;:
{
&quot;description&quot;: &quot;Policy ID.&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
},
&quot;name&quot;:
{
&quot;description&quot;: &quot;Policy name.&quot;,
&quot;type&quot; : &quot;string&quot;,
&quot;required&quot; : true
},
&quot;storageTypes&quot;:
{
&quot;description&quot;: &quot;An array of storage types for block placement.&quot;,
&quot;type&quot; : &quot;array&quot;,
&quot;required&quot; : true
&quot;items&quot; :
{
&quot;type&quot;: &quot;string&quot;
}
},
&quot;replicationFallbacks&quot;:
{
&quot;description&quot;: &quot;An array of fallback storage types for replication.&quot;,
&quot;type&quot; : &quot;array&quot;,
&quot;required&quot; : true
&quot;items&quot; :
{
&quot;type&quot;: &quot;string&quot;
}
},
&quot;creationFallbacks&quot;:
{
&quot;description&quot;: &quot;An array of fallback storage types for file creation.&quot;,
&quot;type&quot; : &quot;array&quot;,
&quot;required&quot; : true
&quot;items&quot; :
{
&quot;type&quot;: &quot;string&quot;
}
},
&quot;copyOnCreateFile&quot;:
{
&quot;description&quot;: &quot;If set then the policy cannot be changed after file creation.&quot;,
&quot;type&quot; : &quot;boolean&quot;,
&quot;required&quot; : true
}
}
};
</pre></div></div>
</div></div>
<div class="section">
<h3><a name="ECPolicy_JSON_Schema"></a>ECPolicy JSON Schema</h3>
<div>
<div>
<pre class="source">{
&quot;name&quot;: &quot;RS-10-4-1024k&quot;,
schema {
&quot;codecName&quot;: &quot;rs&quot;,
&quot;numDataUnits&quot;: 10,
&quot;numParityUnits&quot;: 4,
&quot;extraOptions&quot;: {}
}
&quot;cellSize&quot;: 1048576,
&quot;id&quot;:5,
&quot;codecname&quot;:&quot;rs&quot;,
&quot;numDataUnits&quot;: 10,
&quot;numParityUnits&quot;: 4,
&quot;replicationpolicy&quot;:false,
&quot;systemPolicy&quot;:true
}
</pre></div></div>
</div>
<div class="section">
<h3><a name="BlockStoragePolicies_JSON_Schema"></a>BlockStoragePolicies JSON Schema</h3>
<p>A <tt>BlockStoragePolicies</tt> JSON object represents an array of <tt>BlockStoragePolicy</tt> JSON objects.</p>
<div>
<div>
<pre class="source">{
&quot;name&quot; : &quot;BlockStoragePolicies&quot;,
&quot;properties&quot;:
{
&quot;BlockStoragePolicies&quot;:
{
&quot;type&quot; : &quot;object&quot;,
&quot;properties&quot;:
{
&quot;BlockStoragePolicy&quot;:
{
&quot;description&quot;: &quot;An array of BlockStoragePolicy&quot;,
&quot;type&quot; : &quot;array&quot;,
&quot;items&quot; : blockStoragePolicyProperties //See BlockStoragePolicy Properties
}
}
}
}
}
</pre></div></div>
</div>
<div class="section">
<h3><a name="SnapshotDiffReport_JSON_Schema"></a>SnapshotDiffReport JSON Schema</h3>
<div>
<div>
<pre class="source">{
&quot;name&quot;: &quot;SnapshotDiffReport&quot;,
&quot;type&quot;: &quot;object&quot;,
&quot;properties&quot;:
{
&quot;SnapshotDiffReport&quot;:
{
&quot;type&quot; : &quot;object&quot;,
&quot;properties&quot; :
{
&quot;diffList&quot;:
{
&quot;description&quot;: &quot;An array of DiffReportEntry&quot;,
&quot;type&quot; : &quot;array&quot;,
&quot;items&quot; : diffReportEntries,
&quot;required&quot; : true
},
&quot;fromSnapshot&quot;:
{
&quot;description&quot;: &quot;Source snapshot&quot;,
&quot;type&quot; : &quot;string&quot;,
&quot;required&quot; : true
},
&quot;snapshotRoot&quot;:
{
&quot;description&quot; : &quot;String representation of snapshot root path&quot;,
&quot;type&quot; : &quot;string&quot;,
&quot;required&quot; : true
},
&quot;toSnapshot&quot;:
{
&quot;description&quot; : &quot;Destination snapshot&quot;,
&quot;type&quot; : &quot;string&quot;,
&quot;required&quot; : true
}
}
}
}
}
</pre></div></div>
<div class="section">
<h4><a name="DiffReport_Entries"></a>DiffReport Entries</h4>
<p>JavaScript syntax is used to define <tt>diffReportEntries</tt> so that it can be referred in <tt>SnapshotDiffReport</tt> JSON schema.</p>
<div>
<div>
<pre class="source">var diffReportEntries =
{
&quot;type&quot;: &quot;object&quot;,
&quot;properties&quot;:
{
&quot;sourcePath&quot;:
{
&quot;description&quot; : &quot;Source path name relative to snapshot root&quot;,
&quot;type&quot; : &quot;string&quot;,
&quot;required&quot; : true
},
&quot;targetPath&quot;:
{
&quot;description&quot; : &quot;Target path relative to snapshot root used for renames&quot;,
&quot;type&quot; : &quot;string&quot;,
&quot;required&quot; : true
},
&quot;type&quot;:
{
&quot;description&quot; : &quot;Type of diff report entry&quot;,
&quot;enum&quot; : [&quot;CREATE&quot;, &quot;MODIFY&quot;, &quot;DELETE&quot;, &quot;RENAME&quot;],
&quot;required&quot; : true
}
}
}
</pre></div></div>
</div></div>
<div class="section">
<h3><a name="SnapshottableDirectoryList_JSON_Schema"></a>SnapshottableDirectoryList JSON Schema</h3>
<div>
<div>
<pre class="source">{
&quot;name&quot;: &quot;SnapshottableDirectoryList&quot;,
&quot;type&quot;: &quot;object&quot;,
&quot;properties&quot;:
{
&quot;SnapshottableDirectoryList&quot;:
{
&quot;description&quot;: &quot;An array of SnapshottableDirectoryStatus&quot;,
&quot;type&quot; : &quot;array&quot;,
&quot;items&quot; : snapshottableDirectoryStatus,
&quot;required&quot; : true
}
}
}
</pre></div></div>
<div class="section">
<h4><a name="SnapshottableDirectoryStatus"></a>SnapshottableDirectoryStatus</h4>
<p>JavaScript syntax is used to define <tt>snapshottableDirectoryStatus</tt> so that it can be referred in <tt>SnapshottableDirectoryList</tt> JSON schema.</p>
<div>
<div>
<pre class="source">var snapshottableDirectoryStatus =
{
&quot;type&quot;: &quot;object&quot;,
&quot;properties&quot;:
{
&quot;dirStatus&quot;: fileStatusProperties,
&quot;parentFullPath&quot;:
{
&quot;description&quot; : &quot;Full path of the parent of snapshottable directory&quot;,
&quot;type&quot; : &quot;string&quot;,
&quot;required&quot; : true
},
&quot;snapshotNumber&quot;:
{
&quot;description&quot; : &quot;Number of snapshots created on the snapshottable directory&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
},
&quot;snapshotQuota&quot;:
{
&quot;description&quot; : &quot;Total number of snapshots allowed on the snapshottable directory&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : true
}
}
}
</pre></div></div>
</div></div>
<div class="section">
<h3><a name="BlockLocations_JSON_Schema"></a>BlockLocations JSON Schema</h3>
<p>A <tt>BlockLocations</tt> JSON object represents an array of <tt>BlockLocation</tt> JSON objects.</p>
<div>
<div>
<pre class="source">{
&quot;name&quot; : &quot;BlockLocations&quot;,
&quot;properties&quot;:
{
&quot;BlockLocations&quot;:
{
&quot;type&quot; : &quot;object&quot;,
&quot;properties&quot;:
{
&quot;BlockLocation&quot;:
{
&quot;description&quot;: &quot;An array of BlockLocation&quot;,
&quot;type&quot; : &quot;array&quot;,
&quot;items&quot; : blockLocationProperties //See BlockLocation Properties
}
}
}
}
}
</pre></div></div>
<p>See also <a href="#BlockLocation_Properties"><tt>BlockLocation</tt> Properties</a>, <a href="#Get_File_Block_Locations"><tt>GETFILEBLOCKLOCATIONS</tt></a>, <a href="../../api/org/apache/hadoop/fs/BlockLocation.html">BlockLocation</a></p></div>
<div class="section">
<h3><a name="BlockLocation_JSON_Schema"></a>BlockLocation JSON Schema</h3>
<div>
<div>
<pre class="source">{
&quot;name&quot; : &quot;BlockLocation&quot;,
&quot;properties&quot;:
{
&quot;BlockLocation&quot;: blockLocationProperties //See BlockLocation Properties
}
}
</pre></div></div>
<p>See also <a href="#BlockLocation_Properties"><tt>BlockLocation</tt> Properties</a>, <a href="#Get_File_Block_Locations"><tt>GETFILEBLOCKLOCATIONS</tt></a>, <a href="../../api/org/apache/hadoop/fs/BlockLocation.html">BlockLocation</a></p>
<div class="section">
<h4><a name="BlockLocation_Properties"></a>BlockLocation Properties</h4>
<p>JavaScript syntax is used to define <tt>blockLocationProperties</tt> so that it can be referred in both <tt>BlockLocation</tt> and <tt>BlockLocations</tt> JSON schemas.</p>
<div>
<div>
<pre class="source">var blockLocationProperties =
{
&quot;type&quot; : &quot;object&quot;,
&quot;properties&quot;:
{
&quot;cachedHosts&quot;:
{
&quot;description&quot;: &quot;Datanode hostnames with a cached replica&quot;,
&quot;type&quot; : &quot;array&quot;,
&quot;required&quot; : &quot;true&quot;,
&quot;items&quot; :
{
&quot;description&quot;: &quot;A datanode hostname&quot;,
&quot;type&quot; : &quot;string&quot;
}
},
&quot;corrupt&quot;:
{
&quot;description&quot;: &quot;True if the block is corrupted&quot;,
&quot;type&quot; : &quot;boolean&quot;,
&quot;required&quot; : &quot;true&quot;
},
&quot;hosts&quot;:
{
&quot;description&quot;: &quot;Datanode hostnames store the block&quot;,
&quot;type&quot; : &quot;array&quot;,
&quot;required&quot; : &quot;true&quot;,
&quot;items&quot; :
{
&quot;description&quot;: &quot;A datanode hostname&quot;,
&quot;type&quot; : &quot;string&quot;
}
},
&quot;length&quot;:
{
&quot;description&quot;: &quot;Length of the block&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : &quot;true&quot;
},
&quot;names&quot;:
{
&quot;description&quot;: &quot;Datanode IP:xferPort for accessing the block&quot;,
&quot;type&quot; : &quot;array&quot;,
&quot;required&quot; : &quot;true&quot;,
&quot;items&quot; :
{
&quot;description&quot;: &quot;DatanodeIP:xferPort&quot;,
&quot;type&quot; : &quot;string&quot;
}
},
&quot;offset&quot;:
{
&quot;description&quot;: &quot;Offset of the block in the file&quot;,
&quot;type&quot; : &quot;integer&quot;,
&quot;required&quot; : &quot;true&quot;
},
&quot;storageTypes&quot;:
{
&quot;description&quot;: &quot;Storage type of each replica&quot;,
&quot;type&quot; : &quot;array&quot;,
&quot;required&quot; : &quot;true&quot;,
&quot;items&quot; :
{
&quot;description&quot;: &quot;Storage type&quot;,
&quot;enum&quot; : [&quot;RAM_DISK&quot;, &quot;SSD&quot;, &quot;DISK&quot;, &quot;ARCHIVE&quot;]
}
},
&quot;topologyPaths&quot;:
{
&quot;description&quot;: &quot;Datanode addresses in network topology&quot;,
&quot;type&quot; : &quot;array&quot;,
&quot;required&quot; : &quot;true&quot;,
&quot;items&quot; :
{
&quot;description&quot;: &quot;/rack/host:ip&quot;,
&quot;type&quot; : &quot;string&quot;
}
}
}
};
</pre></div></div>
</div></div></div>
<div class="section">
<h2><a name="HTTP_Query_Parameter_Dictionary"></a>HTTP Query Parameter Dictionary</h2>
<div class="section">
<h3><a name="ACL_Spec"></a>ACL Spec</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>aclspec</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The ACL spec included in ACL modification operations. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> String </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> &lt;empty&gt; </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> See <a href="./HdfsPermissionsGuide.html">Permissions and HDFS</a>. </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> See <a href="./HdfsPermissionsGuide.html">Permissions and HDFS</a>. </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="XAttr_Name"></a>XAttr Name</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>xattr.name</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The XAttr name of a file/directory. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> String </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> &lt;empty&gt; </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> Any string prefixed with user./trusted./system./security.. </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any string prefixed with user./trusted./system./security.. </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="XAttr_Value"></a>XAttr Value</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>xattr.value</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The XAttr value of a file/directory. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> String </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> &lt;empty&gt; </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> An encoded value. </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Enclosed in double quotes or prefixed with 0x or 0s. </td></tr>
</tbody>
</table>
<p>See also: <a href="./ExtendedAttributes.html">Extended Attributes</a></p></div>
<div class="section">
<h3><a name="XAttr_set_flag"></a>XAttr set flag</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>flag</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The XAttr set flag. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> String </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> &lt;empty&gt; </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> CREATE,REPLACE. </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> CREATE,REPLACE. </td></tr>
</tbody>
</table>
<p>See also: <a href="./ExtendedAttributes.html">Extended Attributes</a></p></div>
<div class="section">
<h3><a name="XAttr_value_encoding"></a>XAttr value encoding</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>encoding</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The XAttr value encoding. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> String </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> &lt;empty&gt; </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> text </td>
<td> hex </td>
<td> base64 </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> text </td>
<td> hex </td>
<td> base64 </td></tr>
</tbody>
</table>
<p>See also: <a href="./ExtendedAttributes.html">Extended Attributes</a></p></div>
<div class="section">
<h3><a name="Access_Time"></a>Access Time</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>accesstime</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The access time of a file/directory. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> long </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> -1 (means keeping it unchanged) </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> -1 or a timestamp </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any integer. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Set_Access_or_Modification_Time"><tt>SETTIMES</tt></a></p></div>
<div class="section">
<h3><a name="Block_Size"></a>Block Size</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>blocksize</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The block size of a file. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> long </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> Specified in the configuration. </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> &gt; 0 </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any integer. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Create_and_Write_to_a_File"><tt>CREATE</tt></a></p></div>
<div class="section">
<h3><a name="Buffer_Size"></a>Buffer Size</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>buffersize</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The size of the buffer used in transferring data. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> int </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> Specified in the configuration. </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> &gt; 0 </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any integer. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Create_and_Write_to_a_File"><tt>CREATE</tt></a>, <a href="#Append_to_a_File"><tt>APPEND</tt></a>, <a href="#Open_and_Read_a_File"><tt>OPEN</tt></a></p></div>
<div class="section">
<h3><a name="Create_Flag"></a>Create Flag</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>createflag</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> Enum of possible flags to process while creating a file </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> enumerated strings </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> &lt;empty&gt; </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> Legal combinations of create, overwrite, append and sync_block </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> See note below </td></tr>
</tbody>
</table>
<p>The following combinations are not valid: * append,create * create,append,overwrite</p>
<p>See also: <a href="#Create_and_Write_to_a_File"><tt>CREATE</tt></a></p></div>
<div class="section">
<h3><a name="Create_Parent"></a>Create Parent</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>createparent</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> If the parent directories do not exist, should they be created? </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> boolean </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> true </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> true, false </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> true </td></tr>
</tbody>
</table>
<p>See also: <a href="#Create_a_Symbolic_Link"><tt>CREATESYMLINK</tt></a></p></div>
<div class="section">
<h3><a name="Delegation"></a>Delegation</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>delegation</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The delegation token used for authentication. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> String </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> &lt;empty&gt; </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> An encoded token. </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> See the note below. </td></tr>
</tbody>
</table>
<p><b>Note</b> that delegation tokens are encoded as a URL safe string; see <tt>encodeToUrlString()</tt> and <tt>decodeFromUrlString(String)</tt> in <tt>org.apache.hadoop.security.token.Token</tt> for the details of the encoding.</p>
<p>See also: <a href="#Authentication">Authentication</a></p></div>
<div class="section">
<h3><a name="Destination"></a>Destination</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>destination</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The destination path. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> Path </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> &lt;empty&gt; (an invalid path) </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> An absolute FileSystem path without scheme and authority. </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any path. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Create_a_Symbolic_Link"><tt>CREATESYMLINK</tt></a>, <a href="#Rename_a_FileDirectory"><tt>RENAME</tt></a></p></div>
<div class="section">
<h3><a name="Do_As"></a>Do As</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>doas</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> Allowing a proxy user to do as another user. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> String </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> null </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> Any valid username. </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any string. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Proxy_Users">Proxy Users</a></p></div>
<div class="section">
<h3><a name="Fs_Action"></a>Fs Action</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>fsaction</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> File system operation read/write/execute </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> String </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> null (an invalid value) </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> Strings matching regex pattern &#xa0;&quot;[r-][w-][x-]&#xa0;&quot; </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> &#xa0;&quot;[r-][w-][x-]&#xa0;&quot; </td></tr>
</tbody>
</table>
<p>See also: <a href="#Check_access"><tt>CHECKACCESS</tt></a>,</p></div>
<div class="section">
<h3><a name="Group"></a>Group</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>group</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The name of a group. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> String </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> &lt;empty&gt; (means keeping it unchanged) </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> Any valid group name. </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any string. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Set_Owner"><tt>SETOWNER</tt></a></p></div>
<div class="section">
<h3><a name="Length"></a>Length</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>length</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The number of bytes to be processed. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> long </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> null (means the entire file) </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> &gt;= 0 or null </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any integer. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Open_and_Read_a_File"><tt>OPEN</tt></a></p></div>
<div class="section">
<h3><a name="Modification_Time"></a>Modification Time</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>modificationtime</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The modification time of a file/directory. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> long </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> -1 (means keeping it unchanged) </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> -1 or a timestamp </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any integer. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Set_Access_or_Modification_Time"><tt>SETTIMES</tt></a></p></div>
<div class="section">
<h3><a name="New_Length"></a>New Length</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>newlength</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The size the file is to be truncated to. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> long </td></tr>
<tr class="b">
<td align="left"> Valid Values </td>
<td align="left"> &gt;= 0 </td></tr>
<tr class="a">
<td align="left"> Syntax </td>
<td align="left"> Any long. </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Offset"></a>Offset</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>offset</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The starting byte position. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> long </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> 0 </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> &gt;= 0 </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any integer. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Open_and_Read_a_File"><tt>OPEN</tt></a></p></div>
<div class="section">
<h3><a name="Old_Snapshot_Name"></a>Old Snapshot Name</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>oldsnapshotname</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The old name of the snapshot to be renamed. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> String </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> null </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> An existing snapshot name. </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any string. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Rename_Snapshot"><tt>RENAMESNAPSHOT</tt></a></p></div>
<div class="section">
<h3><a name="Op"></a>Op</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>op</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The name of the operation to be executed. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> enum </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> null (an invalid value) </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> Any valid operation name. </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any string. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Operations">Operations</a></p></div>
<div class="section">
<h3><a name="Overwrite"></a>Overwrite</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>overwrite</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> If a file already exists, should it be overwritten? </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> boolean </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> false </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> true </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> true </td></tr>
</tbody>
</table>
<p>See also: <a href="#Create_and_Write_to_a_File"><tt>CREATE</tt></a></p></div>
<div class="section">
<h3><a name="Owner"></a>Owner</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>owner</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The username who is the owner of a file/directory. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> String </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> &lt;empty&gt; (means keeping it unchanged) </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> Any valid username. </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any string. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Set_Owner"><tt>SETOWNER</tt></a></p></div>
<div class="section">
<h3><a name="Permission"></a>Permission</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>permission</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The permission of a file/directory. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> Octal </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> 644 for files, 755 for directories </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> 0 - 1777 </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any radix-8 integer (leading zeros may be omitted.) </td></tr>
</tbody>
</table>
<p>See also: <a href="#Create_and_Write_to_a_File"><tt>CREATE</tt></a>, <a href="#Make_a_Directory"><tt>MKDIRS</tt></a>, <a href="#Set_Permission"><tt>SETPERMISSION</tt></a></p></div>
<div class="section">
<h3><a name="Recursive"></a>Recursive</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>recursive</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> Should the operation act on the content in the subdirectories? </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> boolean </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> false </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> true </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> true </td></tr>
</tbody>
</table>
<p>See also: <a href="#Rename_a_FileDirectory"><tt>RENAME</tt></a></p></div>
<div class="section">
<h3><a name="Renewer"></a>Renewer</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>renewer</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The username of the renewer of a delegation token. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> String </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> &lt;empty&gt; (means the current user) </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> Any valid username. </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any string. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Get_Delegation_Token"><tt>GETDELEGATIONTOKEN</tt></a></p></div>
<div class="section">
<h3><a name="Replication"></a>Replication</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>replication</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The number of replications of a file. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> short </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> Specified in the configuration. </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> &gt; 0 </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any integer. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Create_and_Write_to_a_File"><tt>CREATE</tt></a>, <a href="#Set_Replication_Factor"><tt>SETREPLICATION</tt></a></p></div>
<div class="section">
<h3><a name="Snapshot_Name"></a>Snapshot Name</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>snapshotname</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The name of the snapshot to be created/deleted. Or the new name for snapshot rename. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> String </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> null </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> Any valid snapshot name. </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any string. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Create_Snapshot"><tt>CREATESNAPSHOT</tt></a>, <a href="#Delete_Snapshot"><tt>DELETESNAPSHOT</tt></a>, <a href="#Rename_Snapshot"><tt>RENAMESNAPSHOT</tt></a></p></div>
<div class="section">
<h3><a name="Sources"></a>Sources</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>sources</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> A list of source paths. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> String </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> &lt;empty&gt; </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> A list of comma separated absolute FileSystem paths without scheme and authority. </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any string. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Concat_Files"><tt>CONCAT</tt></a></p></div>
<div class="section">
<h3><a name="Token"></a>Token</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>token</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The delegation token used for the operation. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> String </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> &lt;empty&gt; </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> An encoded token. </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> See the note in <a href="#Delegation">Delegation</a>. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Renew_Delegation_Token"><tt>RENEWDELEGATIONTOKEN</tt></a>, <a href="#Cancel_Delegation_Token"><tt>CANCELDELEGATIONTOKEN</tt></a></p></div>
<div class="section">
<h3><a name="Token_Kind"></a>Token Kind</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>kind</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The kind of the delegation token requested </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> String </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> &lt;empty&gt; (Server sets the default kind for the service) </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> A string that represents token kind e.g &#x201c;HDFS_DELEGATION_TOKEN&#x201d; or &#x201c;WEBHDFS delegation&#x201d; </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any string. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Get_Delegation_Token"><tt>GETDELEGATIONTOKEN</tt></a></p></div>
<div class="section">
<h3><a name="Token_Service"></a>Token Service</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>service</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The name of the service where the token is supposed to be used, e.g. ip:port of the namenode </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> String </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> &lt;empty&gt; </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> ip:port in string format or logical name of the service </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any string. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Get_Delegation_Token"><tt>GETDELEGATIONTOKEN</tt></a></p></div>
<div class="section">
<h3><a name="Username"></a>Username</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>user.name</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The authenticated user; see <a href="#Authentication">Authentication</a>. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> String </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> null </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> Any valid username. </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any string. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Authentication">Authentication</a></p></div>
<div class="section">
<h3><a name="NoRedirect"></a>NoRedirect</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>noredirect</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> Whether the response should return an HTTP 307 redirect or HTTP 200 OK. See <a href="#Create_and_Write_to_a_File">Create and Write to a File</a>. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> boolean </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> false </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> true </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> true </td></tr>
</tbody>
</table>
<p>See also: <a href="#Create_and_Write_to_a_File">Create and Write to a File</a></p></div>
<div class="section">
<h3><a name="Namespace_Quota"></a>Namespace Quota</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>namespacequota</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> Limit on the namespace usage, i.e., number of files/directories, under a directory. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> String </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> Long.MAX_VALUE </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> &gt; 0. </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any integer. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Set_Quota"><tt>SETQUOTA</tt></a></p></div>
<div class="section">
<h3><a name="Storage_Space_Quota"></a>Storage Space Quota</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>storagespacequota</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> Limit on storage space usage (in bytes, including replication) under a directory. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> String </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> Long.MAX_VALUE </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> &gt; 0. </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any integer. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Set_Quota"><tt>SETQUOTA</tt></a>, <a href="#Set_Quota_By_Storage_Type"><tt>SETQUOTABYSTORAGETYPE</tt></a></p></div>
<div class="section">
<h3><a name="Storage_Type"></a>Storage Type</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>storagetype</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> Storage type of the specific storage type quota to be modified. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> String </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> &lt;empty&gt; </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> Any valid storage type. </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any string. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Set_Quota_By_Storage_Type"><tt>SETQUOTABYSTORAGETYPE</tt></a></p></div>
<div class="section">
<h3><a name="Storage_Policy"></a>Storage Policy</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>storagepolicy</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The name of the storage policy. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> String </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> &lt;empty&gt; </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> Any valid storage policy name; see <a href="#Get_all_Storage_Policies">GETALLSTORAGEPOLICY</a>. </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any string. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Set_Storage_Policy"><tt>SETSTORAGEPOLICY</tt></a></p></div>
<div class="section">
<h3><a name="Erasure_Coding_Policy"></a>Erasure Coding Policy</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>ecpolicy</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The name of the erasure coding policy. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> String </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> &lt;empty&gt; </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> Any valid erasure coding policy name; </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any string. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Enable_EC_Policy"><tt>ENABLEECPOLICY</tt></a> or <a href="#Disable_EC_Policy"><tt>DISABLEECPOLICY</tt></a></p></div>
<div class="section">
<h3><a name="Start_After"></a>Start After</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Name </th>
<th align="left"> <tt>startAfter</tt> </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> Description </td>
<td align="left"> The last item returned in the liststatus batch. </td></tr>
<tr class="a">
<td align="left"> Type </td>
<td align="left"> String </td></tr>
<tr class="b">
<td align="left"> Default Value </td>
<td align="left"> &lt;empty&gt; </td></tr>
<tr class="a">
<td align="left"> Valid Values </td>
<td align="left"> Any valid file/directory name. </td></tr>
<tr class="b">
<td align="left"> Syntax </td>
<td align="left"> Any string. </td></tr>
</tbody>
</table>
<p>See also: <a href="#Iteratively_List_a_Directory"><tt>LISTSTATUS_BATCH</tt></a></p></div></div>
</div>
</div>
<div class="clear">
<hr/>
</div>
<div id="footer">
<div class="xright">
&#169; 2008-2021
Apache Software Foundation
- <a href="http://maven.apache.org/privacy-policy.html">Privacy Policy</a>.
Apache Maven, Maven, Apache, the Apache feather logo, and the Apache Maven project logos are trademarks of The Apache Software Foundation.
</div>
<div class="clear">
<hr/>
</div>
</div>
</body>
</html>