Skip to content

Commit

Permalink
Implemented Retrieving of FC identify
Browse files Browse the repository at this point in the history
  • Loading branch information
ffeldhaus committed Dec 18, 2018
1 parent caa6b1f commit 5209f05
Showing 1 changed file with 58 additions and 3 deletions.
61 changes: 58 additions & 3 deletions src/OnCommand-Insight.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -5059,7 +5059,7 @@ function Global:Update-OciAnnotation {
$Result = ParseJsonString -json $Result.Trim()
}

Write-Output $Result
Write-Output $Result
}
}

Expand Down Expand Up @@ -6401,7 +6401,7 @@ function Global:Bulk-OciAssignApplicationToAssets {
if (!$assets) {
throw "No Assets specified!"
}

$switchparameters=@()
foreach ($parameter in $switchparameters) {
if ((Get-Variable $parameter).Value) {
Expand Down Expand Up @@ -16116,7 +16116,7 @@ function Global:Get-OciAnnotationsByQtree {

if ($Definition) {
$Uri += "?expand=definition"
}
}

try {
$Result = Invoke-RestMethod -WebSession $Server.Session -TimeoutSec $Server.Timeout -Method GET -Uri $Uri -Headers $Server.Headers
Expand Down Expand Up @@ -31137,6 +31137,61 @@ function Global:Search-Oci {
}
}

## identifications ##

<#
.SYNOPSIS
Retrieve FC Identify
.DESCRIPTION
Retrieve FC Identify
.PARAMETER expand
Expand parameter for underlying JSON object (e.g. expand=acquisitionUnit)
.PARAMETER server
OCI Server to connect to
#>
function Global:Get-OciFcIdentify {
[CmdletBinding()]

PARAM (
[parameter(Mandatory=$False,
Position=0,
HelpMessage="Expand parameter for underlying JSON object (e.g. expand=acquisitionUnit)")][String]$expand,
[parameter(Mandatory=$False,
Position=1,
HelpMessage="OnCommand Insight Server.")]$Server=$CurrentOciServer
)

Begin {
$Result = $null
if (!$Server) {
throw "Server parameter not specified and no global OCI Server available. Run Connect-OciServer first!"
}
}

Process {
$Uri = $Server.BaseUri + "/rest/v1/identifications/fc"

if ($expand) {
$Uri += "?$($Separator)expand=$expand"
}

try {
$Result = Invoke-RestMethod -WebSession $Server.Session -TimeoutSec $Server.Timeout -Method GET -Uri $Uri -Headers $Server.Headers
}
catch {
$ResponseBody = ParseExceptionBody -Response $_.Exception.Response
Write-Error "GET to $Uri failed with Exception $($_.Exception.Message) `n $responseBody"
}

if (([String]$Result).Trim().startsWith('{') -or ([String]$Result).toString().Trim().startsWith('[')) {
$Result = ParseJsonString -json $Result.Trim
}

#$Datasources = ParseDatasources -Datasources $Result -Timezone $Server.Timezone
Write-Output $Result
}
}

### Experimental Cmdlets ###

<#
Expand Down

0 comments on commit 5209f05

Please sign in to comment.