@RESTController.Collection(method='PUT', path='/lifecycle')
@allow_empty_body
def set_lifecycle_policy(self, bucket_name: str = '', lifecycle: str = '', daemon_name=None,
- owner=None):
+ owner=None, tenant=None):
+ owner = self._get_owner(owner)
+ bucket_name = RgwBucket.get_s3_bucket_name(bucket_name, tenant)
if lifecycle == '{}':
return self._delete_lifecycle(bucket_name, daemon_name, owner)
return self._set_lifecycle(bucket_name, lifecycle, daemon_name, owner)
@RESTController.Collection(method='GET', path='/lifecycle')
- def get_lifecycle_policy(self, bucket_name: str = '', daemon_name=None, owner=None):
+ def get_lifecycle_policy(self, bucket_name: str = '', daemon_name=None, owner=None,
+ tenant=None):
+ owner = self._get_owner(owner)
+ bucket_name = RgwBucket.get_s3_bucket_name(bucket_name, tenant)
return self._get_lifecycle(bucket_name, daemon_name, owner)
@Endpoint(method='GET', path='/ratelimit')
loadLifecyclePolicies(context: CdTableFetchDataContext) {
const allLifecycleRules$ = this.rgwBucketService
- .getLifecycle(this.bucket.bucket, this.bucket.owner)
+ .getLifecycle(this.bucket.bucket, this.bucket.owner, this.bucket.tenant)
.pipe(
tap((lifecycle: Lifecycle) => {
this.lifecycleRuleList = lifecycle;
submitLifecycleConfig(rules: any) {
this.rgwBucketService
- .setLifecycle(this.bucket.bucket, JSON.stringify(rules), this.bucket.owner)
+ .setLifecycle(
+ this.bucket.bucket,
+ JSON.stringify(rules),
+ this.bucket.owner,
+ this.bucket.tenant
+ )
.subscribe({
next: () => {
this.notificationService.show(
it('should call setLifecyclePolicy function', () => {
component.ngOnInit();
+ component.bucket.tenant = '';
component.tieringForm.setValue({
name: 'test',
storageClass: 'CLOUD',
expect(setLifecycleSpy).toHaveBeenCalledWith(
'bucket1',
JSON.stringify(component.configuredLifecycle.LifecycleConfiguration),
- 'dashboard'
+ 'dashboard',
+ component.bucket.tenant
);
});
});
ngOnInit() {
this.rgwBucketService
- .getLifecycle(this.bucket.bucket, this.bucket.owner)
+ .getLifecycle(this.bucket.bucket, this.bucket.owner, this.bucket.tenant)
.subscribe((lifecycle: Lifecycle) => {
if (lifecycle === null) {
lifecycle = { LifecycleConfiguration: { Rule: [] } };
.setLifecycle(
this.bucket.bucket,
JSON.stringify(this.configuredLifecycle.LifecycleConfiguration),
- this.bucket.owner
+ this.bucket.owner,
+ this.bucket.tenant
)
.subscribe({
next: () => {
.setLifecycle(
this.bucket.bucket,
JSON.stringify(this.configuredLifecycle.LifecycleConfiguration),
- this.bucket.owner
+ this.bucket.owner,
+ this.bucket.tenant
)
.subscribe({
next: () => {
});
}
- setLifecycle(bucket_name: string, lifecycle: string, owner: string) {
+ setLifecycle(bucket_name: string, lifecycle: string, owner: string, tenant: string) {
return this.rgwDaemonService.request((params: HttpParams) => {
params = params.appendAll({
bucket_name: bucket_name,
lifecycle: lifecycle,
- owner: owner
+ owner: owner,
+ tenant: tenant
});
return this.http.put(`${this.url}/lifecycle`, null, { params: params });
});
}
- getLifecycle(bucket_name: string, owner: string) {
+ getLifecycle(bucket_name: string, owner: string, tenant: string) {
return this.rgwDaemonService.request((params: HttpParams) => {
params = params.appendAll({
bucket_name: bucket_name,
- owner: owner
+ owner: owner,
+ tenant: tenant
});
return this.http.get(`${this.url}/lifecycle`, { params: params });
});
name: owner
schema:
type: string
+ - allowEmptyValue: true
+ in: query
+ name: tenant
+ schema:
+ type: string
responses:
'200':
content:
type: string
owner:
type: string
+ tenant:
+ type: string
type: object
responses:
'200':