Skip to content

Commit 4eb64ec

Browse files
authored
Merge pull request #807 from rubrikinc/devel
[skip ci] Merge Devel into Master for `6.0.0` release
2 parents dfdd1c3 + 254248f commit 4eb64ec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+9244
-7207
lines changed

CHANGELOG.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Change Log
1+
# Changelog
22

33
All notable changes to this project will be documented in this file.
44

@@ -14,18 +14,51 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1414
* **Fixed** for any bug fixes.
1515
* **Security** in case of vulnerabilities.
1616

17+
## [7.0.0]() -
18+
19+
### Changed
20+
21+
### Added
22+
23+
### Fixed
24+
25+
## [6.0.0](https://github.com/rubrikinc/rubrik-sdk-for-powershell/tree/6.0.0) - 2022-01-07
26+
27+
### Changed
28+
29+
* Changed behavior of `Test-RubrikSLA` when no explicit primaryclusterid is specified and multiple matches are found it defaults to local, resolves [Issue 782](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/782)
30+
* Updated various sections of the documentations with additional TLS 1.2 troubleshooting steps & solutions, resolves [Issue 778](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/778)
31+
* Modified `Get-RubrikAvailabilityGroup` query parameters to respect the `PrimaryClusterId`. Resolves [Issue 777](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/777)
32+
* Modified `Get-RubrikAvailabilityGroup` to use the v1 endpoint in CDM 6.0 and above
33+
* Modified TypeDefinition for SQL Instance to show status of unprotected instances rather than just show retention SLA. Resolves [Issue 760](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/760)
34+
* Added support for the v1 endpoint for `Get-RubrikOracleDB` when using 6.0 or above. Resolves [Issue 784](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/784)
35+
* Added ability to retain snapshots while setting the `-DoNotProtect` parameter to `Protect-RubrikFileset`,`Protect-RubrikDatabase`,`Protect-RubrikHyperVVM` and `Protect-RubrikNutanixVM`, this resolves [Issue 795](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/795) and [Issue 785](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/785) and [Issue 697](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/697)
36+
37+
### Added
38+
39+
* Added `Get-RubrikClusterUpgradeHistory` which Retrieves upgrade history for a given cluster, resolves [Issue 789](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/789)
40+
* Added `Find-RubrikFile` which allows end users to automate the search process of finding files within Rubrik snapshots. [Issue 798](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/798)
41+
* Added `CANCELED` as an exit condition for `Get-RubrikRequest` as suggested by @IamTHEvilONE, resolves [Issue 794](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/794)
42+
* Added `-ReseedOnBreak` switch parameter to `New-RubrikLogShipping` to support reseed operations in version 6.0 and above, resolves [Issue 792](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/792)
43+
44+
### Fixed
45+
46+
* `Test-UnicodeInString` issue fixed, issue with slowness for large JSON response thanks @nic080 & @iisresetme, resolves [Issue 774](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/774)
47+
* `Get-RubrikDownloadLink` issue fixed where incorrect timezone could cause cmdlet to get stuck, thanks @benckendall
48+
1749
## [5.3.1](https://github.com/rubrikinc/rubrik-sdk-for-powershell/tree/5.3.1) - 2021-07-06
1850

1951
### Changed
2052

21-
* Added new parameter set & two parameters to `Get-RubrikSnapshot`, `-SnapshotId` & `-SnapshotType` to allow for querying by snapshotid [Issue 743](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/743)
53+
* Added new parameter set & two parameters to `Get-RubrikSnapshot`: `-SnapshotId` & `-SnapshotType` to allow for querying by snapshotid [Issue 743](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/743)
2254
* Updated parameter help for `-Archival` parameter in `New-RubrikSla` cmdlet
2355

2456
### Added
2557

2658
* Added troubleshooting step and additional CDM API links, resolving [Issue 770](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/770)
2759
* Added additional debug logging to `Invoke-RubrikWebRequest`, resolving [Issue 721](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/721)
28-
60+
* Added `Get-RubrikDatabaseDownloadLink` to support the ability to pull mdf/ldf files out of snapshots, resolving [Issue 790](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/790)
61+
*
2962
### Fixed
3063

3164
* Fixed typo in documentation, resolving [Issue 776](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/776)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ Where `#.#.#` represents the version number, for example 5.3.1
1818

1919
The Rubrik SDK for PowerShell provides two mechanisms for supplying credentials to the Connect-Rubrik function. A combination of username and password or a credential object. Credentials in the credential object may be entered manually or provided as an object. The example below prompts for a username and password to create a credential object, connects to a cluster and displays the running version.
2020

21-
```
21+
```powershell
2222
$Credential = Get-Credential
2323
Connect-Rubrik -Server 192.168.10.10 -Credential $Credential
24-
Get-RubrikVersion
24+
Get-RubrikDebugInfo
2525
```
2626

2727
# :blue_book: Documentation

Rubrik/ObjectDefinitions/Rubrik.MSSQLInstance.ps1xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@
3737
<ScriptBlock>$_.rootProperties.rootName</ScriptBlock>
3838
</TableColumnItem>
3939
<TableColumnItem>
40-
<PropertyName>configuredSlaDomainName</PropertyName>
40+
<ScriptBlock>
41+
if ($_.configuredSlaDomainType -eq "RetentionSla") {
42+
"Unprotected (Retention SLA Applied)"
43+
} else {
44+
$_.configuredSlaDomainName
45+
}
46+
</ScriptBlock>
4147
</TableColumnItem>
4248
<TableColumnItem>
4349
<PropertyName>id</PropertyName>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Configuration>
3+
<ViewDefinitions>
4+
<View>
5+
<Name>Default</Name>
6+
<ViewSelectedBy>
7+
<TypeName>Rubrik.RubrikFile</TypeName>
8+
</ViewSelectedBy>
9+
<TableControl>
10+
<TableHeaders>
11+
<TableColumnHeader>
12+
<Label>File Name</Label>
13+
</TableColumnHeader>
14+
<TableColumnHeader>
15+
<Label>Object Name</Label>
16+
</TableColumnHeader>
17+
<TableColumnHeader>
18+
<Label>Path</Label>
19+
</TableColumnHeader>
20+
</TableHeaders>
21+
<TableRowEntries>
22+
<TableRowEntry>
23+
<TableColumnItems>
24+
<TableColumnItem>
25+
<PropertyName>filename</PropertyName>
26+
</TableColumnItem>
27+
<TableColumnItem>
28+
<PropertyName>ObjectName</PropertyName>
29+
</TableColumnItem>
30+
<TableColumnItem>
31+
<PropertyName>path</PropertyName>
32+
</TableColumnItem>
33+
</TableColumnItems>
34+
</TableRowEntry>
35+
</TableRowEntries>
36+
</TableControl>
37+
</View>
38+
</ViewDefinitions>
39+
</Configuration>

Rubrik/Private/Get-RubrikAPIData.ps1

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,26 @@ function Get-RubrikAPIData {
169169
Success = '202'
170170
}
171171
}
172+
'Find-RubrikFile' = @{
173+
'1.0' = @{
174+
Description = 'Retrieves software version of the Rubrik cluster'
175+
URI = '/api/internal/search'
176+
Method = 'Get'
177+
Body = ''
178+
Query = @{
179+
'ID' = 'managed_id'
180+
'SearchString' = 'query_string'
181+
'limit' = 'limit'
182+
'cursor' = 'cursor'
183+
}
184+
Result = 'data'
185+
Filter = @{
186+
}
187+
Success = '200'
188+
ObjectTName = 'Rubrik.RubrikFile'
189+
190+
}
191+
}
172192
'Get-RubrikAPIToken' = @{
173193
'5.0' = @{
174194
Description = 'Retrieves list of generated API tokens from the Rubrik cluster'
@@ -225,6 +245,25 @@ function Get-RubrikAPIData {
225245
Body = ''
226246
Query = @{
227247
primary_database_id = 'primary_database_id'
248+
primary_cluster_id = 'primary_cluster_id'
249+
}
250+
Result = 'data'
251+
Filter = @{
252+
'GroupName' = 'name'
253+
'SLA' = 'effectiveSlaDomainName'
254+
'SLAID' = 'effectiveSlaDomainId'
255+
}
256+
Success = '200'
257+
ObjectTName = 'Rubrik.AvailabilityGroup'
258+
}
259+
'6.0' = @{
260+
Description = 'Get summary information for Microsoft SQL availability groups'
261+
URI = '/api/v1/mssql/availability_group'
262+
Method = 'Get'
263+
Body = ''
264+
Query = @{
265+
primary_database_id = 'primary_database_id'
266+
primary_cluster_id = 'primary_cluster_id'
228267
}
229268
Result = 'data'
230269
Filter = @{
@@ -384,6 +423,18 @@ function Get-RubrikAPIData {
384423
Success = '200'
385424
}
386425
}
426+
'Get-RubrikClusterUpgradeHistory' = @{
427+
'5.0' = @{
428+
Description = 'Retrieves advanced settings of the Rubrik cluster'
429+
URI = '/api/v1/config/history/list_updates?namespace=local_atlas&source=Upgrade'
430+
Method = 'Get'
431+
Body = ''
432+
Query = ''
433+
Result = 'data'
434+
Filter = ''
435+
Success = '200'
436+
}
437+
}
387438
'Get-RubrikBackupServiceDeployment' = @{
388439
'1.0' = @{
389440
Description = 'Retrieve the global settings for automatic deployment of the Rubrik Backup Service to virtual machines.'
@@ -421,6 +472,20 @@ function Get-RubrikAPIData {
421472
ObjectTName = 'Rubrik.MSSQLDatabase'
422473
}
423474
}
475+
'Get-RubrikDatabaseDownloadLink' = @{
476+
'1.0' = @{
477+
Description = 'Returns a link to download the mdf/ldf files of a given MSSQL Snapshot'
478+
URI = '/api/v1/mssql/db/{id}/download_files_by_id'
479+
Method = 'POST'
480+
Body = @{
481+
items = @()
482+
}
483+
Query = ''
484+
Result = ''
485+
Filter = ''
486+
Success = '202'
487+
}
488+
}
424489
'Get-RubrikDatabaseFiles' = @{
425490
'1.0' = @{
426491
Description = 'Returns a list of files for the database.'
@@ -1031,6 +1096,28 @@ function Get-RubrikAPIData {
10311096
Success = '200'
10321097
ObjectTName = 'Rubrik.OracleDatabase'
10331098
}
1099+
'6.0' = @{
1100+
Description = 'Get summary of all the Oracle DBs'
1101+
URI = '/api/v1/oracle/db'
1102+
Method = 'Get'
1103+
Body = ''
1104+
Query = @{
1105+
is_relic = 'is_relic'
1106+
is_live_mount = 'is_live_mount'
1107+
name = 'name'
1108+
effective_sla_domain_id = 'effective_sla_domain_id'
1109+
sla_assignment = 'sla_assignment'
1110+
primary_cluster_id = 'primary_cluster_id'
1111+
is_data_guard_group = 'is_data_guard_group'
1112+
}
1113+
Result = 'data'
1114+
Filter = @{
1115+
'Name' = 'name'
1116+
'SLA' = 'effectiveSlaDomainName'
1117+
}
1118+
Success = '200'
1119+
ObjectTName = 'Rubrik.OracleDatabase'
1120+
}
10341121
}
10351122
'Get-RubrikOrganization' = @{
10361123
'1.0' = @{
@@ -2323,6 +2410,20 @@ function Get-RubrikAPIData {
23232410
Filter = ''
23242411
Success = '200'
23252412
}
2413+
'5.2' = @{
2414+
Description = 'Update a Microsoft SQL database with the specified SLA Domain.'
2415+
URI = '/api/v2/sla_domain/{id}/assign'
2416+
Method = 'Post'
2417+
Body = @{
2418+
managedIds = [System.Collections.ArrayList]@()
2419+
configuredSlaDomainId = 'configuredSlaDomainId'
2420+
existingSnapshotRetention = 'existingSnapshotRetention'
2421+
}
2422+
Query = ''
2423+
Result = ''
2424+
Filter = ''
2425+
Success = '200'
2426+
}
23262427
}
23272428
'Protect-RubrikFileset' = @{
23282429
'1.0' = @{
@@ -2337,6 +2438,20 @@ function Get-RubrikAPIData {
23372438
Filter = ''
23382439
Success = '200'
23392440
}
2441+
'5.2' = @{
2442+
Description = 'Update a fileset with the specified SLA Domain.'
2443+
URI = '/api/v2/sla_domain/{id}/assign'
2444+
Method = 'Post'
2445+
Body = @{
2446+
managedIds = [System.Collections.ArrayList]@()
2447+
configuredSlaDomainId = 'configuredSlaDomainId'
2448+
existingSnapshotRetention = 'existingSnapshotRetention'
2449+
}
2450+
Query = ''
2451+
Result = ''
2452+
Filter = ''
2453+
Success = '200'
2454+
}
23402455
}
23412456
'Protect-RubrikHyperVVM' = @{
23422457
'1.0' = @{
@@ -2351,6 +2466,20 @@ function Get-RubrikAPIData {
23512466
Filter = ''
23522467
Success = '200'
23532468
}
2469+
'5.2' = @{
2470+
Description = 'Update a VM with the specified SLA Domain.'
2471+
URI = '/api/v2/sla_domain/{id}/assign'
2472+
Method = 'Post'
2473+
Body = @{
2474+
managedIds = [System.Collections.ArrayList]@()
2475+
configuredSlaDomainId = 'configuredSlaDomainId'
2476+
existingSnapshotRetention = 'existingSnapshotRetention'
2477+
}
2478+
Query = ''
2479+
Result = ''
2480+
Filter = ''
2481+
Success = '200'
2482+
}
23542483
}
23552484
'Protect-RubrikNutanixVM' = @{
23562485
'1.0' = @{
@@ -2365,6 +2494,20 @@ function Get-RubrikAPIData {
23652494
Filter = ''
23662495
Success = '200'
23672496
}
2497+
'5.2' = @{
2498+
Description = 'Update a VM with the specified SLA Domain.'
2499+
URI = '/api/v2/sla_domain/{id}/assign'
2500+
Method = 'Post'
2501+
Body = @{
2502+
managedIds = [System.Collections.ArrayList]@()
2503+
configuredSlaDomainId = 'configuredSlaDomainId'
2504+
existingSnapshotRetention = 'existingSnapshotRetention'
2505+
}
2506+
Query = ''
2507+
Result = ''
2508+
Filter = ''
2509+
Success = '200'
2510+
}
23682511
}
23692512
'Protect-RubrikTag' = @{
23702513
'1.0' = @{
@@ -3563,6 +3706,30 @@ function Get-RubrikAPIData {
35633706
Filter = ''
35643707
Success = '202'
35653708
}
3709+
'6.0' = @{
3710+
Description = 'Create a log shipping configuration'
3711+
URI = '/api/v2/mssql/db/{id}/log_shipping'
3712+
Method = 'Post'
3713+
Body = @{
3714+
state = 'state'
3715+
shouldDisconnectStandbyUsers = 'shouldDisconnectStandbyUsers'
3716+
maxDataStreams = 'maxDataStreams'
3717+
targetDatabaseName = 'targetDatabaseName'
3718+
targetDataFilePath = 'targetDataFilePath'
3719+
targetFilePaths = @{
3720+
logicalName = 'logicalName'
3721+
exportPath = 'exportPath'
3722+
newLogicalName = 'newLogicalName'
3723+
newFilename = 'newFilename'
3724+
}
3725+
targetInstanceId = 'targetInstanceId'
3726+
targetLogFilePath = 'targetLogFilePath'
3727+
makeupReseedLimit = 'makeupReseedLimit'
3728+
}
3729+
Result = ''
3730+
Filter = ''
3731+
Success = '202'
3732+
}
35663733
}
35673734
'Remove-RubrikLogShipping' = @{
35683735
'1.0' = @{

Rubrik/Private/Test-FilterObject.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
Write-Verbose -Message 'Filter the results'
1717
foreach ($param in $filter.Keys) {
1818
if ((Get-Variable -Name $param -ErrorAction SilentlyContinue).Value -ne $null) {
19-
Write-Verbose -Message "Filter match = $param"
19+
Write-Verbose -Message "Filter match = '$param' with value = '$((Get-Variable -Name $param).Value)'"
2020
$result = Test-ReturnFilter -object (Get-Variable -Name $param).Value -location $filter[$param] -result $result
2121
}
2222
}

Rubrik/Private/Test-RubrikSLA.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,17 @@
2929
if (-not [string]::IsNullOrWhiteSpace($PrimaryClusterID)) {
3030
(Get-RubrikSLA -SLA $SLA -PrimaryClusterID $PrimaryClusterID).id
3131
} else {
32-
(Get-RubrikSLA -SLA $SLA).id
32+
$currentId = (Get-RubrikSLA -SLA $SLA).id
33+
if (@($currentId).count -gt 1) {
34+
Write-Verbose -Message "Multiple SLA ID for '$SLA', limiting query to local cluster"
35+
(Get-RubrikSLA -SLA $SLA -PrimaryClusterID local).id
36+
} else {
37+
$currentId
38+
}
3339
}
3440
}
3541
if ($slaid -eq $null) {
36-
throw "No SLA Domains were found that match $SLA for $PrimaryClusterID"
42+
throw "No SLA Domains were found that match '$SLA' for cluster ID '$PrimaryClusterID'"
3743
}
3844
return $slaid
3945
}

0 commit comments

Comments
 (0)