Skip to content

Commit dd35ac2

Browse files
authored
Merge pull request ceph#63421 from rhcs-dashboard/storageClass-LocalGlacier
mgr/dashboard: Glacier Storage Class - create and list
2 parents a5be94f + 6876669 commit dd35ac2

File tree

10 files changed

+751
-252
lines changed

10 files changed

+751
-252
lines changed

src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/models/rgw-storage-class.model.ts

Lines changed: 78 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,17 @@ export interface StorageClass {
1212
zonegroup_name?: string;
1313
}
1414

15-
export interface StorageClassDetails {
16-
target_path: string;
17-
access_key: string;
18-
secret: string;
19-
multipart_min_part_size: number;
20-
multipart_sync_threshold: number;
21-
host_style: string;
22-
retain_head_object: boolean;
23-
allow_read_through: boolean;
24-
}
25-
2615
export interface TierTarget {
2716
key: string;
2817
val: {
2918
storage_class: string;
3019
tier_type: string;
3120
retain_head_object: boolean;
3221
allow_read_through: boolean;
22+
read_through_restore_days: number;
23+
restore_storage_class: string;
3324
s3?: S3Details;
25+
's3-glacier': S3Glacier;
3426
};
3527
}
3628

@@ -41,14 +33,21 @@ export interface Target {
4133
}
4234

4335
export interface StorageClassDetails {
36+
tier_type: string;
4437
target_path: string;
4538
access_key: string;
4639
secret: string;
4740
multipart_min_part_size: number;
4841
multipart_sync_threshold: number;
4942
host_style: string;
43+
allow_read_through: boolean;
5044
zonegroup_name?: string;
5145
placement_targets?: string;
46+
glacier_restore_days?: number;
47+
glacier_restore_tier_type?: string;
48+
read_through_restore_days?: number;
49+
restore_storage_class?: string;
50+
retain_head_object?: boolean;
5251
}
5352

5453
export interface ZoneGroup {
@@ -71,13 +70,18 @@ export interface S3Details {
7170
retain_head_object?: boolean;
7271
allow_read_through?: boolean;
7372
}
73+
export interface S3Glacier {
74+
glacier_restore_days: number;
75+
glacier_restore_tier_type: string;
76+
}
77+
7478
export interface RequestModel {
7579
zone_group: string;
7680
placement_targets: PlacementTarget[];
7781
}
7882

7983
export interface PlacementTarget {
80-
tags: string[];
84+
tags?: string[];
8185
placement_id: string;
8286
tier_type?: TIER_TYPE;
8387
tier_config?: {
@@ -90,20 +94,64 @@ export interface PlacementTarget {
9094
region: string;
9195
multipart_sync_threshold: number;
9296
multipart_min_part_size: number;
97+
glacier_restore_days?: number;
98+
glacier_restore_tier_type?: string;
99+
restore_storage_class?: string;
100+
read_through_restore_days?: number;
93101
};
94102
storage_class?: string;
95103
name?: string;
96104
tier_targets?: TierTarget[];
97105
}
98106

107+
export interface StorageClassOption {
108+
value: string;
109+
label: string;
110+
}
111+
112+
export interface TextLabels {
113+
targetPathText: string;
114+
targetEndpointText: string;
115+
targetRegionText: string;
116+
multipartMinPartText: string;
117+
storageClassText: string;
118+
multipartSyncThresholdText: string;
119+
targetSecretKeyText: string;
120+
targetAccessKeyText: string;
121+
retainHeadObjectText: string;
122+
allowReadThroughText: string;
123+
glacierRestoreDayText: string;
124+
glacierRestoreTiertypeText: string;
125+
tiertypeText: string;
126+
restoreDaysText: string;
127+
readthroughrestoreDaysText: string;
128+
restoreStorageClassText: string;
129+
}
130+
99131
export const TIER_TYPE = {
100132
LOCAL: 'local',
101133
CLOUD_TIER: 'cloud-s3',
102134
GLACIER: 'cloud-s3-glacier'
103135
} as const;
104136

137+
export const STORAGE_CLASS_CONSTANTS = {
138+
DEFAULT_GLACIER_RESTORE_DAYS: 1,
139+
DEFAULT_READTHROUGH_RESTORE_DAYS: 1,
140+
DEFAULT_MULTIPART_SYNC_THRESHOLD: 33554432,
141+
DEFAULT_MULTIPART_MIN_PART_SIZE: 33554432,
142+
DEFAULT_STORAGE_CLASS: 'Standard'
143+
} as const;
144+
105145
export const DEFAULT_PLACEMENT = 'default-placement';
106146

147+
export type TIER_TYPE = typeof TIER_TYPE[keyof typeof TIER_TYPE];
148+
149+
export const TIER_TYPE_DISPLAY = {
150+
LOCAL: 'Local',
151+
CLOUD_TIER: 'Cloud S3',
152+
GLACIER: 'Cloud S3 Glacier'
153+
};
154+
107155
export const ALLOW_READ_THROUGH_TEXT =
108156
'Enables fetching objects from remote cloud S3 if not found locally.';
109157

@@ -138,10 +186,22 @@ export const LOCAL_STORAGE_CLASS_TEXT = $localize`Local storage uses on-premises
138186

139187
export const CLOUDS3_STORAGE_CLASS_TEXT = $localize`Cloud S3 storage uses Amazon S3-compatible cloud services for tiering.`;
140188

141-
export type TIER_TYPE = typeof TIER_TYPE[keyof typeof TIER_TYPE];
189+
export const GLACIER_STORAGE_CLASS_TEXT = $localize`Glacier storage uses Amazon S3 Glacier for low-cost, long-term archival data storage.`;
142190

143-
export const TIER_TYPE_DISPLAY = {
144-
LOCAL: 'Local',
145-
CLOUD_TIER: 'Cloud S3',
146-
GLACIER: 'Cloud S3 Glacier'
147-
};
191+
export const GLACIER_RESTORE_DAY_TEXT = $localize`Refers to number of days to the object will be restored on glacier/tape endpoint.`;
192+
193+
export const GLACIER_RESTORE_TIER_TYPE_TEXT = $localize`Restore retrieval type.`;
194+
195+
export const STANDARD_TIER_TYPE_TEXT = $localize`Standard glacier restore tier type restores data in 3–5 hours.`;
196+
197+
export const EXPEDITED_TIER_TYPE_TEXT = $localize`Expedited glacier restore tier type restores in 1–5 minutes (faster but costlier).`;
198+
199+
export const RESTORE_DAYS_TEXT = $localize`Refers to number of days to the object will be restored on glacier/tape endpoint.`;
200+
201+
export const READTHROUGH_RESTORE_DAYS_TEXT = $localize`The duration for which objects restored via read-through are retained.`;
202+
203+
export const RESTORE_STORAGE_CLASS_TEXT = $localize`The storage class to which object data is to be restored.`;
204+
205+
export const ZONEGROUP_TEXT = $localize`A Zone Group is a logical grouping of one or more zones that share the same data
206+
and metadata, allowing for multi-site replication and geographic distribution of
207+
data.`;

src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-details/rgw-storage-class-details.component.html

Lines changed: 102 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,26 @@
77
data-testid="rgw-storage-details"
88
>
99
<tbody>
10-
<tr *ngIf="selection.tier_type === TIER_TYPE_DISPLAY.LOCAL">
10+
@if( isTierMatch(
11+
TIER_TYPE_DISPLAY.LOCAL
12+
)){
13+
<tr>
1114
<td class="bold"
1215
i18n>
1316
Zone Group
1417
<cd-helper class="text-pre-wrap">
1518
<span>
16-
A Zone Group is a logical grouping of one or more zones that share the same data
17-
and metadata, allowing for multi-site replication and geographic distribution of
18-
data.
19+
{{ zoneGroupText }}
1920
</span>
2021
</cd-helper>
2122
</td>
2223
<td>{{ selection?.zonegroup_name }}</td>
2324
</tr>
24-
<tr *ngIf="selection.tier_type === TIER_TYPE_DISPLAY.LOCAL">
25+
}
26+
@if(isTierMatch(
27+
TIER_TYPE_DISPLAY.LOCAL
28+
)){
29+
<tr>
2530
<td class="bold"
2631
i18n>
2732
Placement Target
@@ -34,19 +39,23 @@
3439
</td>
3540
<td>{{ selection?.placement_target }}</td>
3641
</tr>
37-
<tr *ngIf="selection.tier_type === TIER_TYPE_DISPLAY.CLOUD_TIER">
42+
}
43+
@if(isTierMatch( TIER_TYPE_DISPLAY.CLOUD_TIER, TIER_TYPE_DISPLAY.GLACIER)){
44+
<tr>
3845
<td class="bold"
3946
i18n>
4047
Target Path
4148
<cd-helper class="text-pre-wrap">
4249
<span>
43-
{{ targetPathText }}
50+
{{ targetPathText }}
4451
</span>
4552
</cd-helper>
4653
</td>
4754
<td>{{ selection?.target_path }}</td>
4855
</tr>
49-
<tr *ngIf="selection.tier_type === TIER_TYPE_DISPLAY.CLOUD_TIER">
56+
}
57+
@if(isTierMatch(TIER_TYPE_DISPLAY.CLOUD_TIER, TIER_TYPE_DISPLAY.GLACIER)){
58+
<tr>
5059
<td class="bold"
5160
i18n>
5261
Access key
@@ -74,7 +83,9 @@
7483
</div>
7584
</td>
7685
</tr>
77-
<tr *ngIf="selection.tier_type === TIER_TYPE_DISPLAY.CLOUD_TIER">
86+
}
87+
@if(isTierMatch(TIER_TYPE_DISPLAY.CLOUD_TIER, TIER_TYPE_DISPLAY.GLACIER)){
88+
<tr>
7889
<td class="bold"
7990
i18n>
8091
Secret key
@@ -100,7 +111,9 @@
100111
</div>
101112
</td>
102113
</tr>
103-
<tr *ngIf="selection.tier_type === TIER_TYPE_DISPLAY.CLOUD_TIER">
114+
}
115+
@if(isTierMatch( TIER_TYPE_DISPLAY.CLOUD_TIER, TIER_TYPE_DISPLAY.GLACIER)){
116+
<tr>
104117
<td class="bold"
105118
i18n>
106119
Host Style
@@ -110,54 +123,117 @@
110123
</td>
111124
<td>{{ selection?.host_style }}</td>
112125
</tr>
113-
<tr *ngIf="selection.tier_type === TIER_TYPE_DISPLAY.CLOUD_TIER">
126+
}
127+
@if(isTierMatch( TIER_TYPE_DISPLAY.CLOUD_TIER, TIER_TYPE_DISPLAY.GLACIER)){
128+
<tr>
114129
<td class="bold"
115130
i18n>
116-
Multipart Minimum Part Size
131+
Head Object (Stub File)
132+
<cd-helper class="text-pre-wrap">
133+
<span> {{ retainHeadObjectText }}</span>
134+
</cd-helper>
135+
</td>
136+
<td>{{ selection?.retain_head_object ? 'Enabled' : 'Disabled' }}</td>
137+
</tr>
138+
}
139+
@if(isTierMatch( TIER_TYPE_DISPLAY.CLOUD_TIER, TIER_TYPE_DISPLAY.GLACIER)){
140+
<tr>
141+
<td class="bold"
142+
i18n>
143+
Allow Read Through
117144
<cd-helper class="text-pre-wrap">
118145
<span>
119-
{{ multipartMinPartText }}
146+
{{ allowReadThroughText }}
120147
</span>
121148
</cd-helper>
122149
</td>
123-
<td>{{ selection?.multipart_min_part_size }}</td>
150+
<td>{{ selection?.allow_read_through ? 'Enabled' : 'Disabled' }}</td>
124151
</tr>
125-
<tr *ngIf="selection.tier_type === TIER_TYPE_DISPLAY.CLOUD_TIER">
152+
}
153+
@if(isTierMatch(TIER_TYPE_DISPLAY.CLOUD_TIER, TIER_TYPE_DISPLAY.GLACIER) && (selection?.allow_read_through)) {
154+
<tr *ngIf="isTierMatch(TIER_TYPE_DISPLAY.CLOUD_TIER, TIER_TYPE_DISPLAY.GLACIER) && (selection?.allow_read_through)">
126155
<td class="bold"
127156
i18n>
128-
Multipart Sync Threshold
157+
Read through Restore Days
129158
<cd-helper class="text-pre-wrap">
130159
<span>
131-
{{ multipartSyncThreholdText }}
160+
{{ readthroughrestoreDaysText }}
132161
</span>
133162
</cd-helper>
134163
</td>
135-
<td>{{ selection?.multipart_sync_threshold }}</td>
164+
<td>{{ selection?.read_through_restore_days }}</td>
136165
</tr>
137-
<tr *ngIf="selection.tier_type === TIER_TYPE_DISPLAY.CLOUD_TIER">
166+
}
167+
@if(isTierMatch( TIER_TYPE_DISPLAY.GLACIER)){
168+
<tr>
138169
<td class="bold"
139170
i18n>
140-
Retain Head Object
171+
Glacier Restore Days
141172
<cd-helper class="text-pre-wrap">
142173
<span>
143-
Retain object metadata after transition to the cloud (default: false).
174+
{{ glacierRestoreDayText }}
144175
</span>
145176
</cd-helper>
146177
</td>
147-
<td>{{ selection?.retain_head_object }}</td>
178+
<td>{{ selection?.glacier_restore_days }}</td>
148179
</tr>
149-
<tr *ngIf="selection.tier_type === TIER_TYPE_DISPLAY.CLOUD_TIER">
180+
}
181+
@if(isTierMatch( TIER_TYPE_DISPLAY.GLACIER)) {
182+
<tr>
150183
<td class="bold"
151184
i18n>
152-
Allow Read Through
185+
Glacier Restore Tier Type
153186
<cd-helper class="text-pre-wrap">
154187
<span>
155-
{{ allowReadThroughText }}
188+
{{ glacierRestoreTiertypeText }}
189+
</span>
190+
</cd-helper>
191+
</td>
192+
<td>{{ selection?.glacier_restore_tier_type }}</td>
193+
</tr>
194+
}
195+
@if(isTierMatch( TIER_TYPE_DISPLAY.CLOUD_TIER, TIER_TYPE_DISPLAY.GLACIER)){
196+
<tr>
197+
<td class="bold"
198+
i18n>
199+
Restore Storage Class
200+
<cd-helper class="text-pre-wrap">
201+
<span>
202+
{{ restoreStorageClassText }}
203+
</span>
204+
</cd-helper>
205+
</td>
206+
<td>{{ selection?.restore_storage_class }}</td>
207+
</tr>
208+
}
209+
@if(isTierMatch( TIER_TYPE_DISPLAY.CLOUD_TIER, TIER_TYPE_DISPLAY.GLACIER)){
210+
<tr>
211+
<td class="bold"
212+
i18n>
213+
Multipart Minimum Part Size
214+
<cd-helper class="text-pre-wrap">
215+
<span>
216+
{{ multipartMinPartText }}
156217
</span>
157218
</cd-helper>
158219
</td>
159-
<td>{{ selection?.allow_read_through }}</td>
220+
<td>{{ selection?.multipart_min_part_size }}</td>
221+
</tr>
222+
}
223+
@if(isTierMatch( TIER_TYPE_DISPLAY.CLOUD_TIER, TIER_TYPE_DISPLAY.GLACIER)){
224+
<tr>
225+
<td class="bold"
226+
i18n>
227+
Multipart Sync Threshold
228+
<cd-helper class="text-pre-wrap">
229+
<span>
230+
{{ multipartSyncThreholdText }}
231+
</span>
232+
</cd-helper>
233+
</td>
234+
<td>{{ selection?.multipart_sync_threshold }}</td>
160235
</tr>
236+
}
161237
</tbody>
162238
</table>
163239
</cds-tab>

src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-details/rgw-storage-class-details.component.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ describe('RgwStorageClassDetailsComponent', () => {
4040
multipart_sync_threshold: 200,
4141
host_style: 'path',
4242
retain_head_object: true,
43-
allow_read_through: true
43+
allow_read_through: true,
44+
tier_type: 'local'
4445
};
4546
component.selection = mockSelection;
4647
component.ngOnChanges();

0 commit comments

Comments
 (0)