In the latest release of the PowerShell SDK (1.7.4.0) we included a new cmdlet for sending CLI commands to the FlashArray. We added this cmdlet in case any new REST APIs had not been integrated into the PowerShell SDK and customers/partners wanted to access a direct CLI command. You can pass a CLI command and we establish the SSH session, execute the command and then return the results as a PSObject.
Example
1 |
<span class=“s2”>New–PfaCLICommand</span> –EndPoint <span class=“s4”>10.1.1.1</span> –Credentials <span class=“s5”>$creds</span> –CommandText <span class=“s6”>“purevol list” </span> |
Output
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
PS C:Windowssystem32> New–PfaCLICommand –EndPoint 10.1.1.1 –Credentials $creds –CommandText “purevol list” Name <span class=“Apple-converted-space”> </span>Size<span class=“Apple-converted-space”> </span>Source<span class=“Apple-converted-space”> </span>Created<span class=“Apple-converted-space”> </span>Serial <span class=“Apple-converted-space”> </span>boneyard3<span class=“Apple-converted-space”> </span>6T<span class=“Apple-converted-space”> </span>– <span class=“Apple-converted-space”> </span>2016–12–21 16:35:39 PST<span class=“Apple-converted-space”> </span>45084F3508BF46140001192C CSV–Cluster01<span class=“Apple-converted-space”> </span>5T<span class=“Apple-converted-space”> </span>– <span class=“Apple-converted-space”> </span>2016–11–12 07:02:45 PST<span class=“Apple-converted-space”> </span>45084F3508BF461400011671 PSRepository <span class=“Apple-converted-space”> </span>250G<span class=“Apple-converted-space”> </span>– <span class=“Apple-converted-space”> </span>2016–11–02 09:21:05 PDT<span class=“Apple-converted-space”> </span>45084F3508BF4614000111A7 SCVMM–Library01<span class=“Apple-converted-space”> </span>2T<span class=“Apple-converted-space”> </span>– <span class=“Apple-converted-space”> </span>2016–10–25 13:54:22 PDT<span class=“Apple-converted-space”> </span>45084F3508BF461400011036 Server01–Vol01 <span class=“Apple-converted-space”> </span>250G<span class=“Apple-converted-space”> </span>– <span class=“Apple-converted-space”> </span>2016–12–21 16:37:49 PST<span class=“Apple-converted-space”> </span>45084F3508BF46140001192D Server01–Vol02 <span class=“Apple-converted-space”> </span>250G<span class=“Apple-converted-space”> </span>– <span class=“Apple-converted-space”> </span>2017–02–06 13:38:44 PST<span class=“Apple-converted-space”> </span>45084F3508BF461400011934 Server02–Vol01 <span class=“Apple-converted-space”> </span>250G<span class=“Apple-converted-space”> </span>– <span class=“Apple-converted-space”> </span>2016–11–12 07:23:05 PST<span class=“Apple-converted-space”> </span>45084F3508BF461400011672 Server03–Vol01 <span class=“Apple-converted-space”> </span>250G<span class=“Apple-converted-space”> </span>– <span class=“Apple-converted-space”> </span>2016–12–21 16:38:03 PST<span class=“Apple-converted-space”> </span>45084F3508BF46140001192E Server04–Vol01 <span class=“Apple-converted-space”> </span>250G<span class=“Apple-converted-space”> </span>– <span class=“Apple-converted-space”> </span>2016–12–21 16:38:17 PST<span class=“Apple-converted-space”> </span>45084F3508BF46140001192F Server05–Vol01 <span class=“Apple-converted-space”> </span>250G<span class=“Apple-converted-space”> </span>– <span class=“Apple-converted-space”> </span>2016–12–21 16:38:26 PST<span class=“Apple-converted-space”> </span>45084F3508BF461400011930 Server06–Vol01 <span class=“Apple-converted-space”> </span>250G<span class=“Apple-converted-space”> </span>– <span class=“Apple-converted-space”> </span>2016–11–12 07:23:16 PST<span class=“Apple-converted-space”> </span>45084F3508BF461400011673 Server07–Vol01 <span class=“Apple-converted-space”> </span>250G<span class=“Apple-converted-space”> </span>– <span class=“Apple-converted-space”> </span>2016–12–21 16:38:34 PST<span class=“Apple-converted-space”> </span>45084F3508BF461400011931 Server08–Vol01 <span class=“Apple-converted-space”> </span>250G<span class=“Apple-converted-space”> </span>– <span class=“Apple-converted-space”> </span>2016–12–21 16:38:42 PST<span class=“Apple-converted-space”> </span>45084F3508BF461400011932 |
Now for the cool “side effect” you can use the very same cmdlet to access a FlashBlade! Below is a simple example of querying information from the FlashBlade.
Example1
1 2 |
<span class=“s2”>$creds</span> <span class=“s4”>=</span> Get–Credential <span class=“s5”>New–PfaCLICommand</span> –EndPoint <span class=“s6”>10.1.1.1</span> –Credentials <span class=“s2”>$creds</span> –CommandText <span class=“s7”>‘pureblade list’</span> |
Output Example1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
Name<span class=“Apple-converted-space”> </span>Status <span class=“Apple-converted-space”> </span>Capacity<span class=“Apple-converted-space”> </span>Details CH1.FB1 <span class=“Apple-converted-space”> </span>healthy<span class=“Apple-converted-space”> </span>8.00T <span class=“Apple-converted-space”> </span>– CH1.FB2 <span class=“Apple-converted-space”> </span>healthy<span class=“Apple-converted-space”> </span>8.00T <span class=“Apple-converted-space”> </span>– CH1.FB3 <span class=“Apple-converted-space”> </span>healthy<span class=“Apple-converted-space”> </span>8.00T <span class=“Apple-converted-space”> </span>– CH1.FB4 <span class=“Apple-converted-space”> </span>healthy<span class=“Apple-converted-space”> </span>8.00T <span class=“Apple-converted-space”> </span>– CH1.FB5 <span class=“Apple-converted-space”> </span>healthy<span class=“Apple-converted-space”> </span>8.00T <span class=“Apple-converted-space”> </span>– CH1.FB6 <span class=“Apple-converted-space”> </span>healthy<span class=“Apple-converted-space”> </span>8.00T <span class=“Apple-converted-space”> </span>– CH1.FB7 <span class=“Apple-converted-space”> </span>healthy<span class=“Apple-converted-space”> </span>8.00T <span class=“Apple-converted-space”> </span>– CH1.FB8 <span class=“Apple-converted-space”> </span>healthy<span class=“Apple-converted-space”> </span>8.00T <span class=“Apple-converted-space”> </span>– CH1.FB9 <span class=“Apple-converted-space”> </span>healthy<span class=“Apple-converted-space”> </span>8.00T <span class=“Apple-converted-space”> </span>– CH1.FB10<span class=“Apple-converted-space”> </span>healthy<span class=“Apple-converted-space”> </span>8.00T <span class=“Apple-converted-space”> </span>– CH1.FB11<span class=“Apple-converted-space”> </span>healthy<span class=“Apple-converted-space”> </span>8.00T <span class=“Apple-converted-space”> </span>– CH1.FB12<span class=“Apple-converted-space”> </span>healthy<span class=“Apple-converted-space”> </span>8.00T <span class=“Apple-converted-space”> </span>– CH1.FB13<span class=“Apple-converted-space”> </span>healthy<span class=“Apple-converted-space”> </span>8.00T <span class=“Apple-converted-space”> </span>– CH1.FB14<span class=“Apple-converted-space”> </span>healthy<span class=“Apple-converted-space”> </span>8.00T <span class=“Apple-converted-space”> </span>– CH1.FB15<span class=“Apple-converted-space”> </span>healthy<span class=“Apple-converted-space”> </span>8.00T <span class=“Apple-converted-space”> </span>– |
Example2
1 2 |
<span class=“s5”><a href=“https://blog.purestorage.com/wp-content/uploads/2017/05/FB_Volumes_View-1.png”><img class=“alignnone size-full wp-image-13681” src=“https://blog.purestorage.com/wp-content/uploads/2017/05/FB_Volumes_View-1.png” alt=“” width=“1440” height=“811” /></a> </span> |
1 2 3 |
<span class=“s2”>$creds</span> <span class=“s4”>=</span> Get–Credential<span class=“s5”> New–PfaCLICommand</span> –EndPoint <span class=“s6”>10.1.1.1</span> –Credentials <span class=“s2”>$creds</span> –CommandText <span class=“s7”>‘purefs list’ </span> |
Output Example2
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Name<span class=“Apple-converted-space”> </span>Size<span class=“Apple-converted-space”> </span>Used <span class=“Apple-converted-space”> </span>% Used<span class=“Apple-converted-space”> </span>Created<span class=“Apple-converted-space”> </span>Protocols<span class=“Apple-converted-space”> </span>Rules <span class=“Apple-converted-space”> </span>Fast Remove agfa01<span class=“Apple-converted-space”> </span>10T <span class=“Apple-converted-space”> </span>572.21G<span class=“Apple-converted-space”> </span>6%<span class=“Apple-converted-space”> </span>2017–03–31 18:22:19 PDT<span class=“Apple-converted-space”> </span>nfs<span class=“Apple-converted-space”> </span>*(rw,no_root_squash)<span class=“Apple-converted-space”> </span>True ArchLog <span class=“Apple-converted-space”> </span>10T <span class=“Apple-converted-space”> </span>23.03G <span class=“Apple-converted-space”> </span>0%<span class=“Apple-converted-space”> </span>2017–03–30 18:46:23 PDT<span class=“Apple-converted-space”> </span>nfs<span class=“Apple-converted-space”> </span>*(rw,no_root_squash)<span class=“Apple-converted-space”> </span>False cv_ddb01<span class=“Apple-converted-space”> </span>2T<span class=“Apple-converted-space”> </span>0.00 <span class=“Apple-converted-space”> </span>0%<span class=“Apple-converted-space”> </span>2017–03–23 10:38:11 PDT<span class=“Apple-converted-space”> </span>nfs<span class=“Apple-converted-space”> </span>*(rw,no_root_squash)<span class=“Apple-converted-space”> </span>True cv_media01<span class=“Apple-converted-space”> </span>25T <span class=“Apple-converted-space”> </span>5.27T<span class=“Apple-converted-space”> </span>21% <span class=“Apple-converted-space”> </span>2017–03–23 10:36:38 PDT<span class=“Apple-converted-space”> </span>nfs<span class=“Apple-converted-space”> </span>*(rw,no_root_squash)<span class=“Apple-converted-space”> </span>True cv_media02<span class=“Apple-converted-space”> </span>25T <span class=“Apple-converted-space”> </span>3.12T<span class=“Apple-converted-space”> </span>12% <span class=“Apple-converted-space”> </span>2017–03–23 10:37:01 PDT<span class=“Apple-converted-space”> </span>nfs<span class=“Apple-converted-space”> </span>*(rw,no_root_squash)<span class=“Apple-converted-space”> </span>True cv_media03<span class=“Apple-converted-space”> </span>20T <span class=“Apple-converted-space”> </span>1.07T<span class=“Apple-converted-space”> </span>5%<span class=“Apple-converted-space”> </span>2017–04–24 15:43:48 PDT<span class=“Apple-converted-space”> </span>nfs<span class=“Apple-converted-space”> </span>*(rw,no_root_squash)<span class=“Apple-converted-space”> </span>False cv_media04<span class=“Apple-converted-space”> </span>20T <span class=“Apple-converted-space”> </span>1.00T<span class=“Apple-converted-space”> </span>5%<span class=“Apple-converted-space”> </span>2017–04–24 15:43:58 PDT<span class=“Apple-converted-space”> </span>nfs<span class=“Apple-converted-space”> </span>*(rw,no_root_squash)<span class=“Apple-converted-space”> </span>False data01<span class=“Apple-converted-space”> </span>10G <span class=“Apple-converted-space”> </span>4.00G<span class=“Apple-converted-space”> </span>40% <span class=“Apple-converted-space”> </span>2017–02–28 15:09:46 PST<span class=“Apple-converted-space”> </span>nfs<span class=“Apple-converted-space”> </span>*(rw,no_root_squash)<span class=“Apple-converted-space”> </span>False DataVol01 <span class=“Apple-converted-space”> </span>10T <span class=“Apple-converted-space”> </span>5.75T<span class=“Apple-converted-space”> </span>56% <span class=“Apple-converted-space”> </span>2017–01–22 20:39:06 PST<span class=“Apple-converted-space”> </span>nfs<span class=“Apple-converted-space”> </span>*(rw,no_root_squash)<span class=“Apple-converted-space”> </span>False DataVol02 <span class=“Apple-converted-space”> </span>10T <span class=“Apple-converted-space”> </span>5.75T<span class=“Apple-converted-space”> </span>56% <span class=“Apple-converted-space”> </span>2017–01–22 21:30:29 PST<span class=“Apple-converted-space”> </span>nfs<span class=“Apple-converted-space”> </span>*(rw,no_root_squash)<span class=“Apple-converted-space”> </span>False DataVol03 <span class=“Apple-converted-space”> </span>10T <span class=“Apple-converted-space”> </span>5.75T<span class=“Apple-converted-space”> </span>56% <span class=“Apple-converted-space”> </span>2017–01–22 21:30:49 PST<span class=“Apple-converted-space”> </span>nfs<span class=“Apple-converted-space”> </span>*(rw,no_root_squash)<span class=“Apple-converted-space”> </span>False DataVol04 <span class=“Apple-converted-space”> </span>10T <span class=“Apple-converted-space”> </span>5.75T<span class=“Apple-converted-space”> </span>56% <span class=“Apple-converted-space”> </span>2017–01–22 21:31:35 PST<span class=“Apple-converted-space”> </span>nfs<span class=“Apple-converted-space”> </span>*(rw,no_root_squash)<span class=“Apple-converted-space”> </span>False |
Hopefully this opens us some automation scenarios for those FlashBlade customers.
Thanks,
Barkz
1 |