authenticaaccountsuspended

accountsuspended  时间:2021-01-11  阅读:()
AlibabaCloudObjectStorageServiceAPIReferenceIssue:20200320ObjectStorageServiceAPIReference/LegaldisclaimerLegaldisclaimerAlibabaCloudremindsyoutocarefullyreadandfullyunderstandthetermsandconditionsofthislegaldisclaimerbeforeyoureadorusethisdocument.
Ifyouhavereadorusedthisdocument,itshallbedeemedasyourtotalacceptanceofthislegaldisclaimer.
1.
YoushalldownloadandobtainthisdocumentfromtheAlibabaCloudwebsiteorotherAlibabaCloud-authorizedchannels,andusethisdocumentforyourownlegalbusinessactivitiesonly.
ThecontentofthisdocumentisconsideredcondentialinformationofAlibabaCloud.
Youshallstrictlyabidebythecondentialityobligations.
NopartofthisdocumentshallbedisclosedorprovidedtoanythirdpartyforusewithoutthepriorwrittenconsentofAlibabaCloud.
2.
Nopartofthisdocumentshallbeexcerpted,translated,reproduced,transmitted,ordisseminatedbyanyorganization,company,orindividualinanyformorbyanymeanswithoutthepriorwrittenconsentofAlibabaCloud.
3.
Thecontentofthisdocumentmaybechangedduetoproductversionupgrades,adjustments,orotherreasons.
AlibabaCloudreservestherighttomodifythecontentofthisdocumentwithoutnoticeandtheupdatedversionsofthisdocumentwillbeoccasionallyreleasedthroughAlibabaCloud-authorizedchannels.
Youshallpayattentiontotheversionchangesofthisdocumentastheyoccuranddownloadandobtainthemostup-to-dateversionofthisdocumentfromAlibabaCloud-authorizedchannels.
4.
ThisdocumentservesonlyasareferenceguideforyouruseofAlibabaCloudproductsandservices.
AlibabaCloudprovidesthedocumentinthecontextthatAlibabaCloudproductsandservicesareprovidedonan"asis","withallfaults"and"asavailable"basis.
AlibabaCloudmakeseveryeorttoproviderelevantoperationalguidancebasedonexistingtechnologies.
However,AlibabaCloudherebymakesaclearstatementthatitinnowayguaranteestheaccuracy,integrity,applicability,andreliabilityofthecontentofthisdocument,eitherexplicitlyorimplicitly.
AlibabaCloudshallnotbearanyliabilityforanyerrorsornanciallossesincurredbyanyorganizations,companies,orindividualsarisingfromtheirdownload,use,ortrustinthisdocument.
AlibabaCloudshallnot,underanycircumstances,bearresponsibilityforanyindirect,consequentIssue:20200320IObjectStorageServiceAPIReference/Legaldisclaimerial,exemplary,incidental,special,orpunitivedamages,includinglostprotsarisingfromtheuseortrustinthisdocument,evenifAlibabaCloudhasbeennotiedofthepossibilityofsuchaloss.
5.
Bylaw,allthecontentsinAlibabaClouddocuments,includingbutnotlimitedtopictures,architecturedesign,pagelayout,andtextdescription,areintellectualpropertyofAlibabaCloudand/oritsaliates.
Thisintellectualpropertyincludes,butisnotlimitedto,trademarkrights,patentrights,copyrights,andtradesecrets.
Nopartofthisdocumentshallbeused,modied,reproduced,publiclytransmitted,changed,disseminated,distributed,orpublishedwithoutthepriorwrittenconsentofAlibabaCloudand/oritsaliates.
ThenamesownedbyAlibabaCloudshallnotbeused,published,orreproducedformarketing,advertising,promotion,orotherpurposeswithoutthepriorwrittenconsentofAlibabaCloud.
ThenamesownedbyAlibabaCloudinclude,butarenotlimitedto,"AlibabaCloud","Aliyun","HiChina",andotherbrandsofAlibabaCloudand/oritsaliates,whichappearseparatelyorincombination,aswellastheauxiliarysignsandpatternsoftheprecedingbrands,oranythingsimilartothecompanynames,tradenames,trademarks,productorservicenames,domainnames,patterns,logos,marks,signs,orspecialdescriptionsthatthirdpartiesidentifyasAlibabaCloudand/oritsaliates.
6.
PleasecontactAlibabaClouddirectlyifyoudiscoveranyerrorsinthisdocument.
IIIssue:20200320ObjectStorageServiceAPIReference/LegaldisclaimerIssue:20200320IIIObjectStorageServiceAPIReference/DocumentconventionsDocumentconventionsStyleDescriptionExampleAdangernoticeindicatesasituationthatwillcausemajorsystemchanges,faults,physicalinjuries,andotheradverseresults.
Danger:Resettingwillresultinthelossofusercongurationdata.
Awarningnoticeindicatesasituationthatmaycausemajorsystemchanges,faults,physicalinjuries,andotheradverseresults.
Warning:Restartingwillcausebusinessinterruption.
About10minutesarerequiredtorestartaninstance.
Acautionnoticeindicateswarninginformation,supplementaryinstructions,andothercontentthattheusermustunderstand.
Notice:Iftheweightissetto0,theservernolongerreceivesnewrequests.
Anoteindicatessupplementalinstructions,bestpractices,tips,andothercontent.
Note:YoucanuseCtrl+Atoselectallles.
>Closinganglebracketsareusedtoindicateamulti-levelmenucascade.
ClickSettings>Network>Setnetworktype.
BoldBoldformattingisusedforbuttons,menus,pagenames,andotherUIelements.
ClickOK.
CourierfontCourierfontisusedforcommands.
Runthecd/dC:/windowcommandtoentertheWindowssystemfolder.
ItalicItalicformattingisusedforparametersandvariables.
baeloglist--instanceidInstance_ID[]or[a|b]Thisformatisusedforanoptionalvalue,whereonlyoneitemcanbeselected.
ipconfig[-all|-t]Issue:20200320IObjectStorageServiceAPIReference/DocumentconventionsStyleDescriptionExample{}or{a|b}Thisformatisusedforarequiredvalue,whereonlyoneitemcanbeselected.
switch{active|stand}IIIssue:20200320ObjectStorageServiceAPIReference/DocumentconventionsIssue:20200320IIIObjectStorageServiceAPIReference/ContentsContentsLegaldisclaimer.
IDocumentconventions.
I1Overview.
12APIoverview.
33DenitionsofcommonHTTPheaders.
74Accesscontrol.
104.
1Usersignatureauthentication.
104.
2Addsignaturestoheaders.
114.
3GenerateasignedURL.
184.
4Bucketaccesscontrol.
215Serviceoperations.
235.
1GetService(ListBuckets)236Bucketoperations.
306.
1PutBucket.
306.
2DeleteBucket.
336.
3PutBucketACL.
356.
4GetBucketAcl.
376.
5PutBucketLifecycle.
396.
6GetBucketLifecycle.
496.
7DeleteBucketLifecycle.
516.
8GetBucket(ListObject)526.
9PutBucketVersioning.
616.
10GetBucketVersioning.
636.
11GetBucketVersions(ListObjectVersions)656.
12PutBucketLogging.
746.
13GetBucketLogging.
806.
14DeleteBucketLogging.
836.
15PutBucketWebsite.
846.
16GetBucketWebsite.
1036.
17DeleteBucketWebsite.
1166.
18PutBucketReferer.
1176.
19GetBucketReferer.
1206.
20GetBucketLocation.
1236.
21GetBucketInfo.
1246.
22PutBucketTags.
1296.
23GetBucketTags.
1326.
24DeleteBucketTags.
1346.
25PutBucketEncryption.
1356.
26GetBucketEncryption.
137IVIssue:20200320ObjectStorageServiceAPIReference/Contents6.
27DeleteBucketEncryption.
1396.
28PutBucketRequestPayment.
1396.
29GetBucketRequestPayment.
1416.
30PutBucketPolicy.
1436.
31GetBucketPolicy.
1446.
32DeleteBucketPolicy.
1457Objectoperations.
1477.
1PutObject.
1477.
2CopyObject.
1557.
3GetObject.
1667.
4AppendObject.
1777.
5DeleteObject.
1867.
6DeleteMultipleObjects.
1917.
7HeadObject.
2017.
8GetObjectMeta.
2087.
9PutObjectACL.
2117.
10GetObjectACL.
2147.
11PostObject.
2177.
12Callback.
2337.
13PutSymlink.
2477.
14GetSymlink.
2517.
15RestoreObject.
2537.
16SelectObject.
2567.
17PutObjectTagging.
2937.
18GetObjectTagging.
2957.
19DeleteObjectTagging.
2968Multipartuploadoperations.
2988.
1Introduction.
2988.
2InitiateMultipartUpload.
2988.
3UploadPart.
3048.
4UploadPartCopy.
3068.
5CompleteMultipartUpload.
3118.
6AbortMultipartUpload.
3188.
7ListMultipartUploads.
3198.
8ListParts.
3289Cross-OriginResourceSharing.
3359.
1Introduction.
3359.
2PutBucketcors.
3359.
3GetBucketCORS.
3409.
4DeleteBucketCORS.
3429.
5OptionObject.
34410LiveChannel-relatedoperations.
34710.
1Overview.
34710.
2RTMPingestURLsandsignatures.
347Issue:20200320VObjectStorageServiceAPIReference/Contents10.
3PutLiveChannel.
34910.
4ListLiveChannel.
35610.
5DeleteLiveChannel.
36110.
6PutLiveChannelStatus.
36110.
7GetLiveChannelInfo.
36210.
8GetLiveChannelStat.
36510.
9GetLiveChannelHistory.
37010.
10PostVodPlaylist.
37210.
11GetVodPlaylist.
37310.
12FAQ.
375VIIssue:20200320ObjectStorageServiceAPIReference/1Overview1OverviewTheObjectStorageService(OSS)isacloudstorageserviceprovidedbyAlibabaCloud,featuringamassivecapacity,security,alowcost,andhighreliability.
Youcanuploadanddownloaddataanytime,anywhere,andonanyInternetdevicethroughasimpleRESTfulinterfacedescribedherein.
WiththeOSS,youcandevelopadiverserangeofmassivedata-basedservicessuchasmultimediasharingwebsites,onlinestorage,personaldatabackups,andcorporatedatabackups.
LimitsDierentOSSresourcesandfunctionshavedierentlimits.
Formoreinformation,seeLimits.
UsageThistopicdescribestherequestsyntax,requestsamplesandreturnsamplesforeachinterface.
Ifyouwanttoperformadditionaldevelopment,werecommendyouuseOSSSDKs.
FormoreinformationabouttheinstallationandusageofOSSSDKs,seeOSSSDKintroduction.
PricingFormoreinformationaboutthepriceofOSS,seeOSSpricingpage.
TermsTermDescriptionBucketAbucketisaresourceinAlibabaCloudthatoperatessimilartoacontainerandisusedtostoreobjectsinOSS.
Everyobjectiscontainedinabucket.
ObjectAnobject(sometimesreferredtoasale)isthefundamentalstorageresourceinAlibabaCloudOSS.
Anobjectiscomposedofmetadata,data,andakey,inwhichthekeyisauniquenamefortheobject.
RegionAregionindicatesthephysicallocationofanAlibabaClouddatacenter.
Youcanchoosetheregioninwhichthebucketsyoucreatearestoredbasedonyourcostsandthegeographicareafromwhererequeststoyourresourcesarecomingfrom.
Formoreinformation,seeRegionsandendpoints.
Issue:202003201ObjectStorageServiceAPIReference/1OverviewTermDescriptionEndpointAnendpointisadomainnameusedtoaccessOSS.
OSSprovidesexternalservicesthroughHTTPRESTfulAPIs.
YoumustusedierentendpointstoaccessdierentOSSregions,oraccessthesameOSSregionthroughtheintranetandtheInternet.
Formoreinformation,seeRegionsandendpoints.
AccessKeyAnAccessKey(AK)iscomposedofanAccessKeyIdandanAccessKeySecret,andisusedtoverifytheidentityofanentitythatrequestsaccesstoresources.
OSSveriestheidentityofarequestsenderbyusingsymmetricencryption.
TheAccessKeyIdisusedtoidentifyauser,andtheAccessKeySecretisusedbytheusertoencryptthesignature,andforOSStoverifythesignature.
TheAccessKeySecretmustbekeptcondential.
2Issue:20200320ObjectStorageServiceAPIReference/2APIoverview2APIoverviewOSSprovidesthefollowingAPIs:Service-relatedoperationsAPIDescriptionGetServiceObtainsallbucketsownedbyaspeciedaccount.
Bucket-relatedoperationsAPIDescriptionPutBucketCreatesabucket.
PutBucketACLSetstheACLforabucket.
PutBucketLoggingEnablestheloggingfunctionforabucket.
PutBucketWebsiteSetsabuckettostaticwebsitehostingmode.
PutBucketRefererCongureshotlinkprotectionrulesforabucket.
PutBucketLifecycleCongureslifecyclerulesfortheobjectsinabucket.
GetBucket(ListObject)Getstheinformationaboutallobjectsinabucket.
GetBucketAclGetstheACLforabucket.
GetBucketLocationGetsthelocationinformationaboutthedatacentertowhichabucketbelongs.
GetBucketInfoObtainstheinformationaboutabucket.
GetBucketLoggingViewsthecongurationoftheloggingfunctionforabucket.
GetBucketWebsiteViewsthestaticwebsitehostingstatusofabucket.
GetBucketRefererViewsthehotlinkprotectionrulesforabucket.
Issue:202003203ObjectStorageServiceAPIReference/2APIoverviewAPIDescriptionGetBucketLifecycleViewsthelifecyclerulesfortheobjectsinabucket.
DeleteBucketDeletesabucket.
DeleteBucketLoggingDisablestheloggingfunctionforabucket.
DeleteBucketWebsiteDisablesthestaticwebsitehostingmodeforabucket.
DeleteBucketLifecycleDeletesthelifecyclerulesfortheobjectsinabucket.
Object-relatedoperationsAPIDescriptionPutObjectUploadsanobjectCopyObjectCopiesanobjecttoanotherobject.
GetObjectGetsanobject.
AppendObjectAppendstheuploaddatatotheendofanobject.
DeleteObjectDeletesanobjectDeleteMultipleObjectsDeletesmultipleobjects.
HeadObjectReturnsonlythemetadataofanobjectbutnottheobjectcontent.
GetObjectMetaReturnsthemetadataofanobject,includingtheETag,Size(objectsize),andLastModiedanddoesnotreturntheobjectcontent.
PostObjectUploadsanobjectinPostmode.
PutObjectACLSetstheACLforanobject.
GetObjectACLGetstheACLforanobject.
CallbackEnablesthecallbackfunction.
PutSymlinkCreatesasymbollink.
GetSymlinkObtainsasymbollink.
RestoreObjectRestoresanobject.
4Issue:20200320ObjectStorageServiceAPIReference/2APIoverviewAPIDescriptionSelectObjectQueriesobjectsusingSQLstatements.
OperationsrelatedtomultipartuploadAPIDescriptionInitiateMultipartUploadInitializesaMultipartUploadevent.
UploadPartUploadsanobjectinmultipleparts.
UploadPartCopyUploadsandcopiesanobjectinmultipleparts.
CompleteMultipartUploadCompletetheMultipartUploadeventforanobject.
AbortMultipartUploadCancelsaMultipartUploadevent.
ListMultipartUploadsListsallongoingMultipartUploadevents.
ListPartsListsallpartssuccessfullyuploadedinaMultipartUploadeventwithaspecieduploadID.
Cross-OriginResourceSharing(CORS)APIDescriptionPutBucketcorsSetsaCORSruleforaspeciedbucket.
GetBucketcorsGetsthecurrentCORSrulesforaspeciedbucket.
DeleteBucketcorsDisablestheCORSfunctionforaspeciedbucketandclearsalltheCORSrules.
OptionObjectSpeciesthepreightrequestforcross-regionaccess.
OperationsrelatedtoLiveChannelAPIDescriptionPutLiveChannelStatusSwitchesthestatusofLiveChannel.
PutLiveChannelCreatesaLiveChannel.
GetVodPlaylistGetsthespeciedplaylist.
Issue:202003205ObjectStorageServiceAPIReference/2APIoverviewAPIDescriptionPostVodPlaylistGeneratesaplaylist.
GetLiveChannelStatGetsthestreampushingstatusofaLiveChannel.
GetLiveChannelInfoGetsthecongurationsofaLiveChannel.
GetLiveChannelHistoryGetsthestreampushingrecordofaLiveChannel.
ListLiveChannelListsLiveChannels.
DeleteLiveChannelDeletesaLiveChannel.
6Issue:20200320ObjectStorageServiceAPIReference/3DenitionsofcommonHTTPheaders3DenitionsofcommonHTTPheadersCommonrequestheadersSomecommonrequestheadersareusedintheOSSRESTfulinterfaces.
TheserequestheaderscanbeusedbyalltheOSSrequests.
Thefollowingtableliststhespecicdenitionsoftherequestheaders:NameTypeDescriptionAuthorizationstringThevericationinformationusedtoverifythevalidityofarequest.
Defaultvalue:noneUsagescenario:non-anonymousrequestsContent-LengthstringContentlengthofanHTTPrequest,whichisdenedinRFC2616.
Defaultvalue:noneUsagescenario:requeststhatneedtosubmitdatatoOSSContent-TypestringContenttypeofanHTTPrequest,whichisdenedinRFC2616.
Defaultvalue:noneUsagescenario:requeststhatneedtosubmitdatatoOSSdatestringTheGMTtimestipulatedintheHTTP1.
1protocol,forexample,Wed,05Sep.
201223:00:00GMTDefaultvalue:noneIssue:202003207ObjectStorageServiceAPIReference/3DenitionsofcommonHTTPheadersNameTypeDescriptionHoststringTheaccesshostvalue.
Format:.
oss-cn-hangzhou.
aliyuncs.
com.
Defaultvalue:noneCommonresponseheadersSomecommonresponseheadersareusedintheOSSRESTfulinterfaces.
TheseresponseheaderscanbeusedbyalltheOSSrequests.
Thefollowingtableliststhespecicdenitionsoftheresponseheaders:NameTypeDescriptionContent-LengthstringContentlengthofanHTTPrequest,whichisdenedinRFC2616.
Defaultvalue:noneUsagescenario:requeststhatneedtosubmitdatatoOSSConnectionenumerativeTheconnectionstatusbetweentheclientandtheOSSserver.
Validvalues:openorcloseDefaultvalue:noneDatestringTheGMTtimestipulatedintheHTTP1.
1protocol,forexample,Wed,05Sep.
201223:00:00GMTDefaultvalue:none8Issue:20200320ObjectStorageServiceAPIReference/3DenitionsofcommonHTTPheadersNameTypeDescriptionEtagstringTheETag(entitytag)iscreatedwhenanobjectisgeneratedandisusedtoindicatethecontentoftheobject.
ForanobjectcreatedforaPutObjectrequest,thevalueofETagisthevalueofMD5inthecontentoftheobject.
Foranobjectcreatedinotherapproaches,thevalueofETagistheUUIDinthecontentoftheobject.
ThevalueofETagcanbeusedtocheckwhetherthecontentoftheobjectischanged.
Defaultvalue:noneServerstringTheserverthatgeneratestheresponse.
Defaultvalue:AliyunOSSx-oss-request-idstringTheUUIDoftheresponse.
ItiscreatedbyAlibabaCloudOSS.
IncaseofanyissueswhenusingtheOSSservice,youcancontactOSSsupportpersonnelusingthiseldtorapidlylocatetheissue.
Defaultvalue:noneIssue:202003209ObjectStorageServiceAPIReference/4Accesscontrol4Accesscontrol4.
1UsersignatureauthenticationOSSveriestheidentityofarequestsenderbyusingtheAccessKeyId/AccessKeySecretsymmetricencryptionmethod.
TheAccessKeyIdisusedtoidentifyauser.
TheAccessKeySecretisusedbytheusertoencryptthesignatureandusedbyOSStoverifythesignature.
TheAccessKeySecretmustbekeptcondential.
Basedontheaccounttypes,AccessKeyscanbecategorizedasfollows:AccessKeyofanAlibabaCloudaccount:TheAccessKeyofaAlibabaCloudaccounthasfullpermissionsonitsresources.
AccessKeyofaRAMuser:ARAMuserisgeneratedundertheauthorizationofanAlibabaCloudaccount.
TheAccessKeyofaRAMuserhaslimitedpermissionsonspeciedresources.
STStemporaryaccesscredential:TheSTSaccesscredentialisatemporarycredentialgeneratedbyanAlibabaCloudaccountoraRAMuser.
TheAccessKeyofthetemporarycredentialhaslimitedpermissionsonspeciedresourcesforaspeciedperiodoftime.
Thepermissionsofthecredentialarewithdrawnoncethecredentialexpires.
Formoreinformation,seeAccesscontrol.
BeforesendingarequesttoOSSasanindividualuser,youmustrstgenerateasignaturestringinthespeciedformatfortherequest.
ThenyoumustencryptthesignaturestringusingyourAccessKeySecrettogenerateavericationcode.
Afterreceivingtherequest,OSSndstheAccessKeySecretbasedontheAccessKeyID,andextractsthesignaturestringandvericationcodeinthesameway.
Ifthecalculatedvericationcodeisthesameasthevericationcodeprovided,OSSdeterminesthattherequestisvalid.
Otherwise,OSSrejectstherequestandreturnsan403HTTPstatuscode.
10Issue:20200320ObjectStorageServiceAPIReference/4Accesscontrol4.
2AddsignaturestoheadersYoucanincludetheAuthorizationheaderintheHTTPrequesttocarrysignatureinformationtoindicatethattherequesthasbeenauthorized.
SDKimplementationOSSSDKsautomaticallyimplementssignaturesinyourrequests.
YoudonotneedtomanuallycalculateyoursignaturewhenyouuseOSSSDKs.
Formoreinformationaboutthesignatureimplementationsinspecicprogramminglanguages,seetheOSSSDKcode.
ThefollowingtabledescribesthesamplecodeusedtoimplementsignaturesinvariousSDKs.
SDKSignatureimplementationJavaSDKOSSRequestSigner.
javaPythonSDKauth.
py.
NETSDKOssRequestSigner.
csPHPSDKOssClient.
phpCSDKoss_auth.
cJavaScriptSDKclient.
jsGoSDKauth.
goRubySDKutil.
rbiOSSDKOSSModel.
mAndroidSDKOSSUtils.
javaCalculationoftheAuthorizationheaderAuthorization="OSS"+AccessKeyId+":"+SignatureSignature=base64(hmac-sha1(AccessKeySecret,VERB+"\n"+Content-MD5+"\n"+Content-Type+"\n"+Date+"\n"+CanonicalizedOSSHeaders+CanonicalizedResource))Detailanalysis:AccessKeySecretspeciesthekeyrequiredforasignature.
VERBspeciestheHTTPrequestmethodsuchasPUT,GET,POST,HEAD,andDELETE.
Issue:2020032011ObjectStorageServiceAPIReference/4Accesscontrol\nspeciesalinebreak.
Content-MD5speciestheMD5valueoftherequest.
TheMD5valueisobtainedbycalculatingthemessagecontent(excludingtheheader)andthenencodingtheresulting128-bitnumberinBase64.
Thisheadercanbeusedtocheckthevalidityofamessage.
Itprovidesacheckingmechanismforwhetherthemessagecontentisconsistentwiththesentcontent,suchas"eB5eJF1ptWaXm4bijSPyxw==".
Thisheadermaybeleftempty.
Formoreinformation,visitRFC2616Content-MD5.
Content-Typespeciesthetypeoftherequestcontent,suchasapplication/octet-stream.
Thisheadermaybeleftempty.
DatespeciestheoperationtimeinGMTformat,suchasSun,22Nov201508:16:38GMT.
CanonicalizedOSSHeadersspeciesanassemblyofHTTPheadersthataresortedinalphabeticalorderandwhoseprexesarex-oss-.
CanonicalizedResourcespeciestheOSSresourcesyouwanttoaccess.
Note:ThevaluesofDateandCanonicalizedResourcecannotbeleftempty.
IfthedierencebetweenthevalueofDateintherequestandthecurrenttimeoftheOSSserverisgreaterthan15minutes,theOSSserverdeniestherequestandreturnsanHTTP403error.
ConstructCanonicalizedOSSHeadersAlltheHTTPheaderswhoseprexesarex-oss-arecalledCanonicalizedOSSHeaders.
YoucanconstructCanonicalizedOSSHeadersasfollows:1.
ConvertthenamesofallHTTPrequestheaderswhoseprexesarex-oss-intolowercaseletters.
Forexample,convertX-OSS-Meta-Name:TaoBaointox-oss-meta-name:TaoBao.
2.
IftherequestissentbyusingtheAccessKeyIDandAccessKeysecretobtainedbySTS,youmustaddtheobtainedsecurity-tokenvaluetothesignaturestringinx-oss-security-token:security-tokenformat.
3.
SortalltheobtainedHTTPrequestheadersinalphabeticalorder.
4.
Deleteanyspacesoneitherendofthedelimiterbetweentheheaderandcontentofeachrequest.
Forexample,convertx-oss-meta-name:TaoBaointox-oss-meta-name:TaoBao.
12Issue:20200320ObjectStorageServiceAPIReference/4Accesscontrol5.
Separatetheheaderandcontentofeachrequestwiththe\ndelimitertoformthenalCanonicalizedOSSHeaders.
Note:CanonicalizedOSSHeaderscanbeleftempty,andthe\ndelimiterattheendcanberemoved.
ToconstructonlyoneCanonicalizedOSSHeaders,youmustaddthe\ndelimitertotheendoftheheader.
Example:x-oss-meta-a\n.
ToconstructmultipleCanonicalizedOSSHeaders,youmustaddthe\ndelimitertotheendofeachheader.
Example:x-oss-meta-a:a\nx-oss-meta-b:b\nx-oss-meta-c:c\n.
ConstructCanonicalizedResourceThetargetOSSresourcespeciedintherequestsentbytheuseriscalledaCanonicalizedResource.
YoucanconstructaCanonicalizedResourceasfollows:1.
SetCanonicalizedResourcetoanullcharacterstring"".
2.
SpecifytheOSSresourceyouwanttoaccessinthefollowingformat:/BucketName/ObjectName.
IfObjectNamedoesnotexist,CanonicalizedResourceis/BucketName/.
IfBucketNamedoesnotexisteither,CanonicalizedResourceisaforwardslash(/).
3.
Iftherequestedresourceincludessubresources(SubResource),sortallsubresourcesinalphabeticalorderandseparatethesubresourceswiththeampersand(&)delimitertogenerateasubresourcestring.
Addaquestionmark()andthesubresourcestringtotheendoftheCanonicalizedResourcestring.
Inthiscase,CanonicalizedResourceis/BucketName/ObjectNameacl&uploadId=UploadId.
Note:ThesubresourcessupportedbyOSScurrentlyinclude:acl,uploads,location,cors,logging,website,referer,lifecycle,delete,append,tagging,objectMeta,uploadId,partNumber,security-token,position,img,style,styleName,replication,replicationProgress,replicationLocation,cname,bucketInfo,comp,qos,live,status,vod,startTime,endTime,symlink,x-oss-process,response-Issue:2020032013ObjectStorageServiceAPIReference/4Accesscontrolcontent-type,response-content-language,response-expires,response-cache-control,response-content-disposition,andresponse-content-encoding.
Threetypesofsubresourcesareavailable:-Resourceidentierssuchasacl,append,uploadId,andsymlinksubresources.
Formoreinformation,seeBucketoperationsandObjectoperations.
-Subresourcesthatspecifytheresponseheaderelds,suchasresponse-***subresources.
Formoreinformation,seetheRequestparameterssectioninGetObject.
-Objectprocessingmethodssuchasx-oss-process.
Formoreinformation,seeImageProcessing.
RulestocalculateasignatureheaderAsignaturestringmustbeinUTF-8format.
AsignaturestringthatcontainsChinesecharactersmustbeencodedinUTF-8.
TheencodedsignaturestringisusedtogetherwithAccessKeySecrettocalculatethenalsignature.
TheHMAC-SHA1methoddenedinRFC2104isusedtocalculatethenalsignature.
Inthismethod,theKeyisAccessKeySecret.
Content-TypeandContent-MD5arenotrequiredinarequest.
Iftherequestrequiressignatureverication,nullvaluesmustbereplacedwithalinebreak(\n).
Amongnon-HTTPheaders,onlytheheadersstartingwithx-oss-requiresignaturestrings.
Othernon-HTTPheadersareignoredbyOSS.
Forexample,thex-oss-magicheaderinthefollowingexamplemustincludeasignaturestring.
Note:Headersstartingwithx-oss-mustcomplywiththefollowingspecicationsbeforesignatureverication:-Theheadernameisconvertedtolowercaseletters.
-Theheadersaresortedinalphabeticalorder.
-Nospaceexistsbeforeorafterthecolon(:)thatseparatestheheadernameandvalue.
-Eachheaderisfollowedbyalinebreak(\n).
Ifnoheaderisused,setCanonicalizedOSSHeaderstonull.
14Issue:20200320ObjectStorageServiceAPIReference/4AccesscontrolExamplesRequestSignaturestringcalculationformulaSignaturestringPUT/nelsonHTTP/1.
0Content-MD5:eB5eJF1ptWaXm4bijSPyxw==Content-Type:text/htmlDate:Thu,17Nov200518:49:58GMTHost:oss-example.
oss-cn-hangzhou.
aliyuncs.
comX-OSS-Meta-Author:foo@bar.
comX-OSS-Magic:abracadabraSignature=base64(hmac-sha1(AccessKeySecret,VERB+"\n"+Content-MD5+"\n"+Content-Type+"\n"+Date+"\n"+CanonicalizedOSSHeaders+CanonicalizedResource))"PUT\neB5eJF1ptWaXm4bijSPyxw==\ntext/html\nThu,17Nov200518:49:58GMT\nx-oss-magic:abracadabra\nx-oss-meta-author:foo@bar.
com\n/oss-example/nelsIfAccessKeyIdis"44CF959******252F707"andAccessKeySecretis"OtxrzxIsfpFjA7Sw******8Bw21TLhquhboDYROV",youcanusethefollowingmethodtocalculatethesignatureinPython:importbase64importhmacimportshah=hmac.
new("OtxrzxIsfpFjA7Sw******8Bw21TLhquhboDYROV","PUT\nODBGOERFMDMzQTczRUY3NUE3NzA5QzdFNUYzMDQxNEM=\ntext/html\nThu,17Nov200518:49:58GMT\nx-oss-magic:abracadabra\nx-oss-meta-author:foo@bar.
com\n/oss-example/nelson",sha)Signature=base64.
b64encode(h.
digest())print("Signature:%s"%Signature)Thesignaturecalculationresultis26NBxoKd******Dv6inkoDft/yA=.
BasedontheformulaAuthorization="OSS"+AccessKeyId+":"+Signature,thevalueofAuthorizationisOSS44CF95900***BF252F707:26NBxoKd******Dv6inkoDft/yA=.
ThevalueisaddedwiththeAuthorizationheadertoformthemessagetobesent:PUT/nelsonHTTP/1.
0Authorization:OSS44CF95900***BF252F707:26NBxoKd******Dv6inkoDft/yA=Content-Md5:eB5eJF1ptWaXm4bijSPyxw==Content-Type:text/htmlDate:Thu,17Nov200518:49:58GMTHost:oss-example.
oss-cn-hangzhou.
aliyuncs.
comX-OSS-Meta-Author:foo@bar.
comX-OSS-Magic:abracadabraDetailanalysis:IftheenteredAccessKeyIDdoesnotexistorisnotactivated,403Forbiddenisreturned.
Errorcode:InvalidAccessKeyId.
Issue:2020032015ObjectStorageServiceAPIReference/4AccesscontrolIfthevalueoftheAuthorizationheaderintherequestisinaninvalidformat,400BadRequestisreturned.
Errorcode:InvalidArgument.
AllOSSrequestsmustusetheGMTtimeformatprovidedinHTTP1.
1.
Theformatisasfollows:date1=2DIGITSPmonthSP4DIGIT;daymonthyear(e.
g.
,02Jun1982).
Note:Inthisformat,dayisin2-digitform.
Therefore,"Jun2","2Jun1982",and"2-Jun-1982"areallinvalidformats.
Ifnodateisenteredorthedateisintheinvalidformatduringsignatureverication,403Forbiddenisreturned.
Errorcode:AccessDenied.
Therequestmustbeenteredwithin15minutesafterthecurrenttimeoftheOSSserver.
Otherwise,403Forbiddenisreturned.
Errorcode:RequestTimeTooSkewed.
IftheAccessKeyIDisactivatedbutOSSdeterminesthatthesignatureoftheuserrequestisincorrect,403Forbiddenisreturned.
Thecorrectsignaturestringforvericationandencryptionisreturnedtotheuserintheresponsemessage.
YoucancheckwhetherthesignaturestringiscorrectbasedontheresponseofOSS.
Sampleresponses:SignatureDoesNotMatchTherequestsignaturewecalculateddoesnotmatchthesignatureyouprovided.
Checkyourkeyandsigningmethod.
4745540a0a0a5765642c203131204d617920323031312030373a35393a323520474d540a2f75737265616c746573743f61636c1E446260FF9B****oss-cn-hangzhou.
aliyuncs.
***y5H7yzPsA/tP4+0tH1HHvPEwUv8=GETWed,11May201107:59:25GMT16Issue:20200320ObjectStorageServiceAPIReference/4Accesscontrol/oss-exampleaclAKIAIVAKMSMOY7VO****CalculatetheContent-MD5valueThemessagecontent"123456789"isusedasanexample.
ThefollowingsectionprovidesadetaileddescriptionaboutthecorrectandincorrectmethodstocalculatetheContent-MD5valueofthestring.
Correctmethod1.
CalculatetheMD5-encrypted128-bitbinaryarray.
2.
Encodethebinaryarray(insteadofthe32-bitstring)inBase64.
ThefollowingcodeprovidesanexampleonhowtocalculatetheContent-MD5valueinPython:>>>importbase64,hashlib>>>hash=hashlib.
md5()>>>hash.
update("0123456789")>>>base64.
b64encode(hash.
digest())'eB5eJF1ptWaXm4bijSPyxw=='Callthehash.
digest()functiontoobtaina128-bitbinaryarray.
>>>hash.
digest()'x\x1e^$]i\xb5f\x97\x9b\x86\xe2\x8d#\xf2\xc7'IncorrectmethodNote:Acommonincorrectmethodistodirectlyencodethe32-bitstringinBase64.
#Callthehash.
hexdigest()functiontoobtainavisible32-bitstring.
>>>hash.
hexdigest()'781e5e245d69b566979b86e28d23f2c7'#ResultofencodingtheMD5valueinBase64:>>>base64.
b64encode(hash.
hexdigest())Issue:2020032017ObjectStorageServiceAPIReference/4Accesscontrol'NzgxZTVlMjQ1ZDY5YjU2Njk3OWI4NmUyOGQyM2YyYzc='4.
3GenerateasignedURLInadditiontoincludingtheAuthorizationheaderintherequest,youcanalsoaddsignatureinformationtoaURLsothatyoucanforwardtheURLtoathirdpartyforauthorizedaccess.
Notice:IfyougenerateasignedURL,thedatathatisauthorizedwillbeexposedtotheInternetaslongastheauthorizationisvalid.
Werecommendthatyouassesstherisksinadvance.
AsignaturecannotbeincludedinaURLandaheaderatthesametime.
YoucanaddasignaturetoaURLinPUTandGETrequests.
SamplecodeThefollowingcodeprovidesanexampleonhowtogenerateasignedURLinPython:importbase64importhmacimportshaimporturllibh=hmac.
new("OtxrzxIsfpFjA7SwPzILwy8Bw21TLhquhboDYROV","GET\n\n\n1141889120\n/oss-example/oss-api.
pdf",sha)urllib.
quote(base64.
encodestring(h.
digest()).
strip())OSSSDKsprovidemethodsonhowtogenerateasignedURL.
Formoreinformation,seeSDKreference.
FormoreinformationabouthowtogenerateasignedURLforOSSSDKs,seethefollowingtable.
SDKURLsignaturemethodImplementationleJavaSDKOSSClient.
generatePresignedUrlOSSClient.
javaPythonSDKBucket.
sign_urlapi.
py.
NETSDKOssClient.
GeneratePresignedUriOssClient.
csPHPSDKOssClient.
signUrlOssClient.
php18Issue:20200320ObjectStorageServiceAPIReference/4AccesscontrolSDKURLsignaturemethodImplementationleJavaScriptSDKsignatureUrlobject.
jsCSDKoss_gen_signed_urloss_object.
cC++SDKOssClient::GeneratePresignedUrlOssClient.
ccImplementationThefollowingcodeprovidesanexampleonhowtogenerateasignedURL:http://oss-example.
oss-cn-hangzhou.
aliyuncs.
com/oss-api.
pdfOSSAccessKeyId=nz2pc56s936**9l&Expires=1141889120&Signature=vjbyPxybdZaNmGa%2ByT272YEAiv4%3DAsignedURLmustincludethefollowingthreeparameters:Signature,Expires,andOSSAccessKeyId.
Whenyougeneratethesignaturestring,replaceDatewithExpires,butincludetheheaderssuchasContent-TypeandContent-MD5denedinAddsignaturestoheaders.
(AlthoughDatestillexistsintherequestheader,youdonotneedtoaddittothesignaturestring.
)ExpiresspeciesthevalidityperiodoftheURL.
ThevalueofthisparameterisinUNIXtimeformat.
ThevalueisthenumberofsecondsthatelapsedsinceJanuary1,1970UTC.
IfthetimeOSSreceivestheURLrequestislaterthanthevalueofExpiresthatisincludedinthesignature,arequesttimeouterrorisreturned.
Forexample,thecurrenttimeis1141889060.
TocreateaURLthatisscheduledtoexpirein60seconds,youcansetthevalueofExpiresto1141889120.
Note:Forsecurityreasons,thedefaultvalidityperiodofaURLis3,600seconds.
ThemaximumvalidityperiodofaURLis32,400seconds.
OSSAccessKeyIdspeciestheAccessKeyIDofakey.
Signaturespeciesthesignatureinformation.
ForallrequestsandheadersthatOSSsupports,thesignaturealgorithmforaURLisbasicallythesameasthatforaheaderinAddsignaturestoheaders.
Signature=urlencode(base64(hmac-sha1(AccessKeySecret,VERB+"\n"+CONTENT-MD5+"\n"+CONTENT-TYPE+"\n"+EXPIRES+"\n"+CanonicalizedOSSHeadersIssue:2020032019ObjectStorageServiceAPIReference/4Accesscontrol+CanonicalizedResource)))FormoreinformationaboutvaluesoftheCONTENT-MD5,CanonicalizedOSSHeaders,andCONTENT-TYPEheaders,seeAddsignaturestoheaders.
Note:Thedierenceislistedasfollows:-WhenasignedURLiscreated,theExpiresparameterreplacestheDateparameter.
-IfmorethanoneSignature,Expires,orOSSAccessKeyIdvalueisimported,therstinputvalueisused.
-Beforeverifyingthesignatureofarequest,OSScheckstherequesttimetodeterminewhetheritislaterthanthetimespeciedinExpires.
-WhenyouaddasignaturestringtoaURL,youmustencodetheURL.
WhenyouaddasignaturetoatemporaryuserURL,youmustincludesecurity-token.
Theformatisasfollows:http://oss-example.
oss-cn-hangzhou.
aliyuncs.
com/oss-api.
pdfOSSAccessKeyId=nz2pc56s936**9l&Expires=1141889120&Signature=vjbyPxybdZaNmGa%2ByT272YEAiv4%3D&security-token=SecurityTokenErrorcodesErrorcodeErrormessageDescriptionAccessDenied403ForbiddenTheerrormessagereturnedbecauseoneormoreoftheSignature,Expires,andOSSAccessKeyIdparametersaremissing.
WhenasignatureisaddedtoaURL,thesequenceoftheSignature,Expires,andOSSAccessKeyIdparameterscanbeswapped.
20Issue:20200320ObjectStorageServiceAPIReference/4AccesscontrolErrorcodeErrormessageDescriptionAccessDenied403ForbiddenTheerrormessagereturnedbecausethecurrentaccesstimeislaterthantheExpiresvaluesetintherequest,orthetimeisinawrongformat.
InvalidArgument400BadRequestTheerrormessagereturnedbecauseaURLincludesoneormoreoftheSignature,Expires,andOSSAccessKeyIdparametersandtheheaderalsoincludesthesignatureinformation.
4.
4BucketaccesscontrolOSSprovidesanAccessControlList(ACL)forbucket-levelaccesscontrol.
Currently,threeACLsareavailableforabucket:public-read-write,public-read,andprivate.
ACLPermissionDescriptionpublic-read-writePublicreadandwriteAnyuser(includinganonymoususers)canperformread/writeoperations,anddeleteoperationsonobjectsinthebucket.
Warning:WerecommendyouthatdonotsettheACLofabuckettopublic-read-writetoavoidincurringexcessivefeesorhavingyouraccountsuspendedduetomaliciousorillegalactivitiesofanotheruser.
Issue:2020032021ObjectStorageServiceAPIReference/4AccesscontrolACLPermissionDescriptionpublic-readPublicreadandprivatewriteOnlytheownerofthebucketcanperformwriteoperationsonobjectsinthebucket.
Allotherusers(includinganonymoususers)canonlyperformreadoperationsonobjectsinthebucket.
Warning:WerecommendthatyouexercisecautionwhensettingthisACLbecauseitauthorizesanyusertoperformreadoperationsonobjectsinthebucketthroughtheInternet,whichmayincurexcessivefees.
privatePrivatereadandwriteOnlytheownerofthebucketcanperformread/writeoperationsontheobjectsinthebucket.
Otheruserscannotaccesstheobjects.
Note:IfyoudonotsetanACLforabucketwhenyoucreateit,itsACLissettoprivateautomatically.
IftheACLruleofthebucketissettoprivate,onlyauthorizeduserscanaccessandoperateonobjectsinthebucket.
Formoreinformationaboutaccesscontrol,seeAccesscontrol.
OnlythecreatorofanexistingbucketcanmodifytheACLforthebucketbyusingthePutBucketACLAPI.
22Issue:20200320ObjectStorageServiceAPIReference/5Serviceoperations5Serviceoperations5.
1GetService(ListBuckets)Youcancallthisoperationtoobtainallbucketsthatyouown.
Theforwardslash(/)intherequestsyntaxrepresentstherootdirectory.
Note:TheGetService(ListBuckets)operationisvalidonlyforauthenticatedusers.
RequestsyntaxGET/HTTP/1.
1Host:oss.
example.
comDate:GMTDateAuthorization:SignatureValueRequestparametersNote:WhenusingGetService(ListBuckets),youcansettheparametersdescribedinthefollowingtabletolimitthelistofbucketsreturnedsothatonlyspeciedresultsarereturned.
ParameterTypeRequiredDescriptionprexStringNoSpeciestheprexthatreturnedbucketnamesmustcontain.
Ifthisparameterisnotspecied,prexinformationisnotusedtolterthereturnedbuckets.
Defaultvalue:nullmarkerStringNoSpeciesthenameofthebucketafterwhichthelistbegins.
Ifthisparameterisnotspecied,allresultsarereturned.
Defaultvalue:nullIssue:2020032023ObjectStorageServiceAPIReference/5ServiceoperationsParameterTypeRequiredDescriptionmax-keysStringNoSpeciesthemaximumnumberofbucketsthatcanbereturnedeachtime.
Ifthisparameterisnotspecied,defaultvalue100isused.
Themaximumvalueis1000.
Defaultvalue:100ResponseelementsNote:Whenallbucketsarereturned,thereturnedXMLdoesnotcontainPrex,Marker,MaxKeys,IsTruncated,andNextMarker.
Ifsomeresultsarenotreturned,theprecedingnodesareadded.
ElementTypeDescriptionListAllMyBucketsResultContainerIndicatesthecontainerusedtostoreresultsoftheGetServicerequest.
Childnode:OwnerandBucketsParentnode:nonePrexStringIndicatestheprexthatthereturnedobjectnamesmustcontain.
Parentnode:ListAllMyBucketsResultMarkerStringIndicatesthenameofthebucketafterwhichthelistbegins.
Parentnode:ListAllMyBucketsResultMaxKeysStringIndicatesthemaximumnumberofbucketsreturnedeachtime.
Parentnode:ListAllMyBucketsResult24Issue:20200320ObjectStorageServiceAPIReference/5ServiceoperationsElementTypeDescriptionIsTruncatedBooleanIndicateswhetherallresultshavebeenreturned.
Validvalues:trueandfalsetrueindicatesthatnotallresultsarereturnedthistime.
falseindicatesthatallresultshavebeenreturnedthistime.
Parentnode:ListAllMyBucketsResultNextMarkerStringIndicatesthemarkerforthenextGetService(ListBuckets)request,whichcanbeusedtoreturntheresultsthatarenotreturnedthistime.
Parentnode:ListAllMyBucketsResultOwnerContainerIndicatesthecontainerusedtostoretheinformationaboutthebucketowner.
Parentnode:ListAllMyBucketsResultIDStringIndicatestheuserIDofthebucketowner.
Parentnode:ListAllMyBucketsResult.
OwnerDisplayNameStringIndicatesthenameofthebucketowner,whichiscurrentlythesameastheuserID.
Parentnode:ListAllMyBucketsResult.
OwnerBucketsContainerIndicatesthecontainerthatstorestheinformationaboutmultiplebuckets.
Childnode:BucketParentnode:ListAllMyBucketsResultIssue:2020032025ObjectStorageServiceAPIReference/5ServiceoperationsElementTypeDescriptionBucketContainerIndicatesthecontainerusedtostorethebucketinformation.
Childnode:Name,CreationDate,andLocationParentnode:ListAllMyBucketsResult.
BucketsNameStringIndicatesthenameofthebucket.
Parentnode:ListAllMyBucketsResult.
Buckets.
BucketCreateDateTime(Format:yyyy-mm-ddThh:mm:ss.
timezone.
Example:2011-12-01T12:27:13.
000Z)Indicatesthetimewhenthebucketiscreated.
Parentnode:ListAllMyBucketsResult.
Buckets.
BucketLocationStringIndicatesthedatacenterinwhichthebucketislocated.
Parentnode:ListAllMyBucketsResult.
Buckets.
BucketExtranetEndpointStringIndicatesthepublicendpointusedtoaccessthebucketovertheInternet.
Parentnode:ListAllMyBucketsResult.
Buckets.
BucketIntranetEndpointStringIndicatestheinternalendpointusedtoaccessthebucketfromECSinstancesinthesameregion.
Parentnode:ListAllMyBucketsResult.
Buckets.
BucketStorageClassStringIndicatesthestorageclassofthebucket.
Validvalues:Standard,IA,andArchive.
Parentnode:ListAllMyBucketsResult.
Buckets.
Bucket26Issue:20200320ObjectStorageServiceAPIReference/5ServiceoperationsElementTypeDescriptionCommentStringIndicatesthecommentsonthebucket.
Parentnode:ListAllMyBucketsResult.
Buckets.
BucketExamplesSamplerequest1GET/HTTP/1.
1Date:Thu,15May201411:18:32GMTHost:oss-cn-hangzhou.
aliyuncs.
comAuthorization:OSSnxj7dtlhcyl5hpvnhi:COS3OQkfQPnKmYZTEHYv2******Sampleresponse1HTTP/1.
1200OKDate:Thu,15May201411:18:32GMTContent-Type:application/xmlContent-Length:556Connection:keep-aliveServer:AliyunOSSx-oss-request-id:5374A2880232A65C2300****512**512642015-12-17T18:12:43.
000Zoss-cn-shanghai.
aliyuncs.
comoss-cn-shanghai-internal.
aliyuncs.
comoss-cn-shanghaiapp-base-osscn-shanghaiStandard2014-12-25T11:21:04.
000Zoss-cn-hangzhou.
aliyuncs.
comoss-cn-hangzhou-internal.
aliyuncs.
comoss-cn-hangzhouatestleo23cn-hangzhouIAIssue:2020032027ObjectStorageServiceAPIReference/5ServiceoperationsSamplerequest2GET/prefix=xz02tphky6fjfiuc&max-keys=1HTTP/1.
1Date:Thu,15May201411:18:32GMTHost:oss-cn-hangzhou.
aliyuncs.
comAuthorization:OSSnxj7dtwhcyl5hpvnhi:COS3OQkfQPnKmYZTEHYv2****Sampleresponse2HTTP/1.
1200OKDate:Thu,15May201411:18:32GMTContent-Type:application/xmlContent-Length:545Connection:keep-aliveServer:AliyunOSSx-oss-request-id:5374A2880232A65C2300****xz02tphky6fjfiuc1truexz02tphky6fjfiuc0ut_test_put_bucketut_test_put_bucket2014-05-15T11:18:32.
000Zoss-cn-hangzhou.
aliyuncs.
comoss-cn-hangzhou-internal.
aliyuncs.
comoss-cn-hangzhouxz02tphky6fjfiuc0cn-hangzhouStandardSDKsTheSDKsoftheGetServiceoperationforvariousprogramminglanguagesareasfollows:JavaPythonPHPGoC.
NET28Issue:20200320ObjectStorageServiceAPIReference/5ServiceoperationsiOSNode.
jsRubyErrorcodesErrorcodeHTTPstatuscodeDescriptionAccessDenied403Theerrormessagereturnedbecausetherequestisfromanonymousaccessandincludesnouserauthenticationinformation.
Issue:2020032029ObjectStorageServiceAPIReference/6Bucketoperations6Bucketoperations6.
1PutBucketYoucancallthisoperationtocreateabucket.
Note:Anonymousaccessisnotsupported.
Youcancreateupto100bucketsinthesameregionwithanAlibabaCloudaccount.
Eachregionhascorrespondingendpoints.
Formoreinformationaboutthemappingsbetweenregionsandendpoints,seeRegionsandendpoints.
RequestsyntaxPUT/HTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDatex-oss-acl:PermissionAuthorization:SignatureValueStandardRequestheadersHeaderTypeRequiredDescriptionx-oss-aclStringNoSpeciesthebucketACL.
Validvalues:publicread/write,publicread,andprivateNote:IfnoACLisspeciedforthecreatedbucket,thebucketACLissettoprivatebydefault.
30Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsRequestelementsElementTypeRequiredDescriptionStorageClassStringNoSpeciesthestorageclassofthebucket.
Validvalues:StandardIA(InfrequentAccess)ArchiveNote:Ifnostorageclassisspeciedforthebucket,thestorageclassissettoStandardbydefault.
DataRedundancyTypeStringNoSpeciesthetypeofdisasterrecoveryforabucket.
Validvalues:LRS(localdisasterrecovery,defaultvalue)ZRS(zonedisasterrecovery)ExamplesSamplerequestsPUT/HTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Fri,24Feb201703:15:40GMTx-oss-acl:privateAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:77Dvh5wQgIjWjwO/KyRt8dOP****StandardSampleresponsesHTTP/1.
1200OKx-oss-request-id:534B371674E88A4D8906****Date:Fri,24Feb201703:15:40GMTIssue:2020032031ObjectStorageServiceAPIReference/6BucketoperationsLocation:/oss-exampleContent-Length:0Connection:keep-aliveServer:AliyunOSSSDKsTheSDKsofthePutBucketoperationforvariousprogramminglanguagesareasfollows:JavaPythonPHPGoC.
NETAndroidiOSNode.
jsRubyErrorcodesErrorcodeHTTPstatuscodeDescriptionInvalidBucketName400Theerrormessagereturnedbecausethebucketnamedoesnotcomplywiththenamingconventions.
AccessDenied403TheerrormessagereturnedbecausetheinformationforuserauthenticationisnotimportedwhenyouinitiateaPutBucketrequest.
Theerrormessagereturnedbecauseyouarenotauthorizedtoperformthisoperation.
TooManyBuckets400Theerrormessagereturnedbecausethenumberofbucketstobecreatedexceedstheupperlimit.
Youcancreateupto100bucketsinaregion.
32Issue:20200320ObjectStorageServiceAPIReference/6Bucketoperations6.
2DeleteBucketDeletesabucket.
Note:Onlytheownerofabucketcandeletethebucket.
Topreventaccidentaldeletion,usersarenotallowedtodeleteabucketthatisnotempty.
RequestsyntaxDELETE/HTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueExamplesDeleteabucketnormally.
Requestexample:DELETE/HTTP/1.
1Host:test.
oss-cn-hangzhou.
aliyuncs.
comAccept-Encoding:identityUser-Agent:aliyun-sdk-python/2.
6.
0(Windows/7/AMD64;3.
7.
0)Accept:*/*Connection:keep-alivedate:Tue,15Jan201908:19:04GMTauthorization:OSSqn6qrrqxo2oawuk53otfjbyc:ceOEyZavKY4QcjoUWYSpYbJ3naA=Content-Length:0Responseexample:HTTP/1.
1204NoContentServer:AliyunOSSDate:Tue,15Jan201908:19:04GMTContent-Length:0Connection:keep-alivex-oss-request-id:5C3D9778CC1C2AEDF85BD9B7x-oss-server-time:190Thebuckettobedeleteddoesnotexist.
Requestexample:DELETE/HTTP/1.
1Host:test.
oss-cn-hangzhou.
aliyuncs.
comAccept-Encoding:identityUser-Agent:aliyun-sdk-python/2.
6.
0(Windows/7/AMD64;3.
7.
0)Accept:*/*Connection:keep-aliveIssue:2020032033ObjectStorageServiceAPIReference/6Bucketoperationsdate:Tue,15Jan201907:53:24GMTauthorization:OSSqn6qrrqxo2oawuk53otfjbyc:ceOEyZavKY4QcjoUWYSpYbJ3naA=Content-Length:0Responseexample:HTTP/1.
1404NotFoundServer:AliyunOSSDate:Tue,15Jan201907:53:25GMTContent-Type:application/xmlContent-Length:288Connection:keep-alivex-oss-request-id:5C3D9175B6FC201293AD4890NoSuchBucketThespecifiedbucketdoesnotexist.
5C3D9175B6FC201293AD4890test.
oss-cn-hangzhou.
aliyuncs.
comtestThebuckettobedeletedisnotempty.
Requestexample:DELETE/HTTP/1.
1Host:test.
oss-cn-hangzhou.
aliyuncs.
comAccept-Encoding:identityUser-Agent:aliyun-sdk-python/2.
6.
0(Windows/7/AMD64;3.
7.
0)Accept:*/*Connection:keep-alivedate:Tue,15Jan201907:35:06GMTauthorization:OSSqn6qrrqxo2oawuk53otfjbyc:ceOEyZavKY4QcjoUWYSpYbJ3naA=Content-Length:0Responseexample:HTTP/1.
1409ConflictServer:AliyunOSSDate:Tue,15Jan201907:35:06GMTContent-Type:application/xmlContent-Length:296Connection:keep-alivex-oss-request-id:5C3D8D2A0ACA54D87B43C048x-oss-server-time:16BucketNotEmptyThebucketyoutriedtodeleteisnotempty.
5C3D8D2A0ACA54D87B43C048test.
oss-cn-hangzhou.
aliyuncs.
comtest34Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsSDKTheSDKsofthisAPIareasfollows:JavaPythonPHPGoC.
NETAndroidiOSNode.
jsRubyErrorcodesErrorcodeHTTPstatuscodeDescriptionAccessDenied403ForbiddenYoudonothavethepermissiontodeletethebucket.
Onlytheownerofabucketcandeletethebucket.
6.
3PutBucketACLModiestheACLforabucket.
Onlythebucketownercanperformthisoperation.
Note:WhenthebucketownerinitiatesaPutBucketACLrequest:TheACLisupdatedifthebucketalreadyexistsandhasadierentACL.
AbucketwiththerequestedACLiscreatediftherequestedbucketdoesnotexist.
RequestsyntaxPUT/aclHTTP/1.
1x-oss-acl:PermissionHost:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateIssue:2020032035ObjectStorageServiceAPIReference/6BucketoperationsAuthorization:SignatureValueRequestheaderParameterTypeRequiredDescriptionx-oss-aclStringYesSpeciestheACLforthebucket.
ThisparameterisincludedinthePutBucketACLrequesttosettheACLforthebucket.
Ifthisheaderisnotincluded,theACLsettingsdonottakeeect.
Validvalues:public-read-write,public-read,andprivateExamplesRequestexample:PUT/aclHTTP/1.
1x-oss-acl:public-readHost:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Fri,24Feb201203:21:12GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:KU5h8YMUC78M30dXqf3JxrTZHiA=Normalresponseexample:HTTP/1.
1200OKx-oss-request-id:534B371674E88A4D8906008BDate:Fri,24Feb201203:21:12GMTContent-Length:0Connection:keep-aliveServer:AliyunOSSResponseexamplethatindicatesthattheACLsettingsdonottakeeect:HTTP/1.
1400BadRequestx-oss-request-id:56594298207FB304438516F9Date:Fri,24Feb201203:55:00GMTContent-Length:309Content-Type:text/xml;charset=UTF-8Connection:keep-aliveServer:AliyunOSSInvalidArgumentnosuchbucketaccesscontrolexists5***9***-test.
example.
comx-oss-aclerror-acl36Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsSDKTheSDKsofthisAPIareasfollows:JavaPythonPHPGoC.
NETNode.
jsRubyErrorcodeErrorcodeHTTPstatuscodeDescriptionAccessDenied403AuthenticationinformationabouttheuserisnotincludedinthePutBucketACLrequest.
YoudonothavethepermissiontoinitiateaPutBucketACLrequest.
Onlythebucketownercanperformthisoperation.
6.
4GetBucketAclObtainstheACLforabucket.
OnlytheownerofabucketcanobtaintheACLforthebucket.
RequestsyntaxGET/aclHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateIssue:2020032037ObjectStorageServiceAPIReference/6BucketoperationsAuthorization:SignatureValueResponseelementsElementsTypeDescriptionAccesscontrollistContainerSpeciesthecontainerusedtostoretheACLinformation.
Parentnode:AccessControlPolicyAccessControlPolicyContainerSpeciesthecontainerthatstorestheresulttotheGetBucketACLrequest.
Parentnode:NoneDisplaynameStringIndicatesthenameofthebucketowner,whichisthesameasthevalueofID.
ParentNode:AccessControlPolicy.
OwnerGrantEnumeratedstringIndicatestheACLforthebucket.
Validvalues:private,public-read,andpublic-read-writeParentnode:AccessControlPolicy.
AccessControlListIDStringIndicatestheuserIDofthebucketowner.
Parentnode:AccessControlPolicy.
OwnerOwnerContainerIndicatesthecontainerusedtostoretheinformationaboutthebucketowner.
Parentnode:AccessControlPolicyExamplesRequestexample:GET/aclHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Fri,24Feb201204:11:23GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:CTkuxpLAi4XZ+WwIfNm0FmgbrQ0=Responseexample:HTTP/1.
1200OKx-oss-request-id:534B371674E88A4D8906008B38Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsDate:Fri,24Feb201204:11:23GMTContent-Length:253Content-Type:application/xmlConnection:keep-aliveServer:AliyunOSS00220120222user_examplepublic-readSDKTheSDKsofthisAPIareasfollows:JavaPythonPHPGoC.
NETNode.
jsRubyErrorcodesErrorcodeHTTPstatuscodeDescriptionNoSuchBucket404Thetargetbucketdoesnotexist.
AccessDenied403Youdonothavethepermissiontoperformthisoperation.
OnlytheownerofabucketcanobtaintheACLforthebucket.
6.
5PutBucketLifecycleYoucancallthisoperationtocongurelifecyclerulesforabucket.
Afteryoucongurelifecyclerulesforabucket,OSSautomaticallydeletestheIssue:2020032039ObjectStorageServiceAPIReference/6Bucketoperationsobjectsthatmatchthelifecyclerules.
OnlytheownerofabucketcaninitiateaPutBucketLifecyclerequestforthebucket.
Note:Ifnolifecycleruleshavebeenconguredforabucket,thePutBucketLifecycleoperationcreatesalifecycleruleforthebucket.
Ifalifecyclerulehasbeenconguredforthebucket,thisoperationcreatesalifecyclerulethatoverwritestheexistingone.
PutBucketLifecycleusestheoverwritingsemantics.
Anewlifecycleruleoverwritestheexistingrule.
Ifyouwanttocongureanewlifecycleruleforabucket,youmustcalltheGetBucketLifecycleoperationtoobtainthecurrentlifecyclecongurationsofthebucket,addanewlifecycleconguration,andcallthePutBucketLifecycleoperationtoupdatethelifecyclecongurationsforthebucket.
YoucancallthePutBucketLifecycleoperationtosetavalidityperiodforanobjectorapartthatisgeneratedinanincompletemultipartuploadtask.
RequestsyntaxPUT/lifecycleHTTP/1.
1Date:GMTDateContent-Length:ContentLengthContent-Type:application/xmlAuthorization:SignatureValueHost:BucketName.
oss.
aliyuncs.
comRuleIDPrefixStatusDaysDaysStorageClassDays40Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsRequestelementsElementTypeRequiredDescriptionCreatedBeforeDateStringDaysorCreatedBeforeDateSpeciesadate.
OSSrunslifecyclerulesforobjectsthatarelastmodiedbeforethisdate.
ThedatemustconformtotheISO8601standard.
ThetimemustbeinUTC.
Forexample,2002-10-11T00:00:00.
000Zindicatesthatobjectslastupdatedbefore2002-10-11T00:00:00.
000Zaredeletedorthestorageclassesoftheseobjectsareconvertedtoanotherstorageclass.
Objectslastupdatedatorafterthistimearenotdeletedortheirstorageclassesarenotconvertedtoanotherstorageclass.
Parentnode:ExpirationorAbortMultipartUploadDaysPositiveintegerDaysorCreatedBeforeDateSpeciesthenumberofdayswithinwhichobjectscanberetainedaftertheyarelastmodied.
Parentnode:ExpirationIssue:2020032041ObjectStorageServiceAPIReference/6BucketoperationsElementTypeRequiredDescriptionExpirationContainerNoSpeciestheoperationontheobjectsforthelifecyclerule.
Note:Foranobjectinaversioning-enabledbucket,thiselementonlyspeciesthevalidityperiodofthecurrentversionoftheobject.
Childnode:DaysorCreatedBeforeDate,orExpiredObjectDeleteMarkerParentnode:RuleAbortMultipartUploadContainerNoSpeciestheoperationonthemultipartuploadtasksthatarenotcomplete.
Childnode:DaysorCreatedBeforeDateParentnode:RuleIDStringNoSpeciestheuniqueIDofalifecyclerule.
AnIDiscomposedofupto255bytes.
Ifthevalueofthisparameterisnullornotspecied,OSSautomaticallygeneratesauniqueIDforthelifecyclerule.
Childnode:noneParentnode:RuleLifecycleCongurationContainerYesSpeciesthecontainerusedtostorelifecyclecongurations.
Thecontainercancontainupto1,000rules.
Chilenode:RuleParentnode:none42Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsElementTypeRequiredDescriptionPrexStringYesSpeciestheprexforarule.
Theruleappliesonlytoobjectswhosenamescontainthespeciedprex.
Theprexesspeciedbydierentrulescannotoverlap.
Childnode:noneParentnode:RuleRuleContainerYesSpeciesarule.
Note:Youcannotcreatearuletoconvertthestorageclassofobjectsforanarchivebucket.
ThevalidityperiodspeciedforExpirationmustbelongerthanthatspeciedforTransition.
Likewise,theexpiratetimespeciedforExpirationmustbelaterthanthatspeciedforTransition.
Childnode:ID,Prex,Status,andExpirationParentnode:LifecycleCongurationStatusStringYesThevalueofEnabledindicatesthatOSSrunstherule.
ThevalueofDisabledindicatesthatOSSignorestherule.
Parentnode:RuleValidvalues:EnabledandDisabledIssue:2020032043ObjectStorageServiceAPIReference/6BucketoperationsElementTypeRequiredDescriptionStorageClassStringYesifTransitionorNoncurrentVersionTransitionisconguredSpeciesthecurrentstorageclassoftheobject.
Note:YoucanconvertthestorageclassofanobjectinanIAbuckettoArchive,butnotStandard.
Validvalues:IAandArchiveParentnode:TransitionTransitionContainerNoSpeciesthevalidityperiodwithinwhichobjectscanberetainedandtheconversionoperationontheobjects.
Afterthevalidityperiodexpires,thestorageclassoftheobjectscanbeconvertedtoIAorArchive.
Note:ThestorageclassofstandardobjectscanbeconvertedtoIAorArchive.
NotethatthevalidityperiodforconversiontoArchivemustbelongerthanthatforconversiontoIA.
Forexample,ifthevalidityperiodissetto30forobjectswhosestorageclassesareconvertedtoIAafterthevalidityperiodexpires,thevalidityperiodmustbesettoavaluegreaterthan30forobjectswhosestorageclassesareconvertedtoArchive.
TagContainerNoSpeciestheobjecttagforarule.
Youcansetmultipletags.
Parentnode:RuleChildnode:KeyandValue44Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsElementTypeRequiredDescriptionKeyStringYesifTagisconguredSpeciesthetagkey.
Parentnode:TagValueStringYesifTagisconguredSpeciesthetagvalue.
Parentnode:TagNoncurrentDaysStringYesifNoncurrentVersionTransitionorNoncurrentVersionExpirationisconguredSpeciesthenumberofdayswithinwhichthepreviousversionscanberetained.
Whenthecurrentversionsexpire,theyrollbacktothepreviousversions.
Parentnode:NoncurrentVersionTransitionandNoncurrentVersionExpirationNoncurrentVersionTransitionContainerNoSpeciesthevalidityperiodwithinwhichpreviousversionscanberetainedandtheconversionoperationonthepreviousversions.
Afterthevalidityperiodexpires,thestorageclassofthepreviousversionscanbeconvertedtoIAorArchive.
Note:ThestorageclassofstandardobjectscanbeconvertedtoIAorArchive.
NotethatthevalidityperiodforconversiontoArchivemustbelongerthanthatforconversiontoIA.
Forexample,ifthevalidityperiodissetto30forpreviousversionswhosestorageclassesareconvertedtoIAafterthevalidityperiodexpires,thevalidityperiodmustbesettoavaluegreaterthan30forpreviousversionswhosestorageclassesareconvertedtoArchive.
Childnode:NoncurrentDaysandStorageClassIssue:2020032045ObjectStorageServiceAPIReference/6BucketoperationsElementTypeRequiredDescriptionNoncurrentVersionExpirationContainerNoSpeciestheoperationonthepreviousversionsoftheobject.
Childnode:NoncurrentDaysExpiredObjectDeleteMarkerStringNoSpecieswhetherexpireddeletemarkersareautomaticallyremoved.
Validvalues:True:indicatesthatexpireddeletemarkersareautomaticallyremoved.
False:indicatesthatexpireddeletemarkersarenotautomaticallyremoved.
Parentnode:ExpirationExamplesRequestexampleforanunversionedbucketPUT/lifecycleHTTP/1.
1Host:oss-example.
oss.
aliyuncs.
comContent-Length:443Date:Thu,8Jun201713:08:38GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:PYbzsdWAIWAlMW8luk*****deleteobjectsandpartsafteronedaylogs/Enabled11transitobjectstoIAafter30,toArchive60,expireafter10yearsdata/Enabled30IA60Archive46Issue:20200320ObjectStorageServiceAPIReference/6Bucketoperations3600transitobjectstoArchiveafter60daysimportant/Enabled6Archivedeletecreatedbeforedatebackup/Enabled2017-01-01T00:00:00.
000Z2017-01-01T00:00:00.
000Zr1rule1xx1yy2Enabled30r2rule2xx1Enabled60ArchiveSampleresponseHTTP/1.
1200OKx-oss-request-id:534B371674A4D890*****Date:Thu,8Jun201713:08:38GMTContent-Length:0Connection:keep-aliveServer:AliyunOSSSamplerequestforaversioning-enabledbucketPUT/lifecycleHTTP/1.
1Host:oss-example.
oss.
aliyuncs.
comContent-Length:336Issue:2020032047ObjectStorageServiceAPIReference/6BucketoperationsDate:Mon,6May201915:23:20GMTAuthorization:OSSWnjl3fg9fdv8fg4b8sdf:Phuu8bBhS8dsff2a*****deleteexamplelogs/Enabledtrue51transitexampledata/Enabled30IA10IASampleresponseHTTP/1.
1200OKx-oss-request-id:7D3435J59A9812B*****Date:Mon,6May201915:23:20GMTContent-Length:0Connection:keep-aliveServer:AliyunOSSSDKsTheSDKsofthePutBucketLifecycleoperationforvariousprogramminglanguagesareasfollows:JavaPythonPHPGoC.
NET48Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsNode.
jsRubyErrorcodesErrorcodeHTTPstatuscodeDescriptionAccessDenied403Theerrormessagereturnedbecauseyouarenotauthorizedtoperformthisoperation.
OnlytheownerofabucketcaninitiatethePutBucketLifecyclerequestforthebucket.
InvalidArgument400ThestorageclassofstandardobjectscanbeconvertedtoIAorArchive.
ThestorageclassofstandardobjectscanbeconvertedtoIAorArchive.
NotethatthevalidityperiodforconversiontoArchivemustbelongerthanthatforconversiontoIA.
ThevalidityperiodspeciedforExpirationmustbelongerthanthatspeciedforTransition.
Likewise,theexpiratetimespeciedforExpirationmustbelaterthanthatspeciedforTransition.
6.
6GetBucketLifecycleViewsthelifecyclerulesforabucket.
Onlytheownerofabucketcanviewthelifecyclerulesforthebucket.
RequestsyntaxGET/lifecycleHTTP/1.
1Host:BucketName.
oss.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueExamplesRequestexample:Get/lifecycleHTTP/1.
1Host:oss-example.
oss.
aliyuncs.
comDate:Mon,14Apr201401:17:29GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:ceOEyZavKY4QcjoUWYSpYbJ3naA=Issue:2020032049ObjectStorageServiceAPIReference/6BucketoperationsResponseexamplereturnedwhenlifecyclerulesareconguredforthebucket:HTTP/1.
1200x-oss-request-id:534B371674E88A4D8906008BDate:Mon,14Apr201401:17:29GMTConnection:keep-aliveContent-Length:255Server:AliyunOSSdeleteafteronedaylogs/Enabled1Responseexamplereturnedwhennobucketlifecyclerulesareconguredforthebucket:HTTP/1.
1404x-oss-request-id:534B371674E88A4D8906****Date:Mon,14Apr201401:17:29GMTConnection:keep-aliveContent-Length:278Server:AliyunOSSoss-exampleNoSuchLifecycleNoRowfoundinLifecycleTable.
534B372974E88A4D8906****BucketName.
oss.
example.
comSDKTheSDKsofthisAPIareasfollows:JavaPythonPHPGoC.
NET50Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsNode.
jsRubyErrorcodesErrorcodeHTTPstatuscodeDescriptionAccessDenied403ForbiddenYoudonothavethepermissiontoviewthelifecyclerulesforthebucket.
Onlytheownerofabucketcanviewthelifecyclerulesforthebucket.
NoSuchBucketorNoSuchLifecycle404NotFoundThebucketdoesnotexistornolifecyclerulesareconguredforthebucket.
6.
7DeleteBucketLifecycleDeletesthelifecyclerulesforaspeciedbucket.
AfteryoudeletealllifecyclerulesforaspeciedbucketbyusingthisAPI,theobjectsstoredinthebucketarenolongerautomaticallydeletedbecauseofthelifecyclerules.
Onlytheownerofabucketcandeletethelifecyclerulesforthebucket.
RequestsyntaxDELETE/lifecycleHTTP/1.
1Host:BucketName.
oss.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueExamplesRequestexample:DELETE/lifecycleHTTP/1.
1Host:BucketName.
oss.
aliyuncs.
comDate:Mon,14Apr201401:17:35GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:6ZVHOehYzxoC1yxRydPQs/Cn****Responseexample:HTTP/1.
1204NoContentx-oss-request-id:534B371674E88A4D8906****Date:Mon,14Apr201401:17:35GMTConnection:keep-aliveContent-Length:0Server:AliyunOSSIssue:2020032051ObjectStorageServiceAPIReference/6BucketoperationsSDKTheSDKsofthisAPIareasfollows:JavaPythonPHPGoC.
NETNode.
jsRubyErrorcodesErrorcodeHTTPstatuscodeDescriptionNoSuchBucket404Thetargetbucketdoesnotexist.
AccessDenied403ForbiddenYoudonothavethepermissiontodeletethelifecyclerulesforthebucket.
Onlytheownerofabucketcandeletethelifecyclerulesforthebucket.
6.
8GetBucket(ListObject)Liststheinformationaboutallobjectsinabucket.
RequestsyntaxGET/HTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueRequestelementsWhenyouinitiateaGetBucket(ListObject)request,youcanuseprex,marker,delimiter,andmax-keystoprescribealimittotheListObjectoperationtoreturnpartialresults.
52Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsElementTypeRequiredDescriptiondelimiterStringNoSpeciesacharacterusedtogroupobjectnames.
Allthenamesoftheobjectsthatcontainaspeciedprexandafterwhichthedelimiteroccursforthersttime,actasagroupofelements,thatis,CommonPrexes.
Defaultvalue:NonemarkerStringNoSetsthereturnedresultstobeginfromtherstentryafterthemarkerinalphabeticalorder.
Defaultvalue:Nonemax-keysStringNoLimitsthemaximumnumberofobjectsreturnedforonerequest.
Themax-keysvaluecannotexceed1000.
Defaultvalue:100Ifthelistingoperationcannotbecompletedatonetimebecauseofthelimitssetbymax-keys.
Aisincludedintheresponsetoindicatesthemarkerforthenextlistingoperation.
prefixStringNoLimitsthatthereturnedobjectkeymustbeprexedaccordingly.
Notethatthekeysreturnedfromqueriesusingaprexstillcontaintheprex.
Defaultvalue:NoneIssue:2020032053ObjectStorageServiceAPIReference/6BucketoperationsElementTypeRequiredDescriptionencoding-typeStringNoEncodesthereturnedresultsandspeciestheencodingtype.
Parametersdelimiter,marker,prex,NextMarker,andkeyuseUTF-8characters,buttheXML1.
0Standarddoesnotsupportparsingcertaincontrolcharacters,suchascharacterswithASCIIvaluesrangingfrom0to10.
IfsomeelementsinthereturnedresultscontaincharactersthatarenotsupportedbytheXML1.
0Standard,encoding-typecanbespeciedtoencodetheseelements,suchasdelimiter,marker,prex,NextMarker,andkey.
Defaultvalue:NoneOptionalvalue:urlNote:XML1.
0doesnotsupportparsingcertaincontrolcharacters,suchascharacterswithASCIIvaluesrangingfrom0to10.
IfsomeelementsinthereturnedresultscontaincharactersthatarenotsupportedbyXML1.
0,youcansetthevalueofencoding-typetoencodetheseelements,suchasdelimiter,marker,prex,NextMarker,andkey.
ResponseelementsElementTypeDescriptionContentsContainerIndicatesthecontainerusedtostoreeveryreturnedobjectmeta.
Parentnode:ListBucketResultCommonPrefixesStringIfthedelimiterparameterisspeciedintherequest,theresponsereturnedbyOSScontainstheCommonPrexeselement.
Thiselementindicatesthesetofobjectswhichendswithadelimiterandhaveacommonprex.
Parentnode:ListBucketResult54Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionDelimiterStringIndicatesacharacterusedtogroupobjectnames.
Allthoseobjectswhosenamescontainthespeciedprexandafterwhichthedelimiteroccursforthersttime,actasagroupofelements,thatis,CommonPrexes.
Parentnode:ListBucketResultEncodingTypeStringIndicatestheencodingtypeforthereturnedresults.
Ifencoding-typeisspeciedinarequest,thefollowingelementsinthereturnedresultsareencoded:delimiter,marker,prex,NextMarker,andkey.
Parentnode:ListBucketResultDisplayNameStringIndicatesthenameoftheobjectowner.
Parentnode:ListBucketResult.
Contents.
OwnerETagStringTheETag(entitytag)iscreatedwhenanobjectisgeneratedandisusedtoindicatethecontentoftheobject.
Parentnode:ListBucketResult.
ContentsForanobjectcreatedbyaPutObjectrequest,thevalueofETagisthevalueofMD5inthecontentoftheobject.
Foranobjectcreatedinotherway,thevalueofETagistheUUIDinthecontentoftheobject.
ThevalueofETagcanbeusedtocheckwhetherthecontentoftheobjectischanged.
WerecommendthattheETagbeusedastheMD5valueoftheobjectcontenttoverifydataintegrity.
IDStringUserIDofthebucketowner.
Parentnode:ListBucketResult.
Contents.
OwnerIssue:2020032055ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionIsTruncatedEnumeratedstringIndicateswhetherallresultsarereturned.
Validvalues:trueandfalsetrueindicatesthatnotallresultsarereturnedfortherequest.
falseindicatesthatallresultsarereturnedfortherequest.
Parentnode:ListBucketResultKeyStringIndicatesthekeyofanobjectParentnode:ListBucketResult.
ContentsLastModiedTimeIndicatesthetimewhentheobjectislastmodied.
Parentnode:ListBucketResult.
ContentsListBucketResultContainerIndicatesthecontainerusedtostoretheresultsoftheGetBucket(ListObject)request.
Sub-node:Name,Prex,Marker,MaxKeys,Delimiter,IsTruncated,Nextmarker,andContentsParentnode:NoneMarkerStringMarksthepositionwherethecurrentGetBucket(ListObject)operationstarts.
Parentnode:ListBucketResultMaxKeysStringIndicatesthemaximumnumberofreturnedresultsintheresponsetotherequest.
Parentnode:ListBucketResultNameStringIndicatesthenameofthebucket.
Parentnode:ListBucketResultOwnerContainerIndicatesthecontainerusedtostoretheinformationaboutthebucketowner.
Sub-node:DisplayNameandIDParentnode:ListBucketResult56Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionPrexStringIndicatestheprexofresultsreturnedfortherequest.
Parentnode:ListBucketResultSizeStringIndicatesthenumberofbytesoftheobject.
Parentnode:ListBucketResult.
ContentsStorageClassStringIndicatesthestorageclassofanobject.
OnlytheStandardstorageclassissupported.
Parentnode:ListBucketResult.
ContentsDetailanalysisThecustommetaintheobjectisnotreturnedduringtheGetBucketrequest.
Ifthebuckettobeaccesseddoesnotexist,a404NotFounderrorisreturnedwiththeerrorcodeNoSuchBucket.
Ifyouhavenopermissiontoaccessthebucket,OSSreturnsa403ForbiddenerrorwiththeerrorcodeAccessDenied.
Duringaconditionalquery,evenifthemarkerdoesnotexistinthelist,theresultsareprintedstartingfromtheletternexttomarkerinalphabeticalorder.
Ifthevalueofmax-keysislessthan0orgreaterthan1000,a400BadRequesterrorisreturnedwiththeerrorcodeInvalidArgument.
IfthelengthofthePrex,Marker,andDelimiterparametersdoesnotmeettherequirement,a400BadRequesterrorisreturnedwiththeerrorcodeInvalidArgument.
ThePrexandMarkerparametersareusedtodisplaytheresultsbypages,andtheparameterlengthmustbelessthan1024bytes.
IfyousetthevalueofPrextoadirectoryname,youcanlistallobjectswiththeprex,thatis,allobjectsandsub-directoriesinthedirectory.
IfyousetthePrexandsetDelimiterto"/",onlytheobjectsinthedirectoryarereturned.
Sub-directoriesinthedirectoryarereturnedinCommonPrefixes.
Allobjectsanddirectoriesinthesub-directoriesarenotdisplayed.
Forexample,thefollowingthreeobjectsarestoredinabucket:fun/test.
jpg,fun/movie/001.
avi,andfun/movie/007.
avi.
IfthePrexissetto"fun/",allthreeIssue:2020032057ObjectStorageServiceAPIReference/6Bucketoperationsobjectsarereturned.
Ifthedelimiterissetto"/"additionally,"fun/test.
jpg"and"fun/movie/"arereturned.
ExamplesSimplerequestexample:GET/HTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Fri,24Feb201208:43:27GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:BC+oQIXVR2/ZghT7cGa0ykboO4M=Responseexample:HTTP/1.
1200OKx-oss-request-id:534B371674E88A4D8906008BDate:Fri,24Feb201208:43:27GMTContent-Type:application/xmlContent-Length:1866Connection:keep-aliveServer:AliyunOSSoss-example100falsefun/movie/001.
avi2012-02-24T08:43:07.
000Z"5B3C1A2E053D763E1B002CC607C5A0FE"Normal344606Standard00220120222user-examplefun/movie/007.
avi2012-02-24T08:43:27.
000Z"5B3C1A2E053D763E1B002CC607C5A0FE"Normal344606Standard00220120222user-examplefun/test.
jpg2012-02-24T08:42:32.
000Z"5B3C1A2E053D763E1B002CC607C5A0FE"Normal34460658Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsStandard00220120222user-exampleoss.
jpg2012-02-24T06:07:48.
000Z"5B3C1A2E053D763E1B002CC607C5A0FE"Normal344606Standard00220120222user-exampleExampleofarequestincludingtheprexparameter:GET/prefix=funHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Fri,24Feb201208:43:27GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:BC+oQIXVR2/ZghT7cGa0ykboO4M=Responseexample:HTTP/1.
1200OKx-oss-request-id:534B371674E88A4D8906008BDate:Fri,24Feb201208:43:27GMTContent-Type:application/xmlContent-Length:1464Connection:keep-aliveServer:AliyunOSSoss-examplefun100falsefun/movie/001.
avi2012-02-24T08:43:07.
000Z"5B3C1A2E053D763E1B002CC607C5A0FE"Normal344606Standard00220120222user_examplefun/movie/007.
avi2012-02-24T08:43:27.
000Z"5B3C1A2E053D763E1B002CC607C5A0FE"NormalIssue:2020032059ObjectStorageServiceAPIReference/6Bucketoperations344606Standard00220120222user_examplefun/test.
jpg2012-02-24T08:42:32.
000Z"5B3C1A2E053D763E1B002CC607C5A0FE"Normal344606Standard00220120222user_exampleExampleofarequestincludingtheprexanddelimiterparameters:GET/prefix=fun/&delimiter=/HTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Fri,24Feb201208:43:27GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:DNrnx7xHk3sgysx7I8U9I9IY1vY=Responseexample:HTTP/1.
1200OKx-oss-request-id:534B371674E88A4D8906008BDate:Fri,24Feb201208:43:27GMTContent-Type:application/xmlContent-Length:712Connection:keep-aliveServer:AliyunOSSoss-examplefun/100/falsefun/test.
jpg2012-02-24T08:42:32.
000Z"5B3C1A2E053D763E1B002CC607C5A0FE"Normal344606Standard00220120222user_examplefun/movie/60Issue:20200320ObjectStorageServiceAPIReference/6Bucketoperations6.
9PutBucketVersioningCongurestheversioningstateofaspeciedbucket.
OnlythebucketownercanperformthePutBucketVersioningoperation.
Note:Versioningisnotenabledforallbucketsbydefault.
Youcanenableorsuspendversioningforabucket.
Whenversioningisenabledforabucket,eachobjectuploadedtothebuckethasauniqueversionID,anddierentversionsofthesameobjectareallstored.
Whenversioningissuspended,theversionIDofalluploadedobjectsisnull,andnomoreversionsarestoredfortheobjectsofwhichtheversionIDisnull.
RequestsyntaxPUT/versioningHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueEnabledNote:TheversioningstateofabucketcanonlybesettoEnabledorSuspended.
Otherwise,the400BadRequesterrorisreturned.
Versioningcannotbedisabledafteritisenabledforabucket.
However,youcansuspendversioningtostopstoringmoreobjectversions.
ExamplesEnableversioning.
Requestexample:PUT/versioningHTTP/1.
1Host:bucket-versioning.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,09Apr201902:20:12GMTAuthorization:OSSe7thre3jj5mlvqk:12ztptkaR8a74gIGFzOaZZQe****EnabledIssue:2020032061ObjectStorageServiceAPIReference/6BucketoperationsResponseexample:HTTP/1.
1200OKx-oss-request-id:5CAC015CB7AEADE01700****Date:Tue,09Apr201902:20:12GMTContent-Length:0Connection:keep-aliveServer:AliyunOSSSuspendversioning.
Requestexample:PUT/versioningHTTP/1.
1Host:bucket-versioning.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,09Apr201902:28:18GMTAuthorization:OSSm2qa99e9tpkaehr:DWAzr2EkqDwFJNke1Nuaogn7****SuspendedResponseexample:HTTP/1.
1200OKx-oss-request-id:5CAC0342B7AEADE01700****Date:Tue,09Apr201902:28:18GMTContent-Length:0Connection:keep-aliveServer:AliyunOSSErrorcodeErrorcodeHTTPstatuscodeDescriptionAccessDenied403Youdonothavethepermissiontoperformthisoperation.
OnlythebucketownercaninitiateaPutBucketVersioningrequest.
InvalidArgument400Theversioningstateisinvalid.
TheversioningstateofabucketcanonlybesettoEnabledorSuspended.
62Issue:20200320ObjectStorageServiceAPIReference/6Bucketoperations6.
10GetBucketVersioningObtainstheversioningstateofaspeciedbucket.
RequestsyntaxGET/versioningHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueResponseelementsElementTypeDescriptionVersioningConfigurationContainerIndicatesthecontainerusedtostoretheversioningstateofthebucket.
Sub-node:StatusParentnode:NoneStatusStringIndicatestheversioningstateofthebucket.
Parentnode:VersioningCongurationValues:Enabled:Indicatesthatversioningisenabledforthebucket.
Suspended:Indicatesthatversioningissuspendedforthebucket.
Note:Ifversioninghasnotbeenenabledfortherequestedbucket,StatusisnotincludedintherespondedXML.
Issue:2020032063ObjectStorageServiceAPIReference/6BucketoperationsExamplesRequestexample:GET/versioningHTTP/1.
1Host:bucket-versioning.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,09Apr201902:28:18GMTAuthorization:OSSpu4kyewh6qk6nut:2TeHBmWY36GwdwS0JFiRb+NV****Responseexample:Ifversioningisenabledforthebucket,theresponseexampleisasfollows:HTTP/1.
1200OKx-oss-request-id:5CAC0342B7AEADE01700****Date:Tue,09Apr201902:28:18GMTContent-Length:121Content-Type:application/xmlConnection:keep-aliveServer:AliyunOSSEnabledIfversioninghasnotbeenenabledforthebucket,theresponseexampleisasfollows:HTTP/1.
1200OKx-oss-request-id:5CAC015CB7AEADE01700****Date:Tue,09Apr201902:20:12GMTContent-Length:74Content-Type:application/xmlConnection:keep-aliveServer:AliyunOSSErrorcodesErrorcodeHTTPstatuscodeDescriptionAccessDenied403Youdonothavethepermissiontoperformthisoperation.
Onlytheownerofabucketcanobtaintheversioningstatusofthebucket.
NoSuchBucket404Thetargetbucketdoesnotexist.
64Issue:20200320ObjectStorageServiceAPIReference/6Bucketoperations6.
11GetBucketVersions(ListObjectVersions)Liststheinformationaboutallversions(includingdeletemarkers)ofallobjectsinabucket.
Note:IfyouperformtheGetBucket(ListObjects)operationonabucketwithversioningenabled,onlythecurrentversionsoftheobjects(whicharenotdeletemarkers)inthebucketarereturned.
Tolistallversionsofallobjectsinthebucket,youmustcalltheGetBucketVersionsinterface.
RequestparametersWhencallingGetBucketVersions,youcanlimittheinformationincludedinthereturnedlistbysettingthefollowingparameters:Prefix,Key-marker,Version-id-marker,DelimiterandMax-keys.
ParameterTypeRequiredDescriptionDelimiterStringNoSpeciesacharacterusedtogroupobjectnames.
Allthenamesoftheobjectsthatcontainaspeciedprexandafterwhichthedelimiteroccursforthersttime,actasagroupofelements,thatis,CommonPrefixes.
Defaultvalue:NoneKey-markerStringRequirediftheversion-id-markerisnotnull.
SpeciesthattheresultsaftertheKey-markerarereturnedinalphabeticalorder.
ThisparametermustbeconguredtogetherwithVersion-id-marker.
Thesizeofthisparametermustbelessthan1,024bytes.
Defaultvalue:NoneIssue:2020032065ObjectStorageServiceAPIReference/6BucketoperationsParameterTypeRequiredDescriptionVersion-id-markerStringNoSpeciesthattheresultsaftertheVersion-id-markeroftheKey-markerarereturnedinthecreationtimeorderoftheversions.
However,theversionspeciedinthisparameterisnotreturned.
Ifthisparameterisnotspecied,theresultsarereturnedfromtheversionafterKey-markerinalphabeticalorderbydefault.
Defaultvalue:NoneValidvalue:ValidversionIDsMax-keysStringNoLimitsthemaximumnumberofobjectsreturnedforonerequest.
Themax-keysvaluecannotexceed1000.
Defaultvalue:100Note:IftheresultscannotbecompletelylistedbecauseofthesettingofMax-keys,theNextKeyMarkerandNextVersionIdMarkerareaddedintheresultsastheMarkerforthenextListObjectVersionsoperation.
PrefixStringNoLimitsthatthereturnedobjectkeymustbeprexedaccordingly.
Defaultvalue:NoneNote:Thesizeofthisparametermustbelessthan1,024bytes.
Thekeysreturnedforrequestsusingaprexstillcontaintheprex.
66Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsParameterTypeRequiredDescriptionEncoding-typeStringNoEncodesthereturnedresultsandspeciestheencodingtype.
Defaultvalue:NoneValidvalue:urlNote:ParametersDelimiter,Key-Marker,Prex,NextKeyMarker,andKeyuseUTF-8characters,buttheXML1.
0Standarddoesnotsupportparsingcertaincontrolcharacters.
IfsomeparametersinthereturnedresultscontaincharactersthatarenotsupportedbytheXML1.
0Standard,encoding-typecanbespeciedtoencodetheseparameters,suchasDelimiter,Key-Marker,Prex,NextKeyMarker,andKey.
ResponseelementsElementTypeDescriptionListVersionsResultContainerIndicatesthecontainerusedtostoretheresultsreturnedfortheGetBucketVersionsrequest.
Sub-nodes:Name,Prex,Marker,MaxKeys,Delimiter,IsTruncated,Nextmarker,Version,DeleteMarkerParentnode:NoneIssue:2020032067ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionCommonPrefixesStringIfthedelimiterparameterisspeciedintherequest,theresponsereturnedbyOSScontainstheCommonPrefixeselement.
Thiselementindicatesthesetofobjectswhichendswithadelimiterandhaveacommonprex.
Parentnode:ListVersionsResultDelimiterStringIndicatesacharacterusedtogroupobjectnames.
Allthoseobjectswhosenamescontainthespeciedprexandafterwhichthedelimiteroccursforthersttime,actasagroupofelements,thatis,CommonPrefixes.
Parentnode:ListVersionsResultEncodingTypeStringIndicatestheencodingtypeforthereturnedresults.
Ifencoding-typeisspeciedinarequest,thefollowingelementsinthereturnedresultsareencoded:Delimiter,Marker,Prex,NextMarker,andKey.
Parentnode:ListVersionsResultIsTruncatedStringIndicateswhetherallresultsarereturned.
true:indicatesthatnotallresultsarereturnedfortherequest.
false:indicatesthatallresultsarereturnedfortherequest.
Validvalue:true,falseParentnode:ListVersionsResult68Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionKeyMarkerStringMarkstheobjectwherethecurrentGetBucketVersionsoperationstarts.
Parentnode:ListVersionsResultVersionIdMarkerStringUsedtogetherwithKeyMarkertospecifytheversionoftheobjectwheretheGetBucketVersionsoperationstarts.
Parentnode:ListVersionsResultNextKeyMarkerStringIfnotallresultsarereturned,thiselementisincludedintheresponsetoindicatetheKey-markerforthenextrequest.
Parentnode:ListVersionsResultNextVersionIdMarkerStringIfnotallresultsarereturned,thiselementisincludedintheresponsetoindicatetheVersion-id-markerforthenextrequest.
Parentnode:ListVersionsResultMaxKeysStringIndicatesthemaximumnumberofreturnedresultsintheresponsetotherequest.
Parentnode:ListVersionsResultNameStringIndicatesthenameofthebucket.
Parentnode:ListVersionsResultOwnerContainerIndicatesthecontainerusedtostoretheinformationaboutthebucketowner.
Parentnode:ListVersionsResultPrefixStringIndicatestheprexofresultsreturnedfortherequest.
Parentnode:ListVersionsResultIssue:2020032069ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionVersionContainerIndicatesthecontainerusedtostoreobjectversionsratherthandeletemarkers.
Parentnode:ListVersionsResultDeleteMarkerContainerIndicatesthecontainerusedtostoredeletemarkers.
Parentnode:ListVersionsResultETagStringIndicatestheETag(entitytag)whichiscreatedwhenanobjectisgeneratedtoindicatethecontentoftheobject.
ForanobjectcreatedbyaPutObjectrequest,thevalueofETagistheMD5valueofthecontentoftheobject.
Foranobjectcreatedinotherways,thevalueofETagistheUUIDofthecontentoftheobject.
Note:ThevalueofETagcanbeusedtocheckwhetherthecontentoftheobjectischanged.
WerecommendthattheETagshouldnotbeusedastheMD5valueoftheobjectcontenttoverifydataintegrity.
Parentnode:ListVersionsResult.
VersionKeyStringIndicatesthekeyofanobject.
Parentnode:ListVersionsResult.
Version|ListVersionsResult.
DeleteMarker70Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionLastModifiedTimeIndicatesthetimewhentheobjectislastmodied.
Parentnode:ListVersionsResult.
Version|ListVersionsResult.
DeleteMarkerVersionIdStringIndicatestheversionIDofanobject.
Parentnode:ListVersionsResult.
Version|ListVersionsResult.
DeleteMarkerIsLatestStringIndicateswhetheraversionisthecurrentversion.
true:Theversionisthecurrentversion.
false:Theversionisnotthecurrentversion.
Parentnode:ListVersionsResult.
Version|ListVersionsResult.
DeleteMarkerSizeStringIndicatesthesizeofanobjectinbytes.
Parentnode:ListVersionsResult.
Version|ListVersionsResult.
DeleteMarkerStorageClassStringIndicatesthestorageclassofanobject.
Parentnode:ListVersionsResult.
Version|ListVersionsResult.
DeleteMarkerDisplayNameStringIndicatesthenameoftheobjectowner.
Parentnode:ListVersionsResult.
Version.
Owner|ListVersionsResult.
DeleteMarker.
OwnerIssue:2020032071ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionIDStringIndicatestheuserIDofthebucketowner.
Parentnode:ListVersionsResult.
Version.
Owner|ListVersionsResult.
DeleteMarker.
OwnerDetailanalysisDierentobjectsarereturnedinalphabeticalorder.
Dierentversionofanobjectisreturnedinthecreationtimeorder.
ThecustommetadataofobjectsarenotreturnedintheresponsefortheGetBucketVersionsrequest.
IftheresultscannotbecompletelylistedbecauseofthesettingofMax-keys,thevaluesofNextKeyMarkerandNextVersionIdMarkerareaddedintheresultsastheMarkerforthenextListObjectVersionsoperation.
ThePrexandMarkerparametersaresettodisplayresultsinmultiplepages.
Thesizeofthesetwoparametersmustbelessthan1,024bytes.
IfyousetthevalueofPrextoafoldername,allobjectsprexedwiththefoldername,thatis,allobjectsandsub-foldersunderthefolderarerecursivelylisted.
IfyousetthevalueofPrextoafoldernameandthevalueofDelimitertoaforwardslash(/),onlytheobjectsinthefolderarereturned.
Namesofthesub-foldersunderthefolderisreturnedinCommonPrefixes.
Objectsandfoldersinthesub-foldersarenotdisplayed.
Assumethatthefollowingthreeobjectsarestoredinabucket:fun/test.
jpg,fun/movie/001.
avi,andfun/movie/007.
avi,inwhich:-fun/test.
jpghastwoversions:V111111andV222222.
-fun/movie/001.
avihasonlyoneversion:V121212.
-fun/movie/007.
avihasonlyoneversion:V212121.
IfyousetthevalueofPrextofun/,thefollowingfourresultsarereturned:fun/test.
jpg(V111111),fun/test.
jpg(V222222),fun/movie/001.
avi(V121212),andfun/movie/007.
avi(V212121).
IfyoufurthersetthevalueofDelimitertoaforwardslash(/),fun/test.
jpg(V111111),fun/test.
jpg(V222222),andfun/movie/arereturned.
72Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsExamplesAssumethatthefollowingtwoobjectsarestoredinabucketnamedossexample:exampleandpic.
jpg.
Theobjectnamedexamplehasthreeversions(inthecreationtimeorder):111222,000123(deletemarker),and222333.
Theobjectnamedpic.
jpgonlyhasoneversion:232323.
IfyousetthevalueofKey-MarkertoexampleandthevalueofVersion-id-markerto111222,theresultsarereturnedinthefollowingorder:example(000123),example(222333),andpic.
jpg(232323).
Requestexample:GET/versions&key-marker=example&version-id-marker=CAEQMxiBgICbof2D0BYiIGRhZjgwMzJiMjA3MjQ0ODE5MWYxZDYwMzJlZjU1YmMyHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,09Apr201907:27:48GMTAuthorization:OSSami4tq0x76ov9cu:WFx4kLpx+e7Rc0jawCsh7hlk****Responseexample:HTTP/1.
1200OKx-oss-request-id:5CAC4974B7AEADE01700****Date:Tue,09Apr201907:27:48GMTContent-Type:application/xmlConnection:keep-aliveServer:AliyunOSSoss-exampleexampleCAEQMxiBgICbof2D0BYiIGRhZjgwMzJiMjA3MjQ0ODE5MWYxZDYwMzJlZjU1****100falseexampleCAEQMxiBgICAof2D0BYiIDJhMGE3N2M1YTI1NDQzOGY5NTkyNTI3MGYyMzJm****false2019-04-09T07:27:28.
000Z1234512528586****12345125285864390exampleCAEQMxiBgMDNoP2D0BYiIDE3MWUxNzgxZDQxNTRiODI5OGYwZGMwNGY3MzZjN****false2019-04-09T07:27:28.
000Z"250F8A0AE989679A22926A875F0A2****"NormalIssue:2020032073ObjectStorageServiceAPIReference/6Bucketoperations93731Standard1234512528586****12345125285864390pic.
jpgCAEQMxiBgMCZov2D0BYiIDY4MDllOTc2YmY5MjQxMzdiOGI3OTlhNTU0ODIx****true2019-04-09T07:27:28.
000Z"3663F7B0B9D3153F884C821E7CF4****"Normal574768Standard1234512528586****12345125285864390ErrorcodesErrorcodeHTTPstatuscodeDescriptionNoSuchBucket404Thetargetbucketdoesnotexist.
Thebucketthatyouaccessmaycannotbecreatedbecauseoftheinvalidname.
AccessDenied403Youdonothavethepermissiontoaccessthebucket.
InvalidArgument400ThevalueofMax-keysissmallerthan0orlargerthan1000.
ThesizeofPrex,Marker,orDelimiterisinvalid.
ThevalueofVersion-id-markerisaninvalidversionID.
6.
12PutBucketLoggingEnablestheaccessloggingfunctionforabucket.
Whenthisfunctionisenabled,OSSautomaticallyrecordsthedetailsabouttherequeststothisbucket,andfollows74Issue:20200320ObjectStorageServiceAPIReference/6Bucketoperationstheuser-speciedrulestowritetheaccesslogsasanobjectintoauser-speciedbucketonanhourlybasis.
Note:Whenthesourcebucketisdeleted,thecorrespondingloggingrulesarealsodeleted.
OSSgeneratesabucketaccesslogleeveryhour.
However,allrequestsduringthehourmaynotberecordedinthelogle,butmaygetrecordedinthepreviousornextlogle.
EachtimeOSSgeneratesabucketaccesslogle,thisisconsideredaPUToperationandtheoccupiedspaceisrecorded,butthegeneratedtracisnotrecorded.
Afterloglesaregenerated,youcanoperatetheseloglesascommonobjects.
OSSignoresallquery-stringparametersprexedby"x-"butsuchquery-stringparametersarerecordedinaccesslogs.
Ifyouwanttomarkaspecialrequestfrommassiveaccesslogs,youcanaddaquery-stringparameterprexedby"x-"totheURL.
Forexample,youcanaddmarkhttp://oss-example.
regionid.
example.
com/aliyun-logo.
pngbyaddingaparameterprexedby"x-"asfollows:http://oss-example.
regionid.
example.
com/aliyun-logo.
pngx-user=admin.
Theaddedparameterisignored.
However,youcanlocatetherequestbysearching"x-user=admin".
RequestsyntaxPUT/loggingHTTP/1.
1Date:GMTDateContent-Length:ContentLengthContent-Type:application/xmlAuthorization:SignatureValueHost:BucketName.
oss-cn-hangzhou.
aliyuncs.
comTargetBucketTargetPrefixRequestelementsNote:Issue:2020032075ObjectStorageServiceAPIReference/6BucketoperationsAllPutBucketLoggingrequestsmustsignedbecausetheanonymousaccessisnotsupported.
ElementTypeRequiredDescriptionBucketLoggingStatusContainerYesSpeciesthecontainerforstoringaccesslogstatusinformationSub-node:LoggingEnabledParentnode:NoneLoggingEnabledContainerNoSpeciesthecontainerforstoringaccessloginformation.
Thiselementisrequiredonlywhenserveraccessloggingisenabled.
Sub-node:TargetBucket,TargetPrefixParentnode:BucketLoggingStatusTargetBucketStringThiselementisrequiredwhenserveraccessloggingisenabledSpeciesthebucketforstoringaccesslogs.
Thesourcebucketandtargetbucketcanbethesameordierentbuckets.
Youcansavelogsfrommultiplesourcebucketstothesametargetbucket(inthiscase,werecommendthatyouassigndierentvaluestoTargetPrex).
Sub-node:NoneParentnode:BucketLoggingStatus.
LoggingEnabledTargetPrefixStringNoSpeciestheprexofthenamesofsavedaccesslogles,whichcanbenull.
Sub-node:NoneParentnode:BucketLoggingStatus.
LoggingEnabledNamingrulesfortheobjectsstoringaccesslogsTheformatofanobjectnameisasfollows:-YYYY-mm-DD-HH-MM-SS-UniqueStringThefollowingtabledescribestheparametersinanobjectname:76Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsParameterDescriptionTargetPrefixSpeciestheprexoftheobjectname.
YYYY-mm-DD-HH-MM-SSIndicatesthetimewhentheobjectiscreated.
YYYY,mm,DD,HH,MM,andSSindicatetheyear,month,day,hour,minutes,andsecondsindividually.
Forexample:2012-09-10-04-00-00.
UniqueStringIndicatestheuniqueUUIDgeneratedbyOSStoidentifyalog.
Anexampleobjectnameisasfollows:MyLog-oss-example-2012-09-10-04-00-00-0000Intheprecedingexample,MyLog-istheprexspeciedbytheuser,oss-exampleisthenameofthesourcebucket,2012-09-10-04-00-00isthetimewhentheobjectiscreated,and0000istheUUIDstringgeneratedbyOSS.
LogleformatNote:Youmaysee"-"inanyeldofOSSlogs.
Itindicatesthatdataisunknownortheeldisinvalidforthecurrentrequest.
CertaineldsareaddedtotheendofOSSloglesinfuturebasedontherequirements.
Werecommendthatdevelopersconsidercompatibilityissueswhendevelopinglogprocessingtools.
FieldExampleDescriptionRemoteIP119.
140.
142.
11IPaddressfromwhichtherequestisinitiated(theproxyoruserrewallmayblockthiseld)Reserved-ReservedeldReserved-ReservedeldTime[02/May/2012:00:00:04+0800]TimewhenOSSreceivestherequestRequest-URL"GET/aliyun-logo.
pngHTTP/1.
1"User-RequestedURL(includingquery-string)HTTPStatus200HTTPstatuscodereturnedbyOSSIssue:2020032077ObjectStorageServiceAPIReference/6BucketoperationsFieldExampleDescriptionSentBytes5576TracthattheuserdownloadsfromOSSRequestTime(ms)71Timeutilizedincompletingthisrequest(inms)Refererhttp://www.
aliyun.
com/product/ossHTTPRefererintherequestUser-Agentcurl/7.
15.
5HTTPUser-AgentheaderHostNameoss-example.
regionid.
example.
comDomainnameforaccessrequestRequestID505B01695037C2AF032593A4UUIDusedtouniquelyidentifythisrequestLoggingFlagtrueWhethertheaccessloggingfunctionisenabledRequesterAliyunID16571******83691AlibabaCloudIDoftherequester,"-"forananonymousaccessOperationGetObjectRequesttypeBucketoss-exampleNameofthebucketrequestedforaccessKey/aliyun-logo.
pngKeyofuserrequestObjectSize5576ObjectsizeServerCostTime(ms)17TimeutilizedbyOSSservertoprocessthisrequest(inms)ErrorCodeNoSuchBucketErrorcodereturnedbyOSSRequestLength302Lengthofuserrequest(byte)UserID16571******83691IDofthebucketownerDeltaDataSize280Bucketsizevariation,"-"fornochangeSyncRequest-WhetherthisisanoriginretrievalrequestfromCDN,"-"fornoReserved-Reservedeld78Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsExamplesExampleofarequestforenablingbucketaccesslogging:PUT/loggingHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comContent-Length:186Date:Fri,04May201203:21:12GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:KU5h8YMUC78M30dXqf3JxrTZHiA=doc-logMyLog-Responseexample:HTTP/1.
1200OKx-oss-request-id:534B371674E88A4D8906008BDate:Fri,04May201203:21:12GMTContent-Length:0Connection:keep-aliveServer:AliyunOSSExampleofarequestfordisablingbucketaccesslogging:PUT/loggingHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comContent-Type:application/xmlContent-Length:86Date:Fri,04May201204:21:12GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:KU5h8YMUC78M30dXqf3JxrTZHiA=Responseexample:HTTP/1.
1200OKx-oss-request-id:534B371674E88A4D8906008BDate:Fri,04May201204:21:12GMTContent-Length:0Connection:keep-aliveServer:AliyunOSSSDKTheSDKsofthisAPIareasfollows:JavaPythonPHPIssue:2020032079ObjectStorageServiceAPIReference/6BucketoperationsGoC.
NETNode.
jsRubyErrorcodesErrorcodeHTTPstatuscodeDescriptionNoSuchBucket404Thesourcebucketdoesnotexist.
Thesourcebucketandthetargetbucketmustbeownedbythesameuser.
InvalidTargetBucketForLogging400Thesourcebucketandthetargetbucketareindierentregions.
InvalidDigest400IfyouincludetheContent-MD5headerintherequest,OSScalculatestheContent-MD5oftherequestbodyandchecksifthetwoarethesame.
Ifthetwovaluesaredierent,thiserrorisreturned.
MalformedXML400TheXMLleintherequestisinvalid.
InvalidTargetBucketForLogging403Theuserwhoinitiatestherequestisnottheownerofthetargetbucket.
AccessDenied403Theuserwhoinitiatestherequestisnottheownerofthesourcebucket,6.
13GetBucketLoggingViewstheaccessloggingcongurationofabucket.
Onlytheownerofabucketcanviewtheaccessloggingcongurationofthebucket.
RequestsyntaxGET/loggingHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDate80Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsAuthorization:SignatureValueResponseelementsNameTypeDescriptionBucketLoggingStatusContainerIndicatesthecontainerusedtostoreaccessloggingcongurationofabucket.
Sub-node:LoggingEnabledParentnode:NoneNote:Ifnologgingrulesaresetforthesourcebucket,OSSreturnsanXMLmessagebodyinwhichthevalueofBucketLoggingStatusisnull.
LoggingEnabledContainerIndicatesthecontainerusedtostoreaccesslogginginformation.
Thiselementisreturnedifitisenabledandisnotreturnedifitisdisabled.
Sub-node:TargetBucketandTargetPrefixParentnode:BucketLoggingStatusTargetBucketCharacterIndicatesthebucketthatstoresaccesslogs.
Sub-node:NoneParentnode:BucketLoggingStatus.
LoggingEnabledTargetPrefixCharacterIndicatestheprexofthenamesofstoredaccesslogles.
Sub-node:NoneParentnode:BucketLoggingStatus.
LoggingEnabledIssue:2020032081ObjectStorageServiceAPIReference/6BucketoperationsExamplesRequestexample:Get/loggingHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Fri,04May201205:31:04GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:ceOEyZavKY4QcjoUWYSpYbJ3naA=Responseexamplereturnedwhenloggingrulesaresetforthebucket:HTTP/1.
1200x-oss-request-id:534B371674E88A4D8906008BDate:Fri,04May201205:31:04GMTConnection:keep-aliveContent-Length:210Server:AliyunOSSmybucketlogsmybucket-access_log/Responseexamplereturnedwhennologgingrulesaresetforthebucket:HTTP/1.
1200x-oss-request-id:534B371674E88A4D8906008BDate:Fri,04May201205:31:04GMTConnection:keep-aliveContent-Length:110Server:AliyunOSSSDKTheSDKsofthisAPIareasfollows:JavaPythonPHPGoC.
NETNode.
jsRuby82Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsErrorcodesErrorcodeHTTPstatuscodeDescriptionNoSuchBucket404Thetargetbucketdoesnotexist.
AccessDenied403Youdonothavethepermissiontoviewtheaccessloggingcongurationofabucket.
Onlytheownerofabucketcanviewtheaccessloggingcongurationofthebucket.
6.
14DeleteBucketLoggingDisablestheaccessloggingfunctionofabucket.
Onlytheownerofabucketcandisabletheaccessloggingfunctionofthebucket.
RequestsyntaxDELETE/loggingHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueExamplesRequestexample:DELETE/loggingHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Fri,24Feb201205:35:24GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:6ZVHOehYzxoC1yxRydPQs/CnMZU=Responseexample:HTTP/1.
1204NoContentx-oss-request-id:534B371674E88A4D8906008BDate:Fri,24Feb201205:35:24GMTConnection:keep-aliveContent-Length:0Server:AliyunOSSSDKTheSDKsofthisAPIareasfollows:JavaPythonPHPIssue:2020032083ObjectStorageServiceAPIReference/6BucketoperationsGoC.
NETNode.
jsRubyErrorcodesErrorcodeHTTPstatuscodeDescriptionNoSuchBucket404Thetargetbucketdoesnotexist.
AccessDenied403Youdonothavethepermissiontodisabletheaccessloggingfunctionofthebucket.
Onlytheownerofabucketcandisabletheaccessloggingfunctionofthebucket.
6.
15PutBucketWebsiteYoucancallthisoperationtosetabuckettothestaticwebsitehostingmodeandsetredirectionrules.
Note:Staticwebsitesarewebsiteswhereallwebpagesconsistofonlystaticcontent,includingscriptssuchasJavaScriptrunningontheclient.
OSSdoesnotsupportcontentthatneedstobeprocessedbytheserver,suchasPHP,JSP,andASP.
NETcontent.
Touseyourowndomainnametoaccessbucket-basedstaticwebsites,youcanuseCNAME.
Formoreinformation,seeBindacustomdomainname.
Whensettingabuckettothestaticwebsitehostingmode,youmustspecifytheindexpage.
Theerrorpageisoptional.
Thespeciedindexdocumentanderrordocumentmustbeobjectsinthebucket.
Afterabucketissettothestaticwebsitehostingmode,OSSreturnstheindexpageforanonymousaccesstotherootdomainnameofthestaticwebsite,andreturnstheresultofGetBucketforsignedaccesstotherootdomainnameofthestaticwebsite.
84Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationswebsiteThePutBucketWebsiteoperationhastwomainfunctions:Congurethedefaulthomepageandthedefault404page.
CongureRoutingRule.
RoutingRuleisusedtospecifythe3xxroutingrulesandmirroring-basedback-to-originrules.
Note:Mirroring-basedback-to-originsupportsAlibabaCloudpubliccloudandFinanceCloud.
Thefollowingcodeprovidesanexampleofthewebsiteeld:index.
htmltrue0error.
html1abc/404Mirrortruehttp://www.
test.
com/truetruefalsetruemyheader-key1myheader-key2myheader-key3myheader-key4myheader-key5myheader-value52abc/404hostIssue:2020032085ObjectStorageServiceAPIReference/6Bucketoperationstest.
oss-cn-beijing-internal.
aliyuncs.
comAliCDNhttpwww.
test.
comfalseprefix/${key}.
suffix301RequestsyntaxPUT/websiteHTTP/1.
1Date:GMTDateContent-Length:ContentLengthContent-Type:application/xmlHost:BucketName.
oss-cn-hangzhou.
aliyuncs.
comAuthorization:SignatureValueindex.
htmlerrorDocument.
htmlRequestelementsElementTypeDescriptionRequiredWebsiteConfigurationContainerSpeciestherootnode.
Parentnode:noneYesIndexDocumentContainerSpeciesthecontainerforthedefaulthomepage.
Parentnode:WebsiteCongurationConditional.
Youmustspecifyatleastoneofthefollowingcontainers:IndexDocument,ErrorDocument,andRoutingRules.
86Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionRequiredSuffixStringSpeciesthedefaulthomepage.
Ifthiselementisset,thedefaulthomepageisreturnedforaccesstoobjectswhosenamesendwithaforwardslash(/).
Parentnode:IndexDocumentConditional.
ThiselementmustbespeciedifitsparentnodeIndexDocumentisspecied.
ErrorDocumentContainerSpeciesthecontainerforthedefault404page.
Parentnode:WebsiteCongurationConditional.
Youmustspecifyatleastoneofthefollowingcontainers:IndexDocument,ErrorDocument,andRoutingRules.
KeyContainerSpeciesthedefault404page.
Ifthiselementisspecied,the404pageisreturnedwhenthetargetobjectdoesnotexist.
Parentnode:ErrorDocumentConditional.
ThiselementmustbespeciedifitsparentnodeErrorDocumentisspecied.
RoutingRulesContainerSpeciesthecontainerforRoutingRule.
Parentnode:WebsiteCongurationConditional.
Youmustspecifyatleastoneofthefollowingcontainers:IndexDocument,ErrorDocument,andRoutingRules.
RoutingRuleContainerSpeciesroutingrulesormirroring-basedback-to-originrules.
Youcanspecifyamaximumofveroutingrules.
Parentnode:RoutingRulesNoIssue:2020032087ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionRequiredSupportSubDirStringSpecieswhethertosearchforthedefaulthomepageofasubfolderwhenyouaccessthesubfolder.
Avalueoffalseindicatesthattherequestisredirectedtothedefaulthomepageoftherootfolderinsteadofthatofthesubfolder.
Avalueoftrueindicatesthattherequestisredirectedtothedefaulthomepageofthesubfolder.
Assumethatthedefaulthomepageforaccesstobucket.
oss-cn-hangzhou.
aliyuncs.
com/subdir/issettoindex.
html.
Avalueoffalseindicatesthattherequestisredirectedtobucket.
oss-cn-hangzhou.
aliyuncs.
com/index.
html,andavalueoftrueindicatesthattherequestisredirectedtobucket.
oss-cn-hangzhou.
aliyuncs.
com/subdir/index.
html.
Defaultvalue:falseParentnode:IndexDocumentNo88Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionRequiredTypeHTTPstatuscodeSpeciestheoperationtoperformwhenthedefaulthomepageisset,thenameoftheaccessedobjectdoesnotendwithaforwardslash(/),andtheobjectdoesnotexist.
Note:ThiselementtakeseectonlywhenSupportSubDirissettotrue.
IttakeseectafterRoutingRuleandbeforeErrorFile.
Assumethatthedefaulthomepageforaccesstobucket.
oss-cn-hangzhou.
aliyuncs.
com/abcissettoindex.
htmlandtheobjectabcdoesnotexist.
TheoperationscorrespondingtothevalidvaluesofTypeareasfollows:0:checkswhetherabc/index.
html(inobject+slash(/)+homepageformat)exists.
Ifitexists,OSSreturns302andtheLocationheader/abc/(inforwardslash(/)+object+forwardslash(/)format)intheresponseisURL-encoded.
Ifitdoesnotexist,OSSreturns404andcontinuestocheckErrorFile.
1:OSSreturns404anderrormessageNoSuchKeyandcontinuestocheckErrorFile.
2:checkswhetherabc/index.
htmlexists.
Ifitexists,thecontentoftheobjectisreturned.
Ifitdoesnotexist,OSSreturns404andcontinuestocheckErrorFile.
Defaultvalue:0Parentnode:IndexDocumentNoIssue:2020032089ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionRequiredRuleNumberPositiveintegerSpeciesthesequencenumberusedtomatchandexecuteroutingrules.
Routingrulesarematchedbasedonthissequencenumber.
Ifamatchsucceeds,theruleisexecutedandthesubsequentrulesarenotexecuted.
Parentnode:RoutingRuleConditional.
ThiselementmustbespeciedifitsparentnodeRoutingRuleisspecied.
ConditionContainerSpeciesthematchingconditions.
Ifallofthespeciedconditionsaremet,theruleisexecuted.
ThenodesinthecontainerareintheANDrelationship,thatis,arequestmustmeetalltheconditionstobeconsideredamatch.
Parentnode:RoutingRuleConditional.
ThiselementmustbespeciedifitsparentnodeRoutingRuleisspecied.
KeyPrefixEqualsStringSpeciesthatobjectswhosenamescontainthespeciedprexcanmatchtherule.
Parentnode:ConditionNoHttpErrorCodeReturnedEqualsHTTPstatuscodeSpeciesthattheruleismatchedonlywhenthespeciedobjectisaccessedandthespeciedstatuscodeisreturned.
Iftheroutingruleisthemirroring-basedback-to-originrule,theelementvaluemustbe404.
Parentnode:ConditionNoIncludeHeaderContainerSpeciesthattheruleismatchedonlywhenthespeciedheaderisincludedintherequestandtheheadervalueequalsthespeciedvalue.
Amaximumofvecontainerscanbespecied.
Parentnode:ConditionNo90Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionRequiredKeyStringSpeciesthattheruleismatchedonlywhenthespeciedheaderisincludedintherequestandtheheadervalueequalsthevaluespeciedbyEquals.
Parentnode:IncludeHeaderConditional.
ThiselementmustbespeciedifitsparentnodeIncludeHeaderisspecied.
EqualsStringSpeciesthattheruleismatchedonlywhentheheaderspeciedbyKeyisincludedintherequestandtheheadervalueequalsthespeciedvalue.
Parentnode:IncludeHeaderConditional.
ThiselementmustbespeciedifitsparentnodeIncludeHeaderisspecied.
RedirectContainerSpeciestheoperationtoperformaftertheruleismatched.
Parentnode:RoutingRuleConditional.
ThiselementmustbespeciedifitsparentnodeRoutingRuleisspecied.
Issue:2020032091ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionRequiredRedirectTypeStringSpeciestheredirectingtype.
Validvalues:Mirror:back-to-originExternal:externalredirection.
OSSreturnsa3xxrequesttoredirecttheaccesstoanotherIPaddress.
Internal:internalredirection.
OSSredirectstheaccessfromobject1toobject2basedontherule.
Inthiscase,theuseraccessesobject2insteadofobject1.
AliCDN:AlibabaCloudCDNredirection.
UnliketheExternaltype,OSSaddsanadditionalheadertotherequest.
Afteridentifyingtheheader,CDNredirectstheaccesstothespeciedIPaddressandreturnstheobtaineddatainsteadofthe3xxredirectingrequesttotheuser.
Parentnode:RedirectConditional.
ThiselementmustbespeciedifitsparentnodeRedirectisspecied.
92Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionRequiredPassQueryStringBooleanSpecieswhethertherequestparameteriscarriedwhentheredirectionormirroring-basedback-to-originisperformed.
Forexample,iftheparameter"a=b&c=d"iscarriedinarequestsenttoOSSandthiselementissettotrue,thisparameterisaddedtotheLocationheaderwhentheruleis302redirection.
Forexample,iftherequestis"Location:www.
test.
coma=b&c=d"andtheredirectingtypeismirroring-basedback-to-origin,theparameter"a=b&c=d"isalsocarriedintheback-to-originrequest.
Defaultvalue:falseValidvalues:trueandfalseParentnode:RedirectNoIssue:2020032093ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionRequiredMirrorURLStringSpeciestheIPaddressoftheoriginformirroring-basedback-to-origin.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisMirror.
URLsstartwithhttp://orhttps://mustendwithaforwardslash(/).
OSSaddstheobjecttothestringtoformtheback-to-originURL.
Forexample,theobjecttoaccessismyobject.
IfthespeciedURLishttp://www.
test.
com/,theback-to-originURLishttp://www.
test.
com/myobject.
IfthespeciedURLishttp://www.
test.
com/dir1/,theback-to-originURLishttp://www.
test.
com/dir1/myobject.
Parentnode:RedirectConditional.
ThiselementmustbespeciedifRedirectTypeissettoMirror.
MirrorPassQueryStringBooleanThiselementplaysthesameroleasPassQueryStringandhasahigherprioritythanPassQueryString.
However,thiselementtakeeectsonlywhenRedirectTypeissettoMirror.
Defaultvalue:falseParentnode:RedirectNo94Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionRequiredMirrorFollowRedirectBooleanSpecieswhethertheaccessisredirectedtothespeciedLocationiftheoriginreturnsa3xxstatuscodewhenreceivingamirroring-basedback-to-originrequest.
Forexample,whenamirroring-basedback-to-originrequestisinitiated,theoriginreturns302andLocationisspecied.
Inthiscase,ifthevalueofMirrorFollowRedirectistrue,OSScontinuestosendrequeststotheIPaddressspeciedbyLocation.
Arequestcanberedirectedforamaximumof10times.
Ifarequestisredirectedformorethan10times,amirroring-basedback-to-originfailureisreturned.
IfthevalueofMirrorFollowRedirectisfalse,OSSreturns302andpassesthroughtheLocation.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisMirror.
Defaultvalue:trueParentnode:RedirectNoIssue:2020032095ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionRequiredMirrorCheckMd5BooleanSpecieswhetherOSScheckstheMD5checksumonthebodyoftheresponsereturnedbytheorigin.
WhenthevalueofthiselementistrueandtheresponsereturnedbytheoriginincludesaContent-Md5header,OSScheckswhethertheMD5checksumoftheobtaineddatamatchestheheader.
Ifitisnotmatched,OSSdoesnotstorethedata.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisMirror.
Defaultvalue:falseParentnode:RedirectNoMirrorHeadersContainerSpeciestheheaderscarriedintheresponsethatisreturnedwhenyouusemirroring-basedback-to-origin.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisMirror.
Parentnode:RedirectNoPassAllBooleanSpecieswhetherOSSpassesthroughallrequestheaders(exceptforreservedheadersandheadersthatstartwithoss-,x-oss-,andx-drs-)totheorigin.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisMirror.
Defaultvalue:falseParentnode:MirrorHeadersNo96Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionRequiredPassStringSpeciestheheaderstopassthroughtotheorigin.
Amaximumof10headerscanbespecied.
Theheadercanbeamaximumof1,024bytesinlength.
Theelementcancontainonlyletters,digits,andhyphens(-).
ThiselementtakeseectonlywhenthevalueofRedirectTypeisMirror.
Parentnode:MirrorHeadersNoRemoveStringSpeciestheheadersthatarenotallowedtobepassedthroughtotheorigin.
Amaximumof10headerscanbespecied,includingrepeatedheaders.
ThiselementisusedtogetherwithPassAll.
Theheadercanbeamaximumof1,024bytesinlength.
ThecharactersetofthiselementisthesameasthatofPass.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisMirror.
Parentnode:MirrorHeadersNoSetContainerSpeciestheheadersthataresenttotheorigin.
Thespeciedheadersareconguredinthedatareturnedbytheoriginregardlessofwhethertheyarecarriedintherequest.
Amaximumof10containerscanbespecied.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisMirror.
Parentnode:MirrorHeadersNoIssue:2020032097ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionRequiredKeyStringSpeciesthekeyoftheheader.
Thekeycanbeamaximumof1,024bytesinlength.
ThecharactersetofthiselementisthesameasthatofPass.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisMirror.
Parentnode:SetConditional.
ThiselementmustbespeciedifitsparentnodeSetisspecied.
ValueStringSpeciesthevalueoftheheader.
Thevaluecanbeamaximumof1,024bytesinlengthandcannotcontain"\r\n".
ThiselementtakeseectonlywhenthevalueofRedirectTypeisMirror.
Parentnode:SetConditional.
ThiselementmustbespeciedifitsparentnodeSetisspecied.
ProtocolStringSpeciestheprotocolusedforredirection.
Forexample,ifyouaccesstheobjecttest,andProtocolissettohttps,andHostnameissettowww.
test.
com,theLocationheaderishttps://www.
test.
com/test.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisExternalorAliCDN.
Validvalues:httpandhttps.
Parentnode:RedirectConditional.
ThiselementmustbespeciedifthevalueofRedirectTypeisExternalorAliCDN.
98Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionRequiredHostNameStringSpeciesthedomainnameusedforredirection.
Itmustcomplywiththenamingconventionsfordomainnames.
Forexample,ifyouaccesstheobjecttest,Protocolissettohttps,andHostnameissettowww.
test.
com,theLocationheaderishttps://www.
test.
com/test.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisExternalorAliCDN.
Parentnode:RedirectConditional.
ThiselementmustbespeciedifthevalueofRedirectTypeisExternalorAliCDN.
HttpRedirectCodeHTTPstatuscodeSpeciesthereturnedstatuscodeinredirections.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisExternalorAliCDN.
Validvalues:301,302,and307.
Parentnode:RedirectConditional.
ThiselementmustbespeciedifthevalueofRedirectTypeisExternalorAliCDN.
Issue:2020032099ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionRequiredReplaceKeyPrefixWithStringSpeciesthestringtoreplacetheprexoftherequestedobjectnameinredirection.
Iftheprexoftheobjectisempty,thisstringisaddedbeforetheobjectname.
Note:OnlyReplaceKeyWithorReplaceKeyPrexWithisallowed.
AssumethatKeyPrexEqualsissettoabc/andReplaceKeyPrexWithissettodef/.
Ifyouaccesstheobjectabc/test.
txt,theLocationheaderishttp://www.
test.
com/def/test.
txt.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisExternalorAliCDN.
Parentnode:RedirectConditional.
ThiselementmustbespeciedifthevalueofRedirectTypeisInternal,External,orAliCDN.
100Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionRequiredReplaceKeyWithStringSpeciesthestringtoreplacetherequestedobjectnameinredirections.
Thiselementcanbeavariable.
The${key}variablethatindicatestheobjectnameintherequestissupported.
Note:OnlyReplaceKeyWithorReplaceKeyPrexWithisallowed.
AssumethatReplaceKeyWithissettoprex/${key}.
sux.
Ifyouaccesstheobjecttest,theLocationheaderishttp://www.
test.
com/prefix/test.
suffix.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisExternalorAliCDN.
Parentnode:RedirectConditional.
ThiselementmustbespeciedifthevalueofRedirectTypeisInternal,External,orAliCDN.
ExamplesSamplerequestsPUT/websiteHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comContent-Length:209Date:Fri,04May201203:21:12GMTAuthorization:OSSqn6qrrqx******k53otfjbyc:KU5h8YM******0dXqf3JxrTZHiA=index.
htmltrue0error.
htmlSampleresponsesHTTP/1.
1200OKx-oss-request-id:534B371674E88A4D8906008BDate:Fri,04May201203:21:12GMTIssue:20200320101ObjectStorageServiceAPIReference/6BucketoperationsContent-Length:0Connection:keep-aliveServer:AliyunOSSExamplePUT/websiteHTTP/1.
1Date:Fri,27Jul201809:03:18GMTContent-Length:2064Host:test.
oss-cn-hangzhou-internal.
aliyuncs.
comAuthorization:OSSa1nBN******QMf8u:sNKIHT6ci/z231yIT5vYnetDLu4=User-Agent:aliyun-sdk-python-test/0.
4.
0index.
htmltrue0error.
html1abc/404Mirrortruehttp://www.
test.
com/truetruefalsetruemyheader-key1myheader-key2myheader-key3myheader-key4myheader-key5myheader-value52abc/404hosttest.
oss-cn-beijing-internal.
aliyuncs.
comAliCDN102Issue:20200320ObjectStorageServiceAPIReference/6Bucketoperationshttpwww.
test.
comfalseprefix/${key}.
suffix301HTTP/1.
1200OKServer:AliyunOSSDate:Fri,27Jul201809:03:18GMTContent-Length:0Connection:keep-alivex-oss-request-id:5B5ADFD6ED3CC49176CBE29Dx-oss-server-time:47SDKsJavaPythonGoC++PHPC.
NETNode.
jsErrorcodesErrorcodeHTTPstatuscodeDescriptionInvalidDigest400TheerrormessagereturnedbecausetheContent-MD5valueofthemessagebodyisinconsistentwiththeContent-MD5valueintherequestheader.
6.
16GetBucketWebsiteQueriesthestaticwebsitehostingstatusandroutingrulesforabucket.
RequestsyntaxGET/websiteHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateIssue:20200320103ObjectStorageServiceAPIReference/6BucketoperationsAuthorization:SignatureValueResponseelementsElementTypeDescriptionWebsiteConfigurationContainerRootnodeParentnode:NoneIndexDocumentContainerSpeciesthecontainerforthedefaulthomepage.
Parentnode:WebsiteCongurationSuffixStringSpeciesthedefaulthomepage.
Parentnode:IndexDocumentErrorDocumentContainerSpeciesthecontainerforthe404page.
Parentnode:WebsiteCongurationKeyContainer404pageParentnode:ErrorDocumentRoutingRulesContainerSpeciesthecontainerfortheRoutingRule.
Parentnode:WebsiteCongurationRoutingRuleContainerSpeciesroutingrulesormirroringback-to-originrules.
Parentnode:RoutingRulesRuleNumberPositiveintegerSpeciesthesequencenumberusedtomatchandexecuteroutingrules.
Routingrulesarematchedaccordingtothesequencenumbers.
Aroutingrulethatmatchesthenumberisexecutedandthefollowingrulesarenotexecuted.
Parentnode:RoutingRule104Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsConditionContainerSpeciesthematchingconditions.
Ifaroutingrulemeetsalltheconditions,itisexecuted.
TheelementsinthebucketareintheANDrelationship,thatis,aroutingrulemustmeetalltheconditionsbeforeitcanbeconsideredmatched.
Parentnode:RoutingRuleKeyPrefixEqualsStringIndicatesthatonlyobjectsthatmatchtheprexcanmatchtherule.
Parentnode:ConditionHttpErrorCodeReturnedEqualsHTTPstatuscodeIndicatesthattherulecanbematchedonlywhentheobjectreturnsthespeciedstatuscodewhenbeingaccessed.
Iftheroutingruleisamirroringback-to-sourcerule,thisstatuscodemustbe404.
Parentnode:ConditionIncludeHeaderContainerIndicatesthattheroutingrulecanbematchedonlywhenthespeciedheaderisincludedintherequestandtheheaderequalsthespeciedvalue.
Youcanspecifyamaximum5ofthesamecontainer.
Parentnode:ConditionKeyStringIndicatesthattheruleismatchedonlywhenthisheaderisincludedintherequestandtheheadervalueequalsthevaluespeciedbyEquals.
Parentnode:IncludeHeaderIssue:20200320105ObjectStorageServiceAPIReference/6BucketoperationsEqualsStringIndicatesthattherulecanbematchedonlywhentheheaderspeciedbyKeyisincludedintherequestandtheheadervalueequalsthespeciedvalue.
Parentnode:IncludeHeaderRedirectContainerSpeciestheactionstoperformaftertheruleismatched.
Parentnode:RoutingRuleRedirectTypeStringSpeciestheredirectingtype,whichhasthefollowingavailablevalues:Mirror(mirroringback-to-origin)External(externalredirection,thatis,OSSreturnsa3xxrequestwhichredirectstheaccesstoanotherIPaddress.
)Internal(internalredirection,thatis,OSSredirectstheaccessfromobject1toobject2basedontherule.
Inthiscase,theuseraccessesobject2butnotobject1.
)AliCDN(AliCDNredirection,whichisusedforAliCDN.
UnliketheExternaltype,OSSaddsanadditionalheadertotherequest.
Afteridentifyingtheheader,AliCDNredirectstheaccesstothespeciedIPaddressandreturnstheobtaineddatabutnotthe3xxredirectingrequesttotheuser.
)Parentnode:Redirect106Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsPassQueryStringBoolIndicateswhethertherequestparameteriscarriedwhentheredirectionormirroringback-to-originisperformed.
Forexample,iftheparameter"a=b&c=d"iscarriedinarequesttoOSSandthiselementissettotrue,thisparameterisaddedtotheLocationheaderwhentheruleis302redirection.
Forexample,iftherequestincludes"Location:www.
test.
coma=b&c=d"andtheredirectingtypeismirroringback-to-origin,theparameter"a=b&c=d"isalsocarriedintheback-to-originrequest.
Defaultvalue:falseParentnode:RedirectMirrorURLStringIndicatestheIPaddressoftheoriginsiteinthemirroringback-to-origin.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisMirror.
IftheMirrorURLstartswithhttp://orhttps://,itmustbeendedwithaslash(/).
OSSconstructstheback-to-originURLbyaddingthetargetobjecttotheMirrorURL.
Forexample,ifMirrorURLissettohttp://www.
test.
com/andtheobjecttobeaccessedis"myobject",theback-to-originURLishttp://www.
test.
com/dir1/myobject.
IfMirrorURLissettohttp://www.
test.
com/dir1/,theback-to-originURLishttp://www.
test.
com/dir1/myobject.
Parentnode:RedirectIssue:20200320107ObjectStorageServiceAPIReference/6BucketoperationsMirrorPassQueryStringBoolThiselementplaysthesameroleasPassQueryStringandhasahigherprioritythanPassQueryString.
However,thiselementtakeeectsonlywhentheRedirectTypeisMirror.
Defaultvalue:falseParentnode:RedirectMirrorFollowRedirectBoolIndicateswhethertheaccessisredirectedtothespeciedLocationiftheoriginsitereturnsa3xxstatuscodewhenreceivingaback-to-originrequest.
Forexample,theoriginsitereturnsa302statuscodeandspeciestheLocationwhenreceivingamirroringback-to-originrequest.
Inthiscase,ifthevalueofMirrorFollowRedirectistrue,OSScontinuestosendrequeststotheIPaddressspeciedbytheLocation.
(Arequestcanberedirectedforamaximumof10times.
Iftherequestisredirectedformorethan10times,amirroringback-to-originfailuremessageisreturned.
)IfthevalueofMirrorFollowRedirectisfalse,OSSreturnsa302statuscodeandpassesthroughtheLocation.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisMirror.
Defaultvalue:trueParentnode:Redirect108Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsMirrorCheckMd5BoolIndicateswhetherOSSperformsanMD5checkonthebodyoftheresponsereturnedbytheoriginsite.
WhenthevalueofthiselementistrueandtheresponsereturnedbytheoriginsiteincludesaContent-Md5header,OSScheckswhethertheMD5checksumoftheobtaineddatamatchestheheader.
Ifnot,OSSdoesnotstorethedata.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisMirror.
Defaultvalue:falseParentnode:RedirectMirrorHeadersContainerSpeciestheheadercarriedintheresponsereturnedbytheoriginsite.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisMirror.
Parentnode:RedirectPassAllBoolIndicateswhetherOSSpassesthroughallheaders(exceptforreservedheadersandtheheadersstartingwithoss-/x-oss-/x-drs-)totheoriginsite.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisMirror.
Defaultvalue:falseParentnode:MirrorHeadersIssue:20200320109ObjectStorageServiceAPIReference/6BucketoperationsPassStringSpeciestheheadersthatarepassedthroughtotheoriginsite.
Amaximumof10headerscanbespecied.
Themaximumlengthofaheaderis1,024bytes.
Thecharactersetofthiselementis:0-9,A-Z,a-z,anddash.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisMirror.
Parentnode:MirrorHeadersRemoveStringSpeciestheheadersthatcannottobepassedthroughtotheoriginsite.
Amaximumof10headerscanbespecied(includingrepeatedheaders).
ThiselementisusedtogetherwithPassAll.
Themaximumlengthofaheaderis1,024bytes.
ThecharactersetofthiselementisthesameasthatofPass.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisMirror.
Parentnode:MirrorHeadersSetContainerSpeciesheadersthataresenttotheoriginsite.
Thespeciedheadersareconguredinthedatareturnedbytheoriginsitenomatterwhethertheyarecarriedintherequest.
Amaximumof10groupsofheaderscanbecongured(includingrepeatedheaders).
ThiselementtakeseectonlywhenthevalueofRedirectTypeisMirror.
Parentnode:MirrorHeaders110Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsKeyStringSpeciesthekeyoftheheader.
Themaximumlengthofakeyis1,024bytes.
ThecharactersetofthiselementisthesameasthatofPass.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisMirror.
Parentnode:SetValueStringSpeciesthevalueoftheheader.
Themaximumlengthofthevalueis1,024bytes.
Thecharacter"\r\n"isnotallowedintheelement.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisMirror.
Parentnode:SetProtocolStringSpeciestheprotocolusedforredirections.
Forexample,theLocationheaderishttps://www.
test.
com/testiftherequestedobjectistest,therequestisredirectedtowww.
test.
com,andthevalueofProtocolishttps.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisExternalorAliCDN.
Values:http,httpsParentnode:RedirectIssue:20200320111ObjectStorageServiceAPIReference/6BucketoperationsHostNameStringSpeciesthedomainnameusedinredirections,whichmustcomplywiththespecicationsfordomainnames.
Forexample,theLocationheaderishttps://www.
test.
com/testiftherequestedobjectistest,thevalueofProtocolishttps,andtheHostnameisspeciedtowww.
test.
com.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisExternalorAliCDN.
Parentnode:RedirectHttpRedirectCodeHTTPstatuscodeSpeciesthereturnedstatuscodeinredirections.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisExternalorAliCDN.
Values:301,302,307Parentnode:RedirectReplaceKeyPrefixWithStringIndicatesthestringusedtoreplacetheprexoftherequestedobjectnameinredirections.
Iftheprexoftheobjectnameisempty,thisstringisaddedbeforetheobjectname.
TheReplaceKeyWithandReplaceKeyPrexWithelementscannotbesetsimultaneously.
Forexample,ifKeyPrexEqualsissettoabc/andReplaceKeyPrexWithissettodef/,theLocationheaderforanobjectnamedabc/test.
txtishttp://www.
test.
com/def/test.
txt.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisInternal,External,orAliCDN.
Parentnode:Redirect112Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsReplaceKeyWithStringIndicatesthestringusedtoreplacetherequestedobjectnameinredirections.
Thiselementcanbeavariable.
(The${key}variableindicatingtheobjectnameintherequestissupported.
)TheReplaceKeyWithandReplaceKeyPrexWithelementscannotbesetsimultaneously.
Forexample,ifReplaceKeyWithissettoprex/${key}.
sux,theLocationheaderforanobjectnamedtestishttp://www.
test.
com/prefix/test.
suffix.
ThiselementtakeseectonlywhenthevalueofRedirectTypeisInternal,External,orAliCDN.
Parentnode:RedirectExamplesRequestexampleGet/websiteHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Thu,13Sep201207:51:28GMTAuthorization:OSSqn6qrrqx******k53otfjbyc:BuG4rRK+zNh******1NNHD39zXw=ResponseexamplewithloggingrulesconguredHTTP/1.
1200x-oss-request-id:534B371674E88A4D8906008BDate:Thu,13Sep201207:51:28GMTConnection:keep-aliveContent-Length:218Server:AliyunOSSindex.
htmlerror.
htmlIssue:20200320113ObjectStorageServiceAPIReference/6BucketoperationsReturnexamplewithloggingrulesnotsetHTTP/1.
1404x-oss-request-id:534B371674E88A4D8906008BDate:Thu,13Sep201207:56:46GMTConnection:keep-aliveContent-Length:308Server:AliyunOSSNoSuchWebsiteConfigurationThespecifiedbucketdoesnothaveawebsiteconfiguration.
oss-example505191BEC4689A033D00236Foss-example.
oss-cn-hangzhou.
aliyuncs.
comCompletecodeGET/websiteHTTP/1.
1Date:Fri,27Jul201809:07:41GMTHost:test.
oss-cn-hangzhou-internal.
aliyuncs.
comAuthorization:OSSa1nBN******QMf8u:0Jzamofmy******sU9HUWomxsus=User-Agent:aliyun-sdk-python-test/0.
4.
0HTTP/1.
1200OKServer:AliyunOSSDate:Fri,27Jul201809:07:41GMTContent-Type:application/xmlContent-Length:2102Connection:keep-alivex-oss-request-id:5B5AE0DD2F7938C45FCED4BAx-oss-server-time:47index.
htmlerror.
html1abc/404Mirrortruehttp://www.
test.
com/truetruefalsetrue114Issue:20200320ObjectStorageServiceAPIReference/6Bucketoperationsmyheader-key1myheader-key2myheader-key3myheader-key4myheader-key5myheader-value52hosttest.
oss-cn-beijing-internal.
aliyuncs.
comabc/404AliCDNhttpwww.
test.
comfalseprefix/${key}.
suffix301SDKTheSDKsofthisAPIareasfollows:JavaPythonPHPGoC++C.
NETNode.
jsRubyIssue:20200320115ObjectStorageServiceAPIReference/6BucketoperationsErrorcodesErrorcodeHTTPstatuscodeDescriptionNoSuchBucket404Thetargetbucketdoesnotexist.
AccessDenied403Youdonothavethepermissiontoviewthestaticwebsitehostingstatusofthebucket.
Onlytheownerofabucketcanviewthestaticwebsitehostingstatusofthebucket.
NoSuchWebsiteConguration404Staticwebsitehostingisnotconguredforthetargetbucket.
6.
17DeleteBucketWebsiteDisablesthestaticwebsitehostingmodeandclearstheredirectionrulesforabucket.
Onlytheownerofabucketcandisablethestaticwebsitehostingmodeforthebucket.
RequestsyntaxDELETE/websiteHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueExamplesRequestexampleDELETE/websiteHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:Fri,24Feb201205:45:34GMTAuthorization:OSSqn6q*tfjbyc:LnM4AZ1OeIduZF5vGFWicOMEkVg=ResponseexampleHTTP/1.
1204NoContentx-oss-request-id:534B371674E88A4D8906008BDate:Fri,24Feb201205:45:34GMTConnection:keep-aliveContent-Length:0Server:AliyunOSSCompletecodeDELETE/websiteHTTP/1.
1Date:Fri,27Jul201809:10:52GMT116Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsHost:test.
oss-cn-hangzhou-internal.
aliyuncs.
comAuthorization:OSSa1nB******cQMf8u:qPrKwuMaarA4Tfk1pqTCylFs1jY=User-Agent:aliyun-sdk-python-test/0.
4.
0HTTP/1.
1204NoContentServer:AliyunOSSDate:Fri,27Jul201809:10:52GMTContent-Length:0Connection:keep-alivex-oss-request-id:5B5AE19C188DC1CE81DAD7C8ErrorcodesErrorcodeHTTPstatuscodeDescriptionNoSuchBucket404NotFoundThebucketthatyouwanttodisablethestaticwebsitehostingmodefordoesnotexist.
AccessDenied403ForbiddenYoudonothavethepermissiontodisablethestaticwebsitehostingmodeforthebucket.
Onlytheownerofabucketcandisablethestaticwebsitehostingmodeforabucket.
6.
18PutBucketRefererSetstherefereraccesswhitelistofabucketandcongureswhetherarequestinwhichthereferereldisnullisallowed.
RequestsyntaxPUT/refererHTTP/1.
1Date:GMTDateContent-Length:ContentLengthContent-Type:application/xmlHost:BucketName.
oss.
aliyuncs.
comAuthorization:SignatureValuetruehttp://www.
aliyun.
comhttps://www.
aliyun.
comhttp://www.
*.
comhttps://www.
.
aliyuncs.
comIssue:20200320117ObjectStorageServiceAPIReference/6BucketoperationsRequestelementsElementTypeRequiredDescriptionRefererConfigurationContainerYesSpeciesthecontainerthatstoresthereferersettings.
Sub-nodes:AllowEmptyRefererandRefererListParentnode:NoneAllowEmptyRefererEnumeratedstringYesSpecieswhetherarequestinwhichthereferereldisnullisallowed.
ThespeciedvaluereplacesthepreviousAllowEmptyReferersetting.
Validvalue:trueorfalseDefaultvalue:trueParentnode:RefererCongurationRefererListContainerYesSpeciesthecontainerthatstorestherefereraccesswhitelist.
Note:ThePutBucketRefereroperationreplacestheconguredwhitelistwiththewhitelistspeciedinRefererList.
IfthevalueofReferListisnull(thatis,Refererisnotincluded)intherequest,thisoperationreplacestheconguredwhitelistwithanullvalue,thatis,deletestheconguredRefererList.
Parentnode:RefererCongurationSub-node:RefererRefererStringNoSpeciesarefereraccesswhitelist.
Parentnode:RefererListDetailanalysisOnlythebucketownercaninitiateaPutBucketRefererrequest.
Otherwise,themessageof403Forbiddenisreturned.
Errorcode:AccessDenied.
118Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsThecongurationspeciedinAllowEmptyRefererreplacesthepreviousAllowEmptyRefererconguration.
Thiseldisrequired.
Bydefault,AllowEmptyRefererinthesystemisconguredastrue.
ThisoperationoverwritesthepreviouslyconguredwhitelistwiththewhitelistintheRefererList.
Whentheuser-uploadedRefererListisempty(containingnorefererrequestelement),thisoperationoverwritestheconguredwhitelist,thatis,thepreviouslyconguredRefererListisdeleted.
IfyouhaveuploadedtheContent-MD5requestheader,OSScalculatesthebody'sContent-MD5andchecksifthetwoarethesame.
Ifthetwoaredierent,theerrorcode:InvalidDigestisreturned.
ExamplesExampleofarequestwithnoreferercontained:PUT/refererHTTP/1.
1Host:BucketName.
oss.
example.
comContent-Length:247Date:Fri,04May201203:21:12GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:KU5h8YMUC78M30dXqf3JxrTZHiA=trueExampleofarequestwithreferercontained:PUT/refererHTTP/1.
1Host:BucketName.
oss.
example.
comContent-Length:247Date:Fri,04May201203:21:12GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:KU5h8YMUC78M30dXqf3JxrTZHiA=truehttp://www.
aliyun.
comhttps://www.
aliyun.
comhttp://www.
*.
comhttps://www.
.
aliyuncs.
comResponseexample:HTTP/1.
1200OKIssue:20200320119ObjectStorageServiceAPIReference/6Bucketoperationsx-oss-request-id:534B371674E88A4D8906008BDate:Fri,04May201203:21:12GMTContent-Length:0Connection:keep-aliveServer:AliyunOSSSDKTheSDKsofthisAPIareasfollows:JavaPythonPHPGoC.
NETNode.
jsRubyErrorcodesErrorcodeHTTPstatuscodeDescriptionAccessDenied403Youdonothavethepermissiontoperformthisoperation.
OnlythebucketownercaninitiateaPutBucketRefererrequest.
InvalidDigest400IfyouincludetheContent-MD5headerintherequest,OSScalculatestheContent-MD5oftherequestbodyandchecksifthetwoarethesame.
Ifthetwovaluesaredierent,thiserrorisreturned.
6.
19GetBucketRefererViewsthereferercongurationofabucket.
Onlytheownerofabucketcanviewthereferercongurationofthebucket.
RequestsyntaxGET/refererHTTP/1.
1Host:BucketName.
oss.
aliyuncs.
comDate:GMTDate120Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsAuthorization:SignatureValueResponseelementsElementTypeDescriptionRefererConfigurationContainerIndicatesthecontainerthatstoresthereferercongurationofthebucket.
Sub-node:AllowEmptyRefererandRefererListParentnode:NoneAllowEmptyRefererEnumeratedstringSpecieswhethertheaccessrequestinwhichthereferereldisnullisallowed.
Validvalue:trueorfalseDefaultvalue:trueParentnode:RefererCongurationRefererListContainerIndicatesthecontainerthatstorestherefereraccesswhitelistforthebucket.
Sub-node:RefererParentnode:RefererCongurationRefererStringSpeciesarefereraccesswhitelist.
Parentnode:RefererListDetailanalysisIfthebucketdoesnotexist,error404isreturned.
Errorcode:NoSuchBucket.
Onlytheownerofabucketcanviewthereferercongurationofthebucket.
Ifotherusersattempttoaccesstheconguration,theerror403Forbiddenwiththeerrorcode:AccessDeniedisreturned.
Ifnoreferercongurationhasbeenconductedforthebucket,OSSreturnsthedefaultAllowEmptyReferervalueandanemptyRefererList.
ExamplesRequestexample:Get/refererHTTP/1.
1Host:oss-example.
oss.
aliyuncs.
comIssue:20200320121ObjectStorageServiceAPIReference/6BucketoperationsDate:Thu,13Sep201207:51:28GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:BuG4rRK+zNhH1AcF51NNHD39zXw=Responseexamplereturnedwhenarefererruleisconguredforthebucket:HTTP/1.
1200x-oss-request-id:534B371674E88A4D8906008BDate:Thu,13Sep201207:51:28GMTConnection:keep-aliveContent-Length:218Server:AliyunOSStruehttp://www.
aliyun.
comhttps://www.
aliyun.
comhttp://www.
*.
comhttps://www.
.
aliyuncs.
comResponseexamplereturnedwhennorefererruleisconguredforthebucket:HTTP/1.
1200x-oss-request-id:534B371674E88A4D8906008BDate:Thu,13Sep201207:56:46GMTConnection:keep-aliveContent-Length:308Server:AliyunOSStrueSDKTheSDKsofthisAPIareasfollows:JavaPythonPHPGoC.
NETNode.
jsRuby122Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsErrorcodesErrorcodeHTTPstatuscodeDescriptionNoSuchBucket404Thetargetbucketdoesnotexist.
AccessDenied403Youdonothavethepermissiontoviewthereferercongurationofabucket.
Onlytheownerofabucketcanviewthereferercongurationofthebucket.
6.
20GetBucketLocationViewsthelocationinformationaboutthedatacenter(region)towhichabucketbelongs.
Onlytheownerofabucketcanviewtheregionofthebucket.
RequestsyntaxGET/LocationHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueResponseelementsElementTypeDescriptionLocationconstraintStringIndicatestheregionwhereabucketislocated.
Validvalues:oss-cn-hangzhou,oss-cn-qingdao,oss-cn-beijing,oss-cn-hongkong,oss-cn-shenzhen,oss-cn-shanghai,oss-us-west-1,oss-us-east-1,andoss-ap-southeast-1Note:FormoreinformationabouttheregionsandthelocationswheretheAlibabaClouddatacentersarelocated,seeRegionsandendpoints.
ExamplesRequestexample:Get/locationHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Fri,04May201205:31:04GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:ceOEyZavKY4QcjoUWYSpYbJ3naA=Issue:20200320123ObjectStorageServiceAPIReference/6BucketoperationsResponseexample:HTTP/1.
1200x-oss-request-id:534B371674E88A4D8906008BDate:Fri,15Mar201305:31:04GMTConnection:keep-aliveContent-Length:90Server:AliyunOSSoss-cn-hangzhouSDKTheSDKsofthisAPIareasfollows:JavaPHPGoCErrorcodesErrorcodeHTTPstatuscodeDescriptionAccessDenied403Youdonothavethepermissiontoviewtheregionofabucket.
Onlytheownerofabucketcanviewtheregionofthebucket.
6.
21GetBucketInfoYoucancallthisoperationtoviewinformationaboutabucket.
Onlythebucketownercanviewinformationaboutabucket.
Note:TherequestcanbeinitiatedfromanyOSSendpoint.
RequestsyntaxGET/bucketInfoHTTP/1.
1Host:BucketName.
oss.
aliyuncs.
comDate:GMTDate124Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsAuthorization:SignatureValueResponseelementsElementTypeDescriptionBucketInfoContainerThecontainerthatstoresthebucketinformationcontent.
Childnode:BucketParentnode:noneBucketContainerThecontainerthatstoresthespecicinformationaboutthebucket.
Parentnode:BucketInfoCreationDateTimeThetimewhenthebucketwascreated.
Timeformat:2013-07-31T10:56:21.
000Z.
ThetimefollowstheISO8601standardintheyyyy-MM-ddTHH:mm:ssZformat.
Parentnode:BucketInfo.
BucketExtranetEndpointStringTheOSSdomainnametoaccessthebucketoverthepublicnetwork.
Parentnode:BucketInfo.
BucketIntranetEndpointStringTheOSSdomainnametoaccessthebucketfromECSwithinthesameregionovertheinternalnetwork.
Parentnode:BucketInfo.
BucketLocationStringTheregionwherethebucketislocated.
Parentnode:BucketInfo.
BucketNameStringThebucketname.
Parentnode:BucketInfo.
BucketIssue:20200320125ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionOwnerContainerThecontainerthatstorestheinformationaboutthebucketowner.
Parentnode:BucketInfo.
BucketIDStringTheuserIDofthebucketowner.
Parentnode:BucketInfo.
Bucket.
OwnerDisplayNameStringThenameofthebucketowner,whichiscurrentlythesameastheuserID.
Parentnode:BucketInfo.
Bucket.
OwnerAccessControlListContainerThecontainerthatstorestheACLinformation.
Parentnode:BucketInfo.
BucketGrantEnumeratedstringTheACLforthebucket.
Validvalues:private,public-read,andpublic-read-writeParentnode:BucketInfo.
Bucket.
AccessControlListDataRedundancyTypeEnumeratedstringThetypeofdisasterrecovery.
Validvalues:LRSandZRSParentnode:BucketInfo.
BucketStorageClassStringThebucketstorageclass.
Validvalues:Standard,IA,andArchiveVersioningStringThestatusofversioningforthebucket.
Validvalues:EnabledandSuspendedParentnode:BucketInfo.
Bucket126Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionServerSideEncryptionRuleContainerThecontainerthatstoresserver-sideencryptionrules.
Parentnode:BucketInfo.
BucketApplyServerSideEncryptionByDefaultContainerThecontainerthatstoresthedefaultserver-sideencryptionmethod.
Parentnode:BucketInfo.
BucketSSEAlgorithmStringDisplaysthedefaultserver-sideencryptionmethod.
Validvalues:KMSandAES256KMSMasterKeyIDStringDisplaysthecurrentlyusedCMKID.
AvalidvalueisreturnedonlywhenyousetSSEAlgorithmtoKMSandspecifytheCMKID.
Inothercases,nullisreturned.
ExamplesSamplerequestsGet/bucketInfoHTTP/1.
1Host:oss-example.
oss.
aliyuncs.
comDate:Sat,12Sep201507:51:28GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:BuG4rRK+zNhH1AcF51NNHD39****SampleresponsesSamplesuccessresponseswheninformationaboutthebucketisobtainedHTTP/1.
1200x-oss-request-id:534B371674E88A4D8906****Date:Sat,12Sep201507:51:28GMTConnection:keep-aliveContent-Length:531Server:AliyunOSS2013-07-31T10:56:21.
000ZIssue:20200320127ObjectStorageServiceAPIReference/6Bucketoperationsoss-cn-hangzhou.
aliyuncs.
comoss-cn-hangzhou-internal.
aliyuncs.
comoss-cn-hangzhouoss-exampleusername27183473914****privatetestSampleerrorresponseswhenaspeciedbucketisnotfoundHTTP/1.
1404x-oss-request-id:534B371674E88A4D8906****Date:Sat,12Sep201507:51:28GMTConnection:keep-aliveContent-Length:308Server:AliyunOSSNoSuchBucketThespecifiedbucketdoesnotexist.
568D547F31243C673BA1****nosuchbucket.
oss.
aliyuncs.
comnosuchbucketSampleerrorresponseswhenyouarenotauthorizedtoaccessinformationaboutthebucketHTTP/1.
1403x-oss-request-id:534B371674E88A4D8906****Date:Sat,12Sep201507:51:28GMTConnection:keep-aliveContent-Length:209Server:AliyunOSSAccessDeniedAccessDenied568D5566F2D0F89F5C0E****test.
oss.
aliyuncs.
comSDKsYoucancallthisoperationwhenyouuseSDKdemosinanyofthefollowingprogramminglanguages:JavaPython128Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsGoCErrorcodesErrorcodeHTTPstatuscodeDescriptionNoSuchBucket404Theerrormessagereturnedbecausenosuchbucketisfound.
AccessDenied403Theerrormessagereturnedbecauseyouarenotauthorizedtoviewinformationaboutthebucket.
Onlythebucketownercanviewinformationaboutabucket.
6.
22PutBucketTagsAddstagsforabucketormodifythetagsforabucket.
Note:OnlythebucketownerorauthorizedRAMuserscanaddtagsforabucket.
Otherwise,the403Forbiddenerrorisreturnedwiththeerrorcode:AccessDenied.
Youcanaddamaximumof20tags(key-valuepairs)forabucket.
IfyoucallPutBucketTagstoaddtagsforabucket,theoriginaltagsaddedforthebucketarecompletelyoverwritten.
RequestsyntaxPUT/taggingHTTP/1.
1Date:GMTDateContent-Length:ContentLengtAuthorization:SignatureValueHost:BucketName.
oss-cn-hangzhou.
aliyuncs.
comkey1value1key2value2Issue:20200320129ObjectStorageServiceAPIReference/6BucketoperationsRequestelementsElementTypeRequiredDescriptionTaggingContainerYesSpeciesthecontainerusedtoconguretheTagSetforthebucket.
Sub-node:TagSetParentnode:NoneTagSetContainerYesSpeciesthecontainerusedtostoreasetoftagsforthebucket.
Sub-node:TagParentnode:TaggingTagContainerYesSpeciesthecontainerusedtocongureatagforthebucket.
Sub-node:Key,ValueParentnode:TagSet130Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsElementTypeRequiredDescriptionKeyStringYesSpeciesthekeyofatagforthebucket.
Themaximumsizeofakeyis64bytes.
Thekeyofatagcannotbeprexedwithhttp://,https://,orAliyun.
ThekeyofatagmustbeUTF-8encoded.
Thekeyofatagcannotbenull.
Parentnode:TagSub-node:NoneValueStringNoSpeciesthevalueofatagforthebucket.
Themaximumsizeofatagvalueis128bytes.
ThevalueofatagmustbeUTF-8encoded.
Thevalueofatagcanbenull.
Sub-node:NoneParentnode:TagExamplesRequestexample:PUT/taggingHost:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,20Dec201811:49:13GMTAuthorization:OSSqn6qrrqxo2oawuk53otf****:ceOEyZavKY4QcjoUWYSpYbJ3****testaIssue:20200320131ObjectStorageServiceAPIReference/6Bucketoperationstestv1testbtestv2Responseexample:200(OK)content-length:0server:AliyunOSSx-oss-request-id:5C1B138A109F4E405B2D8AEFdate:Thu,20Dec201811:59:06GMTx-oss-server-time:148connection:keep-alive6.
23GetBucketTagsObtainsthetagsforabucket.
RequestsyntaxGET/taggingHost:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueResponseelementsElementTypeDescriptionTaggingContainerIndicatesthecontainerusedtostorethereturnedtagsforabucket.
Parentnode:NoneTagSetContainerIndicatesthecontainerusedtostorethereturnedtagsforabucket.
Parentnode:TaggingTagContainerIndicatesthecontainerusedtostorethereturnedtagsforabucket.
Parentnode:TagSet132Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionKeyStringIndicatesthekeyofatag.
Parentnode:TagValueStringIndicatesthevalueofatag.
Parentnode:TagDetailanalysisIfthetargetbucketdoesnotexist,the404NoContenterrorisreturnedwiththeerrorcode:NoSuchBucket.
OnlythebucketownerandauthorizedRAMuserscanviewthetagsforabucket.
Otherwise,the403Forbiddenerrorisreturnedwiththeerrorcode:AccessDenied.
Ifnotagsareaddedforthebucket,OSSreturnsanXMLmessagebodyinwhichvalueofTaggingisnull.
ExamplesRequestexample:GET/taggingHost:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,20Dec201813:09:13GMTAuthorization:OSSqn6qrrqxo2oawuk53otf****:ceOEyZavKY4QcjoUWYSpYbJ3****Responseexample:200(OK)content-length:237server:AliyunOSSx-oss-request-id:5C1B2D24B90AD5490CFE368Edate:Thu,20Dec201813:12:21GMTcontent-type:application/xmltestavalue1-testtestbvalue2-testIssue:20200320133ObjectStorageServiceAPIReference/6Bucketoperations6.
24DeleteBucketTagsDeletesthetagsaddedforabucket.
RequestsyntaxDELETE/taggingHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueDetailanalysisIfthetargetbucketdoesnotexist,the404NoContenterrorisreturnedwiththeerrorcode:NoSuchBucket.
Onlythebucketownercandeletethetagsaddedforabucket.
Ifyoutrytodeletethetagsforabucketownedbyanotheruser,the403Forbiddenerrorisreturnedwiththeerrorcode:AccessDenied.
Ifnotagsareaddedforthebucketorthekeyofthespeciedtagdoesnotexist,theHTTPstatuscode204isreturned.
ExamplesRequestexample1(Deletealltagsforabucket):DELETE/taggingHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,25Dec201817:35:24GMTAuthorization:OSSqn6qrrqxo2oawuk53otf****:6ZVHOehYzxoC1yxRydPQs/Cn****Responseexample:HTTP/1.
1204NoContentx-oss-request-id:5C22E0EFD127F6810B1A92A8Date:Tue,25Dec201817:35:24GMTConnection:keep-aliveContent-Length:0Server:AliyunOSSRequestexample2(Deletespeciedtagsforabucket,forexample,tagsofwhichthekeysarek1andk2):DELETE/tagging=k1,k2HTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,25Dec201817:35:24GMT134Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsAuthorization:OSSqn6qrrqxo2oawuk53otf****:6ZVHOehYzxoC1yxRydPQs/Cn****Responseexample:HTTP/1.
1204NoContentx-oss-request-id:5C22E0EFD127F6810B1A92A8Date:Tue,25Dec201817:35:24GMTConnection:keep-aliveContent-Length:0Server:AliyunOSS6.
25PutBucketEncryptionCongurestheencryptionruleforabucket.
RequestsyntaxPUT/encryptionHTTP/1.
1Date:GMTDateContent-Length:ContentLengthContent-Type:application/xmlHost:BucketName.
oss.
aliyuncs.
comAuthorization:SignatureValueAES256RequestelementsElementTypeRequiredDescriptionServerSideEncryptionRuleContainerYesSpeciesthecontainerusedtostoretheserver-sideencryptionrule.
Sub-node:ApplyServerSideEncryptionByDefaultApplyServerSideEncryptionByDefaultContainerYesSpeciesthecontainerusedtostorethedefaultserver-sideencryptionmethod.
Sub-element:SSEAlgorithm,KMSMasterKeyIDIssue:20200320135ObjectStorageServiceAPIReference/6BucketoperationsElementTypeRequiredDescriptionSSEAlgorithmStringYesSpeciesthedefaultserver-sideencryptionmethod.
Validvalue:KMS,AES256KMSMasterKeyIDStringNoSpeciestheCMKIDwhenthevalueofSSEAlgorithmisKMSandaspeciedCMKisusedforencryption.
IfthevalueofSSEAlgorithmisnotKMS,thiselementmustbenull.
DetailanalysisOnlythebucketownerandauthorizedRAMuserscancongureencryptionrulesforabucket.
Otherwise,the403Forbiddenerrorisreturned.
APIcallingfeesmayincurwhenyouusetheCMKforencryption.
IfthevalueofSSEAlgorithmisnotKMSorAES256,the400InvalidEncryptionAlgorithmerrorisreturnedwiththefollowingerrormessage:TheEncryptionrequestyouspeciedisnotvalid.
Supportedvalue:AES256/KMS.
IfthevalueofSSEAlgorithmisAES256andKMSMasterKeyIDisnotnull,the400InvalidArgumenterrorisreturnedwiththefollowingerrormessage:KMSMasterKeyIDisnotapplicableifthedefaultssealgorithmisnotKMS.
ExamplesRequestexample:PUT/encryptionHTTP/1.
1Date:Tue,20Dec201811:09:13GMTContent-Length:ContentLengthContent-Type:application/xmlHost:oss-example.
oss-cn-hangzhou.
aliyuncs.
comAuthorization:OSSqn6qrrqxo2oawuk53otf****:ceOEyZavKY4QcjoUWYSpYbJ3****KMS9468da86-3509-4f8d-a61e-6eab1eac****136Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsResponseexample:HTTP/1.
1200OKx-oss-request-id:5C1B138A109F4E405B2D8AEFDate:Thu,20Dec201811:11:06GMT6.
26GetBucketEncryptionObtainstheencryptionruleforabucket.
RequestsyntaxGet/encryptionHTTP/1.
1Date:GMTDateHost:BucketName.
oss.
aliyuncs.
comAuthorization:SignatureValueResponseelementsElementTypeRequiredDescriptionServerSideEncryptionRuleContainerYesIndicatesthecontainerusedtostoretheserver-sideencryptionrule.
Sub-node:ApplyServerSideEncryptionByDefaultApplyServerSideEncryptionByDefaultContainerYesIndicatesthecontainerusedtostorethedefaultserver-sideencryptionmethod.
Sub-node:SSEAlgorithm,KMSMasterKeyIDSSEAlgorithmStringYesIndicatesthedefaultserver-sideencryptionmethod.
Validvalue:KMS,AES256Issue:20200320137ObjectStorageServiceAPIReference/6BucketoperationsElementTypeRequiredDescriptionKMSMasterKeyIDStringNoIndicatestheIDofCMKthatiscurrentlyused.
ThiselementisonlyreturnedwhenthevalueofSSEAlgorithmisKMSandtheCMKIDisspecied.
Inothercases,thevalueofthiselementisnull.
DetailanalysisOnlythebucketownerandauthorizedRAMuserscanviewtheencryptionruleforabucket.
Otherwise,the403Forbiddenerrorisreturnedwiththeerrorcode:AccessDenied.
Ifthetargetbucketdoesnotexist,the404errorisreturnedwiththeerrorcode:NoSuchBucket.
Ifnoencryptionruleisconguredforthebucket,the404errorisreturnedwiththeerrorcode:NoSuchServerSideEncryptionRule.
ExamplesRequestexample:Get/encryptionHTTP/1.
1Date:Tue,20Dec201811:20:10GMTHost:oss-example.
oss-cn-hangzhou.
aliyuncs.
comAuthorization:OSSqn6qrrqxo2oawuk53otf****:ceOEyZavKY4QcjoUWYSpYbJ3****Responseexample:HTTP/1.
1204NoContentx-oss-request-id:5C1B138A109F4E405B2D8AEFDate:Tue,20Dec201811:22:05GMTKMS9468da86-3509-4f8d-a61e-6eab1eac****138Issue:20200320ObjectStorageServiceAPIReference/6Bucketoperations6.
27DeleteBucketEncryptionDeletestheencryptionruleforabucket.
RequestsyntaxDELETE/encryptionHTTP/1.
1Date:GMTDateHost:BucketName.
oss.
aliyuncs.
comAuthorization:SignatureValueDetailanalysisOnlythebucketownerandauthorizedRAMuserscandeletetheencryptionruleforabucket.
Otherwise,the403Forbiddenerrorisreturnedwiththeerrorcode:AccessDenied.
Ifthetargetbucketdoesnotexist,the404errorisreturnedwiththeerrorcode:NoSuchBucket.
ExamplesRequestexample:DELETE/encryptionHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,20Dec201811:35:24GMTAuthorization:OSSqn6qrrqxo2oawuk53otf****:6ZVHOehYzxoC1yxRydPQs/Cn****Responseexample:HTTP/1.
1204OKx-oss-request-id:5C22E0EFD127F6810B1A92A8Date:Tue,20Dec201811:37:05GMTConnection:keep-aliveContent-Length:06.
28PutBucketRequestPaymentYoucancallthisoperationtocongurepay-by-requestermodeforabucket.
Note:YoucansetthepayertoBucketOwnerorRequester.
Ifthebuckethaspay-by-requestermodeenabled,accessfromanonymoususersisdenied.
Issue:20200320139ObjectStorageServiceAPIReference/6BucketoperationsIfthebuckethaspay-by-requestermodeenabledandtherequesterisnotthebucketowner,therequestermustincludethex-oss-request-payer:requesterrequestheader.
Thisway,therequesterunderstandsthattheirrequestsanddatadownloadsincurfees.
x-oss-request-charged:requesterisincludedintheserverresponse.
Iftheoss-request-payer:requesterrequestheaderisnotincluded,theaccessisdenied.
RequestsyntaxPUT/requestPaymentHTTP/1.
1Date:GMTDateContent-Length:ContentLengthContent-Type:application/xmlHost:BucketName.
oss.
aliyuncs.
comAuthorization:SignatureValueRequesterRequestelementsElementTypeRequiredDescriptionRequestPaymentConfigurationContainerYesSpeciesthecontainerforthepayer.
Child:PayerPayerStringYesSpecieswhopaysthedownloadandrequestfees.
Validvalues:BucketOwnerandRequesterParent:RequestPaymentCongurationExamplesRequestsamplePUT/requestPaymentContent-Length:83Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,23Jul201901:33:47GMT140Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsAuthorization:OSSLTAIC*FsDgQiO+RMwLq*RequesterResponsesample200(OK)content-length:0x-oss-request-id:5D3663FBB007B79097FC****date:Tue,23Jul201901:33:47GMTSDKsSDKsthatsupportthisoperationusethefollowinglanguages:JavaPythonGoC++ErrorcodesErrorcodeHTTPstatuscodeDescriptionNoSuchBucket404Theerrormessagereturnedbecausethespeciedbucketdoesnotexist.
6.
29GetBucketRequestPaymentYoucancallthisoperationtoobtainpay-by-requestercongurationsforabucket.
RequestsyntaxGET/requestPaymentHTTP/1.
1Date:GMTDateHost:BucketName.
oss.
aliyuncs.
comAuthorization:authorizationstringResponseelementsElementTypeDescriptionRequestPaymentConfigurationContainerIndicatesthecontainerforthepayer.
Child:PayerIssue:20200320141ObjectStorageServiceAPIReference/6BucketoperationsElementTypeDescriptionPayerStringIndicateswhopaysthedownloadandrequestfees.
Validvalues:BucketOwnerandRequesterParent:RequestPaymentCongurationExamplesRequestsampleGET/requestPaymentHost:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,23Jul201901:23:20GMTAuthorization:OSSLTAICQmy1*Rk7tT30yhDO3D*Responsesample200(OK)content-length:129server:AliyunOSSx-oss-request-id:5D366188B007B79097EC****date:Tue,23Jul201901:23:20GMTcontent-type:application/xmlBucketOwnerSDKsSDKsthatsupportthisoperationusethefollowinglanguages:JavaPythonGoC++142Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsErrorcodesErrorcodeHTTPstatuscodeDescriptionNoSuchBucket404Theerrormessagereturnedbecausethespeciedbucketdoesnotexist.
6.
30PutBucketPolicyYoucancallPutBucketPolicytocongurepoliciesforaspeciedbucket.
Bucketpoliciesprovideresource-basedauthorizationforusers.
Bucketpoliciesapplytothefollowingscenarios:AuthorizeRAMusersofotheraccountstoaccessyourOSSresources.
YoucanauthorizeRAMusersofotheraccountstoaccessyourOSSresources.
AuthorizeanonymoususerstoaccessyourOSSresourcesusingspecicIPaddressesorIPranges.
Insomecases,youmustauthorizeanonymoususerstoaccessOSSresourcesusingspecicIPaddressesorIPranges.
Forexample,condentialdocumentsofanenterpriseareonlyallowedtobeaccessedwithintheenterprisebutnotinotherregions.
Previously,conguringRAMpoliciesforeveryuserwasatediousandcomplextaskbecauseofthepotentialforalargenumberofinternalusers.
Toresolvethisissue,youcancongureaccesspolicieswithIPrestrictionsbasedonbucketpoliciestoauthorizealargenumberofuserseasilyandeciently.
Formoreinformationaboutbucketpolicycongurationsandusecases,see#unique_149.
Formoreinformationaboutbucketpolicysyntax,see#unique_150.
RequestsyntaxPUT/policyHost:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,13Nov201809:09:13GMTAuthorization:OSSxxxxxxxxx:xxxxxxxxxxxPolicywritteninJSONExamplesSamplerequestsPUT/policyContent-Length:230Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comIssue:20200320143ObjectStorageServiceAPIReference/6BucketoperationsDate:Thu,21Feb201912:51:09GMTAuthorization:OSSxxxxxxx:xxxxxxxxxxxx{"Version":"1","Statement":[{"Action":["oss:PutObject","oss:GetObject"],"Effect":"Deny","Principal":["1234567890"],"Resource":["acs:oss:*:1234567890:*/*"]}]}Sampleresponses200(OK)content-length:0server:AliyunOSSx-oss-server-time:87connection:keep-alivex-oss-request-id:5C6E9EBD5CC26B28EE41****date:Thu,21Feb201912:51:09GMT6.
31GetBucketPolicyYoucancallGetBucketPolicytoquerythepoliciesconguredforaspeciedbucket.
Bucketpoliciesprovideresource-basedauthorizationforusers.
Bucketpoliciesapplytothefollowingscenarios:Formoreinformationaboutbucketpolicycongurationsandusecases,see#unique_149.
Formoreinformationaboutbucketpolicysyntax,see#unique_150.
RequestsyntaxGET/policyHost:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueExamplesSamplerequestsGET/policyHost:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,13Nov201809:09:13GMT144Issue:20200320ObjectStorageServiceAPIReference/6BucketoperationsAuthorization:OSSxxxxxxxxx:xxxxxxxxxxxSampleresponses200(OK)server:AliyunOSSx-oss-server-time:24connection:keep-alivex-oss-request-id:5C6E9847BE0EBCD13DA90C11date:Thu,21Feb201912:23:35GMTcontent-type:application/json{"Version":"1","Statement":[{"Action":["oss:PutObject","oss:GetObject"],"Effect":"Deny","Principal":["1234567890"],"Resource":["acs:oss:*:1234567890:*/*"]}]}ErrorcodesErrorcodeHTTPstatuscodeDescriptionNoSuchBucketPolicy404Nopolicyisconguredfortherequestedbucket.
6.
32DeleteBucketPolicyYoucancallDeleteBucketPolicytodeletethepoliciesconguredforaspeciedbucket.
Bucketpoliciesprovideresource-basedauthorizationforusers.
Bucketpoliciesapplytothefollowingscenarios:Formoreinformationaboutbucketpolicycongurationsandusecases,see#unique_149.
Formoreinformationaboutbucketpolicysyntax,see#unique_150.
ExamplesSamplerequestsDELETE/policyHost:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Thu,21Feb201912:55:10GMTIssue:20200320145ObjectStorageServiceAPIReference/6BucketoperationsAuthorization:OSSxxxxxxxx:xxxxxxxxxxxxxxSampleresponses204(NoContent)content-length:0server:AliyunOSSx-oss-server-time:31connection:keep-alivex-oss-request-id:5C6E9FAF31A13327124B****date:Thu,21Feb201912:55:11GMT146Issue:20200320ObjectStorageServiceAPIReference/7Objectoperations7Objectoperations7.
1PutObjectUploadsobjects.
Note:Thesizeoftheobjecttobeuploadedcannotexceed5GB.
Ifanobjectwiththesamenameasanexistingobject,andyouhaveaccesstoit,theexistingobjectisoverwrittenbytheuploadedobject,andthestatuscode200OKisreturned.
OSSdoesnothaveafolder.
Allthedataisstoredasobjects.
Youcancreateanemptyobjectasafolder.
VersioningInabucketwithversioningenabled,OSSgeneratesauniqueversionIDforanewlyuploadedobject,andreturnstheversionIDinthex-oss-version-ideldintheresponseheader.
Inabucketwithversioningsuspended,theversionIDforanewlyuploadedobjectisnull.
EachobjectcanonlyhasoneversionofwhichtheversionIDisnull.
RequestsyntaxPUT/ObjectNameHTTP/1.
1Content-Length:ContentLengthContent-Type:ContentTypeHost:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueRequestheaderNote:OSSsupportsthefollowingveheadereldsdenedinHTTP:Cache-Control,Expires,Content-Encoding,Content-Disposition,andContent-Type.
Iftheseheadersaresetwhenyouuploadanobject,theheadervaluesareautomaticallysettothecorrespondingvalueswhentheobjectisdownloaded.
Issue:20200320147ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeRequiredDescriptionAuthorizationStringNoIndicatesthattherequestisauthorized.
Formoreinformation,seeRFC2616.
Generally,theAuthorizationrequestheaderisrequired.
ThisheaderisoptionaliftheURLyouusecontainsasignature.
Formoreinformation,seeGenerateasignedURL.
Defaultvalue:NoneCache-controlStringNoSpeciestheWebpagecachingbehaviorwhentheobjectisdownloaded.
Formoreinformation,seeRFC2616.
Defaultvalue:NoneContent-DispositionStringNoSpeciesthenameoftheobjectwhentheobjectisdownloaded.
Formoreinformation,seeRFC2616.
Defaultvalue:NoneContent-EncodingStringNoSpeciesthecontentencodingformatwhentheobjectisdownloaded.
Formoreinformation,seeRFC2616.
Defaultvalue:NoneContent-MD5StringNoCheckswhetherthemessagecontentisconsistentwiththesentcontent.
ThevalueofContent-MD5iscalculatedbasedontheMD5algorithm.
AftertheContent-MD5requestheaderisuploaded,OSScalculatesContent-MD5andcheckstheconsistency.
Defaultvalue:None148Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeRequiredDescriptionContent-LengthStringNoSpeciesthedatalengthintheHTTPrequestbody.
IfthevalueofContent-Lengthintherequestheaderissmallerthanthedatalengthintherequestbody,OSScanstillcreatetheobjectsuccessfully.
However,theobjectsizeisthevalueofContent-Length,andthedatathatexceedsthevalueisdiscarded.
ETagStringNoAnentitytag(ETag)iscreatedtoidentifythecontentofanobjectwhentheobjectiscreated.
ForanobjectcreatedwiththePutObjectrequest,itsETagistheMD5valueoftheobjectcontent.
Foranobjectcreatedbyusingothermethods,itsETagistheUUIDoftheobjectcontent.
Note:TheETagvalueofanobjectcanbeusedtocheckwhethertheobjectcontenthaschanged.
However,werecommendthatyounotusetheETagofanobjectastheMD5valueoftheobjecttoverifydataintegrity.
Defaultvalue:NoneIssue:20200320149ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeRequiredDescriptionExpiresStringNoSpeciestheexpirationtime.
Formoreinformation,seeRFC2616.
Defaultvalue:Nonex-oss-server-side-encryptionStringNoSpeciestheserver-sideencryptionalgorithmwhenOSScreatesanobject.
Validvalues:AES256andKMSNote:YoumustenableKeyManagementService(KMS)intheconsolebeforeyoucanusetheKMSencryptionalgorithm.
Otherwise,aKmsServiceNotEnablederrorcodeisreported.
Afterthisheaderisspecied,itwillbereturnedintheresponseheader,andOSSwillencryptandstoretheuploadedobject.
Whentheobjectisdownloaded,theresponseheaderwillcontainx-oss-server-side-encryptionandthevaluewillbesettotheencryptionalgorithmoftheobject.
x-oss-server-side-encryption-key-idStringNoSpeciestheprimarykeymanagedbyKMS.
Thisparameterisvalidwhenthevalueofx-oss-server-side-encryptionissettoKMS.
150Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeRequiredDescriptionx-oss-object-aclStringNoSpeciestheaccesspermissionwhenOSScreatesanobject.
Validvalues:public-read,private,andpublic-read-writex-oss-storage-classStringNoSpeciesthestorageclassoftheobject.
Ifyouspecifythevalueofx-oss-storage-classwhenuploadinganobjecttoabucket,thestorageclassoftheuploadedobjectisthespeciedvalue.
Forexample,ifyouspecifythevalueofx-oss-storage-classtoStandardwhenuploadinganobjecttoabucketoftheIAstorageclass,thestorageclassoftheobjectisStandard.
Validvalues:Standard,IA,andArchiveSupportedAPIs:PutObject,InitMultipartUpload,AppendObject,PutObjectSymlink,andCopyObjectIssue:20200320151ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeRequiredDescriptionx-oss-meta-*StringNoWhenyouusethePutObjectAPI,ifyoucongureaparameterprexedwithx-oss-meta-*,thisparameterthenworksasthemetadata,suchasx-oss-meta-location.
Anobjectcanhavemultiplesimilarparameters.
However,thetotalsizeofallmetadatacannotexceed8KB.
Themetadatacanbenumbers,hyphens(-),andlowercaseletters.
Othercharacterssuchasunderscores(_)arenotsupported.
Uppercaselettersareconvertedtolowercaselettersautomatically.
x-oss-taggingStringNoSpeciesthetagoftheobject.
Youcansetmultipletagsatthesametime,forexample,TagA=A&TagB=B.
Note:YoumustperformURLencodingforthetagkeyandvalueinadvance.
Ifatagdoesnotcontainanequalsign(=),thisstringdoesnothaveavalue.
ExamplesRequestexampleinsimpleupload:PUT/test.
txtHTTP/1.
1Host:test.
oss-cn-zhangjiakou.
aliyuncs.
comUser-Agent:aliyun-sdk-python/2.
6.
0(Windows/7/AMD64;3.
7.
0)Accept:*/*Connection:keep-aliveContent-Type:text/plaindate:Tue,04Dec201815:56:37GMTauthorization:OSSqn6qrrqxo2oawuk53otf****:kZoYNv66bsmc10+dcGKw5x2P****152Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsTransfer-Encoding:chunkedResponseexample:HTTP/1.
1200OKServer:AliyunOSSDate:Tue,04Dec201815:56:38GMTContent-Length:0Connection:keep-alivex-oss-request-id:5C06A3B67B8B5A3DA422****ETag:"D41D8CD98F00B204E9800998ECF8427E"x-oss-hash-crc64ecma:0Content-MD5:1B2M2Y8AsgTpgAmY7PhCfg==x-oss-server-time:7RequestexampleinwhichthestorageclassisspeciedasArchive:PUT/oss.
jpgHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comCache-control:no-cacheExpires:Fri,28Feb201205:38:42GMTContent-Encoding:utf-8Content-Disposition:attachment;filename=oss_download.
jpgDate:Fri,24Feb201206:03:28GMTContent-Type:image/jpgContent-Length:344606x-oss-storage-class:ArchiveAuthorization:OSSqn6qrrqxo2oawuk53otf****:kZoYNv66bsmc10+dcGKw5x2P****[344606bytesofobjectdata]Responseexmaple:HTTP/1.
1200OKServer:AliyunOSSDate:Sat,21Nov201518:52:34GMTContent-Type:image/jpgContent-Length:0Connection:keep-alivex-oss-request-id:5650BD72207FB3044396****x-oss-bucket-version:1418321259ETag:"A797938C31D59EDD08D86188F6D5B872"Requestexamplewhenversioningisenabledforthetargetbucket:PUT/testHTTP/1.
1Content-Length:362149Content-Type:text/htmlHost:versioning-put.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,09Apr201902:53:24GMTAuthorization:OSSlkojgn8y1ex****:6yYhX+BuuEqzI1tAMW0wgIyl****Responseexample:HTTP/1.
1200OKServer:AliyunOSSDate:Tue,09Apr201902:53:24GMTContent-Length:0Connection:keep-alivex-oss-request-id:5CAC0A3DB7AEADE01700****Issue:20200320153ObjectStorageServiceAPIReference/7Objectoperationsx-oss-version-id:CAEQNhiBgMDJgZCA0BYiIDc4MGZjZGI2OTBjOTRmNTE5NmU5NmFhZjhjYmY0MWM2ETag:"4F345B1F066DB1444775AA97D5D26ADA"SDKJavaPythonPHPGoC.
NETiOSNode.
jsBrowser.
jsRubyErrorcodesErrorcodeHTTPstatuscodeDescriptionMissingContentLength411TherequestheaderisnotencodedaccordingtochunkedencodinganddoesnotcontaintheContent-Lengthparameter.
InvalidEncryptionAlgorithmError400Thevalueofx-oss-server-side-encryptionisinvalid.
ThevalidvalueisAES256orKMS.
AccessDenied403Youdonothavethepermissiontoaccessthebuckettowhichyouwanttoaddanobject.
NoSuchBucket404Thebuckettowhichyouwanttoaddanobjectdoesnotexist.
InvalidObjectName400Thelengthoftheuploadedobjectkeyexceeds1,023bytes.
InvalidArgument400Theuploadedobjectexceeds5GB.
Valuesoftheparameterssuchasx-oss-storage-classareinvalid.
154Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsErrorcodeHTTPstatuscodeDescriptionRequestTimeout400TheContent-Lengthparameterisspecied,butthemessagebodyisnotsent.
Orthesentmessagebodyissmallerthanthespeciedsize.
Inthiscase,theseverkeepswaitinguntiltimesout.
KmsServiceNotEnabled403Thex-oss-server-side-encryptionisspeciedtoKMS.
However,youdonotenableKMSinadvance.
7.
2CopyObjectCopiesobjectswithinabucketorbetweenbucketsinthesameregion.
BycallingCopyObject,youcansendaPUTrequesttoOSS.
OSSautomaticallyrecognizestherequestasacopyoperationandperformitontheserver.
VersioningCopyObjectcopiesthecurrentversionofanobjectbydefault.
Ifthecurrentversionofthetargetobjectisadeletemarker,the404NotFounderrorisreturnedtoindicatethattheobjectdoesnotexist.
YoucanspecifytheversionIdinaCopyObjectrequesttocopyaspeciedversionofthetargetobject.
However,adeletemarkercannotbecopied.
Youcancopyahistoricalversionofanobjecttothebucketthatstorestheobject.
Thecopiedhistoricalversionbecomesthecurrentversionofanewobject.
Youcanusethismethodtorestoreahistoricalversionofanobject.
Ifversioningisenabledforthebucketthatstoresthetargetobjectisenabled,OSSgeneratesauniqueversionIDforthecopiedobject,whichisreturnedinthex-oss-version-ideldintheresponseheader.
Ifversioningissuspendedornotenabledforthebucketthatstoresthetargetobject,OSSgeneratesaversionofwhichtheIDisnullforthecopiedobjectandoverwriteoverwritestheoriginalversionofwhichtheIDisnull.
LimitsCopyObjectonlysupportsobjectssmallerthan1GB.
Tocopyobjectslargerthan1GB,youmustuseUploadPartCopy.
Issue:20200320155ObjectStorageServiceAPIReference/7ObjectoperationsYoucancallCopyObjecttomodifythemetadataofanobjectthatequalstoorsmallerthan48.
8TB(bysettingthesourceobjectandtargetobjecttothesameobject).
TouseCopyObject,youmusthavethereadpermissiononthesourceobject.
Thesourceobjectandthetargetobjectmustbeinthesameregion.
YoucannotcopyobjectscreatedbyAppendObject.
Ifthesourceobjectisasymboliclink,onlythesymboliclink(insteadofthecontentthatthelinkdirectsto)iscopied.
BillingitemsAGETrequestisbilledaccordingtothebucketwherethesourceobjectisstored.
APUTrequestisbilledaccordingtothebucketwherethetargetobjectisstored.
Theusedstoragecapacityisbilledaccordingtothebucketwherethetargetobjectisstored.
IfyouchangethestorageclassofanobjectbycallingCopyObject,theobjectisconsideredasoverwrittenandwillincurcharges.
AnobjectoftheIAorArchivestorageclasswillbechargedifitisoverwrittenwithin30and60daysrespectivelyafteritiscreated.
Forexample,ifyouchangethestorageclassofanobjectfromIAtoArchiveorStandard10daysaftertheobjectiscreated,earlydeletionfeesfor20dayswillbecharged.
RequestsyntaxPUT/DestObjectNameHTTP/1.
1Host:DestBucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValuex-oss-copy-source:/SourceBucketName/SourceObjectNameRequestheaderNote:Therequestheadersusedincopyoperationsstartwithx-oss-.
Therefore,theseheadersmustbeaddedintothesignaturestring.
HeaderTypeRequiredDescriptionx-oss-copy-sourceStringYesSpeciestheaddressofthesourceobject.
Defaultvalue:None.
156Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeRequiredDescriptionx-oss-copy-source-if-matchStringNoIftheETagofthesourceobjectisthesameastheETagprovidedbytheuser,thecopyoperationisperformedanda200OKmessageisreturned.
Otherwise,a412PreconditionFailederrorcode(preprocessingfailed)isreturned.
Defaultvalue:None.
x-oss-copy-source-if-none-matchStringNoIftheETagofthesourceobjectisdierentfromtheETagprovidedbytheuser,thecopyoperationisperformedanda200OKmessageisreturned.
Otherwise,a304NotModiederrorcode(preprocessingfailed)isreturned.
Defaultvalue:None.
x-oss-copy-source-if-unmodified-sinceStringNoIfthespeciedtimeisthesameasorlaterthanthemodicationtimeoftheobject,theobjectiscopiednormallyanda200OKmessageisreturned.
Otherwise,a412PreconditionFailederrorcode(preprocessingfailed)isreturned.
Defaultvalue:None.
x-oss-copy-source-if-modified-sinceStringNoIfthesourceobjectismodiedafterthetimespeciedbytheuser,thecopyoperationisperformed.
Otherwise,a304NotModiederrorcode(preprocessingfailed)isreturned.
Defaultvalue:None.
Issue:20200320157ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeRequiredDescriptionx-oss-metadata-directiveStringNoSpecieshowtosetthemetadataofthetargetobject.
ThevalidvaluesareCOPYandREPLACE.
COPY(default):Themetadataofthesourceobjectiscopiedtothetargetobject.
Thex-oss-server-side-encryptionofthesourceobjectisnotcopied.
Thatis,server-sideencryptionisperformedonthetargetobjectonlyifthex-oss-server-side-encryptionheaderisspeciedintheCOPYrequest.
REPLACE:Themetadataofthetargetobjectissettothemetadataspeciedintheuser'srequestinsteadofthemetadataofthesourceobject.
Note:Ifthesourceobjectandthetargetobjecthavethesameaddress,themetadataofthetargetobjectisreplacedwiththemetadataofthesourceobjectregardlessofthevalueofx-oss-metadata-directive.
158Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeRequiredDescriptionx-oss-server-side-encryptionStringNoSpeciestheserver-sideentropyencodingencryptionalgorithmwhenOSScreatesthetargetobject.
Validvalues:AES256KMS(YoumustenableKMSintheconsolebeforeyoucanusetheKMSencryptionalgorithm.
Otherwise,aKmsServiceNotEnablederrorcodeisreturned.
)Note:Ifthex-oss-server-side-encryptionheaderisnotspeciedinthecopyoperation,thetargetobjectisnotencryptedontheserversidenomatterwhetherserver-sideencryptionhasbeenperformedonthesourceobject.
Ifyouspecifythex-oss-server-side-encryptionheader,server-sideencryptionisperformedonthetargetobjectnomatterwhethertheencryptionhasbeenperformedonthesourceobject.
Inaddition,theresponseheaderforthecopyrequestincludesthex-oss-server-side-encryptionheader,andthevalueoftheheaderistheencryptionalgorithmofthetargetobject.
Whenthetargetobjectisdownloaded,theresponseheaderalsoincludesthex-oss-server-side-encryptionheader,andthevalueoftheheaderistheencryptionalgorithmofthetargetIssue:20200320159ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeRequiredDescriptionx-oss-server-side-encryption-key-idStringNoIndicatestheprimarykeymanagedbyKMS.
Thisparameterisvalidwhenthevalueofx-oss-server-side-encryptionisKMS.
x-oss-object-aclStringNoSpeciestheACLforthetargetobjectwhenitiscreated.
Validvalues:public-read,private,public-read-writeanddefault160Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeRequiredDescriptionx-oss-storage-classStringNoSpeciesthestorageclassoftheobject.
Validvalues:Standard,IAandArchiveSupportedinterfaces:PutObject,InitMultipartUpload,AppendObject,PutObjectSymlink,andCopyObjectNote:IfthevalueofStorageClassisinvalid,a400errormessageisreturnedwithanerrorcode:InvalidArgument.
WerecommendthatyoudonotsetthestorageclasstoIAorArchivewhencallingCopyObjectbecauseanIAorArchiveobjectsmallerthan64KBisbilledat64KB.
Ifyouspecifythevalueofx-oss-storage-classwhenuploadinganobjecttoabucket,thestorageclassoftheuploadedobjectisthespeciedvalueofx-oss-storage-class.
Forexample,ifyouspecifythevalueofx-oss-storage-classtoStandardwhenuploadinganobjecttoabucketoftheIAstorageclass,thestorageclassoftheobjectisStandard.
Ifyouchangethestorageclassofanobject,theobjectisconsideredasoverwrittenandwillincurcharges.
AnobjectoftheIAorArchiveclasswillbechargedifitisoverwrittenwithin30and60daysrespectivelyafteritiscreated.
Issue:20200320161ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeRequiredDescriptionx-oss-taggingStringNoSpeciesthetagoftheobject.
Youcansetmultipletagsatthesametime,forexample,TagA=A&TagB=B.
Note:YoumustperformURLencodingforthetagkeyandvalueinadvance.
Ifatagdoesnotcontainanequalsign(=),thisstringdoesnothaveavalue.
x-oss-tagging-directiveStringNoSpecieshowtosetthetagofthetargetobject.
ThevalidvaluesareCopyandReplace.
Copy(default):Thetagofthesourceobjectiscopiedtothetargetobject.
Replace:Thetagofthetargetobjectissettothetagspeciedintherequestinsteadofthetagofthesourceobject.
ResponseelementsTable7-1:ResponseelementsNameTypeDescriptionCopyObjectResultStringIndicatestheresultofCopyObject.
Defaultvalue:None.
ETagStringIndicatestheETagofthetargetobject.
Parentnode:CopyObjectResultLastModifiedStringIndicatesthetimewhenthetargetobjectislastmodied.
Parentnode:CopyObjectResult162Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsExamplesExample1Requestexample:PUT/copy_oss.
jpgHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Fri,24Feb201207:18:48GMTx-oss-storage-class:Archivex-oss-copy-source:/oss-example/oss.
jpgAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:gmnwPKuu20LQEjd+iPkL259A****Responseexample:HTTP/1.
1200OKx-oss-request-id:559CC9BDC755F95A64485981Content-Type:application/xmlContent-Length:193Connection:keep-aliveDate:Fri,24Feb201207:18:48GMTServer:AliyunOSSFri,24Feb201207:18:48GMT"5B3C1A2E053D763E1B002CC607C5****"Example2Requestexample:PUT/test%2FAK.
txtHTTP/1.
1Host:tesx.
oss-cn-zhangjiakou.
aliyuncs.
comAccept-Encoding:identityUser-Agent:aliyun-sdk-python/2.
6.
0(Windows/7/AMD64;3.
7.
0)Accept:*/*Connection:keep-alivex-oss-copy-source:/test/AK.
txtdate:Fri,28Dec201809:41:55GMTauthorization:OSSqn6qrrqxo2oawuk53otfjbyc:gmnwPKuu20LQEjd+iPkL259A****Content-Length:0Responseexample:HTTP/1.
1200OKServer:AliyunOSSDate:Fri,28Dec201809:41:56GMTContent-Type:application/xmlContent-Length:184Connection:keep-alivex-oss-request-id:5C25EFE4462CE00EC6D87156ETag:"F2064A169EE92E9775EE5324D0B1****"x-oss-hash-crc64ecma:12753002859196105360x-oss-server-time:150Issue:20200320163ObjectStorageServiceAPIReference/7Objectoperations"F2064A169EE92E9775EE5324D0B1****"2018-12-28T09:41:56.
000ZNote:x-oss-hash-crc64ecmaindicatesthe64-bitCRCvalueoftheobject.
ThisvalueiscalculatedbasedontheECMA-182standard.
AnobjectgeneratedinaCopyObjectoperationmaynothavethisvalue.
ExampleofarequestinwhichtheversionIdisnotspecied:PUT/dest-object-exampleHTTP/1.
1Host:versioning-copy.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,09Apr201903:45:32GMTAuthorization:OSSqeyxjc9arppwa0t:QqwOjq7U7j04NVpPqdfcVk0I****x-oss-copy-source:/versioning-copy-source/source-objectResponseexample:HTTP/1.
1200OKx-oss-copy-source-version-id:CAEQNRiBgIC28uaA0BYiIDY5OGIwNmNlNjYyMTRjNTc4N2M2OGNiMjZkZTQ2ZTRix-oss-version-id:CAEQNxiBgIDG8uaA0BYiIGZhZDRkZTk5Zjg3YzRhNzdiMWEwZGViNDM1NTFhNGQwx-oss-request-id:5CAC155CB7AEADE0170002DFContent-Type:application/xmlContent-Length:184Connection:keep-aliveDate:Tue,09Apr201903:45:32GMTServer:AliyunOSS"C81E728D9D4C2F636F067F89CC14****"2019-04-09T03:45:32.
000ZNote:Thex-oss-copy-source-version-ideldintheresponseexampleindicatestheIDofthecopiedversionofthetargetobject,thatis,thecurrentversioninthisexample.
Thex-oss-version-ideldindicatestheversionIDofthenewobjectgeneratedbytheCopyObjectoperation.
ExampleofarequestinwhichtheversionIdisspecied:PUT/dest-object-exampleHTTP/1.
1Host:versioning-copy.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,09Apr201903:45:32GMTAuthorization:OSSqeyxjc9arppwa0t:5qG4DLaHjxDPtpLlf2e8fBfX****164Issue:20200320ObjectStorageServiceAPIReference/7Objectoperationsx-oss-copy-source:/versioning-copy-source/source-objectversionId=CAEQNRiBgICv8uaA0BYiIDliZDc3MTc1NjE5MjRkMDI4ZGU4MTZkYjY1ZDgyYzdlResponseexample:HTTP/1.
1200OKx-oss-copy-source-version-id:CAEQNRiBgICv8uaA0BYiIDliZDc3MTc1NjE5MjRkMDI4ZGU4MTZkYjY1ZDgyYzdlx-oss-version-id:CAEQNxiBgMDP8uaA0BYiIDIyNGNhZDQ1M2M3NzRkZThiNzE0N2I3ZDkxOWY4NGRjx-oss-request-id:5CAC155CB7AEADE0170002E1Content-Type:application/xmlContent-Length:184Connection:keep-aliveDate:Tue,09Apr201903:45:32GMTServer:AliyunOSS"C4CA4238A0B923820DCC509A6F75****"2019-04-09T03:45:32.
000ZNote:Thex-oss-copy-source-version-ideldintheresponseexampleindicatestheIDofthecopiedversionofthetargetobject,thatis,theversionspeciedbythex-oss-copy-sourceparameterintherequest.
Thex-oss-version-ideldindicatestheversionIDofthenewobjectgeneratedbytheCopyObjectoperation.
SDKTheSDKsofthisAPIareasfollows:JavaPythonPHPGoC.
NETiOSNode.
jsRubyIssue:20200320165ObjectStorageServiceAPIReference/7ObjectoperationsErrorcodesErrorcodeHTTPstatuscodeDescriptionInvalidArgument400Thevaluesofparameters,suchasx-oss-storage-classareinvalid.
PreconditionFailed412Thex-oss-copy-source-if-matchheaderisspeciedintherequest,buttheprovidedETagisdierentfromtheETagofthesourceobject.
Thex-oss-copy-source-if-unmodified-sinceheaderisspeciedintherequest,butthetimespeciedintherequestisearlierthanthemodicationtimeoftheobject.
NotModied304Thex-oss-copy-source-if-none-matchheaderisspeciedintherequest,andtheprovidedETagisthesameastheETagofthesourceobject.
Thex-oss-copy-source-if-modified-sinceheaderisspeciedintherequest,butthesourceobjecthasnotbeenmodiedafterthetimespeciedintherequest.
KmsServiceNotEnabled403Thex-oss-server-side-encryptionheaderissettoKMS,buttheKMSserviceisnotenabled.
7.
3GetObjectYoucancallthisoperationtoobtainanobject.
ToperformtheGetObjectoperation,youmusthavethereadpermissionsontheobject.
Notice:TheGetObjectAPIoperationcanbecalledbyHTTPandHTTPSrequestsbydefault.
TospecifythattheAPIoperationcanbecalledonlybyHTTPSrequests,conguretheaccessmethodinthebucketpolicy.
Formoreinformation,see#unique_149.
166Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsIfthestorageclassoftheobjectisArchive,youmustsendaRestoreObjectrequesttorestoretheobjectbeforeyoucalltheGetObjectoperation.
VersioningBydefault,theGetObjectoperationreturnsonlythecurrentversionofanobject.
Note:WhenyouperformtheGetObjectoperationonanobjectinabucket:Ifthecurrentversionoftheobjectisadeletemarker,OSSreturns404NotFound.
IftheversionIDoftheobjectisspeciedintherequest,OSSreturnsthespeciedversionoftheobject.
IftheversionIDisspeciedasnullintherequest,OSSreturnstheversionwhoseversionIDisnull.
IftheversionIDisspeciedasadeletemarker,OSSreturns405MethodNotAllowed.
RequestsyntaxGET/ObjectNameHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueRange:bytes=ByteRange(Optional)Whenyouaredownloadinganobjectlargerthan100MBfromOSS,transmissionmayfailduetothenetworkenvironment.
YoucanspecifytheHTTPRangeheadertoquerydataofthelargeobject.
Note:OSSdoesnotsupportmultiplerangeparameters.
Youcanonlyqueryonerangeatatime.
ByteRangespeciestherangeofdatathatyourequest,inbytes.
ThevalidvaluesofByteRangearefrom0toobjectsize-1.
Examplesareasfollows:Range:bytes=0-499speciestherst500bytes.
Range:bytes=500-999speciesthesecond500bytes.
Range:bytes=-500speciesthelast500bytes.
Range:bytes=500-speciesdatafromthe500thbytetotheendoftheobject.
Range:bytes=0-speciesdatafromtherstbytetothelastbyte,thatis,theentireobject.
Issue:20200320167ObjectStorageServiceAPIReference/7ObjectoperationsRequestheadersNote:WhenyouinitiateaGETrequestinOSS,youcansetheadersintherequesttocustomizesomeheadersintheresponse.
However,theheadersintheresponsearesettothevaluesspeciedintheheadersintherequestonlywhentherequestissuccessful(the200OKcodeisreturned).
WhenyouinitiateaGETrequestinOSSasananonymoususer,youcannotsetheadersintherequesttocustomizeheadersintheresponse.
YoumustsigntheGETrequestbeforesendingit.
HeaderTypeRequiredDescriptionresponse-content-typeStringNoSpeciesthecontent-typeheaderintheresponsereturnedbyOSS.
Defaultvalue:null.
response-content-languageStringNoSpeciesthecontent-languageheaderintheresponsereturnedbyOSS.
Defaultvalue:null.
response-expiresStringNoSpeciestheexpiresheaderintheresponsereturnedbyOSS.
Defaultvalue:null.
response-cache-controlStringNoSpeciesthecache-controlheaderintheresponsereturnedbyOSS.
Defaultvalue:null.
response-content-dispositionStringNoSpeciesthecontent-dispositionheaderintheresponsereturnedbyOSS.
Defaultvalue:null.
168Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeRequiredDescriptionresponse-content-encodingStringNoSpeciesthecontent-encodingheaderintheresponsereturnedbyOSS.
Defaultvalue:null.
RangeStringNoSpeciestherangeofdatatobereturned.
Defaultvalue:null.
IfthevalueofRangeisvalid,theresponsereturnedbyOSSincludesthetotalsizeoftheobjectandtherangeofdatareturned.
Forexample,"Content-Range:bytes0-9/44"indicatesthatthetotalsizeoftheobjectis44bytes,andtherangeofdatareturnedistherst10bytes.
IfthevalueofRangeisinvalid,theentireobjectisreturnedandtheresponsereturnedbyOSSdoesnotincludeContent-Range.
If-Modified-SinceStringNoIfthetimespeciedinthisheaderisearlierthantheobjectmodicationtimeordoesnotconformtothestandards,OSSreturnstheobjectand200OK.
Otherwise,OSSreturns304NotModied.
Defaultvalue:null.
Timeformat:GMT,forexample,Fri,13Nov201514:47:53GMTIssue:20200320169ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeRequiredDescriptionIf-Unmodified-SinceStringNoIfthetimespeciedinthisheaderisthesameasorlaterthantheobjectmodicationtime,OSSreturnstheobjectand200OK.
Otherwise,OSSreturns412PreconditionFailed.
Defaultvalue:null.
Timeformat:GMT,forexample,Fri,13Nov201514:47:53GMTYoucanspecifytheIf-Modied-SinceandIf-Unmodied-Sinceheadersinarequestatthesametime.
If-MatchStringNoSpeciestheobjectreturningcondition.
IftheETagvaluespeciedintherequestmatchestheETagvalueoftheobject,OSSreturnstheobjectand200OK.
Otherwise,OSSreturns412PreconditionFailed.
Defaultvalue:null.
If-None-MatchStringNoSpeciestheobjectreturningcondition.
IftheETagvaluespeciedintherequestdoesnotmatchtheETagvalueoftheobject,OSSreturnstheobjectand200OK.
Otherwise,OSSreturns304NotModied.
Defaultvalue:null.
YoucanspecifytheIf-MatchandIf-None-Matchheadersinarequestatthesametime.
170Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeRequiredDescriptionAccept-EncodingStringNoSpeciestheencodingtypeattheclientside.
IfyouwantanobjecttobereturnedinGZIPformat,youmustincludetheAccept-Encoding:gzipheaderinyourrequest.
OSSdetermineswhethertoreturntheobjectcompressedinGZIPformatbasedontheContent-Typeheaderandthesizeoftheobject(largerthanorequalto1KB).
Note:IfanobjectiscompressedinGZIPformat,theresponsereturnedbyOSSdoesnotincludetheETagvalueoftheobject.
OSSsupportsGZIPcompressionforobjectswhoseContent-Typeheaderisoneofthefollowingvalues:HTML,JavaScript,CSS,XML,RSS,andJSON.
ResponseheadersNote:Iftherequestedobjectisasymboliclink,thecontentoftheobjectisreturned.
ResponseheadersContent-Length,ETag,andContent-Md5indicatethemetadataoftherequestedobject.
TheLast-Modifiedheaderindicatesthelateroneofthetimepointswhentherequestedobjectandthesymboliclinkarelastmodied.
Allotherheadersindicatethemetadataofthesymboliclink.
Issue:20200320171ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeDescriptionx-oss-server-side-encryptionStringIftherequestedobjectisentropyencryptedontheserver,OSSautomaticallydecryptsandreturnstheobjectafterreceivingtheGetObjectrequest.
OSSincludesx-oss-server-side-encryptionintheresponsetoindicatetheencryptionalgorithmthatisusedtoencrypttheobjectontheserver.
x-oss-tagging-countStringIndicatesthenumberoftagsassociatedwiththeobject.
Thisheaderisreturnedonlyifyouhavethereadpermissionsontags.
ExamplesSamplerequestforsimpleGetObjectGET/oss.
jpgHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Fri,24Feb201206:38:30GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:UNQDb7GapEgJkcde6OhZ9J*****SampleresponseHTTP/1.
1200OKx-oss-request-id:3a8f-2e2d-7965-3ff9-51c875b*****x-oss-object-type:NormalDate:Fri,24Feb201206:38:30GMTLast-Modified:Fri,24Feb201206:07:48GMTETag:"5B3C1A2E0563E1B002CC607C*****"Content-Type:image/jpgContent-Length:344606Server:AliyunOSS[344606bytesofobjectdata]SamplerequestwithaRangeheaderGET/oss.
jpgHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Fri,28Feb201205:38:42GMTRange:bytes=100-900172Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsAuthorization:OSSqn6qrrqxo2oawuk5jbyc:qZzjF3DUtd+yK16BdhGtFcC*****SampleresponseHTTP/1.
1206PartialContentx-oss-request-id:28f6-15ea-8224-234e-c0ce407*****x-oss-object-type:NormalDate:Fri,28Feb201205:38:42GMTLast-Modified:Fri,24Feb201206:07:48GMTETag:"5B3C1A2E05E1B002CC607C*****"Accept-Ranges:bytesContent-Range:bytes100-900/344606Content-Type:image/jpgContent-Length:801Server:AliyunOSS[801bytesofobjectdata]SamplerequestwithresponseheaderscustomizedGET/oss.
jpgresponse-expires=Thu%2C%2001%20Feb%202012%2017%3A00%3A00%20GMT&response-content-type=text&response-cache-control=No-cache&response-content-disposition=attachment%253B%2520filename%253Dtesting.
txt&response-content-encoding=utf-8&response-content-language=%E4%B8%AD%E6%96%87HTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
com:Date:Fri,24Feb201206:09:48GMTSampleresponseHTTP/1.
1200OKx-oss-request-id:559CC9BDC75A644*****x-oss-object-type:NormalDate:Fri,24Feb201206:09:48GMTLast-Modified:Fri,24Feb201206:07:48GMTETag:"5B3C1A2E053D1B002CC607*****"Content-Length:344606Connection:keep-aliveContent-disposition:attachment;filename:testing.
txtContent-language:ChineseContent-encoding:utf-8Content-type:textCache-control:no-cacheExpires:Fri,24Feb201217:00:00GMTServer:AliyunOSS[344606bytesofobjectdata]SamplerequestwiththeobjecttypespeciedassymboliclinkGET/link-to-oss.
jpgHTTP/1.
1Accept-Encoding:identityDate:Tue,08Nov201603:17:58GMTHost:oss-example.
oss-cn-hangzhou.
aliyuncs.
comAuthorization:OSSqn6qrrqxok53otfjbyc:qZzjF3DUtd+yK16BdhGtFc*****SampleresponseHTTP/1.
1200OKServer:AliyunOSSDate:Tue,08Nov201603:17:58GMTContent-Type:application/octet-streamIssue:20200320173ObjectStorageServiceAPIReference/7ObjectoperationsContent-Length:20Connection:keep-alivex-oss-request-id:582143E6A212AD*****Accept-Ranges:bytesETag:"8086265EFC021F9A2F09BF4****"Last-Modified:Tue,08Nov201603:17:58GMTx-oss-object-type:SymlinkContent-MD5:gIYmXvwCEe0fmi8Jv0Y****SamplerequestforanobjectthatisrestoredGET/oss.
jpgHTTP/1.
1Host:oss-archive-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Sat,15Apr201709:38:30GMTAuthorization:OSSqn6qrrqxo2o***k53otfjbyc:zUglwRPGkbByZxm1+y4eyu+*****SampleresponseHTTP/1.
1200OKx-oss-request-id:58F723829F29F18D7F00*****x-oss-object-type:Normalx-oss-restore:ongoing-request="false",expiry-date="Sun,16Apr201708:12:33GMT"Date:Sat,15Apr201709:38:30GMTLast-Modified:Sat,15Apr201706:07:48GMTETag:"5B3C1A2E0763E1B002CC607C*****"Content-Type:image/jpgContent-Length:344606Server:AliyunOSS[354606bytesofobjectdata]SamplerequestwiththeversionIDoftherequestedobjectspeciedGET/exampleversionId=CAEQNhiBgMDJgZCA0BYiIDc4MGZjZGI2OTBjOTRmNTE5NmU5NmFhZjhjYmY0****HTTP/1.
1Host:versioning-get.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,09Apr201902:58:06GMTAuthorization:OSSlkojgxic6e:8wcOrEDt4iSxpBPfQW9OJNw*****SampleresponseHTTP/1.
1200OKx-oss-request-id:5CAC0A3EDE0170*****x-oss-version-id:CAEQNhiBgM0BYiIDc4MGZjZGI2OTBjOTRmNTE5NmU5NmFhZjhjYmY*****x-oss-object-type:NormalDate:Tue,09Apr201902:58:06GMTLast-Modified:Fri,22Mar201808:07:50GMTETag:"5B3C1A2E053D7002CC607C5A*****"Content-Type:text/htmlContent-Length:362149Server:AliyunOSS[362149bytesofobjectdata]SamplerequestwiththeversionIDnotspeciedandthecurrentversionspeciedasadeletemarkerGET/exampleHTTP/1.
1174Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsHost:versioning-get.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,09Apr201903:22:33GMTAuthorization:OSSduagpvtn35:taVlDvAJMhEumrR+oLMWtQp*****SampleresponseHTTP/1.
1404NotFoundx-oss-request-id:5CAC0FEADE0170*****x-oss-delete-marker:truex-oss-version-id:CAEQNxiBgyA0BYiIDc4ZDdmNTA2MGViZTRiNjE5NzZlZWM4OWM5OT*****Date:Tue,09Apr201903:22:33GMTContent-Type:application/xmlConnection:keep-aliveServer:AliyunOSSNoSuchKeyThespecifiedkeydoesnotexist.
5CAC0FEADE0170*****versioning-get.
oss-cn-hangzhou.
aliyun*****exampleSamplerequestwiththeversionIDspeciedasadeletemarkerGET/exampleversionId=CAEQMxiBgMCfqaWA0BYiIDliMWI4MGQ0MTVmMjQ3MmE5MDNlMmY4YmFkYTk3****HTTP/1.
1Host:versioning-get.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,09Apr201903:09:44GMTAuthorization:OSStvqm50uz4y:51UaP+wQt5k1RQang/U6Eeq*****SampleresponseHTTP/1.
1405MethodNotAllowedx-oss-request-id:5CAC0CF8DE01700*****x-oss-delete-marker:truex-oss-version-id:CAEQMxiBgMCfqaWADliMWI4MGQ0MTVmMjQ3MmE5MDNlMmY4YmFkYTk*****Allow:DELETEDate:Tue,09Apr201903:09:44GMTContent-Type:application/xmlContent-Length:318Connection:keep-aliveServer:AliyunOSSMethodNotAllowedThespecifiedmethodisnotallowedagainstthisresource.
5CAC0CF8DE0170*****versioning-get.
oss-cn-hangzhou.
aliyunc*****GETDeleteMarkerIssue:20200320175ObjectStorageServiceAPIReference/7ObjectoperationsSDKsTheSDKsoftheGetObjectoperationforvariousprogramminglanguagesareasfollows:JavaPythonPHPGoC.
NETNode.
jsBrowser.
jsRubyErrorcodesErrorcodeHTTPstatuscodeDescriptionNoSuchKey404Theerrormessagereturnedbecausetherequestedobjectdoesnotexist.
SymlinkTargetNotExist404Theerrormessagereturnedbecausetherequestedobjectisasymboliclink,andtheobjectthatthesymboliclinkdirectstodoesnotexist.
InvalidTargetType400Theerrormessagereturnedbecausetherequestedobjectisasymboliclink,andtheobjectthatthesymboliclinkdirectstoisstillasymboliclink.
InvalidObjectState403TheerrormessagereturnedbecausethestorageclassoftherequestedobjectisArchiveand:TheRestoreObjectrequestfortheobjectisnotinitiatedortimedout.
TheRestoreObjectrequestfortheobjecthasbeeninitiatedbuttheobjectisnotrestoredyet.
176Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsErrorcodeHTTPstatuscodeDescriptionNotModied304TheerrormessagereturnedbecausetheIf-Modified-Sinceheaderisspeciedintherequest,buttherequestedobjecthasnotbeenmodiedsincethetimespeciedintherequest.
TheerrormessagereturnedbecausetheIf-None-Matchheaderisspeciedintherequest,andtheETagvalueprovidedintherequestisthesameastheETagvalueoftherequestedobject.
PreconditionFailed412TheerrormessagereturnedbecausetheIf-Unmodified-Sinceheaderisspeciedintherequest,butthespeciedtimeisearlierthanthemodicationtimeoftherequestedobject.
TheerrormessagereturnedbecausetheIf-Matchheaderisspeciedintherequest,buttheETagvalueprovidedintherequestisdierentfromtheETagvalueoftherequestedobject.
7.
4AppendObjectUploadsalebyappendingtheletoanexistingobject.
AnobjectcreatedbytheAppendObjectoperationisanappendableobject,andanobjectuploadedbythePutObjectoperationisanormalobject.
VersioningTheAppendObjectoperationcanbeperformedonlyonobjectsofwhichthecurrentversionisanappendableobject.
Note:Issue:20200320177ObjectStorageServiceAPIReference/7ObjectoperationsWhenyouperformtheAppendObjectoperationonanobjectofwhichthecurrentversionisanappendableobject,OSSdoesnotgeneratehistoricalversionfortheappendableobject.
WhenyouperformthePutObjectorDeleteObjectoperationonanobjectofwhichthecurrentversionisanappendableobject,OSSstorestheappendableobjectasahistoricalversionandpreventstheobjectfrombeingfurtherappended.
YoucannotperformtheAppendObjectoperationonobjectsofwhichthecurrentversionisnotanappendableobject(suchasanormalobjectoradeletemarker).
Ifversioningisenabledorsuspendedforabucket,youcannotperformtheCopyObjectoperationonappendableobjectsinthebucket.
LimitsThemaximumsizeofanobjectgeneratedbytheAppendObjectoperationis5GB.
YoucannotuseAppendObjecttouploadaletoanobjectprotectedbythecompliantretentionstrategy.
YoucannotuseKMStoencryptappendableobjectsontheserverbyspecifyingCMKIDsfortheobjects.
RequestsyntaxPOST/ObjectNameappend&position=PositionHTTP/1.
1Content-Length:ContentLengthContent-Type:ContentTypeHost:BucketName.
oss.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueRequestheadersNote:AnAppendObjectrequestmustincludetheappendandpositionparameters,whicharebothCanonicalizedResourceandmustbeincludedinthesignature.
HeaderTypeRequiredDescriptionAppendStringYesIndicatesthattherequestissenttoperformanAppendObjectoperation.
178Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeRequiredDescriptionPositionStringYesSpeciesthepositionfromwheretheAppendObjectoperationstarts.
ThevalueofpositionintherstAppendObjectoperationmustbe0,andthevalueofpositioninthesubsequentoperationisthecurrentobjectlength.
Forexample,ifthevalueofpositionspeciedintherstAppendObjectrequestis0,andthevalueofcontent-lengthis65536,thevalueofpositionspeciedinthesecondAppendObjectrequestmustbesetto65536.
EachtimeafteranAppendObjectoperationsucceeds,x-oss-next-append-positionintheresponseheaderspeciesthepositionofthenextAppendObjectrequest.
Note:Ifthevalueofpositionis0andanobjectwiththesamenamedoesnotexist,youcansetheaders(suchasx-oss-server-side-encryption)intheAppendObjectrequestinthesamewayasyoudoinaPutObjectrequest.
Ifyouaddacorrectx-oss-server-side-encryptionheaderinanAppendObjectrequestinwhichthevalueofpositionis0,thex-oss-server-side-encryptionheaderisalsoincludedintheresponseheader.
YoucaninitiateaCopyObjectrequesttomodifythemetadataoftheobjectinsubsequentoperations.
EachtimeafteranAppendObjectoperationisperformed,thelastmodicationtimeofthisobjectisupdated.
Ifthepositionvalueiscorrectandcontentwithalengthof0isappendedtoanexistingappendableobject,thestatusoftheobjectdoesnotchange.
Issue:20200320179ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeRequiredDescriptionCache-ControlStringNoSpeciestheWebpagecachingbehaviorfortheobject.
Formoreinformation,seeRFC2616.
Defaultvalue:noneContent-DispositionStringSpeciesthenameoftheobjectwhentheobjectisdownloaded.
Formoreinformation,seeRFC2616.
Defaultvalue:noneContent-EncodingStringSpeciesthecontentencodingformatoftheobject.
Formoreinformation,seeRFC2616.
Defaultvalue:noneContent-MD5StringContent-MD5isastringcalculatedbytheMD5algorithm.
Thisheaderisusedtocheckwhetherthemessagecontentisconsistentwiththesentcontent.
ThevalueofContent-MD5canbeobtainedasfollows:Calculatea128-bitnumberbasedonthemessagecontent,ratherthantheheader,andthenbase64-encodethenumber.
Defaultvalue:noneRestriction:noneExpiresIntegerSpeciestheexpirationtime.
Formoreinformation,seeRFC2616.
Defaultvalue:none180Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeRequiredDescriptionx-oss-server-side-encryptionStringSpeciestheserver-sideencryptionalgorithm.
Validvalues:AES256orKMSNote:YoumustenableKMS(KeyManagementService)intheconsolebeforeyoucanusetheKMSencryptionalgorithm.
Otherwise,aKmsServiceNotEnablederrorisreturned.
x-oss-object-aclStringSpeciestheACLfortheobject.
Validvalues:public-read,private,andpublic-read-writeIssue:20200320181ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeRequiredDescriptionx-oss-storage-classStringSpeciesthestorageclassoftheobject.
Values:StandardIAArchiveSupportedAPIs:PutObject,InitMultipartUpload,AppendObject,PutObjectSymlink,andCopyObjectNote:Ifyouspecifythevalueofx-oss-storage-classwhenuploadinganobjecttoabucket,thestorageclassoftheuploadedobjectisthespeciedvalueofx-oss-storage-classregardlessofthestorageclassofthebucket.
Forexample,ifyouspecifythevalueofx-oss-storage-classtoStandardwhenuploadinganobjecttoabucketoftheIAstorageclass,thestorageclassoftheobjectisStandard.
ThisheadertakeseectonlyifyouspecifyitwhenyouperformtheAppendObjectoperationforthersttime.
Note:WhenyoucallAppendObject,parametersprexedbyx-oss-meta-*,suchasx-oss-meta-location,areprocessedasmetadataoftheobject.
Anobjectcanhavemultiplemetadataparameters.
However,thetotalsizeofthemetadatacannotexceed8KB.
Thenameofametadataparametersupportsdashes(-),numbers,andletters(uppercaselettersareconvertedtolowercaseletters)butdoesnotsupportunderscores(_).
Youcanaddparametersprexedwithx-oss-meta-*whencreatinganewappendableobjectbyperformingtheAppendObjectoperation.
However,you182Issue:20200320ObjectStorageServiceAPIReference/7Objectoperationscannotaddtheseparameterswhenappendinglestoanexistingappendableobject.
ResponseheadersHeaderTypeDescriptionx-oss-next-append-position64-bitintegerSpeciesthepositionthatmustbeprovidedinthenextrequest,thatis,thecurrentobjectlength.
ThisheaderisreturnedwhenasuccessfulmessageisreturnedforanAppendObjectrequest,orwhena409erroroccursbecausethepositionandtheobjectlengthdonotmatch.
x-oss-hash-crc64ecma64-bitintegerSpeciesthe64-bitCRCvalueoftheobject.
ThisvalueiscalculatedaccordingtotheECMA-182.
CRC64calculationmethodTheCRCvalueofanappendableobjectiscalculatedaccordingtoECMA-182.
YoucancalculatetheCRC64inthefollowingmethods:CalculateusingboostCRCmodule:typedefboost::crc_optimalboost_ecma;uint64_tdo_boost_crc(constchar*buffer,intlength){boost_ecmacrc;crc.
process_bytes(buffer,length);returncrc.
checksum();}CalculateusingthecrcmodfunctioninPython:do_crc64=crcmod.
mkCrcFun(0x142F0E1EBA9EA3693L,initCrc=0L,xorOut=0xffffffffffffffffL,rev=True)printdo_crc64("123456789")ExamplesNormalrequestexample:POST/oss.
jpgappend&position=0HTTP/1.
1Host:oss-example.
oss.
aliyuncs.
comCache-control:no-cacheIssue:20200320183ObjectStorageServiceAPIReference/7ObjectoperationsExpires:Wed,08Jul201516:57:01GMTContent-Encoding:utf-8x-oss-storage-class:ArchiveContent-Disposition:attachment;filename=oss_download.
jpgDate:Wed,08Jul201506:57:01GMTContent-Type:image/jpgContent-Length:1717Authorization:OSSqn6qrrqxo2oawuk53otfjbyc:kZoYNv66bsmc10+dcGKw5x2P****[1717bytesofobjectdata]Responseexample:HTTP/1.
1200OKDate:Wed,08Jul201506:57:01GMTETag:"0F7230CAA4BE94CCBDC99C550000****"Connection:keep-aliveContent-Length:0Server:AliyunOSSx-oss-hash-crc64ecma:14741617095266562575x-oss-next-append-position:1717x-oss-request-id:559CC9BDC755F95A64485981Exampleofarequestinitiatedtoappendaletoanexistingobjectinabucketwithversioningenabledorsuspended:POST/exampleappend&position=0HTTP/1.
1Host:versioning-append.
oss.
aliyuncs.
comDate:Tue,09Apr201903:59:33GMTContent-Length:3Content-Type:application/octet-streamAuthorization:OSSbwo4j5l8d3jou9u:MCY5nnfgfJU/f3Xe0odqBtG5****Responseexample:HTTP/1.
1200OKDate:Tue,09Apr201903:59:33GMTETag:"2776271A4A09D82CA518AC5C0000****"Connection:keep-aliveContent-Length:0Server:AliyunOSSx-oss-version-id:nullx-oss-hash-crc64ecma:3231342946509354535x-oss-next-append-position:3x-oss-request-id:5CAC18A5B7AEADE0170002F7Note:IfyouperformtheAppendObjectoperationonanobjectinabucketwithversioningenabledorsuspended,thex-oss-version-idheaderisincludedintheresponseanditsversioncanonlybenull.
SDKTheSDKsofthisAPIareasfollows:184Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsJavaPythonPHPGoC.
NETiOSRubyAssociationwithotheroperationsOperationsRelationshipPutObjectIfyouperformaPutObjectoperationonanexistingappendableobject,theappendableobjectisoverwrittenbyanewnormalobject.
HeadObjectIfyouperformaHeadObjectoperationonanexistingappendableobject,thenx-oss-next-append-position,x-oss-hash-crc64ecma,andx-oss-object-typearereturned.
Thex-oss-object-typeoftheappendableobjectisAppendable.
GetBucketIntheresponsetoaGetBucketrequest,thex-oss-object-typeoftheappendableobjectissettoAppendable.
CopyObjectYoucanneitheruseCopyObjecttocopyanappendableobject,norchangetheserver-sideencryptionmethodofthisobject.
However,youcanuseCopyObjecttomodifythecustommetadataofanobject.
ErrorcodesErrorcodeHTTPstatuscodeDescriptionObjectNotAppendable409YoucannotperformAppendObjectoperationsonanon-appendableobject.
Issue:20200320185ObjectStorageServiceAPIReference/7ObjectoperationsErrorcodeHTTPstatuscodeDescriptionPositionNotEqualToLength409Thevalueofpositiondoesnotmatchthecurrentobjectlength.
Note:Youcanobtainthepositionforthenextoperationfromtheresponseheaderx-oss-next-append-positionandinitiatearequestagain.
Althoughmultiplerequestsmaybesentconcurrently,evenifyousetthevalueofx-oss-next-append-positioninonerequest,therequestmaystillfailbecausethevalueisnotupdatedimmediately.
Therequestissuccessfulwhenthevalueofpositionis0andthelengthofanappendableobjectwiththesamenameis0.
ortheappendableobjectwiththesamenamedoesnotexist.
Inothercases,thiserrorcodeisreturnedbecausethepositionandthelengthoftheobjectdonotmatch.
InvalidArgument400Thevalueofaparameter,suchasx-oss-storage-class,isinvalid.
7.
5DeleteObjectYoucancalltheDeleteObjectoperationtodeleteanobject.
ToperformtheDeleteObjectoperationonanobject,youmusthavethewritepermissionsontheobject.
Note:HTTPstatuscode204isreturnedwhentheDeleteObjectoperationsucceeds,regardlessofwhethertheobjectexists.
Iftherequestedobjectisasymboliclink,theDeleteObjectoperationonlydeletesthesymboliclinkbutnotthecontentthatthelinkdirectsto.
186Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsVersioningIfyoudonotspecifytheobjectversionIDwhenperformingtheDeleteObjectoperationonanobjectinaversioning-enabledbucket,OSSinsertsadeletemarkerasthecurrentobjectversioninsteadofdeletingtheobjectpermanently.
IfyouspecifytheobjectversionID,thespeciedversionoftheobjectispermanentlydeleted.
Note:IfyoudonotspecifytheobjectversionIDwhenperformingtheDeleteObjectoperation:Bydefault,theDeleteObjectoperationisperformedonthecurrentversionofthetargetobject.
Thecurrentversioniskeptbutnotdeletedandadeletemarkerisinsertedasthenewcurrentversionoftheobject.
WhentheGetObjectoperationisperformedontheobject,OSSidentiesthatthecurrentversionoftheobjectisadeletemarkerandreturns404NotFound.
Additionally,thex-oss-delete-marker=trueandx-oss-version-id(indicatingtheversionIDofthegenerateddeletemarker)headersareincludedintheresponse.
Ifthevalueofthex-oss-delete-markereldistrue,theversionspeciedinthex-oss-version-ideldisadeletemarker.
IfyouspecifytheobjectversionIDwhenperformingtheDeleteObjectoperation:OSSpermanentlydeletestheobjectversionspeciedbytheversionidparameter.
Forexample,todeleteanobjectwhoseversionIDisnull,youmustspecifythevalueofversionIdintherequestasnull.
OSSidentiesthestringnullasaversionIDanddeletestheobjectwhoseversionIDisnull.
Issue:20200320187ObjectStorageServiceAPIReference/7ObjectoperationsResponseheadersHeaderTypeDescriptionx-oss-delete-markerBooleanIfyoudonotspecifytheobjectversionIDwhenperformingtheDeleteObjectoperation,OSScreatesadeletemarkerasthecurrentversionandincludesthisheaderwiththe"true"valueintheresponse.
IfyouspecifytheobjectversionIDtopermanentlydeleteaversionofthetargetobjectandthespeciedversionisadeletemarker,OSSincludesthisheaderwiththe"true"valueintheresponse.
Validvalue:truex-oss-version-idStringIfyoudonotspecifytheobjectversionIDwhenperformingtheDeleteObjectoperation,OSScreatesadeletemarkerasthecurrentversionandincludesthisheaderintheresponsetoindicatetheversionIDofthecreateddeletemarker.
IfyouspecifytheobjectversionIDtopermanentlydeleteaversionofthetargetobject,OSSincludesthisheaderintheresponsetoindicatetheIDofthedeletedobjectversion.
RequestsyntaxDELETE/ObjectNameHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueExamplesSamplerequestsDELETE/AK.
txtHTTP/1.
1Host:test.
oss-cn-zhangjiakou.
aliyuncs.
comAccept-Encoding:identityUser-Agent:aliyun-sdk-python/2.
6.
0(Windows/7/AMD64;3.
7.
0)Accept:*/*Connection:keep-alivedate:Wed,02Jan201913:28:38GMT188Issue:20200320ObjectStorageServiceAPIReference/7Objectoperationsauthorization:OSSqn6qrrqxo2oawuk53otfjbyc:zUglwRPGkbByZxm1+y4eyu+NIUs=zV0****Content-Length:0SampleresponsesHTTP/1.
1204NoContentServer:AliyunOSSDate:Wed,02Jan201913:28:38GMTContent-Length:0Connection:keep-alivex-oss-request-id:5C2CBC8653718B5511EF4535x-oss-server-time:134SamplerequestswhentheobjectversionIDisnotspeciedInthiscase,OSSinsertsadeletemarker.
Thex-oss-delete-marker=trueeldisincludedintheresponse.
DELETE/exampleHTTP/1.
1Host:versioning-delete.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,09Apr201904:08:23GMTAuthorization:OSStwnetzwjkqr9eq6:z73SSKA6t2tNTP4GuPjPiyV/****SampleresponsesHTTP/1.
1204NoContentx-oss-delete-marker:truex-oss-version-id:CAEQMxiBgIDh3ZCB0BYiIGE4YjIyMjExZDhhYjQxNzZiNGUyZTI4ZjljZDcz****x-oss-request-id:5CAC1AB7B7AEADE01700****Date:Tue,09Apr201904:08:23GMTConnection:keep-aliveServer:AliyunOSSSamplerequestswhentheobjectversionIDisspeciedInthiscase,theobjectwiththespeciedversionIDispermanentlydeleted.
DELETE/exampleversionId=CAEQOBiBgIDNlJeB0BYiIDAwYjJlNDQ4YjJkMzQxMmY5NTM5N2UzZWNiZTQ2****HTTP/1.
1Host:versioning-delete.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,09Apr201904:11:54GMTAuthorization:OSSgb3m2qiwirupd6v:UjOXBmIbJD3qXL+DP1EDNyCI****SampleresponsesHTTP/1.
1204NoContentx-oss-version-id:CAEQOBiBgIDNlJeB0BYiIDAwYjJlNDQ4YjJkMzQxMmY5NTM5N2UzZWNiZTQ2****x-oss-request-id:5CAC1B8AB7AEADE01700****Date:Tue,09Apr201904:11:54GMTContent-Length:0Connection:keep-aliveIssue:20200320189ObjectStorageServiceAPIReference/7ObjectoperationsServer:AliyunOSSSamplerequestswhentheobjectversionIDisspeciedtodeleteadeletemarkerNote:Youcanonlydeleteadeletemarker.
Inthefollowingexample,thespeciedversionisadeletemarker.
Thex-oss-delete-marker=trueeldisincludedintheresponse.
DELETE/exampleversionId=CAEQOBiBgIDNlJeB0BYiIDAwYjJlNDQ4YjJkMzQxMmY5NTM5N2UzZWNiZTQ2****HTTP/1.
1Host:versioning-delete.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,09Apr201904:16:25GMTAuthorization:OSSjh475i54ffozhoy:4tX6Z+fnhtINhp0g+sRiLEQb****SampleresponsesHTTP/1.
1204NoContentx-oss-delete-marker:truex-oss-version-id:CAEQNhiBgIDFtp.
B0BYiIDk4NzgwMmU4NDMyOTQyM2NiMDQxOTcxYWNhMjc1****x-oss-request-id:5CAC1C99B7AEADE01700****Date:Tue,09Apr201904:16:25GMTContent-Length:0Connection:keep-aliveServer:AliyunOSSSDKsYoucancalltheDeleteObjectoperationwhenyouusetheSDKofanyofthefollowingprogramminglanguages:JavaPythonPHPGoC.
NETiOSNode.
jsBrowser.
jsRuby190Issue:20200320ObjectStorageServiceAPIReference/7Objectoperations7.
6DeleteMultipleObjectsDeletesmultipleobjectsfromthesamebucket.
Note:Youcandeleteamaximumof1,000objectsatonetimebycallingDeleteMultipleObjects.
VersioningYoucanuseDeleteMultipleObjectstodeletemultipleobjectsinabucketwithversioningenabled.
IfyoudonotspecifytheversionIdintherequest,deletemarkersareaddedtotheobjectsthatyouwanttodelete.
IfyouspecifytheversionIdintherequest,thespeciedversionsoftheobjectsthatyouwanttodeletearepermanentlydeleted.
RequestsyntaxPOST/deleteHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateContent-Length:ContentLengthContent-MD5:MD5ValueAuthorization:SignatureValuetruekey…RequestheadersOSSveriesthereceivedmessagebodybasedonthefollowingheaders,anddeletestheobjectonlywhentheattributesofthemessagebodyconformtotheheaders.
Issue:20200320191ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeRequiredDescriptionEncoding-typeStringNoTheKeyparameterisUTF-8encoded.
IftheKeyparameterincludescontrolcharacterswhicharenotsupportedbytheXML1.
0standard,youcanspecifythisheadertoencodetheKeyparameterinthereturnedresult.
Defaultvalue:NoneValidvalue:urlContent-LengthStringYesIndicatesthelengthoftheHTTPmessagebody.
OSSveriesthereceivedmessagebodybasedonthisheader,anddeletestheobjectonlywhenthelengthofthemessagebodyisthesameasthisheader.
Content-MD5StringYesContent-MD5isastringcalculatedwiththeMD5algorithm.
Thisheaderisusedtocheckwhetherthecontentofthereceivedmessageisconsistentwiththatofthesentmessage.
Ifthisheaderisincludedintherequest,OSScalculatestheContent-MD5ofthereceivedmessagebodyandcomparesitwiththevalueofthisheader.
Note:Toobtainthevalueofthisheader,encryptthemessagebodyoftheDeleteMultipleObjectsrequestusingtheMD5algorithmtogeta128-bitbytearray,andthenbase64-encodethebytearray.
192Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsRequestelementsElementTypeRequiredDescriptionDeleteContainerYesSpeciesthecontainerthatstorestheDeleteMultipleObjectsrequest.
Sub-node:OneormoreObjects,QuietParentnode:NoneKeyStringYesSpeciesthenameoftheobjecttobedeleted.
Parentnode:ObjectObjectContainerYesSpeciesthecontainerthatstorestheinformationabouttheobject.
Sub-node:KeyParentnode:DeleteIssue:20200320193ObjectStorageServiceAPIReference/7ObjectoperationsElementTypeRequiredDescriptionQuietEnumeratedstringYesEnablestheQuietresponsemode.
DeleteMultipleObjectsprovidesthefollowingtworesponsemodes:Quiet:ThemessagebodyoftheresponsereturnedbyOSSonlyincludesobjectsthatfailtobedeleted.
Ifallobjectsaredeletedsuccessfully,theresponsedoesnotincludeamessagebody.
Verbose:ThemessagebodyoftheresponsereturnedbyOSSincludestheresultsofalldeletedobjects.
Thismodeisusedbydefault.
Validvalue:true(enablesQuietmode),false(enablesVerbosemode)Defaultvalue:falseParentnode:DeleteVersionIdStringNoIndicatestheversionoftheobjectthatyouwanttodelete.
Parentnode:Object194Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsResponseelementsElementTypeDescriptionDeletedContainerSpeciesthecontainerthatstoresthesuccessfullydeletedobjects.
Sub-node:KeyParentnode:DeleteResultDeleteResultContainerSpeciesthecontainerthatstoresthereturnedresultsoftheDeleteMultipleObjectsrequest.
Sub-node:DeletedParentnode:NoneKeyStringSpeciesthenameofthedeletedobject.
Parentnode:DeletedEncodingTypeStringSpeciestheencodingtypeforthereturnedresults.
Ifencoding-typeisspeciedintherequest,theKeyisencodedinthereturnedresult.
Parentnode:ContainerIssue:20200320195ObjectStorageServiceAPIReference/7ObjectoperationsElementTypeDescriptionDeleteMarkerBooleanIndicateswhetherthespeciedversionisadeletemarker.
Values:true:Thespeciedversionisadeletemarker.
false:Thespeciedversionisnotadeletemarker.
Note:Thiselementisreturnedonlywhenadeletemarkeriscreatedorpermanentlydeleted,andthevalueistrue.
DeleteMarkerVersionIdStringIndicatestheversionIDofthedeletemarker.
Parentnode:DeletedExamplesRequestexamplewithQuietmodedisabled:POST/deleteHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Wed,29Feb201212:26:16GMTContent-Length:151Content-MD5:ohhnqLBJFiKkPSBO1eNaUA==Authorization:OSSqn6qrrqxo2oawuk53otfjbyc:+z3gBfnFAxBcBDgx27Y/jEfb****falsemultipart.
datatest.
jpgdemo.
jpg196Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsResponseexample:HTTP/1.
1200OKx-oss-request-id:78320852-7eee-b697-75e1-b6db0f4849e7Date:Wed,29Feb201212:26:16GMTContent-Length:244Content-Type:application/xmlConnection:keep-aliveServer:AliyunOSSmultipart.
datatest.
jpgdemo.
jpgRequestexamplewithQuietmodeenabled:POST/deleteHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Wed,29Feb201212:33:45GMTContent-Length:151Content-MD5:ohhnqLBJFiKkPSBO1eNaUA==Authorization:OSSqn6qrrqxo2oawuk53otfjbyc:WuV0Jks8RyGSNQrBca64kEEx****truemultipart.
datatest.
jpgdemo.
jpgResponseexample:HTTP/1.
1200OKx-oss-request-id:559CC9BDC755F95A64485981Date:Wed,29Feb201212:33:45GMTContent-Length:0Connection:keep-aliveServer:AliyunOSSRequestexamplewhentheversionIdisnotspeciedintheDeleteMultipartObjectrequest:POST/deleteHTTP/1.
1Issue:20200320197ObjectStorageServiceAPIReference/7ObjectoperationsHost:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,09Apr201904:20:03GMTContent-MD5:xSLOYWaPC86RPwWXNiFeXg==Authorization:OSSxq39jyxyrddzvvh:/G5kxMIw1ilMQjPp2HkJEp5q****falsemultipart.
datatest.
jpgResponseexample:HTTP/1.
1200OKx-oss-request-id:5CAC1D73B7AEADE01700044FDate:Tue,09Apr201904:20:03GMTContent-Type:application/xmlConnection:keep-aliveServer:AliyunOSSmultipart.
datatrueCAEQMhiBgIDXiaaB0BYiIGQzYmRkZGUxMTM1ZDRjOTZhNjk4YjRjMTAyZjhl****test.
jpgtrueCAEQMhiBgIDB3aWB0BYiIGUzYTA3YzliMzVmNzRkZGM5NjllYTVlMjYyYWEy****Note:Intheprecedingexample,theversionIDsofthetwoobjectstobedeleted(multipart.
datandtest.
jpg)arenotspecied.
Therefore,OSSaddsdeletemarkersforthetwoobjects,andreturnstrueandXXXXXX.
RequestexamplewhentheversionIdisspeciedtodeletethespeciedversionoftheobject:YoumustspecifythekeyoftheobjectwhenspecifyingtheversionId.
POST/deleteHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,09Apr201906:09:34GMTContent-Length:151Content-MD5:2Tpk+dL/tGyuSA+YCEuSVg==Authorization:OSSqac50zy2vbvbq4z:/pingCxyqfxc0+50Bfi2SX9c****198Issue:20200320ObjectStorageServiceAPIReference/7Objectoperationsfalsemultipart.
dataCAEQNRiBgIDyz.
6C0BYiIGQ2NWEwNmVhNTA3ZTQ3MzM5ODliYjM1ZTdjYjA4****Responseexample:HTTP/1.
1200OKx-oss-request-id:5CAC371EB7AEADE0170004BFDate:Tue,09Apr201906:09:34GMTContent-Length:244Content-Type:application/xmlConnection:keep-aliveServer:AliyunOSSmultipart.
dataCAEQNRiBgIDyz.
6C0BYiIGQ2NWEwNmVhNTA3ZTQ3MzM5ODliYjM1ZTdjYjA4****Note:Intheprecedingexample,thekeyandtheversionIDoftheobjecttobedeletedarereturned.
RequestexamplewhentheversionIdisspeciedtodeleteadeletemarker:POST/deleteHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,09Apr201906:14:50GMTContent-Length:178Content-MD5:dX9IFePFgYhmINvAhG30Bg==Authorization:OSS9dfwrokza5gf1p7:iyl6IU6TcfFXcu5p0ds5dUdo****falsemultipart.
dataCAEQNRiBgICEoPiC0BYiIGMxZWJmYmMzYjE0OTQ0ZmZhYjgzNzkzYjc2NjZk****Responseexample:HTTP/1.
1200OKx-oss-request-id:5CAC385AB7AEADE01700052FDate:Tue,09Apr201906:14:50GMTContent-Length:364Content-Type:application/xmlConnection:keep-aliveIssue:20200320199ObjectStorageServiceAPIReference/7ObjectoperationsServer:AliyunOSSdemo.
jpgCAEQNRiBgICEoPiC0BYiIGMxZWJmYmMzYjE0OTQ0ZmZhYjgzNzkzYjc2NjZk****true111111Note:-Intheprecedingexample,thereturnedKeyindicatesthekeyofthedeletedobjectandthereturnedVersionIdindicatesthedeletedversionoftheobject.
-DeleteMarkerindicatesthatthedeletedversionisadeletemarker.
DeleteMarkerVersionIdindicatestheIDofthedeletedversion.
Inthiscase,thevaluesofVersionIdandDeleteMarkerVersionIdarethesame,andDeleteMarkerandDeleteMarkerVersionIdarereturnedtogether.
SDKTheSDKsofthisAPIareasfollows:JavaPythonPHPGoC.
NETiOSNode.
jsBrowser.
jsRuby200Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsErrorcodesErrorcodeHTTPstatuscodeDescriptionInvalidDigest400IfyouspecifytheContent-MD5headerintherequest,OSScalculatestheContent-MD5ofthemessagebodyandcomparesitwiththisheader.
Ifthetwovaluesaredierent,thiserrorcodeisreturned.
MalformedXML400ADeleteMultipleObjectsrequestcancontainamessagebodyofupto2MB.
Ifthesizeofthemessagebodyexceeds2MB,thiserrorcodeisreturned.
ADeleteMultipleObjectsrequestcanbeusedtodeleteupto1,000objectsatatime.
Ifthenumberofobjectstobedeletedatatimeexceeds1,000,thiserrorcodeisreturned.
7.
7HeadObjectObtainsthemetainformationaboutanobjectwithoutreturningtheobjectcontent.
Note:Ifyouuploadtheusermetainformationprexedwithx-oss-meta-whensendingaPutObjectrequest,forexample,x-oss-meta-location,theusermetainformationisreturned.
VersioningBydefault,HeadObjectobtainsthemetainformationaboutthecurrentversionofanobject.
Ifthecurrentversionofthetargetobjectisadeletemarker,the404NotFounderrorisreturned.
YoucanspecifytheversionIdtoobtainthemetainformationaboutaspeciedversionofthetargetobject.
RequestsyntaxHEAD/ObjectNameHTTP/1.
1Host:BucketName/oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateIssue:20200320201ObjectStorageServiceAPIReference/7ObjectoperationsAuthorization:SignatureValueRequestheaderHeaderTypeRequiredDescriptionIf-Modified-SinceStringNoIfthetimespeciedintheparameterisearlierthanthemodicationtime,OSSreturnsthe200OKmessageandtheobjectmetainformation.
Otherwise,the304NotModiedmessageisreturned.
Defaultvalue:NoneIf-Unmodified-SinceStringNoIfthetimespeciedintheparameteristhesameasorlaterthantheobjectmodicationtime,OSSreturnsthe200OKmessageandtheobjectmetainformation.
Otherwise,the412PreconditionFailedmessageisreturned.
Defaultvalue:NoneIf-MatchStringNoIftheintroducedETagmatchestheETagoftheobject,OSSreturnsthe200OKmessageandtheobjectmetainformation.
Otherwise,the412PreconditionFailedmessageisreturned.
Defaultvalue:NoneIf-None-MatchStringNoIftheintroducedETagdoesnotmatchtheETagoftheobject,OSSreturnsthe200OKmessageandtheobjectmetainformation.
Otherwise,the304NotModiedmessageisreturned.
Defaultvalue:NoneResponseheaderNote:Ifthetypeoftherequestedobjectissymbollink,thecontentoftheobjectisreturned.
Intheresponseheader,Content-Length,ETag,andContent-Md5arethemetainformationoftherequestedobject,Last-Modifiedisthemaximumvalueoftherequestedobjectandsymbollink(thatis,thelatermodicationtime),andotherparametersarethemetainformationofthesymbollink.
202Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeDescriptionx-oss-meta-*StringIndicatesacustommetaheader.
Ifyouuploadtheusermetainformationprexedwithx-oss-meta-whensendingaPutObjectrequest,theusermetainformationisreturned.
Customheaderwithaprexexcludingx-oss-meta-StringIndicatesacustomheaderwithaprexexcludingx-oss-meta-.
Ifyouuploadtheusermetainformationwithaprex(excludingx-oss-meta-),forexample,x-oss-persistent-headerskey1:base64_encode(value1),key2:base64_encode(value2).
.
.
.
whensendingaPutObjectrequest,theusermetainformationprexedwiththecorrespondingcustomheadersisreturned.
x-oss-server-side-encryptionStringIftherequestedobjectisencryptedwiththeentropycodingalgorithmontheserver,OSSdecryptstheobjectandincludesthisheaderintheresponsetoindicatetheencryptionalgorithmusedtoencrypttheobjectontheserver.
x-oss-server-side-encryption-key-idStringIndicatestheKeyManagementService(KMS)keyIDofauser.
ThisheaderisreturnedifyouuseKMStoencryptanobjectwhencratingtheobject.
x-oss-storage-classStringIndicatesthestorageclassofanobject.
ThestorageclassincludesStandard,InfrequentAccess,andArchive.
Standardstorageprovideshighlyreliable,highlyavailable,andhigh-performanceobjectstorageservicesthatsupportfrequentdataaccess.
InfrequentAccessstorageisapplicabletothescenariowheredataneedstobestoredforalongtimeandisnotfrequentlyaccessed.
(Themonthlyaccessfrequencyis1to2timesonaverage.
)Archivestorageisapplicabletothescenariowheredataneedstobestoredformorethansixmonthsandisrarelyaccessedduringthestorageperiod.
Thestoreddatatakesaboutoneminutetobecomereadable.
Issue:20200320203ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeDescriptionx-oss-object-typeStringIndicatestheobjecttype.
ThetypeofobjectsthatareuploadedthroughPutObjectisNormal.
ThetypeofobjectsthatareuploadedthroughAppendObjectisAppendable.
ThetypeofobjectsthatareuploadedthroughMultipartUploadisMultipart.
x-oss-next-append-positionStringSpeciesthepositiontobeprovidedforthenextrequest.
ThisheaderisreturnedforAppendableobjects.
x-oss-hash-crc64ecmaStringIndicatesthe64-bitCRCvalueoftheobject.
ThisvalueiscalculatedbasedontheECMA-182standard.
Anexistingobjectmaynothavethisvalue.
x-oss-expirationStringIfthelifecycleruleisconguredfortheobject,thex-oss-expirationheaderisreturned.
Inthereturnedheader,thevalueofexpiry-dateistheexpirationdateoftheobject,andthevalueofrule-idisthecorrespondingruleID.
x-oss-restoreStringIfthebuckettypeisArchiveandtheRestorerequestissubmitted,theRestorestateoftheobjectisindicatedbyx-oss-restoreintheresponseheader.
IftheRestorerequestisnotsubmittedortimesout,theeldisnotreturned.
IftheRestorerequestissubmittedanddoesnottimeout,thevalueofx-oss-restorereturnedisongoing-request="true".
IftheRestorerequestissubmittedandcompleted,thevalueofx-oss-restorereturnedisongoing-request="false",expiry-date="Sun,16Apr201708:12:33GMT".
Inthereturnedvalue,thevalueofexpiry-dateistheexpirationdateofthereadablestateoftherestoredle.
x-oss-process-statusStringAfteryoucreateanOSSeventnoticationthroughMNSandsendarequesttoperformOSSoperations,ifamatchingeventnoticationruleisdetected,thisheaderisreturned.
Inthiscase,thevalueistheeventnoticationresultintheBase64encodedJSONformat.
204Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeDescriptionx-oss-request-chargedStringIffeesofthebuckettowhichtheobjectbelongsispaidbytherequester,notthebucketowner,thisheaderisreturnedwiththevalueofrequester.
Content-Md5StringThemessagecontent(excludingheaders)ofNormalobjectsiscalculatedbasedontheRFC1864standard,anda128-bitnumberisobtained.
TheContent-Md5valueofamessageisobtainedafterthe128-bitnumberisencodedbasedonBase64.
ThisheaderisnotreturnedinMultipartandAppendableobjects.
Last-ModifiedStringIndicatesthelatesttimewhentheobjectismodied.
ThetimeisintheGMTformatspeciedinHTTP1.
1.
Access-Control-Allow-OriginStringWhentheCORSruleisconguredforthebuckettowhichtheobjectbelongs,iftherequestedoriginmeetsthespeciedCORSrule,theoriginisreturned.
Access-Control-Allow-MethodsStringWhentheCORSruleisconguredforthebuckettowhichtheobjectbelongs,iftherequestedAccess-Control-Request-MethodmeetsthespeciedCORSrule,thecorrespondingmethodsarereturned.
Access-Control-Max-AgeStringWhentheCORSruleisconguredforthebuckettowhichtheobjectbelongs,ifarequestmeetsthespeciedCORSrule,thevalueofMaxAgeSecondsisreturned.
Access-Control-Allow-HeadersStringWhentheCORSruleisconguredforthebuckettowhichtheobjectbelongs,ifarequestmeetsthespeciedCORSrule,theheadersarereturned.
Access-Control-Expose-HeadersStringIndicatesthelistofheadersthatcanaccesstheclientJavaScript.
WhentheCORSruleisconguredforthebuckettowhichtheobjectbelongs,ifarequestmeetsthespeciedCORSrule,theExposeHeaderisreturned.
x-oss-tagging-countStringSpeciesthenumberoftagsassociatedwiththeobject.
Thevalueofthisparameterreturnsonlyiftheuserhaspermissiontoreadtags.
Issue:20200320205ObjectStorageServiceAPIReference/7ObjectoperationsExamplesNormalrequestexample:HEAD/oss.
jpgHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Fri,24Feb201207:32:52GMTAuthorization:OSSqn6qrrqxo2oawuk53otf****:JbzF2LxZUtanlJ5dLA092wpD****Responseexample:HTTP/1.
1200OKx-oss-request-id:559CC9BDC755F95A6448****x-oss-object-type:Normalx-oss-storage-class:ArchiveDate:Fri,24Feb201207:32:52GMTLast-Modified:Fri,24Feb201206:07:48GMTETag:"fba9dede5f27731c9771645a39863328"Content-Length:344606Content-Type:image/jpgConnection:keep-aliveServer:AliyunOSSExampleofarequestwhentheRestorerequesthasbeensubmittedbutnotcompleted:HEAD/oss.
jpgHTTP/1.
1Host:oss-archive-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Sat,15Apr201707:32:52GMTAuthorization:OSSe1Unnbm1rg****:KKxkdNrUBu2t1kqlDh0MLbDb****Responseexample:HTTP/1.
1200OKx-oss-request-id:58F71A164529F18D7F00****x-oss-object-type:Normalx-oss-storage-class:Archivex-oss-restore:ongoing-request="true"Date:Sat,15Apr201707:32:52GMTLast-Modified:Sat,15Apr201706:07:48GMTETag:"fba9dede5f27731c9771645a39863328"Content-Length:344606Content-Type:image/jpgConnection:keep-aliveServer:AliyunOSSExampleofarequestwhentheRestorerequesthasbeensubmittedandcompleted:HEAD/oss.
jpgHTTP/1.
1Host:oss-archive-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Sat,15Apr201709:35:51GMT206Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsAuthorization:OSSe1Unnbm1rg****:21qtGJ+ykDVmdu6O6FMJnn+W****Responseexample:HTTP/1.
1200OKx-oss-request-id:58F725344529F18D7F00****x-oss-object-type:Normalx-oss-storage-class:Archivex-oss-restore:ongoing-request="false",expiry-date="Sun,16Apr201708:12:33GMT"Date:Sat,15Apr201709:35:51GMTLast-Modified:Sat,15Apr201706:07:48GMTETag:"fba9dede5f27731c9771645a39863328"Content-Length:344606Exampleofarequestinitiatedtoobtainthemetainformationaboutthecurrentversionofanobject:HEAD/exampleversionId=CAEQNRiBgICb8o6D0BYiIDNlNzk5NGE2M2Y3ZjRhZTViYTAxZGE0ZTEyMWYyNDFmHost:versioning-test.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,09Apr201906:27:12GMTAuthorization:OSSryghu9rp3mq****:RvyjGvKxaUhdF0ibyEwX5mOM****Responseexample:HTTP/1.
1200OKx-oss-versionId:CAEQNRiBgICb8o6D0BYiIDNlNzk5NGE2M2Y3ZjRhZTViYTAxZGE0ZTEyMWYyNDFmx-oss-request-id:5CAC3B40B7AEADE01700****x-oss-object-type:Normalx-oss-storage-class:ArchiveDate:Tue,09Apr201906:27:12GMTLast-Modified:Tue,09Apr201906:27:12GMTETag:"A082B659EF78733A5A042FA253B19BA4"Content-Length:481827Content-Type:text/htmlConnection:keep-aliveServer:AliyunOSSErrorcodesErrorcodeHTTPstatuscodeDescriptionNoSuchKey404Therequestobjectdoesnotexist.
SymlinkTargetNotExist404Therequestedobjectisasymbollink.
InvalidTargetType400Therequestedandthetargetobjectsareasymbollinkisasymbollinkandthetarget.
Issue:20200320207ObjectStorageServiceAPIReference/7ObjectoperationsErrorcodeHTTPstatuscodeDescriptionNotModied304TheIf-Modified-Sinceheaderisspeciedintherequest,butthesourceobjecthasnotbeenmodiedafterthetimespeciedintherequest.
TheIf-None-Matchheaderisspeciedintherequest,andtheETagprovidedintherequestisthesameastheETagofthesourceobject.
PreconditionFailed412TheIf-Unmodified-Sinceheaderisspecied,butthetimespeciedintherequestisearlierthantheobjectmodicationtime.
TheIf-Matchheaderisspecied,buttheprovidedETagisdierentfromtheETagofthesourceobject.
7.
8GetObjectMetaObtainsthemetadataofanobjectinabucket,includingtheETag,Size,andLastModied.
Thecontentoftheobjectisnotreturned.
Note:Iftherequestedobjectisasymbollink,theinformationofthesymbollinkisreturned.
TheresponsetoaGetObjectMetarequestdoesnotincludeamessagebodywhethertherequestissuccessful.
VersioningGetObjectMetaobtainsthemetadataofthecurrentversionofthetargetobjectbydefault.
Ifthecurrentversionofthetargetobjectisadeletemarker,the404NotFounderrorisreturned.
YoucanspecifytheversionIdintherequesttoobtainthemetadataofaspeciedversionofthetargetobject.
RequestsyntaxHEAD/ObjectNameobjectMetaHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDate208Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsAuthorization:SignatureValueResponseheadersHeaderTypeDescriptionContent-LengthStringIndicatesthesizeoftheobject.
ETagStringIndicatestheETagoftheobject,whichisgeneratedwhenanobjectiscreatedtoidentifythecontentoftheobject.
ForanobjectcreatedbyaPutObjectrequest,itsETagistheMD5valueofitscontent.
Foranobjectcreatedinothermethods,itsETagistheUUIDofitscontent.
TheETagofanobjectcanbeusedtocheckwhetherthecontentoftheobjectchanges.
WerecommendyoudonotuseETagastheMD5valueofanobjecttoverifydataintegrity.
Defaultvalue:NoneExamplesNormalrequestexample:HEAD/oss.
jpgobjectMetaHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Wed,29Apr201505:21:12GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:CTkuxpLAi4XZ+WwIfNm0Fmgb****Responseexample:HTTP/1.
1200OKx-oss-request-id:559CC9BDC755F95A64485981Date:Wed,29Apr201505:21:12GMTETag:"5B3C1A2E053D763E1B002CC607C5****"Last-Modified:Fri,24Feb201206:07:48GMTContent-Length:344606Connection:keep-aliveIssue:20200320209ObjectStorageServiceAPIReference/7ObjectoperationsServer:AliyunOSSExampleofarequestinitiatedtoobtainthemetadataofaspeciedversionofthetargetobject:GET/exampleobjectMeta&versionId=CAEQNRiBgIDMh4mD0BYiIDUzNDA4OGNmZjBjYTQ0YmI4Y2I4ZmVlYzJlNGVk****HTTP/1.
1Host:versioning-test.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,09Apr201906:24:00GMTAuthorization:OSS5n4nrhyqrcs6ngn:i/M/c36KzrOEA/bBSHLllIAt****Responseexample:HTTP/1.
1200OKx-oss-version-id:CAEQNRiBgIDMh4mD0BYiIDUzNDA4OGNmZjBjYTQ0YmI4Y2I4ZmVlYzJlNGVk****x-oss-request-id:5CAC3A80B7AEADE0170005F6Date:Tue,09Apr201906:24:00GMTETag:"1CF5A685959CA2ED8DE6E5F8ACC2****"Last-Modified:Tue,09Apr201906:24:00GMTContent-Length:119914Connection:keep-aliveServer:AliyunOSSSDKTheSDKsofthisAPIareasfollows:JavaPythonJavaPythonPHPGoC.
NETiOSErrorcodesErrorcodeHTTPstatuscodeDescriptionNotFound404Therequestedobjectdoesnotexist.
210Issue:20200320ObjectStorageServiceAPIReference/7Objectoperations7.
9PutObjectACLModiestheACLforanobject.
OnlythebucketownerwhohasthewritepermissionontherequestedobjectcanperformPutObjectACLoperations.
VersioningPutObjectACLsetstheACLforthecurrentversionofthetargetobjectbydefault.
Ifthecurrentversionofthetargetobjectisadeletemarker,the404NotFounderrorisreturned.
YoucansettheversionIdintherequesttosettheACLforaspeciedversionofthetargetobject.
Note:TheobjectACLtakesprecedenceoverthebucketACL.
Forexample,ifthebucketACLisprivateandtheobjectACLispublic-read-write,OSSrstcheckstheACLfortheobjectwhenauseraccessestheobject.
Asaresult,alluserscanaccessthisobjecteveniftheACLforthebucketisaprivate.
IftheACLforanobjecthasneverbeenset,theACLforthisobjectissameasthatforthebucketwheretheobjectislocated.
Readoperationstoanobjectinclude:thereadoperationstothesourceobjectinGetObject,HeadObject,CopyObject,andUploadPartCopyWriteoperationstoanobjectinclude:thewriteoperationsonanewobjectinPutObject,PostObject,AppendObject,DeleteObject,DeleteMultipleObjects,CompleteMultipartUpload,andCopyObject.
Youcanalsoincludethex-oss-object-aclheaderintherequesttosettheACLforanobjectwhenperformingwriteoperationsontheobject.
Forexample,ifyouincludethex-oss-object-aclheaderinthePutObjectrequest,youcansettheACLfortheobjectwhileuploadingit.
ACLoverviewYoucanspecifythex-oss-object-aclheaderinthePutObjectACLrequest.
tosettheACLforanobject.
ThefollowingtabledescribesthefourACLsthatcanbesetforanobject.
Issue:20200320211ObjectStorageServiceAPIReference/7ObjectoperationsACLDescriptionprivateThisACLindicatesthatanobjectisaprivateresource.
Onlytheownerofthisobjecthasthepermissiontoreadorwritethisobject.
public-readThisACLindicatesthatanobjectisaresourcethatcanbereadbythepublic.
Onlytheownerofthisobjecthasthepermissiontoreadandwritethisobject.
Otherusersonlyhavethepermissiontoreadthisobject.
public-read-writeThisACLindicatesthatanobjectisaresourcethatcanbereadandwrittenbythepublic.
Allusershavethepermissiontoreadandwritethisobject.
defaultThisACLindicatesanobjectisaresourceinheritingtheread-writepermissionsofthebucket.
Thatis,thebucketandtheobjecthavethesamepermissions.
RequestsyntaxPUT/ObjectNameaclHTTP/1.
1x-oss-object-acl:PermissionHost:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueExamplesNormalrequestexample:PUT/test-objectaclHTTP/1.
1x-oss-object-acl:public-readHost:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Wed,29Apr201505:21:12GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:KU5h8YMUC78M30dXqf3JxrTZ****Responseexample:HTTP/1.
1200OKx-oss-request-id:559CC9BDC755F95A64485981Date:Wed,29Apr201505:21:12GMTContent-Length:0Connection:keep-alive212Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsServer:AliyunOSSExampleofarequestinitiatedtosettheACLforaspeciedversionofthetargetobject:PUT/exampleacl&versionId=CAEQMhiBgIC3rpSD0BYiIDBjYTk5MmIzN2JlNjQxZTFiNGIzM2E3OTliODA0****HTTP/1.
1x-oss-object-acl:public-readHost:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,09Apr201906:30:11GMTAuthorization:OSSqctg2ns3l8u51iu:UTsv3F7L34v+ECq52vURdCSv****Responseexample:HTTP/1.
1200OKx-oss-version-id:CAEQMhiBgIC3rpSD0BYiIDBjYTk5MmIzN2JlNjQxZTFiNGIzM2E3OTliODA0****x-oss-request-id:5CAC3BF3B7AEADE017000624Date:Tue,09Apr201906:30:11GMTContent-Length:0Connection:keep-aliveServer:AliyunOSSSDKTheSDKsofthisAPIareasfollows:JavaPythonPHPGoC.
NETNode.
jsBrowser.
jsRubyErrorcodesErrorcodeHTTPstatuscodeDescriptionAccessDenied403Theuserisnotthebucketownerordoesnothavethereadandwritepermissionsontheobject.
InvalidArgument400Thevalueofx-oss-object-aclisinvalid.
Issue:20200320213ObjectStorageServiceAPIReference/7Objectoperations7.
10GetObjectACLObtainstheACLforanobjectinabucket.
VersioningGetObjectACLobtainstheACLforthecurrentversionofthetargetobjectbydefault.
Ifthecurrentversionoftheobjectisadeletemarker,the404NotFounderrorisreturned.
YoucanspecifytheversionIdintherequesttoobtaintheACLforaspeciedversionofthetargetobject.
Note:IftheACLforanobjecthasnotbeenset,theObjectACLintheresponsetotheGetObjectACLrequestisdefault,whichindicatesthattheACLfortheobjectisthesameasthatforthebucket.
Forexample,iftheACLforthebucketisprivate,theACLfortheobjectisalsoprivate.
RequestsyntaxGET/ObjectNameaclHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueResponseelementsElementTypeDescriptionAccessControlListContainerSpeciesthecontainerusedtostoretheACLinformation.
Parentnode:AccessControlPolicyAccessControlPolicyContainerSpeciesthecontainerthatstoresthereturnedresultoftheGetObjectACLrequest.
Parentnode:None214Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsElementTypeDescriptionDisplayNameStringIndicatesthenameofthebucketowner,whichisthesameasthevalueofID.
Parentnode:AccessControlPolicy.
OwnerGrantEnumeratedstringIndicatestheACLfortheobject.
Validvalues:private,public-read,andpublic-read-writeParentnode:AccessControlPolicy.
AccessControlListIDStringIndicatestheuserIDofthebucketowner.
Parentnode:AccessControlPolicy.
OwnerOwnerContainerSpeciesthecontainerusedtostoretheinformationaboutthebucketowner.
Parentnode:AccessControlPolicyExamplesNormalrequestexample:GET/test-objectaclHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Wed,29Apr201505:21:12GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:CTkuxpLAi4XZ+WwIfNm0Fmgb****Responseexample:HTTP/1.
1200OKIssue:20200320215ObjectStorageServiceAPIReference/7Objectoperationsx-oss-request-id:559CC9BDC755F95A64485981Date:Wed,29Apr201505:21:12GMTContent-Length:253Content-Tupe:application/xmlConnection:keep-aliveServer:AliyunOSS0022012022200220120222public-readExampleofarequestinitiatedtoobtaintheACLforaspeciedversionofthetargetobject:GET/exampleacl&versionId=CAEQMhiBgMC1qpSD0BYiIGQ0ZmI5ZDEyYWVkNTQwMjBiNTliY2NjNmY3ZTVk****HTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,09Apr201906:30:10GMTAuthorization:OSSqctg2ns3l8u51iu:w4DK66Kb/0M9GJKdsrpNs8l1****Responseexample:HTTP/1.
1200OKx-oss-version-id:CAEQMhiBgMC1qpSD0BYiIGQ0ZmI5ZDEyYWVkNTQwMjBiNTliY2NjNmY3ZTVk****x-oss-request-id:5CAC3BF2B7AEADE017000621Date:Tue,09Apr201906:30:10GMTContent-Length:261Content-Tupe:application/xmlConnection:keep-aliveServer:AliyunOSS1234513715092****1234513715092****public-readSDKTheSDKsofthisAPIareasfollows:JavaPythonPHPGo216Issue:20200320ObjectStorageServiceAPIReference/7Objectoperations.
NETErrorcodesErrorcodeHTTPStatuscodeErrormessageDescriptionAccessDenied403Youdonothavereadaclpermissiononthisobject.
YoudonothavethepermissiontoperformtheGetObjectACLoperation.
OnlythebucketownercancallGetObjectACLtoobtaintheACLforanobjectinthebucket.
7.
11PostObjectYoucancallthisoperationtouploadanobjecttoaspecicbucketbyusingHTMLformupload.
Note:ToperformthePostObjectoperationonabucket,youmusthavethewritepermissionsonthebucket.
IftheACLofthebucketispublicread/write,youdonotneedtouploadthesignatureinformation.
IftheACLofthebucketisnotpublicread/write,signaturevericationisrequiredforthisoperation.
UnlikePutObject,PostObjectusesanAccessKeysecrettocalculatethesignatureforpolicy.
ThecalculatedsignaturestringisusedasthevaluefortheSignatureformeld.
OSSchecksthisvaluetoverifythevalidityofthesignature.
TheURLofthesubmittedformcanbethedomainnameofthebucket.
YoudonotneedtospecifytheobjectintheURL.
Inotherwords,therequestlineisinformatofPOST/HTTP/1.
1insteadofPOST/ObjectNameHTTP/1.
1.
IfthePostObjectrequestcontainstheHeadersignatureorURLsignature,OSSdoesnotcheckthesesignatures.
Issue:20200320217ObjectStorageServiceAPIReference/7ObjectoperationsVersioningIfyouinitiateaPostObjectrequesttoaversioning-enabledbucket,OSSautomaticallygeneratesauniqueversionIDfortheuploadedobjectandincludestheversionIDinthex-oss-version-idresponseheader.
IfyouinitiateaPostObjectrequesttoaversioning-suspendedbucket,OSSautomaticallygeneratesanullversionIDfortheuploadedobjectandincludestheversionIDinthex-oss-version-idresponseheader.
AnobjectcanonlyhaveonenullversionID.
PostObjectRequestsyntaxPOST/HTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comUser-Agent:browser_dataContent-Length:ContentLengthContent-Type:multipart/form-data;boundary=9431149156168--9431149156168Content-Disposition:form-data;name="key"key--9431149156168Content-Disposition:form-data;name="success_action_redirect"success_redirect--9431149156168Content-Disposition:form-data;name="Content-Disposition"attachment;filename=oss_download.
jpg--9431149156168Content-Disposition:form-data;name="x-oss-meta-uuid"myuuid--9431149156168Content-Disposition:form-data;name="x-oss-meta-tag"mytag--9431149156168Content-Disposition:form-data;name="OSSAccessKeyId"access-key-id--9431149156168Content-Disposition:form-data;name="policy"encoded_policy--9431149156168Content-Disposition:form-data;name="Signature"signature--9431149156168Content-Disposition:form-data;name="file";filename="MyFilename.
jpg"Content-Type:image/jpegfile_content--9431149156168Content-Disposition:form-data;name="submit"UploadtoOSS218Issue:20200320ObjectStorageServiceAPIReference/7Objectoperations--9431149156168--RequestheadersNote:ThemessagebodyofaPostObjectrequestisencodedinmultipart/form-dataformat.
InPostObjectoperations,parametersarepassedasformeldsintherequestmessagebody,whicharedierentfromtheparameterspassedbyHTTPrequestheadersinPutObjectoperations.
HeaderTypeDescriptionRequiredOSSAccessKeyIdStringSpeciestheAccessKeyIDofthebucketowner.
Defaultvalue:null.
Constraint:ThisformeldisrequiredwhenthebucketACLisnotpublicread/writeorwhenthepolicy(orSignature)formeldisprovided.
ConditionalIssue:20200320219ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeDescriptionRequiredpolicyStringSpeciesthevalidityoftheformeldsintherequest.
Arequestthatdoesnotcontainthepolicyformeldisconsideredasananonymousrequest,andcanonlybeusedtoaccessbucketswhoseACLsarepublicread/write.
Defaultvalue:null.
Constraint:ThisformeldisrequiredwhenthebucketACLisnotpublicread/writeorwhentheOSSAccessKeyId(orSignature)formeldisprovided.
Note:TheformandthepolicyformeldmustbeencodedinUTF-8.
Conditional220Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeDescriptionRequiredSignatureStringSpeciesthesignatureinformationobtainedaftercalculationbasedontheAccessKeysecretandthepolicyformeld.
OSSchecksthesignatureinformationtoverifyvalidityofthePostObjectrequest.
Formoreinformation,seethePostSignaturesectioninthistopic.
Defaultvalue:null.
Constraint:ThisformeldisrequiredwhenthebucketACLisnotpublicread/writeorwhentheOSSAccessKeyId(orPolicy)formeldisprovided.
Note:Formeldsarecase-insensitive,buttheirvaluesarecase-sensitive.
ConditionalCache-Control,Content-Type,Content-Disposition,Content-Encoding,ExpiresStringSpeciestheHTTPrequestheaders.
Formoreinformation,seePutObject.
Defaultvalue:null.
TheformsubmittedbythePostObjectoperationmustbeencodedinmultipart/form-dataformat.
Forexample,theContent-Typeheadermustbeinmultipart/form-data;boundary=xxxxxxformat,whereboundaryisaboundarystring.
NoIssue:20200320221ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeDescriptionRequiredfileStringSpeciestheleortextcontent.
Itmustbethelasteldintheform.
ThebrowserautomaticallysetstheContent-Typeheaderbasedontheletypeandoverwritestheusersetting.
OnlyonelecanbeuploadedtoOSSatatime.
Defaultvalue:null.
YeskeyStringSpeciesthenameoftheuploadedobject.
Iftheobjectnameincludesapath,suchasa/b/c/b.
jpg,OSSautomaticallycreatesthecorrespondingdirectory.
Defaultvalue:null.
Yessuccess_action_redirectStringSpeciestheURLtowhichtheclientisredirectedaftertheobjectisuploaded.
Ifthisformeldisnotspecied,thereturnedresultisspeciedbysuccess_action_status.
Iftheuploadfails,OSSreturnsanerrorcode,andtheclientisnotredirectedtoanyURL.
Defaultvalue:null.
No222Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeDescriptionRequiredsuccess_action_statusStringSpeciesthestatuscodereturnedtotheclientaftertheobjectisuploadedifthesuccess_action_redirectformeldisnotspecied.
Defaultvalue:null.
Validvalues:200,201,and204(default)Note:-Ifthevalueofthisformeldissetto200or204,OSSreturnsanemptyleandthe200or204statuscode.
-Ifthevalueofthisformeldissetto201,OSSreturnsanXMLleandthe201statuscode.
-Ifthevalueofthisformeldisnotspeciedorsettoaninvalidvalue,OSSreturnsanemptyleandthe204statuscode.
NoIssue:20200320223ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeDescriptionRequiredx-oss-meta-*StringSpeciesthemetadatacustomizedbytheuser.
Defaultvalue:null.
Iftherequestcontainsaformeldprexedwithx-oss-meta-,theformeldisconsideredasthemetadata.
Example:x-oss-meta-location.
Note:Anobjectmayhavemultiplesimilarparameters,butthetotalsizeofallmetadatacannotexceed8KB.
No224Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeDescriptionRequiredx-oss-server-side-encryptionStringSpeciestheserver-sideencryptionalgorithmusedwhenOSScreatestheobject.
Validvalues:AES256orKMS.
YoumustpurchaseKMSbeforeusingtheKMS-basedencryptionalgorithm.
Otherwise,aKmsServiceNotEnablederrorcodeisreturned.
Ifyouspecifythisparameter,itisreturnedintheresponseheaderandtheuploadedobjectisencrypted.
Whenyoudownloadtheencryptedobject,thex-oss-server-side-encryptioneldisincludedintheresponseheaderanditsvalueissettothealgorithmusedtoencrypttheobject.
Nox-oss-server-side-encryption-key-idStringSpeciestheIDofthecustomermasterkey(CMK)hostedinKMS.
Thisparameterisvalidonlywhenthevalueofx-oss-server-side-encryptionissettoKMS.
NoIssue:20200320225ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeDescriptionRequiredx-oss-object-aclStringSpeciestheACLconguredwhenOSScreatestheobject.
Validvalues:publicread,private,andpublicread/writeNox-oss-security-tokenStringIfanSTStemporarysecuritycredentialisusedforthisaccess,youmustsetthiseldtotheSecurityTokenvalueandsetOSSAccessKeyIdtothevalueofthepairedtemporaryAccessKeyID.
ThemethodofcalculatingasignaturebasedonatemporaryAccessKeyIDisthesameasthatbasedonatypicalAccessKeyID.
Defaultvalue:null.
Nox-oss-forbid-overwriteStringSpecieswhetherthePostObjectoperationoverwritestheobjectwiththesameobjectname.
-Ifx-oss-forbid-overwriteisnotspecied,theobjectwiththesameobjectnameisoverwritten.
-Ifthevalueofx-oss-forbid-overwriteissettotrue,theobjectwiththesameobjectnamecannotbeoverwritten.
Ifthevalueofx-oss-forbid-overwriteissettofalse,theobjectwiththesameobjectnamecanbeoverwritten.
No226Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsResponseheadersHeaderTypeDescriptionx-oss-server-side-encryptionStringIfx-oss-server-side-encryptionisspeciedintherequest,theresponseheadercontainsthiseldtoindicatetheencryptionalgorithmused.
ResponseelementsElementTypeDescriptionPostResponseContainerSpeciesthecontainerthatstorestheresultofthePostObjectrequest.
Childnode:Bucket,ETag,Key,andLocationBucketStringSpeciesthebucketname.
Parentnode:PostResponseETagStringSpeciestheentitytag(ETag)thatiscreatedwhenanobjectisgenerated.
ForanobjectcreatedbyusingPostObject,theETagvalueistheUUIDoftheobjectandcanbeusedtocheckwhetherthecontentoftheobjecthaschanged.
Parentnode:PostResponseLocationStringSpeciestheURLofthenewlycreatedobject.
Parentnode:PostResponseExamples-SamplerequestsPOST/HTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comContent-Length:344606Content-Type:multipart/form-data;boundary=9431149156168--9431149156168Content-Disposition:form-data;name="key"/user/a/objectName.
txt--9431149156168Content-Disposition:form-data;name="success_action_status"200--9431149156168Content-Disposition:form-data;name="Content-Disposition"content_disposition--9431149156168Issue:20200320227ObjectStorageServiceAPIReference/7ObjectoperationsContent-Disposition:form-data;name="x-oss-meta-uuid"uuid--9431149156168Content-Disposition:form-data;name="x-oss-meta-tag"metadata--9431149156168Content-Disposition:form-data;name="OSSAccessKeyId"44CF9590006BF252F707--9431149156168Content-Disposition:form-data;name="policy"eyJleHBpcmF0aW9uIjoiMjAxMy0xMi0wMVQxMjowMDowMFoiLCJjb25kaXRpb25zIjpbWyJjb250ZW50LWxlbmd0aC1yYW5nZSIsIDAsIDEwNDg1NzYwXSx7ImJ1Y2tldCI6ImFoYWhhIn0sIHsiQSI6ICJhIn0seyJrZXkiOiAiQUJDIn1dfQ==--9431149156168Content-Disposition:form-data;name="Signature"kZoYNv66bsmc10+dcGKw5x2PRrk=--9431149156168Content-Disposition:form-data;name="file";filename="MyFilename.
txt"Content-Type:text/plainabcdefg--9431149156168Content-Disposition:form-data;name="submit"UploadtoOSS--9431149156168---Sampleresponses:HTTP/1.
1200OKx-oss-request-id:61d2042d-1b68-6708-5906-33d81921362eDate:Fri,24Feb201406:03:28GMTETag:"5B3C1A2E053D763E1B002CC607C5****"Connection:keep-aliveContent-Length:0Server:AliyunOSSErrorcodesErrorcodeHTTPstatuscodeDescriptionInvalidArgument400TheerrormessagereturnedbecausewhenanyoneoftheOSSAccessKeyId,Policy,andSignatureformeldsisuploaded,theremainingtwoformeldsthatarerequiredaremissing,regardlessofwhetherthebucketACLispublicread/write.
228Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsErrorcodeHTTPstatuscodeDescriptionInvalidDigest400TheerrormessagereturnedbecausetheContent-MD5valueoftherequestbodythatiscalculatedbyOSSisnotthesameasthevalueoftheContent-MD5headereldintherequest.
EntityTooLarge400TheerrormessagereturnedbecausethetotalsizeofthePostObjectrequestbodyisgreaterthan5GB.
InvalidEncryptionAlgorithmError400TheerrormessagereturnedbecauseavalueotherthanAES256orKMSissetforthex-oss-server-side-encryptionheadereld.
FileAlreadyExists409Theerrormessagereturnedbecauseanobjectwiththesameobjectnamealreadyexistswhentherequestcontainsanx-oss-forbid-overwriteheaderandthevalueofthisheaderissettotrue.
PolicyThepolicyformeldinaPostObjectrequestisusedtoverifythevalidityoftherequest.
ThepolicyisaJSONtextencodedinUTF-8andBase64.
ItstatestheconditionsthataPostObjectrequestmustmeet.
AlthoughthepolicyformeldisoptionalforuploadingobjectstoabucketwhoseACLispublicread/write,werecommendthatyouusethiseldtolimitPostObjectrequests.
Example{"expiration":"2014-12-01T12:00:00.
000Z","conditions":[{"bucket":"johnsmith"},["starts-with","$key","user/eric/"]]Issue:20200320229ObjectStorageServiceAPIReference/7Objectoperations}Thepolicyformeldmustcontaintheexpirationandconditionsparameters.
ExpirationExpirationspeciestheexpirationtimeofthepolicy.
ThetimefollowstheISO8601standard.
ThetimemustbeGMT.
Forexample,2014-12-01T12:00:00.
000ZindicatesthatthePostObjectrequestmustbesentbefore12:00onDecember1,2014.
ConditionsConditionsisalistthatspeciesthevalidvaluesofformeldsinthePostObjectrequest.
Note:ThevalueofaformeldisextendedafterOSSchecksthepolicy.
Therefore,thevalidvalueoftheformeldsetinthepolicyisequivalenttothevalueoftheformeldbeforeextension.
Thefollowingtableliststheconditionssupportedbythepolicy.
ParameterDescriptioncontent-length-rangeSpeciestheminimumandmaximumallowedsizesoftheuploadedobject.
Thisconditionsupportsthecontent-length-rangematchmode.
Cache-Control,Content-Type,Content-Disposition,Content-Encoding,ExpiresSpeciestheHTTPrequestheaders.
Thisconditionsupportstheexactmatchandstarts-withmatchmodes.
Notice:WerecommendthatyouincludetheContent-TypeparameterinthepolicyformeldtopreventmaliciousmodicationoftheContent-Typeheaderduringformupload.
keySpeciesthenameoftheobjecttoupload.
Thisconditionsupportstheexactmatchandstarts-withmatchmodes.
230Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsParameterDescriptionsuccess_action_redirectSpeciestheURLtowhichtheclientisredirectedaftertheobjectisuploaded.
Thisconditionsupportstheexactmatchandstarts-withmatchmodes.
success_action_statusSpeciesthestatuscodereturnedaftertheobjectisuploadedifsuccess_action_redirectisnotspecied.
Thisconditionsupportstheexactmatchandstarts-withmatchmodes.
x-oss-meta-*Speciestheusermetasetbytheuser.
Thisconditionsupportstheexactmatchandstarts-withmatchmodes.
IfthePostObjectrequestcontainsextraformelds,OSSaddstheseextraformeldstoconditionsofthepolicyandcheckstheirvalidity.
ConditionmatchmodesConditionmatchmodesDescriptionExactmatchThevalueofaformeldmustbeexactlythesameasthevaluedeclaredintheconditions.
Forexample,ifthevalueofthekeyformeldmustbea,theconditionsmustbe["eq","$key","a"].
StartswithThevalueofaformeldmuststartwiththespeciedvalue.
Forexample,ifthevalueofthekeyformeldmuststartwithuser/user1,theconditionsmustbe["starts-with","$key","user/user1"].
SpeciedlesizeSpeciestherangeoftheacceptableobjectsize.
Forexample,iftheacceptableobjectsizeis1to10bytes,theconditionsmustbe["content-length-range",1,10].
EscapecharactersInthepolicyformeldofthePostObjectrequest,$isusedtoindicateavariable.
Therefore,todescribe$,theescapecharactermustbeused.
Inaddition,someIssue:20200320231ObjectStorageServiceAPIReference/7ObjectoperationscharactersinJSONstringsareescaped.
ThefollowingtabledescribescharactersintheJSONstringofthepolicyformeldofaPostObjectrequest.
EscapecharacterDescription\/Forwardslash\Backslash\"Doublequote\$Dollarsign\bBackspace\fFormfeed\nNewline\rCarriagereturn\tHorizontaltab\uxxxxUnicodecharacterSignatureForaveriedPostObjectrequest,theHTMLformmustcontainthepolicyandSignatureformelds.
Thepolicyformeldspecieswhichvaluesareacceptableintherequest.
TheprocedureforcalculatingtheSignatureformeldisasfollows:1.
CreateaUTF-8encodedpolicy.
2.
EncodethepolicyinBase64.
Theencodingresultisthevalueofthepolicyformeld,andthisvalueisusedasthestringtobesigned.
3.
UseAccessKeySecrettosignthestring.
Thesigningmethodisthesameasthecalculatingmethodofthesignatureintheheader;thatis,byreplacingthestringtobesignedwiththepolicyformeld.
Formoreinformation,seeAddsignaturestoheaders.
DemoForthedemoofdirectlytransferringdatafromthewebtoOSSbyusingformupload,seeJavaScript-basedsignaturesontheclientforobjectuploads.
232Issue:20200320ObjectStorageServiceAPIReference/7Objectoperations7.
12CallbackToenableOSStoreturncallbackinformationofanobjecttoanapplicationserveraftertheobjectisuploadedtoOSS,youneedonlytoincludeacallbackparameterintheuploadrequestsenttoOSS.
Thistopicdescribeshowtoimplementuploadcallbackindetail.
Note:TheAPIoperationsthatsupportuploadcallbackincludePutObject,PostObject,andCompleteMultipartUpload.
Formoreinformationaboutcallback,seeAddsignaturesontheserver,configureuploadcallback,anddirectlytransferdata.
Step1:ConstructparametersConstructacallbackparameter.
AcallbackparameterisaBase64-encodedstring(eld)inJSONformat.
Toconstructacallbackparameter,youmustspecifytheURL(callbackUrl)oftheIssue:20200320233ObjectStorageServiceAPIReference/7Objectoperationsservertowhichthecallbackinformationissentandthecontent(callbackBody)ofthecallbackinformation.
ThefollowingtabledescribestheJSONeldsincludedinacallbackparameter.
FieldDescriptionRequiredcallbackUrl-Afteranobjectisuploaded,OSSsendsacallbackrequestbyusingthePOSTmethodtothisURL.
ThebodyoftherequestisthecontentspeciedincallbackBody.
Innormalcases,theURLreturnsanHTTP/1.
1200OKresponse.
TheresponsebodymustbeinJSONformat,andtheContent-Lengthheaderoftheresponseisavalidvaluethatisnotgreaterthan3MB.
-YoucancongureuptoveURLsseparatedbysemicolons(;)forarequest.
OSSsendsrequeststoeachURLuntiltherstsuccessresponseisreturned.
-IfnoURLsareconguredorthevalueofthiseldisnull,OSSdeterminesthatthecallbackfunctionisnotcongured.
-HTTPS-basedURLsaresupported.
-ToensurethatChinesecharacterscanbecorrectlyprocessed,thecallbackURLmustbeencoded.
Forexample,ifthevalueofcallbackUrlishttp://example.
com/ChineseCharacters.
phpkey=value&ChineseName=ChineseValue,thevaluemustbeencodedintohttp://example.
com/%E4%B8%AD%E6%96%87.
phpkey=value&%E4%B8%AD%E6%96%87%E5%90%8D%E7%A7%B0=%E4%B8%AD%E6%96%87%E5%80%BC.
Yes234Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsFieldDescriptionRequiredcallbackHost-ThevalueoftheHostheaderinthecallbackrequest.
ThiseldisvalidonlywhencallbackUrlisspecied.
-IfcallbackHostisnotspecied,thehostsareresolvedfromtheURLsofthecallbackUrleldandarespeciedasthevalueofcallbackHost.
NocallbackBody-Thevalueofthecallbackrequestbody.
Example:key=$(key)&etag=$(etag)&my_var=$(x:my_var).
-Systemvariables,customvariables,andconstantsaresupportedforthiseld.
Thefollowingtableliststhesupportedsystemvariables.
Customvariablesarepassedbyusingthecallback-varparameterinthePutObjectandCompleteMultipartoperationsandbyusingformeldsinthePostObjectoperation.
YescallbackBodyType-TheContent-Typeheaderinthecallbackrequest.
Validvalues:application/x-www-form-urlencodedandapplication/json.
Defaultvalue:application/x-www-form-urlencoded.
-IfthevalueofcallbackBodyTypeisapplication/x-www-form-urlencoded,variablesincallbackBodyarereplacedbytheencodedURLs.
IfthevalueofcallbackBodyTypeisapplication/json,thevariablesarereplacedinJSONformat.
NoExamplesoftheJSONeldsinacallbackparameterareasfollows:{"callbackUrl":"121.
101.
166.
30/test.
php","callbackHost":"oss-cn-hangzhou.
aliyuncs.
com","callbackBody":"{\"mimeType\":${mimeType},\"size\":${size}}","callbackBodyType":"application/json"}{"callbackUrl":"121.
43.
113.
8:23456/index.
html",Issue:20200320235ObjectStorageServiceAPIReference/7Objectoperations"callbackBody":"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&imageInfo.
height=${imageInfo.
height}&imageInfo.
width=${imageInfo.
width}&imageInfo.
format=${imageInfo.
format}&my_var=${x:my_var}"}ThefollowingtabledescribesthesystemparametersyoucancongureforcallbackBody.
SystemparameterDescriptionbucketThebucketthatcontainstherequestedobject.
objectThenameoftherequestedobject.
etagTheETageldconguredfortheobjectandreturnedtotherequester.
sizeThesizeoftherequestedobject,whichisthetotalsizeoftheentireobjectinCompleteMultipartUploadoperations.
mimeTypeTheresourcetype.
Forexample,theresourcetypeofJPEGimagesisimage/jpeg.
imageInfo.
heightTheheightoftheimage.
imageInfo.
widthThewidthoftheimage.
imageInfo.
formatTheformatoftheimage.
Example:JPGorPNG.
Note:OnlyanimageobjectsupportstheimageInfoparameter.
Iftheobjectisnotanimage,thevaluesofimageInfo.
height,imageInfo.
width,andimageInfo.
formatarenull.
Constructcustomparametersbyusingcallback-var.
Youcancongurecustomparametersbyusingthecallback-varparameter.
Customparametersarekey-valuepairsinMap.
Youcanaddrequiredparameterstothemap.
WhenaPOSTcallbackrequestisinitiated,OSSaddsthesecustomparametersandthesystemparametersdescribedintheprecedingsectionto236Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsthebodyofthePOSTrequest.
Thismethodallowstheseparameterstobeeasilyobtainedbytherequester.
Youcanconstructacustomparameterthewayyouconstructacallbackparameter.
Eachparameterhasakey-valuepair,whichisamapthatconsistsofkey-valuepairsofallcustomparameters.
Note:Thekeyofacustomparametermuststartwithx:andbeinlowercaseletters.
Otherwise,OSSreturnsanerror.
Assumethatyouneedtoconguretwocustomparametersx:var1andx:var2.
Thevalueofx:var1isvalue1.
Thevalueofx:var2isvalue2.
TheconstructedJSONstringisasfollows:{"x:var1":"value1","x:var2":"value2"}Note:Iftheinputcallbackparameterorcallback-varparameterisinvalid,HTTPstatuscode400isreturnedwiththeInvalidArgumenterrorcode.
Thiserroroccursinthefollowingscenarios:URLsandheadersarepassedinatthesametimetothecallbackparameter(x-oss-callback)orthecallback-varparameter(x-oss-callback-var)inPutObjectandCompleteMultipartUploadoperations.
Thesizeofthecallbackorcallback-varparameterexceeds5KB.
ThisdoesnotoccurinPostObjectoperationsbecausethecallback-varparameterisnotavailableinPostObjectoperations.
Thecallbackorcallback-varparameterisnotBase64-encodedorisnotinthevalidJSONformatafterbeingdecoded.
ThecallbackUrlelddecodedfromthecallbackparameterincludesmorethanveURLs,ortheportintheURLisinvalid.
Example:{"callbackUrl":"10.
101.
166.
30:test","callbackBody":"test"}ThecallbackBodyelddecodedfromthecallbackparameterisnull.
Issue:20200320237ObjectStorageServiceAPIReference/7ObjectoperationsThevalueofthecallbackBodyTypeelddecodedfromthecallbackparameterisnotapplication/x-www-form-urlencodedorapplication/json.
ThevariablesinthecallbackBodyelddecodedfromthecallbackparameterarenotinthevalidformatof${var}.
ThevariablesinthecallbackBodyelddecodedfromthecallback-varparameterarenotintheexpectedJSONformatof{"x:var1":"value1","x:var2":"value2".
.
.
}.
Step2:ConstructacallbackrequestAfteryouconstructthecallbackandcallback-varparameters,youmustaddtheparameterstothecallbackrequestsenttoOSS.
Youcanusethefollowingmethodstoaddparameters:AddtheparameterstotheURL.
Addtheparameterstotheheader.
AddtheparameterstotheformeldsinthebodyofaPOSTrequest.
Note:YoucanuseonlythismethodtospecifycallbackparameterswhenyouuploadobjectsbyusingPOSTrequests.
Youcanonlyuseoneoftheprecedingthreemethodsatatime.
Ifyouusemorethanonemethod,OSSreturnstheInvalidArgumenterrorcode.
ToaddtheparameterstoarequestsenttoOSS,youmustuseBase64toencodetheJSONstringconstructedintheprecedingsection,andthenaddtheparametersasfollows:ToaddtheparameterstotheURL,addcallback=[CallBack]orcallback-var=[CallBackVar]totherequestasaURLparameter.
WhentheCanonicalizedResourceeldinthesignatureiscalculated,callbackorcallback-varisusedasasubresource.
Toaddtheparameterstotheheader,addx-oss-callback=[CallBack]orx-oss-callback-var=[CallBackVar]totherequestasaheader.
WhentheCanonicalizedOSSHeaderseldinthesignatureiscalculated,includex-oss-callback-varandx-oss-callback.
Examples:PUT/test.
txtHTTP/1.
1Host:callback-test.
oss-test.
aliyun-inc.
com238Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsAccept-ncoding:identityContent-Length:5x-oss-callback-var:eyJ4Om15X3ZhciI6ImZvci1jYWxsYmFjay10ZXN0In0=User-Agent:aliyun-sdk-python/0.
4.
0(Linux/2.
6.
32-220.
23.
2.
ali1089.
el5.
x86_64/x86_64;2.
5.
4)x-oss-callback:eyJjYWxsYmFja1VybCI6IjEyMS40My4xMTMuODoyMzQ1Ni9pbmRleC5odG1sIiwgICJjYWxsYmFja0JvZHkiOiJidWNrZXQ9JHtidWNrZXR9Jm9iamVjdD0ke29iamVjdH0mZXRhZz0ke2V0YWd9JnNpemU9JHtzaXplfSZtaW1lVHlwZT0ke21pbWVUeXBlfSZpbWFnZUluZm8uaGVpZ2h0PSR7aW1hZ2VJbmZvLmhlaWdodH0maW1hZ2VJbmZvLndpZHRoPSR7aW1hZ2VJbmZvLndpZHRofSZpbWFnZUluZm8uZm9ybWF0PSR7aW1hZ2VJbmZvLmZvcm1hdH0mbXlfdmFyPSR7eDpteV92YXJ9In0=Host:callback-test.
oss-test.
aliyun-inc.
comExpect:100-ContinueDate:Mon,14Sep201512:37:27GMTContent-Type:text/plainAuthorization:OSSmlepou3zr4u7b14:5a74vhd4UXpmyuudV14Kaen5****TestAddtheparameterstotheformeldsinthebodyofaPOSTrequest.
-ItisslightlycomplicatedtoaddthecallbackparameterwhenthePOSTmethodisusedtouploadanobjectbecausethecallbackparametermustbeaddedbyusingaseparateformeld.
Example:--9431149156168Content-Disposition:form-data;name="callback"eyJjYWxsYmFja1VybCI6IjEwLjEwMS4xNjYuMzA6ODA4My9jYWxsYmFjay5waHAiLCJjYWxsYmFja0hvc3QiOiIxMC4xMDEuMTY2LjMwIiwiY2FsbGJhY2tCb2R5IjoiZmlsZW5hbWU9JChmaWxlbmFtZSkmdGFibGU9JHt4OnRhYmxlfSIsImNhbGxiYWNrQm9keVR5cGUiOiJhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQifQ==-Eachcustomparameterusesaseparateformeld.
Youcannotaddthecallback-varparametertoexistingelds.
Forexample,iftheJSONstringforthecustomparameterisasfollows:{"x:var1":"value1","x:var2":"value2"}TheformeldsinthePOSTrequestareasfollows:--9431149156168Content-Disposition:form-data;name="callback"eyJjYWxsYmFja1VybCI6IjEwLjEwMS4xNjYuMzA6ODA4My9jYWxsYmFjay5waHAiLCJjYWxsYmFja0hvc3QiOiIxMC4xMDEuMTY2LjMwIiwiY2FsbGJhY2tCb2R5IjoiZmlsZW5hbWU9JChmaWxlbmFtZSkmdGFibGU9JHt4OnRhYmxlfSIsImNhbGxiYWNrQm9keVR5cGUiOiJhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQifQ==--9431149156168Content-Disposition:form-data;name="x:var1"value1--9431149156168Content-Disposition:form-data;name="x:var2"Issue:20200320239ObjectStorageServiceAPIReference/7Objectoperationsvalue2Youcanalsoaddcallbackconditionsinthepolicy(ifcallbackparametersarenotadded,uploadvericationisnotperformedonpolicy).
Example:{"expiration":"2014-12-01T12:00:00.
000Z","conditions":[{"bucket":"johnsmith"},{"callback":"eyJjYWxsYmFja1VybCI6IjEwLjEwMS4xNjYuMzA6ODA4My9jYWxsYmFjay5waHAiLCJjYWxsYmFja0hvc3QiOiIxMC4xMDEuMTY2LjMwIiwiY2FsbGJhY2tCb2R5IjoiZmlsZW5hbWU9JChmaWxlbmFtZSkiLCJjYWxsYmFja0JvZHlUeXBlIjoiYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkIn0="},["starts-with","$key","user/eric/"],]}Step3:InitiateacallbackrequestIfanobjectisuploaded,OSSsendsthecontentspeciedbythecallbackandcallback-varparametersintherequesttotheapplicationserverbyusingthePOSTmethod.
Example:POST/index.
htmlHTTP/1.
0Host:121.
43.
113.
8Connection:closeContent-Length:181Content-Type:application/x-www-form-urlencodedUser-Agent:http-client/0.
0.
1bucket=callback-test&object=test.
txt&etag=D8E8FCA2DC0F896FD7CB4CB0031BA249&size=5&mimeType=text%2Fplain&imageInfo.
height=&imageInfo.
width=&imageInfo.
format=&x:var1=for-callback-testStep4(optional):SignthecallbackrequestIfthecallbackparameterisconguredintherequest,OSSusesPOSTtosendacallbackrequesttotheapplicationserverbasedonthespeciedcallbackURL.
ToverifywhetherthecallbackrequestreceivedbytheapplicationserverisinitiatedbyOSS,youcansignthecallbackrequest.
Generateasignature.
AcallbackrequestissignedbyOSSbyusingtheRSAasymmetricalgorithm.
Togenerateasignature,encryptthecallbackstringwithaprivatekey.
Example:authorization=base64_encode(rsa_sign(private_key,url_decode(path)+query_string+'\n'+body,md5))Note:240Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsIntheprecedingcode,private_keyisaprivatekeyonlyknownbyOSS,pathistheresourcepathincludedinthecallbackrequest,query_stringisthequerystring,andbodyisthemessagebodyspeciedinthecallbackrequest.
Acallbackrequestissignedinthefollowingsteps:1.
Obtainthecallbackstringtosign,whichconsistsoftheresourcepaththatisobtainedbydecodingtheURL,theoriginalquerystring,acarriagereturn,andthecallbackmessagebody.
2.
SignthecallbackstringbyusingtheRSAencryptionalgorithm.
Usetheprivatekeytoencryptthesignaturestring.
ThehashfunctionusedforthesignatureisMD5.
3.
UseBase64toencodethesignedresulttoobtainthenalsignatureandaddthesignaturetotheAuthorizationheaderinthecallbackrequest.
Example:POST/index.
phpid=1&index=2HTTP/1.
0Host:121.
43.
113.
8Connection:closeContent-Length:18authorization:kKQeGTRccDKyHB3H9vF+xYMSrmhMZjzzl2/kdD1ktNVgbWEfYTQG0G2SU/RaHBovRCE8OkQDjC3uG33esH2t****Content-Type:application/x-www-form-urlencodedUser-Agent:http-client/0.
0.
1x-oss-pub-key-url:aHR0cDovL2dvc3NwdWJsaWMuYWxpY2RuLmNvbS9jYWxsYmFja19wdWJfa2V5X3YxLnBlbQ==bucket=yonghu-testIntheprecedingcode,pathissetto/index.
php,query_stringissettoid=1&index=2,thebodyissettobucket=yonghu-test.
ThenalsignatureiskKQeGTRccDKyHB3H9vF+xYMSrmhMZjzzl2/kdD1ktNVgbWEfYTQG0G2SU/RaHBovRCE8OkQDjC3uG33esH2txA==.
Issue:20200320241ObjectStorageServiceAPIReference/7ObjectoperationsVerifythesignature.
Signaturevericationisaninverseprocessofsigningarequest.
Thesignatureisveriedbytheapplicationserverasfollows:Result=rsa_verify(public_key,md5(url_decode(path)+query_string+'\n'+body),base64_decode(authorization))Theeldsintheprecedingcodehavethesamemeaningsastheyareusedtosigntherequest.
public_keyindicatesthepublickeyandauthorizationindicatesthesignatureinthecallbackrequestheader.
Thesignatureisveriedasfollows:1.
Thex-oss-pub-key-urlheaderinthecallbackrequeststorestheBase64-encodedURLofthepublickey.
Therefore,youmustdecodetheBase64-encodedURLtoobtainthepublickey.
public_key=urlopen(base64_decode(x-oss-pub-key-urlheader))Note:242Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsToensurethatthepublickeyisissuedbyOSS,youmustverifywhetherthevalueofthex-oss-pub-key-urlheaderstartswithhttp://gosspublic.
alicdn.
com/orhttps://gosspublic.
alicdn.
com/.
2.
ObtainthesignaturedecodedinBase64.
signature=base64_decode(authorizationheader)3.
Obtainthestringtosignthewaydescribedintheprocessofsigningthecallbackrequest.
sign_str=url_decode(path)+query_string+'\n'+body4.
Verifythesignature.
result=rsa_verify(public_key,md5(sign_str),signature)Theprecedingcodeisusedasanexample:1.
ObtaintheURLofthepublickeybydecodingaHR0cDovL2dvc3NwdWJsaWMuYWxpY2RuLmNvbS9jYWxsYmFja19wdWJfa2V5X3YxLnBlbQ==inBase64.
ThedecodedURLishttp://gosspublic.
alicdn.
com/callback_pub_key_v1.
pem.
2.
DecodesignatureheaderkKQeGTRccDKyHB3H9vF+xYMSrmhMZjzzl2/kdD1ktNVgbWEfYTQG0G2SU/RaHBovRCE8OkQDjC3uG33esH2txA==inBase64.
Thedecodedresultcannotbedisplayedbecauseitisanonprintablestring.
3.
Obtainthestringtosign,whichisurl_decode("index.
php")+"id=1&index=2"+"\n"+"bucket=yonghu-test",andperformMD5vericationonthestring.
4.
Verifythesignature.
ApplicationserverexampleThefollowingPythoncodeshowsyouhowanapplicationserververiesasignature.
Beforeyourunthecode,theM2Cryptolibrarymustbeinstalled.
importhttplibimportbase64importmd5importurllib2fromBaseHTTPServerimportBaseHTTPRequestHandler,HTTPServerfromM2CryptoimportRSAfromM2CryptoimportBIOdefget_local_ip():try:csock=socket.
socket(socket.
AF_INET,socket.
SOCK_DGRAM)csock.
connect(('8.
8.
8.
8',80))(addr,port)=csock.
getsockname()csock.
close()returnaddrexceptsocket.
error:Issue:20200320243ObjectStorageServiceAPIReference/7Objectoperationsreturn""classMyHTTPRequestHandler(BaseHTTPRequestHandler):'''deflog_message(self,format,*args):return'''defdo_POST(self):#getpublickeypub_key_url=''try:pub_key_url_base64=self.
headers['x-oss-pub-key-url']pub_key_url=pub_key_url_base64.
decode('base64')ifnotpub_key_url.
startswith("http://gosspublic.
alicdn.
com/")andnotpub_key_url.
startswith("https://gosspublic.
alicdn.
com/"):self.
send_response(400)self.
end_headers()returnurl_reader=urllib2.
urlopen(pub_key_url)#youcancacheitpub_key=url_reader.
read()except:print'pub_key_url:'+pub_key_urlprint'Getpubkeyfailed!
'self.
send_response(400)self.
end_headers()return#getauthorizationauthorization_base64=self.
headers['authorization']authorization=authorization_base64.
decode('base64')#getcallbackbodycontent_length=self.
headers['content-length']callback_body=self.
rfile.
read(int(content_length))#composeauthorizationstringauth_str=''pos=self.
path.
find('')if-1==pos:auth_str=urllib2.
unquote(self.
path)+'\n'+callback_bodyelse:auth_str=urllib2.
unquote(self.
path[0:pos])+self.
path[pos:]+'\n'+callback_bodyprintauth_str#verifyauthorizationauth_md5=md5.
new(auth_str).
digest()bio=BIO.
MemoryBuffer(pub_key)rsa_pub=RSA.
load_pub_key_bio(bio)try:result=rsa_pub.
verify(auth_md5,authorization,'md5')except:result=Falseifnotresult:print'Authorizationverifyfailed!
'print'Publickey:%s'%(pub_key)print'Authstring:%s'%(auth_str)self.
send_response(400)self.
end_headers()return#dosomethingaccordingtocallback_body#responsetoOSSresp_body='{"Status":"OK"}'self.
send_response(200)self.
send_header('Content-Type','application/json')self.
send_header('Content-Length',str(len(resp_body)))244Issue:20200320ObjectStorageServiceAPIReference/7Objectoperationsself.
end_headers()self.
wfile.
write(resp_body)classMyHTTPServer(HTTPServer):def__init__(self,host,port):HTTPServer.
__init__(self,(host,port),MyHTTPRequestHandler)if'__main_name__:server_ip=get_local_ip()server_port=23451server=MyHTTPServer(server_ip,server_port)server.
serve_forever()Thecodefortheserverinotherprogramminglanguagesisasfollows:Java:-Clickheretodownloadthecode.
-Runningmethod:Decompressthepackageandrunjava-jaross-callback-server-demo.
jar9000.
9000istheportnumberandcanbespeciedasneeded.
PHP:-Clickheretodownloadthecode.
-Runningmethod:DeploythecodetoanApacheenvironmentbecausesomeheadersinthePHPcodedependontheenvironment.
Youcanmodifytheexamplecodebasedontheenvironment.
Python:-Clickheretodownloadthecode.
-Runningmethod:Decompressthepackageandrunpythoncallback_app_server.
py.
Beforeyourunthecode,RSAdependenciesmustbeinstalled.
.
NET:-Clickheretodownloadthecode.
-Runningmethod:DecompressthepackageandfollowREADME.
md.
Go:-Clickheretodownloadthecode.
-Runningmethod:DecompressthepackageandfollowREADME.
md.
Ruby:-Clickheretodownloadthecode.
-Runningmethod:Runtherubyaliyun_oss_callback_server.
rbcommand.
Issue:20200320245ObjectStorageServiceAPIReference/7ObjectoperationsStep5:ReturnthecallbackresultTheapplicationserverreturnstheresponsetoOSS.
Theresponsetothecallbackrequestisasfollows:HTTP/1.
0200OKServer:BaseHTTP/0.
3Python/2.
7.
6Date:Mon,14Sep201512:37:27GMTContent-Type:application/jsonContent-Length:9{"a":"b"}Note:TheresponsereturnedbytheapplicationservertoOSSmustcontaintheContent-Lengthheader.
Thesizeoftheresponsebodycannotexceed1MB.
Step6:ReturntheuploadresultOSSreturnstheinformationthatisreturnedbytheapplicationservertotheuser.
Anexampleofthereturnedresponseisasfollows:HTTP/1.
1200OKDate:Mon,14Sep201512:37:27GMTContent-Type:application/jsonContent-Length:9Connection:keep-aliveETag:"D8E8FCA2DC0F896FD7CB4CB0031BA249"Server:AliyunOSSx-oss-bucket-version:1442231779x-oss-request-id:55F6BF87207FB30F2640C548{"a":"b"}Note:ThebodyofresponsesforsomerequestssuchasCompleteMultipartUploadcontainscontent,suchasinformationinXMLformat.
Ifyouusetheuploadcallbackfunction,theoriginalbodycontentisoverwrittensuchas{"a":"b"}.
Exercisecautionwhenyouimplementuploadcallback.
Iftheuploadcallbackfails,HTTPstatuscode203isreturnedwitherrorcodeCallbackFailed.
ThisresponseindicatesthattheobjectissuccessfullyuploadedtoOSS,butthecallbackfails.
AcallbackfailureonlyindicatesthatOSSdoesnotreceivetheexpectedcallbackresponse.
Itdoesnotindicatethattheapplicationserverdoesnotreceiveacallbackrequest.
Forexample,acallbackfailurewilloccuriftheresponsereturnedbytheapplicationserverisnotinJSONformat.
246Issue:20200320ObjectStorageServiceAPIReference/7Objectoperations7.
13PutSymlinkCreatesasymbollinkdirectingtothetargetobject.
Youcanusethesymbollinktoaccessthetargetobject.
Note:Whenasymboliclinkiscreated,thefollowingchecksarenotperformed:-Whetherthetargetobjectexists.
-Whetherthestorageclassofthetargetobjectisvalid.
-Whethertheuserhaspermissiontoaccessthetargetobject.
ThesechecksareperformedbyAPIsthataccessthetargetobject,suchasGetObject.
Iftheobjectthatyouwanttoaddalreadyexistsandyoucanaccesstheobject,theexistingobjectisoverwrittenbytheaddedobjectanda200OKmessageisreturned.
IfaPutSymlinkrequestcarriesaparameterwiththex-oss-meta-prex,theparameterisconsideredasusermeta,suchasx-oss-meta-location.
Anobjectcanhavemultipleparameterswiththex-oss-meta-prex.
However,thetotalsizeofallusermetacannotexceed8KB.
VersioningYoucandirectasymbollinktothecurrentversionofthetargetobject.
Asymbollinkcanhasmultipleversionsthatdirecttodierenttargetobjects.
TheversionIDofthesymbollinkisautomaticallygeneratedandisreturnedasx-oss-version-idintheresponseheader.
RequestsyntaxPUT/ObjectNamesymlinkHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueIssue:20200320247ObjectStorageServiceAPIReference/7Objectoperationsx-oss-symlink-target:TargetObjectNameRequestheadersHeaderTypeRequiredDescriptionx-oss-symlink-targetStringYesIndicatesthetargetobjectthatthesymboliclinkdirectsto.
Validvalue:Thenamingconventionsarethesameasthoseforobjects.
Note:SimilartoObjectName,TargetObjectNamemustbeURL-encoded.
Thetargetobjectthatasymboliclinkdirectstocannotbeasymboliclink.
248Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsHeaderTypeRequiredDescriptionx-oss-storage-classStringNoSpeciesthestorageclassofthetargetobject.
Validvalues:StandardIAArchiveSupportedAPIs:PutObject,InitMultipartUpload,AppendObject,PutObjectSymlink,andCopyObjectNote:WerecommendthatyoudonotsetthestorageclassinPutObjectSymlinktoIAorArchivebecauseanIAorArchiveobjectsmallerthan64KBisbilledat64KB.
Ifyouspecifythevalueofx-oss-storage-classwhenuploadinganobjecttoabucket,thestorageclassoftheuploadedobjectisthespeciedvalueofx-oss-storage-classregardlessofthestorageclassofthebucket.
Forexample,ifyouspecifythevalueofx-oss-storage-classtoStandardwhenuploadinganobjecttoabucketoftheIAstorageclass,thestorageclassoftheobjectisStandard.
ExamplesNormalRequestexample:PUT/link-to-oss.
jpgsymlinkHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comCache-control:no-cacheContent-Disposition:attachment;filename=oss_download.
jpgIssue:20200320249ObjectStorageServiceAPIReference/7ObjectoperationsDate:Tue,08Nov201602:00:25GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:kZoYNv66bsmc10+dcGKw5x2****=x-oss-symlink-target:oss****x-oss-storage-class:StandardResponseexample:HTTP/1.
1200OKServer:AliyunOSSDate:Tue,08Nov201602:00:25GMTContent-Length:0Connection:keep-alivex-oss-request-id:582131B9109F4EE66CDE56A5ETag:"0A477B89B4602AA8DECB8E19BFD4****"Exampleofarequestinitiatedtocreateasymbollinkthatdirectstoaspeciedversionofthetargetobject:PUT/link-to-oss.
jpgsymlinkHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,09Apr201906:50:48GMTAuthorization:OSSo3shiyktjw16xw1:NVXXKiyUJ2tg07PxINinU0eO****x-oss-symlink-target:oss.
jpgResponseexample:HTTP/1.
1200OKServer:AliyunOSSDate:Tue,09Apr201906:50:48GMTContent-Length:0Connection:keep-alivex-oss-version-id:CAEQNRiBgMClj7qD0BYiIDQ5Y2QyMjc3NGZkODRlMTU5M2VkY2U3MWRiNGRh****x-oss-request-id:5CAC40C8B7AEADE01700064BETag:"136A5E127272200EDAB170DD84DE****"SDKTheSDKsofthisAPIareasfollows:JavaPythonPHPGoC.
NET250Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsErrorcodesErrorcodeHTTPstatuscodeDescriptionInvalidArgument400Thevalueofx-oss-storage-classisinvalid.
7.
14GetSymlinkObtainsasymbollink.
ToperformGetSymlinkoperations,youmusthavethereadpermissiononthesymbollink.
VersioningGetSymlinkobtainsthecurrentversionofthetargetsymbollinkbydefault.
YoucanspecifytheversionIdintherequesttoobtainthespeciedversionofasymbollink.
Ifthecurrentversionofthetargetsymbollinkisadeletemarker,OSSreturnsthe404NotFounderrorandincludesx-oss-delete-marker=trueandx-oss-version-idintheresponseheader.
Adeletemarkerdoesnotcontainanydata.
Therefore,theinformationaboutthetargetobjectthatthesymbollinkdirectstoisnotincludedintheresponse.
RequestsyntaxGET/ObjectNamesymlinkHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueResponseheadersHeaderTypeDescriptionx-oss-symlink-targetStringIndicatesthetargetobjectthatthesymbollinkdirectsto.
ExamplesNormalrequestexample:GET/link-to-oss.
jpgsymlinkHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Fri,24Feb201206:38:30GMTIssue:20200320251ObjectStorageServiceAPIReference/7ObjectoperationsAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:UNQDb7GapEgJCZkcde6OhZ9J****Responseexample:HTTP/1.
1200OKServer:AliyunOSSDate:Fri,24Feb201206:38:30GMTLast-Modified:Fri,24Feb201206:07:48GMTContent-Length:0Connection:keep-alivex-oss-request-id:5650BD72207FB30443962F9Ax-oss-symlink-target:oss.
jpgETag:"A797938C31D59EDD08D86188F6D5****"ExampleofarequestinitiatedwithaspeciedversionIdtoobtainthespeciedversionofasymbollink:GET/link-to-oss.
jpgsymlink&versionId=CAEQNRiBgMClj7qD0BYiIDQ5Y2QyMjc3NGZkODRlMTU5M2VkY2U3MWRiNGRh****HTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,09Apr201906:50:48GMTAuthorization:OSSo3shiyktjw16xw1:LFKjDsA81MCTcBKV6h+Z/95f****Responseexample:HTTP/1.
1200OKServer:AliyunOSSDate:Tue,09Apr201906:50:48GMTLast-Modified:Tue,09Apr201906:50:48GMTContent-Length:0Connection:keep-alivex-oss-version-id:CAEQNRiBgMClj7qD0BYiIDQ5Y2QyMjc3NGZkODRlMTU5M2VkY2U3MWRiNGRh****x-oss-request-id:5CAC40C8B7AEADE01700064Dx-oss-symlink-target:oss.
jpgETag:"40CF4D450730DCCD1A78566FAE35****"SDKTheSDKsofthisAPIareasfollows:JavaPythonPHPGoC.
NET252Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsErrorcodesErrorcodeHTTPstatuscodeDescriptionNoSuchKey404Therequestedsymbollinkdoesnotexist.
7.
15RestoreObjectRestoresanobjectoftheArchivestorageclass.
VersioningThestorageclassofeachversionofanobjectcanbedierent.
RestoreObjectrestoresthecurrentversionofthetargetobjectbydefault.
YoucanspecifytheversionIdintherequesttorestorethespeciedversionoftheobject.
Note:RestoreObjectonlyappliestoobjectsoftheArchivestorageclassbutnotthoseoftheStandardandIAstorageclasses.
A202statuscodeisreturnedifyoucallRestoreObjecttorestoreanobjectforthersttime.
IfyouhaverestoredanobjectbycallingRestoreObject,a200OKmessageisreturnedifyoucalltheAPIagain.
RestoreprocessAnobjectoftheArchivestorageclassisrestoredasfollows:1.
Theobjectisinthefrozenstatus.
2.
Afteryouinitiatearestorerequest,theobjectisintherestoringstate.
Itgenerallytakes1minutefortheobjecttoberestored.
However,themaximumtimeperiodrequiredtorestoreanobjectis4hours.
3.
Aftertherestoretasksisnished,theobjectisintherestoredstatefor24hoursbydefault.
Duringthisperiod,youcanreadtheobject.
IfyoucallRestoreObjectagainduringthisperiod,therestorestateoftheobjectprolongsfor24hours.
Therestoredperiodcanbeprolongedtoamaximumof7days.
4.
Aftertherestoredperiod,theobjectreturnstothefrozenstate.
Issue:20200320253ObjectStorageServiceAPIReference/7ObjectoperationsBillingmethodsThefollowingfeesareincurredwhenthestatusofanobjectischanged:Dataretrievalfeesareincurredifyourestoreanarchivedobject.
Therestoredstateofanobjectcanbeprolongedtoamaximumofsevendays.
Nofeesareincurredduringthisperiod.
Afterarestoredobjectreturnstothefrozenstate,dataretrievalfeesareincurredifyourestoreitagain.
RequestsyntaxPOST/ObjectNamerestoreHTTP/1.
1Host:archive-bucket.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueExamplesExampleofrequestinitiatedtorestoreaarchivedobjectforthersttime:POST/oss.
jpgrestoreHTTP/1.
1Host:oss-archive-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Sat,15Apr201707:45:28GMTAuthorization:OSSe1Unnbm1rgdnpI:y4eyu+4yje5ioRCr****ResponseexampleHTTP/1.
1202AcceptedDate:Sat,15Apr201707:45:28GMTContent-Length:0Connection:keep-aliveServer:AliyunOSSx-oss-request-id:5374A2880232A65C23002D74Exampleofarequestinitiatedtorestoreanobjectbeingrestored:POST/oss.
jpgrestoreHTTP/1.
1Host:oss-archive-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Sat,15Apr201707:45:29GMTAuthorization:OSSe1Unnbm1rgdnpI:21qtGJ+ykDVmdy4eyu+N****ResponseexampleHTTP/1.
1409ConflictDate:Sat,15Apr201707:45:29GMTContent-Length:556Connection:keep-aliveServer:AliyunOSSx-oss-request-id:5374A2880232A65C23002D74RestoreAlreadyInProgressTherestoreoperationisinprogress.
254Issue:20200320ObjectStorageServiceAPIReference/7Objectoperations58EAF141461FB42C2B00000810.
101.
200.
***Exampleofarequestinitiatedtorestorearestoredobject:POST/oss.
jpgrestoreHTTP/1.
1Host:oss-archive-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Sat,15Apr201707:45:29GMTAuthorization:OSSe1Unnbm1rgdnpI:u6O6FMJnn+WuBwbByZxm1+y4eyu+N****ResponseexampleHTTP/1.
1200OkDate:Sat,15Apr201707:45:30GMTContent-Length:0Connection:keep-aliveServer:AliyunOSSx-oss-request-id:5374A2880232A65C23002D74ExampleofarequestinitiatedwithaspeciedversionIdtorestorethespeciedversionofanobject:POST/oss.
jpgrestore&versionId=CAEQNRiBgMClj7qD0BYiIDQ5Y2QyMjc3NGZkODRlMTU5M2VkY2U3MWRiNGRh****HTTP/1.
1Host:oss-archive-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,09Apr201906:50:48GMTAuthorization:OSSo3shiyktjw16xw1:2JND5qqlAlaA1/kLO4kBbGTw****ResponseexampleHTTP/1.
1202AcceptedDate:Tue,09Apr201906:50:48GMTContent-Length:0Connection:keep-aliveServer:AliyunOSSx-oss-version-id:CAEQNRiBgMClj7qD0BYiIDQ5Y2QyMjc3NGZkODRlMTU5M2VkY2U3MWRiNGRh****x-oss-request-id:5CAC40C8B7AEADE017000653SDKTheSDKsofthisAPIareasfollows:JavaPythonPHPGoC.
NETIssue:20200320255ObjectStorageServiceAPIReference/7ObjectoperationsErrorcodesErrorcodeHTTPstatuscodeDescriptionNoSuchKey404Therequestedobjectdoesnotexist.
OperationNotSupported400ThestorageclassoftherequestedobjectisnotArchive.
RestoreAlreadyInProgress409YouhavecalledRestoreObjectsuccessfullyandtheobjectisbeingrestored.
DonotinitiateRestoreObjectrequestsrepeatedly.
7.
16SelectObjectYoucancallthisoperationtoexecutetheSQLstatementonthetargetobjectandobtainthequeryresult.
Note:Youmusthavethereadpermissionsontheobject.
HTTPstatuscode206isreturnediftheoperationissuccessfullyperformed.
IftheSQLstatementsarenotvalidorcannotmatchanyobjects,HTTPstatuscode400isreturned.
FormoreinformationaboutthefunctionsofSelectObject,seeSelectObjectinOSSDeveloperGuide.
RequestsyntaxRequestsyntaxforeitherCSVorJSONobjects.
RequestsyntaxforCSVobjectsPOST/objectx-oss-process=csv/selectHTTP/1.
1HOST:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:timeGMTContent-Length:ContentLengthContent-MD5:MD5ValueAuthorization:Signaturebase64encode(Select*fromOSSObjectwhere.
.
.
)None|GZIPNONE|IGNORE|USE256Issue:20200320ObjectStorageServiceAPIReference/7Objectoperationsbase64encodebase64encodebase64encodebase64encodeline-range=start-end|split-range=start-endtrue|falsebase64encodebase64encodefalse|truefalse|truetruefalsefalsemaxallowednumberofrecordsskippedRequestsyntaxforJSONobjectsPOST/objectx-oss-process=json/selectHTTP/1.
1HOST:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:timeGMTContent-Length:ContentLengthContent-MD5:MD5ValueAuthorization:SignatureBase64encodeofsqlsuchas(select*fromossobject)None|GZIPDOCUMENT|LINESline-range=start-end|split-range=start-endtrue|falseBase64ofrecorddelimiterfalse|truetrueIssue:20200320257ObjectStorageServiceAPIReference/7Objectoperationsfalse|truemaxallowednumberofrecordsskippedRequestelementsElementTypeDescriptionSelectRequestContainerSpeciesthecontainerthatstorestheSelectObjectrequest.
Childnode:Expression,InputSerialization,andOutputSerializationParentnode:noneExpressionStringTheBase64-encodedSQLstatement.
Childnode:noneParentnode:SelectRequestInputSerializationContainerOptional.
Thiselementspeciestheinputserializationparameters.
Childnode:CompressionType,CSV,andJSONParentnode:SelectRequestOutputSerializationContainerOptional.
Thiselementspeciestheoutputserializationparameters.
Childnode:CSV,JSON,andOutputRawDataParentnode:SelectRequest258Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsElementTypeDescriptionCSV(InputSerialization)ContainerOptional.
ThiselementspeciestheinputserializationparameterswhentheCSVobjectisqueried.
Childnode:FileHeaderInfo,RecordDelimiter,FieldDelimiter,QuoteCharacter,CommentCharacter,andRangeParentnode:InputSerializationCSV(OutputSerialization)ContainerOptional.
ThiselementspeciestheoutputserializationparameterswhentheCSVobjectisqueried.
Childnode:RecordDelimiterandFieldDelimiterParentnode:OutputSerializationJSON(InputSerialization)ContainerOptional.
ThiselementspeciestheinputserializationparameterswhentheJSONobjectisqueried.
Childnode:Type,Range,andParseJsonNumberAsStringJSON(OutputSerialization)ContainerOptional.
ThiselementspeciestheoutputserializationparameterswhentheJSONobjectisqueried.
Childnode:RecordDelimiterTypeEnumerationSpeciesthetypeoftheinputJSONobject:DOCUMENTorLINES.
Issue:20200320259ObjectStorageServiceAPIReference/7ObjectoperationsElementTypeDescriptionOutputRawDataBoolean(falsebydefault)Optional.
Thiselementspeciestheoutputdataasrawdata.
Childnode:noneParentnode:OutputSerializationNote:IfOutputRawDataisspeciedintherequest,OSSreturnsdataaccordingly.
IfOutputRawDataisnotspeciedintherequest,OSSautomaticallyselectsaformatandreturnsitintheresponse.
IfOutputRawDataissettoTrueandtheSQLstatementtakesalongtimetoreturndata,theHTTPrequestmaytimeout.
CompressionTypeEnumerationSpeciesthecompressiontypeoftheobject:None|GZIP.
Childnode:noneParentnode:InputSerialization260Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsElementTypeDescriptionFileHeaderInfoEnumerationOptional.
ThiselementspeciestheheaderinformationoftheCSVobject.
Validvalues:Use:indicatesthattheCSVobjectcontainsheaderinformation.
YoucanusethecolumnnameintheCSVobjectasthecolumnnameintheSelectObjectoperation.
Ignore:indicatesthattheCSVobjectcontainsheaderinformation.
However,youcannotusethecolumnnameintheCSVobjectasthecolumnnameintheSelectObjectoperation.
None:thedefaultvalue,indicatingthattheCSVobjectdoesnotcontainheaderinformation.
Childnode:noneParentnode:CSV(input)RecordDelimiterStringOptional.
ThiselementspeciesaBase64-encodeddelimiter.
Defaultvalue:\n.
ThevalueofthiselementbeforebeingencodedcanbeanANSIvalueofuptotwocharactersinlength.
Forexample,\nisusedtoindicatealinebreakinJavacode.
Childnode:noneParentnode:CSV(inputandoutput)andJSON(output)Issue:20200320261ObjectStorageServiceAPIReference/7ObjectoperationsElementTypeDescriptionFieldDelimiterStringOptional.
ThiselementspeciesaBase64-encodeddelimiterusedtoseparatecolumnsintheCSVobject.
Defaultvalue:,.
Thevalueofthiselementbeforebeingencodedmustbeaone-characterANSIvalue.
Forexample,,isusedtoindicateacommainJavacode.
Childnode:noneParentnode:CSV(inputandoutput)QuoteCharacterStringOptional.
ThiselementspeciesaBase64-encodedquotecharacterusedintheCSVobject.
Defaultvalue:\".
InaCSVobject,linebreaksandcolumndelimitersenclosedinquotationmarksareprocessedasnormalcharacters.
Thevalueofthiselementbeforebeingencodedmustbeaone-characterANSIvalue.
Forexample,\"isusedtoindicateaquotecharacterinJavacode.
Childnode:noneParentnode:CSV(input)CommentCharacterStringSpeciesthecommentcharacterusedintheCSVobject.
ThevalueofthiselementmustbeBase64-encoded.
Thedefaultvalueisnull.
262Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsElementTypeDescriptionRangeStringOptional.
Thiselementspeciesthequeryrange.
Thefollowingtwoquerymethodsaresupported:Note:SelectMetamustbecreatedforobjectsthatarequeriedbasedonRange.
FormoreinformationaboutSelectMeta,see#unique_220.
Querybyrow:line-range=start-end.
Forexample,line-range=10-20indicatesthatrows10to20willbescanned.
Querybysplit:split-range=start-end.
Forexample,split-range=10-20indicatesthatsplits10to20willbescanned.
Thestartandendparametersoftheprecedingfunctionsarebothinclusive.
Thetwoprecedingparametershavethesameformatasthatoftherangeparameterintherangegetfunction.
ThisparametercanonlybeusedwhentheobjectisinCSVformatorwhentheJSONTypeisLINES.
Childnode:noneParentnode:CSV(input)andJSON(output)Issue:20200320263ObjectStorageServiceAPIReference/7ObjectoperationsElementTypeDescriptionKeepAllColumnsBooleanOptional.
AvalueoftrueindicatesthatallcolumnsintheCSVobjectareincludedinthereturnedresult.
Thedefaultvalueisfalse.
However,onlycolumnsincludedintheSELECTclausehavevalues.
Thecolumnsinthereturnedresultaresortedinascendingorderofthecolumnnumbers.
Forexample:select_5,_1fromossobject.
IfyousetKeepAllColumntotrueandsixcolumnsareincludedintheCSVobject,thefollowingresultisreturnedfortheprecedingSELECTclause:Valueof1stcolumn,,,,Valueof5thcolumn,\nChildnode:noneParentnode:OutputSerialization(CSV)EnablePayloadCrcBooleanIndicatesthateachframeincludesaCRC-32valueforverication.
TheclientcancalculatetheCRC-32valueofeachpayloadandcompareitwiththeincludedCRC-32valuetoverifydataintegrity.
Childnode:noneParentnode:OutputSerialization264Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsElementTypeDescriptionOptionsContainerSpeciesotheroptionalparameters.
Type:containerChildnode:SkipPartialDataRecordandMaxSkippedRecordsAllowedParentnode:SelectRequestOutputHeaderBooleanAvalueoftrueindicatesthattheheaderinformationoftheCSVobjectisincludedinthebeginningofthereturnedresult.
Type:Boolean.
Defaultvalue:false.
Childnode:noneParentnode:OutputSerializationSkipPartialDataRecordBooleanSpecieswhethertoignorerowswithoutdata.
Ifthisparameterissettofalse,OSSwillprocesstherowdataasnullwithoutreportingerrors.
Ifthisparameterissettotrue,rowswithoutdataareskipped.
Ifthenumberofskippedrowshasexceededthemaximumallowednumber,OSSreportsanerrorandstopsprocessingthedata.
Type:Boolean.
Defaultvalue:false.
Childnode:noneParentnode:OptionsIssue:20200320265ObjectStorageServiceAPIReference/7ObjectoperationsElementTypeDescriptionMaxSkippedRecordsAllowedIntSpeciesthemaximumallowednumberofskippedrows.
IfarowdoesnotmatchthetypespeciedintheSQLstatement,orifoneormorecolumnsinarowaremissingandthevalueofSkipPartialDataRecordisTrue,therowisskipped.
Ifthenumberofskippedrowshasexceededthevalueofthisparameter,OSSreportsanerrorandstopsprocessingthedata.
Note:IfarowinaCSVobjectisnotproperlyformatted,OSSstopsprocessingthedataandreportsanerrorbecausethisformaterrormayresultinincorrectresolutiontotheCSVobject.
Forexample,acolumnintherowincludescontinualoddnumberedquotecharacters.
ThisparametercanbeusedtoadjustthetoleranceforirregulardatabutcannotbeappliedtoinvalidCSVobjects.
Type:int.
Defaultvalue:0.
Childnode:noneParentnode:Options266Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsElementTypeDescriptionParseJsonNumberAsStringBooleanParsesintegerandoating-pointnumbersinaJSONobjectintostrings.
Theprecisionofoating-pointnumbersinaJSONobjectdegradeswhenthenumbersareparsed.
Therefore,werecommendthatyousetthevalueofthisparametertotrueifyouwanttoretaintherawdata.
Tousetheparsednumbersincalculations,youcanusetheCASTfunctioninanSQLstatementtoconverttheparseddataintotherequiredtype,suchasint,double,ordecimal.
Defaultvalue:falseChildnode:noneParentnode:JSONAllowQuotedRecordDelimiterBooleanSpecieswhethertheCSVobjectcontainslinebreaksinquotationmarks(").
Forexample,thevalueofacolumnis"abc\ndef"and\nisalinebreak,youmustsetthisvaluetotrue.
Ifthisparameterissettofalse,SelectObjectallowsyoutospecifyarangeintherequestheaderformoreecientmultipartquery.
Defaultvalue:trueChildnode:noneParentnode:InputSerializationIssue:20200320267ObjectStorageServiceAPIReference/7ObjectoperationsResponsebodyIftheHTTPstatuscodeincludedintheresponseis4xx,itindicatesthattherequesthasnotpassedtheSQLsyntaxcheckorthattherequestcontainserror.
Inthiscase,thebodyformatofthereturnederrormessageisthesameasthatoftheerrormessagereturnedforaGetObjectrequest.
IftheHTTPstatuscodeincludedintheresponseis5xx,itindicatesthatanerroroccursintheserver.
Inthiscase,thebodyformatofthereturnederrormessageisthesameasthatoftheerrormessagereturnedforaGetObjectrequest.
HTTPstatuscode206isreturnedwhentheoperationissuccessfullyperformed.
Inthiscase:-Ifthevalueofheaderx-oss-select-output-rawistrue,itindicatesthattheobjectdata(notincludingframe-baseddata)wassuccessfullyreturned.
TheclientcanobtainthedatainthesamemannerastheGetObjectoperation.
-Ifthevalueofx-oss-select-output-rawisfalse,theresultisreturnedasframes.
AreturnedframeisinVersion|Frame-Type|PayloadLength|HeaderChecksum|Payload|PayloadChecksumAdataframeincludesthedatareturnedfortheSelectObjectrequest.
Theosetparameterisan8-bitintegerthatindicatesthecurrentscanninglocation(theosetfromtheleheader)andisusedtoreporttheprogressoftheoperation.
268Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsFrametypeValuePayloadformatDescriptionContinuousFrame8388612osetAcontinuousframeisusedtoreporttheprogressofanoperationandkeepanHTTPconnection.
Ifnodataisreturnedforaqueryrequestwithin5seconds,acontinuousframeisreturned.
Issue:20200320269ObjectStorageServiceAPIReference/7ObjectoperationsFrametypeValuePayloadformatDescriptionEndFrame8388613oset|totalscannedbytes|httpstatuscode|errormessageAnendframeisusedtoreturnthenalstatusofanoperation,includingthescannedbytesandthepossibleerrormessages.
Theosetparameterindicatesthenallocationosetafterscanning.
Thetotalscannedbytesparameterindicatesthesizeofthescanneddata.
Thehttpstatuscodeparameterindicatesthenalstatusoftheoperation.
Note:SelectObjectisastreamoperation.
Onlytherstdatablockisprocessedwhentheresponseheaderissent.
IftherstdatablockmatchestheSQLstatement,theHTTPstatuscodeintheresponseheaderis206,whichindicatesthattheoperationwassuccessful.
However,thenalstatuscodemaynotbe206becausethesubsequentdatablocksmaybeinvalid.
Thestatuscodeintheresponseheadercannotbemodied.
Therefore,HTTPstatuscodeisincludedintheendframetoindicatethenalstatusoftheoperation.
Theclientusesthestatuscodeincludedintheendframetodeterminewhethertheoperationissuccessful.
Theerrormessageparameterincludeserrormessages,includingthenumberofeachskippedrowandthetotalnumberofskippedrows.
Note:TheformatoferrormessagesincludedinanendframeisErrorCodes.
DetailMessage.
TheErrorCodessectioncontainsoneormoreErrorCodesseparatedbycommas(,).
TheErrorCodesand270Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsSamplerequestsSamplerequestsforeitherCSVorJSONobjects.
SamplerequestforCSVobjectsPOST/oss-select/bigcsv_normal.
csvx-oss-process=csv%2FselectHTTP/1.
1Date:Fri,25May201822:11:39GMTContent-Type:Authorization:OSSLTAIJPLocA0fD:FC/9JRbBGRw4o2QqdaL246Px****User-Agent:aliyun-sdk-dotnet/2.
8.
0.
0(windows16.
7/16.
7.
0.
0/x86;4.
0.
30319.
42000)Content-Length:748Expect:100-continueConnection:keep-aliveHost:hostnamec2VsZWN0IGNvdW50KCopIGZyb20gb3Nzb2JqZWN0IHdoZXJlIF80ID4gNDU=NoneIgnoreCg==LA==Ig==Iw==Cg==LA==Ig==falsefalseSamplerequestforJSONobjectsPOST/oss-select/sample_json.
jsonx-oss-process=json%2FselectHTTP/1.
1Host:hostnameAccept-Encoding:identityUser-Agent:aliyun-sdk-python/2.
6.
0(Darwin/16.
7.
0/x86_64;3.
5.
4)Accept:*/*Connection:keep-alivedate:Mon,10Dec201818:28:11GMTauthorization:OSSAccessKeySignatureContent-Length:317c2VsZWN0ICogZnJvbSBvc3NvYmplY3Qub2JqZWN0c1sqXSB3aGVyZSBwYXJ0eSA9ICdEZW1vY3JhdCc=DOCUMENTIssue:20200320271ObjectStorageServiceAPIReference/7ObjectoperationsLA==RegularexpressionsinanSQLstatementTheregularexpressioninanSQLstatementisSELECTselect-listfromtablewhere_optlimit_opt.
Note:SELECT,OSSOBJECT,andWHEREarekeywordsthatcannotbemodied.
select_list:columnname|columnindex(example:_1,_2.
columnindexappliesonlytoCSVobjects)|jsonpath(example:s.
contacts.
firstname.
jsonpathappliesonlytoJSONobjects)|function(columnindex|columnname)|function(json_path)(appliesonlytoJSONobjects)|select_listASaliasNote:Thefollowingfunctionsaresupported:AVG,SUM,MAX,MIN,COUNT,andCAST(typeconversionfunction).
Youcanuseonlythewildcard(*)afterCOUNT.
table:OSSOBJECT|OSSOBJECTjson_path(appliesonlytoJSONobjects)ForCSVobjects,thetablemustbeOSSOBJECT.
ForJSONobjects(includingDOCUMENTandLINEStypeobjects),youcanspecifyajson_pathafterOSSOBJECT.
json_path:['string'](Thequotationmarksaroundstringcanbedeletedifthestringdoesnotincludeaspaceorawildcard(*).
Inthiscase,['string']isequivalentto.
'string'.
|[n](Usedtoindicatethenthelementinanarray.
Thevalueof0iscountedfrom0.
)|[*](Usedtoindicateanychildelementinanarrayorobject.
)|.
'string'(Thequotationmarksaroundstringcanbedeletedifthestringdoesnotincludeaspaceorawildcard(*).
)272Issue:20200320ObjectStorageServiceAPIReference/7Objectoperations|json_pathjsonpath(Youcanconcatenatemultipleelementsinajsonpath,suchas[n].
property1.
attributes[*].
)Where_opt:|WHEREexprexpr:|literalvalue|columnname|columnindex|jsonpath(appliesonlytoJSONobjects)|expropexpr|exprORexpr|exprANDexpr|exprISNULL|exprISNOTNULL|(columnname|columnindex|jsonpath)IN(value1,value2,.
.
.
)|(columnname|columnindex|jsonpath)NOTin(value1,value2,.
.
.
)|(columnname|columnindex|jsonpath)betweenvalue1andvalue2|NOT(expr)|expropexpr|(expr)|cast(columnindex|columnname|jsonpath|literalasINT|DOUBLE|)op:includesthefollowingoperators:LIKE,and||.
cast:YoucanusetheCASTfunctiontoconvertdatainacolumnfromonetypeintoanother.
Thecombinationofanaggregationfunctionandlimit:Selectavg(cast(_1asint))fromossobjectlimit100.
Theprecedingstatementcalculatestheaveragevaluesoftherstcolumnsintherst100rows.
ThisfunctiondiersfromtheMySQLstatementbecauseonlyasinglerowisreturnedforanaggregationfunctioninSelectObjectoperations.
Thismakesitunnecessarytolimittheoutput.
LimitisperformedbeforeaggregationfunctionsinSelectObjectoperations.
LimitsforSQLstatementsLimitsforSQLstatementsareasfollows:OnlytextobjectsencodedinUTF-8andUTF-8textobjectscompressedinGZIPformataresupported.
ThedeateformatisnotsupportedforGZIPobjects.
AnSQLstatementcanonlyqueryasingleobject.
Thefollowingclausesarenotsupported:JOIN,ORDERBY,GROUPBY,andHAVING.
AWHEREclausecannotincludeaggregationconditions.
Forexample,thefollowingclauseisnotallowed:WHEREmax(cast(ageasint))>100.
Issue:20200320273ObjectStorageServiceAPIReference/7ObjectoperationsAmaximumof1,000columnscanbespeciedforanSQLstatement.
ThecolumnnameinanSQLstatementcanbeupto1,024bytesinlength.
Amaximumofvewildcards(%)aresupportedinaLIKEclause.
Boththepercentsign(%)andtheasterisk(*)arewildcardsthatrepresentzeroormorecharacters.
TheESCAPEkeywordissupportedinSQLLIKEclauses,andisusedtoescapethespecialcharacters,suchaspercentsigns(%),asterisks(*),andquestionmarks(),intonormalstrings.
Amaximumof1,024constantsaresupportedinanINclause.
TheProjectionafterSELECTcanbeacolumnname,aCSVcolumnindex(suchas_1and_2),anaggregationfunction,oraCASTfunction.
Otherexpressionsarenotsupported,suchasselect_1+_2fromossobject.
ThemaximumcolumnsizeandrowsizeforaCSVobjectare256KB.
ThejsonpathafterFROMsupportsaJSONnodewithamaximumsizeof512KB.
Thepathcancontainupto10levels,andanarraycancontainamaximumof5,000elements.
TheeldsafterSELECTandWHEREmustbefromthenodescorrespondingtothejsonpathafterFROM.
InSQLstatementsforaJSONobject,theSELECTorWHEREexpressionscannotincludethearraywildcard([*]).
Thearraywildcard([*])canonlybeincludedinthejsonpathafterFROM.
Forexample,select*fromossobject.
contacts[*]insteadofselects.
contacts[*]fromossobjectsissupported.
ThemaximumsizeofanSQLstatementis16KB.
Amaximumof20expressionscanbeaddedafterWHERE.
Eachstatementsupportsupto10levelsand100aggregationoperations.
DataerrorhandlingThefollowingsectionlistscommonmethodsforhandlingdataerrors.
SomecolumnsaremissinginsomerowsinaCSVobject.
IfthevalueofSkipPartialDataRecordisnotspeciedorissettoFalse,OSScalculatestheexpressionsintheSQLstatementbyprocessingthevaluesofthemissingcolumnsasnull.
IfthevalueofSkipPartialDataRecordissettoTrue,OSSignorestherowsinwhichsomecolumnsaremissing.
Inthiscase,ifthevalueofMaxSkippedRecordsAllowedisnotspeciedorissettoavaluesmallerthanthenumberof274Issue:20200320ObjectStorageServiceAPIReference/7Objectoperationsskippedrows,OSSreportsanerrorbysendingHTTPstatuscode400orincludingstatuscode400intheendframe.
AssumethattheSQLstatementisselect_1,_3fromossobjectandthedatainarowoftheCSVobjectis"John,companyA".
-IfthevalueofSkipPartialDataRecordissettoFalse,"John,\n"isreturned.
-IfthevalueofSkipPartialDataRecordissettoTrue,thisrowisskipped.
SomekeysaremissinginaJSONobject.
SomeobjectsintheJSONobjectmaynotincludethekeysspeciedintheSQLstatement.
-IfthevalueofSkipPartialDataRecordisnotspeciedorissettoFalse,OSScalculatestheexpressionsintheSQLstatementbyprocessingthemissingkeysasnull.
-IfthevalueofSkipPartialDataRecordisTrue,OSSskipsthedataintheJSONnode.
Inthiscase,ifthevalueofMaxSkippedRecordsAllowedisnotspeciedorissettoavaluesmallerthanthenumberofskippedrows,OSSreportsanerrorbysendingHTTPstatuscode400orincludingstatuscode400intheendframe.
AssumethattheSQLstatementisselects.
firstName,s.
lastName,s.
agefromossobject.
contacts[*]sandthevalueofaJSONnodeis{"rstName":"John","lastName":"Smith"}.
-IfthevalueofSkipPartialDataRecordisnotspeciedorissettoFalse,{"rstName":"John","lastName":"Smith"}isreturned.
-IfthevalueofSkipPartialDataRecordissettoTrue,thisrowisskipped.
Note:ForkeysinthereturneddataofarequestforJSONobjects,theoutputJSONobjectscanonlybeLINES.
TheKeyvalueintheoutputresultisdeterminedbasedonthefollowingrules.
Issue:20200320275ObjectStorageServiceAPIReference/7Objectoperations-AssumethattheSQLstatementisselect*fromossobject.
.
.
.
If*correspondstoaJSONobjectitisreturned.
If*correspondstoaStringoranArray,itisreturnedasaDummyKey_1.
Whenthedatais{"Age":5}select*fromossobject.
Ageswheres=5,{"_1":5}isreturnedbecause5thatcorrespondsto*isnotaJSONobject.
WhentheSQLstatementisselect*fromossobjectswheres.
Age=5,{"Age":5}correspondingto*isreturned.
-IftheSQLstatementdoesnotuseselect*butspeciescolumns,thereturnedcontentisin{"{Column1}":Value,"{Column2}":Value.
.
.
}format.
{Columnn}canbegeneratedinthefollowingways:IftheAliasofthecolumnisspeciedintheSELECTclause,theAliasapplies.
IfthecolumnisthekeyofaJSONobject,thiskeyisusedastheoutputkeyvalue.
IfthecolumnisanelementofaJSONarrayoranaggregatefunction,prexthecolumnwithserialnumber(startingfrom1)plus_astheoutputkeyvalue.
Assumethatthedatais{"contacts":{"Age":35,"Children":["child1","child2","child3"]}}:WhentheSQLstatementisselects.
contacts.
Age,s.
contacts.
Children[0]fromossobject,AgeisthekeyoftheinputJSONobject,andChildren[0]indicatestherstelementofChildrenofthearraytypeandisthesecondcolumnintheoutputcontent.
{"Age":35,"_2":"child1"}isreturned.
WhentheSQLstatementisselectmax(cast(s.
Ageasint))fromossobject.
contactss,andtheselectedcolumnisanaggregatefunction,thecolumnisprexedwith_1plusitsserialnumberintheoutput.
{"_1":35}isreturned.
WhentheAliasofthecolumnisspeciedintheSQLstatementselects.
contacts.
Age,s.
contacts.
Children[0]asfirstChildfromossobject,{"Age":35,"rstChild":"child1"}isreturned.
276Issue:20200320ObjectStorageServiceAPIReference/7Objectoperations-KeysmatchinginJSONobjectsandSQLstatementsarecase-sensitive.
Forexample,"selects.
Age"and"selects.
age"aredierent.
ThedatatypeofsomecolumnsinaCSVobjectdoesnotmatchtheSQLstatement.
IfthedatatypeofarowinaCSVobjectdoesnotmatchthetypespeciedintheSQLstatement,therowisskipped.
IfthenumberofskippedrowshasexceededthevalueofMaxSkippedRecordsAllowed,OSSstopsprocessingdataandreturnsHTTPstatuscode400.
AssumethattheSQLstatementisselect_1,_3fromossobjectwhere_3>5.
IfthevalueofarowintheCSVobjectisJohn,CompanyA,Tobehired,thisrowisskippedbecausethethirdcolumnintherowisnotoftheintegertype.
ThedatatypeofsomekeysinaJSONobjectdoesnotmatchtheSQLstatement.
AssumethattheSQLstatementisselects.
namefromossobjectswheres.
aliren_age>5.
IfthevalueofaJSONnodeis{"Name":"John","aliren_age":Tobehired},thisnodeisskipped.
CreateSelectObjectMetaYoucancallthisoperationtoobtaininformationaboutthetargetCSVobject,suchasthetotalnumberofrows,thetotalnumberofcolumnsinCSVobjects,andthenumberofsplits.
Iftheinformationdoesnotexistintheobject,thewholeCSVobjectisscannedtoanalyzeandrecordtheprecedinginformation.
TheinformationobtainedintherstAPIcallisusedwhentheAPIiscalledagain,sothattheentireCSVobjectdoesnotneedtobescannedagain.
Note:YoumusthavethewritepermissionsonthetargetobjectbeforeperformingtheCreateSelectObjectMetaoperation.
HTTPstatuscode200isreturnediftheoperationissuccessfullyperformed.
IfthetargetobjectisnotavalidCSVorJSONLINESobject,orthespecieddelimiterdoesnotmatchanyCSVobjects,HTTPstatuscode400isreturned.
Requestsyntax-RequestsyntaxforCSVobjectsPOST/samplecsvx-oss-process=csv/metaIssue:20200320277ObjectStorageServiceAPIReference/7ObjectoperationsNonebase64encodebase64encodebase64encodefalse|true-RequestsyntaxforJSONobjectsPOST/samplecsvx-oss-process=json/metaNoneLINESfalse|trueRequestelementsElementTypeDescriptionCsvMetaRequestContainerSpeciesthecontainerthatstorestheSelectcsvMetarequest.
Childnode:InputSerializationParentnode:noneJsonMetaRequestContainerSpeciesthecontainerthatstorestheSelectjsonMetarequest.
Childnode:InputSerializationParentnode:noneInputSerializationContainerOptional.
Thiselementspeciestheinputserializationparameters.
Childnode:CompressionType,CSV,andJSONParentnode:CsvMetaRequestandJsonMetaRequest278Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsElementTypeDescriptionOverwriteIfExistsBooleanOptional.
ThiselementspecieswhethertorecalculatetheSelectMetaandoverwritetheexistingdata.
AvalueoffalseindicatesthattheresultisdirectlyreturnediftheSelectMetaalreadyexists.
Thedefaultvalueisfalse.
Childnode:noneParentnode:CsvMetaRequestandJsonMetaRequestCompressionTypeEnumerationOptional.
Thiselementspeciesthecompressiontypeoftheobject.
OnlyNoneissupportedcurrently.
Childnode:noneParentnode:InputSerializationRecordDelimiterStringOptional.
ThiselementspeciesaBase64-encodeddelimiterusedtoseparaterowsintheCSVobject.
Thedefaultvalueis\n.
ThevalueofthiselementbeforebeingencodedcanbeanANSIvalueofuptotwocharacters.
Forexample,\nisusedtoindicatealinebreakinJavacode.
Childnode:noneParentnode:CSVIssue:20200320279ObjectStorageServiceAPIReference/7ObjectoperationsElementTypeDescriptionFieldDelimiterStringOptional.
ThiselementspeciesaBase64-encodeddelimiterusedtoseparatecolumnsintheCSVobject.
Defaultvalue:,.
Thevalueofthiselementbeforebeingencodedmustbeaone-characterANSIvalue.
Forexample,,isusedtoindicateacommainJavacode.
Childnode:noneParentnode:CSV(inputandoutput)QuoteCharacterStringOptional.
ThiselementspeciesaBase64-encodedquotecharacterusedintheCSVobject.
Defaultvalue:\".
InaCSVobject,linebreaksandcolumndelimitersenclosedinquotationmarksareprocessedasnormalcharacters.
Thevalueofthiselementbeforebeingencodedmustbeaone-characterANSIvalue.
Forexample,\"isusedtoindicateaquotecharacterinJavacode.
Childnode:noneParentnode:CSV(input)CSVContainerSpeciestheformatoftheinputCSVobject.
Childnode:RecordDelimiter,FieldDelimiter,andQuoteCharacterParentnode:InputSerializationJSONContainerSpeciestheformatoftheinputJSONobject.
Childnode:TypeParentnode:InputSerialization280Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsElementTypeDescriptionTypeEnumerationSpeciesthetypeoftheJSONobject.
Validvalues:LINESResponsebodySimilartoSelectObject,theresultsforCreateSelectObjectMetaarealsoreturnedasframes.
FrametypeValuePayloadformatDescriptionMetaEndFrame(CSV)8388614oset|totalscannedbytes|status|splitscount|rowscount|columnscount|errormessageReportsthenalstatusoftheCreateSelectObjectMetaoperation.
-oset:an8-bitinteger,indicatestheosetwhenthescanningiscomplete.
-totalscannedbytes:an8-bitinteger,indicatesthesizeofthescanneddata.
-status:a4-bitinteger,indicatesthenalstatusoftheoperation.
-splits_count:a4-bitinteger,indicatesthetotalnumberofsplits.
-rows_count:an8-bitinteger,indicatesthetotalnumberofrows.
-cols_count:a4-bitinteger,indicatesthetotalnumberofcolumns.
-error_message:includesdetailederrormessages.
Ifnoerroroccurs,thevalueofthisparameterisnull.
Issue:20200320281ObjectStorageServiceAPIReference/7ObjectoperationsFrametypeValuePayloadformatDescriptionMetaEndFrame(JSON)8388615oset|totalscannedbytes|status|splitscount|rowscount|errormessageReportsthenalstatusoftheCreateSelectObjectMetaoperation.
-oset:an8-bitinteger,indicatestheosetwhenthescanningiscomplete.
-totalscannedbytes:an8-bitinteger,indicatesthesizeofthescanneddata.
-status:a4-bitinteger,indicatesthenalstatusoftheoperation.
-splits_count:a4-bitinteger,indicatesthetotalnumberofsplits.
-rows_count:an8-bitinteger,indicatesthetotalnumberofrows.
-error_message:includesdetailederrormessages.
Ifnoerroroccurs,thevalueofthisparameterisnull.
Samplerequests-SamplerequestforCSVobjectsPOST/oss-select/bigcsv_normal.
csvx-oss-process=csv%2FmetaHTTP/1.
1Date:Fri,25May201823:06:41GMTContent-Type:Authorization:OSSAccessKeySignatureUser-Agent:aliyun-sdk-dotnet/2.
8.
0.
0(windows16.
7/16.
7.
0.
0/x86;4.
0.
30319.
42000)Content-Length:309Expect:100-continueConnection:keep-aliveHost:HostCg==LA==Ig==false282Issue:20200320ObjectStorageServiceAPIReference/7Objectoperations-SamplerequestforJSONobjectsPOST/oss-select/sample.
jsonx-oss-process=json%2FmetaHTTP/1.
1Date:Fri,25May201823:06:41GMTContent-Type:Authorization:OSSAccessKeySignatureUser-Agent:aliyun-sdk-dotnet/2.
8.
0.
0(windows16.
7/16.
7.
0.
0/x86;4.
0.
30319.
42000)Content-Length:309Expect:100-continueConnection:keep-aliveHost:HostLINESfalseSupportedtimeformatsYoucanconvertanyofthefollowinglistedformatsintoatimestampwithoutspecifyingthetimeformat.
Forexample,thestringcast('20121201'astimestamp)isautomaticallyparsedasatimestamp:December1,2012.
Thefollowingtabledescribestherecognizedtimeformats.
FormatDescriptionYYYYMMDDyearmonthdayYYYY/MM/DDyear/month/dayDD/MM/YYYY/day/month/yearYYYY-MM-DDyear-month-dayDD-MM-YYday-month-yearDD.
MM.
YYday.
month.
yearHH:MM:SS.
msshour:minute:second.
millisecondHH:MM:SShour:minute:secondHHMMSSmsshourminutesecondmillisecondHH.
MM.
SS.
msshour.
minute.
second.
millisecondHHMMhourminuteHHMMSSmsshourminutesecondmillisecondIssue:20200320283ObjectStorageServiceAPIReference/7ObjectoperationsFormatDescriptionYYYYMMDDHH:MM:SS.
mssyearmonthdayhour:minute:second.
millisecondYYYY/MM/DDHH:MM:SS.
mssyear/month/dayhour:minute:second.
millisecondDD/MM/YYYYHH:MM:SS.
mssday/month/yearhour:minute:second.
millisecondYYYYMMDDHH:MM:SSyearmonthdayhour:minute:secondYYYY/MM/DDHH:MM:SSyear/month/dayhour:minute:secondDD/MM/YYYYHH:MM:SSday/month/yearhour:minute:secondYYYY-MM-DDHH:MM:SS.
mssyear-month-dayhour:minute:second.
millisecondDD-MM-YYYYHH:MM:SS.
mssday-month-yearhour:minute:second.
millisecondYYYY-MM-DDHH:MM:SSyear-month-dayhour:minute:secondYYYYMMDDTHH:MM:SSyearmonthdayThour:minute:secondYYYYMMDDTHH:MM:SS.
mssyearmonthdayThour:minute:second.
millisecondDD-MM-YYYYTHH:MM:SS.
mssday-month-yearThour:minute:second.
millisecondDD-MM-YYYYTHH:MM:SSday-month-yearThour:minute:secondYYYYMMDDTHHMMyearmonthdayThourminuteYYYYMMDDTHHMMSSyearmonthdayThourminutesecondYYYYMMDDTHHMMSSMSSyearmonthdayThourminutesecondmillisecond284Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsFormatDescriptionISO8601-0year-month-dayThour:minute+hour:minute,oryear-month-dayThour:minute-hour:minute"+"indicatesthatthetimeinthecurrenttimezoneisaheadofstandardUTCtime.
"-"indicatesthatthetimeinthecurrenttimezoneisbehindthestandardUTCtime.
Inthisformat,ISO8601-0canbeused.
ISO8601-1year-month-dayThour:minute+hour:minute,oryear-month-dayThour:minute-hour:minute"+"indicatesthatthetimeinthecurrenttimezoneisinfrontofstandardUTCtime.
"-"indicatesthatthetimeinthecurrenttimezoneisbehindthestandUTCtime.
Inthisformat,ISO8601-1canbeused.
CommonLogExample:28/Feb/2017:12:30:51+0700RFC822Example:Tue,28Feb201712:30:51GMTD/M/YYday/month/year,inwhichthedayandmonthcanbeoneortwodigits.
D/M/YYH:Mdaymonthyearhour:minute,inwhichtheday,month,hour,andminutecanbeoneortwodigits.
D/M/YYH:M:Sdaymonthyearhour:minute:second,inwhichtheday,month,hour,minute,andsecondcanbeoneortwodigits.
Theformatsinthefollowingtableareambiguous.
Youmustspecifyatimeformatwhenusingstringsintheseformats.
Forexample,thecast('20121201'astimestampformat'YYYYDDMM')statementincorrectlyparsesthestring20121201asJanuary12,2012.
Issue:20200320285ObjectStorageServiceAPIReference/7ObjectoperationsFormatDescriptionYYYYDDMMyeardaymonthYYYY/DD/MMyear/day/monthMM/DD/YYYYmonth/day/yearYYYY-DD-MMyear-day-monthMM-DD-YYYYmonth-day-yearMM.
DD.
YYYYmonth.
day.
yearErrorcodesSelectObjectreturnserrorcodesinthefollowingtwoways:TheHTTPstatuscodeisincludedintheresponseheaderandtheerrorcodeisincludedintheresponsebody,whichisthesameasotherOSSrequests.
ErrorcodereturnedinthismannerindicatesthattheSQLstatementcontainedinputordataerrors,suchasaninvalidSQLstatement.
Errorcodeisincludedintheendframeoftheresponsebody.
ErrorcodereturnedinthismannerindicatesthatthedataisnotcorrectordoesnotmatchtheSQLstatement.
Forexample,astringexistsinacolumnofwhichthetypeisspeciedasintegerintheSQLstatement.
Inthiscase,apartofdataisprocessedandreturnedtotheclient,andtheHTTPstatuscodeis206.
SomeerrorcodessuchasInvalidCSVLinecanbereturnedasanHTTPstatuscodeintheresponseheaderortheendframebasedonthelocationoftheerrorrowwithintheCSVobject.
ErrorcodeDescriptionHTTPstatuscodeHTTPstatuscodeinendframeInvalidSqlParameterInvalidSQLparameter.
IndicatesthattheSQLstatementintherequestisnull,theSQLstatementsizehasexceededthelimit,ortheSQLstatementisnotBase64-encoded.
400None286Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsErrorcodeDescriptionHTTPstatuscodeHTTPstatuscodeinendframeInvalidInputFieldDelimiterInvalidcolumndelimiterintheinputCSVobject.
IndicatesthattheparameterisnotBase64-encodedorthatthesizeoftheparameterisgreaterthan1byteafterbeingdecoded.
400NoneInvalidInputRecordDelimiterInvalidrowdelimiterintheinputCSVobject.
IndicatesthattheparameterisnotBase64-encodedorthatthesizeoftheparameterisgreaterthan2bytesafterbeingdecoded.
400NoneInvalidInputQuoteInvalidquotecharacterintheinputCSVobject.
IndicatesthattheparameterisnotBase64-encodedorthatthesizeoftheparameterisgreaterthan1byteafterbeingdecoded.
400NoneInvalidOutputFieldDelimiterInvalidcolumndelimiterintheoutputCSVobject.
IndicatesthattheparameterisnotBase64-encodedorthatthesizeoftheparameterisgreaterthan1byteafterbeingdecoded.
400NoneInvalidOutputRecordDelimiterInvalidcolumndelimiterintheoutputCSVobject.
IndicatesthattheparameterisnotBase64-encodedorthatthesizeoftheparameterisgreaterthan2bytesafterbeingdecoded.
400NoneUnsupportedCompressionFormatInvalidCompressionparameter.
IndicatesthatthevalueoftheparameterisnotNONEorGZIP(case-insensitive).
400NoneIssue:20200320287ObjectStorageServiceAPIReference/7ObjectoperationsErrorcodeDescriptionHTTPstatuscodeHTTPstatuscodeinendframeInvalidCommentCharacterInvalidcommentcharacterintheCSVobject.
IndicatesthattheparameterisnotBase64-encodedorthatthesizeoftheparameterisgreaterthan1byteafterbeingdecoded.
400NoneInvalidRangeInvalidRangeparameter.
Indicatesthattheparameterisnotprexedwithline-range=orsplit-range=,orthattherangevaluedoesnotmeettheHTTPstandardforRange.
400NoneDecompressFailureIndicatesthatthevalueofCompressionisGZIPandthattheobjectcannotbedecompressed.
400NoneInvalidMaxSkippedRecordsAllowedIndicatesthatthevalueofMaxSkippedRecordsAllowedisnotaninteger.
400NoneSelectCsvMetaUnavailableIndicatesthattheRangeparameterisspeciedandtheCreateSelectObjectMetaoperationhasbeencalled,butthetargetobjectdoesnotincludeCSVMeta.
400NoneInvalidTextEncodingIndicatesthattheobjectisnotUTF-8encoded.
400NoneInvalidOSSSelectParametersIndicatesthattheEnablePayloadCrcandOutputRawDataparametersarebothsettoTrue,whichresultsinconicts.
400NoneInternalErrorIndicatesthatanOSSsystemerrorhasoccurred.
500or206Noneor500SqlSyntaxErrorIndicatesthatthesyntaxoftheBase64-decodedSQLstatementisinvalid.
400NoneSqlExceedsMaxInCountIndicatesthatthenumberofvaluesincludedintheSQLINclausehasexceeded1,024.
400None288Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsErrorcodeDescriptionHTTPstatuscodeHTTPstatuscodeinendframeSqlExceedsMaxColumnNameLengthIndicatesthatthesizeofthecolumnnamehasexceeded1,024bytes.
400NoneSqlInvalidColumnIndexIndicatesthatthecolumnindexintheSQLstatementislessthan1byteorgreaterthan1,000bytesinlength.
400NoneSqlAggregationOnNonNumericTypeIndicatesthatanaggregationfunctionisusedinanon-numericcolumn.
400NoneSqlInvalidAggregationOnTimestampIndicatesthattheSUMorAVGaggregationfunctionisusedinthetimestampcolumn.
400NoneSqlValueTypeOfInMustBeSameIndicatesthatvaluesofdierenttypesareincludedintheSQLINclause.
400NoneSqlInvalidEscapeCharIndicatesthataninvalidescapecharactersuchasaquestionmark(),percentsign(%),oranasterisk(*)wasspeciedintheSQLLIKEclause.
400NoneSqlOnlyOneEscapeCharIsAllowedIndicatesthatthesizeoftheescapecharacterintheSQLLIKEclauseisgreaterthan1byteinlength.
400NoneSqlNoCharAfterEscapeCharIndicatesthattherearenocharactersaftertheescapecharacterintheSQLLIKEclause.
400NoneSqlInvalidLimitValueIndicatesthatthenumberaftertheSQLLimitclauseissmallerthan1.
400NoneSqlExceedsMaxWildCardCountIndicatesthatthenumberofwildcards,(*)or(%),hasexceededthelimitintheSQLLIKEclause.
400NoneSqlExceedsMaxConditionCountIndicatesthatthenumberofconditionalexpressionsintheSQLWHEREclausehasexceededthelimit.
400NoneIssue:20200320289ObjectStorageServiceAPIReference/7ObjectoperationsErrorcodeDescriptionHTTPstatuscodeHTTPstatuscodeinendframeSqlExceedsMaxConditionDepthIndicatesthatthedepthoftheconditionaltreeintheSQLWHEREclausehasexceededthelimit.
400NoneSqlOneColumnCastToDierentTypesIndicatesthatacolumnwasconvertedintodierenttypesbyincludingtheCASTfunctionintheSQLstatement.
400NoneSqlOperationAppliedToDierentTypesIndicatesthatanoperatorwasusedfortwoobjectsofdierenttypesintheSQLstatement.
Forexample,thiserrorcodeisreturnedifcol1in_col1>3isastring.
400NoneSqlInvalidColumnNameIndicatesthatacolumnnameusedintheSQLstatementwasnotincludedintheheaderoftheCSVobject.
400NoneSqlNotSupportedTimestampFormatIndicatesthatthetimestampformatspeciedintheSQLCASTclauseisnotsupported.
400NoneSqlNotMatchTimestampFormatIndicatesthatthetimestampformatspeciedintheSQLCASTclausedoesnotmatchthetimestampstring.
400NoneSqlInvalidTimestampValueIndicatesthatnotimestampformatisspeciedintheSQLCASTclauseandthattheprovidedstringcannotbeconvertedintoatimestamp.
400NoneSqlInvalidLikeOperandIndicatesthatcolumnnamesorindexesarenotspeciedintheSQLLIKEclause,thatthespeciedcolumnisnotofthestringtype,orthattherightcolumnintheLIKEclauseisofthestringtype.
400NoneSqlInvalidMixOfAggregationAndColumnIndicatesthattheSQLSELECTclauseincludescolumnnamesandindexesforbothaggregationfunctionsandnon-aggregationfunctionsatthesametime.
400None290Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsErrorcodeDescriptionHTTPstatuscodeHTTPstatuscodeinendframeSqlExceedsMaxAggregationCountIndicatesthatthenumberofaggregationfunctionsincludedintheSQLSELECTclausehasexceededthelimit.
400NoneSqlInvalidMixOfStarAndColumnIndicatesthatanasterisk(*),acolumnname,andacolumnindexareincludedwithinthesameSQLstatement.
400NoneSqlInvalidKeepAllColumnsWithAggregationIndicatesthattheSQLstatementincludesaggregationfunctionswhiletheKeepAllColumnsparameterissettoTrue.
400NoneSqlInvalidKeepAllColumnsWithDuplicateColumnIndicatesthattheSQLstatementincludesrepeatedcolumnnamesorcolumnindexeswhiletheKeepAllColumnsparameterissettoTrue.
400NoneSqlInvalidSqlAfterAnalysisIndicatesthattheSQLstatementisnotsupportedbecauseitistoocomplextoresolve.
400NoneInvalidArithmeticOperandIndicatesthattheSQLstatementcontainsarithmeticaloperationsperformedonnon-numericconstantsorcolumns.
400NoneSqlInvalidAndOperandIndicatesthattheexpressionsconnectedbytheANDoperatorintheSQLstatementarenotoftheBooleantype.
400NoneSqlInvalidOrOperandIndicatesthattheexpressionsconnectedbytheORoperatorintheSQLstatementarenotoftheBooleantype.
400NoneSqlInvalidNotOperandIndicatesthattheexpressionsconnectedbytheNOToperatorintheSQLstatementarenotoftheBooleantype.
400NoneIssue:20200320291ObjectStorageServiceAPIReference/7ObjectoperationsErrorcodeDescriptionHTTPstatuscodeHTTPstatuscodeinendframeSqlInvalidIsNullOperandIndicatesthattheSQLstatementcontainstheISNULLoperatorperformedonaconstant.
400NoneSqlComparerOperandTypeMismatchIndicatesthattheSQLstatementcontainsthecomparisonoperatorperformedontwoobjectsofdierenttypes.
400NoneSqlInvalidConcatOperandIndicatesthattheSQLstatementcontainstwoconstantsconnectedbytheconcatenationoperator(||).
400NoneSqlUnsupportedSqlIndicatesthattheSQLstatementistoocomplexsothatthesizeofthegeneratedSQLplanhasexceededthelimit.
400NoneHeaderInfoExceedsMaxSizeIndicatesthatthesizeoftheheaderinformationspeciedintheSQLstatementhasexceededthelimit.
400NoneOutputExceedsMaxSizeIndicatesthatarowofoutputresultshasexceededthesizelimit.
400NoneInvalidCsvLineIndicatesthatarowintheCSVobjectisinvalidorhasexceededthesizelimit,orthatthenumberofskippedrowshasexceededthevalueofMaxSkippedRecordsAllowed.
206or400400orNoneNegativeRowIndexIndicatesthatthevalueofthearrayindexintheSQLstatementisanegativenumber.
400NoneExceedsMaxNestedColumnDepthIndicatesthatthenestedlevelsoftheJSONobjectintheSQLstatementhaveexceededthelevellimit.
400NoneNestedColumnNotSupportInCsvIndicatesthattheSQLstatementcontainsnestedcolumnsthatincludeperiods(.
)orarrayswithbrackets([]),whicharenotsupportedforSQLstatementsofCSVobjects.
400None292Issue:20200320ObjectStorageServiceAPIReference/7ObjectoperationsErrorcodeDescriptionHTTPstatuscodeHTTPstatuscodeinendframeTableRootNodeOnlySupportInJsonIndicatesthattherootnodepathcanonlybespeciedafterFromossobjectinJSONobjects.
400NoneJsonNodeExceedsMaxSizeIndicatesthatthesizeoftherootnodeintheJSONobjecthasexceededthelimit.
400or206Noneor400InvalidJsonDataIndicatesthattheJSONdataisformattedincorrectly.
400or206Noneor400ExceedsMaxJsonArraySizeIndicatesthatthenumberofelementsinanarrayintherootnodeoftheJSONobjecthasexceededthelimit.
400or206Noneor400WildCardNotAllowedIndicatesthatthewildcard(*)cannotbeusedinSQLSELECTclausesorSQLWHEREclausesintheJSONobject.
Forexample,thefollowingstatementisnotsupported:selects.
a.
b[*]fromossobjectwherea.
c[*]>0.
400NoneJsonNodeExceedsMaxDepthIndicatesthatthedepthoftherootnodeoftheJSONobjecthasexceededthelimit.
400or206Noneor4007.
17PutObjectTaggingConguresorupdatesthetagsofanobject.
RequestsyntaxPUT/objectnametaggingContent‐Length:114Host:bucketname.
oss‐cn‐hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueKeyValueIssue:20200320293ObjectStorageServiceAPIReference/7ObjectoperationsRequestelementsElementTypeRequiredDescriptionTaggingContainerYesSub-node:TagSetTagSetContainerYesParentnode:TaggingSub-node:TagTagContainerNoParentnode:TagSetSub-node:Key,ValueKeyStringNoParentnode:TagSub-node:NoneValueStringNoParentnode:TagSub-node:NoneDetailanalysisTherequestermusthavethepermissiontoperformthePutObjectTaggingoperation.
TheLast-Modiedtimeofanobjectisnotupdatedifthetagoftheobjectismodied.
Atagcancontainletters,numbers,spaces,andthefollowingsymbols:plussign(+),hyphen(-),equalsign(=),period(.
),underscore(_),colon(:),andforwardslash(/).
ExamplesRequestexample:PUT/objectnametaggingContent‐Length:114Host:bucketname.
oss‐cn‐hangzhou.
aliyuncs.
comDate:Mon,18Mar201908:25:17GMTAuthorization:OSS294Issue:20200320ObjectStorageServiceAPIReference/7Objectoperationsa1b2Responseexmple:200(OK)content‐length:0server:AliyunOSSx‐oss‐request‐id:5C8F55ED461FB4A64C000004date:Mon,18Mar201908:25:17GMT7.
18GetObjectTaggingObtainsthetagsofanobject.
RequestsyntaxGET/objectnametaggingHost:bucketname.
oss‐cn‐hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueResponseelementsElementTypeDescriptionTaggingContainerSub-node:TagSetTagSetContainerParentnode:TaggingSub-node:TagTagContainerParentnode:TagSetSub-node:Key,ValueKeyStringParentnode:TagSub-node:NoneValueStringParentnode:TagSub-node:NoneIssue:20200320295ObjectStorageServiceAPIReference/7ObjectoperationsExamplesRequestexample:GET/objectnametaggingHost:bucketname.
oss‐cn‐hangzhou.
aliyuncs.
comDate:Wed,20Mar201902:02:36GMTAuthorization:OSSResponseexample:200(OK)content‐length:209server:AliyunOSSx‐oss‐request‐id:5C919F38461FB42826000002date:Wed,20Mar201902:02:32GMTcontent‐type:application/xmla1b27.
19DeleteObjectTaggingDeletesthetagofaspeciedobject.
RequestsyntaxDELETE/objectnametaggingHost:bucketname.
oss‐cn‐hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueExamplesRequestexample:DELETE/objectnametaggingHost:bucketname.
oss‐cn‐hangzhou.
aliyuncs.
comDate:Tue,09Apr201903:00:33GMTAuthorization:OSSLTAIbsTkySSptaz****/Zr0o6BKgAl7iiBtHN2JMC****Responseexample:204(NoContent)content‐length:0server:AliyunOSSx‐oss‐request‐id:5CAC0AD16D0232E2051B****296Issue:20200320ObjectStorageServiceAPIReference/7Objectoperationsdate:Tue,09Apr201903:00:33GMTIssue:20200320297ObjectStorageServiceAPIReference/8Multipartuploadoperations8Multipartuploadoperations8.
1IntroductionInadditiontoPutObject,OSSalsoprovidesthemultipartuploadmode.
Youcanuploadlesinthemultipartuploadmodeinthefollowingscenarios(butnotlimitedtothefollowing):Resumableuploadmustbesupported.
Thelestobeuploadedarelargerthan100MB.
Thenetworkconditionsarepoor,andtheconnectionwiththeOSSserverisfrequentlydisconnected.
Beforealeisuploaded,thesizeofthelecannotbedetermined.
8.
2InitiateMultipartUploadYoumustcallthisoperationtorequireOSStoinitiateamultipartuploadtaskbeforedatacanbetransmittedinmultipartuploadmode.
Note:TheoperationreturnsagloballyuniqueuploadIDcreatedbytheOSSservertoidentifythemultipartuploadtask.
YoucaninitiateoperationsbasedonthisuploadID,suchasstoppingorqueryingthemultipartuploadtask.
TheInitiateMultipartUploadrequestdoesnotaectexistingobjectsofthesamename.
Whenperformingthisoperationtocalculatethesignatureforauthentication,youmustadd"uploads"toCanonicalizedResource.
RequestsyntaxPOST/ObjectNameuploadsHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTdate298Issue:20200320ObjectStorageServiceAPIReference/8MultipartuploadoperationsAuthorization:SignatureValueRequestparametersTheencoding-typeparametercanbespeciedintheInitiateMultipartUploadrequest.
OSSusesthespeciedencodingtypetoencodetheobjectnameintheresponse.
ParameterTypeDescriptionencoding-typeStringTheencodingtypeoftheobjectnameintheresponse.
TheobjectnamecancontainanycharactersencodedinUTF-8.
However,theXML1.
0standardcannotbeusedtoparsecertaincontrolcharacters,suchascharacterswithanASCIIvaluefrom0to10.
Youcansettheencoding-typeparametertoencodetheobjectnameintheresponse.
Setthevaluetourl.
Defaultvalue:nullValidvalue:urlRequestheadersNote:TheInitiateMultipartUploadrequestsupportsthefollowingstandardHTTPrequestheaders:Cache-Control,Content-Disposition,Content-Encoding,Content-Type,Expires,andcustomheadersthatstartwithx-oss-meta-.
Formoreinformation,seePutObject.
Issue:20200320299ObjectStorageServiceAPIReference/8MultipartuploadoperationsHeaderTypeDescriptionCache-ControlStringTheWebpagecachingbehaviorwhentheobjectisdownloaded.
Formoreinformation,seeRFC2616.
Defaultvalue:nullContent-DispositionStringThenameoftheobjectduringthedownload.
Formoreinformation,seeRFC2616.
Defaultvalue:nullContent-EncodingStringThecontentencodingformatwhentheobjectisdownloaded.
Formoreinformation,seeRFC2616.
Defaultvalue:nullExpiresIntegerTheexpirationtimeinms.
Formoreinformation,seeRFC2616.
Defaultvalue:nullx-oss-server-side-encryptionStringTheserver-sideencryptionalgorithmusedtoencrypteachpartoftheobject.
EachpartisstoredinOSSafterencryption.
Validvalues:AES256orKMSNote:YoucanuseKeyManagementService(KMS)forencryptionafteryouactivateKMSintheconsole.
x-oss-server-side-encryption-key-idStringTheIDofthecustomermasterkey(CMK)hostedinKMS.
Thisparametertakeseectonlywhenx-oss-server-side-encryptionissettoKMS.
300Issue:20200320ObjectStorageServiceAPIReference/8MultipartuploadoperationsHeaderTypeDescriptionx-oss-storage-classStringThestorageclassoftheobject.
Validvalues:StandardIAArchiveSupportedoperations:PutObject,InitiateMultipartUpload,AppendObject,PutObjectSymlink,andCopyObjectNote:Ifthevalueofx-oss-storage-classisinvalid,400isreturnedwitherrorcodeInvalidArgumet.
Ifthestorageclassisspeciedwhenyouuploadtheobject,thespeciedstorageclassappliesregardlessofthestorageclassforthebuckettowhichtheobjectbelongs.
Ifyousetx-oss-storage-classtoStandardwhenuploadinganobjectthatisinanIAbucket,theobjectisstoredasastandardobject.
x-oss-taggingStringThetagfortheobject.
Youcansetmultipletagsfortheobject,suchasTagA=A&TagB=B.
Note:ThetagkeyandvaluemustbeURL-encoded.
Ifacongurationdoesnotcontainequalsigns(=),thevalueisconsideredasanemptystring.
ResponseelementsNote:AfterreceivingtheInitiateMultipartUploadrequest,theserverreturnsamessagebodythatisintheXMLformat.
Themessagebodycontainsthefollowingelements:Bucket,Key,andUploadID.
Issue:20200320301ObjectStorageServiceAPIReference/8MultipartuploadoperationsElementTypeDescriptionBucketStringThenameofthebucketforwhichthemultipartuploadtaskisinitiated.
Parentnode:InitiateMultipartUploadResultInitiateMultipartUploadResultContainerThecontainerthatcontainstheresultoftheInitiateMultipartUploadrequest.
Childnode:Bucket,Key,andUploadIdParentnode:noneKeyStringThenameoftheobjectforwhichthemultipartuploadtaskisinitiated.
Parentnode:InitiateMultipartUploadResultUploadIdStringTheuniqueIDofthemultipartuploadtask.
Parentnode:InitiateMultipartUploadResultNote:MakesurethattheuploadIDisrecordedforsubsequentmultipart-relatedoperations.
EncodingTypeStringTheencodingtypeoftheobjectnameintheresponse.
Iftheencoding-typeparameterisspeciedintherequest,theobjectnameisencodedintheresponse.
Parentnode:InitiateMultipartUploadResultExamplesSamplerequestsPOST/multipart.
datauploadsHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
com302Issue:20200320ObjectStorageServiceAPIReference/8MultipartuploadoperationsDate:Wed,22Feb201208:32:21GMTx-oss-storage-class:ArchiveAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:/cluRFtRwMTZpC2hTj4F67AG****SampleresponsesHTTP/1.
1200OKContent-Length:230Server:AliyunOSSConnection:keep-alivex-oss-request-id:42c25703-7503-fbd8-670a-bda01eae****Date:Wed,22Feb201208:32:21GMTContent-Type:application/xmlmultipart_uploadmultipart.
data0004B9894A22E5B1888A1E29F823****SDKsYoucancallthisoperationwhenyouuseSDKdemosinanyofthefollowinglanguages:JavaPythonGoC++PHPC.
NETNode.
jsErrorcodesErrorcodeHTTPstatuscodeDescriptionInvalidEncryptionAlgorithmError400Theerrormessagereturnedbecausetheserver-sideencryptionmethodotherthanAES-256orKMSisspecied.
InvalidArgument400Theerrormessagereturnedbecausethex-oss-server-side-encryptionrequestheaderisaddedeachtimeapartisuploaded.
Issue:20200320303ObjectStorageServiceAPIReference/8MultipartuploadoperationsErrorcodeHTTPstatuscodeDescriptionKmsServiceNotEnabled403TheerrormessagereturnedbecauseKMSisspeciedastheserver-sideencryptionmethodbutKMSisnotactivatedintheconsole.
8.
3UploadPartYoucancallthisoperationtouploaddatainpartsbasedonaspeciedobjectnameanduploadIDafterinitializingamultipartuploadtask.
Note:BeforecallingUploadParttouploadapart,youmustcallInitiateMultipartUploadtoobtainanuploadIDissuedbytheOSSserver.
TheuploadIDuniquelyidentieswhichobjecttheuploadedpartbelongsto.
Eachparthasapartnumberthatidentiesthepart.
Partnumberscanrangefrom1to10000.
Thesizeofeachpartrangesfrom100KBto5GBinsize.
Inmultipartuploadmode,eachpartexceptthelastpartmustbegreaterthan100KBinsize.
ThesizeofeachpartisnotveriedwhenyoucallUploadPartbecausenotallpartsareuploadedandthesystemdoesnotknowwhichpartisthelastpart.
ThesizeofeachpartisveriedonlywhenyoucallCompleteMultipartUpload.
Ifyouusethesamepartnumbertouploadnewdata,OSSoverwritestheexistingdataidentiedbythispartnumber.
OSSincludestheMD5valueofthepartreceivedbytheserverintheETagheaderandreturnstheETagheadertotheuser.
Ifthex-oss-server-side-encryptionrequestheaderisspeciedwhenyoucallInitiateMultipartUpload,theuploadedpartisencoded.
Thex-oss-server-side-encryptionheaderisincludedintheresponseheaderofUploadPart,indicatingtheserver-sideencryptionmethodofthepart.
Formoreinformation,seeInitiateMultipartUpload.
RequestsyntaxPUT/ObjectNamepartNumber=PartNumber&uploadId=UploadIdHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateContent-Length:Size304Issue:20200320ObjectStorageServiceAPIReference/8MultipartuploadoperationsAuthorization:SignatureValueExamplesSamplerequestsPUT/multipart.
datapartNumber=1&uploadId=0004B9895DBBB6EC98E36HTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comContent-Length:6291456Date:Wed,22Feb201208:32:21GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:J/lICfXEvPmmSW86bBAfMmUm****[6291456bytesdata]SampleresponsesHTTP/1.
1200OKServer:AliyunOSSConnection:keep-aliveETag:"7265F4D211B56873A381D321F586****"x-oss-request-id:3e6aba62-1eae-d246-6118-8ff42cd0****Date:Wed,22Feb201208:32:21GMTSDKsYoucancallthisoperationwhenyouuseSDKdemosinanyofthefollowinglanguages:JavaPythonGoC++PHPC.
NETNode.
jsErrorcodesErrorcodeHTTPstatuscodeDescriptionInvalidArgument400Theerrormessagereturnedbecausethepartnumberisnotwithintherangeof1to10000.
Issue:20200320305ObjectStorageServiceAPIReference/8MultipartuploadoperationsErrorcodeHTTPstatuscodeDescriptionInvalidDigest400TheerrormessagereturnedbecausetheContent-MD5valueintherequestandtheMD5valuecalculatedbyOSSaredierent.
Tomakesurethatnoerrorsoccurduringdatatransmissionoverthenetwork,youcanincludetheContent-MD5valueintherequest.
OSScalculatestheMD5valueoftheuploadeddataandcomparesitwiththeContent-MD5value.
8.
4UploadPartCopyYoucancallthisoperationtocopydatafromanexistingobjecttouploadapart.
VersioningBydefault,UploadPartCopyisusedtouploadapartbycopyingdatafromanexistingobjectofthecurrentversion.
Tocopydatafromanobjectofaspecicversion,includeversionIdinthex-oss-copy-sourcerequestheaderasasubconditionintherequest.
Youcansetx-oss-copy-sourceasfollows:x-oss-copy-source:/SourceBucketName/SourceObjectNameversionId=111111.
Note:ThenameofthesourceobjectmustbeURL-encoded.
x-oss-copy-source-version-idisreturnedintheresponse,indicatingtheversionIDofthesourceobject.
IfversionIdisnotspeciedandthecurrentversionofthesourceobjectisadeletemarker,OSSreturns404NotFound.
IfversionIdisspeciedandthecurrentversionofthesourceobjectisadeletemarker,OSSreturns400BadRequest.
TocallUploadPartCopy,youcanaddthex-oss-copy-sourcerequestheadertotheUploadPartrequest.
Tocopyanobjectlargerthan1GB,useUploadPartCopy.
Formoreinformationabouthowtocopyobjectssmallerthan1GB,seeCopyObject.
Note:YoucannotcallUploadPartCopytocopydatafromappendableobjects.
WhenyoucallUploadPartCopy,thesourceanddestinationbucketsmustbelocatedwithinthesameregion.
306Issue:20200320ObjectStorageServiceAPIReference/8MultipartuploadoperationsBeforecallingUploadPartCopytouploadapart,youmustcallInitiateMultipartUploadtoobtainanuploadIDissuedbytheOSSserver.
Ifthex-oss-server-side-encryptionrequestheaderisspeciedwhenyoucallInitiateMultipartUpload,theuploadedpartisencoded.
Thex-oss-server-side-encryptionheaderisincludedintheresponseheaderofUploadPart,indicatingtheserver-sideencryptionmethodofthepart.
Formoreinformation,seeInitiateMultipartUpload.
Inmultipartuploadmode,eachpartexceptthelastpartmustbegreaterthan100KBinsize.
ThesizeofeachpartisnotveriedwhenyoucallUploadPartbecausenotallpartsareuploadedandthesystemdoesnotknowwhichpartisthelastpart.
ThesizeofeachpartisveriedonlywhenyoucallCompleteMultipartUpload.
RequestsyntaxPUT/ObjectNamepartNumber=PartNumber&uploadId=UploadIdHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateContent-Length:SizeAuthorization:SignatureValuex-oss-copy-source:/SourceBucketName/SourceObjectNamex-oss-copy-source-range:bytes=first-lastRequestheadersThefollowingtabledescribestherequestheadersinadditiontocommonlyusedrequestheadersintheUploadPartCopyrequest.
HeaderTypeDescriptionx-oss-copy-sourceStringTheaddresstoaccessthesourceobject.
Youmusthavepermissionstoreadthesourceobject.
Defaultvalue:nullIssue:20200320307ObjectStorageServiceAPIReference/8MultipartuploadoperationsHeaderTypeDescriptionx-oss-copy-source-rangeIntegerTherangeofBytestocopydatafromthesourceobject.
Forexample,ifyouspecifybytes=0-9,thesystemtransfersByte0toByte9,atotalof10Bytes.
Thisrequestheaderisnotrequiredwhentheentiresourceobjectiscopied.
Defaultvalue:nullNote:Ifthex-oss-copy-source-rangerequestheaderisnotspecied,theentiresourceobjectiscopied.
Ifthex-oss-copy-source-rangerequestheaderisspecied,theresponsecontainsthelengthoftheentireobjectandtherangeofBytestobecopiedforthisoperation.
Forexample,Content-Range:bytes0-9/44indicatesthatthelengthoftheentireobjectis44Bytes.
TherangeofBytestobecopiedisByte0toByte9.
Ifthespeciedrangedoesnotconformtotherangeconventions,OSScopiestheentireobjectanddoesnotincludeContent-Rangeintheresponse.
Thefollowingtabledescribesrequestheadersthatareusedforx-oss-copy-sourcetospecifythesourceobject.
308Issue:20200320ObjectStorageServiceAPIReference/8MultipartuploadoperationsHeaderTypeDescriptionx-oss-copy-source-if-matchStringThecopyoperationcondition.
IftheETagvalueofthesourceobjectisthesameastheETagvalueprovidedbytheuser,OSScopiesdata.
Otherwise,OSSreturns412PreconditionFailed.
Defaultvalue:nullx-oss-copy-source-if-none-matchStringTheobjecttransfercondition.
IftheinputETagvaluedoesnotmatchtheETagvalueoftheobject,thesystemtransferstheobjectnormallyandreturns200OK.
Otherwise,thesystemreturns304NotModied.
Defaultvalue:nullx-oss-copy-source-if-unmodified-sinceStringTheobjecttransfercondition.
Ifthespeciedtimeisthesameasorlaterthantheactualobjectmodicationtime,OSStransferstheobjectnormallyandreturns200OK.
Otherwise,OSSreturns412PreconditionFailed.
Defaultvalue:nullx-oss-copy-source-if-modified-sinceStringTheobjecttransfercondition.
Ifthespeciedtimeisearlierthantheactualobjectmodicationtime,thesystemtransferstheobjectnormallyandreturns200OK.
Otherwise,thesystemreturns304NotModied.
Defaultvalue:nullTimeformat:EEE,dMMMyyyyHH:mm:ssZGMT.
Example:Fri,13Nov201514:47:53GMT.
Issue:20200320309ObjectStorageServiceAPIReference/8MultipartuploadoperationsExamplesSamplerequestsPUT/multipart.
datapartNumber=1&uploadId=0004B9895DBBB6EC98E36HTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comContent-Length:6291456Date:Wed,22Feb201208:32:21GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:J/lICfXEvPmmSW86bBAfMmUm****x-oss-copy-source:/oss-example/src-objectx-oss-copy-source-range:bytes=100-6291756SampleresponsesHTTP/1.
1200OKServer:AliyunOSSConnection:keep-alivex-oss-request-id:3e6aba62-1eae-d246-6118-8ff42cd0****Date:Thu,17Jul201406:27:54GMT'2014-07-17T06:27:54.
000Z"5B3C1A2E053D763E1B002CC607C5****"SamplerequestsforspecifyingversionIdforUploadPartCopyifabuckethasversioningenabledPUT/multipart.
datapartNumber=2&uploadId=63C06A5CFF6F4AE4A6BB3AD7F01C****HTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Tue,09Apr201907:01:56GMTAuthorization:OSS6jftttm6x6san0e:v/sJFtYvg7DTa4pJ2AMShZL/****x-oss-copy-source:/oss-example/src-objectversionId=CAEQMxiBgMC0vs6D0BYiIGJiZWRjOTRjNTg0NzQ1MTRiN2Y1OTYxMTdkYjQ0****SampleresponsesHTTP/1.
1200OKServer:AliyunOSSConnection:keep-alivex-oss-copy-source-version-id:CAEQMxiBgMC0vs6D0BYiIGJiZWRjOTRjNTg0NzQ1MTRiN2Y1OTYxMTdkYjQ0****x-oss-request-id:5CAC4364B7AEADE017000660Date:Tue,09Apr201907:01:56GMT2019-04-09T07:01:56.
000Z"25A9F4ABFCC05743DF6E2C886C56****"SDKsYoucancallthisoperationwhenyouuseSDKdemosinanyofthefollowinglanguages:310Issue:20200320ObjectStorageServiceAPIReference/8MultipartuploadoperationsJavaPythonGoC++PHPC.
NETErrorcodesErrorcodeHTTPstatuscodeDescriptionOperationNotSupported400TheerrormessagereturnedbecauseUploadPartCopydoesnotsupportthestorageclassofArchive.
8.
5CompleteMultipartUploadYoucancallthisoperationtocompletemultipartuploadofanobject.
VersioningYoucancallthisoperationtocompletemultipartuploadofanobjectwhenversioningisenabled.
Inthiscase,OSSgeneratesauniqueversionIDfortheobject,addstheversionIDtox-oss-version-id,andreturnsx-oss-version-idintheresponseheader.
Whenyouperformthisoperation,youmustprovideacompletelistofparts.
Informationofeachpartmustcontainapartnumberandanentitytag(ETag).
AfterOSSreceivesthelistofparts,OSSveriesthevalidityofeachpartonebyone.
Afterallthesepartshavebeenveried,OSScombinesthesepartsintoacompleteobject.
Note:Whenyouperformthisoperation,OSScheckswhetherthesizeofeachpartexceptthelastpartislargerthan100KBandwhetherthepartnumberandETagareprovidedforeachpartinthelist.
Wheneachpartisuploaded,theclientmustrecordthepartnumberandtheETagvaluereturnedfromtheserveraftereachpartisuploaded.
Issue:20200320311ObjectStorageServiceAPIReference/8MultipartuploadoperationsItmaytakeawhileforOSStoprocesstheCompleteMultipartUploadrequest.
IftheclientisdisconnectedfromOSSduringthisperiod,OSScontinuestoprocesstherequest.
Thepartnumberslistedintherequestdonothavetobeconsecutive.
Forexample,therstpartnumbercanbe1andthesecondpartnumbercanbe5.
AfterOSSprocessestheCompleteMultipartUploadrequest,theuploadIDofthistaskisnolongervalid.
AnobjectmayhavedierentuploadIDsthatareindependentofeachother.
Whenoneuploadtaskiscomplete,thecorrespondinguploadIDbecomesinvalidandotheruploadIDsarenotaected.
IfInitiateMultipartUploadiscalledandthex-oss-server-side-encryptionrequestheaderisspecied,thex-oss-server-side-encryptionresponseheaderisreturnedinresponsetotheCompleteMultipartUploadrequest.
Thex-oss-server-side-encryptionresponseheaderindicatesthesever-sideencryptionmethodfortheobject.
RequestsyntaxPOST/ObjectNameuploadId=UploadIdHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateContent-Length:SizeAuthorization:SignaturePartNumberETag.
.
.
RequestparametersTheEncoding-typeparametercanbespeciedintheCompleteMultipartUploadrequest.
OSSusesthespeciedencodingtypetoencodetheobjectnameintheresponse.
312Issue:20200320ObjectStorageServiceAPIReference/8MultipartuploadoperationsParameterTypeDescriptionEncoding-typeStringTheencodingtypeoftheobjectnameintheresponse.
TheobjectnamecancontainanycharactersencodedinUTF-8.
However,theXML1.
0standardcannotbeusedtoparsecertaincontrolcharacters,suchascharacterswithanASCIIvaluefrom0to10.
YoucansettheEncoding-typeparametertoencodethereturnedobjectname.
Setthevaluetourl.
Defaultvalue:noneRequestheadersHeaderTypeRequiredDescriptionx-oss-forbid-overwriteStringNoSpecieswhethertheobjectwiththesameobjectnameisoverwrittenwhenyouperformtheCompleteMultipartUploadoperation.
Bydefault,ifx-oss-forbid-overwriteisnotspecied,theobjectwiththesamenameisoverwritten.
Ifx-oss-forbid-overwriteissettotrue,theobjectwiththesamenameisnotoverwritten.
Ifx-oss-forbid-overwriteissettofalse,theobjectwiththesamenameisoverwritten.
Issue:20200320313ObjectStorageServiceAPIReference/8MultipartuploadoperationsRequestelementsElementTypeDescriptionCompleteMultipartUploadContainerThecontainerthatstoresthecontentoftheCompleteMultipartUploadrequest.
Childnode:oneormorepartelementsParentnode:noneETagStringTheETagvaluereturnedbyOSSafterthepartisuploaded.
Parentnode:PartPartContainerThecontainerthatstoresinformationabouttheuploadedpart.
Childnode:ETagandPartNumberParentnode:CompleteMultipartUploadPartNumberIntegerThenumberoftheparts.
Parentnode:PartResponseelementsElementTypeDescriptionBucketStringThenameofthebucket.
Parentnode:CompleteMultipartUploadResult314Issue:20200320ObjectStorageServiceAPIReference/8MultipartuploadoperationsElementTypeDescriptionCompleteMultipartUploadResultContainerThecontainerthatstorestheresponsetotheCompleteMultipartUploadrequest.
Childnode:Bucket,Key,ETag,andLocationParentnode:noneETagStringTheETagcreatedtoidentifythecontentoftheobjectwhentheobjectiscreatedbyusingtheCompleteMultipartUploadrequest.
TheETagvalueistheUUIDoftheobjectcontent.
TheETagvalueoftheobjectcanbeusedtocheckwhethertheobjectcontentismodied.
Parentnode:CompleteMultipartUploadResultLocationStringTheURLusedtoaccesstheobject.
Parentnode:CompleteMultipartUploadResultKeyStringThenameoftheobject.
Parentnode:CompleteMultipartUploadResultEncodingTypeStringTheencodingtypeoftheobjectnameintheresponse.
Iftheencoding-typeparameterisspeciedintherequest,theobjectnameintheresponseisencoded.
Parentnode:ContainerIssue:20200320315ObjectStorageServiceAPIReference/8MultipartuploadoperationsExamplesSamplerequestsPOST/multipart.
datauploadId=0004B9B2D2F7815C432C9057C03134D4HTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comContent-Length:1056Date:Fri,24Feb201210:19:18GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:8VwFhFUWmVecK6jQlHlXMK/z****1"3349DC700140D7F86A0784842780****"5"8EFDA8BE206636A695359836FE0A****"8"8C315065167132444177411FDA14****"SampleresponsesHTTP/1.
1200OKServer:AliyunOSSContent-Length:329Content-Type:Application/xmlConnection:keep-alivex-oss-request-id:594f0751-3b1e-168f-4501-4ac71d21****Date:Fri,24Feb201210:19:18GMThttp://oss-example.
oss-cn-hangzhou.
aliyuncs.
com/multipart.
dataoss-examplemultipart.
data"B864DB6A936D376F9F8D3ED3BBE540****"Samplerequestforaversioning-enabledbucketPOST/multipart.
datauploadId=63C06A5CFF6F4AE4A6BB3AD7F01C****HTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comContent-Length:223Date:Tue,09Apr201907:01:56GMTAuthorization:OSS6jftttm6x6san0e:XljBrYBYxDnxKdFMj9WYI6qu****1"25A9F4ABFCC05743DF6E2C886C56****"5"25A9F4ABFCC05743DF6E2C886C56****"316Issue:20200320ObjectStorageServiceAPIReference/8MultipartuploadoperationsSampleresponseHTTP/1.
1200OKServer:AliyunOSSContent-Length:314Content-Type:Application/xmlConnection:keep-alivex-oss-version-id:CAEQMxiBgID6v86D0BYiIDc3ZDI0YTBjZGQzYjQ2Mjk4OWVjYWNiMDljYzhlN****x-oss-request-id:5CAC4364B7AEADE017000662Date:Tue,09Apr201907:01:56GMThttp://oss-example.
oss-cn-hangzhou.
aliyuncs.
com/multipart.
dataoss-examplemultipart.
data"097DE458AD02B5F89F9D0530231876****"SDKsTheSDKsoftheCompleteMultipartUploadoperationforvariousprogramminglanguagesareasfollows:JavaPythonGoC++PHPC.
NETIssue:20200320317ObjectStorageServiceAPIReference/8MultipartuploadoperationsErrorcodesErrorcodeHTTPstatuscodeDescriptionInvalidDigest400TheerrormessagereturnedbecausetheContent-MD5valueintherequestandtheMD5valuecalculatedbyOSSareinconsistent.
Toensurethatnoerrorsoccurduringdatatransmissionoverthenetwork,youcanincludetheContent-MD5valueintherequest.
OSScalculatestheMD5valueoftheuploadeddataandcomparesitwiththeContent-MD5value.
FileAlreadyExists409Theerrormessagereturnedbecauseanobjectwiththesameobjectnamealreadyexistswhentherequestcontainsanx-oss-forbid-overwriteheaderandthevalueofthisheaderissettotrue.
8.
6AbortMultipartUploadStopsaMultipartUploadevent.
ToperformanAbotMultipartUploadoperation,youmustprovidetheUploadIDoftheMultipartUploadeventyouwanttostop.
Note:AfteraMultipartUploadeventisstopped,youcannotusethisUploadIDtoperformanyoperations,andtheuploadeddatapartsarealsodeleted.
AfteryoustopaMultipartUploadevent,ifpartsinthiseventisstillbeinguploaded,theyarenotdeleted.
Therefore,ifmultipleMultipartUploadeventsareperformedconcurrently,youmustcallAbortMultipartUploadformultipletimestocompletelyreleasetheOSSstoragespaces.
RequestsyntaxDELETE/ObjectNameuploadId=UploadIdHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDate318Issue:20200320ObjectStorageServiceAPIReference/8MultipartuploadoperationsAuthorization:SignatureExamplesRequestexample:Delete/multipart.
data&uploadId=0004B9895DBBB6EC98EHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Wed,22Feb201208:32:21GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:J/lICfXEvPmmSW86bBAfMmUmWjI=Responseexample:HTTP/1.
1204Server:AliyunOSSConnection:keep-alivex-oss-request-id:059a22ba-6ba9-daed-5f3a-e48027df344dDate:Wed,22Feb201208:32:21GMTSDKTheSDKsofthisAPIareasfollows:JavaPHPGoC.
NETErrorcodesErrorcodeHTTPstatuscodeDescriptionNoSuchUpload404TheUploadIDdoesnotexist.
8.
7ListMultipartUploadsYoucancallthisoperationtolistallongoingmultipartuploadtasksthathavebeeninitiatedbutcanceledornotcompleted.
TospecifythenumberoftasksthatarereturnedintheresponsefromOSS,youcanaddthemax-uploadsparametertotherequest.
TheIsTruncatedelementindicateswhetherallrequiredmultipartuploadtasksarereturned.
Note:Issue:20200320319ObjectStorageServiceAPIReference/8MultipartuploadoperationsThemaximumvalueofmax-uploadsis1000,indicatingthatamaximumof1,000multipartuploadtaskscanbereturnedintheresponse.
TheresultsreturnedbyOSSarelistedinascendingalphabeticalorderofobjectnames.
Ifmultipartuploadtasksinvolvethesameobject,theresultsarelistedinascendingorderoftimewhenthemultipartuploadtaskswereinitiated.
RequestsyntaxGet/uploadsHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureRequestparametersNote:ListMultipartUploadssupportsthefollowingparameters:prefix,marker,delimiter,upload-id-marker,andmax-uploads.
Youcanuseoneormoreoftheprecedingparameterstocongurerulestoquerymultipartuploadtaskssothatresultsthatmeetconditionsarereturned.
ParameterTypeDescriptiondelimiterStringThedelimiterusedtogroupobjectsbyname.
CommonPrefixesspeciesasetofsubstringsofobjectnames.
Thesubstringsstartwiththeprexandendwiththenextoccurrenceofthespecieddelimiter.
max-uploadsStringThemaximumnumberofmultipartuploadtaskstobereturnedinasinglerequest.
Themaximumvalueofthisparameteris1000.
Defaultvalue:1000.
320Issue:20200320ObjectStorageServiceAPIReference/8MultipartuploadoperationsParameterTypeDescriptionkey-markerStringThenameoftheobjectcorrespondingtothemultipartuploadtaskafterwhichthelistingbegins.
Thisparameterisusedtogetherwiththeupload-id-markerparameter.
Iftheupload-id-markerparameterisnotset,OSSreturnsallmultipartuploadtasksinwhichobjectnamescomeafterthekey-markervalueinalphabeticalorder.
Iftheupload-id-markerparameterisset,theresponseincludesthefollowingtasks:-Multipartuploadtasksinwhichobjectnamescomeafterthekey-markervalueinalphabeticalorder-Multipartuploadtasksinwhichobjectnamesareequaltothekey-markerparametervalueinalphabeticalorderbutuploadIDsaregreaterthantheupload-id-markerparametervalueIssue:20200320321ObjectStorageServiceAPIReference/8MultipartuploadoperationsParameterTypeDescriptionprefixStringTheprextobecontainedinthenamesofreturnedobjectssothatonlyobjectswiththespeciedprexarelisted.
Notethatthereturnedobjectnamescontaintheprexthatisspeciedintherequest.
Note:Youcanuseprexestogroupandmanageobjectsinbucketinthesamewayyoumanageafolderinalesystem.
322Issue:20200320ObjectStorageServiceAPIReference/8MultipartuploadoperationsParameterTypeDescriptionupload-id-markerStringTheuploadIDofthemultipartuploadtaskafterwhichthelistingbegins.
Ifthekey-markerparameterisnotset,OSSignorestheupload-id-markerparameter.
Ifthekey-markerparameterisset,theresponseincludesthefollowingtasks:-Multipartuploadtasksinwhichobjectnamescomeafterthekey-markervalueinalphabeticalorder-Multipartuploadtasksinwhichobjectnamesareequaltothekey-markerparametervalueinalphabeticalorderbutuploadIDsaregreaterthantheupload-id-markerparametervalueIssue:20200320323ObjectStorageServiceAPIReference/8MultipartuploadoperationsParameterTypeDescriptionencoding-typeStringTheencodingtypeoftheobjectnameintheresponse.
ValuesofDelimiter,KeyMarker,Prex,NextKeyMarker,andKeycanbeencodedinUTF-8.
However,theXML1.
0standardcannotbeusedtoparsecertaincontrolcharacters,suchascharacterswithanASCIIvalue0to10.
Youcansettheencoding-typeparametertoencodevaluesofDelimiter,KeyMarker,Prex,NextKeyMarker,andKeyintheresponse.
Defaultvalue:nullResponseelementsElementTypeDescriptionListMultipartUploadsResultContainerThecontainerthatstorestheresponsetotheListMultipartUploadrequest.
Childnode:Bucket,KeyMarker,UploadIdMarker,NextKeyMarker,NextUploadIdMarker,MasUploads,Delimiter,Prex,CommonPrefixes,IsTruncated,andUploadParentnode:none324Issue:20200320ObjectStorageServiceAPIReference/8MultipartuploadoperationsElementTypeDescriptionBucketStringThenameofthebucket.
Parentnode:ListMultipartUploadsResultEncodingTypeStringTheencodingtypeoftheobjectnameintheresponse.
Ifencoding-typeisspeciedintherequest,valuesofDelimiter,KeyMarker,Prex,NextKeyMarker,andKeyintheresponseareencoded.
Parentnode:ListMultipartUploadsResultKeyMarkerStringThenameoftheobjectcorrespondingtothemultipartuploadtaskafterwhichthelistingbegins.
Parentnode:ListMultipartUploadsResultUploadIdMarkerStringTheuploadIDofthemultipartuploadtaskafterwhichthelistingbegins.
Parentnode:ListMultipartUploadsResultNextKeyMarkerStringThevaluethatisusedforthekey-markerparameterinasubsequentrequestwhentheresponsedoesnotcontainallrequiredresults.
Parentnode:ListMultipartUploadsResultIssue:20200320325ObjectStorageServiceAPIReference/8MultipartuploadoperationsElementTypeDescriptionNextUploadMarkerStringThevaluethatisusedfortheupload-id-markerinasubsequentrequestwhentheresponsedoesnotcontainallrequiredresults.
Parentnode:ListMultipartUploadsResultMaxUploadsIntegerThemaximumnumberofuploadtasksreturnedbyOSS.
Parentnode:ListMultipartUploadsResultIsTruncatedBooleanIndicateswhetherthelistofmultipartuploadtasksreturnedintheresponseistruncated.
"true"indicatesthattheresponsedoesnotcontainallrequiredresults.
"false"indicatesthattheresponsecontainsallrequiredresults.
Validvalues:falseandtrueDefaultvalue:falseParentnode:ListMultipartUploadsResult326Issue:20200320ObjectStorageServiceAPIReference/8MultipartuploadoperationsElementTypeDescriptionUploadContainerThecontainerthatstorestheinformationaboutmultipartuploadtasks.
Childnode:Key,UploadId,andInitiatedParentnode:ListMultipartUploadsResultKeyStringTheobjectnameintheinitializedmultipartuploadtask.
Parentnode:UploadUploadIdStringTheIDofthemultipartuploadtask.
Parentnode:UploadInitiatedDateThetimewhenthemultipartuploadtaskwasinitialized.
Parentnode:UploadExamplesSamplerequestsGet/uploadsHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Thu,23Feb201206:14:27GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:JX75CtQqsmBBz+dcivn7kwBM****SampleresponsesHTTP/1.
1200Server:AliyunOSSConnection:keep-aliveContent-length:1839Content-type:application/xmlx-oss-request-id:58a41847-3d93-1905-20db-ba6f561c****Date:Thu,23Feb201206:14:27GMToss-exampleIssue:20200320327ObjectStorageServiceAPIReference/8Multipartuploadoperationsoss.
avi0004B99B8E707874FC2D692FA5D77D3F1000falsemultipart.
data0004B999EF518A1FE585B0C9360DC4C82012-02-23T04:18:23.
000Zmultipart.
data0004B999EF5A239BB9138C6227D6****2012-02-23T04:18:23.
000Zoss.
avi0004B99B8E707874FC2D692FA5D7****2012-02-23T06:14:27.
000ZSDKsYoucancallthisoperationwhenyouuseSDKdemosinanyofthefollowinglanguages:JavaGoC++PHP.
NET8.
8ListPartsYoucancallthisoperationtolistallpartsthathavebeenuploadedusingaspecieduploadID.
Note:TheresultsreturnedbyOSSarelistedinascendingorderoftheirpartnumbers.
Errorsmayoccurduringnetworktransmission.
Werecommendthatyoudonotusetheresults(partnumbersandETagvalues)ofListPartstogeneratethenalpartlistofCompleteMultipart.
328Issue:20200320ObjectStorageServiceAPIReference/8MultipartuploadoperationsRequestsyntaxGet/ObjectNameuploadId=UploadIdHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureRequestparametersParameterTypeDescriptionuploadIdStringTheIDofthemultipartuploadtask.
Defaultvalue:nullmax-partsIntegerThemaximumnumberofpartstolistintheOSSresponse.
Defaultvalue:1,000Maximumvalue:1,000part-number-markerIntegerThenumberofthepartafterwhichthelistingbegins.
Allpartswiththepartnumbersgreaterthanthevalueofthisparameterarelisted.
Defaultvalue:nullIssue:20200320329ObjectStorageServiceAPIReference/8MultipartuploadoperationsParameterTypeDescriptionEncoding-typeStringTheencodingtypeoftheobjectnameintheresponse.
TheobjectnamecancontainanycharactersencodedinUTF-8.
However,theXML1.
0standardcannotbeusedtoparsecertaincontrolcharacters,suchascharacterswithanASCIIvaluefrom0to10.
YoucansettheEncoding-typeparametertoencodethereturnedobjectname.
Setthevaluetourl.
Defaultvalue:nullValidvalue:urlResponseelementsElementTypeDescriptionListPartsResultContainerThecontainerthatstorestheresponsetotheListPartsrequest.
Childnode:Bucket,Key,UploadId,PartNumberMarker,NextPartNumberMarker,MaxParts,IsTruncated,andPartParentnode:noneBucketStringThenameofthebucket.
Parentnode:ListPartsResult330Issue:20200320ObjectStorageServiceAPIReference/8MultipartuploadoperationsElementTypeDescriptionEncodingTypeStringTheencodingtypeoftheobjectnameintheresponse.
IftheEncoding-typeparameterisspeciedintherequest,theobjectnameintheresponseisencoded.
Parentnode:ListPartsResultKeyStringThenameoftheobjectParentnode:ListPartsResultUploadIdStringTheIDoftheuploadtask.
Parentnode:ListPartsResultPartNumberMarkerIntegerThenumberofthepartafterwhichthelistingbegins.
Allpartswiththepartnumbersgreaterthanthevalueofthisparameterarelisted.
Parentnode:ListPartsResultNextPartNumberMarkerIntegerThenumberofthepartafterwhichthenextlistingbegins.
Iftheresponsedoesnotcontainallrequiredresults,allpartswiththepartnumbersgreaterthanthevalueofthisparameterarelisted.
Parentnode:ListPartsResultIssue:20200320331ObjectStorageServiceAPIReference/8MultipartuploadoperationsElementTypeDescriptionMaxPartsIntegerThemaximumnumberofpartsintheresponse.
Parentnode:ListPartsResultIsTruncatedBooleanIndicateswhetherthelistofpartsreturnedintheresponsehasbeentruncated.
"true"indicatesthattheresponsedoesnotcontainallrequiredresults.
"false"indicatesthattheresponsecontainsallrequiredresults.
Validvalues:trueandfalseParentnode:ListPartsResultPartStringThecontainerthatstoresinformationaboutthepart.
Childnode:PartNumber,LastModied,ETag,andSizeParentnode:ListPartsResultPartNumberIntegerThenumberthatidentiesapart.
Parentnode:ListPartsResult.
Part332Issue:20200320ObjectStorageServiceAPIReference/8MultipartuploadoperationsElementTypeDescriptionLastModifiedDateThetimewhenthepartwasuploaded.
Parentnode:ListPartsResult.
PartETagStringTheETagvalueoftheuploadedpart.
Parentnode:ListPartsResult.
PartSizeIntegerThesizeoftheuploadedpart.
Parentnode:ListPartsResult.
PartExamplesSamplerequestsGet/multipart.
datauploadId=0004B999EF5A239BB9138C6227D69F95HTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Thu,23Feb201207:13:28GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:4qOnUMc9UQWqkz8wDqD3lIsa9P8=SampleresponsesHTTP/1.
1200Server:AliyunOSSConnection:keep-aliveContent-length:1221Content-type:application/xmlx-oss-request-id:106452c8-10ff-812d-736e-c865294afc1cDate:Thu,23Feb201207:13:28GMTmultipart_uploadmultipart.
data0004B999EF5A239BB9138C6227D69F9551000false12012-02-23T07:01:34.
000Z"3349DC700140D7F86A0784842780****"6291456Issue:20200320333ObjectStorageServiceAPIReference/8Multipartuploadoperations22012-02-23T07:01:12.
000Z"3349DC700140D7F86A0784842780****"629145652012-02-23T07:02:03.
000Z"7265F4D211B56873A381D321F586****"1024SDKsYoucancallthisoperationwhenyouuseSDKdemosinanyofthefollowinglanguages:JavaPHPGoC.
NET334Issue:20200320ObjectStorageServiceAPIReference/9Cross-OriginResourceSharing9Cross-OriginResourceSharing9.
1IntroductionCross-OriginResourceSharing(CORS)allowswebapplicationstoaccessresourcesinotherregions.
WiththeCORSsupport,OSSallowsuserstodevelopmoreexiblewebapplications.
OSSprovidesinterfacesfordeveloperstoeasilycontrolvariouspermissionsforcross-domainaccess.
9.
2PutBucketcorsSetsaCORSruleforaspeciedbucket.
Ifarulehasbeensetforthebucket,itisoverwritten.
RequestsyntaxPUT/corsHTTP/1.
1Date:GMTDateContent-Length:ContentLengthContent-Type:application/xmlHost:BucketName.
oss-cn-hangzhou.
aliyuncs.
comAuthorization:SignatureValuetheoriginyouwantallowCORSrequestfrom…HTTPmethod…headersthatallowedbrowsertosend…headersinresponsethatcanaccessfromclientapp…timetocachepre-fightresponse……Issue:20200320335ObjectStorageServiceAPIReference/9Cross-OriginResourceSharingRequestelementsElementTypeRequiredDescriptionCORSRuleContainerYesSpeciesthecontainerthatstoresCORSrules.
Amaximumof10rulescanbesetforabucket.
Parentnode:CORSCongurationAllowedOriginStringYesSpeciestheallowedoriginsfromwhichthecross-domainrequestsareinitiated.
Youcanusemultipleelementstospecifymultipleallowedorigins.
Eachruleallowsuptoonewildcard(*),whichindicatesthatcross-domainrequestsfromalloriginsareallowed.
Parentnode:CORSRuleAllowedMethodenumeration(GET,PUT,DELETE,POST,HEAD)YesSpeciestheallowedmethodsforcross-domainrequests.
Parentnode:CORSRule336Issue:20200320ObjectStorageServiceAPIReference/9Cross-OriginResourceSharingElementTypeRequiredDescriptionAllowedHeaderStringNoControlswhethertheheadersspeciedbyAccess-Control-Request-HeadersintheOPTIONSprefetchcommandareallowed.
EachheaderspeciedbyAccess-Control-Request-HeadersmustmatchavalueinAllowedHeader.
Eachruleallowsuptoonewildcard(*).
Parentnode:CORSRuleExposeHeaderStringNoSpeciestheresponseheadersthatcanbeaccessedbyfromanapplication(forexample,aJavascriptXMLHttpRequestobject).
Thewildcard(*)isnotallowed.
Parentnode:CORSRuleIssue:20200320337ObjectStorageServiceAPIReference/9Cross-OriginResourceSharingElementTypeRequiredDescriptionMaxAgeSecondsIntegerNoSpeciesthecachetime(inseconds)ofabrowserusedtorespondaprefetch(OPTIONS)requesttoaspecicresource.
OnlyoneofthisparameterisallowedinaCORSRule.
Parentnode:CORSRuleCORSConfigurationContainerYesSpeciesthecontainerthatstorestheCORSrulesforabucket.
Parentnode:NoneDetailanalysisCORSisdisabledforbucketsbydefault,thatis,cross-domainrequestsfromanyoriginareforbidden.
TouseCORSinapplications,forexample,accessingOSSfromwww.
a.
comthroughtheXMLHttpRequestfunctionofthebrowser,youmustmanuallyuploadaCORSrulethroughthisinterfacetoenableCORS.
ThisruleisdescribedinanXMLdocument.
TheCORSsettingsforeachbucketisspeciedbymultipleCORSrules.
Amaximumof10CORSrulescanbesetforabucket.
TheuploadedXMLdocumentcannotbelargerthan16KB.
Whenreceivingacross-domainrequest(oranOPTIONSrequest),OSSreadstheCORSrulesforthebucketandthenchecksrelatedpermissions.
OSScheckseachrulesequentiallyandusestherstrulethatmatchestherequesttoapprovetherequestandreturnthecorrespondingheader.
Ifnoneoftherulesmatchtherequest,OSSdoesnotincludeanyCORSheaderintheresponse.
338Issue:20200320ObjectStorageServiceAPIReference/9Cross-OriginResourceSharingThefollowingconditionsmustbemetbeforeOSSdeterminesthataCORSrulematchestherequest:-TheoriginfromwhichtherequestisinitiatedmustmatchthevalueofAllowOriginoftheCORSrule.
-Themethodoftherequest(suchasGETorPUT)orthemethodcorrespondingtotheAccess-Control-Request-MethodheaderinanOPTIONSrequestmustmatchthevalueofAllowedMethodoftheCORSrule.
-EachheaderincludedintheAccess-Control-Request-HeadersheaderinanOPTIONSrequestmustmatchthevalueofAllowedHeaderoftheCORSrule.
IfyouincludetheContent-MD5headerintherequest,OSScalculatestheContent-MD5oftherequestbodyandcheckswhetherthetwovaluesarethesame.
Ifthetwovaluesaredierent,theerrorcodeInvalidDigestisreturned.
ExamplesRequestexampleofaddingabucketCORSrule:PUT/corsHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comContent-Length:186Date:Fri,04May201203:21:12GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:KU5h8YMUC78M30dXqf3JxrTZHiA=*PUTGETAuthorizationhttp://www.
a.
comhttp://www.
b.
comGETAuthorizationx-oss-testx-oss-test1100Responseexample:HTTP/1.
1200OKx-oss-request-id:50519080C4689A033D00235FDate:Fri,04May201203:21:12GMTContent-Length:0Connection:keep-aliveIssue:20200320339ObjectStorageServiceAPIReference/9Cross-OriginResourceSharingServer:AliyunOSS9.
3GetBucketCORSYoucancallthisoperationtoquerythecurrentcross-originresourcesharing(CORS)rulesofaspecicbucket.
RequestsyntaxGET/corsHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDateAuthorization:SignatureValueResponseelementsElementTypeDescriptionCORSRuleContainerIndicatesthecontainerthatstoresCORSrules.
Amaximumof10rulescanbeconguredforabucket.
Parentnode:CORSCongurationAllowedOriginStringIndicatesthesourcesfromwhichcross-originrequestsareallowed.
IfAllowedOriginissettoanasterisk(*),cross-originrequestsfromallsourcesareallowed.
Parentnode:CORSRuleAllowedMethodEnumeration(GET,PUT,DELETE,POST,andHEAD)Indicatesthecross-originrequestmethodsthatareallowed.
Parentnode:CORSRuleAllowedHeaderStringIndicateswhethertheheadersspeciedbyAccess-Control-Request-HeadersintheOPTIONSprefetchcommandareallowed.
EachheaderspeciedbyAccess-Control-Request-HeadersmustmatchavalueofAllowedHeader.
Parentnode:CORSRule340Issue:20200320ObjectStorageServiceAPIReference/9Cross-OriginResourceSharingElementTypeDescriptionExposeHeaderStringIndicatestheresponseheadersforallowedaccessrequestsfromapplications,suchasaJavaScriptXMLHttpRequestobject.
Parentnode:CORSRuleMaxAgeSecondsIntegerIndicatestheperiodoftimethatthebrowsercancachetheresponsetoapreight(OPTIONS)requesttoaspecicresource.
OnlyoneMaxAgeSecondsparameterisallowedinoneCORSrule.
Unit:secondsParentnode:CORSRuleCORSConfigurationContainerIndicatesthecontainerthatstorestheCORSrulesforabucket.
Parentnode:noneExamplesSamplerequestsGet/corsHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Thu,13Sep201207:51:28GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:BuG4rRK+zNhH1AcF51NNHD39****SampleresponsesHTTP/1.
1200x-oss-request-id:50519080C4689A033D00****Date:Thu,13Sep201207:51:28GMTConnection:keep-aliveContent-Length:218Server:AliyunOSS*GET*x-oss-test100Issue:20200320341ObjectStorageServiceAPIReference/9Cross-OriginResourceSharingSDKsTheSDKsoftheGetBucketCORSoperationforvariousprogramminglanguagesareasfollows:JavaPythonPHPGoC++C.
NETNode.
jsRubyErrorcodesErrorcodeHTTPstatuscodeDescriptionNoSuchBucket404Theerrormessagereturnedbecausethespeciedbucketdoesnotexist.
NoSuchCORSConguration404TheerrormessagereturnedbecausethespeciedCORSruledoesnotexist.
AccessDenied403Theerrormessagereturnedbecauseyouarenotauthorizedtoperformthisoperation.
OnlytheownerofabucketcanquerytheCORSrulesconguredforthebucket.
9.
4DeleteBucketCORSYoucancallthisoperationtodisablethecross-originresourcesharing(CORS)functionforaspecicbucketandclearsallCORSrules.
RequestsyntaxDELETE/corsHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTDate342Issue:20200320ObjectStorageServiceAPIReference/9Cross-OriginResourceSharingAuthorization:SignatureValueExamplesSamplerequestsDELETE/corsHTTP/1.
1Host:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Fri,24Feb201205:45:34GMTAuthorization:OSSqn6qrrqxo2oawuk53otfjbyc:LnM4AZ1OeIduZF5vGFWicOME****SampleresponsesHTTP/1.
1204NoContentx-oss-request-id:5051845BC4689A033D00****Date:Fri,24Feb201205:45:34GMTConnection:keep-aliveContent-Length:0Server:AliyunOSSSDKsTheSDKsoftheDeleteBucketCORSoperationforvariousprogramminglanguagesareasfollows:JavaPythonPHPGoC++C.
NETNode.
jsRubyErrorcodesErrorcodeHTTPstatuscodeDescriptionNoSuchBucket404Theerrormessagereturnedbecausethespeciedbucketdoesnotexist.
Issue:20200320343ObjectStorageServiceAPIReference/9Cross-OriginResourceSharingErrorcodeHTTPstatuscodeDescriptionAccessDenied403Theerrormessagereturnedbecauseyouarenotauthorizedtoperformthisoperation.
OnlytheownerofabucketcandeletetheCORSrulesconguredforthebucket.
9.
5OptionObjectBeforesendingacross-domainrequest,thebrowsersendsapreightrequest(OPTIONS)containingaspeciedorigin,HTTPmethod,andheaderinformationtoOSStodeterminewhethertosendarealrequest.
OSScanenableCORSforabucketthroughPutBucketcors.
AfterCORSisenabledforabucket,OSSdetermineswhethertoallowthepreightrequestsentfromthebrowserbasedonthespeciedCORSrules.
IfOSSdoesnotallowtherequestorCORSisdisabledforthebucket,the403Forbiddenerrorisreturned.
RequestsyntaxOPTIONS/ObjectNameHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comOrigin:OriginAccess-Control-Request-Method:HTTPmethodAccess-Control-Request-Headers:RequestHeadersRequestheaderHeaderTypeDescriptionOriginStringSpeciestheoriginofarequest,whichisusedtoidentifyacross-domainrequest.
Defaultvalue:NoneAccess-Control-Request-MethodStringSpeciesthemethodstobeusedinarealrequest.
Defaultvalue:None344Issue:20200320ObjectStorageServiceAPIReference/9Cross-OriginResourceSharingHeaderTypeDescriptionAccess-Control-Request-HeadersStringSpeciestheheaders(exceptforsimpleheaders)tobeusedinarealrequest.
Defaultvalue:NoneResponseheaderHeaderTypeDescriptionAccess-Control-Allow-OriginStringIndicatestheorigincontainedintherequest.
Thisheaderisnotcontainediftherequestisnotallowed.
Access-Control-Allow-MethodsStringIndicatestheHTTPmethodusedbytherequest.
Thisheaderisnotcontainedifthisrequestisnotallowed.
Access-Control-Allow-HeadersStringIndicatesthelistofallowedheadersintherequest.
Iftherequestcontainsforbiddenheaders,thisheaderisnotcontainedandtherequestisrejected.
Access-Control-Expose-HeadersStringIndicatesthelistofheadersthatcanbeaccessedbytheclient'sJavaScriptapplication.
Access-Control-Max-AgeIntegerIndicatestheallowedtimeduration(inseconds)requiredforthebrowsertobuerthepreightresults.
ExamplesRequestexample:OPTIONS/testobjectHTTP/1.
1Issue:20200320345ObjectStorageServiceAPIReference/9Cross-OriginResourceSharingHost:oss-example.
oss-cn-hangzhou.
aliyuncs.
comDate:Fri,24Feb201205:45:34GMTOrigin:http://www.
example.
comAccess-Control-Request-Method:PUTAccess-Control-Request-Headers:x-oss-testResponseexample:HTTP/1.
1200OKx-oss-request-id:5051845BC4689A033D0022BCDate:Fri,24Feb201205:45:34GMTAccess-Control-Allow-Origin:http://www.
example.
comAccess-Control-Allow-Methods:PUTAccess-Control-Expose-Headers:x-oss-testConnection:keep-aliveContent-Length:0Server:AliyunOSS346Issue:20200320ObjectStorageServiceAPIReference/10LiveChannel-relatedoperations10LiveChannel-relatedoperations10.
1OverviewYoucanuploadaudioandvideodatatoOSSthroughtheRTMPprotocolandstorethedataasaudioandvideolesinspeciedformats.
Beforeuploadingaudioandvideodata,youmustcreateaLiveChanneltoobtaintheURLusedtopushvideooraudiostreams.
WhenuploadingaudioandvideodatatoOSSthroughtheRTMPprotocol,youmustpayattentiontothefollowinglimits:ByusingtheRTMPprotocol,youcanonlypushvideooraudiostreamsbutnotpullthestreams.
ALiveChannelmustincludeavideostreaminH264format.
AudiostreamsareoptionalinaLiveChannel.
OnlyaudiostreamsintheAACformataresupported.
Audiostreamsinotherformatsarediscarded.
OnlytheHLSprotocolissupportedtostoretheuploadedvideoandaudiodataaslesinspeciedformats.
OnlyoneclientcanpushstreamstoaLiveChannelatthesametime.
10.
2RTMPingestURLsandsignaturesThistopicdescribesRTMPingestURLsandtheirsignaturemethod.
Note:YoumustaddasignaturetoaRTMPingestURLonlywhenthebucketACLisnotsettopublic-read-write.
ThesignaturemethodofRTMPingestURLsissimilartothatofOSSURLs.
ARTMPingestURLmustbeinrtmp://${bucket}.
${host}/live/${channel}${params}format.
Example:rtmp://your-bucket.
oss-cn-hangzhou.
aliyuncs.
com/live/test-channel.
live:thenameoftheappforRTMP.
OSSuses"live"forRTMPingest.
params:theingestparameter.
ItsformatmustbethesameasthequerystringofanHTTPrequest.
Example:varA=valueA&varB=valueB.
Issue:20200320347ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsRTMPingestURLparametersThefollowingtabledescribestheparametersinRTMPingestURLs.
ParameterDescriptionplaylistNameSpeciesthenameofthegeneratedM3U8le.
ThevalueofthisparameteroverwritesthevaluespeciedintheLiveChannelsettings.
Note:ThegeneratedM3U8lewillstillcontainthe${channel_name}/prex.
SignaturemethodofRTMPingestURLsAsignedRTMPingestURLisinrtmp://${bucket}.
${host}/live/${channel}OSSAccessKeyId=xxx&Expires=yyy&Signature=zzz&${params}format.
ThefollowingtabledescribestheparametersinsignedRTMPingestURLs.
ParameterDescriptionOSSAccessKeyIdAssumesthesameroleastheAccessKeyIdinthesignedHTTPrequest.
ExpiresTheexpirationtimeoftheURL.
ThetimestampfollowstheUNIXtimeformat.
SignatureThesignaturestring.
paramsOtherparameters.
Note:Allparametersmustbeincludedinthesignature.
Thesignaturecalculationrulesareasfollows:base64(hmac-sha1(AccessKeySecret,+Expires+"\n"+CanonicalizedParams+CanonicalizedResource))Thefollowingtabledescribestheparametersinvolvedinthesignaturecalculation.
348Issue:20200320ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsParameterDescriptionCanonicalizedResourceThevalueofthisparameterisin/BucketName/ChannelNameformat.
CanonicalizedParamsThecanonicalizedquerystringcreatedbyarrangingtheparameterkeysinalphabeticalorder.
Parametersmustbeinkey:value\nformat.
Note:Thevalueofthisparameterisnulliftherearenoparameters.
SecurityToken,OSSAccessKeyId,Expire,andSignaturearenotusedforcreatingacanonicalizedquerystring.
Everyparameterkeyisusedinthestringonlyonce.
10.
3PutLiveChannelBeforeuploadingaudioorvideodatatoOSSthroughtheRTMPprotocol,youmustusePutLiveChanneltocreateaLiveChannel.
PutLiveChannelreturnsaURLusedtopushstreamsthroughtheRTMPprotocolandaURLusedtoplaytheuploadeddata.
YoucanusetheURLsreturnedbyPutLiveChanneltopushstreamsandplaytheuploadeddata.
Inaddition,youcanperformoperationsonthecreatedLiveChannel,suchasquerythestreampushingstatus,querystreampushingrecords,ordisablestreampushing.
RequestsyntaxPUT/ChannelNameliveHTTP/1.
1Host:BucketName.
oss-cn-hangzhou.
aliyuncs.
comDate:GMTdateContent-Length:SizeAuthorization:SignatureValueChannelDescriptionChannelStatusHLSFragDurationFragCountPlaylistNameIssue:20200320349ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsSnapshotramroleSnapshotdestbucketNotifytopicofMNSSnapshotintervalinsecondRequestelementsElementTypeDescriptionRequiredLiveChannelConfigurationContainerSpeciesthecontainerusedtostorethesettingsoftheLiveChannel.
Sub-node:Description、Status、TargetParentnode:NoneYesDescriptionStringSpeciesthedescriptionoftheLiveChannel,whichis128bytesinmaximum.
Sub-node:NoneParentnode:LiveChannelCongurationNoStatusEnumeratedstringSpeciesthestatusoftheLiveChannel.
Sub-node:NoneParentnode:LiveChannelCongurationValidvalues:enabledanddisabledDefaultvalue:enabledNo350Issue:20200320ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsElementTypeDescriptionRequiredTargetContainerSpeciesthecontainerusedtostorethesettingsforstoringuploadeddata.
Sub-node:Type,FragDuration,FragCount,andPlaylistNameParentnode:LiveChannelCongurationYesTypeEnumeratedstringSpeciestheformatthattheuploadeddataisstoredas.
Sub-node:NoneParentnode:TargetValidvalue:HLSYesFragDurationStringSpeciestheduration(inseconds)ofeachtslewhenthevalueofTypeisHLS.
Sub-node:NoneParentnode:TargetDefaultvalue:5Valuerange:[1,100]NoFragCountStringSpeciesthenumberoftslesincludedinthem3u8lewhenthevalueofTypeisHLS.
Sub-node:NoneParentnode:TargetDefaultvalue:3Valuerange:[1,100]NoIssue:20200320351ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsElementTypeDescriptionRequiredPlaylistNameStringSpeciesthenameofthem3u8legeneratedwhenthevalueofTypeisHLS.
Thenamemustbeendedwith".
m3u8"andinthefollowinglengthrange:[6,128].
Sub-node:NoneParentnode:TargetDefaultvalue:playlist.
m3u8Valuerange:[6,128]NoSnapshotContainerSpeciesthecontainerusedtostoretheSnapshot(high-frequentsnapshotoperation)options.
Sub-node:RoleName,DestBucket,NotifyTopic,Interval,andPornRecParentnode:SnapshotNoRoleNameStringSpeciesthenameoftherolewhoperformsthehigh-frequentsnapshotoperations.
TherolemusthavethepermissiontowritedataintoDestBucketandsendmessagestoNotifyTopic.
Sub-node:NoneParentnode:SnapshotNoDestBucketStringSpeciesthebucketwherethesnapshotsarestored.
TheDestBucketandthecurrentbucketmustbeownedbythesameuser.
Sub-node:NoneParentnode:SnapshotNo352Issue:20200320ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsElementTypeDescriptionRequiredNotifyTopicStringSpeciesthetopicoftheMNSusedtonotifytheuseroftheresultofhigh-frequentsnapshotoperations.
Sub-node:NoneParentnode:SnapshotNoIntervalNumericSpeciestheinterval(inseconds)betweeneachsnapshotoperation.
Ifnokeyframe(I-frame)existsinaninterval,nosnapshotiscapturedintheinterval.
Sub-node:NoneParentnode:SnapshotValuerange:[1,100]NoDetailanalysisChannelNamemustconformtothenamingconventionsforobjectsandcannotinclude"/".
ThedefaultvaluesofFragDurationandFragCounttakeeectonlywhenthevaluesarebothnotspecied.
Ifyouspecifythevalueofoneofthetwoparameters,thevalueoftheothermustalsobespecied.
IfthevalueofTypeisHLS,OSSupdatesthegeneratedm3u8leeachtimewhenatsleisgenerated.
Thenumberofnewly-generatedtslesincludedinthem3u8leisspeciedbyFragCount.
IfthevalueofTypeisHLS,whenthedurationofthevideooraudiodatainthecurrenttslereachesthevalueofFragDuration,OSSgeneratesanewtslewhenreceivingthenextkeyframe.
IfOSSdoesnotreceivethenextkeyframewithinatimeperoid(calculatedbymax(2*FragDuration,60s)),anewtsleisgenerated,whichresultslaginaudioorvideoplaying.
Issue:20200320353ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsResponseelementElementTypeDescriptionCreateLiveChannelResultContainerSpeciesthecontainerusedtostoretheresponsefotheCreateLiveChannelrequest.
Sub-nodes:PublishUrlsandPlayUrlsParentnode:NonePublishUrlsContainerSpeciesthecontainerusedtostorethestreampushingURL.
Sub-node:UrlParentnode:CreateLiveChannelResultUrlStringSpeciesthestreampushingURL.
Sub-node:NoneParentnode:PublishUrlsPlayUrlsContainerSpeciesthecontainerusedtostorethestreampushingURL.
Sub-node:UrlParentnode:CreateLiveChannelResultUrlStringSpeciestheURLusedtoplaytheaudioorvideodata.
Sub-node:NoneParentnode:PlayUrlsDetailanalysisThestreampushingURLisnotsigned.
IftheACLforthebucketisnotpublic-read-write,youmustsigntheURLbeforeaccessingit.
354Issue:20200320ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsTheURLusedtoplaytheaudioorvideodataisnotsigned.
IftheACLforthebucketisprivate,youmustsigntheURLbeforeaccessingit.
ExamplesRequestexamplePUT/test-channelliveHTTP/1.
1Date:Wed,24Aug201611:11:28GMTContent-Length:333Host:test-bucket.
oss-cn-hangzhou.
aliyuncs.
comAuthorization:OSSYJjHKOKWDWINLKXv:hvwOZJRh8toAj3DZvtsuPgf+agA=enabledHLS23role_for_snapshotsnapshotdestsnapshotnotify1ResponseexampleHTTP/1.
1200content-length:259server:AliyunOSSx-oss-server-time:4connection:closex-oss-request-id:57BD8419B92475920B0002F1date:Wed,24Aug201611:11:28GMTx-oss-bucket-storage-type:standardcontent-type:application/xmlrtmp://test-bucket.
oss-cn-hangzhou.
aliyuncs.
com/live/test-channelhttp://test-bucket.
oss-cn-hangzhou.
aliyuncs.
com/test-channel/playlist.
m3u8Issue:20200320355ObjectStorageServiceAPIReference/10LiveChannel-relatedoperations10.
4ListLiveChannelListsspeciedLiveChannels.
RequestsyntaxGET/liveHTTP/1.
1Date:GMTdateHost:BucketName.
oss-cn-hangzhou.
aliyuncs.
comAuthorization:SignatureValueRequestparameterParameterDescriptionRequiredmarkerIndicatesthattheresultsafterthemarkerarereturnedinalphabeticalorder.
Nomax-keysSpeciesthemaximumnumberofthereturnedLiveChannels.
Defaultvalue:100Maximumvalue:1000NoprefixSpeciesthatonlyLiveChannelswiththeprexarereturned.
WhenyouusetheprexparametertoqueryLiveChannels,itisalsoincludedinthereturnedkeys.
No356Issue:20200320ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsResponseelementsElementTypeDescriptionListLiveChannelResultContainerSpeciesthecontainerthatstorestheresponsetotheListLiveChannelrequest.
Sub-node:Prex,Marker,MaxKeys,andIsTruncated,NextMarker,andLiveChannelParentnode:NonePrefixStringSpeciestheprexofthequeryresult.
Sub-node:NoneParentnode:ListLiveChannelResultMarkerStringIndicatesthattheLiveChannelsafterthemarkerinalphabeticalorderarereturned.
Sub-node:NoneParentnode:ListLiveChannelResultMaxKeysStringSpeciesthemaximumnumberofreturnedLiveChannelsintheresponse.
Sub-node:NoneParentnode:ListLiveChannelResultIssue:20200320357ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsElementTypeDescriptionIsTruncatedStringIndicateswhetherallresultsarereturned.
Thevaluetrueindicatesthatnotallresultsarereturned,andvaluefalseindicatesthatallresultsarereturned.
Sub-node:NoneParentnode:ListLiveChannelResultNextMarkerStringIfnotallresultsarereturned,thiselementisincludedintheresponsetoindicatesthevalueofMarkerforthenextrequest.
Sub-node:NoneParentnode:ListLiveChannelResultLiveChannelContainerSpeciesthecontainerthatstorestheinformationaboutareturnedLiveChannel.
Sub-node:Name,Description,Status,LastModied,PublishUrls,andPlayUrlsParentnode:ListLiveChannelResultNameStringIndicatesthenameofthereturnedLiveChannel.
Sub-node:NoneParentnode:LiveChannel358Issue:20200320ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsElementTypeDescriptionDescriptionStringSpeciesthedescriptionofthereturnedLiveChannel.
Sub-node:NoneParentnode:LiveChannelStatusEnumeratedstringIndicatesthestatusofthereturnedLiveChannel.
Sub-node:NoneParentnode:LiveChannelValidvalue:disabledandenabledLastModifiedStringIndicatesthelastmodicationtimeofthereturnedLiveChannel.
ThevalueofthisparameterisinISO8601format.
Sub-node:NoneParentnode:LiveChannelPublishUrlsContainerSpeciesthecontainerthatstorestheURLusedtopushastreamtotheLiveChannel.
Sub-node:UrlParentnode:LiveChannelUrlStringSpeciestheURLusedtopushastreamtotheLiveChannel.
Sub-node:NoneParentnode:PublishUrlsIssue:20200320359ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsElementTypeDescriptionPlayUrlsContainerSpeciesthecontainerthatstorestheURLusedtoplayastreampushedtotheLiveChannel.
Sub-node:UrlParentnode:LiveChannelUrlStringSpeciestheURLusedtoplaythestreampushedtotheLiveChannel.
Sub-node:NoneParentnode:PlayUrlsExamplesRequestexampleGET/live&max-keys=1HTTP/1.
1Date:Thu,25Aug201607:50:09GMTHost:test-bucket.
oss-cn-hangzhou.
aliyuncs.
comAuthorization:OSSYJjHKOKWDWINLKXv:TaX+tlc/Xsgpz6uRuqcbmUJsIHw=ResponseexampleHTTP/1.
1200content-length:656server:AliyunOSSconnection:closex-oss-request-id:57BEA331B92475920B00245Edate:Thu,25Aug201607:50:09GMTcontent-type:application/xml1truechannel-0channel-0disabled2016-07-30T01:54:21.
000Zrtmp://test-bucket.
oss-cn-hangzhou.
aliyuncs.
com/live/channel-0http://test-bucket.
oss-cn-hangzhou.
aliyuncs.
com/channel-0/playlist.
m3u8360Issue:20200320ObjectStorageServiceAPIReference/10LiveChannel-relatedoperations10.
5DeleteLiveChannelDeletesthespeciedLiveChannel.
RequestsyntaxDELETE/ChannelNameliveHTTP/1.
1Date:GMTdateHost:BucketName.
oss-cn-hangzhou.
aliyuncs.
comAuthorization:SignatureValueDetailanalysisADeleteLiveChannelrequestfailsonlywhenaclientispushingastreamtotheLiveChannel.
DeleteLiveChannelonlydeletestheLiveChannelbutnotthelesgeneratedbythestreamspushedtotheLiveChannel.
ExamplesRequestexampleDELETE/test-channelliveHTTP/1.
1Date:Thu,25Aug201607:32:26GMTHost:test-bucket.
oss-cn-hangzhou.
aliyuncs.
comAuthorization:OSSYJjHKOKWDWINLKXv:ZbfvQ3XwmYEE8O9CX8kwVQYNbzQ=ResponseexampleHTTP/1.
1204content-length:0server:AliyunOSSconnection:closex-oss-request-id:57BE9F0AB92475920B0023E0date:Thu,25Aug201607:32:26GMT10.
6PutLiveChannelStatusALiveChannelcanbeenabledordisabled.
YoucanusePutLiveChannelStatustoswitchthestatusofaLiveChannel.
IfaLiveChannelisinthedisabledstatus,youcannotpushstreamstotheLiveChannel.
IfyouarepushingastreamtoaLiveChannelwhenthestatusoftheLiveChannelisswitchedtodisabled,yourclientisdisconnectedfromtheLiveChannel(theremaybeadelayof10seconds).
Issue:20200320361ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsRequestsyntaxPUT/ChannelNamelive&status=NewStatusHTTP/1.
1Date:GMTdateHost:BucketName.
oss-cn-hangzhou.
aliyuncs.
comAuthorization:SignatureValueRequestparameterParameterDescriptionRequiredNewStatusSpeciesthestatusoftheLiveChannel.
Validvalues:enabledanddisabledYesDetailanalysisIfnoclientispushingstreamstoaLivaChannel,youcanswitchthestatusoftheLiveChannelbyusingPutLiveChannel,whichcreatesanewLiveChannel.
IfastreamisbeingpushedtoaLiveChannelbyotherclients,youcannotusePutLiveChanneltocreateanewLiveChannel.
YoucanswitchthestatusoftheLiveChanneltodisabledonlybyusingPutLiveChannelStatus.
ExamplesRequestexamplePUT/test-channellive&status=disabledHTTP/1.
1Date:Thu,25Aug201605:37:38GMTHost:test-bucket.
oss-cn-hangzhou.
aliyuncs.
comAuthorization:OSSYJjHKOKWDWINLKXv:X/mBrSbkNoqM/JoAfRC0ytyQ5pY=ResponseexampleHTTP/1.
1200content-length:0server:AliyunOSSconnection:closex-oss-request-id:57BE8422B92475920B002030date:Thu,25Aug201605:37:39GMT10.
7GetLiveChannelInfoObtainsthecongurationinformationaboutaspeciedLiveChannel.
RequestsyntaxGET/ChannelNameliveHTTP/1.
1Date:GMTdate362Issue:20200320ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsHost:BucketName.
oss-cn-hangzhou.
aliyuncs.
comAuthorization:SignatureValueResponseelementElementTypeDescriptionLiveChannelConfigurationContainerSpeciesthecontainerthatstorestheresponsetotheGetLiveChannelInforequest.
Sub-node:Description,Status,andTargetParentnode:NoneDescriptionStringSpeciesthedescriptionoftheLiveChannel.
Sub-node:NoneParentnode:LiveChannelCongurationStatusEnumeratedstringIndicatesthestatusoftheLiveChannel.
Sub-node:NoneParentnode:LiveChannelCongurationValidvalue:enabledanddisabledTargetContainerSpeciesthecontainerusedtostorethesettingsforstoringuploadeddata.
Sub-node:Type,FragDuration,FragCount,andPlaylistNameParentnode:LiveChannelCongurationIssue:20200320363ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsElementTypeDescriptionTypeEnumeratedstringSpeciestheformatthattheuploadeddataisstoredaswhenitsvalueisHLS.
Sub-node:NoneParent-node:TargetValidvalue:HLSFragDurationStringSpeciestheduration(inseconds)ofeachtslewhenthevalueofTypeisHLS.
Sub-node:NoneParentnode:TargetFragCountStringSpeciesthenumberoftslesincludedinthem3u8lewhenthevalueofTypeisHLS.
Sub-node:NoneParentnode:TargetPlaylistNameStringSpeciesthenameofthem3u8legeneratedwhenthevalueofTypeisHLS.
Sub-node:NoneParentnode:TargetDetailanalysisThesub-nodesofTarget,includingFragDuration,FragCount,andPlaylistName,arereturnedonlywhenthevalueofTypeisHLS.
ExamplesRequestexampleGET/test-channelliveHTTP/1.
1Date:Thu,25Aug201605:52:40GMT364Issue:20200320ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsHost:test-bucket.
oss-cn-hangzhou.
aliyuncs.
comAuthorization:OSSYJjHKOKWDWINLKXv:D6bDCRXKht58hin1BL83wxyGvl0=ResponseexampleHTTP/1.
1200content-length:475server:AliyunOSSconnection:closex-oss-request-id:57BE87A8B92475920B002098date:Thu,25Aug201605:52:40GMTcontent-type:application/xmlenabledHLS23playlist.
m3u810.
8GetLiveChannelStatObtainsthestreampushingstatusofaspeciedLiveChannel.
RequestsyntaxGET/ChannelNamelive&comp=statHTTP/1.
1Date:GMTdateHost:BucketName.
oss-cn-hangzhou.
aliyuncs.
comAuthorization:SignatureValueResponseelementElementTypeDescriptionLiveChannelStatContainerSpeciesthecontainerusedtostoretheresponsetotheGetLiveChannelStatrequest.
Sub-node:Status,ConnectedTime,Video,andAudioParentnode:NoneIssue:20200320365ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsElementTypeDescriptionStatusEnumeratedstringIndicatesthecurrentstreampushingstatusoftheLiveChannel.
Sub-node:NoneParentnode:LiveChannelStatValidvalue:Disabled,Live,andIdleConnnectedTimeStringIfthevalueofStatusisLive,thisparameterindicatesthetimewhenthecurrentclientstarttopushstreams.
ThevalueofthisparameterisintheISO8601format.
Sub-node:NoneParentnode:LiveChannelStatRemoteAddrStringIfthevalueofStatusisLive,thisparameterindicatestheIPaddressofthecurrentclientthatpushesstreams.
Sub-node:NoneParentnode:LiveChannelStat366Issue:20200320ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsElementTypeDescriptionVideoContainerIfthevalueofStatusisLive,thisparameterspeciesthecontainerthatstorestheinfomrationaboutthevideostream.
Sub-node:Width,Heigth,FrameRate,Bandwidth,andCodecParentnode:LiveChannelStatWidthStringIndicatesthewidth(inpixels)ofthecurrentvideostream.
Sub-node:NoneParentnode:VideoHeightStringIndicatestheheight(inpixels)ofthecurrentvideostreamSub-node:NoneParentnode:VideoFrameRateStringIndicatestheframerateofthecurrentvideostream.
Sub-node:NoneParentnode:VideoBandwidthStringIndicatesthebitrate(bit/s)ofthecurrentvideostream.
Sub-node:NoneParentnode:VideoIssue:20200320367ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsElementTypeDescriptionCodecEnumeratedstringIndicatesthecodecofthecurrentvideostream.
Sub-node:NoneParentnode:VideoAudioContainerIfthevalueofStatusisLive,thisparameterspeciesthecontainerthatstorestheinformationabouttheaudiostream.
Sub-node:SampleRate,Bandwidth,andCodecParentnode:LiveChannelStatSampleRateStringIndicatesthesamplingrateofthecurrentaudiostream.
Sub-node:NoneParentnode:AudioBandwidthStringIndicatesthebitrate(bit/s)ofthecurrentaudiostream.
Sub-node:NoneParentnode:AudioCodecEnumeratedstringIndicatesthecodecofthecurrentaudiostream.
Sub-node:NoneParentnode:AudioDetailanalysisTheVideoandAudiocontainersareonlyreturnedwhenthevalueofStatusisLive.
However,theymaynotbereturnedevenifthevalueofStatusisLive.
For368Issue:20200320ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsexample,theVideoandAudiocontainersarenotreturnedwhentheclientisconnectedtotheLiveChannelbutdoesnotstarttosendvideoandaudiodata.
Bandwidthindicatestheaveragebitrateofthevideooraudiostreamintherecentperiod.
ThevalueofBandwidthmaybe0immediatelyaftertheStatusoftheLiveChannelisswitchedtoLive.
ExamplesRequestexampe1GET/test-channellive&comp=statHTTP/1.
1Date:Thu,25Aug201606:22:01GMTHost:test-bucket.
oss-cn-hangzhou.
aliyuncs.
comAuthorization:OSSYJjHKOKWDWINLKXv:fOzwkAgVTVSO1VKLPIInQ0JYyOA=Responseexmample1HTTP/1.
1200content-length:100server:AliyunOSSconnection:closex-oss-request-id:57BE8E89B92475920B002164date:Thu,25Aug201606:22:01GMTcontent-type:application/xmlIdleRequestexample1GET/test-channellive&comp=statHTTP/1.
1Date:Thu,25Aug201606:25:26GMTHost:test-bucket.
oss-cn-hangzhou.
aliyuncs.
comAuthorization:OSSYJjHKOKWDWINLKXv:WeC5joEaRzfSSS8xK0tlo7WTK1I=Responseexample2HTTP/1.
1200content-length:469server:AliyunOSSconnection:closex-oss-request-id:57BE8F56B92475920B002187date:Thu,25Aug201606:25:26GMTcontent-type:application/xmlLive2016-08-25T06:25:15.
000Z10.
1.
2.
3:477451280536240H264Issue:20200320369ObjectStorageServiceAPIReference/10LiveChannel-relatedoperations044100ADPCM10.
9GetLiveChannelHistoryObtainsthestreampushingrecordofaLiveChannel.
RequestsyntaxGET/ChannelNamelive&comp=historyHTTP/1.
1Date:GMTdateHost:BucketName.
oss-cn-hangzhou.
aliyuncs.
comAuthorization:SignatureValueResponseelementElementTypeDescriptionLiveChannelHistoryContainer\SpeciesthecontainerthatstorestheresponsetotheGetLiveChannelHistoryrequest.
Sub-node:LiveRecordParentnode:NoneLiveRecordContainerSpeciesthecontainerthatstoresastreampushingrecord.
Sub-node:StartTime,EndTime,andRemoteAddrParentnode:LiveChannelHistory370Issue:20200320ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsElementTypeDescriptionStartTimeStringIndicatesthetimewhentheclientstartstopushthestream.
ThevalueofthisparameterisinISO8601format.
Sub-node:NoneParentnode:LiveRecordEndTimeStringIndicatesthetimewhentheclientstopstopushthestream.
ThevalueofthisparameterisinISO8601format.
Sub-node:NoneParentnode:LiveRecordRemoteAddrStringIndicatestheIPaddressoftheclientthatpushesthestream.
Sub-node:NoneParentnode:LiveRecordDetailanalysisAmaximumof10recordsofthestreamsrecentlypushedtothespeciedLiveChannelisreturned.
ExamplesRequestexampleGET/test-channellive&comp=historyHTTP/1.
1Date:Thu,25Aug201607:00:12GMTHost:test-bucket.
oss-cn-hangzhou.
aliyuncs.
comAuthorization:OSSYJjHKOKWDWINLKXv:pqgDBP8JXTXAytBoXpvNoZfo68k=ResponseexampleHTTP/1.
1200content-length:1892server:AliyunOSSconnection:closex-oss-request-id:57BE977CB92475920B0022FBIssue:20200320371ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsdate:Thu,25Aug201607:00:12GMTcontent-type:application/xml2016-07-30T01:53:21.
000Z2016-07-30T01:53:31.
000Z10.
101.
194.
148:568612016-07-30T01:53:35.
000Z2016-07-30T01:53:45.
000Z10.
101.
194.
148:571262016-07-30T01:53:49.
000Z2016-07-30T01:53:59.
000Z10.
101.
194.
148:575772016-07-30T01:54:04.
000Z2016-07-30T01:54:14.
000Z10.
101.
194.
148:5763210.
10PostVodPlaylistGeneratesaVoDplaylist(m3u8le)forthetslesgeneratedbythestreamspushedtoaspeciedLiveChannelinaspeciedtimeperiod.
RequestsyntaxPOST/ChannelName/PlaylistNamevod&endTime=EndTime&startTime=StartTimeHTTP/1.
1Date:GMTdateHost:BucketName.
oss-cn-hangzhou.
aliyuncs.
comAuthorization:SignatureValueRequestelementsElementDescriptionRequiredChannelNameSpeciesthenameofanexistingLiveChannel.
YesPlaylistNameSpeciesthenameofthegeneratedVoDplaylist,whichmustbeendedwith".
m3u8".
YesStartTimeSpeciesthestarttimeofthetslethatyouwanttoquery,whichisaUnixtimestamp.
Yes372Issue:20200320ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsElementDescriptionRequiredEndTimeSpeciestheendtimeofthetslethatyouwanttoquery,whichisaUnixtimestamp.
YesDetailanalysisThevalueofEndTimemustbelaterthanthatofStartTime.
TheperiodbetweentheEndTimeandStartTimemustbeshorterthanoneday.
OSSqueriesalltslesgeneratedbythestreamspushedtotheLiveChannelinaspeciedtimeperiod,andsplicesthelesintoaplaylist.
ExamplesRequestexamplePOST/test-channel/vod.
m3u8vod&endTime=1472020226&startTime=1472020031HTTP/1.
1Date:Thu,25Aug201607:13:26GMTHost:test-bucket.
oss-cn-hangzhou.
aliyuncs.
comAuthorization:OSSYJjHKOKWDWINLKXv:ABIigvnLtCHK+7fMHLeRlOUnzv0=ResponseexampleHTTP/1.
1200content-length:0server:AliyunOSSconnection:closeetag:"9C6104DD9CF1A0C4D0CFD21F43905D59"x-oss-request-id:57BE9A96B92475920B002359date:Thu,25Aug201607:13:26GMT10.
11GetVodPlaylistQueriesfortheplaylistgeneratedbythestreamspushedtoaspeciedLiveChannelinaspeciedtimeperiod.
RequestsyntaxGET/ChannelNamevod&endTime=EndTime&startTime=StartTimeHTTP/1.
1Date:GMTdateHost:BucketName.
oss-cn-hangzhou.
aliyuncs.
comAuthorization:SignatureValueRequestelementElementDescriptionRequiredIssue:20200320373ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsChannelNameSpeciesthenameofanexistingLiveChannel.
YesStartTimeSpeciesthestarttimeofthetslethatyouwanttoquery,whichisaUnixtimestamp.
YesEndTimeSpeciestheendtimeofthetslethatyouwanttoquery,whichisaUnixtimestamp.
Note:ThevalueofEndTimemustbelaterthanthatofStartTime.
TheperiodbetweentheEndTimeandStartTimemustbeshorterthanoneday.
YesExamplesRequestexampleGET/test-channelvod&endTime=1472020226&startTime=1472020031HTTP/1.
1Date:Thu,25Aug201607:13:26GMTHost:test-bucket.
oss-cn-hangzhou.
aliyuncs.
comAuthorization:OSSYJjHKOKWDWINLKXv:ABIigvnLtCHK+7fMHLeRlOUnzv0=ResponseexampleHTTP/1.
1200content-length:312server:AliyunOSSconnection:closeetag:"9C6104DD9CF1A0C4D0CFD21F43905D59"x-oss-request-id:57BE9A96B92475920B002359date:Thu,25Aug201607:13:26GMTContent-Type:application/x-mpegURL#EXTM3U#EXT-X-VERSION:3#EXT-X-MEDIA-SEQUENCE:0#EXT-X-TARGETDURATION:13#EXTINF:7.
120,1543895706266.
ts#EXTINF:5.
840,1543895706323.
ts#EXTINF:6.
400,1543895706356.
ts#EXTINF:5.
520,1543895706389.
ts#EXTINF:5.
240,1543895706428.
ts#EXTINF:13.
320,1543895706468.
ts#EXTINF:5.
960,374Issue:20200320ObjectStorageServiceAPIReference/10LiveChannel-relatedoperations1543895706538.
ts#EXTINF:6.
520,1543895706561.
ts#EXT-X-ENDLIST10.
12FAQThistopicprovidessolutionsforcommonproblemsthatyoumaycomeacrosswhileyouareusingLiveChannel.
PushastreamtoOSSLiveChannelThefollowinggureshowstheprocessofpushingastreamtoaLiveChannel,helpingyouinvestigateproblemsoccurredwhenyoupushastreamtoaLiveChannel.
Formoreinformation,seethefollowingtopics:PutLiveChannelPutLiveChannelStatusCase1:Them3u8leismissing.
Problem:Thegeneratedm3u8leonlycontainsthelast3tslesbydefault.
Them3u8leconformstothedefaultrulesoftheHLSprotocol.
Solution:UsePostVodPlaylisttoconvergethetslesgeneratedinthespeciedtimeperiodintoam3u8indexle.
Issue:20200320375ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationsNote:ThevalueofEndTimemustbelaterthanthevalueofStartTime.
ThedurationbetweentheEndTimeandStartTimemustbeshorterthanoneday.
OSSqueriesallthetslesgeneratedbythestreamspushedtothespeciedLiveChannelinthespeciedtimerangeandconvergestheselesintoaplaylist.
Case2:Failedtogeneratethem3u8leProblem:Them3u8leisnotsuccessfullygenerateduntiltheaudioorvideodataiscompletelyuploadedtoOSS.
Solution:Youcancapturepacketsattheclientsidetocheckwhetherthe"publishsuccess"messageisincluded,whichindicatesthattheaudioorvideodataiscompletelyuploadedtoOSS.
Ifthemessageisincludedbutthem3u8leisnotgenerated,youcananalyzethepacketssentfromtheclientforrootcauses.
Case3:TheclientcannotpushastreamtoOSSProblem:Theclientfailstousempegtopushastream:ffmpeg-re-i0_20180525105430445.
aac-acodecaac-strict-2-fflvrtmp://xxx.
oss-cn-beijing.
aliyuncs.
com/live/test_1000Expires=1540458859&OSSAccessKeyId=LTAlujianb6C9z&Signature=qwh31xQsanmao6ygCFJgovNIg%3D&playlistName=playlist.
m3u8Solution:Werecommendyouusetheoriginalcommandtopushastreamwithoutsettingadditionalparameters.
Ifthe"&"characterisincludedintheURLusedtopushastream,enclosetheURLwithquotationmarks("").
Forexample:mpeg-re-i0_20180525105430445.
aac-acodecaac-strict-2-fv"rtmp://xxx.
oss-cn-beijing.
aliyuncs.
com/live/test_1000Expires=1540458859&OSSAccessKeyId=LTAlujianb6C9z&Signature=qwh31xQsanmao6ygCFJgovNIg%3D&playlistName=playlist.
m3u8"UseOBStopushastreamtocheckwhethertheproblemiscausedbympeg.
Case4:Lagproblemsoccurwhenthem3u8leisgenerated.
IfthevalueofTypeisHLS,whenthedurationofthevideooraudiodatainthecurrenttslereachesthevalueofFragDuration,OSSgeneratesanewtslewhenreceivingthenextkeyframe.
IfOSSdoesnotreceivethenextkeyframewithina376Issue:20200320ObjectStorageServiceAPIReference/10LiveChannel-relatedoperationstimeperiod(calculatedbymax(2*FragDuration,60s)),anewtsleisgenerated,whichresultslaginaudioorvideoplaying.
Case5:Noaudioorvideodataisincludedinthegeneratedm3u8le.
Thisproblemmaybecausedbythefollowingreasons:AVCheaderorAACheaderisnotsent.
Youcancapturepacketssentbytheclienttocheckwhetherthetwoheadersaresent.
ThelengthofRTMPmessageisshorterthan2,orthelengthofsequenceheaderistooshort.
ThesizeofMessageoftheaudiodataexceedsthecachesize.
codec_ctxisimportantforthecodec.
Iftheaudioorvideodataincludedintheparameterisincorrect,them3u8lemayfailtobegenerated.
Case6:ThedatauploadtoOSSbympegdoesnotincludeaudiodata.
Viewthelogsgeneratedbympegtocheckwhetheraac_headerissent.
CapturetheRTMPpacketssentbytheclienttocheckwhetheraac_headerissent.
Issue:20200320377

VinaHost,越南vps,国内延时100MS;不限流量100Mbps

vinahost怎么样?vinahost是一家越南的主机商家,至今已经成13年了,企业运营,老牌商家,销售VPS、虚拟主机、域名、邮箱、独立服务器等,机房全部在越南,有Viettle和VNPT两个机房,其中VNPT机房中三网直连国内的机房,他家的产品优势就是100Mbps不限流量。目前,VinaHost商家发布了新的优惠,购买虚拟主机、邮箱、云服务器、VPS超过三个月都有赠送相应的时长,最高送半年...

Spinservers:美国独立服务器(圣何塞),$111/月

spinservers是Majestic Hosting Solutions,LLC旗下站点,主营美国独立服务器租用和Hybrid Dedicated等,spinservers这次提供的大硬盘、大内存服务器很多人很喜欢。TheServerStore自1994年以来,它是一家成熟的企业 IT 设备供应商,专门从事二手服务器和工作站业务,在德克萨斯州拥有40,000 平方英尺的仓库,库存中始终有数千台...

百纵科技:美国独立服务器租用/高配置;E52670/32G内存/512G SSD/4IP/50M带宽,999元/月

百纵科技怎么样?百纵科技国人商家,ISP ICP 电信增值许可证的正规公司,近期上线美国C3机房洛杉矶独立服务器,大带宽/高配置多ip站群服务器。百纵科技拥有专业技术售后团队,机器支持自动化,自助安装系统 重启,开机交付时间 30分钟内交付!美国洛杉矶高防服务器配置特点: 硬件配置高 线路稳定 洛杉矶C3机房等级T4 平价销售,支持免费测试,美国独服适合做站,满意付款。点击进入:百纵科技官方网站地...

accountsuspended为你推荐
网络域名注册如何注册网络域名美国vps服务器打听下,国外V P S服务器哪个好?企业虚拟主机一个企业网站是什么比较划算,买服务器还是买虚拟主机呢中国互联网域名注册什么叫做网络域名 怎么注册网络域名 以及它的收费方式com域名空间那里有免费的com域名和空间申请啊!网站域名域名和网址有什么区别?域名注册服务万网域名注册服务怎么样?免费网站域名申请怎么免费上传我的网站呀和免费申请域名ip代理地址代理ip地址是怎么来的?免费vps服务器有没有便宜的vps,最好是免费的
ipage 阿里云搜索 128m内存 免费名片模板 浙江独立 智能骨干网 dux 国外免费全能空间 谁的qq空间最好看 可外链相册 中国网通测速 卡巴斯基破解版 万网空间购买 腾讯总部在哪 海外空间 net空间 工信部icp备案查询 cdn服务 新网dns 防盗链 更多