Bu sayfa henüz yerel dilinizde mevcut değildir. Daha fazla dil seçeneği eklemek için yoğun bir şekilde çalışıyoruz. Desteğiniz için teşekkür ederiz.

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
On this page

Show all

Methods

Updated on 2024-04-26 GMT+08:00
NOTICE:

If you have any questions during development, post them on the Issues page of GitHub. For details about parameters and usage of each API, see the API Reference.

If problems occur when using the OBS BrowserJS SDK, you can perform the following steps to analyze and locate the problems.

  1. Make sure that the OBS BrowserJS SDK is the latest version. Download the latest version.
  2. Make sure that the program code of the OBS BrowserJS SDK complies with General Examples of ObsClient. All ObsClient APIs are processed with exception handling. The following is an example code of uploading an object:

    // Create an ObsClient instance.
    var obsClient = new ObsClient({
        // Hard-coded or plaintext AK/SK are risky. For security purposes, encrypt your AK/SK and store them in the configuration file or environment variables. In this example, the AK/SK are stored in environment variables for identity authentication. Before running this example, configure environment variables AccessKeyID and SecretAccessKey.
        // The front-end code does not have the process environment variable, so you need to use a module bundler like webpack to define the process variable.
        // Obtain an AK/SK pair on the management console. For details, see https://support.huaweicloud.com/intl/en-us/usermanual-ca/ca_01_0003.html.
        access_key_id: process.env.AccessKeyID,
        secret_access_key: process.env.SecretAccessKey,
        // Replace the example endpoint with the actual one in your case.
        server: 'https://obs.ap-southeast-1.myhuaweicloud.com'
    });
    
    obsClient.putObject({
           Bucket : 'bucketname',
           Key : 'objectname',
           Body : 'Hello OBS'
    }, function (err, result) {
           if(err){
                  // If there are any error messages displayed, there is something wrong with the API call. The common cause is a network exception.
                  console.error('Error-->' + err);
           }else{
                  // If there are no error messages displayed, the API call is complete. Then, check the HTTP status code using the SDK common result.
                  if(result.CommonMsg.Status < 300){// If the HTTP status code is less than 300, and the API call is successful.
                         if(result.InterfaceResult){
                               // Process the business logic after the call is successful.
                               // Optional: After the API is successfully called, record the HTTP status code and request ID returned by the server.
                               console.log('Status-->' + result.CommonMsg.Status);
                               console.log('RequestId-->' + result.CommonMsg.RequestId);
                         }
                  }else{
                         // Recommended: If the call fails, record the HTTP status code, server-side error code, and request ID returned by the server.
                         console.log('Status-->' + result.CommonMsg.Status);
                         console.log('Code-->' + result.CommonMsg.Code); ;
                         console.log('RequestId-->' + result.CommonMsg.RequestId);
                  }
           }
    });
    NOTE:

    You can view the details about the SDK common result objects here.

  3. If there are any error messages, check the network connection between the client and the OBS server first. If the connection is good, provide the error messages to the OBS client O&M team for locating the cause.
  4. If an ObsClient API call fails, obtain the HTTP status code and OBS server-side error code from the SDK common result objects, and compare them to locate the cause.
  5. If the cause cannot be found in step 4, obtain the request ID returned by the OBS server from the SDK common result objects and contact the OBS server O&M team to locate the cause.
  6. If the request ID cannot be obtained from the SDK common result objects, contact the OBS client O&M team to locate the failure cause.

Sitemizi ve deneyiminizi iyileştirmek için çerezleri kullanırız. Sitemizde tarama yapmaya devam ederek çerez politikamızı kabul etmiş olursunuz. Daha fazla bilgi edinin

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback