检测到您已登录华为云国际站账号,为了您更好的体验,建议您访问国际站服务网站 https://www.huaweicloud.com/intl/zh-cn
不再显示此消息
Each time you want to send an HTTP/HTTPS request to OBS, you must create an instance of ObsClient. Sample code is as follows: // 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.
OBS Android SDK provides the logging function based on the java.util.logging library. You can use LogConfigurator.enableLog to enable or use LogConfigurator.disableLog to disable the logging function. Sample code is as follows: // Set the log level.
ObsClient obsClient = new ObsClient(ak, sk, endPoint); // Leave the logging settings in blank. obsClient.setBucketLogging("bucketname", new BucketLoggingConfiguration()); To handle the error codes possibly returned during the operation, see OBS Server-Side Error Codes.
ObsClient obsClient = new ObsClient(ak, sk, endPoint); obsClient.deleteBucketWebsite("bucketname"); To handle the error codes possibly returned during the operation, see OBS Server-Side Error Codes. Parent topic: Static Website Hosting
// 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.
Each time you want to send an HTTP/HTTPS request to OBS, you must create an instance of ObsClient. Sample code is as follows: // Create an instance of ObsClient. var obsClient = new ObsClient({ // Hard-coded or plaintext AK/SK are risky.
The following table lists APIs related to server-side encryption: Method in OBS Java SDK Description Supported Encryption Type ObsClient.putObject Sets the encryption algorithm and key during object upload to enable server-side encryption.
It is provided for the OBS server to verify data integrity. The OBS server will compare this MD5 value with the MD5 value calculated based on the object data. If the two values are not the same, HTTP status code 400 is returned.
For details, see Introduction to OBS Access Control, IAM Custom Policies, and Creating a Custom Bucket Policy. The mapping between OBS regions and endpoints must comply with what is listed in Regions and Endpoints.
Restrictions To configure an object ACL, you must be the bucket owner or have the required permission (obs:object:PutObjectAcl in IAM or PutObjectAcl in a bucket policy). For details, see Introduction to OBS Access Control, IAM Custom Policies, and Configuring an Object Policy.
Restrictions To list buckets, you must have the obs:bucket:ListAllMyBuckets permission. IAM is recommended for granting permissions. For details, see IAM Custom Policies. The mapping between OBS regions and endpoints must comply with what is listed in Regions and Endpoints.
Operation HTTP Request Method (Value in OBS .NET SDK) Sub-resource (Value in OBS .NET SDK) Bucket Name Required Object Name Required PUT Bucket HttpVerb.PUT N/A Yes No GET Buckets HttpVerb.GET N/A No No DELETE Bucket HttpVerb.DELETE N/A Yes No GET Objects HttpVerb.GET N/A Yes No GET
Restrictions To upload 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.
server: 'https://obs.ap-southeast-1.myhuaweicloud.com' }); // Configure logging for the bucket. obsClient.setBucketLogging({ Bucket:'bucketname', // Name of the OBS agency created by the owner of the target bucket on IAM.
If there is no such a default master key, OBS will create one and use it by default.
For details, see Introduction to OBS Access Control, IAM Custom Policies, and Configuring an Object Policy. The mapping between OBS regions and endpoints must comply with what is listed in Regions and Endpoints.
For details, see Introduction to OBS Access Control, IAM Custom Policies, and Configuring an Object Policy. The mapping between OBS regions and endpoints must comply with what is listed in Regions and Endpoints.
Restrictions To process and download an image, you must be the bucket owner or have the required permission (obs:object:GetObject in IAM or GetObject in a bucket policy). For details, see Introduction to OBS Access Control, IAM Custom Policies, and Configuring an Object Policy.
For details, see Introduction to OBS Access Control, IAM Custom Policies, and Configuring an Object Policy. The mapping between OBS regions and endpoints must comply with what is listed in Regions and Endpoints.
Use the Gradle of Android Studio to download and install the OBS Android SDK. The procedure is as follows: Open Android Studio. Click Start a new Android Studio project to go to the page for creating a project.