-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
1,349 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Class ApplianceInfo { | ||
[String]$Name | ||
[String]$Description | ||
[String]$Vendor | ||
[String]$Branding | ||
[Version]$Version | ||
[String]$BuildNumber | ||
[String]$BuildDate | ||
[String]$Guid | ||
[String]$OperationStatus | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Class Domain { | ||
[Int]$Id | ||
[Int]$DeviceId | ||
[String[]]$PublicAddress | ||
[String]$Name | ||
[String]$Description | ||
[String]$Identifier | ||
[Int]$DomainTypeId | ||
[String]$DomainTypeValue | ||
[Int]$DomainRoleTypeId | ||
[String]$DomainRoleTypeValue | ||
[Version]$Version | ||
[Boolean]$Local | ||
[String]$GroupId | ||
[String]$GroupName | ||
[Boolean]$BackupLead | ||
[String[]]$Capabilities | ||
[Int]$BackupLeadHealth | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
# | ||
# Generated by: Trevor Squillario <[email protected]> | ||
# | ||
# Generated on: 1/12/2023 | ||
# Generated on: 1/19/2023 | ||
# | ||
|
||
@{ | ||
|
@@ -12,7 +12,7 @@ | |
RootModule = 'DellOpenManage.psm1' | ||
|
||
# Version number of this module. | ||
ModuleVersion = '3.2.0' | ||
ModuleVersion = '3.3.0' | ||
|
||
# Supported PSEditions | ||
# CompatiblePSEditions = @() | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using module ..\Classes\ApplianceInfo.psm1 | ||
function New-ApplianceInfoFromJson { | ||
Param( | ||
[PSCustomObject]$ApplianceInfo | ||
) | ||
$ApplianceInfoObj = [ApplianceInfo]@{ | ||
Name = $ApplianceInfo.Name | ||
Description = $ApplianceInfo.Description | ||
Vendor = $ApplianceInfo.Vendor | ||
Branding = $ApplianceInfo.Branding | ||
Version = [Version]$ApplianceInfo.Version | ||
BuildNumber = $ApplianceInfo.BuildNumber | ||
BuildDate = $ApplianceInfo.BuildDate | ||
Guid = $ApplianceInfo.Guid | ||
OperationStatus = $ApplianceInfo.OperationStatus | ||
} | ||
return $ApplianceInfoObj | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using module ..\Classes\Domain.psm1 | ||
function New-DomainFromJson { | ||
Param( | ||
[PSCustomObject]$Domain | ||
) | ||
return [Domain]@{ | ||
Id = $Domain.Id | ||
DeviceId = $Domain.DeviceId | ||
PublicAddress = $Domain.PublicAddress | ||
Name = $Domain.Name | ||
Description = $Domain.Description | ||
Identifier = $Domain.Identifier | ||
DomainTypeId = $Domain.DomainTypeId | ||
DomainTypeValue = $Domain.DomainTypeValue | ||
DomainRoleTypeId = $Domain.DomainRoleTypeId | ||
DomainRoleTypeValue = $Domain.DomainRoleTypeValue | ||
Version = $Domain.Version | ||
Local = $Domain.Local | ||
GroupId = $Domain.GroupId | ||
GroupName = $Domain.GroupName | ||
BackupLead = $Domain.BackupLead | ||
Capabilities = $Domain.Capabilities | ||
BackupLeadHealth = $Domain.BackupLeadHealth | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
|
||
function Get-OMEApplianceInfo { | ||
<# | ||
Copyright (c) 2021 Dell EMC Corporation | ||
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. | ||
#> | ||
|
||
<# | ||
.SYNOPSIS | ||
Get appliance info | ||
.DESCRIPTION | ||
This script uses the OME REST API. | ||
Note that the credentials entered are not stored to disk. | ||
.PARAMETER Name | ||
String containing name to search by | ||
.EXAMPLE | ||
Get-OMEApplianceInfo | Format-Table | ||
List all account roles | ||
.EXAMPLE | ||
Get-OMEApplianceInfo | Format-Table | ||
Get appliance info | ||
#> | ||
|
||
Begin {} | ||
Process { | ||
if (!$(Confirm-IsAuthenticated)){ | ||
Return | ||
} | ||
Try { | ||
if ($SessionAuth.IgnoreCertificateWarning) { Set-CertPolicy } | ||
$BaseUri = "https://$($SessionAuth.Host)" | ||
$Headers = @{} | ||
$ContentType = "application/json" | ||
$Headers."X-Auth-Token" = $SessionAuth.Token | ||
|
||
$ApplianceInfoUrl = $BaseUri + "/api/ApplicationService/Info" | ||
|
||
Write-Verbose $ApplianceInfoUrl | ||
$ApplianceInfoResponse = Invoke-WebRequest -Uri $ApplianceInfoUrl -UseBasicParsing -Method Get -Headers $Headers -ContentType $ContentType | ||
if ($ApplianceInfoResponse.StatusCode -in 200, 201) { | ||
$ApplianceInfoData = $ApplianceInfoResponse.Content | ConvertFrom-Json | ||
$ApplianceInfo = New-ApplianceInfoFromJson -ApplianceInfo $ApplianceInfoData | ||
return $ApplianceInfo | ||
} | ||
} | ||
Catch { | ||
Resolve-Error $_ | ||
} | ||
|
||
} | ||
|
||
End {} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.