Skip to content

Commit cdc8795

Browse files
feat(graph): add oracle autonomous db (#22)
1 parent eac3b28 commit cdc8795

5 files changed

Lines changed: 133 additions & 0 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# OracleAutonomousDB
2+
3+
Represents Oracle Autonomous Database resources discovered from Azure ARM.
4+
5+
**Labels:** `:ArmResource:OracleAutonomousDB`
6+
7+
**Properties:**
8+
9+
- `id` - Resource ID (primary key)
10+
- `actualUsedDataStorageSizeInTbs` - Actual used storage size in TB
11+
- `allocatedStorageSizeInTbs` - Allocated storage size in TB
12+
- `backupRententionPeriodInDays` - Backup retention period in days
13+
- `characterSet` - Database character set
14+
- `databaseType` - Oracle database type (from ARM `dataBaseType`)
15+
- `dbVersion` - Database version
16+
- `displayName` - Display name
17+
- `isLocalDataGuardEnabled` - Whether local Data Guard is enabled
18+
- `isMtlsConnectionRequired` - Whether mTLS is required for connections
19+
- `isRemoteDataGuardEnabled` - Whether remote Data Guard is enabled
20+
- `localDisasterRecoveryType` - Local disaster recovery type
21+
- `ociUrl` - Oracle Cloud URL
22+
- `ocid` - Oracle Cloud identifier
23+
- `openMode` - Database open mode
24+
- `permissionLevel` - Permission/access level
25+
- `privateEndpoint` - Private endpoint resource
26+
- `privateEndpointIp` - Private endpoint IP address
27+
- `privateEndpointLabel` - Private endpoint label
28+
- `timeCreated` - Creation timestamp
29+
- `timeLocalDataGuardEnabled` - Timestamp when local Data Guard was enabled
30+
- `highConnectionString` - High workload connection string
31+
- `mediumConnectionString` - Medium workload connection string
32+
- `lowConnectionString` - Low workload connection string
33+
- Dynamic URL properties from `connectionUrls` (e.g. `apexUrl`, `ordsUrl`, `sqlDevWebUrl`, `graphStudioUrl`, `machineLearningNotebookUrl`, `databaseTransformsUrl`)
34+
35+
## Relationships
36+
37+
### Incoming
38+
39+
- **ArmResource**`HAS_ORACLE_RESOURCE`**OracleAutonomousDB** - Subnet-linked parent resource contains this database
40+
41+
## Examples
42+
43+
```cypher
44+
// Find Oracle autonomous databases and connection info
45+
MATCH (db:OracleAutonomousDB)
46+
RETURN db.displayName, db.dbVersion, db.openMode, db.permissionLevel
47+
```
48+
49+
```cypher
50+
// Find databases with mTLS not required
51+
MATCH (db:OracleAutonomousDB)
52+
WHERE db.isMtlsConnectionRequired = false
53+
RETURN db.displayName, db.privateEndpoint
54+
```
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# HAS_ORACLE_RESOURCE
2+
3+
Represents the relationship between an ARM resource and Oracle database resources hosted within it.
4+
5+
**Direction:** `(subnet)-[:HAS_ORACLE_RESOURCE]->(oracleDb)`
6+
7+
**Description:** Indicates that an ARM resource (typically a subnet) contains or is associated with an Oracle Autonomous Database resource.
8+
9+
**Properties:** None
10+
11+
## Usage
12+
13+
- **ArmResource**`HAS_ORACLE_RESOURCE`**OracleAutonomousDB** - Subnet or parent resource associated with an Oracle Autonomous Database
14+
15+
## Query Examples
16+
17+
```cypher
18+
// Find all Oracle databases and their parent resources
19+
MATCH (src:ArmResource)-[:HAS_ORACLE_RESOURCE]->(db:OracleAutonomousDB)
20+
RETURN src.id, db.displayName, db.dbVersion
21+
22+
// Find Oracle databases accessible via private endpoint
23+
MATCH (src:ArmResource)-[:HAS_ORACLE_RESOURCE]->(db:OracleAutonomousDB)
24+
WHERE db.privateEndpointIp IS NOT NULL
25+
RETURN src.id, db.displayName, db.privateEndpointIp
26+
```
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: "Oracle Autonomous Database"
2+
label: "{{ LABELS.OracleAutonomousDB }}"
3+
table_name: "resources"
4+
resource_type: "oracle.database/autonomousdatabases"
5+
properties:
6+
- "/id"
7+
- "/properties"
8+
cypher: |
9+
UNWIND $batch AS row
10+
MERGE (obj:{{ LABELS.ArmResource }} {id: toLower(row.id)})
11+
SET obj:{{ LABELS.OracleAutonomousDB }}
12+
13+
SET obj += {
14+
actualUsedDataStorageSizeInTbs: row.properties.actualUsedDataStorageSizeInTbs,
15+
allocatedStorageSizeInTbs: row.properties.allocatedStorageSizeInTbs,
16+
backupRententionPeriodInDays: row.properties.backupRetentionPeriodInDays,
17+
characterSet: row.properties.characterSet,
18+
databaseType: row.properties.dataBaseType, // Note: property name in ARM is "dataBaseType" with a capital B
19+
dbVersion: row.properties.dbVersion,
20+
displayName: row.properties.displayName,
21+
isLocalDataGuardEnabled: row.properties.isLocalDataGuardEnabled,
22+
isMtlsConnectionRequired: row.properties.isMtlsConnectionRequired,
23+
isRemoteDataGuardEnabled: row.properties.isRemoteDataGuardEnabled,
24+
localDisasterRecoveryType: row.properties.localDisasterRecoveryType,
25+
ociUrl: row.properties.ociUrl,
26+
ocid: row.properties.ocid,
27+
openMode: row.properties.openMode,
28+
permissionLevel: row.properties.permissionLevel,
29+
privateEndpoint: row.properties.privateEndpoint,
30+
privateEndpointIp: row.properties.privateEndpointIp,
31+
privateEndpointLabel: row.properties.privateEndpointLabel,
32+
timeCreated: row.properties.timeCreated,
33+
timeLocalDataGuardEnabled: row.properties.timeLocalDataGuardEnabled,
34+
35+
highConnectionString: row.properties.connectionStrings.high,
36+
mediumConnectionString: row.properties.connectionStrings.medium,
37+
lowConnectionString: row.properties.connectionStrings.low
38+
}
39+
40+
// Connection URLs. Not sure of all values so adding them dynamically
41+
FOREACH (k IN coalesce(keys(row.properties.connectionUrls), []) |
42+
SET obj[k] = row.properties.connectionUrls[k]
43+
)
44+
45+
MERGE (sub: {{ LABELS.ArmResource }} {id: toLower(row.properties.subnetId)})
46+
MERGE (sub)-[:{{ REL.HAS_ORACLE_RESOURCE }}]->(obj)
47+
RETURN count(*) AS _

src/graph/config/constants.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ REL:
3434
HAS_NIC: "HAS_NIC"
3535
HAS_NSG: "HAS_NSG"
3636
HAS_OAUTH_GRANT: "HAS_OAUTH_GRANT"
37+
HAS_ORACLE_RESOURCE: "HAS_ORACLE_RESOURCE"
3738
HAS_PARAMETER: "HAS_PARAMETER"
3839
HAS_PEERING: "HAS_PEERING"
3940
HAS_POLICY: "HAS_POLICY"
@@ -149,6 +150,7 @@ LABELS:
149150
NetworkInterface: "NetworkInterface"
150151
NetworkSecurityGroup: "NetworkSecurityGroup"
151152
NetworkWatcher: "NetworkWatcher"
153+
OracleAutonomousDB: "OracleAutonomousDB"
152154
PanCloudNgfwFirewall: "PanCloudNgfwFirewall"
153155
PanCloudNgfwLocalRulestack: "PanCloudNgfwLocalRulestack"
154156
PrivateDnsZone: "PrivateDnsZone"

zensical.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ nav = [
226226
{ "Machine Learning" = [
227227
"analysis/arm-nodes/machinelearning/ml-workspace.md",
228228
] },
229+
{ "Oracle" = [
230+
"analysis/arm-nodes/oracle/oracle-autonomous-db.md",
231+
] },
229232
{ "Palo Alto" = [
230233
"analysis/arm-nodes/paloalto/pan-cloudngfw-firewall.md",
231234
"analysis/arm-nodes/paloalto/pan-cloudngfw-localrulestack.md",
@@ -321,6 +324,7 @@ nav = [
321324
"analysis/edges/has-nic.md",
322325
"analysis/edges/has-nsg.md",
323326
"analysis/edges/has-oauth-grant.md",
327+
"analysis/edges/has-oracle-resource.md",
324328
"analysis/edges/has-parameter.md",
325329
"analysis/edges/has-peering.md",
326330
"analysis/edges/has-policy.md",

0 commit comments

Comments
 (0)