Docs
api
Object-based Storage(US3)
SetUFileReferer

Set up Object Storage Anti-leech - SetUFileReferer

Overview

Set up Object Storage Anti-leech

Definition

Public Parameters

Parameter NameTypeDescription InformationRequired
ActionstringCorresponding API command name, the current API is SetUFileReferer.Yes
PublicKeystringThe user's public key can be obtained from Console (opens in a new tab)Yes
SignaturestringUser signature generated based on public key and API command, see Signature AlgorithmYes

Request Parameters

Parameter NameTypeDescription InformationRequired
RegionstringRegion. See List of Regions and Availability ZonesNo
ProjectIdstringProject ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the GetProjectList interface.No
BucketNamestringStorage Space NameYes
RefererStatusstringEnable or disable referer anti-leeching; Disabling anti-leeching will clear the anti-leeching parameter settings, enabling anti-leeching must specify RefererType, Referers; Enable: on, Disable: off;Yes
RefererAllowNullbooleanWhen RefererType is set to whitelist, setting RefererAllowNull to false means that empty referer access is not allowed, while setting it to true means that empty referer access is allowed;
This parameter is set to true by default.
No
RefererTypeintAnti-theft chain Referer type, supports three types,
1 represents setting a blacklist, 2 represents setting a whitelist,
3 represents setting both blacklist and whitelist; (1 and 2 are for backward compatibility, subsequent calls should only pass type 3)
This parameter must be filled in when RefererStatus is "on";
No
Referers.NstringAnti-theft chain Referer rule, supports regular expressions (does not support the symbol ';'), this field has been deprecated, please use WhiteList.n or BlackList.nNo
WhiteList.NstringAn item in the whitelistNo
BlackList.NstringAn item in the blacklistNo

Response Field

Field NameTypeDescription InformationRequired
RetCodeintReturn status code. If it is 0, it means successful return. If it is not 0, it means failure.Yes
ActionstringOperation command name.Yes
MessagestringReturns an error message, providing detailed description when RetCode is non-zero.No

Example

Request Example

https://api.ucloud-global.com/?Action=SetUFileReferer
&Region=cn-zj
&ProjectId=EhCcaLxv
&BucketName=XvqwhKrY
&RefererType=ZzOlNzdj
&Referers.n=iaEJuvtY
&NullReferer=MrViJqjQ
&RefererStatus=开启:on; 关闭:off;
&RefererStatus=开启:on; 关闭:off;
&WhiteList.n=ZTziAPAx
&BlackList.n=gRpnOElW
&WhiteList.n=jCEtMJTO
&BlackList.n=CuicHvDo
&WhiteList.n=dQxkpotm
&BlackList.n=DhqOJukG

Response Example

{
  "Action": "SetUFileRefererResponse",
  "RetCode": 0
}