Use PowerShell to Manage OpenStack Swift Containers in Gladinet Cloud Enterprise
Gladinet Cloud Enterprise is a self-hosted file sync and share solution. It works well on top of OpenStack Swift as the private cloud storage. When Gladinet Cloud Enterprise and OpenStack Swift combined together, it is a very good private file sync and share solution.
When it comes to OpenStack Swift as the storage and serving end users, questions arise about how to map an OpenStack Swift container to an end user, or map multiple OpenStack Swift containers to an end user. This article demonstrates using PowerShell to achieve the mapping.
PowerShell Module
Gladinet Cloud Enterprise ships with a PowerShell module. It is the GCEAutomation.dll in the installation folder. You can copy the DLL to a Windows machine where you will be issuing the PowerShell command. The Windows machine will need to have full .NET framework and also at least PowerShell 3.0 installed (PowerShell 3.0 is part of the Windows Management Framework 3.0)
To Start, you will need a PowerShell command or the PowerShell ISE. If you are new to PowerShell, we recommend you start with PowerShell ISE since it comes with the panel of help.
PowerShell Commands – Get Started
Use import-module to import the PowerShell module
Import-Module .\GCEAutomation.dll
Command #2 – Login
$login = Get-GceLogin joe@gladinet.com dddddddd http://192.168.2.11
Command #3 – Add Remove Containers
Remove-GceUserStorage -LoginToken $login.Cookie -Name mytest1_container -ServerUrl http://192.168.2.11
$result = Get-GceOpenStackStoragekeyStoneConfig -AccessPoint http://192.168.2.118:5000/v2.0 -Container mytest1 -DataAtRest $False -MountName mytest1_container -SecretKey admin123 -UserName admin -IsPrimary $False -IsTenantId $False
$result1 = Add-GceUserStorage -LoginToken $login.Cookie -Name mytest1_container -Value $result -ServerUrl http://192.168.2.11
Command #4 – List the Top Level Directory
Now you can use directory listing of the top level folder to verify the mounted OpenStack Swift containers
$dir = Get-GceDir -LoginToken $login.Cookie -ServerUrl http://192.168.2.11 -Path ""
For more details, check the service provider pages on http://www.gladinet.com
Comments