diff --git a/.nuget/NuGet.Config b/.nuget/NuGet.Config new file mode 100644 index 0000000..67f8ea0 --- /dev/null +++ b/.nuget/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.nuget/NuGet.exe b/.nuget/NuGet.exe new file mode 100644 index 0000000..9cba6ed Binary files /dev/null and b/.nuget/NuGet.exe differ diff --git a/.nuget/NuGet.targets b/.nuget/NuGet.targets new file mode 100644 index 0000000..2c3545b --- /dev/null +++ b/.nuget/NuGet.targets @@ -0,0 +1,151 @@ + + + + $(MSBuildProjectDirectory)\..\ + + + false + + + false + + + true + + + false + + + + + + + + + + + $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) + + + + + $(SolutionDir).nuget + + + + packages.$(MSBuildProjectName.Replace(' ', '_')).config + + + + + + $(PackagesProjectConfig) + + + + + packages.config + + + + + + + $(NuGetToolsPath)\NuGet.exe + @(PackageSource) + + "$(NuGetExePath)" + mono --runtime=v4.0.30319 $(NuGetExePath) + + $(TargetDir.Trim('\\')) + + -RequireConsent + -NonInteractive + + "$(SolutionDir) " + "$(SolutionDir)" + + + $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir) + $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols + + + + RestorePackages; + $(BuildDependsOn); + + + + + $(BuildDependsOn); + BuildPackage; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.nuget/packages.config b/.nuget/packages.config new file mode 100644 index 0000000..3f66cf8 --- /dev/null +++ b/.nuget/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Openstack.Client.Powershell.Deployment/Openstack.Client.Powershell.Deployment.sln b/Openstack.Client.Powershell.Deployment/Openstack.Client.Powershell.Deployment.sln new file mode 100644 index 0000000..00ccad7 --- /dev/null +++ b/Openstack.Client.Powershell.Deployment/Openstack.Client.Powershell.Deployment.sln @@ -0,0 +1,46 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "Openstack.Client.Powershell.Deployment", "Openstack.Client.Powershell.Deployment.vdproj", "{15B40627-0EBD-4D70-A69C-F248EBD1BD36}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Openstack.Client.Powershell", "..\Openstack.Client.Powershell\Openstack.Client.Powershell.csproj", "{32BAC168-2EC8-4074-9E6D-8C13460DCFAD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Openstack.Common", "..\..\OpenStack-API\Openstack.Common\Openstack.Common.csproj", "{F6AF0191-F236-4C26-8C93-30D5F4D8000F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Openstack.Objects", "..\..\OpenStack-API\Openstack.Objects\Openstack.Objects.csproj", "{BDCDCBF5-3467-461E-8307-E1E4E19F6532}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + TransformTool Build|Any CPU = TransformTool Build|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {15B40627-0EBD-4D70-A69C-F248EBD1BD36}.Debug|Any CPU.ActiveCfg = Debug + {15B40627-0EBD-4D70-A69C-F248EBD1BD36}.Release|Any CPU.ActiveCfg = Release + {15B40627-0EBD-4D70-A69C-F248EBD1BD36}.Release|Any CPU.Build.0 = Release + {15B40627-0EBD-4D70-A69C-F248EBD1BD36}.TransformTool Build|Any CPU.ActiveCfg = Release + {15B40627-0EBD-4D70-A69C-F248EBD1BD36}.TransformTool Build|Any CPU.Build.0 = Release + {32BAC168-2EC8-4074-9E6D-8C13460DCFAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {32BAC168-2EC8-4074-9E6D-8C13460DCFAD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {32BAC168-2EC8-4074-9E6D-8C13460DCFAD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {32BAC168-2EC8-4074-9E6D-8C13460DCFAD}.Release|Any CPU.Build.0 = Release|Any CPU + {32BAC168-2EC8-4074-9E6D-8C13460DCFAD}.TransformTool Build|Any CPU.ActiveCfg = TransformTool Build|Any CPU + {32BAC168-2EC8-4074-9E6D-8C13460DCFAD}.TransformTool Build|Any CPU.Build.0 = TransformTool Build|Any CPU + {F6AF0191-F236-4C26-8C93-30D5F4D8000F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F6AF0191-F236-4C26-8C93-30D5F4D8000F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F6AF0191-F236-4C26-8C93-30D5F4D8000F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F6AF0191-F236-4C26-8C93-30D5F4D8000F}.Release|Any CPU.Build.0 = Release|Any CPU + {F6AF0191-F236-4C26-8C93-30D5F4D8000F}.TransformTool Build|Any CPU.ActiveCfg = Release|Any CPU + {F6AF0191-F236-4C26-8C93-30D5F4D8000F}.TransformTool Build|Any CPU.Build.0 = Release|Any CPU + {BDCDCBF5-3467-461E-8307-E1E4E19F6532}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BDCDCBF5-3467-461E-8307-E1E4E19F6532}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BDCDCBF5-3467-461E-8307-E1E4E19F6532}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BDCDCBF5-3467-461E-8307-E1E4E19F6532}.Release|Any CPU.Build.0 = Release|Any CPU + {BDCDCBF5-3467-461E-8307-E1E4E19F6532}.TransformTool Build|Any CPU.ActiveCfg = Release|Any CPU + {BDCDCBF5-3467-461E-8307-E1E4E19F6532}.TransformTool Build|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Openstack.Client.Powershell.Deployment/Openstack.Client.Powershell.Deployment.vdproj b/Openstack.Client.Powershell.Deployment/Openstack.Client.Powershell.Deployment.vdproj new file mode 100644 index 0000000..7666a01 --- /dev/null +++ b/Openstack.Client.Powershell.Deployment/Openstack.Client.Powershell.Deployment.vdproj @@ -0,0 +1,2113 @@ +"DeployProject" +{ +"VSVersion" = "3:800" +"ProjectType" = "8:{978C614F-708E-4E1A-B201-565925725DBA}" +"IsWebType" = "8:FALSE" +"ProjectName" = "8:Openstack.Client.Powershell.Deployment" +"LanguageId" = "3:1033" +"CodePage" = "3:1252" +"UILanguageId" = "3:1033" +"SccProjectName" = "8:" +"SccLocalPath" = "8:" +"SccAuxPath" = "8:" +"SccProvider" = "8:" + "Hierarchy" + { + "Entry" + { + "MsmKey" = "8:_0108F045584E4F02A9CCFCDE41A4E5FE" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_120E86A2F6B2FBF01D5CEFF23BBDADCB" + "OwnerKey" = "8:_F9DA14B8181D4D1C81A5633A05CC0CD8" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_120E86A2F6B2FBF01D5CEFF23BBDADCB" + "OwnerKey" = "8:_5D4A130C7710F31397E77392A962A7F0" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_1616F6BD5055B800012A605247B5AC50" + "OwnerKey" = "8:_F9DA14B8181D4D1C81A5633A05CC0CD8" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_1616F6BD5055B800012A605247B5AC50" + "OwnerKey" = "8:_7786D558494C6E31096187EFF5280365" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_24CC4C4F721736ECA4CACDE2E868F356" + "OwnerKey" = "8:_F9DA14B8181D4D1C81A5633A05CC0CD8" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_479B6CE5D32F47CA87619917C183495B" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_49A73026F0385BCD8B6C8BC1FCA3171E" + "OwnerKey" = "8:_F9DA14B8181D4D1C81A5633A05CC0CD8" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_49A73026F0385BCD8B6C8BC1FCA3171E" + "OwnerKey" = "8:_24CC4C4F721736ECA4CACDE2E868F356" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_4B1457626EF021E89B30C19C1E508BE7" + "OwnerKey" = "8:_BE0AA97B689F435A66973DA8C0B3FBAB" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_4B1457626EF021E89B30C19C1E508BE7" + "OwnerKey" = "8:_F9DA14B8181D4D1C81A5633A05CC0CD8" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_4B1457626EF021E89B30C19C1E508BE7" + "OwnerKey" = "8:_5C67CA7D250FDE6BD6EB3DA026C9E609" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_4B1457626EF021E89B30C19C1E508BE7" + "OwnerKey" = "8:_F5C81E04F66151DF6C7146E2A19F58A3" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_4B1457626EF021E89B30C19C1E508BE7" + "OwnerKey" = "8:_DFC25003A292366E800AA9D1F1B718AE" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_4B1457626EF021E89B30C19C1E508BE7" + "OwnerKey" = "8:_80CCC200D3BB534007550DEE28117657" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_5C67CA7D250FDE6BD6EB3DA026C9E609" + "OwnerKey" = "8:_F9DA14B8181D4D1C81A5633A05CC0CD8" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_5D4A130C7710F31397E77392A962A7F0" + "OwnerKey" = "8:_7786D558494C6E31096187EFF5280365" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_5D4A130C7710F31397E77392A962A7F0" + "OwnerKey" = "8:_F9DA14B8181D4D1C81A5633A05CC0CD8" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_6A1D92BBE10E490E97DB380F836A3C37" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_7786D558494C6E31096187EFF5280365" + "OwnerKey" = "8:_F9DA14B8181D4D1C81A5633A05CC0CD8" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_7AD1F39B117F45F79449D2071C2360FD" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_7FA0CE0FB8FE981205AE4444F9483D40" + "OwnerKey" = "8:_F9DA14B8181D4D1C81A5633A05CC0CD8" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_80CCC200D3BB534007550DEE28117657" + "OwnerKey" = "8:_DFC25003A292366E800AA9D1F1B718AE" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_80CCC200D3BB534007550DEE28117657" + "OwnerKey" = "8:_F9DA14B8181D4D1C81A5633A05CC0CD8" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_8D280F1E4F5E2F1754505609323472F5" + "OwnerKey" = "8:_F9DA14B8181D4D1C81A5633A05CC0CD8" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_8D280F1E4F5E2F1754505609323472F5" + "OwnerKey" = "8:_7786D558494C6E31096187EFF5280365" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_B033ABE13B0544B4BCCC0519C661931A" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_BE0AA97B689F435A66973DA8C0B3FBAB" + "OwnerKey" = "8:_DFC25003A292366E800AA9D1F1B718AE" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_BE0AA97B689F435A66973DA8C0B3FBAB" + "OwnerKey" = "8:_F9DA14B8181D4D1C81A5633A05CC0CD8" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_BE0AA97B689F435A66973DA8C0B3FBAB" + "OwnerKey" = "8:_5C67CA7D250FDE6BD6EB3DA026C9E609" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_BFB9B3022A6C8D9EDBA57B89058FDFBD" + "OwnerKey" = "8:_F9DA14B8181D4D1C81A5633A05CC0CD8" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_CC23A57E743BD96D8C406B703A8E74D6" + "OwnerKey" = "8:_5D4A130C7710F31397E77392A962A7F0" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_CC23A57E743BD96D8C406B703A8E74D6" + "OwnerKey" = "8:_7FA0CE0FB8FE981205AE4444F9483D40" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_CC23A57E743BD96D8C406B703A8E74D6" + "OwnerKey" = "8:_F9DA14B8181D4D1C81A5633A05CC0CD8" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_CC23A57E743BD96D8C406B703A8E74D6" + "OwnerKey" = "8:_7786D558494C6E31096187EFF5280365" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_DB2FE965FC8553215481813D77FE917A" + "OwnerKey" = "8:_F9DA14B8181D4D1C81A5633A05CC0CD8" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_DB2FE965FC8553215481813D77FE917A" + "OwnerKey" = "8:_7786D558494C6E31096187EFF5280365" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_DFC25003A292366E800AA9D1F1B718AE" + "OwnerKey" = "8:_F9DA14B8181D4D1C81A5633A05CC0CD8" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_DFC25003A292366E800AA9D1F1B718AE" + "OwnerKey" = "8:_5C67CA7D250FDE6BD6EB3DA026C9E609" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_E4B6908BAA2642AAA608ECBDB527B9DF" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_ED9653262D774E91943C82410BCE16F4" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_EEDE127153874226B3B4F0346775DC9E" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_F5101F37851EA659C1D69BDAB446D70A" + "OwnerKey" = "8:_F9DA14B8181D4D1C81A5633A05CC0CD8" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_F5101F37851EA659C1D69BDAB446D70A" + "OwnerKey" = "8:_24CC4C4F721736ECA4CACDE2E868F356" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_F5C81E04F66151DF6C7146E2A19F58A3" + "OwnerKey" = "8:_DFC25003A292366E800AA9D1F1B718AE" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_F5C81E04F66151DF6C7146E2A19F58A3" + "OwnerKey" = "8:_F9DA14B8181D4D1C81A5633A05CC0CD8" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_F9DA14B8181D4D1C81A5633A05CC0CD8" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_F9DA14B8181D4D1C81A5633A05CC0CD8" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_BFB9B3022A6C8D9EDBA57B89058FDFBD" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_1616F6BD5055B800012A605247B5AC50" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_7FA0CE0FB8FE981205AE4444F9483D40" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_24CC4C4F721736ECA4CACDE2E868F356" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_7786D558494C6E31096187EFF5280365" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_5D4A130C7710F31397E77392A962A7F0" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_CC23A57E743BD96D8C406B703A8E74D6" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_DB2FE965FC8553215481813D77FE917A" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_49A73026F0385BCD8B6C8BC1FCA3171E" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_5C67CA7D250FDE6BD6EB3DA026C9E609" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_DFC25003A292366E800AA9D1F1B718AE" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_F5C81E04F66151DF6C7146E2A19F58A3" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_80CCC200D3BB534007550DEE28117657" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_BE0AA97B689F435A66973DA8C0B3FBAB" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_4B1457626EF021E89B30C19C1E508BE7" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_F5101F37851EA659C1D69BDAB446D70A" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_8D280F1E4F5E2F1754505609323472F5" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_120E86A2F6B2FBF01D5CEFF23BBDADCB" + "MsmSig" = "8:_UNDEFINED" + } + } + "Configurations" + { + "Debug" + { + "DisplayName" = "8:Debug" + "IsDebugOnly" = "11:TRUE" + "IsReleaseOnly" = "11:FALSE" + "OutputFilename" = "8:Release\\Openstack.Powershell.msi" + "PackageFilesAs" = "3:2" + "PackageFileSize" = "3:-2147483648" + "CabType" = "3:1" + "Compression" = "3:2" + "SignOutput" = "11:FALSE" + "CertificateFile" = "8:" + "PrivateKeyFile" = "8:" + "TimeStampServer" = "8:" + "InstallerBootstrapper" = "3:2" + "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" + { + "Enabled" = "11:TRUE" + "PromptEnabled" = "11:TRUE" + "PrerequisitesLocation" = "2:1" + "Url" = "8:" + "ComponentsUrl" = "8:" + "Items" + { + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.0" + { + "Name" = "8:Microsoft .NET Framework 4 (x86 and x64)" + "ProductCode" = "8:.NETFramework,Version=v4.0" + } + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Windows.Installer.3.1" + { + "Name" = "8:Windows Installer 3.1" + "ProductCode" = "8:Microsoft.Windows.Installer.3.1" + } + } + } + } + "Release" + { + "DisplayName" = "8:Release" + "IsDebugOnly" = "11:FALSE" + "IsReleaseOnly" = "11:TRUE" + "OutputFilename" = "8:Release\\Openstack.Powershell.msi" + "PackageFilesAs" = "3:2" + "PackageFileSize" = "3:-2147483648" + "CabType" = "3:1" + "Compression" = "3:2" + "SignOutput" = "11:FALSE" + "CertificateFile" = "8:" + "PrivateKeyFile" = "8:" + "TimeStampServer" = "8:" + "InstallerBootstrapper" = "3:2" + "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" + { + "Enabled" = "11:TRUE" + "PromptEnabled" = "11:TRUE" + "PrerequisitesLocation" = "2:1" + "Url" = "8:" + "ComponentsUrl" = "8:" + "Items" + { + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.0,Profile=Client" + { + "Name" = "8:Microsoft .NET Framework 4 Client Profile (x86 and x64)" + "ProductCode" = "8:.NETFramework,Version=v4.0,Profile=Client" + } + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Windows.Installer.3.1" + { + "Name" = "8:Windows Installer 3.1" + "ProductCode" = "8:Microsoft.Windows.Installer.3.1" + } + } + } + } + } + "Deployable" + { + "CustomAction" + { + } + "DefaultFeature" + { + "Name" = "8:DefaultFeature" + "Title" = "8:" + "Description" = "8:" + } + "ExternalPersistence" + { + "LaunchCondition" + { + "{A06ECF26-33A3-4562-8140-9B0E340D4F24}:_55054CFFC25E4C08AE74A7A094EFAD6C" + { + "Name" = "8:.NET Framework" + "Message" = "8:[VSDNETMSG]" + "FrameworkVersion" = "8:.NETFramework,Version=v4.0,Profile=Client" + "AllowLaterVersions" = "11:FALSE" + "InstallUrl" = "8:http://go.microsoft.com/fwlink/?LinkId=131000" + } + } + } + "File" + { + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_0108F045584E4F02A9CCFCDE41A4E5FE" + { + "SourcePath" = "8:..\\Openstack.Client.Powershell\\Deployment\\License.rtf" + "TargetName" = "8:License.rtf" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_120E86A2F6B2FBF01D5CEFF23BBDADCB" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_120E86A2F6B2FBF01D5CEFF23BBDADCB" + { + "Name" = "8:Newtonsoft.Json.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:Newtonsoft.Json.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_1616F6BD5055B800012A605247B5AC50" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:TRUE" + "AssemblyAsmDisplayName" = "8:System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_1616F6BD5055B800012A605247B5AC50" + { + "Name" = "8:System.Management.Automation.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:System.Management.Automation.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_24CC4C4F721736ECA4CACDE2E868F356" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:System.Data.OData, Version=4.99.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_24CC4C4F721736ECA4CACDE2E868F356" + { + "Name" = "8:System.Data.OData.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:System.Data.OData.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_479B6CE5D32F47CA87619917C183495B" + { + "SourcePath" = "8:..\\Openstack.Client.Powershell\\Deployment\\Microsoft.PowerShell_profile.ps1" + "TargetName" = "8:Microsoft.PowerShell_profile.ps1" + "Tag" = "8:" + "Folder" = "8:_B2A2973E3B55492CB13E4038783D9DC1" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_49A73026F0385BCD8B6C8BC1FCA3171E" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:Microsoft.Data.Spatial, Version=4.99.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_49A73026F0385BCD8B6C8BC1FCA3171E" + { + "Name" = "8:Microsoft.Data.Spatial.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:Microsoft.Data.Spatial.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_4B1457626EF021E89B30C19C1E508BE7" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:Microsoft.Server.Common, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_4B1457626EF021E89B30C19C1E508BE7" + { + "Name" = "8:Microsoft.Server.Common.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:Microsoft.Server.Common.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_5C67CA7D250FDE6BD6EB3DA026C9E609" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:Microsoft.ApplicationServer.HttpEnhancements, Version=0.3.0.0, Culture=neutral, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_5C67CA7D250FDE6BD6EB3DA026C9E609" + { + "Name" = "8:Microsoft.ApplicationServer.HttpEnhancements.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:Microsoft.ApplicationServer.HttpEnhancements.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_5D4A130C7710F31397E77392A962A7F0" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_5D4A130C7710F31397E77392A962A7F0" + { + "Name" = "8:System.Net.Http.Formatting.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:System.Net.Http.Formatting.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_6A1D92BBE10E490E97DB380F836A3C37" + { + "SourcePath" = "8:..\\Openstack.Client.Powershell\\Deployment\\CLI.config" + "TargetName" = "8:CLI.config" + "Tag" = "8:" + "Folder" = "8:_87CD8629B7FC462E931E315AFD4D0AED" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_7786D558494C6E31096187EFF5280365" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:Openstack.Objects, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_7786D558494C6E31096187EFF5280365" + { + "Name" = "8:Openstack.Objects.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:Openstack.Objects.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_7AD1F39B117F45F79449D2071C2360FD" + { + "SourcePath" = "8:..\\Openstack.Client.Powershell\\Deployment\\OpenstackShell.format.ps1xml" + "TargetName" = "8:OpenstackShell.format.ps1xml" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_7FA0CE0FB8FE981205AE4444F9483D40" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:System.Net.Http.WebRequest, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_7FA0CE0FB8FE981205AE4444F9483D40" + { + "Name" = "8:System.Net.Http.WebRequest.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:System.Net.Http.WebRequest.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_80CCC200D3BB534007550DEE28117657" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:Microsoft.Runtime.Serialization.Internal, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_80CCC200D3BB534007550DEE28117657" + { + "Name" = "8:Microsoft.Runtime.Serialization.Internal.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:Microsoft.Runtime.Serialization.Internal.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_8D280F1E4F5E2F1754505609323472F5" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:BouncyCastle.Crypto, Version=1.7.4137.9688, Culture=neutral, PublicKeyToken=a4292a325f69b123, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_8D280F1E4F5E2F1754505609323472F5" + { + "Name" = "8:BouncyCastle.Crypto.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:BouncyCastle.Crypto.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_B033ABE13B0544B4BCCC0519C661931A" + { + "SourcePath" = "8:..\\Openstack.Client.Powershell\\Deployment\\CredentialList.xml" + "TargetName" = "8:CredentialList.xml" + "Tag" = "8:" + "Folder" = "8:_87CD8629B7FC462E931E315AFD4D0AED" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_BE0AA97B689F435A66973DA8C0B3FBAB" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:Microsoft.Json, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_BE0AA97B689F435A66973DA8C0B3FBAB" + { + "Name" = "8:Microsoft.Json.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:Microsoft.Json.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_BFB9B3022A6C8D9EDBA57B89058FDFBD" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:TRUE" + "AssemblyAsmDisplayName" = "8:AWSSDK, Version=1.5.12.1, Culture=neutral, PublicKeyToken=cd2d24cd2bace800, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_BFB9B3022A6C8D9EDBA57B89058FDFBD" + { + "Name" = "8:AWSSDK.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:AWSSDK.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_CC23A57E743BD96D8C406B703A8E74D6" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_CC23A57E743BD96D8C406B703A8E74D6" + { + "Name" = "8:System.Net.Http.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:System.Net.Http.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_DB2FE965FC8553215481813D77FE917A" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:Openstack.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_DB2FE965FC8553215481813D77FE917A" + { + "Name" = "8:Openstack.Common.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:Openstack.Common.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_DFC25003A292366E800AA9D1F1B718AE" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:Microsoft.ApplicationServer.Http, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_DFC25003A292366E800AA9D1F1B718AE" + { + "Name" = "8:Microsoft.ApplicationServer.Http.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:Microsoft.ApplicationServer.Http.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_E4B6908BAA2642AAA608ECBDB527B9DF" + { + "SourcePath" = "8:..\\Openstack.Client.Powershell\\Deployment\\CLIManifest.psd1" + "TargetName" = "8:CLIManifest.psd1" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_ED9653262D774E91943C82410BCE16F4" + { + "SourcePath" = "8:..\\Openstack.Client.Powershell\\Deployment\\powershell.exe.config" + "TargetName" = "8:powershell.exe.config" + "Tag" = "8:" + "Folder" = "8:_F947D145E9E04E8DBF01747FA4838FDB" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_EEDE127153874226B3B4F0346775DC9E" + { + "SourcePath" = "8:..\\Openstack.Client.Powershell\\Deployment\\Openstack.Client.Powershell.dll-Help.xml" + "TargetName" = "8:Openstack.Client.Powershell.dll-Help.xml" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_F5101F37851EA659C1D69BDAB446D70A" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:EntityDataModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_F5101F37851EA659C1D69BDAB446D70A" + { + "Name" = "8:EntityDataModel.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:EntityDataModel.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_F5C81E04F66151DF6C7146E2A19F58A3" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:Microsoft.ServiceModel.Internal, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_F5C81E04F66151DF6C7146E2A19F58A3" + { + "Name" = "8:Microsoft.ServiceModel.Internal.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:Microsoft.ServiceModel.Internal.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + } + "FileType" + { + } + "Folder" + { + "{1525181F-901A-416C-8A58-119130FE478E}:_28CA19A0A44B47C5A21339D3570393EE" + { + "Name" = "8:#1914" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:SystemFolder" + "Folders" + { + "{9EF0B969-E518-4E46-987F-47570745A589}:_3DB17BBC7838478888F8E5A3B2DBF500" + { + "Name" = "8:WindowsPowershell" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:_EB610A086BAB4DD0979BC27CA5A31095" + "Folders" + { + "{9EF0B969-E518-4E46-987F-47570745A589}:_F947D145E9E04E8DBF01747FA4838FDB" + { + "Name" = "8:v1.0" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:_82756904F8184708B194388C789F6755" + "Folders" + { + } + } + } + } + } + } + "{1525181F-901A-416C-8A58-119130FE478E}:_4E2D7BB09B38459BA1EC96A972F5D5B3" + { + "Name" = "8:#1919" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:ProgramMenuFolder" + "Folders" + { + } + } + "{1525181F-901A-416C-8A58-119130FE478E}:_A189E1C570CF48C48417696154535108" + { + "Name" = "8:#1916" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:DesktopFolder" + "Folders" + { + } + } + "{3C67513D-01DD-4637-8A68-80971EB9504F}:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + { + "DefaultLocation" = "8:[ProgramFilesFolder][Manufacturer]\\[ProductName]" + "Name" = "8:#1925" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:TARGETDIR" + "Folders" + { + } + } + "{1525181F-901A-416C-8A58-119130FE478E}:_CE8B4D10528A4EA487A61D155B873CCC" + { + "Name" = "8:#1918" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:PersonalFolder" + "Folders" + { + "{9EF0B969-E518-4E46-987F-47570745A589}:_87CD8629B7FC462E931E315AFD4D0AED" + { + "Name" = "8:OS" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:_DFAC1AF0966D4E2A8E58D73A830ACC02" + "Folders" + { + } + } + "{9EF0B969-E518-4E46-987F-47570745A589}:_B2A2973E3B55492CB13E4038783D9DC1" + { + "Name" = "8:WindowsPowerShell" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:_DDD4E7ACA6854964A6C172AF00694CD9" + "Folders" + { + } + } + } + } + } + "LaunchCondition" + { + } + "Locator" + { + } + "MsiBootstrapper" + { + "LangId" = "3:1033" + "RequiresElevation" = "11:FALSE" + } + "Product" + { + "Name" = "8:Microsoft Visual Studio" + "ProductName" = "8:Openstack-Powershell" + "ProductCode" = "8:{C18DFE3F-A1BA-4198-BFE4-D1B68C770E5D}" + "PackageCode" = "8:{33DFB56F-B04A-43E3-8841-6BBB1B71CDD5}" + "UpgradeCode" = "8:{C641E061-8F30-4D37-A138-F60C1E7CBFCC}" + "AspNetVersion" = "8:4.0.30319.0" + "RestartWWWService" = "11:FALSE" + "RemovePreviousVersions" = "11:FALSE" + "DetectNewerInstalledVersion" = "11:TRUE" + "InstallAllUsers" = "11:FALSE" + "ProductVersion" = "8:1.0.0" + "Manufacturer" = "8:OpenStack" + "ARPHELPTELEPHONE" = "8:" + "ARPHELPLINK" = "8:" + "Title" = "8:OpenStack Powershell Installation" + "Subject" = "8:" + "ARPCONTACT" = "8:Travis Plummer" + "Keywords" = "8:" + "ARPCOMMENTS" = "8:" + "ARPURLINFOABOUT" = "8:https://www.openstack.org" + "ARPPRODUCTICON" = "8:" + "ARPIconIndex" = "3:0" + "SearchPath" = "8:" + "UseSystemSearchPath" = "11:TRUE" + "TargetPlatform" = "3:0" + "PreBuildEvent" = "8:" + "PostBuildEvent" = "8:" + "RunPostBuildEvent" = "3:0" + } + "Registry" + { + "HKLM" + { + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_577AC17166584F428E1BFBA6C2E8D662" + { + "Name" = "8:Software" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_D90EB64DA3BE4D06B2FA4FF0B411F23B" + { + "Name" = "8:[Manufacturer]" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + } + "Values" + { + } + } + } + "Values" + { + } + } + } + } + "HKCU" + { + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_D62C6F0F1552497083B13D6DEF4B1C14" + { + "Name" = "8:Software" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_1FB3CD672F294ECCACBDDABCF5295401" + { + "Name" = "8:[Manufacturer]" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + } + "Values" + { + } + } + } + "Values" + { + } + } + } + } + "HKCR" + { + "Keys" + { + } + } + "HKU" + { + "Keys" + { + } + } + "HKPU" + { + "Keys" + { + } + } + } + "Sequences" + { + } + "Shortcut" + { + } + "UserInterface" + { + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_12A236C0C68E43D1955A02A2DF4107FB" + { + "Name" = "8:#1901" + "Sequence" = "3:2" + "Attributes" = "3:2" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_3DBCB751BE954AE88D0D991FA4F51981" + { + "Sequence" = "3:100" + "DisplayName" = "8:Progress" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminProgressDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "ShowProgress" + { + "Name" = "8:ShowProgress" + "DisplayName" = "8:#1009" + "Description" = "8:#1109" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_226596825242492183DA2072044D1A0E" + { + "Name" = "8:#1902" + "Sequence" = "3:2" + "Attributes" = "3:3" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_F31B30656D594A8F94C14F4E9DADCF53" + { + "Sequence" = "3:100" + "DisplayName" = "8:Finished" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminFinishedDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_3E74C822BC8D4C84BA6885E2B2860738" + { + "Name" = "8:#1900" + "Sequence" = "3:1" + "Attributes" = "3:1" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_10F0A2B3D563447E901F553D3ED2F6DE" + { + "Sequence" = "3:210" + "DisplayName" = "8:License Agreement" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdLicenseDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "EulaText" + { + "Name" = "8:EulaText" + "DisplayName" = "8:#1008" + "Description" = "8:#1108" + "Type" = "3:6" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:2" + "Value" = "8:_0108F045584E4F02A9CCFCDE41A4E5FE" + "UsePlugInResources" = "11:TRUE" + } + "Sunken" + { + "Name" = "8:Sunken" + "DisplayName" = "8:#1007" + "Description" = "8:#1107" + "Type" = "3:5" + "ContextData" = "8:4;True=4;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:4" + "DefaultValue" = "3:4" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_5AC05D021DC14E26B740EC1406672FDF" + { + "Sequence" = "3:100" + "DisplayName" = "8:Welcome" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdWelcomeDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "CopyrightWarning" + { + "Name" = "8:CopyrightWarning" + "DisplayName" = "8:#1002" + "Description" = "8:#1102" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1202" + "DefaultValue" = "8:#1202" + "UsePlugInResources" = "11:TRUE" + } + "Welcome" + { + "Name" = "8:Welcome" + "DisplayName" = "8:#1003" + "Description" = "8:#1103" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1203" + "DefaultValue" = "8:#1203" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_732B9DFF89134E46938093AA7904D6FD" + { + "Sequence" = "3:300" + "DisplayName" = "8:Confirm Installation" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdConfirmDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_DB577EB87E544C34933A2734BFA8A34F" + { + "Sequence" = "3:200" + "DisplayName" = "8:Installation Folder" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdFolderDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "InstallAllUsersVisible" + { + "Name" = "8:InstallAllUsersVisible" + "DisplayName" = "8:#1059" + "Description" = "8:#1159" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_5120F5A6901944D2A802D7B6E26FC35E" + { + "Name" = "8:#1900" + "Sequence" = "3:2" + "Attributes" = "3:1" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_5CA3F491F3AD4AFC8B6C5362C82EB6D3" + { + "Sequence" = "3:200" + "DisplayName" = "8:Installation Folder" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminFolderDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_7967898D916B46CCAE9CF7029B7DB728" + { + "Sequence" = "3:300" + "DisplayName" = "8:Confirm Installation" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminConfirmDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_7BC7357CB94246999E4A8E2C16DC4EEF" + { + "Sequence" = "3:210" + "DisplayName" = "8:License Agreement" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminLicenseDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "EulaText" + { + "Name" = "8:EulaText" + "DisplayName" = "8:#1008" + "Description" = "8:#1108" + "Type" = "3:6" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:2" + "Value" = "8:_0108F045584E4F02A9CCFCDE41A4E5FE" + "UsePlugInResources" = "11:TRUE" + } + "Sunken" + { + "Name" = "8:Sunken" + "DisplayName" = "8:#1007" + "Description" = "8:#1107" + "Type" = "3:5" + "ContextData" = "8:4;True=4;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:4" + "DefaultValue" = "3:4" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_84B43E40F6BE493AA4AE1C1297A80910" + { + "Sequence" = "3:100" + "DisplayName" = "8:Welcome" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminWelcomeDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "CopyrightWarning" + { + "Name" = "8:CopyrightWarning" + "DisplayName" = "8:#1002" + "Description" = "8:#1102" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1202" + "DefaultValue" = "8:#1202" + "UsePlugInResources" = "11:TRUE" + } + "Welcome" + { + "Name" = "8:Welcome" + "DisplayName" = "8:#1003" + "Description" = "8:#1103" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1203" + "DefaultValue" = "8:#1203" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_944ACD4C1BE94CE29D115EFDC74C889D" + { + "UseDynamicProperties" = "11:FALSE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdUserInterface.wim" + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_9EDC9C21078E4EE4B2C489BB38666C4F" + { + "Name" = "8:#1902" + "Sequence" = "3:1" + "Attributes" = "3:3" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_8FD10AF1C5414862AF9E8EF6E0A0B889" + { + "Sequence" = "3:100" + "DisplayName" = "8:Finished" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdFinishedDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "UpdateText" + { + "Name" = "8:UpdateText" + "DisplayName" = "8:#1058" + "Description" = "8:#1158" + "Type" = "3:15" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1258" + "DefaultValue" = "8:#1258" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_E16E901F34954D24A8DB7E2006EFD074" + { + "UseDynamicProperties" = "11:FALSE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdBasicDialogs.wim" + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_F932E58FA3164F338D979A893086D0A7" + { + "Name" = "8:#1901" + "Sequence" = "3:1" + "Attributes" = "3:2" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_137D78E425F947ABAA4948884266A8A9" + { + "Sequence" = "3:100" + "DisplayName" = "8:Progress" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdProgressDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "ShowProgress" + { + "Name" = "8:ShowProgress" + "DisplayName" = "8:#1009" + "Description" = "8:#1109" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + } + "MergeModule" + { + } + "ProjectOutput" + { + "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_0C4093C3ABCB4881933B1E9DB5608D72" + { + "SourcePath" = "8:" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:XmlSerializer" + "OutputProjectGuid" = "8:{32BAC168-2EC8-4074-9E6D-8C13460DCFAD}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_43DC30A840684F04BCFF32121E1ECFAF" + { + "SourcePath" = "8:" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:ContentFiles" + "OutputProjectGuid" = "8:{32BAC168-2EC8-4074-9E6D-8C13460DCFAD}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_7CBBD5AF8E1641BC9A8E33B94C43F736" + { + "SourcePath" = "8:" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:Documentation" + "OutputProjectGuid" = "8:{32BAC168-2EC8-4074-9E6D-8C13460DCFAD}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_D44F1A855DE64E3295938B778445F161" + { + "SourcePath" = "8:" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:LocalizedResourceDlls" + "OutputProjectGuid" = "8:{32BAC168-2EC8-4074-9E6D-8C13460DCFAD}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_F9DA14B8181D4D1C81A5633A05CC0CD8" + { + "SourcePath" = "8:..\\Openstack.Client.Powershell\\obj\\Debug\\Openstack.Client.Powershell.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_CA25B11EEB9B4EAE95BE65E3A7F5E7EA" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:Built" + "OutputProjectGuid" = "8:{32BAC168-2EC8-4074-9E6D-8C13460DCFAD}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + } + } +} diff --git a/Openstack.Client.Powershell/BaseNavigationCmdletProvider.cs b/Openstack.Client.Powershell/BaseNavigationCmdletProvider.cs new file mode 100644 index 0000000..3d2567f --- /dev/null +++ b/Openstack.Client.Powershell/BaseNavigationCmdletProvider.cs @@ -0,0 +1,242 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Management.Automation; +using System.Management.Automation.Provider; +using Openstack; +using System.Xml.Serialization; +using System.Xml; +using System.IO; +using System.Text; +using System.Runtime.Serialization.Json; +using Openstack.Client.Powershell.Providers.Storage; +using System.Reflection; +using System.Xml.Linq; +using System.Xml.XPath; +using System.Threading; +using Openstack.Client.Powershell.Utility; +using Openstack.Storage; +using System.Security; +using System.Linq; +using Openstack.Identity; + + +namespace Openstack.Client.Powershell.Providers.Common +{ + public class BaseNavigationCmdletProvider : NavigationCmdletProvider + { + + OpenstackClient _client; // = new OpenstackClient(credential, CancellationToken.None); + + +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected OpenstackClient Client + { + get + { + return (OpenstackClient)this.SessionState.PSVariable.Get("Client").Value; + } + set + { + this.SessionState.PSVariable.Set(new PSVariable("Client", value)); + } + } +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + protected Settings Settings + { + get + { + return this.Context.Settings; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + protected Context Context + { + get + { + return (Context)this.SessionState.PSVariable.GetValue("Context", null); + } + } +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + private bool IsContextInitialized() + { + if (this.SessionState.PSVariable.GetValue("Context", null) == null) { + return false; + } + else + { + return true; + } + } +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + protected string ConfigFilePath + { + get + { + try + { + return (string)this.SessionState.PSVariable.Get("ConfigPath").Value; + } + catch (Exception) + { + return Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\" + @"OS\CLI.config"; + } + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + private void SetZoneColor() + { + string configFilePath = this.ConfigFilePath; + XDocument doc = XDocument.Load(configFilePath); + XElement defaultZoneNode = doc.XPathSelectElement("//AvailabilityZone[@isDefault='True']"); + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), defaultZoneNode.Attribute("shellForegroundColor").Value); + this.Host.UI.RawUI.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), defaultZoneNode.Attribute("shellForegroundColor").Value); + this.Context.Forecolor = defaultZoneNode.Attribute("shellForegroundColor").Value; + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + protected void InitializeSession() + { + CredentialManager manager = new CredentialManager(false); + IOpenstackCredential credential = manager.GetCredentials(false); + + // Connect to the Service Provider.. + + var client = new OpenstackClient(credential, CancellationToken.None); + var connectTask = client.Connect(); + connectTask.Wait(); + + // Setup the environment based on what came back from Auth.. + + Context context = new Context(); + context.ServiceCatalog = credential.ServiceCatalog; + context.Settings = Settings.Default; + context.ProductName = "Openstack-WinCLI"; + context.Version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); + + this.SessionState.PSVariable.Set(new PSVariable("Context", context)); + this.SessionState.PSVariable.Set(new PSVariable("Client", client)); + this.SetZoneColor(); + } + #region Implementation of DriveCmdletProvider +//================================================================================================== +/// +/// Removes an Item from the store.. +/// +/// +//================================================================================================== + protected override void ClearItem(string path) + { + base.ClearItem(path); + } +//================================================================================================== +/// +/// Called when the user decides to delete a KVSDrive. +/// +/// +/// +//================================================================================================== + protected override PSDriveInfo RemoveDrive(PSDriveInfo drive) + { + if (drive == null) + { + WriteError(new ErrorRecord(new ArgumentNullException("drive"), "NullDrive", ErrorCategory.InvalidArgument, drive)); + return null; + } + return drive; + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + protected override void GetChildNames(string path, ReturnContainers returnContainers) + { + WriteItemObject(path, path, true); + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + protected override string GetChildName(string path) + { + return base.GetChildName(path); + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + protected override bool ItemExists(string path) + { + return true; + } + #endregion + +//================================================================================================== +/// +/// This test should not verify the existance of the item at the path. +/// It should only perform syntactic and semantic validation of the +/// path. For instance, for the file system provider, that path should +/// be canonicalized, syntactically verified, and ensure that the path +/// does not refer to a device. +/// +/// +/// +//================================================================================================== + protected override bool IsValidPath(string path) + { + return true; + } + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/BasePSCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/BasePSCmdlet.cs new file mode 100644 index 0000000..826e6be --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/BasePSCmdlet.cs @@ -0,0 +1,383 @@ +///* ============================================================================ +//Copyright 2014 Hewlett Packard + +//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. +//============================================================================ */ +//using System; +//using System.Text; +//using System.Management.Automation; +//using Openstack.Objects.DataAccess; +//using System.IO; +//using Openstack.Common.Properties; +//using System.Xml; +//using System.Xml.Serialization; +//using Openstack.Client.Powershell.Providers.Storage; +//using Openstack.Objects.Domain; +//using Openstack.Objects.Utility; +//using Openstack.Client.Powershell.Providers.Common; +//using System.Linq; +//using System.Collections.ObjectModel; +//using System.Management.Automation.Host; + +//namespace Openstack.Client.Powershell.Cmdlets.Common +//{ +// public class BasePSCmdlet : PSCmdlet +// { +// private Openstack.Objects.DataAccess.ResponseFormat _responseFormat = ResponseFormat.none; +// private BaseRepositoryFactory _repositoryFactory; + +// #region Properties +////========================================================================================= +///// +///// +///// +////========================================================================================= +// protected BaseUIContainer CurrentContainer +// { +// get +// { +// CommonDriveInfo tempDrive = this.Drive as CommonDriveInfo; +// if (tempDrive != null) +// { +// return tempDrive.CurrentContainer as BaseUIContainer; +// } +// else return null; +// } +// } +////========================================================================================= +///// +///// Exposes the currently mapped Drive. Belongs in base class??? +///// +////========================================================================================= +// protected PSDriveInfo Drive +// { +// get +// { +// return this.SessionState.Drive.Current; +// } +// } +////========================================================================================= +///// +///// +///// +///// +////========================================================================================= +// protected void WriteHeaderSection(string headerText) +// { +// WriteObject(" "); +// Console.ForegroundColor = ConsoleColor.DarkGray; +// WriteObject("=============================================================================================="); +// Console.ForegroundColor = ConsoleColor.Yellow; +// WriteObject(headerText); +// Console.ForegroundColor = ConsoleColor.DarkGray; +// WriteObject("=============================================================================================="); +// Console.ForegroundColor = ConsoleColor.Green; +// } +////================================================================================================== +///// +///// +///// +////================================================================================================== +// protected Context Context +// { +// get +// { +// return (Context)this.SessionState.PSVariable.GetValue("Context", null); +// } +// set +// { +// this.SessionState.PSVariable.Set(new PSVariable("Context", value)); +// } +// } +////========================================================================================= +///// +///// +///// +////========================================================================================= +// protected BaseRepositoryFactory RepositoryFactory +// { +// get +// { +// if (_repositoryFactory == null) +// { +// try +// { +// _repositoryFactory = (BaseRepositoryFactory)this.SessionState.PSVariable.Get("BaseRepositoryFactory").Value; +// } +// catch (NullReferenceException ex) +// { +// throw new PSSecurityException("The Authentication process has failed for this session. Please ensure that proper credentials have been supplied before using any of these cmdlets."); +// } +// return _repositoryFactory; +// } +// else +// { +// return _repositoryFactory; +// } +// } +// } +////========================================================================================= +///// +///// +///// +///// +////========================================================================================= +// protected string ConfigFilePath +// { +// get +// { +// try +// { +// return (string)this.SessionState.PSVariable.Get("ConfigPath").Value; +// } +// catch (Exception) +// { +// return Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\" + @"OS\CLI.config"; +// } +// } +// } +////========================================================================================= +///// +///// +///// +///// +////========================================================================================= +// protected Settings Settings +// { +// set +// { +// this.Context.Settings = value; +// } +// get +// { +// return this.Context.Settings; +// } +// } +// #endregion +// #region Methods +////================================================================================================== +///// +///// +///// +///// +///// +////================================================================================================== +// protected string TranslateQuickPickNumber(string path) +// { +// CommonDriveInfo drive = this.Drive as CommonDriveInfo; +// if (drive != null) +// { +// BaseUIContainer result = null; +// int number = 0; + +// if (Int32.TryParse(Path.GetFileName(path), out number)) +// { +// if (path == "\\" + this.Drive.CurrentLocation) +// { +// return path.Replace(Path.GetFileName(path), drive.CurrentContainer.Entity.Id); +// } +// //else if (path.Length < this.Drive.CurrentLocation.Length) +// //{ +// // result = drive.CurrentContainer.Parent; +// //} +// else +// { +// result = drive.CurrentContainer.Containers.Where(q => q.Entity.QuickPickNumber == number).FirstOrDefault(); +// } +// } +// else +// { +// return path; +// } + +// if (result != null) +// return path.Replace(Path.GetFileName(path), result.Id); +// else return null; +// } +// else return null; +// } +////================================================================================================== +///// +///// +///// +////================================================================================================== +// protected override void BeginProcessing() +// { +// if (this.Drive.Name != "OpenStack" && this.Drive.Provider.Name != "OS-Storage") +// { +// ErrorRecord err = new ErrorRecord(new InvalidOperationException("You must be attached to an ObjectStorage Container or the OpenStack drive to execute an OpenStack Cloud cmdlet."), "0" , ErrorCategory.InvalidOperation, this); +// this.ThrowTerminatingError(err); +// } + +// bool isAuthorized = false; +// Type type = this.GetType(); +// object[] metadata = type.GetCustomAttributes(false); +// bool foundattribute = false; + +// foreach (object attribute in metadata) +// { +// RequiredServiceIdentifierAttribute identifier = attribute as RequiredServiceIdentifierAttribute; + +// if (identifier != null) +// { +// if (this.Context.ServiceCatalog.GetService(identifier.Services) != null) +// isAuthorized = true; +// } +// } + +// if (isAuthorized == false && foundattribute == false) return; + +// if (!isAuthorized) +// this.ThrowTerminatingError(new ErrorRecord(new InvalidOperationException("You're not current authorized to use this service. Please go to https://www.Openstack.com/ for more information on signing up for this service."), "aa", ErrorCategory.InvalidOperation, this)); +// } +////================================================================================================== +///// +///// Writes out the files represented as StorageObjects for the supplied path. +///// +////================================================================================================== +// protected void WriteXML(T graph, string path) +// { +// XmlTextWriter xtw = null; +// MemoryStream stream = new MemoryStream(); +// StringBuilder builder = new StringBuilder(); +// XmlDocument document = new XmlDocument(); +// StringWriter writer = null; +// XmlSerializer serializer = new XmlSerializer(typeof(T)); + +// try +// { +// serializer.Serialize(stream, graph); +// stream.Position = 0; +// document.Load(stream); + +// writer = new StringWriter(builder); +// xtw = new XmlTextWriter(writer); +// xtw.Formatting = Formatting.Indented; + +// document.WriteTo(xtw); +// } +// finally +// { +// xtw.Close(); +// } +// WriteObject(builder.ToString()); +// WriteObject(""); +// } +// #endregion +// #region Methods +////========================================================================================= +///// +///// +///// +///// +///// +////========================================================================================= +// protected bool UserConfirmsDeleteAction(string entity) +// { +// Collection choices = new Collection(); +// choices.Add(new ChoiceDescription("Y", "Yes")); +// choices.Add(new ChoiceDescription("N", "No")); + +// if (this.Host.UI.PromptForChoice("Confirm Action", "You are about to delete all " + entity + " in the current container. Are you sure about this?", choices, 0) == 0) +// { +// return true; +// } +// else +// { +// return false; +// } +// } +////========================================================================================= +///// +///// +///// +////========================================================================================= +// protected void UpdateCache(Context context) +// { +// CommonDriveInfo tempDrive = this.Drive as CommonDriveInfo; +// if (tempDrive != null) +// { +// BaseUIContainer container = tempDrive.CurrentContainer as BaseUIContainer; +// container.Context = context; + +// if (container != null) +// { +// try +// { +// container.Load(); +// } +// catch (InvalidOperationException) { } +// if (container.Parent != null) +// container.Parent.Load(); +// } +// } +// } +////========================================================================================= +///// +///// +///// +////========================================================================================= +// protected void UpdateCache() +// { +// CommonDriveInfo tempDrive = this.Drive as CommonDriveInfo; +// if (tempDrive != null) +// { +// BaseUIContainer container = tempDrive.CurrentContainer as BaseUIContainer; + +// if (container != null) +// { +// try +// { +// container.Load(); +// } +// catch (InvalidOperationException) { } +// if (container.Parent != null) +// container.Parent.Load(); +// } +// } +// } +////========================================================================================= +///// +///// Updates the cache if the current UIContainer manages the supplied type. +///// +////========================================================================================= +// protected void UpdateCache() where T : BaseUIContainer +// { +// T container = ((CommonDriveInfo)this.Drive).CurrentContainer as T; + +// if (container != null) +// { +// container.Load(); +// } +// else +// { +// T parentContainer = ((CommonDriveInfo)this.Drive).CurrentContainer.Parent as T; +// if (parentContainer != null) +// { +// parentContainer.Load(); +// } +// } +// } +////========================================================================================= +///// +///// +///// +///// +////========================================================================================= +// protected StoragePath CreateStoragePath(string path) +// { +// return ((OSDriveInfo)this.Drive).CreateStoragePath(path); +// } +// #endregion +// } +//} diff --git a/Openstack.Client.Powershell/Cmdlets/BlockStorage/AttachVolumeCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/BlockStorage/AttachVolumeCmdlet.cs new file mode 100644 index 0000000..51a1b25 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/BlockStorage/AttachVolumeCmdlet.cs @@ -0,0 +1,97 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.BlockStorage; +using Openstack.Client.Powershell.Providers.BlockStorage; +using Openstack.Client.Powershell.Providers.Security; + +namespace Openstack.Client.Powershell.Cmdlets.BlockStorage +{ + [Cmdlet("Attach", "Volume", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.BlockStorage)] + public class AttachVolumeCmdlet : BasePSCmdlet + { + private string _serverId; + private string _volumeId; + private string _device; + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "AttachVolume", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("s")] + [ValidateNotNullOrEmpty] + public string ServerId + { + get { return _serverId; } + set { _serverId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "AttachVolume", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("v")] + [ValidateNotNullOrEmpty] + public string VolumeId + { + get { return _volumeId; } + set { _volumeId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 2, ParameterSetName = "AttachVolume", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("d")] + [ValidateNotNullOrEmpty] + public string Device + { + get { return _device; } + set { _device = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + VolumeAttachment attachment = new VolumeAttachment(); + attachment.Device = this.Device; + attachment.VolumeId = this.VolumeId; + attachment.ServerId = this.ServerId; + + this.RepositoryFactory.CreateVolumeRepository().AttachVolume(attachment, this.ServerId); + this.UpdateCache(); + this.UpdateCache(); + } + #endregion + } +} + + + + diff --git a/Openstack.Client.Powershell/Cmdlets/BlockStorage/BackupVolumeCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/BlockStorage/BackupVolumeCmdlet.cs new file mode 100644 index 0000000..d408dc0 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/BlockStorage/BackupVolumeCmdlet.cs @@ -0,0 +1,107 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.BlockStorage; +using Openstack.Client.Powershell.Providers.BlockStorage; +using Openstack.Client.Powershell.Providers.Security; + +namespace Openstack.Client.Powershell.Cmdlets.BlockStorage +{ + [Cmdlet("Backup", "Volume", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.BlockStorage)] + public class BackupVolumeCmdlet : BasePSCmdlet + { + private NewVolumeBackup _newBackup = new NewVolumeBackup(); + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 3, ParameterSetName = "BackupVolume", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("c")] + [ValidateNotNullOrEmpty] + public string Container + { + get { return _newBackup.Container; } + set { _newBackup.Container = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 2, ParameterSetName = "BackupVolume", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("d")] + [ValidateNotNullOrEmpty] + public string Description + { + get { return _newBackup.Description; } + set { _newBackup.Container = value; } + } + +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "BackupVolume", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("v")] + [ValidateNotNullOrEmpty] + public string VolumeId + { + get { return _newBackup.VolumeId;} + set { _newBackup.VolumeId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "BackupVolume", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("n")] + [ValidateNotNullOrEmpty] + public string Name + { + get { return _newBackup.Name; } + set { _newBackup.Name = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + NewVolumeBackup backup = new NewVolumeBackup(); + + backup.VolumeId = this.TranslateQuickPickNumber(_newBackup.VolumeId); + + this.RepositoryFactory.CreateVolumeRepository().SaveVolumeBackup(backup); + this.UpdateCache(); + } + #endregion + } +} + + + + diff --git a/Openstack.Client.Powershell/Cmdlets/BlockStorage/DetachVolumeCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/BlockStorage/DetachVolumeCmdlet.cs new file mode 100644 index 0000000..314c8f3 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/BlockStorage/DetachVolumeCmdlet.cs @@ -0,0 +1,78 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.BlockStorage; +using Openstack.Client.Powershell.Providers.BlockStorage; +using Openstack.Client.Powershell.Providers.Security; + +namespace Openstack.Client.Powershell.Cmdlets.BlockStorage +{ + [Cmdlet("Detach", "Volume", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.BlockStorage)] + public class DetachVolumeCmdlet : BasePSCmdlet + { + private string _serverId; + private string _volumeId; + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "DettachVolume", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("s")] + [ValidateNotNullOrEmpty] + public string ServerId + { + get { return _serverId; } + set { _serverId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "DettachVolume", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("v")] + [ValidateNotNullOrEmpty] + public string VolumeId + { + get { return _volumeId; } + set { _volumeId = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + this.RepositoryFactory.CreateVolumeRepository().DetachVolume(this.VolumeId, this.ServerId); + this.UpdateCache(); + this.UpdateCache(); + } + #endregion + } +} + + + + diff --git a/Openstack.Client.Powershell/Cmdlets/BlockStorage/NewSnapshotCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/BlockStorage/NewSnapshotCmdlet.cs new file mode 100644 index 0000000..027486e --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/BlockStorage/NewSnapshotCmdlet.cs @@ -0,0 +1,132 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.BlockStorage; +using Openstack.Client.Powershell.Providers.Security; +using System; + +namespace Openstack.Client.Powershell.Cmdlets.BlockStorage +{ + [Cmdlet(VerbsCommon.New, "Snapshot", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.BlockStorage)] + public class NewSnapshotCmdlet : BasePSCmdlet + { + private string _name; + private SwitchParameter _force = false; + private string _description; + private string _volumeId; + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "NewSnapshot", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("n")] + [ValidateNotNullOrEmpty] + public string Name + { + get { return _name; } + set { _name = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "NewSnapshot", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("d")] + [ValidateNotNullOrEmpty] + public string Description + { + get { return _description; } + set { _description = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 2, ParameterSetName = "NewSnapshot", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("v")] + [ValidateNotNullOrEmpty] + public string VolumeId + { + get { return _volumeId; } + set { _volumeId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 4, ParameterSetName = "NewSnapshot", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("f")] + public SwitchParameter Force + { + get { return _force; } + set { _force = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + private bool IsVolumeAvailable(string volumeId) + { + Volume volume = this.RepositoryFactory.CreateVolumeRepository().GetVolume(volumeId); + if (volume.Status == "in-use") + return false; + else + return true; + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + if (this.IsVolumeAvailable(this.VolumeId)) + { + NewSnapshot snapshot = new NewSnapshot(); + snapshot.Description = this.Description; + snapshot.Name = this.Name; + snapshot.VolumeId = this.VolumeId; + snapshot.Force = this.Force; + + this.RepositoryFactory.CreateSnapshotRepository().SaveSnapshot(snapshot); + this.UpdateCache(); + } + else + { + Console.WriteLine(""); + Console.WriteLine("The specified Volume is already in use."); + Console.WriteLine(""); + } + } + #endregion + } +} + + + + diff --git a/Openstack.Client.Powershell/Cmdlets/BlockStorage/NewVolumeCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/BlockStorage/NewVolumeCmdlet.cs new file mode 100644 index 0000000..55c235f --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/BlockStorage/NewVolumeCmdlet.cs @@ -0,0 +1,153 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.BlockStorage; +using Openstack.Client.Powershell.Providers.Security; + +namespace Openstack.Client.Powershell.Cmdlets.BlockStorage +{ + [Cmdlet(VerbsCommon.New, "Volume", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.BlockStorage)] + public class NewVolumeCmdlet : BasePSCmdlet + { + private string _name; + private string _size; + private string _description; + private string[] _metadata; + private NewVolume vol = new NewVolume(); + private string _availabilityZone; + private string _sourceVolid; + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 4, ParameterSetName = "NewVolume", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("az")] + [ValidateNotNullOrEmpty] + public string AvailabilityZone + { + get { return _availabilityZone; } + set { _availabilityZone = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 5, ParameterSetName = "NewVolume", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("svid")] + [ValidateNotNullOrEmpty] + public string SourceVolumeId + { + get { return _sourceVolid; } + set { _sourceVolid = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "NewVolume", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("n")] + [ValidateNotNullOrEmpty] + public string Name + { + get { return _name; } + set { _name = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "NewVolume", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("d")] + [ValidateNotNullOrEmpty] + public string Description + { + get { return _description; } + set { _description = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 2, ParameterSetName = "NewVolume", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("s")] + [ValidateNotNullOrEmpty] + public string Size + { + get { return _size; } + set { _size = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 3, Mandatory = false, ParameterSetName = "NewVolume", ValueFromPipelineByPropertyName = true, HelpMessage = "Valid values include")] + [Alias("md")] + [ValidateNotNullOrEmpty] + public string[] MetaData + { + get { return _metadata; } + set { _metadata = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + NewVolume volume = new NewVolume(); + volume.Description = this.Description; + volume.Name = this.Name; + volume.SourceVolid = this.SourceVolumeId; + volume.AvailabilityZone = this.AvailabilityZone; + + if (this.SourceVolumeId == null) + volume.Size = this.Size; + else + volume.Size = null; + + + if (_metadata != null && _metadata.Length > 0) + { + foreach (string kv in _metadata) + { + char[] seperator = { '|' }; + string[] temp = kv.Split(seperator); + volume.Metadata.Add(temp[0], temp[1]); + } + } + + this.RepositoryFactory.CreateVolumeRepository().SaveVolume(volume); + this.UpdateCache(); + } + #endregion + } +} + + diff --git a/Openstack.Client.Powershell/Cmdlets/BlockStorage/RemoveSnapshotCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/BlockStorage/RemoveSnapshotCmdlet.cs new file mode 100644 index 0000000..d41c8fc --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/BlockStorage/RemoveSnapshotCmdlet.cs @@ -0,0 +1,62 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Client.Powershell.Providers.Security; + +namespace Openstack.Client.Powershell.Cmdlets.BlockStorage +{ + [Cmdlet(VerbsCommon.Remove, "Snapshot", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class RemoveSnapshotCmdlet : BasePSCmdlet + { + private string _snapshotId; + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "RemoveSnapshot", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "a")] + [Alias("s")] + public string SnapshotId + { + get { return _snapshotId; } + set { _snapshotId = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + if (this.UserConfirmsDeleteAction("Snapshots")) + { + this.RepositoryFactory.CreateSnapshotRepository().DeleteSnapshot(this.SnapshotId); + this.UpdateCache(); + } + } + #endregion + } +} + + + diff --git a/Openstack.Client.Powershell/Cmdlets/BlockStorage/RemoveVolumeBackupCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/BlockStorage/RemoveVolumeBackupCmdlet.cs new file mode 100644 index 0000000..6cffa11 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/BlockStorage/RemoveVolumeBackupCmdlet.cs @@ -0,0 +1,26 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Openstack.Client.Powershell.Cmdlets.BlockStorage +{ + class RemoveVolumeBackupCmdlet + { + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/BlockStorage/RemoveVolumeCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/BlockStorage/RemoveVolumeCmdlet.cs new file mode 100644 index 0000000..013aabd --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/BlockStorage/RemoveVolumeCmdlet.cs @@ -0,0 +1,102 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Client.Powershell.Providers.Security; +using Openstack.Objects.Domain.BlockStorage; + +namespace Openstack.Client.Powershell.Cmdlets.BlockStorage +{ + [Cmdlet(VerbsCommon.Remove, "Volume", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class RemoveVolumeCmdlet : BasePSCmdlet + { + private string _volumeId; + private SwitchParameter _force = false; + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "RemoveVolume2", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("all")] + public SwitchParameter RemoveAll + { + get { return _force; } + set { _force = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "RemoveVolume", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "a")] + [Alias("v")] + public string VolumeId + { + get { return _volumeId; } + set { _volumeId = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + string id = this.TranslateQuickPickNumber(this.VolumeId); + + if (_force == true && this.UserConfirmsDeleteAction("Volumes")) { + this.RemoveAllVolumes(); + } + else + { + this.RepositoryFactory.CreateVolumeRepository().DeleteVolume(id); + this.UpdateCache(); + } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void RemoveAllVolumes() + { + List volumes = this.RepositoryFactory.CreateVolumeRepository().GetVolumes(); + Console.WriteLine(""); + + foreach (Volume volume in volumes) + { + + Console.WriteLine("Removing Volume : " + volume.Name); + this.RepositoryFactory.CreateVolumeRepository().DeleteVolume(volume.Id); + + } + Console.WriteLine(""); + } + #endregion + } +} + + + diff --git a/Openstack.Client.Powershell/Cmdlets/Clipboard.cs b/Openstack.Client.Powershell/Cmdlets/Clipboard.cs new file mode 100644 index 0000000..030021d --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Clipboard.cs @@ -0,0 +1,39 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Runtime.InteropServices; +using System.Windows.Forms; + +namespace Openstack.Client.Powershell.Cmdlets +{ + class OutClipboard + { + [STAThread] + public static void SetText(string text) + { + TextBox tb = new TextBox(); + tb.Multiline = true; + + tb.Text = text; + tb.SelectAll(); + tb.Copy(); + + } + } +} + + + diff --git a/Openstack.Client.Powershell/Cmdlets/Common/BaseAuthenticationCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Common/BaseAuthenticationCmdlet.cs new file mode 100644 index 0000000..dd67a1f --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Common/BaseAuthenticationCmdlet.cs @@ -0,0 +1,268 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Management.Automation; +using Openstack.Common.Properties; +using System.Collections.ObjectModel; +using Openstack.Client.Powershell.Providers.Storage; +using System.Collections.Generic; +using Openstack.Objects.Domain; +using Openstack.Objects.DataAccess; +using Openstack.Objects.Domain.Admin; +using Openstack.Objects.DataAccess.Security; +using Openstack.Objects.Utility; + +namespace Openstack.Client.Powershell.Cmdlets.Common +{ + public class BaseAuthenticationCmdlet : BasePSCmdlet + { + private string _key; + private string _value; + private SwitchParameter _reset = false; +//================================================================================================== +/// +/// +/// +//================================================================================================== + protected void InitializeSession(AuthenticationRequest request, Settings settings = null) + { + Context context = new Context(); + + if (request != null) + { + KeystoneAuthProvider authProvider = new KeystoneAuthProvider(); + AuthenticationResponse response = authProvider.Authenticate(request); + + context.ServiceCatalog = response.ServiceCatalog; + if (settings == null) + context.Settings = Settings.Default; + else + context.Settings = settings; + context.AccessToken = response.Token; + + this.SessionState.PSVariable.Set(new PSVariable("Context", context)); + this.SessionState.PSVariable.Set(new PSVariable("BaseRepositoryFactory", new BaseRepositoryFactory(context))); + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + protected void InitializeSession(Settings settings) + { + AuthenticationRequest request = new AuthenticationRequest(new Credentials(settings.Username, settings.Password), settings.DefaultTenantId); + this.InitializeSession(request, settings); + } +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + private System.Collections.ObjectModel.Collection GetAvailableDrives(Settings settings, ProviderInfo providerInfo, string configFilePath) + { + List storageContainers = null; + OSDriveParameters parameters = new OSDriveParameters(); + + if (this.Settings != null) + { + parameters.Settings = this.Settings; + } + else + { + parameters.Settings = settings; + } + + try + { + IContainerRepository storageContainerRepository = this.RepositoryFactory.CreateContainerRepository(); + storageContainers = storageContainerRepository.GetStorageContainers(configFilePath); + } + catch (Exception ex) + { + Console.WriteLine(ex); + } + + Collection drives = new Collection(); + + // For every storageContainer that the User has access to, create a Drive that he can mount within Powershell.. + + try + { + if (storageContainers.Count > 0) + { + foreach (StorageContainer storageContainer in storageContainers) + { + PSDriveInfo driveInfo = new PSDriveInfo(storageContainer.Name, providerInfo, "/", "Root folder for your storageContainer", null); + OSDriveInfo kvsDriveInfo = new OSDriveInfo(driveInfo, parameters, this.Context); + try + { + drives.Add(kvsDriveInfo); + } + catch (Exception) { } + } + } + else + { + PSDriveInfo driveInfo = new PSDriveInfo("OS-Init", this.SessionState.Drive.Current.Provider, "/", "Root folder for your storageContainer", null); + return new Collection + { + new OSDriveInfo(driveInfo, parameters, this.Context) + }; + } + } + catch (Exception) + { + + } + + return drives; + } +//======================================================================================================= +/// +/// Removes all currently registered drives.. +/// +//======================================================================================================= + private void RemoveDrives() + { + // Remove the old Users drives first.. + + Collection deadDrives = this.SessionState.Drive.GetAllForProvider("OS-Storage"); + foreach (PSDriveInfo deadDrive in deadDrives) + { + this.SessionState.Drive.Remove(deadDrive.Name, true, "local"); + } + } +////======================================================================================================= +///// +///// removes only the currently registered shared drives.. +///// +////======================================================================================================= +// private void RemoveSharedDrives() +// { +// Collection deadDrives = this.SessionState.Drive.GetAllForProvider("OS-Storage"); +// foreach (OSDriveInfo deadDrive in deadDrives) +// { +// if (deadDrive.SharePath != null) +// this.SessionState.Drive.Remove(deadDrive.Name, true, "local"); +// } +// } +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + protected void WriteContainers(string configFilePath) + { + List invalidDriveNames = new List(); + OSDriveParameters parameters = new OSDriveParameters(); + + // Write out the commands header information first.. + + WriteObject(""); + Console.ForegroundColor = ConsoleColor.DarkGray; + WriteObject("==================================================================="); + Console.ForegroundColor = ConsoleColor.Yellow; + WriteObject("Object Storage Service available. Remapping to the following drives."); + Console.ForegroundColor = ConsoleColor.DarkGray; + WriteObject("==================================================================="); + Console.ForegroundColor = ConsoleColor.Green; + WriteObject(" "); + + HPOSNavigationProvider provider = new HPOSNavigationProvider(); + Collection drives = this.GetAvailableDrives(this.Settings, this.SessionState.Provider.GetOne("OS-Storage"), configFilePath); + + if (drives != null) + { + this.RemoveDrives(); + + foreach (PSDriveInfo drive in drives) + { + if (drive.Name != string.Empty) + { + WriteObject("Storage Container : [" + drive.Name + "] now available."); + } + + try + { + this.SessionState.Drive.New(drive, "local"); + } + catch (PSArgumentException ex) + { + if (drive.Name != string.Empty) + invalidDriveNames.Add(drive.Name); + } + catch (Exception) { } + + } + WriteObject(""); + } + else + { + // No storageContainers exist for the new credentials so make some up... + + PSDriveInfo driveInfo = new PSDriveInfo("OS-Init", this.SessionState.Drive.Current.Provider, "/", "Root folder for your storageContainer", null); + this.SessionState.Drive.New(new OSDriveInfo(driveInfo, parameters, this.Context), "local"); + } + + if (invalidDriveNames.Count > 0) + { + WriteObject(""); + Console.ForegroundColor = ConsoleColor.DarkGray; + WriteObject("================================================================="); + Console.ForegroundColor = ConsoleColor.Red; + WriteObject("Error : A subset of your Containers could not be bound to this"); + WriteObject("session due to naming conflicts with the naming standards required"); + WriteObject("for Powershell drives. These containers are listed below."); + Console.ForegroundColor = ConsoleColor.DarkGray; + WriteObject("================================================================="); + Console.ForegroundColor = ConsoleColor.Green; + WriteObject(" "); + + foreach (string name in invalidDriveNames) + { + WriteObject(name); + WriteObject(" "); + } + WriteObject(" "); + } + } +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + protected void WriteServices() + { + WriteObject(""); + Console.ForegroundColor = ConsoleColor.DarkGray; + WriteObject("================================================================="); + Console.ForegroundColor = ConsoleColor.Yellow; + WriteObject("Binding to new Account. New service catalog is as follows."); + Console.ForegroundColor = ConsoleColor.DarkGray; + WriteObject("================================================================="); + Console.ForegroundColor = ConsoleColor.Green; + WriteObject(" "); + + foreach (Service service in this.Context.ServiceCatalog) + { + WriteObject(service); + } + WriteObject(""); + } + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Common/BasePSCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Common/BasePSCmdlet.cs new file mode 100644 index 0000000..2b6188c --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Common/BasePSCmdlet.cs @@ -0,0 +1,310 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Text; +using System.Management.Automation; +using Openstack.Client.Powershell.Utility; +using System.IO; +using Openstack.Common; +using System.Xml; +using System.Xml.Serialization; +using Openstack.Client.Powershell.Providers.Storage; +using Openstack.Client.Powershell.Providers.Common; +using System.Linq; +using System.Collections.ObjectModel; +using System.Management.Automation.Host; + +namespace Openstack.Client.Powershell.Cmdlets.Common +{ + public class BasePSCmdlet : PSCmdlet + { + #region Properties + ////========================================================================================= + ///// + ///// + ///// + ////========================================================================================= + //protected BaseUIContainer CurrentContainer + //{ + // get + // { + // CommonDriveInfo tempDrive = this.Drive as CommonDriveInfo; + // if (tempDrive != null) + // { + // return tempDrive.CurrentContainer as BaseUIContainer; + // } + // else return null; + // } + //} + //========================================================================================= + /// + /// Exposes the currently mapped Drive. Belongs in base class??? + /// + //========================================================================================= + protected PSDriveInfo Drive + { + get + { + return this.SessionState.Drive.Current; + } + } + //========================================================================================= + /// + /// + /// + /// + //========================================================================================= + protected void WriteHeaderSection(string headerText) + { + WriteObject(" "); + Console.ForegroundColor = ConsoleColor.DarkGray; + WriteObject("=============================================================================================="); + Console.ForegroundColor = ConsoleColor.Yellow; + WriteObject(headerText); + Console.ForegroundColor = ConsoleColor.DarkGray; + WriteObject("=============================================================================================="); + Console.ForegroundColor = ConsoleColor.Green; + } + //================================================================================================== + /// + /// + /// + //================================================================================================== + protected IOpenstackClient Client + { + get + { + return (IOpenstackClient)this.SessionState.PSVariable.GetValue("Client", null); + } + set + { + this.SessionState.PSVariable.Set(new PSVariable("Client", value)); + } + } + //================================================================================================== + /// + /// + /// + //================================================================================================== + protected Context Context + { + get + { + return (Context)this.SessionState.PSVariable.GetValue("Context", null); + } + set + { + this.SessionState.PSVariable.Set(new PSVariable("Context", value)); + } + } + //========================================================================================= + /// + /// + /// + /// + //========================================================================================= + protected string ConfigFilePath + { + get + { + return Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\" + @"OS\CLI.config"; + } + } + #endregion + #region Methods + ////================================================================================================== + ///// + ///// + ///// + ///// + ///// + ////================================================================================================== + //protected string TranslateQuickPickNumber(string path) + //{ + // CommonDriveInfo drive = this.Drive as CommonDriveInfo; + // if (drive != null) + // { + // BaseUIContainer result = null; + // int number = 0; + + // if (Int32.TryParse(Path.GetFileName(path), out number)) + // { + // if (path == "\\" + this.Drive.CurrentLocation) + // { + // return path.Replace(Path.GetFileName(path), drive.CurrentContainer.Entity.Id); + // } + // //else if (path.Length < this.Drive.CurrentLocation.Length) + // //{ + // // result = drive.CurrentContainer.Parent; + // //} + // else + // { + // result = drive.CurrentContainer.Containers.Where(q => q.Entity.QuickPickNumber == number).FirstOrDefault(); + // } + // } + // else + // { + // return path; + // } + + // if (result != null) + // return path.Replace(Path.GetFileName(path), result.Id); + // else return null; + // } + // else return null; + //} + //================================================================================================== + /// + /// + /// + //================================================================================================== + protected override void BeginProcessing() + { + //if (this.Drive.Name != "OpenStack" && this.Drive.Provider.Name != "OS-Storage") + //{ + // ErrorRecord err = new ErrorRecord(new InvalidOperationException("You must be attached to an ObjectStorage Container or the OpenStack drive to execute an OpenStack Cloud cmdlet."), "0", ErrorCategory.InvalidOperation, this); + // this.ThrowTerminatingError(err); + //} + + //bool isAuthorized = false; + //Type type = this.GetType(); + //object[] metadata = type.GetCustomAttributes(false); + //bool foundattribute = false; + + //foreach (object attribute in metadata) + //{ + // RequiredServiceIdentifierAttribute identifier = attribute as RequiredServiceIdentifierAttribute; + + // if (identifier != null) + // { + // if (this.Context.ServiceCatalog.Exists(identifier.Services) != null) + // isAuthorized = true; + // } + //} + + //if (isAuthorized == false && foundattribute == false) return; + + //if (!isAuthorized) + // this.ThrowTerminatingError(new ErrorRecord(new InvalidOperationException("You're not current authorized to use this service. Please go to https://www.Openstack.com/ for more information on signing up for this service."), "aa", ErrorCategory.InvalidOperation, this)); + } + #endregion + #region Methods + //========================================================================================= + /// + /// + /// + /// + /// + //========================================================================================= + protected bool UserConfirmsDeleteAction(string entity) + { + Collection choices = new Collection(); + choices.Add(new ChoiceDescription("Y", "Yes")); + choices.Add(new ChoiceDescription("N", "No")); + + if (this.Host.UI.PromptForChoice("Confirm Action", "You are about to delete all " + entity + " in the current container. Are you sure about this?", choices, 0) == 0) + { + return true; + } + else + { + return false; + } + } + //========================================================================================= + /// + /// + /// + //========================================================================================= + protected void UpdateCache(Context context) + { + //CommonDriveInfo tempDrive = this.Drive as CommonDriveInfo; + //if (tempDrive != null) + //{ + // BaseUIContainer container = tempDrive.CurrentContainer as BaseUIContainer; + // container.Context = context; + + // if (container != null) + // { + // try + // { + // container.Load(); + // } + // catch (InvalidOperationException) { } + // if (container.Parent != null) + // container.Parent.Load(); + // } + //} + } + //========================================================================================= + /// + /// + /// + //========================================================================================= + protected void UpdateCache() + { + //CommonDriveInfo tempDrive = this.Drive as CommonDriveInfo; + //if (tempDrive != null) + //{ + // BaseUIContainer container = tempDrive.CurrentContainer as BaseUIContainer; + + // if (container != null) + // { + // try + // { + // container.Load(); + // } + // catch (InvalidOperationException) { } + // if (container.Parent != null) + // container.Parent.Load(); + // } + //} + } + //========================================================================================= + /// + /// Updates the cache if the current UIContainer manages the supplied type. + /// + //========================================================================================= + //protected void UpdateCache() where T : BaseUIContainer + //{ + // T container = ((CommonDriveInfo)this.Drive).CurrentContainer as T; + + // if (container != null) + // { + // container.Load(); + // } + // else + // { + // T parentContainer = ((CommonDriveInfo)this.Drive).CurrentContainer.Parent as T; + // if (parentContainer != null) + // { + // parentContainer.Load(); + // } + // } + //} + //========================================================================================= + /// + /// + /// + /// + //========================================================================================= + //protected StoragePath CreateStoragePath(string path) + //{ + // return ((OSDriveInfo)this.Drive).CreateStoragePath(path); + //} + #endregion + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Common/CopyIdCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Common/CopyIdCmdlet.cs new file mode 100644 index 0000000..3728975 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Common/CopyIdCmdlet.cs @@ -0,0 +1,61 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Management.Automation; +using System.Collections; +using Openstack.Client.Powershell.Cmdlets.Common; +using System.IO; +using System.Xml; +using Openstack.Client.Powershell.Providers.Common; +using System.Linq; + +namespace Openstack.Client.Powershell.Cmdlets.Common +{ + [Cmdlet(VerbsCommon.Copy, "Id", SupportsShouldProcess = true)] + public class CopyIdCmdlet : BasePSCmdlet + { + private int _quickPickNumber; + +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "CopyIdCmdlet", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the Server.")] + [Alias("qp")] + public int QuickPickNumber + { + get { return _quickPickNumber; } + set { _quickPickNumber = value; } + } +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + protected override void ProcessRecord() + { + int number = 0; + CommonDriveInfo drive = this.Drive as CommonDriveInfo; + BaseUIContainer result = drive.CurrentContainer.Containers.Where(q => q.Entity.QuickPickNumber == _quickPickNumber).FirstOrDefault(); + + WriteObject(""); + this.WriteObject("Id " + result.Entity.Id + " copied to clipboard."); + WriteObject(""); + OutClipboard.SetText(result.Entity.Id); + } + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Common/GetCatalogCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Common/GetCatalogCmdlet.cs new file mode 100644 index 0000000..9bf9519 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Common/GetCatalogCmdlet.cs @@ -0,0 +1,152 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Management.Automation; +using System.Collections; +using Openstack.Client.Powershell.Cmdlets.Common; +using System.IO; +using System.Xml; +using Openstack.Objects.Domain.Admin; + +namespace Openstack.Client.Powershell.Cmdlets.Common +{ + [Cmdlet(VerbsCommon.Get, "Catalog", SupportsShouldProcess = true)] + public class GetCatalogCmdlet : BasePSCmdlet + { + private SwitchParameter _verbose = false; + + #region Properties +//========================================================================================= +/// +/// +/// +//========================================================================================= + //[Parameter(Mandatory = false, ParameterSetName = "gc0", ValueFromPipelineByPropertyName = true, HelpMessage = "Prints information for the current service in use.")] + //[Alias("cs")] + //[ValidateNotNullOrEmpty] + //public SwitchParameter CurrentService + //{ + // get { return _currentService; } + // set { _currentService = value; } + //} +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Mandatory = false, ParameterSetName = "gc0", ValueFromPipelineByPropertyName = true, HelpMessage = "Prints extended information for each service.")] + [Alias("v")] + [ValidateNotNullOrEmpty] + public SwitchParameter Verbose2 + { + get { return _verbose; } + set { _verbose = value; } + } + #endregion +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + private void WriteSection(string headerText) + { + WriteObject(" "); + Console.ForegroundColor = ConsoleColor.DarkGray; + WriteObject("=============================================================================================="); + Console.ForegroundColor = ConsoleColor.Yellow; + WriteObject(headerText); + Console.ForegroundColor = ConsoleColor.DarkGray; + WriteObject("=============================================================================================="); + Console.ForegroundColor = ConsoleColor.Green; + } +//======================================================================================================= +/// +/// +/// +/// +//======================================================================================================= + private void PrintEndpoint(Endpoint endpoint) + { + Console.WriteLine("Region : " + endpoint.Region); + Console.WriteLine("Public URL : " + endpoint.PublicURL); + Console.WriteLine("Internal URL : " + endpoint.InternalURL); + Console.WriteLine("Admin URL : " + endpoint.AdminURL); + Console.WriteLine("Version : " + endpoint.Version.Id); + Console.WriteLine("Version Info : " + endpoint.Version.InfoURL); + Console.WriteLine("Version List : " + endpoint.Version.ListURL); + Console.WriteLine(); + } +//======================================================================================================= +/// +/// +/// +/// +//======================================================================================================= + private void PrintServiceVerbose(Service service) + { + Console.WriteLine(""); + this.WriteSection ("Service : " + service.Name); + Console.WriteLine(""); + Console.ForegroundColor = ConsoleColor.Yellow; + Console.WriteLine("General"); + Console.WriteLine(""); + Console.ForegroundColor = ConsoleColor.Green; + Console.WriteLine("Name : " + service.Name); + Console.WriteLine("Type : " + service.Type); + // Console.WriteLine("Provider Name : " + service.ProviderName); + Console.ForegroundColor = ConsoleColor.Yellow; + Console.WriteLine(""); + Console.WriteLine("Associated Endpoints"); + Console.WriteLine(""); + Console.ForegroundColor = ConsoleColor.Green; + + foreach (Endpoint endpoint in service.Endpoints) + { + this.PrintEndpoint(endpoint); + } + } +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + private void PrintServiceCatalog() + { + WriteObject(""); + this.WriteSection("You have access to the following Services "); + WriteObject(""); + + foreach (Service service in this.Context.ServiceCatalog) + { + if (!_verbose) + WriteObject(service); + else + PrintServiceVerbose(service); + } + WriteObject(""); + } +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + protected override void ProcessRecord() + { + this.PrintServiceCatalog(); + } + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Common/GetConfigCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Common/GetConfigCmdlet.cs new file mode 100644 index 0000000..0b94c1b --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Common/GetConfigCmdlet.cs @@ -0,0 +1,77 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Management.Automation; +using System.Collections; +using Openstack.Client.Powershell.Cmdlets.Common; +using System.IO; +using System.Xml; + +namespace Openstack.Client.Powershell.Cmdlets.Common +{ + [Cmdlet(VerbsCommon.Get, "Config", SupportsShouldProcess = true)] + public class GetConfigCmdlet : BasePSCmdlet + { +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + private void WriteSection(string headerText) + { + WriteObject(" "); + Console.ForegroundColor = ConsoleColor.DarkGray; + WriteObject("=============================================================================================="); + Console.ForegroundColor = ConsoleColor.Yellow; + WriteObject(headerText); + Console.ForegroundColor = ConsoleColor.DarkGray; + WriteObject("=============================================================================================="); + Console.ForegroundColor = ConsoleColor.Green; + } +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + protected override void ProcessRecord() + { + string configFilePath = this.ConfigFilePath; + + WriteObject(""); + this.WriteSection("Current Session Settings are as follows. "); + WriteObject(""); + this.WriteObject("Configuration File located at " + configFilePath); + WriteObject(""); + + foreach (DictionaryEntry setting in this.Settings) + { + if (((string)setting.Key) == "SecretKey" || ((string)setting.Key)== "AccessKey") + { + DictionaryEntry entry = new DictionaryEntry(); + entry.Value = "***********"; + entry.Key = setting.Key; + WriteObject(entry); + } + else + { + WriteObject(setting); + } + } + WriteObject(""); + } + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Common/GetMetadataCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Common/GetMetadataCmdlet.cs new file mode 100644 index 0000000..a3b8644 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Common/GetMetadataCmdlet.cs @@ -0,0 +1,210 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Collections.Generic; +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using System; +using Openstack.Objects.Domain.Compute; +using Openstack.Objects.Domain.Admin; + +namespace Openstack.Client.Powershell.Cmdlets.Storage.CDN +{ + [Cmdlet(VerbsCommon.Get, "Metadata", SupportsShouldProcess = true)] + public class GetNMetadataCmdlet2 : BasePSCmdlet + { + private string _cdnContainerName; + private string _sourcePath; + private string _objectStorageContainerName; + private string _serverId; + +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(ParameterSetName = "serverMetadata", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("s")] + [ValidateNotNullOrEmpty] + public string ServerId + { + get { return _serverId; } + set { _serverId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(ParameterSetName = "containerMetadata", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("cn")] + [ValidateNotNullOrEmpty] + public string ObjectStorageContainerName + { + get { return _objectStorageContainerName; } + set { _objectStorageContainerName = value; } + } +//========================================================================================= +/// +/// The location of the file to set permissions on. +/// +//========================================================================================= + [Parameter(Position = 0 , ParameterSetName = "objectMetadata", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("sp")] + [ValidateNotNullOrEmpty] + public string SourcePath + { + get { return _sourcePath; } + set { _sourcePath = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Mandatory = false, ParameterSetName = "cdnMetadata", ValueFromPipelineByPropertyName = true, HelpMessage = "The Name of the Container to enable for CDN access.")] + [Alias("cdn")] + [ValidateNotNullOrEmpty] + public string CDNContainerName + { + get { return _cdnContainerName; } + set { _cdnContainerName = value; } + } +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + private void WriteSection(string headerText) + { + WriteObject(" "); + Console.ForegroundColor = ConsoleColor.DarkGray; + WriteObject("=============================================================================================="); + Console.ForegroundColor = ConsoleColor.Yellow; + WriteObject(headerText); + Console.ForegroundColor = ConsoleColor.DarkGray; + WriteObject("=============================================================================================="); + Console.ForegroundColor = ConsoleColor.Green; + } +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + private void WriteKVPs(List> kvps, string displayName) + { + if (kvps.Count > 0) + { + WriteObject(""); + this.WriteSection("Meta-Data for " + displayName + " is as follows."); + WriteObject(""); + foreach (KeyValuePair kvp in kvps) + { + WriteObject("Key = " + kvp.Key.Replace("X-", string.Empty)); + WriteObject("Value = " + Convert.ToString(kvp.Value)); + WriteObject("---------------------------------"); + } + WriteObject(""); + } + else + { + WriteObject(""); + Console.WriteLine("No meta-data found for the supplied resource name."); + WriteObject(""); + } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void ProcessCDNMetadata() + { + if (this.Context.ServiceCatalog.DoesServiceExist(Services.CDN) == false) { + Console.WriteLine("You don't have access to CDN services under this account. For information on signing up for CDN access please go to http://Openstack.com/."); + } + WriteKVPs(RepositoryFactory.CreateCDNRepository().GetMetaData(this.CDNContainerName), this.CDNContainerName); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void ProcessObjectMetadata() + { + if (this.Drive.Provider.Name != "OS-Storage") + Console.WriteLine("You must be using the Object Storage Provider to use this cmdlet with the supplied parameters. To use this provider mount to a ObjectStorage container first. To see a list of available Containers issue the Get-PSDrive command."); + else + WriteKVPs(RepositoryFactory.CreateStorageObjectRepository().GetMetaData(this.CreateStoragePath(this.SourcePath).AbsoluteURI), this.SourcePath); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void ProcessContainerMetadata() + { + if (this.Drive.Provider.Name != "OS-Storage") + Console.WriteLine("You must be using the Object Storage Provider to use this cmdlet with the supplied parameters. To use this provider mount to a ObjectStorage container first. To see a list of available Containers issue the Get-PSDrive command."); + else + WriteKVPs(RepositoryFactory.CreateContainerRepository().GetMetaData(_objectStorageContainerName), _objectStorageContainerName); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void ProcessServerMetadata() + { + if (this.Context.ServiceCatalog.DoesServiceExist(Services.Compute) == false) + Console.WriteLine("You don't have access to Compute services under this account. For information on signing up for this please go to http://Openstack.com/."); + else + { + Server server = RepositoryFactory.CreateServerRepository().GetServer(this.ServerId); + //WriteKVPs(server.MetaData.ToKeypairs(), server.Name); + } + } +//========================================================================================= +/// +/// The main driver.. +/// +//========================================================================================= + protected override void ProcessRecord() + { + switch (this.ParameterSetName) + { + case ("serverMetadata"): + this.ProcessServerMetadata(); + break; + + case ("containerMetadata"): + this.ProcessContainerMetadata(); + break; + + case ("cdnMetadata"): + + this.ProcessCDNMetadata(); + break; + + case ("objectMetadata"): + this.ProcessObjectMetadata(); + break; + } + } + } +} + diff --git a/Openstack.Client.Powershell/Cmdlets/Common/GetNotesCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Common/GetNotesCmdlet.cs new file mode 100644 index 0000000..8313ae4 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Common/GetNotesCmdlet.cs @@ -0,0 +1,148 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Management.Automation; +using System.Reflection; +using System.Xml.Linq; +using System.Linq; +using System.Xml.XPath; + +namespace Openstack.Client.Powershell.Cmdlets.Common +{ + [Cmdlet(VerbsCommon.Get, "Notes", SupportsShouldProcess = true)] + public class GetNotesCmdlet : BasePSCmdlet + { + private bool _showAllNotes = false; + private string _version; + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, Mandatory = false, ParameterSetName = "sn", ValueFromPipelineByPropertyName = true, HelpMessage = "Show all release notes for this product.")] + [Alias("all")] + [ValidateNotNullOrEmpty] + public SwitchParameter ShowAllNotes + { + get { return _showAllNotes; } + set { _showAllNotes = value; } + } +//========================================================================================= +/// +/// The location of the file to set permissions on. +/// +//========================================================================================= + [Parameter(ParameterSetName = "sn", Position = 0, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Show release notes for a specific version of the CLI.")] + [Alias("v")] + [ValidateNotNullOrEmpty] + public string Version + { + get { return _version; } + set { _version = value; } + } + #endregion +//======================================================================================================= +/// +/// +/// +/// +//======================================================================================================= + private void PrintRelease (XElement releaseNode) + { + Console.WriteLine("-------------------------------------------------------- "); + Console.WriteLine("Version : " + releaseNode.Attribute(XName.Get("version")).Value); + Console.WriteLine("Notes :"); + + XElement notes = (from xml2 in releaseNode.Descendants() + select xml2).FirstOrDefault(); + Console.WriteLine(notes.Value); + } +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + public void PrintVersionNotes(XDocument releaseNotes) + { + string currentVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); + XElement releaseNode = (from xml2 in releaseNotes.Descendants("Release") + where xml2.Attribute(XName.Get("version")).Value == _version + select xml2).FirstOrDefault(); + + this.PrintRelease(releaseNode); + } +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + private void PrintAllNotes(XDocument releaseNotes) + { + Console.WriteLine(" "); + foreach (XElement element in releaseNotes.Descendants("Release")) + { + this.PrintRelease(element); + } + Console.WriteLine(" "); + } +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + private void PrintCurrentRelease(XDocument releaseNotes) + { + string currentVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); + //XElement releaseNode = (from xml2 in releaseNotes.Descendants("Release") + // where xml2.Attribute(XName.Get("version")).Value == currentVersion + // select xml2).FirstOrDefault(); + + XElement notes = releaseNotes.XPathSelectElement("//Release[@version='" + currentVersion + "']"); + if (notes != null) + this.PrintRelease(notes); + else + { + Console.WriteLine(""); + Console.WriteLine("No release notes exist for the current version."); + Console.WriteLine(""); + } + } +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + protected override void ProcessRecord() + { + XDocument releaseNotes = XDocument.Load(this.Settings.ReleaseNotesURI); + + if (_version == null && _showAllNotes == false) + { + this.PrintCurrentRelease(releaseNotes); + } + else if (_showAllNotes) + { + this.PrintAllNotes(releaseNotes); + } + else if (_version != null) + { + this.PrintVersionNotes(releaseNotes); + } + } + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Common/GetServiceProvidersCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Common/GetServiceProvidersCmdlet.cs new file mode 100644 index 0000000..6523797 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Common/GetServiceProvidersCmdlet.cs @@ -0,0 +1,63 @@ +///* ============================================================================ +//Copyright 2014 Hewlett Packard + +//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. +//============================================================================ */ +using System; +using System.Management.Automation; +using Openstack.Client.Powershell.Providers.Common; +using System.Security.Cryptography; +using System.Text; +using System.Web; +using Openstack; +using System.Xml.Linq; +using System.Collections.Generic; +using Openstack.Client.Powershell.Utility; +using System.Linq; + +namespace Openstack.Client.Powershell.Cmdlets.Common +{ + [Cmdlet(VerbsCommon.Get, "SP", SupportsShouldProcess = true)] + //[RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.ObjectStorage)] + public class GetServiceProvidersCmdlet : BasePSCmdlet + { + #region Parameters + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + List serviceProviders = new List(); + XDocument doc = XDocument.Load(this.ConfigFilePath); + IEnumerable serviceProviderNodes = doc.Descendants("ServiceProvider"); + + foreach (XElement element in serviceProviderNodes) + { + ServiceProvider provider = new ServiceProvider(); + provider.AuthenticationServiceURI = element.Elements().Where(e => e.Attribute("key").Value == "AuthenticationServiceURI").Attributes("value").Single().Value; + provider.DefaultTenantId = element.Elements().Where(e => e.Attribute("key").Value == "DefaultTenantId").Attributes("value").Single().Value; + provider.Username = element.Elements().Where(e => e.Attribute("key").Value == "Username").Attributes("value").Single().Value; + provider.IsDefault = Convert.ToBoolean(element.Attribute("isDefault").Value); + provider.Name = element.Attribute("name").Value; + + serviceProviders.Add(provider); + } + this.WriteObject(serviceProviders); + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Common/GetVersionCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Common/GetVersionCmdlet.cs new file mode 100644 index 0000000..fafaac4 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Common/GetVersionCmdlet.cs @@ -0,0 +1,41 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using System.Reflection; +using Openstack.Client.Powershell.Providers.Common; + +namespace Openstack.Client.Powershell.Cmdlets.GroupManagement +{ + [Cmdlet(VerbsCommon.Get, "Version", SupportsShouldProcess = true)] + public class GetVersionCmdlet : BasePSCmdlet + { +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + protected override void ProcessRecord() + { + Console.WriteLine(" "); + Console.WriteLine("Assembly Location : " + Assembly.GetExecutingAssembly().Location); + Console.WriteLine("Product Version : " + Assembly.GetExecutingAssembly().GetName().Version); + Console.WriteLine("CLR Version : " + Assembly.GetExecutingAssembly().ImageRuntimeVersion); + Console.WriteLine(" "); + } + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Common/GetZoneCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Common/GetZoneCmdlet.cs new file mode 100644 index 0000000..8be0e06 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Common/GetZoneCmdlet.cs @@ -0,0 +1,46 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Openstack.Client.Powershell.Cmdlets.Common; +using System.Management.Automation; +using System.Xml.Linq; +using System.Xml.XPath; + +namespace Openstack.Client.Powershell.Cmdlets.Common +{ + [Cmdlet("Get", "Zone", SupportsShouldProcess = true)] + public class GetZoneCmdlet : BasePSCmdlet + { +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + string configFilePath = this.ConfigFilePath; + XDocument doc = XDocument.Load(configFilePath); + XElement defaultZoneNode = doc.XPathSelectElement("//AvailabilityZone[@isDefault='True']"); + + Console.WriteLine(""); + Console.WriteLine("Current Availability Zone is " + defaultZoneNode.Attribute("name").Value); + Console.WriteLine(""); + } + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Common/GetZonesCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Common/GetZonesCmdlet.cs new file mode 100644 index 0000000..d53784b --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Common/GetZonesCmdlet.cs @@ -0,0 +1,115 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Openstack.Client.Powershell.Cmdlets.Common; +using System.Management.Automation; +using System.Xml.Linq; +using System.Xml.XPath; +using Openstack.Objects.Domain.Admin; + +namespace Openstack.Client.Powershell.Cmdlets.Common +{ + [Cmdlet("Get", "Zones", SupportsShouldProcess = true)] + public class GetZonesCmdlet : BasePSCmdlet + { + private SwitchParameter _verbose = false; + +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Mandatory = false, ParameterSetName = "gc0", ValueFromPipelineByPropertyName = true, HelpMessage = "Prints extended information for each service.")] + [Alias("v")] + [ValidateNotNullOrEmpty] + public SwitchParameter Verbose2 + { + get { return _verbose; } + set { _verbose = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void ShowVerboseOutput(IEnumerable zoneKeyNode) + { + foreach (XElement element in zoneKeyNode) + { + this.WriteHeaderSection("Zone : " + element.Attribute("name").Value); + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + Console.WriteLine("Zone Id : " + element.Attribute("id").Value); + Console.WriteLine("Zone Name : " + element.Attribute("name").Value); + Console.WriteLine("Shell Foreground Color : " + element.Attribute("shellForegroundColor").Value); + Console.WriteLine(""); + Console.WriteLine("The following Services are available from this Availability Zone"); + Console.WriteLine("----------------------------------------------------------------"); + this.WriteObject(this.Context.ServiceCatalog.GetAZServices(element.Attribute("name").Value)); + Console.WriteLine(""); + } + Console.WriteLine(""); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void ShowNonVerboseOutput(IEnumerable zoneKeyNode) + { + Console.WriteLine(""); + Console.WriteLine("Current Availability Zones include "); + Console.WriteLine(""); + foreach (XElement element in zoneKeyNode) + { + Zone zone = new Zone(); + zone.Name = element.Attribute("name").Value; + zone.ShellForegroundColor = element.Attribute("shellForegroundColor").Value; + zone.Id = element.Attribute("id").Value; + + if (element.Attribute("isDefault").Value == "True") + zone.IsDefault = true; + else + zone.IsDefault = false; + + this.WriteObject(zone); + } + Console.WriteLine(""); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + string configFilePath = this.ConfigFilePath; ; + XDocument doc = XDocument.Load(configFilePath); + IEnumerable zoneKeyNode = doc.Descendants("AvailabilityZone"); + + if (_verbose) + { + this.ShowVerboseOutput(zoneKeyNode); + } + else + { + this.ShowNonVerboseOutput(zoneKeyNode); + } + } + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Common/NewServiceProvider.cs b/Openstack.Client.Powershell/Cmdlets/Common/NewServiceProvider.cs new file mode 100644 index 0000000..0bddfc2 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Common/NewServiceProvider.cs @@ -0,0 +1,131 @@ +//* ============================================================================ +//Copyright 2014 Hewlett Packard + +//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. +//============================================================================ */ +using System.Management.Automation; +using System.Xml.Linq; +using System.Collections.Generic; +using Openstack.Client.Powershell.Utility; +using System.Xml.XPath; + +namespace Openstack.Client.Powershell.Cmdlets.Common +{ + [Cmdlet(VerbsCommon.New, "SP", SupportsShouldProcess = true)] + //[RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.ObjectStorage)] + public class NewServiceProvidersCmdlet : BasePSCmdlet + { + + private string _name = "HP21"; + private bool _isDefault = false; + private string _authenticationServiceURI = "https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/tokens"; + private string _username = "travis.plummer@hp.com"; + private string _password = "NoRemorseGlock27"; + private string _defTenantId = "travis.plummer@hp.com"; + + #region Parameters + + [Parameter(Position = 0, ParameterSetName = "NewSP", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = " ")] + [Alias("n")] + public string Name + { + get { return _name; } + set { _name = value; } + } + [Parameter(Position = 1, ParameterSetName = "NewSP", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = " ")] + [Alias("url")] + public string AuthenticationServiceURI + { + get { return _authenticationServiceURI; } + set { _authenticationServiceURI = value; } + } + [Parameter(Position = 2, ParameterSetName = "NewSP", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = " ")] + [Alias("un")] + public string Username + { + get { return _username; } + set { _username = value; } + } + [Parameter(Position = 3, ParameterSetName = "NewSP", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = " ")] + [Alias("p")] + public string Password + { + get { return _password; } + set { _password = value; } + } + [Parameter(Position = 4, ParameterSetName = "NewSP", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = " ")] + [Alias("t")] + public string DefTenantId + { + get { return _defTenantId; } + set { _defTenantId = value; } + } + [Parameter(Position = 4, ParameterSetName = "NewSP", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = " ")] + [Alias("d")] + [ValidateNotNullOrEmpty] + public SwitchParameter IsDefault + { + get { return _isDefault; } + set { _isDefault = value; } + } + + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +/// +/// +//========================================================================================= + private XElement CreateAddElement(string name, string value) + { + XElement element = new XElement("add"); + element.SetAttributeValue("key", name); + element.SetAttributeValue("value", value); + return element; + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + string isDef = "False"; + if (IsDefault) { + isDef = "True"; + } + else { + isDef = "False"; + } + + List serviceProviders = new List(); + XDocument doc = XDocument.Load(this.ConfigFilePath); + XElement element = new XElement("ServiceProvider", new XAttribute("name", this.Name), new XAttribute("isDefault", isDef)); + + element.Add(this.CreateAddElement("AuthenticationServiceURI", this.AuthenticationServiceURI)); + element.Add(this.CreateAddElement("Username", this.Username)); + element.Add(this.CreateAddElement("Password", this.Password)); + element.Add(this.CreateAddElement("DefaultTenantId", this.DefTenantId)); + + doc.XPathSelectElement("configuration/appSettings/IdentityServices").Add(element); + doc.Save(this.ConfigFilePath); + this.WriteObject(""); + this.WriteObject("New Serviced Provider " + this.Name + " created!"); + this.WriteObject(""); + } + #endregion + } +} + diff --git a/Openstack.Client.Powershell/Cmdlets/Common/RefreshCacheCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Common/RefreshCacheCmdlet.cs new file mode 100644 index 0000000..3051466 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Common/RefreshCacheCmdlet.cs @@ -0,0 +1,40 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Management.Automation; + +namespace Openstack.Client.Powershell.Cmdlets.Common +{ + [Cmdlet("Refresh", "Cache", SupportsShouldProcess = true)] + public class RefreshCacheCmdlet : BasePSCmdlet + { +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + this.UpdateCache(); + Console.WriteLine(""); + Console.WriteLine("Shell Cache Reloaded successfully."); + Console.WriteLine(""); + } + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Common/SetConfigCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Common/SetConfigCmdlet.cs new file mode 100644 index 0000000..bd17be2 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Common/SetConfigCmdlet.cs @@ -0,0 +1,197 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Management.Automation; +using System.Xml.Linq; +using Openstack.Common.Properties; +using Openstack.Objects.Domain; +using System.Xml.XPath; +using Openstack.Objects.DataAccess; +using Openstack.Objects.Utility; +using Openstack.Client.Powershell.Providers.Common; + +namespace Openstack.Client.Powershell.Cmdlets.Common +{ + [Cmdlet(VerbsCommon.Set, "Config", SupportsShouldProcess = true)] + public class SetConfigCmdlet : BaseAuthenticationCmdlet + { + private string _key; + private string _value; + private string _configFilePath = null; + private SwitchParameter _reset = false; + private string _oldAccessKey; + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, Mandatory = false, ParameterSetName = "sc3", ValueFromPipelineByPropertyName = true, HelpMessage = "s")] + [Alias("resetcfg")] + [ValidateNotNullOrEmpty] + public SwitchParameter Reset + { + get { return _reset; } + set { _reset = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, Mandatory = true, ParameterSetName = "sc4", ValueFromPipelineByPropertyName = true, HelpMessage = "s")] + [Alias("s")] + [ValidateNotNullOrEmpty] + public string ConfigFilePathKey + { + get { return _configFilePath; } + set { _configFilePath = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, Mandatory = true, ParameterSetName = "sc", ValueFromPipelineByPropertyName = true, HelpMessage = "s")] + [Alias("k")] + [ValidateNotNullOrEmpty] + public string Key + { + get { return _key; } + set { _key = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 2, Mandatory = true, ParameterSetName = "sc", ValueFromPipelineByPropertyName = true, HelpMessage = "s")] + [Alias("v")] + [ValidateNotNullOrEmpty] + public string Value + { + get { return _value; } + set { _value = value; } + } + #endregion +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + private void LoadConfigFile() + { + this.InitializeSession(Settings.Default); + + // Show the User the new ServiceCatalog that we just received.. + + this.WriteServices(); + + // If ObjectStorage is among those new Services, show the new Container set bound to those credentials.. + + if (this.Context.ServiceCatalog.DoesServiceExist("OS-Storage")) + { + this.WriteContainers(_configFilePath); + } + } +//====================================================================================================================== +/// +/// +/// +/// +/// +//====================================================================================================================== + private string GetContainerName(string url) + { + string[] elements = url.Split('/'); + return elements[elements.Length - 1]; + } +//====================================================================================================================== +/// +/// +/// +/// +/// +//====================================================================================================================== + private string GetDNSPortion(string url) + { + string[] elements = url.Split('/'); + return elements[2]; + } +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + private void LoadConfigFile(string configFilePath) + { + this.Settings = Settings.LoadConfig(configFilePath); + this.Context.Settings = this.Settings; + this.Context = this.Context; + + // We need to ensure that the Users new identity doesn't alter the list bof available storageContainers. If so, just deal with it.. + + if (_oldAccessKey != this.Settings.Username) + { + this.InitializeSession(this.Settings); + + // Show the User the new ServiceCatalog that we just received.. + + this.WriteServices(); + + // If ObjectStorage is among those new Services, show the new Container set bound to those credentials.. + + if (this.Context.ServiceCatalog.DoesServiceExist("OS-Storage")) + { + this.WriteContainers(_configFilePath); + } + + if (this.Drive.Name == "OpenStack") + { + this.SessionState.InvokeCommand.InvokeScript(@"cd\"); + ((CommonDriveInfo)this.Drive).CurrentContainer.Load(); + } + + this.SessionState.PSVariable.Set(new PSVariable("ConfigPath", configFilePath)); + + //Context tempContext = (Context)this.SessionState.PSVariable.GetValue("Context", null); + //this.UpdateCache(tempContext); + } + } +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + protected override void ProcessRecord() + { + if (_reset) + { + _configFilePath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\" + @"OS\CLI.config"; + this.LoadConfigFile(); + } + else + { + if (_configFilePath != null) + this.LoadConfigFile(_configFilePath); + else + this.Settings[_key] = _value; + } + } + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Common/SetCredentialsCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Common/SetCredentialsCmdlet.cs new file mode 100644 index 0000000..adbdf76 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Common/SetCredentialsCmdlet.cs @@ -0,0 +1,97 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Management.Automation; +using Openstack.Objects.Domain.Admin; + +namespace Openstack.Client.Powershell.Cmdlets.Common +{ + [Cmdlet(VerbsCommon.Set, "Credentials", SupportsShouldProcess = true)] + public class SetCredentialsCmdlet : BaseAuthenticationCmdlet + { + private string _accessKey; + private string _secretKey; + private string _tenantId; + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, Mandatory = true, ParameterSetName = "sc5", ValueFromPipelineByPropertyName = true, HelpMessage = "s")] + [Alias("ak")] + [ValidateNotNullOrEmpty] + public string AccessKey + { + get { return _accessKey; } + set { _accessKey = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, Mandatory = true, ParameterSetName = "sc5", ValueFromPipelineByPropertyName = true, HelpMessage = "s")] + [Alias("sk")] + [ValidateNotNullOrEmpty] + public string SecretKey + { + get { return _secretKey; } + set { _secretKey = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 2, Mandatory = true, ParameterSetName = "sc5", ValueFromPipelineByPropertyName = true, HelpMessage = "s")] + [Alias("t")] + [ValidateNotNullOrEmpty] + public string TenantId + { + get { return _tenantId; } + set { _tenantId = value; } + } + #endregion + #region Methods +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + protected override void ProcessRecord() + { + AuthenticationRequest request = new AuthenticationRequest(new Credentials(_accessKey, _secretKey), _tenantId); + this.InitializeSession(request); + + // Show the User the new ServiceCatalog that we just received.. + + this.WriteServices(); + + // If ObjectStorage is among those new Services, show the new Container set bound to those credentials.. + + if (this.Context.ServiceCatalog.DoesServiceExist("OS-Storage")) + { + //this.WriteContainers(); + } + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Common/SetMetadataCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Common/SetMetadataCmdlet.cs new file mode 100644 index 0000000..f8cefe8 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Common/SetMetadataCmdlet.cs @@ -0,0 +1,302 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using System; +using Openstack.Objects.Domain.Compute; +using Openstack.Objects.Domain.Admin; +using Openstack.Objects.DataAccess; +using Openstack.Objects.Domain; +using System.Collections; +using Openstack.Client.Powershell.Providers.Security; +using System.Linq; +using Openstack.Client.Powershell.Providers.Common; +using System.Collections.Generic; +using Openstack.Client.Powershell.Providers.Compute; + +namespace Openstack.Client.Powershell.Cmdlets.Storage.CDN +{ + [Cmdlet(VerbsCommon.Set, "Metadata", SupportsShouldProcess = true)] + public class SetMetadataCmdlet2 : BasePSCmdlet + { + private string _cdnContainerName; + private string _sourcePath; + private string _objectStorageContainerName; + private string _serverId; + private string[] _extendedProperties; + +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter( ParameterSetName = "containerMetadata", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("c")] + [ValidateNotNullOrEmpty] + public string ObjectStorageContainerName + { + get { return _objectStorageContainerName; } + set { _objectStorageContainerName = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("md")] + [ValidateNotNullOrEmpty] + public string[] ExtendedProperties + { + get { return _extendedProperties; } + set { _extendedProperties = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(ParameterSetName = "serverMetadata", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("s")] + [ValidateNotNullOrEmpty] + public string ServerId + { + get { return _serverId; } + set { _serverId = value; } + } +//========================================================================================= +/// +/// The location of the file to set permissions on. +/// +//========================================================================================= + [Parameter(ParameterSetName = "objectMetadata", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("sp")] + [ValidateNotNullOrEmpty] + public string SourcePath + { + get { return _sourcePath; } + set { _sourcePath = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Mandatory = false, ParameterSetName = "cdnMetadata", ValueFromPipelineByPropertyName = true, HelpMessage = "The Name of the Container to enable for CDN access.")] + [Alias("cdn")] + [ValidateNotNullOrEmpty] + public string CDNContainerName + { + get { return _cdnContainerName; } + set { _cdnContainerName = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void ProcessCDNMetadata() + { + if (this.Context.ServiceCatalog.DoesServiceExist(Services.CDN) == false) + Console.WriteLine("You don't have access to CDN services under this account. For information on signing up for CDN access please go to http://Openstack.com/."); + else + { + List> metadata = new List>(); + if (this.ExtendedProperties != null && this.ExtendedProperties.Count() > 0) + { + foreach (string kv in this.ExtendedProperties) + { + char[] seperator = { '|' }; + string[] temp = kv.Split(seperator); + KeyValuePair element = new KeyValuePair(temp[0], temp[1]); + + metadata.Add(element); + } + this.RepositoryFactory.CreateCDNRepository().SetMetaData(this.CDNContainerName, metadata); + } + } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void ProcessObjectMetadata() + { + IStorageObjectRepository repository = this.RepositoryFactory.CreateStorageObjectRepository(); + StoragePath storagePath = this.CreateStoragePath(_sourcePath); + StorageObject storageObject = new StorageObject(); + storageObject.FileName = storagePath.FileName; + + storageObject.ExtendedProperties.AddEntries(this.ExtendedProperties); + repository.SetMetaData(storagePath.AbsoluteURI, storageObject.ExtendedProperties); + } +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + private void AddElements(MetaData metadata) + { + IList elements = ((CommonDriveInfo)this.Drive).CurrentContainer.Entities; + + foreach (KeyValuePair element in metadata) + { + MetaDataElement newElement = new MetaDataElement(); + newElement.Key = element.Key; + newElement.Value = element.Value; + + elements.Add(newElement); + } + } +//========================================================================================= +/// +/// +/// +/// +/// +//========================================================================================= + public MetaData ReformatMetadata(string[] keyValuePairs) + { + MetaData metadata = new MetaData(); + + if (keyValuePairs != null && keyValuePairs.Count() > 0) + { + foreach (string kv in keyValuePairs) + { + char[] seperator = { '|' }; + string[] temp = kv.Split(seperator); + MetaDataElement element = new MetaDataElement(); + element.Key = temp[0]; + element.Value = temp[1]; + + metadata.Add(temp[0], temp[1]); + } + return metadata; + } + return null; + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void ProcessServerMetadata() + { + if (this.Context.ServiceCatalog.DoesServiceExist(Services.Compute) == false) + Console.WriteLine("You don't have access to Compute services under this account. For information on signing up for this please go to http://Openstack.com/."); + else + { + MetaData md = null; + if (this.ServerId != null) + { + md = this.ReformatMetadata(this.ExtendedProperties); + this.RepositoryFactory.CreateServerRepository().SetMetadata(md, this.ServerId); + this.UpdateCache(); + } + else + { + BaseUIContainer currentContainer = this.SessionState.PSVariable.Get("CurrentContainer").Value as BaseUIContainer; + + if (currentContainer.Name == "Metadata") + { + ServerUIContainer serverContainer = currentContainer.Parent as ServerUIContainer; + + if (serverContainer != null) + { + md = this.ReformatMetadata(this.ExtendedProperties); + this.RepositoryFactory.CreateServerRepository().SetMetadata(md, serverContainer.Entity.Id); + this.UpdateCache(); + } + } + else + { + md = this.ReformatMetadata(this.ExtendedProperties); + this.RepositoryFactory.CreateServerRepository().SetMetadata(md, currentContainer.Entity.Id); + this.UpdateCache(); + } + } + } + } +////========================================================================================= +///// +///// +///// +////========================================================================================= + private void ProcessContainerMetadata() + { + if (this.Context.ServiceCatalog.DoesServiceExist(Services.ObjectStorage) == false) + Console.WriteLine("You don't have access to Object Storage services under this account. For information on signing up for this please go to http://Openstack.com/."); + else + { + MetaData md = null; + if (this.ObjectStorageContainerName != null) + { + List> exProps = new List>(); + if (this.ExtendedProperties != null && this.ExtendedProperties.Count() > 0) + { + foreach (string kv in this.ExtendedProperties) + { + char[] seperator = { '|' }; + string[] temp = kv.Split(seperator); + exProps.AddEntry(temp[0], temp[1]); + } + } + + md = this.ReformatMetadata(this.ExtendedProperties); + this.RepositoryFactory.CreateContainerRepository().SetMetaData(_objectStorageContainerName, exProps); + this.UpdateCache(); + } + else + { + + } + } + } +//========================================================================================= +/// +/// The main driver.. +/// +//========================================================================================= + protected override void ProcessRecord() + { + switch (this.ParameterSetName) + { + case ("serverMetadata"): + this.ProcessServerMetadata(); + break; + + case ("cdnMetadata"): + + this.ProcessCDNMetadata(); + break; + + case ("objectMetadata"): + this.ProcessObjectMetadata(); + break; + + case ("containerMetadata"): + this.ProcessContainerMetadata(); + break; + + } + } + + + } +} + diff --git a/Openstack.Client.Powershell/Cmdlets/Common/SetZoneCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Common/SetZoneCmdlet.cs new file mode 100644 index 0000000..b0a3e71 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Common/SetZoneCmdlet.cs @@ -0,0 +1,262 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using Openstack.Client.Powershell.Cmdlets.Common; +using System.Management.Automation; +using System.Xml.Linq; +using System.Xml.XPath; +using System.Collections.Generic; +using Openstack.Objects.Domain; +using Openstack.Client.Powershell.Providers.Storage; +using System.Collections.ObjectModel; +using Openstack.Common.Properties; +using Openstack.Objects.DataAccess; + +namespace Openstack.Client.Powershell.Cmdlets.Common +{ + [Cmdlet("Set", "Zone", SupportsShouldProcess = true)] + public class SetZoneCmdlet : BasePSCmdlet + { + private string _Zone; + +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "SetZone", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Valid values include")] + [Alias("z")] + [ValidateNotNullOrEmpty] + [ValidateSet("1", "2", "3", "4", "5")] + public string Zone + { + get { return _Zone; } + set { _Zone = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + if (this.Drive.Provider.Name != "OS-Cloud" && this.Drive.Provider.Name != "OS-Storage") + { + ConsoleColor oldColor = Console.ForegroundColor; + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine(""); + Console.WriteLine("Setting the Availability Zone requires you to be connected to the OpenStack: drive or a valid Storage Container. Please map to one of these drive types and reissue the command."); + Console.WriteLine(""); + Console.ForegroundColor = oldColor; + } + else + { + string configFilePath = this.ConfigFilePath; + XDocument doc = XDocument.Load(configFilePath); + XElement zoneKeyNode = doc.XPathSelectElement("//AvailabilityZone[@id='" + _Zone + "']"); + XElement defaultZoneNode = doc.XPathSelectElement("//AvailabilityZone[@isDefault='True']"); + + defaultZoneNode.SetAttributeValue("isDefault", "False"); + zoneKeyNode.SetAttributeValue("isDefault", "True"); + doc.Save(configFilePath); + this.Settings.Load(configFilePath); + + this.Context.Forecolor = zoneKeyNode.Attribute("shellForegroundColor").Value; + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), zoneKeyNode.Attribute("shellForegroundColor").Value); + Console.WriteLine(""); + Console.WriteLine("New Availability Zone " + zoneKeyNode.Attribute("name").Value + " selected."); + Console.WriteLine(""); + + + if (this.Drive.Name == "OpenStack") + this.SessionState.InvokeCommand.InvokeScript(@"cd\"); + else + this.SessionState.InvokeCommand.InvokeScript("cd c:"); + + + this.UpdateCache(); + this.WriteServices(zoneKeyNode.Attribute("name").Value); + this.WriteContainers(); + } + } +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + private void WriteServices(string availabilityZone) + { + this.WriteHeader("This Availability Zone has the following services available."); + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + WriteObject(this.Context.ServiceCatalog.GetAZServices(availabilityZone)); + } +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + private System.Collections.ObjectModel.Collection GetAvailableDrives(Settings settings, ProviderInfo providerInfo) + { + List storageContainers = null; + OSDriveParameters parameters = new OSDriveParameters(); + + if (this.Settings != null) + { + parameters.Settings = this.Settings; + } + else + { + parameters.Settings = settings; + } + + try + { + IContainerRepository storageContainerRepository = this.RepositoryFactory.CreateContainerRepository(); + storageContainers = storageContainerRepository.GetStorageContainers(); + } + catch (Exception ex) + { + Console.WriteLine(ex); + } + + Collection drives = new Collection(); + + // For every storageContainer that the User has access to, create a Drive that he can mount within Powershell.. + + try + { + if (storageContainers.Count > 0) + { + foreach (StorageContainer storageContainer in storageContainers) + { + PSDriveInfo driveInfo = new PSDriveInfo(storageContainer.Name, providerInfo, "/", "Root folder for your storageContainer", null); + OSDriveInfo kvsDriveInfo = new OSDriveInfo(driveInfo, parameters, this.Context); + drives.Add(kvsDriveInfo); + } + } + else + { + PSDriveInfo driveInfo = new PSDriveInfo("OS-Init", this.SessionState.Drive.Current.Provider, "/", "Root folder for your storageContainer", null); + return new Collection + { + new OSDriveInfo(driveInfo, parameters, this.Context) + }; + } + } + catch (Exception) + { + + } + + return drives; + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void WriteHeader(string message) + { + // Write out the commands header information first.. + + WriteObject(""); + Console.ForegroundColor = ConsoleColor.DarkGray; + WriteObject("==================================================================="); + Console.ForegroundColor = ConsoleColor.Yellow; + WriteObject(message); + Console.ForegroundColor = ConsoleColor.DarkGray; + WriteObject("==================================================================="); + Console.ForegroundColor = ConsoleColor.Green; + WriteObject(" "); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void WriteContainers() + { + List invalidDriveNames = new List(); + OSDriveParameters parameters = new OSDriveParameters(); + HPOSNavigationProvider provider = new HPOSNavigationProvider(); + Collection drives = this.GetAvailableDrives(this.Settings, this.SessionState.Provider.GetOne("OS-Storage")); + + if (drives != null) + { + this.WriteHeader("Storage Containers available in this Region include"); + + // Remove the old Users drives first.. + + Collection deadDrives = this.SessionState.Drive.GetAllForProvider("OS-Storage"); + foreach (PSDriveInfo deadDrive in deadDrives) + { + this.SessionState.Drive.Remove(deadDrive.Name, true, "local"); + } + + foreach (PSDriveInfo drive in drives) + { + if (drive.Name != string.Empty) + { + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + WriteObject("Storage Container : [" + drive.Name + "] now available."); + } + + try + { + this.SessionState.Drive.New(drive, "local"); + } + catch (PSArgumentException ex) + { + if (drive.Name != string.Empty) + invalidDriveNames.Add(drive.Name); + } + + } + //WriteObject(""); + } + else + { + // No storageContainers exist for the new credentials so make some up... + + PSDriveInfo driveInfo = new PSDriveInfo("OS-Init", this.SessionState.Drive.Current.Provider, "/", "Root folder for your storageContainer", null); + this.SessionState.Drive.New(new OSDriveInfo(driveInfo, parameters, this.Context), "local"); + } + + if (invalidDriveNames.Count > 0) + { + WriteObject(""); + Console.ForegroundColor = ConsoleColor.DarkGray; + WriteObject("================================================================="); + Console.ForegroundColor = ConsoleColor.Red; + WriteObject("Error : A subset of your Containers could not be bound to this"); + WriteObject("session due to naming conflicts with the naming standards required"); + WriteObject("for Powershell drives. These containers are listed below."); + Console.ForegroundColor = ConsoleColor.DarkGray; + WriteObject("================================================================="); + Console.ForegroundColor = ConsoleColor.Green; + WriteObject(" "); + + foreach (string name in invalidDriveNames) + { + WriteObject(name); + WriteObject(" "); + } + //WriteObject(" "); + } + } + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Common/SetZoneColorCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Common/SetZoneColorCmdlet.cs new file mode 100644 index 0000000..d46e22a --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Common/SetZoneColorCmdlet.cs @@ -0,0 +1,85 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using Openstack.Client.Powershell.Cmdlets.Common; +using System.Management.Automation; +using System.Xml.Linq; +using System.Xml.XPath; +using System.Collections.Generic; + +namespace Openstack.Client.Powershell.Cmdlets.Common +{ + [Cmdlet("Set", "ZoneColor", SupportsShouldProcess = true)] + public class SetZoneColorCmdlet : BasePSCmdlet + { + private string _zone; + private string _color; + +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "SetZoneColor", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Valid values include")] + [Alias("c")] + [ValidateNotNullOrEmpty] + [ValidateSet("Black", "Blue", "Cyan", "DarkBlue", "DarkCyan", "DarkGray", "DarkGreen", "DarkMagenta", "DarkRed", "DarkYellow", "Gray", "Green", "Magenta", "Red", "White", "Yellow")] + public string Color + { + get { return _color; } + set { _color = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "SetZoneColor", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Valid values include")] + [Alias("z")] + [ValidateNotNullOrEmpty] + [ValidateSet("1", "2", "3", "4")] + public string Zone + { + get { return _zone; } + set { _zone = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + string configFilePath = this.ConfigFilePath; + XDocument doc = XDocument.Load(configFilePath); + XElement zoneKeyNode = doc.XPathSelectElement("//AvailabilityZone[@id='" + _zone + "']"); + + zoneKeyNode.SetAttributeValue("shellForegroundColor", _color); + doc.Save(configFilePath); + + Console.WriteLine(""); + Console.Write(zoneKeyNode.Attribute("name").Value + " now assigned to "); + + ConsoleColor currentColor = Console.ForegroundColor; + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), zoneKeyNode.Attribute("shellForegroundColor").Value); + + Console.Write(_color + "."); + Console.ForegroundColor = currentColor; + Console.WriteLine(""); + Console.WriteLine(""); + } + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Compute/Security/GetLimitsCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Compute/Security/GetLimitsCmdlet.cs new file mode 100644 index 0000000..db7e3d4 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Compute/Security/GetLimitsCmdlet.cs @@ -0,0 +1,59 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Networking; +using System; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.DataAccess.Security; +using Openstack.Objects.Domain.Compute; +using Openstack.Objects.DataAccess.Compute; + + +namespace Openstack.Client.Powershell.Cmdlets.Compute.Security +{ + [Cmdlet("Get", "Limits", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class GetLimitsCmdlet : BasePSCmdlet + { + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + Limits limits = this.RepositoryFactory.CreateServerRepository().GetLimits(); + Console.WriteLine(""); + Console.WriteLine("The following Limits are in place for this account."); + Console.WriteLine(""); + Console.WriteLine("Limit Category : Absolute"); + Console.WriteLine("-------------------------------------------------"); + Console.WriteLine("Max Server Metadata Elements : " + limits.limits.AbsoluteLimits.maxServerMeta); + Console.WriteLine("Max Personality : " + limits.limits.AbsoluteLimits.maxPersonality); + Console.WriteLine("Max Image Metadata Elements : " + limits.limits.AbsoluteLimits.maxImageMeta); + Console.WriteLine("Max Personality Size : " + limits.limits.AbsoluteLimits.maxPersonalitySize); + Console.WriteLine("Max Security Group Rules : " + limits.limits.AbsoluteLimits.maxSecurityGroupRules); + Console.WriteLine("Max Security Groups : " + limits.limits.AbsoluteLimits.maxSecurityGroups); + Console.WriteLine("Max Total Instances : " + limits.limits.AbsoluteLimits.maxTotalInstances); + Console.WriteLine("Max Total RAM Size : " + limits.limits.AbsoluteLimits.maxTotalRAMSize); + Console.WriteLine(""); + } + #endregion + } +} + diff --git a/Openstack.Client.Powershell/Cmdlets/Compute/Security/GetPasswordCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Compute/Security/GetPasswordCmdlet.cs new file mode 100644 index 0000000..2c7a3c1 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Compute/Security/GetPasswordCmdlet.cs @@ -0,0 +1,129 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Compute; +using System.Linq; +using Openstack.Objects.Domain.Compute.Servers; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Client.Powershell.Providers.Security; +using Openstack.Objects.DataAccess.Security; +using Openstack.Objects.DataAccess; +using Openstack.Objects.Domain.Compute.Servers.Actions; +using System; +using Openstack.Objects.DataAccess.Compute; +using Openstack.Client.Powershell.Providers.Compute; + +namespace Openstack.Client.Powershell.Cmdlets.Compute.Server +{ + [Cmdlet(VerbsCommon.Get, "Password", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class GetPasswordCmdlet : BasePSCmdlet + { + private string _administratorPassword; + private string _serverId; + private string _keyName; + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "GetPassword", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("k")] + [ValidateNotNullOrEmpty] + public string KeyName + { + get { return _keyName; } + set { _keyName = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "GetPassword", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("s")] + [ValidateNotNullOrEmpty] + public string ServerId + { + get { return _serverId; } + set { _serverId = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + private string GetServerId() + { + BaseUIContainer currentContainer = this.SessionState.PSVariable.Get("CurrentContainer").Value as BaseUIContainer; + + if (currentContainer.Name == "Metadata") + { + ServerUIContainer serverContainer = currentContainer.Parent as ServerUIContainer; + if (serverContainer != null) + return serverContainer.Entity.Id; + } + else + { + return currentContainer.Entity.Id; + } + return null; + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + if (this.ServerId == null) + this.ServerId = this.GetServerId(); + + IServerRepository repository = this.RepositoryFactory.CreateServerRepository(); + GetServerLogAction action = new GetServerLogAction(); + action.ServerId = this.ServerId; + Log log = repository.GetServerLog(action); + + if (log != null && log.Content.Length > 14) + { + Console.WriteLine(""); + Console.WriteLine("Log detected!"); + string pw = log.ExtractAdminPassword(this.Settings.KeyStoragePath + @"\OS\" + _keyName + ".pem"); + Console.WriteLine("Administrator Password : " + pw); + Console.WriteLine(""); + + if (this.Settings.EnableCredentialTracking == true) + { + CredentialListManager manager = new CredentialListManager(this.Settings); + manager.SetPassword(this.ServerId, pw); + } + } + else + { + Console.WriteLine(""); + Console.WriteLine("Unfortunately we couldn't retrieve the Instance Log. If this situation persist, we recommend that you delete and recreate the instance."); + Console.WriteLine(""); + } + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Compute/Security/NewKeyPairCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Compute/Security/NewKeyPairCmdlet.cs new file mode 100644 index 0000000..d42d3d7 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Compute/Security/NewKeyPairCmdlet.cs @@ -0,0 +1,145 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Compute; +using System.Linq; +using Openstack.Client.Powershell.Providers.Security; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Security; +using System; +using System.IO; +using System.Text; +using System.Diagnostics; +using System.Threading; +using Openstack.Objects.Domain.Server; +using Openstack.Client.Powershell.Providers.Compute; + +namespace Openstack.Client.Powershell.Cmdlets.Compute.Network +{ + [Cmdlet(VerbsCommon.New, "KeyPair", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class NewKeyPairCmdlet : BasePSCmdlet + { + private string _name; + private string _filename = null; + private SwitchParameter _copyToClipboard = false; + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + //[Parameter(Position = 2, ParameterSetName = "NewKeypair", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "a")] + //[Alias("c")] + //public SwitchParameter CopyToClipboard + //{ + // get { return _copyToClipboard; } + // set { _copyToClipboard = value; } + //} +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "NewKeypair", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "a")] + [Alias("n")] + public string Name + { + get { return _name; } + set { _name = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void StoreKey(string privateKey) + { + + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void ExportKey(string privateKey, string filename) + { + // Save the key locally first.. + + StringBuilder builder = new StringBuilder(); + builder.AppendLine(privateKey); + + using (StreamWriter outfile = new StreamWriter(this.Settings.KeyStoragePath + @"\OS\" + filename, false)) + { + outfile.Write(builder.ToString()); + } + + // Now export with PuttyGen + + //Process.Start(this.Settings.PuttuGenPath, this.Settings.KeyStoragePath + @"\TempKey.key -O private -o " + this.Settings.KeyStoragePath + "testKey.ppk" + "-q"); + //int y = 9; + + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + NewKeyPair nkp = new NewKeyPair(); + nkp.Name = this.Name; + KeyPair keypair = this.RepositoryFactory.CreateKeyPairRepository().SaveKeyPair(nkp); + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + + Console.WriteLine(""); + Console.ForegroundColor = ConsoleColor.Yellow; + Console.WriteLine("New keypair created."); + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + Console.WriteLine(""); + Console.WriteLine("User Id : " + keypair.UserId); + Console.WriteLine("Name : " + keypair.Name); + Console.WriteLine("Private Key : "); + Console.WriteLine(""); + Console.WriteLine(keypair.PrivateKey); + Console.WriteLine(""); + Console.WriteLine("Public Key : "); + Console.WriteLine(""); + Console.WriteLine(keypair.PublicKey); + Console.WriteLine(""); + Console.WriteLine("Fingerprint : " + keypair.Fingerprint); + Console.WriteLine(""); + + this.ExportKey(keypair.PrivateKey, keypair.Name + ".pem"); + + if (_copyToClipboard) + { + OutClipboard.SetText(keypair.PrivateKey); + } + + Console.WriteLine("Exporting Private Key."); + Console.WriteLine("Storing Key."); + Console.WriteLine("Key Generation and storage complete."); + Console.WriteLine(""); + this.UpdateCache(); + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Compute/Security/RemoveKeyPairCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Compute/Security/RemoveKeyPairCmdlet.cs new file mode 100644 index 0000000..f32d508 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Compute/Security/RemoveKeyPairCmdlet.cs @@ -0,0 +1,72 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using System; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Client.Powershell.Providers.Security; +using Openstack.Client.Powershell.Providers.Compute; + +namespace Openstack.Client.Powershell.Cmdlets.Compute.Network +{ + [Cmdlet(VerbsCommon.Remove, "KeyPair", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class RemoveKeyPairCmdlet : BasePSCmdlet + { + private string _name; + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "RemoveKeyPair", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "a")] + [Alias("n")] + public string Name + { + get { return _name; } + set { _name = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + try + { + this.RepositoryFactory.CreateKeyPairRepository().DeleteKeyPair(this.Name); + Console.WriteLine(""); + Console.WriteLine("Keypair " + this.Name + " removed."); + Console.WriteLine(""); + this.UpdateCache(); + } + catch (InvalidOperationException) + { + Console.WriteLine(""); + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine("Error : Keypair " + this.Name + " not found."); + Console.WriteLine(""); + Console.ForegroundColor = ConsoleColor.Green; + } + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Compute/Security/ResetPasswordCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Compute/Security/ResetPasswordCmdlet.cs new file mode 100644 index 0000000..8cc25ab --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Compute/Security/ResetPasswordCmdlet.cs @@ -0,0 +1,159 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Compute; +using Openstack.Objects.Domain.Compute.Servers; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Client.Powershell.Providers.Security; +using Openstack.Objects.DataAccess.Security; +using System; +using Openstack.Client.Powershell.Providers.Compute; + +namespace Openstack.Client.Powershell.Cmdlets.Compute.Server +{ + [Cmdlet(VerbsCommon.Reset, "Password", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class ResetPasswordCmdlet : BasePSCmdlet + { + private string _administratorPassword; + private string _serverId; + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "ResetPassword", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("id")] + [ValidateNotNullOrEmpty] + public string ServerId + { + get { return _serverId; } + set { _serverId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "ResetPassword", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("p")] + [ValidateNotNullOrEmpty] + public string AdministratorPassword + { + get { return _administratorPassword; } + set { _administratorPassword = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void ChangeWindowsImagePW() + { + CredentialListManager manager = new CredentialListManager(this.Settings); + if (this.Settings.EnableCredentialTracking == true) + { + manager.SetPassword(this.ServerId, this.AdministratorPassword); + Console.WriteLine(""); + Console.WriteLine("Password Updated."); + Console.WriteLine(""); + } + else + { + Console.WriteLine(""); + Console.WriteLine("You're attempting to update the password for a Windows Image but EnableCredentialTracking is currently turned off. To turn this on please use the Get-config and Set-config cmdlets. Operation failed."); + Console.WriteLine(""); + } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void ChangeNonWindowsImagePW() + { + ChangePasswordAction action = new ChangePasswordAction(); + action.AdministratorPassword = this.AdministratorPassword; + action.ServerId = this.ServerId; + + this.RepositoryFactory.CreateServerRepository().ChangePassword(action); + Console.WriteLine(""); + Console.WriteLine("Password Changed."); + Console.WriteLine(""); + } +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + private string GetServerId() + { + BaseUIContainer currentContainer = this.SessionState.PSVariable.Get("CurrentContainer").Value as BaseUIContainer; + + if (currentContainer.Name == "Metadata") + { + ServerUIContainer serverContainer = currentContainer.Parent as ServerUIContainer; + if (serverContainer != null) + return serverContainer.Entity.Id; + } + else + { + return currentContainer.Entity.Id; + } + return null; + } +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + private bool IsWindowsImage(string imageId) + { + Image image = this.RepositoryFactory.CreateImageRepository().GetImage(imageId); + return image.IsWindowsImage; + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + if (this.ServerId == null) + this.ServerId = this.GetServerId(); + + Openstack.Objects.Domain.Compute.Server server = this.RepositoryFactory.CreateServerRepository().GetServer(this.ServerId); + + if (this.IsWindowsImage(server.Image.Id)) { + ChangeWindowsImagePW(); + } + else + { + Console.WriteLine(""); + Console.WriteLine("Invalid Server : The Server you supplied is not a based on a Windows image. We currently only support key based authentication for non-Windows images."); + Console.WriteLine(""); + } + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Compute/Server/ConnectServerCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Compute/Server/ConnectServerCmdlet.cs new file mode 100644 index 0000000..423762c --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Compute/Server/ConnectServerCmdlet.cs @@ -0,0 +1,316 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Compute; +using Openstack.Objects.DataAccess.Compute; +using Openstack.Objects.DataAccess.Security; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Client.Powershell.Providers.Security; +using Openstack.Objects.Domain.Compute.Servers.Actions; +using Openstack.Objects.Domain.Compute.Servers; +using System; +using System.IO; +using System.Xml.Linq; +using System.Xml.XPath; +using Openstack.Client.Powershell.Providers.Compute; + +namespace Openstack.Client.Powershell.Cmdlets.Compute.Server +{ + [Cmdlet("Connect", "Server", SupportsShouldProcess = true)] + public class ConnectServerCmdletd : BasePSCmdlet + { + private string _serverId; + private string _keypairName = null; + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "ConnectServerPS", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("s")] + public string ServerId + { + get + { + if (_serverId != null) + return _serverId; + else + { + BaseUIContainer currentContainer = this.SessionState.PSVariable.Get("CurrentContainer").Value as BaseUIContainer; + ServerUIContainer serverContainer = currentContainer as ServerUIContainer; + + if (serverContainer != null) { + return serverContainer.Entity.Id; + } + } + return null; + + } + set { _serverId = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + private bool IsWindowsImage(string imageId) + { + Image image = this.RepositoryFactory.CreateImageRepository().GetImage(imageId); + return image.IsWindowsImage; + } +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + private string GetAdminPassword(string keyname) + { + GetServerLogAction action = new GetServerLogAction(); + action.ServerId = this.ServerId; + Log log = this.RepositoryFactory.CreateServerRepository().GetServerLog(action); + + if (log != null) + { + Console.WriteLine(""); + string pw = log.ExtractAdminPassword(this.Settings.KeyStoragePath + keyname + ".pem"); + Console.WriteLine("Administrator Password : " + pw); + return pw; + } + else + return null; + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void ShowCredentialsNotFoundMsg() + { + Console.WriteLine(""); + Console.WriteLine("Credentials not found. You'll have to manually enter your Administrator credentials for this instance."); + Console.WriteLine("If you want to continue to use Automatic Credential Tracking for this instance make sure that you update"); + Console.WriteLine("our records with the new password. To do this, use the Reset-Password cmdlet."); + Console.WriteLine(""); + } +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + private void WriteSection(string headerText) + { + ConsoleColor oldColor = Console.ForegroundColor; + Console.WriteLine(" "); + Console.ForegroundColor = ConsoleColor.DarkGray; + Console.WriteLine("=============================================================================================================================================="); + Console.ForegroundColor = ConsoleColor.Yellow; + Console.WriteLine(headerText); + Console.ForegroundColor = ConsoleColor.DarkGray; + Console.WriteLine("=============================================================================================================================================="); + Console.ForegroundColor = oldColor; + } +//========================================================================================= +/// +/// +/// +//===================================================================================K===== + private void ShowKeyBasedLoginInstructions(string keyname) + { + if (keyname == null) keyname = "YourKeyfile"; + + this.WriteSection("Unable to find a suitable Putty key file!"); + Console.WriteLine("1. Make sure that you have downloaded the latest version of Putty and PuttyGen for Windows."); + Console.WriteLine("2. Tell us where Putty.exe exist by setting the Config file entry SSHClientPath (use Set-Config)"); + Console.WriteLine("3. Tell PuttyGen to Load an existing key file. This file will be located at " + this.Settings.KeyStoragePath + @"\OS\" + keyname + ".pem"); + Console.WriteLine("4. Convert the .pem file to the .ppk format that Putty.exe understands by clicking the Save Private Key button."); + Console.WriteLine("5. Save the .ppk file as " + keyname + ".ppk"); + Console.WriteLine("6. Launch the SSH session with the Connect-Server cmdlet"); + Console.WriteLine("7. HINT : If you use the same keypair name for each Server you create you can skip steps 1-5 after the steps have been completed once."); + Console.WriteLine(""); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private bool LaunchPasswordBasedSSHSession(Openstack.Objects.Domain.Compute.Server server) + { + CredentialListManager manager = new CredentialListManager(this.Settings); + SSHClient sshClient = new SSHClient(this.Settings); + sshClient.Username = "ubuntu"; + sshClient.Address = server.Addresses.Private[1].Addr; + sshClient.Password = manager.GetPassword(server.Id); + + if (sshClient.Password == null) { + return false; + } + else { + sshClient.LaunchClient(); + return true; + } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private bool IsSSHClientConfigured() + { + if (this.Settings.SSHClientPath == string.Empty) + return false; + else + return File.Exists(this.Settings.SSHClientPath); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private bool DoesPPKExist(string keyName) + { + return File.Exists(this.Settings.KeyStoragePath + @"\OS\" + keyName + ".ppk"); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void SaveSSHClientLocation(string path) + { + string configFilePath = this.ConfigFilePath; + XDocument doc = XDocument.Load(configFilePath); + XElement clientPathNode = doc.XPathSelectElement("//add[@key='SSHClientPath']"); + + clientPathNode.SetAttributeValue("value", path); + doc.Save(configFilePath); + this.Settings.SSHClientPath = path; + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void ConfigureSSHClient() + { + Console.WriteLine(""); + Console.WriteLine("You're trying to establish a remote session with a non-Windows based server. This requires a fully qualified path to the SSH client (putty.exe)"); + Console.Write("SSH Client Path : "); + string path = Console.ReadLine(); + + if (File.Exists(path)) + { + Console.WriteLine(""); + Console.WriteLine("Putty.exe found! Saving location for future sessions.."); + Console.WriteLine(""); + this.SaveSSHClientLocation(path); + } + else + { + Console.WriteLine(""); + Console.WriteLine("Putty.exe not found! Invalid path supplied."); + Console.WriteLine(""); + } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void LaunchSSHSession(Openstack.Objects.Domain.Compute.Server server) + { + if (!IsSSHClientConfigured()) { + this.ConfigureSSHClient(); + } + + if (server.KeyName != null && this.DoesPPKExist(server.KeyName)) + { + SSHClient sshClient = new SSHClient(this.Settings); + sshClient.Username = "ubuntu"; + sshClient.KeypairName = server.KeyName; + sshClient.Address = server.Addresses.Private[1].Addr; + + sshClient.LaunchClient(); + } + else + { + this.ShowKeyBasedLoginInstructions(server.KeyName); + } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void LaunchWindowsSession(Openstack.Objects.Domain.Compute.Server server) + { + CredentialListManager manager = new CredentialListManager(this.Settings); + RDPClient client = new RDPClient(); + client.Address = server.Addresses.Private[1].Addr; + client.Username = "Administrator"; + + if (this.Settings.EnableCredentialTracking == true) + { + client.Password = manager.GetPassword(server.Id); + if (client.Password == null) + { + this.ShowCredentialsNotFoundMsg(); + return; + } + } + client.LaunchClient(); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + string id = this.TranslateQuickPickNumber(this.ServerId); + if (id != null) + { + Openstack.Objects.Domain.Compute.Server server = this.RepositoryFactory.CreateServerRepository().GetServer(id); + if (server != null) + { + if (IsWindowsImage(server.Image.Id)) + { + this.LaunchWindowsSession(server); + } + else + { + this.LaunchSSHSession(server); + } + } + else + { + Console.WriteLine(""); + Console.WriteLine("Server not found."); + Console.WriteLine(""); + } + } + } + #endregion + } +} + diff --git a/Openstack.Client.Powershell/Cmdlets/Compute/Server/NewImageCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Compute/Server/NewImageCmdlet.cs new file mode 100644 index 0000000..b86378e --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Compute/Server/NewImageCmdlet.cs @@ -0,0 +1,176 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Compute; +using System.Linq; +using Openstack.Objects.Domain.Compute.Servers; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Client.Powershell.Providers.Security; +using Openstack.Client.Powershell.Providers.Compute; + +namespace Openstack.Client.Powershell.Cmdlets.Compute.Server +{ + [Cmdlet(VerbsCommon.New, "Image", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class NewImageCmdlet : BasePSCmdlet + { + private string _name; + private string[] _metadata; + private string _serverId; + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, Mandatory = false, ParameterSetName = "NewImage", ValueFromPipelineByPropertyName = true, HelpMessage = "cfgn")] + [Alias("s")] + [ValidateNotNullOrEmpty] + public string ServerId + { + get { return _serverId; } + set { _serverId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "NewImage", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the Server.")] + [Alias("n")] + public string Name + { + get { return _name; } + set { _name = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, Mandatory = false, ParameterSetName = "NewImage", ValueFromPipelineByPropertyName = true, HelpMessage = "Valid values include")] + [Alias("md")] + [ValidateNotNullOrEmpty] + public string[] MetaData + { + get { return _metadata; } + set { _metadata = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +/// +/// +//========================================================================================= + public MetaData AddEntries(string[] keyValuePairs) + { + MetaData metadata = new MetaData(); + + if (keyValuePairs != null && keyValuePairs.Count() > 0) + { + foreach (string kv in keyValuePairs) + { + char[] seperator = { '|' }; + string[] temp = kv.Split(seperator); + MetaDataElement element = new MetaDataElement(); + element.Key = temp[0]; + element.Value = temp[1]; + + metadata.Add(temp[0], temp[1]); + } + return metadata; + } + return null; + } +//========================================================================================= +/// +/// +/// +/// +/// +//========================================================================================= + public MetaData ReformatMetadata(string[] keyValuePairs) + { + MetaData metadata = new MetaData(); + + if (keyValuePairs != null && keyValuePairs.Count() > 0) + { + foreach (string kv in keyValuePairs) + { + char[] seperator = { '|' }; + string[] temp = kv.Split(seperator); + MetaDataElement element = new MetaDataElement(); + element.Key = temp[0]; + element.Value = temp[1]; + + metadata.Add(temp[0], temp[1]); + } + return metadata; + } + return null; + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + MetaData md = null; + md = this.ReformatMetadata(this.MetaData); + NewImage image = new NewImage(); + image.MetaData = md; + image.Name = this.Name; + + if (this.ServerId != null) + { + image.ServerId = this.ServerId; + this.RepositoryFactory.CreateImageRepository().SaveImage(image); + this.UpdateCache(); + } + else + { + BaseUIContainer currentContainer = this.SessionState.PSVariable.Get("CurrentContainer").Value as BaseUIContainer; + + if (currentContainer.Name == "Metadata") + { + ServerUIContainer serverContainer = currentContainer.Parent as ServerUIContainer; + + if (serverContainer != null) + { + image.ServerId = serverContainer.Entity.Id; + this.RepositoryFactory.CreateImageRepository().SaveImage(image); + this.UpdateCache(); + } + } + else { + + image.ServerId = currentContainer.Entity.Id; + this.RepositoryFactory.CreateImageRepository().SaveImage(image); + this.UpdateCache(); + } + } + } + #endregion + } +} + + diff --git a/Openstack.Client.Powershell/Cmdlets/Compute/Server/NewServerCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Compute/Server/NewServerCmdlet.cs new file mode 100644 index 0000000..e4402ed --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Compute/Server/NewServerCmdlet.cs @@ -0,0 +1,323 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Compute; +using System.Linq; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Security; +using System.Collections.Generic; +using System; +using Openstack.Objects.DataAccess.Compute; +using System.Threading; + +namespace Openstack.Client.Powershell.Cmdlets.Compute.Server +{ + [Cmdlet(VerbsCommon.New, "Server", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class NewServerCmdlet : BasePSCmdlet + { + private string _name; + private string _imageId; + private string _flavorId; + private string _password; + private string _accessIPv4; + private string _accessIPv6; + private string _keyName; + private string[] _metadata; + private string[] _securityGroups; + private bool _useWizard = false; + private string[] _networksIds; + private string _availabilityZone; + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "NewServerPS", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the Server.")] + [Alias("n")] + public string Name + { + get { return _name; } + set { _name = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "NewServerPS", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "A valid reference to an Image.")] + [Alias("i")] + [ValidateNotNullOrEmpty] + public string ImageRef + { + get { return _imageId; } + set { _imageId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 2, ParameterSetName = "NewServerPS", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "A reference to a valid Flavor.Image")] + [Alias("f")] + [ValidateNotNullOrEmpty] + public string FlavorRef + { + get { return _flavorId; } + set { _flavorId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 3, ParameterSetName = "NewServerPS", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "ipv4 address for remote access.")] + [Alias("ip4")] + public string AccessIPv4 + { + get { return _accessIPv4; } + set { _accessIPv4 = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 4, ParameterSetName = "NewServerPS", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "ipv6 address for remote access.")] + [Alias("ip6")] + public string AccessIPv6 + { + get { return _accessIPv6; } + set { _accessIPv6 = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 5, Mandatory = false, ParameterSetName = "NewServerPS", ValueFromPipelineByPropertyName = true, HelpMessage = "Valid values include")] + [Alias("md")] + [ValidateNotNullOrEmpty] + public string[] MetaData + { + get { return _metadata; } + set { _metadata = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 6, ParameterSetName = "NewServerPS", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("k")] + [ValidateNotNullOrEmpty] + public string KeyName + { + get { return _keyName; } + set { _keyName = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 7, Mandatory = false, ParameterSetName = "NewServerPS", ValueFromPipelineByPropertyName = true, HelpMessage = "Valid values include")] + [Alias("sg")] + [ValidateNotNullOrEmpty] + public string[] SecurityGroups + { + get { return _securityGroups; } + set { _securityGroups = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 8, Mandatory = true, ParameterSetName = "NewServerPS", ValueFromPipelineByPropertyName = true, HelpMessage = "Valid values include")] + [Alias("nid")] + [ValidateNotNullOrEmpty] + public string[] NetworksIds + { + get { return _networksIds; } + set { _networksIds = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 9, ParameterSetName = "NewServerPS", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the Server.")] + [Alias("az")] + public string AvailabilityZone + { + get { return _availabilityZone; } + set { _availabilityZone = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +/// +/// +//========================================================================================= + public MetaData AddEntries(string[] keyValuePairs) + { + MetaData metadata = new MetaData(); + + if (keyValuePairs != null && keyValuePairs.Count() > 0) + { + foreach (string kv in keyValuePairs) + { + char[] seperator = { '|' }; + string[] temp = kv.Split(seperator); + MetaDataElement element = new MetaDataElement(); + element.Key = temp[0]; + element.Value = temp[1]; + + metadata.Add(temp[0], temp[1]); + } + return metadata; + } + return null; + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private List GetSecurityGroups() + { + List assignments = new List(); + + if (_securityGroups != null) + { + foreach (string sg in _securityGroups) + { + assignments.Add(new SecurityGroupAssignment(sg)); + } + } + + return assignments; + } +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + private bool IsWindowsImage(string imageId) + { + Image image = this.RepositoryFactory.CreateImageRepository().GetImage(imageId); + return image.IsWindowsImage; + } +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + private List GetNetworkIDs() + { + if (this.NetworksIds != null) + { + List ids = new List(); + foreach (string id in this.NetworksIds) + { + NetworkId uuid = new NetworkId(id); + ids.Add(uuid); + } + return ids; + } + else + { + return null; + } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void SaveServer() + { + NewServer server = new NewServer(); + server.Name = this.Name; + server.ImageRef = this.ImageRef; + server.FlavorRef = this.FlavorRef; + server.AccessIPv6 = this.AccessIPv6; + server.AccessIPv4 = this.AccessIPv4; + server.MetaData = this.AddEntries(this.MetaData); + server.KeyName = this.KeyName; + server.SecurityGroups = this.GetSecurityGroups(); + server.Networks = this.GetNetworkIDs(); + server.AvailabilityZone = this.AvailabilityZone; + + if (IsWindowsImage(this.ImageRef)) + { + WindowsInstanceBuilder builder = new WindowsInstanceBuilder(this.RepositoryFactory, this.Settings); + builder.Changed += new Openstack.Objects.DataAccess.Compute.WindowsInstanceBuilder.CreateInstanceEventHandler(BuilderEvent); + builder.CreateInstance(server); + builder.Changed -= new Openstack.Objects.DataAccess.Compute.WindowsInstanceBuilder.CreateInstanceEventHandler(BuilderEvent); + this.UpdateCache(); + } + else + { + NonWindowsInstanceBuilder nonWIBuilder = new NonWindowsInstanceBuilder(this.RepositoryFactory, this.Settings); + nonWIBuilder.Changed += new Openstack.Objects.DataAccess.Compute.NonWindowsInstanceBuilder.CreateInstanceEventHandler(BuilderEvent); + nonWIBuilder.CreateInstance(server, _keyName); + nonWIBuilder.Changed -= new Openstack.Objects.DataAccess.Compute.NonWindowsInstanceBuilder.CreateInstanceEventHandler(BuilderEvent); + this.UpdateCache(); + } + } +//========================================================================================= +/// +/// +/// +/// +/// +//========================================================================================= + private void BuilderEvent(object sender, CreateInstanceEventArgs e) + { + Console.WriteLine(e.Message); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private NewServer ShowNewServerWizard() + { + return null; + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + this.SaveServer(); + } + #endregion + } +} + diff --git a/Openstack.Client.Powershell/Cmdlets/Compute/Server/PingServerCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Compute/Server/PingServerCmdlet.cs new file mode 100644 index 0000000..279c773 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Compute/Server/PingServerCmdlet.cs @@ -0,0 +1,180 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Client.Powershell.Providers.Common; +using System; +using System.Threading; +using System.Net.NetworkInformation; +using System.Text; +using System.Collections.Generic; +using Openstack.Objects.Domain.Networking; +using Openstack.Objects.Domain.Compute; + +namespace Openstack.Client.Powershell.Cmdlets.Compute.Server +{ + [Cmdlet("Ping", "Server", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class PingServerCmdletd : BasePSCmdlet + { + private string _serverId; + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "PingwServerPS", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("s")] + public string ServerId + { + get { return _serverId; } + set { _serverId = value; } + } +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + private void PingServer(string address) + { + Console.WriteLine(""); + Console.WriteLine("Pinging Server : " + address); + AutoResetEvent waiter = new AutoResetEvent(false); + + Ping pingSender = new Ping(); + + // When the PingCompleted event is raised, + // the PingCompletedCallback method is called. + pingSender.PingCompleted += new PingCompletedEventHandler(PingCompletedCallback); + + // Create a buffer of 32 bytes of data to be transmitted. + string data = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + byte[] buffer = Encoding.ASCII.GetBytes(data); + + // Wait 12 seconds for a reply. + int timeout = 12000; + + // Set options for transmission: + // The data can go through 64 gateways or routers + // before it is destroyed, and the data packet + // cannot be fragmented. + PingOptions options = new PingOptions(64, true); + + Console.WriteLine("Time to live : {0}", options.Ttl); + Console.WriteLine("Don't fragment : {0}", options.DontFragment); + + // Send the ping asynchronously. + // Use the waiter as the user token. + // When the callback completes, it can wake up this thread. + pingSender.SendAsync(address, timeout, buffer, options, waiter); + + // Prevent this example application from ending. + // A real application should do something useful + // when possible. + waiter.WaitOne(); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private IList GetServerIPAddresses(string serverId) + { + Openstack.Objects.Domain.Compute.Server server = this.RepositoryFactory.CreateServerRepository().GetServer(serverId); + return server.Addresses.Private; + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + IList addresses = this.GetServerIPAddresses(this.ServerId); + Console.WriteLine(""); + Console.WriteLine(addresses.Count + " assigned IP addresses found. Ping results are as follows."); + Console.WriteLine(""); + + foreach (IPAddress address in addresses) + { + this.PingServer(address.Addr); + Console.WriteLine(""); + } + Console.WriteLine(""); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private static void PingCompletedCallback(object sender, PingCompletedEventArgs e) + { + // If the operation was canceled, display a message to the user. + if (e.Cancelled) + { + Console.WriteLine("Ping canceled."); + + // Let the main thread resume. + // UserToken is the AutoResetEvent object that the main thread + // is waiting for. + ((AutoResetEvent)e.UserState).Set(); + } + + // If an error occurred, display the exception to the user. + if (e.Error != null) + { + Console.WriteLine("Ping failed:"); + Console.WriteLine(e.Error.ToString()); + + // Let the main thread resume. + ((AutoResetEvent)e.UserState).Set(); + } + + PingReply reply = e.Reply; + + DisplayReply(reply); + + // Let the main thread resume. + ((AutoResetEvent)e.UserState).Set(); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + public static void DisplayReply(PingReply reply) + { + if (reply == null) + return; + + Console.WriteLine("ping status : {0}", reply.Status); + if (reply.Status == IPStatus.Success) + { + Console.WriteLine("Address : {0}", reply.Address.ToString()); + Console.WriteLine("RoundTrip time : {0}", reply.RoundtripTime); + Console.WriteLine("Time to live : {0}", reply.Options.Ttl); + Console.WriteLine("Don't fragment : {0}", reply.Options.DontFragment); + Console.WriteLine("Buffer size : {0}", reply.Buffer.Length); + } + } + + #endregion + } +} + diff --git a/Openstack.Client.Powershell/Cmdlets/Compute/Server/RebootServerCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Compute/Server/RebootServerCmdlet.cs new file mode 100644 index 0000000..ab9e9a3 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Compute/Server/RebootServerCmdlet.cs @@ -0,0 +1,112 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Compute.Servers; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Client.Powershell.Providers.Security; +using Openstack.Objects; +using Openstack.Client.Powershell.Providers.Compute; +using System; + +namespace Openstack.Client.Powershell.Cmdlets.Compute.Server +{ + [Cmdlet("Reboot", "Server", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class RebootServerCmdlet : BasePSCmdlet + { + private ServerRebootType _type = ServerRebootType.SOFT; + private string _serverId; + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "RebootServer", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("id")] + [ValidateNotNullOrEmpty] + public string ServerId + { + get { return _serverId; } + set { _serverId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "RebootServer", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = " ")] + [Alias("t")] + [ValidateNotNullOrEmpty] + [ValidateSet("SOFT", "HARD")] + public ServerRebootType Type + { + get { return _type; } + set { _type = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + string id = this.TranslateQuickPickNumber(this.ServerId); + + RebootAction action = new RebootAction(); + action.RebootType = this.Type; + + if (this.ServerId != null) + { + action.ServerId = id; + Console.WriteLine(""); + Console.WriteLine("Rebooting Server " + id); + Console.WriteLine(""); + this.RepositoryFactory.CreateServerRepository().Reboot(action); + } + else + { + BaseUIContainer currentContainer = this.SessionState.PSVariable.Get("CurrentContainer").Value as BaseUIContainer; + + if (currentContainer.Name == "Metadata") + { + ServerUIContainer serverContainer = currentContainer.Parent as ServerUIContainer; + + if (serverContainer != null) + { + action.ServerId = serverContainer.Entity.Id; + this.RepositoryFactory.CreateServerRepository().Reboot(action); + } + } + else + { + ServerUIContainer serverContainer = currentContainer as ServerUIContainer; + if (serverContainer != null) + { + action.ServerId = serverContainer.Entity.Id; + this.RepositoryFactory.CreateServerRepository().Reboot(action); + this.UpdateCache(); + } + } + } + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Compute/Server/RemoveMetadataCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Compute/Server/RemoveMetadataCmdlet.cs new file mode 100644 index 0000000..ac75c80 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Compute/Server/RemoveMetadataCmdlet.cs @@ -0,0 +1,117 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Compute; +using System.Linq; +using Openstack.Client.Powershell.Providers.Security; +using Openstack.Client.Powershell.Providers.Common; +using System.Collections; +using System.Collections.Generic; +using Openstack.Client.Powershell.Providers.Compute; + +namespace Openstack.Client.Powershell.Cmdlets.Compute.Server +{ + [Cmdlet(VerbsCommon.Remove, "Metadata", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class RemoveMetadataCmdletd : BasePSCmdlet + { + private string _key; + private string _serverId; + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, Mandatory = false, ParameterSetName = "RemoveMetadata", ValueFromPipelineByPropertyName = true, HelpMessage = "cfgn")] + [Alias("id")] + [ValidateNotNullOrEmpty] + public string ServerId + { + get { return _serverId; } + set { _serverId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, Mandatory = true, ParameterSetName = "RemoveMetadata", ValueFromPipelineByPropertyName = true, HelpMessage = "sdfgh")] + [Alias("k")] + [ValidateNotNullOrEmpty] + public string Key + { + get { return _key; } + set { _key = value; } + } + #endregion +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + private void RemoveElement(string key) + { + IList elements = ((CommonDriveInfo)this.Drive).CurrentContainer.Entities; + MetaDataElement mdElement = null; + + foreach (MetaDataElement element in elements) + { + if (element.Key == this.Key) + { + mdElement = element; + } + } + + elements.Remove(mdElement); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + if (this.ServerId != null) + { + this.RepositoryFactory.CreateServerRepository().DeleteMetadata(this.ServerId, this.Key); + this.RemoveElement(this.Key); + } + else + { + BaseUIContainer currentContainer = this.SessionState.PSVariable.Get("CurrentContainer").Value as BaseUIContainer; + + if (currentContainer.Name == "Metadata") + { + ServerUIContainer serverContainer = currentContainer.Parent as ServerUIContainer; + + if (serverContainer != null) { + this.RepositoryFactory.CreateServerRepository().DeleteMetadata(serverContainer.Entity.Id, this.Key); + this.RemoveElement(this.Key); + } + } + else { + this.RepositoryFactory.CreateServerRepository().DeleteMetadata(currentContainer.Entity.Id, this.Key); + this.RemoveElement(this.Key); + } + } + } + } + + } \ No newline at end of file diff --git a/Openstack.Client.Powershell/Cmdlets/Compute/Server/RemoveServerCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Compute/Server/RemoveServerCmdlet.cs new file mode 100644 index 0000000..de8a15a --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Compute/Server/RemoveServerCmdlet.cs @@ -0,0 +1,120 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Compute; +using System.Linq; +using Openstack.Objects.Domain.Compute.Servers; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Client.Powershell.Providers.Security; +using System.Collections; +using System.Threading; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Management.Automation.Host; +using System; +using Openstack.Client.Powershell.Providers.Compute; + +namespace Openstack.Client.Powershell.Cmdlets.Compute.Server +{ + [Cmdlet(VerbsCommon.Remove, "Server", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class RemoveServerCmdlet : BasePSCmdlet + { + private string _serverId; + private SwitchParameter _force = false; + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "RemoveServer", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("all")] + public SwitchParameter RemoveAll + { + get { return _force; } + set { _force = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "RemoveServer", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("id")] + [ValidateNotNullOrEmpty] + public string ServerId + { + get { return _serverId; } + set { _serverId = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void RemoveAllServers() + { + List servers = this.RepositoryFactory.CreateServerRepository().GetServers(); + Console.WriteLine(""); + + foreach(Openstack.Objects.Domain.Compute.Server server in servers) + { + if (server.Name != "RGWinLarge") + { + Console.WriteLine("Removing Server : " + server.Name); + this.RepositoryFactory.CreateServerRepository().DeleteServer(server.Id); + } + } + Console.WriteLine(""); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + string id = this.TranslateQuickPickNumber(this.ServerId); + + if (_force) + { + Collection choices = new Collection(); + choices.Add(new ChoiceDescription("Y", "Yes")); + choices.Add(new ChoiceDescription("N", "No")); + + Console.WriteLine(""); + if (this.Host.UI.PromptForChoice("Confirm Action", "You are about to remove all active Server instances. Are you sure about this?", choices, 0) == 0) + this.RemoveAllServers(); + } + else + { + if (this.ServerId != null) + { + this.RepositoryFactory.CreateServerRepository().DeleteServer(id); + this.UpdateCache(); + } + } + + } + #endregion + } +} + diff --git a/Openstack.Client.Powershell/Cmdlets/Compute/Server/UpdateServerCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Compute/Server/UpdateServerCmdlet.cs new file mode 100644 index 0000000..df17efa --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Compute/Server/UpdateServerCmdlet.cs @@ -0,0 +1,96 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Compute; +using System.Linq; +using Openstack.Objects.Domain.Compute.Servers; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Client.Powershell.Providers.Security; +using Openstack.Client.Powershell.Providers.Compute; + +namespace Openstack.Client.Powershell.Cmdlets.Compute.Server +{ + [Cmdlet("Update", "Server", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class UpdateServerCmdlet : BasePSCmdlet + { + private string _serverId; + private string _name; + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "UpdateServer", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("n")] + [ValidateNotNullOrEmpty] + public string Name + { + get { return _name; } + set { _name = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "UpdateServer", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("id")] + [ValidateNotNullOrEmpty] + public string ServerId + { + get { return _serverId; } + set { _serverId = value; } + } + + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void UpdateName(string name) + { + BaseUIContainer server = ((CommonDriveInfo)this.Drive).CurrentContainer; + server.Name = name; + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + Openstack.Objects.Domain.Compute.Server server = new Openstack.Objects.Domain.Compute.Server(); + if (this.ServerId != null) + { + server.Id = this.ServerId; + server.Name = this.Name; + + this.RepositoryFactory.CreateServerRepository().UpdateServer(server); + this.UpdateName(this.Name); + this.UpdateCache(); + } + } + #endregion + } +} + + diff --git a/Openstack.Client.Powershell/Cmdlets/Networking/AssignIPCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Networking/AssignIPCmdlet.cs new file mode 100644 index 0000000..9c5e347 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Networking/AssignIPCmdlet.cs @@ -0,0 +1,93 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Networking; +using System; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Client.Powershell.Providers.Security; +using Openstack.Objects.DataAccess.Networking; + +namespace Openstack.Client.Powershell.Cmdlets.Networking +{ + [Cmdlet("Assign", "IP", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class AssignIPCmdlet : BasePSCmdlet + { + private string _serverId; + private string _ip; + + #region Properties +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "cfgn")] + [Alias("ip")] + [ValidateNotNullOrEmpty] + public string IpAddress + { + get { return _ip; } + set { _ip = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "cfgn")] + [Alias("s")] + [ValidateNotNullOrEmpty] + public string ServerId + { + get { return _serverId; } + set { _serverId = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + if (!this.ServerId.Contains(".")) + { + IFloatingIPRepository repository = new FloatingIPRepository(this.Context.GetRepositoryContext("compute")); + + AssignIPAction assignment = new AssignIPAction(); + assignment.ServerId = this.ServerId; + assignment.Ip = this.IpAddress; + + repository.AssignIP(assignment); + + Console.WriteLine(""); + Console.WriteLine("Floating IP Address " + this.IpAddress + " now assigned to Server : " + assignment.ServerId); + Console.WriteLine(""); + this.UpdateCache(); + } + else + { + InvalidOperationException ex = new InvalidOperationException("Please check the supplied parameters. IP addresses are not allowed in place of Server IDs.", null); + WriteError(new ErrorRecord(ex, "0", ErrorCategory.InvalidArgument, null)); + } + } + #endregion + } +} + diff --git a/Openstack.Client.Powershell/Cmdlets/Networking/DeleteFloatingIPCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Networking/DeleteFloatingIPCmdlet.cs new file mode 100644 index 0000000..6b0354d --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Networking/DeleteFloatingIPCmdlet.cs @@ -0,0 +1,107 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Management.Automation; +using System.Management.Automation.Host; +using System.Text; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.DataAccess.Networking; +using Openstack.Objects.Domain; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Cmdlets.Networking +{ + [Cmdlet(VerbsCommon.Remove, "FloatingIP", SupportsShouldProcess = true)] + //[RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class DeleteFloatingIPCmdlet : BasePSCmdlet + { + private string _floatingIPId; + private SwitchParameter _force = false; + +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "DeleteFloatingIP", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("all")] + public SwitchParameter RemoveAll + { + get { return _force; } + set { _force = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "DeleteFloatingIP2", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the Server.")] + [Alias("id")] + public string FloatingIP + { + get { return _floatingIPId; } + set { _floatingIPId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void RemoveAllFloatingIPs() + { + IFloatingIPRepository repository = this.RepositoryFactory.CreateFloatingIPRepository(); + Console.WriteLine(""); + + foreach (BaseEntity entity in this.CurrentContainer.Entities) + { + if (entity.Name != null) + Console.WriteLine("Removing Floating IP : " + entity.Name); + else + Console.WriteLine("Removing Floating IP : " + entity.Id); + + repository.DeleteFloatingIP(entity.Id); + } + Console.WriteLine(""); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + if (_force) + { + if (this.UserConfirmsDeleteAction("Floating IP Addresses")) + { + this.RemoveAllFloatingIPs(); + this.UpdateCache(); + } + } + else + { + string id = this.TranslateQuickPickNumber(this.FloatingIP); + this.RepositoryFactory.CreateFloatingIPRepository().DeleteFloatingIP(id); + this.UpdateCache(); + } + } + + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Networking/DeleteNetworkCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Networking/DeleteNetworkCmdlet.cs new file mode 100644 index 0000000..13d827f --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Networking/DeleteNetworkCmdlet.cs @@ -0,0 +1,143 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Management.Automation; +using System.Management.Automation.Host; +using System.Text; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.DataAccess.Networking; +using Openstack.Objects.Domain; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Cmdlets.Networking +{ + [Cmdlet(VerbsCommon.Remove, "Network", SupportsShouldProcess = true)] + //[RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.)] + public class DeleteNetworkCmdlet : BasePSCmdlet + { + private string _networkId; + private SwitchParameter _removeAll = false; + private SwitchParameter _force = true; + +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "DeleteNetwork", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the Server.")] + [Alias("id")] + public string NetworkId + { + get { return _networkId; } + set { _networkId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "DeleteNetwork2", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("all")] + public SwitchParameter RemoveAll + { + get { return _removeAll; } + set { _removeAll = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 2, ParameterSetName = "DeleteNetwork", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("f")] + public SwitchParameter Force + { + get { return _force; } + set { _force = value; } + } +//========================================================================================= +/// +/// +/// +/// +/// +//========================================================================================= + private void BuilderEvent(object sender, CreateNetworkEventArgs e) + { + Console.WriteLine(e.Message); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void RemoveAllNetworks() + { + INetworkRepository repository = this.RepositoryFactory.CreateNetworkRepository(); + List networks = repository.GetNetworks(); + + repository.Changed += new Openstack.Objects.DataAccess.Networking.NetworkRepository.CreateNetworkEventHandler(BuilderEvent); + foreach (BaseEntity entity in this.CurrentContainer.Entities) + { + if (entity.Name != "Ext-Net") + { + Console.WriteLine(""); + Console.WriteLine("Removing Network : " + entity.Name); + Console.WriteLine(""); + repository.DeleteNetwork(entity.Id, _force); + } + } + Console.WriteLine(""); + repository.Changed -= new Openstack.Objects.DataAccess.Networking.NetworkRepository.CreateNetworkEventHandler(BuilderEvent); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + + if (_networkId == null && _removeAll == false) + { + Console.WriteLine("Error : "); + } + else + { + if (_removeAll) + { + if (this.UserConfirmsDeleteAction("Networks")) + { + this.RemoveAllNetworks(); + this.UpdateCache(); + } + } + else + { + string id = this.TranslateQuickPickNumber(this.NetworkId); + this.RepositoryFactory.CreateNetworkRepository().DeleteNetwork(id, _force); + this.UpdateCache(); + } + } + + } + + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Networking/DeletePortCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Networking/DeletePortCmdlet.cs new file mode 100644 index 0000000..cfebca4 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Networking/DeletePortCmdlet.cs @@ -0,0 +1,107 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Management.Automation; +using System.Management.Automation.Host; +using System.Text; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.DataAccess.Networking; +using Openstack.Objects.Domain; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Cmdlets.Networking +{ + [Cmdlet(VerbsCommon.Remove, "Port", SupportsShouldProcess = true)] + //[RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class DeletePortCmdlet : BasePSCmdlet + { + private string _floatingIPId; + private SwitchParameter _force = false; + +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "DeletePort", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the Server.")] + [Alias("id")] + public string PortId + { + get { return _floatingIPId; } + set { _floatingIPId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "DeletePort2", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("all")] + public SwitchParameter RemoveAll + { + get { return _force; } + set { _force = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void RemoveAllPorts() + { + IPortRepository repository = this.RepositoryFactory.CreatePortRepository(); + Console.WriteLine(""); + + foreach (BaseEntity entity in this.CurrentContainer.Entities) + { + if (entity.Name != null) + Console.WriteLine("Removing Port : " + entity.Name); + else + Console.WriteLine("Removing Port : " + entity.Id); + + repository.DeletePort(entity.Id); + } + Console.WriteLine(""); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + string id = this.TranslateQuickPickNumber(this.PortId); + + if (_force) + { + if (this.UserConfirmsDeleteAction("Ports")) + { + this.RemoveAllPorts(); + this.UpdateCache(); + } + } + else + { + this.RepositoryFactory.CreatePortRepository().DeletePort(id); + this.UpdateCache(); + } + } + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Networking/DeleteRouterCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Networking/DeleteRouterCmdlet.cs new file mode 100644 index 0000000..474566a --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Networking/DeleteRouterCmdlet.cs @@ -0,0 +1,106 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Management.Automation; +using System.Management.Automation.Host; +using System.Text; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.DataAccess.Networking; +using Openstack.Objects.Domain; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Cmdlets.Networking +{ + [Cmdlet(VerbsCommon.Remove, "Router", SupportsShouldProcess = true)] + //[RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class DeleteRouterCmdlet : BasePSCmdlet + { + private string _routerId; + private SwitchParameter _force = false; +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "DeleteRouter", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the Server.")] + [Alias("rid")] + public string RouterId + { + get { return _routerId; } + set { _routerId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "DeleteRouter2", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("all")] + public SwitchParameter RemoveAll + { + get { return _force; } + set { _force = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void RemoveAllRouters() + { + IRouterRepository repository = this.RepositoryFactory.CreateRouterRepository(); + Console.WriteLine(""); + + foreach (BaseEntity entity in this.CurrentContainer.Entities) + { + if (entity.Name != null) + Console.WriteLine("Removing Router : " + entity.Name); + else + Console.WriteLine("Removing Router : " + entity.Id); + + repository.DeleteRouter(entity.Id); + } + Console.WriteLine(""); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + string id = this.TranslateQuickPickNumber(this.RouterId); + + if (_force) + { + if (this.UserConfirmsDeleteAction("Routers")) + { + this.RemoveAllRouters(); + this.UpdateCache(); + } + } + else + { + this.RepositoryFactory.CreateRouterRepository().DeleteRouter(id); + this.UpdateCache(); + } + } + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Networking/DeleteRouterInterfaceCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Networking/DeleteRouterInterfaceCmdlet.cs new file mode 100644 index 0000000..9877c6d --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Networking/DeleteRouterInterfaceCmdlet.cs @@ -0,0 +1,69 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Text; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Cmdlets.Networking +{ + [Cmdlet(VerbsCommon.Remove, "RouterInterface", SupportsShouldProcess = true)] + //[RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class DeleteRouterInterfaceCmdlet : BasePSCmdlet + { + private string _routerId; + private string _subnetId; + +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "DeleteRouterInterface", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the Server.")] + [Alias("id")] + public string RouterId + { + get { return _routerId; } + set { _routerId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "DeleteRouterInterface", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the Server.")] + [Alias("sid")] + public string SubnetId + { + get { return _subnetId; } + set { _subnetId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + this.RepositoryFactory.CreateRouterRepository().DeleteInterfaceByRouter(this.RouterId, this.SubnetId); + this.UpdateCache(); + } + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Networking/DeleteSubnetCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Networking/DeleteSubnetCmdlet.cs new file mode 100644 index 0000000..1396a6c --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Networking/DeleteSubnetCmdlet.cs @@ -0,0 +1,104 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Management.Automation; +using System.Management.Automation.Host; +using System.Text; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.DataAccess.Networking; +using Openstack.Objects.Domain; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Cmdlets.Networking +{ + [Cmdlet(VerbsCommon.Remove, "Subnet", SupportsShouldProcess = true)] + //[RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class DeleteSubnetCmdlet : BasePSCmdlet + { + private string _subnetId; + private SwitchParameter _force = false; + +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "DeleteSubnet", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the Server.")] + [Alias("id")] + public string SubnetId + { + get { return _subnetId; } + set { _subnetId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "DeleteSubnet2", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("all")] + public SwitchParameter RemoveAll + { + get { return _force; } + set { _force = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void RemoveAllSubnets() + { + ISubnetRepository repository = this.RepositoryFactory.CreateSubnetRepository(); + Console.WriteLine(""); + + foreach (BaseEntity entity in this.CurrentContainer.Entities) + { + if (entity.Name != null) + Console.WriteLine("Removing Subnet : " + entity.Name); + else + Console.WriteLine("Removing Subnet : " + entity.Id); + + repository.DeleteSubnet(entity.Id); + } + Console.WriteLine(""); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + string id = this.TranslateQuickPickNumber(this.SubnetId); + + if (_force && this.UserConfirmsDeleteAction("Subnets")) + { + this.RemoveAllSubnets(); + this.UpdateCache(); + } + else + { + this.RepositoryFactory.CreateSubnetRepository().DeleteSubnet(id); + this.UpdateCache(); + } + } + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Networking/NewFloatingIPCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Networking/NewFloatingIPCmdlet.cs new file mode 100644 index 0000000..462cc4a --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Networking/NewFloatingIPCmdlet.cs @@ -0,0 +1,71 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Text; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Cmdlets.Networking +{ + [Cmdlet(VerbsCommon.New, "FloatingIP", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class NewFloatingIPCmdlet : BasePSCmdlet + { + private string _networkId; + private string _portId; +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "NewFloatingIP", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the Server.")] + [Alias("pid")] + public string PortId + { + get { return _portId; } + set { _portId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "NewFloatingIP", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the Server.")] + [Alias("nid")] + public string NetworkId + { + get { return _networkId; } + set { _networkId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + NewFloatingIP newFloatingIP = new NewFloatingIP(); + newFloatingIP.FloatingNetworkId = this.NetworkId; + newFloatingIP.PortId = this.PortId; + + this.RepositoryFactory.CreateFloatingIPRepository().SaveFloatingIP(newFloatingIP); + } + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Networking/NewNetworkCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Networking/NewNetworkCmdlet.cs new file mode 100644 index 0000000..da11296 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Networking/NewNetworkCmdlet.cs @@ -0,0 +1,127 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Text; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.DataAccess.Networking; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Cmdlets.Networking +{ + [Cmdlet("New", "Network", SupportsShouldProcess = true)] + public class NewNetworkCmdlet : BasePSCmdlet + { + private bool _adminStateUp = true; + private bool _force = true; + private string _name; + private string _cidr = "11.0.3.0/24"; + + #region Properties +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "NewNetwork", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("n")] + public string Name + { + get { return _name; } + set { _name = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 3, ParameterSetName = "NewNetwork", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("cidr")] + public string CidrValue + { + get { return _cidr; } + set { _cidr = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "NewNetwork", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("asu")] + [ValidateNotNullOrEmpty] + public SwitchParameter AdminStateUp + { + get { return _adminStateUp; } + set { _adminStateUp = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 2, ParameterSetName = "NewNetwork", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("f")] + [ValidateNotNullOrEmpty] + public SwitchParameter Force + { + get { return _force; } + set { _force = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +/// +/// +//========================================================================================= + private void BuilderEvent(object sender, CreateNetworkEventArgs e) + { + Console.WriteLine("- " + e.Message); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + Console.WriteLine(""); + NewNetwork newNetwork = new NewNetwork(); + newNetwork.AdminStateUp = _adminStateUp; + newNetwork.Name = _name; + + if (this.CidrValue == null) { + newNetwork.Cidr = "11.0.3.0/24"; + } + else{ + newNetwork.Cidr = this.CidrValue; + } + + INetworkRepository repository = this.RepositoryFactory.CreateNetworkRepository(); + repository.Changed += new Openstack.Objects.DataAccess.Networking.NetworkRepository.CreateNetworkEventHandler(BuilderEvent); + repository.SaveNetwork(newNetwork, this.Force); + repository.Changed -= new Openstack.Objects.DataAccess.Networking.NetworkRepository.CreateNetworkEventHandler(BuilderEvent); + Console.WriteLine(" Network Build Complete!"); + Console.WriteLine(""); + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Networking/NewPortCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Networking/NewPortCmdlet.cs new file mode 100644 index 0000000..064cf47 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Networking/NewPortCmdlet.cs @@ -0,0 +1,104 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Text; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Cmdlets.Networking +{ + [Cmdlet("New", "Port", SupportsShouldProcess = true)] + public class NewPortCmdlet : BasePSCmdlet + { + private string _name; + private SwitchParameter _admin_state_up = true; + private string _networkId; + private string _deviceId; + + #region Properties +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "NewPort", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("n")] + public string Name + { + get { return _name; } + set { _name = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "NewPort", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("nid")] + public string NetworkId + { + get { return _networkId; } + set { _networkId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 3, ParameterSetName = "NewPort", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("asu")] + + public SwitchParameter AdminStateUp + { + get { return _admin_state_up; } + set { _admin_state_up = value; } + } +//============================================================================ +/// +/// +/// +//============================================================================ + [Parameter(Position = 2, ParameterSetName = "NewPort", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("did")] + public string DeviceId + { + get { return _deviceId; } + set { _deviceId = value; } + } + #endregion + #region Methods +//============================================================================ +/// +/// +/// +//============================================================================ + protected override void ProcessRecord() + { + NewPort newPort = new NewPort(); + newPort.AdminStateUp = this.AdminStateUp; + newPort.DeviceId = this.DeviceId; + newPort.Name = this.Name; + newPort.NetworkId = this.NetworkId; + + this.RepositoryFactory.CreatePortRepository().SavePort(newPort); + + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Networking/NewRouterCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Networking/NewRouterCmdlet.cs new file mode 100644 index 0000000..cec4dc5 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Networking/NewRouterCmdlet.cs @@ -0,0 +1,93 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Text; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Cmdlets.Networking +{ + [Cmdlet("New", "Router", SupportsShouldProcess = true)] + public class NewRouterCmdlet : BasePSCmdlet + { + private bool _adminStateUp = true; + private string _name; + private string _extGatewayNetworkId; + + #region Properties +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 2, ParameterSetName = "NewRouter", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("egw")] + public string ExternalGateway + { + get { return _extGatewayNetworkId; } + set { _extGatewayNetworkId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "NewRouter", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("n")] + public string Name + { + get { return _name; } + set { _name = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "NewRouter", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("asu")] + [ValidateNotNullOrEmpty] + public SwitchParameter AdminStateUp + { + get { return _adminStateUp; } + set { _adminStateUp = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + NewRouter newRouter = new NewRouter(); + newRouter.Name = this.Name; + newRouter.AdminStateUp = this.AdminStateUp; + + if (this.ExternalGateway != null) { + newRouter.ExternalGateway.NetworkId = this.ExternalGateway; + } + + this.RepositoryFactory.CreateRouterRepository().SaveRouter(newRouter); + } + #endregion + + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Networking/NewRouterInterfaceCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Networking/NewRouterInterfaceCmdlet.cs new file mode 100644 index 0000000..844499a --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Networking/NewRouterInterfaceCmdlet.cs @@ -0,0 +1,101 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Text; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Cmdlets.Networking +{ + [Cmdlet("New", "RouterInterface", SupportsShouldProcess = true)] + public class NewRouterInterfaceCmdlet : BasePSCmdlet + { + private string _subnetId; + private string _portId; + private string _routerId; + + #region Properties +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "NewRouterInterface", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("rid")] + public string RouterId + { + get { return _routerId; } + set { _routerId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "NewRouterInterface", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("sid")] + public string SubnetId + { + get { return _subnetId; } + set { _subnetId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 2, ParameterSetName = "NewRouterInterface", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("pid")] + public string PortId + { + get { return _portId; } + set { _portId = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + NewRouterInterface newRouterInterface = new NewRouterInterface(); + newRouterInterface.PortId = this.PortId; + newRouterInterface.SubnetId = this._subnetId; + newRouterInterface.RouterId = this.RouterId; + + NewRouterInterface response = this.RepositoryFactory.CreateRouterRepository().SaveRouterInterface(newRouterInterface); + if (response.SubnetId != null) + { + Console.WriteLine(""); + Console.WriteLine("New Router Interface created for Subnet Id " + response.SubnetId); + Console.WriteLine(""); + } + else if (response.PortId != null) + { + Console.WriteLine(""); + Console.WriteLine("New Router Interface created for Port Id " + response.PortId); + Console.WriteLine(""); + } + } + #endregion + + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Networking/NewSubnetCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Networking/NewSubnetCmdlet.cs new file mode 100644 index 0000000..70d6f0f --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Networking/NewSubnetCmdlet.cs @@ -0,0 +1,136 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Text; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Cmdlets.Networking +{ + [Cmdlet("New", "Subnet", SupportsShouldProcess = true)] + public class NewSubnetCmdlet : BasePSCmdlet + { + private string _networkId; + private int _IPVersion; + private string _cidr; + private string[] _allocationPools; + + #region Properties +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "NewSubnet", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("nid")] + public string NetworkId + { + get { return _networkId; } + set { _networkId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "NewSubnet", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("ipv")] + public int IPVersion + { + get { return _IPVersion; } + set { _IPVersion = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 2, ParameterSetName = "NewSubnet", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("c")] + public string Cidr + { + get { return _cidr; } + set { _cidr = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 3, Mandatory = false, ParameterSetName = "NewSubnet", ValueFromPipelineByPropertyName = true, HelpMessage = "Valid values include")] + [Alias("a")] + [ValidateNotNullOrEmpty] + public string[] AllocationPools + { + get { return _allocationPools; } + set { _allocationPools = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + NewSubnet newSubnet = new NewSubnet(); + //newSubnet.AllocationPools = this.FormatAllocationPools(); + newSubnet.Cidr = this.Cidr; + newSubnet.IPversion = this.IPVersion; + newSubnet.NetworkId = this.NetworkId; + + Subnet subnet = this.RepositoryFactory.CreateSubnetRepository().SaveSubnet(newSubnet); + Console.WriteLine(""); + Console.WriteLine("New Subnet " + subnet.Id + " created."); + Console.WriteLine(""); + } +//========================================================================================= +/// +/// +/// +/// +/// +//========================================================================================= + public List FormatAllocationPools() + { + if (_allocationPools != null) + { + List allocationPools = new List(); + char[] seperator = { '|' }; + + foreach (string ap in _allocationPools) + { + string[] temp = ap.Split(seperator); + AllocationPool allocationPool = new AllocationPool(); + allocationPool.Start = temp[0]; + allocationPool.End = temp[1]; + + allocationPools.Add(allocationPool); + } + return allocationPools; + } + else + { + return null; + } + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Networking/UnAssignIPCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Networking/UnAssignIPCmdlet.cs new file mode 100644 index 0000000..d487204 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Networking/UnAssignIPCmdlet.cs @@ -0,0 +1,85 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Networking; +using System; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Client.Powershell.Providers.Security; +using Openstack.Objects.DataAccess.Networking; +using Openstack.Client.Powershell.Providers.Compute; + +namespace Openstack.Client.Powershell.Cmdlets.Compute.Security +{ + [Cmdlet("UnAssign", "IP", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class UnAssignIPCmdlet : BasePSCmdlet + { + private string _serverId; + private string _ip; + + #region Properties +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "cfgn")] + [Alias("ip")] + [ValidateNotNullOrEmpty] + public string IpAddress + { + get { return _ip; } + set { _ip = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "cfgn")] + [Alias("sid")] + [ValidateNotNullOrEmpty] + public string ServerId + { + get { return _serverId; } + set { _serverId = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + IFloatingIPRepository repository = new FloatingIPRepository(this.Context.GetRepositoryContext("compute")); + UnAssignIPAction assignment = new UnAssignIPAction(); + assignment.ServerId = this.ServerId; + assignment.Ip = this.IpAddress; + + repository.UnAssignIP(assignment); + + Console.WriteLine(""); + Console.WriteLine("Floating IP Address " + this.IpAddress + " has been disassociated with Server : " + assignment.ServerId); + Console.WriteLine(""); + this.UpdateCache(); + } + #endregion + } +} + diff --git a/Openstack.Client.Powershell/Cmdlets/Networking/UpdateFloatingIPCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Networking/UpdateFloatingIPCmdlet.cs new file mode 100644 index 0000000..f9c79ba --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Networking/UpdateFloatingIPCmdlet.cs @@ -0,0 +1,70 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Text; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Cmdlets.Networking +{ + [Cmdlet("Update", "FloatingIP", SupportsShouldProcess = true)] + //[RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class UpdateFloatingIPCmdlet : BasePSCmdlet + { + private string _portId; + private string _floatingIPId; + +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "UpdateFloatingIP", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("fid")] + public string FloatingIPId + { + get { return _floatingIPId; } + set { _floatingIPId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "UpdateFloatingIP", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("pid")] + public string PortId + { + get { return _portId; } + set { _portId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + UpdateFloatingIP updateIP = new UpdateFloatingIP(); + updateIP.PortId = this.PortId; + + this.RepositoryFactory.CreateFloatingIPRepository().UpdateFloatingIP(this.FloatingIPId, updateIP); + } + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Networking/UpdateNetworkCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Networking/UpdateNetworkCmdlet.cs new file mode 100644 index 0000000..d919366 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Networking/UpdateNetworkCmdlet.cs @@ -0,0 +1,70 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Text; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Cmdlets.Networking +{ + [Cmdlet("Update", "Network", SupportsShouldProcess = true)] + public class UpdateNetworkCmdlet : BasePSCmdlet + { + private string _name; + private string _networkId; +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "UpdateNetwork", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("id")] + public string NetworkId + { + get { return _networkId; } + set { _networkId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "UpdateNetwork", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("n")] + public string Name + { + get { return _name; } + set { _name = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + string id = this.TranslateQuickPickNumber(this.NetworkId); + UpdateNetwork updateNetwork = new UpdateNetwork(); + updateNetwork.Name = this.Name; + + this.RepositoryFactory.CreateNetworkRepository().UpdateNetwork(id, updateNetwork); + this.UpdateCache(); + } + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Networking/UpdatePortCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Networking/UpdatePortCmdlet.cs new file mode 100644 index 0000000..e4dbd63 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Networking/UpdatePortCmdlet.cs @@ -0,0 +1,73 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Text; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Cmdlets.Networking +{ + [Cmdlet("Update", "Port", SupportsShouldProcess = true)] + public class UpdatePortCmdlet : BasePSCmdlet + { + private string _deviceId; + private string _portId; + + #region Properties +//============================================================================ +/// +/// +/// +//============================================================================ + [Parameter(Position = 0, ParameterSetName = "UpdatePort", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("id")] + public string PortId + { + get { return _portId; } + set { _portId = value; } + } +//============================================================================ +/// +/// +/// +//============================================================================ + [Parameter(Position = 1, ParameterSetName = "UpdatePort", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("did")] + public string DeviceId + { + get { return _deviceId; } + set { _deviceId = value; } + } + #endregion + #region Methods +//============================================================================ +/// +/// +/// +//============================================================================ + protected override void ProcessRecord() + { + UpdatePort updatePort = new UpdatePort(); + updatePort.DeviceId = this.DeviceId; + + this.RepositoryFactory.CreatePortRepository().UpdatePort(this.PortId, updatePort); + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Networking/UpdateRouterCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Networking/UpdateRouterCmdlet.cs new file mode 100644 index 0000000..54b6518 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Networking/UpdateRouterCmdlet.cs @@ -0,0 +1,70 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Text; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Cmdlets.Networking +{ + [Cmdlet("Update", "Router", SupportsShouldProcess = true)] + public class UpdateRouterCmdlet : BasePSCmdlet + { + private string _networkId; + private string _routerId; + +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "UpdateRouter", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("id")] + public string RouterId + { + get { return _routerId; } + set { _routerId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "UpdateRouter", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("nid")] + public string NetworkId + { + get { return _networkId; } + set { _networkId = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + string id = this.TranslateQuickPickNumber(this.RouterId); + UpdateRouter updateRouter = new UpdateRouter(); + //updateRouter.ExternalGatewayInfo.NetworkId = this.NetworkId; + + this.RepositoryFactory.CreateRouterRepository().UpdateRouter(id, updateRouter); + } + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Networking/UpdateSubnetCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Networking/UpdateSubnetCmdlet.cs new file mode 100644 index 0000000..de1399d --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Networking/UpdateSubnetCmdlet.cs @@ -0,0 +1,83 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Text; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Cmdlets.Networking +{ + [Cmdlet("Update", "Subnet", SupportsShouldProcess = true)] + public class UpdateSubnetCmdlet : BasePSCmdlet + { + private string _gatewayIP; + private string _name; + private string _subnetId; + +//============================================================================ +/// +/// +/// +//============================================================================ + [Parameter(Position = 0, ParameterSetName = "UpdateSubnet", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("id")] + public string SubnetId + { + get { return _subnetId; } + set { _subnetId = value; } + } +//============================================================================ +/// +/// +/// +//============================================================================ + [Parameter(Position = 2, ParameterSetName = "UpdateSubnet", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("egw")] + public string GatewayId + { + get { return _gatewayIP; } + set { _gatewayIP = value; } + } +//============================================================================ +/// +/// +/// +//============================================================================ + [Parameter(Position = 1, ParameterSetName = "UpdateSubnet", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The Id of the Server.")] + [Alias("n")] + public string Name + { + get { return _name; } + set { _name = value; } + } +//============================================================================ +/// +/// +/// +//============================================================================ + protected override void ProcessRecord() + { + UpdateSubnet updateSubnet = new UpdateSubnet(); + updateSubnet.Name = this.Name; + updateSubnet.GatewayIP = this.GatewayId; + + this.RepositoryFactory.CreateSubnetRepository().UpdateSubnet(_subnetId, updateSubnet); + } + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/Networking/newclasses b/Openstack.Client.Powershell/Cmdlets/Networking/newclasses new file mode 100644 index 0000000..dbafcf2 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Networking/newclasses @@ -0,0 +1,31 @@ + Volume in drive C has no label. + Volume Serial Number is EE3F-CECC + + Directory of C:\Projects\HPCloud\CLI\HPCloud.Client.Powershell\Cmdlets\Networking + +08/23/2013 02:45 PM . +08/23/2013 02:45 PM .. +07/19/2013 04:04 PM 1,386 AllocateIPCmdlet.cs +07/30/2013 08:06 PM 4,351 AssignIPCmdlet.cs +07/19/2013 04:04 PM 2,484 DeallocateIPCmdlet.cs +07/30/2013 08:06 PM 4,871 DeleteFloatingIPCmdlet.cs +08/13/2013 11:01 AM 6,478 DeleteNetworkCmdlet.cs +07/30/2013 08:06 PM 4,771 DeletePortCmdlet.cs +07/30/2013 08:06 PM 4,786 DeleteRouterCmdlet.cs +07/30/2013 08:06 PM 3,491 DeleteRouterInterfaceCmdlet.cs +07/30/2013 08:06 PM 4,745 DeleteSubnetCmdlet.cs +08/23/2013 02:45 PM 0 newclasses +07/30/2013 08:06 PM 3,607 NewFloatingIPCmdlet.cs +07/30/2013 08:06 PM 5,864 NewNetworkCmdlet.cs +07/30/2013 08:06 PM 4,717 NewPortCmdlet.cs +08/10/2013 07:02 PM 4,297 NewRouterCmdlet.cs +07/30/2013 08:06 PM 4,797 NewRouterInterfaceCmdlet.cs +07/30/2013 08:06 PM 6,609 NewSubnetCmdlet.cs +07/30/2013 08:06 PM 4,043 UnAssignIPCmdlet.cs +07/30/2013 08:06 PM 3,507 UpdateFloatingIPCmdlet.cs +07/30/2013 08:06 PM 3,486 UpdateNetworkCmdlet.cs +07/30/2013 08:06 PM 3,370 UpdatePortCmdlet.cs +07/30/2013 08:06 PM 3,512 UpdateRouterCmdlet.cs +07/30/2013 08:06 PM 3,879 UpdateSubnetCmdlet.cs + 22 File(s) 89,051 bytes + 2 Dir(s) 6,555,230,208 bytes free diff --git a/Openstack.Client.Powershell/Cmdlets/ObjectStorage/CDN/GetCDNCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/ObjectStorage/CDN/GetCDNCmdlet.cs new file mode 100644 index 0000000..dc9f3e9 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/ObjectStorage/CDN/GetCDNCmdlet.cs @@ -0,0 +1,54 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Openstack.Client.Powershell.Cmdlets.Common; +using System.Management.Automation; +using Openstack.Objects.Domain; +using Openstack.Client.Powershell.Providers.Common; + +namespace Openstack.Client.Powershell.Cmdlets.Storage.CDN +{ + [Cmdlet(VerbsCommon.Get, "CDN", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.CDN)] + public class GetCDNCmdlet : BasePSCmdlet + { +//========================================================================================= +/// +/// The main driver.. +/// +//========================================================================================= + protected override void ProcessRecord() + { + List containers = this.RepositoryFactory.CreateCDNRepository().GetContainers(); + + Console.WriteLine(""); + Console.ForegroundColor = ConsoleColor.DarkGray; + Console.WriteLine("=============================================================================================="); + Console.ForegroundColor = ConsoleColor.Yellow; + Console.WriteLine("The following Storage Containers are CDN enabled"); + Console.ForegroundColor = ConsoleColor.DarkGray; + Console.WriteLine("=============================================================================================="); + Console.ForegroundColor = ConsoleColor.Green; + Console.WriteLine(""); + + + this.WriteObject(containers); + } + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/ObjectStorage/CDN/NewCDNCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/ObjectStorage/CDN/NewCDNCmdlet.cs new file mode 100644 index 0000000..aa02390 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/ObjectStorage/CDN/NewCDNCmdlet.cs @@ -0,0 +1,89 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Management.Automation; +using Openstack.Objects.DataAccess; +using Openstack.Objects.Domain; +using System.IO; +using Openstack.Client.Powershell.Providers.Storage; +using System.Diagnostics; +using Openstack.Common; +using System.Diagnostics.Contracts; +using System.Collections; +using System.Linq; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Client.Powershell.Providers.Common; + +namespace Openstack.Client.Powershell.Cmdlets.Storage.CDN +{ + [Cmdlet(VerbsCommon.New, "CDN", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.CDN)] + public class NewCDNCmdlet : BasePSCmdlet + { + private string _containerName; +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, Mandatory = true, ParameterSetName = "EnableCDN", ValueFromPipelineByPropertyName = true, HelpMessage = "The Name of the Container to enable for CDN access.")] + [Alias("n")] + [ValidateNotNullOrEmpty] + public string ContainerName + { + get { return _containerName; } + set { _containerName = value; } + } +//========================================================================================= +/// +/// The main driver.. +/// +//========================================================================================= + protected override void ProcessRecord() + { + List containers = this.RepositoryFactory.CreateContainerRepository().GetStorageContainers(); + if (!containers.Any(c => c.Name == this.ContainerName)) + { + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine(""); + Console.WriteLine ("Storage Container not found. Please specify an existing Storage Container name to pair with this CDN entry."); + Console.WriteLine(""); + Console.ForegroundColor = ConsoleColor.Green; + } + else + { + string url = this.RepositoryFactory.CreateCDNRepository().SaveContainer(this.ContainerName); + if (url != null) + { + Console.WriteLine(""); + Console.ForegroundColor = ConsoleColor.DarkGray; + Console.WriteLine("================================================================================================================"); + Console.ForegroundColor = ConsoleColor.Yellow; + Console.WriteLine("CDN entry created successfully. The URL below can be combined with object names to serve objects through the CDN."); + Console.ForegroundColor = ConsoleColor.DarkGray; + Console.WriteLine("================================================================================================================"); + Console.ForegroundColor = ConsoleColor.Green; + Console.WriteLine(""); + Console.WriteLine(url); + Console.WriteLine(""); + } + } + } + } +} + + \ No newline at end of file diff --git a/Openstack.Client.Powershell/Cmdlets/ObjectStorage/CDN/RemoveCDNCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/ObjectStorage/CDN/RemoveCDNCmdlet.cs new file mode 100644 index 0000000..8756128 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/ObjectStorage/CDN/RemoveCDNCmdlet.cs @@ -0,0 +1,62 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Management.Automation; +using Openstack.Objects.DataAccess; +using Openstack.Objects.Domain; +using System.IO; +using Openstack.Client.Powershell.Providers.Storage; +using System.Diagnostics; +using Openstack.Common; +using System.Diagnostics.Contracts; +using System.Collections; +using System.Linq; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Client.Powershell.Providers.Common; + +namespace Openstack.Client.Powershell.Cmdlets.Storage.CDN +{ + [Cmdlet(VerbsCommon.Remove, "CDN", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.CDN)] + public class RemoveCDNCmdlet : BasePSCmdlet + { + private string _containerName; +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Mandatory = true, ParameterSetName = "EnableCDN", ValueFromPipelineByPropertyName = true, HelpMessage = "The Name of the Container to enable for CDN access.")] + [Alias("n")] + [ValidateNotNullOrEmpty] + public string ContainerName + { + get { return _containerName; } + set { _containerName = value; } + } +//========================================================================================= +/// +/// The main driver.. +/// +//========================================================================================= + protected override void ProcessRecord() + { + this.RepositoryFactory.CreateCDNRepository().DeleteContainer(this.ContainerName); + } + } +} + diff --git a/Openstack.Client.Powershell/Cmdlets/ObjectStorage/Containers/MigrateDriveCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/ObjectStorage/Containers/MigrateDriveCmdlet.cs new file mode 100644 index 0000000..4a3e6be --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/ObjectStorage/Containers/MigrateDriveCmdlet.cs @@ -0,0 +1,265 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.DataAccess.Storage; +using Openstack.Migrations; +using System; +using Openstack.Client.Powershell.Providers.Storage; +using Openstack.Client.Powershell.Providers.Common; + +namespace Openstack.Client.Powershell.Cmdlets.Containers +{ + [Cmdlet("Migrate", "Drive", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.ObjectStorage)] + public class MigrateDriveCmdlet : BasePSCmdlet + { + private string _accessKeyID; + private string _secretAccessKeyID; + private long _bytesCopied = 0; + private int _filesCopied = 0; + private long _totalBytesCopied = 0; + private int _totalFilesCopied = 0; + private string[] _buckets; + private string _provider; + + #region Parameters + +//========================================================================================= +/// +/// The location of the file to set permissions on. +/// +//========================================================================================= + [Parameter(ParameterSetName = "localStore", Position = 0, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = " ")] + [ValidateSet("Skydrive", "Dropbox", "S3")] + [Alias("p")] + [ValidateNotNullOrEmpty] + public string Provider + { + get { return _provider; } + set { _provider = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 3, Mandatory = false, ParameterSetName = "localStore", ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("ak")] + [ValidateNotNullOrEmpty] + public string AccessKeyId + { + get { return _accessKeyID; } + set { _accessKeyID = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 2, ParameterSetName = "localStore", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("sk")] + [ValidateNotNullOrEmpty] + public string SecretAccessKeyId + { + get { return _secretAccessKeyID; } + set { _secretAccessKeyID = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, Mandatory = false, ParameterSetName = "localStore", ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("b")] + [ValidateNotNullOrEmpty] + public string[] Buckets + { + get { return _buckets; } + set { _buckets = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void PrintTotals() + { + Console.ForegroundColor = ConsoleColor.Gray; + Console.WriteLine(""); + Console.WriteLine("--------------------------------------"); + Console.ForegroundColor = ConsoleColor.Yellow; + Console.WriteLine("Operation Summary"); + Console.ForegroundColor = ConsoleColor.Gray; + Console.WriteLine("--------------------------------------"); + Console.WriteLine(""); + Console.ForegroundColor = ConsoleColor.Yellow; + Console.WriteLine("Total Files Copied : " + Convert.ToString(_totalFilesCopied)); + Console.WriteLine("Total Bytes Copied : " + Convert.ToString(_totalBytesCopied)); + Console.WriteLine(""); + Console.ForegroundColor = ConsoleColor.Green; + + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void MigrateS3Drive() + { + //AWSMigration migration = new AWSMigration("AKIAJ6SAONGOGCUKSONA", "0Hi00F7zlFwGi8a45qRhGfW2Btf+FAioZhfD+99K"); + AWSMigration migration = new AWSMigration(_accessKeyID, _secretAccessKeyID); + if (_buckets == null) _buckets = migration.GetBuckets(); + + migration.Changed += new Openstack.Migrations.AWSMigration.CopyOperationEventHandler(ListChanged); + migration.ContainerCreated += new Openstack.Migrations.AWSMigration.CreateContainerOperationEventHandler(OnCreateContainer); + + Console.WriteLine(""); + foreach (string bucketName in _buckets) + { + _bytesCopied = 0; + _filesCopied = 0; + + Console.ForegroundColor = ConsoleColor.Gray; + Console.WriteLine(""); + Console.WriteLine("--------------------------------------"); + Console.ForegroundColor = ConsoleColor.Yellow; + Console.WriteLine("Processing Bucket : " + bucketName); + Console.ForegroundColor = ConsoleColor.Gray; + Console.WriteLine("--------------------------------------"); + Console.WriteLine(""); + Console.ForegroundColor = ConsoleColor.Green; + migration.MigrateBucket(bucketName); + Console.WriteLine(""); + Console.ForegroundColor = ConsoleColor.Yellow; + Console.WriteLine("Files Copied : " + Convert.ToString(_filesCopied)); + Console.WriteLine("Bytes Copied : " + Convert.ToString(_bytesCopied)); + Console.ForegroundColor = ConsoleColor.Green; + Console.WriteLine(""); + } + + this.PrintTotals(); + migration.Changed -= new Openstack.Migrations.AWSMigration.CopyOperationEventHandler(ListChanged); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void MigrateLocalDrive() + { + LocalStoreMigration migration = new LocalStoreMigration(); + + migration.Changed += new Openstack.Migrations.LocalStoreMigration.CopyOperationEventHandler(ListChanged); + Console.WriteLine(""); + + _bytesCopied = 0; + _filesCopied = 0; + + Console.ForegroundColor = ConsoleColor.Gray; + Console.WriteLine(""); + Console.WriteLine("--------------------------------------"); + Console.ForegroundColor = ConsoleColor.Yellow; + Console.WriteLine("Migrating local " + _provider + " store."); + Console.ForegroundColor = ConsoleColor.Gray; + Console.WriteLine("--------------------------------------"); + Console.WriteLine(""); + Console.ForegroundColor = ConsoleColor.Green; + + if (_provider == "Dropbox") + migration.MigrateLocalStore(StorageProvider.DropBox); + else + migration.MigrateLocalStore(StorageProvider.SkyDrive); + + this.PrintTotals(); + migration.Changed -= new Openstack.Migrations.LocalStoreMigration.CopyOperationEventHandler(ListChanged); + } +//========================================================================================= +/// +/// +/// +/// +/// +//========================================================================================= + private void OnCreateContainer(object sender, CreateContainerOperationInfoEventArgs e) + { + PSDriveInfo psDriveInfo = new PSDriveInfo(e.ContainerName, this.Drive.Provider, "/", "", null); + OSDriveParameters driveParameters = new OSDriveParameters(); + driveParameters.Settings = this.Settings; + try + { + this.SessionState.Drive.New(new OSDriveInfo(psDriveInfo, driveParameters, this.Context), "local"); + } + catch (SessionStateException ex) { } + } +//========================================================================================= +/// +/// +/// +/// +/// +//========================================================================================= + private void ListChanged(object sender, CopyOperationInfoEventArgs e) + { + if (e.ExceptionMessage == null) + { + if (e.Filename != null || e.Filename != string.Empty) + { + Console.WriteLine("Copying file " + e.Filename); + _bytesCopied = _bytesCopied + e.BytesCopied; + ++_filesCopied; + _totalBytesCopied = _totalBytesCopied + e.BytesCopied; + ++_totalFilesCopied; + } + } + else + { + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine("Error : " + e.ExceptionMessage); + Console.ForegroundColor = ConsoleColor.Green; + } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + if (_provider == "S3") + { + if (_accessKeyID == null || _secretAccessKeyID == null) + { + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine("Please supply both Secret key and Access key parameters to migrate your S3 Buckets."); + Console.ForegroundColor = ConsoleColor.Green; + this.MigrateS3Drive(); + } + else + { + this.MigrateS3Drive(); + } + } + else + { + this.MigrateLocalDrive(); + } + } + #endregion + } + } diff --git a/Openstack.Client.Powershell/Cmdlets/ObjectStorage/Containers/NewContainerCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/ObjectStorage/Containers/NewContainerCmdlet.cs new file mode 100644 index 0000000..28d46a3 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/ObjectStorage/Containers/NewContainerCmdlet.cs @@ -0,0 +1,306 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Objects.DataAccess; +using Openstack.Objects.Domain; +using Openstack.Client.Powershell.Providers.Storage; +using System.Collections.ObjectModel; +using System.Management.Automation.Host; +using Openstack.Client.Powershell.Cmdlets.Common; +using System; +using Openstack.Client.Powershell.Providers.Common; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Sockets; +using System.Xml.Linq; +using System.IO; + +namespace Openstack.Client.Powershell.Cmdlets.Containers +{ + [Cmdlet(VerbsCommon.New, "Container", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.ObjectStorage)] + public class NewContainerCmdlet : BasePSCmdlet + { + private string _name; + private string _sharedContainerURL = null; + private bool _forceSave = false; + private bool _createCDN = false; + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "SaveSharedStorageContainer", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("url")] + [ValidateNotNullOrEmpty] + public string SharedContainerURL + { + get { return _sharedContainerURL; } + set { _sharedContainerURL = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "SavestorageContainer", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("n")] + [ValidateNotNullOrEmpty] + public string Name + { + get { return _name; } + set { _name = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(ParameterSetName = "SavestorageContainer", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("cdn")] + [ValidateNotNullOrEmpty] + public SwitchParameter CreateCDN + { + get { return _createCDN; } + set { _createCDN = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, ParameterSetName = "SavestorageContainer", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("f")] + [ValidateNotNullOrEmpty] + public SwitchParameter Force + { + get { return _forceSave; } + set { _forceSave = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void CreateStorageContainer(StorageContainer storageContainer) + { + IContainerRepository repository = this.RepositoryFactory.CreateContainerRepository(); + bool skipAdd = false; + + // These should be transacted somehow.. + + repository.SaveContainer(storageContainer); + + Collection drives = this.SessionState.Drive.GetAllForProvider("OS-Storage"); + foreach (PSDriveInfo drive in drives) + { + if (drive.Name == storageContainer.Name) + { + skipAdd = true; + } + } + if (!skipAdd) + { + PSDriveInfo psDriveInfo = new PSDriveInfo(storageContainer.Name, this.GetStorageProvider(drives), "/", "", null); + OSDriveParameters driveParameters = new OSDriveParameters(); + driveParameters.Settings = this.Settings; + + this.SessionState.Drive.New(new OSDriveInfo(psDriveInfo, driveParameters, this.Context), "local"); + } + + this.WriteObject(" "); + this.WriteObject("Storage Container " + _name + " created successfully."); + this.WriteObject(" "); + } +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + private bool IsDuplicateContainer(string container) + { + List containers = this.RepositoryFactory.CreateContainerRepository().GetStorageContainers(); + return containers.Where(cn => cn.Name == container).Any(); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void SaveNewContainer() + { + StorageContainer storageContainer = new StorageContainer(); + storageContainer.Name = _name; + + if (IsDuplicateContainer(this.Name)) + { + this.WriteObject(" "); + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + Console.WriteLine("Storage Container " + _name + " already exist."); + Console.WriteLine(""); + return; + } + + if (storageContainer.ValidateBasicRequirements() == false) + { + this.WriteObject(" "); + this.WriteObject("Storage Container " + _name + " has failed basic validation rules. Please ensure that the name doesn't include a forward slash, single or double quote character and is less than 255 characters in length."); + return; + } + else if (storageContainer.ValidateExtendedRequirements() == false) + { + + // Check to see if the Container already exist.. Or not maybe it does z + + if (_forceSave) + { + this.CreateStorageContainer(storageContainer); + if (_createCDN) + { + this.RepositoryFactory.CreateCDNRepository().SaveContainer(_name); + } + } + else + { + Collection choices = new Collection(); + choices.Add(new ChoiceDescription("Y", "Yes")); + choices.Add(new ChoiceDescription("N", "No")); + + if (this.Host.UI.PromptForChoice("Confirm Action", "Specified Storage Container name is not a valid virtalhost name, continue anyway?", choices, 0) == 0) + { + this.CreateStorageContainer(storageContainer); + if (_createCDN) + { + this.RepositoryFactory.CreateCDNRepository().SaveContainer(_name); + } + } + } + } + else + { + this.CreateStorageContainer(storageContainer); + if (_createCDN) + { + this.RepositoryFactory.CreateCDNRepository().SaveContainer(_name); + } + + } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void CreateSharedDrive(string drivePath) + { + string driveName = Path.GetFileName(drivePath); + Collection drives = this.SessionState.Drive.GetAllForProvider("OS-Storage"); + PSDriveInfo psDriveInfo = new PSDriveInfo(driveName, this.GetStorageProvider(drives), "/", "", null); + OSDriveParameters driveParameters = new OSDriveParameters(); + driveParameters.Settings = this.Settings; + OSDriveInfo newDrive = new OSDriveInfo(psDriveInfo, driveParameters, this.Context); + newDrive.SharePath = drivePath; + + this.SessionState.Drive.New(newDrive, "local"); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void SaveSharedContainer() + { + if (this.IsUrlValid(this.SharedContainerURL)) + { + string configFilePath = this.ConfigFilePath; + XDocument doc = XDocument.Load(configFilePath); + XElement newDrive = new XElement("SharedContainer"); + newDrive.Add(new XAttribute("url", this.SharedContainerURL)); + + doc.Element("configuration").Element("appSettings").Element("StorageManagement").Element("SharedContainers").Add(newDrive); + doc.Save(configFilePath); + this.CreateSharedDrive(this.SharedContainerURL); + } + else + { + Console.WriteLine("Invalid URL supplied"); + } + } +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + private ProviderInfo GetStorageProvider(Collection drives) + { + foreach (PSDriveInfo drive in drives) + { + if (drive.Provider.Name == "OS-Storage") + { + return drive.Provider; + } + } + return null; + } +//========================================================================================= +/// +/// +/// +/// +/// +//========================================================================================= + private bool IsUrlValid(string smtpHost) + { + return true; + bool br = false; + try + { + IPHostEntry ipHost = Dns.GetHostEntry(smtpHost); + br = true; + } + catch (SocketException se) + { + br = false; + } + return br; + } +//========================================================================================= +/// +/// qqqqqqqqqqq +/// +//========================================================================================= + protected override void ProcessRecord() + { + if (_sharedContainerURL != null) + { + this.SaveSharedContainer(); + } + else + { + this.SaveNewContainer(); + } + } + #endregion + } +} + diff --git a/Openstack.Client.Powershell/Cmdlets/ObjectStorage/Containers/RemoveContainerCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/ObjectStorage/Containers/RemoveContainerCmdlet.cs new file mode 100644 index 0000000..1a2e78d --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/ObjectStorage/Containers/RemoveContainerCmdlet.cs @@ -0,0 +1,274 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Management.Automation; +using Openstack.Objects.DataAccess; +using Openstack.Objects.Domain; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.DataAccess; +using System.Collections.ObjectModel; +using System.Management.Automation.Host; +using Openstack.Common.Properties; +using Openstack.Client.Powershell.Providers.Common; +using System.Xml.Linq; +using System.Xml.XPath; + +namespace Openstack.Client.Powershell.Cmdlets.Containers +{ + [Cmdlet(VerbsCommon.Remove, "Container", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.ObjectStorage)] + public class RemoveContainerCmdlet : BasePSCmdlet + { + private string _name; + private SwitchParameter _forceDelete = false; + private SwitchParameter _reset = false; + private bool _removeCDN = false; + + #region Properties +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(ParameterSetName = "RemoveContainer", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("cdn")] + [ValidateNotNullOrEmpty] + public SwitchParameter RemoveCDN + { + get { return _removeCDN; } + set { _removeCDN = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "RemoveContainer", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] + [Alias("n")] + [ValidateNotNullOrEmpty] + public string Name + { + get { return _name; } + set { _name = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, Mandatory = false, ParameterSetName = "RemoveContainer", ValueFromPipelineByPropertyName = true, HelpMessage = "s")] + [Alias("fd")] + [ValidateNotNullOrEmpty] + public SwitchParameter ForceDelete + { + get { return _forceDelete; } + set { _forceDelete = value; } + } + #endregion + #region Methods +//====================================================================================================================== +/// +/// +/// +/// Name of the Container to trash +//====================================================================================================================== + private bool DeleteContainerContents(StorageContainer storageContainer) + { + List containerItems = null; + IStorageObjectRepository repository = this.RepositoryFactory.CreateStorageObjectRepository(); + + try + { + containerItems = repository.GetStorageObjects(storageContainer.Name, true); + } + catch (Exception ex) + { + return false; + } + + // Define our Action delegate which will delete the element in the list.. + + if (containerItems != null) + { + Action deleteStorageObjectAction = delegate(StorageObject storageObject) + { + StoragePath targetPath = this.CreateStoragePath(storageObject.Key); + repository.DeleteStorageObject(targetPath.AbsoluteURI); + }; + + // Remove all Files contained within the storageContainer... + + if (containerItems != null) + { + containerItems.ForEach(deleteStorageObjectAction); + return true; + } + } + return true; + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void DeleteAllContainers() + { + IContainerRepository repository = this.RepositoryFactory.CreateContainerRepository(); + List containers = repository.GetStorageContainers(); + + foreach (StorageContainer container in containers) + { + try + { + // repository.DeleteContainer(container); + } + catch (Exception) { } + } + } +//====================================================================================================================== +/// +/// +/// +/// +/// +//====================================================================================================================== + private string GetContainerName(string url) + { + string[] elements = url.Split('/'); + return elements[elements.Length - 1]; + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private bool RemoveSharedContainer() + { + bool entryRemoved = false; + List results = new List(); + string configFilePath = this.ConfigFilePath; + XDocument doc = XDocument.Load(configFilePath); + IEnumerable containers = doc.XPathSelectElements("//SharedContainer"); + + foreach (XElement element in containers) + { + string sharedPath = (string)element.Attribute("url"); + if (this.GetContainerName(sharedPath) == this.Name) + { + element.Remove(); + entryRemoved = true; + } + } + doc.Save(configFilePath); + this.SessionState.Drive.Remove(this.Name, true, "local"); + if (this.Name == this.SessionState.Drive.Current.Name) + this.SessionState.InvokeCommand.InvokeScript("cd c:"); + + return entryRemoved; + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + if (RemoveSharedContainer() == true) return; + + Collection choices = new Collection(); + choices.Add(new ChoiceDescription("Y", "Yes")); + choices.Add(new ChoiceDescription("N", "No")); + + if (_forceDelete == false) + { + if (this.Host.UI.PromptForChoice("Confirm Action", "You are about to delete an entire Container. Are you sure about this?", choices, 0) == 0) + { + IContainerRepository repository = this.RepositoryFactory.CreateContainerRepository(); + StorageContainer storageContainer = new StorageContainer(); + storageContainer.Name = _name; + + try + { + repository.DeleteContainer(storageContainer); + if (_removeCDN) + { + this.RepositoryFactory.CreateCDNRepository().DeleteContainer(_name); + } + } + catch (Exception ex) + { + // The container has content and the operation is in conflict. Destroy all contents then retry (the User knows what's up). + + if (ex.Message == "Unknown Repository Error") + { + if (DeleteContainerContents(storageContainer)) + { + repository.DeleteContainer(storageContainer); + if (_removeCDN) + { + this.RepositoryFactory.CreateCDNRepository().DeleteContainer(_name); + } + } + } + } + try + { + this.SessionState.Drive.Remove(storageContainer.Name, true, "local"); + if (storageContainer.Name == this.SessionState.Drive.Current.Name) + this.SessionState.InvokeCommand.InvokeScript("cd c:"); + } + catch (DriveNotFoundException ex) { } + } + else + { + return; + } + } + else + { + IContainerRepository repository = this.RepositoryFactory.CreateContainerRepository(); + StorageContainer storageContainer = new StorageContainer(); + storageContainer.Name = _name; + + try + { + repository.DeleteContainer(storageContainer); + } + catch (Exception ex) + { + // The container has content and the operation is in conflict. Destroy all contents then retry (the User knows what's up). + + if (ex.Message == "Unknown Repository Error") + { + if (DeleteContainerContents(storageContainer)) + { + repository.DeleteContainer(storageContainer); + if (_removeCDN) + { + this.RepositoryFactory.CreateCDNRepository().DeleteContainer(_name); + } + } + } + + } + } + #endregion + } + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/ObjectStorage/Containers/SetScopeCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/ObjectStorage/Containers/SetScopeCmdlet.cs new file mode 100644 index 0000000..7ddc553 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/ObjectStorage/Containers/SetScopeCmdlet.cs @@ -0,0 +1,191 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Management.Automation; +using Openstack.Objects.DataAccess; +using Openstack.Objects.DataAccess; +using Openstack.Objects.Domain; +using System.IO; +using Openstack.Client.Powershell.Providers.Storage; +using Openstack.Common; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Storage; +using System.Collections.Generic; + +namespace Openstack.Client.Powershell.Cmdlets.Containers +{ + [Cmdlet(VerbsCommon.Set, "Scope", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.ObjectStorage)] + public class SetScopeCmdlet : BasePSCmdlet + { + private string _containerName; + private ContainerScope _scope; + private string _permission; + private string[] _users; + + #region Parameters +//========================================================================================= +/// +/// The Container name. +/// +//========================================================================================= + [Parameter(ParameterSetName = "scp1", Position = 0, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = @"The Container name.")] + [Alias("cn")] + [ValidateNotNullOrEmpty] + public string ContainerName + { + get { return _containerName; } + set { _containerName = value; } + } +//========================================================================================= +/// +/// The Container name. +/// +//========================================================================================= + [Parameter(ParameterSetName = "scp2", Position = 0, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = @"The Container name.")] + [Alias("c")] + [ValidateNotNullOrEmpty] + public string Name + { + get { return _containerName; } + set { _containerName = value; } + } +//========================================================================================= +/// +/// The location of the file to set permissions on. +/// +//========================================================================================= + [Parameter(ParameterSetName = "scp2", Position = 1, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The Containers Scope.")] + [ValidateSet("Public", "Private")] + [Alias("s")] + [ValidateNotNullOrEmpty] + public ContainerScope Scope + { + get { return _scope; } + set { _scope = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(ParameterSetName = "scp1", Position = 2, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "c")] + [Alias("u")] + [ValidateNotNullOrEmpty] + public string[] Users + { + get { return _users; } + set { _users = value; } + } +//========================================================================================= +/// +/// The location of the file to set permissions on. +/// +//========================================================================================= + [Parameter(ParameterSetName = "scp1", Position = 1, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "v")] + [ValidateSet("Read", "Write", "ReadWrite")] + [Alias("p")] + [ValidateNotNullOrEmpty] + public string Permission + { + get { return _permission; } + set { _permission = value; } + } + #endregion + #region Methods +//======================================================================================== +/// +/// +/// +/// +/// +//======================================================================================== + private ContainerPermissions GetPermission(string permission) + { + switch (permission) + { + case ("Read") : + return ContainerPermissions.PublicRead; + + case ("ReadWrite"): + return ContainerPermissions.PublicReadWrite; + + case ("Write"): + return ContainerPermissions.PublicWrite; + + default : + return ContainerPermissions.PublicRead; + } + } +//======================================================================================== +/// +/// +/// +/// +/// +//======================================================================================== + private List GetUsers(string[] users) + { + List userList = new List(); + foreach (string user in users) { + userList.Add("*:" + user); + } + return userList; + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void ShowUrl() + { + StoragePath path = this.CreateStoragePath(String.Empty); + path.Volume = _containerName; + string uri = path.AbsoluteURI.Remove(path.AbsoluteURI.LastIndexOf('/')); + + if (this.Settings.PasteGetURIResultsToClipboard) + OutClipboard.SetText(uri); + + WriteObject(""); + WriteObject("Shared Container located at : " + uri); + WriteObject(""); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + IContainerRepository repository = this.RepositoryFactory.CreateContainerRepository(); + + if (this.ParameterSetName == "scp2") + { + repository.SetScope(_containerName, _scope); + } + else + { + ContainerACL acl = new ContainerACL(); + acl.Permission = this.GetPermission(_permission); + acl.Users = this.GetUsers(_users); + repository.SetScope(_containerName, acl); + this.ShowUrl(); + } + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/Cmdlets/ObjectStorage/Objects/CopyItemCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/ObjectStorage/Objects/CopyItemCmdlet.cs new file mode 100644 index 0000000..13bbd70 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/ObjectStorage/Objects/CopyItemCmdlet.cs @@ -0,0 +1,260 @@ +///* ============================================================================ +//Copyright 2014 Hewlett Packard + +//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. +//============================================================================ */ +//using System.Management.Automation; +//using Openstack.Objects; +//using Openstack.Objects.Domain; +//using Openstack.Client.Powershell.Providers.Storage; +//using System; +//using Openstack.Objects.DataAccess.Storage; +//using Openstack.Client.Powershell.Providers.Common; +//using System.IO; + +//namespace Openstack.Client.Powershell.Cmdlets.Common +//{ +// [Cmdlet(VerbsCommon.Copy, "Item", SupportsShouldProcess = true)] +// [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.ObjectStorage)] +// public class CopyItemCmdlet : BasePSCmdlet +// { +// public const string cDelimiter = "/"; +// const string cFolderMarker = "folder.txt"; +// private string _sourcePath; +// private string _targetPath; +// private SwitchParameter _recursive; +// private long _bytesCopied = 0; +// private int _filesCopied = 0; +// private long _totalBytesCopied = 0; +// private int _totalFilesCopied = 0; + +// #region Ctors +////========================================================================================= +///// +///// +///// +////========================================================================================= +// public CopyItemCmdlet() +// { } +// #endregion +// #region Parameters +////========================================================================================= +///// +///// +///// +////========================================================================================= +// [Parameter(Mandatory = false, ParameterSetName = "aa", ValueFromPipelineByPropertyName = true, HelpMessage = "oih")] +// [Alias("recurse")] +// [ValidateNotNullOrEmpty] +// public SwitchParameter Recursive +// { +// get { return _recursive; } +// set { _recursive = value; } +// } +////========================================================================================= +///// +///// The location of the file to copy. +///// +////========================================================================================= +// [Parameter(Position = 1, Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = "aa", ValueFromPipeline = true, HelpMessage = "Help Text")] +// [ValidateNotNullOrEmpty] +// public string SourcePath +// { +// get { return _sourcePath; } +// set { _sourcePath = value; } +// } +////========================================================================================= +///// +///// The destination of the file to copy. +///// +////========================================================================================= +// [Parameter(Position = 2, Mandatory = false, ValueFromPipeline = true, ParameterSetName = "aa", ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] +// [ValidateNotNullOrEmpty] +// public string TargetPath +// { +// get { return _targetPath; } +// set +// { +// if (value.StartsWith(@"/") || value.StartsWith(@"\")) +// { +// _targetPath = value.Substring(1, _targetPath.Length - 1); +// } +// else +// { +// _targetPath = value; +// } +// } +// } +// #endregion +// #region Properties +////================================================================================================== +///// +///// +///// +////================================================================================================== +// private string StorageServiceURL +// { +// get +// { +// if (((OSDriveInfo)this.Drive).SharePath == null) +// return this.Context.ServiceCatalog.GetService("object-store").Url; +// else +// //return ((OSDriveInfo)this.Drive).SharePath; +// return ((OSDriveInfo)this.Drive).SharePath.Replace(this.Drive.Name, string.Empty); +// } +// } +// #endregion +// #region Methods +////========================================================================================= +///// +///// +///// +////========================================================================================= +// private void PrintTotals() +// { +// Console.ForegroundColor = ConsoleColor.Gray; +// Console.WriteLine(""); +// Console.WriteLine("--------------------------------------"); +// Console.ForegroundColor = ConsoleColor.Yellow; +// Console.WriteLine("Operation Summary"); +// Console.ForegroundColor = ConsoleColor.Gray; +// Console.WriteLine("--------------------------------------"); +// Console.WriteLine(""); +// Console.ForegroundColor = ConsoleColor.Yellow; +// Console.WriteLine("Total Files Copied : " + Convert.ToString(_totalFilesCopied)); +// Console.WriteLine("Total Bytes Copied : " + Convert.ToString(_totalBytesCopied)); +// Console.WriteLine(""); +// Console.ForegroundColor = ConsoleColor.Green; + +// } +////================================================================================================= +///// +///// +///// +///// +///// +////================================================================================================= +// private bool IsFolderPath(string path) +// { +// if (path.EndsWith(@"\") || path.EndsWith("/")) +// { +// return true; +// } +// else +// { +// return false; +// } +// } +////================================================================================================= +///// +///// +///// +///// +///// +///// +////================================================================================================= +// private StoragePath CreateValidTargetPath(StoragePath sourcePath, string targetPath) +// { +// if (targetPath == null && sourcePath != null) +// { +// // The user has supplied a source but no target at all (we should use the current folder) + +// return new StoragePath(this.StorageServiceURL + cDelimiter + this.Drive.Name + cDelimiter + this.Drive.CurrentLocation + cDelimiter + sourcePath.FileName); +// } +// else if (System.IO.Path.GetFileName(targetPath) == "" && this.IsFolderPath(targetPath) == true) +// { +// // The user supplied a target path but no filename (we will use the Source filename) + +// return this.CreateStoragePath(targetPath + sourcePath.FileName); +// } +// else +// { +// // The user has supplied a target path and target filename so create the StoragePath against that... + +// return this.CreateStoragePath(targetPath); +// } +// } +////========================================================================================= +///// +///// +///// +///// +///// +////========================================================================================= +// private void ListChanged(object sender, CopyOperationInfoEventArgs e) +// { +// if (e.ExceptionMessage == null) +// { +// if (e.Filename != null || e.Filename != string.Empty) +// { +// Console.WriteLine("Copying file " + e.Filename); +// _bytesCopied = _bytesCopied + e.BytesCopied; +// ++_filesCopied; +// _totalBytesCopied = _totalBytesCopied + e.BytesCopied; +// ++_totalFilesCopied; +// } +// } +// else +// { +// Console.ForegroundColor = ConsoleColor.Red; +// Console.WriteLine("Error : " + e.ExceptionMessage); +// Console.ForegroundColor = ConsoleColor.Green; +// } +// } +////================================================================================================= +///// +///// Direct the operation based on the types of paths supplied for both target and source locations. +///// +////================================================================================================= +// private void ProcessNonQueuedCopy() +// { +// StoragePath sourcePath = this.CreateStoragePath(this.SourcePath); +// StoragePath targetPath = this.CreateValidTargetPath(sourcePath, this.TargetPath); +// IStorageObjectRepository repository = this.RepositoryFactory.CreateStorageObjectRepository(); + + +// if (sourcePath.PathType == Openstack.Common.PathType.Local && targetPath.PathType == Openstack.Common.PathType.Remote) +// { +// long lastSegment = repository.GetLastSegmentId(targetPath); +// if (lastSegment != 0) +// { +// Console.WriteLine(""); +// Console.WriteLine(" You've already uploaded a portion of this file."); +// Console.WriteLine(" Would you like to resume your previous upload? [Y/N]"); +// ConsoleKeyInfo response = Console.ReadKey(); +// if (response.Key != ConsoleKey.Y) +// { +// repository.DeleteStorageObject(targetPath.AbsoluteURI + @"_temp\"); +// } +// } +// } + +// ((StorageObjectRepository)repository).Changed += new StorageObjectRepository.CopyOperationCompleteEventHandler(ListChanged); +// Console.WriteLine(""); +// repository.Copy(sourcePath.AbsoluteURI, targetPath.AbsoluteURI, true); +// this.PrintTotals(); +// ((StorageObjectRepository)repository).Changed -= new StorageObjectRepository.CopyOperationCompleteEventHandler(ListChanged); +// } +////========================================================================================= +///// +///// The main driver.. +///// +////========================================================================================= +// protected override void ProcessRecord() +// { +// OSDriveInfo drive = this.SessionState.Drive.Current as OSDriveInfo; +// this.ProcessNonQueuedCopy(); +// } +// #endregion +// } +//} diff --git a/Openstack.Client.Powershell/Cmdlets/ObjectStorage/Objects/GetURICmdlet.cs b/Openstack.Client.Powershell/Cmdlets/ObjectStorage/Objects/GetURICmdlet.cs new file mode 100644 index 0000000..39bd779 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/ObjectStorage/Objects/GetURICmdlet.cs @@ -0,0 +1,194 @@ +///* ============================================================================ +//Copyright 2014 Hewlett Packard + +//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. +//============================================================================ */ +//using System; +//using System.Management.Automation; +//using Openstack.Client.Powershell.Providers.Common; +//using System.Security.Cryptography; +//using System.Text; +//using System.Web; +//using Openstack.Objects.Domain; + +//namespace Openstack.Client.Powershell.Cmdlets.Common +//{ +// [Cmdlet(VerbsCommon.Get, "URI", SupportsShouldProcess = true)] +// [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.ObjectStorage)] +// public class GetURICmdlet : BasePSCmdlet +// { +// private string _sourcePath; +// private int _daysValid = 0; +// private int _secondsValid = 0; + +// #region Parameters +////========================================================================================= +///// +///// The location of the file to set permissions on. +///// +////========================================================================================= +// [Parameter(Position = 0, ParameterSetName = "qA", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text is here")] +// [Alias("s")] +// [ValidateNotNullOrEmpty] +// public string SourcePath +// { +// get { return _sourcePath; } +// set { _sourcePath = value; } +// } +////========================================================================================= +///// +///// The location of the file to set permissions on. +///// +////========================================================================================= +// [Parameter(Position = 1, ParameterSetName = "qA", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text is here")] +// [Alias("dv")] +// [ValidateNotNullOrEmpty] +// public int DaysValid +// { +// get { return _daysValid; } +// set { _daysValid = value; } +// } +////========================================================================================= +///// +///// The location of the file to set permissions on. +///// +////========================================================================================= +// [Parameter(Position = 2, ParameterSetName = "qA", Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text is here")] +// [Alias("sv")] +// [ValidateNotNullOrEmpty] +// public int SecondsValid +// { +// get { return _secondsValid; } +// set { _secondsValid = value; } +// } +// #endregion +// #region Methods +////========================================================================================= +///// +///// +///// +////========================================================================================= +// private string ConvertSignatureToHex(string signature) +// { +// string hexaHash = ""; +// foreach (byte b in signature) +// { +// hexaHash += String.Format("{0:x2}", b); +// } +// return hexaHash; +// } +////========================================================================================= +///// +///// +///// +////========================================================================================= +// private string GenerateTempUrl(string signatureString) +// { +// var hmac = new HMACSHA1(Encoding.UTF8.GetBytes(this.Settings.Username)); +// var hash = hmac.ComputeHash(Encoding.UTF8.GetBytes(signatureString)); +// return BitConverter.ToString(hash).Replace("-", "").ToLower(); +// } +////========================================================================================= +///// +///// +///// +///// +////========================================================================================= +// private string GetFormattedUri(StoragePath path) +// { +// string[] elements = this.CreateStoragePath(this.SourcePath).ToString().Split('/'); +// return String.Join("/", elements).Replace(elements[0] + "/" + elements[1] + "/" + elements[2], string.Empty); +// } +////========================================================================================= +///// +///// +///// +///// +////========================================================================================= +// public long GetEpochTime() +// { +// long baseTicks = 621355968000000000; +// long tickResolution = 10000000; +// long epoch = (DateTime.Now.ToUniversalTime().Ticks - baseTicks) / tickResolution; + +// return epoch; +// } +////========================================================================================= +///// +///// +///// +///// +////========================================================================================= +// private long GetExpirationInSeconds() +// { +// if (_daysValid != 0) +// { +// return GetEpochTime() + (86400 * _daysValid); +// } +// else if (_secondsValid != 0) +// { +// return GetEpochTime() + _secondsValid; +// } +// return 0; +// } + +////========================================================================================= +///// +///// +///// +////========================================================================================= +// private void GetTempUrl() +// { +// string uri = null; +// long expiration = this.GetExpirationInSeconds(); +// string totalSeconds = Convert.ToString(expiration); +// StoragePath fullPath = this.CreateStoragePath(this.SourcePath); +// uri = this.GetFormattedUri(fullPath); +// string signedString = this.GenerateTempUrl("GET" + "\n" + totalSeconds + "\n" + uri); +// string signature = HttpUtility.UrlEncode(this.Settings.DefaultTenantId + ":" + this.Settings.Username + ":" + signedString); +// string tempUrl = fullPath.BasePath + "?temp_url_sig=" + signature + "&temp_url_expires=" + totalSeconds; + +// WriteObject(""); +// WriteObject("Object located at : " + tempUrl); +// WriteObject("Url Expiration Date : " + DateTime.Now.AddDays(_daysValid).ToShortDateString() + ". [" + _daysValid + @" day(s) \ " + expiration + " seconds.]"); +// WriteObject(""); + +// if (this.Settings.PasteGetURIResultsToClipboard) +// OutClipboard.SetText(tempUrl); +// } +////========================================================================================= +///// +///// 1347472640 +///// +////========================================================================================= +// protected override void ProcessRecord() +// { +// if (_daysValid != 0 || _secondsValid != 0) +// { +// this.GetTempUrl(); +// } +// else +// { +// string uri = this.CreateStoragePath(this.SourcePath).ToString(); + +// if (this.Settings.PasteGetURIResultsToClipboard) +// OutClipboard.SetText(uri); + +// WriteObject(""); +// WriteObject("Object located at : " + uri); +// WriteObject(""); +// } +// } +// #endregion +// } +//} diff --git a/Openstack.Client.Powershell/Cmdlets/ObjectStorage/Objects/RemoveItemCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/ObjectStorage/Objects/RemoveItemCmdlet.cs new file mode 100644 index 0000000..193f4db --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/ObjectStorage/Objects/RemoveItemCmdlet.cs @@ -0,0 +1,133 @@ +///* ============================================================================ +//Copyright 2014 Hewlett Packard + +//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. +//============================================================================ */ +//using System; +//using System.Management.Automation; +//using Openstack.Objects.DataAccess; +//using Openstack.Objects.Domain; +//using Openstack.Client.Powershell.Providers.Storage; +//using Openstack.Common; +//using System.Management.Automation.Host; +//using System.Collections.ObjectModel; +//using System.Diagnostics.Contracts; +//using Openstack.Client.Powershell.Providers.Common; + +//namespace Openstack.Client.Powershell.Cmdlets.Common +//{ +// [Cmdlet(VerbsCommon.Remove, "Item", SupportsShouldProcess = true)] +// [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.ObjectStorage)] +// public class RemoveItemCmdlet : BasePSCmdlet +// { +// public const string cDelimiter = "/"; +// private string _targetPath; + +// #region Parameters +////========================================================================================= +///// +///// +///// +////========================================================================================= +// [Parameter(Position = 0, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Help Text")] +// [ValidateNotNullOrEmpty] +// [Alias("t")] +// public string TargetPath +// { +// get { return _targetPath; } +// set { _targetPath = value; } +// } +// #endregion +// #region Methods +////========================================================================================= +///// +///// +///// +////========================================================================================= +// private void DeleteFolder(StoragePath targetPath, bool recurse) +// { +// Contract.Requires(targetPath.IsFolderPathOnly); + +// string confirmationMsg; +// IStorageObjectRepository repository = null; +// OSDriveInfo kvsDrive = null; +// Collection choices; + +// #if (DEBUG) + +// // We can't prompt for confirmation as this jacks up the unit test.. + +// repository = this.RepositoryFactory.CreateStorageObjectRepository(); +// repository.DeleteFolder(targetPath.AbsoluteURI + "/"); +// kvsDrive = (OSDriveInfo)this.SessionState.Drive.Current; + +// if (kvsDrive.PathCache.Exists(p => p == targetPath.Path)) +// { +// kvsDrive.PathCache.Remove(targetPath.Path); +// } +// return; + +// #endif + +// choices = new Collection(); +// choices.Add(new ChoiceDescription("Y", "Yes")); +// choices.Add(new ChoiceDescription("N", "No")); + +// if (recurse) confirmationMsg = "You are about to delete an entire folder and all of its decendant folders. Are you sure about this?"; +// else confirmationMsg = "You are about to delete a folder and its Storage Objects Are you sure about this?"; + +// if (this.Host.UI.PromptForChoice("Confirmation Required." , confirmationMsg, choices, 0) == 0) +// { +// repository = this.RepositoryFactory.CreateStorageObjectRepository(); +// repository.DeleteFolder(targetPath.AbsoluteURI); + +// kvsDrive = (OSDriveInfo)this.SessionState.Drive.Current; + +// if (kvsDrive.PathCache.Exists(p => p == targetPath.Path)) +// { +// kvsDrive.PathCache.Remove(targetPath.Path); +// } +// } +// } +////========================================================================================= +///// +///// +///// +////========================================================================================= +// protected override void ProcessRecord() +// { +// Contract.Requires(this.Drive != null); +// StoragePath targetPath = this.CreateStoragePath(this.TargetPath); + +// if (targetPath.IsFolderPathOnly) +// { +// this.DeleteFolder(targetPath, true); +// } +// else +// { +// try +// { +// this.RepositoryFactory.CreateStorageObjectRepository().DeleteStorageObject(targetPath.AbsoluteURI); +// } +// catch (Exception ex) +// { +// Console.WriteLine(""); +// Console.WriteLine(ex.Message); +// Console.WriteLine(""); +// } +// } +// } +// } +// #endregion +// } + diff --git a/Openstack.Client.Powershell/Cmdlets/Security/AddRuleCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Security/AddRuleCmdlet.cs new file mode 100644 index 0000000..0da434e --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Security/AddRuleCmdlet.cs @@ -0,0 +1,176 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Compute; +using System.Linq; +using Openstack.Client.Powershell.Providers.Security; +using Openstack.Client.Powershell.Providers.Common; +using System.Collections; +using Openstack.Objects.Domain.Security; + +namespace Openstack.Client.Powershell.Cmdlets.Security +{ + [Cmdlet(VerbsCommon.Add, "Rule", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class AddRuleCmdlet : BasePSCmdlet + { + private string _direction; + private string _etherType; + private string _portRangeMax; + private string _portRangeMin; + private string _protocol; + private string _remoteGroupId; + private string _remoteIPPrefix; + private string _securityGroupId; + + #region Parameters +//========================================================================================= +/// +/// +//add-rule -ipr "iprTest" -IP "100.0.0.0" -tp "80" -fp "81" -sg "2302" +/// +//========================================================================================= + [Parameter(Position = 5, Mandatory = true, ParameterSetName = "AddRule", ValueFromPipelineByPropertyName = true, HelpMessage = "cfgn")] + [Alias("d")] + [ValidateNotNullOrEmpty] + public string Direction + { + get { return _direction; } + set { _direction = value; } + } +//========================================================================================= +/// +/// +// add-rule -ipr "iprTest" -IP "tcp" -tp "81" -fp "80" +/// +//========================================================================================= + [Parameter(Position = 4, Mandatory = false, ParameterSetName = "AddRule", ValueFromPipelineByPropertyName = true, HelpMessage = "cfgn")] + [Alias("et")] + [ValidateNotNullOrEmpty] + public string EtherType + { + get { return _etherType; } + set { _etherType = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 2, Mandatory = true, ParameterSetName = "AddRule", ValueFromPipelineByPropertyName = true, HelpMessage = "cfgn")] + [Alias("max")] + [ValidateNotNullOrEmpty] + public string PortRangeMax + { + get { return _portRangeMax; } + set { _portRangeMax = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, Mandatory = true, ParameterSetName = "AddRule", ValueFromPipelineByPropertyName = true, HelpMessage = "cfgn")] + [Alias("min")] + [ValidateNotNullOrEmpty] + public string PortRangeMin + { + get { return _portRangeMin; } + set { _portRangeMin = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 3, Mandatory = true, ParameterSetName = "AddRule", ValueFromPipelineByPropertyName = true, HelpMessage = "cfgn")] + [Alias("p")] + [ValidateNotNullOrEmpty] + public string Protocol + { + get { return _protocol; } + set { _protocol = value; } + } +//========================================================================================= +/// +/// +//add-rule -ipr "iprTest" -IP "100.0.0.0" -tp "80" -fp "81" -sg "2302" +/// +//========================================================================================= + [Parameter(Position = 5, Mandatory = true, ParameterSetName = "AddRule", ValueFromPipelineByPropertyName = true, HelpMessage = "cfgn")] + [Alias("sid")] + [ValidateNotNullOrEmpty] + public string SecurityGroupId + { + get { return _securityGroupId; } + set { _securityGroupId = value; } + } +//========================================================================================= +/// +/// +//add-rule -ipr "iprTest" -IP "100.0.0.0" -tp "80" -fp "81" -sg "2302" +/// +//========================================================================================= + [Parameter(Position = 5, Mandatory = false, ParameterSetName = "AddRule", ValueFromPipelineByPropertyName = true, HelpMessage = "cfgn")] + [Alias("rgid")] + [ValidateNotNullOrEmpty] + public string RemoteGroupId + { + get { return _remoteGroupId; } + set { _remoteGroupId = value; } + } +//========================================================================================= +/// +/// +//add-rule -ipr "iprTest" -IP "100.0.0.0" -tp "80" -fp "81" -sg "2302" +/// +//========================================================================================= + [Parameter(Position = 5, Mandatory = false, ParameterSetName = "AddRule", ValueFromPipelineByPropertyName = true, HelpMessage = "cfgn")] + [Alias("ripp")] + [ValidateNotNullOrEmpty] + public string RemoteIPPrefix + { + get { return _remoteIPPrefix; } + set { _remoteIPPrefix = value; } + } + + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + NewSecurityGroupRule rule = new NewSecurityGroupRule(); + rule.PortRangeMin = this.PortRangeMin; + rule.PortRangeMax = this.PortRangeMax; + rule.Protocol = this.Protocol; + rule.SecurityGroupId = this.SecurityGroupId; + rule.RemoteGroupId = this.RemoteGroupId; + rule.RemoteIPPrefix = this.RemoteIPPrefix; + rule.EtherType = this.EtherType; + rule.Direction = this.Direction; + + SecurityGroupRule result = this.RepositoryFactory.CreateSecurityRepository().SaveSecurityRule(rule); + this.UpdateCache(); + } + #endregion + } +} + diff --git a/Openstack.Client.Powershell/Cmdlets/Security/NewSecurityGroupCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Security/NewSecurityGroupCmdlet.cs new file mode 100644 index 0000000..239c8a1 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Security/NewSecurityGroupCmdlet.cs @@ -0,0 +1,80 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Security; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Client.Powershell.Providers.Security; + +namespace Openstack.Client.Powershell.Cmdlets.Security +{ + [Cmdlet(VerbsCommon.New, "SecurityGroup", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class NewSecurityGroupCmdlet : BasePSCmdlet + { + private string _name; + private string _description; + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, Mandatory = true, ParameterSetName = "NewSecurityGroup", ValueFromPipelineByPropertyName = true, HelpMessage = "ww")] + [Alias("d")] + [ValidateNotNullOrEmpty] + public string Description + { + get { return _description; } + set { _description = value; } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 0, ParameterSetName = "NewSecurityGroup", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "www")] + [Alias("n")] + public string Name + { + get { return _name; } + set { _name = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + NewSecurityGroup newGroup = new NewSecurityGroup(); + newGroup.Description = this.Description; + newGroup.Name = this.Name; + + SecurityGroup securityGroup = this.RepositoryFactory.CreateSecurityRepository().SaveSecurityGroup(newGroup); + this.UpdateCache(); + } + #endregion + } + +} diff --git a/Openstack.Client.Powershell/Cmdlets/Security/RemoveRuleCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Security/RemoveRuleCmdlet.cs new file mode 100644 index 0000000..6812352 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Security/RemoveRuleCmdlet.cs @@ -0,0 +1,62 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Compute; +using System.Linq; +using Openstack.Client.Powershell.Providers.Security; +using Openstack.Client.Powershell.Providers.Common; +using System.Collections; +using Openstack.Objects.Domain.Security; + +namespace Openstack.Client.Powershell.Cmdlets.Security +{ + [Cmdlet(VerbsCommon.Remove, "Rule", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class RemoveRuleCmdlet : BasePSCmdlet + { + private string _securityGroupRuleId; + + #region Parameters +//========================================================================================= +/// +/// +//========================================================================================= + [Parameter(Position = 1, Mandatory = true, ParameterSetName = "RemoveRule", ValueFromPipelineByPropertyName = true, HelpMessage = "cfgn")] + [Alias("id")] + [ValidateNotNullOrEmpty] + public string SecurityGroupRuleId + { + get { return _securityGroupRuleId; } + set { _securityGroupRuleId = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + this.RepositoryFactory.CreateSecurityRepository().DeleteSecurityRule(this.SecurityGroupRuleId); + this.UpdateCache(); + } + #endregion + } +} + + diff --git a/Openstack.Client.Powershell/Cmdlets/Security/RemoveSecurityGroupCmdlet.cs b/Openstack.Client.Powershell/Cmdlets/Security/RemoveSecurityGroupCmdlet.cs new file mode 100644 index 0000000..952ac85 --- /dev/null +++ b/Openstack.Client.Powershell/Cmdlets/Security/RemoveSecurityGroupCmdlet.cs @@ -0,0 +1,76 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Management.Automation; +using Openstack.Client.Powershell.Cmdlets.Common; +using Openstack.Objects.Domain.Security; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Client.Powershell.Providers.Security; +using Openstack.Objects.DataAccess; +using Openstack.Objects.DataAccess.Security; + +namespace Openstack.Client.Powershell.Cmdlets.Security +{ + [Cmdlet(VerbsCommon.Remove, "SecurityGroup", SupportsShouldProcess = true)] + [RequiredServiceIdentifierAttribute(Openstack.Objects.Domain.Admin.Services.Compute)] + public class RemoveSecurityGroupCmdlet : BasePSCmdlet + { + private string _securityGroupId; + + #region Parameters +//========================================================================================= +/// +/// +/// +//========================================================================================= + [Parameter(Position = 1, Mandatory = true, ParameterSetName = "RemoveSecurityGroup", ValueFromPipelineByPropertyName = true, HelpMessage = "ww")] + [Alias("id")] + [ValidateNotNullOrEmpty] + public string SecurityGroupId + { + get { return _securityGroupId; } + set { _securityGroupId = value; } + } + #endregion + #region Methods +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected override void ProcessRecord() + { + string id = this.TranslateQuickPickNumber(this.SecurityGroupId); + ISecurityRepository repository = this.RepositoryFactory.CreateSecurityRepository(); + + SecurityGroup group = repository.GetSecurityGroup(id); + + if (group.Name != "default") + { + repository.DeleteSecurityGroup(id); + this.UpdateCache(); + } + else + { + Console.WriteLine(""); + Console.WriteLine("Invalid SecurityGroupId : Unable to delete the Default Security Group."); + Console.WriteLine(""); + } + } + #endregion + } + +} diff --git a/Openstack.Client.Powershell/Dependencies/Microsoft.Http.Extensions.dll b/Openstack.Client.Powershell/Dependencies/Microsoft.Http.Extensions.dll new file mode 100644 index 0000000..265a4b5 Binary files /dev/null and b/Openstack.Client.Powershell/Dependencies/Microsoft.Http.Extensions.dll differ diff --git a/Openstack.Client.Powershell/Dependencies/Microsoft.Http.dll b/Openstack.Client.Powershell/Dependencies/Microsoft.Http.dll new file mode 100644 index 0000000..fd6942b Binary files /dev/null and b/Openstack.Client.Powershell/Dependencies/Microsoft.Http.dll differ diff --git a/Openstack.Client.Powershell/Dependencies/Microsoft.QueryComposition.dll b/Openstack.Client.Powershell/Dependencies/Microsoft.QueryComposition.dll new file mode 100644 index 0000000..d86913b Binary files /dev/null and b/Openstack.Client.Powershell/Dependencies/Microsoft.QueryComposition.dll differ diff --git a/Openstack.Client.Powershell/Dependencies/Microsoft.ServiceModel.Http.Client.UnitTest.dll b/Openstack.Client.Powershell/Dependencies/Microsoft.ServiceModel.Http.Client.UnitTest.dll new file mode 100644 index 0000000..d8180ba Binary files /dev/null and b/Openstack.Client.Powershell/Dependencies/Microsoft.ServiceModel.Http.Client.UnitTest.dll differ diff --git a/Openstack.Client.Powershell/Dependencies/Microsoft.ServiceModel.Http.Client.dll b/Openstack.Client.Powershell/Dependencies/Microsoft.ServiceModel.Http.Client.dll new file mode 100644 index 0000000..ee05901 Binary files /dev/null and b/Openstack.Client.Powershell/Dependencies/Microsoft.ServiceModel.Http.Client.dll differ diff --git a/Openstack.Client.Powershell/Dependencies/Microsoft.ServiceModel.Http.Test.dll b/Openstack.Client.Powershell/Dependencies/Microsoft.ServiceModel.Http.Test.dll new file mode 100644 index 0000000..100b457 Binary files /dev/null and b/Openstack.Client.Powershell/Dependencies/Microsoft.ServiceModel.Http.Test.dll differ diff --git a/Openstack.Client.Powershell/Dependencies/Microsoft.ServiceModel.Http.dll b/Openstack.Client.Powershell/Dependencies/Microsoft.ServiceModel.Http.dll new file mode 100644 index 0000000..4896128 Binary files /dev/null and b/Openstack.Client.Powershell/Dependencies/Microsoft.ServiceModel.Http.dll differ diff --git a/Openstack.Client.Powershell/Deployment/Aliases.txt b/Openstack.Client.Powershell/Deployment/Aliases.txt new file mode 100644 index 0000000..87e8b52 Binary files /dev/null and b/Openstack.Client.Powershell/Deployment/Aliases.txt differ diff --git a/Openstack.Client.Powershell/Deployment/ApacheLicense.rtf b/Openstack.Client.Powershell/Deployment/ApacheLicense.rtf new file mode 100644 index 0000000..9114d6b --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/ApacheLicense.rtf @@ -0,0 +1,170 @@ +{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch31506\stshfloch31506\stshfhich31506\stshfbi31507\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f39\fbidi \fmodern\fcharset0\fprq1{\*\panose 020b0609020204030204}Consolas;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;} +{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;} +{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f40\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f41\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\f43\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f44\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f45\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f46\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\f47\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f48\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f40\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f41\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\f43\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f44\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f45\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f46\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\f47\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f48\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f410\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f411\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;} +{\f413\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f414\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f417\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f418\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);} +{\f430\fbidi \fmodern\fcharset238\fprq1 Consolas CE;}{\f431\fbidi \fmodern\fcharset204\fprq1 Consolas Cyr;}{\f433\fbidi \fmodern\fcharset161\fprq1 Consolas Greek;}{\f434\fbidi \fmodern\fcharset162\fprq1 Consolas Tur;} +{\f437\fbidi \fmodern\fcharset186\fprq1 Consolas Baltic;}{\f438\fbidi \fmodern\fcharset163\fprq1 Consolas (Vietnamese);}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} +{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;} +{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} +{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} +{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;} +{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;} +{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0; +\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\*\defchp \f31506\fs22 }{\*\defpap +\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 +\af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\* +\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1 +\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext11 \ssemihidden \sunhideused Normal Table;}{ +\s15\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs21\alang1025 \ltrch\fcs0 \f39\fs21\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext15 \slink16 \sunhideused Plain Text;} +{\*\cs16 \additive \rtlch\fcs1 \af0\afs21 \ltrch\fcs0 \f39\fs21 \sbasedon10 \slink15 \slocked Plain Text Char;}}{\*\rsidtbl \rsid8006177\rsid10242273\rsid13443570}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1 +\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\author tplummer}{\operator tplummer}{\creatim\yr2012\mo9\dy6\hr10\min42}{\revtim\yr2012\mo9\dy6\hr10\min42}{\version2}{\edmins1}{\nofpages1}{\nofwords86}{\nofchars494}{\nofcharsws579}{\vern49273}} +{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\paperw12240\paperh15840\margl1501\margr1502\margt1440\margb1440\gutter0\ltrsect +\widowctrl\ftnbj\aenddoc\trackmoves0\trackformatting1\donotembedsysfont1\relyonvml0\donotembedlingdata0\grfdocevents0\validatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors1\noxlattoyen +\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1501\dgvorigin1440\dghshow1\dgvshow1 +\jexpand\viewkind1\viewscale210\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct +\asianbrkrule\rsidroot13443570\newtblstyruls\nogrowautofit\usenormstyforlist\noindnmbrts\felnbrelev\nocxsptable\indrlsweleven\noafcnsttbl\afelev\utinl\hwelev\spltpgpar\notcvasp\notbrkcnstfrctbl\notvatxbx\krnprsnet\cachedcolbal \nouicompat \fet0 +{\*\wgrffmtfilter 2450}\nofeaturethrottle1\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\endnhere\sectlinegrid360\sectdefaultcl\sectrsid1316550\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2 +\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6 +\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang +{\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8006177 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 +\f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid8006177 Copyright }{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid8006177 2012 Hewlett-Packard}{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid8006177 +\par Licensed under the Apache License, Version 2.0 (the "License"); +\par you may not use this file except in compliance with the License. +\par You may obtain a copy of the License at +\par http://www.apache.org/licenses/LICENSE-2.0 +\par Unless required by applicable law or agreed to in writing, software +\par distributed under the License is distributed on an "AS IS" BASIS, +\par WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +\par See the License for the specific language governing permissions and +\par limitations under the License.}{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid10242273\charrsid8006177 +\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a +9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad +5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6 +b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0 +0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6 +a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f +c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512 +0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462 +a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865 +6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b +4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b +4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210030dd4329a8060000a41b0000160000007468656d652f7468656d652f +7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87 +615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad +79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b +5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab +999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9 +699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586 +8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6 +0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f +9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be +15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979 +3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d +32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a +f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86 +e877f0034e16bafb0e258ebb4faf06b769e888340b103d331115bebc4eb813bf83291b63624a0d1475a756c734f9bbc2cd28546ecbe1e20a3794ca175f3fae90 +fb6d2dd99bb07b55e5ccf68942bd0877b23c77b908e8db5f9db7f024d9239010f35bd4bbe2fcae387bfff9e2bc289f2fbe24cfaa301468dd8bd846dbb4ddf1c2 +ae7b4c191ba8292337a469bc25ec3d411f06f53a73e224c5292c8de0516732307070a1c0660d125c7d44553488700a4d7bddd3444299910e254ab984c3a219ae +a4adf1d0f82b7bd46cea4388ad1c12ab5d1ed8e1153d9c9f350a3246aad01c6873462b9ac05999ad5cc988826eafc3acae853a33b7ba11cd1445875ba1b236b1 +399483c90bd560b0b0263435085a21b0f22a9cf9356b38ec6046026d77eba3dc2dc60b17e92219e180643ed27acffba86e9c94c7ca9c225a0f1b0cfae0788ad5 +4adc5a9aec1b703b8b93caec1a0bd8e5de7b132fe5113cf312503b998e2c2927274bd051db6b35979b1ef271daf6c6704e86c73805af4bdd476216c26593af84 +0dfb5393d964f9cc9bad5c313709ea70f561ed3ea7b053075221d51696910d0d339585004b34272bff7213cc7a510a5454a3b349b1b206c1f0af490176745d4b +c663e2abb2b34b23da76f6352ba57ca2881844c1111ab189d8c7e07e1daaa04f40255c77988aa05fe06e4e5bdb4cb9c5394bbaf28d98c1d971ccd20867e556a7 +689ec9166e0a522183792b8907ba55ca6e943bbf2a26e52f48957218ffcf54d1fb09dc3eac04da033e5c0d0b8c74a6b43d2e54c4a10aa511f5fb021a07533b20 +5ae07e17a621a8e082dafc17e450ffb739676998b48643a4daa7211214f623150942f6a02c99e83b85583ddbbb2c4996113211551257a656ec1139246ca86be0 +aadedb3d1441a89b6a929501833b197fee7b9641a3503739e57c732a59b1f7da1cf8a73b1f9bcca0945b874d4393dbbf10b1680f66bbaa5d6f96e77b6f59113d +316bb31a795600b3d256d0cad2fe354538e7566b2bd69cc6cbcd5c38f0e2bcc63058344429dc2121fd07f63f2a7c66bf76e80d75c8f7a1b622f878a18941d840 +545fb28d07d205d20e8ea071b283369834296bdaac75d256cb37eb0bee740bbe278cad253b8bbfcf69eca23973d939b97891c6ce2cecd8da8e2d343578f6648a +c2d0383fc818c798cf64e52f597c740f1cbd05df0c264c49134cf09d4a60e8a107260f20f92d47b374e32f000000ffff0300504b030414000600080000002100 +0dd1909fb60000001b010000270000007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f7 +8277086f6fd3ba109126dd88d0add40384e4350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89 +d93b64b060828e6f37ed1567914b284d262452282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd500 +1996509affb3fd381a89672f1f165dfe514173d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0f +bfff0000001c0200001300000000000000000000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6 +a7e7c0000000360100000b00000000000000000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a +0000001c00000000000000000000000000190200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d00140006000800000021 +0030dd4329a8060000a41b00001600000000000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d001400060008 +00000021000dd1909fb60000001b0100002700000000000000000000000000b20900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000ad0a00000000} +{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d +617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169 +6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363 +656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e} +{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4; +\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9; +\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7; +\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000 +4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000 +d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e500000000000000000000000090e7 +0a31468ccd01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file diff --git a/Openstack.Client.Powershell/Deployment/ApacheLicense.txt b/Openstack.Client.Powershell/Deployment/ApacheLicense.txt new file mode 100644 index 0000000..62a1964 --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/ApacheLicense.txt @@ -0,0 +1,15 @@ + Copyright 2012 Hewlett-Packard + + The Migrate-Drive cmdlet is licensed under the following agreement + + 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. diff --git a/Openstack.Client.Powershell/Deployment/CLI.config b/Openstack.Client.Powershell/Deployment/CLI.config new file mode 100644 index 0000000..a884916 --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/CLI.config @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Openstack.Client.Powershell/Deployment/CLI.config.example b/Openstack.Client.Powershell/Deployment/CLI.config.example new file mode 100644 index 0000000..8445b81 --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/CLI.config.example @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Openstack.Client.Powershell/Deployment/CLIManifest.psd1 b/Openstack.Client.Powershell/Deployment/CLIManifest.psd1 new file mode 100644 index 0000000..4e9bf61 --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/CLIManifest.psd1 @@ -0,0 +1,21 @@ +@{ +ModuleToProcess = 'Openstack.Client.Powershell.dll' +GUID="{847a28a4-6407-4aa6-8070-a4a51396db70}" +Author="Travis Plummer" +CompanyName="Hewlett-Packard Corporation" +Copyright="© Hewlett-Packard. All rights reserved." +ModuleVersion="1.0.0.0" +PowerShellVersion="2.0" +CLRVersion="4.0.30319" +FormatsToProcess="OpenstackShell.format.ps1xml" +FileList='CLI.config' +RequiredAssemblies = 'Openstack.dll', 'Openstack.Common.dll' + +} + + + + + + + diff --git a/Openstack.Client.Powershell/Deployment/CredentialList.xml b/Openstack.Client.Powershell/Deployment/CredentialList.xml new file mode 100644 index 0000000..778162c --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/CredentialList.xml @@ -0,0 +1,4 @@ + + + + diff --git a/Openstack.Client.Powershell/Deployment/DevProfile.ps1 b/Openstack.Client.Powershell/Deployment/DevProfile.ps1 new file mode 100644 index 0000000..2f7e147 --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/DevProfile.ps1 @@ -0,0 +1,79 @@ +# --------------------------------------------------------------- +# Set up the default windows size and color.... +# --------------------------------------------------------------- +#$DebugPreference=$VerbosePreference="Continue" +#$DebugPreference = "Continue" +$a = (Get-Host).UI.RawUI +$b = $a.WindowSize +$b.Width = 109 +$b.Height = 61 +$a.WindowSize = $b +cls +# ----------------------------------------------------------------- +# Register known providers, write out welcome and status messages.. +# ----------------------------------------------------------------- +$a.BackgroundColor = "black" +Echo '' +$a.ForegroundColor = "gray" +Echo '========================================================================================' +$a.ForegroundColor = "yellow" +Echo 'Welcome to the OpenStack Powershell Environment.333' +$a.ForegroundColor = "gray" +Echo '========================================================================================' +Echo '' +$a.ForegroundColor = "green" +echo ' ==> Registering Providers...' + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------- +# ACTION REQUIRED! ==> Substitute the example CD commands path below to match your setup. This should be the final output of the Solution as dictated by the +# $(TargetDir) macro in the Post-Build Script. +# ----------------------------------------------------------------------------------------------------------------------------------------------------------- + + #cd C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\bin\Release + cd C:\Users\tplummer\Source\Repos\OpenStack-NewCLI\Openstack.Client.Powershell\bin\Release + +import-module .\CLIManifest.psd1 -DisableNameChecking +cd Builds: +cd 1-3-4-5 + + +#cd OpenStack: +#cd Networks +#get-sp + +# --------------------------------------------------------------- +# Let the User know what's going on.. +# --------------------------------------------------------------- + +echo ' ==> Applying Command Aliases...' +echo ' ==> Registering Views...' +echo '' + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------- +# Issue any startup commands you would like to execute after everything loads. +# ----------------------------------------------------------------------------------------------------------------------------------------------------------- +#cd BlockStorage +#cd Volumes +#ls + +# --------------------------------------------------------------- +# Reset Shell to default colors.. +# --------------------------------------------------------------- +#$a.ForegroundColor = "yellow" +echo 'Ready..' +#$a.ForegroundColor = "green" +echo '' + + + + + + + + + + + + + + diff --git a/Openstack.Client.Powershell/Deployment/DevProfile.ps1.example b/Openstack.Client.Powershell/Deployment/DevProfile.ps1.example new file mode 100644 index 0000000..dde1b36 --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/DevProfile.ps1.example @@ -0,0 +1,73 @@ +# --------------------------------------------------------------- +# Set up the default windows size and color.... +# --------------------------------------------------------------- + #$DebugPreference=$VerbosePreference="Continue" + #$DebugPreference = "Continue" + $a = (Get-Host).UI.RawUI + $b = $a.WindowSize + $b.Width = 109 + $b.Height = 61 + $a.WindowSize = $b + cls +# ----------------------------------------------------------------- +# Register known providers, write out welcome and status messages.. +# ----------------------------------------------------------------- + $a.BackgroundColor = "black" + Echo '' + $a.ForegroundColor = "gray" + Echo '========================================================================================' + $a.ForegroundColor = "yellow" + Echo 'Welcome to the OpenStack Powershell Environment.' + $a.ForegroundColor = "gray" + Echo '========================================================================================' + Echo '' + $a.ForegroundColor = "green" + echo ' ==> Registering Providers...' + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------- +# ACTION REQUIRED! ==> Substitute the example CD commands path below to match your setup. This should be the final output of the Solution as dictated by the +# $(TargetDir) macro in the Post-Build Script. +# ----------------------------------------------------------------------------------------------------------------------------------------------------------- + + # cd 'Your Target Directory Here!'... + + import-module .\CLIManifest.psd1 -DisableNameChecking + cd OpenStack: + +# --------------------------------------------------------------- +# Let the User know what's going on.. +# --------------------------------------------------------------- + + echo ' ==> Applying Command Aliases...' + echo ' ==> Registering Views...' + echo '' + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------- +# Issue any startup commands you would like to execute after everything loads. +# ----------------------------------------------------------------------------------------------------------------------------------------------------------- + #cd BlockStorage + #cd Volumes + #ls + +# --------------------------------------------------------------- +# Reset Shell to default colors.. +# --------------------------------------------------------------- + #$a.ForegroundColor = "yellow" + echo 'Ready..' + #$a.ForegroundColor = "green" + echo '' + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Openstack.Client.Powershell/Deployment/License.rtf b/Openstack.Client.Powershell/Deployment/License.rtf new file mode 100644 index 0000000..b51380c --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/License.rtf @@ -0,0 +1,217 @@ +{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch31506\stshfloch31506\stshfhich31506\stshfbi31507\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;} +{\f34\fbidi \froman\fcharset1\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhimajor\f31502\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0302020204030204}Calibri Light;} +{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;} +{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f40\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f41\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\f43\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f44\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f45\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f46\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\f47\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f48\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f60\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}{\f61\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;} +{\f63\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f64\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f65\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f66\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);} +{\f67\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f68\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f410\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f411\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;} +{\f413\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f414\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f417\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f418\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);} +{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} +{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhimajor\f31528\fbidi \fswiss\fcharset238\fprq2 Calibri Light CE;}{\fhimajor\f31529\fbidi \fswiss\fcharset204\fprq2 Calibri Light Cyr;} +{\fhimajor\f31531\fbidi \fswiss\fcharset161\fprq2 Calibri Light Greek;}{\fhimajor\f31532\fbidi \fswiss\fcharset162\fprq2 Calibri Light Tur;}{\fhimajor\f31535\fbidi \fswiss\fcharset186\fprq2 Calibri Light Baltic;} +{\fhimajor\f31536\fbidi \fswiss\fcharset163\fprq2 Calibri Light (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} +{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} +{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;} +{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;} +{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}} +{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0; +\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\*\defchp \f31506\fs22 }{\*\defpap \ql \li0\ri0\sa160\sl259\slmult1 +\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\sa160\sl259\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 +\ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\* +\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa160\sl259\slmult1 +\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext11 \ssemihidden \sunhideused Normal Table;}}{\*\pgptbl {\pgp +\ipgp5\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp2\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp3\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp4\itap0\li0\ri0\sb0\sa0}}{\*\rsidtbl \rsid11606679\rsid12599557\rsid15035048}{\mmathPr\mmathFont34\mbrkBin0 +\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\author Travis Plummer}{\operator Travis Plummer}{\creatim\yr2014\mo2\dy11\hr13\min24}{\revtim\yr2014\mo2\dy11\hr13\min25}{\version1}{\edmins1} +{\nofpages1}{\nofwords82}{\nofchars469}{\nofcharsws550}{\vern57435}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect +\widowctrl\ftnbj\aenddoc\trackmoves0\trackformatting1\donotembedsysfont1\relyonvml0\donotembedlingdata0\grfdocevents0\validatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors1\noxlattoyen +\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1440\dgvorigin1440\dghshow1\dgvshow1 +\jexpand\viewkind1\viewscale100\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct +\asianbrkrule\rsidroot11606679\newtblstyruls\nogrowautofit\usenormstyforlist\noindnmbrts\felnbrelev\nocxsptable\indrlsweleven\noafcnsttbl\afelev\utinl\hwelev\spltpgpar\notcvasp\notbrkcnstfrctbl\notvatxbx\krnprsnet\cachedcolbal \nouicompat \fet0 +{\*\wgrffmtfilter 2450}\nofeaturethrottle1\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\endnhere\sectlinegrid360\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang +{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang +{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}} +\pard\plain \ltrpar\ql \li0\ri0\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11606679 \rtlch\fcs1 +\af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af2\afs20 \ltrch\fcs0 \f2\fs20\lang9\langfe1033\langnp9\insrsid11606679\charrsid11606679 Copyright }{\rtlch\fcs1 \af2\afs20 \ltrch\fcs0 +\f2\fs20\lang9\langfe1033\langnp9\insrsid11606679 2014 Openstack}{\rtlch\fcs1 \af2\afs20 \ltrch\fcs0 \f2\fs20\lang9\langfe1033\langnp9\insrsid11606679\charrsid11606679 +\par +\par Licensed under the Apache License, Version 2.0 (the "License"); +\par you may not use this file except in compliance with the License. +\par You may obtain a copy of the License at +\par +\par http://www.apache.org/licenses/LICENSE-2.0 +\par +\par Unless required by applicable law or agreed to in writing, software +\par distributed under the License is distributed on an "AS IS" BASIS, +\par WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +\par See the License for the specific language governing permissions and +\par limitations under the License. +\par }\pard \ltrpar\ql \li0\ri0\sa160\sl259\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid12599557 +\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a +9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad +5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6 +b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0 +0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6 +a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f +c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512 +0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462 +a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865 +6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b +4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b +4757e8d3f729e245eb2b260a0238fd010000ffff0300504b030414000600080000002100aa5225dfc60600008b1a0000160000007468656d652f7468656d652f +7468656d65312e786d6cec595d8bdb46147d2ff43f08bd3bfe92fcb1c41b6cd9ceb6d94d42eca4e4716c8fadc98e344633de8d0981923c160aa569e943037deb +43691b48a02fe9afd936a54d217fa17746b63c638fbb9b2585a5640d8b343af7ce997bafce1d4997afdc8fa87384134e58dc708b970aae83e3211b9178d2706f +f7bbb99aeb7081e211a22cc60d778eb97b65f7c30f2ea31d11e2083b601ff31dd4704321a63bf93c1fc230e297d814c7706dcc920809384d26f951828ec16f44 +f3a542a1928f10895d274611b8bd311e932176fad2a5bbbb74dea1701a0b2e078634e949d7d8b050d8d1615122f89c0734718e106db830cf881df7f17de13a14 +7101171a6e41fdb9f9ddcb79b4b330a2628bad66d7557f0bbb85c1e8b0a4e64c26836c52cff3bd4a33f3af00546ce23ad54ea553c9fc29001a0e61a52917dda7 +dfaab7dafe02ab81d2438bef76b55d2e1a78cd7f798373d3973f03af40a97f6f03dfed06104503af4029dedfc07b5eb51478065e81527c65035f2d34db5ed5c0 +2b5048497cb8812ef89572b05c6d061933ba6785d77daf5b2d2d9caf50500d5975c929c62c16db6a2d42f758d2058004522448ec88f9148fd110aa3840940c12 +e2ec93490885374531e3305c2815ba8532fc973f4f1da988a01d8c346bc90b98f08d21c9c7e1c3844c45c3fd18bcba1ae4cdcb1fdfbc7cee9c3c7a71f2e89793 +c78f4f1efd9c3a32acf6503cd1ad5e7fffc5df4f3f75fe7afeddeb275fd9f15cc7fffed367bffdfaa51d082b5d85e0d5d7cffe78f1ecd5379ffff9c3130bbc99 +a0810eef930873e73a3e766eb10816a6426032c783e4ed2cfa2122ba45339e701423398bc57f478406fafa1c5164c1b5b019c13b09488c0d787576cf20dc0b93 +9920168fd7c2c8001e30465b2cb146e19a9c4b0b737f164fec9327331d770ba123dbdc018a8dfc766653d05662731984d8a07993a258a0098eb170e4357688b1 +6575770931e27a408609e36c2c9cbbc46921620d499f0c8c6a5a19ed9108f232b711847c1bb139b8e3b418b5adba8d8f4c24dc15885ac8f73135c27815cd048a +6c2efb28a27ac0f791086d247bf364a8e33a5c40a6279832a733c29cdb6c6e24b05e2de9d7405eec693fa0f3c84426821cda7cee23c674649b1d06218aa6366c +8fc4a18efd881f428922e7261336f80133ef10790e7940f1d674df21d848f7e96a701b9455a7b42a107965965872791533a37e7b733a4658490d08bfa1e71189 +4f15f73559f7ff5b5907217df5ed53cbaa2eaaa0371362bda3f6d6647c1b6e5dbc03968cc8c5d7ee369ac53731dc2e9b0decbd74bf976ef77f2fdddbeee7772f +d82b8d06f9965bc574abae36eed1d67dfb9850da13738af7b9daba73e84ca32e0c4a3bf5cc8ab3e7b8690887f24e86090cdc2441cac64998f88488b017a229ec +ef8bae7432e10bd713ee4c19876dbf1ab6fa96783a8b0ed8287d5c2d16e5a3692a1e1c89d578c1cfc6e15143a4e84a75f50896b9576c27ea51794940dabe0d09 +6d329344d942a2ba1c9441520fe610340b09b5b277c2a26e615193ee97a9da6001d4b2acc0d6c9810d57c3f53d30012378a242148f649ed2542fb3ab92f92e33 +bd2d984605c03e625901ab4cd725d7adcb93ab4b4bed0c99364868e566925091513d8c87688417d52947cf42e36d735d5fa5d4a02743a1e683d25ad1a8d6fe8d +c579730d76ebda40635d2968ec1c37dc4ad9879219a269c31dc3633f1c4653a81d2eb7bc884ee0ddd95024e90d7f1e6599265cb4110fd3802bd149d520220227 +0e2551c395cbcfd24063a5218a5bb104827061c9d541562e1a3948ba99643c1ee3a1d0d3ae8dc848a7a7a0f0a95658af2af3f383a5259b41ba7be1e8d819d059 +720b4189f9d5a20ce0887078fb534ca33922f03a3313b255fdad35a685eceaef13550da5e3884e43b4e828ba98a77025e5191d7596c5403b5bac1902aa8564d1 +080713d960f5a01add34eb1a2987ad5df7742319394d34573dd35015d935ed2a66ccb06c036bb13c5f93d7582d430c9aa677f854bad725b7bed4bab57d42d625 +20e059fc2c5df70c0d41a3b69acca026196fcab0d4ecc5a8d93b960b3c85da599a84a6fa95a5dbb5b8653dc23a1d0c9eabf383dd7ad5c2d078b9af549156df3d +f44f136c700fc4a30d2f81675470954af8f09020d810f5d49e24950db845ee8bc5ad0147ce2c210df741c16f7a41c90f72859adfc97965af90abf9cd72aee9fb +e562c72f16daadd243682c228c8a7efacda50bafa2e87cf1e5458d6f7c7d89966fdb2e0d599467eaeb4a5e11575f5f8aa5ed5f5f1c02a2f3a052ead6cbf55625 +572f37bb39afddaae5ea41a5956b57826abbdb0efc5abdfbd0758e14d86b9603afd2a9e52ac520c8799582a45fabe7aa5ea9d4f4aacd5ac76b3e5c6c6360e5a9 +7c2c6201e155bc76ff010000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d652f7468656d652f5f72656c732f +7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d363f2451eced0dae2c082e8761be +9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e3198720e274a939cd08a54f980 +ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d9850528a2c6cce0239baa4c04ca5b +babac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c0200001300000000000000000000000000000000005b436f6e74656e +745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000000000000000300100005f72656c732f +2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c00000000000000000000000000190200007468656d652f7468656d652f74 +68656d654d616e616765722e786d6c504b01022d0014000600080000002100aa5225dfc60600008b1a00001600000000000000000000000000d6020000746865 +6d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b0100002700000000000000000000000000d00900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000cb0a00000000} +{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d +617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169 +6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363 +656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e} +{\*\latentstyles\lsdstimax371\lsdlockeddef0\lsdsemihiddendef0\lsdunhideuseddef0\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1; +\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4; +\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7; +\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 1; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 5; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 6;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 7;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 8;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 9; +\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 1;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 2;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 3; +\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 4;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 5;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 6; +\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 7;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 8;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 9;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Normal Indent; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footnote text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 header;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footer; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index heading;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 table of figures; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 envelope address;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 envelope return;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footnote reference;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation reference; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 line number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 page number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 endnote reference;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 endnote text; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 table of authorities;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 macro;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 toa heading;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 5;\lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Closing; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Signature;\lsdsemihidden1 \lsdunhideused1 \lsdpriority1 \lsdlocked0 Default Paragraph Font;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 4; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Message Header;\lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Salutation; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Date;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text First Indent;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text First Indent 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Note Heading; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Block Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Hyperlink;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 FollowedHyperlink;\lsdqformat1 \lsdpriority22 \lsdlocked0 Strong; +\lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Document Map;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Plain Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 E-mail Signature; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Top of Form;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Bottom of Form;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Normal (Web);\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Acronym; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Address;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Cite;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Code;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Definition; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Keyboard;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Preformatted;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Sample;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Typewriter; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Variable;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Normal Table;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation subject;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 No List; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Simple 1; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Simple 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Simple 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Classic 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Classic 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Classic 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Classic 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Colorful 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Colorful 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Colorful 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 6; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 7;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 8;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 6; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 7;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 8;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table 3D effects 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table 3D effects 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table 3D effects 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Contemporary;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Elegant;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Professional; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Subtle 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Subtle 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Web 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Web 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Web 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Balloon Text;\lsdpriority39 \lsdlocked0 Table Grid;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Theme;\lsdsemihidden1 \lsdlocked0 Placeholder Text; +\lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;\lsdpriority60 \lsdlocked0 Light Shading;\lsdpriority61 \lsdlocked0 Light List;\lsdpriority62 \lsdlocked0 Light Grid;\lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdpriority64 \lsdlocked0 Medium Shading 2; +\lsdpriority65 \lsdlocked0 Medium List 1;\lsdpriority66 \lsdlocked0 Medium List 2;\lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdpriority68 \lsdlocked0 Medium Grid 2;\lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdpriority70 \lsdlocked0 Dark List; +\lsdpriority71 \lsdlocked0 Colorful Shading;\lsdpriority72 \lsdlocked0 Colorful List;\lsdpriority73 \lsdlocked0 Colorful Grid;\lsdpriority60 \lsdlocked0 Light Shading Accent 1;\lsdpriority61 \lsdlocked0 Light List Accent 1; +\lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdsemihidden1 \lsdlocked0 Revision; +\lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1; +\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;\lsdpriority72 \lsdlocked0 Colorful List Accent 1; +\lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdpriority60 \lsdlocked0 Light Shading Accent 2;\lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2; +\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2; +\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;\lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdpriority72 \lsdlocked0 Colorful List Accent 2;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 2; +\lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdpriority61 \lsdlocked0 Light List Accent 3;\lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3; +\lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3; +\lsdpriority70 \lsdlocked0 Dark List Accent 3;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;\lsdpriority60 \lsdlocked0 Light Shading Accent 4; +\lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdpriority62 \lsdlocked0 Light Grid Accent 4;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 4; +\lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdpriority70 \lsdlocked0 Dark List Accent 4; +\lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;\lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdpriority60 \lsdlocked0 Light Shading Accent 5;\lsdpriority61 \lsdlocked0 Light List Accent 5; +\lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 5; +\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;\lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 5; +\lsdpriority72 \lsdlocked0 Colorful List Accent 5;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdpriority61 \lsdlocked0 Light List Accent 6;\lsdpriority62 \lsdlocked0 Light Grid Accent 6; +\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 6; +\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdpriority70 \lsdlocked0 Dark List Accent 6;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 6; +\lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;\lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis; +\lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;\lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdsemihidden1 \lsdunhideused1 \lsdpriority37 \lsdlocked0 Bibliography; +\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;\lsdpriority41 \lsdlocked0 Plain Table 1;\lsdpriority42 \lsdlocked0 Plain Table 2;\lsdpriority43 \lsdlocked0 Plain Table 3;\lsdpriority44 \lsdlocked0 Plain Table 4; +\lsdpriority45 \lsdlocked0 Plain Table 5;\lsdpriority40 \lsdlocked0 Grid Table Light;\lsdpriority46 \lsdlocked0 Grid Table 1 Light;\lsdpriority47 \lsdlocked0 Grid Table 2;\lsdpriority48 \lsdlocked0 Grid Table 3;\lsdpriority49 \lsdlocked0 Grid Table 4; +\lsdpriority50 \lsdlocked0 Grid Table 5 Dark;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 1;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 1; +\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 1;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 1;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 1;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 1; +\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 1;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 2;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 2;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 2; +\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 2;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 2;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 2;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 2; +\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 3;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 3;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 3;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 3; +\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 3;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 3;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 3;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 4; +\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 4;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 4;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 4;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 4; +\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 4;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 4;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 5;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 5; +\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 5;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 5;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 5;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 5; +\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 5;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 6;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 6;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 6; +\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 6;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 6;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 6;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 6; +\lsdpriority46 \lsdlocked0 List Table 1 Light;\lsdpriority47 \lsdlocked0 List Table 2;\lsdpriority48 \lsdlocked0 List Table 3;\lsdpriority49 \lsdlocked0 List Table 4;\lsdpriority50 \lsdlocked0 List Table 5 Dark; +\lsdpriority51 \lsdlocked0 List Table 6 Colorful;\lsdpriority52 \lsdlocked0 List Table 7 Colorful;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 1;\lsdpriority47 \lsdlocked0 List Table 2 Accent 1;\lsdpriority48 \lsdlocked0 List Table 3 Accent 1; +\lsdpriority49 \lsdlocked0 List Table 4 Accent 1;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 1;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 1;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 1; +\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 2;\lsdpriority47 \lsdlocked0 List Table 2 Accent 2;\lsdpriority48 \lsdlocked0 List Table 3 Accent 2;\lsdpriority49 \lsdlocked0 List Table 4 Accent 2; +\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 2;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 2;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 2;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 3; +\lsdpriority47 \lsdlocked0 List Table 2 Accent 3;\lsdpriority48 \lsdlocked0 List Table 3 Accent 3;\lsdpriority49 \lsdlocked0 List Table 4 Accent 3;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 3; +\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 3;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 3;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 4;\lsdpriority47 \lsdlocked0 List Table 2 Accent 4; +\lsdpriority48 \lsdlocked0 List Table 3 Accent 4;\lsdpriority49 \lsdlocked0 List Table 4 Accent 4;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 4;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 4; +\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 4;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 5;\lsdpriority47 \lsdlocked0 List Table 2 Accent 5;\lsdpriority48 \lsdlocked0 List Table 3 Accent 5; +\lsdpriority49 \lsdlocked0 List Table 4 Accent 5;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 5;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 5;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 5; +\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 6;\lsdpriority47 \lsdlocked0 List Table 2 Accent 6;\lsdpriority48 \lsdlocked0 List Table 3 Accent 6;\lsdpriority49 \lsdlocked0 List Table 4 Accent 6; +\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 6;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 6;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 6;}}{\*\datastore 010500000200000018000000 +4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000 +d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e500000000000000000000000000c4 +b60a5f27cf01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file diff --git a/Openstack.Client.Powershell/Deployment/Microsoft.PowerShell_profile.ps1 b/Openstack.Client.Powershell/Deployment/Microsoft.PowerShell_profile.ps1 new file mode 100644 index 0000000..cb8fbd2 --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/Microsoft.PowerShell_profile.ps1 @@ -0,0 +1,81 @@ +# --------------------------------------------------------------- +# Set up support methods first.. +# --------------------------------------------------------------- + + function is64bit() { + return ([IntPtr]::Size -eq 8) + } + + function get-programfilesdir() { + if (is64bit -eq $true) { + (Get-Item "Env:ProgramFiles(x86)").Value + } + else { + (Get-Item "Env:ProgramFiles").Value + } + } +# --------------------------------------------------------------- +# Set up the default windows size and color.... +# --------------------------------------------------------------- + + #$DebugPreference=$VerbosePreference="Continue" + #$DebugPreference = "Continue" + $a = (Get-Host).UI.RawUI + $b = $a.WindowSize + $b.Width = 109 + $b.Height = 61 + $a.WindowSize = $b + $a.BackgroundColor = "black" + $a.ForegroundColor = "green" + + cls +# --------------------------------------------------------------- +# Register known providers, write out welcome and status messages.. +# ----------------------------------------------------------------- + + $a.BackgroundColor = "black" + Echo '' + $a.ForegroundColor = "gray" + Echo '========================================================================================' + $a.ForegroundColor = "yellow" + Echo 'Welcome to the OpenStack Powershell Environment.' + $a.ForegroundColor = "gray" + Echo '========================================================================================' + Echo '' + $a.ForegroundColor = "green" + echo ' ==> Registering Providers...' + + $tempvar = get-programfilesdir + $tempvar = $tempvar + "\Openstack\OpenStack-Powershell" + cd $tempvar + import-module .\CLIManifest.psd1 -DisableNameChecking + + echo ' ==> Applying Command Aliases...' + echo ' ==> Registering Views...' + echo '' + +# --------------------------------------------------------------- +# Reset Shell to default colors.. +# --------------------------------------------------------------- + + $a.ForegroundColor = "yellow" + echo 'Ready..' + $a.ForegroundColor = "green" + echo '' + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Openstack.Client.Powershell/Deployment/Openstack.Client.Powershell.dll-Help.xml b/Openstack.Client.Powershell/Deployment/Openstack.Client.Powershell.dll-Help.xml new file mode 100644 index 0000000..5d1ee01 --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/Openstack.Client.Powershell.dll-Help.xml @@ -0,0 +1,9685 @@ + + + + + + + + + + + + + + + Copy-Id + + + This Cmdlet will copy a records Id column to the clipboard given a QuickPick Number. + + + + + Copy + Id + + + + + This Cmdlet will copy a records Id column to the clipboard given a QuickPick Number. + + + + + + + + + + + + + qp + + + The QuickPick Number of the row + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # copy-id 2 + + + Description + ----------- + + This command will copy the Id of the record represented by QuickPickNumber 2 + + + + + + + + + + + + + + + + + + + + + + + + Get-Config + + + This Cmdlet will print out what config file entries the current session is running under. + + + + + Get + Config + + + + + This Cmdlet will print out what config file entries the current session is running under. + + + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourstorageContainer:\> + + + # Get-Config + + + Description + ----------- + + Prints out settings for the current session. + + + + + + + + + + + + + + + + + + + + + + + Map-Drive + + + This Cmdlet will map a Container that someone else owns to your list of available drives. + + + + + Map + Drive + + + + + This Cmdlet will map a Container that someone else owns to your list of available drives. + + + + + + + + + s + + + The full Container path + + + string + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourContainer:\> + + + # map-drive https://objects.werr.net:443/v1/9153476658759/rgtest2 + + + Description + ----------- + + Maps the rgtest2 Container to the list of available drives for the user. + + + + + + + + + + + + + + + + + + + + + + + Remove-Drive + + + This Cmdlet will remove an existing mapped drive. + + + + + Map + Drive + + + + + This Cmdlet will remove an existing mapped drive. + + + + + + + + + s + + + The Container name + + + string + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourContainer:\> + + + # remove-drive rgtest + + + Description + ----------- + + removes the rgtest2 Container from the list of available drives. + + + + + + + + + + + + + + + + + + + + + + + Migrate-Drive + + + This Cmdlet is used migrate existing stores of data from external sources like S3, Dropbox and Skydrive to a target Container within OpenStack Object Storage. + + + + + Set + Config + + + + + This Cmdlet is used migrate existing stores of data from external sources like S3, Dropbox and Skydrive to a target Container within OpenStack Object Storage. + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourContainer:\> + + + # Migrate-Drive -p "S3" -sk "aa78676dhhh100" -ak "jhjhgu64332" -b "testb1", "testb2" + + + Description + ----------- + + Copies the testb1 and testb2 S3 Buckets to OpenStack Object Storage Containers of the same name. -sk = SecretKey -ak = AccessKey + + + + + + + + + + + + + + + + EXAMPLE 2 + + + PS yourContainer:\> + + + # Migrate-Drive -p "S3" -sk "aa78676dhhh100" -ak "jhjhgu64332" + + + Description + ----------- + + This example omits the Buckets (-b) parameter which forces the cmdlet to migrate all S3 Buckets to OpenStack Object Storage Containers of the same name. + + + + + + + + + + + + + + + + EXAMPLE 3 + + + PS yourContainer:\> + + + # Migrate-Drive -p "Skydrive" + + + Description + ----------- + + Migrates the local Skydrive store over to a Container called "Skydrive" + + + + + + + + + + + + + + + + EXAMPLE 4 + + + PS yourContainer:\> + + + # Migrate-Drive -p "Dropbox" + + + Description + ----------- + + Migrates the local Dropbox store over to a Container called "Dropbox" + + + + + + + + + + + + + + + + + + + + + + + + Set-Config + + + This Cmdlet is used to change specific settings on a per session basis. In addition to this, all settings may be changed at once by supplying the path to a completely different config file. + + + + + Set + Config + + + + + This Cmdlet is used to change specific settings on a per session basis. In addition to this, all settings may be changed at once by supplying the path to a completely different config file. + + + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourContainer:\> + + + # Set-Config -k "HttpTimeOut" -v "100" + + + Description + ----------- + + Changes the HttpTimeout setting to 100 miliseconds + + + + + + + + + + + + + + + + EXAMPLE 2 + + + PS yourContainer:\> + + + # Set-Config -s "c:\testconfig.config" + + + Description + ----------- + + Replaces all current session settings with those defined within the testconfig.config file. + + + + + + + + + + + + + + + + EXAMPLE 3 + + + PS yourContainer:\> + + + # Set-Config -resercfg" + + + Description + ----------- + + Resets the current session settings to those defined within the default config file (CLI.config) + + + + + + + + + + + + + + + + + + + + + + + + Get-Uri + + + This cmdlet will print out the fully qualified URI of the resource that you supply with optional parameters which constrain the URIs validity to a timepsan.. + + + + + Get + URI + + + + + When you issue this command the URI is also pasted to the Windows clipboard for your convenience. If you want to disable this behavior simply set the CLI.config option entitled PasteGetURIResultsToClipboard to false. + + + + + + + + + s + + + The Source Path to the StorageObject. + + + string + + + dv + + + The number of days the URI is considered valid (optional) + + + string + + + sv + + + The number of seconds the URI is considered valid (optional) + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourContainer:\> + + + # get-uri anothertest.txt + + + Description + ----------- + + This prints out the fully qualified URI for the anothertest.txt file. + + + + + + + + + + + + + + + + + + + + + + + + Get-Notes + + + + This cmdlet will pull a list of release notes from the server. You can also filter the notes to a specific version. + + + + + + Get + Notes + + + + + + + + + + + + + + all + + + Prints all release notes + + + + + string + + + v + + + Prints release notes for a specific version + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Get-Notes -all + + + Description + ----------- + + Prints the entire set of release notes from all releases. + + + + + + + + + + + + + + + + EXAMPLE 2 + + + + + + # Get-Notes -v "2.0.0.0" + + + Description + ----------- + + Prints out the release notes for the 2.0.0.0 release only. + + + + + + + + + + + + + + + + + + + + + + + + Get-Catalog + + + + This cmdlet will show the current Users service catalog that was retrieved when logging in. This catalog represents every service the user has authorization to use. + + + + + + Get + Catalog + + + + + + + + + + + + + + v + + + Verbose mode displays detailed information about each service that's available. + + + + + string + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Get-Catalog + + + Description + ----------- + + Shows a simple listing of available services. + + + + + + + + + + + + + + + + EXAMPLE 2 + + + + + + # Get-Catalog -v + + + Description + ----------- + + Shows a more detailed list of services with additional technical information. + + + + + + + + + + + + + + + + + + + + + + + + Get-Version + + + + Shows the products version number. + + + + + + Get + Version + + + + + + + + + + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Get-Version + + + Description + ----------- + + Shows the products current version. + + + + + + + + + + + + + + + + + + + + + + + + + + Remove-FloatingIP + + + This Cmdlet will completely remove an existing Floating IP address. + + + + + Remove + FloatingIP + + + + + This Cmdlet will completely remove an existing Floating IP address. + + + + + + + + + + + + + id + + + The identifier for the Floating IP address. + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # remove-floatingIP 4ee64397-1253-473c-a81d-bc23dceeef31 + + + Description + ----------- + + This command will delete the floatingIP with the id of 4ee64397-1253-473c-a81d-bc23dceeef31 + + + + + + + + + + + + + + + + + + + + + + Remove-Network + + + This Cmdlet will completely remove an existing Network. + + + + + Remove + Network + + + + + This Cmdlet will completely remove an existing Network. + + + + + + + + + + + + + id + + + The identifier of the Network + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # remove-network -id 12857174-99cf-40e9-999e-fb0fa2e84898 + + + Description + ----------- + + This command will delete the Network with the id of 12857174-99cf-40e9-999e-fb0fa2e84898 + + + + + + + + + + + + + + + + + + + + + + Remove-Port + + + This Cmdlet will completely remove an existing Port. + + + + + Remove + Port + + + + + This Cmdlet will completely remove an existing Port. + + + + + + + + + + + + + id + + + The identifier of the Port + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # remove-port -id 12857174-99cf-40e9-999e-fb0fa2e84898 + + + Description + ----------- + + This command will delete the Port with the id of 12857174-99cf-40e9-999e-fb0fa2e84898 + + + + + + + + + + + + + + + + + + + + + + Remove-Router + + + This Cmdlet will completely remove an existing Router. + + + + + Remove + Port + + + + + This Cmdlet will completely remove an existing Router. + + + + + + + + + + + + + id + + + The identifier of the Router + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # remove-router 12857174-99cf-40e9-999e-fb0fa2e84898 + + + Description + ----------- + + This command will delete the Router with the id of 12857174-99cf-40e9-999e-fb0fa2e84898 + + + + + + + + + + + + + + + + + + + + + + Remove-RouterInterface + + + TThis Cmdlet will completely remove an existing relation between a Subnet and Router. + + + + + Remove + Port + + + + + This Cmdlet will completely remove an existing relation between a Subnet and Router. + + + + + + + + + + + + + id + + + The identifier of the Router + + + string + + + + sid + + + The identifier of the Subnet. + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # remove-routerinterface -id 12857174-99cf-40e9-999e-fb0fa2e84898 -sid bd1c30f7-71f1-455e-b91e-8d03da7f5224 + + + Description + ----------- + + This command will remove the association between Router 12857174-99cf-40e9-999e-fb0fa2e84898 and Subnet bd1c30f7-71f1-455e-b91e-8d03da7f5224 + + + + + + + + + + + + + + + + + + + + + + Remove-Subnet + + + This Cmdlet will completely remove an existing Subnet. + + + + + Remove + Subnet + + + + + This Cmdlet will completely remove an existing Subnet. + + + + + + + + + + + + + id + + + The identifier of the Subnet + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # remove-Subnet 12857174-99cf-40e9-999e-fb0fa2e84898 + + + Description + ----------- + + This command will delete the Subnet with the id of 12857174-99cf-40e9-999e-fb0fa2e84898 + + + + + + + + + + + + + + + + + + + + + + New-FloatingIP + + + This Cmdlet will create a new FloatingIP. + + + + + New + FloatingIP + + + + + This Cmdlet will create a new FloatingIP. + + + + + + + + + + + + + pid + + + The identifier of the Port required to create the FloatingIP + + + string + + + + nid + + + The identifier of the Network required to create the FloatingIP + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # new-FloatingIP -pid 12857174-99cf-40e9-999e-fb0fa2e84898 -nid bd1c30f7-71f1-455e-b91e-8d03da7f5224 + + + Description + ----------- + + This command will create a new Floating IP address for Network 12857174-99cf-40e9-999e-fb0fa2e84898 and Port bd1c30f7-71f1-455e-b91e-8d03da7f5224 + + + + + + + + + + + + + + + + + + + + + + New-Network + + + This Cmdlet will create a new Network. + + + + + New + Network + + + + + This Cmdlet will create a new Network. + + + + + + + + + + + + + n + + + The name of the new Network + + + string + + + + asu + + + Determines if the AdminStateUp flag is true or false. + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # new-network "testNet1" -asu + + + Description + ----------- + + This command will create a new network called testNet1 with its AdminStateUp set to true. + + + + + + + + + + + + + + + + + + + + + + New-Port + + + This Cmdlet will create a new Port. + + + + + New + Port + + + + + This Cmdlet will create a new Port. + + + + + + + + + + + + + n + + + The name of the new Port + + + string + + + + asu + + + Determines if the AdminStateUp flag is true or false. + + + string + + + + nid + + + The id of the Network where the Port will exist. + + + string + + + + did + + + The Ports DeviceId + + + string + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # new-port "testPort1" -nid bd1c30f7-71f1-455e-b91e-8d03da7f5224 -asu -did "sdf\etc" + + + Description + ----------- + + This command will create a new Port called testNet1 on Network bd1c30f7-71f1-455e-b91e-8d03da7f5224 with its AdminStateUp set to true and a Device = sdf/etc. + + + + + + + + + + + + + + + + + + + + + + New-Router + + + This Cmdlet will create a new Router. + + + + + New + Router + + + + + This Cmdlet will create a new Router. + + + + + + + + + + + + + n + + + The name of the new Router + + + string + + + + asu + + + Determines if the AdminStateUp flag is true or false. + + + string + + + + egw + + + The id of the External Gateway Network Id. + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # new-router "testRouter1" -asu -egw bd1c30f7-71f1-455e-b91e-8d03da7f5224 + + + Description + ----------- + + This command will create a new Router called testRouter1 on External Network bd1c30f7-71f1-455e-b91e-8d03da7f5224 with its AdminStateUp set to true. + + + + + + + + + + + + + + + + + + + + + + New-RouterInterface + + + This Cmdlet will create a new Router. + + + + + New + RouterInterface + + + + + This Cmdlet will create a new RouterInterface. + + + + + + + + + + + + + rid + + + The Router Id + + + string + + + + sid + + + The Subnet Id + + + string + + + + pid + + + The Port Id + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # new-routerinterface -rid bd1c30f7-71f1-455e-b91e-8d03da7f5224 -pid c9e32588-5b69-4100-a1a6-fa49094ec0a8 -sid 7yuu9886-5b69-4100-a1a6-fa49094ec0a8 + + + Description + ----------- + + This command will create a new Relationship between Router (bd1c30f7-71f1-455e-b91e-8d03da7f5224), Port (c9e32588-5b69-4100-a1a6-fa49094ec0a8) and Subnet (7yuu9886-5b69-4100-a1a6-fa49094ec0a8) + + + + + + + + + + + + + + + + + + + + + + New-Subnet + + + This Cmdlet will create a new Subnet. + + + + + New + Subnet + + + + + This Cmdlet will create a new Subnet. + + + + + + + + + + + + + nid + + + The id of the Network Id. + + + string + + + + ipv + + + Sets the IP Version + + + string + + + + c + + + The CIDR value + + + string + + + a + + + A comma seperated list of Allocation Pools. + + + string + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # new-subnet -nid bd1c30f7-71f1-455e-b91e-8d03da7f5224 -ipv 4 -c "10.0.6.0/24" -a "10.0.6.20", "10.0.6.22" , "10.0.6.26", "10.0.6.29" + + + Description + ----------- + + This command will create a new Subnet. + + + + + + + + + + + + + + + + + + + + + + Update-FloatingIP + + + This Cmdlet will update an existing FloatingIP. + + + + + Update + FloatingIP + + + + + This Cmdlet will update an existing FloatingIP. + + + + + + + + + + + + + id + + + The identifier of the Floating IP + + + string + + + + pid + + + The identifier of the Port Id + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # update-FLoatingIP -fid 12857174-99cf-40e9-999e-fb0fa2e84898 -pid c9e32588-5b69-4100-a1a6-fa49094ec0a8 + + + Description + ----------- + + This command will reassign the Floating IP (12857174-99cf-40e9-999e-fb0fa2e84898) to the new Port (c9e32588-5b69-4100-a1a6-fa49094ec0a8) + + + + + + + + + + + + + + + + + + + + + + Update-Network + + + This Cmdlet will update an existing Network. + + + + + Update + Network + + + + + This Cmdlet will update an existing Network. + + + + + + + + + + + + + id + + + The identifier of the Network IP + + + string + + + + n + + + The Networks name + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # update-Network -id 12857174-99cf-40e9-999e-fb0fa2e84898 -n "NewNameTest" + + + Description + ----------- + + This command will change the Network(12857174-99cf-40e9-999e-fb0fa2e84898) name to NewNameTest. + + + + + + + + + + + + + + + + + + + + + + Update-Port + + + This Cmdlet will update an existing Port. + + + + + Update + Port + + + + + This Cmdlet will update an existing Port. + + + + + + + + + + + + + id + + + The identifier of the Port IP + + + string + + + + did + + + The Device Id + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # update-Port -id 12857174-99cf-40e9-999e-fb0fa2e84898 -did "984456484-76cf-431t-66f-uyt5674567543" + + + Description + ----------- + + This command will change the Port(12857174-99cf-40e9-999e-fb0fa2e84898) device to the devie with Id = 984456484-76cf-431t-66f-uyt5674567543 + + + + + + + + + + + + + + + + + + + + + + Update-Router + + + This Cmdlet will update an existing Router. + + + + + Update + Router + + + + + This Cmdlet will update an existing Router. + + + + + + + + + + + + + id + + + The identifier of the Router + + + string + + + + nid + + + The identifier of the Network + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # update-Router -id 12857174-99cf-40e9-999e-fb0fa2e84898 -nid c9e32588-5b69-4100-a1a6-fa49094ec0a8 + + + Description + ----------- + + This command will reassign the Router(12857174-99cf-40e9-999e-fb0fa2e84898) to Network (c9e32588-5b69-4100-a1a6-fa49094ec0a8) + + + + + + + + + + + + + + + + + + + + + + Update-Subnet + + + This Cmdlet will update an existing Subnet. + + + + + Update + Subnet + + + + + This Cmdlet will update an existing Subnet. + + + + + + + + + + + + + id + + + The identifier of the Subnet + + + string + + + + egw + + + The identifier of the External Network Gateway + + + string + + + + n + + + The new name of the Subnet + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # update-Subnet -id 12857174-99cf-40e9-999e-fb0fa2e84898 -egw c9e32588-5b69-4100-a1a6-fa49094ec0a8 -n "NewSubnetName" + + + Description + ----------- + + This command will reassign the Subnet(12857174-99cf-40e9-999e-fb0fa2e84898) to External Network (c9e32588-5b69-4100-a1a6-fa49094ec0a8) with the new name of "NewSubnetName" + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get-Metadata + + + This Cmdlet will list out the Metadata entries assigned to the supplied resource. You can currently list metadata assigned to Servers, Storage Objects , Containers and CDN Containers. + + + + + Get + Metadata + + + + + Many resources can have zero to many custom meta-data entries assigned to them. This is essentially a list of Key Value Pairs attached to the resource that you may use for whatever you would like. + + + + + + + + + + + + + sp + + + The path to the remote Storage Object. Paths may be expressed as fully qualified or relative to the current location in the store. + + + string + + + + cn + + + The Container Name. + + + string + + + + cdn + + + The CDN Container Name. + + + string + + + + sid + + + The Server ID. + + + string + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourContainer:\> + + + # Get-metadata test.txt + + + Description + ----------- + + This command will print out a list of name value pairs assigned to the. For details on how to add meta-data elements see the Set-Metadata Cmdlet. + + + + + + + + + + + + + + + + EXAMPLE 2 + + + + + + # Get-metadata -sid 23465 + + + Description + ----------- + + This command will print out all Metadata entries for the Server with an ID = 23465. + + + + + + + + + + + + + + + + EXAMPLE 3 + + + + + + # Get-metadata -cn "Marketing" + + + Description + ----------- + + This command will print out all Metadata entries for the Marketing Container. + + + + + + + + + + + + + + + + EXAMPLE 4 + + + + + + # Get-metadata -cdn "Marketing" + + + Description + ----------- + + This command will print out all Metadata entries for the Marketing CDN Container. + + + + + + + + + + + + + + + + + + + + + + + + Set-Metadata + + + This Cmdlet can be used to add meta-data elements to an existing resource. + + + + + Set + Metadata + + + + + Resources can have zero to many custom meta-data entries assigned to them. This is essentially a list of Key Value Pairs attached to the object that you may use for whatever you would like. + + + + + + Set-Metadata [-sp] [-sid] [-cdn] -md + + + + + + + sp + + + The path to a remote Storage Object. Paths may be expressed as fully qualified or relative to the current location in the store. + + + string + + + md + + + This is a comma delimited set of Name Value Pairs enclosed in quotes. the Key and Values are delimited by the pipe symbol." + + + string + + + + sid + + + The Server Id + + + string + + + + cdn + + + The CDN Container name. + + + string + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourContainer:\> + + + # Set-metadata test.txt -md "Author|Tom", "Editor|Sam" + + + Description + ----------- + + This example shows us adding two seperate KVPs to the test.txt file. + + + + + + + + + + + + + + + + EXAMPLE 2 + + + + + + # Set-metadata -sid 1345 -md "Author|Tom", "Editor|Sam" + + + Description + ----------- + + This example applies the Key Value Pair (-md argument) to the Server with an Id = 1345. + + + + + + + + + + + + + + + + EXAMPLE 3 + + + + + + # Set-metadata -cdn "Marketing" -md "Author|Tom", "Editor|Sam" + + + Description + ----------- + + This example applies the Key Value Pair (-md argument) to the CDN Container called Marketing. + + + + + + + + + + + + + + + + + + + + + + + + Get-URI + + + This Cmdlet will show the fully qualified URI of an object in storage. + + + + + Get + Metadata + + + + + + + + + + + s + + + + + + + s + + + The path to the remote Storage Object. Paths may be expressed as fully qualified or relative to the current location in the store. + + + string + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourContainer:\> + + + # Get-URI test.xml + + + Description + ----------- + + This example shows the fully qualifed URI for the test.xml file located in the current directory. + + + + + + + + + + + + + + + + + + + + + + + Remove-Item + + + This Cmdlet remove an object in storage. + + + + + Remove + Item + + + + + + + + + + + s + + + + + + + t + + + The path to the remote Storage Object. Paths may be expressed as fully qualified or relative to the current location in the store. + + + string + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourContainer:\> + + + # Remove-Item test.xml + + + Description + ----------- + + This example the test.xml file located in the current directory. + + + + + + + + + + + + + + + + + + + + + + + + + + + Set-Scope + + + This sets a Containers scope to public. + + + + + Get + Metadata + + + + + To allow users other than the owner of a Container to access resources you need to set the Containers scope to Public with this cmdlet. + + + + + + SourcePath + + + + + + + Name + + + The Containers name. + + + string + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourContainer:\> + + + #set-scope testContainer -s public + + + Description + ----------- + + This example shows us changing the testContainers scope to public. + + + + + + + + + + + + + + + + + + + + + + + Remove-Container + + + Removes the specified Container from the system optionally forcing the operation to complete without confirmation. + + + + + Remove + Container + + + + + + + + + + + + + + Name + + + The name of the Container to remove. + + + string + + + + ForceDelete + + + This switch forces the Container to be removed without any confirmation prompt. + + + string + + + cdn + + + Removes any associated CDN entry when the Container is removed. + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourContainer:\> + + + # remove-container testContainer + + + Description + ----------- + + Removes testContainer from the system but prompts the user for confirmation before continuing. + + + + + + + + + + + + + + + + EXAMPLE 2 + + + PS yourContainer:\> + + + # remove-container testContainer -fd + + + Description + ----------- + + Forces the system to delete the specified Container without confirmation from the user. + + + + + + + + + + + + + + + + + + + + + + + + New-Container + + + This Cmdlet create a new storage Container. + + + + + New + Container + + + + + You must be a registered user of the OpenStack Cloud Services platform in order to perform this operation because it requires a valid access key id to authenticate the request. Therefore anonymous requests can not create Containers. When you create a Container, you become the Container owner. + + + + + + Name + + + + + + Name + + + The name of the Container to create. + + + + + string + + + Url + + + The url to a Shared Container. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourContainer:\> + + + # New-Container marketing + + + Description + ----------- + + This command will create a new Container named marketing. + + + + + + + + + + + + + + + EXAMPLE 2 + + + PS yourContainer:\> + + + # New-Container https://region-a.geo-1.objects.Openstacksvc.com/v1/AUTH_2485a207-71a4-4429-9e24-f7bf49e207fc/testcon + + + Description + ----------- + + This command will allow use of the Shared Container named testcon. + + + + + + + + + + + + + + + + + + + + + + + + + + + + New-Volume + + + This Cmdlet creates a new Block Storage Volume. + + + + + New + Volume + + + + + + + + + + + New-Volume + + + + + + svid + + + The Source Volume Id to derive this volume from. The Source Volume Id must reside in the same AZ as the one you are creating. + + + + + string + + + az + + + The target Availability Zone to create the Volume in. + + + + + string + + + Name + + + The name of the Volume to create. + + + + + string + + + Description + + + A quick description of the Volumes purpose. + + + + + string + + + Size + + + The size (in Gb) of the Volume. + + + + + string + + + Metadata + + + Additional Metadata associated with the Volume. This will be a comma delimited set of name value pairs which are themselves pipe delimited. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # New-Volume "TestVolume" "This is a simple Volume test" 20 + + + Description + ----------- + + This command will create a new 20 gig Volume. + + + + + + + + + + + + + + + EXAMPLE 2 + + + + + + # New-Volume "TestVolume" "This is a simple Volume test" 20 "test|data", "another|test" + + + Description + ----------- + + This command will create a new 20 gig Volume with additional metadata + + + + + + + + + + + + + + + + + + + + + + + + Remove-Volume + + + This Cmdlet deletes an existing Block Storage Volume. + + + + + Remove + Volume + + + + + + + + + + + Remove-Volume + + + + + + VolumeId + + + The Volumes unique identifier. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Remove-Volume 12857174-99cf-40e9-999e-fb0fa2e84898 + + + Description + ----------- + + This command will remove a existing Volume with an Id = 12857174-99cf-40e9-999e-fb0fa2e84898. + + + + + + + + + + + + + + + + + + + + + + + + + Attach-Volume + + + This Cmdlet associates a Volume with an existing Server. + + + + + Attach + Volume + + + + + + + + + + + Attach-Volume + + + + + + id + + + The id of the target Server. + + + + + string + + + VolumeId + + + The Volumes unique identifier. + + + + + string + + + Device + + + The associations Device name. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Attach-Volume -s 12857174-99cf-40e9-999e-fb0fa2e84898 -v 7da74520-9d5e-427b-a508-213c84e69616 "/dev/vdp" + + + Description + ----------- + + This command will associate Volume 7da74520-9d5e-427b-a508-213c84e69616 to Server 12857174-99cf-40e9-999e-fb0fa2e84898 with an assigned device name of /dev/vdX. + + + + + + + + + + + + + + + + + + + + + + + Detach-Volume + + + This Cmdlet disassociates a Volume with an existing Server. + + + + + Detach + Volume + + + + + + + + + + + Detach-Volume + + + + + + Id + + + The id of the target Server. + + + + + string + + + VolumeId + + + The Volumes unique identifier. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Detach-Volume -v 7da74520-9d5e-427b-a508-213c84e69616 -s 4ee64397-1253-473c-a81d-bc23dceeef31 + + + Description + ----------- + + This command will disassociate Volume a508 from Server 4ee64397-1253-473c-a81d-bc23dceeef31. + + + + + + + + + + + + + + + + + + + + + + + New-Snapshot + + + This Cmdlet creates a new Block Storage Snapshot. + + + + + New + Snapshot + + + + + + + + + + + New-Snapshot + + + + + + Name + + + The name of the Snapshot to create. + + + + + string + + + Description + + + A quick description of the Snapshots contents. + + + + + string + + + VolumeId + + + The Id of the Volume that we're taking the snapshot of. + + + + + string + + + Force + + + Force + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # New-Snapshot -n "TestSnapshot" -d "This is a simple Snapshot test" -v 4ee64397-1253-473c-a81d-bc23dceeef31 + + + Description + ----------- + + This command will create a new snapshot of Volume 4ee64397-1253-473c-a81d-bc23dceeef31 + + + + + + + + + + + + + + + + + + + + + + + Remove-Snapshot + + + This Cmdlet deletes an existing Block Storage Snapshot. + + + + + Remove + Snapshot + + + + + + + + + + + Remove-Snapshot + + + + + + SnapshotId + + + The Snapshots unique identifier. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Remove-Snapshot -s 4ee64397-1253-473c-a81d-bc23dceeef31 + + + Description + ----------- + + This command will remove a existing Snapshot with an Id = 4ee64397-1253-473c-a81d-bc23dceeef31. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + New-Keypair + + + This Cmdlet creates a new keypair for the user. + + + + + New + Keypair + + + + + + + + + + + New-Keypair + + + + + + Name + + + The name of the Keypair to create. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # New-Keypair "TestKey" + + + Description + ----------- + + This command will create a new Keypair named TestKey. + + + + + + + + + + + + + + + + + + + + + + + + Remove-Keypair + + + This Cmdlet deletes a previously created keypair for the user. + + + + + Remove + Keypair + + + + + + + + + + + Remove-Keypair + + + + + + Name + + + The name of the Keypair to delete. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Remove-Keypair "TestKey" + + + Description + ----------- + + This command will delete an existing Keypair named TestKey. + + + + + + + + + + + + + + + + + + + + + + + + Disassociate-IP + + + This Cmdlet releases a previously allocated IP address. + + + + + Disassociate + IP + + + + + + + + + + + Disassociate-IP + + + + + + ip + + + The IP address to release. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Disassociate-IP 4ee64397-1253-473c-a81d-bc23dceeef31 + + + Description + ----------- + + This command will release a previously allocated IP address. + + + + + + + + + + + + + + + + + + + + + + + + UnAssign-IP + + + This Cmdlet assigns an existing IP address to an existing Server. + + + + + UnAssign + IP + + + + + + + + + + + UnAssign-IP + + + + + + ip + + + The IP address to disassociate. + + + + + string + + + sid + + + The Server Id that will be disassociated from the supplied IP address. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + #Unassign-IP "192.168.110.45" -s 4ee64397-1253-473c-a81d-bc23dceeef31 + + + Description + ----------- + + This command will remove the supplied IP address from server 4ee64397-1253-473c-a81d-bc23dceeef31 + + + + + + + + + + + + + + + + + + + + + + + + Assign-IP + + + This Cmdlet assigns an existing IP address to an existing Server. + + + + + Assign + IP + + + + + + + + + + + Assign-IP + + + + + + ip + + + The IP address to assign. + + + + + string + + + sid + + + The Server Id that will be assigned to. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + #Assign-IP "192.168.110.45" -s 4ee64397-1253-473c-a81d-bc23dceeef31 + + + Description + ----------- + + This command will assign the supplied IP address to server 4ee64397-1253-473c-a81d-bc23dceeef31 + + + + + + + + + + + + + + + + + + + + + + + + New-CDN + + + This Cmdlet will create a new CDN entry for the specified Container. + + + + + New + CDN + + + + + + + + + + + New-CDN + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # New-CDN -n "TestContainer" + + + Description + ----------- + + Associates a new CDN entry for the existing Container called TestContainer. + + + + + + + + + + + + + + + + + + + + + + + + Remove-CDN + + + This Cmdlet will remove a CDN entry for the specified Container. + + + + + Remove + CDN + + + + + + + + + + + Remove-CDN + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Remove-CDN -n "TestContainer" + + + Description + ----------- + + Disassociates the CDN entry for existing container TestContainer. + + + + + + + + + + + + + + + + + + + + + + + + List-CDN + + + This Cmdlet will list out all Containers that have associated CDN entries. + + + + + List + CDN + + + + + + + + + + + List-CDN + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # List-CDN + + + Description + ----------- + + This cmdlet will list out all Containers with associated CDN entries. + + + + + + + + + + + + + + + + + + + + + + + + Set-Zone + + + This Cmdlet will force subsequent cmdlets to utilize the Availability Zone supplied. + + + + + Set + Zone + + + + + + + + + + + Set-Zone + + + + + + z + + + The Availability ZoneID to be set. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Set-Zone 1 + + + Description + ----------- + + This command will cause all susequent Compute related IO to be directed to the AZ-2 Zone which has the Id of 1. The Id's for each Zone can be found by issueing the Get-Zones cmdlet. + + + + + + + + + + + + + + + + + + + + + + + + Set-ZoneColor + + + This command will set all output to a specific color when the User selects the Zone via Set-Zone. + + + + + Set + ZoneColor + + + + + + + + + + + Set-ZoneColor + + + + + + z + + + The Availability ZoneID to be set. + + + + + string + + + c + + + The color for the zones output. Valid values are "Black", "Blue", "Cyan", "DarkBlue", "DarkCyan", "DarkGray", "DarkGreen", "DarkMagenta", "DarkRed", "DarkYellow", "Gray", "Green", "Magenta", "Red", "White", and "Yellow". + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Set-ZoneColor -z 1 -c Green + + + Description + ----------- + + This command will set all output to Green when the User selects the Zone via Set-Zone. + + + + + + + + + + + + + + + + + + + + + + + + Get-Zone + + + This Cmdlet will current Availability Zone being used. + + + + + Get + Zone + + + + + + + + + + + Get-Zone + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Get-Zone + + + Description + ----------- + + This command will simply show the current Availability Zone in use. + + + + + + + + + + + + + + + + + + + + + + + + Associate-IP + + + This Cmdlet will request a new Floating IP address from the server. + + + + + Associate + IP + + + + + + + + + + + Associate-IP + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Associate-IP + + + Description + ----------- + + Request a new Floating IP address from the server. + + + + + + + + + + + + + + + + + + + + + + + + Add-Rule + + + This Cmdlet creates a new Security Group Rule and assigns it to an existing Security Group + + + + + Add + Rule + + + + + + + + + + + Add-Rule + + + + + + d + + + Ingress or egress: The direction in which the security group rule is applied. For a compute instance, an ‘ingress’ security group rule matches traffic that is incoming (ingress) for that instance. An ‘egress’ rule is applied to traffic leaving the instance. + + + + + string + + + max + + + The maximum port number in the range that is matched by the security group rule. The port_range_min attribute constrains the port_range_max attribute. If the protocol is ICMP, this value must be an ICMP type. + + + + + string + + + min + + + The minimum port number in the range that is matched by the security group rule. If the protocol is TCP or UDP, this value must be less than or equal to the value of the port_range_max attribute. If the protocol is ICMP, this value must be an ICMP type. + + + + + string + + + p + + + The protocol that is matched by the security group rule. Valid values are null, tcp, udp, and icmp. + + + + + string + + + rgid + + + The remote group ID to be associated with this security group rule. + + + + + string + + + ripp + + + The remote IP prefix to be associated with this security group rule. + + + + + string + + + sgid + + + The Security GroupId used to apply this rule. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Add-Rule -min "80" -max "85" -d "ingress" -et -p icmp IPv4 -sgid 2076db17-a522-4506-91de-c6dd8e837028 + + + Description + ----------- + + This will create a new Security Group Rule affecting the tcp protocol from port 80 to 85 and assign it to SecurityGroup 2076db17-a522-4506-91de-c6dd8e837028. + + + + + + + + + + + + + + + + + + + + + + + + Remove-Rule + + + This Cmdlet will delete an existing Security Group Rule. + + + + + Remove + Rule + + + + + + + + + + + Remove-Rule + + + + + + id + + + The Security GroupRuleId used to remove the rule. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Remove-Rule -id 4ee64397-1253-473c-a81d-bc23dceeef31 + + + Description + ----------- + + Remove the SecurityGroupRule with an Id of 4ee64397-1253-473c-a81d-bc23dceeef31. + + + + + + + + + + + + + + + + + + + + + + + + New-SecurityGroup + + + This Cmdlet creates a new Security Group. + + + + + New + SecurityGroup + + + + + + + + + + + New-SecurityGroup + + + + + + n + + + The name of the new Security Group. + + + + + string + + + d + + + A brief description of the groups purpose. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # New-SecurityGroup -n "TestGroup" -d "SomeDescription" + + + Description + ----------- + + This command will create a simple test Security Group. + + + + + + + + + + + + + + + + + + + + + + + + Remove-SecurityGroup + + + This Cmdlet will delete an existing Security Group. + + + + + Remove + SecurityGroup + + + + + + + + + + + Remove-SecurityGroup + + + + + + id + + + The identifier used to remove the Security Group. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Remove-SecurityGroup -id 4ee64397-1253-473c-a81d-bc23dceeef31 + + + Description + ----------- + + Remove the Security Group with an Id of 4ee64397-1253-473c-a81d-bc23dceeef31. + + + + + + + + + + + + + + + + + + + + + + + + Add-Metadata + + + This Cmdlet associates a set of key value pairs with a Server. + + + + + Add + Metadata + + + + + + + + + + + Add-Metadata + + + + + + md + + + A pipe delimited set of Name Value Pairs seperated by commas. "Namevalue1 | value1" , "NameValue2 | value2", "NameValue3 | value3" etc.. + + + + + string + + + s + + + The identifier (ServerId) used to associate this metadata with. If your currently viewing a Servers details this parameter may be ommited as it's supplied for you. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Add-Metadata -md "Namevalue1 | value1" , "NameValue2 | value2", "NameValue3 | value3" -s 4ee64397-1253-473c-a81d-bc23dceeef31 + + + Description + ----------- + + This command will add threee Name Value Pairs to Server 4ee64397-1253-473c-a81d-bc23dceeef31. + + + + + + + + + + + + + + + + + + + + + + + + New-Server + + + This Cmdlet creates a new Server. + + + + + New + Server + + + + + + + + + + + New-Server + + + + + + nid + + + A Comma seperated list of targeted network Ids. + + + + + string + + + az + + + Ther Servers Availability Zone + + + + + string + + + + n + + + The Servers name. + + + + + string + + + i + + + The identifier (ImageRefId) used to define this Server. + + + + + string + + + k + + + The name of a keypair to assign to the newly created Server. + + + + + string + + + sg + + + A comma delimited set of quoted SecurityGroup names that are to be applied to the newly created Server. + + + + + string + + + f + + + The identifier (FlavorRefId) used to define this Server. + + + + + string + + + p + + + A password may be specified when creating the server via this optional parameter. If a password is not specified, a randomly generated password will be assigned and returned in the response. + + + + + string + + + ip4 + + + ip4 based access address. + + + + + string + + + ip6 + + + ip6 based access address. + + + + + string + + + md + + + A pipe delimited set of Name Value Pairs seperated by commas. "Namevalue1 | value1" , "NameValue2 | value2", "NameValue3 | value3" etc.. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # New-Server -n "TestServer" -p "gooblygook" -i "2111" -f "100" -md "Namevalue1 | value1" , "NameValue2 | value2", "NameValue3 | value3" -s 4ee64397-1253-473c-a81d-bc23dceeef31 + + + Description + ----------- + + This command will create a new server with some metadata. + + + + + + + + + + + + + + + EXAMPLE 2 + + + + + + # New-Server -n "TestServer" -p "gooblygook" -i "2111" -f "100" -s "2133" -k "testkey" + + + Description + ----------- + + This command will create a new server using the testkey keypair name. + + + + + + + + + + + + + + + + + + + + + + + + Reboot-Server + + + This cmdlet allows for either a soft or hard reboot of a server. With a soft reboot, the operating system is signaled to restart, which allows for a graceful shutdown of all processes. A hard reboot is the equivalent of power cycling the server. + + + + + Reboot + Server + + + + + + + + + + + Reboot-Server + + + + + + id + + + The Servers identifier. + + + + + string + + + + + + + + + + + + t + + + + + + With a soft reboot (SOFT), the operating system is signaled to restart, which allows for a graceful shutdown of all processes. A hard reboot (HARD) is the equivalent of power cycling the server. + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Reboot-Server -s 4ee64397-1253-473c-a81d-bc23dceeef31 -t "SOFT" + + + Description + ----------- + Perform a soft reboot on the specified server + + + + + + + + + + + + + + + + + + + + + + + + Remove-Server + + + This cmdlet deletes an existing Server. + + + + + Remove + Server + + + + + + + + + + + Remove-Server + + + + + + id + + + The Servers identifier. + + + + + string + + + + + + + + + + + + t + + + + + + Deletes an existing Server. + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Remove-Server -s 4ee64397-1253-473c-a81d-bc23dceeef31 + + + Description + ----------- + + Deletes the server with the identifier 4ee64397-1253-473c-a81d-bc23dceeef31. + + + + + + + + + + + + + + + + + + + + + + + + Reset-Password + + + This cmdlet resets the administrators password for the given Server. + + + + + Reset + Password + + + + + + + + + + + Reset-Password + + + + + + id + + + The Servers identifier. + + + + + string + + + + + + + + + + + + p + + + + + + The password which must meet the complexity requirements set by your OpenStack Compute provider. + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Reset-Password -id 4ee64397-1253-473c-a81d-bc23dceeef31 -p "testpassword08" + + + Description + ----------- + + Resets the Admin password on Server 4ee64397-1253-473c-a81d-bc23dceeef31. + + + + + + + + + + + + + + + + + + + + + + + + Update-Server + + + This cmdlet allows you to change the Servers name property. + + + + + Update + Server + + + + + + + + + + + Update-Server + + + + + + id + + + The Servers identifier. + + + + + string + + + + + + + + + + + + n + + + + + + The new Server name. + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Update-Server -id 4ee64397-1253-473c-a81d-bc23dceeef31 -n "NewName" + + + Description + ----------- + + Updates Server 4ee64397-1253-473c-a81d-bc23dceeef31 to the new name of NewName. + + + + + + + + + + + + + + + + + + + + + + + + New-Image + + + This Cmdlet crfeates a new Image based on an existing Server. + + + + + New + Image + + + + + + + + + + + New-Image + + + + + + md + + + A pipe delimited set of Name Value Pairs seperated by commas. "Namevalue1 | value1" , "NameValue2 | value2", "NameValue3 | value3" etc.. + + + + + string + + + s + + + The identifier (ServerId) to base the Image on. + + + + string + + + n + + + The name of the new Image. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # New-Image -md "Namevalue1 | value1" , "NameValue2 | value2", "NameValue3 | value3" -s 4ee64397-1253-473c-a81d-bc23dceeef31 -n "TestImage" + + + Description + ----------- + + This command will add three Name Value Pairs to the image for Server 4ee64397-1253-473c-a81d-bc23dceeef31. + + + + + + + + + + + + + + + + + + + diff --git a/Openstack.Client.Powershell/Deployment/OpenstackShell.format.ps1xml b/Openstack.Client.Powershell/Deployment/OpenstackShell.format.ps1xml new file mode 100644 index 0000000..b88bb75 --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/OpenstackShell.format.ps1xml @@ -0,0 +1,1729 @@ + + + + + + + service + + Openstack.Objects.Domain.Admin.Zone + + + + + + + 8 + left + + + + 20 + left + + + + 23 + left + + + + 10 + left + + + + + + + + Id + + + Name + + + ShellForegroundColor + + + IsDefault + + + + + + + + + service + + Openstack.Objects.Domain.BlockStorage.Snapshot + + + + + + + 3 + left + + + + 40 + left + + + + 20 + left + + + + 40 + left + + + + 22 + left + + + + 18 + left + + + + 7 + left + + + + 40 + left + + + + + + + QuickPickNumber + + + Id + + + DisplayName + + + Description + + + CreationDate + + + Status + + + Size + + + VolumeId + + + + + + + + + + + service + + Openstack.Objects.Domain.BlockStorage.VolumeBackup + + + + + + 3 + left + + + + 45 + left + + + + 20 + left + + + + 20 + left + + + + 8 + left + + + + 10 + left + + + + 10 + left + + + + 28 + left + + + + 18 + left + + + + 42 + left + + + + + + + QuickPickNumber + + + Id + + + Name + + + Container + + + Size + + + Status + + + AvailabilityZone + + + CreatedDate + + + ObjectCount + + + VolumeId + + + + + + + + + + service + + Openstack.Objects.Domain.BlockStorage.Volume + + + + + + 3 + left + + + + 45 + left + + + + 20 + left + + + + 30 + left + + + + 6 + left + + + + 8 + left + + + + 8 + left + + + + 22 + left + + + + 10 + left + + + + 10 + left + + + + 10 + left + + + + 30 + left + + + + 40 + left + + + + + + + QuickPickNumber + + + Id + + + Name + + + Description + + + VolumeType + + + Size + + + IsBootable + + + CreationDate + + + Status + + + AvailabilityZone + + + Device + + + AttachedTo + + + SourceVolid + + + + + + + + + KeyPair + + Openstack.Objects.Domain.Server.KeyPair + + + + + + + 40 + left + + + + + 50 + left + + + + + 330 + left + + + + + + + + + + Name + + + + Fingerprint + + + + PublicKey + + + + + + + + + + + + + Port + + Openstack.Objects.Domain.Networking.Port + + + + + + + + 3 + left + + + + + 40 + left + + + + + 13 + left + + + + + 6 + left + + + + 16 + left + + + + 25 + left + + + + 40 + left + + + + 40 + left + + + + 21 + left + + + + 16 + left + + + + + + + + + QuickPickNumber + + + Id + + + Name + + + Status + + + AdminStateUp + + + MacAddress + + + DeviceOwner + + + DeviceId + + + PortSecurityEnabled + + + BindingType + + + + + + + + + + Subnet + + Openstack.Objects.Domain.Networking.Subnet + + + + + + + 3 + left + + + + + 40 + left + + + + + 34 + left + + + + + 7 + left + + + + 24 + left + + + + 11 + left + + + + 24 + left + + + + + + + QuickPickNumber + + + Id + + + Name + + + EnableDHCP + + + Cidr + + + IPVersion + + + GatewayIP + + + + + + + + + service + + Openstack.Client.Powershell.Utility.ServiceProvider + + + + + + 15 + left + + + + 80 + left + + + + 7 + left + + + + 30 + left + + + + + + + Name + + + AuthenticationServiceURI + + + IsDefault + + + + DefaultTenantId + + + + + + + + + service + + Openstack.Objects.Domain.Networking.FloatingIP + + + + + + + 3 + left + + + + + 42 + left + + + + + 20 + left + + + + + 42 + left + + + + + 15 + left + + + + + 15 + left + + + + + 15 + left + + + + + + + + + + QuickPickNumber + + + + Id + + + + FloatingIPAddress + + + + FloatingNetworkId + + + + FixedIPAddress + + + + PortId + + + + RouterId + + + + + + + + + + StorageContainer + + Openstack.Objects.Domain.StorageContainer + + + + + + 40 + left + + + + + + + Name + + + + + + + + + Network + + Openstack.Objects.Domain.Networking.Network + + + + + + + + 3 + left + + + + + 40 + left + + + + + 13 + left + + + + + 6 + left + + + + + 6 + left + + + + + 6 + left + + + + + + + + + + QuickPickNumber + + + + Id + + + + Name + + + + IsExternal + + + + Shared + + + + PortSecurityEnabled + + + + + + + + + + service + + Openstack.Objects.Domain.Admin.Service + + + + + + + 20 + left + + + + + 27 + left + + + + + + + + + + Type + + + + Name + + + + + + + + + + process4 + + Openstack.Client.Powershell.Providers.ObjectStorage.StorageItemViewModel + + + + + + 47 + left + + + + 13 + left + + + + 25 + left + + + + 40 + left + + + + + + + Name + + + Size + + + LastModifiedDate + + + Type + + + + + + + + + + process4 + + Openstack.Storage.StorageObject + + + + + + 47 + left + + + + 13 + left + + + + 25 + left + + + + 40 + left + + + + + + + Name + + + Length + + + LastModified + + + ContentType + + + + + + + + + process5 + + Openstack.Storage.StorageFolder + + + + + + 47 + left + + + + + 40 + left + + + + + + + Name + + + + ContentType + + + + + + + + + Router + + Openstack.Objects.Domain.Networking.Router + + + + + + + 3 + left + + + + + 40 + left + + + + 47 + left + + + + + 13 + left + + + + + 14 + left + + + + + + + + + + + QuickPickNumber + + + + Id + + + Name + + + + Status + + + AdminStateUp + + + + + + + + + + + process + + Openstack.Client.Powershell.Providers.Common.BaseUIContainer + + + + + + + 15 + left + + + + + 100 + left + + + + + 13 + left + + + + + 40 + left + + + + + + + + + Name + + + + Description + + + ObjectType + + + Path + + + + + + + + + process + + Openstack.Administration.Domain.User + + + + + + + 15 + left + + + + + 20 + left + + + + + 20 + left + + + + + + + + + AccountId + + + + Username + + + Name + + + + + + + + + + process + + Openstack.Objects.Domain.Compute.Account + + + + + + + 15 + left + + + + + 20 + left + + + + + + + + + + Id + + + Name + + + + + + + + + + process + + Openstack.Administration.Domain.Group + + + + + + + 40 + left + + + + + 26 + left + + + + + 50 + left + + + + + + + + + GroupId + + + + Name + + + Description + + + + + + + + + + process + + Openstack.Objects.Domain.Compute.Server + + + + + + + + 3 + left + + + + + 40 + left + + + + + 40 + left + + + + + + 30 + left + + + + 25 + left + + + + 10 + left + + + + 15 + left + + + + + 100 + left + + + + + + + + QuickPickNumber + + + Id + + + + Name + + + CreationDate + + + LastUpdatedDate + + + KeyName + + + Status + + + DisplayIPAddresses + + + + + + + + + + + process + + Openstack.Objects.Domain.Compute.Image + + + + + + + + 3 + left + + + + + 40 + left + + + + + 70 + left + + + + + 25 + left + + + + + 25 + left + + + + + 15 + left + + + + + + + + + QuickPickNumber + + + + Id + + + + Name + + + + LastModified + + + + CreatedDate + + + + Status + + + + + + + + + + + process + + System.Collections.DictionaryEntry + + + + + + + 30 + left + + + + + 320 + left + + + + + + + + + + + Key + + + + Value + + + + + + + + + + + process + + Openstack.Objects.Domain.Security.SecurityGroup + + + + + + + 3 + left + + + + + 40 + left + + + + + 40 + left + + + + + 90 + left + + + + + 15 + left + + + + + + + + + QuickPickNumber + + + + Id + + + + Name + + + + Description + + + + TenantId + + + + + + + + + + + process + + Openstack.Objects.Domain.Compute.MetaDataElement + + + + + + + 20 + left + + + + + 20 + left + + + + + + + + + + + Key + + + + Value + + + + + + + + + + + + flavor + + Openstack.Objects.Domain.Compute.Flavor + + + + + + + 8 + left + + + + + 26 + left + + + + + 5 + left + + + + + 10 + left + + + + + + 11 + left + + + + + 11 + left + + + + + 5 + left + + + + + 5 + left + + + + + + + + + + + + + + Id + + + + Name + + + Disk + + + Ram + + + + RxtxCap + + + + RxtxQuota + + + + Swap + + + + Vcpus + + + + + + + + + + diff --git a/Openstack.Client.Powershell/Deployment/PostBuild.bat b/Openstack.Client.Powershell/Deployment/PostBuild.bat new file mode 100644 index 0000000..d09c045 --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/PostBuild.bat @@ -0,0 +1,21 @@ + +===================================================================================================================== +ACTION REQUIRED : Change the DocPath Variable below to reflect your Personal Documents Folder.. +===================================================================================================================== +set DocPath=C:\Users\Travis\Documents + + md %DocPath%\WindowsPowershell\ + md %DocPath%\OS\ + md %DocPath%\OS\ + +echo copy ..\..\.\Deployment\DevProfile.ps1 %DocPath%\WindowsPowershell\Microsoft.PowerShell_profile.ps1 +copy ..\..\.\Deployment\DevProfile.ps1 C:\Users\tplummer\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 +copy ..\..\.\Deployment\CLI.config C:\Users\tplummer\Documents\OS\CLI.config +copy ..\..\.\Deployment\Openstack.Client.Powershell.dll-Help.xml %DocPath%\OS\Openstack.Client.Powershell.dll-Help.xml +copy ..\..\.\Deployment\OpenstackShell.format.ps1xml C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\bin\Release\OpenstackShell.format.ps1xml + + +echo copy C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\bin\Release\Openstack.Client.Powershell.dll C:\Users\tplummer\Source\Repos\OpenStack.HP.Extensions\Openstack.HP.Extensions\bin\Debug + + +echo %DocPath%\OS\OpenstackShell.format.ps1xml \ No newline at end of file diff --git a/Openstack.Client.Powershell/Deployment/PostBuild.example b/Openstack.Client.Powershell/Deployment/PostBuild.example new file mode 100644 index 0000000..9ecf6d1 --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/PostBuild.example @@ -0,0 +1,13 @@ + +===================================================================================================================== +ACTION REQUIRED : Change the DocPath Variable below to reflect your Personal Documents Folder.. +===================================================================================================================== +set DocPath=C:\Users\Travis\Documents + + md %DocPath%\WindowsPowershell\ + md %DocPath%\OS\ + md %DocPath%\OS\ + +copy ..\..\.\Deployment\DevProfile.ps1 %DocPath%\WindowsPowershell\Microsoft.PowerShell_profile.ps1 +copy ..\..\.\Deployment\CLI.config %DocPath%\OS\CLI.config +copy ..\..\.\Deployment\Openstack.Client.Powershell.dll-Help.xml %DocPath%\OS\Openstack.Client.Powershell.dll-Help.xml \ No newline at end of file diff --git a/Openstack.Client.Powershell/Deployment/ReleaseManifest.xml b/Openstack.Client.Powershell/Deployment/ReleaseManifest.xml new file mode 100644 index 0000000..5a1ee8b --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/ReleaseManifest.xml @@ -0,0 +1,47 @@ + + + + + New Features + * Easier Zone management with Set-Zone and Get-Zones + + + + + + New Features + * Easier Zone management with Set-Zone and Get-Zones + + + + + + New Features + * Easier Zone management with Set-Zone and Get-Zones + + + + + + New Features + * Support for listing, adding, attaching, detaching and removing block volumes + * Support for creating and removing block storage snapshots + + + + + + New Features + * Migrate-Drive support for migrating full data sets from external sources + + + + + + New Features + * Full access to the OpenStack compute infrastructure + * CDN support + + + + diff --git a/Openstack.Client.Powershell/Deployment/ReleaseNotes.xml b/Openstack.Client.Powershell/Deployment/ReleaseNotes.xml new file mode 100644 index 0000000..b6571b6 --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/ReleaseNotes.xml @@ -0,0 +1,47 @@ + + + + + New Features + * Easier Zone management with Set-Zone and Get-Zones + + + + + + New Features + * Easier Zone management with Set-Zone and Get-Zones + + + + + + New Features + * Easier Zone management with Set-Zone and Get-Zones + + + + + + New Features + * Support for listing, adding, attaching, detaching and removing block volumes + * Support for creating and removing block storage snapshots + + + + + + New Features + * Migrate-Drive support for migrating full data sets from external sources + + + + + + New Features + * Full access to the OpenStack compute infrastructure + * CDN support + + + + diff --git a/Openstack.Client.Powershell/Deployment/ScratchPad/AnotherTest.txt b/Openstack.Client.Powershell/Deployment/ScratchPad/AnotherTest.txt new file mode 100644 index 0000000..103d384 --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/ScratchPad/AnotherTest.txt @@ -0,0 +1,92 @@ +==================================================================================================================== +/// +/// +/// +/// +/// +/// +//====================================================================================================================== + public StorageObject GetStorageObject(string path) + { + try + { + path = path.Replace(@"\", "/"); + RequestHeaders headers = StorageRequestSigner.CreateSignedHeaders(HttpMethod.GET, path); + string resourcePath = ["StorageManagementURI"] + "/" + path; + HttpClient client = new HttpClient(); + client.DefaultHeaders = headers; + + Uri uri = new Uri(resourcePath); + HttpResponseMessage msg = client.Get(uri); + + if (msg.StatusCode == System.Net.HttpStatusCode.OK) + { + msg.Content.LoadIntoBufferAsync(); + StorageObject storageObject = new StorageObject(); + storageObject.Key = path; + storageObject.Load(msg.Content.ReadAsStream()); + this.CopyCommonRequestHeaders(ref storageObject, msg.Headers); + return storageObject; + } + else + { + return null; + } + } + catch (Exception ex) + { + Console.WriteLine(ex); + } + return null; + } +//====================================================================================================================== +/// +/// +/// +/// +/// +//====================================================================================================================== + public bool IsValidPath(string storageContainer, string path) + { + HttpClient client = new HttpClient(); + Uri uri = new Uri(["StorageManagementURI"] + cDelimiter + storageContainer + cDelimiter + path + cDelimiter + "folder.txt"); + string rootCheck = null; + + if (path == cDelimiter) { + rootCheck = String.Empty; + } + else { + rootCheck = cFolderMarker; + } + + + if (this.GetStorageObject(storageContainer + cDelimiter + path + cDelimiter + rootCheck) != null) + { + return true; + } + else + { + return false; + } + } +//====================================================================================================================== +/// +/// +/// +/// +//====================================================================================================================== + public StorageObjects GetStorageObjects (string storageContainer, string path) + { + HttpQueryString queryString = new HttpQueryString(); + + if (path == "") + { + queryString.Add("prefix", "" ); + queryString.Add("delimiter", "/"); + } + else + { + path = path.Replace(@"\", "/"); + queryString.Add("prefix", path); + queryString.Add("delimiter", "/"); + } \ No newline at end of file diff --git a/Openstack.Client.Powershell/Deployment/ScratchPad/PostBuild.targets b/Openstack.Client.Powershell/Deployment/ScratchPad/PostBuild.targets new file mode 100644 index 0000000..07013fc --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/ScratchPad/PostBuild.targets @@ -0,0 +1,47 @@ + + + + + + Release + Any CPU + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Openstack.Client.Powershell/Deployment/ScratchPad/SecurityGroupData/SecurityGroupTest.xml b/Openstack.Client.Powershell/Deployment/ScratchPad/SecurityGroupData/SecurityGroupTest.xml new file mode 100644 index 0000000..ab26426 --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/ScratchPad/SecurityGroupData/SecurityGroupTest.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/Openstack.Client.Powershell/Deployment/ScratchPad/SecurityGroupData/SecurityGroups.xml b/Openstack.Client.Powershell/Deployment/ScratchPad/SecurityGroupData/SecurityGroups.xml new file mode 100644 index 0000000..a1bf735 --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/ScratchPad/SecurityGroupData/SecurityGroups.xml @@ -0,0 +1,85 @@ + + + + + + 22 + + + + tcp + + + 22 + + + + 0.0.0.0/0 + + + + + + -1 + + + + icmp + + + -1 + + + + 0.0.0.0/0 + + + + + + default + + + + + + + 11 + + + + tcp + + + 33 + + + + 0.0.0.0/0 + + + + + + -1 + + + + icmp + + + -1 + + + + 0.0.0.0/0 + + + + + + default + + + + diff --git a/Openstack.Client.Powershell/Deployment/ScratchPad/SecurityGroupData/SecurityGroupsTest.xml b/Openstack.Client.Powershell/Deployment/ScratchPad/SecurityGroupData/SecurityGroupsTest.xml new file mode 100644 index 0000000..d152d40 --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/ScratchPad/SecurityGroupData/SecurityGroupsTest.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/Openstack.Client.Powershell/Deployment/ScratchPad/ServerData/Server.xml b/Openstack.Client.Powershell/Deployment/ScratchPad/ServerData/Server.xml new file mode 100644 index 0000000..8562881 --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/ScratchPad/ServerData/Server.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + Web Head 1 + 2.1 + + + + + + + + + + + + + + + diff --git a/Openstack.Client.Powershell/Deployment/ScratchPad/ServerData/Server1.xml b/Openstack.Client.Powershell/Deployment/ScratchPad/ServerData/Server1.xml new file mode 100644 index 0000000..d9bf71e --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/ScratchPad/ServerData/Server1.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + Web Head 1 + 2.1 + + + + + + + + + + + + + + + + + diff --git a/Openstack.Client.Powershell/Deployment/ScratchPad/ServerData/Servers.xml b/Openstack.Client.Powershell/Deployment/ScratchPad/ServerData/Servers.xml new file mode 100644 index 0000000..fae1202 --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/ScratchPad/ServerData/Servers.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Openstack.Client.Powershell/Deployment/ScratchPad/app.config b/Openstack.Client.Powershell/Deployment/ScratchPad/app.config new file mode 100644 index 0000000..2e14572 --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/ScratchPad/app.config @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Openstack.Client.Powershell/Deployment/powershell.exe.config b/Openstack.Client.Powershell/Deployment/powershell.exe.config new file mode 100644 index 0000000..944e423 --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/powershell.exe.config @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Openstack.Client.Powershell/Deployment/readme.txt b/Openstack.Client.Powershell/Deployment/readme.txt new file mode 100644 index 0000000..e2feb1a --- /dev/null +++ b/Openstack.Client.Powershell/Deployment/readme.txt @@ -0,0 +1,126 @@ +Openstack Powershell CLI - Getting Set up to Contribute + +I - Pre-requisits + + Before we get started we need to make sure that our Development environment reflects what a machine looks like when we install the CLI. The following steps should get the job done. + + A. Set the Required Execution Policy + + To use the Openstack CLI Software for Windows PowerShell, you must make sure that your Powershell environment is capable of executing 3rd party modules. + Note: If you are performing a re-installation of the software package, you can skip this step. This step is applicable only for a fresh installation. + Open a PowerShell window as the administrator and issue the command set-executionpolicy -ExecutionPolicy Unrestricted: + + ------------------------------------------------------------------------------------------------------------------- + PS C:\Projects\Outgoing\OS> set-executionpolicy -ExecutionPolicy Unrestricted + + Execution policy change + + The execution policy helps protect you from scripts that you do not trust. Changing the execution policy + might expose you to the security risks described in the about_Execution_Policies help topic. Do you want to + change the execution policy? + [Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y + PS C:\Projects\Outgoing\OS> + ------------------------------------------------------------------------------------------------------------------- + Close the Powershell window and reopen as administrator for the policy changes to take effect. + + B. A Quick Setting in Visual Studio + + After Cloning the repo and loading the solution within Visual Studio, ensure that the "Enable Nuget Package Restore" option has been turned + on at the Solution level. This will retreive all of the neccessary external dependencies for the Solution to build properly. + +C. - Supplying your Credentials + +Our next step is to make sure that we supply the proper credentials when logging on to the system. If you ran the CLI after your initial +install, you'll have noticed that you were prompted for this information. The result is stored in the CLI.config file located within the Users Personal Data Folder +under the OS directory. With each Build we must update that file with the version in our solution. This is so that when new config file changes are introduced, you +have the CLI picking them up at runtime from the expected location (instead of residing in just your project directory). Complete these steps to supply this information. + +1. Navigate to the Openstack.Client.Powershell project and look into the Deployment folder. +2. Within that folder you will see a file called CLI.config.example +3. Copy the example file into the same folder but remove the .example on the filename. +4. Open up the CLI.config file that you just created. +5. Find the config section entitled "IdentityServices". +6. Within this section supply values for Username, Password, and Default Tenenat Id. All of this can be found within your account information on you providers portal. + +Each time that we build, this CLI.config file will be moved to the correct runtime location via Post-Build Scripts outlined in the next section. + +D. - Edit Post Build Scripts + +Within the Openstack.Client.Powershell projects Post-Build Event you'll notice that we call a PostBuild.bat file. This +batch file will move important run-time files required by the CLI to their proper locations if you decide to edit them. +Without this, all changes to important files (like CLI.config) would go unnoticed because they would sit in our project +folders on disk (rather than the location the CLI expects). To create tis batch file, follow these steps. + +1. Navigate to the Openstack.Client.Powershell project and look into the Deployment folder. +2. Within that folder you will see a file called PostBuild.example +3. Open up that file and copy the contents to the clipboard. +4. Within that same folder create a file called PostBuild.bat +5. Paste the script on the clipboard into that file. +6. Notice the Action Required section of the file. Modify the path you see there to reflect your development machine. +7. Save your Project and do a test build (Rebuild All). The Output Window will show any Echo results from the script and show any script errors that may break the build. + +E. - Modifying you Developer Profile + + When the Powershell runtime starts it looks for a file called Microsoft.PowerShell_profile.ps1. This script gets executed right after +Powershell loads. Here we can set up the look of the environment, issue some default commands (useful for testing!) +and loading Powershell Modules. The Powershell module is where all of our CLI code resides and must get loaded by this script. +The only problem here is that the path to that module is specific to your machine. To address this follow these steps + + 1. Open up the DevProfile.ps1.example file within the Solutions [Openstack.Client.Powershell]\Deployment folder. + 2. Copy the contents of this file into a new text file called DevProfile.ps1 + 3. Search this document for "ACTION REQUIRED" and follow the instructions given. + +II - Debugging + +Debugging the CLI is a bit more challenging than with say a normal executable. In this case the entry point or main process is the Powershell runtime itself. +This requires us to load our work into that environment and attach the VS debugger to the Powershell host at runtime. Follow these steps to get the debugger running. + + 1. Set your breakpoint. + 2. Compile the Solution. + 3. Load Powershell. With everything in place this should automatically Import the module you just compiled. + 3. From within VS select Debug\Attach To Process + 4. Attach to the Powershell.exe process. + 5. Issue a command in the CLI that triggers your breakpoint. + +A. Debugging Provider Code + +When Powershell modules get Imported, any providers found in that Module will be executed first. This leaves us with a problem in that +any code that we need to debug in the provider during startup needs to be paused until we have time to actually set a break point properly. +To do this complete the following actions. + + 1. Set you breakpoint in the providers InitializeDefaultDrives() method. This is the first stage in the Providers Life-Cycle. + 2. Open the DevProfile.ps1 file. + 3. Comment out the Import-Module statement (Copy it to the clipboard for your convience). + 2. Compile the Solution. + 3. Load Powershell. + 3. From within VS select Debug\Attach To Process + 4. Attach to the Powershell.exe process. + 5. From the command line paste the Import-Module statement into the CLI. This will trigger the breakpoint that you set in step 1. + +B. Getting to the Action - A Quick Tip + +Sometimes we're trying to debug something in the CLI and we need to get to a certain location quickly. For example if you are testing the +list view for Servers and your sick of typing this after you restart each time + + cd\ + cd Servers + ls + cd 1 + ls + +Just remember that this can be placed in your Devprofile.ps1 file and Powershell will issue those commands for you. This makes debugging a specific +section of the CLI much easier.. + +III. Testing + + Object Storage Integration Test Notes + + These unit test require a particular directory structure to be present on your machine to complete the test cases where we copy files and or folders to the server. + Make sure that you have something like the following on your machine. + + Folder1 (contains files) + -> Folder2 (contains files) + -> Folder3 (contains NO files) + + Note : Go to the Testing section in the CLI.Config file. Make sure that LocalTestDirectory + element points to the root of the test folder hierarchy (Folder1 in the example above). \ No newline at end of file diff --git a/Openstack.Client.Powershell/License.txt b/Openstack.Client.Powershell/License.txt new file mode 100644 index 0000000..282f43d --- /dev/null +++ b/Openstack.Client.Powershell/License.txt @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + diff --git a/Openstack.Client.Powershell/Migrations/AWSMigration.cs b/Openstack.Client.Powershell/Migrations/AWSMigration.cs new file mode 100644 index 0000000..ade2fc0 --- /dev/null +++ b/Openstack.Client.Powershell/Migrations/AWSMigration.cs @@ -0,0 +1,162 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Amazon.S3; +using Amazon.S3.Model; +using Openstack.Objects.DataAccess; +using Openstack.Objects.Utility; +using System.IO; +using Openstack.Objects.Domain; +using Openstack.Objects.DataAccess.Storage; + +namespace Openstack.Migrations +{ + public class AWSMigration + { + private IAmazonS3 _client; + private Session _session; + public delegate void CopyOperationEventHandler(object sender, CopyOperationInfoEventArgs e); + public delegate void CreateContainerOperationEventHandler(object sender, CreateContainerOperationInfoEventArgs e); + public event CopyOperationEventHandler Changed; + public event CreateContainerOperationEventHandler ContainerCreated; +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + private void OnChanged(CopyOperationInfoEventArgs e) + { + if (Changed != null) + Changed(this, e); + } +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + private void OnCreateContainer(CreateContainerOperationInfoEventArgs e) + { + if (ContainerCreated != null) + ContainerCreated(this, e); + } +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + public AWSMigration(string accessKeyID, string secretAccessKeyID) + { + _client = Amazon.AWSClientFactory.CreateAmazonS3Client(accessKeyID, secretAccessKeyID); + _session = Session.CreateSession(); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void CreateContainer(string name) + { + _session.Factory.CreateContainerRepository().SaveContainer(new Objects.Domain.StorageContainer(name)); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + public string[] GetBuckets() + { + return _client.ListBuckets().Buckets.Select(b => b.BucketName).ToArray(); + } +//========================================================================================= +/// +/// +/// +/// +/// +//========================================================================================= + private void CopyObject(S3Object s3Object, string bucketName) + { + IStorageObjectRepository repository = _session.Factory.CreateStorageObjectRepository(); + + if (s3Object.Key.EndsWith("/") || s3Object.Size == 0) + { + StoragePath path = new StoragePath(_session.Context.GetRepositoryContext("object-store").ServiceDescription.Url, bucketName, s3Object.Key); + repository.MakeFolder(path.AbsoluteURI); + } + else + { + // Grab the file from the S3 store... + + GetObjectRequest goRequest = new GetObjectRequest(); + goRequest.BucketName = bucketName; + goRequest.Key = s3Object.Key; + GetObjectResponse goResponse = _client.GetObject(goRequest); + + // Save to the newly created OpenStack Container.. + + StorageObject sObject = new StorageObject(); + sObject.Load(goResponse.ResponseStream); + StoragePath path = new StoragePath(_session.Context.GetRepositoryContext("object-store").ServiceDescription.Url, bucketName, s3Object.Key); + _session.Factory.CreateStorageObjectRepository().Copy(sObject, path.AbsoluteURI, true); + + this.OnChanged(new CopyOperationInfoEventArgs(Path.GetFileName(s3Object.Key), s3Object.Size)); + } + } +//========================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================= + public void MigrateBucket(string sourceBucketName) + { + ListObjectsRequest request = new ListObjectsRequest(); + request = new ListObjectsRequest(); + request.BucketName = sourceBucketName; + + // Create the target Storage Object Container first in Swift.. + + this.CreateContainer(sourceBucketName); + this.OnCreateContainer(new CreateContainerOperationInfoEventArgs(sourceBucketName)); + + do + { + ListObjectsResponse response = _client.ListObjects(request); + + foreach (S3Object s3Object in response.S3Objects) { + this.CopyObject(s3Object, sourceBucketName); + } + + if (response.IsTruncated) { + request.Marker = response.NextMarker; + } + else + { + request = null; + } + } while (request != null); + } + } +} diff --git a/Openstack.Client.Powershell/Migrations/CopyInfoEventArgs.cs b/Openstack.Client.Powershell/Migrations/CopyInfoEventArgs.cs new file mode 100644 index 0000000..f0078cd --- /dev/null +++ b/Openstack.Client.Powershell/Migrations/CopyInfoEventArgs.cs @@ -0,0 +1,47 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +namespace Openstack.Migrations +{ + public class CopyInfoEventArgs + { + private long _BytesCopied = 0; + private string _filename; + private string _exception; + + public string ExceptionMessage + { + get { return _exception; } + set { _exception = value; } + } + + public CopyInfoEventArgs(string filename, long bytesCopied) + { + _filename = filename; + _BytesCopied = bytesCopied; + } + + public string Filename + { + get { return _filename; } + set { _filename = value; } + } + public long BytesCopied + { + get { return _BytesCopied; } + set { _BytesCopied = value; } + } + } +} diff --git a/Openstack.Client.Powershell/Migrations/LocalStoreMigration.cs b/Openstack.Client.Powershell/Migrations/LocalStoreMigration.cs new file mode 100644 index 0000000..e831086 --- /dev/null +++ b/Openstack.Client.Powershell/Migrations/LocalStoreMigration.cs @@ -0,0 +1,138 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using Openstack.Objects.Utility; +using System; +using Openstack.Objects.DataAccess.Storage; +using System.IO; + +namespace Openstack.Migrations +{ + public enum StorageProvider + { + SkyDrive = 0, + DropBox = 1 + } + + public class LocalStoreMigration + { + private Session _session; + public delegate void CopyOperationEventHandler(object sender, CopyOperationInfoEventArgs e); + public event CopyOperationEventHandler Changed; + +////========================================================================================= +///// +///// +///// +///// +////========================================================================================= + private void OnChanged(CopyOperationInfoEventArgs e) + { + if (Changed != null) + Changed(this, e); + } +//========================================================================================= +/// +/// +/// +/// +/// +//========================================================================================= + private void Repository_Changed(object sender, CopyOperationInfoEventArgs e) + { + this.OnChanged(e); + } +//========================================================================================= +/// +/// +/// +/// +/// +//========================================================================================= + public LocalStoreMigration() + { + _session = Session.CreateSession(); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void CreateContainer(string name) + { + _session.Factory.CreateContainerRepository().SaveContainer(new Objects.Domain.StorageContainer(name)); + } +//========================================================================================= +/// +/// +/// +/// +/// +//========================================================================================= + private DirectoryInfo[] GetRootDecendants(string localStorePath) + { + DirectoryInfo info = new DirectoryInfo(localStorePath); + return info.GetDirectories("*.*", SearchOption.AllDirectories); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + private void MigrateDrive(StorageProvider provider, string containerName) + { + string localStorePath = null; + + if (provider == StorageProvider.DropBox) + localStorePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\Dropbox\"; + else + localStorePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\Skydrive\"; + + string targetPath = _session.Context.GetRepositoryContext("object-store").ServiceDescription.Url + "/" + containerName + "/"; + StorageObjectRepository repository = new StorageObjectRepository(_session.Context.GetRepositoryContext("object-store")); + + // Create the target Container.. + + this.CreateContainer(containerName); + + repository.Changed += new StorageObjectRepository.CopyOperationCompleteEventHandler(Repository_Changed); + + DirectoryInfo[] dirs = this.GetRootDecendants(localStorePath); + foreach (DirectoryInfo direcory in dirs) { + repository.Copy(localStorePath + direcory.Name + @"\", targetPath, true); + } + + repository.Changed -= new StorageObjectRepository.CopyOperationCompleteEventHandler(Repository_Changed); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + public void MigrateLocalStore(StorageProvider provider) + { + this.MigrateLocalStore(provider, provider.ToString()); + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + public void MigrateLocalStore(StorageProvider provider, string containerName) + { + MigrateDrive(provider, containerName); + } + } +} diff --git a/Openstack.Client.Powershell/Openstack.Client.Powershell - Shortcut.lnk b/Openstack.Client.Powershell/Openstack.Client.Powershell - Shortcut.lnk new file mode 100644 index 0000000..a5aa06a Binary files /dev/null and b/Openstack.Client.Powershell/Openstack.Client.Powershell - Shortcut.lnk differ diff --git a/Openstack.Client.Powershell/Openstack.Client.Powershell.csproj b/Openstack.Client.Powershell/Openstack.Client.Powershell.csproj new file mode 100644 index 0000000..67cdc30 --- /dev/null +++ b/Openstack.Client.Powershell/Openstack.Client.Powershell.csproj @@ -0,0 +1,236 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {32BAC168-2EC8-4074-9E6D-8C13460DCFAD} + Library + Properties + Openstack.Client.Powershell + Openstack.Client.Powershell + v4.5 + 512 + + + ..\..\ + true + + + true + full + false + bin\Release\ + DEBUG + prompt + 4 + AnyCPU + false + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + true + bin\TransformTool Build\ + TRACE;DEBUG + full + AnyCPU + true + GlobalSuppressions.cs + prompt + MinimumRecommendedRules.ruleset + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + false + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + false + false + + + OnBuildSuccess + + + + False + ..\packages\AWSSDK.2.0.11.0\lib\net45\AWSSDK.dll + + + False + ..\..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll + + + ..\packages\Newtonsoft.Json.4.5.7\lib\net40\Newtonsoft.Json.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Designer + Always + + + + + + Designer + Always + + + + Designer + Always + + + Always + + + + Designer + + + Designer + + + + Designer + Always + + + + + + + + + + + + + + + + + + + + + + Always + + + Always + + + + Designer + + + + + + + + + Designer + + + + + + Always + + + Always + Designer + + + + + + + + {c53d669c-cdf1-4157-aec1-bd167f655b2b} + Openstack.Common + + + {b2c92371-b62b-45a2-adeb-edebefa3a75c} + Openstack + + + + + + + + Echo ===================== +Echo Executing Post-Build Scripts +Echo ===================== + +copy ..\..\.\Deployment\CLIManifest.psd1 $(ProjectDir)\bin\release\CLIManifest.psd1 +copy ..\..\.\Deployment\OpenstackShell.format.ps1xml $(ProjectDir)\bin\release\OpenstackShell.format.ps1xml +copy ..\..\.\Deployment\Openstack.Client.Powershell.dll-help.xml $(ProjectDir)\bin\release\Openstack.Client.Powershell.dll-help.xml + +call $(ProjectDir)Deployment\PostBuild.bat + + + + + + + + + \ No newline at end of file diff --git a/Openstack.Client.Powershell/Openstack.Client.Powershell.sln b/Openstack.Client.Powershell/Openstack.Client.Powershell.sln new file mode 100644 index 0000000..8bece28 --- /dev/null +++ b/Openstack.Client.Powershell/Openstack.Client.Powershell.sln @@ -0,0 +1,133 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D129B468-4E23-4226-AA0E-AE02BB697D9A}" + ProjectSection(SolutionItems) = preProject + HPCloud.Client.Powershell.vsmdi = HPCloud.Client.Powershell.vsmdi + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Openstack.Client.Powershell", "Openstack.Client.Powershell.csproj", "{32BAC168-2EC8-4074-9E6D-8C13460DCFAD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Openstack.Client.Common", "..\..\Common\HPCloud.Client.Common\Openstack.Client.Common.csproj", "{668A82E0-9F8A-476E-A5F7-F755B44AC4DD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Openstack.RDPClient", "..\RDPClient\Openstack.RDPClient.csproj", "{3301ACFF-3A51-458D-B4C7-37D229A86AC9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Openstack.Objects", "..\..\API\Openstack.Objects\Openstack.Objects.csproj", "{BDCDCBF5-3467-461E-8307-E1E4E19F6532}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Openstack.Common", "..\..\API\Openstack.Common\Openstack.Common.csproj", "{F6AF0191-F236-4C26-8C93-30D5F4D8000F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Openstack.Objects.Test", "..\..\API\Openstack.Objects.Test\Openstack.Objects.Test.csproj", "{E90D4392-6748-4405-9F99-2D5FBB09DFC8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + TransformTool Build|Any CPU = TransformTool Build|Any CPU + TransformTool Build|Mixed Platforms = TransformTool Build|Mixed Platforms + TransformTool Build|x86 = TransformTool Build|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {32BAC168-2EC8-4074-9E6D-8C13460DCFAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {32BAC168-2EC8-4074-9E6D-8C13460DCFAD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {32BAC168-2EC8-4074-9E6D-8C13460DCFAD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {32BAC168-2EC8-4074-9E6D-8C13460DCFAD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {32BAC168-2EC8-4074-9E6D-8C13460DCFAD}.Debug|x86.ActiveCfg = Debug|Any CPU + {32BAC168-2EC8-4074-9E6D-8C13460DCFAD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {32BAC168-2EC8-4074-9E6D-8C13460DCFAD}.Release|Any CPU.Build.0 = Release|Any CPU + {32BAC168-2EC8-4074-9E6D-8C13460DCFAD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {32BAC168-2EC8-4074-9E6D-8C13460DCFAD}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {32BAC168-2EC8-4074-9E6D-8C13460DCFAD}.Release|x86.ActiveCfg = Release|Any CPU + {32BAC168-2EC8-4074-9E6D-8C13460DCFAD}.TransformTool Build|Any CPU.ActiveCfg = TransformTool Build|Any CPU + {32BAC168-2EC8-4074-9E6D-8C13460DCFAD}.TransformTool Build|Any CPU.Build.0 = TransformTool Build|Any CPU + {32BAC168-2EC8-4074-9E6D-8C13460DCFAD}.TransformTool Build|Mixed Platforms.ActiveCfg = TransformTool Build|Any CPU + {32BAC168-2EC8-4074-9E6D-8C13460DCFAD}.TransformTool Build|Mixed Platforms.Build.0 = TransformTool Build|Any CPU + {32BAC168-2EC8-4074-9E6D-8C13460DCFAD}.TransformTool Build|x86.ActiveCfg = TransformTool Build|Any CPU + {668A82E0-9F8A-476E-A5F7-F755B44AC4DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {668A82E0-9F8A-476E-A5F7-F755B44AC4DD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {668A82E0-9F8A-476E-A5F7-F755B44AC4DD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {668A82E0-9F8A-476E-A5F7-F755B44AC4DD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {668A82E0-9F8A-476E-A5F7-F755B44AC4DD}.Debug|x86.ActiveCfg = Debug|Any CPU + {668A82E0-9F8A-476E-A5F7-F755B44AC4DD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {668A82E0-9F8A-476E-A5F7-F755B44AC4DD}.Release|Any CPU.Build.0 = Release|Any CPU + {668A82E0-9F8A-476E-A5F7-F755B44AC4DD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {668A82E0-9F8A-476E-A5F7-F755B44AC4DD}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {668A82E0-9F8A-476E-A5F7-F755B44AC4DD}.Release|x86.ActiveCfg = Release|Any CPU + {668A82E0-9F8A-476E-A5F7-F755B44AC4DD}.TransformTool Build|Any CPU.ActiveCfg = Release|Any CPU + {668A82E0-9F8A-476E-A5F7-F755B44AC4DD}.TransformTool Build|Any CPU.Build.0 = Release|Any CPU + {668A82E0-9F8A-476E-A5F7-F755B44AC4DD}.TransformTool Build|Mixed Platforms.ActiveCfg = Release|Any CPU + {668A82E0-9F8A-476E-A5F7-F755B44AC4DD}.TransformTool Build|Mixed Platforms.Build.0 = Release|Any CPU + {668A82E0-9F8A-476E-A5F7-F755B44AC4DD}.TransformTool Build|x86.ActiveCfg = Release|Any CPU + {3301ACFF-3A51-458D-B4C7-37D229A86AC9}.Debug|Any CPU.ActiveCfg = Debug|x86 + {3301ACFF-3A51-458D-B4C7-37D229A86AC9}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {3301ACFF-3A51-458D-B4C7-37D229A86AC9}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {3301ACFF-3A51-458D-B4C7-37D229A86AC9}.Debug|x86.ActiveCfg = Debug|x86 + {3301ACFF-3A51-458D-B4C7-37D229A86AC9}.Debug|x86.Build.0 = Debug|x86 + {3301ACFF-3A51-458D-B4C7-37D229A86AC9}.Release|Any CPU.ActiveCfg = Release|x86 + {3301ACFF-3A51-458D-B4C7-37D229A86AC9}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {3301ACFF-3A51-458D-B4C7-37D229A86AC9}.Release|Mixed Platforms.Build.0 = Release|x86 + {3301ACFF-3A51-458D-B4C7-37D229A86AC9}.Release|x86.ActiveCfg = Release|x86 + {3301ACFF-3A51-458D-B4C7-37D229A86AC9}.Release|x86.Build.0 = Release|x86 + {3301ACFF-3A51-458D-B4C7-37D229A86AC9}.TransformTool Build|Any CPU.ActiveCfg = Release|x86 + {3301ACFF-3A51-458D-B4C7-37D229A86AC9}.TransformTool Build|Mixed Platforms.ActiveCfg = Release|x86 + {3301ACFF-3A51-458D-B4C7-37D229A86AC9}.TransformTool Build|Mixed Platforms.Build.0 = Release|x86 + {3301ACFF-3A51-458D-B4C7-37D229A86AC9}.TransformTool Build|x86.ActiveCfg = Release|x86 + {3301ACFF-3A51-458D-B4C7-37D229A86AC9}.TransformTool Build|x86.Build.0 = Release|x86 + {BDCDCBF5-3467-461E-8307-E1E4E19F6532}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BDCDCBF5-3467-461E-8307-E1E4E19F6532}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BDCDCBF5-3467-461E-8307-E1E4E19F6532}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {BDCDCBF5-3467-461E-8307-E1E4E19F6532}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {BDCDCBF5-3467-461E-8307-E1E4E19F6532}.Debug|x86.ActiveCfg = Debug|Any CPU + {BDCDCBF5-3467-461E-8307-E1E4E19F6532}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BDCDCBF5-3467-461E-8307-E1E4E19F6532}.Release|Any CPU.Build.0 = Release|Any CPU + {BDCDCBF5-3467-461E-8307-E1E4E19F6532}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {BDCDCBF5-3467-461E-8307-E1E4E19F6532}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {BDCDCBF5-3467-461E-8307-E1E4E19F6532}.Release|x86.ActiveCfg = Release|Any CPU + {BDCDCBF5-3467-461E-8307-E1E4E19F6532}.TransformTool Build|Any CPU.ActiveCfg = Release|Any CPU + {BDCDCBF5-3467-461E-8307-E1E4E19F6532}.TransformTool Build|Any CPU.Build.0 = Release|Any CPU + {BDCDCBF5-3467-461E-8307-E1E4E19F6532}.TransformTool Build|Mixed Platforms.ActiveCfg = Release|Any CPU + {BDCDCBF5-3467-461E-8307-E1E4E19F6532}.TransformTool Build|Mixed Platforms.Build.0 = Release|Any CPU + {BDCDCBF5-3467-461E-8307-E1E4E19F6532}.TransformTool Build|x86.ActiveCfg = Release|Any CPU + {F6AF0191-F236-4C26-8C93-30D5F4D8000F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F6AF0191-F236-4C26-8C93-30D5F4D8000F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F6AF0191-F236-4C26-8C93-30D5F4D8000F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {F6AF0191-F236-4C26-8C93-30D5F4D8000F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {F6AF0191-F236-4C26-8C93-30D5F4D8000F}.Debug|x86.ActiveCfg = Debug|Any CPU + {F6AF0191-F236-4C26-8C93-30D5F4D8000F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F6AF0191-F236-4C26-8C93-30D5F4D8000F}.Release|Any CPU.Build.0 = Release|Any CPU + {F6AF0191-F236-4C26-8C93-30D5F4D8000F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {F6AF0191-F236-4C26-8C93-30D5F4D8000F}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {F6AF0191-F236-4C26-8C93-30D5F4D8000F}.Release|x86.ActiveCfg = Release|Any CPU + {F6AF0191-F236-4C26-8C93-30D5F4D8000F}.TransformTool Build|Any CPU.ActiveCfg = Release|Any CPU + {F6AF0191-F236-4C26-8C93-30D5F4D8000F}.TransformTool Build|Any CPU.Build.0 = Release|Any CPU + {F6AF0191-F236-4C26-8C93-30D5F4D8000F}.TransformTool Build|Mixed Platforms.ActiveCfg = Release|Any CPU + {F6AF0191-F236-4C26-8C93-30D5F4D8000F}.TransformTool Build|Mixed Platforms.Build.0 = Release|Any CPU + {F6AF0191-F236-4C26-8C93-30D5F4D8000F}.TransformTool Build|x86.ActiveCfg = Release|Any CPU + {E90D4392-6748-4405-9F99-2D5FBB09DFC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E90D4392-6748-4405-9F99-2D5FBB09DFC8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E90D4392-6748-4405-9F99-2D5FBB09DFC8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {E90D4392-6748-4405-9F99-2D5FBB09DFC8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {E90D4392-6748-4405-9F99-2D5FBB09DFC8}.Debug|x86.ActiveCfg = Debug|Any CPU + {E90D4392-6748-4405-9F99-2D5FBB09DFC8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E90D4392-6748-4405-9F99-2D5FBB09DFC8}.Release|Any CPU.Build.0 = Release|Any CPU + {E90D4392-6748-4405-9F99-2D5FBB09DFC8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {E90D4392-6748-4405-9F99-2D5FBB09DFC8}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {E90D4392-6748-4405-9F99-2D5FBB09DFC8}.Release|x86.ActiveCfg = Release|Any CPU + {E90D4392-6748-4405-9F99-2D5FBB09DFC8}.TransformTool Build|Any CPU.ActiveCfg = Release|Any CPU + {E90D4392-6748-4405-9F99-2D5FBB09DFC8}.TransformTool Build|Any CPU.Build.0 = Release|Any CPU + {E90D4392-6748-4405-9F99-2D5FBB09DFC8}.TransformTool Build|Mixed Platforms.ActiveCfg = Release|Any CPU + {E90D4392-6748-4405-9F99-2D5FBB09DFC8}.TransformTool Build|Mixed Platforms.Build.0 = Release|Any CPU + {E90D4392-6748-4405-9F99-2D5FBB09DFC8}.TransformTool Build|x86.ActiveCfg = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(TestCaseManagementSettings) = postSolution + CategoryFile = HPCloud.Client.Powershell.vsmdi + EndGlobalSection +EndGlobal diff --git a/Openstack.Client.Powershell/Openstack.Client.Powershell.v12.suo b/Openstack.Client.Powershell/Openstack.Client.Powershell.v12.suo new file mode 100644 index 0000000..7383093 Binary files /dev/null and b/Openstack.Client.Powershell/Openstack.Client.Powershell.v12.suo differ diff --git a/Openstack.Client.Powershell/Properties/AssemblyInfo.cs b/Openstack.Client.Powershell/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..7c46497 --- /dev/null +++ b/Openstack.Client.Powershell/Properties/AssemblyInfo.cs @@ -0,0 +1,52 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Openstack.Client.Powershell")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("OpenStack")] +[assembly: AssemblyProduct("Openstack.Client.Powershell")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("847a28a4-6407-4aa6-8070-a4a51396db70")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] + +[assembly: AssemblyVersion("1.3.5.8")] +[assembly: AssemblyFileVersion("1.1.0.0")] diff --git a/Openstack.Client.Powershell/Providers/BlockStorage/AttachmentUIContainer.cs b/Openstack.Client.Powershell/Providers/BlockStorage/AttachmentUIContainer.cs new file mode 100644 index 0000000..6c42dae --- /dev/null +++ b/Openstack.Client.Powershell/Providers/BlockStorage/AttachmentUIContainer.cs @@ -0,0 +1,73 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Compute; +using Openstack.Objects.Domain.BlockStorage; + +namespace Openstack.Client.Powershell.Providers.BlockStorage +{ + public class AttachmentUIContainer : BaseUIContainer + { +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void Load() + { + // this.Entities = ((Image)this.Entity).MetaData; + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void WriteEntityDetails() + { + VolumeAttachment attachment = (VolumeAttachment)this.Entity; + + this.WriteHeader("Attachment Details"); + this.WriteAttachmentDetails(attachment); + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void WriteImageMetadata(Image image) + { + this.WriteMetadata(image.MetaData); + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void WriteAttachmentDetails(VolumeAttachment attachment) + { + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + + Console.WriteLine("Device : " + attachment.Device); + Console.WriteLine("Volume Id : " + attachment.VolumeId); + } + } +} diff --git a/Openstack.Client.Powershell/Providers/BlockStorage/AttachmentsUIContainer.cs b/Openstack.Client.Powershell/Providers/BlockStorage/AttachmentsUIContainer.cs new file mode 100644 index 0000000..394bf60 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/BlockStorage/AttachmentsUIContainer.cs @@ -0,0 +1,105 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Collections.Generic; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Compute; +using Openstack.Objects.Domain.BlockStorage; +using System.Linq; +using Openstack.Client.Powershell.Providers.Security; + +namespace Openstack.Client.Powershell.Providers.BlockStorage +{ + [RequiredServiceIdentifierAttribute("Openstack-ComputeDrive")] + public class AttachmentsUIContainer : BaseUIContainer + { + private Server _server; +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public AttachmentsUIContainer(BaseUIContainer parentContainer, + string name, + string description, + string path) + : base(parentContainer, name, description, path) + { + this.ObjectType = ObjectType.Container; + } + public AttachmentsUIContainer() + {} + #region Methods +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + public void LoadEntities(Server server) + { + _server = server; + List attachments = this.RepositoryFactory.CreateVolumeRepository().GetServerVolumes(server.Id); + + if (attachments != null && attachments.Count() > 0) + { + List volumes = this.RepositoryFactory.CreateVolumeRepository().GetVolumes(); + + var innerJoinQuery = + from attachment in attachments + join volume in volumes on attachment.VolumeId equals volume.Id + select new Volume() + { + Id = volume.Id, + Description = volume.Description, + Name = volume.Name, + Size = volume.Size, + AvailabilityZone = volume.AvailabilityZone, + Device = attachment.Device, + AttachedTo = volume.AttachedTo, + Status = volume.Status, + CreationDate = volume.CreationDate + }; + + List allVolumes = innerJoinQuery.ToList(); + + this.SetUIContainers(allVolumes); + this.Entities = allVolumes; + } + else + { + this.Entities = null; + } + } +//========================================================================================================= +/// +/// +/// +/// +/// +//========================================================================================================= + public override void Load() + { + this.LoadEntities(_server); + } + #endregion + } +} + + + diff --git a/Openstack.Client.Powershell/Providers/BlockStorage/BlockStorageUIContainer.cs b/Openstack.Client.Powershell/Providers/BlockStorage/BlockStorageUIContainer.cs new file mode 100644 index 0000000..1191711 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/BlockStorage/BlockStorageUIContainer.cs @@ -0,0 +1,87 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Collections; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Client.Powershell.Providers.Security; +using Openstack.Objects.Domain; +using Openstack.Objects.Utility; +using Openstack.Objects.DataAccess; + +namespace Openstack.Client.Powershell.Providers.Compute +{ +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + [RequiredServiceIdentifierAttribute("Openstack-ComputeDrive")] + public class BlockStorageUIContainer : BaseUIContainer + { +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public BlockStorageUIContainer() { } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void Load() + { + this.LoadContainers(); + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void LoadContainers() + { + this.Containers.Clear(); + this.Containers.Add(this.CreateContainer("Volumes", "Manage all Block Storage Volumes from this location.", @"BlockStorage\Volumes")); + this.Containers.Add(this.CreateContainer("Backups", "Manage all of your Volume backups.", @"BlockStorage\Backups")); + this.Containers.Add(this.CreateContainer("Snapshots", "Container for storing and managing Block Storage Snapshots. ", @"BlockStorage\Snapshots")); + } +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public BlockStorageUIContainer(BaseUIContainer parentContainer, string name, string description, string path, Context context, BaseRepositoryFactory repository) + : base(parentContainer, name, description, path) + { + this.Context = context; + this.RepositoryFactory = repository; + + this.LoadContainers(); + this.ObjectType = Client.Powershell.Providers.Common.ObjectType.Entity; + } + } +} + diff --git a/Openstack.Client.Powershell/Providers/BlockStorage/SnapshotUIContainer.cs b/Openstack.Client.Powershell/Providers/BlockStorage/SnapshotUIContainer.cs new file mode 100644 index 0000000..e81077c --- /dev/null +++ b/Openstack.Client.Powershell/Providers/BlockStorage/SnapshotUIContainer.cs @@ -0,0 +1,79 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Compute; +using Openstack.Objects.Domain.BlockStorage; + +namespace Openstack.Client.Powershell.Providers.Security +{ + public class SnapshotUIContainer : BaseUIContainer + { +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void Load() + { + // this.Entities = ((Image)this.Entity).MetaData; + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void WriteEntityDetails() + { + Snapshot snapshot = (Snapshot)this.Entity; + + this.WriteHeader("Snapshot Details"); + this.WriteSnapshotDetails(snapshot); + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void WriteVolumeMetadata(Volume volume) + { + //this.WriteMetadata(volume.MetaData); + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void WriteSnapshotDetails(Snapshot snapshot) + { + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + + Console.WriteLine("Id : " + snapshot.Id); + Console.WriteLine("Name : " + snapshot.DisplayName); + Console.WriteLine("Description : " + snapshot.Description); + Console.WriteLine("Created On : " + snapshot.CreationDate); + Console.WriteLine("Status : " + snapshot.Status); + Console.WriteLine("Volume Id : " + snapshot.VolumeId); + Console.WriteLine(""); + } + } +} + diff --git a/Openstack.Client.Powershell/Providers/BlockStorage/SnapshotsUIContainer.cs b/Openstack.Client.Powershell/Providers/BlockStorage/SnapshotsUIContainer.cs new file mode 100644 index 0000000..0cca918 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/BlockStorage/SnapshotsUIContainer.cs @@ -0,0 +1,64 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Collections.Generic; +using Openstack.Administration.Domain; +using System.Collections; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Compute; +using Openstack.Objects.Domain; + +namespace Openstack.Client.Powershell.Providers.Security +{ + [RequiredServiceIdentifierAttribute("Openstack-ComputeDrive")] + public class SnapshotsUIContainer : BaseUIContainer + { +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public SnapshotsUIContainer(BaseUIContainer parentContainer, + string name, + string description, + string path) + : base(parentContainer, name, description, path) + { + this.ObjectType = ObjectType.Container; + } + public SnapshotsUIContainer() + {} + #region Methods +//========================================================================================================= +/// +/// +/// +/// +/// +//========================================================================================================= + public override void Load() + { + IList snapshots = this.RepositoryFactory.CreateSnapshotRepository().GetSnapshots(); + this.SetUIContainers(snapshots); + this.Entities = snapshots; + } + #endregion + } +} + + diff --git a/Openstack.Client.Powershell/Providers/BlockStorage/VolumeBackupUIContainer.cs b/Openstack.Client.Powershell/Providers/BlockStorage/VolumeBackupUIContainer.cs new file mode 100644 index 0000000..910dbff --- /dev/null +++ b/Openstack.Client.Powershell/Providers/BlockStorage/VolumeBackupUIContainer.cs @@ -0,0 +1,79 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Compute; +using Openstack.Objects.Domain.BlockStorage; +using Openstack.Client.Powershell.Providers.BlockStorage; + +namespace Openstack.Client.Powershell.Providers.Security +{ + public class VolumeBackupUIContainer : BaseUIContainer + { +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void LoadContainers() + {} +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void Load() + {} +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void WriteEntityDetails() + { + VolumeBackup backup = (VolumeBackup)this.Entity; + + this.WriteHeader("Volume Backup Details"); + this.WriteVolumeBackupDetails(backup); + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void WriteVolumeBackupDetails(VolumeBackup backup) + { + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + + Console.WriteLine("Id : " + backup.Id); + Console.WriteLine("Name : " + backup.Name); + Console.WriteLine("Description : " + backup.Description); + Console.WriteLine("Size : " + backup.Size); + Console.WriteLine("Availability Zone : " + backup.AvailabilityZone); + Console.WriteLine("Container : " + backup.Container); + Console.WriteLine("Object Count : " + backup.ObjectCount); + Console.WriteLine("Created On : " + backup.CreatedDate); + Console.WriteLine("Status : " + backup.Status); + Console.WriteLine("Volume Id : " + backup.VolumeId); + Console.WriteLine(""); + } + } +} diff --git a/Openstack.Client.Powershell/Providers/BlockStorage/VolumeBackupsUIContainer.cs b/Openstack.Client.Powershell/Providers/BlockStorage/VolumeBackupsUIContainer.cs new file mode 100644 index 0000000..1527649 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/BlockStorage/VolumeBackupsUIContainer.cs @@ -0,0 +1,63 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Collections.Generic; +using Openstack.Administration.Domain; +using System.Collections; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Compute; +using Openstack.Objects.Domain; + +namespace Openstack.Client.Powershell.Providers.Security +{ + [RequiredServiceIdentifierAttribute("Openstack-ComputeDrive")] + public class VolumeBackupsUIContainer : BaseUIContainer + { +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public VolumeBackupsUIContainer(BaseUIContainer parentContainer, + string name, + string description, + string path) + : base(parentContainer, name, description, path) + { + this.ObjectType = ObjectType.Container; + } + public VolumeBackupsUIContainer() + {} + #region Methods +//========================================================================================================= +/// +/// +/// +/// +/// +//========================================================================================================= + public override void Load() + { + IList volumes = this.RepositoryFactory.CreateVolumeRepository().GetVolumeBackups(); + this.SetUIContainers(volumes); + this.Entities = volumes; + } + #endregion + } +} + diff --git a/Openstack.Client.Powershell/Providers/BlockStorage/VolumeUIContainer.cs b/Openstack.Client.Powershell/Providers/BlockStorage/VolumeUIContainer.cs new file mode 100644 index 0000000..e52b1b3 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/BlockStorage/VolumeUIContainer.cs @@ -0,0 +1,109 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Compute; +using Openstack.Objects.Domain.BlockStorage; +using Openstack.Client.Powershell.Providers.BlockStorage; + +namespace Openstack.Client.Powershell.Providers.Security +{ + public class VolumeUIContainer : BaseUIContainer + { +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void Load() + { + //this.LoadContainers(); + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void LoadContainers() + { + this.Containers.Clear(); + AttachmentsUIContainer sgContainer = (AttachmentsUIContainer)this.CreateContainer("Attachments", "Manage this Volumes attachments.", this.Parent.Path + @"\Attachments"); + this.Containers.Add(sgContainer); + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void WriteEntityDetails() + { + Volume volume = (Volume)this.Entity; + + this.WriteHeader("Volume Details"); + this.WriteVolumeDetails(volume); + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void WriteVolumeMetadata(Volume volume) + { + int maxLength = volume.Metadata.Max(m => m.Key.Length); + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + + foreach (KeyValuePair element in volume.Metadata) + { + Console.WriteLine(element.Key.PadRight(maxLength) + " : " + element.Value.Trim()); + } + Console.WriteLine(); + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void WriteVolumeDetails(Volume volume) + { + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + + Console.WriteLine("Id : " + volume.Id); + Console.WriteLine("Name : " + volume.Name); + Console.WriteLine("Description : " + volume.Description); + Console.WriteLine("Size : " + volume.Size); + Console.WriteLine("Created On : " + volume.CreationDate); + Console.WriteLine("Status : " + volume.Status); + Console.WriteLine("Server Attached To : " + volume.AttachedTo); + Console.WriteLine("Device : " + volume.Device); + Console.WriteLine(""); + + if (volume.Metadata.Count() > 0) + { + Console.ForegroundColor = ConsoleColor.White; + Console.WriteLine("Volume Metadata"); + Console.ForegroundColor = ConsoleColor.Green; + Console.WriteLine(""); + WriteVolumeMetadata(volume); + } + } + } +} diff --git a/Openstack.Client.Powershell/Providers/BlockStorage/VolumesUIContainer.cs b/Openstack.Client.Powershell/Providers/BlockStorage/VolumesUIContainer.cs new file mode 100644 index 0000000..19ffa99 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/BlockStorage/VolumesUIContainer.cs @@ -0,0 +1,63 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Collections.Generic; +using Openstack.Administration.Domain; +using System.Collections; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Compute; +using Openstack.Objects.Domain; + +namespace Openstack.Client.Powershell.Providers.Security +{ + [RequiredServiceIdentifierAttribute("Openstack-ComputeDrive")] + public class VolumesUIContainer : BaseUIContainer + { +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public VolumesUIContainer(BaseUIContainer parentContainer, + string name, + string description, + string path) + : base(parentContainer, name, description, path) + { + this.ObjectType = ObjectType.Container; + } + public VolumesUIContainer() + {} + #region Methods +//========================================================================================================= +/// +/// +/// +/// +/// +//========================================================================================================= + public override void Load() + { + IList volumes = this.RepositoryFactory.CreateVolumeRepository().GetVolumes(); + this.SetUIContainers(volumes); + this.Entities = volumes; + } + #endregion + } +} + diff --git a/Openstack.Client.Powershell/Providers/Common/AccountUIContainer.cs b/Openstack.Client.Powershell/Providers/Common/AccountUIContainer.cs new file mode 100644 index 0000000..bd2f2c8 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Common/AccountUIContainer.cs @@ -0,0 +1,84 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Collections; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Client.Powershell.Providers.Security; +using Openstack.Objects.Domain; +using Openstack.Objects.Utility; +using Openstack.Objects.DataAccess; +using Openstack.Client.Powershell.Providers.Database; +using Openstack.Client.Powershell.Providers.Networking; +using Openstack.Client.Powershell.Providers.Compute; + +namespace Openstack.Administration.Domain +{ + public static class CurrentAccountUIContainer + { + public static AccountUIContainer CurrentAccount = null; + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public class AccountUIContainer : BaseUIContainer + { + public override void Load() + { + this.LoadContainers(); + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void LoadContainers() + { + this.Containers.Clear(); + + this.AddContainer(this.CreateContainer ("Servers", "A place to manage Servers across the Account.", "Servers")); + this.AddContainer(this.CreateContainer ("Flavors", "Manage additional hardware configurations for Servers.", "Flavors")); + this.AddContainer(this.CreateContainer ("Images", "Manage collections of files used to create or rebuild Servers.", "Images")); + this.AddContainer(this.CreateContainer ("Security", "Manage Key Pair and Security Group Rules here.", "Security")); + //this.AddContainer(this.CreateContainer ("Networking", "A place to manage dynamic IP addresses assigned to your Servers.", "Networking")); + this.AddContainer(this.CreateContainer ("BlockStorage", "A place to manage Block Storage Volumes and Snapshots.", "BlockStorage")); + this.AddContainer(this.CreateContainer ("Networks", "Manage networks, subnets, ports and routers.", "Networks")); + // this.AddContainer(this.CreateContainer ("Data", "Database Services", "Data")); + } +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public AccountUIContainer(BaseUIContainer parentContainer, string name, string description, string path, Context context, BaseRepositoryFactory repository) + : base(parentContainer, name, description, path) + { + this.Context = context; + this.RepositoryFactory = repository; + + this.LoadContainers(); + this.ObjectType = Client.Powershell.Providers.Common.ObjectType.Entity; + } + } +} diff --git a/Openstack.Client.Powershell/Providers/Common/BaseEntityUIContainer.cs b/Openstack.Client.Powershell/Providers/Common/BaseEntityUIContainer.cs new file mode 100644 index 0000000..b043fe3 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Common/BaseEntityUIContainer.cs @@ -0,0 +1,32 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace Openstack.Client.Powershell.Providers.Common +{ + public class BaseEntityUIContainer : BaseUIContainer + { + public override void Load() + { + + + } + } +} diff --git a/Openstack.Client.Powershell/Providers/Common/BaseNavigationCmdletProvider.cs b/Openstack.Client.Powershell/Providers/Common/BaseNavigationCmdletProvider.cs new file mode 100644 index 0000000..d4913fd --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Common/BaseNavigationCmdletProvider.cs @@ -0,0 +1,317 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Management.Automation; +using System.Management.Automation.Provider; +using Openstack.Objects.DataAccess; +using Openstack.Common.Properties; +using System.Xml.Serialization; +using System.Xml; +using System.IO; +using System.Text; +using System.Runtime.Serialization.Json; +using Openstack.Client.Powershell.Providers.Storage; +using Openstack.Objects.Utility; +using Openstack.Objects.Domain.Admin; +using Openstack.Objects.DataAccess.Security; +using System.Reflection; +using System.Xml.Linq; +using System.Xml.XPath; + +namespace Openstack.Client.Powershell.Providers.Common +{ + public class BaseNavigationCmdletProvider : NavigationCmdletProvider + { + static BaseRepositoryFactory _repositoryFactory; +//========================================================================================= +/// +/// +/// +//========================================================================================= + protected BaseRepositoryFactory RepositoryFactory + { + get + { + return (BaseRepositoryFactory)this.SessionState.PSVariable.Get("BaseRepositoryFactory").Value; + } + set + { + this.SessionState.PSVariable.Set(new PSVariable("BaseRepositoryFactory", value)); + } + } +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + protected Settings Settings + { + get + { + return this.Context.Settings; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + protected Context Context + { + get + { + return (Context)this.SessionState.PSVariable.GetValue("Context", null); + } + } +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + private bool IsContextInitialized() + { + if (this.SessionState.PSVariable.GetValue("Context", null) == null) { + return false; + } + else + { + return true; + } + } +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + protected string ConfigFilePath + { + get + { + try + { + return (string)this.SessionState.PSVariable.Get("ConfigPath").Value; + } + catch (Exception) + { + return Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\" + @"OS\CLI.config"; + } + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + private void SetZoneColor() + { + string configFilePath = this.ConfigFilePath; + XDocument doc = XDocument.Load(configFilePath); + XElement defaultZoneNode = doc.XPathSelectElement("//AvailabilityZone[@isDefault='True']"); + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), defaultZoneNode.Attribute("shellForegroundColor").Value); + this.Host.UI.RawUI.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), defaultZoneNode.Attribute("shellForegroundColor").Value); + this.Context.Forecolor = defaultZoneNode.Attribute("shellForegroundColor").Value; + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + protected void InitializeSession() + { + if (!IsContextInitialized()) + { + Context context = new Context(); + CredentialManager manager = new CredentialManager(false); + AuthenticationRequest request = manager.BuildAuthenticationRequest(); + + if (request != null) + { + KeystoneAuthProvider authProvider = new KeystoneAuthProvider(); + AuthenticationResponse response = authProvider.Authenticate(request); + + context.ServiceCatalog = response.ServiceCatalog; + context.Settings = Settings.Default; + + context.AccessToken = response.Token; + context.ProductName = "Openstack-WinCLI"; + context.Version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); + + this.SessionState.PSVariable.Set(new PSVariable("Context", context)); + this.SessionState.PSVariable.Set(new PSVariable("BaseRepositoryFactory", new BaseRepositoryFactory(context))); + this.SetZoneColor(); + + string currentVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); + //string currentVersion = "1.4.0.0"; + UpdateManager updateManager = new UpdateManager(this.Context, currentVersion, this.RepositoryFactory); + updateManager.ProcessUpdateCheck(); + } + } + } + #region Implementation of DriveCmdletProvider +//================================================================================================== +/// +/// Removes an Item from the store.. +/// +/// +//================================================================================================== + protected override void ClearItem(string path) + { + base.ClearItem(path); + } +//================================================================================================== +/// +/// +/// +/// +/// +/// +//================================================================================================== + protected void WriteJSON (T graph, string path) + { + MemoryStream stream = new MemoryStream(); + DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(T)); + ser.WriteObject(stream, graph); + + string retValue = Encoding.Default.GetString(stream.ToArray()); + WriteItemObject(retValue, path, false); + WriteItemObject("", path, false); + } +//================================================================================================== +/// +/// Writes out the files represented as StorageObjects for the supplied path. +/// +//================================================================================================== + protected void WriteXML(T graph, string path) + { + XmlTextWriter xtw = null; + MemoryStream stream = new MemoryStream(); + StringBuilder builder = new StringBuilder(); + XmlDocument document = new XmlDocument(); + StringWriter writer = null; + XmlSerializer serializer = new XmlSerializer(typeof(T)); + + try + { + serializer.Serialize(stream, graph); + stream.Position = 0; + document.Load(stream); + + writer = new StringWriter(builder); + xtw = new XmlTextWriter(writer); + xtw.Formatting = Formatting.Indented; + + document.WriteTo(xtw); + } + finally + { + xtw.Close(); + } + WriteItemObject(builder.ToString(), path, false); + WriteItemObject("", path, false); + } +//================================================================================================== +/// +/// Called when the user decides to delete a KVSDrive. +/// +/// +/// +//================================================================================================== + protected override PSDriveInfo RemoveDrive(PSDriveInfo drive) + { + if (drive == null) + { + WriteError(new ErrorRecord(new ArgumentNullException("drive"), "NullDrive", ErrorCategory.InvalidArgument, drive)); + return null; + } + return drive; + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + protected override void GetChildNames(string path, ReturnContainers returnContainers) + { + WriteItemObject(path, path, true); + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + protected override string GetChildName(string path) + { + return base.GetChildName(path); + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + protected override bool ItemExists(string path) + { + return true; + } + #endregion +//================================================================================================== +/// +/// +/// +//================================================================================================== + protected ResponseFormat ResponseFormat + { + get + { + try + { + return (ResponseFormat)this.SessionState.PSVariable.Get("ResponseFormat").Value; + } + catch (Exception) + { + PSVariable variable = new PSVariable("ResponseFormat"); + variable.Value = ResponseFormat.data; + + this.SessionState.PSVariable.Set(variable); + return ResponseFormat.data; + } + } + } +//================================================================================================== +/// +/// This test should not verify the existance of the item at the path. +/// It should only perform syntactic and semantic validation of the +/// path. For instance, for the file system provider, that path should +/// be canonicalized, syntactically verified, and ensure that the path +/// does not refer to a device. +/// +/// +/// +//================================================================================================== + protected override bool IsValidPath(string path) + { + return true; + } + } +} diff --git a/Openstack.Client.Powershell/Providers/Common/BaseUIContainer.cs b/Openstack.Client.Powershell/Providers/Common/BaseUIContainer.cs new file mode 100644 index 0000000..4f7d5f8 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Common/BaseUIContainer.cs @@ -0,0 +1,518 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Collections.Generic; +using System.Linq; +using Openstack.Common.Properties; +using Openstack.Objects.Domain; +using System; +using Openstack.Objects.Utility; +using Openstack.Objects.DataAccess; +using System.Collections.ObjectModel; +using System.Collections; +using Openstack.Objects.Domain.Compute; + +namespace Openstack.Client.Powershell.Providers.Common +{ + public class GenericUIContainer : BaseEntityUIContainer { } + + public enum ObjectType + { + Entity = 1, + Container = 2 + } + public abstract class BaseUIContainer + { + private string _id; + private string _name; + private string _description; + private string _path = @"\"; + private ObjectType _objectType = ObjectType.Container; + protected List _containers = new List(); + protected IList _entities = new List(); + private BaseEntity _entity; + private BaseUIContainer _parentContainer; + private bool _isContainerListInitialized = false; + private Context _context; + private BaseRepositoryFactory _repositoryFactory; + private string _displayName = null; + + #region Ctors +//================================================================================ +/// +/// +/// +//================================================================================ + public BaseUIContainer() + { + + } +//================================================================================ +/// +/// +/// +/// +/// +/// +/// +/// +//================================================================================ + public BaseUIContainer(BaseUIContainer parentContainer, string name, string description, string path) + { + _description = description; + _parentContainer = parentContainer; + _name = name; + _path = path; + } +//================================================================================ +/// +/// +/// +/// +/// +/// +/// +//================================================================================ + public BaseUIContainer(string displayName, BaseUIContainer parentContainer, string name, string path) + { + _parentContainer = parentContainer; + _name = name; + _path = path; + _displayName = displayName; + } + #endregion + #region Properties +//================================================================================ +/// +/// +/// +//================================================================================ + public BaseRepositoryFactory RepositoryFactory + { + get { return _repositoryFactory; } + set { _repositoryFactory = value; } + } +//================================================================================ +/// +/// +/// +//================================================================================ + public Context Context + { + get { return _context; } + set + { + _context = value; + if (_repositoryFactory != null && _repositoryFactory.Context != null) + _repositoryFactory.Context = value; + } + } +//================================================================================ +/// +/// +/// +/// +//================================================================================ + protected bool IsMocked + { + get + { + if (Settings.Default.IsMocked == true) + { + return true; + } + else + { + return false; + } + } + } +//================================================================================ +/// +/// +/// +//================================================================================ + public IList Entities + { + get { return _entities; } + set + { + _entities = value; + } + } +//================================================================================ +/// +/// +/// +//================================================================================ + public BaseEntity Entity + { + get { return _entity; } + set + { + _entity = value; + } + } +//================================================================================ +/// +/// +/// +//================================================================================ + public List Containers + { + get { return _containers; } + //set { _containers = value; } + } +//================================================================================ +/// +/// +/// +//================================================================================ + public ObjectType ObjectType + { + get { return _objectType; } + set { _objectType = value; } + } +//================================================================================ +/// +/// +/// +//================================================================================ + public string Id + { + get { return _id; } + set { _id = value; } + } +//================================================================================ +/// +/// +/// +//================================================================================ + public BaseUIContainer Parent + { + get { return _parentContainer; } + set { _parentContainer = value; } + } +//================================================================================ +/// +/// +/// +//================================================================================ + public string Path + { + get { return _path; } + set { _path = value; } + + } +//================================================================================ +/// +/// +/// +//================================================================================ + public string Description + { + get { return _description; } + set { _description = value; } + } +//================================================================================ +/// +/// +/// +//================================================================================ + public string DisplayName + { + get { return _displayName; } + set { _displayName = value; } + } +//================================================================================ +/// +/// +/// +//================================================================================ + public string Name + { + get { return _name; } + set { _name = value; } + } + #endregion + #region Methods +//================================================================================ +/// +/// +/// +/// +//================================================================================ + protected void AddContainer(BaseUIContainer container) + { + if (container != null) { + this.Containers.Add(container); + } + } +//================================================================================ +/// +/// +/// +/// +/// +//================================================================================ + protected string BuildChildPath(string name) + { + return this.Path + "\\" + name; + } +//================================================================================ +/// +/// +/// +/// +//================================================================================ + public virtual BaseUIContainer CreateContainer(string id) + { + return null; + } +//================================================================================ +/// +/// +/// +/// +/// +/// +//================================================================================ + private bool IsAuthorized(T container) + { + Type type = container.GetType(); + object[] metadata = type.GetCustomAttributes(false); + + foreach (object attribute in metadata) + { + RequiredServiceIdentifierAttribute identifier = attribute as RequiredServiceIdentifierAttribute; + + if (identifier != null) + if (this.Context.ServiceCatalog.DoesServiceExist(identifier.ServiceName)) + return true; + else return false; + } + + return true; + } +//================================================================================ +/// +/// +/// +/// +/// +/// +/// +/// +//================================================================================ + protected BaseUIContainer SetContainer(BaseUIContainer container, string name, string description, string path, string displayName = null) where T : BaseUIContainer + { + if (this.IsAuthorized(container)) + { + container.Name = name; + container.Description = description; + container.Context = this.Context; + container.RepositoryFactory = this.RepositoryFactory; + container.Parent = this; + container.Path = path; + container.DisplayName = displayName; + container.Id = name; + + return container; + } + else + { + return null; + } + } +//================================================================================ +/// +/// +/// +/// +/// +/// +/// +/// +//================================================================================ + protected BaseUIContainer CreateContainer(string name, string description, string path, string displayName = null) where T : BaseUIContainer + { + T container = Activator.CreateInstance(); + + if (this.IsAuthorized(container)) + { + container.Name = name; + container.Description = description; + container.Context = this.Context; + container.RepositoryFactory = this.RepositoryFactory; + container.Parent = this; + container.Path = path; + container.DisplayName = displayName; + container.Id = name; + + return container; + } + else + { + return null; + } + } +//================================================================================ +/// +/// +/// +/// +//================================================================================ + public virtual BaseUIContainer CreateEntityContainer(BaseEntity entity) + { + BaseEntityUIContainer container = new BaseEntityUIContainer(); + container.Entity = entity; + + return container; + } +//================================================================================ +/// +/// +/// +/// +/// +//================================================================================ + public BaseUIContainer GetContainer(string containerName) + { + return _containers.Where(c => c.Id == containerName).SingleOrDefault(); + } + + public virtual void WriteEntityDetails() { return; } +//================================================================================ +/// +/// +/// +/// +/// +//================================================================================ + protected void SetUIContainers(Collection entities) where T : BaseUIContainer + { + List entityContainers = new List(); + foreach (BaseEntity entity in entities) + { + T entityContainer = (T)Activator.CreateInstance(typeof(T)); + + entityContainer.Entity = entity; + entityContainer.Name = entity.Name; + entityContainer.ObjectType = Common.ObjectType.Entity; + entityContainer.Parent = this; + entityContainer.RepositoryFactory = this.RepositoryFactory; + entityContainer.Context = this.Context; + entityContainer.Id = entity.Id; + + entityContainers.Add(entityContainer); + } + + this.Containers.Clear(); + + int count = 0; + foreach (BaseUIContainer bc in entityContainers) + { + bc.Path = @"\" + bc.Parent.Path + @"\-" + Convert.ToString(count); + this.Containers.Add(bc); + ++count; + } + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + protected void SetUIContainers(IList entities) where T : BaseUIContainer + { + if (entities != null && entities.Count > 0) + { + List entityContainers = new List(); + foreach (BaseEntity entity in entities) + { + T entityContainer = (T)Activator.CreateInstance(typeof(T)); + + entityContainer.Entity = entity; + entityContainer.Name = entity.Name; + entityContainer.ObjectType = Common.ObjectType.Entity; + entityContainer.Parent = this; + entityContainer.RepositoryFactory = this.RepositoryFactory; + entityContainer.Context = this.Context; + entityContainer.Id = entity.Id; + + entityContainers.Add(entityContainer); + } + + this.Containers.Clear(); + + int count = 0; + foreach (BaseUIContainer bc in entityContainers) + { + bc.Path = @"\" + bc.Parent.Path + @"\-" + Convert.ToString(count); + this.Containers.Add(bc); + ++count; + } + } + } + public abstract void Load(); +//================================================================================ +/// +/// +/// +/// +/// +//================================================================================ + public virtual bool IsEntityId(string id) + { + if (this.Id == id) return true; else return false; + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + protected void WriteMetadata(MetaData metadata) + { + if (metadata != null) + { + int maxLength = metadata.Max(m => m.Key.Length); + + foreach (KeyValuePair element in metadata) + { + if (element.Value != null && element.Key != null) + Console.WriteLine(element.Key.PadRight(maxLength) + " : " + element.Value.Trim()); + } + Console.WriteLine(); + } + } +//================================================================================ +/// +/// +/// +/// +/// +//================================================================================ + protected void WriteHeader(string msg, ConsoleColor textColor = ConsoleColor.Yellow) + { + Console.ForegroundColor = ConsoleColor.White; + Console.WriteLine(""); + Console.WriteLine(msg ); + Console.WriteLine(); + Console.ForegroundColor = ConsoleColor.Green; + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/Providers/Common/CommonDriveInfo.cs b/Openstack.Client.Powershell/Providers/Common/CommonDriveInfo.cs new file mode 100644 index 0000000..658f392 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Common/CommonDriveInfo.cs @@ -0,0 +1,85 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Collections; +using System.Collections.Generic; +using System.Management.Automation; +using Openstack.Objects.DataAccess; +using Openstack.Common.DataAccess; +using Openstack.Client.Powershell.Providers.Common; + +namespace Openstack.Client.Powershell.Providers.Common +{ + public class CommonDriveInfo : PSDriveInfo + { + private CommonDriveParameters _parameters = null; + private BaseUIContainer _currentContainer = null; + + #region Ctors +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + public CommonDriveInfo(PSDriveInfo driveInfo, CommonDriveParameters parameters) : base (driveInfo) + { + _parameters = parameters; + } + #endregion + #region Methods +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + public Hashtable GetParameters() + { + return null; + } + #endregion + #region Properties +//================================================================================================== +/// +/// +/// +//================================================================================================== + public BaseUIContainer CurrentTenant + { + get { return _currentContainer; } + set + { + _currentContainer = value; + this.CurrentLocation = _currentContainer.Path; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public BaseUIContainer CurrentContainer + { + get { return _currentContainer; } + set + { + _currentContainer = value; + this.CurrentLocation = _currentContainer.Path; + } + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/Providers/Common/CommonDriveParameters.cs b/Openstack.Client.Powershell/Providers/Common/CommonDriveParameters.cs new file mode 100644 index 0000000..816e2c0 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Common/CommonDriveParameters.cs @@ -0,0 +1,44 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Openstack.Client.Powershell.Providers.Common +{ + public class CommonDriveParameters + { + #region Ctors + //================================================================================= + /// + /// + /// + /// + //================================================================================= + public CommonDriveParameters() + { } + #endregion + #region Properties + //================================================================================= + /// + /// + /// + //================================================================================= + #endregion + } +} + diff --git a/Openstack.Client.Powershell/Providers/Common/CommonServiceProvider.cs b/Openstack.Client.Powershell/Providers/Common/CommonServiceProvider.cs new file mode 100644 index 0000000..8a67c9b --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Common/CommonServiceProvider.cs @@ -0,0 +1,606 @@ + +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Management.Automation; +using System.Management.Automation.Provider; +using System.Collections.ObjectModel; +using System.IO; +using Openstack.Administration.Domain; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Compute; +using System.Diagnostics.Contracts; +using System.Linq; +using Openstack.Objects.Domain; +using System.Management.Automation.Runspaces; + +namespace Openstack.Client.Powershell.Providers.Security +{ + public enum ContainerAxis + { + Ancestor = 0, + Descendant = 1, + Neutral = 3, + Root = 4, + NotFound = 5 + } + + [CmdletProvider("OS-Cloud", ProviderCapabilities.None)] + public class CommonServiceProvider : BaseNavigationCmdletProvider + { + #region Provider LifeCycle Support +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + protected override System.Collections.ObjectModel.Collection InitializeDefaultDrives() + { + this.InitializeSession(); + + // Check to see if this provider is in the list of returned Services in the Catalog (indicating access is granted) + + PSDriveInfo driveInfo = new PSDriveInfo("OpenStack", this.ProviderInfo, "/", "Openstack Services Provider", null); + Collection drives = new Collection(); + drives.Add(driveInfo); + return drives; + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + protected override ProviderInfo Start(ProviderInfo providerInfo) + { + return base.Start(providerInfo); + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + protected override PSDriveInfo NewDrive(PSDriveInfo drive) + { + WriteDebug("Enter : CloudServiceProvider.NewDrive"); + if (drive == null) + { + WriteError(new ErrorRecord(new ArgumentNullException("drive"), "NullDrive", ErrorCategory.InvalidArgument, drive)); + return null; + } + + if (drive.Root == null) + { + WriteError(new ErrorRecord(new ArgumentNullException("drive.Root"), "NullRoot", ErrorCategory.InvalidArgument, drive)); + return null; + } + + if (drive is CommonDriveInfo) + { + return drive; + } + + var driveParams = this.DynamicParameters as CommonDriveParameters; + WriteDebug("Exit : CloudServiceProvider.NewDrive"); + return new CommonDriveInfo(drive, driveParams); + } +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + protected override object NewDriveDynamicParameters() + { + return new CommonDriveParameters(); + } + #endregion + #region Basic Operations (LS, CD xxx, CD.. etc) +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + protected override void GetChildItems(string path, bool recurse) + { + WriteContainer(this.Drive.CurrentContainer); + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + private bool IsParentPath(string path) + { + if (Path.GetFileNameWithoutExtension(path) == Path.GetFileNameWithoutExtension(this.Drive.CurrentContainer.Parent.Path)) + return true; + else + return false; + } +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + private void SetRoot() + { + string defaultTenantId = "TENANTAC1001"; + BaseUIContainer root = new AccountUIContainer(null, "Account", "The Users assigned Account", @"\\", this.Context, this.RepositoryFactory); + Account fake = new Account(); + fake.Name = "TestAccount"; + fake.Id = defaultTenantId; + root.Entity = fake; + + CurrentAccountUIContainer.CurrentAccount = (AccountUIContainer)root; + this.Drive.CurrentContainer = root; + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + private bool IsMovingToContainer(string lastPathEntry) + { + bool isMovingToContainer = false; + + if (this.Drive.CurrentContainer.Name == lastPathEntry) isMovingToContainer = true; + + foreach (BaseUIContainer container in this.Drive.CurrentContainer.Containers) + { + if (container.Id == lastPathEntry) isMovingToContainer = true; + } + + return isMovingToContainer; + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + private ContainerAxis CheckContainerAxis(string path) + { + // Do our Root and Neutrality Checks (by Neutral I mean the User has issued LS on the same entity so no movement along the axis). + + if (path == "\\") return ContainerAxis.Root; + + string lastPathEntry = Path.GetFileNameWithoutExtension(path); + + // See if the User is moving back up to the Parent node of the Current Container. + + if ((this.Drive.CurrentContainer != null && this.Drive.CurrentContainer.Parent != null && lastPathEntry == this.Drive.CurrentContainer.Parent.Id)) return ContainerAxis.Ancestor; + if (this.IsNamedAncestor(path)) return ContainerAxis.Ancestor; + + // Before we get started verifying the decendant move, make sure the next node is populated with something first.. + + if (this.Drive.CurrentContainer != null && this.Drive.CurrentContainer.Containers.Count == 0) + this.Drive.CurrentContainer.Load(); + + // Finally see if the User is moving downward into a decendant BaseUIContainer from the current one, if not the input supplied is invalid. + + if (lastPathEntry == this.Drive.CurrentContainer.Id) return ContainerAxis.Descendant; + + if (this.IsMovingToContainer(lastPathEntry)) return ContainerAxis.Descendant; + else + return ContainerAxis.NotFound; + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + private bool IsNamedAncestor(string path) + { + string lastPathEntry = Path.GetFileNameWithoutExtension(path); + + if (Path.GetFileNameWithoutExtension(path).StartsWith("-") || path == "\\") + { + return false; + } + else if (this.Drive.CurrentContainer.Parent != null && this.Drive.CurrentContainer.Parent.Name == lastPathEntry) + { + return true; + } + else + { + return false; + } + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + private string TranslateQuickPickNumber(string path) + { + BaseUIContainer result = null; + int number = 0; + + if (Int32.TryParse(Path.GetFileName(path), out number)) + { + if (path == "\\" + this.Drive.CurrentLocation) + { + return path.Replace(Path.GetFileName(path), this.Drive.CurrentContainer.Entity.Id); + } + else if (path.Length < this.Drive.CurrentLocation.Length) + { + result = this.Drive.CurrentContainer.Parent; + } + else + { + try + { + result = this.Drive.CurrentContainer.Containers.Where(q => q.Entity.QuickPickNumber == number).FirstOrDefault(); + } + catch (NullReferenceException ex) + { + return null; + } + } + + + if (result != null) + return path.Replace(Path.GetFileName(path), result.Id); + else return null; + } + else return null; + + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + private bool IsQuickPickNumber(string path) + { + int test = 0; + return Int32.TryParse(Path.GetFileName(path), out test); + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + protected override bool IsItemContainer(string path) + { + if (this.IsQuickPickNumber(path)) + { + string testPath = this.TranslateQuickPickNumber(path); + if (testPath == null && this.Drive.CurrentContainer.Entity != null) + { + path = path.Replace(Path.GetFileName(path), this.Drive.CurrentContainer.Entity.Id); + } + else { + path = testPath; + } + } + + switch (this.CheckContainerAxis(path)) + { + case (ContainerAxis.Ancestor): + + // The User has issued "cd .." so we're moving up the Ancestor axis... + + this.Drive.CurrentContainer = this.Drive.CurrentContainer.Parent; + this.SessionState.PSVariable.Set("CurrentContainer", this.Drive.CurrentContainer); + return true; + + case (ContainerAxis.Descendant): + + // The User has moved down the decendant axis either into a Container representing a single Entity or one that represents + // a full blown association of entities. + + this.SetDescendant(path); + break; + + case (ContainerAxis.Neutral): + + // The User has issued LS one the same Container so no movement on the axis.. + + return true; + + case (ContainerAxis.Root): + + // The User has issued cd\ bringing them all the way back to Root.. + + this.SetRoot(); + return true; + + case (ContainerAxis.NotFound): + + return false; + } + + return true; + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + private bool SetDescendant(string path) + { + if (this.Drive.CurrentContainer != null && this.Drive.CurrentContainer.Containers != null) + { + // To clarify, we're looking for the value of the last delimited entry in the path.. + + string lastPathEntry = Path.GetFileNameWithoutExtension(path); + + if (lastPathEntry != "" && lastPathEntry != this.Drive.CurrentContainer.Id) + { + BaseUIContainer container = null; + container = this.Drive.CurrentContainer.GetContainer(lastPathEntry); + this.SessionState.PSVariable.Set("CurrentContainer", container); + + if (container != null) + { + // NAVIGATION SUCCESS : The commands value can be matched to an available association so set that node + // as the current container\position.. + + this.Drive.CurrentContainer = container; + this.SessionState.PSVariable.Set("CurrentContainer", container); + return true; + } + else + { + // SHOW ENTITY DETAILS : Check to see if the key supplied by the User matches any Entity that is being managed + // by the current Container. Here, the User has moved (CD) into an Entity and has issued an LS command. + + if (this.Drive.CurrentContainer.Entity != null && this.Drive.CurrentContainer.IsEntityId(lastPathEntry)) return true; + + // The User tried to view the details of some entity yet we havn't pulled that Entity into the Container yet. + + BaseUIContainer entityContainer = this.Drive.CurrentContainer.CreateContainer(lastPathEntry); + + if (entityContainer != null) + { + // The Read operation on that Entity succeeded so set that Container as current.. + + this.Drive.CurrentContainer = entityContainer; + this.SessionState.PSVariable.Set("CurrentContainer", container); + return true; + } + else + { + return false; + } + } + } + + if (this.Drive.CurrentContainer != null) + { + return true; + } + else + { + return false; + } + + } + return false; + } +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + private void WriteDecendantContainers(BaseUIContainer container) + { + Contract.Assert(container != null); + + if (container.Containers != null && container.Containers.Where(c => c.ObjectType == ObjectType.Container).Count() > 0) + { + Console.ForegroundColor = ConsoleColor.DarkGray; + WriteItemObject("==========================================================================================================", container.Path, false); + Console.ForegroundColor = ConsoleColor.Yellow; + Console.WriteLine(container.Name + " " + "Associations"); + Console.ForegroundColor = ConsoleColor.DarkGray; + WriteItemObject("==========================================================================================================", container.Path, false); + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + + + foreach (BaseUIContainer testContainer in container.Containers) + { + if (testContainer.ObjectType == ObjectType.Container) + { + WriteItemObject(testContainer, container.Path, false); + } + } + //container.Containers.ForEach(c => WriteItemObject(c, c.Path, true)); + WriteItemObject("", container.Path, false); + } + } +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + private void WriteEntities(BaseUIContainer container) + { + //if (container.Entities.Count == 0) + //container.Load(); + + if (container.Entities != null && container.Entities.Count > 0) + { + Console.ForegroundColor = ConsoleColor.DarkGray; + WriteItemObject("", container.Path, false); + WriteItemObject("==========================================================================================================", container.Path, false); + Console.ForegroundColor = ConsoleColor.Yellow; + WriteItemObject("The following " + container.Name + " " + "are available.", container.Path, false); + Console.ForegroundColor = ConsoleColor.DarkGray; + WriteItemObject("==========================================================================================================", container.Path, false); + WriteItemObject("", container.Path, false); + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + + int count = 0; + foreach (object obj in container.Entities) + { + this.Host.UI.RawUI.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + + BaseEntity tempObj = obj as BaseEntity; + if (tempObj != null) + { + tempObj.QuickPickNumber = count; + WriteItemObject(tempObj, this.Drive.CurrentLocation, false); + } + else + { + WriteItemObject(obj, this.Drive.CurrentLocation, false); + } + ++count; + } + + WriteItemObject("", this.Drive.CurrentLocation, false); + WriteItemObject(Convert.ToString(count) + " " + container.Name + "(s) found", this.Drive.CurrentLocation, false); + WriteItemObject("", this.Drive.CurrentLocation, false); + } + else + { + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + } + } +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + private void WriteEntity(BaseUIContainer container) + { + if (container.ObjectType == ObjectType.Entity) + { + container.WriteEntityDetails(); + } + } +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + private void WriteUIContainer(BaseUIContainer container) + { + container.Load(); + + this.WriteDecendantContainers(container); + this.WriteEntities(container); + this.WriteEntity(container); + } +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + private void WriteEntityContainer(BaseEntityUIContainer container) + { } +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + private void WriteContainer(BaseUIContainer container) + { + this.WriteUIContainer(container); + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + protected override void GetChildNames(string path, ReturnContainers returnContainers) + { + WriteItemObject(path, path, true); + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + protected override string GetChildName(string path) + { + return base.GetChildName(path); + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + protected override bool ItemExists(string path) + { + return true; + } +//================================================================================================== +/// +/// This test should not verify the existance of the item at the path. +/// It should only perform syntactic and semantic validation of the +/// path. For instance, for the file system provider, that path should +/// be canonicalized, syntactically verified, and ensure that the path +/// does not refer to a device. +/// +/// +/// +//================================================================================================== + protected override bool IsValidPath(string path) + { + return true; + } + #endregion + #region Properties +//================================================================================================== +/// +/// +/// +//================================================================================================== + private CommonDriveInfo Drive + { + get + { + return this.PSDriveInfo as CommonDriveInfo; + } + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/Providers/Common/HPServiceIdentifierAttribute.cs b/Openstack.Client.Powershell/Providers/Common/HPServiceIdentifierAttribute.cs new file mode 100644 index 0000000..73e9252 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Common/HPServiceIdentifierAttribute.cs @@ -0,0 +1,54 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Openstack.Objects.Domain.Admin; + +namespace Openstack.Client.Powershell.Providers.Common +{ + [System.AttributeUsage(System.AttributeTargets.Class ) +] public class RequiredServiceIdentifierAttribute : System.Attribute + { + private string _serviceName; + private Services _services; + + public Services Services + { + get { return _services; } + set { _services = value; } + } + + public RequiredServiceIdentifierAttribute(Services service) + { + _services = service; + } + + public RequiredServiceIdentifierAttribute(string serviceName) + { + _serviceName = serviceName; + } + + public string ServiceName + { + get + { + return _serviceName; + } + } + } +} diff --git a/Openstack.Client.Powershell/Providers/Common/UpdateManager.cs b/Openstack.Client.Powershell/Providers/Common/UpdateManager.cs new file mode 100644 index 0000000..b78093a --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Common/UpdateManager.cs @@ -0,0 +1,293 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Linq; +using System.Xml.Linq; +using Openstack.Common.Properties; +using System.Xml.XPath; +using Openstack.Objects.Utility; +using Openstack.Objects.DataAccess; +using System.IO; + +namespace Openstack.Client.Powershell.Providers.Common +{ + public class UpdateManager + { + private Settings _settings; + private string _currentVersion; + private Context _context; + private BaseRepositoryFactory _factory = null; + +//================================================================================ +/// +/// +/// +//================================================================================ + public UpdateManager(Context context, string currentVersion, BaseRepositoryFactory factory) + { + _settings = context.Settings; + _currentVersion = currentVersion; + _context = context; + _factory = new BaseRepositoryFactory(context); + } +//================================================================================ +// + +// +//================================================================================ + public BaseRepositoryFactory Factory + { + get { return _factory; } + set { _factory = value; } + } +//================================================================================ +/// +/// +/// +/// +/// +//================================================================================ + private bool RequiresUpdate(XDocument manifest) + { + try + { + XElement releaseNode = (from xml2 in manifest.Descendants("Release") + where xml2.Attribute(XName.Get("IsCurrentRelease")).Value == "True" + select xml2).FirstOrDefault(); + + if (releaseNode.Attribute(XName.Get("version")).Value == _currentVersion) + return false; + else + return true; + } + catch (Exception ex) { return false; } + } +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + protected void WriteHeaderSection(string headerText) + { + Console.WriteLine(" "); + Console.ForegroundColor = ConsoleColor.DarkGray; + Console.WriteLine("========================================================================================"); + Console.ForegroundColor = ConsoleColor.Yellow; + Console.WriteLine(headerText); + Console.ForegroundColor = ConsoleColor.DarkGray; + Console.WriteLine("========================================================================================"); + Console.ForegroundColor = ConsoleColor.Green; + } +//========================================================================================= +/// +/// +/// +/// +/// +//========================================================================================= + private string ReplaceToken(string url) + { + string[] elements = url.Split('/'); + elements[4] = "AUTH_2485a207-71a4-4429-9e24-f7bf49e207fc"; + return String.Join("/", elements); + } +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + private string CreateValidSourcePath(string sourcePath) + { + int pos = sourcePath.IndexOf(':'); + sourcePath = sourcePath.Remove(pos, 1); + return (this.ReplaceToken(this._context.ServiceCatalog.GetService("object-store").Url) + "/" + sourcePath).Replace(@"\", "/"); + } +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + private void GetLatestRelease(XDocument manifest) + { + IStorageObjectRepository repository = this.Factory.CreateStorageObjectRepository(); + ((BaseRepository)repository).Context.AccessToken.Id = null; + + XElement releaseNode = (from xml2 in manifest.Descendants("Release") + where xml2.Attribute(XName.Get("IsCurrentRelease")).Value == "True" + select xml2).FirstOrDefault(); + + string sourcePath = this.CreateValidSourcePath(releaseNode.Attribute(XName.Get("InstallPath")).Value); + + repository.Copy(sourcePath, _settings.NewReleaseFolder + Path.GetFileName(sourcePath), false); + Console.Write(@" ==> Download of " + _settings.NewReleaseFolder + Path.GetFileName(sourcePath) + " was successful."); + Console.WriteLine(" "); + } +//======================================================================================================= +/// +/// +/// +/// +//======================================================================================================= + private string PromptForCredentials() + { + Console.WriteLine("Please supply a downloads folder : "); + string path = Console.ReadLine(); + if (!path.EndsWith(@"\")) path = path + @"\"; + + if (!path.EndsWith(@"\")) path = path + @"\"; + + while (!Directory.Exists(path)) + { + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine(""); + Console.WriteLine("The supplied path does not exist. Please enter a valid path : "); + Console.ForegroundColor = ConsoleColor.Green; + path = Console.ReadLine(); + } + return path; + } +//======================================================================================================= +/// +/// Writes out header information to be used during the process that prompts for new credentials. +/// +//======================================================================================================= + private void WriteGetReleasePathHeader() + { + Console.WriteLine(""); + Console.ForegroundColor = ConsoleColor.DarkGray; + Console.WriteLine("======================================================================================================="); + Console.ForegroundColor = ConsoleColor.Yellow; + Console.WriteLine("We've noticed that you haven't supplied a location that we can download new releases to. When a new "); + Console.WriteLine("Windows CLI version is released, you will be shown the release notes for that version and be asked "); + Console.WriteLine("to download the latest install package. This component will be sent to that location"); + Console.ForegroundColor = ConsoleColor.DarkGray; + Console.WriteLine("======================================================================================================="); + Console.ForegroundColor = ConsoleColor.Green; + Console.WriteLine(" "); + } +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + private void UpdateCheck(XDocument manifest) + { + string configFilePath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\" + @"OS\CLI.config"; + + if (this.RequiresUpdate(manifest)) + { + this.WriteHeaderSection("New updates are available.."); + Console.WriteLine(" "); + this.PrintReleaseNotes(manifest); + Console.WriteLine(" "); + Console.Write(@"Would you like to download the latest release? (Y\N)"); + ConsoleKeyInfo key = Console.ReadKey(); + + if (key.KeyChar == 'Y' || key.KeyChar == 'y') + { + _settings.Load(configFilePath); + Console.WriteLine(" "); + Console.WriteLine(" "); + Console.WriteLine(@" ==> Copying latest release to " + _settings.NewReleaseFolder); + this.GetLatestRelease(manifest); + } + else + { + Console.WriteLine(" "); + Console.WriteLine(" "); + } + } + } +//======================================================================================================= +/// +/// +/// +/// +//======================================================================================================= + private void PrintReleaseNotes(XDocument manifest) + { + XElement releaseNode = (from xml2 in manifest.Descendants("Release") + where xml2.Attribute(XName.Get("IsCurrentRelease")).Value == "True" + select xml2).FirstOrDefault(); + + Console.WriteLine("Version : " + releaseNode.Attribute(XName.Get("version")).Value); + Console.WriteLine("Notes :"); + + XElement notes = (from xml2 in releaseNode.Descendants() + select xml2).FirstOrDefault(); + Console.WriteLine(notes.Value); + } +//======================================================================================================= +/// +/// +/// +/// +//======================================================================================================= + private bool DoesRequireReleasePath(XElement releasePathNode) + { + System.Collections.Generic.IEnumerable attributes = releasePathNode.Attributes(); + foreach (XAttribute attribute in attributes) + { + if (attribute.Name == "value" && attribute.Value == string.Empty) + { + return true; + } + } + return false; + } +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + private void CheckReleasePath() + { + string configFilePath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\" + @"OS\CLI.config"; + XDocument doc = XDocument.Load(configFilePath); + XElement releasePathNode = doc.XPathSelectElement("//add[@key='NewReleaseFolder']"); + + if (this.DoesRequireReleasePath(releasePathNode)) + { + this.WriteGetReleasePathHeader(); + string path = this.PromptForCredentials(); + releasePathNode.SetAttributeValue("value", path); + doc.Save(configFilePath); + } + } +//================================================================================ +/// +/// +/// +/// +//================================================================================ + public void ProcessUpdateCheck() + { + return; + XDocument manifest = XDocument.Load(_settings.ReleaseNotesURI); + + // Make sure that we have a supplied Downloads path from the user to send the release to.. + + this.CheckReleasePath(); + + // Check for and handle the new update.. + + this.UpdateCheck(manifest); + } + } +} diff --git a/Openstack.Client.Powershell/Providers/Compute/AbsoluteUIContainer.cs b/Openstack.Client.Powershell/Providers/Compute/AbsoluteUIContainer.cs new file mode 100644 index 0000000..f6b49c9 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Compute/AbsoluteUIContainer.cs @@ -0,0 +1,85 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Collections.Generic; +using Openstack.Administration.Domain; +using System.Collections; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Compute; +using Openstack.Objects.Domain; + +namespace Openstack.Client.Powershell.Providers.Compute +{ + public class AbsoluteLimitsUIContainer : BaseUIContainer + { + private List _absoluteLimits; + +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public AbsoluteLimitsUIContainer(BaseUIContainer parentContainer, + string name, + string description, + string path, + List absoluteLimits) + : base(parentContainer, name, description, path) + { + _absoluteLimits = absoluteLimits; + this.ObjectType = ObjectType.Container; + } + + #region Methods +//========================================================================================================= +/// +/// +/// +/// +/// +//========================================================================================================= + public override void Load() + { + + } +//========================================================================================================= +/// +/// +/// +/// +/// +//========================================================================================================= + public override BaseUIContainer CreateContainer(string id) + { + return null; + } + #endregion + #region Properties +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + //public List AbsoluteLimits + //{ + // get { return _absoluteLimits; } + // set { _absoluteLimits = value; } + //} + #endregion + } +} diff --git a/Openstack.Client.Powershell/Providers/Compute/AddressesUIContainer.cs b/Openstack.Client.Powershell/Providers/Compute/AddressesUIContainer.cs new file mode 100644 index 0000000..392f500 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Compute/AddressesUIContainer.cs @@ -0,0 +1,31 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Openstack.Client.Powershell.Providers.Common; + +namespace Openstack.Client.Powershell.Providers.Compute +{ + public class AddressesUIContainer : BaseUIContainer + { + public override void Load() + { + throw new NotImplementedException(); + } + } +} diff --git a/Openstack.Client.Powershell/Providers/Compute/FlavorUIContainer.cs b/Openstack.Client.Powershell/Providers/Compute/FlavorUIContainer.cs new file mode 100644 index 0000000..032f6b6 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Compute/FlavorUIContainer.cs @@ -0,0 +1,68 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Openstack.Objects.Domain.Compute; +using Openstack.Client.Powershell.Providers.Common; + +namespace Openstack.Client.Powershell.Providers.Compute +{ + public class FlavorUIContainer : BaseUIContainer + { +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void Load() + { } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void WriteEntityDetails() + { + Flavor flavor = (Flavor)this.Entity; + this.WriteHeader("Flavor Details"); + this.WriteFlavorDetails(flavor); + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void WriteFlavorDetails(Flavor flavor) + { + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + + Console.WriteLine("Id : " + flavor.Id); + Console.WriteLine("Name : " + flavor.Name); + Console.WriteLine("Disk : " + flavor.Disk); + Console.WriteLine("Ram : " + flavor.Ram); + Console.WriteLine("Status : " + flavor.Status); + Console.WriteLine("RxtxCap : " + flavor.RxtxCap); + Console.WriteLine("RxtxQuota : " + flavor.RxtxQuota); + Console.WriteLine("Swap : " + flavor.Swap); + Console.WriteLine("Vcpus : " + flavor.Vcpus); + Console.WriteLine(""); + + } + } +} diff --git a/Openstack.Client.Powershell/Providers/Compute/FlavorsUIContainer.cs b/Openstack.Client.Powershell/Providers/Compute/FlavorsUIContainer.cs new file mode 100644 index 0000000..cb4954f --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Compute/FlavorsUIContainer.cs @@ -0,0 +1,77 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using Openstack.Client.Powershell.Providers.Common; +using System.Collections; +using System.Collections.Generic; +using Openstack.Objects.Domain.Compute; + +namespace Openstack.Client.Powershell.Providers.Compute +{ + [RequiredServiceIdentifierAttribute("Openstack-ComputeDrive")] + public class FlavorsUIContainer : BaseUIContainer + { +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public FlavorsUIContainer(BaseUIContainer parentContainer, + string name, + string description, + string path) + : base(parentContainer, name, description, path) + { + this.ObjectType = ObjectType.Container; + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public FlavorsUIContainer() + {} + #region Methods +//========================================================================================================= +/// +/// +/// +/// +/// +//========================================================================================================= + public override void Load() + { + List flavors = this.RepositoryFactory.CreateFlavorRepository().GetFlavors(null, null); + flavors.Sort(); + this.SetUIContainers(flavors); + this.Entities = flavors; + } +//========================================================================================================= +/// +/// +/// +/// +/// +//========================================================================================================= + public override BaseUIContainer CreateContainer(string id) + { + return null; + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/Providers/Compute/FloatingIPUIContainer.cs b/Openstack.Client.Powershell/Providers/Compute/FloatingIPUIContainer.cs new file mode 100644 index 0000000..56d3bf4 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Compute/FloatingIPUIContainer.cs @@ -0,0 +1,71 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Collections.Generic; +using Openstack.Administration.Domain; +using System.Collections; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Compute; +using Openstack.Objects.Domain; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Providers.Compute +{ + [RequiredServiceIdentifierAttribute("Openstack-ComputeDrive")] + public class FloatingIPUIContainer : BaseUIContainer + { +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public FloatingIPUIContainer(BaseUIContainer parentContainer, + string name, + string description, + string path) + : base(parentContainer, name, description, path) + { + this.ObjectType = ObjectType.Container; + } + public FloatingIPUIContainer() + { } + #region Methods +//========================================================================================================= +/// +/// +/// +/// +/// +//========================================================================================================= + public override void Load() + { + //List IPs = this.RepositoryFactory.CreateNetworkRepository().GetFloatingIPs(); + //if (IPs != null && IPs.Count > 0) + //{ + // this.Entities = IPs; + //} + //else + //{ + // this.Containers.Clear(); + // this.Entities.Clear(); + //} + } + #endregion + } +} + diff --git a/Openstack.Client.Powershell/Providers/Compute/ImageUIContainer.cs b/Openstack.Client.Powershell/Providers/Compute/ImageUIContainer.cs new file mode 100644 index 0000000..36b2b93 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Compute/ImageUIContainer.cs @@ -0,0 +1,76 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Compute; + +namespace Openstack.Client.Powershell.Providers.Compute +{ + public class ImageUIContainer : BaseUIContainer + { +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void Load(){ } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void WriteEntityDetails() + { + Image image = (Image)this.Entity; + + this.WriteHeader("Image Details"); + this.WriteImageDetails(image); + this.WriteHeader("Image meta-data is as follows.", ConsoleColor.White); + this.WriteImageMetadata(image); + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void WriteImageMetadata(Image image) + { + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + this.WriteMetadata(image.MetaData); + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void WriteImageDetails(Image image) + { + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + + Console.WriteLine("Id : " + image.Id); + Console.WriteLine("Name : " + image.Name); + Console.WriteLine("Created On : " + image.CreatedDate); + Console.WriteLine("Last Updated On : " + image.LastModified); + Console.WriteLine("Status : " + image.Status); + Console.WriteLine("Progress : " + image.Progress); + } + } +} diff --git a/Openstack.Client.Powershell/Providers/Compute/ImagesUIContainer.cs b/Openstack.Client.Powershell/Providers/Compute/ImagesUIContainer.cs new file mode 100644 index 0000000..e0dfbcf --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Compute/ImagesUIContainer.cs @@ -0,0 +1,62 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Collections.Generic; +using Openstack.Administration.Domain; +using System.Collections; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Compute; +using Openstack.Objects.Domain; + +namespace Openstack.Client.Powershell.Providers.Compute +{ + [RequiredServiceIdentifierAttribute("Openstack-ComputeDrive")] + public class ImagesUIContainer : BaseUIContainer + { +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public ImagesUIContainer(BaseUIContainer parentContainer, + string name, + string description, + string path) + : base(parentContainer, name, description, path) + { + this.ObjectType = ObjectType.Container; + } + public ImagesUIContainer() + {} + #region Methods +//========================================================================================================= +/// +/// +/// +/// +/// +//========================================================================================================= + public override void Load() + { + IList images = this.RepositoryFactory.CreateImageRepository().GetImages(null, null, null, null, null); + this.SetUIContainers(images); + this.Entities = images; + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/Providers/Compute/KeyPairsUIContainer.cs b/Openstack.Client.Powershell/Providers/Compute/KeyPairsUIContainer.cs new file mode 100644 index 0000000..192cad7 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Compute/KeyPairsUIContainer.cs @@ -0,0 +1,69 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Collections.Generic; +using Openstack.Administration.Domain; +using System.Collections; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Compute; +using Openstack.Objects.Domain; + +namespace Openstack.Client.Powershell.Providers.Compute +{ + public class KeyPairsUIContainer : BaseUIContainer + { +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public KeyPairsUIContainer(BaseUIContainer parentContainer, + string name, + string description, + string path) + : base(parentContainer, name, description, path) + { + this.ObjectType = ObjectType.Container; + } + public KeyPairsUIContainer() + { } + #region Methods +//========================================================================================================= +/// +/// +/// +/// +/// +//========================================================================================================= + public override void Load() + { + IList keypairs = this.RepositoryFactory.CreateKeyPairRepository().GetKeyPairs(); + if (keypairs != null && keypairs.Count > 0) + { + this.SetUIContainers(keypairs); + this.Entities = keypairs; + } + else + { + this.Containers.Clear(); + this.Entities.Clear(); + } + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/Providers/Compute/LimitsUIContainer.cs b/Openstack.Client.Powershell/Providers/Compute/LimitsUIContainer.cs new file mode 100644 index 0000000..8a1758b --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Compute/LimitsUIContainer.cs @@ -0,0 +1,159 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Collections; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Client.Powershell.Providers.Security; +using Openstack.Objects.Domain.Compute; +using System.Xml.Serialization; +using System.IO; +using System.Xml.Linq; +using Openstack.Objects.Domain; + +namespace Openstack.Client.Powershell.Providers.Compute +{ + public class LimitsUIContainer : BaseUIContainer + { + private Limits _limits; + + public LimitsUIContainer() + { + + } + + public override void Load() + { + + } + + //========================================================================================================= + /// + /// + /// + /// + //========================================================================================================= + public void LoadContainers() + { + + + //XmlSerializer serializer = new XmlSerializer(typeof(Limits)); + + + //XDocument document = new XDocument(); + //document.lo + + + //Limits limits = (Limits)serializer.Deserialize(new FileStream(@"c:\Projects\rates.xml", FileMode.Open, FileAccess.Read)); + // _limits = (Limits)serializer.Deserialize(new FileStream(@"c:\Projects\results.xml", FileMode.Open, FileAccess.Read)); + //int y = 7; + + + + + + //this.Containers.Add(new AbsoluteLimitsUIContainer(this, "Absolute", "Limits based on some monitoring value." , "/")); + // this.Containers.Add(new RatesUIContainer(this, "Rates", "Limits based on HTTP Verb in use.", "/")); + + + //Limits limits = new Limits(); + //Rate rate1 = new Rate(); + //rate1.RegEx = "testreg"; + //rate1.Uri = "theURI"; + + + //limits.rates.Add(rate1); + + //XmlSerializer serializer = new XmlSerializer(typeof(Limits)); + //TextWriter tw = new StreamWriter(@"c:\Projects\results.xml"); + //serializer.Serialize(tw, limits); + //tw.Close(); + + + + + + + + + + //Limits limits = this.MockEntity(); + //RatesUIContainer ratesContainer = new RatesUIContainer(this, "Rates", "Rate limits are specified in terms of both a human-readable wild-card URI and a machine-processable regular expression.", this.BuildChildPath("Rates")); + //ratesContainer.Rates = limits.Rates; + //this.Containers.Add(ratesContainer); + //AbsoluteLimitsUIContainer absoluteLimitsContainer = new AbsoluteLimitsUIContainer(this, "AbsoluteLimits", "Absolute Limits assigned to this account.", this.BuildChildPath("Rates")); + //this.Containers.Add(absoluteLimitsContainer); + + } + //========================================================================================================= + /// + /// + /// + /// + //========================================================================================================= + //private Limits MockEntity() + //{ + // Limits limits = new Limits(); + + + // AbsoluteLimit al1 = new AbsoluteLimit(); + // al1.Name = "al1 test"; + // al1.Value = 21; + // limits.AbsoluteLimits.Add(al1); + + // AbsoluteLimit al2 = new AbsoluteLimit(); + // al2.Name = "al2 test"; + // al2.Value = 21; + // limits.AbsoluteLimits.Add(al2); + + // AbsoluteLimit al3 = new AbsoluteLimit(); + // al3.Name = "al3 test"; + // al3.Value = 21; + // limits.AbsoluteLimits.Add(al3); + + // AbsoluteLimit al4 = new AbsoluteLimit(); + // al4.Name = "al4 test"; + // al4.Value = 21; + // limits.AbsoluteLimits.Add(al4); + + + // Rate r1 = new Rate(); + + // limits.Rates.Add + + + + + + //} + //========================================================================================================= + /// + /// + /// + /// + /// + /// + //========================================================================================================= + public LimitsUIContainer(BaseUIContainer parentContainer, string name, string description, string path) + : base(parentContainer, name, description, path) + { + this.LoadContainers(); + this.ObjectType = ObjectType.Container; + } + } +} diff --git a/Openstack.Client.Powershell/Providers/Compute/MetaDataUIContainer.cs b/Openstack.Client.Powershell/Providers/Compute/MetaDataUIContainer.cs new file mode 100644 index 0000000..dda1f66 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Compute/MetaDataUIContainer.cs @@ -0,0 +1,58 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Compute; + +namespace Openstack.Client.Powershell.Providers.Compute +{ + public class MetaDataUIContainer : BaseUIContainer + { +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + public void Load(System.Collections.Generic.Dictionary elements) + { + List metadataElements = new List(); + + foreach (KeyValuePair element in elements) { + if (element.Key != String.Empty) + metadataElements.Add(new MetaDataElement(element.Key, element.Value)); + } + this.Entities = metadataElements; + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public override void Load() + { + + } + public override void WriteEntityDetails() + { + + base.WriteEntityDetails(); + } + } +} diff --git a/Openstack.Client.Powershell/Providers/Compute/RatesUIContainer.cs b/Openstack.Client.Powershell/Providers/Compute/RatesUIContainer.cs new file mode 100644 index 0000000..66391f8 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Compute/RatesUIContainer.cs @@ -0,0 +1,155 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Collections.Generic; +using Openstack.Administration.Domain; +using System.Collections; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Compute; +using Openstack.Objects.Domain; + +namespace Openstack.Client.Powershell.Providers.Compute +{ + public class RatesUIContainer : BaseUIContainer + { + private List _rates; + +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public RatesUIContainer(BaseUIContainer parentContainer, + string name, + string description, + string path, + List rates) + : base(parentContainer, name, description, path) + { + _rates = rates; + this.ObjectType = ObjectType.Container; + } + + #region Methods +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private BaseUIContainer MockEntity(string id) + { + Server server1 = new Server(); + server1.Name = "server1"; + server1.Id = "11"; + ServerUIContainer container = new ServerUIContainer(this, id, "server test", this.Path + "\\" + server1.Id); + container.Entity = server1; + + return container; + + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void Load() + { + _entities = this.MockEntities(); + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private List MockEntities() + { + Server server1 = new Server(); + server1.Name = "server1"; + server1.Id = "11"; + + Server server2 = new Server(); + server2.Name = "server2"; + server2.Id = "44"; + + + Server server3 = new Server(); + server3.Name = "server3"; + server3.Id = "99"; + + Server server4 = new Server(); + server4.Name = "server4"; + server4.Id = "23"; + + Server server5 = new Server(); + server5.Name = "server5"; + server5.Id = "87"; + + List servers = new List(); + servers.Add(server1); + servers.Add(server2); + servers.Add(server3); + servers.Add(server4); + servers.Add(server5); + + return servers; + + } +//========================================================================================================= +/// +/// +/// +/// +/// +//========================================================================================================= + public override BaseUIContainer CreateContainer(string id) + { + return this.MockEntity(id); + + //string tenantId = ((Tenant)CurrentTenantContainer.CurrentTenant.Entity).Id; + //IUserRepository repository = RepositoryFactory.CreateUserRepository(ResponseFormat.xml); + //User user = repository.GetUser(id, tenantId); + + //if (user != null) + //{ + // UserContainer container = new UserContainer(this, user.AccountId, "test descr", this.BuildChildPath(user.AccountId)); + // container.Entity = user; + + // return container; + //} + //else + //{ + // return null; + //} + } + #endregion + #region Properties + //========================================================================================================= + /// + /// + /// + //========================================================================================================= + public List Rates + { + get { return _rates; } + set { _rates = value; } + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/Providers/Compute/ServerLogUIContainer.cs b/Openstack.Client.Powershell/Providers/Compute/ServerLogUIContainer.cs new file mode 100644 index 0000000..6d7a0e6 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Compute/ServerLogUIContainer.cs @@ -0,0 +1,78 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Compute; +using Openstack.Objects.Domain.Compute.Servers; +using Openstack.Objects.Domain.Compute.Servers.Actions; + +namespace Openstack.Client.Powershell.Providers.Compute +{ + public class ServerLogUIContainer : BaseUIContainer + { + public static int CountStringOccurrences(string text, string pattern) + { + // Loop through all instances of the string 'text'. + int count = 0; + int i = 0; + while ((i = text.IndexOf(pattern, i)) != -1) + { + i += pattern.Length; + count++; + } + return count; + } + +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void Load() + { + GetServerLogAction action = new GetServerLogAction(); + action.ServerId = this.Parent.Entity.Id; + this.Entity = (Log)this.RepositoryFactory.CreateServerRepository().GetServerLog(action); + + this.WriteHeader("Log Entries"); + + Log log = (Log)this.Entity; + System.Text.RegularExpressions.Regex ex = new System.Text.RegularExpressions.Regex(@"\\n"); + string[] buffer = ex.Split(log.Content); + + Console.WriteLine(); + foreach (string line in buffer) + { + Console.WriteLine(line); + } + Console.WriteLine(); + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void WriteEntityDetails() + { + + this.WriteHeader("Log Entries"); + Console.Write(((Log)this.Entity).Content); + } + } +} diff --git a/Openstack.Client.Powershell/Providers/Compute/ServerUIContainer.cs b/Openstack.Client.Powershell/Providers/Compute/ServerUIContainer.cs new file mode 100644 index 0000000..100d7ef --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Compute/ServerUIContainer.cs @@ -0,0 +1,279 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Linq; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Compute; +using System.Collections.Generic; +using Openstack.Client.Powershell.Providers.BlockStorage; +using Openstack.Objects.Domain.Security; +using Openstack.Objects.Domain.Compute.Common; +using Openstack.Client.Powershell.Providers.Security; +using Openstack.Objects.DataAccess.Security; + +namespace Openstack.Client.Powershell.Providers.Compute +{ + public class ServerUIContainer : BaseUIContainer + { + private Image _image; + private Flavor _flavor; +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public ServerUIContainer(BaseUIContainer parentContainer, string name, string description, string path) + : base(parentContainer, name, description, path) + { + this.LoadContainers(); + this.ObjectType = Common.ObjectType.Entity; + } +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public ServerUIContainer() { } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void Load() + { + this.LoadServerDetails(); + this.LoadContainers(); + this.LoadFlavorDetails(); + this.LoadImageDetails(); + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + private void LoadServerDetails() + { + Server server = (Server)this.Entity; + this.Entity = this.RepositoryFactory.CreateServerRepository().GetServer(server.Id); + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + private void LoadFlavorDetails() + { + Server temp = ((Server)this.Entity); + string flavorId = ((EntityRef)temp.Flavor).Id; + _flavor = this.RepositoryFactory.CreateFlavorRepository().GetFlavor(flavorId); + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + private void LoadImageDetails() + { + Server temp = ((Server)this.Entity); + string imageId = ((EntityRef)temp.Image).Id; + _image = this.RepositoryFactory.CreateImageRepository().GetImage(imageId); + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + private List GetResolvedSecurityGroups(List groups) + { + List secGroups = this.RepositoryFactory.CreateSecurityRepository().GetSecurityGroups(); + try + { + var innerJoinQuery = + from agroup in groups + join secGroup in secGroups on agroup.Name equals secGroup.Name + select new SecurityGroup() + { + Id = secGroup.Id, + Description = secGroup.Description, + Name = secGroup.Name, + TenantId = secGroup.TenantId, + Rules = secGroup.Rules + }; + return innerJoinQuery.ToList(); + } + catch (Exception) { } + return null; + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void LoadContainers() + { + this.Containers.Clear(); + BaseUIContainer container = (BaseUIContainer)this.CreateContainer("Metadata", "Metadata about the Server.", this.Parent.Path + @"\Metadata"); + if (this.Entity != null) + { + ((MetaDataUIContainer)container).Load(((Server)this.Entity).MetaData); + } + + this.Containers.Add(container); + + SecurityGroupsUIContainer sgContainer = (SecurityGroupsUIContainer)this.CreateContainer("SecurityGroups", "Manage this Servers security rules.", this.Parent.Path + @"\SecurityGroups"); + sgContainer.IsServerGroups = true; + sgContainer.LoadEntities(this.GetResolvedSecurityGroups(((Server)this.Entity).SecurityGroups)); + this.Containers.Add(sgContainer); + + try + { + AttachmentsUIContainer aContainer = (AttachmentsUIContainer)this.CreateContainer("Volumes", "List the Volumes attached to this Server", this.Parent.Path + @"\Volumes"); + aContainer.LoadEntities(((Server)this.Entity)); + //if (aContainer != null && aContainer.Entities != null) + if (aContainer != null) + this.Containers.Add(aContainer); + } + catch (Exception ex) { int h = 8; } + + ServerLogUIContainer logContainer = (ServerLogUIContainer)this.CreateContainer("EventLog", "EventLog", this.Parent.Path + @"\Log"); + this.Containers.Add(logContainer); + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + private void WriteNetworkDetails() + { + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + Console.WriteLine(); + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + Console.WriteLine(" Address : " + ((Server)this.Entity).IpAddress); + Console.WriteLine(); + + //IList addresses = ((Server)this.Entity).Addresses.Private; + //if (addresses != null) + //{ + // foreach (IPAddress address in addresses) + // { + // Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + // Console.WriteLine(); + // Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + // Console.WriteLine(" Address : " + address.Addr); + // Console.WriteLine(" Version : " + address.Version); + // Console.WriteLine(); + // } + //} + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + private void WriteServerDetails(Server server) + { + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + Console.WriteLine(" Id : " + server.Id); + Console.WriteLine(" Name : " + server.Name); + Console.WriteLine(" UUID : " + server.UUID); + Console.WriteLine(" Host Id : " + server.HostId); + Console.WriteLine(" Status : " + server.Status); + Console.WriteLine(" Progress : " + server.Progress); + Console.WriteLine(" Created On : " + server.CreationDate); + Console.WriteLine(" Last Update : " + server.LastUpdatedDate); + Console.WriteLine(" Key : " + server.KeyName); + + TimeSpan span = DateTime.Now - server.CreationDate; + Console.WriteLine(" Age : " + Convert.ToString(span.Days) + " day(s)"); + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void WriteImageDetails(Image image) + { + if (image != null) + { + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + Console.WriteLine(" Id : " + image.Id); + Console.WriteLine(" Name : " + image.Name); + Console.WriteLine(" Last Modified : " + image.LastModified); + Console.WriteLine(" Created On : " + image.CreatedDate); + Console.WriteLine(" Status : " + image.Status); + } + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void WriteFlavorDetails(Flavor flavor) + { + if (flavor != null) + { + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + Console.WriteLine(" Id : " + flavor.Id); + Console.WriteLine(" Name : " + flavor.Name); + Console.WriteLine(" RAM : " + flavor.Ram); + Console.WriteLine(" Disk : " + flavor.Disk); + Console.WriteLine(" Status : " + flavor.Status); + } + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void WriteEntityDetails() + { + Server server = (Server)this.Entity; + + this.WriteHeader("Server Details"); + this.WriteServerDetails(server); + this.WriteHeader("Image Information.", ConsoleColor.White); + this.WriteImageDetails(_image); + this.WriteHeader("Flavor Details", ConsoleColor.White); + this.WriteFlavorDetails(_flavor); + this.WriteHeader("Assigned Network Addresses", ConsoleColor.White); + this.WriteNetworkDetails(); + Console.WriteLine(); + } +//========================================================================================================= +/// +/// +/// +/// +/// +//========================================================================================================= + public override bool IsEntityId(string id) + { + if (id == ((Server)this.Entity).Id) + return true; + else + return false; + } + } +} diff --git a/Openstack.Client.Powershell/Providers/Compute/ServersUIContainer.cs b/Openstack.Client.Powershell/Providers/Compute/ServersUIContainer.cs new file mode 100644 index 0000000..2313de9 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Compute/ServersUIContainer.cs @@ -0,0 +1,103 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Collections.Generic; +using Openstack.Administration.Domain; +using System.Collections; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Compute; +using Openstack.Objects.Domain; +using System; +using System.Collections.ObjectModel; +using Openstack.Objects; +using System.Xml.Serialization; +using System.IO; + +namespace Openstack.Client.Powershell.Providers.Compute +{ + [RequiredServiceIdentifierAttribute("Openstack-ComputeDrive")] + public class ServersUIContainer : BaseUIContainer + { +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public ServersUIContainer() { } +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public ServersUIContainer(BaseUIContainer parentContainer, + string name, + string description, + string path) + : base(parentContainer, name, description, path) + { + this.ObjectType = Common.ObjectType.Container; + } + + #region Methods +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void Load() + { + this.LoadEntities(); + } +//========================================================================================================= +/// +/// +/// +/// +/// +//========================================================================================================= + private void LoadEntities() + { + IList servers = this.RepositoryFactory.CreateServerRepository().GetServers(null, null, null, null, ServerStatus.Unknown); + if (servers != null && servers.Count > 0) + { + this.SetUIContainers(servers); + this.Entities = servers; + } + else + { + this.Containers.Clear(); + this.Entities.Clear(); + } + } +//========================================================================================================= +/// +/// +/// +/// +/// +//========================================================================================================= + public override BaseUIContainer CreateContainer(string id) + { + return null; + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/Providers/Dbaas/DBInstancesUIContainer.cs b/Openstack.Client.Powershell/Providers/Dbaas/DBInstancesUIContainer.cs new file mode 100644 index 0000000..44ff4fa --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Dbaas/DBInstancesUIContainer.cs @@ -0,0 +1,28 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Openstack.Client.Powershell.Providers.Dbaas +{ + class DBInstancesUIContainer + { + } +} + + diff --git a/Openstack.Client.Powershell/Providers/Dbaas/DatabaseUIContainer.cs b/Openstack.Client.Powershell/Providers/Dbaas/DatabaseUIContainer.cs new file mode 100644 index 0000000..c67e785 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Dbaas/DatabaseUIContainer.cs @@ -0,0 +1,89 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Collections; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Client.Powershell.Providers.Security; +using Openstack.Objects.Domain; +using Openstack.Objects.Utility; +using Openstack.Objects.DataAccess; +using Openstack.Client.Powershell.Providers.Compute; + +namespace Openstack.Client.Powershell.Providers.Database +{ +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + [RequiredServiceIdentifierAttribute("Openstack-ComputeDrive")] + public class DatabaseUIContainer : BaseUIContainer + { +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public DatabaseUIContainer() { } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void Load() + { + this.LoadContainers(); + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void LoadContainers() + { + this.Containers.Clear(); + this.Containers.Add(this.CreateContainer("Instances", "Manage Database Instances across the Account..", @"Data\Instances")); + this.AddContainer(this.CreateContainer("Flavors", "Manage additional hardware configurations for Database Servers.", @"Data\Flavors")); + this.Containers.Add(this.CreateContainer("Snapshots", "Container for storing and managing Database Instance Snapshots. ", @"Data\Snapshots")); + this.Containers.Add(this.CreateContainer("SecurityGroups", "Container for storing and managing Database Instance Security Groups. ", @"Data\SecurityGroups")); + } +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public DatabaseUIContainer(BaseUIContainer parentContainer, string name, string description, string path, Context context, BaseRepositoryFactory repository) + : base(parentContainer, name, description, path) + { + this.Context = context; + this.RepositoryFactory = repository; + + this.LoadContainers(); + this.ObjectType = Client.Powershell.Providers.Common.ObjectType.Entity; + } + } +} + diff --git a/Openstack.Client.Powershell/Providers/Networking/FloatingIPUIContainer.cs b/Openstack.Client.Powershell/Providers/Networking/FloatingIPUIContainer.cs new file mode 100644 index 0000000..352f020 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Networking/FloatingIPUIContainer.cs @@ -0,0 +1,87 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Providers.Networking +{ + public class FloatingIPUIContainer : BaseUIContainer + { +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public FloatingIPUIContainer(BaseUIContainer parentContainer, string name, string description, string path) + : base(parentContainer, name, description, path) + { + this.ObjectType = Common.ObjectType.Entity; + } +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public FloatingIPUIContainer() { } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void Load() + { + + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void WriteEntityDetails() + { + FloatingIP floatingIP = (FloatingIP)this.Entity; + this.WriteHeader("Floating IP Details"); + this.WriteFloatingIPDetails(floatingIP); + Console.WriteLine(); + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void WriteFloatingIPDetails(FloatingIP floatingIP) + { + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + Console.WriteLine(" Id : " + floatingIP.Id); + Console.WriteLine(" Fixed Address : " + floatingIP.FixedIPAddress); + Console.WriteLine(" Floating Address : " + floatingIP.FloatingIPAddress); + Console.WriteLine(" Port Id : " + floatingIP.PortId); + Console.WriteLine(" Router Id : " + floatingIP.RouterID); + Console.WriteLine(" Tenant Id : " + floatingIP.TenantId); + } + } +} \ No newline at end of file diff --git a/Openstack.Client.Powershell/Providers/Networking/FloatingIPsUIContainer.cs b/Openstack.Client.Powershell/Providers/Networking/FloatingIPsUIContainer.cs new file mode 100644 index 0000000..ad2f259 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Networking/FloatingIPsUIContainer.cs @@ -0,0 +1,102 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Networking; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Providers.Networking +{ + public class FloatingIPsUIContainer : BaseUIContainer + { + private bool _hasLoaded = false; + +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public FloatingIPsUIContainer() { } +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public FloatingIPsUIContainer(BaseUIContainer parentContainer, + string name, + string description, + string path) + : base(parentContainer, name, description, path) + { + this.ObjectType = Common.ObjectType.Container; + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void Load() + { + if (!_hasLoaded) + { + this.LoadEntities(); + } + } +//================================================================================================= +/// +/// +/// +//================================================================================================= + public void Load(List floatingIPs) + { + this.Containers.Clear(); + this.SetUIContainers(floatingIPs); + this.Entities = floatingIPs; + _hasLoaded = true; + } +//========================================================================================================= +/// +/// +/// +/// +/// +//========================================================================================================= + private void LoadEntities() + { + List floatingIPs = this.RepositoryFactory.CreateFloatingIPRepository().GetFloatingIPs(); + + if (floatingIPs != null && floatingIPs.Count > 0) + { + this.SetUIContainers(floatingIPs); + this.Entities = floatingIPs; + } + else + { + this.Containers.Clear(); + this.Entities.Clear(); + } + } + } +} diff --git a/Openstack.Client.Powershell/Providers/Networking/NetworkUIContainer.cs b/Openstack.Client.Powershell/Providers/Networking/NetworkUIContainer.cs new file mode 100644 index 0000000..f99e954 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Networking/NetworkUIContainer.cs @@ -0,0 +1,166 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.DataAccess.Networking; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Providers.Networking +{ + public class NetworkUIContainer : BaseUIContainer + { +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void Load() + { + this.LoadNetworkDetails(); + this.LoadContainers(); + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + private void LoadPortUIContainers() + { + string networkId = this.Entity.Id; + BaseUIContainer container = (BaseUIContainer)this.CreateContainer("Ports", "Ports associated with this Network.", this.Parent.Path + @"\Port"); + + if (this.Entity != null) + { + IPortRepository repository = this.RepositoryFactory.CreatePortRepository(); + List allports = repository.GetPorts(); + List ports = new List(); + + foreach (Port port in allports) { + if (port.NetworkId == networkId) + ports.Add(port); + } + + ((PortsUIContainer)container).Load(ports); + this.Containers.Add(container); + } + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + private void LoadFloatingIPUIContainers() + { + string networkId = this.Entity.Id; + BaseUIContainer container = (BaseUIContainer)this.CreateContainer("FloatingIPs", "Floating IPs associated with this Network.", this.Parent.Path + @"\FloatingIP"); + + if (this.Entity != null) + { + IFloatingIPRepository repository = this.RepositoryFactory.CreateFloatingIPRepository(); + List allfloatingIPs = repository.GetFloatingIPs(); + List floatingIPs = new List(); + + foreach (FloatingIP floatingIP in allfloatingIPs) + { + if (floatingIP.FloatingNetworkId == networkId) + floatingIPs.Add(floatingIP); + } + + ((FloatingIPsUIContainer)container).Load(floatingIPs); + this.Containers.Add(container); + } + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + private void LoadSubnetUIContainers() + { + BaseUIContainer container = (BaseUIContainer)this.CreateContainer("Subnets", "Subnets associated with this Network.", this.Parent.Path + @"\Subnet"); + if (this.Entity != null) + { + ISubnetRepository repository = this.RepositoryFactory.CreateSubnetRepository(); + List subnets = new List(); + + foreach (string subnetListElement in ((Network)this.Entity).Subnets) + { + Subnet subnet = repository.GetSubnet(subnetListElement); + if (subnet != null) + subnets.Add(subnet); + } + + ((SubnetsUIContainer)container).Load(subnets); + this.Containers.Add(container); + } + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void LoadContainers() + { + this.Containers.Clear(); + this.LoadSubnetUIContainers(); + this.LoadPortUIContainers(); + this.LoadFloatingIPUIContainers(); + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + private void LoadNetworkDetails() + { + Network network = (Network)this.Entity; + this.Entity = this.RepositoryFactory.CreateNetworkRepository().GetNetwork(network.Id); + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + private void WriteNetworkDetails(Network network) + { + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + Console.WriteLine(" Id : " + network.Id); + Console.WriteLine(" Name : " + network.Name); + Console.WriteLine(" Status : " + network.Status); + Console.WriteLine(" Admin State Up : " + network.AdminStateUp); + Console.WriteLine(" Shared : " + network.Shared); + Console.WriteLine(" Is External : " + network.IsExternal); + Console.WriteLine(" Port Security Enabled : " + network.PortSecurityEnabled); + Console.WriteLine(" Tenant Id : " + network.TenantId); + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void WriteEntityDetails() + { + Network network = (Network)this.Entity; + this.WriteHeader("Network Details"); + this.WriteNetworkDetails(network); + Console.WriteLine(); + } + } +} diff --git a/Openstack.Client.Powershell/Providers/Networking/NetworksUIContainer.cs b/Openstack.Client.Powershell/Providers/Networking/NetworksUIContainer.cs new file mode 100644 index 0000000..3574c7d --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Networking/NetworksUIContainer.cs @@ -0,0 +1,110 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Collections.Generic; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Providers.Networking +{ + // [RequiredServiceIdentifierAttribute("Openstack-ComputeDrive")] + public class NetworksUIContainer : BaseUIContainer + { +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public NetworksUIContainer() { } +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public NetworksUIContainer(BaseUIContainer parentContainer, + string name, + string description, + string path) + : base(parentContainer, name, description, path) + { + this.ObjectType = Common.ObjectType.Container; + } + + #region Methods +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void Load() + { + this.LoadEntities(); + this.LoadContainers(); + } +//========================================================================================================= +/// +/// +/// +/// +/// +//========================================================================================================= + private void LoadEntities() + { + List networks = this.RepositoryFactory.CreateNetworkRepository().GetNetworks(); + + if (networks != null && networks.Count > 0) + { + this.SetUIContainers(networks); + this.Entities = networks; + } + else + { + this.Containers.Clear(); + this.Entities.Clear(); + } + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void LoadContainers() + { + this.AddContainer(this.CreateContainer("Subnets", "All Subnets assocated with the Account.", "Subnets")); + this.AddContainer(this.CreateContainer("Ports", "All Ports associated with the Account", "Ports")); + this.AddContainer(this.CreateContainer("FloatingIPs", "All Floating IPs associated with the Account", "FloatingIPs")); + this.AddContainer(this.CreateContainer("Routers", "All Routers associated with the Account", "Routers")); + } +//========================================================================================================= +/// +/// +/// +/// +/// +//========================================================================================================= + public override BaseUIContainer CreateContainer(string id) + { + return null; + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/Providers/Networking/PortUIContainer.cs b/Openstack.Client.Powershell/Providers/Networking/PortUIContainer.cs new file mode 100644 index 0000000..5a7eeff --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Networking/PortUIContainer.cs @@ -0,0 +1,75 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Providers.Networking +{ + public class PortUIContainer : BaseUIContainer + { +//================================================================================================== +/// +/// +/// +//================================================================================================== + public override void Load() + { + + } +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + private void WriteFixedIPs(Port port) + { + this.WriteHeader("Assigned Fixed IPs"); + foreach (FixedIP fixedIP in port.FixedIPs) + { + Console.WriteLine(" IP Address : " + fixedIP.IpAddress); + Console.WriteLine(" Subnet Id : " + fixedIP.SubnetId); + Console.WriteLine(""); + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public override void WriteEntityDetails() + { + Port port = (Port)this.Entity; + this.WriteHeader("Port Details"); + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + Console.WriteLine(" Id : " + port.Id); + Console.WriteLine(" Device Id : " + port.DeviceId); + Console.WriteLine(" Device Owner : " + port.DeviceOwner); + Console.WriteLine(" MAC Address : " + port.MacAddress); + Console.WriteLine(" Status : " + port.Status); + Console.WriteLine(" Network Id : " + port.NetworkId); + Console.WriteLine(" Admin State Up : " + port.AdminStateUp); + Console.WriteLine(" Port Security Enabled : " + port.PortSecurityEnabled); + Console.WriteLine(" Binding Type : " + port.BindingType); + + this.WriteFixedIPs(port); + } + } +} diff --git a/Openstack.Client.Powershell/Providers/Networking/PortsUIContainer.cs b/Openstack.Client.Powershell/Providers/Networking/PortsUIContainer.cs new file mode 100644 index 0000000..63cb3df --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Networking/PortsUIContainer.cs @@ -0,0 +1,57 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.DataAccess.Networking; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Providers.Networking +{ + public class PortsUIContainer : BaseUIContainer + { + private bool _hasLoaded = false; +//================================================================================================= +/// +/// +/// +//================================================================================================= + public override void Load() + { + if (!_hasLoaded) + { + this.Containers.Clear(); + IPortRepository repository = this.RepositoryFactory.CreatePortRepository(); + this.Entities = repository.GetPorts(); + this.SetUIContainers(this.Entities); + } + } +//================================================================================================= +/// +/// +/// +//================================================================================================= + public void Load(List ports) + { + this.Containers.Clear(); + this.SetUIContainers(ports); + this.Entities = ports; + _hasLoaded = true; + } + } +} diff --git a/Openstack.Client.Powershell/Providers/Networking/RouterUIContainer.cs b/Openstack.Client.Powershell/Providers/Networking/RouterUIContainer.cs new file mode 100644 index 0000000..0371477 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Networking/RouterUIContainer.cs @@ -0,0 +1,55 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.DataAccess.Networking; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Providers.Networking +{ + public class RouterUIContainer : BaseUIContainer + { +//================================================================================================== +/// +/// +/// +//================================================================================================== + public override void Load() + {} +//================================================================================================== +/// +/// +/// +//================================================================================================== + public override void WriteEntityDetails() + { + Router router = (Router)this.Entity; + this.WriteHeader("Router Details"); + + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + Console.WriteLine(" Id : " + router.Id); + Console.WriteLine(" Router Name : " + router.Name); + Console.WriteLine(" Status : " + router.Status); + Console.WriteLine(" Admin State Up : " + router.AdminStateUp); + Console.WriteLine(" Ext Gateway : " + router.ExternalGateway.NetworkId); + Console.WriteLine(" Tenant Id : " + router.TenantId); + Console.WriteLine(""); + } + } +} diff --git a/Openstack.Client.Powershell/Providers/Networking/RoutersUIContainer.cs b/Openstack.Client.Powershell/Providers/Networking/RoutersUIContainer.cs new file mode 100644 index 0000000..0ab94a7 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Networking/RoutersUIContainer.cs @@ -0,0 +1,40 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.DataAccess.Networking; + +namespace Openstack.Client.Powershell.Providers.Networking +{ + public class RoutersUIContainer : BaseUIContainer + { +//================================================================================================= +/// +/// +/// +//================================================================================================= + public override void Load() + { + this.Containers.Clear(); + IRouterRepository repository = this.RepositoryFactory.CreateRouterRepository(); + this.Entities = repository.GetRouters(); + this.SetUIContainers(this.Entities); + } + } +} diff --git a/Openstack.Client.Powershell/Providers/Networking/SubnetUIContainer.cs b/Openstack.Client.Powershell/Providers/Networking/SubnetUIContainer.cs new file mode 100644 index 0000000..6de6522 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Networking/SubnetUIContainer.cs @@ -0,0 +1,103 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Providers.Networking +{ + public class SubnetUIContainer : BaseUIContainer + { +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public SubnetUIContainer(BaseUIContainer parentContainer, string name, string description, string path) + : base(parentContainer, name, description, path) + { + this.ObjectType = Common.ObjectType.Entity; + } +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public SubnetUIContainer() { } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void Load() + { } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void WriteSubnetDetails(Subnet subnet) + { + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + Console.WriteLine(" Id : " + subnet.Id); + Console.WriteLine(" Gateway IP : " + subnet.GatewayIP); + Console.WriteLine(" IP Version : " + subnet.IPVersion); + Console.WriteLine(" Cidr : " + subnet.Cidr); + Console.WriteLine(" DHCP Enabled : " + subnet.EnableDHCP); + Console.WriteLine(" Network Id : " + subnet.NetworkId); + Console.WriteLine(" Tenant Id : " + subnet.TenantId); + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void WriteAllocationPools(Subnet subnet) + { + this.WriteHeader("Available Subnet Allocation Pools"); + foreach (AllocationPool pool in subnet.AllocationPools) + { + Console.WriteLine(" Start : " + pool.Start); + Console.WriteLine(" End : " + pool.End); + Console.WriteLine(""); + } + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void WriteEntityDetails() + { + Subnet subnet = (Subnet)this.Entity; + this.WriteHeader("Subnet Details"); + this.WriteSubnetDetails(subnet); + this.WriteAllocationPools(subnet); + Console.WriteLine(); + } + } +} diff --git a/Openstack.Client.Powershell/Providers/Networking/SubnetsUIContainer.cs b/Openstack.Client.Powershell/Providers/Networking/SubnetsUIContainer.cs new file mode 100644 index 0000000..690bfd6 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Networking/SubnetsUIContainer.cs @@ -0,0 +1,58 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.DataAccess.Networking; +using Openstack.Objects.Domain.Networking; + +namespace Openstack.Client.Powershell.Providers.Networking +{ + public class SubnetsUIContainer : BaseUIContainer + { + private bool _hasLoaded = false; +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + public void Load(List subnets) + { + this.Containers.Clear(); + this.SetUIContainers(subnets); + this.Entities = subnets; + _hasLoaded = true; + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public override void Load() + { + if (!_hasLoaded) + { + this.Containers.Clear(); + List subnets = this.RepositoryFactory.CreateSubnetRepository().GetSubnets(); + this.SetUIContainers(subnets); + this.Entities = subnets; + } + } + } +} diff --git a/Openstack.Client.Powershell/Providers/ObjectStorage/HPOSDriveInfo.cs b/Openstack.Client.Powershell/Providers/ObjectStorage/HPOSDriveInfo.cs new file mode 100644 index 0000000..8985fb0 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/ObjectStorage/HPOSDriveInfo.cs @@ -0,0 +1,363 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Collections.Generic; +using System.Management.Automation; +using System.Collections; +using Openstack; +using System.Diagnostics.Contracts; +using Openstack.Client.Powershell.Utility; +using System; +using System.IO; +using System.Linq; +using Openstack.Storage; +using Openstack.Identity; + + +namespace Openstack.Client.Powershell.Providers.Storage +{ + public class OpenStackPSDriveInfo : PSDriveInfo + { + public const string cDelimiter = "/"; + + private OSDriveParameters _parameters = null; + private IStorageServiceClient _storageClient; + private List _pathCache = new List(); + private bool _isQueueOn = false; + private Settings _settings = null; + private Context _context; + private string _sharePath; + private string _storageServiceUrl; + + #region Ctors +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + public OpenStackPSDriveInfo(PSDriveInfo driveInfo, OSDriveParameters parameters, Context context , string storageServiceUrl): base(driveInfo) + { + _parameters = parameters; + _context = context; + _storageServiceUrl = storageServiceUrl; + + if (parameters != null) + _settings = parameters.Settings; + } + #endregion + #region Methods +//======================================================================================================= +/// +/// +/// +/// +/// +//======================================================================================================= + private string GetFirstPathElement(string path) + { + int delimeterPosition; + + if (path.StartsWith(@"\")) + { + delimeterPosition = path.IndexOf(@"\", 1, StringComparison.Ordinal); + if (delimeterPosition != -1) + return path.Substring(0, delimeterPosition); + else + return null; + } + else + { + delimeterPosition = path.IndexOf("/", 0, StringComparison.Ordinal); + if (delimeterPosition != -1) + return path.Substring(0, delimeterPosition); + else + { + delimeterPosition = path.IndexOf(@"\", 0, StringComparison.Ordinal); + if (delimeterPosition != -1) + return path.Substring(0, delimeterPosition); + else + return null; + } + } + } +//======================================================================================================= +/// +/// +/// +/// +/// +//======================================================================================================= + private bool IsHPOSDrive(string name) + { + if (name != null) + { + if (name.Contains(":")) + { + return true; + } + else + { + return false; + } + } + else return false; + } + + public string SharePath + { + get { return _sharePath; } + set { _sharePath = value; } + } + private IStorageServiceClient StorageClient + { + get { return _storageClient; } + set { _storageClient = value; } + } + +//======================================================================================================= +/// +/// +/// +/// +/// +//======================================================================================================= + private bool ContainsHPOSDrive(string name) + { + foreach (PSDriveInfo drive in this.Provider.Drives) + { + if (drive.Provider.Name == "OS-Storage" && drive.Name.Contains(name)) + return true; + } + return false; + } +////========================================================================================= +/// +/// +/// +/// +/// +//========================================================================================= + private bool IsLocalPath(string path) + { + // Temporaily reverse the delimiter for this check... + + string temp = path.Replace(@"/", @"\"); + List drives = DriveInfo.GetDrives().ToList(); + + drives.DefaultIfEmpty(null); + if (drives.Where(d => temp.ToUpper().Contains(d.Name)).FirstOrDefault() == null) + { + return false; + } + else + { + return true; + } + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + private bool IsFullyQualifiedPath (string path) + { + string firstPathElement = GetFirstPathElement(path); + + if (IsHPOSDrive(firstPathElement)) + { + return true; + } + else if (IsLocalPath(path)) + { + return true; + } + else + { + return false; + } + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + private string FormatPath (string path) + { + string currentLocation = null; + + // Strip out any leading or trailing delimiters.. + + if (path.StartsWith(@"\") || path.StartsWith("/")) + { + path = path.Substring(1); + } + + // Reverse the delimiter and strip out the current location. We do this because some paths will come from the provider + // in which PS has already supplied the fully qualified path, yet some paths will come from cmdlets (like CopyItem) + // that receive paths from the user. These paths may or may not contain the current location so we strip it out reguardless + // then read it back... + + path = path.Replace(@"\", "/"); + currentLocation = this.CurrentLocation.Replace(@"\", "/"); + + if (currentLocation != "") + { + path = path.Replace(currentLocation + "/", string.Empty); + } + path = path.Replace(this.Name + "/", string.Empty); + return path; + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + private StoragePath ProcessRootPath(string path) + { + path = this.FormatPath(path); + + if (this.IsLocalPath(path)) + { + // Nothing to do to a pure local path. Just return it wrapped up.. + + return new StoragePath(path); + } + else + { + string firstElement = this.GetFirstPathElement(path); + + if (this.IsHPOSDrive(firstElement)) + { + // If the path supplied already contains a storageContainer name, strip it out and pass it in as the volume name.. + + path = path.Replace(firstElement, string.Empty); + return new StoragePath(this.StorageServiceUrl); + + } + else + { + // If the path supplied lacks a storageContainer name, take the current one.. + + return new StoragePath(this.StorageServiceUrl, this.Name, path.Replace(@"\", "/")); + } + } + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + private StoragePath ProcessNonRootPath (string path) + { + string publicURL = this.StorageServiceUrl; + + if (this.IsFullyQualifiedPath(path) == true) + { + return new StoragePath(this.StorageServiceUrl + "/" + path.Replace(@"\", "/").Replace(":", "/")); + } + else + { + path = this.FormatPath(path); + + if (path.EndsWith(cDelimiter)) + { + // We're dealing with a folder path here.. + + return new StoragePath(publicURL, this.Name, this.CurrentLocation.Replace(@"\", "/") + cDelimiter + path); + + } + else + { + // We're dealing with an object path here.. + + path = (publicURL + cDelimiter + this.Name + cDelimiter + this.CurrentLocation.Replace(@"\", "/") + cDelimiter + path); + return new StoragePath(path); + } + } + } + //================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + public StoragePath CreateStoragePath(string path) + { + if (this.IsLocalPath(path)) + { + return new StoragePath(path); + } + else + { + // Check for a root path supplied first.. + + if (this.CurrentLocation == string.Empty) + { + return this.ProcessRootPath(path); + } + else + { + return this.ProcessNonRootPath(path); + } + } + return null; + } +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + public Hashtable GetParameters() + { + return null; + } + #endregion + #region Properties +//================================================================================================== +/// +/// +/// +//================================================================================================== + private string StorageServiceUrl + { + get + { + return _storageServiceUrl; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public List PathCache + { + get { return _pathCache; } + set { _pathCache = value; } + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/Providers/ObjectStorage/HPOSDriveParameters.cs b/Openstack.Client.Powershell/Providers/ObjectStorage/HPOSDriveParameters.cs new file mode 100644 index 0000000..f6b1bab --- /dev/null +++ b/Openstack.Client.Powershell/Providers/ObjectStorage/HPOSDriveParameters.cs @@ -0,0 +1,42 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using Openstack.Client.Powershell.Utility; + +namespace Openstack.Client.Powershell.Providers.Storage +{ + public class OSDriveParameters + { + private Settings _settings; + + public Settings Settings + { + get { return _settings; } + set { _settings = value; } + } + #region Ctors +//================================================================================= +/// +/// +/// +/// +//================================================================================= + public OSDriveParameters() + { + } + + #endregion + } +} diff --git a/Openstack.Client.Powershell/Providers/ObjectStorage/HPOSNavigationProvider.cs b/Openstack.Client.Powershell/Providers/ObjectStorage/HPOSNavigationProvider.cs new file mode 100644 index 0000000..ded3813 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/ObjectStorage/HPOSNavigationProvider.cs @@ -0,0 +1,751 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Management.Automation.Provider; +using System.Collections.ObjectModel; +using Openstack.Storage; +using Openstack.Client.Powershell.Utility; +using Openstack.Client.Powershell.Providers.Common; +using System.Management.Automation.Runspaces; +using Openstack; +using System.Threading.Tasks; +using System.Threading; +using Openstack.Client.Powershell.Providers.ObjectStorage; + +namespace Openstack.Client.Powershell.Providers.Storage +{ + [CmdletProvider("Object Storage", ProviderCapabilities.ExpandWildcards)] + public class HPOSNavigationProvider : BaseNavigationCmdletProvider + { + const string cDelimiter = @"\"; + const string cFolderMarker = "folder.txt"; + + private class FolderStatistics + { + public long TotalFilesFound = 0; + public long TotalBytes = 0; + public long TotalFoldersFound = 0; + } + private IStorageServiceClient _storageClient; + + + private IStorageServiceClient StorageClient + { + get + { + IOpenstackClient client = (IOpenstackClient)this.SessionState.PSVariable.GetValue("Client", null); + return client.CreateServiceClient(); + } + + } + + #region Implementation of DriveCmdletProvider +//================================================================================================== +/// +/// Removes an Item from the store.. +/// +/// +//================================================================================================== + protected override void ClearItem(string path) + { + base.ClearItem(path); + } +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + public System.Collections.ObjectModel.Collection GetAvailableDrives(Settings settings, ProviderInfo providerInfo) + { + IEnumerable storageContainers = null; + OSDriveParameters parameters = new OSDriveParameters(); + + if (this.Settings != null) + { + parameters.Settings = this.Settings; + } + else + { + parameters.Settings = settings; + } + + try + { + // Get a list of Storage Containers... + + Task> getContainersTask = this.Client.CreateServiceClient().ListStorageContainers(); + getContainersTask.Wait(); + storageContainers = getContainersTask.Result; + } + catch (Exception ex) + { + Console.WriteLine(ex); + } + + Collection drives = new Collection(); + + // For every storageContainer that the User has access to, create a Drive that he can mount within Powershell.. + + try + { + if (storageContainers.Count() > 0) + { + foreach (StorageContainer storageContainer in storageContainers) + { + PSDriveInfo driveInfo = new PSDriveInfo(storageContainer.Name, providerInfo, "/", "Root folder for your storageContainer", null); + parameters.Settings = this.Settings; + OpenStackPSDriveInfo kvsDriveInfo = new OpenStackPSDriveInfo(driveInfo, parameters, this.Context, this.StorageServiceURL); + //kvsDriveInfo.SharePath = storageContainer.SharePath; + drives.Add(kvsDriveInfo); + } + } + else + { + PSDriveInfo driveInfo = new PSDriveInfo("OS-Init", this.ProviderInfo, "/", "Root folder for your storageContainer", null); + return new Collection + { + new OpenStackPSDriveInfo(driveInfo, parameters, this.Context, this.StorageServiceURL) + }; + } + } + catch (Exception) + { + + } + + return drives; + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + private void SetDefaultDrive() + { + Runspace runSpace = RunspaceFactory.CreateRunspace(); + runSpace.Open(); + Pipeline pipeline = runSpace.CreatePipeline(); + Command setDefaultDriveCmd = new Command("Set-Location OS-Init:"); + pipeline.Commands.Add(setDefaultDriveCmd); + } +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + private Collection CreateDefaultDrive(OSDriveParameters parameters) + { + WriteDebug("No Storage Containers found, initializing defaults."); + PSDriveInfo driveInfo = new PSDriveInfo("OS-Init", this.ProviderInfo, "/", "Root folder for your Container", null); + + return new Collection + { + new OpenStackPSDriveInfo(driveInfo, parameters, this.Context, this.StorageServiceURL) + }; + } +//================================================================================================== +/// +/// This is called when the CLIManifest.psd1 is registered with the Import-Module cmdlet. +/// +/// +//================================================================================================== + protected override System.Collections.ObjectModel.Collection InitializeDefaultDrives() + { + this.InitializeSession(); + + if (this.Context.ServiceCatalog.Exists(this.ProviderInfo.Name)) + { + IEnumerable storageContainers = null; + OSDriveParameters parameters = new OSDriveParameters(); + var storageServiceClient = this.Client.CreateServiceClient(); + Task accountTask = storageServiceClient.GetStorageAccount(); + + accountTask.Wait(); + StorageAccount account = accountTask.Result; + storageContainers = account.Containers; + Collection drives = new Collection(); + + // For every storageContainer that the User has access to, create a Drive that he can mount within Powershell.. + + try + { + if (storageContainers != null) + { + if (storageContainers.Count() == 1 && storageContainers.First().Name == string.Empty) + { + return this.CreateDefaultDrive(parameters); + } + parameters.Settings = this.Settings; + + foreach (StorageContainer storageContainer in storageContainers) + { + PSDriveInfo driveInfo = new PSDriveInfo(storageContainer.Name, this.ProviderInfo, "/", "Root folder for your storageContainer", null); + OpenStackPSDriveInfo kvsDriveInfo = new OpenStackPSDriveInfo(driveInfo, parameters, this.Context, this.StorageServiceURL); + //kvsDriveInfo.SharePath = storageContainer.SharePath; + drives.Add(kvsDriveInfo); + } + } + else + { + return this.CreateDefaultDrive(parameters); + } + } + catch (Exception ex) + { + WriteDebug("Exception : HPOSNavigationProvider.InitializeDefaultDrives"); + WriteDebug(ex.Message); + this.WriteError(new ErrorRecord(ex, "1", ErrorCategory.InvalidArgument, this)); + } + return drives; + } + else + { + return null; + } + } +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + public bool ContainsWildcard(string path) + { + if (path.Contains("?") || path.Contains("*") || path.Contains("[") || path.Contains("]")) + return true; + else + return false; + } +//======================================================================================================= +/// +/// +/// +/// +/// +//======================================================================================================= + private string GetContainerName(string path) + { + return this.Drive.Name; + + if (path == "//") + { + return this.Drive.Name; + } + return null; + } +//================================================================================================== +/// +/// Retrieves a StorageObject with a fully qualified path from the User. +/// +/// +/// +//================================================================================================== + private IEnumerable GetStorageObjects(string path) + { + List modelViewItems = new List(); + Task listStorageObjectTask; + string folderName = null; + + if (path != @"\" && !path.EndsWith(@"\")) + path = path + @"\"; + + StoragePath storagePath = this.CreateStoragePath(path); + IStorageServiceClient client = this.Client.CreateServiceClient(); + + if (path == "\\") { + folderName = "/"; + } + else { + folderName = path.Replace(@"\", "/").TrimStart('/'); + } + + listStorageObjectTask = client.GetStorageFolder(this.GetContainerName(path), folderName); + listStorageObjectTask.Wait(); + foreach (StorageItem item in listStorageObjectTask.Result.Objects.Union(listStorageObjectTask.Result.Folders)) + { + StorageItemModelView modelView = new StorageItemModelView(item); + modelViewItems.Add(modelView); + } + return modelViewItems; + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + private void WriteData(IEnumerable storageItemViewModel, string path, WildcardPattern pattern = null) + { + FolderStatistics statistics = new FolderStatistics(); + bool doesExist = false; + + if (storageItemViewModel.Count() > 0 || storageItemViewModel == null) + { + // Write out any files that we find within this particular folder.. + + statistics = this.WriteFiles(storageItemViewModel, path); + doesExist = true; + } + + //List folders = storageObjects.Where(so => so.Name.EndsWith(@"\")).ToList(); + + List folders = storageItemViewModel.Where(so => so.Type == "Folder").ToList(); + + // List folders = storageObjects.Where(so => so.StorageObjectType == StorageObjectType.Folder).ToList(); + + if (folders != null) + { + // Now we'll write out any decendant folders found within the current directory.. + + this.WriteFolders(folders, ref statistics); + doesExist = true; + } + + // Finally write out the summary folder stats section of the command.. + + if (doesExist) + { + this.WriteFolderStatistics(statistics); + } + else + { + Console.WriteLine("No files or folders found."); + Console.WriteLine(""); + } + } +//================================================================================================== +/// +/// Writes out the files represented as StorageObjects for the supplied path. +/// +//================================================================================================== + private FolderStatistics WriteFiles(IEnumerable storageObjects, string path) + { + FolderStatistics statistics = new FolderStatistics(); + + if (storageObjects != null && storageObjects.ToList() != null) + { + storageObjects.ToList().ForEach(item => + { + if (item.Type == "File") + { + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + WriteItemObject(item, item.Name, false); + statistics.TotalFilesFound++; + //statistics.TotalBytes = statistics.TotalBytes + item.Length; + } + }); + } + return statistics; + } +//================================================================================================== +/// +/// Writes out a list of supplied Folders and returns stats on them as well. +/// +//================================================================================================== + private void WriteFolders(List folders, ref FolderStatistics statistics) + { + if (folders != null) + { + // Write out each folder we find in the current directory.. + + foreach (StorageItemModelView obj in folders) + { + string fixedString = obj.Name.TrimEnd('/'); + string[] folderNames = fixedString.Split('/'); + string folderName = folderNames[folderNames.Count() - 1]; + //obj.Name = folderName; + + if (folderName != "") + { + WriteItemObject(obj, folderName, false); + statistics.TotalFoldersFound++; + } + } + } + else + { + statistics.TotalFoldersFound = 0; + } + } +//================================================================================================== +/// +/// Writes out summary information on a given folder. +/// +//================================================================================================== + private void WriteFolderStatistics(FolderStatistics statistics) + { + if (statistics.TotalFoldersFound > 0 || statistics.TotalFilesFound > 0) + WriteItemObject ("----------------------------------------------------------------------------------------------", cDelimiter, false); + WriteItemObject(" ", cDelimiter, false); + WriteItemObject("Total # Folders found : " + Convert.ToString(statistics.TotalFoldersFound) , cDelimiter, false); + WriteItemObject("Total # Items Found : " + Convert.ToString(statistics.TotalFilesFound) , cDelimiter, false); + WriteItemObject("Total # Bytes in Folder : " + Convert.ToString(statistics.TotalBytes), cDelimiter, false); + // WriteItemObject("Total Cost of Folder : " + "$" + Convert.ToString(statistics.TotalBytes * 2), cDelimiter, false); + WriteItemObject(" ", cDelimiter, false); + } +//================================================================================================== +/// +/// Writes out header information to be used during listing operations. +/// +//================================================================================================== + private void WriteHeader() + { + // Write out the commands header information first.. + + WriteItemObject(" ", cDelimiter, false); + Console.ForegroundColor = ConsoleColor.DarkGray; + WriteItemObject("==============================================================================================", cDelimiter, false); + Console.ForegroundColor = ConsoleColor.Yellow; + WriteItemObject("Storage Container : " + this.Drive.Name, cDelimiter, false); + WriteItemObject("Directory of : " + this.Drive.Name + " " + cDelimiter + this.Drive.CurrentLocation, cDelimiter, false); + Console.ForegroundColor = ConsoleColor.DarkGray; + WriteItemObject("==============================================================================================", cDelimiter, false); + Console.ForegroundColor = ConsoleColor.Green; + WriteItemObject(" ", cDelimiter, false); + } +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + private bool CheckDefaultDrive(bool suppressMsg) + { + if (this.Drive.Name == "OS-Init") + { + if (!suppressMsg) + { + Console.WriteLine(" ", cDelimiter, false); + Console.ForegroundColor = ConsoleColor.DarkGray; + Console.WriteLine("==============================================================================================", cDelimiter, false); + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine("You are currently connected to the default Container. This drive is used to boot-strap the"); + Console.WriteLine("Container creation prcoess. The only valid command that you can issue from here is the"); + Console.WriteLine("New-Container command. After the Container is created successfully, issue CD yourcontainer:"); + Console.WriteLine("This will bind to that container exposing the full functionality of OpenStack Object Storage. "); + Console.ForegroundColor = ConsoleColor.DarkGray; + Console.WriteLine("==============================================================================================", cDelimiter, false); + Console.ForegroundColor = ConsoleColor.Green; + Console.WriteLine(" ", cDelimiter, false); + } + + return true; + } + else + { + return false; + } + } + + protected override object GetItemDynamicParameters(string path) + { + return base.GetItemDynamicParameters(path); + } + + protected override void SetItem(string path, object value) + { + base.SetItem(path, value); + } + protected override string[] ExpandPath(string path) + { + return base.ExpandPath(path); + } + protected override string GetParentPath(string path, string root) + { + return base.GetParentPath(path, root); + } + protected override object GetChildNamesDynamicParameters(string path) + { + return base.GetChildNamesDynamicParameters(path); + } + protected override object GetChildItemsDynamicParameters(string path, bool recurse) + { + return base.GetChildItemsDynamicParameters(path, recurse); + } + protected override object ClearItemDynamicParameters(string path) + { + return base.ClearItemDynamicParameters(path); + } + protected override string NormalizeRelativePath(string path, string basePath) + { + return base.NormalizeRelativePath(path, basePath); + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + protected override bool IsItemContainer(string path) + { + if (path == @"\") + { + if (this.CheckDefaultDrive(false)) return true; + } + else + { + StoragePath storagePath = null; + + if (path.Contains(":")) + { + storagePath = new StoragePath(this.StorageServiceURL + path); + } + else + { + storagePath = new StoragePath(this.StorageServiceURL, this.Drive.Name, path.Substring(1) + "/"); + } + + IStorageServiceClient storageService = this.Client.CreateServiceClient(); + Task getStorageObjectTask = storageService.GetStorageObject(storagePath.Volume, storagePath.ResourcePath); //(storagePath.AbsoluteURI); + getStorageObjectTask.Wait(); + StorageObject sObject = getStorageObjectTask.Result; + + if (sObject != null) + { + return true; + } + else + { + return false; + } + } + return true; + } +//================================================================================================== +/// +/// Displays all StorageObjects for a given folder.. +/// +/// +/// +//================================================================================================== + protected override void GetChildItems(string path, bool recurse) + { + // Write out the commands header information first.. + + if (this.CheckDefaultDrive(true)) return; + + this.WriteHeader(); + this.WriteData(this.GetStorageObjects(path).ToList(), path); + } +//================================================================================================== +/// +/// Called when the user decides to delete a KVSDrive. +/// +/// +/// +//================================================================================================== + protected override PSDriveInfo RemoveDrive(PSDriveInfo drive) + { + if (drive == null) + { + WriteError(new ErrorRecord(new ArgumentNullException("drive"), "NullDrive", ErrorCategory.InvalidArgument, drive)); + return null; + } + return drive; + } +//================================================================================================== +/// +/// Called by the PS runtime when a NewDrive is required.. +/// +/// +/// +//================================================================================================== + protected override PSDriveInfo NewDrive(PSDriveInfo drive) + { + if (drive == null) { + WriteError(new ErrorRecord(new ArgumentNullException("drive"), "NullDrive", ErrorCategory.InvalidArgument, drive)); + return null; + } + + if (drive.Root == null) { + WriteError(new ErrorRecord(new ArgumentNullException("drive.Root"), "NullRoot", ErrorCategory.InvalidArgument, drive)); + return null; + } + + if (drive is OpenStackPSDriveInfo) { + return drive; + } + + var driveParams = this.DynamicParameters as OSDriveParameters; + return new OpenStackPSDriveInfo(drive, driveParams, this.Context, this.StorageServiceURL); + } +//================================================================================================== +/// +/// Called by the PS runtime when +/// +/// +//================================================================================================== + protected override object NewDriveDynamicParameters() + { + // The KVSDriveParameters instance will pull its values from the config file when created.. + + return new OSDriveParameters(); + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + private string GetLeafFolder(string path) + { + string[] elements = path.Replace(@"\", "/").Split('/'); + return elements[elements.Count() - 2]; + } +//================================================================================================== +/// +/// +/// +/// +/// +/// +//================================================================================================== + protected override void NewItem(string path, string itemTypeName, object newItemValue) + { + //// Validate the folder name first.. + + //if (path.Contains("%") || path.Contains(".")) + //{ + // Console.WriteLine(""); + // Console.WriteLine("Folder names cannot contain % or . characters" ); + // Console.WriteLine(""); + //} + //else + //{ + // if (!path.EndsWith("/")) + // { + // path = path + "/"; + // } + + // StoragePath newFolderPath = this.CreateStoragePath(path); + // this.RepositoryFactory.CreateStorageObjectRepository().MakeFolder(newFolderPath.AbsoluteURI); + //} + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + private string ExtractPattern(string path) + { + string[] elements = path.Split('\\'); + return elements[elements.Length - 1]; + } +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + protected override void GetItem(string path) + { + // Write out the commands header information first.. + + if (this.CheckDefaultDrive(true)) return; + this.WriteHeader(); + IEnumerable storageObjects = this.GetStorageObjects(path); + + + + this.WriteData(storageObjects.ToList(), path); + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + protected override bool ItemExists(string path) + { + if (path == "//") + { + if (this.CheckDefaultDrive(true)) + { + return false; + } + else + { + return base.ItemExists(path); + } + } + return base.ItemExists(path); + } + #endregion + #region Properties +//================================================================================================== +/// +/// +/// +//================================================================================================== + private string StorageServiceURL + { + get + { + return this.StorageClient.GetPublicEndpoint().AbsoluteUri; + //if (this.Drive.SharePath == null) + // return this.Context.ServiceCatalog.GetService("object-store").Url; + //else + // return this.Drive.SharePath; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + private OpenStackPSDriveInfo Drive + { + get + { + return this.PSDriveInfo as OpenStackPSDriveInfo; + } + } +//========================================================================================= +/// +/// +/// +/// +//========================================================================================= + private StoragePath CreateStoragePath(string path) + { + return this.Drive.CreateStoragePath(path); + } + #endregion +//================================================================================================== +/// +/// This test should not verify the existance of the item at the path. +/// It should only perform syntactic and semantic validation of the +/// path. For instance, for the file system provider, that path should +/// be canonicalized, syntactically verified, and ensure that the path +/// does not refer to a device. +/// +/// +/// +//================================================================================================== + protected override bool IsValidPath(string path) + { + return true; + } + } +} diff --git a/Openstack.Client.Powershell/Providers/ObjectStorage/StorageItemViewModel.cs b/Openstack.Client.Powershell/Providers/ObjectStorage/StorageItemViewModel.cs new file mode 100644 index 0000000..29cdf63 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/ObjectStorage/StorageItemViewModel.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Openstack.Storage; + +namespace Openstack.Client.Powershell.Providers.ObjectStorage +{ + public class StorageItemViewModel + { + private DateTime _lastModifiedDate; + private long _size; + private string _name; + private string _type; + + public StorageItemViewModel(StorageItem item) + { + StorageObject storageObject = item as StorageObject; + + if (storageObject != null) + { + this.Name = storageObject.Name; + this.Size = storageObject.Length; + this.Type = "File"; + this.LastModifiedDate = storageObject.LastModified; + } + else + { + StorageFolder storageFolder = item as StorageFolder; + if (storageFolder != null) + { + this.Name = storageFolder.Name; + this.Size = 0; + this.Type = "Folder"; + } + } + } + public DateTime LastModifiedDate + { + get { return _lastModifiedDate; } + set { _lastModifiedDate = value; } + } + public long Size + { + get { return _size; } + set { _size = value; } + } + public string Name + { + get { return _name; } + set { _name = value; } + } + public string Type + { + get { return _type; } + set { _type = value; } + } + } +} diff --git a/Openstack.Client.Powershell/Providers/Security/SecurityGroupUIContainer.cs b/Openstack.Client.Powershell/Providers/Security/SecurityGroupUIContainer.cs new file mode 100644 index 0000000..bc7b49c --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Security/SecurityGroupUIContainer.cs @@ -0,0 +1,134 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Compute; +using Openstack.Objects.Domain.Security; + +namespace Openstack.Client.Powershell.Providers.Security +{ + public class SecurityGroupUIContainer : BaseUIContainer + { +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public SecurityGroupUIContainer(BaseUIContainer parentContainer, string name, string description, string path) + : base(parentContainer, name, description, path) + { + this.LoadContainers(); + this.ObjectType = Common.ObjectType.Entity; + } +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public SecurityGroupUIContainer() { } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void Load() + { + this.Entity = this.RepositoryFactory.CreateSecurityRepository().GetSecurityGroup(this.Id); + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void LoadContainers() + {} +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + private void WriteGroupDetails(SecurityGroup group) + { + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + Console.WriteLine(" Id : " + group.Id); + Console.WriteLine(" Name : " + group.Name); + Console.WriteLine(" Tenant Id : " + group.TenantId); + Console.WriteLine(" Description : " + group.Description); + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void WriteSecurityRules(SecurityGroup group) + { + foreach (SecurityGroupRule rule in ((SecurityGroup)this.Entity).Rules) + { + Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), this.Context.Forecolor); + Console.WriteLine(""); + Console.WriteLine(" Rule Id : " + rule.Id); + Console.WriteLine(" IP Protocol : " + rule.Protocol); + Console.WriteLine(" Direction : " + rule.Direction); + Console.WriteLine(" Range Min : " + rule.PortRangeMin); + Console.WriteLine(" Range Max : " + rule.PortRangeMax); + Console.WriteLine(" Ether Type : " + rule.EtherType); + Console.WriteLine(" Security Group : " + rule.SecurityGroupId); + Console.WriteLine(" Remote Group : " + rule.RemoteGroupId); + Console.WriteLine(" Remote IP Prefix : " + rule.RemoteIPPrefix); + Console.WriteLine(" Tenant Id : " + rule.TenantId); + } + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void WriteEntityDetails() + { + SecurityGroup group = (SecurityGroup)this.Entity; + + this.WriteHeader("Security Group Details"); + this.WriteGroupDetails(group); + this.WriteHeader("Security Rules", ConsoleColor.White); + + this.WriteSecurityRules(group); + Console.WriteLine(); + } +//========================================================================================================= +/// +/// +/// +/// +/// +//========================================================================================================= + public override bool IsEntityId(string id) + { + if (id == ((Server)this.Entity).Id) + return true; + else + return false; + + } + } +} diff --git a/Openstack.Client.Powershell/Providers/Security/SecurityGroupsUIContainer.cs b/Openstack.Client.Powershell/Providers/Security/SecurityGroupsUIContainer.cs new file mode 100644 index 0000000..f664838 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Security/SecurityGroupsUIContainer.cs @@ -0,0 +1,128 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Collections.Generic; +using Openstack.Administration.Domain; +using System.Collections; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Objects.Domain.Compute; +using Openstack.Objects.Domain; +using System; +using System.Collections.ObjectModel; +using Openstack.Objects; +using System.Xml.Serialization; +using System.IO; +using Openstack.Objects.Domain.Security; + +namespace Openstack.Client.Powershell.Providers.Security +{ + public class SecurityGroupsUIContainer : BaseUIContainer + { + private bool _isServerGroups = false; + +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public SecurityGroupsUIContainer() { } +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public SecurityGroupsUIContainer(BaseUIContainer parentContainer, + string name, + string description, + string path) + : base(parentContainer, name, description, path) + { + this.ObjectType = Common.ObjectType.Container; + this.LoadContainers(); + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public bool IsServerGroups + { + get { return _isServerGroups; } + set { _isServerGroups = value; } + } + #region Methods +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void Load() + { + this.LoadEntities(); + } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + private void LoadContainers() + {} +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + public void LoadEntities(List securityGroups) + { + this.SetUIContainers(securityGroups); + this.Entities = securityGroups; + } +//========================================================================================================= +/// +/// +/// +/// +/// +//========================================================================================================= + private void LoadEntities() + { + if (!_isServerGroups) + { + IList securityGroups = this.RepositoryFactory.CreateSecurityRepository().GetSecurityGroups(); + this.SetUIContainers(securityGroups); + this.Entities = securityGroups; + } + } +//========================================================================================================= +/// +/// +/// +/// +/// +//========================================================================================================= + public override BaseUIContainer CreateContainer(string id) + { + return null; + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/Providers/Security/SecurityUIContainer.cs b/Openstack.Client.Powershell/Providers/Security/SecurityUIContainer.cs new file mode 100644 index 0000000..2f58bc5 --- /dev/null +++ b/Openstack.Client.Powershell/Providers/Security/SecurityUIContainer.cs @@ -0,0 +1,86 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Collections; +using Openstack.Client.Powershell.Providers.Common; +using Openstack.Client.Powershell.Providers.Security; +using Openstack.Objects.Domain; +using Openstack.Objects.Utility; +using Openstack.Objects.DataAccess; +using Openstack.Client.Powershell.Providers.Compute; + +namespace Openstack.Client.Powershell.Providers.Security +{ +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + [RequiredServiceIdentifierAttribute("Openstack-ComputeDrive")] + public class SecurityUIContainer : BaseUIContainer + { +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public SecurityUIContainer() { } +//========================================================================================================= +/// +/// +/// +//========================================================================================================= + public override void Load() + { + this.LoadContainers(); + } +//========================================================================================================= +/// +/// +/// +/// +//========================================================================================================= + private void LoadContainers() + { + this.Containers.Clear(); + this.Containers.Add(this.CreateContainer("SecurityGroups", "Container objects used for security group rules", @"Security\SecurityGroups")); + this.Containers.Add(this.CreateContainer("KeyPairs", "A place to manage public/private keys used to create secure connections to compute instances.", @"Security\KeyPairs")); + } +//========================================================================================================= +/// +/// +/// +/// +/// +/// +//========================================================================================================= + public SecurityUIContainer(BaseUIContainer parentContainer, string name, string description, string path, Context context, BaseRepositoryFactory repository) + : base(parentContainer, name, description, path) + { + this.Context = context; + this.RepositoryFactory = repository; + + this.LoadContainers(); + this.ObjectType = Client.Powershell.Providers.Common.ObjectType.Entity; + } + } +} diff --git a/Openstack.Client.Powershell/Utility/Context.cs b/Openstack.Client.Powershell/Utility/Context.cs new file mode 100644 index 0000000..2f9be33 --- /dev/null +++ b/Openstack.Client.Powershell/Utility/Context.cs @@ -0,0 +1,108 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using Openstack.Common; +using Openstack; +using System.Security; +using System.Reflection; +using Openstack.Identity; + +namespace Openstack.Client.Powershell.Utility +{ + public class Context + { + private IOpenstackServiceCatalog _serviceCatalog; + private Settings _settings; + //private Token _accessToken; + private string _productName = "OpenstackDotNetAPI"; + private string _version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); + private string _forecolor = "Green"; + + + #region Ctors + //================================================================================================== + /// + /// + /// + //================================================================================================== + public Context() + { + _settings = Settings.Default; + } + #endregion + #region Properties + //================================================================================================== + /// + /// + /// + //================================================================================================== + public string Version + { + get { return _version; } + set { _version = value; } + } + //================================================================================================== + /// + /// + /// + //================================================================================================== + public string Forecolor + { + get { return _forecolor; } + set { _forecolor = value; } + } + //================================================================================================== + /// + /// + /// + //================================================================================================== + public string ProductName + { + get { return _productName; } + set { _productName = value; } + } + ////================================================================================================== + ///// + ///// + ///// + ////================================================================================================== + // public Token AccessToken + // { + // get { return _accessToken; } + // set { _accessToken = value; } + // } + //================================================================================================== + /// + /// + /// + //================================================================================================== + public Settings Settings + { + get { return _settings; } + set { _settings = value; } + } + //================================================================================================== + /// + /// + /// + //================================================================================================== + public IOpenstackServiceCatalog ServiceCatalog + { + get { return _serviceCatalog; } + set { _serviceCatalog = value; } + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/Utility/CredentialManager.cs b/Openstack.Client.Powershell/Utility/CredentialManager.cs new file mode 100644 index 0000000..c08839d --- /dev/null +++ b/Openstack.Client.Powershell/Utility/CredentialManager.cs @@ -0,0 +1,337 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Xml.Linq; +using System.Xml.XPath; +using System.Security; +using Openstack.Identity; +using Openstack.Client.Powershell.Utility; +using System.Linq; +using System.Runtime.InteropServices; +using System.Collections.Generic; +using System.Diagnostics.Contracts; + +namespace Openstack.Client.Powershell.Utility +{ + + public class ServiceProviderInfo + { + public string Name; + public IOpenstackCredential Credential; + public string ServbiceProviderUrl; + } + + public class CredentialManager + { + private bool _supressPrompt = false; + +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + public CredentialManager(bool supressPrompt = false) + { + _supressPrompt = supressPrompt; + } +//======================================================================================================= +/// +/// +/// +/// +//======================================================================================================= + private Boolean DoesRequireCredentials(string accountIdNode, string accessKeyNode, string identityServiceURI, string tenantId) + { + if (accountIdNode == String.Empty || accessKeyNode == String.Empty || identityServiceURI == String.Empty || tenantId == String.Empty) + return true; + else return false; + + + + + //// First make sure the User info exist.. + + //System.Collections.Generic.IEnumerable attributes = accountIdNode.Attributes(); + //foreach (XAttribute attribute in attributes) + //{ + // if (attribute.Name == "value" && attribute.Value == string.Empty) + // { + // return true; + // } + //} + + //// Now check to ensure the auth key exist + + //System.Collections.Generic.IEnumerable attributes2 = accessKeyNode.Attributes(); + //foreach (XAttribute attribute in attributes2) + //{ + // if (attribute.Name == "value" && attribute.Value == string.Empty) + // { + // return true; + // } + //} + + //return false; + } +//================================================================================================== +/// +/// +/// +/// +/// +/// +//================================================================================================== + private bool VerifyCredentials(string accessKey, string accountId) + { + //RequestHeaders headers = BaseRepositoryFactory.GetSecurityHeaders(accountId, accessKey); + + //if (headers != null) + //{ + // return true; + //} + //else + //{ + // return false; + //} + return true; + } +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + private static string ReadPassword() + { + string password = ""; + ConsoleKeyInfo info = Console.ReadKey(true); + + while (info.Key != ConsoleKey.Enter) + { + if (info.Key != ConsoleKey.Backspace) + { + Console.Write("*"); + password += info.KeyChar; + } + + else if (info.Key == ConsoleKey.Backspace) + { + if (!string.IsNullOrEmpty(password)) + { + // remove one character from the list of password characters + + password = password.Substring(0, password.Length - 1); + + // get the location of the cursor + + int pos = Console.CursorLeft; + + // move the cursor to the left by one character + + Console.SetCursorPosition(pos - 1, Console.CursorTop); + + // replace it with space + + Console.Write(" "); + + // move the cursor to the left by one character again + + Console.SetCursorPosition(pos - 1, Console.CursorTop); + } + } + info = Console.ReadKey(true); + } + + // add a new line because user pressed enter at the end of their password + + Console.WriteLine(); + return password; + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + private string convertToUNSecureString(SecureString secstrPassword) + { + IntPtr unmanagedString = IntPtr.Zero; + try + { + unmanagedString = Marshal.SecureStringToGlobalAllocUnicode(secstrPassword); + return Marshal.PtrToStringUni(unmanagedString); + } + finally + { + Marshal.ZeroFreeGlobalAllocUnicode(unmanagedString); + } + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + private SecureString ConvertToSecureString(string value) + { + // Instantiate the secure string. + SecureString securePwd = new SecureString(); + var secureStr = new SecureString(); + if (value.Length > 0) + { + foreach (var c in value.ToCharArray()) secureStr.AppendChar(c); + } + else return null; + return secureStr; + } +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + private ServiceProviderInfo PromptForCredentials() + { + ServiceProviderInfo info = new ServiceProviderInfo(); + + Console.WriteLine("User Name : "); + string username = Console.ReadLine(); + Console.WriteLine(""); + Console.WriteLine("Password : "); + string password = CredentialManager.ReadPassword(); + Console.WriteLine(""); + Console.WriteLine("Tenant Name : "); + string tenantName = Console.ReadLine(); + Console.WriteLine(""); + Console.WriteLine("Service Provider Identity Service Url : "); + string identityServiceUrl = Console.ReadLine(); + Console.WriteLine(""); + Console.WriteLine("Finally supply a name for this Profile."); + string name = Console.ReadLine(); + Console.WriteLine(""); + Console.WriteLine(""); + info.Credential = new OpenstackCredential(new Uri(identityServiceUrl), username, this.ConvertToSecureString(password), tenantName); + info.ServbiceProviderUrl = identityServiceUrl; + info.Name = name; + + return info; + } +//================================================================================================== +/// +/// Writes out header information to be used during the process that prompts for new credentials. +/// +//================================================================================================== + private void WriteGetCredentialsHeader() + { + Console.WriteLine(""); + Console.ForegroundColor = ConsoleColor.DarkGray; + Console.WriteLine("======================================================================================================="); + Console.ForegroundColor = ConsoleColor.Yellow; + Console.WriteLine("We've noticed that you haven't supplied any credentials yet. To continue we need to get your Username, "); + Console.WriteLine("Password, and the Tenant Id provided to you during the sign up process. If you haven't signed up"); + Console.WriteLine("for any services yet, just go to https://console.Openstack.com for details on how to get started today!"); + Console.ForegroundColor = ConsoleColor.DarkGray; + Console.WriteLine("======================================================================================================="); + Console.ForegroundColor = ConsoleColor.Green; + Console.WriteLine(" "); + } +//================================================================================================== +/// +/// Writes out an error message when invalid credentials are supplied.. +/// +//================================================================================================== + private void WriteBadCredentialsMsg() + { + Console.WriteLine(""); + Console.ForegroundColor = ConsoleColor.DarkGray; + Console.WriteLine("======================================================================================================="); + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine("The credentials that you have supplied could not be verified. Please try again. If you continue to have "); + Console.WriteLine("problems please feel free to contact our support staff at https://console.Openstack.com"); + Console.ForegroundColor = ConsoleColor.DarkGray; + Console.WriteLine("======================================================================================================="); + Console.ForegroundColor = ConsoleColor.Green; + Console.WriteLine(" "); + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public IOpenstackCredential GetCredentials(bool badCredentialsSupplied = false) + { + ServiceProviderInfo info; + IOpenstackCredential credential; + + string configFilePath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\" + @"OS\CLI.config"; + XDocument doc = XDocument.Load(configFilePath); + XElement serviceProviderNode = doc.Descendants("ServiceProvider").Where(a => a.Attribute("isDefault").Value == "True").FirstOrDefault(); + XElement username = serviceProviderNode.Elements().Where(u => u.Name == "add" && u.Attribute("key").Value == "Username").Single(); + XElement password = serviceProviderNode.Elements().Where(u => u.Name == "add" && u.Attribute("key").Value == "Password").Single(); + XElement tenantId = serviceProviderNode.Elements().Where(u => u.Name == "add" && u.Attribute("key").Value == "DefaultTenantId").Single(); + XElement identityServiceUrl = serviceProviderNode.Elements().Where(u => u.Name == "add" && u.Attribute("key").Value == "AuthenticationServiceURI").Single(); + XAttribute name = serviceProviderNode.Attribute("name"); + + if (this.DoesRequireCredentials(username.Attribute("value").Value, password.Attribute("value").Value, identityServiceUrl.Attribute("value").Value, tenantId.Attribute("value").Value)) + { + if (!badCredentialsSupplied){ + this.WriteGetCredentialsHeader(); + } + + if (_supressPrompt == false) { + info = this.PromptForCredentials(); + credential = info.Credential; + } + else + { + // The test client would be an example of where we need to supress the prompt for credentials. Here we just raise an exception instead.. + + throw new SecurityException("You must supply a valid Access Key and Secret Key in the CLI.config file to start unit testing."); + } + + while (!this.VerifyCredentials(username.Value, password.Value)) + { + Console.Clear(); + this.WriteBadCredentialsMsg(); + info = this.PromptForCredentials(); + credential = info.Credential; + } + + username.SetAttributeValue("value", credential.UserName); + password.SetAttributeValue("value", this.convertToUNSecureString(credential.Password)); + tenantId.SetAttributeValue("value", credential.TenantId); + identityServiceUrl.SetAttributeValue("value", credential.AuthenticationEndpoint.AbsoluteUri); + name.SetValue(info.Name); + + Console.WriteLine(" ==> Verifying and Storing Credentials.."); + doc.Save(configFilePath); + + return credential; + } + + // We didn't need to prompt for credentials from the user so just send back what we found in the config file.. + + SecureString securePassword = new SecureString(); + password.Attribute("value").Value.ToCharArray().ToList().ForEach(securePassword.AppendChar); + string h = this.convertToUNSecureString(securePassword); + IOpenstackCredential newCredential = new OpenstackCredential(new Uri(identityServiceUrl.Attribute("value").Value), username.Attribute("value").Value, securePassword, tenantId.Attribute("value").Value); + + return newCredential; + } + } +} diff --git a/Openstack.Client.Powershell/Utility/Enums.cs b/Openstack.Client.Powershell/Utility/Enums.cs new file mode 100644 index 0000000..1ca34e2 --- /dev/null +++ b/Openstack.Client.Powershell/Utility/Enums.cs @@ -0,0 +1,62 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System.Xml.Serialization; + +namespace Openstack.Client.Powershell.Utility +{ + + public enum StorageOperationType + { + IntraServer = 0, + ServerToLocal = 1, + LocalToServer = 2 + } + + public enum PathType + { + Local = 1, // Local is implicitly always fully qualified.. + Remote = 2, + UnknownPathType = 3 + } + + public enum CannedPermissionTypes + { + [XmlEnum(Name = "private")] + Private, + [XmlEnum(Name = "public-read")] + PublicRead, + [XmlEnum(Name = "public-read-write")] + PublicReadWrite, + [XmlEnum(Name = "authenticated-read")] + AuthenticatedRead, + [XmlEnum(Name = "authenticated-read-write")] + AuthenticatedReadWrite, + [XmlEnum(Name = "storageContainer-owner-read")] + storageContainerOwnerRead, + [XmlEnum(Name = "storageContainer-owner-full-control")] + storageContainerOwnerFullcontrol, + Unspecified + } + + public enum ContainerScope + { + Public, + Private + + } +} + + diff --git a/Openstack.Client.Powershell/Utility/ServiceProvider.cs b/Openstack.Client.Powershell/Utility/ServiceProvider.cs new file mode 100644 index 0000000..5e51b0a --- /dev/null +++ b/Openstack.Client.Powershell/Utility/ServiceProvider.cs @@ -0,0 +1,62 @@ +// /* ============================================================================ +// Copyright 2014 Hewlett Packard +// +// 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. +// ============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Openstack.Client.Powershell.Utility +{ + public class ServiceProvider + { + private string _name; + private bool _isDefault = false; + private string _authenticationServiceURI; + private string _defaultTenantId; + private string _username; + + public string Username + { + get { return _username; } + set { _username = value; } + } + + public string DefaultTenantId + { + get { return _defaultTenantId; } + set { _defaultTenantId = value; } + } + + public string AuthenticationServiceURI + { + get { return _authenticationServiceURI; } + set { _authenticationServiceURI = value; } + } + + public bool IsDefault + { + get { return _isDefault; } + set { _isDefault = value; } + } + + public string Name + { + get { return _name; } + set { _name = value; } + } + } +} diff --git a/Openstack.Client.Powershell/Utility/Settings.cs b/Openstack.Client.Powershell/Utility/Settings.cs new file mode 100644 index 0000000..14e7916 --- /dev/null +++ b/Openstack.Client.Powershell/Utility/Settings.cs @@ -0,0 +1,742 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Xml.Linq; +using System.Collections; +using System.Configuration; +using System.IO; + +namespace Openstack.Client.Powershell.Utility +{ + public sealed partial class Settings : Hashtable + { + private static Settings defaultInstance = new Settings(); + + #region Ctors +//================================================================================================== +/// +/// +/// +//================================================================================================== + public Settings(Hashtable settings) + { + this.Load(settings); + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public Settings(bool isEmpty) + { + + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public Settings() + { + this.Reset(); + } + #endregion + #region File Transfer Settings.. +//================================================================================================== +/// +/// +/// +//================================================================================================== + public bool UseCleanLargeFileCopies + { + get + { + return Convert.ToBoolean(this["UseCleanLargeFileCopies"]); + } + set + { + this["UseCleanLargeFileCopies"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public int MaxSegmentCopyRetries + { + get + { + return Convert.ToInt32(this["MaxSegmentCopyRetries"]); + } + set + { + this["MaxSegmentCopyRetries"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string LargeFileSize + { + get + { + return (string)this["largeFileSize"]; + } + set + { + this["largeFileSize"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string DefaultSegmentNumber + { + get + { + return (string)this["defSegmentNumber"]; + } + set + { + this["defSegmentNumber"] = value; + } + } + #endregion + #region General Operations +//================================================================================================== +/// +/// +/// +//================================================================================================== + public static Settings Default + { + get + { + return defaultInstance; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public bool IsMocked + { + get + { + return ((bool)(this["IsMocked"])); + } + set + { + this["IsMocked"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public bool PasteGetURIResultsToClipboard + { + get + { + return Convert.ToBoolean(this["PasteGetURIResultsToClipboard"]); + } + set + { + this["PasteGetURIResultsToClipboard"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string ReleaseNotesURI + { + get + { + return (string)this["ReleaseNotesURI"]; + } + set + { + this["ReleaseNotesURI"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string NewReleaseFolder + { + get + { + return (string)this["NewReleaseFolder"]; + } + set + { + this["NewReleaseFolder"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string DefaultZone + { + get + { + return (string)this["DefaultZone"]; + } + set + { + this["DefaultZone"] = value; + } + } + #endregion + #region Connecting to a Server Settings + //================================================================================================== +/// +/// +/// +//================================================================================================== + public string CredentialListPath + { + get + { + return Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\OS\CredentialList.xml"; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public bool EnableCredentialTracking + { + get + { + return Convert.ToBoolean(this["EnableCredentialTracking"]); + } + set + { + this["EnableCredentialTracking"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string SSHClientPath + { + get + { + return (string)this["SSHClientPath"]; + } + set + { + this["SSHClientPath"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string KeyStoragePath + { + get + { + return Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string LogReadAttemptIntervalInMilliSeconds + { + get + { + return (string)this["LogReadAttemptIntervalInMilliSeconds"]; + } + set + { + this["LogReadAttemptIntervalInMilliSeconds"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string LogReadAttemptsMax + { + get + { + return (string)this["LogReadAttemptsMax"]; + } + set + { + this["LogReadAttemptsMax"] = value; + } + } + #endregion + #region Testing +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string TestFilePath + { + get + { + return ((string)(this["TestFilePath"])); + } + set + { + this["TestFilePath"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string TestImageId + { + get + { + return ((string)(this["TestImageId"])); + } + set + { + this["TestImageId"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string TestServerName + { + get + { + return ((string)(this["TestServerName"])); + } + set + { + this["TestServerName"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string TestNetworkName + { + get + { + return ((string)(this["TestNetworkName"])); + } + set + { + this["TestNetworkName"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string TestPortName + { + get + { + return ((string)(this["TestPortName"])); + } + set + { + this["TestPortName"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string TestRouterName + { + get + { + return ((string)(this["TestRouterName"])); + } + set + { + this["TestRouterName"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string TestSecurityGroupName + { + get + { + return ((string)(this["TestSecurityGroupName"])); + } + set + { + this["TestSecurityGroupName"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string TestSnapshotName + { + get + { + return ((string)(this["TestSnapshotName"])); + } + set + { + this["TestSnapshotName"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string TestSubnetName + { + get + { + return ((string)(this["TestSubnetName"])); + } + set + { + this["TestSubnetName"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string TestVolumeName + { + get + { + return ((string)(this["TestVolumeName"])); + } + set + { + this["TestVolumeName"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string TestFlavorId + { + get + { + return ((string)(this["TestFlavorId"])); + } + set + { + this["TestFlavorId"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string LocalTestDirectory + { + get + { + return (string)this["LocalTestDirectory"]; + } + set + { + this["LocalTestDirectory"] = value; + } + } + +//================================================================================================== +/// +/// +/// +//================================================================================================== + public int HttpTimeoutInterval + { + get + { + return Convert.ToInt32(this["HttpTimeoutInterval"]); + } + set + { + this["HttpTimeoutInterval"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string TestStorageContainerSecondary + { + get + { + return (string)this["TestStorageContainerSecondaryName"]; + } + set + { + this["TestStorageContainerSecondaryName"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string TestStorageContainerName + { + get + { + return (string)this["TestStorageContainerName"]; + } + set + { + this["TestStorageContainerName"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string TestVolumeIdUnattached + { + get + { + return (string)this["TestVolumeIdUnattached"]; + } + set + { + this["TestVolumeIdUnattached"] = value; + } + } + #endregion + #region Authentication +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string DefaultTenantId + { + get + { + return ((string)(this["DefaultTenantId"])); + } + set + { + this["DefaultTenantId"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string Username + { + get + { + return (string)this["Username"]; + } + set + { + this["Username"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string Password + { + get + { + return (string)this["Password"]; + } + set + { + this["Password"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string Host + { + get + { + return ((string)(this["Host"])); + } + set + { + this["Host"] = value; + } + } +//================================================================================================== +/// +/// +/// +//================================================================================================== + public string AuthenticationServiceURI + { + get + { + return (string)this["AuthenticationServiceURI"]; + } + set + { + this["AuthenticationServiceURI"] = value; + } + } +#endregion + #region Methods +//================================================================================================== +/// +/// +/// +//================================================================================================== + public void Reset() + { + System.Diagnostics.Debug.WriteLine("here"); + + if (File.Exists("CLI.config")) + { + this.Load("CLI.config"); + } + else if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\" + @"OS\CLI.config")) + { + string configFilePath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\" + @"OS\CLI.config"; + this.Load(configFilePath); + } + else + { + throw new InvalidOperationException("Unable to locate CLI.config file."); + } + } +//================================================================================================== +/// +/// +/// +/// +//================================================================================================== + public void Load (Hashtable settings) + { + foreach (DictionaryEntry entry in settings) { + this.Add(entry.Key, entry.Value); + } + } +//================================================================================================== +/// +/// Fully Qualified path to a config file +/// +/// +//================================================================================================== + public static Settings LoadConfig(string configFilePath) + { + try + { + Settings settings = new Settings(true); + XDocument document = XDocument.Load(configFilePath); + + foreach (XElement element in document.Descendants("add")) + { + string key = element.Attribute(XName.Get("key")).Value; + string value = element.Attribute(XName.Get("value")).Value; + settings.Add(key, value); + } + return settings; + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + throw ex; + } + } +//================================================================================================== +/// +/// Fully Qualified path to a config file +/// +/// +//================================================================================================== + public void Load(string configFilePath) + { + try + { + XDocument document = XDocument.Load(configFilePath); + this.Clear(); + foreach (XElement element in document.Descendants("add")) + { + string key = element.Attribute(XName.Get("key")).Value; + string value = element.Attribute(XName.Get("value")).Value; + this.Add(key, value); + } + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + throw ex; + } + } + #endregion + } +} + diff --git a/Openstack.Client.Powershell/Utility/StoragePath.cs b/Openstack.Client.Powershell/Utility/StoragePath.cs new file mode 100644 index 0000000..654c020 --- /dev/null +++ b/Openstack.Client.Powershell/Utility/StoragePath.cs @@ -0,0 +1,572 @@ +/* ============================================================================ +Copyright 2014 Hewlett Packard + +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. +============================================================================ */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.IO; +using Openstack; +using Openstack.Client.Powershell.Utility; +using System.Collections.ObjectModel; +using Openstack.Common; +using System.Diagnostics.Contracts; +using System.Web; + +namespace Openstack.Client.Powershell.Utility +{ + public class StoragePath + { + const string cFolderMarker = "folder.txt"; + private string _storageManagementURI; + private string _path; + private PathType _pathType; + private string _volume; + private string _fileName; + +//======================================================================================================= +/// +/// +/// +/// The KvsDriveInfo instance +/// The path to the resource +//======================================================================================================= + public StoragePath(string dnsPortion, string volume, string path) + { + Contract.Requires(dnsPortion != null); + Contract.Requires(volume != null); + Contract.Requires(path != null); + + string absoluteURI; + if (volume != "") + absoluteURI = dnsPortion + "/" + volume + "/" + path; + else + absoluteURI = dnsPortion + "/" + path; + + _pathType = this.GetPathType(absoluteURI); + + if (_pathType == PathType.Remote) + { + _storageManagementURI = this.GetPathSubstring(absoluteURI, 2); + string resourcePath = volume + "/" + path; + _volume = volume; + _path = path; + _fileName = System.IO.Path.GetFileName(_path); + } + else + { + _volume = volume; + _path = path; + _fileName = System.IO.Path.GetFileName(_path); + } + _volume = volume; + } +//======================================================================================================= +/// +/// +/// +/// The KvsDriveInfo instance +/// The path to the resource +//======================================================================================================= + public StoragePath(string absoluteURI) + { + this.Initialize(absoluteURI); + } +//======================================================================================================= +/// +/// +/// +/// +//======================================================================================================= + private void Initialize(string absoluteURI) + { + Contract.Requires(absoluteURI != null); + + _pathType = this.GetPathType(absoluteURI); + + if (_pathType == PathType.Remote) + { + _storageManagementURI = this.GetPathSubstring(absoluteURI, 2); + string resourcePath = absoluteURI.Replace(_storageManagementURI, String.Empty).Substring(1); + _volume = StoragePath.GetFirstPathElement(resourcePath); + _path = absoluteURI.Replace(_storageManagementURI + "/" + _volume, String.Empty).Substring(1); + _fileName = System.IO.Path.GetFileName(_path); + } + else + { + _volume = StoragePath.GetFirstPathElement(absoluteURI); + _path = absoluteURI.Replace(_volume, String.Empty).Substring(1); + _fileName = System.IO.Path.GetFileName(_path); + } + } +//================================================================================================== +/// +/// +/// +/// +/// +//================================================================================================== + private string ExtractPattern(string path) + { + path = path.TrimEnd('/'); + string[] elements = path.Split('/'); + return elements[elements.Length - 1]; + } +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + public bool IsRoot + { + get + { + if (this.ContainsWildcard) + + if (this.GetDirectoryName().Replace(this.ExtractPattern(this.Path), String.Empty) == String.Empty) + return true; + else + return false; + return false; + } + } +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + public bool ContainsWildcard + { + get + { + if (this.Path.Contains("?") || this.Path.Contains("*") || this.Path.Contains("[") || this.Path.Contains("]")) + return true; + else + return false; + } + } +//======================================================================================================= +/// +/// +/// +/// +/// +//======================================================================================================= + private string CleanVolumeName(string name) + { + string storageContainerName = name.Replace("/", ""); + int index = storageContainerName.IndexOf(":"); + + if (index != -1) + storageContainerName = storageContainerName.Remove(index, 1); + + return storageContainerName.Replace(@"\", "").Trim(); + } +//======================================================================================================= +/// +/// +/// +/// +/// +//======================================================================================================= + private string CleanPath(string path) + { + string tempPath = path.Replace(@"\", "/"); + + if (path.StartsWith("/")) + { + tempPath = tempPath.Substring(1); + } + + // If this is not a folder path, extract out the filename.. + + if (!tempPath.EndsWith("/")) + { + _fileName = System.IO.Path.GetFileName(tempPath); + } + return tempPath; + } + #region Properties +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + public PathType PathType + { + get { return _pathType; } + //set { _pathType = value; } + } + #endregion + #region Methods +//======================================================================================================= +/// +/// +/// +/// +//======================================================================================================= + public string GetDirectoryName() + { + return System.IO.Path.GetDirectoryName(this.Path); + } +//======================================================================================================= +/// +/// +/// +/// +/// +//======================================================================================================= + private string GetPathSubstring(string element, int offset) + { + bool isSecure = false; + + if (element.StartsWith("https://")) + { + element = element.Replace("https://", string.Empty); + isSecure = true; + } + else + { + element = element.Replace("http://", string.Empty); + } + string [] elements = element.Split('/'); + string result = null; + + for (int i = 0; i <= offset; ++i) { + result = result + "/" + elements[i]; + } + + if (isSecure) + { + return "https:/" + result; + } + else + { + return "http:/" + result; + } + } +//======================================================================================================= +/// +/// +/// +/// +/// +//======================================================================================================= + public static string GetFirstPathElement(string element) + { + if (element != string.Empty) + { + if (element.StartsWith("/")) + { + int delimeterPosition = element.IndexOf("/", 1, StringComparison.Ordinal); + if (delimeterPosition != -1) + return element.Substring(0, delimeterPosition); + else + return null; + } + else + { + int delimeterPosition = element.IndexOf("/", 0, StringComparison.Ordinal); + if (delimeterPosition != -1) + return element.Substring(0, delimeterPosition); + else + { + // No / delimiters exist. This is a local file path with \ as the delimiter so parse with that in mind.. + + int delimeterPosition2 = element.IndexOf(@"\", 0, StringComparison.Ordinal); + if (delimeterPosition2 != -1) + return element.Substring(0, delimeterPosition2); + + } + return null; + } + } + else + { + return null; + } + } +//========================================================================================= +/// +/// +/// +//========================================================================================= + public bool IsFolderPathOnly + { + get + { + if (_path.EndsWith("/") || _path.EndsWith(@"\") || _path == "") + { + return true; + } + else + { + return false; + } + } + } +////========================================================================================= +/// +/// +/// +/// +/// +//========================================================================================= + private bool IsLocalPath(string volume) + { + // Temporaily reverse the delimiter for this check... + + List drives = DriveInfo.GetDrives().ToList(); + + drives.DefaultIfEmpty(null); + if (drives.Where(d => volume.ToUpper().Contains(d.Name)).FirstOrDefault() == null) + { + return false; + } + else + { + return true; + } + } +//======================================================================================================= +/// +/// +/// +/// +/// +//======================================================================================================= + private PathType GetPathType(string absoluteURI) + { + if (absoluteURI.StartsWith("http:") || absoluteURI.StartsWith("https:")) + return PathType.Remote; + else + return PathType.Local; + } +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + public string BasePath + { + get + { + string[] absolutePath = this.AbsoluteURI.Split('/'); + List basePath = new List(); + + //for (int i = 0; i < 3; i++) { + for (int i = 0; i <= absolutePath.Length - 1; i++) + { + basePath.Add(absolutePath[i]); + } + + return String.Join("/", basePath); + } + } +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + public string ContainerPath + { + get + { + return _storageManagementURI + "/" + _volume + "/"; + } + } +//======================================================================================================= +/// +/// +/// - +/// +//======================================================================================================= + public string FileName + { + get + { + if (this.IsFolderPathOnly) + return string.Empty; + else + return _fileName; + } + set + { + string[] tempPath = _path.Split('/'); + tempPath[tempPath.Length - 1] = value; + _path = String.Join("/", tempPath); + _fileName = value; + } + } +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + public string Volume + { + get + { + return _volume; + } + set + { + _volume = value; + } + } +//======================================================================================================= +/// +/// +/// +//======================================================================================================= + public string LeafFolder + { + get + { + string tempPath = null; + if (this.Path.EndsWith("/") || this.Path.EndsWith(@"\")) + { + tempPath = this.Path.Substring(0, this.Path.Count() - 1 ); + } + else + { + tempPath = this.Path; + } + + string[] elements = tempPath.Replace(@"\", "/").Split('/'); + + if (elements.Count() == 1) + { + return elements[0]; + } + else if (elements.Count() == 0) + { + return "/"; + } + else if (elements.Count() > 1) + { + string leaf = elements[elements.Count() - 1]; + return leaf + "/"; + } + return ""; + } + } +//======================================================================================================= +/// +/// This is the address to the Object starting AFTER the storageContainer name. If this points to an object, that +/// object name will still be in this path.. +/// +//======================================================================================================= + public string Path + { + get + { + if (_path.StartsWith(@"\") || _path.StartsWith("/")) + { + return _path.Substring(1); + //return _path; + } + else + { + return _path; + } + } + } +//======================================================================================================= +/// +/// Volume + Path +/// +//======================================================================================================= + public string ResourcePath + { + get + { + if (_pathType == PathType.Remote) + + if (this.Path == "/") + { + //return (this.Volume + "/").Replace(@"\", "/"); + //return ("/").Replace(@"\", "/"); + return String.Empty; + } + else + { + //return (this.Volume + "/" + this.Path).Replace(@"\", "/").Replace("//", "/"); + return (this.Path).Replace(@"\", "/").Replace("//", "/"); + //return this.Path.Replace("/", String.Empty); + } + else + //return this.Volume + @"\" + this.Path; + return this.Path; + } + } +//======================================================================================================= +/// +/// DNS Address + Volume + Path +/// +//======================================================================================================= + public string AbsoluteURI + { + get + { + if (_pathType == PathType.Remote) + { + //return (Settings.Default.StorageManagementURI + "/" + this.ResourcePath).Replace(@"\", "/").Replace(" ", "_"); + + if (this.ResourcePath.StartsWith("/")) + return (_storageManagementURI + this.ResourcePath).Replace(@"\", "/"); + else + return (_storageManagementURI + "/" + this.ResourcePath).Replace(@"\", "/"); + } + else + { + return (this.Volume + @"\" + this.Path).Replace(@"\", "/"); + } + } + } +//======================================================================================================= +/// +/// Returns the fully qualified URI in string format. +/// +/// +//======================================================================================================= + public override string ToString() + { + return this.AbsoluteURI; + } +//======================================================================================================= +/// +/// +/// +/// +//======================================================================================================= + public Uri ToUri() + { + string uri; + + if (this.ResourcePath.StartsWith("/")) + { + uri = _storageManagementURI + this.ResourcePath; + return new Uri(uri); + } + else + { + uri = _storageManagementURI + "/" + this.ResourcePath; + return new Uri(uri); + } + } + #endregion + } +} diff --git a/Openstack.Client.Powershell/app.config b/Openstack.Client.Powershell/app.config new file mode 100644 index 0000000..6193adb --- /dev/null +++ b/Openstack.Client.Powershell/app.config @@ -0,0 +1,15 @@ + + + + +
+ + + + + + C:\Projects\OS\Openstack.Client.Powershell\Openstack.Client.AsyncQueue\Openstack.Client.AsyncQueue\bin\Debug\Openstack.Client.AsyncQueue.exe + + + + diff --git a/Openstack.Client.Powershell/bin/Release/AWSSDK.dll b/Openstack.Client.Powershell/bin/Release/AWSSDK.dll new file mode 100644 index 0000000..d8235cc Binary files /dev/null and b/Openstack.Client.Powershell/bin/Release/AWSSDK.dll differ diff --git a/Openstack.Client.Powershell/bin/Release/AWSSDK.pdb b/Openstack.Client.Powershell/bin/Release/AWSSDK.pdb new file mode 100644 index 0000000..f5d447d Binary files /dev/null and b/Openstack.Client.Powershell/bin/Release/AWSSDK.pdb differ diff --git a/Openstack.Client.Powershell/bin/Release/BouncyCastle.Crypto.dll b/Openstack.Client.Powershell/bin/Release/BouncyCastle.Crypto.dll new file mode 100644 index 0000000..a078d27 Binary files /dev/null and b/Openstack.Client.Powershell/bin/Release/BouncyCastle.Crypto.dll differ diff --git a/Openstack.Client.Powershell/bin/Release/CLIManifest.psd1 b/Openstack.Client.Powershell/bin/Release/CLIManifest.psd1 new file mode 100644 index 0000000..4e9bf61 --- /dev/null +++ b/Openstack.Client.Powershell/bin/Release/CLIManifest.psd1 @@ -0,0 +1,21 @@ +@{ +ModuleToProcess = 'Openstack.Client.Powershell.dll' +GUID="{847a28a4-6407-4aa6-8070-a4a51396db70}" +Author="Travis Plummer" +CompanyName="Hewlett-Packard Corporation" +Copyright="© Hewlett-Packard. All rights reserved." +ModuleVersion="1.0.0.0" +PowerShellVersion="2.0" +CLRVersion="4.0.30319" +FormatsToProcess="OpenstackShell.format.ps1xml" +FileList='CLI.config' +RequiredAssemblies = 'Openstack.dll', 'Openstack.Common.dll' + +} + + + + + + + diff --git a/Openstack.Client.Powershell/bin/Release/Deployment/Aliases.txt b/Openstack.Client.Powershell/bin/Release/Deployment/Aliases.txt new file mode 100644 index 0000000..87e8b52 Binary files /dev/null and b/Openstack.Client.Powershell/bin/Release/Deployment/Aliases.txt differ diff --git a/Openstack.Client.Powershell/bin/Release/Deployment/CLI.config b/Openstack.Client.Powershell/bin/Release/Deployment/CLI.config new file mode 100644 index 0000000..5432181 --- /dev/null +++ b/Openstack.Client.Powershell/bin/Release/Deployment/CLI.config @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Openstack.Client.Powershell/bin/Release/Deployment/CLI.config.example b/Openstack.Client.Powershell/bin/Release/Deployment/CLI.config.example new file mode 100644 index 0000000..8445b81 --- /dev/null +++ b/Openstack.Client.Powershell/bin/Release/Deployment/CLI.config.example @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Openstack.Client.Powershell/bin/Release/Deployment/CLIManifest.psd1 b/Openstack.Client.Powershell/bin/Release/Deployment/CLIManifest.psd1 new file mode 100644 index 0000000..4e9bf61 --- /dev/null +++ b/Openstack.Client.Powershell/bin/Release/Deployment/CLIManifest.psd1 @@ -0,0 +1,21 @@ +@{ +ModuleToProcess = 'Openstack.Client.Powershell.dll' +GUID="{847a28a4-6407-4aa6-8070-a4a51396db70}" +Author="Travis Plummer" +CompanyName="Hewlett-Packard Corporation" +Copyright="© Hewlett-Packard. All rights reserved." +ModuleVersion="1.0.0.0" +PowerShellVersion="2.0" +CLRVersion="4.0.30319" +FormatsToProcess="OpenstackShell.format.ps1xml" +FileList='CLI.config' +RequiredAssemblies = 'Openstack.dll', 'Openstack.Common.dll' + +} + + + + + + + diff --git a/Openstack.Client.Powershell/bin/Release/Deployment/Microsoft.PowerShell_profile.ps1 b/Openstack.Client.Powershell/bin/Release/Deployment/Microsoft.PowerShell_profile.ps1 new file mode 100644 index 0000000..cb8fbd2 --- /dev/null +++ b/Openstack.Client.Powershell/bin/Release/Deployment/Microsoft.PowerShell_profile.ps1 @@ -0,0 +1,81 @@ +# --------------------------------------------------------------- +# Set up support methods first.. +# --------------------------------------------------------------- + + function is64bit() { + return ([IntPtr]::Size -eq 8) + } + + function get-programfilesdir() { + if (is64bit -eq $true) { + (Get-Item "Env:ProgramFiles(x86)").Value + } + else { + (Get-Item "Env:ProgramFiles").Value + } + } +# --------------------------------------------------------------- +# Set up the default windows size and color.... +# --------------------------------------------------------------- + + #$DebugPreference=$VerbosePreference="Continue" + #$DebugPreference = "Continue" + $a = (Get-Host).UI.RawUI + $b = $a.WindowSize + $b.Width = 109 + $b.Height = 61 + $a.WindowSize = $b + $a.BackgroundColor = "black" + $a.ForegroundColor = "green" + + cls +# --------------------------------------------------------------- +# Register known providers, write out welcome and status messages.. +# ----------------------------------------------------------------- + + $a.BackgroundColor = "black" + Echo '' + $a.ForegroundColor = "gray" + Echo '========================================================================================' + $a.ForegroundColor = "yellow" + Echo 'Welcome to the OpenStack Powershell Environment.' + $a.ForegroundColor = "gray" + Echo '========================================================================================' + Echo '' + $a.ForegroundColor = "green" + echo ' ==> Registering Providers...' + + $tempvar = get-programfilesdir + $tempvar = $tempvar + "\Openstack\OpenStack-Powershell" + cd $tempvar + import-module .\CLIManifest.psd1 -DisableNameChecking + + echo ' ==> Applying Command Aliases...' + echo ' ==> Registering Views...' + echo '' + +# --------------------------------------------------------------- +# Reset Shell to default colors.. +# --------------------------------------------------------------- + + $a.ForegroundColor = "yellow" + echo 'Ready..' + $a.ForegroundColor = "green" + echo '' + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Openstack.Client.Powershell/bin/Release/Deployment/OpenstackShell.format.ps1xml b/Openstack.Client.Powershell/bin/Release/Deployment/OpenstackShell.format.ps1xml new file mode 100644 index 0000000..e9597e8 --- /dev/null +++ b/Openstack.Client.Powershell/bin/Release/Deployment/OpenstackShell.format.ps1xml @@ -0,0 +1,1729 @@ + + + + + + + service + + Openstack.Objects.Domain.Admin.Zone + + + + + + + 8 + left + + + + 20 + left + + + + 23 + left + + + + 10 + left + + + + + + + + Id + + + Name + + + ShellForegroundColor + + + IsDefault + + + + + + + + + service + + Openstack.Objects.Domain.BlockStorage.Snapshot + + + + + + + 3 + left + + + + 40 + left + + + + 20 + left + + + + 40 + left + + + + 22 + left + + + + 18 + left + + + + 7 + left + + + + 40 + left + + + + + + + QuickPickNumber + + + Id + + + DisplayName + + + Description + + + CreationDate + + + Status + + + Size + + + VolumeId + + + + + + + + + + + service + + Openstack.Objects.Domain.BlockStorage.VolumeBackup + + + + + + 3 + left + + + + 45 + left + + + + 20 + left + + + + 20 + left + + + + 8 + left + + + + 10 + left + + + + 10 + left + + + + 28 + left + + + + 18 + left + + + + 42 + left + + + + + + + QuickPickNumber + + + Id + + + Name + + + Container + + + Size + + + Status + + + AvailabilityZone + + + CreatedDate + + + ObjectCount + + + VolumeId + + + + + + + + + + service + + Openstack.Objects.Domain.BlockStorage.Volume + + + + + + 3 + left + + + + 45 + left + + + + 20 + left + + + + 30 + left + + + + 6 + left + + + + 8 + left + + + + 8 + left + + + + 22 + left + + + + 10 + left + + + + 10 + left + + + + 10 + left + + + + 30 + left + + + + 40 + left + + + + + + + QuickPickNumber + + + Id + + + Name + + + Description + + + VolumeType + + + Size + + + IsBootable + + + CreationDate + + + Status + + + AvailabilityZone + + + Device + + + AttachedTo + + + SourceVolid + + + + + + + + + KeyPair + + Openstack.Objects.Domain.Server.KeyPair + + + + + + + 40 + left + + + + + 50 + left + + + + + 330 + left + + + + + + + + + + Name + + + + Fingerprint + + + + PublicKey + + + + + + + + + + + + + Port + + Openstack.Objects.Domain.Networking.Port + + + + + + + + 3 + left + + + + + 40 + left + + + + + 13 + left + + + + + 6 + left + + + + 16 + left + + + + 25 + left + + + + 40 + left + + + + 40 + left + + + + 21 + left + + + + 16 + left + + + + + + + + + QuickPickNumber + + + Id + + + Name + + + Status + + + AdminStateUp + + + MacAddress + + + DeviceOwner + + + DeviceId + + + PortSecurityEnabled + + + BindingType + + + + + + + + + + Subnet + + Openstack.Objects.Domain.Networking.Subnet + + + + + + + 3 + left + + + + + 40 + left + + + + + 34 + left + + + + + 7 + left + + + + 24 + left + + + + 11 + left + + + + 24 + left + + + + + + + QuickPickNumber + + + Id + + + Name + + + EnableDHCP + + + Cidr + + + IPVersion + + + GatewayIP + + + + + + + + + service + + Openstack.Client.Powershell.Utility.ServiceProvider + + + + + + 15 + left + + + + 80 + left + + + + 7 + left + + + + 30 + left + + + + + + + Name + + + AuthenticationServiceURI + + + IsDefault + + + + DefaultTenantId + + + + + + + + + service + + Openstack.Objects.Domain.Networking.FloatingIP + + + + + + + 3 + left + + + + + 42 + left + + + + + 20 + left + + + + + 42 + left + + + + + 15 + left + + + + + 15 + left + + + + + 15 + left + + + + + + + + + + QuickPickNumber + + + + Id + + + + FloatingIPAddress + + + + FloatingNetworkId + + + + FixedIPAddress + + + + PortId + + + + RouterId + + + + + + + + + + StorageContainer + + Openstack.Objects.Domain.StorageContainer + + + + + + 40 + left + + + + + + + Name + + + + + + + + + Network + + Openstack.Objects.Domain.Networking.Network + + + + + + + + 3 + left + + + + + 40 + left + + + + + 13 + left + + + + + 6 + left + + + + + 6 + left + + + + + 6 + left + + + + + + + + + + QuickPickNumber + + + + Id + + + + Name + + + + IsExternal + + + + Shared + + + + PortSecurityEnabled + + + + + + + + + + service + + Openstack.Objects.Domain.Admin.Service + + + + + + + 20 + left + + + + + 27 + left + + + + + + + + + + Type + + + + Name + + + + + + + + + + process4 + + Openstack.Client.Powershell.Providers.ObjectStorage.StorageItemModelView + + + + + + 47 + left + + + + 13 + left + + + + 25 + left + + + + 40 + left + + + + + + + Name + + + Size + + + LastModifiedDate + + + Type + + + + + + + + + + process4 + + Openstack.Storage.StorageObject + + + + + + 47 + left + + + + 13 + left + + + + 25 + left + + + + 40 + left + + + + + + + Name + + + Length + + + LastModified + + + ContentType + + + + + + + + + process5 + + Openstack.Storage.StorageFolder + + + + + + 47 + left + + + + + 40 + left + + + + + + + Name + + + + ContentType + + + + + + + + + Router + + Openstack.Objects.Domain.Networking.Router + + + + + + + 3 + left + + + + + 40 + left + + + + 47 + left + + + + + 13 + left + + + + + 14 + left + + + + + + + + + + + QuickPickNumber + + + + Id + + + Name + + + + Status + + + AdminStateUp + + + + + + + + + + + process + + Openstack.Client.Powershell.Providers.Common.BaseUIContainer + + + + + + + 15 + left + + + + + 100 + left + + + + + 13 + left + + + + + 40 + left + + + + + + + + + Name + + + + Description + + + ObjectType + + + Path + + + + + + + + + process + + Openstack.Administration.Domain.User + + + + + + + 15 + left + + + + + 20 + left + + + + + 20 + left + + + + + + + + + AccountId + + + + Username + + + Name + + + + + + + + + + process + + Openstack.Objects.Domain.Compute.Account + + + + + + + 15 + left + + + + + 20 + left + + + + + + + + + + Id + + + Name + + + + + + + + + + process + + Openstack.Administration.Domain.Group + + + + + + + 40 + left + + + + + 26 + left + + + + + 50 + left + + + + + + + + + GroupId + + + + Name + + + Description + + + + + + + + + + process + + Openstack.Objects.Domain.Compute.Server + + + + + + + + 3 + left + + + + + 40 + left + + + + + 40 + left + + + + + + 30 + left + + + + 25 + left + + + + 10 + left + + + + 15 + left + + + + + 100 + left + + + + + + + + QuickPickNumber + + + Id + + + + Name + + + CreationDate + + + LastUpdatedDate + + + KeyName + + + Status + + + DisplayIPAddresses + + + + + + + + + + + process + + Openstack.Objects.Domain.Compute.Image + + + + + + + + 3 + left + + + + + 40 + left + + + + + 70 + left + + + + + 25 + left + + + + + 25 + left + + + + + 15 + left + + + + + + + + + QuickPickNumber + + + + Id + + + + Name + + + + LastModified + + + + CreatedDate + + + + Status + + + + + + + + + + + process + + System.Collections.DictionaryEntry + + + + + + + 30 + left + + + + + 320 + left + + + + + + + + + + + Key + + + + Value + + + + + + + + + + + process + + Openstack.Objects.Domain.Security.SecurityGroup + + + + + + + 3 + left + + + + + 40 + left + + + + + 40 + left + + + + + 90 + left + + + + + 15 + left + + + + + + + + + QuickPickNumber + + + + Id + + + + Name + + + + Description + + + + TenantId + + + + + + + + + + + process + + Openstack.Objects.Domain.Compute.MetaDataElement + + + + + + + 20 + left + + + + + 20 + left + + + + + + + + + + + Key + + + + Value + + + + + + + + + + + + flavor + + Openstack.Objects.Domain.Compute.Flavor + + + + + + + 8 + left + + + + + 26 + left + + + + + 5 + left + + + + + 10 + left + + + + + + 11 + left + + + + + 11 + left + + + + + 5 + left + + + + + 5 + left + + + + + + + + + + + + + + Id + + + + Name + + + Disk + + + Ram + + + + RxtxCap + + + + RxtxQuota + + + + Swap + + + + Vcpus + + + + + + + + + + diff --git a/Openstack.Client.Powershell/bin/Release/Deployment/ReleaseNotes.xml b/Openstack.Client.Powershell/bin/Release/Deployment/ReleaseNotes.xml new file mode 100644 index 0000000..b6571b6 --- /dev/null +++ b/Openstack.Client.Powershell/bin/Release/Deployment/ReleaseNotes.xml @@ -0,0 +1,47 @@ + + + + + New Features + * Easier Zone management with Set-Zone and Get-Zones + + + + + + New Features + * Easier Zone management with Set-Zone and Get-Zones + + + + + + New Features + * Easier Zone management with Set-Zone and Get-Zones + + + + + + New Features + * Support for listing, adding, attaching, detaching and removing block volumes + * Support for creating and removing block storage snapshots + + + + + + New Features + * Migrate-Drive support for migrating full data sets from external sources + + + + + + New Features + * Full access to the OpenStack compute infrastructure + * CDN support + + + + diff --git a/Openstack.Client.Powershell/bin/Release/Deployment/ScratchPad/AnotherTest.txt b/Openstack.Client.Powershell/bin/Release/Deployment/ScratchPad/AnotherTest.txt new file mode 100644 index 0000000..103d384 --- /dev/null +++ b/Openstack.Client.Powershell/bin/Release/Deployment/ScratchPad/AnotherTest.txt @@ -0,0 +1,92 @@ +==================================================================================================================== +/// +/// +/// +/// +/// +/// +//====================================================================================================================== + public StorageObject GetStorageObject(string path) + { + try + { + path = path.Replace(@"\", "/"); + RequestHeaders headers = StorageRequestSigner.CreateSignedHeaders(HttpMethod.GET, path); + string resourcePath = ["StorageManagementURI"] + "/" + path; + HttpClient client = new HttpClient(); + client.DefaultHeaders = headers; + + Uri uri = new Uri(resourcePath); + HttpResponseMessage msg = client.Get(uri); + + if (msg.StatusCode == System.Net.HttpStatusCode.OK) + { + msg.Content.LoadIntoBufferAsync(); + StorageObject storageObject = new StorageObject(); + storageObject.Key = path; + storageObject.Load(msg.Content.ReadAsStream()); + this.CopyCommonRequestHeaders(ref storageObject, msg.Headers); + return storageObject; + } + else + { + return null; + } + } + catch (Exception ex) + { + Console.WriteLine(ex); + } + return null; + } +//====================================================================================================================== +/// +/// +/// +/// +/// +//====================================================================================================================== + public bool IsValidPath(string storageContainer, string path) + { + HttpClient client = new HttpClient(); + Uri uri = new Uri(["StorageManagementURI"] + cDelimiter + storageContainer + cDelimiter + path + cDelimiter + "folder.txt"); + string rootCheck = null; + + if (path == cDelimiter) { + rootCheck = String.Empty; + } + else { + rootCheck = cFolderMarker; + } + + + if (this.GetStorageObject(storageContainer + cDelimiter + path + cDelimiter + rootCheck) != null) + { + return true; + } + else + { + return false; + } + } +//====================================================================================================================== +/// +/// +/// +/// +//====================================================================================================================== + public StorageObjects GetStorageObjects (string storageContainer, string path) + { + HttpQueryString queryString = new HttpQueryString(); + + if (path == "") + { + queryString.Add("prefix", "" ); + queryString.Add("delimiter", "/"); + } + else + { + path = path.Replace(@"\", "/"); + queryString.Add("prefix", path); + queryString.Add("delimiter", "/"); + } \ No newline at end of file diff --git a/Openstack.Client.Powershell/bin/Release/Microsoft.ComponentModel.Composition.Diagnostics.dll b/Openstack.Client.Powershell/bin/Release/Microsoft.ComponentModel.Composition.Diagnostics.dll new file mode 100644 index 0000000..3503ee3 Binary files /dev/null and b/Openstack.Client.Powershell/bin/Release/Microsoft.ComponentModel.Composition.Diagnostics.dll differ diff --git a/Openstack.Client.Powershell/bin/Release/MyPackage.1.0.0.nupkg b/Openstack.Client.Powershell/bin/Release/MyPackage.1.0.0.nupkg new file mode 100644 index 0000000..9ec0010 Binary files /dev/null and b/Openstack.Client.Powershell/bin/Release/MyPackage.1.0.0.nupkg differ diff --git a/Openstack.Client.Powershell/bin/Release/Newtonsoft.Json.dll b/Openstack.Client.Powershell/bin/Release/Newtonsoft.Json.dll new file mode 100644 index 0000000..1c16c11 Binary files /dev/null and b/Openstack.Client.Powershell/bin/Release/Newtonsoft.Json.dll differ diff --git a/Openstack.Client.Powershell/bin/Release/Newtonsoft.Json.xml b/Openstack.Client.Powershell/bin/Release/Newtonsoft.Json.xml new file mode 100644 index 0000000..e91d694 --- /dev/null +++ b/Openstack.Client.Powershell/bin/Release/Newtonsoft.Json.xml @@ -0,0 +1,7583 @@ + + + + Newtonsoft.Json + + + + + Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. + + + + + Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. + + + + + Initializes a new instance of the class with the specified . + + + + + Reads the next JSON token from the stream. + + true if the next token was read successfully; false if there are no more tokens to read. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A or a null reference if the next JSON token is null. This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Skips the children of the current token. + + + + + Sets the current token. + + The new token. + + + + Sets the current token and value. + + The new token. + The value. + + + + Sets the state based on current token type. + + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Changes the to Closed. + + + + + Gets the current reader state. + + The current reader state. + + + + Gets or sets a value indicating whether the underlying stream or + should be closed when the reader is closed. + + + true to close the underlying stream or when + the reader is closed; otherwise false. The default is true. + + + + + Gets the quotation mark character used to enclose the value of a string. + + + + + Get or set how time zones are handling when reading JSON. + + + + + Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. + + + + + Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . + + + + + Gets the type of the current JSON token. + + + + + Gets the text value of the current JSON token. + + + + + Gets The Common Language Runtime (CLR) type for the current JSON token. + + + + + Gets the depth of the current token in the JSON document. + + The depth of the current token in the JSON document. + + + + Gets the path of the current JSON token. + + + + + Gets or sets the culture used when reading JSON. Defaults to . + + + + + Specifies the state of the reader. + + + + + The Read method has not been called. + + + + + The end of the file has been reached successfully. + + + + + Reader is at a property. + + + + + Reader is at the start of an object. + + + + + Reader is in an object. + + + + + Reader is at the start of an array. + + + + + Reader is in an array. + + + + + The Close method has been called. + + + + + Reader has just read a value. + + + + + Reader is at the start of a constructor. + + + + + Reader in a constructor. + + + + + An error occurred that prevents the read operation from continuing. + + + + + The end of the file has been reached successfully. + + + + + Initializes a new instance of the class. + + The stream. + + + + Initializes a new instance of the class. + + The reader. + + + + Initializes a new instance of the class. + + The stream. + if set to true the root object will be read as a JSON array. + The used when reading values from BSON. + + + + Initializes a new instance of the class. + + The reader. + if set to true the root object will be read as a JSON array. + The used when reading values from BSON. + + + + Reads the next JSON token from the stream as a . + + + A or a null reference if the next JSON token is null. This method will return null at the end of an array. + + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + + A . This method will return null at the end of an array. + + + + + Reads the next JSON token from the stream. + + + true if the next token was read successfully; false if there are no more tokens to read. + + + + + Changes the to Closed. + + + + + Gets or sets a value indicating whether binary data reading should compatible with incorrect Json.NET 3.5 written binary. + + + true if binary data reading will be compatible with incorrect Json.NET 3.5 written binary; otherwise, false. + + + + + Gets or sets a value indicating whether the root object will be read as a JSON array. + + + true if the root object will be read as a JSON array; otherwise, false. + + + + + Gets or sets the used when reading values from BSON. + + The used when reading values from BSON. + + + + Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. + + + + + Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. + + + + + Creates an instance of the JsonWriter class. + + + + + Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. + + + + + Closes this stream and the underlying stream. + + + + + Writes the beginning of a Json object. + + + + + Writes the end of a Json object. + + + + + Writes the beginning of a Json array. + + + + + Writes the end of an array. + + + + + Writes the start of a constructor with the given name. + + The name of the constructor. + + + + Writes the end constructor. + + + + + Writes the property name of a name/value pair on a Json object. + + The name of the property. + + + + Writes the end of the current Json object or array. + + + + + Writes the current token. + + The to read the token from. + + + + Writes the specified end token. + + The end token to write. + + + + Writes indent characters. + + + + + Writes the JSON value delimiter. + + + + + Writes an indent space. + + + + + Writes a null value. + + + + + Writes an undefined value. + + + + + Writes raw JSON without changing the writer's state. + + The raw JSON to write. + + + + Writes raw JSON where a value is expected and updates the writer's state. + + The raw JSON to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + An error will raised if the value cannot be written as a single JSON token. + + The value to write. + + + + Writes out a comment /*...*/ containing the specified text. + + Text to place inside the comment. + + + + Writes out the given white space. + + The string of white space characters. + + + + Gets or sets a value indicating whether the underlying stream or + should be closed when the writer is closed. + + + true to close the underlying stream or when + the writer is closed; otherwise false. The default is true. + + + + + Gets the top. + + The top. + + + + Gets the state of the writer. + + + + + Gets the path of the writer. + + + + + Indicates how JSON text output is formatted. + + + + + Get or set how dates are written to JSON text. + + + + + Get or set how time zones are handling when writing JSON. + + + + + Initializes a new instance of the class. + + The stream. + + + + Initializes a new instance of the class. + + The writer. + + + + Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. + + + + + Writes the end. + + The token. + + + + Writes out a comment /*...*/ containing the specified text. + + Text to place inside the comment. + + + + Writes the start of a constructor with the given name. + + The name of the constructor. + + + + Writes raw JSON. + + The raw JSON to write. + + + + Writes raw JSON where a value is expected and updates the writer's state. + + The raw JSON to write. + + + + Writes the beginning of a Json array. + + + + + Writes the beginning of a Json object. + + + + + Writes the property name of a name/value pair on a Json object. + + The name of the property. + + + + Closes this stream and the underlying stream. + + + + + Writes a null value. + + + + + Writes an undefined value. + + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value that represents a BSON object id. + + + + + + Writes a BSON regex. + + The regex pattern. + The regex options. + + + + Gets or sets the used when writing values to BSON. + When set to no conversion will occur. + + The used when writing values to BSON. + + + + Represents a BSON Oid (object id). + + + + + Initializes a new instance of the class. + + The Oid value. + + + + Gets or sets the value of the Oid. + + The value of the Oid. + + + + Converts a binary value to and from a base 64 string value. + + + + + Converts an object to and from JSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Gets the of the JSON produced by the JsonConverter. + + The of the JSON produced by the JsonConverter. + + + + Gets a value indicating whether this can read JSON. + + true if this can read JSON; otherwise, false. + + + + Gets a value indicating whether this can write JSON. + + true if this can write JSON; otherwise, false. + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Converts a to and from JSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified value type. + + Type of the value. + + true if this instance can convert the specified value type; otherwise, false. + + + + + Converts a to and from JSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified value type. + + Type of the value. + + true if this instance can convert the specified value type; otherwise, false. + + + + + Create a custom object + + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Creates an object which will then be populated by the serializer. + + Type of the object. + + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Gets a value indicating whether this can write JSON. + + + true if this can write JSON; otherwise, false. + + + + + Provides a base class for converting a to and from JSON. + + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Converts an Entity Framework EntityKey to and from JSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Converts an ExpandoObject to and from JSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Gets a value indicating whether this can write JSON. + + + true if this can write JSON; otherwise, false. + + + + + Converts a to and from JSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Converts a to and from JSON and BSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Converts a to and from JSON and BSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Converts an to and from its name string value. + + + Converts an to and from its name string value. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + A cached representation of the Enum string representation to respect per Enum field name. + + The type of the Enum. + A map of enum field name to either the field name, or the configured enum member name (). + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Gets or sets a value indicating whether the written enum text should be camel case. + + true if the written enum text will be camel case; otherwise, false. + + + + Specifies how constructors are used when initializing objects during deserialization by the . + + + + + First attempt to use the public default constructor, then fall back to single paramatized constructor, then the non-public default constructor. + + + + + Json.NET will use a non-public default constructor before falling back to a paramatized constructor. + + + + + Converts a to and from a string (e.g. "1.2.3.4"). + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing property value of the JSON that is being converted. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Instructs the how to serialize the collection. + + + + + Instructs the how to serialize the object. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with the specified container Id. + + The container Id. + + + + Gets or sets the id. + + The id. + + + + Gets or sets the title. + + The title. + + + + Gets or sets the description. + + The description. + + + + Gets the collection's items converter. + + The collection's items converter. + + + + Gets or sets a value that indicates whether to preserve object references. + + + true to keep object reference; otherwise, false. The default is false. + + + + + Gets or sets a value that indicates whether to preserve collection's items references. + + + true to keep collection's items object references; otherwise, false. The default is false. + + + + + Gets or sets the reference loop handling used when serializing the collection's items. + + The reference loop handling. + + + + Gets or sets the type name handling used when serializing the collection's items. + + The type name handling. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with the specified container Id. + + The container Id. + + + + The exception thrown when an error occurs during Json serialization or deserialization. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class + with a specified error message. + + The error message that explains the reason for the exception. + + + + Initializes a new instance of the class + with a specified error message and a reference to the inner exception that is the cause of this exception. + + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. + + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + The parameter is null. + The class name is null or is zero (0). + + + + Specifies how dates are formatted when writing JSON text. + + + + + Dates are written in the ISO 8601 format, e.g. "2012-03-21T05:40Z". + + + + + Dates are written in the Microsoft JSON format, e.g. "\/Date(1198908717056)\/". + + + + + Specifies how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON text. + + + + + Date formatted strings are not parsed to a date type and are read as strings. + + + + + Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . + + + + + Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . + + + + + Specifies how to treat the time value when converting between string and . + + + + + Treat as local time. If the object represents a Coordinated Universal Time (UTC), it is converted to the local time. + + + + + Treat as a UTC. If the object represents a local time, it is converted to a UTC. + + + + + Treat as a local time if a is being converted to a string. + If a string is being converted to , convert to a local time if a time zone is specified. + + + + + Time zone information should be preserved when converting. + + + + + Specifies formatting options for the . + + + + + No special formatting is applied. This is the default. + + + + + Causes child objects to be indented according to the and settings. + + + + + Instructs the to use the specified constructor when deserializing that object. + + + + + Contract details for a used by the . + + + + + Contract details for a used by the . + + + + + Gets the underlying type for the contract. + + The underlying type for the contract. + + + + Gets or sets the type created during deserialization. + + The type created during deserialization. + + + + Gets or sets whether this type contract is serialized as a reference. + + Whether this type contract is serialized as a reference. + + + + Gets or sets the default for this contract. + + The converter. + + + + Gets or sets the method called immediately after deserialization of the object. + + The method called immediately after deserialization of the object. + + + + Gets or sets the method called during deserialization of the object. + + The method called during deserialization of the object. + + + + Gets or sets the method called after serialization of the object graph. + + The method called after serialization of the object graph. + + + + Gets or sets the method called before serialization of the object. + + The method called before serialization of the object. + + + + Gets or sets the default creator method used to create the object. + + The default creator method used to create the object. + + + + Gets or sets a value indicating whether the default creator is non public. + + true if the default object creator is non-public; otherwise, false. + + + + Gets or sets the method called when an error is thrown during the serialization of the object. + + The method called when an error is thrown during the serialization of the object. + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Gets or sets the default collection items . + + The converter. + + + + Gets or sets a value indicating whether the collection items preserve object references. + + true if collection items preserve object references; otherwise, false. + + + + Gets or sets the collection item reference loop handling. + + The reference loop handling. + + + + Gets or sets the collection item type name handling. + + The type name handling. + + + + Represents a raw JSON string. + + + + + Represents a value in JSON (string, integer, date, etc). + + + + + Represents an abstract JSON token. + + + + + Represents a collection of objects. + + The type of token + + + + Gets the with the specified key. + + + + + + Provides an interface to enable a class to return line and position information. + + + + + Gets a value indicating whether the class can return line information. + + + true if LineNumber and LinePosition can be provided; otherwise, false. + + + + + Gets the current line number. + + The current line number or 0 if no line information is available (for example, HasLineInfo returns false). + + + + Gets the current line position. + + The current line position or 0 if no line information is available (for example, HasLineInfo returns false). + + + + Compares the values of two tokens, including the values of all descendant tokens. + + The first to compare. + The second to compare. + true if the tokens are equal; otherwise false. + + + + Adds the specified content immediately after this token. + + A content object that contains simple content or a collection of content objects to be added after this token. + + + + Adds the specified content immediately before this token. + + A content object that contains simple content or a collection of content objects to be added before this token. + + + + Returns a collection of the ancestor tokens of this token. + + A collection of the ancestor tokens of this token. + + + + Returns a collection of the sibling tokens after this token, in document order. + + A collection of the sibling tokens after this tokens, in document order. + + + + Returns a collection of the sibling tokens before this token, in document order. + + A collection of the sibling tokens before this token, in document order. + + + + Gets the with the specified key converted to the specified type. + + The type to convert the token to. + The token key. + The converted token value. + + + + Returns a collection of the child tokens of this token, in document order. + + An of containing the child tokens of this , in document order. + + + + Returns a collection of the child tokens of this token, in document order, filtered by the specified type. + + The type to filter the child tokens on. + A containing the child tokens of this , in document order. + + + + Returns a collection of the child values of this token, in document order. + + The type to convert the values to. + A containing the child values of this , in document order. + + + + Removes this token from its parent. + + + + + Replaces this token with the specified token. + + The value. + + + + Writes this token to a . + + A into which this method will write. + A collection of which will be used when writing the token. + + + + Returns the indented JSON for this token. + + + The indented JSON for this token. + + + + + Returns the JSON for this token using the given formatting and converters. + + Indicates how the output is formatted. + A collection of which will be used when writing the token. + The JSON for this token using the given formatting and converters. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Creates an for this token. + + An that can be used to read this token and its descendants. + + + + Creates a from an object. + + The object that will be used to create . + A with the value of the specified object + + + + Creates a from an object using the specified . + + The object that will be used to create . + The that will be used when reading the object. + A with the value of the specified object + + + + Creates the specified .NET type from the . + + The new object created from the JSON value. + + + + Creates the specified .NET type from the using the specified . + + The that will be used when creating the object. + The new object created from the JSON value. + + + + Creates a from a . + + An positioned at the token to read into this . + + An that contains the token and its descendant tokens + that were read from the reader. The runtime type of the token is determined + by the token type of the first token encountered in the reader. + + + + + Load a from a string that contains JSON. + + A that contains JSON. + A populated from the string that contains JSON. + + + + Creates a from a . + + An positioned at the token to read into this . + + An that contains the token and its descendant tokens + that were read from the reader. The runtime type of the token is determined + by the token type of the first token encountered in the reader. + + + + + Selects the token that matches the object path. + + + The object path from the current to the + to be returned. This must be a string of property names or array indexes separated + by periods, such as Tables[0].DefaultView[0].Price in C# or + Tables(0).DefaultView(0).Price in Visual Basic. + + The that matches the object path or a null reference if no matching token is found. + + + + Selects the token that matches the object path. + + + The object path from the current to the + to be returned. This must be a string of property names or array indexes separated + by periods, such as Tables[0].DefaultView[0].Price in C# or + Tables(0).DefaultView(0).Price in Visual Basic. + + A flag to indicate whether an error should be thrown if no token is found. + The that matches the object path. + + + + Returns the responsible for binding operations performed on this object. + + The expression tree representation of the runtime value. + + The to bind this object. + + + + + Returns the responsible for binding operations performed on this object. + + The expression tree representation of the runtime value. + + The to bind this object. + + + + + Creates a new instance of the . All child tokens are recursively cloned. + + A new instance of the . + + + + Gets a comparer that can compare two tokens for value equality. + + A that can compare two nodes for value equality. + + + + Gets or sets the parent. + + The parent. + + + + Gets the root of this . + + The root of this . + + + + Gets the node type for this . + + The type. + + + + Gets a value indicating whether this token has childen tokens. + + + true if this token has child values; otherwise, false. + + + + + Gets the next sibling token of this node. + + The that contains the next sibling token. + + + + Gets the previous sibling token of this node. + + The that contains the previous sibling token. + + + + Gets the with the specified key. + + The with the specified key. + + + + Get the first child token of this token. + + A containing the first child token of the . + + + + Get the last child token of this token. + + A containing the last child token of the . + + + + Initializes a new instance of the class from another object. + + A object to copy from. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Creates a comment with the given value. + + The value. + A comment with the given value. + + + + Creates a string with the given value. + + The value. + A string with the given value. + + + + Writes this token to a . + + A into which this method will write. + A collection of which will be used when writing the token. + + + + Indicates whether the current object is equal to another object of the same type. + + + true if the current object is equal to the parameter; otherwise, false. + + An object to compare with this object. + + + + Determines whether the specified is equal to the current . + + The to compare with the current . + + true if the specified is equal to the current ; otherwise, false. + + + The parameter is null. + + + + + Serves as a hash function for a particular type. + + + A hash code for the current . + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format provider. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + The format provider. + + A that represents this instance. + + + + + Returns the responsible for binding operations performed on this object. + + The expression tree representation of the runtime value. + + The to bind this object. + + + + + Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. + + An object to compare with this instance. + + A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: + Value + Meaning + Less than zero + This instance is less than . + Zero + This instance is equal to . + Greater than zero + This instance is greater than . + + + is not the same type as this instance. + + + + + Gets a value indicating whether this token has childen tokens. + + + true if this token has child values; otherwise, false. + + + + + Gets the node type for this . + + The type. + + + + Gets or sets the underlying token value. + + The underlying token value. + + + + Initializes a new instance of the class from another object. + + A object to copy from. + + + + Initializes a new instance of the class. + + The raw json. + + + + Creates an instance of with the content of the reader's current token. + + The reader. + An instance of with the content of the reader's current token. + + + + Indicating whether a property is required. + + + + + The property is not required. The default state. + + + + + The property must be defined in JSON but can be a null value. + + + + + The property must be defined in JSON and cannot be a null value. + + + + + Contract details for a used by the . + + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Gets the object's properties. + + The object's properties. + + + + Gets or sets the property name resolver. + + The property name resolver. + + + + Contract details for a used by the . + + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Gets or sets the ISerializable object constructor. + + The ISerializable object constructor. + + + + Contract details for a used by the . + + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Contract details for a used by the . + + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Get and set values for a using dynamic methods. + + + + + Provides methods to get and set values. + + + + + Sets the value. + + The target to set the value on. + The value to set on the target. + + + + Gets the value. + + The target to get the value from. + The value. + + + + Initializes a new instance of the class. + + The member info. + + + + Sets the value. + + The target to set the value on. + The value to set on the target. + + + + Gets the value. + + The target to get the value from. + The value. + + + + Provides data for the Error event. + + + + + Initializes a new instance of the class. + + The current object. + The error context. + + + + Gets the current object the error event is being raised against. + + The current object the error event is being raised against. + + + + Gets the error context. + + The error context. + + + + Represents a view of a . + + + + + Initializes a new instance of the class. + + The name. + Type of the property. + + + + When overridden in a derived class, returns whether resetting an object changes its value. + + + true if resetting the component changes its value; otherwise, false. + + The component to test for reset capability. + + + + + When overridden in a derived class, gets the current value of the property on a component. + + + The value of a property for a given component. + + The component with the property for which to retrieve the value. + + + + + When overridden in a derived class, resets the value for this property of the component to the default value. + + The component with the property value that is to be reset to the default value. + + + + + When overridden in a derived class, sets the value of the component to a different value. + + The component with the property value that is to be set. + The new value. + + + + + When overridden in a derived class, determines a value indicating whether the value of this property needs to be persisted. + + + true if the property should be persisted; otherwise, false. + + The component with the property to be examined for persistence. + + + + + When overridden in a derived class, gets the type of the component this property is bound to. + + + A that represents the type of component this property is bound to. When the or methods are invoked, the object specified might be an instance of this type. + + + + + When overridden in a derived class, gets a value indicating whether this property is read-only. + + + true if the property is read-only; otherwise, false. + + + + + When overridden in a derived class, gets the type of the property. + + + A that represents the type of the property. + + + + + Gets the hash code for the name of the member. + + + + The hash code for the name of the member. + + + + + Used to resolve references when serializing and deserializing JSON by the . + + + + + Resolves a reference to its object. + + The serialization context. + The reference to resolve. + The object that + + + + Gets the reference for the sepecified object. + + The serialization context. + The object to get a reference for. + The reference to the object. + + + + Determines whether the specified object is referenced. + + The serialization context. + The object to test for a reference. + + true if the specified object is referenced; otherwise, false. + + + + + Adds a reference to the specified object. + + The serialization context. + The reference. + The object to reference. + + + + Specifies reference handling options for the . + + + + + Do not preserve references when serializing types. + + + + + Preserve references when serializing into a JSON object structure. + + + + + Preserve references when serializing into a JSON array structure. + + + + + Preserve references when serializing. + + + + + Instructs the how to serialize the collection. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with a flag indicating whether the array can contain null items + + A flag indicating whether the array can contain null items. + + + + Initializes a new instance of the class with the specified container Id. + + The container Id. + + + + Gets or sets a value indicating whether null items are allowed in the collection. + + true if null items are allowed in the collection; otherwise, false. + + + + Specifies default value handling options for the . + + + + + Include members where the member value is the same as the member's default value when serializing objects. + Included members are written to JSON. Has no effect when deserializing. + + + + + Ignore members where the member value is the same as the member's default value when serializing objects + so that is is not written to JSON, and ignores setting members when the JSON value equals the member's default value. + + + + + Members with a default value but no JSON will be set to their default value when deserializing. + + + + + Ignore members where the member value is the same as the member's default value when serializing objects + and sets members to their default value when deserializing. + + + + + Instructs the to use the specified when serializing the member or class. + + + + + Initializes a new instance of the class. + + Type of the converter. + + + + Gets the type of the converter. + + The type of the converter. + + + + Instructs the how to serialize the object. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with the specified member serialization. + + The member serialization. + + + + Initializes a new instance of the class with the specified container Id. + + The container Id. + + + + Gets or sets the member serialization. + + The member serialization. + + + + Gets or sets a value that indicates whether the object's properties are required. + + + A value indicating whether the object's properties are required. + + + + + Specifies the settings on a object. + + + + + Initializes a new instance of the class. + + + + + Gets or sets how reference loops (e.g. a class referencing itself) is handled. + + Reference loop handling. + + + + Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. + + Missing member handling. + + + + Gets or sets how objects are created during deserialization. + + The object creation handling. + + + + Gets or sets how null values are handled during serialization and deserialization. + + Null value handling. + + + + Gets or sets how null default are handled during serialization and deserialization. + + The default value handling. + + + + Gets or sets a collection that will be used during serialization. + + The converters. + + + + Gets or sets how object references are preserved by the serializer. + + The preserve references handling. + + + + Gets or sets how type name writing and reading is handled by the serializer. + + The type name handling. + + + + Gets or sets how a type name assembly is written and resolved by the serializer. + + The type name assembly format. + + + + Gets or sets how constructors are used during deserialization. + + The constructor handling. + + + + Gets or sets the contract resolver used by the serializer when + serializing .NET objects to JSON and vice versa. + + The contract resolver. + + + + Gets or sets the used by the serializer when resolving references. + + The reference resolver. + + + + Gets or sets the used by the serializer when resolving type names. + + The binder. + + + + Gets or sets the error handler called during serialization and deserialization. + + The error handler called during serialization and deserialization. + + + + Gets or sets the used by the serializer when invoking serialization callback methods. + + The context. + + + + Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . + + + + + Indicates how JSON text output is formatted. + + + + + Get or set how dates are written to JSON text. + + + + + Get or set how time zones are handling during serialization and deserialization. + + + + + Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. + + + + + Gets or sets the culture used when reading JSON. Defaults to . + + + + + Gets a value indicating whether there will be a check for additional content after deserializing an object. + + + true if there will be a check for additional content after deserializing an object; otherwise, false. + + + + + Represents a reader that provides validation. + + + + + Initializes a new instance of the class that + validates the content returned from the given . + + The to read from while validating. + + + + Reads the next JSON token from the stream as a . + + A . + + + + Reads the next JSON token from the stream as a . + + + A or a null reference if the next JSON token is null. + + + + + Reads the next JSON token from the stream as a . + + A . + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . + + + + Reads the next JSON token from the stream. + + + true if the next token was read successfully; false if there are no more tokens to read. + + + + + Sets an event handler for receiving schema validation errors. + + + + + Gets the text value of the current Json token. + + + + + + Gets the depth of the current token in the JSON document. + + The depth of the current token in the JSON document. + + + + Gets the path of the current JSON token. + + + + + Gets the quotation mark character used to enclose the value of a string. + + + + + + Gets the type of the current Json token. + + + + + + Gets the Common Language Runtime (CLR) type for the current Json token. + + + + + + Gets or sets the schema. + + The schema. + + + + Gets the used to construct this . + + The specified in the constructor. + + + + Compares tokens to determine whether they are equal. + + + + + Determines whether the specified objects are equal. + + The first object of type to compare. + The second object of type to compare. + + true if the specified objects are equal; otherwise, false. + + + + + Returns a hash code for the specified object. + + The for which a hash code is to be returned. + A hash code for the specified object. + The type of is a reference type and is null. + + + + Specifies the member serialization options for the . + + + + + All public members are serialized by default. Members can be excluded using or . + This is the default member serialization mode. + + + + + Only members must be marked with or are serialized. + This member serialization mode can also be set by marking the class with . + + + + + All public and private fields are serialized. Members can be excluded using or . + This member serialization mode can also be set by marking the class with + and setting IgnoreSerializableAttribute on to false. + + + + + Specifies how object creation is handled by the . + + + + + Reuse existing objects, create new objects when needed. + + + + + Only reuse existing objects. + + + + + Always create new objects. + + + + + Converts a to and from the ISO 8601 date format (e.g. 2008-04-12T12:53Z). + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Gets or sets the date time styles used when converting a date to and from JSON. + + The date time styles used when converting a date to and from JSON. + + + + Gets or sets the date time format used when converting a date to and from JSON. + + The date time format used when converting a date to and from JSON. + + + + Gets or sets the culture used when converting a date to and from JSON. + + The culture used when converting a date to and from JSON. + + + + Converts a to and from a JavaScript date constructor (e.g. new Date(52231943)). + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing property value of the JSON that is being converted. + The calling serializer. + The object value. + + + + Converts XML to and from JSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The calling serializer. + The value. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Checks if the attributeName is a namespace attribute. + + Attribute name to test. + The attribute name prefix if it has one, otherwise an empty string. + True if attribute name is for a namespace attribute, otherwise false. + + + + Determines whether this instance can convert the specified value type. + + Type of the value. + + true if this instance can convert the specified value type; otherwise, false. + + + + + Gets or sets the name of the root element to insert when deserializing to XML if the JSON structure has produces multiple root elements. + + The name of the deserialize root element. + + + + Gets or sets a flag to indicate whether to write the Json.NET array attribute. + This attribute helps preserve arrays when converting the written XML back to JSON. + + true if the array attibute is written to the XML; otherwise, false. + + + + Gets or sets a value indicating whether to write the root JSON object. + + true if the JSON root object is omitted; otherwise, false. + + + + Represents a reader that provides fast, non-cached, forward-only access to JSON text data. + + + + + Initializes a new instance of the class with the specified . + + The TextReader containing the XML data to read. + + + + Reads the next JSON token from the stream. + + + true if the next token was read successfully; false if there are no more tokens to read. + + + + + Reads the next JSON token from the stream as a . + + + A or a null reference if the next JSON token is null. This method will return null at the end of an array. + + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Changes the state to closed. + + + + + Gets a value indicating whether the class can return line information. + + + true if LineNumber and LinePosition can be provided; otherwise, false. + + + + + Gets the current line number. + + + The current line number or 0 if no line information is available (for example, HasLineInfo returns false). + + + + + Gets the current line position. + + + The current line position or 0 if no line information is available (for example, HasLineInfo returns false). + + + + + Instructs the to always serialize the member with the specified name. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with the specified name. + + Name of the property. + + + + Gets or sets the converter used when serializing the property's collection items. + + The collection's items converter. + + + + Gets or sets the null value handling used when serializing this property. + + The null value handling. + + + + Gets or sets the default value handling used when serializing this property. + + The default value handling. + + + + Gets or sets the reference loop handling used when serializing this property. + + The reference loop handling. + + + + Gets or sets the object creation handling used when deserializing this property. + + The object creation handling. + + + + Gets or sets the type name handling used when serializing this property. + + The type name handling. + + + + Gets or sets whether this property's value is serialized as a reference. + + Whether this property's value is serialized as a reference. + + + + Gets or sets the order of serialization and deserialization of a member. + + The numeric order of serialization or deserialization. + + + + Gets or sets a value indicating whether this property is required. + + + A value indicating whether this property is required. + + + + + Gets or sets the name of the property. + + The name of the property. + + + + Gets or sets the the reference loop handling used when serializing the property's collection items. + + The collection's items reference loop handling. + + + + Gets or sets the the type name handling used when serializing the property's collection items. + + The collection's items type name handling. + + + + Gets or sets whether this property's collection items are serialized as a reference. + + Whether this property's collection items are serialized as a reference. + + + + Instructs the not to serialize the public field or public read/write property value. + + + + + Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. + + + + + Creates an instance of the JsonWriter class using the specified . + + The TextWriter to write to. + + + + Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. + + + + + Closes this stream and the underlying stream. + + + + + Writes the beginning of a Json object. + + + + + Writes the beginning of a Json array. + + + + + Writes the start of a constructor with the given name. + + The name of the constructor. + + + + Writes the specified end token. + + The end token to write. + + + + Writes the property name of a name/value pair on a Json object. + + The name of the property. + + + + Writes indent characters. + + + + + Writes the JSON value delimiter. + + + + + Writes an indent space. + + + + + Writes a null value. + + + + + Writes an undefined value. + + + + + Writes raw JSON. + + The raw JSON to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes out a comment /*...*/ containing the specified text. + + Text to place inside the comment. + + + + Writes out the given white space. + + The string of white space characters. + + + + Gets or sets how many IndentChars to write for each level in the hierarchy when is set to Formatting.Indented. + + + + + Gets or sets which character to use to quote attribute values. + + + + + Gets or sets which character to use for indenting when is set to Formatting.Indented. + + + + + Gets or sets a value indicating whether object names will be surrounded with quotes. + + + + + The exception thrown when an error occurs while reading Json text. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class + with a specified error message. + + The error message that explains the reason for the exception. + + + + Initializes a new instance of the class + with a specified error message and a reference to the inner exception that is the cause of this exception. + + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. + + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + The parameter is null. + The class name is null or is zero (0). + + + + Gets the path to the JSON where the error occurred. + + The path to the JSON where the error occurred. + + + + The exception thrown when an error occurs while reading Json text. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class + with a specified error message. + + The error message that explains the reason for the exception. + + + + Initializes a new instance of the class + with a specified error message and a reference to the inner exception that is the cause of this exception. + + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. + + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + The parameter is null. + The class name is null or is zero (0). + + + + Gets the line number indicating where the error occurred. + + The line number indicating where the error occurred. + + + + Gets the line position indicating where the error occurred. + + The line position indicating where the error occurred. + + + + Gets the path to the JSON where the error occurred. + + The path to the JSON where the error occurred. + + + + Represents a collection of . + + + + + Provides methods for converting between common language runtime types and JSON types. + + + + + Represents JavaScript's boolean value true as a string. This field is read-only. + + + + + Represents JavaScript's boolean value false as a string. This field is read-only. + + + + + Represents JavaScript's null as a string. This field is read-only. + + + + + Represents JavaScript's undefined as a string. This field is read-only. + + + + + Represents JavaScript's positive infinity as a string. This field is read-only. + + + + + Represents JavaScript's negative infinity as a string. This field is read-only. + + + + + Represents JavaScript's NaN as a string. This field is read-only. + + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation using the specified. + + The value to convert. + The format the date will be converted to. + The time zone handling when the date is converted to a string. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation using the specified. + + The value to convert. + The format the date will be converted to. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + The string delimiter character. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Serializes the specified object to a JSON string. + + The object to serialize. + A JSON string representation of the object. + + + + Serializes the specified object to a JSON string. + + The object to serialize. + Indicates how the output is formatted. + + A JSON string representation of the object. + + + + + Serializes the specified object to a JSON string using a collection of . + + The object to serialize. + A collection converters used while serializing. + A JSON string representation of the object. + + + + Serializes the specified object to a JSON string using a collection of . + + The object to serialize. + Indicates how the output is formatted. + A collection converters used while serializing. + A JSON string representation of the object. + + + + Serializes the specified object to a JSON string using a collection of . + + The object to serialize. + The used to serialize the object. + If this is null, default serialization settings will be is used. + + A JSON string representation of the object. + + + + + Serializes the specified object to a JSON string using a collection of . + + The object to serialize. + Indicates how the output is formatted. + The used to serialize the object. + If this is null, default serialization settings will be is used. + + A JSON string representation of the object. + + + + + Asynchronously serializes the specified object to a JSON string using a collection of . + + The object to serialize. + + A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. + + + + + Asynchronously serializes the specified object to a JSON string using a collection of . + + The object to serialize. + Indicates how the output is formatted. + + A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. + + + + + Asynchronously serializes the specified object to a JSON string using a collection of . + + The object to serialize. + Indicates how the output is formatted. + The used to serialize the object. + If this is null, default serialization settings will be is used. + + A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. + + + + + Deserializes the JSON to a .NET object. + + The JSON to deserialize. + The deserialized object from the Json string. + + + + Deserializes the JSON to a .NET object. + + The JSON to deserialize. + + The used to deserialize the object. + If this is null, default serialization settings will be is used. + + The deserialized object from the JSON string. + + + + Deserializes the JSON to the specified .NET type. + + The JSON to deserialize. + The of object being deserialized. + The deserialized object from the Json string. + + + + Deserializes the JSON to the specified .NET type. + + The type of the object to deserialize to. + The JSON to deserialize. + The deserialized object from the Json string. + + + + Deserializes the JSON to the given anonymous type. + + + The anonymous type to deserialize to. This can't be specified + traditionally and must be infered from the anonymous type passed + as a parameter. + + The JSON to deserialize. + The anonymous type object. + The deserialized anonymous type from the JSON string. + + + + Deserializes the JSON to the specified .NET type. + + The type of the object to deserialize to. + The JSON to deserialize. + Converters to use while deserializing. + The deserialized object from the JSON string. + + + + Deserializes the JSON to the specified .NET type. + + The type of the object to deserialize to. + The object to deserialize. + + The used to deserialize the object. + If this is null, default serialization settings will be is used. + + The deserialized object from the JSON string. + + + + Deserializes the JSON to the specified .NET type. + + The JSON to deserialize. + The type of the object to deserialize. + Converters to use while deserializing. + The deserialized object from the JSON string. + + + + Deserializes the JSON to the specified .NET type. + + The JSON to deserialize. + The type of the object to deserialize to. + + The used to deserialize the object. + If this is null, default serialization settings will be is used. + + The deserialized object from the JSON string. + + + + Asynchronously deserializes the JSON to the specified .NET type. + + The type of the object to deserialize to. + The JSON to deserialize. + + A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. + + + + + Asynchronously deserializes the JSON to the specified .NET type. + + The type of the object to deserialize to. + The JSON to deserialize. + + The used to deserialize the object. + If this is null, default serialization settings will be is used. + + + A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. + + + + + Asynchronously deserializes the JSON to the specified .NET type. + + The JSON to deserialize. + + A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. + + + + + Asynchronously deserializes the JSON to the specified .NET type. + + The JSON to deserialize. + The type of the object to deserialize to. + + The used to deserialize the object. + If this is null, default serialization settings will be is used. + + + A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. + + + + + Populates the object with values from the JSON string. + + The JSON to populate values from. + The target object to populate values onto. + + + + Populates the object with values from the JSON string. + + The JSON to populate values from. + The target object to populate values onto. + + The used to deserialize the object. + If this is null, default serialization settings will be is used. + + + + + Asynchronously populates the object with values from the JSON string. + + The JSON to populate values from. + The target object to populate values onto. + + The used to deserialize the object. + If this is null, default serialization settings will be is used. + + + A task that represents the asynchronous populate operation. + + + + + Serializes the XML node to a JSON string. + + The node to serialize. + A JSON string of the XmlNode. + + + + Serializes the XML node to a JSON string. + + The node to serialize. + Indicates how the output is formatted. + A JSON string of the XmlNode. + + + + Serializes the XML node to a JSON string. + + The node to serialize. + Indicates how the output is formatted. + Omits writing the root object. + A JSON string of the XmlNode. + + + + Deserializes the XmlNode from a JSON string. + + The JSON string. + The deserialized XmlNode + + + + Deserializes the XmlNode from a JSON string nested in a root elment. + + The JSON string. + The name of the root element to append when deserializing. + The deserialized XmlNode + + + + Deserializes the XmlNode from a JSON string nested in a root elment. + + The JSON string. + The name of the root element to append when deserializing. + + A flag to indicate whether to write the Json.NET array attribute. + This attribute helps preserve arrays when converting the written XML back to JSON. + + The deserialized XmlNode + + + + Serializes the to a JSON string. + + The node to convert to JSON. + A JSON string of the XNode. + + + + Serializes the to a JSON string. + + The node to convert to JSON. + Indicates how the output is formatted. + A JSON string of the XNode. + + + + Serializes the to a JSON string. + + The node to serialize. + Indicates how the output is formatted. + Omits writing the root object. + A JSON string of the XNode. + + + + Deserializes the from a JSON string. + + The JSON string. + The deserialized XNode + + + + Deserializes the from a JSON string nested in a root elment. + + The JSON string. + The name of the root element to append when deserializing. + The deserialized XNode + + + + Deserializes the from a JSON string nested in a root elment. + + The JSON string. + The name of the root element to append when deserializing. + + A flag to indicate whether to write the Json.NET array attribute. + This attribute helps preserve arrays when converting the written XML back to JSON. + + The deserialized XNode + + + + The exception thrown when an error occurs during Json serialization or deserialization. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class + with a specified error message. + + The error message that explains the reason for the exception. + + + + Initializes a new instance of the class + with a specified error message and a reference to the inner exception that is the cause of this exception. + + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. + + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + The parameter is null. + The class name is null or is zero (0). + + + + Serializes and deserializes objects into and from the JSON format. + The enables you to control how objects are encoded into JSON. + + + + + Initializes a new instance of the class. + + + + + Creates a new instance using the specified . + + The settings to be applied to the . + A new instance using the specified . + + + + Populates the JSON values onto the target object. + + The that contains the JSON structure to reader values from. + The target object to populate values onto. + + + + Populates the JSON values onto the target object. + + The that contains the JSON structure to reader values from. + The target object to populate values onto. + + + + Deserializes the Json structure contained by the specified . + + The that contains the JSON structure to deserialize. + The being deserialized. + + + + Deserializes the Json structure contained by the specified + into an instance of the specified type. + + The containing the object. + The of object being deserialized. + The instance of being deserialized. + + + + Deserializes the Json structure contained by the specified + into an instance of the specified type. + + The containing the object. + The type of the object to deserialize. + The instance of being deserialized. + + + + Deserializes the Json structure contained by the specified + into an instance of the specified type. + + The containing the object. + The of object being deserialized. + The instance of being deserialized. + + + + Serializes the specified and writes the Json structure + to a Stream using the specified . + + The used to write the Json structure. + The to serialize. + + + + Serializes the specified and writes the Json structure + to a Stream using the specified . + + The used to write the Json structure. + The to serialize. + + + + Occurs when the errors during serialization and deserialization. + + + + + Gets or sets the used by the serializer when resolving references. + + + + + Gets or sets the used by the serializer when resolving type names. + + + + + Gets or sets how type name writing and reading is handled by the serializer. + + + + + Gets or sets how a type name assembly is written and resolved by the serializer. + + The type name assembly format. + + + + Gets or sets how object references are preserved by the serializer. + + + + + Get or set how reference loops (e.g. a class referencing itself) is handled. + + + + + Get or set how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. + + + + + Get or set how null values are handled during serialization and deserialization. + + + + + Get or set how null default are handled during serialization and deserialization. + + + + + Gets or sets how objects are created during deserialization. + + The object creation handling. + + + + Gets or sets how constructors are used during deserialization. + + The constructor handling. + + + + Gets a collection that will be used during serialization. + + Collection that will be used during serialization. + + + + Gets or sets the contract resolver used by the serializer when + serializing .NET objects to JSON and vice versa. + + + + + Gets or sets the used by the serializer when invoking serialization callback methods. + + The context. + + + + Indicates how JSON text output is formatted. + + + + + Get or set how dates are written to JSON text. + + + + + Get or set how time zones are handling during serialization and deserialization. + + + + + Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. + + + + + Gets or sets the culture used when reading JSON. Defaults to . + + + + + Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . + + + + + Gets a value indicating whether there will be a check for additional JSON content after deserializing an object. + + + true if there will be a check for additional JSON content after deserializing an object; otherwise, false. + + + + + Contains the LINQ to JSON extension methods. + + + + + Returns a collection of tokens that contains the ancestors of every token in the source collection. + + The type of the objects in source, constrained to . + An of that contains the source collection. + An of that contains the ancestors of every node in the source collection. + + + + Returns a collection of tokens that contains the descendants of every token in the source collection. + + The type of the objects in source, constrained to . + An of that contains the source collection. + An of that contains the descendants of every node in the source collection. + + + + Returns a collection of child properties of every object in the source collection. + + An of that contains the source collection. + An of that contains the properties of every object in the source collection. + + + + Returns a collection of child values of every object in the source collection with the given key. + + An of that contains the source collection. + The token key. + An of that contains the values of every node in the source collection with the given key. + + + + Returns a collection of child values of every object in the source collection. + + An of that contains the source collection. + An of that contains the values of every node in the source collection. + + + + Returns a collection of converted child values of every object in the source collection with the given key. + + The type to convert the values to. + An of that contains the source collection. + The token key. + An that contains the converted values of every node in the source collection with the given key. + + + + Returns a collection of converted child values of every object in the source collection. + + The type to convert the values to. + An of that contains the source collection. + An that contains the converted values of every node in the source collection. + + + + Converts the value. + + The type to convert the value to. + A cast as a of . + A converted value. + + + + Converts the value. + + The source collection type. + The type to convert the value to. + A cast as a of . + A converted value. + + + + Returns a collection of child tokens of every array in the source collection. + + The source collection type. + An of that contains the source collection. + An of that contains the values of every node in the source collection. + + + + Returns a collection of converted child tokens of every array in the source collection. + + An of that contains the source collection. + The type to convert the values to. + The source collection type. + An that contains the converted values of every node in the source collection. + + + + Returns the input typed as . + + An of that contains the source collection. + The input typed as . + + + + Returns the input typed as . + + The source collection type. + An of that contains the source collection. + The input typed as . + + + + Represents a JSON constructor. + + + + + Represents a token that can contain other tokens. + + + + + Raises the event. + + The instance containing the event data. + + + + Raises the event. + + The instance containing the event data. + + + + Raises the event. + + The instance containing the event data. + + + + Returns a collection of the child tokens of this token, in document order. + + + An of containing the child tokens of this , in document order. + + + + + Returns a collection of the child values of this token, in document order. + + The type to convert the values to. + + A containing the child values of this , in document order. + + + + + Returns a collection of the descendant tokens for this token in document order. + + An containing the descendant tokens of the . + + + + Adds the specified content as children of this . + + The content to be added. + + + + Adds the specified content as the first children of this . + + The content to be added. + + + + Creates an that can be used to add tokens to the . + + An that is ready to have content written to it. + + + + Replaces the children nodes of this token with the specified content. + + The content. + + + + Removes the child nodes from this token. + + + + + Occurs when the list changes or an item in the list changes. + + + + + Occurs before an item is added to the collection. + + + + + Occurs when the items list of the collection has changed, or the collection is reset. + + + + + Gets the container's children tokens. + + The container's children tokens. + + + + Gets a value indicating whether this token has childen tokens. + + + true if this token has child values; otherwise, false. + + + + + Get the first child token of this token. + + + A containing the first child token of the . + + + + + Get the last child token of this token. + + + A containing the last child token of the . + + + + + Gets the count of child JSON tokens. + + The count of child JSON tokens + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class from another object. + + A object to copy from. + + + + Initializes a new instance of the class with the specified name and content. + + The constructor name. + The contents of the constructor. + + + + Initializes a new instance of the class with the specified name and content. + + The constructor name. + The contents of the constructor. + + + + Initializes a new instance of the class with the specified name. + + The constructor name. + + + + Writes this token to a . + + A into which this method will write. + A collection of which will be used when writing the token. + + + + Loads an from a . + + A that will be read for the content of the . + A that contains the JSON that was read from the specified . + + + + Gets the container's children tokens. + + The container's children tokens. + + + + Gets or sets the name of this constructor. + + The constructor name. + + + + Gets the node type for this . + + The type. + + + + Gets the with the specified key. + + The with the specified key. + + + + Represents a collection of objects. + + The type of token + + + + An empty collection of objects. + + + + + Initializes a new instance of the struct. + + The enumerable. + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + + + + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Gets the with the specified key. + + + + + + Represents a JSON object. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class from another object. + + A object to copy from. + + + + Initializes a new instance of the class with the specified content. + + The contents of the object. + + + + Initializes a new instance of the class with the specified content. + + The contents of the object. + + + + Gets an of this object's properties. + + An of this object's properties. + + + + Gets a the specified name. + + The property name. + A with the specified name or null. + + + + Gets an of this object's property values. + + An of this object's property values. + + + + Loads an from a . + + A that will be read for the content of the . + A that contains the JSON that was read from the specified . + + + + Load a from a string that contains JSON. + + A that contains JSON. + A populated from the string that contains JSON. + + + + Creates a from an object. + + The object that will be used to create . + A with the values of the specified object + + + + Creates a from an object. + + The object that will be used to create . + The that will be used to read the object. + A with the values of the specified object + + + + Writes this token to a . + + A into which this method will write. + A collection of which will be used when writing the token. + + + + Adds the specified property name. + + Name of the property. + The value. + + + + Removes the property with the specified name. + + Name of the property. + true if item was successfully removed; otherwise, false. + + + + Tries the get value. + + Name of the property. + The value. + true if a value was successfully retrieved; otherwise, false. + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + + + + Raises the event with the provided arguments. + + Name of the property. + + + + Raises the event with the provided arguments. + + Name of the property. + + + + Returns the properties for this instance of a component. + + + A that represents the properties for this component instance. + + + + + Returns the properties for this instance of a component using the attribute array as a filter. + + An array of type that is used as a filter. + + A that represents the filtered properties for this component instance. + + + + + Returns a collection of custom attributes for this instance of a component. + + + An containing the attributes for this object. + + + + + Returns the class name of this instance of a component. + + + The class name of the object, or null if the class does not have a name. + + + + + Returns the name of this instance of a component. + + + The name of the object, or null if the object does not have a name. + + + + + Returns a type converter for this instance of a component. + + + A that is the converter for this object, or null if there is no for this object. + + + + + Returns the default event for this instance of a component. + + + An that represents the default event for this object, or null if this object does not have events. + + + + + Returns the default property for this instance of a component. + + + A that represents the default property for this object, or null if this object does not have properties. + + + + + Returns an editor of the specified type for this instance of a component. + + A that represents the editor for this object. + + An of the specified type that is the editor for this object, or null if the editor cannot be found. + + + + + Returns the events for this instance of a component using the specified attribute array as a filter. + + An array of type that is used as a filter. + + An that represents the filtered events for this component instance. + + + + + Returns the events for this instance of a component. + + + An that represents the events for this component instance. + + + + + Returns an object that contains the property described by the specified property descriptor. + + A that represents the property whose owner is to be found. + + An that represents the owner of the specified property. + + + + + Returns the responsible for binding operations performed on this object. + + The expression tree representation of the runtime value. + + The to bind this object. + + + + + Gets the container's children tokens. + + The container's children tokens. + + + + Occurs when a property value changes. + + + + + Occurs when a property value is changing. + + + + + Gets the node type for this . + + The type. + + + + Gets the with the specified key. + + The with the specified key. + + + + Gets or sets the with the specified property name. + + + + + + Represents a JSON array. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class from another object. + + A object to copy from. + + + + Initializes a new instance of the class with the specified content. + + The contents of the array. + + + + Initializes a new instance of the class with the specified content. + + The contents of the array. + + + + Loads an from a . + + A that will be read for the content of the . + A that contains the JSON that was read from the specified . + + + + Load a from a string that contains JSON. + + A that contains JSON. + A populated from the string that contains JSON. + + + + Creates a from an object. + + The object that will be used to create . + A with the values of the specified object + + + + Creates a from an object. + + The object that will be used to create . + The that will be used to read the object. + A with the values of the specified object + + + + Writes this token to a . + + A into which this method will write. + A collection of which will be used when writing the token. + + + + Determines the index of a specific item in the . + + The object to locate in the . + + The index of if found in the list; otherwise, -1. + + + + + Inserts an item to the at the specified index. + + The zero-based index at which should be inserted. + The object to insert into the . + + is not a valid index in the . + The is read-only. + + + + Removes the item at the specified index. + + The zero-based index of the item to remove. + + is not a valid index in the . + The is read-only. + + + + Adds an item to the . + + The object to add to the . + The is read-only. + + + + Removes all items from the . + + The is read-only. + + + + Determines whether the contains a specific value. + + The object to locate in the . + + true if is found in the ; otherwise, false. + + + + + Removes the first occurrence of a specific object from the . + + The object to remove from the . + + true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . + + The is read-only. + + + + Gets the container's children tokens. + + The container's children tokens. + + + + Gets the node type for this . + + The type. + + + + Gets the with the specified key. + + The with the specified key. + + + + Gets or sets the at the specified index. + + + + + + Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. + + + + + Initializes a new instance of the class. + + The token to read from. + + + + Reads the next JSON token from the stream as a . + + + A or a null reference if the next JSON token is null. This method will return null at the end of an array. + + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream. + + + true if the next token was read successfully; false if there are no more tokens to read. + + + + + Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. + + + + + Initializes a new instance of the class writing to the given . + + The container being written to. + + + + Initializes a new instance of the class. + + + + + Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. + + + + + Closes this stream and the underlying stream. + + + + + Writes the beginning of a Json object. + + + + + Writes the beginning of a Json array. + + + + + Writes the start of a constructor with the given name. + + The name of the constructor. + + + + Writes the end. + + The token. + + + + Writes the property name of a name/value pair on a Json object. + + The name of the property. + + + + Writes a null value. + + + + + Writes an undefined value. + + + + + Writes raw JSON. + + The raw JSON to write. + + + + Writes out a comment /*...*/ containing the specified text. + + Text to place inside the comment. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Gets the token being writen. + + The token being writen. + + + + Represents a JSON property. + + + + + Initializes a new instance of the class from another object. + + A object to copy from. + + + + Initializes a new instance of the class. + + The property name. + The property content. + + + + Initializes a new instance of the class. + + The property name. + The property content. + + + + Writes this token to a . + + A into which this method will write. + A collection of which will be used when writing the token. + + + + Loads an from a . + + A that will be read for the content of the . + A that contains the JSON that was read from the specified . + + + + Gets the container's children tokens. + + The container's children tokens. + + + + Gets the property name. + + The property name. + + + + Gets or sets the property value. + + The property value. + + + + Gets the node type for this . + + The type. + + + + Specifies the type of token. + + + + + No token type has been set. + + + + + A JSON object. + + + + + A JSON array. + + + + + A JSON constructor. + + + + + A JSON object property. + + + + + A comment. + + + + + An integer value. + + + + + A float value. + + + + + A string value. + + + + + A boolean value. + + + + + A null value. + + + + + An undefined value. + + + + + A date value. + + + + + A raw JSON value. + + + + + A collection of bytes value. + + + + + A Guid value. + + + + + A Uri value. + + + + + A TimeSpan value. + + + + + Contains the JSON schema extension methods. + + + + + Determines whether the is valid. + + The source to test. + The schema to test with. + + true if the specified is valid; otherwise, false. + + + + + Determines whether the is valid. + + The source to test. + The schema to test with. + When this method returns, contains any error messages generated while validating. + + true if the specified is valid; otherwise, false. + + + + + Validates the specified . + + The source to test. + The schema to test with. + + + + Validates the specified . + + The source to test. + The schema to test with. + The validation event handler. + + + + Returns detailed information about the schema exception. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class + with a specified error message. + + The error message that explains the reason for the exception. + + + + Initializes a new instance of the class + with a specified error message and a reference to the inner exception that is the cause of this exception. + + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. + + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + The parameter is null. + The class name is null or is zero (0). + + + + Gets the line number indicating where the error occurred. + + The line number indicating where the error occurred. + + + + Gets the line position indicating where the error occurred. + + The line position indicating where the error occurred. + + + + Gets the path to the JSON where the error occurred. + + The path to the JSON where the error occurred. + + + + Resolves from an id. + + + + + Initializes a new instance of the class. + + + + + Gets a for the specified id. + + The id. + A for the specified id. + + + + Gets or sets the loaded schemas. + + The loaded schemas. + + + + Specifies undefined schema Id handling options for the . + + + + + Do not infer a schema Id. + + + + + Use the .NET type name as the schema Id. + + + + + Use the assembly qualified .NET type name as the schema Id. + + + + + Returns detailed information related to the . + + + + + Gets the associated with the validation error. + + The JsonSchemaException associated with the validation error. + + + + Gets the path of the JSON location where the validation error occurred. + + The path of the JSON location where the validation error occurred. + + + + Gets the text description corresponding to the validation error. + + The text description. + + + + Represents the callback method that will handle JSON schema validation events and the . + + + + + Resolves member mappings for a type, camel casing property names. + + + + + Used by to resolves a for a given . + + + + + Used by to resolves a for a given . + + + + + Resolves the contract for a given type. + + The type to resolve a contract for. + The contract for a given type. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + If set to true the will use a cached shared with other resolvers of the same type. + Sharing the cache will significantly performance because expensive reflection will only happen once but could cause unexpected + behavior if different instances of the resolver are suppose to produce different results. When set to false it is highly + recommended to reuse instances with the . + + + + + Resolves the contract for a given type. + + The type to resolve a contract for. + The contract for a given type. + + + + Gets the serializable members for the type. + + The type to get serializable members for. + The serializable members for the type. + + + + Creates a for the given type. + + Type of the object. + A for the given type. + + + + Creates the constructor parameters. + + The constructor to create properties for. + The type's member properties. + Properties for the given . + + + + Creates a for the given . + + The matching member property. + The constructor parameter. + A created for the given . + + + + Resolves the default for the contract. + + Type of the object. + + + + + Creates a for the given type. + + Type of the object. + A for the given type. + + + + Creates a for the given type. + + Type of the object. + A for the given type. + + + + Creates a for the given type. + + Type of the object. + A for the given type. + + + + Creates a for the given type. + + Type of the object. + A for the given type. + + + + Creates a for the given type. + + Type of the object. + A for the given type. + + + + Creates a for the given type. + + Type of the object. + A for the given type. + + + + Creates a for the given type. + + Type of the object. + A for the given type. + + + + Determines which contract type is created for the given type. + + Type of the object. + A for the given type. + + + + Creates properties for the given . + + The type to create properties for. + /// The member serialization mode for the type. + Properties for the given . + + + + Creates the used by the serializer to get and set values from a member. + + The member. + The used by the serializer to get and set values from a member. + + + + Creates a for the given . + + The member's parent . + The member to create a for. + A created for the given . + + + + Resolves the name of the property. + + Name of the property. + Name of the property. + + + + Gets the resolved name of the property. + + Name of the property. + Name of the property. + + + + Gets a value indicating whether members are being get and set using dynamic code generation. + This value is determined by the runtime permissions available. + + + true if using dynamic code generation; otherwise, false. + + + + + Gets or sets the default members search flags. + + The default members search flags. + + + + Gets or sets a value indicating whether compiler generated members should be serialized. + + + true if serialized compiler generated members; otherwise, false. + + + + + Gets or sets a value indicating whether to ignore the interface when serializing and deserializing types. + + + true if the interface will be ignored when serializing and deserializing types; otherwise, false. + + + + + Gets or sets a value indicating whether to ignore the attribute when serializing and deserializing types. + + + true if the attribute will be ignored when serializing and deserializing types; otherwise, false. + + + + + Initializes a new instance of the class. + + + + + Resolves the name of the property. + + Name of the property. + The property name camel cased. + + + + The default serialization binder used when resolving and loading classes from type names. + + + + + When overridden in a derived class, controls the binding of a serialized object to a type. + + Specifies the name of the serialized object. + Specifies the name of the serialized object. + + The type of the object the formatter creates a new instance of. + + + + + When overridden in a derived class, controls the binding of a serialized object to a type. + + The type of the object the formatter creates a new instance of. + Specifies the name of the serialized object. + Specifies the name of the serialized object. + + + + Provides information surrounding an error. + + + + + Gets or sets the error. + + The error. + + + + Gets the original object that caused the error. + + The original object that caused the error. + + + + Gets the member that caused the error. + + The member that caused the error. + + + + Gets the path of the JSON location where the error occurred. + + The path of the JSON location where the error occurred. + + + + Gets or sets a value indicating whether this is handled. + + true if handled; otherwise, false. + + + + Contract details for a used by the . + + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Gets the of the collection items. + + The of the collection items. + + + + Contract details for a used by the . + + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Gets or sets the property name resolver. + + The property name resolver. + + + + Gets the of the dictionary keys. + + The of the dictionary keys. + + + + Gets the of the dictionary values. + + The of the dictionary values. + + + + Maps a JSON property to a .NET member or constructor parameter. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Gets or sets the name of the property. + + The name of the property. + + + + Gets or sets the type that declared this property. + + The type that declared this property. + + + + Gets or sets the order of serialization and deserialization of a member. + + The numeric order of serialization or deserialization. + + + + Gets or sets the name of the underlying member or parameter. + + The name of the underlying member or parameter. + + + + Gets the that will get and set the during serialization. + + The that will get and set the during serialization. + + + + Gets or sets the type of the property. + + The type of the property. + + + + Gets or sets the for the property. + If set this converter takes presidence over the contract converter for the property type. + + The converter. + + + + Gets the member converter. + + The member converter. + + + + Gets a value indicating whether this is ignored. + + true if ignored; otherwise, false. + + + + Gets a value indicating whether this is readable. + + true if readable; otherwise, false. + + + + Gets a value indicating whether this is writable. + + true if writable; otherwise, false. + + + + Gets the default value. + + The default value. + + + + Gets a value indicating whether this is required. + + A value indicating whether this is required. + + + + Gets a value indicating whether this property preserves object references. + + + true if this instance is reference; otherwise, false. + + + + + Gets the property null value handling. + + The null value handling. + + + + Gets the property default value handling. + + The default value handling. + + + + Gets the property reference loop handling. + + The reference loop handling. + + + + Gets the property object creation handling. + + The object creation handling. + + + + Gets or sets the type name handling. + + The type name handling. + + + + Gets or sets a predicate used to determine whether the property should be serialize. + + A predicate used to determine whether the property should be serialize. + + + + Gets or sets a predicate used to determine whether the property should be serialized. + + A predicate used to determine whether the property should be serialized. + + + + Gets or sets an action used to set whether the property has been deserialized. + + An action used to set whether the property has been deserialized. + + + + Gets or sets the converter used when serializing the property's collection items. + + The collection's items converter. + + + + Gets or sets whether this property's collection items are serialized as a reference. + + Whether this property's collection items are serialized as a reference. + + + + Gets or sets the the type name handling used when serializing the property's collection items. + + The collection's items type name handling. + + + + Gets or sets the the reference loop handling used when serializing the property's collection items. + + The collection's items reference loop handling. + + + + A collection of objects. + + + + + Initializes a new instance of the class. + + The type. + + + + When implemented in a derived class, extracts the key from the specified element. + + The element from which to extract the key. + The key for the specified element. + + + + Adds a object. + + The property to add to the collection. + + + + Gets the closest matching object. + First attempts to get an exact case match of propertyName and then + a case insensitive match. + + Name of the property. + A matching property if found. + + + + Gets a property by property name. + + The name of the property to get. + Type property name string comparison. + A matching property if found. + + + + Specifies missing member handling options for the . + + + + + Ignore a missing member and do not attempt to deserialize it. + + + + + Throw a when a missing member is encountered during deserialization. + + + + + Specifies null value handling options for the . + + + + + Include null values when serializing and deserializing objects. + + + + + Ignore null values when serializing and deserializing objects. + + + + + Specifies reference loop handling options for the . + + + + + Throw a when a loop is encountered. + + + + + Ignore loop references and do not serialize. + + + + + Serialize loop references. + + + + + An in-memory representation of a JSON Schema. + + + + + Initializes a new instance of the class. + + + + + Reads a from the specified . + + The containing the JSON Schema to read. + The object representing the JSON Schema. + + + + Reads a from the specified . + + The containing the JSON Schema to read. + The to use when resolving schema references. + The object representing the JSON Schema. + + + + Load a from a string that contains schema JSON. + + A that contains JSON. + A populated from the string that contains JSON. + + + + Parses the specified json. + + The json. + The resolver. + A populated from the string that contains JSON. + + + + Writes this schema to a . + + A into which this method will write. + + + + Writes this schema to a using the specified . + + A into which this method will write. + The resolver used. + + + + Returns a that represents the current . + + + A that represents the current . + + + + + Gets or sets the id. + + + + + Gets or sets the title. + + + + + Gets or sets whether the object is required. + + + + + Gets or sets whether the object is read only. + + + + + Gets or sets whether the object is visible to users. + + + + + Gets or sets whether the object is transient. + + + + + Gets or sets the description of the object. + + + + + Gets or sets the types of values allowed by the object. + + The type. + + + + Gets or sets the pattern. + + The pattern. + + + + Gets or sets the minimum length. + + The minimum length. + + + + Gets or sets the maximum length. + + The maximum length. + + + + Gets or sets a number that the value should be divisble by. + + A number that the value should be divisble by. + + + + Gets or sets the minimum. + + The minimum. + + + + Gets or sets the maximum. + + The maximum. + + + + Gets or sets a flag indicating whether the value can not equal the number defined by the "minimum" attribute. + + A flag indicating whether the value can not equal the number defined by the "minimum" attribute. + + + + Gets or sets a flag indicating whether the value can not equal the number defined by the "maximum" attribute. + + A flag indicating whether the value can not equal the number defined by the "maximum" attribute. + + + + Gets or sets the minimum number of items. + + The minimum number of items. + + + + Gets or sets the maximum number of items. + + The maximum number of items. + + + + Gets or sets the of items. + + The of items. + + + + Gets or sets the of properties. + + The of properties. + + + + Gets or sets the of additional properties. + + The of additional properties. + + + + Gets or sets the pattern properties. + + The pattern properties. + + + + Gets or sets a value indicating whether additional properties are allowed. + + + true if additional properties are allowed; otherwise, false. + + + + + Gets or sets the required property if this property is present. + + The required property if this property is present. + + + + Gets or sets the identity. + + The identity. + + + + Gets or sets the a collection of valid enum values allowed. + + A collection of valid enum values allowed. + + + + Gets or sets a collection of options. + + A collection of options. + + + + Gets or sets disallowed types. + + The disallow types. + + + + Gets or sets the default value. + + The default value. + + + + Gets or sets the extend . + + The extended . + + + + Gets or sets the format. + + The format. + + + + Generates a from a specified . + + + + + Generate a from the specified type. + + The type to generate a from. + A generated from the specified type. + + + + Generate a from the specified type. + + The type to generate a from. + The used to resolve schema references. + A generated from the specified type. + + + + Generate a from the specified type. + + The type to generate a from. + Specify whether the generated root will be nullable. + A generated from the specified type. + + + + Generate a from the specified type. + + The type to generate a from. + The used to resolve schema references. + Specify whether the generated root will be nullable. + A generated from the specified type. + + + + Gets or sets how undefined schemas are handled by the serializer. + + + + + Gets or sets the contract resolver. + + The contract resolver. + + + + The value types allowed by the . + + + + + No type specified. + + + + + String type. + + + + + Float type. + + + + + Integer type. + + + + + Boolean type. + + + + + Object type. + + + + + Array type. + + + + + Null type. + + + + + Any type. + + + + + Contract details for a used by the . + + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Gets or sets the object member serialization. + + The member object serialization. + + + + Gets or sets a value that indicates whether the object's properties are required. + + + A value indicating whether the object's properties are required. + + + + + Gets the object's properties. + + The object's properties. + + + + Gets the constructor parameters required for any non-default constructor + + + + + Gets or sets the override constructor used to create the object. + This is set when a constructor is marked up using the + JsonConstructor attribute. + + The override constructor. + + + + Gets or sets the parametrized constructor used to create the object. + + The parametrized constructor. + + + + Contract details for a used by the . + + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Get and set values for a using reflection. + + + + + Initializes a new instance of the class. + + The member info. + + + + Sets the value. + + The target to set the value on. + The value to set on the target. + + + + Gets the value. + + The target to get the value from. + The value. + + + + When applied to a method, specifies that the method is called when an error occurs serializing an object. + + + + + Helper method for generating a MetaObject which calls a + specific method on Dynamic that returns a result + + + + + Helper method for generating a MetaObject which calls a + specific method on Dynamic, but uses one of the arguments for + the result. + + + + + Helper method for generating a MetaObject which calls a + specific method on Dynamic, but uses one of the arguments for + the result. + + + + + Returns a Restrictions object which includes our current restrictions merged + with a restriction limiting our type + + + + + Represents a method that constructs an object. + + + + + Specifies type name handling options for the . + + + + + Do not include the .NET type name when serializing types. + + + + + Include the .NET type name when serializing into a JSON object structure. + + + + + Include the .NET type name when serializing into a JSON array structure. + + + + + Always include the .NET type name when serializing. + + + + + Include the .NET type name when the type of the object being serialized is not the same as its declared type. + + + + + Converts the value to the specified type. + + The value to convert. + The culture to use when converting. + The type to convert the value to. + The converted type. + + + + Converts the value to the specified type. + + The value to convert. + The culture to use when converting. + The type to convert the value to. + The converted value if the conversion was successful or the default value of T if it failed. + + true if initialValue was converted successfully; otherwise, false. + + + + + Converts the value to the specified type. If the value is unable to be converted, the + value is checked whether it assignable to the specified type. + + The value to convert. + The culture to use when converting. + The type to convert or cast the value to. + + The converted type. If conversion was unsuccessful, the initial value + is returned if assignable to the target type. + + + + + Gets a dictionary of the names and values of an Enum type. + + + + + + Gets a dictionary of the names and values of an Enum type. + + The enum type to get names and values for. + + + + + Specifies the type of Json token. + + + + + This is returned by the if a method has not been called. + + + + + An object start token. + + + + + An array start token. + + + + + A constructor start token. + + + + + An object property name. + + + + + A comment. + + + + + Raw JSON. + + + + + An integer. + + + + + A float. + + + + + A string. + + + + + A boolean. + + + + + A null token. + + + + + An undefined token. + + + + + An object end token. + + + + + An array end token. + + + + + A constructor end token. + + + + + A Date. + + + + + Byte data. + + + + + Builds a string. Unlike StringBuilder this class lets you reuse it's internal buffer. + + + + + Determines whether the collection is null or empty. + + The collection. + + true if the collection is null or empty; otherwise, false. + + + + + Adds the elements of the specified collection to the specified generic IList. + + The list to add to. + The collection of elements to add. + + + + Returns the index of the first occurrence in a sequence by using a specified IEqualityComparer. + + The type of the elements of source. + A sequence in which to locate a value. + The object to locate in the sequence + An equality comparer to compare values. + The zero-based index of the first occurrence of value within the entire sequence, if found; otherwise, –1. + + + + Gets the type of the typed collection's items. + + The type. + The type of the typed collection's items. + + + + Gets the member's underlying type. + + The member. + The underlying type of the member. + + + + Determines whether the member is an indexed property. + + The member. + + true if the member is an indexed property; otherwise, false. + + + + + Determines whether the property is an indexed property. + + The property. + + true if the property is an indexed property; otherwise, false. + + + + + Gets the member's value on the object. + + The member. + The target object. + The member's value on the object. + + + + Sets the member's value on the target object. + + The member. + The target. + The value. + + + + Determines whether the specified MemberInfo can be read. + + The MemberInfo to determine whether can be read. + /// if set to true then allow the member to be gotten non-publicly. + + true if the specified MemberInfo can be read; otherwise, false. + + + + + Determines whether the specified MemberInfo can be set. + + The MemberInfo to determine whether can be set. + if set to true then allow the member to be set non-publicly. + if set to true then allow the member to be set if read-only. + + true if the specified MemberInfo can be set; otherwise, false. + + + + + Determines whether the string is all white space. Empty string will return false. + + The string to test whether it is all white space. + + true if the string is all white space; otherwise, false. + + + + + Nulls an empty string. + + The string. + Null if the string was null, otherwise the string unchanged. + + + + Specifies the state of the . + + + + + An exception has been thrown, which has left the in an invalid state. + You may call the method to put the in the Closed state. + Any other method calls results in an being thrown. + + + + + The method has been called. + + + + + An object is being written. + + + + + A array is being written. + + + + + A constructor is being written. + + + + + A property is being written. + + + + + A write method has not been called. + + + + diff --git a/Openstack.Client.Powershell/bin/Release/Openstack.Client.Powershell.dll b/Openstack.Client.Powershell/bin/Release/Openstack.Client.Powershell.dll new file mode 100644 index 0000000..cf9a9a5 Binary files /dev/null and b/Openstack.Client.Powershell/bin/Release/Openstack.Client.Powershell.dll differ diff --git a/Openstack.Client.Powershell/bin/Release/Openstack.Client.Powershell.dll-help.xml b/Openstack.Client.Powershell/bin/Release/Openstack.Client.Powershell.dll-help.xml new file mode 100644 index 0000000..5d1ee01 --- /dev/null +++ b/Openstack.Client.Powershell/bin/Release/Openstack.Client.Powershell.dll-help.xml @@ -0,0 +1,9685 @@ + + + + + + + + + + + + + + + Copy-Id + + + This Cmdlet will copy a records Id column to the clipboard given a QuickPick Number. + + + + + Copy + Id + + + + + This Cmdlet will copy a records Id column to the clipboard given a QuickPick Number. + + + + + + + + + + + + + qp + + + The QuickPick Number of the row + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # copy-id 2 + + + Description + ----------- + + This command will copy the Id of the record represented by QuickPickNumber 2 + + + + + + + + + + + + + + + + + + + + + + + + Get-Config + + + This Cmdlet will print out what config file entries the current session is running under. + + + + + Get + Config + + + + + This Cmdlet will print out what config file entries the current session is running under. + + + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourstorageContainer:\> + + + # Get-Config + + + Description + ----------- + + Prints out settings for the current session. + + + + + + + + + + + + + + + + + + + + + + + Map-Drive + + + This Cmdlet will map a Container that someone else owns to your list of available drives. + + + + + Map + Drive + + + + + This Cmdlet will map a Container that someone else owns to your list of available drives. + + + + + + + + + s + + + The full Container path + + + string + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourContainer:\> + + + # map-drive https://objects.werr.net:443/v1/9153476658759/rgtest2 + + + Description + ----------- + + Maps the rgtest2 Container to the list of available drives for the user. + + + + + + + + + + + + + + + + + + + + + + + Remove-Drive + + + This Cmdlet will remove an existing mapped drive. + + + + + Map + Drive + + + + + This Cmdlet will remove an existing mapped drive. + + + + + + + + + s + + + The Container name + + + string + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourContainer:\> + + + # remove-drive rgtest + + + Description + ----------- + + removes the rgtest2 Container from the list of available drives. + + + + + + + + + + + + + + + + + + + + + + + Migrate-Drive + + + This Cmdlet is used migrate existing stores of data from external sources like S3, Dropbox and Skydrive to a target Container within OpenStack Object Storage. + + + + + Set + Config + + + + + This Cmdlet is used migrate existing stores of data from external sources like S3, Dropbox and Skydrive to a target Container within OpenStack Object Storage. + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourContainer:\> + + + # Migrate-Drive -p "S3" -sk "aa78676dhhh100" -ak "jhjhgu64332" -b "testb1", "testb2" + + + Description + ----------- + + Copies the testb1 and testb2 S3 Buckets to OpenStack Object Storage Containers of the same name. -sk = SecretKey -ak = AccessKey + + + + + + + + + + + + + + + + EXAMPLE 2 + + + PS yourContainer:\> + + + # Migrate-Drive -p "S3" -sk "aa78676dhhh100" -ak "jhjhgu64332" + + + Description + ----------- + + This example omits the Buckets (-b) parameter which forces the cmdlet to migrate all S3 Buckets to OpenStack Object Storage Containers of the same name. + + + + + + + + + + + + + + + + EXAMPLE 3 + + + PS yourContainer:\> + + + # Migrate-Drive -p "Skydrive" + + + Description + ----------- + + Migrates the local Skydrive store over to a Container called "Skydrive" + + + + + + + + + + + + + + + + EXAMPLE 4 + + + PS yourContainer:\> + + + # Migrate-Drive -p "Dropbox" + + + Description + ----------- + + Migrates the local Dropbox store over to a Container called "Dropbox" + + + + + + + + + + + + + + + + + + + + + + + + Set-Config + + + This Cmdlet is used to change specific settings on a per session basis. In addition to this, all settings may be changed at once by supplying the path to a completely different config file. + + + + + Set + Config + + + + + This Cmdlet is used to change specific settings on a per session basis. In addition to this, all settings may be changed at once by supplying the path to a completely different config file. + + + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourContainer:\> + + + # Set-Config -k "HttpTimeOut" -v "100" + + + Description + ----------- + + Changes the HttpTimeout setting to 100 miliseconds + + + + + + + + + + + + + + + + EXAMPLE 2 + + + PS yourContainer:\> + + + # Set-Config -s "c:\testconfig.config" + + + Description + ----------- + + Replaces all current session settings with those defined within the testconfig.config file. + + + + + + + + + + + + + + + + EXAMPLE 3 + + + PS yourContainer:\> + + + # Set-Config -resercfg" + + + Description + ----------- + + Resets the current session settings to those defined within the default config file (CLI.config) + + + + + + + + + + + + + + + + + + + + + + + + Get-Uri + + + This cmdlet will print out the fully qualified URI of the resource that you supply with optional parameters which constrain the URIs validity to a timepsan.. + + + + + Get + URI + + + + + When you issue this command the URI is also pasted to the Windows clipboard for your convenience. If you want to disable this behavior simply set the CLI.config option entitled PasteGetURIResultsToClipboard to false. + + + + + + + + + s + + + The Source Path to the StorageObject. + + + string + + + dv + + + The number of days the URI is considered valid (optional) + + + string + + + sv + + + The number of seconds the URI is considered valid (optional) + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourContainer:\> + + + # get-uri anothertest.txt + + + Description + ----------- + + This prints out the fully qualified URI for the anothertest.txt file. + + + + + + + + + + + + + + + + + + + + + + + + Get-Notes + + + + This cmdlet will pull a list of release notes from the server. You can also filter the notes to a specific version. + + + + + + Get + Notes + + + + + + + + + + + + + + all + + + Prints all release notes + + + + + string + + + v + + + Prints release notes for a specific version + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Get-Notes -all + + + Description + ----------- + + Prints the entire set of release notes from all releases. + + + + + + + + + + + + + + + + EXAMPLE 2 + + + + + + # Get-Notes -v "2.0.0.0" + + + Description + ----------- + + Prints out the release notes for the 2.0.0.0 release only. + + + + + + + + + + + + + + + + + + + + + + + + Get-Catalog + + + + This cmdlet will show the current Users service catalog that was retrieved when logging in. This catalog represents every service the user has authorization to use. + + + + + + Get + Catalog + + + + + + + + + + + + + + v + + + Verbose mode displays detailed information about each service that's available. + + + + + string + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Get-Catalog + + + Description + ----------- + + Shows a simple listing of available services. + + + + + + + + + + + + + + + + EXAMPLE 2 + + + + + + # Get-Catalog -v + + + Description + ----------- + + Shows a more detailed list of services with additional technical information. + + + + + + + + + + + + + + + + + + + + + + + + Get-Version + + + + Shows the products version number. + + + + + + Get + Version + + + + + + + + + + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Get-Version + + + Description + ----------- + + Shows the products current version. + + + + + + + + + + + + + + + + + + + + + + + + + + Remove-FloatingIP + + + This Cmdlet will completely remove an existing Floating IP address. + + + + + Remove + FloatingIP + + + + + This Cmdlet will completely remove an existing Floating IP address. + + + + + + + + + + + + + id + + + The identifier for the Floating IP address. + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # remove-floatingIP 4ee64397-1253-473c-a81d-bc23dceeef31 + + + Description + ----------- + + This command will delete the floatingIP with the id of 4ee64397-1253-473c-a81d-bc23dceeef31 + + + + + + + + + + + + + + + + + + + + + + Remove-Network + + + This Cmdlet will completely remove an existing Network. + + + + + Remove + Network + + + + + This Cmdlet will completely remove an existing Network. + + + + + + + + + + + + + id + + + The identifier of the Network + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # remove-network -id 12857174-99cf-40e9-999e-fb0fa2e84898 + + + Description + ----------- + + This command will delete the Network with the id of 12857174-99cf-40e9-999e-fb0fa2e84898 + + + + + + + + + + + + + + + + + + + + + + Remove-Port + + + This Cmdlet will completely remove an existing Port. + + + + + Remove + Port + + + + + This Cmdlet will completely remove an existing Port. + + + + + + + + + + + + + id + + + The identifier of the Port + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # remove-port -id 12857174-99cf-40e9-999e-fb0fa2e84898 + + + Description + ----------- + + This command will delete the Port with the id of 12857174-99cf-40e9-999e-fb0fa2e84898 + + + + + + + + + + + + + + + + + + + + + + Remove-Router + + + This Cmdlet will completely remove an existing Router. + + + + + Remove + Port + + + + + This Cmdlet will completely remove an existing Router. + + + + + + + + + + + + + id + + + The identifier of the Router + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # remove-router 12857174-99cf-40e9-999e-fb0fa2e84898 + + + Description + ----------- + + This command will delete the Router with the id of 12857174-99cf-40e9-999e-fb0fa2e84898 + + + + + + + + + + + + + + + + + + + + + + Remove-RouterInterface + + + TThis Cmdlet will completely remove an existing relation between a Subnet and Router. + + + + + Remove + Port + + + + + This Cmdlet will completely remove an existing relation between a Subnet and Router. + + + + + + + + + + + + + id + + + The identifier of the Router + + + string + + + + sid + + + The identifier of the Subnet. + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # remove-routerinterface -id 12857174-99cf-40e9-999e-fb0fa2e84898 -sid bd1c30f7-71f1-455e-b91e-8d03da7f5224 + + + Description + ----------- + + This command will remove the association between Router 12857174-99cf-40e9-999e-fb0fa2e84898 and Subnet bd1c30f7-71f1-455e-b91e-8d03da7f5224 + + + + + + + + + + + + + + + + + + + + + + Remove-Subnet + + + This Cmdlet will completely remove an existing Subnet. + + + + + Remove + Subnet + + + + + This Cmdlet will completely remove an existing Subnet. + + + + + + + + + + + + + id + + + The identifier of the Subnet + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # remove-Subnet 12857174-99cf-40e9-999e-fb0fa2e84898 + + + Description + ----------- + + This command will delete the Subnet with the id of 12857174-99cf-40e9-999e-fb0fa2e84898 + + + + + + + + + + + + + + + + + + + + + + New-FloatingIP + + + This Cmdlet will create a new FloatingIP. + + + + + New + FloatingIP + + + + + This Cmdlet will create a new FloatingIP. + + + + + + + + + + + + + pid + + + The identifier of the Port required to create the FloatingIP + + + string + + + + nid + + + The identifier of the Network required to create the FloatingIP + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # new-FloatingIP -pid 12857174-99cf-40e9-999e-fb0fa2e84898 -nid bd1c30f7-71f1-455e-b91e-8d03da7f5224 + + + Description + ----------- + + This command will create a new Floating IP address for Network 12857174-99cf-40e9-999e-fb0fa2e84898 and Port bd1c30f7-71f1-455e-b91e-8d03da7f5224 + + + + + + + + + + + + + + + + + + + + + + New-Network + + + This Cmdlet will create a new Network. + + + + + New + Network + + + + + This Cmdlet will create a new Network. + + + + + + + + + + + + + n + + + The name of the new Network + + + string + + + + asu + + + Determines if the AdminStateUp flag is true or false. + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # new-network "testNet1" -asu + + + Description + ----------- + + This command will create a new network called testNet1 with its AdminStateUp set to true. + + + + + + + + + + + + + + + + + + + + + + New-Port + + + This Cmdlet will create a new Port. + + + + + New + Port + + + + + This Cmdlet will create a new Port. + + + + + + + + + + + + + n + + + The name of the new Port + + + string + + + + asu + + + Determines if the AdminStateUp flag is true or false. + + + string + + + + nid + + + The id of the Network where the Port will exist. + + + string + + + + did + + + The Ports DeviceId + + + string + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # new-port "testPort1" -nid bd1c30f7-71f1-455e-b91e-8d03da7f5224 -asu -did "sdf\etc" + + + Description + ----------- + + This command will create a new Port called testNet1 on Network bd1c30f7-71f1-455e-b91e-8d03da7f5224 with its AdminStateUp set to true and a Device = sdf/etc. + + + + + + + + + + + + + + + + + + + + + + New-Router + + + This Cmdlet will create a new Router. + + + + + New + Router + + + + + This Cmdlet will create a new Router. + + + + + + + + + + + + + n + + + The name of the new Router + + + string + + + + asu + + + Determines if the AdminStateUp flag is true or false. + + + string + + + + egw + + + The id of the External Gateway Network Id. + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # new-router "testRouter1" -asu -egw bd1c30f7-71f1-455e-b91e-8d03da7f5224 + + + Description + ----------- + + This command will create a new Router called testRouter1 on External Network bd1c30f7-71f1-455e-b91e-8d03da7f5224 with its AdminStateUp set to true. + + + + + + + + + + + + + + + + + + + + + + New-RouterInterface + + + This Cmdlet will create a new Router. + + + + + New + RouterInterface + + + + + This Cmdlet will create a new RouterInterface. + + + + + + + + + + + + + rid + + + The Router Id + + + string + + + + sid + + + The Subnet Id + + + string + + + + pid + + + The Port Id + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # new-routerinterface -rid bd1c30f7-71f1-455e-b91e-8d03da7f5224 -pid c9e32588-5b69-4100-a1a6-fa49094ec0a8 -sid 7yuu9886-5b69-4100-a1a6-fa49094ec0a8 + + + Description + ----------- + + This command will create a new Relationship between Router (bd1c30f7-71f1-455e-b91e-8d03da7f5224), Port (c9e32588-5b69-4100-a1a6-fa49094ec0a8) and Subnet (7yuu9886-5b69-4100-a1a6-fa49094ec0a8) + + + + + + + + + + + + + + + + + + + + + + New-Subnet + + + This Cmdlet will create a new Subnet. + + + + + New + Subnet + + + + + This Cmdlet will create a new Subnet. + + + + + + + + + + + + + nid + + + The id of the Network Id. + + + string + + + + ipv + + + Sets the IP Version + + + string + + + + c + + + The CIDR value + + + string + + + a + + + A comma seperated list of Allocation Pools. + + + string + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # new-subnet -nid bd1c30f7-71f1-455e-b91e-8d03da7f5224 -ipv 4 -c "10.0.6.0/24" -a "10.0.6.20", "10.0.6.22" , "10.0.6.26", "10.0.6.29" + + + Description + ----------- + + This command will create a new Subnet. + + + + + + + + + + + + + + + + + + + + + + Update-FloatingIP + + + This Cmdlet will update an existing FloatingIP. + + + + + Update + FloatingIP + + + + + This Cmdlet will update an existing FloatingIP. + + + + + + + + + + + + + id + + + The identifier of the Floating IP + + + string + + + + pid + + + The identifier of the Port Id + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # update-FLoatingIP -fid 12857174-99cf-40e9-999e-fb0fa2e84898 -pid c9e32588-5b69-4100-a1a6-fa49094ec0a8 + + + Description + ----------- + + This command will reassign the Floating IP (12857174-99cf-40e9-999e-fb0fa2e84898) to the new Port (c9e32588-5b69-4100-a1a6-fa49094ec0a8) + + + + + + + + + + + + + + + + + + + + + + Update-Network + + + This Cmdlet will update an existing Network. + + + + + Update + Network + + + + + This Cmdlet will update an existing Network. + + + + + + + + + + + + + id + + + The identifier of the Network IP + + + string + + + + n + + + The Networks name + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # update-Network -id 12857174-99cf-40e9-999e-fb0fa2e84898 -n "NewNameTest" + + + Description + ----------- + + This command will change the Network(12857174-99cf-40e9-999e-fb0fa2e84898) name to NewNameTest. + + + + + + + + + + + + + + + + + + + + + + Update-Port + + + This Cmdlet will update an existing Port. + + + + + Update + Port + + + + + This Cmdlet will update an existing Port. + + + + + + + + + + + + + id + + + The identifier of the Port IP + + + string + + + + did + + + The Device Id + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # update-Port -id 12857174-99cf-40e9-999e-fb0fa2e84898 -did "984456484-76cf-431t-66f-uyt5674567543" + + + Description + ----------- + + This command will change the Port(12857174-99cf-40e9-999e-fb0fa2e84898) device to the devie with Id = 984456484-76cf-431t-66f-uyt5674567543 + + + + + + + + + + + + + + + + + + + + + + Update-Router + + + This Cmdlet will update an existing Router. + + + + + Update + Router + + + + + This Cmdlet will update an existing Router. + + + + + + + + + + + + + id + + + The identifier of the Router + + + string + + + + nid + + + The identifier of the Network + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # update-Router -id 12857174-99cf-40e9-999e-fb0fa2e84898 -nid c9e32588-5b69-4100-a1a6-fa49094ec0a8 + + + Description + ----------- + + This command will reassign the Router(12857174-99cf-40e9-999e-fb0fa2e84898) to Network (c9e32588-5b69-4100-a1a6-fa49094ec0a8) + + + + + + + + + + + + + + + + + + + + + + Update-Subnet + + + This Cmdlet will update an existing Subnet. + + + + + Update + Subnet + + + + + This Cmdlet will update an existing Subnet. + + + + + + + + + + + + + id + + + The identifier of the Subnet + + + string + + + + egw + + + The identifier of the External Network Gateway + + + string + + + + n + + + The new name of the Subnet + + + string + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # update-Subnet -id 12857174-99cf-40e9-999e-fb0fa2e84898 -egw c9e32588-5b69-4100-a1a6-fa49094ec0a8 -n "NewSubnetName" + + + Description + ----------- + + This command will reassign the Subnet(12857174-99cf-40e9-999e-fb0fa2e84898) to External Network (c9e32588-5b69-4100-a1a6-fa49094ec0a8) with the new name of "NewSubnetName" + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get-Metadata + + + This Cmdlet will list out the Metadata entries assigned to the supplied resource. You can currently list metadata assigned to Servers, Storage Objects , Containers and CDN Containers. + + + + + Get + Metadata + + + + + Many resources can have zero to many custom meta-data entries assigned to them. This is essentially a list of Key Value Pairs attached to the resource that you may use for whatever you would like. + + + + + + + + + + + + + sp + + + The path to the remote Storage Object. Paths may be expressed as fully qualified or relative to the current location in the store. + + + string + + + + cn + + + The Container Name. + + + string + + + + cdn + + + The CDN Container Name. + + + string + + + + sid + + + The Server ID. + + + string + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourContainer:\> + + + # Get-metadata test.txt + + + Description + ----------- + + This command will print out a list of name value pairs assigned to the. For details on how to add meta-data elements see the Set-Metadata Cmdlet. + + + + + + + + + + + + + + + + EXAMPLE 2 + + + + + + # Get-metadata -sid 23465 + + + Description + ----------- + + This command will print out all Metadata entries for the Server with an ID = 23465. + + + + + + + + + + + + + + + + EXAMPLE 3 + + + + + + # Get-metadata -cn "Marketing" + + + Description + ----------- + + This command will print out all Metadata entries for the Marketing Container. + + + + + + + + + + + + + + + + EXAMPLE 4 + + + + + + # Get-metadata -cdn "Marketing" + + + Description + ----------- + + This command will print out all Metadata entries for the Marketing CDN Container. + + + + + + + + + + + + + + + + + + + + + + + + Set-Metadata + + + This Cmdlet can be used to add meta-data elements to an existing resource. + + + + + Set + Metadata + + + + + Resources can have zero to many custom meta-data entries assigned to them. This is essentially a list of Key Value Pairs attached to the object that you may use for whatever you would like. + + + + + + Set-Metadata [-sp] [-sid] [-cdn] -md + + + + + + + sp + + + The path to a remote Storage Object. Paths may be expressed as fully qualified or relative to the current location in the store. + + + string + + + md + + + This is a comma delimited set of Name Value Pairs enclosed in quotes. the Key and Values are delimited by the pipe symbol." + + + string + + + + sid + + + The Server Id + + + string + + + + cdn + + + The CDN Container name. + + + string + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourContainer:\> + + + # Set-metadata test.txt -md "Author|Tom", "Editor|Sam" + + + Description + ----------- + + This example shows us adding two seperate KVPs to the test.txt file. + + + + + + + + + + + + + + + + EXAMPLE 2 + + + + + + # Set-metadata -sid 1345 -md "Author|Tom", "Editor|Sam" + + + Description + ----------- + + This example applies the Key Value Pair (-md argument) to the Server with an Id = 1345. + + + + + + + + + + + + + + + + EXAMPLE 3 + + + + + + # Set-metadata -cdn "Marketing" -md "Author|Tom", "Editor|Sam" + + + Description + ----------- + + This example applies the Key Value Pair (-md argument) to the CDN Container called Marketing. + + + + + + + + + + + + + + + + + + + + + + + + Get-URI + + + This Cmdlet will show the fully qualified URI of an object in storage. + + + + + Get + Metadata + + + + + + + + + + + s + + + + + + + s + + + The path to the remote Storage Object. Paths may be expressed as fully qualified or relative to the current location in the store. + + + string + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourContainer:\> + + + # Get-URI test.xml + + + Description + ----------- + + This example shows the fully qualifed URI for the test.xml file located in the current directory. + + + + + + + + + + + + + + + + + + + + + + + Remove-Item + + + This Cmdlet remove an object in storage. + + + + + Remove + Item + + + + + + + + + + + s + + + + + + + t + + + The path to the remote Storage Object. Paths may be expressed as fully qualified or relative to the current location in the store. + + + string + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourContainer:\> + + + # Remove-Item test.xml + + + Description + ----------- + + This example the test.xml file located in the current directory. + + + + + + + + + + + + + + + + + + + + + + + + + + + Set-Scope + + + This sets a Containers scope to public. + + + + + Get + Metadata + + + + + To allow users other than the owner of a Container to access resources you need to set the Containers scope to Public with this cmdlet. + + + + + + SourcePath + + + + + + + Name + + + The Containers name. + + + string + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourContainer:\> + + + #set-scope testContainer -s public + + + Description + ----------- + + This example shows us changing the testContainers scope to public. + + + + + + + + + + + + + + + + + + + + + + + Remove-Container + + + Removes the specified Container from the system optionally forcing the operation to complete without confirmation. + + + + + Remove + Container + + + + + + + + + + + + + + Name + + + The name of the Container to remove. + + + string + + + + ForceDelete + + + This switch forces the Container to be removed without any confirmation prompt. + + + string + + + cdn + + + Removes any associated CDN entry when the Container is removed. + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourContainer:\> + + + # remove-container testContainer + + + Description + ----------- + + Removes testContainer from the system but prompts the user for confirmation before continuing. + + + + + + + + + + + + + + + + EXAMPLE 2 + + + PS yourContainer:\> + + + # remove-container testContainer -fd + + + Description + ----------- + + Forces the system to delete the specified Container without confirmation from the user. + + + + + + + + + + + + + + + + + + + + + + + + New-Container + + + This Cmdlet create a new storage Container. + + + + + New + Container + + + + + You must be a registered user of the OpenStack Cloud Services platform in order to perform this operation because it requires a valid access key id to authenticate the request. Therefore anonymous requests can not create Containers. When you create a Container, you become the Container owner. + + + + + + Name + + + + + + Name + + + The name of the Container to create. + + + + + string + + + Url + + + The url to a Shared Container. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + PS yourContainer:\> + + + # New-Container marketing + + + Description + ----------- + + This command will create a new Container named marketing. + + + + + + + + + + + + + + + EXAMPLE 2 + + + PS yourContainer:\> + + + # New-Container https://region-a.geo-1.objects.Openstacksvc.com/v1/AUTH_2485a207-71a4-4429-9e24-f7bf49e207fc/testcon + + + Description + ----------- + + This command will allow use of the Shared Container named testcon. + + + + + + + + + + + + + + + + + + + + + + + + + + + + New-Volume + + + This Cmdlet creates a new Block Storage Volume. + + + + + New + Volume + + + + + + + + + + + New-Volume + + + + + + svid + + + The Source Volume Id to derive this volume from. The Source Volume Id must reside in the same AZ as the one you are creating. + + + + + string + + + az + + + The target Availability Zone to create the Volume in. + + + + + string + + + Name + + + The name of the Volume to create. + + + + + string + + + Description + + + A quick description of the Volumes purpose. + + + + + string + + + Size + + + The size (in Gb) of the Volume. + + + + + string + + + Metadata + + + Additional Metadata associated with the Volume. This will be a comma delimited set of name value pairs which are themselves pipe delimited. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # New-Volume "TestVolume" "This is a simple Volume test" 20 + + + Description + ----------- + + This command will create a new 20 gig Volume. + + + + + + + + + + + + + + + EXAMPLE 2 + + + + + + # New-Volume "TestVolume" "This is a simple Volume test" 20 "test|data", "another|test" + + + Description + ----------- + + This command will create a new 20 gig Volume with additional metadata + + + + + + + + + + + + + + + + + + + + + + + + Remove-Volume + + + This Cmdlet deletes an existing Block Storage Volume. + + + + + Remove + Volume + + + + + + + + + + + Remove-Volume + + + + + + VolumeId + + + The Volumes unique identifier. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Remove-Volume 12857174-99cf-40e9-999e-fb0fa2e84898 + + + Description + ----------- + + This command will remove a existing Volume with an Id = 12857174-99cf-40e9-999e-fb0fa2e84898. + + + + + + + + + + + + + + + + + + + + + + + + + Attach-Volume + + + This Cmdlet associates a Volume with an existing Server. + + + + + Attach + Volume + + + + + + + + + + + Attach-Volume + + + + + + id + + + The id of the target Server. + + + + + string + + + VolumeId + + + The Volumes unique identifier. + + + + + string + + + Device + + + The associations Device name. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Attach-Volume -s 12857174-99cf-40e9-999e-fb0fa2e84898 -v 7da74520-9d5e-427b-a508-213c84e69616 "/dev/vdp" + + + Description + ----------- + + This command will associate Volume 7da74520-9d5e-427b-a508-213c84e69616 to Server 12857174-99cf-40e9-999e-fb0fa2e84898 with an assigned device name of /dev/vdX. + + + + + + + + + + + + + + + + + + + + + + + Detach-Volume + + + This Cmdlet disassociates a Volume with an existing Server. + + + + + Detach + Volume + + + + + + + + + + + Detach-Volume + + + + + + Id + + + The id of the target Server. + + + + + string + + + VolumeId + + + The Volumes unique identifier. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Detach-Volume -v 7da74520-9d5e-427b-a508-213c84e69616 -s 4ee64397-1253-473c-a81d-bc23dceeef31 + + + Description + ----------- + + This command will disassociate Volume a508 from Server 4ee64397-1253-473c-a81d-bc23dceeef31. + + + + + + + + + + + + + + + + + + + + + + + New-Snapshot + + + This Cmdlet creates a new Block Storage Snapshot. + + + + + New + Snapshot + + + + + + + + + + + New-Snapshot + + + + + + Name + + + The name of the Snapshot to create. + + + + + string + + + Description + + + A quick description of the Snapshots contents. + + + + + string + + + VolumeId + + + The Id of the Volume that we're taking the snapshot of. + + + + + string + + + Force + + + Force + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # New-Snapshot -n "TestSnapshot" -d "This is a simple Snapshot test" -v 4ee64397-1253-473c-a81d-bc23dceeef31 + + + Description + ----------- + + This command will create a new snapshot of Volume 4ee64397-1253-473c-a81d-bc23dceeef31 + + + + + + + + + + + + + + + + + + + + + + + Remove-Snapshot + + + This Cmdlet deletes an existing Block Storage Snapshot. + + + + + Remove + Snapshot + + + + + + + + + + + Remove-Snapshot + + + + + + SnapshotId + + + The Snapshots unique identifier. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Remove-Snapshot -s 4ee64397-1253-473c-a81d-bc23dceeef31 + + + Description + ----------- + + This command will remove a existing Snapshot with an Id = 4ee64397-1253-473c-a81d-bc23dceeef31. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + New-Keypair + + + This Cmdlet creates a new keypair for the user. + + + + + New + Keypair + + + + + + + + + + + New-Keypair + + + + + + Name + + + The name of the Keypair to create. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # New-Keypair "TestKey" + + + Description + ----------- + + This command will create a new Keypair named TestKey. + + + + + + + + + + + + + + + + + + + + + + + + Remove-Keypair + + + This Cmdlet deletes a previously created keypair for the user. + + + + + Remove + Keypair + + + + + + + + + + + Remove-Keypair + + + + + + Name + + + The name of the Keypair to delete. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Remove-Keypair "TestKey" + + + Description + ----------- + + This command will delete an existing Keypair named TestKey. + + + + + + + + + + + + + + + + + + + + + + + + Disassociate-IP + + + This Cmdlet releases a previously allocated IP address. + + + + + Disassociate + IP + + + + + + + + + + + Disassociate-IP + + + + + + ip + + + The IP address to release. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Disassociate-IP 4ee64397-1253-473c-a81d-bc23dceeef31 + + + Description + ----------- + + This command will release a previously allocated IP address. + + + + + + + + + + + + + + + + + + + + + + + + UnAssign-IP + + + This Cmdlet assigns an existing IP address to an existing Server. + + + + + UnAssign + IP + + + + + + + + + + + UnAssign-IP + + + + + + ip + + + The IP address to disassociate. + + + + + string + + + sid + + + The Server Id that will be disassociated from the supplied IP address. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + #Unassign-IP "192.168.110.45" -s 4ee64397-1253-473c-a81d-bc23dceeef31 + + + Description + ----------- + + This command will remove the supplied IP address from server 4ee64397-1253-473c-a81d-bc23dceeef31 + + + + + + + + + + + + + + + + + + + + + + + + Assign-IP + + + This Cmdlet assigns an existing IP address to an existing Server. + + + + + Assign + IP + + + + + + + + + + + Assign-IP + + + + + + ip + + + The IP address to assign. + + + + + string + + + sid + + + The Server Id that will be assigned to. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + #Assign-IP "192.168.110.45" -s 4ee64397-1253-473c-a81d-bc23dceeef31 + + + Description + ----------- + + This command will assign the supplied IP address to server 4ee64397-1253-473c-a81d-bc23dceeef31 + + + + + + + + + + + + + + + + + + + + + + + + New-CDN + + + This Cmdlet will create a new CDN entry for the specified Container. + + + + + New + CDN + + + + + + + + + + + New-CDN + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # New-CDN -n "TestContainer" + + + Description + ----------- + + Associates a new CDN entry for the existing Container called TestContainer. + + + + + + + + + + + + + + + + + + + + + + + + Remove-CDN + + + This Cmdlet will remove a CDN entry for the specified Container. + + + + + Remove + CDN + + + + + + + + + + + Remove-CDN + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Remove-CDN -n "TestContainer" + + + Description + ----------- + + Disassociates the CDN entry for existing container TestContainer. + + + + + + + + + + + + + + + + + + + + + + + + List-CDN + + + This Cmdlet will list out all Containers that have associated CDN entries. + + + + + List + CDN + + + + + + + + + + + List-CDN + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # List-CDN + + + Description + ----------- + + This cmdlet will list out all Containers with associated CDN entries. + + + + + + + + + + + + + + + + + + + + + + + + Set-Zone + + + This Cmdlet will force subsequent cmdlets to utilize the Availability Zone supplied. + + + + + Set + Zone + + + + + + + + + + + Set-Zone + + + + + + z + + + The Availability ZoneID to be set. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Set-Zone 1 + + + Description + ----------- + + This command will cause all susequent Compute related IO to be directed to the AZ-2 Zone which has the Id of 1. The Id's for each Zone can be found by issueing the Get-Zones cmdlet. + + + + + + + + + + + + + + + + + + + + + + + + Set-ZoneColor + + + This command will set all output to a specific color when the User selects the Zone via Set-Zone. + + + + + Set + ZoneColor + + + + + + + + + + + Set-ZoneColor + + + + + + z + + + The Availability ZoneID to be set. + + + + + string + + + c + + + The color for the zones output. Valid values are "Black", "Blue", "Cyan", "DarkBlue", "DarkCyan", "DarkGray", "DarkGreen", "DarkMagenta", "DarkRed", "DarkYellow", "Gray", "Green", "Magenta", "Red", "White", and "Yellow". + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Set-ZoneColor -z 1 -c Green + + + Description + ----------- + + This command will set all output to Green when the User selects the Zone via Set-Zone. + + + + + + + + + + + + + + + + + + + + + + + + Get-Zone + + + This Cmdlet will current Availability Zone being used. + + + + + Get + Zone + + + + + + + + + + + Get-Zone + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Get-Zone + + + Description + ----------- + + This command will simply show the current Availability Zone in use. + + + + + + + + + + + + + + + + + + + + + + + + Associate-IP + + + This Cmdlet will request a new Floating IP address from the server. + + + + + Associate + IP + + + + + + + + + + + Associate-IP + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Associate-IP + + + Description + ----------- + + Request a new Floating IP address from the server. + + + + + + + + + + + + + + + + + + + + + + + + Add-Rule + + + This Cmdlet creates a new Security Group Rule and assigns it to an existing Security Group + + + + + Add + Rule + + + + + + + + + + + Add-Rule + + + + + + d + + + Ingress or egress: The direction in which the security group rule is applied. For a compute instance, an ‘ingress’ security group rule matches traffic that is incoming (ingress) for that instance. An ‘egress’ rule is applied to traffic leaving the instance. + + + + + string + + + max + + + The maximum port number in the range that is matched by the security group rule. The port_range_min attribute constrains the port_range_max attribute. If the protocol is ICMP, this value must be an ICMP type. + + + + + string + + + min + + + The minimum port number in the range that is matched by the security group rule. If the protocol is TCP or UDP, this value must be less than or equal to the value of the port_range_max attribute. If the protocol is ICMP, this value must be an ICMP type. + + + + + string + + + p + + + The protocol that is matched by the security group rule. Valid values are null, tcp, udp, and icmp. + + + + + string + + + rgid + + + The remote group ID to be associated with this security group rule. + + + + + string + + + ripp + + + The remote IP prefix to be associated with this security group rule. + + + + + string + + + sgid + + + The Security GroupId used to apply this rule. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Add-Rule -min "80" -max "85" -d "ingress" -et -p icmp IPv4 -sgid 2076db17-a522-4506-91de-c6dd8e837028 + + + Description + ----------- + + This will create a new Security Group Rule affecting the tcp protocol from port 80 to 85 and assign it to SecurityGroup 2076db17-a522-4506-91de-c6dd8e837028. + + + + + + + + + + + + + + + + + + + + + + + + Remove-Rule + + + This Cmdlet will delete an existing Security Group Rule. + + + + + Remove + Rule + + + + + + + + + + + Remove-Rule + + + + + + id + + + The Security GroupRuleId used to remove the rule. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Remove-Rule -id 4ee64397-1253-473c-a81d-bc23dceeef31 + + + Description + ----------- + + Remove the SecurityGroupRule with an Id of 4ee64397-1253-473c-a81d-bc23dceeef31. + + + + + + + + + + + + + + + + + + + + + + + + New-SecurityGroup + + + This Cmdlet creates a new Security Group. + + + + + New + SecurityGroup + + + + + + + + + + + New-SecurityGroup + + + + + + n + + + The name of the new Security Group. + + + + + string + + + d + + + A brief description of the groups purpose. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # New-SecurityGroup -n "TestGroup" -d "SomeDescription" + + + Description + ----------- + + This command will create a simple test Security Group. + + + + + + + + + + + + + + + + + + + + + + + + Remove-SecurityGroup + + + This Cmdlet will delete an existing Security Group. + + + + + Remove + SecurityGroup + + + + + + + + + + + Remove-SecurityGroup + + + + + + id + + + The identifier used to remove the Security Group. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Remove-SecurityGroup -id 4ee64397-1253-473c-a81d-bc23dceeef31 + + + Description + ----------- + + Remove the Security Group with an Id of 4ee64397-1253-473c-a81d-bc23dceeef31. + + + + + + + + + + + + + + + + + + + + + + + + Add-Metadata + + + This Cmdlet associates a set of key value pairs with a Server. + + + + + Add + Metadata + + + + + + + + + + + Add-Metadata + + + + + + md + + + A pipe delimited set of Name Value Pairs seperated by commas. "Namevalue1 | value1" , "NameValue2 | value2", "NameValue3 | value3" etc.. + + + + + string + + + s + + + The identifier (ServerId) used to associate this metadata with. If your currently viewing a Servers details this parameter may be ommited as it's supplied for you. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Add-Metadata -md "Namevalue1 | value1" , "NameValue2 | value2", "NameValue3 | value3" -s 4ee64397-1253-473c-a81d-bc23dceeef31 + + + Description + ----------- + + This command will add threee Name Value Pairs to Server 4ee64397-1253-473c-a81d-bc23dceeef31. + + + + + + + + + + + + + + + + + + + + + + + + New-Server + + + This Cmdlet creates a new Server. + + + + + New + Server + + + + + + + + + + + New-Server + + + + + + nid + + + A Comma seperated list of targeted network Ids. + + + + + string + + + az + + + Ther Servers Availability Zone + + + + + string + + + + n + + + The Servers name. + + + + + string + + + i + + + The identifier (ImageRefId) used to define this Server. + + + + + string + + + k + + + The name of a keypair to assign to the newly created Server. + + + + + string + + + sg + + + A comma delimited set of quoted SecurityGroup names that are to be applied to the newly created Server. + + + + + string + + + f + + + The identifier (FlavorRefId) used to define this Server. + + + + + string + + + p + + + A password may be specified when creating the server via this optional parameter. If a password is not specified, a randomly generated password will be assigned and returned in the response. + + + + + string + + + ip4 + + + ip4 based access address. + + + + + string + + + ip6 + + + ip6 based access address. + + + + + string + + + md + + + A pipe delimited set of Name Value Pairs seperated by commas. "Namevalue1 | value1" , "NameValue2 | value2", "NameValue3 | value3" etc.. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # New-Server -n "TestServer" -p "gooblygook" -i "2111" -f "100" -md "Namevalue1 | value1" , "NameValue2 | value2", "NameValue3 | value3" -s 4ee64397-1253-473c-a81d-bc23dceeef31 + + + Description + ----------- + + This command will create a new server with some metadata. + + + + + + + + + + + + + + + EXAMPLE 2 + + + + + + # New-Server -n "TestServer" -p "gooblygook" -i "2111" -f "100" -s "2133" -k "testkey" + + + Description + ----------- + + This command will create a new server using the testkey keypair name. + + + + + + + + + + + + + + + + + + + + + + + + Reboot-Server + + + This cmdlet allows for either a soft or hard reboot of a server. With a soft reboot, the operating system is signaled to restart, which allows for a graceful shutdown of all processes. A hard reboot is the equivalent of power cycling the server. + + + + + Reboot + Server + + + + + + + + + + + Reboot-Server + + + + + + id + + + The Servers identifier. + + + + + string + + + + + + + + + + + + t + + + + + + With a soft reboot (SOFT), the operating system is signaled to restart, which allows for a graceful shutdown of all processes. A hard reboot (HARD) is the equivalent of power cycling the server. + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Reboot-Server -s 4ee64397-1253-473c-a81d-bc23dceeef31 -t "SOFT" + + + Description + ----------- + Perform a soft reboot on the specified server + + + + + + + + + + + + + + + + + + + + + + + + Remove-Server + + + This cmdlet deletes an existing Server. + + + + + Remove + Server + + + + + + + + + + + Remove-Server + + + + + + id + + + The Servers identifier. + + + + + string + + + + + + + + + + + + t + + + + + + Deletes an existing Server. + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Remove-Server -s 4ee64397-1253-473c-a81d-bc23dceeef31 + + + Description + ----------- + + Deletes the server with the identifier 4ee64397-1253-473c-a81d-bc23dceeef31. + + + + + + + + + + + + + + + + + + + + + + + + Reset-Password + + + This cmdlet resets the administrators password for the given Server. + + + + + Reset + Password + + + + + + + + + + + Reset-Password + + + + + + id + + + The Servers identifier. + + + + + string + + + + + + + + + + + + p + + + + + + The password which must meet the complexity requirements set by your OpenStack Compute provider. + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Reset-Password -id 4ee64397-1253-473c-a81d-bc23dceeef31 -p "testpassword08" + + + Description + ----------- + + Resets the Admin password on Server 4ee64397-1253-473c-a81d-bc23dceeef31. + + + + + + + + + + + + + + + + + + + + + + + + Update-Server + + + This cmdlet allows you to change the Servers name property. + + + + + Update + Server + + + + + + + + + + + Update-Server + + + + + + id + + + The Servers identifier. + + + + + string + + + + + + + + + + + + n + + + + + + The new Server name. + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # Update-Server -id 4ee64397-1253-473c-a81d-bc23dceeef31 -n "NewName" + + + Description + ----------- + + Updates Server 4ee64397-1253-473c-a81d-bc23dceeef31 to the new name of NewName. + + + + + + + + + + + + + + + + + + + + + + + + New-Image + + + This Cmdlet crfeates a new Image based on an existing Server. + + + + + New + Image + + + + + + + + + + + New-Image + + + + + + md + + + A pipe delimited set of Name Value Pairs seperated by commas. "Namevalue1 | value1" , "NameValue2 | value2", "NameValue3 | value3" etc.. + + + + + string + + + s + + + The identifier (ServerId) to base the Image on. + + + + string + + + n + + + The name of the new Image. + + + + + string + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXAMPLE 1 + + + + + + # New-Image -md "Namevalue1 | value1" , "NameValue2 | value2", "NameValue3 | value3" -s 4ee64397-1253-473c-a81d-bc23dceeef31 -n "TestImage" + + + Description + ----------- + + This command will add three Name Value Pairs to the image for Server 4ee64397-1253-473c-a81d-bc23dceeef31. + + + + + + + + + + + + + + + + + + + diff --git a/Openstack.Client.Powershell/bin/Release/Openstack.Client.Powershell.dll.config b/Openstack.Client.Powershell/bin/Release/Openstack.Client.Powershell.dll.config new file mode 100644 index 0000000..6193adb --- /dev/null +++ b/Openstack.Client.Powershell/bin/Release/Openstack.Client.Powershell.dll.config @@ -0,0 +1,15 @@ + + + + +
+ + + + + + C:\Projects\OS\Openstack.Client.Powershell\Openstack.Client.AsyncQueue\Openstack.Client.AsyncQueue\bin\Debug\Openstack.Client.AsyncQueue.exe + + + + diff --git a/Openstack.Client.Powershell/bin/Release/Openstack.Client.Powershell.pdb b/Openstack.Client.Powershell/bin/Release/Openstack.Client.Powershell.pdb new file mode 100644 index 0000000..fb724ee Binary files /dev/null and b/Openstack.Client.Powershell/bin/Release/Openstack.Client.Powershell.pdb differ diff --git a/Openstack.Client.Powershell/bin/Release/Openstack.Common.dll b/Openstack.Client.Powershell/bin/Release/Openstack.Common.dll new file mode 100644 index 0000000..b59a9f0 Binary files /dev/null and b/Openstack.Client.Powershell/bin/Release/Openstack.Common.dll differ diff --git a/Openstack.Client.Powershell/bin/Release/Openstack.Common.pdb b/Openstack.Client.Powershell/bin/Release/Openstack.Common.pdb new file mode 100644 index 0000000..9053af2 Binary files /dev/null and b/Openstack.Client.Powershell/bin/Release/Openstack.Common.pdb differ diff --git a/Openstack.Client.Powershell/bin/Release/Openstack.Objects.dll b/Openstack.Client.Powershell/bin/Release/Openstack.Objects.dll new file mode 100644 index 0000000..d639536 Binary files /dev/null and b/Openstack.Client.Powershell/bin/Release/Openstack.Objects.dll differ diff --git a/Openstack.Client.Powershell/bin/Release/Openstack.Objects.pdb b/Openstack.Client.Powershell/bin/Release/Openstack.Objects.pdb new file mode 100644 index 0000000..5dae925 Binary files /dev/null and b/Openstack.Client.Powershell/bin/Release/Openstack.Objects.pdb differ diff --git a/Openstack.Client.Powershell/bin/Release/Openstack.dll b/Openstack.Client.Powershell/bin/Release/Openstack.dll new file mode 100644 index 0000000..a04473f Binary files /dev/null and b/Openstack.Client.Powershell/bin/Release/Openstack.dll differ diff --git a/Openstack.Client.Powershell/bin/Release/Openstack.pdb b/Openstack.Client.Powershell/bin/Release/Openstack.pdb new file mode 100644 index 0000000..83b114e Binary files /dev/null and b/Openstack.Client.Powershell/bin/Release/Openstack.pdb differ diff --git a/Openstack.Client.Powershell/bin/Release/OpenstackShell.format.ps1xml b/Openstack.Client.Powershell/bin/Release/OpenstackShell.format.ps1xml new file mode 100644 index 0000000..e9597e8 --- /dev/null +++ b/Openstack.Client.Powershell/bin/Release/OpenstackShell.format.ps1xml @@ -0,0 +1,1729 @@ + + + + + + + service + + Openstack.Objects.Domain.Admin.Zone + + + + + + + 8 + left + + + + 20 + left + + + + 23 + left + + + + 10 + left + + + + + + + + Id + + + Name + + + ShellForegroundColor + + + IsDefault + + + + + + + + + service + + Openstack.Objects.Domain.BlockStorage.Snapshot + + + + + + + 3 + left + + + + 40 + left + + + + 20 + left + + + + 40 + left + + + + 22 + left + + + + 18 + left + + + + 7 + left + + + + 40 + left + + + + + + + QuickPickNumber + + + Id + + + DisplayName + + + Description + + + CreationDate + + + Status + + + Size + + + VolumeId + + + + + + + + + + + service + + Openstack.Objects.Domain.BlockStorage.VolumeBackup + + + + + + 3 + left + + + + 45 + left + + + + 20 + left + + + + 20 + left + + + + 8 + left + + + + 10 + left + + + + 10 + left + + + + 28 + left + + + + 18 + left + + + + 42 + left + + + + + + + QuickPickNumber + + + Id + + + Name + + + Container + + + Size + + + Status + + + AvailabilityZone + + + CreatedDate + + + ObjectCount + + + VolumeId + + + + + + + + + + service + + Openstack.Objects.Domain.BlockStorage.Volume + + + + + + 3 + left + + + + 45 + left + + + + 20 + left + + + + 30 + left + + + + 6 + left + + + + 8 + left + + + + 8 + left + + + + 22 + left + + + + 10 + left + + + + 10 + left + + + + 10 + left + + + + 30 + left + + + + 40 + left + + + + + + + QuickPickNumber + + + Id + + + Name + + + Description + + + VolumeType + + + Size + + + IsBootable + + + CreationDate + + + Status + + + AvailabilityZone + + + Device + + + AttachedTo + + + SourceVolid + + + + + + + + + KeyPair + + Openstack.Objects.Domain.Server.KeyPair + + + + + + + 40 + left + + + + + 50 + left + + + + + 330 + left + + + + + + + + + + Name + + + + Fingerprint + + + + PublicKey + + + + + + + + + + + + + Port + + Openstack.Objects.Domain.Networking.Port + + + + + + + + 3 + left + + + + + 40 + left + + + + + 13 + left + + + + + 6 + left + + + + 16 + left + + + + 25 + left + + + + 40 + left + + + + 40 + left + + + + 21 + left + + + + 16 + left + + + + + + + + + QuickPickNumber + + + Id + + + Name + + + Status + + + AdminStateUp + + + MacAddress + + + DeviceOwner + + + DeviceId + + + PortSecurityEnabled + + + BindingType + + + + + + + + + + Subnet + + Openstack.Objects.Domain.Networking.Subnet + + + + + + + 3 + left + + + + + 40 + left + + + + + 34 + left + + + + + 7 + left + + + + 24 + left + + + + 11 + left + + + + 24 + left + + + + + + + QuickPickNumber + + + Id + + + Name + + + EnableDHCP + + + Cidr + + + IPVersion + + + GatewayIP + + + + + + + + + service + + Openstack.Client.Powershell.Utility.ServiceProvider + + + + + + 15 + left + + + + 80 + left + + + + 7 + left + + + + 30 + left + + + + + + + Name + + + AuthenticationServiceURI + + + IsDefault + + + + DefaultTenantId + + + + + + + + + service + + Openstack.Objects.Domain.Networking.FloatingIP + + + + + + + 3 + left + + + + + 42 + left + + + + + 20 + left + + + + + 42 + left + + + + + 15 + left + + + + + 15 + left + + + + + 15 + left + + + + + + + + + + QuickPickNumber + + + + Id + + + + FloatingIPAddress + + + + FloatingNetworkId + + + + FixedIPAddress + + + + PortId + + + + RouterId + + + + + + + + + + StorageContainer + + Openstack.Objects.Domain.StorageContainer + + + + + + 40 + left + + + + + + + Name + + + + + + + + + Network + + Openstack.Objects.Domain.Networking.Network + + + + + + + + 3 + left + + + + + 40 + left + + + + + 13 + left + + + + + 6 + left + + + + + 6 + left + + + + + 6 + left + + + + + + + + + + QuickPickNumber + + + + Id + + + + Name + + + + IsExternal + + + + Shared + + + + PortSecurityEnabled + + + + + + + + + + service + + Openstack.Objects.Domain.Admin.Service + + + + + + + 20 + left + + + + + 27 + left + + + + + + + + + + Type + + + + Name + + + + + + + + + + process4 + + Openstack.Client.Powershell.Providers.ObjectStorage.StorageItemModelView + + + + + + 47 + left + + + + 13 + left + + + + 25 + left + + + + 40 + left + + + + + + + Name + + + Size + + + LastModifiedDate + + + Type + + + + + + + + + + process4 + + Openstack.Storage.StorageObject + + + + + + 47 + left + + + + 13 + left + + + + 25 + left + + + + 40 + left + + + + + + + Name + + + Length + + + LastModified + + + ContentType + + + + + + + + + process5 + + Openstack.Storage.StorageFolder + + + + + + 47 + left + + + + + 40 + left + + + + + + + Name + + + + ContentType + + + + + + + + + Router + + Openstack.Objects.Domain.Networking.Router + + + + + + + 3 + left + + + + + 40 + left + + + + 47 + left + + + + + 13 + left + + + + + 14 + left + + + + + + + + + + + QuickPickNumber + + + + Id + + + Name + + + + Status + + + AdminStateUp + + + + + + + + + + + process + + Openstack.Client.Powershell.Providers.Common.BaseUIContainer + + + + + + + 15 + left + + + + + 100 + left + + + + + 13 + left + + + + + 40 + left + + + + + + + + + Name + + + + Description + + + ObjectType + + + Path + + + + + + + + + process + + Openstack.Administration.Domain.User + + + + + + + 15 + left + + + + + 20 + left + + + + + 20 + left + + + + + + + + + AccountId + + + + Username + + + Name + + + + + + + + + + process + + Openstack.Objects.Domain.Compute.Account + + + + + + + 15 + left + + + + + 20 + left + + + + + + + + + + Id + + + Name + + + + + + + + + + process + + Openstack.Administration.Domain.Group + + + + + + + 40 + left + + + + + 26 + left + + + + + 50 + left + + + + + + + + + GroupId + + + + Name + + + Description + + + + + + + + + + process + + Openstack.Objects.Domain.Compute.Server + + + + + + + + 3 + left + + + + + 40 + left + + + + + 40 + left + + + + + + 30 + left + + + + 25 + left + + + + 10 + left + + + + 15 + left + + + + + 100 + left + + + + + + + + QuickPickNumber + + + Id + + + + Name + + + CreationDate + + + LastUpdatedDate + + + KeyName + + + Status + + + DisplayIPAddresses + + + + + + + + + + + process + + Openstack.Objects.Domain.Compute.Image + + + + + + + + 3 + left + + + + + 40 + left + + + + + 70 + left + + + + + 25 + left + + + + + 25 + left + + + + + 15 + left + + + + + + + + + QuickPickNumber + + + + Id + + + + Name + + + + LastModified + + + + CreatedDate + + + + Status + + + + + + + + + + + process + + System.Collections.DictionaryEntry + + + + + + + 30 + left + + + + + 320 + left + + + + + + + + + + + Key + + + + Value + + + + + + + + + + + process + + Openstack.Objects.Domain.Security.SecurityGroup + + + + + + + 3 + left + + + + + 40 + left + + + + + 40 + left + + + + + 90 + left + + + + + 15 + left + + + + + + + + + QuickPickNumber + + + + Id + + + + Name + + + + Description + + + + TenantId + + + + + + + + + + + process + + Openstack.Objects.Domain.Compute.MetaDataElement + + + + + + + 20 + left + + + + + 20 + left + + + + + + + + + + + Key + + + + Value + + + + + + + + + + + + flavor + + Openstack.Objects.Domain.Compute.Flavor + + + + + + + 8 + left + + + + + 26 + left + + + + + 5 + left + + + + + 10 + left + + + + + + 11 + left + + + + + 11 + left + + + + + 5 + left + + + + + 5 + left + + + + + + + + + + + + + + Id + + + + Name + + + Disk + + + Ram + + + + RxtxCap + + + + RxtxQuota + + + + Swap + + + + Vcpus + + + + + + + + + + diff --git a/Openstack.Client.Powershell/bin/Release/System.Net.Http.Formatting.dll b/Openstack.Client.Powershell/bin/Release/System.Net.Http.Formatting.dll new file mode 100644 index 0000000..2dd77d3 Binary files /dev/null and b/Openstack.Client.Powershell/bin/Release/System.Net.Http.Formatting.dll differ diff --git a/Openstack.Client.Powershell/bin/Release/System.Net.Http.Formatting.xml b/Openstack.Client.Powershell/bin/Release/System.Net.Http.Formatting.xml new file mode 100644 index 0000000..65ead53 --- /dev/null +++ b/Openstack.Client.Powershell/bin/Release/System.Net.Http.Formatting.xml @@ -0,0 +1,1489 @@ + + + + System.Net.Http.Formatting + + + + Extension methods that aid in making formatted requests using . + + + Sends a POST request as an asynchronous operation, with a specified value serialized as JSON. + A task object representing the asynchronous operation. + The client used to make the request. + The URI the request is sent to. + The value to write into the entity body of the request. + The type of object to serialize. + + + Sends a POST request as an asynchronous operation, with a specified value serialized as JSON. Includes a cancellation token to cancel the request. + A task object representing the asynchronous operation. + The client used to make the request. + The URI the request is sent to. + The value to write into the entity body of the request. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The type of object to serialize. + + + Sends a POST request as an asynchronous operation, with a specified value serialized as XML. + A task object representing the asynchronous operation. + The client used to make the request. + The URI the request is sent to. + The value to write into the entity body of the request. + The type of object to serialize. + + + Sends a POST request as an asynchronous operation, with a specified value serialized as XML. Includes a cancellation token to cancel the request. + A task object representing the asynchronous operation. + The client used to make the request. + The URI the request is sent to. + The value to write into the entity body of the request. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The type of object to serialize. + + + Sends a POST request as an asynchronous operation, with a specified value serialized using the given formatter. + A task object representing the asynchronous operation. + The client used to make the request. + The URI the request is sent to. + The value to write into the entity body of the request. + The formatter used to serialize the value. + The type of object to serialize. + + + Sends a POST request as an asynchronous operation, with a specified value serialized using the given formatter and media type. + A task object representing the asynchronous operation. + The client used to make the request. + The URI the request is sent to. + The value to write into the entity body of the request. + The formatter used to serialize the value. + The authoritative value of the Content-Type header. Can be null, in which case the default content type of the formatter will be used. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The type of object to serialize. + + + Sends a POST request as an asynchronous operation, with a specified value serialized using the given formatter and media type string. + A task object representing the asynchronous operation. + The client used to make the request. + The URI the request is sent to. + The value to write into the entity body of the request. + The formatter used to serialize the value. + The authoritative value of the Content-Type header. Can be null, in which case the default content type of the formatter will be used. + The type of object to serialize. + + + Sends a POST request as an asynchronous operation, with a specified value serialized using the given formatter and media type string. Includes a cancellation token to cancel the request. + A task object representing the asynchronous operation. + The client used to make the request. + The URI the request is sent to. + The value to write into the entity body of the request. + The formatter used to serialize the value. + The authoritative value of the Content-Type header. Can be null, in which case the default content type of the formatter will be used. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The type of object to serialize. + + + Sends a POST request as an asynchronous operation, with a specified value serialized using the given formatter. Includes a cancellation token to cancel the request. + A task object representing the asynchronous operation. + The client used to make the request. + The URI the request is sent to. + The value to write into the entity body of the request. + The formatter used to serialize the value. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The type of object to serialize. + + + Sends a PUT request as an asynchronous operation, with a specified value serialized as JSON. + A task object representing the asynchronous operation. + The client used to make the request. + The URI the request is sent to. + The value to write into the entity body of the request. + The type of object to serialize. + + + Sends a PUT request as an asynchronous operation, with a specified value serialized as JSON. Includes a cancellation token to cancel the request. + A task object representing the asynchronous operation. + The client used to make the request. + The URI the request is sent to. + The value to write into the entity body of the request. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The type of object to serialize. + + + Sends a PUT request as an asynchronous operation, with a specified value serialized as XML. + A task object representing the asynchronous operation. + The client used to make the request. + The URI the request is sent to. + The value to write into the entity body of the request. + The type of object to serialize. + + + Sends a PUT request as an asynchronous operation, with a specified value serialized as XML. Includes a cancellation token to cancel the request. + A task object representing the asynchronous operation. + The client used to make the request. + The URI the request is sent to. + The value to write into the entity body of the request. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The type of object to serialize. + + + Sends a PUT request as an asynchronous operation, with a specified value serialized using the given formatter. + A task object representing the asynchronous operation. + The client used to make the request. + The URI the request is sent to. + The value to write into the entity body of the request. + The formatter used to serialize the value. + The type of object to serialize. + + + Sends a PUT request as an asynchronous operation, with a specified value serialized using the given formatter and media type. Includes a cancellation token to cancel the request. + A task object representing the asynchronous operation. + The client used to make the request. + The URI the request is sent to. + The value to write into the entity body of the request. + The formatter used to serialize the value. + The authoritative value of the Content-Type header. Can be null, in which case the default content type of the formatter will be used. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The type of object to serialize. + + + Sends a PUT request as an asynchronous operation, with a specified value serialized using the given formatter and media type string. + A task object representing the asynchronous operation. + The client used to make the request. + The URI the request is sent to. + The value to write into the entity body of the request. + The formatter used to serialize the value. + The authoritative value of the Content-Type header. Can be null, in which case the default content type of the formatter will be used. + The type of object to serialize. + + + Sends a PUT request as an asynchronous operation, with a specified value serialized using the given formatter and media type string. Includes a cancellation token to cancel the request. + A task object representing the asynchronous operation. + The client used to make the request. + The URI the request is sent to. + The value to write into the entity body of the request. + The formatter used to serialize the value. + The authoritative value of the Content-Type header. Can be null, in which case the default content type of the formatter will be used. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The type of object to serialize. + + + Sends a PUT request as an asynchronous operation, with a specified value serialized using the given formatter and medai type string. Includes a cancellation token to cancel the request. + A task object representing the asynchronous operation. + The client used to make the request. + The URI the request is sent to. + The value to write into the entity body of the request. + The formatter used to serialize the value. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The type of object to serialize. + + + Represents the factory for creating new instance of . + + + Creates a new instance of the . + A new instance of the . + The list of HTTP handler that delegates the processing of HTTP response messages to another handler. + + + Creates a new instance of the . + A new instance of the . + The inner handler which is responsible for processing the HTTP response messages. + The list of HTTP handler that delegates the processing of HTTP response messages to another handler. + + + Creates a new instance of the which should be pipelined. + A new instance of the which should be pipelined. + The inner handler which is responsible for processing the HTTP response messages. + The list of HTTP handler that delegates the processing of HTTP response messages to another handler. + + + Specifies extension methods to allow strongly typed objects to be read from HttpContent instances. + + + Returns a Task that will yield an object of the specified type <typeparamref name="T" /> from the content instance. + An object instance of the specified type. + The HttpContent instance from which to read. + The type of the object to read. + + + Returns a Task that will yield an object of the specified type <typeparamref name="T" /> from the content instance. + An object instance of the specified type. + The HttpContent instance from which to read. + The collection of MediaTyepFormatter instances to use. + The type of the object to read. + + + Returns a Task that will yield an object of the specified type <typeparamref name="T" /> from the content instance. + An object instance of the specified type. + The HttpContent instance from which to read. + The collection of MediaTypeFormatter instances to use. + The IFormatterLogger to log events to. + The type of the object to read. + + + Returns a Task that will yield an object of the specified type from the content instance. + A Task that will yield an object instance of the specified type. + The HttpContent instance from which to read. + The type of the object to read. + + + Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content. + An object instance of the specified type. + The HttpContent instance from which to read. + The type of the object to read. + The collection of MediaTypeFormatter instances to use. + + + Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content. + An object instance of the specified type. + The HttpContent instance from which to read. + The type of the object to read. + The collection of MediaTypeFormatter instances to use. + The IFormatterLogger to log events to. + + + Extension methods to read HTML form URL-encoded datafrom instances. + + + Determines whether the specified content is HTML form URL-encoded data. + true if the specified content is HTML form URL-encoded data; otherwise, false. + The content. + + + Asynchronously reads HTML form URL-encoded from an instance and stores the results in a object. + A task object representing the asynchronous operation. + The content. + + + Provides extension methods to read and entities from instances. + + + Determines whether the specified content is HTTP request message content. + true if the specified content is HTTP message content; otherwise, false. + The content to check. + + + Determines whether the specified content is HTTP response message content. + true if the specified content is HTTP message content; otherwise, false. + The content to check. + + + Reads the as an . + The parsed instance. + The content to read. + + + Reads the as an . + The parsed instance. + The content to read. + The URI scheme to use for the request URI. + + + Reads the as an . + The parsed instance. + The content to read. + The URI scheme to use for the request URI. + The size of the buffer. + + + Reads the as an . + The parsed instance. + The content to read. + The URI scheme to use for the request URI. + The size of the buffer. + The maximum length of the HTTP header. + + + Reads the as an . + The parsed instance. + The content to read. + + + Reads the as an . + The parsed instance. + The content to read. + The size of the buffer. + + + Reads the as an . + The parsed instance. + The content to read. + The size of the buffer. + The maximum length of the HTTP header. + + + Extension methods to read MIME multipart entities from instances. + + + Determines whether the specified content is MIME multipart content. + true if the specified content is MIME multipart content; otherwise, false. + The content. + + + Determines whether the specified content is MIME multipart content with the specified subtype. + true if the specified content is MIME multipart content with the specified subtype; otherwise, false. + The content. + The MIME multipart subtype to match. + + + Reads all body parts within a MIME multipart message and produces a set of instances as a result. + A <see cref="T:System.Threading.Tasks.Task`1" /> representing the tasks of getting the collection of instances where each instance represents a body part. + An existing instance to use for the object's content. + + + Reads all body parts within a MIME multipart message and produces a set of instances as a result using the streamProvider instance to determine where the contents of each body part is written. + A representing the tasks of getting the collection of instances where each instance represents a body part. + An existing instance to use for the object's content. + A stream provider providing output streams for where to write body parts as they are parsed. + The type of the MIME multipart. + + + Reads all body parts within a MIME multipart message and produces a set of instances as a result using the streamProvider instance to determine where the contents of each body part is written and bufferSize as read buffer size. + A representing the tasks of getting the collection of instances where each instance represents a body part. + An existing instance to use for the object's content. + A stream provider providing output streams for where to write body parts as they are parsed. + Size of the buffer used to read the contents. + The type of the MIME multipart. + + + Derived class which can encapsulate an or an as an entity with media type "application/http". + + + Initializes a new instance of the class encapsulating an . + The instance to encapsulate. + + + Initializes a new instance of the class encapsulating an . + The instance to encapsulate. + + + Releases unmanaged and - optionally - managed resources + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + Gets the HTTP request message. + + + Gets the HTTP response message. + + + Asynchronously serializes the object's content to the given stream. + A instance that is asynchronously serializing the object's content. + The to which to write. + The associated . + + + Computes the length of the stream if possible. + true if the length has been computed; otherwise false. + The computed length of the stream. + + + Provides extension methods for the class. + + + Gets any cookie headers present in the request. + A collection of instances. + The request headers. + + + Gets any cookie headers present in the request that contain a cookie state whose name that matches the specified value. + A collection of instances. + The request headers. + The cookie state name to match. + + + + + Provides extension methods for the class. + + + Adds cookies to a response. Each Set-Cookie header is represented as one instance. A contains information about the domain, path, and other cookie information as well as one or more instances. Each instance contains a cookie name and whatever cookie state is associate with that name. The state is in the form of a which on the wire is encoded as HTML Form URL-encoded data. This representation allows for multiple related "cookies" to be carried within the same Cookie header while still providing separation between each cookie state. A sample Cookie header is shown below. In this example, there are two with names state1 and state2 respectively. Further, each cookie state contains two name/value pairs (name1/value1 and name2/value2) and (name3/value3 and name4/value4). <code> Set-Cookie: state1:name1=value1&amp;name2=value2; state2:name3=value3&amp;name4=value4; domain=domain1; path=path1; </code> + The response headers + The cookie values to add to the response. + + + Represents a multipart file data. + + + Initializes a new instance of the class. + The headers of the multipart file data. + The name of the local file for the multipart file data. + + + Gets or sets the headers of the multipart file data. + The headers of the multipart file data. + + + Gets or sets the name of the local file for the multipart file data. + The name of the local file for the multipart file data. + + + Represents an suited for writing each MIME body parts of the MIME multipart message to a file using a . + + + Initializes a new instance of the class. + The root path where the content of MIME multipart body parts are written to. + + + Initializes a new instance of the class. + The root path where the content of MIME multipart body parts are written to. + The number of bytes buffered for writes to the file. + + + Gets or sets the number of bytes buffered for writes to the file. + The number of bytes buffered for writes to the file. + + + Gets or sets the multipart file data. + The multipart file data. + + + Gets the name of the local file which will be combined with the root path to create an absolute file name where the contents of the current MIME body part will be stored. + A relative filename with no path component. + The headers for the current MIME body part. + + + Gets the stream instance where the message body part is written to. + The instance where the message body part is written to. + The content of HTTP. + The header fields describing the body part. + + + Gets or sets the root path where the content of MIME multipart body parts are written to. + The root path where the content of MIME multipart body parts are written to. + + + An suited for use with HTML file uploads for writing file content to a . The stream provider looks at the <b>Content-Disposition</b> header field and determines an output based on the presence of a <b>filename</b> parameter. If a <b>filename</b> parameter is present in the <b>Content-Disposition</b> header field then the body part is written to a , otherwise it is written to a . This makes it convenient to process MIME Multipart HTML Form data which is a combination of form data and file content. + + + Initializes a new instance of the class. + The root path where the content of MIME multipart body parts are written to. + + + Initializes a new instance of the class. + The root path where the content of MIME multipart body parts are written to. + The number of bytes buffered for writes to the file. + + + Reads the non-file contents as form data + A task that represents the asynchronous operation. + + + Gets a of form data passed as part of the multipart form data. + The of form data. + + + The instance where the message body part is written. + The HTTP content that contains this body part. + Header fields describing the body part. + + + Represents a multipart memory stream provider. + + + Initializes a new instance of the class. + + + Returns the for the . + The for the . + A object. + The HTTP content headers. + + + Represents the provider for the multipart related multistream. + + + Initializes a new instance of the class. + + + Gets the related stream for the provider. + The content headers. + The parent content. + The http content headers. + + + Gets the root content of the . + The root content of the . + + + Represents a stream provider that examines the headers provided by the MIME multipart parser as part of the MIME multipart extension methods (see ) and decides what kind of stream to return for the body part to be written to. + + + Initializes a new instance of the class. + + + Gets or sets the contents for this . + The contents for this . + + + Executes the post processing operation for this . + The asynchronous task for this operation. + + + Gets the stream where to write the body part to. This method is called when a MIME multipart body part has been parsed. + The instance where the message body part is written to. + The content of the HTTP. + The header fields describing the body part. + + + Contains a value as well as an associated that will be used to serialize the value when writing this content. + + + Initializes a new instance of the class. + The type of object this instance will contain. + The value of the object this instance will contain. + The formatter to use when serializing the value. + + + Initializes a new instance of the class. + The type of object this instance will contain. + The value of the object this instance will contain. + The formatter to use when serializing the value. + The authoritative value of the Content-Type header. Can be null, in which case the default content type of the formatter will be used. + + + Initializes a new instance of the class. + The type of object this instance will contain. + The value of the object this instance will contain. + The formatter to use when serializing the value. + The authoritative value of the Content-Type header. + + + Gets the media-type formatter associated with this content instance. + The . + + + Gets the type of object managed by this instance. + The object type. + + + Asynchronously serializes the object's content to the given stream. + The task object representing the asynchronous operation. + The stream to write to. + The associated . + + + Computes the length of the stream if possible. + true if the length has been computed; otherwise, false. + Receives the computed length of the stream. + + + Gets or sets the value of the content. + The content value. + + + Generic form of . + The type of object this class will contain. + + + Initializes a new instance of the class. + The value of the object this instance will contain. + The formatter to use when serializing the value. + + + Initializes a new instance of the <see cref="T:System.Net.Http.ObjectContent`1" /> class. + The value of the object this instance will contain. + The formatter to use when serializing the value. + The authoritative value of the Content-Type header. Can be null, in which case the default content type of the formatter will be used. + + + Initializes a new instance of the class. + The value of the object this instance will contain. + The formatter to use when serializing the value. + The authoritative value of the Content-Type header. + + + Enables scenarios where a data producer wants to write directly (either synchronously or asynchronously) using a stream. + + + Initializes a new instance of the class. + An action that is called when an output stream is available, allowing the action to write to it directly. + + + Initializes a new instance of the class. + An action that is called when an output stream is available, allowing the action to write to it directly. + The media type. + + + Initializes a new instance of the class. + An action that is called when an output stream is available, allowing the action to write to it directly. + The media type. + + + Asynchronously serializes the push content into stream. + The serialized push content. + The stream where the push content will be serialized. + The context. + + + Determines whether the stream content has a valid length in bytes. + true if length is a valid length; otherwise, false. + The length in bytes of the stream content. + + + Contains extension methods to allow strongly typed objects to be read from the query component of instances. + + + Parses the query portion of the specified URI. + A that contains the query parameters. + The URI to parse. + + + Reads HTML form URL encoded data provided in the URI query string as an object of a specified type. + true if the query component of the URI can be read as the specified type; otherwise, false. + The URI to read. + The type of object to read. + When this method returns, contains an object that is initialized from the query component of the URI. This parameter is treated as uninitialized. + + + Reads HTML form URL encoded data provided in the URI query string as an object of a specified type. + true if the query component of the URI can be read as the specified type; otherwise, false. + The URI to read. + When this method returns, contains an object that is initialized from the query component of the URI. This parameter is treated as uninitialized. + The type of object to read. + + + Reads HTML form URL encoded data provided in the query component as a object. + true if the query component can be read as ; otherwise false. + The instance from which to read. + An object to be initialized with this instance or null if the conversion cannot be performed. + + + Represents a helper class to allow a synchronous formatter on top of the asynchronous formatter infrastructure. + + + Initializes a new instance of the class. + + + Gets or sets the suggested size of buffer to use with streams in bytes. + The suggested size of buffer to use with streams in bytes. + + + Reads synchronously from the buffered stream. + An object of the given . + The type of the object to deserialize. + The stream from which to read + The , if available. Can be null. + The to log events to. + + + Reads asynchronously from the buffered stream. + A task object representing the asynchronous operation. + The type of the object to deserialize. + The stream from which to read. + The , if available. Can be null. + The to log events to. + + + Writes synchronously to the buffered stream. + The type of the object to serialize. + The object value to write. Can be null. + The stream to which to write. + The , if available. Can be null. + + + Writes asynchronously to the buffered stream. + A task object representing the asynchronous operation. + The type of the object to serialize. + The object value to write. It may be null. + The stream to which to write. + The , if available. Can be null. + The transport context. + + + Represents the result of content negotiation performed using <see cref="M:System.Net.Http.Formatting.IContentNegotiator.Negotiate(System.Type,System.Net.Http.HttpRequestMessage,System.Collections.Generic.IEnumerable{System.Net.Http.Formatting.MediaTypeFormatter})" /> + + + Create the content negotiation result object. + The formatter. + The preferred media type. Can be null. + + + The formatter chosen for serialization. + + + The media type that is associated with the formatter chosen for serialization. Can be null. + + + The default implementation of , which is used to select a for an or . + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + true to exclude formatters that match only on the object type; otherwise, false. + + + Determines how well each formatter matches an HTTP request. + Returns a collection of objects that represent all of the matches. + The type to be serialized. + The request. + The set of objects from which to choose. + + + If true, exclude formatters that match only on the object type; otherwise, false. + Returns a . + + + Matches a set of Accept header fields against the media types that a formatter supports. + Returns a object that indicates the quality of the match, or null if there is no match. + A list of Accept header values, sorted in descending order of q factor. You can create this list by calling the method. + The formatter to match against. + + + Matches a request against the objects in a media-type formatter. + Returns a object that indicates the quality of the match, or null if there is no match. + The requrst. + The media-type formatter. + + + Match the content type of a request against the media types that a formatter supports. + Returns a object that indicates the quality of the match, or null if there is no match. + The request. + The formatter to match against. + + + Selects the first supported media type of a formatter. + Returns a with set to , or null if there is no match. + The type to match. + The formatter to match against. + + + Performs content negotiating by selecting the most appropriate out of the passed in for the given that can serialize an object of the given . + The result of the negotiation containing the most appropriate instance, or null if there is no appropriate formatter. + The type to be serialized. + The request. + The set of objects from which to choose. + + + Determines the best character encoding for writing the response. + Returns the that is the best match. + The request. + The selected media formatter. + + + Selects the best match among the candidate matches found. + Returns the object that represents the best match. + The collection of matches. + + + Sorts Accept header values in descending order of q factor. + Returns the sorted list of MediaTypeWithQualityHeaderValue objects. + A collection of MediaTypeWithQualityHeaderValue objects, representing the Accept header values. + + + Sorts a list of Accept-Charset, Accept-Encoding, Accept-Language or related header values in descending order or q factor. + Returns the sorted list of StringWithQualityHeaderValue objects. + A collection of StringWithQualityHeaderValue objects, representing the header fields. + + + Evaluates whether a match is better than the current match. + Returns whichever object is a better match. + The current match. + The match to evaluate against the current match. + + + Helper class to serialize <see cref="T:System.Collections.Generic.IEnumerable`1" /> types by delegating them through a concrete implementation."/&gt;. + The interface implementing to proxy. + + + Initialize a DelegatingEnumerable. This constructor is necessary for to work. + + + Initialize a DelegatingEnumerable with an <see cref="T:System.Collections.Generic.IEnumerable`1" />. This is a helper class to proxy <see cref="T:System.Collections.Generic.IEnumerable`1" /> interfaces for . + The <see cref="T:System.Collections.Generic.IEnumerable`1" /> instance to get the enumerator from. + + + This method is not implemented but is required method for serialization to work. Do not use. + The item to add. Unused. + + + Get the enumerator of the associated <see cref="T:System.Collections.Generic.IEnumerable`1" />. + The enumerator of the <see cref="T:System.Collections.Generic.IEnumerable`1" /> source. + + + Get the enumerator of the associated <see cref="T:System.Collections.Generic.IEnumerable`1" />. + The enumerator of the <see cref="T:System.Collections.Generic.IEnumerable`1" /> source. + + + Represent the collection of form data. + + + Initializes a new instance of class. + The pairs. + + + Initializes a new instance of class. + The query. + + + Initializes a new instance of class. + The URI + + + Gets the collection of form data. + The collection of form data. + The key. + + + Gets an enumerable that iterates through the collection. + The enumerable that iterates through the collection. + + + Gets the values of the collection of form data. + The values of the collection of form data. + The key. + + + Reads the collection of form data as a collection of name value. + The collection of form data as a collection of name value. + + + Gets an enumerable that iterates through the collection. + The enumerable that iterates through the collection. + + + + class for handling HTML form URL-ended data, also known as application/x-www-form-urlencoded. + + + Initializes a new instance of the class. + + + Queries whether the can deserializean object of the specified type. + true if the can deserialize the type; otherwise, false. + The type to deserialize. + + + Queries whether the can serializean object of the specified type. + true if the can serialize the type; otherwise, false. + The type to serialize. + + + Gets the default media type for HTML form-URL-encoded data, which is application/x-www-form-urlencoded. + The default media type for HTML form-URL-encoded data + + + Gets or sets the maximum depth allowed by this formatter. + The maximum depth. + + + Gets or sets the size of the buffer when reading the incoming stream. + The buffer size. + + + Asynchronously deserializes an object of the specified type. + A whose result will be the object instance that has been read. + The type of object to deserialize. + The to read. + The for the content being read. + The to log events to. + + + Performs content negotiation. This is the process of selecting a response writer (formatter) in compliance with header values in the request. + + + Performs content negotiating by selecting the most appropriate out of the passed in formatters for the given request that can serialize an object of the given type. + The result of the negotiation containing the most appropriate instance, or null if there is no appropriate formatter. + The type to be serialized. + Request message, which contains the header values used to perform negotiation. + The set of objects from which to choose. + + + Specifies a callback interface that a formatter can use to log errors while reading. + + + Logs an error. + The path to the member for which the error is being logged. + The error message. + + + Logs an error. + The path to the member for which the error is being logged. + The error message to be logged. + + + Defines method that determines whether a given member is required on deserialization. + + + Determines whether a given member is required on deserialization. + true if should be treated as a required member; otherwise false. + The to be deserialized. + + + Represents the class to handle JSON. + + + Initializes a new instance of the class. + + + Determines whether this can read objects of the specified . + true if objects of this can be read, otherwise false. + The type of object that will be read. + + + Determines whether this can write objects of the specified . + true if objects of this can be written, otherwise false. + The type of object that will be written. + + + Creates a JsonSerializerSettings instance with the default settings used by the . + A newly created JsonSerializerSettings instance with the default settings used by the . + + + Gets the default media type for JSON, namely "application/json". + The for JSON. + + + Gets or sets a value indicating whether to indent elements when writing data. + true if to indent elements when writing data; otherwise, false. + + + Gets or sets the maximum depth allowed by this formatter. + The maximum depth allowed by this formatter. + + + Reads an object of the specified from the specified . This method is called during deserialization. + Returns . + The type of object to read. + Thestream from which to read + The content being written. + The to log events to. + + + Gets or sets the JsonSerializerSettings used to configure the JsonSerializer. + The JsonSerializerSettings used to configure the JsonSerializer. + + + Gets or sets a value indicating whether to use by default. + true if to by default; otherwise, false. + + + Writes an object of the specified to the specified . This method is called during serialization. + A that will write the value to the stream. + The type of object to write. + The object to write. + The to which to write. + The where the content is being written. + The . + + + Base class to handle serializing and deserializing strongly-typed objects using . + + + Initializes a new instance of the class. + + + Queries whether this can deserializean object of the specified type. + true if the can deserialize the type; otherwise, false. + The type to deserialize. + + + Queries whether this can serializean object of the specified type. + true if the can serialize the type; otherwise, false. + The type to serialize. + + + Gets the default value for the specified type. + The default value. + The type for which to get the default value. + + + Returns a specialized instance of the that can format a response for the given parameters. + Returns . + The type to format. + The request. + The media type. + + + Gets or sets the maximum number of keys stored in a T: . + The maximum number of keys. + + + Gets the mutable collection of objects that match HTTP requests to media types. + The collection. + + + Asynchronously deserializes an object of the specified type. + A whose result will be an object of the given type. + The type of the object to deserialize. + The to read. + The , if available. It may be null. + The to log events to. + Derived types need to support reading. + + + Gets or sets the instance used to determine required members. + The instance. + + + Determines the best character encoding for reading or writing an HTTP entity body, given a set of content headers. + The encoding that is the best match. + The content headers. + + + Sets the default headers for content that will be formatted using this formatter. This method is called from the constructor. This implementation sets the Content-Type header to the value of mediaType if it is not null. If it is null it sets the Content-Type to the default media type of this formatter. If the Content-Type does not specify a charset it will set it using this formatters configured . + The type of the object being serialized. See . + The content headers that should be configured. + The authoritative media type. Can be null. + + + Gets the mutable collection of character encodings supported bythis . + The collection of objects. + + + Gets the mutable collection of media types supported bythis . + The collection of objects. + + + Asynchronously writes an object of the specified type. + A that will perform the write. + The type of the object to write. + The object value to write. It may be null. + The to which to write. + The if available. It may be null. + The if available. It may be null. + Derived types need to support writing. + + + Represents a collection class that contains instances. + + + Initializes a new instance of the class with default values. + + + Initializes a new instance of the class with the given . + A collection of instances to place in the collection. + + + Searches a collection for a formatter that can read the .NET in the given . + The that can read the type, or null if no formatter found. + The .NET type to read. + The media type to match on. + + + Searches a collection for a formatter that can write the .NET in the given . + The that can write the type, or null if no formatter found. + The .NET type to write. + The media type to match on. + + + Gets the to use for application/x-www-form-urlencoded data. + The to use for application/x-www-form-urlencoded data. + + + Determines whether the is one of those loosely defined types that should be excluded from validation. + true if the type should be excluded; otherwise, false. + The .NET to validate. + + + Gets the to use for JSON. + The to use for JSON. + + + Gets the to use for XML. + The to use for XML. + + + Updates the given set of formatter of elements so that it associates the mediaType with s containing a specific query parameter and value. + The to receive the new item. + The name of the query parameter. + The value assigned to that query parameter. + The to associate with a containing a query string matching queryStringParameterName and queryStringParameterValue. + + + Updates the given set of formatter of elements so that it associates the mediaType with s containing a specific query parameter and value. + The to receive the new item. + The name of the query parameter. + The value assigned to that query parameter. + The media type to associate with a containing a query string matching queryStringParameterName and queryStringParameterValue. + + + Updates the given set of formatter of elements so that it associates the mediaType with a specific HTTP request header field with a specific value. + The to receive the new item. + Name of the header to match. + The header value to match. + The to use when matching headerValue. + if set to true then headerValue is considered a match if it matches a substring of the actual header value. + The to associate with a entry with a name matching headerName and a value matching headerValue. + + + Updates the given set of formatter of elements so that it associates the mediaType with a specific HTTP request header field with a specific value. + The to receive the new item. + Name of the header to match. + The header value to match. + The to use when matching headerValue. + if set to true then headerValue is considered a match if it matches a substring of the actual header value. + The media type to associate with a entry with a name matching headerName and a value matching headerValue. + + + This class describes how well a particular matches a request. + + + Initializes a new instance of the class. + The matching formatter. + The media type. Can be null in which case the media type application/octet-stream is used. + The quality of the match. Can be null in which case it is considered a full match with a value of 1.0 + The kind of match. + + + Gets the media type formatter. + + + Gets the matched media type. + + + Gets the quality of the match + + + Gets the kind of match that occurred. + + + Contains information about the degree to which a matches the explicit or implicit preferences found in an incoming request. + + + No match was found + + + Matched on a type, meaning that the formatter is able to serialize the type. + + + Matched on an explicit literal accept header, such as “application/json”. + + + Matched on an explicit subtype range in an Accept header, such as “application/*”. + + + Matched on an explicit “*/*” range in the Accept header. + + + Matched on after having applied the various s. + + + Matched on the media type of the entity body in the HTTP request message. + + + An abstract base class used to create an association between or instances that have certain characteristics and a specific . + + + Initializes a new instance of a with the given mediaType value. + The that is associated with or instances that have the given characteristics of the . + + + Initializes a new instance of a with the given mediaType value. + The that is associated with or instances that have the given characteristics of the . + + + Gets the that is associated with or instances that have the given characteristics of the . + + + Returns the quality of the match of the associated with request. + The quality of the match. It must be between 0.0 and 1.0. A value of 0.0 signifies no match. A value of 1.0 signifies a complete match. + The to evaluate for the characteristics associated with the of the . + + + Class that provides s from query strings. + + + Initializes a new instance of the class. + The name of the query string parameter to match, if present. + The value of the query string parameter specified by queryStringParameterName. + The to use if the query parameter specified by queryStringParameterName is present and assigned the value specified by queryStringParameterValue. + + + Initializes a new instance of the class. + The name of the query string parameter to match, if present. + The value of the query string parameter specified by queryStringParameterName. + The media type to use if the query parameter specified by queryStringParameterName is present and assigned the value specified by queryStringParameterValue. + + + Gets the query string parameter name. + + + Gets the query string parameter value. + + + Returns a value indicating whether the current instance can return a from request. + If this instance can produce a from request it returns 1.0 otherwise 0.0. + The to check. + + + This class provides a mapping from an arbitrary HTTP request header field to a used to select instances for handling the entity body of an or . <remarks>This class only checks header fields associated with for a match. It does not check header fields associated with or instances.</remarks> + + + Initializes a new instance of the class. + Name of the header to match. + The header value to match. + The to use when matching headerValue. + if set to true then headerValue is considered a match if it matches a substring of the actual header value. + The to use if headerName and headerValue is considered a match. + + + Initializes a new instance of the class. + Name of the header to match. + The header value to match. + The value comparison to use when matching headerValue. + if set to true then headerValue is considered a match if it matches a substring of the actual header value. + The media type to use if headerName and headerValue is considered a match. + + + Gets the name of the header to match. + + + Gets the header value to match. + + + Gets the to use when matching . + + + Gets a value indicating whether is a matched as a substring of the actual header value. this instance is value substring. + truefalse + + + Returns a value indicating whether the current instance can return a from request. + The quality of the match. It must be between 0.0 and 1.0. A value of 0.0 signifies no match. A value of 1.0 signifies a complete match. + The to check. + + + A that maps the X-Requested-With http header field set by AJAX XmlHttpRequest (XHR) to the media type application/json if no explicit Accept header fields are present in the request. + + + Initializes a new instance of class + + + Returns a value indicating whether the current instance can return a from request. + The quality of the match. A value of 0.0 signifies no match. A value of 1.0 signifies a complete match and that the request was made using XmlHttpRequest without an Accept header. + The to check. + + + + class to handle Xml. + + + Initializes a new instance of the class. + + + Queries whether the can deserializean object of the specified type. + true if the can deserialize the type; otherwise, false. + The type to deserialize. + + + Queries whether the can serializean object of the specified type. + true if the can serialize the type; otherwise, false. + The type to serialize. + + + Gets the default media type for the XML formatter. + The default media type, which is “application/xml”. + + + Gets or sets a value indicating whether to indent elements when writing data. + true to indent elements; otherwise, false. + + + Gets and sets the maximum nested node depth. + The maximum nested node depth. + + + Called during deserialization to read an object of the specified type from the specified readStream. + A whose result will be the object instance that has been read. + The type of object to read. + The from which to read. + The for the content being read. + The to log events to. + + + Unregisters the serializer currently associated with the given type. + true if a serializer was previously registered for the type; otherwise, false. + The type of object whose serializer should be removed. + + + Registers an to read or write objects of a specified type. + The instance. + The type of object that will be serialized or deserialized with. + + + Registers an to read or write objects of a specified type. + The type of object that will be serialized or deserialized with. + The instance. + + + Registers an to read or write objects of a specified type. + The type of object that will be serialized or deserialized with. + The instance. + + + Registers an to read or write objects of a specified type. + The instance. + The type of object that will be serialized or deserialized with. + + + Gets or sets a value indicating whether the XML formatter uses the as the default serializer, instead of using the . + If true, the formatter uses the by default; otherwise, it uses the by default. + + + Called during serialization to write an object of the specified type to the specified writeStream. + A that will write the value to the stream. + The type of object to write. + The object to write. + The to which to write. + The for the content being written. + The . + + + Represents the event arguments for the HTTP progress. + + + Initializes a new instance of the class. + The percentage of the progress. + The user token. + The number of bytes transferred. + The total number of bytes transferred. + + + Gets the number of bytes transferred in the HTTP progress. + The number of bytes transferred in the HTTP progress. + + + Gets the total number of bytes transferred by the HTTP progress. + The total number of bytes transferred by the HTTP progress. + + + Generates progress notification for both request entities being uploaded and response entities being downloaded. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The inner message handler. + + + Occurs when event entities are being downloaded. + + + Occurs when event entities are being uploaded. + + + Raises the event that handles the request of the progress. + The request. + The event handler for the request. + + + Raises the event that handles the response of the progress. + The request. + The event handler for the request. + + + Sends the specified progress message to an HTTP server for delivery. + The sent progress message. + The request. + The cancellation token. + + + Provides value for the cookie header. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The value of the name. + The values. + + + Initializes a new instance of the class. + The value of the name. + The value. + + + Creates a shallow copy of the cookie value. + A shallow copy of the cookie value. + + + Gets a collection of cookies sent by the client. + A collection object representing the client’s cookie variables. + + + Gets or sets the domain to associate the cookie with. + The name of the domain to associate the cookie with. + + + Gets or sets the expiration date and time for the cookie. + The time of day (on the client) at which the cookie expires. + + + Gets or sets a value that specifies whether a cookie is accessible by client-side script. + true if the cookie has the HttpOnly attribute and cannot be accessed through a client-side script; otherwise, false. + + + Gets a shortcut to the cookie property. + The cookie value. + + + Gets or sets the maximum age permitted for a resource. + The maximum age permitted for a resource. + + + Gets or sets the virtual path to transmit with the current cookie. + The virtual path to transmit with the cookie. + + + Gets or sets a value indicating whether to transmit the cookie using Secure Sockets Layer (SSL)—that is, over HTTPS only. + true to transmit the cookie over an SSL connection (HTTPS); otherwise, false. + + + Returns a string that represents the current object. + A string that represents the current object. + + + Indicates a value whether the string representation will be converted. + true if the string representation will be converted; otherwise, false. + The input value. + The parsed value to convert. + + + Contains cookie name and its associated cookie state. + + + Initializes a new instance of the class. + The name of the cookie. + + + Initializes a new instance of the class. + The name of the cookie. + The collection of name-value pair for the cookie. + + + Initializes a new instance of the class. + The name of the cookie. + The value of the cookie. + + + Returns a new object that is a copy of the current instance. + A new object that is a copy of the current instance. + + + Gets or sets the cookie value with the specified cookie name, if the cookie data is structured. + The cookie value with the specified cookie name. + + + Gets or sets the name of the cookie. + The name of the cookie. + + + Returns the string representation the current object. + The string representation the current object. + + + Gets or sets the cookie value, if cookie data is a simple string value. + The value of the cookie. + + + Gets or sets the collection of name-value pair, if the cookie data is structured. + The collection of name-value pair for the cookie. + + + \ No newline at end of file diff --git a/Openstack.Client.Powershell/bin/Release/mefx.exe b/Openstack.Client.Powershell/bin/Release/mefx.exe new file mode 100644 index 0000000..38fe687 Binary files /dev/null and b/Openstack.Client.Powershell/bin/Release/mefx.exe differ diff --git a/Openstack.Client.Powershell/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Openstack.Client.Powershell/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..86ddd48 Binary files /dev/null and b/Openstack.Client.Powershell/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/Openstack.Client.Powershell/obj/Debug/Openstack.Client.Powershell.csproj.FileListAbsolute.txt b/Openstack.Client.Powershell/obj/Debug/Openstack.Client.Powershell.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..1e11e46 --- /dev/null +++ b/Openstack.Client.Powershell/obj/Debug/Openstack.Client.Powershell.csproj.FileListAbsolute.txt @@ -0,0 +1,51 @@ +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\bin\Release\Deployment\Aliases.txt +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\bin\Release\Deployment\ScratchPad\AnotherTest.txt +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\bin\Release\Deployment\CLI.config +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\bin\Release\Deployment\CLI.config.example +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\bin\Release\Deployment\OpenstackShell.format.ps1xml +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\bin\Release\Deployment\Microsoft.PowerShell_profile.ps1 +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\bin\Release\Deployment\CLIManifest.psd1 +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\bin\Release\Deployment\ReleaseNotes.xml +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\bin\Release\Openstack.Client.Powershell.dll.config +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\bin\Release\Openstack.Client.Powershell.dll +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\bin\Release\Openstack.Client.Powershell.pdb +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\bin\Release\AWSSDK.dll +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\bin\Release\Openstack.Common.dll +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\bin\Release\Openstack.Objects.dll +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\bin\Release\System.Net.Http.Formatting.dll +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\bin\Release\Newtonsoft.Json.dll +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\bin\Release\Openstack.Common.pdb +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\bin\Release\Openstack.Objects.pdb +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\bin\Release\AWSSDK.pdb +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\bin\Release\System.Net.Http.Formatting.xml +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\obj\Debug\Openstack.Client.Powershell.csprojResolveAssemblyReference.cache +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\obj\Debug\Openstack.Client.Powershell.g.resources +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\obj\Debug\Openstack.Client.Powershell.dll +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\obj\Debug\Openstack.Client.Powershell.pdb +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\bin\Release\BouncyCastle.Crypto.pdb +C:\Users\tplummer\Source\Repos\OpenStack-CLI\Openstack.Client.Powershell\bin\Release\Newtonsoft.Json.xml +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\obj\Debug\Openstack.Client.Powershell.csprojResolveAssemblyReference.cache +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\obj\Debug\Openstack.Client.Powershell.g.resources +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\obj\Debug\Openstack.Client.Powershell.dll +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\obj\Debug\Openstack.Client.Powershell.pdb +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\bin\Release\Deployment\Aliases.txt +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\bin\Release\Deployment\ScratchPad\AnotherTest.txt +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\bin\Release\Deployment\CLI.config +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\bin\Release\Deployment\CLI.config.example +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\bin\Release\Deployment\OpenstackShell.format.ps1xml +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\bin\Release\Deployment\Microsoft.PowerShell_profile.ps1 +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\bin\Release\Deployment\CLIManifest.psd1 +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\bin\Release\Deployment\ReleaseNotes.xml +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\bin\Release\Openstack.Client.Powershell.dll.config +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\bin\Release\Openstack.Client.Powershell.dll +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\bin\Release\Openstack.Client.Powershell.pdb +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\bin\Release\AWSSDK.dll +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\bin\Release\Newtonsoft.Json.dll +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\bin\Release\Openstack.Common.dll +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\bin\Release\Openstack.dll +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\bin\Release\System.Net.Http.Formatting.dll +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\bin\Release\Openstack.Common.pdb +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\bin\Release\Openstack.pdb +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\bin\Release\AWSSDK.pdb +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\bin\Release\Newtonsoft.Json.xml +C:\Users\tplummer\Source\Repos\Openstack-NewCLI\Openstack.Client.Powershell\bin\Release\System.Net.Http.Formatting.xml diff --git a/Openstack.Client.Powershell/obj/Debug/Openstack.Client.Powershell.csprojResolveAssemblyReference.cache b/Openstack.Client.Powershell/obj/Debug/Openstack.Client.Powershell.csprojResolveAssemblyReference.cache new file mode 100644 index 0000000..eeebf1e Binary files /dev/null and b/Openstack.Client.Powershell/obj/Debug/Openstack.Client.Powershell.csprojResolveAssemblyReference.cache differ diff --git a/Openstack.Client.Powershell/obj/Debug/Openstack.Client.Powershell.dll b/Openstack.Client.Powershell/obj/Debug/Openstack.Client.Powershell.dll new file mode 100644 index 0000000..cf9a9a5 Binary files /dev/null and b/Openstack.Client.Powershell/obj/Debug/Openstack.Client.Powershell.dll differ diff --git a/Openstack.Client.Powershell/obj/Debug/Openstack.Client.Powershell.g.resources b/Openstack.Client.Powershell/obj/Debug/Openstack.Client.Powershell.g.resources new file mode 100644 index 0000000..40d5d53 Binary files /dev/null and b/Openstack.Client.Powershell/obj/Debug/Openstack.Client.Powershell.g.resources differ diff --git a/Openstack.Client.Powershell/obj/Debug/Openstack.Client.Powershell.pdb b/Openstack.Client.Powershell/obj/Debug/Openstack.Client.Powershell.pdb new file mode 100644 index 0000000..fb724ee Binary files /dev/null and b/Openstack.Client.Powershell/obj/Debug/Openstack.Client.Powershell.pdb differ diff --git a/Openstack.Client.Powershell/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/Openstack.Client.Powershell/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs new file mode 100644 index 0000000..e69de29 diff --git a/Openstack.Client.Powershell/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs b/Openstack.Client.Powershell/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs new file mode 100644 index 0000000..e69de29 diff --git a/Openstack.Client.Powershell/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/Openstack.Client.Powershell/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs new file mode 100644 index 0000000..e69de29 diff --git a/Openstack.Client.Powershell/packages.config b/Openstack.Client.Powershell/packages.config new file mode 100644 index 0000000..38bec45 --- /dev/null +++ b/Openstack.Client.Powershell/packages.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file