Getting there
This commit is contained in:
12
list_oracle_databases.py
Normal file → Executable file
12
list_oracle_databases.py
Normal file → Executable file
@@ -20,6 +20,7 @@ def list_oracle_databases():
|
||||
nodes {
|
||||
dbUniqueName
|
||||
id
|
||||
isRelic
|
||||
cluster {
|
||||
id
|
||||
name
|
||||
@@ -34,13 +35,9 @@ def list_oracle_databases():
|
||||
}
|
||||
"""
|
||||
|
||||
# Variables: exclude relics and replicated databases
|
||||
# Variables: exclude replicated databases only
|
||||
variables = {
|
||||
"filter": [
|
||||
{
|
||||
"texts": ["false"],
|
||||
"field": "IS_RELIC"
|
||||
},
|
||||
{
|
||||
"texts": ["false"],
|
||||
"field": "IS_REPLICATED"
|
||||
@@ -71,11 +68,12 @@ def list_oracle_databases():
|
||||
db['dbUniqueName'],
|
||||
db['id'],
|
||||
cluster_name,
|
||||
host_name
|
||||
host_name,
|
||||
'Yes' if db['isRelic'] else 'No'
|
||||
])
|
||||
|
||||
# Print tabulated output
|
||||
headers = ['Database Name', 'ID', 'Cluster', 'Host']
|
||||
headers = ['Database Name', 'ID', 'Cluster', 'Host', 'Relic']
|
||||
print(tabulate(table_data, headers=headers, tablefmt='grid'))
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user