El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Obtaining Files from a Specified Directory

Updated on 2022-12-08 GMT+08:00

Function

This API is used to obtain the list of files from a specified directory in an MRS cluster.

URI

  • Format

    GET /v2/{project_id}/clusters/{cluster_id}/files?path={directory}&offset={offset}&limit={limit}&sort_key={sort_key}&order={order}

  • URI parameter description
    Table 1 URI parameter description

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Project ID. For details on how to obtain the project ID, see Obtaining a Project ID.

    cluster_id

    Yes

    Cluster ID For details on how to obtain the cluster ID, see Obtaining a Cluster ID.

    path

    Yes

    File directory. For example, to access the /tmp/test directory list, the directory must be a directory. The overall URI is as follows:

    /v2/{project_id}/clusters/{cluster_id}/files?path=%2Ftmp%2Ftest

    A single-level directory must comply with the following rules:

    1. The directory path cannot be left blank.
    2. The value cannot start or end with a period (.).
    3. The value cannot contain the following characters: /:*?"<>|\;&,'`!{}[]$%+
    4. The value cannot exceed 255 characters.

    offset

    No

    Pagination parameter. The file list is queried from the offset. The default value is 0.

    limit

    No

    Pagination parameter, indicating the maximum number of records on a page. The default value is 100 and the maximum value is 1000.

    sort_key

    No

    The list is sorted by this attribute. The following attributes are supported:

    • path_suffix: file or directory name
    • length: file size
    • modification_time: modification time

    The default value is path_suffix, indicating that files or directories are sorted by file or directory name.

    order

    No

    List sorting mode:

    • desc: Files are displayed in the descending order.
    • asc: Files are displayed in ascending order.

    The default value is desc.

Request

Request parameters

None.

Response

Table 2 Response parameter description

Parameter

Type

Description

total_count

Integer

Total number of files, which is irrelevant to pagination.

files

Array of FileStatus

File list. For details, see Table 3.

Table 3 FileStatus description

Parameter

Type

Description

path_suffix

String

File name extension in the current directory. For example, if you obtain the /tmp/test file in the /tmp directory, the value of path_suffix is test.

owner

String

File owner.

group

String

File owner group.

permission

String

Permission information.

replication

Integer

Number of replicas.

block_size

Integer

Block size.

length

Integer

File length.

type

String

The following file types are supported:

  • FILE: file
  • DIRECTORY: directory

children_num

Integer

Number of files in the directory.

access_time

Long

File access time.

modification_time

Long

File modification time

Example

  • Example request

    None.

  • Example response
    • Example of a successful response
      {
          "total_count": 2,
          "files": [
              {
                  "access_time": 0,
                  "block_size": 0,
                  "children_num": 0,
                  "group": "hadoop",
                  "length": 0,
                  "modification_time": 1587179516623,
                  "owner": "hdfs",
                  "path_suffix": "app-logs",
                  "permission": "777",
                  "replication": 0,
                  "type": "DIRECTORY"
              },
              {
                  "access_time": 1587267212761,
                  "block_size": 134217728,
                  "children_num": 0,
                  "group": "hadoop",
                  "length": 23666188,
                  "modification_time": 1587222156003,
                  "owner": "root",
                  "path_suffix": "data-m-00000",
                  "permission": "644",
                  "replication": 3,
                  "type": "FILE"
              }
          ]
      }
      

Status Code

For details about status codes, see Status Codes.

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback