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

Get-RubrikOracleDB is using internal API endpoints instead of v1 on CDM 6.X #784

Closed
marcus9467 opened this issue Sep 17, 2021 · 0 comments · Fixed by #797
Closed

Get-RubrikOracleDB is using internal API endpoints instead of v1 on CDM 6.X #784

marcus9467 opened this issue Sep 17, 2021 · 0 comments · Fixed by #797
Assignees
Labels

Comments

@marcus9467
Copy link

Current Behavior:

Using the internal endpoint works fine for most Oracle DBs, but DataGuard based DBs were just recently added into the support matrix in CDM 6.X, and the oracle/{DB} endpoint only works with the v1 branch for those DBs.

PS /Users/marcushenderson> Get-RubrikOracleDB -id OracleDatabase:::62ed90f1-cc25-45e8-a6ea-ee61f273d0e7 -Verbose
VERBOSE: Validate the Rubrik token exists
VERBOSE: Found a Rubrik token for authentication
VERBOSE: Gather API Data for Get-RubrikOracleDB
VERBOSE: Selected 1.0 API Data for Get-RubrikOracleDB
VERBOSE: Load API data for Get-RubrikOracleDB
VERBOSE: Description: Get summary of all the Oracle DBs
VERBOSE: Build the URI
VERBOSE: URI = https://10.38.4.177/api/internal/oracle/db/OracleDatabase:::62ed90f1-cc25-45e8-a6ea-ee61f273d0e7
VERBOSE: Build the query parameters for name,effective_sla_domain_id,is_relic,sla_assignment,primary_cluster_id,is_live_mount
VERBOSE: URI = https://10.38.4.177/api/internal/oracle/db/OracleDatabase:::62ed90f1-cc25-45e8-a6ea-ee61f273d0e7?is_relic=False&is_live_mount=False
VERBOSE: Submitting the request
VERBOSE: Invoking request with a custom timeout of 1500 seconds
VERBOSE: GET https://10.38.4.177/api/internal/oracle/db/OracleDatabase:::62ed90f1-cc25-45e8-a6ea-ee61f273d0e7?is_relic=False&is_live_mount=False with 0-byte payload
VERBOSE: received 196-byte response of content type text/plain
WARNING: user_error
WARNING: OracleDatabase:::62ed90f1-cc25-45e8-a6ea-ee61f273d0e7 is a Data Guard Group database. This GET API cannot be used forData Guard Group databases.
OperationStopped: /Users/marcushenderson/.local/share/powershell/Modules/Rubrik/5.3.1/Private/Submit-Request.ps1:122
Line |
 122 |                          throw $_.Exception
     |                          ~~~~~~~~~~~~~~~~~~
     | Response status code does not indicate success: 422 (Unprocessable Entity).```

**Expected Behavior**:
We should update the cmdlet to use the v1 endpoint instead of the internal when connecting to CDM 6.0. 

**Steps to Reproduce**:

Please provide detailed steps for reproducing the issue.

1. Identify an Oracle DataGuard DB
2. Attempt to use Get-RubrikOracleDB specifying its ID
3. Use Invoke-RubrikRESTCall to instead specify v1 and observe the output successfully returns:


`Invoke-RubrikRESTCall -Endpoint "oracle/db/OracleDatabase:::62ed90f1-cc25-45e8-a6ea-ee61f273d0e7" -Method GET -Verbose
VERBOSE: Validate the Rubrik token exists
VERBOSE: Found a Rubrik token for authentication
VERBOSE: Build the URI
VERBOSE: URI = https://10.38.4.177/api/v1/oracle/db/OracleDatabase:::62ed90f1-cc25-45e8-a6ea-ee61f273d0e7
VERBOSE: URI string: https://10.38.4.177/api/v1/oracle/db/OracleDatabase:::62ed90f1-cc25-45e8-a6ea-ee61f273d0e7
VERBOSE: Body string:
VERBOSE: Performing the operation "Invoke WebRequest" on target "https://10.38.4.177/api/v1/oracle/db/OracleDatabase:::62ed90f1-cc25-45e8-a6ea-ee61f273d0e7".
VERBOSE: Submitting the request
VERBOSE: Invoking request with a custom timeout of 1500 seconds
VERBOSE: GET https://10.38.4.177/api/v1/oracle/db/OracleDatabase:::62ed90f1-cc25-45e8-a6ea-ee61f273d0e7 with 0-byte payload
VERBOSE: received 2151-byte response of content type application/json
VERBOSE: Received HTTP Status 200                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     id                                       : OracleDatabase:::62ed90f1-cc25-45e8-a6ea-ee61f273d0e7                                                                                                                                                                                                                                                                   name                                     : ORCL
configuredSlaDomainId                    : b1e3e328-b464-45af-bab1-8358e9eec203
configuredSlaDomainName                  : Mallik_Oracle
configuredSlaDomainType                  : ProtectionSla
primaryClusterId                         : 785f9f3b-f68f-4053-bdc3-fffbbef170db
isConfiguredSlaDomainRetentionLocked     : False
slaLastUpdateTime                        : 8/2/2021 9:28:06 AM
effectiveSlaDomainId                     : b1e3e328-b464-45af-bab1-8358e9eec203
effectiveSlaDomainName                   : Mallik_Oracle
isEffectiveSlaDomainRetentionLocked      : False
effectiveSlaSourceObjectId               : OracleDatabase:::62ed90f1-cc25-45e8-a6ea-ee61f273d0e7
effectiveSlaSourceObjectName             : ORCL
slaAssignment                            : Direct
retentionSlaDomainId                     : b1e3e328-b464-45af-bab1-8358e9eec203
infraPath                                : {}
isRelic                                  : False
numTablespaces                           : 6
logBackupFrequencyInMinutes              : 60
numMissedSnapshot                        : 0
lastSnapshotTime                         : 9/16/2021 4:33:17 PM
includeBackupTaskInfo                    : True
currentBackupTaskInfo                    : @{taskStatus=Queued; queueTime=9/17/2021 4:30:00 PM}
isDbLocalToTheCluster                    : True
hostLogRetentionHours                    : 4
isArchiveLogModeEnabled                  : True
dbUniqueName                             : DG_GROUP_ORCL
dataGuardType                            : DataGuardGroup
dataGuardGroupMembers                    : {@{dbUniqueName=ORCLSB; role=PHYSICAL STANDBY; standaloneHostId=OracleHost:::8dbfb192-c7ed-456a-a4ae-306c34f9bfdf; standaloneHostName=oraclesb.localdomain.com}, @{dbUniqueName=ORCL; role=PRIMARY; standaloneHostId=OracleHost:::a4ed9728-d49c-4720-ab41-bc398f5f86c5; standaloneHostName=oracledb.localdomain.com}}
logRetentionHours                        : 72
numChannels                              : 2
hostMount                                : /var/rubrik/oracle
tablespaces                              : {SYSAUX, SYSTEM, UNDOTBS1, USERS…}
snapshotCount                            : 3
latestRecoveryPoint                      : 9/17/2021 2:53:34 PM
oldestRecoveryPoint                      : 9/14/2021 4:30:40 PM
isLiveMount                              : False
hostsInfo                                : {@{id=Host:::e813b93e-262c-45d3-a2db-e55ce34be18a; hostname=10.38.4.118; oracleSysDbaUser=oracle; oracleQueryUser=oracle}, @{id=Host:::6777d678-1309-45b2-aaeb-db7f464d74fc; hostname=10.38.4.158; oracleSysDbaUser=oracle; oracleQueryUser=oracle}}
shouldBackupFromPrimaryDGGroupMemberOnly : False
preferredDGMemberUniqueNames             : {ORCLSB}`


**Context**:

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

* **Rubrik PowerShell Module Version**: 5.3.1
* **PowerShell Version**: 7.1.4 
* **Operating System**: macOS 11.5.2


**Failure Logs**


@marcus9467 marcus9467 changed the title Get-RubrikOracleDB is using internal API endpoints instead of v1 Get-RubrikOracleDB is using internal API endpoints instead of v1 on CDM 6.X Sep 17, 2021
@mwpreston mwpreston self-assigned this Jan 4, 2022
@mwpreston mwpreston mentioned this issue Jan 4, 2022
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants