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
Help Center/ Object Storage Service/ Tools Guide/ obsutil/ Object Commands/ Listing Objects by Using an Authorization Code

Listing Objects by Using an Authorization Code

Updated on 2024-12-11 GMT+08:00

Function

You can use this command to query objects in a bucket with an authorization code. The returned objects are sorted in lexicographical order.

Command Line Structure

  • In Windows
    • Enter an authorization code directly.
      obsutil share-ls authorization_code [-ac=xxx] [-prefix=xxx] [-s] [-d] [-marker=xxx] [-bf=xxx] [-limit=1] [-format=default] [-config=xxx] [-e=xxx] [-i=xxx] [-k=xxx] [-t=xxx]
    • Use the file path to pass an authorization code.
      obsutil share-ls file://authorization_code_file_url [-ac=xxx] [-prefix=xxx] [-s] [-d] [-marker=xxx] [-bf=xxx] [-limit=1] [-format=default] [-config=xxx] [-e=xxx] [-i=xxx] [-k=xxx] [-t=xxx]
  • In Linux or macOS
    • Enter an authorization code directly.
      ./obsutil share-ls authorization_code [-ac=xxx] [-prefix=xxx] [-s] [-d] [-marker=xxx] [-bf=xxx] [-limit=1] [-config=xxx] [-e=xxx] [-i=xxx] [-k=xxx] [-t=xxx]
    • Use the file path to pass an authorization code.
      ./obsutil share-ls file://authorization_code_file_url [-ac=xxx] [-prefix=xxx] [-s] [-d] [-marker=xxx] [-bf=xxx] [-limit=1] [-config=xxx] [-e=xxx] [-i=xxx] [-k=xxx] [-t=xxx]

Examples

  • In Windows, you can run the obsutil share-ls xxx -ac=123456 -limit=1 command to query objects in a bucket using an authorization code.
    obsutil share-ls xxx -ac=123456 -limit=1
    The authorized prefix is [test/test.tar.gz]
    Listing objects .
    Object list:
    key                                             LastModified                  Size      StorageClass        ETag
    obs://bucket-test/test/test.tar.gz              2019-07-11T14:50:59Z          48.92KB   standard    "1dd27294ad2f152b43cd111e9fe3990f"
    
    Total size of prefix [test/]: 48.92KB
    Folder number: 0
    File number: 1
    The authorized prefix is [test/]
  • In Windows, you can run the obsutil share-ls xxx -ac=123456 -limit=1 command to query directories in a bucket using an authorization code.
    obsutil share-ls xxx -ac=123456 -limit=1
    
    The authorized prefix is [test]
    
    Listing objects .
    
    Folder list:
    obs://bucket-test/test/
    
    Object list:
    key                                             LastModified                  Size      StorageClass        ETag
    obs://bucket-test/test/test.tar.gz              2019-07-11T14:50:59Z          48.92KB   standard    "1dd27294ad2f152b43cd111e9fe3990f"
    
    Total size of prefix [test/]: 48.92KB
    Folder number: 1
    File number: 1
    The authorized prefix is [test/]

Parameter Description

Parameter

Optional or Mandatory

Description

authorization_code

or

file://authorization_code_file_url

Mandatory

Code for authorization

NOTE:

If the authorization code starts with file://, the authorization code is obtained from a local file.

ac

Optional (additional parameter)

Access code

NOTE:
  • If no access code is specified using this parameter, obsutil tool prompts you to enter the access code in interactive mode.
  • An access code is a six-digit string.

prefix

Optional (additional parameter)

Object name prefix specified for listing objects using an authorization code.

NOTE:
  • If this parameter is specified, objects starting with this prefix are listed.
  • If this parameter is left blank, all objects in the authorized path are shared.

s

Optional (additional parameter)

Displays simplified query result.

NOTE:

In the simplified format, the returned result contains only the object name.

d

Optional (additional parameter)

Lists only objects and subdirectories in the current directory, instead of recursively listing all objects and subdirectories.

NOTE:

According to the naming conventions in OBS, a slash (/) is used as the directory separator.

marker

Optional (additional parameter)

Object name to start with when listing objects in a bucket using an authorization code. All objects are listed in lexicographical order by object name.

bf

Optional (additional parameter)

Display formats of bytes in the listing result. Possible values are:

  • human-readable
  • raw
NOTE:

If this parameter is not configured, the display format of bytes in the result is determined by the humanReadableFormat parameter in the configuration file.

limit

Optional (additional parameter)

Maximum number of objects that can be listed. If the value is less than or equal to 0, all objects are listed. If it is left blank, 1000 objects are listed by default.

NOTE:

If there are a large number of objects in a bucket, you are advised to set this parameter to limit the number of objects to be listed each time. If not all objects are listed, marker of the next request will be returned in the result, which you can use to list the remaining objects.

format

Optional (additional parameter)

Prints a listing result in the user-defined format. Currently, the value can only be default, indicating that the listing result is displayed in one row.

config

Optional (additional parameter)

User-defined configuration file for executing the current command. To learn the parameters that can be configured in this file, see Configuration Parameters.

e

Optional (additional parameter)

Specifies the endpoint.

i

Optional (additional parameter)

Specifies the user's AK.

k

Optional (additional parameter)

Specifies the user's SK.

t

Optional (additional parameter)

Specifies the user's security token.

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