import TOSBase from '../base'; export interface FetchCondition { /** * 优先判断deny,如果被任何一个规则拒绝,都不会异步抓取该对象 */ PrefixNotFetch?: string[]; SuffixNotFetch?: string[]; /** * 单位为B */ SizeRangeNotFetch?: string[]; /** * 以下所有配置过的条件都通过才会去抓取 */ PrefixFetch?: string[]; SuffixFetch?: string[]; SizeRangeFetch?: string[]; } export interface MirrorBackRule { ID: string; Condition: { HttpCode: number; KeyPrefix?: string; KeySuffix?: string; /** private unstable */ AllowHost?: string[]; /** private unstable */ HttpMethod?: string[]; }; /** @private unstable */ FetchCondition?: FetchCondition; Redirect: { RedirectType?: 'Mirror' | 'Async'; FetchSourceOnRedirect?: boolean; /** @private unstable */ FetchSourceOnRedirectWithQuery?: boolean; PublicSource?: { SourceEndpoint: { Primary: string[]; Follower?: string[]; }; FixedEndpoint?: boolean; }; /** @private unstable */ PrivateSource?: { SourceEndpoint: { Primary: { Endpoint: string; BucketName: string; CredentialProvider: { Role: string; }; }[]; Follower?: { Endpoint: string; BucketName: string; CredentialProvider: { Role: string; }; }[]; }; }; PassQuery?: boolean; FollowRedirect?: boolean; MirrorHeader?: { PassAll?: boolean; Pass?: string[]; Remove?: string[]; /** private unstable */ Set?: { Key: string; Value: string; }[]; }; /** @private unstable */ PassHeaderFromSource?: string[]; /** @private unstable */ PassStatusCodeFromSource?: string[]; /** @private unstable */ DisableUploadSourceForNoneRangeMirror?: boolean; /** @private unstable */ DisableUploadSourceForRangeMirror?: boolean; Transform?: { WithKeyPrefix?: string; WithKeySuffix?: string; ReplaceKeyPrefix?: { KeyPrefix?: string; ReplaceWith?: string; }; }; }; } export interface PutBucketMirrorBackInput { bucket: string; rules: MirrorBackRule[]; } export interface PutBucketMirrorBackOutput { } export declare function putBucketMirrorBack(this: TOSBase, input: PutBucketMirrorBackInput): Promise>; export interface GetBucketMirrorBackInput { bucket: string; } export interface GetBucketMirrorBackOutput { Rules: MirrorBackRule[]; } export declare function getBucketMirrorBack(this: TOSBase, input: GetBucketMirrorBackInput): Promise>; export interface DeleteBucketMirrorBackInput { bucket: string; } export interface DeleteBucketMirrorBackOutput { } export declare function deleteBucketMirrorBack(this: TOSBase, input: DeleteBucketMirrorBackInput): Promise>;