tencent cloud

Cloud Object Storage

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Overview
Features
Use Cases
Strengths
Concepts
Regions and Access Endpoints
Specifications and Limits
Service Regions and Service Providers
Billing
Billing Overview
Billing Method
Billable Items
Free Tier
Billing Examples
Viewing and Downloading Bill
Payment Overdue
FAQs
Getting Started
Console
Getting Started with COSBrowser
User Guide
Creating Request
Bucket
Object
Data Management
Batch Operation
Global Acceleration
Monitoring and Alarms
Operations Center
Data Processing
Content Moderation
Smart Toolbox
Data Processing Workflow
Application Integration
User Tools
Tool Overview
Installation and Configuration of Environment
COSBrowser
COSCLI (Beta)
COSCMD
COS Migration
FTP Server
Hadoop
COSDistCp
HDFS TO COS
GooseFS-Lite
Online Tools
Diagnostic Tool
Use Cases
Overview
Access Control and Permission Management
Performance Optimization
Accessing COS with AWS S3 SDK
Data Disaster Recovery and Backup
Domain Name Management Practice
Image Processing
Audio/Video Practices
Workflow
Direct Data Upload
Content Moderation
Data Security
Data Verification
Big Data Practice
COS Cost Optimization Solutions
Using COS in the Third-party Applications
Migration Guide
Migrating Local Data to COS
Migrating Data from Third-Party Cloud Storage Service to COS
Migrating Data from URL to COS
Migrating Data Within COS
Migrating Data Between HDFS and COS
Data Lake Storage
Cloud Native Datalake Storage
Metadata Accelerator
GooseFS
Data Processing
Data Processing Overview
Image Processing
Media Processing
Content Moderation
File Processing Service
File Preview
Troubleshooting
Obtaining RequestId
Slow Upload over Public Network
403 Error for COS Access
Resource Access Error
POST Object Common Exceptions
API Documentation
Introduction
Common Request Headers
Common Response Headers
Error Codes
Request Signature
Action List
Service APIs
Bucket APIs
Object APIs
Batch Operation APIs
Data Processing APIs
Job and Workflow
Content Moderation APIs
Cloud Antivirus API
SDK Documentation
SDK Overview
Preparations
Android SDK
C SDK
C++ SDK
.NET(C#) SDK
Flutter SDK
Go SDK
iOS SDK
Java SDK
JavaScript SDK
Node.js SDK
PHP SDK
Python SDK
React Native SDK
Mini Program SDK
Error Codes
Harmony SDK
Endpoint SDK Quality Optimization
Security and Compliance
Data Disaster Recovery
Data Security
Cloud Access Management
FAQs
Popular Questions
General
Billing
Domain Name Compliance Issues
Bucket Configuration
Domain Names and CDN
Object Operations
Logging and Monitoring
Permission Management
Data Processing
Data Security
Pre-signed URL Issues
SDKs
Tools
APIs
Agreements
Service Level Agreement
Privacy Policy
Data Processing And Security Agreement
Contact Us
Glossary
DokumentasiCloud Object StorageUser ToolsCOSCLI (Beta)Common CommandsGenerating and Modifying Configuration Files - config

Generating and Modifying Configuration Files - config

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2025-11-14 15:30:16

Command format

The config command is used to generate and modify the configuration file:
./coscli config [command] [flag]
Note:
If you have set the configuration items correctly, you can run ./coscli config show to view the configurations.
For more general options for this command (such as switching buckets or user accounts), see General Options.
The generated configuration file uses the HTTPS protocol by default. If you want to change it to HTTP, directly modify it in the configuration file.
config includes the following sub-commands:
Command
Description
add
Adds a new bucket configuration.
delete
Deletes an existing bucket configuration.
init
Generates the configuration file interactively.
set
Modify one or more configuration items in the base group of the configuration file. The base group includes secretid, secretkey, sessiontoken, mode, and cvmrolename information.
show
Prints information in a specific configuration file.
config and its sub-commands include the following optional flags:
Flag Abbreviation
Flag Name
Description
-h
--help
View the detailed usage of this command.
-c
--config-path
Path of the configuration file to use.
The config add sub-command includes the following optional flags:
Flag Abbreviation
Flag Name
Description
-h
--help
View the detailed usage of this command.
-a
--alias
Bucket alias.
-b
--bucket
Bucket name.
-r
--region
Region of the bucket.
-o
--ofs
Metadata acceleration bucket flag. For more information, see Metadata Acceleration Overview.
Note:
If you need to specify the bucket endpoint, you can use the general flag -e or --endpoint. For more information, see General Options Introduction.
The config delete sub-command includes the following optional flags:
Flag Abbreviation
Flag Name
Description
-h
--help
View the detailed usage of this command.
-a
--alias
Bucket alias.
The config set sub-command includes the following optional flags:
Flag Abbreviation
Flag Name
Description
-h
--help
View the detailed usage of this command.
None
--secret_id
Sets the secret ID, which can be created and obtained from the CAM console.
None
--secret_key
Sets the secret key, which can be created and obtained from the CAM console.
-t
--session_token
Sets the temporary key token. For more information on temporary key, see Accessing COS Using a Temporary Key.
None
--mode
Set the identity mode, supporting enumeration values SecretKey and CvmRole. It can be empty, with a default value of SecretKey, which means using a key to request COS. When the mode is CvmRole, it means using manage instance role to request COS.
None
--cvm_role_name
Set the CVM role instance name. For details, see manage instance role.
None
--close_auto_switch_host
Set whether to close automatic switching of the backup domain. Available values: true, false. Can be left blank.
If not set or the value is false, the domain name will be switched.
If set to true, the domain name will not be switched.
None
--disable_encryption
Set to turn off key encryption. It defaults to false. If set to true, the key-related information in the configuration file will be unencrypted.
None
--disable_auto_fetch_bucket_type
Set whether to disable automatically obtaining the bucket type. Available values: true, false.
If not set or set to false, the bucket type will be obtained automatically (ensure the account used has cos:HeadBucket permission).
If set to true, the bucket type will not be obtained automatically and the bucket type in the user profile will be used (for example, if the Bucket Configuration item ofs in the configuration file is set to true, the bucket type is ofs; if set to false, the bucket type is cos).

Sample

Adding a new bucket configuration

./coscli config add -b examplebucket3-1250000000 -r ap-chengdu -e cos.ap-chengdu.myqcloud.com -a bucket3

Deleting an existing bucket configuration

./coscli config delete -a bucket3

Modifying session-token in the default configuration file

./coscli config set --session_token test-token123

Printing information in a specific configuration file

./coscli config show -c /your/config/path.yaml

Modifying mode and cvmrolename in the default configuration file

./coscli config set --mode CvmRole --cvm_role_name testName


Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan