Skip to content

Commit

Permalink
[GH-15] capacity report enhancement
Browse files Browse the repository at this point in the history
This enhancement includes:
1. Update readme document to include capacity report function
2. Refine round_it util
  • Loading branch information
Tianqi-Tang committed Jul 5, 2016
1 parent 577769d commit 0224462
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.rst
Expand Up @@ -57,6 +57,7 @@ Feature List
- list/create/delete NFS share
- show system domain information
- list hosts
- show system capacity
- supported feature/operations
- list/start/cancel migration sessions
- enable/disable LUN deduplication
Expand Down
2 changes: 2 additions & 0 deletions storops/lib/common.py
Expand Up @@ -435,3 +435,5 @@ def _inner(*args, **kwargs):
return round(value, ndigits)
return _inner
return inner

round_3 = round_it(3)
10 changes: 5 additions & 5 deletions storops/vnx/resource/capacity.py
Expand Up @@ -18,7 +18,7 @@
from storops.vnx.resource.disk import VNXDisk
from storops.vnx.resource.block_pool import VNXPool
from storops.vnx.resource.rg import VNXRaidGroup
from storops.lib.common import JsonPrinter, round_it
from storops.lib.common import JsonPrinter, round_3
from storops.lib.converter import mb_to_gb

__author__ = 'Tina Tang'
Expand All @@ -41,15 +41,15 @@ def get(cls, cli):
return VNXCapacity(cli)

@property
@round_it()
@round_3
def total(self):
"""Total disk capacity in GB"""
if self._total is None:
self._update_disk_capacity()
return self._total

@property
@round_it()
@round_3
def free_raw_disk(self):
"""Free raw disk capacity in GB
Expand All @@ -61,7 +61,7 @@ def free_raw_disk(self):
return self._free_raw_disk

@property
@round_it()
@round_3
def free_storage_pool(self):
"""Free storage pool capacity in GB
Expand All @@ -73,7 +73,7 @@ def free_storage_pool(self):
return self._free_storage_pool

@property
@round_it()
@round_3
def used(self):
"""Total used capacity in GB
Expand Down
4 changes: 2 additions & 2 deletions storops/vnx/resource/rg.py
Expand Up @@ -17,7 +17,7 @@

from storops.vnx.resource import VNXCliResource, VNXCliResourceList
from storops import exception as ex
from storops.lib.common import round_it
from storops.lib.common import round_3
from storops.lib.converter import block_to_gb

__author__ = 'Cedric Zhuang'
Expand Down Expand Up @@ -58,7 +58,7 @@ def get(cls, cli, raid_group_id=None):
return ret

@property
@round_it()
@round_3
def available_capacity_gbs(self):
return block_to_gb(self.free_capacity_blocks_non_contiguous)

Expand Down

0 comments on commit 0224462

Please sign in to comment.