Skip to content

Commit 98eb7db

Browse files
committed
updated to include FA feedback
1 parent e144bc5 commit 98eb7db

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

Pure_Create_Volume.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
from operator import itemgetter, attrgetter
1515

1616
# Global Variables
17-
VERSION = '1.0.0'
17+
VERSION = '1.1.0'
1818
HEADER = 'Pure Storage Create Volume (' + VERSION + ')'
19-
BANNER = ('=' * 100)
19+
BANNER = ('=' * 132)
2020
DEBUG_LEVEL = 0
2121
VERBOSE_FLAG = False
2222
COOKIE = ''
@@ -52,7 +52,7 @@ def parsecl():
5252
dest = 'flashArray',
5353
help = 'Pure FlashArray')
5454

55-
parser.add_option('--size',
55+
parser.add_option('-S', '--size',
5656
action = 'store',
5757
type = 'string',
5858
dest = 'size',
@@ -70,7 +70,7 @@ def parsecl():
7070
default = False,
7171
help = 'Verbose [default: %default]')
7272

73-
parser.add_option('--volume',
73+
parser.add_option('-V', '--volume',
7474
action = 'store',
7575
dest = 'volume',
7676
default = False,
@@ -116,7 +116,7 @@ def main():
116116

117117
print(BANNER)
118118
print(HEADER + ' - ' + flashArray)
119-
print(strftime('%Y/%m/%d %H:%M:%S %Z', gmtime()))
119+
print(strftime('%d/%m/%Y %H:%M:%S %Z', gmtime()))
120120
print(BANNER)
121121

122122
# Create session
@@ -125,16 +125,29 @@ def main():
125125
# Create Volume
126126
jsonData = array.create_volume(volume, size=volsize)
127127

128-
#jsonData = array.list_volumes()
129128
if VERBOSE_FLAG:
130129
print(BANNER)
131130
print(json.dumps(jsonData, sort_keys=False, indent=4))
131+
132+
133+
volname = (jsonData['name'])
134+
volsize = (jsonData['size'])
135+
cdate = (jsonData['created'])
136+
137+
c1 = cdate[0:10]
138+
c2 = cdate[11:19]
139+
c3 = c1 + ' ' + c2
140+
c4 = strptime(c3,'%Y-%m-%d %H:%M:%S')
141+
created = strftime('%d/%m/%Y %H:%M:%S', c4)
142+
143+
print('{0:20} {1:>20} {2:20}'.format('Name', 'Size', 'Created'))
144+
print('{0:20} {1:20} {2:20}'.format(volname, volsize, created))
132145

133146
# Close API session
134147
array.invalidate_cookie()
135148

136149
print(BANNER)
137-
print(strftime('%Y/%m/%d %H:%M:%S %Z', gmtime()))
150+
print(strftime('%d/%m/%Y %H:%M:%S %Z', gmtime()))
138151
print(BANNER)
139152
sys.exit(exit_code)
140153

0 commit comments

Comments
 (0)