from . import APIDoc, APIRouter, BaseController, CreatePermission, \
DeletePermission, Endpoint, EndpointDoc, ReadPermission, RESTController, \
Task, UIRouter, UpdatePermission, allow_empty_body
+from ._version import APIVersion
logger = logging.getLogger(__name__)
'offset': (int, 'offset'),
},
responses={200: RBD_SCHEMA})
+ @RESTController.MethodMap(version=APIVersion(2, 0)) # type: ignore
def list(self, pool_name=None, offset: int = 0, limit: int = 5,
search: str = ''):
return self._rbd_list(pool_name, offset=offset, limit=limit, search=search)
import _ from 'lodash';
import { map } from 'rxjs/operators';
+import { ApiClient } from '~/app/shared/api/api-client';
import { cdEncode, cdEncodeNot } from '../decorators/cd-encode';
import { ImageSpec } from '../models/image-spec';
import { RbdConfigurationService } from '../services/rbd-configuration.service';
@Injectable({
providedIn: 'root'
})
-export class RbdService {
- constructor(private http: HttpClient, private rbdConfigurationService: RbdConfigurationService) {}
+export class RbdService extends ApiClient {
+ constructor(private http: HttpClient, private rbdConfigurationService: RbdConfigurationService) {
+ super();
+ }
isRBDPool(pool: any) {
return _.indexOf(pool.application_metadata, 'rbd') !== -1 && !pool.pool_name.includes('/');
list(params: any) {
return this.http
- .get<RbdPool[]>('api/block/image', { params: params, observe: 'response' })
+ .get<RbdPool[]>('api/block/image', {
+ params: params,
+ headers: { Accept: this.getVersionHeaderValue(2, 0) },
+ observe: 'response'
+ })
.pipe(
map((response: any) => {
return response['body'].map((pool: any) => {
name: limit
schema:
type: integer
+ - default: ''
+ in: query
+ name: search
+ schema:
+ type: string
responses:
'200':
content:
- application/vnd.ceph.api.v1.0+json:
+ application/vnd.ceph.api.v2.0+json:
schema:
items:
properties: