return f"Successfully created user '{user_entity}'"
@staticmethod
- def user_delete(_, user_entity: str):
+ def user_delete(_, user_entities: str):
"""
- Delete a ceph user and it's defined capabilities.
+ Delete one or more ceph users and their defined capabilities.
+ user_entities: comma-separated string of users to delete
"""
- logger.debug("Sending command 'auth del' of entity '%s'", user_entity)
- CephUserEndpoints._run_auth_command('auth del', entity=user_entity)
- return f"Successfully deleted user '{user_entity}'"
+ users = user_entities.split(',')
+ for user in users:
+ logger.debug("Sending command 'auth del' of entity '%s'", user)
+ CephUserEndpoints._run_auth_command('auth del', entity=user)
+ return f"Successfully deleted user(s) '{user_entities}'"
@staticmethod
def export(_, entities: List[str]):
),
delete=CRUDCollectionMethod(
func=CephUserEndpoints.user_delete,
- doc=EndpointDoc("Delete Ceph User",
+ doc=EndpointDoc("Delete one or more Ceph Users",
parameters={
"user_entity": Param(str, "Entity to delete")
})
}
delete() {
- const selectedKey = this.selection.first()[this.meta.columnKey];
+ let selectedKeys: string[] = [];
+ this.selection.selected.forEach((item: any) => {
+ selectedKeys.push(item[this.meta.columnKey]);
+ });
this.modalRef = this.modalService.show(DeleteConfirmationModalComponent, {
itemDescription: $localize`${this.meta.resource}`,
- itemNames: [selectedKey],
+ itemNames: selectedKeys,
submitAction: () => {
this.taskWrapper
.wrapTaskAroundCall({
- task: new FinishedTask('crud-component/id', selectedKey),
- call: this.dataGatewayService.delete(this.resource, selectedKey)
+ task: new FinishedTask('crud-component/id', selectedKeys),
+ call: this.dataGatewayService.delete(this.resource, selectedKeys)
})
.subscribe({
error: () => {
-import { HttpClient, HttpParams } from '@angular/common/http';
+import { HttpClient, HttpParams, HttpResponse } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
});
}
- delete(dataPath: string, key: string): Observable<any> {
+ delete(dataPath: string, key: string | string[]): Observable<HttpResponse<void>> {
const { url, version } = this.getUrlAndVersion(dataPath);
- return this.http.delete<any>(`${url}/${key}`, {
+ const keyPath = Array.isArray(key) ? key.join(',') : key;
+
+ return this.http.delete<void>(`${url}/${keyPath}`, {
headers: { Accept: `application/vnd.ceph.api.v${version}+json` },
observe: 'response'
});
summary: Export Ceph Users
tags:
- Cluster
- /api/cluster/user/{user_entity}:
+ /api/cluster/user/{user_entities}:
delete:
- description: "\n Delete a ceph user and it's defined capabilities.\n\
- \ "
+ description: "\n Delete one or more ceph users and their defined capabilities.\n\
+ \ user_entities: comma-separated string of users to delete\n \
+ \ "
parameters:
- - description: Entity to delete
- in: path
- name: user_entity
+ - in: path
+ name: user_entities
required: true
schema:
type: string
trace.
security:
- jwt: []
- summary: Delete Ceph User
+ summary: Delete one or more Ceph Users
tags:
- Cluster
/api/cluster_conf: