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

Setting Object Properties

Updated on 2025-02-10 GMT+08:00

Function

You can use this command to set properties of an object or set properties of objects in batches by a specified object name prefix.

NOTE:

You can set storage classes only for buckets whose version is 3.0.

Command Line Structure

  • In Windows
    • Setting properties of a single object
      obsutil chattri obs://bucket/key [-meta=aaa:bbb#ccc:ddd] [-sc=xxx] [-acl=xxx] [-aclXml=xxx] [-versionId=xxx] [-fr] [-o=xxx] [-config=xxx] 
    • Setting properties of objects in batches
      obsutil chattri obs://bucket[/key] -r [-f] [-v] [-meta=aaa:bbb#ccc:ddd] [-sc=xxx] [-acl=xxx] [-aclXml=xxx] [-o=xxx] [-j=1] [-config=xxx] 
  • In Linux or macOS
    • Setting properties of a single object
      ./obsutil chattri obs://bucket/key [-meta=aaa:bbb#ccc:ddd] [-sc=xxx] [-acl=xxx] [-aclXml=xxx] [-versionId=xxx] [-fr] [-o=xxx] [-config=xxx] 
    • Setting properties of objects in batches
      ./obsutil chattri obs://bucket[/key] -r [-f] [-v] [-meta=aaa:bbb#ccc:ddd] [-sc=xxx] [-acl=xxx] [-aclXml=xxx] [-o=xxx] [-j=1] [-config=xxx] 

Examples

  • Take the Windows OS as an example, run the obsutil chattri obs://bucket-test/key -acl=public-read command to set the access permission to an object to public read.
    obsutil chattri obs://bucket-test/key -acl=public-read
    Start at 2024-09-30 08:17:15.5572914 +0000 UTC
    
    Set the acl of object [key] in the bucket [bucket-test] to [public-read] successfully, request id [04050000016836DDFA73B2B5320E2651]
  • Take the Windows OS as an example, run the obsutil chattri obs://bucket-test -r -f -acl=public-read command to set the access permission to all objects in the bucket to public read.
    obsutil chattri obs://bucket-test -r -f -acl=public-read
    Start at 2024-09-30 08:18:03.105373 +0000 UTC
    
    [------------------------------------------------] 100.00% tps:155.15 5/5 233ms
    Succeed count:   5         Failed count:    0
    Metrics [max cost:177 ms, min cost:53 ms, average cost:102.40 ms, average tps:20.41]
    Task id: 9d7f73ff-f747-4fdd-9b2a-815ba2dc3b07

Parameter Description

Parameter

Optional or Mandatory

Description

bucket

Mandatory

Bucket name

key

Mandatory when setting properties of an object.

Optional when setting properties of objects in batches.

Indicates the name of the object whose properties are to be set, or the name prefix of objects whose properties are to be set in batches.

NOTE:

If this parameter is left blank during batch operation, properties of all objects in the bucket are set.

meta

Optional (additional parameter)

Standard or custom metadata that can be specified for destination objects in object replication. This parameter should be configured in the following format: key1:value1#key2:value2#key3:value3.

NOTE:
  1. This parameter takes effect only when it is used together with direct.
  2. This value indicates that the destination objects contain three groups of custom metadata: key1:value1, key2:value2, and key3:value3.
  3. Standard metadata headers include Content-Type, Content-Encoding, Cache-Control, Content-Disposition, Content-Language and Expires.

direct

Optional (additional parameter)

Metadata operation indicator.

The value can be REPLACE_NEW or REPLACE.

REPLACE_NEW: The existing metadata value is replaced with a new one, the metadata lacking a value is assigned one, and the metadata not specified keeps unchanged.

REPLACE: The metadata is replaced with the header included in the current request and the metadata not specified is deleted.

NOTE:

This parameter takes effect only when it is used together with meta.

sc

Optional (additional parameter)

Storage classes of objects. Possible values are:

  • standard: Standard storage class. It features low access latency and high throughput, and is applicable to storing frequently accessed data (multiple accesses per month) or data that is smaller than 1 MB.
  • warm: Warm storage class. It is ideal for storing infrequently accessed (less than 12 times a year) data, but when needed, the access has to be fast.
  • cold: Cold storage class. It provides secure, durable, and inexpensive storage for rarely-accessed (once a year) data.
NOTE:

For an object whose storage class is cold, restore the object first and then specify its storage class. To restore an object, see Restoring Objects from the Cold Storage.

acl

Optional (additional parameter)

Access control policies that can be specified for objects. Possible values are:

  • private
  • public-read
  • public-read-write
  • bucket-owner-full-control
NOTE:

The preceding four values indicate private read and write, public read, public read and write, and bucket owner full control.

aclXml

Optional (additional parameter)

Access control policy of the bucket, in XML format.

<AccessControlPolicy>
    <Owner>
        <ID>ownerid</ID>
    </Owner>
    <AccessControlList>
        <Grant>
            <Grantee>
                <ID>userid</ID>
            </Grantee>
            <Permission>[WRITE|WRITE_ACP|READ|READ_ACP|FULL_CONTROL]</Permission>
        </Grant>
        <Grant>
            <Grantee>
                <Canned>Everyone</Canned>
            </Grantee>
            <Permission>[WRITE|WRITE_ACP|READ|READ_ACP|FULL_CONTROL]</Permission>
        </Grant>
    </AccessControlList>
</AccessControlPolicy>
NOTE:
  • Owner: Optional. Specify the object owner's ID.
  • In AccessControlList, the Grant field contains the authorized users. Grantee specifies the IDs of authorized users. Canned specifies the authorized user group (currently, only Everyone is supported).
  • The following permissions can be granted: WRITE (write), WRITE_ACP (write ACL), READ (read), READ_ACP (read ACL), and FULL_CONTROL (full control).
NOTICE:

Because angle brackets (<) and (>) are unavoidably included in the parameter value, you must use quotation marks to enclose them for escaping when running the command. Use single quotation marks for Linux or macOS and quotation marks for Windows.

versionId

Optional when setting properties of an object (additional parameter)

Version ID of the object whose properties are to be set

fr

Optional when setting properties of an object (additional parameter)

Generates an operation result list when setting properties of an object.

f

Optional when setting properties of objects in batches (additional parameter)

Runs in force mode.

r

Mandatory when setting properties of objects in batches (additional parameter)

Sets properties of objects in batches based on a specified object name prefix.

v

Optional when setting properties of objects in batches (additional parameter)

Sets properties of versions of objects in batches based on a specified object name prefix.

o

Optional (additional parameter)

Indicates the folder where operation result lists reside. After the command is executed, result lists (including success and failure files) are generated in the folder. The default value is .obsutil_output, the subfolder in the home directory of the user who executes obsutil commands.

NOTE:
  • The naming rule for result lists is as follows: chattri_{succeed | failed}_report_time_TaskId.txt

    By default, the maximum size of a single result list is 30 MB and the maximum number of result lists that can be retained is 1024. You can set the maximum size and number by configuring recordMaxLogSize and recordBackups in the configuration file.

  • If there are multiple folders and files and you need to confirm the detailed error information about a failed task, refer to the failure list chattri_failed_report_time_TaskId.txt in the result list folder and the log files in the log path.

j

Optional when setting properties of objects in batches (additional parameter)

Indicates the maximum number of concurrent tasks for setting object properties in batches. The default value is the value of defaultJobs in the configuration file.

NOTE:

The value is ensured to be greater than or equal to 1.

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.

NOTE:

Only one from acl, sc, or aclXml can be set for each command.

Response

Refer to Response for uploading an object.

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