
This volume.resize() function accept one parameter "num_bytes". It will throw an exception when num_bytes is not greater than current volume size, because RSD POMD only support extend the size right now, not shrink. Change-Id: I7037fbe01a1aa901de3d66c851c5466d2501b2ca
42 lines
1.5 KiB
Python
42 lines
1.5 KiB
Python
# Copyright 2018 Intel, Inc.
|
|
# All Rights Reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
from rsd_lib.resources import v2_3
|
|
from rsd_lib.resources.v2_4.storage_service import storage_service
|
|
|
|
|
|
class RSDLibV2_4(v2_3.RSDLibV2_3):
|
|
|
|
def get_storage_service_collection(self):
|
|
"""Get the StorageServiceCollection object
|
|
|
|
:raises: MissingAttributeError, if the collection attribute is
|
|
not found
|
|
:returns: a StorageServiceCollection object
|
|
"""
|
|
return storage_service.StorageServiceCollection(
|
|
self._conn, self._storage_service_path,
|
|
redfish_version=self.redfish_version)
|
|
|
|
def get_storage_service(self, identity):
|
|
"""Given the identity return a StorageService object
|
|
|
|
:param identity: The identity of the StorageService resource
|
|
:returns: The StorageService object
|
|
"""
|
|
return storage_service.StorageService(
|
|
self._conn, identity,
|
|
redfish_version=self.redfish_version)
|