华为云用户手册

  • 功能介绍 复制对象(Copy Object)特性用来为OBS上已经存在的对象创建一个副本。 当进行复制对象操作时,目标对象默认复制源对象的元数据;用户也可以将目标对象的元数据替换为本次请求中所带的元数据。新建的目标对象不会复制源对象的ACL信息,默认的新建对象的ACL是private,用户可以使用设置ACL的操作接口来重新设定新对象的ACL。 复制对象操作的请求需要通过头域携带拷贝的原桶和对象信息,不能携带消息实体。 该操作支持服务端加密功能。 目标对象大小范围是[0, 5GB],如果源对象大小超过5GB,只能使用拷贝段功能拷贝部分对象。 复制对象的结果不能仅根据HTTP返回头域中的status_code来判断请求是否成功,头域中status_code返回200时表示服务端已经收到请求,且开始处理复制对象请求。复制是否成功会在响应消息的body中,只有body体中有ETag标签才表示成功,否则表示复制失败。
  • 对象标签 可以通过携带头域x-obs-tagging-directive指定对象标签的复制策略。也可在对象复制完成后,重新设置对象标签。 复制对象时,如果需要复制源对象的标签,则需拥有源对象的GetObjectTagging权限;如果需要复制某一个版本源对象的标签,则需拥有源对象的GetObjectTagging+GetObjectVersionTagging权限。可通过对象ACL或桶策略授权。 复制对象时,如果需要设置目标对象的标签,则需拥有目标对象的PutObjectTagging权限;如果需要设置某一个版本目标对象的标签,则需拥有目标对象的PutObjectTagging+PutObjectVersionTagging权限。可通过桶ACL或桶策略授权。
  • 请求消息样式 1 2 3 4 5 6 7 8 9 10 PUT /destinationObjectName HTTP/1.1 Host: bucketname.obs.cn-north-4.myhuaweicloud.com x-obs-copy-source: /sourceBucket/sourceObject x-obs-metadata-directive: metadata_directive x-obs-copy-source-if-match: etag x-obs-copy-source-if-none-match: etag x-obs-copy-source-if-unmodified-since: time_stamp x-obs-copy-source-if-modified-since: time_stamp Authorization: signature Date: date
  • 响应示例:设置对象过期时间 HTTP/1.1 204 No Content Server: OBS Date: Thu, 15 Jun 2023 12:39:03 GMT Connection: keep-alive Location: http://examplebucket.obs.cn-north-4.myhuaweicloud.com/my-obs-object-key-demo x-obs-expiration: expiry-date="Tue, 20 Jun 2023 00:00:00 GMT" ETag: "d41d8cd98f00b204e9800998ecf8427e" x-obs-request-id: 00000188BF11049553064911000FC30D x-obs-id-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAA BCS wj2PcBE0YcoLHUDO7GSj+rVByzjflA x-forward-status: 0x40020000000001 x-dae-api-type: REST.POST.OBJECT
  • 请求示例:指定状态码 指定成功响应的状态码为200 POST /srcbucket HTTP/1.1 User-Agent: PostmanRuntime/7.26.8 Accept: */* Postman-Token: 667dcc44-1c48-41ba-9e41-9f87d8975089 Host: obs.cn-north-4.myhuaweicloud.com Accept-Encoding: gzip, deflate, br Connection: keep-alive Content-Type: multipart/form-data; boundary=--------------------------285613759795901770404350 Content-Length: 1134 ----------------------------285613759795901770404350 Content-Disposition: form-data; name="key" obj ----------------------------285613759795901770404350 Content-Disposition: form-data; name="ObsAccessKeyId" XXXXXXXXXXXXXXX000003 ----------------------------285613759795901770404350 Content-Disposition: form-data; name="signature" 9rc4bVhDPQ7eHtw17hWtYxLnBWU= ----------------------------285613759795901770404350 Content-Disposition: form-data; name="policy" eyJleHBpcmF0aW9uIjoiMjAyMy0wNi0xNVQxNDoxMTozNFoiLCAiY29uZGl0aW9ucyI6W3siYnVja2V0Ijoic3JjYnVja2V0MiJ9LHsic3VjY2Vzc19hY3Rpb25fc3RhdHVzIjoiMjAwIn0seyJjb250ZW50LXR5cGUiOiJ0ZXh0L3BsYWluIn0seyJrZXkiOiIzMzMifSxdfQ== ----------------------------285613759795901770404350 Content-Disposition: form-data; name="success_action_status" 200 ----------------------------285613759795901770404350 Content-Disposition: form-data; name="file"; filename="test.txt" Content-Type: text/plain ----------------------------285613759795901770404350 Content-Disposition: form-data; name="submit" Upload to OBS ----------------------------285613759795901770404350--
  • 响应示例:指定状态码 指定成功响应的状态码为200,响应消息 HTTP/1.1 200 OK Server: OBS Date: Thu, 15 Jun 2023 13:12:51 GMT Content-Length: 0 Connection: keep-alive Location: http://obs.cn-north-4.myhuaweicloud.com/srcbucket/obj ETag: "d41d8cd98f00b204e9800998ecf8427e" x-obs-request-id: 00000188BF2FF55F5306426E000FE366 x-obs-id-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAAB CS cDjcXgZ7oMYSVnZnk4+HrClVwLVPTi x-forward-status: 0x40020000000001 x-dae-api-type: REST.POST.OBJECT
  • 请求示例:上传时配置对象级WORM保护策略 POST /srcbucket HTTP/1.1 User-Agent: PostmanRuntime/7.26.8 Accept: */* Postman-Token: 4c2f4c7e-2e0b-46c0-b1a7-4a5da560b6a1 Host: obs.cn-north-4.myhuaweicloud.com Accept-Encoding: gzip, deflate, br Connection: keep-alive Content-Type: multipart/form-data; boundary=--------------------------940435396775653808840608 Content-Length: 1409 ----------------------------940435396775653808840608 Content-Disposition: form-data; name="key" obj ----------------------------940435396775653808840608 Content-Disposition: form-data; name="ObsAccessKeyId" XXXXXXXXXXXXXXX000003 ----------------------------940435396775653808840608 Content-Disposition: form-data; name="signature" X/7QiyMYUvxUWk0R5fToeTcgMMU= ----------------------------940435396775653808840608 Content-Disposition: form-data; name="policy" eyJleHBpcmF0aW9uIjoiMjAyMy0wNi0xNVQxNDoyMjo1MVoiLCAiY29uZGl0aW9ucyI6W3sieC1vYnMtb2JqZWN0LWxvY2stcmV0YWluLXVudGlsLWRhdGUiOiJUaHUsIDIwIEp1biAyMDIzIDEzOjEyOjUxIEdNVCJ9LHsieC1vYnMtb2JqZWN0LWxvY2stbW9kZSI6IkNPTVBMSUFOQ0UifSx7ImJ1Y2tldCI6InNyY2J1Y2tldDIifSx7ImNvbnRlbnQtdHlwZSI6InRleHQvcGxhaW4ifSx7ImtleSI6IjMzMyJ9LF19 ----------------------------940435396775653808840608 Content-Disposition: form-data; name="x-obs-object-lock-mode" COMPLIANCE ----------------------------940435396775653808840608 Content-Disposition: form-data; name="x-obs-object-lock-retain-until-date" Thu, 20 Jun 2023 13:12:51 GMT ----------------------------940435396775653808840608 Content-Disposition: form-data; name="file"; filename="test.txt" Content-Type: text/plain ----------------------------940435396775653808840608 Content-Disposition: form-data; name="submit" Upload to OBS ----------------------------940435396775653808840608--
  • 请求示例:设置对象过期时间 POST / HTTP/1.1 Date: WED, 01 Jul 2015 04:15:23 GMT Host: examplebucket.obs.cn-north-4.myhuaweicloud.com Content-Type: multipart/form-data; boundary=148828969260233905620870 Content-Length: 1639 Origin: www.example.com Access-Control-Request-Headers:acc_header_1 --148828969260233905620870 Content-Disposition: form-data; name="key" object01 --148828969260233905620870 Content-Disposition: form-data; name="ObsAccessKeyId" 55445349414d5354554254455354303030303033 --148828969260233905620870 Content-Disposition: form-data; name="signature" 396246666f6f42793872792f7a3958524f6c44334e4e69763950553d--7db143f50da2 --148828969260233905620870 Content-Disposition: form-data; name="policy" 65794a6c65484270636d463061573975496a6f694d6a41794d7930774e6930784e565178... --148828969260233905620870 Content-Disposition: form-data; name="x-obs-expires" 4 --148828969260233905620870 Content-Disposition: form-data; name="file"; filename="test.txt" Content-Type: text/plain 01234567890 --148828969260233905620870 Content-Disposition: form-data; name="submit" Upload --148828969260233905620870--
  • 请求示例:使用token进行鉴权 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 POST / HTTP/1.1 Content-Type:multipart/form-data; boundary=9431149156168 Content-Length: 634 Host: examplebucket.obs.cn-north-4.myhuaweicloud.com --9431149156168 Content-Disposition: form-data; name="key" obj01 --9431149156168 Content-Disposition: form-data; name="token" UDS IAM STUBTEST002538:XsVcTzR2/A284oE4VH9qPndGcuE=:eyJjb25kaXRpb25zIjogW3siYnVja2V0IjogInRlc3QzMDAzMDU4NzE2NjI2ODkzNjcuMTIifSwgeyJDb250ZW50LVR5cGUiOiAiYXBwbGljYXRpb24veG1sIn0sIFsiZXEiLCAiJGtleSIsICJvYmoudHh0Il1dLCAiZXhwaXJhdGlvbiI6ICIyMDIyLTA5LTA5VDEyOjA5OjI3WiJ9 --9431149156168 Content-Disposition: form-data; name="file"; filename="myfile" Content-Type: text/plain 01234567890 --9431149156168-- Content-Disposition: form-data; name="submit" Upload to OBS
  • 响应示例:带x-obs-acl头域并指定存储类型 1 2 3 4 5 6 7 HTTP/1.1 204 No Content Server: OBS Location: http://examplebucket.obs.cn-north-4.myhuaweicloud.com/my-obs-object-key-demo ETag: "17a83fc8d431273405bd266114b7e034" x-obs-request-id: 5DEB00000164A728A7C7F4E032214CFA x-obs-id-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCSwj2PcBE0YcoLHUDO7GSj+rVByzjflA Date: Tue, 17 Jul 2018 07:33:36 GMT
  • 响应示例:使用token进行鉴权 1 2 3 4 5 6 7 HTTP/1.1 204 No Content Server: OBS Location: http://examplebucket.obs.cn-north-4.myhuaweicloud.com/my-obs-object-key-demo ETag: "7eda50a430fed940023acb9c4c6a2fff" x-obs-request-id: 000001832010443D80F30B649B969C47 x-obs-id-2: 32AAAUgAIAABAAAQAAEAABAAAQAAEAABCTj0yO9KJd5In+i9pzTgCDVG9vMnk7O/ Date: Fri,09Sep 2022 02: 24:40 GMT
  • 响应示例:上传时配置对象级WORM保护策略 HTTP/1.1 204 No Content Server: OBS Date: Thu, 15 Jun 2023 13:24:03 GMT Connection: keep-alive Location: http://obs.cn-north-4.myhuaweicloud.com/srcbucket/obj ETag: "d41d8cd98f00b204e9800998ecf8427e" x-obs-request-id: 00000188BF3A36EE5306427D000FEE0A x-obs-id-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCS/5pj0p0hAQcDVI3B6E5y167zy4eAQv x-forward-status: 0x40020000000001 x-dae-api-type: REST.POST.OBJECT
  • 请求消息头 该请求使用公共的消息头,具体请参见表3。 如果想要获取CORS配置信息,则需要使用的消息头如下表1所示。 表1 获取CORS配置的请求消息头 消息头名称 消息头类型 是否必选 描述 Origin String 是 参数解释: 预请求指定的跨域请求Origin(通常为 域名 )。 约束限制: 无 取值范围: 符合http协议的该头域的取值。 默认取值: 无 Access-Control-Request-Headers String 否 参数解释: 实际请求可以带的HTTP头域,可以带多个头域。 约束限制: 无 取值范围: 符合http协议的该头域的取值。 默认取值: 无 配置后如果仍然提示跨域,请参考为什么配置了跨域资源共享(CORS)仍然报错处理。
  • 请求示例:普通POST上传 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 POST / HTTP/1.1 Date: WED, 01 Jul 2015 04:15:23 GMT Host: examplebucket.obs.cn-north-4.myhuaweicloud.com Content-Type: multipart/form-data; boundary=7db143f50da2 Content-Length: 2424 Origin: www.example.com Access-Control-Request-Headers:acc_header_1 --7db143f50da2 Content-Disposition: form-data; name="key" object01 --7db143f50da2 Content-Disposition: form-data; name="acl" public-read --7db143f50da2 Content-Disposition: form-data; name="content-type" text/plain --7db143f50da2 Content-Disposition: form-data; name="expires" WED, 01 Jul 2015 04:16:15 GMT --7db143f50da2 Content-Disposition: form-data; name="AccessKeyId" 14RZT432N80TGDF2Y2G2 --7db143f50da2 Content-Disposition: form-data; name="policy" ew0KICAiZXhaaXJhdGlvbiI6ICIyMDE1LTA3LTAxVDEyOjAwOjAwLjAwMFoiLA0KICAiY29uZGl0aW9ucyI6IFsNCiAgICB7ImJ1Y2tldCI6ICJleG1hcGxlYnVja2V0IiB9LA0KICAgIHsiYWNsIjogInB1YmxpYy1yZWFkIiB9LA0KICAgIHsiRXhaaXJlcyI6ICIxMDAwIiB9LA0KICAgIFsiZXEiLCAiJGtleSIsICJvYmplY3QwMSJdLA0KICAgIFsic3RhcnRzLXdpdGgiLCAiJENvbnRlbnQtVHlwZSIsICJ0ZXh0LyJdLA0KICBdDQp9DQo= --7db143f50da2 Content-Disposition: form-data; name="signature" Vk6rwO0Nq09BLhvNSIYwSJTRQ+k= --7db143f50da2 Content-Disposition: form-data; name="x-obs-persistent-headers" test:dmFsdWUx --7db143f50da2 Content-Disposition: form-data; name="x-obs-grant-read" id=52f24s3593as5730ea4f722483579xxx --7db143f50da2 Content-Disposition: form-data; name="x-obs-server-side-encryption" kms --7db143f50da2 Content-Disposition: form-data; name="x-obs-website-redirect-location" http://www.example.com/ --7db143f50da2 Content-Disposition: form-data; name="file"; filename="C:\Testtools\UpLoadFiles\object\1024Bytes.txt" Content-Type: text/plain 01234567890 --7db143f50da2 Content-Disposition: form-data; name="submit" Upload --7db143f50da2--
  • 响应示例:普通POST上传 桶配置cors后,响应会包含Access-Control-*的信息。 1 2 3 4 5 6 7 8 9 10 11 12 HTTP/1.1 204 No Content x-obs-request-id: 90E2BA00C26C00000133B442A90063FD x-obs-id-2: OTBFMkJBMDBDMjZDMDAwMDAxMzNCNDQyQTkwMDYzRkRBQUFBQUFBQWJiYmJiYmJi Access-Control-Allow-Origin: www.example.com Access-Control-Allow-Methods: POST,GET,HEAD,PUT Access-Control-Allow-Headers: acc_header_01 Access-Control-Max-Age: 100 Access-Control-Expose-Headers: exp_header_01 Content-Type: text/xml Location: http://examplebucket.obs.cn-north-4.myhuaweicloud.com/object01 Date: WED, 01 Jul 2015 04:15:23 GMT ETag: "ab7abb0da4bca5323ab6119bb5dcd296"
  • 请求示例:带x-obs-acl头域并指定存储类型 带x-obs-acl头域并指定存储类型,重定向头域,上传对象 编码前,policy的内容为 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 { "expiration":"2018-07-17T04:54:35Z", "conditions":[ { "content-type":"text/plain" }, { "x-obs-storage-class":"WARM" }, { "success_action_redirect":"http://www.example.com" }, { "x-obs-acl":"public-read" }, [ "starts-with", "$bucket", "" ], [ "starts-with", "$key", "" ] ] } 请求示例: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 POST / HTTP/1.1 Host: examplebucket.obs.cn-north-4.myhuaweicloud.com Accept-Encoding: identity Content-Length: 947 Content-Type: multipart/form-data; boundary=9431149156168 User-Agent: OBS/Test --9431149156168 Content-Disposition: form-data; name="x-obs-acl" public-read --9431149156168 Content-Disposition: form-data; name="AccessKeyId" H4IPJX0TQTHTHEBQQCEC --9431149156168 Content-Disposition: form-data; name="key" my-obs-object-key-demo --9431149156168 Content-Disposition: form-data; name="signature" WNwv8P1ZiWdqPQqjXeLmAfzPDAI= --9431149156168 Content-Disposition: form-data; name="policy" eyJleHBpcmF0aW9uIjoiMjAxOC0wNy0xN1QwODozNDoyM1oiLCAiY29uZGl0aW9ucyI6W3siY29udGVudC10eXBlIjoidGV4dC9wbGFpbiJ9LHsieC1vYnMtYWNsIjoicHVibGljLXJlYWQifSxbInN0YXJ0cy13aXRoIiwgIiRidWNrZXQiLCAiIl0sWyJzdGFydHMtd2l0aCIsICIka2V5IiwgIiJdXX0= --9431149156168 Content-Disposition: form-data; name="content-type" text/plain --9431149156168 Content-Disposition: form-data; name="file"; filename="myfile" Content-Type: text/plain c2c6cd0f-898e-11e8-aab6-e567c91fb541 52b8e8a0-8481-4696-96f3-910635215a78 --9431149156168--
  • 功能介绍 上传对象操作是指在指定的桶内增加一个对象,执行该操作需要用户拥有桶的写权限。 同一个桶中存储的对象名是唯一的。 在桶未开启多版本的情况下,如果在指定的桶内已经有相同的对象键值的对象,用户上传的新对象会覆盖原来的对象;为了确保数据在传输过程中没有遭到破坏,用户可以在表单域中加入Content-MD5参数。在这种情况下,OBS收到上传的对象后,会对对象进行MD5校验,如果不一致则返回出错信息。用户还可以在上传对象时指定x-obs-acl参数,设置对象的权限控制策略。 用户除了可以用PUT直接上传对象外,还可以使用POST上传对象。 单次上传对象大小范围是[0, 5GB],如果需要上传超过5GB的大文件,需要通过多段操作来分段上传。 该操作支持服务端加密功能。
  • 请求消息样式 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 POST / HTTP/1.1 Host: bucketname.obs.cn-north-4.myhuaweicloud.com User-Agent: browser_data Accept: file_types Accept-Language: Regions Accept-Encoding: encoding Accept-Charset: character_set Keep-Alive: 300 Connection: keep-alive Content-Type: multipart/form-data; boundary=9431149156168 Content-Length: length --9431149156168 Content-Disposition: form-data; name="key" acl --9431149156168 Content-Disposition: form-data; name="success_action_redirect" success_redirect --9431149156168 Content-Disposition: form-data; name="content-Type" content_type --9431149156168 Content-Disposition: form-data; name="x-obs-meta-uuid" uuid --9431149156168 Content-Disposition: form-data; name="x-obs-meta-tag" metadata --9431149156168 Content-Disposition: form-data; name="AccessKeyId" access-key-id --9431149156168 Content-Disposition: form-data; name="policy" encoded_policy --9431149156168 Content-Disposition: form-data; name="signature" signature= --9431149156168 Content-Disposition: form-data; name="file"; filename="MyFilename" Content-Type: image/jpeg file_content --9431149156168 Content-Disposition: form-data; name="submit" Upload to OBS --9431149156168--
  • WORM 如果桶的WORM开关是开启的,则可以为对象配置WORM。您可以通过携带元素x-obs-object-lock-mode和x-obs-object-lock-retain-until-date在上传对象的同时指定对象的保护策略,如果您不携带这些元素,但配置了桶级默认WORM策略,则新上传的对象会自动应用默认策略。您还可以在上传后配置或修改对象级WORM保护策略。 在桶的WORM开关开启时,系统会自动打开多版本功能。WORM保护是基于对象版本号的,配置WORM的版本受到WORM保护,没有配置WORM的版本可正常删除。例如,test.txt 001受到WORM保护。此时再次上传同名文件,产生新的对象版本test.txt 002,test.txt 002并未配置WORM,那么test.txt 002就不受保护可以正常删除。当您下载对象时,不指定版本号下载的是最新对象,也就是test.txt 002。
  • 响应示例:桶开启多版本时上传对象 1 2 3 4 5 6 7 8 HTTP/1.1 200 OK Server: OBS x-obs-request-id: DCD2FC9CAB78000001439A51DB2B2577 ETag: "d41d8cd98f00b204e9800998ecf8427e" X-OBS-ID-2: GcVgfeOJHx8JZHTHrRqkPsbKdB583fYbr3RBbHT6mMrBstReVILBZbMAdLiBYy1l Date: WED, 01 Jul 2015 04:17:12 GMT x-obs-version-id: AAABQ4q2M9_c0vycq3gAAAAAVURTRkha Content-Length: 0
  • 请求示例:上传对象时携带MD5 1 2 3 4 5 6 7 8 9 10 11 PUT /object01 HTTP/1.1 User-Agent: curl/7.29.0 Host: examplebucket.obs.cn-north-4.myhuaweicloud.com Accept: */* Date: WED, 01 Jul 2015 04:17:50 GMT Authorization: OBS H4IPJX0TQTHTHEBQQCEC:uFVJhp/dJqj/CJIVLrSZ0gpw3ng= Content-Length: 10 Content-MD5: 6Afx/PgtEy+bsBjKZzihnw== Expect: 100-continue 1234567890
  • 响应示例:上传对象时携带MD5 1 2 3 4 5 6 7 HTTP/1.1 200 OK Server: OBS x-obs-request-id: BB7800000164B165971F91D82217D105 X-OBS-ID-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCSEKhBpS4BB3d SMN qMtuNxQDD9XvOw5h ETag: "1072e1b96b47d7ec859710068aa70d57" Date: WED, 01 Jul 2015 04:17:50 GMT Content-Length: 0
  • 请求示例:在URL中携带签名并上传对象 PUT /object02?AccessKeyId=H4IPJX0TQTHTHEBQQCEC&Expires=1532688887&Signature=EQmDuOhaLUrzrzRNZxwS72CXeXM%3D HTTP/1.1 User-Agent: curl/7.29.0 Host: examplebucket.obs.cn-north-4.myhuaweicloud.com Accept: */* Content-Length: 1024 [1024 Byte data content]
  • 请求示例:上传指定存储类型的对象 1 2 3 4 5 6 7 8 9 10 11 PUT /object01 HTTP/1.1 User-Agent: curl/7.29.0 Host: examplebucket.obs.cn-north-4.myhuaweicloud.com Accept: */* Date: WED, 01 Jul 2015 04:15:07 GMT x-obs-storage-class: WARM Authorization: OBS H4IPJX0TQTHTHEBQQCEC:uFVJhp/dJqj/CJIVLrSZ0gpw3ng= Content-Length: 10240 Expect: 100-continue [1024 Byte data content]
  • 响应示例:上传指定存储类型的对象 1 2 3 4 5 6 7 HTTP/1.1 200 OK Server: OBS x-obs-request-id: BB7800000164846A2112F98BF970AA7E ETag: "d41d8cd98f00b204e9800998ecf8427e" x-obs-id-2: a39E0UgAIAABAAAQAAEAABAAAQAAEAABCTPOUJu5XlNyU32fvKjM/92MQZK2gtoB Date: WED, 01 Jul 2015 04:15:07 GMT Content-Length: 0
  • 响应示例 :上传时配置对象级WORM保护策略 1 2 3 4 5 6 7 HTTP/1.1 200 OK Server: OBS x-obs-request-id: BF2600000164364C10805D385E1E3C67 ETag: "d41d8cd98f00b204e9800998ecf8427e" x-obs-id-2: 32AAAWJAMAABAAAQAAEAABAAAQAAEAABCTzu4Jp2lquWuXsjnLyPPiT3cfGhqPoY Date: WED, 01 Jul 2015 04:11:15 GMT Content-Length: 0
  • 请求示例:上传时配置website实现下载对象重定向 当桶设置了Website配置,您可以在上传对象时进行以下设置,设置后用户在下载对象时会重定向 1 2 3 4 5 6 7 8 9 10 11 PUT /object01 HTTP/1.1 User-Agent: curl/7.29.0 Host: examplebucket.obs.cn-north-4.myhuaweicloud.com Accept: */* Date: WED, 01 Jul 2015 04:17:12 GMT x-obs-website-redirect-location: http://www.example.com/ Authorization: OBS H4IPJX0TQTHTHEBQQCEC:uFVJhp/dJqj/CJIVLrSZ0gpw3ng= Content-Length: 10240 Expect: 100-continue [1024 Byte data content]
  • 响应示例:在URL中携带签名并上传对象 1 2 3 4 5 6 7 8 HTTP/1.1 200 OK Server: OBS x-obs-request-id: DCD2FC9CAB78000001439A51DB2B2577 x-obs-id-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCTmxB5ufMj/7/GzP8TFwTbp33u0xhn2Z ETag: "1072e1b96b47d7ec859710068aa70d57" Date: Fri, 27 Jul 2018 10:52:31 GMT x-obs-version-id: AAABQ4q2M9_c0vycq3gAAAAAVURTRkha Content-Length: 0
  • 请求示例:上传时配置对象级WORM保护策略 PUT /object01 HTTP/1.1 User-Agent: curl/7.29.0 Host: examplebucket.obs.cn-north-4.myhuaweicloud.com Accept: */* Date: WED, 01 Jul 2015 04:11:15 GMT Authorization: OBS H4IPJX0TQTHTHEBQQCEC:gYqplLq30dEX7GMi2qFWyjdFsyw= Content-Length: 10240 x-obs-object-lock-mode:COMPLIANCE x-obs-object-lock-retain-until-date:2022-09-24T16:10:25Z Expect: 100-continue [1024 Byte data content]
  • 响应示例:上传时配置website实现下载对象重定向 1 2 3 4 5 6 7 8 HTTP/1.1 200 OK Server: OBS x-obs-request-id: DCD2FC9CAB78000001439A51DB2B2577 x-obs-id-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCTmxB5ufMj/7/GzP8TFwTbp33u0xhn2Z ETag: "1072e1b96b47d7ec859710068aa70d57" Date: WED, 01 Jul 2015 04:17:12 GMT x-obs-version-id: AAABQ4q2M9_c0vycq3gAAAAAVURTRkha Content-Length: 0
共100000条