检测到您已登录华为云国际站账号,为了您更好的体验,建议您访问国际站服务网站 https://www.huaweicloud.com/intl/zh-cn
不再显示此消息
OBS can be used to process images in a stable, secure, efficient, easy to use, and cost-efficient manner.
For details, see https://support.huaweicloud.com/intl/en-us/usermanual-ca/ca_01_0003.html. option.bucket_options.access_key = getenv("ACCESS_KEY_ID"); option.bucket_options.secret_access_key = getenv("SECRET_ACCESS_KEY"); option.bucket_options.token = getenv("SecurityToken"); OBS
Public services, such as Elastic Cloud Server (ECS), Elastic Volume Service (EVS), Object Storage Service (OBS), Virtual Private Cloud (VPC), Elastic IP (EIP), and Image Management Service (IMS), are shared within the same region.
The mapping between OBS regions and endpoints must comply with what is listed in Regions and Endpoints.
For details about how to obtain the value of securityToken, see Setting Up an OBS Environment.
The OBS server automatically clears expired objects. The object expiration time set in the preceding method takes precedence over the bucket lifecycle rule. Parent topic: Object Upload
Console.WriteLine("rule maxAgeSeconds is: {0}\n", rule.MaxAgeSeconds); } } 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.
Procedure In the navigation pane of OBS Console, choose Object Storage. In the bucket list, click the bucket you want to operate. The Objects page is displayed. Click Configure Static Website Hosting. The Configure Static Website Hosting dialog box is displayed. Enable Status.
httpGet.addHeader("Authorization", "OBS " + accessKey + ":" + signature); CloseableHttpResponse httpResponse = httpClient.execute(httpGet); // Prints the sending request information and the received response message.
Restrictions To create a bucket, you must have the obs:bucket:CreateBucket 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.
Parameter Description Method in OBS iOS SDK responseContentType Rewrites Content-Type in HTTP/HTTPS responses. request.responseContentType responseContentLanguage Rewrites Content-Language in HTTP/HTTPS responses. request.responseContentLanguage responseExpires Rewrites Expires in
request.bucketCORSRuleList addObject:rule]; [client setBucketCORS:request completionHandler:^(OBSSetBucketCORSResponse *response, NSError *error) { NSLog(@"%@",response); }]; For details about the meanings, causes, and handling methods of possible error codes returned during the operation, see OBS
For example, an OBS client uploads localfile to bucketname as objectname. The example code is as follows: // You can reserve only one global instance of ObsClient in your project. // ObsClient is thread-safe and can be simultaneously used by multiple threads.
If the bucket is in the OBS Infrequent Access or Archive storage class, it cannot be used as the target bucket. Enabling Bucket Logging Sample code: // Hard-coded or plaintext AK/SK are risky.
You can set the following conditions: Parameter Description Property in OBS .NET SDK If-Modified-Since Returns the object if it has been modified since the specified time; otherwise, an error is returned.
Get 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
GroupGrantee.ALL_USERS, Permission.PERMISSION_READ); // Set the ACL for the object version. obsClient.setObjectAcl("bucketname", "objectname", acl, "versionid"); The owner or grantee ID needed in the ACL indicates the account ID, which can be viewed on the My Credentials page of 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.
The OBS server automatically clears expired objects. The object expiration time set in this mode takes precedence over the bucket lifecycle rule. Parent topic: Object Upload