检测到您已登录华为云国际站账号,为了您更好的体验,建议您访问国际站服务网站 https://www.huaweicloud.com/intl/zh-cn
不再显示此消息
result.InterfaceResult){ console.log('StorageClass-->' + result.InterfaceResult.StorageClass); console.log('RequestId-->' + result.InterfaceResult.RequestId); } } }); To handle the error codes possibly returned during the operation, see OBS
result.CommonMsg.Status); if(result.CommonMsg.Status < 300 && result.InterfaceResult){ console.log('Location-->' + result.InterfaceResult.Location); } } }); To handle the error codes possibly returned during the operation, see OBS
This example uploads string Hello OBS to bucket bucketname as object objectname. The example code is as follows: // Create an instance of ObsClient. var obsClient = new ObsClient({ // Hard-coded or plaintext AK/SK are risky.
function (err, result){ if(err){ console.error('Error-->' + err); }else{ console.log('Status-->' + result.CommonMsg.Status); } }); To handle the error codes possibly returned during the operation, see OBS
result.CommonMsg.Status); if(result.CommonMsg.Status < 300 && result.InterfaceResult){ console.log('VersionStatus-->' + result.InterfaceResult.VersionStatus); } } }); To handle the error codes possibly returned during the operation, see OBS
versionId=versionid' }, function (err, result) { if(err){ console.log('Error-->' + err); }else{ console.log('Status-->' + result.CommonMsg.Status); } }); To handle the error codes possibly returned during the operation, see OBS Server-Side
Scenarios Downloading objects Example 1 2 3 4 5 6 7 GET /object01 HTTP/1.1 User-Agent: curl/7.29.0 Host: examplebucket.obs.region.myhuaweicloud.com Accept: */* Date: WED, 01 Jul 2015 04:24:33 GMT Authorization: OBS H4IPJX0TQTHTHEBQQCEC:NxtSMS0jaVxlLnxlO9awaMTn47s= x-obs-traffic-limit
The bucket created in the previous example is of the default ACL (private), in the OBS Standard storage class, and in the default region.
// require 'obs-autoloader.php'; // Declare the namespace. use Obs\ObsClient; // Create an instance of ObsClient. $obsClient = new ObsClient ( [ //Obtain an AK/SK pair using environment variables or import the AK/SK pair in other ways.
The owner or grantee ID required in the ACL indicates an account ID, which can be viewed on the My Credentials page of OBS Console.
21 22 23 24 25 26 27 28 HTTP/1.1 200 OK Server: OBS x-obs-request-id: BF2600000164363593F10738B80CACBE x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSpngvwC5TskcLGh7Fz5KRmCFIayuY8p Content-Type: application/xml Date: WED, 01 Jul 2015 03:54:36 GMT Content-Length: 825 <?
using a temporary URL generated by the OBS Android SDK, perform the following steps: Call ObsClient.createTemporarySignature to generate a signed URL.
Restrictions To copy an object, you must be the bucket owner or have the required permission (obs:object:PutObject in IAM or PutObject in a bucket policy). For details, see Introduction to OBS Access Control, IAM Custom Policies, and Configuring an Object Policy.
OBS can be used to process images in a stable, secure, efficient, easy to use, and cost-efficient manner.
("Delete bucket lifecycle response: {0}", response.StatusCode); } catch (ObsException ex) { Console.WriteLine("ErrorCode: {0}", ex.ErrorCode); Console.WriteLine("ErrorMessage: {0}", ex.ErrorMessage); } To handle the error codes possibly returned during the operation, see OBS
Console.WriteLine("Delete bucket cors response: {0}", response.StatusCode); } catch (ObsException ex) { Console.WriteLine("ErrorCode: {0}", ex.ErrorCode); Console.WriteLine("ErrorMessage: {0}", ex.ErrorMessage); } To handle the error codes possibly returned during the operation, see OBS
"Delete bucket logging response: {0}", putresponse.StatusCode); } catch (ObsException ex) { Console.WriteLine("ErrorCode: {0}", ex.ErrorCode); Console.WriteLine("ErrorMessage: {0}", ex.ErrorMessage); } To handle the error codes possibly returned during the operation, see OBS
Console.WriteLine("Delete bucket website response: {0}", response.StatusCode); } catch (ObsException ex) { Console.WriteLine("ErrorCode: {0}", ex.ErrorCode); Console.WriteLine("ErrorMessage: {0}", ex.ErrorMessage); } To handle the error codes possibly returned during the operation, see OBS
// require 'obs-autoloader.php'; // Declare the namespace. use Obs\ObsClient; // Create an instance of ObsClient. $obsClient = new ObsClient ( [ //Obtain an AK/SK pair using environment variables or import the AK/SK pair in other ways.
// require 'obs-autoloader.php'; // Declare the namespace. use Obs\ObsClient; // Create an instance of ObsClient. $obsClient = new ObsClient ( [ //Obtain an AK/SK pair using environment variables or import the AK/SK pair in other ways.