Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge new functions #16

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
1655eae
update
ymmit85 Dec 3, 2018
0671b67
Update to module
ymmit85 Dec 8, 2018
a3e7a3e
PowervROPs Update
ymmit85 Dec 11, 2018
b51499a
update
ymmit85 Dec 12, 2018
ee7ae37
update
ymmit85 Dec 12, 2018
27d6f07
update
ymmit85 Dec 13, 2018
ab265ef
update
ymmit85 Dec 22, 2018
621ce72
update
ymmit85 Dec 22, 2018
7e9f3b9
update
ymmit85 Jan 2, 2019
0fd08eb
support for deleting reports
ymmit85 Jan 4, 2019
17550d1
Merge pull request #1 from ymmit85/dev
ymmit85 Jan 4, 2019
7b0bf57
0.5.0
ymmit85 Jan 7, 2019
439a680
0.5.0
ymmit85 Jan 7, 2019
071ec8e
Delete get all vROPs Alerts.ps1
ymmit85 Jan 7, 2019
321abcb
0.5.0
ymmit85 Jan 7, 2019
40bbcff
0.5.0
ymmit85 Jan 7, 2019
a4d72ae
Merge branch 'Dev' of https://github.com/ymmit85/PowervROps into Dev
ymmit85 Jan 7, 2019
5bcbe40
0.5.0
ymmit85 Jan 8, 2019
8be9835
added versions
ymmit85 Feb 15, 2019
93d12b1
Merge branch 'Dev' of https://github.com/ymmit85/PowervROps into Dev
ymmit85 Feb 15, 2019
1486845
Merge pull request #2 from ymmit85/Dev
ymmit85 Mar 12, 2019
ead1226
update
ymmit85 Mar 21, 2019
ec0aad5
7.5 0.6.0 Update
ymmit85 Apr 14, 2019
f705c65
7.5 testing
ymmit85 May 1, 2019
f8d9d2e
7.5 0.6.1 Update
ymmit85 May 1, 2019
124db62
7.5 0.6.2 Update
ymmit85 May 9, 2019
f56a117
Merge branch 'Dev' of https://github.com/ymmit85/PowervROps into Dev
ymmit85 May 9, 2019
0549b94
7.5 0.6.2 Update
ymmit85 May 9, 2019
27c3a1c
Net.SecurityProtocolType Update
ymmit85 May 29, 2019
d4a4f9e
Merge branch 'Dev' of https://github.com/ymmit85/PowervROps into Dev
ymmit85 May 29, 2019
1059fa9
Net.SecurityProtocolType Update
ymmit85 May 29, 2019
03a95e6
added convert time function
ymmit85 May 31, 2019
8ccc3b0
Version 0.6.3
ymmit85 Jun 5, 2019
1795834
update
ymmit85 Jun 12, 2019
0931007
update
ymmit85 Jun 12, 2019
21d2b9e
dev
ymmit85 Jun 12, 2019
3017361
Merge pull request #3 from ymmit85/Dev
ymmit85 Jun 12, 2019
03d3cbf
0.6.4 update
ymmit85 Jun 15, 2019
fea3a9e
0.6.4 update
ymmit85 Jun 15, 2019
79b6b04
update
ymmit85 Jun 18, 2019
b6dae0e
update
ymmit85 Jun 18, 2019
9aadd64
update
ymmit85 Jun 19, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added PowervROps.psd1
Binary file not shown.
2,069 changes: 1,811 additions & 258 deletions PowervROps.psm1

Large diffs are not rendered by default.

77 changes: 77 additions & 0 deletions Scripts/Create Groups from Tag List.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
$tags = @()
$tags = Import-Csv .\tags.csv

foreach ($tag in $tags) {
#If item already has resource ID then skip
if ($tag.identifier -ne "") {
Continue
} else {

write-host "Creating group " $tag.groupname

$body = @{ # Create the json payload
'resourceKey' = @{
'name' = $tag.groupname
'adapterKindKey' = 'Container'
'resourceKindKey' = $tag.resourceKindKey
'resourceIdentifiers' = @()
}
'membershipDefinition' = @{
'includedResources' = @()
'excludedResources' = @()
'rules' = @(@{
'resourceKindKey' = @{
'resourceKind' = $tag.resourceKind
'adapterKind' = 'VMWARE'
}
'attributeRules' = @(@{
'type' = 'PROPERTY_CONDITION'
'compareOperator' = 'CONTAINS'
'stringValue' = $tag.stringValue
'key' = $tag.key
})
'resourceNameRules' = @()
'relationshipRules' = @()
}
)
}
}

$newbody = $body | convertto-json -depth 8 -Compress
$createCustomGroup = createCustomGroup -resthost $resthost -token $token -body $newbody

if (($createCustomGroup.identifier).length -eq 36) {

$groupcreated = $true

$teststate = 'SUCCESS'
#write-host ($testname + ": " + $teststate) -foregroundcolor green
} else {
write-host ($testname + ": " + $teststate) -foregroundcolor red
}

$testname = 'getCustomGroup'
$teststate = 'FAIL'

if ($token -ne "") {
$getCustomGroup = getCustomGroup -resthost $resthost -token $token -objectid ($createCustomGroup.identifier)
}
elseif ($credentials -ne "") {
$getCustomGroup = getCustomGroup -resthost $resthost -credentials $credentials -objectid ($createCustomGroup.identifier)
}

if (($createCustomGroup.identifier) -eq ($getCustomGroup.identifier)) {

$teststate = 'SUCCESS'
#write-host ($testname + ": " + $teststate) -foregroundcolor green
write-host "vROPs Group identifier = " $createCustomGroup.identifier
#update input list wite identifier
$tag.identifier = $createCustomGroup.identifier
}
else {
write-host ($testname + ": " + $teststate) -foregroundcolor red
}
$tags += $tag
}
}
$tags | Export-Csv .\tags.csv -NoTypeInformation -Force
File renamed without changes.
17 changes: 17 additions & 0 deletions Scripts/get all vROPs Alerts.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$alerts = getAlerts -resthost $resthost -token $token
$activealerts = $alerts.alerts
$alertHashTable =@()

foreach ($alert in $activealerts) {
#$alertHashTable =@()
$alertObject = $r = getResource -resthost $resthost -token $token -objectid $alert.resourceId
$alertHashTable += [PSCustomObject]@{
'Name' = $alert.alertDefinitionName
'status' = $alert.status
'alertLevel' = $alert.alertLevel
'Effected Object' = $alertObject.resourceKey.name
'Start Time' = (Get-Date 01.01.1970)+([System.TimeSpan]::FromMilliseconds($alert.startTimeUTC))
'Updated Time' = (Get-Date 01.01.1970)+([System.TimeSpan]::FromMilliseconds($alert.updateTimeUTC))
}
}
$alertHashTable | ogv
File renamed without changes.
71 changes: 71 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# PowervROPs

## Overview
PowervROps is a module written for PowerShell that can be used to access various elements of the vRealize Operations Manager API via PowerShell functions.
Feature requests are welcome via the issues tracker on the projects page on GitHub.

## Compatibility
- vROPs 7.0
- vROPs 7.5
- PowerShell 5.1

## ChangeLog

### 0.6.4
#### New Functions
- getResourcesWithAdapterAndResourceKind

### 0.6.3
#### New Functions
- getGlobalSettings

### 0.6.2
#### New Functions
- deleteAdapterInstance

### 0.6.0
- Support for vROPs 7.5
- Default to TLS 1.2

#### New Functions
- getLatestPropertiesofResources
- getLatestStatsofResources
- getSystemAudit
- getProductEdition
- addGroupType

### 0.5.0
#### New functions
The following functions have been added in version 0.5.0, most have been tested but there are a couple that still require modification to allow additonal parameter inputs.

- getAdapterInstances
- setAdapterInMaintenance
- setAdapterEndMaintenance
- setAdapterStartMonitoring
- setAdapterStopMonitoring
- releaseToken
- getAuthSources
- getAuthSource
- getRoles
- getUsers
- getUserGroups
- getCollectorGroups
- getServicesInfo
- getServiceInfo
- getPakList
- getPakStatus
- getPakDistributionStatus
- getNotificationRules
- addNotificationRule
- deleteReport
- getReports
- getSymptomDefinitions
- addCollecotrToGroup
- deleteCollectorFromGroup
- getCollectorGroup

## Support
This module is not supported by VMware, and comes with no warranties express or implied. Please test and validate its functionality before using this product in a production environment. The module exposes elements of both the public and internal APIs, the latter of these may not be included in future releases of vROps so functionality of this module may be reduced at a later date.
Please note that PowervRops is a work in progress, both in terms of the functions that are available but also some of the filtering methods that can be used via each function. There is an expectation that more functions will be made available, although the likelylihood is that this will not include the API in its entirety.

No testing has been done against PowerShell core at this time and there are a number of known issues (see issues tracker).
9 changes: 0 additions & 9 deletions readme.txt

This file was deleted.