Skip to content

Commit 8bdec24

Browse files
authored
Merge pull request ceph#61606 from rhcs-dashboard/create-storage-class
mgr/dashboard: RGW - Create Storage Class Reviewed-by: Afreen Misbah <[email protected]>
2 parents 8bc54ae + 0a8ceef commit 8bdec24

16 files changed

+992
-54
lines changed

src/pybind/mgr/dashboard/controllers/rgw.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,14 @@ def remove_storage_class(self, placement_id: str, storage_class: str):
11891189
result = multisite_instance.delete_placement_targets(placement_id, storage_class)
11901190
return result
11911191

1192+
@Endpoint('POST', path='storage-class')
1193+
@CreatePermission
1194+
# pylint: disable=W0102
1195+
def storage_class(self, zone_group, placement_targets: List[Dict[str, str]] = []):
1196+
multisite_instance = RgwMultisite()
1197+
result = multisite_instance.add_placement_targets(zone_group, placement_targets)
1198+
return result
1199+
11921200
@Endpoint()
11931201
@ReadPermission
11941202
def get_all_zonegroups_info(self):

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

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export interface ZoneGroupDetails {
22
default_zonegroup: string;
3+
name: string;
34
zonegroups: ZoneGroup[];
45
}
56

@@ -18,10 +19,6 @@ export interface StorageClassDetails {
1819
multipart_sync_threshold: number;
1920
host_style: string;
2021
}
21-
export interface ZoneGroup {
22-
name: string;
23-
placement_targets: Target[];
24-
}
2522

2623
export interface S3Details {
2724
endpoint: string;
@@ -49,4 +46,55 @@ export interface Target {
4946
tier_targets: TierTarget[];
5047
}
5148

49+
export interface StorageClassDetails {
50+
target_path: string;
51+
access_key: string;
52+
secret: string;
53+
multipart_min_part_size: number;
54+
multipart_sync_threshold: number;
55+
host_style: string;
56+
}
57+
export interface ZoneGroup {
58+
name: string;
59+
id: string;
60+
placement_targets?: Target[];
61+
}
62+
63+
export interface S3Details {
64+
endpoint: string;
65+
access_key: string;
66+
storage_class: string;
67+
target_path: string;
68+
target_storage_class: string;
69+
region: string;
70+
secret: string;
71+
multipart_min_part_size: number;
72+
multipart_sync_threshold: number;
73+
host_style: boolean;
74+
}
75+
76+
export interface RequestModel {
77+
zone_group: string;
78+
placement_targets: PlacementTarget[];
79+
}
80+
81+
export interface PlacementTarget {
82+
tags: string[];
83+
placement_id: string;
84+
storage_class: string;
85+
tier_type: typeof CLOUD_TIER;
86+
tier_config: {
87+
endpoint: string;
88+
access_key: string;
89+
secret: string;
90+
target_path: string;
91+
retain_head_object: boolean;
92+
region: string;
93+
multipart_sync_threshold: number;
94+
multipart_min_part_size: number;
95+
};
96+
}
97+
5298
export const CLOUD_TIER = 'cloud-s3';
99+
100+
export const DEFAULT_PLACEMENT = 'default-placement';

0 commit comments

Comments
 (0)