multipart_min_part_size: number;
multipart_sync_threshold: number;
host_style: string;
+ retain_head_object: boolean;
}
export interface S3Details {
val: {
storage_class: string;
tier_type: string;
+ retain_head_object: boolean;
s3: S3Details;
};
}
multipart_sync_threshold: number;
host_style: string;
}
+
export interface ZoneGroup {
name: string;
id: string;
host_style: boolean;
retain_head_object?: boolean;
}
-
export interface RequestModel {
zone_group: string;
placement_targets: PlacementTarget[];
</td>
<td>{{ selection?.multipart_sync_threshold }}</td>
</tr>
+ <tr>
+ <td
+ class="bold">
+ Retain Head Object
+ <cd-helper class="text-pre-wrap">
+ <span i18n>
+ Retain object metadata after transition to the cloud (default: false).
+ </span>
+ </cd-helper>
+ </td>
+ <td>{{ selection?.retain_head_object }}</td>
+ </tr>
</tbody>
</table>
</cds-tab>
target_path: '/test/path',
multipart_min_part_size: 100,
multipart_sync_threshold: 200,
- host_style: 'path'
+ host_style: 'path',
+ retain_head_object: true
};
component.selection = mockSelection;
component.ngOnChanges();
target_path: this.selection.target_path,
multipart_min_part_size: this.selection.multipart_min_part_size,
multipart_sync_threshold: this.selection.multipart_sync_threshold,
- host_style: this.selection.host_style
+ host_style: this.selection.host_style,
+ retain_head_object: this.selection.retain_head_object
};
}
}
val: {
storage_class: 'CLOUDIBM',
tier_type: 'cloud-s3',
+ retain_head_object: true,
s3: {
endpoint: 'https://s3.amazonaws.com',
access_key: 'ACCESSKEY',
val: {
storage_class: 'CloudIBM',
tier_type: 'cloud-s3',
+ retain_head_object: true,
s3: {
endpoint: 'https://s3.amazonaws.com',
access_key: 'ACCESSKEY',
this.targetSecretKeyText =
"To view or copy your secret key, go to your cloud service's user management or credentials section, find your user profile, and locate the access key. You can view and copy the key by following the instructions provided.";
this.retainHeadObjectText =
- 'Retain object metadata after transition to the cloud (default: deleted).';
+ 'Retain object metadata after transition to the cloud (default: false).';
this.createForm();
this.loadingReady();
this.loadZoneGroup();
this.storageClassForm.get('target_path').setValue(response.target_path);
this.storageClassForm
.get('retain_head_object')
- .setValue(response.retain_head_object || false);
+ .setValue(this.tierTargetInfo?.val?.retain_head_object || false);
this.storageClassForm
.get('multipart_sync_threshold')
.setValue(response.multipart_sync_threshold || '');
zonegroup_name: zoneGroup,
placement_target: targetName,
storage_class: tierTarget.val.storage_class,
+ retain_head_object: tierTarget.val.retain_head_object,
...tierTarget.val.s3
};
}
else:
self.update_period()
+ def modify_retain_head(self, tier_config: dict) -> List[str]:
+ tier_config_items = []
+ for key, value in tier_config.items():
+ if isinstance(value, bool):
+ value = str(value).lower()
+ tier_config_items.append(f'{key}={value}')
+ return tier_config_items
+
def add_placement_targets(self, zonegroup_name: str, placement_targets: List[Dict]):
rgw_add_placement_cmd = ['zonegroup', 'placement', 'add']
STANDARD_STORAGE_CLASS = "STANDARD"
):
tier_config = placement_target.get('tier_config', {})
if tier_config:
- tier_config_items = (
- f'{key}={value}' for key, value in tier_config.items()
- )
+ tier_config_items = self.modify_retain_head(tier_config)
tier_config_str = ','.join(tier_config_items)
cmd_add_placement_options += [
'--tier-type', 'cloud-s3', '--tier-config', tier_config_str
):
tier_config = placement_target.get('tier_config', {})
if tier_config:
- tier_config_items = (
- f'{key}={value}' for key, value in tier_config.items()
- )
+ tier_config_items = self.modify_retain_head(tier_config)
tier_config_str = ','.join(tier_config_items)
cmd_add_placement_options += [
'--tier-type', 'cloud-s3', '--tier-config', tier_config_str