Back to Playbooks

showoci - Oracle Cloud Infrastructure Reporting Tool

SHOWOCI is a reporting tool which uses the Python SDK to extract list of resources from your tenant. It covers most of OCI components, Authentication by User or Compute using instance principals, Output can be printer friendly, CSV files or JSON file with an option to load the CSV files to Autonomous DB.

15 min read
ocicloudinventory
Share on X

Complete OCI Tenant Inventory Reporting

Extract and analyze your Oracle Cloud Infrastructure resources with comprehensive Python-based reporting.

⚠️ Important Disclaimer

This is not an official Oracle application and is not supported by Oracle Support. It should NOT be used for utilization calculation purposes. Instead, use OCI's official cost analysis and usage reports features.

Developed by Adi Zohar, 2018-2025. Contributors: Olaf Heimburger

What is SHOWOCI?

SHOWOCI is a Python-based reporting tool that uses the OCI SDK to extract comprehensive lists of resources from your Oracle Cloud Infrastructure tenant.

Comprehensive Coverage

Covers 50+ OCI service modules from compute to databases

Multiple Outputs

Printer-friendly, CSV, JSON, or Autonomous DB

Flexible Auth

User authentication or instance principals

Requirements

  • Cloud Shell, Virtual Machine, or local PC
  • Internet connectivity to access OCI REST APIs
  • Python 3.9+
  • OCI SDK Python packages

Quick Start with Cloud Shell

Cloud Shell has a 20-minute timeout. For large extracts, use a dedicated Virtual Machine.

Step 1: Clone and Link

Clone from OCI Python SDK Repobash
git clone https://github.com/oracle/oci-python-sdk
ln -s oci-python-sdk/examples/showoci .

Or install using bash:

One-line installationbash
bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-python-sdk/master/examples/showoci/showoci_upgrade.sh)"

Step 2: Change Directory

cd showoci

Common Usage Examples

All Resources (Except Identity)

python3 showoci.py -dt -ani

Compute Resources with CSV Output

python3 showoci.py -dt -c -csv $HOME/output

Compute & Database with CSV

python3 showoci.py -dt -c -d -csv $HOME/output

Filter by Compartment and Region

python3 showoci.py -ip -c -cp AdiZohar -rg us-ashburn-1

PaaS Services with JSON Output

python3 showoci.py -paas -js

Setup Policies

For Instance Principals

Create Dynamic Group ShowOCIDynamicGroup:

Dynamic Group Ruletext
any {ALL {instance.id = 'ocid1.instance.oc1.xxxxxxxxxx'}}

Add Policy:

Policy Statementtext
allow dynamic-group ShowOCIDynamicGroup to read all-resources in tenancy

For User Authentication

Required: OCI IAM user with read-only privileges (Inspect can be used with reduced info)

User Policytext
ALLOW GROUP ReadOnlyUsers to read all-resources IN TENANCY

Use oci setup config to configure the user on VM

Covered OCI Services (50+ Modules)

Compute & Networking
  • • Virtual Networks
  • • Compute Instances
  • • Load Balancers
  • • Network Firewalls
Storage
  • • Block Storage
  • • File Storage
  • • Object Storage
Databases
  • • Database Services
  • • Autonomous DB
  • • NoSQL
  • • PostgreSQL
Containers & Functions
  • • Container Engine
  • • Functions
  • • API Gateways
Analytics & AI
  • • Analytics
  • • Data Science
  • • Data Flow
  • • Data Catalog
Security & Management
  • • Cloud Guard
  • • Key Management
  • • Bastion
  • • Data Safe
Integration
  • • Integration Cloud
  • • Golden Gate
  • • Events
  • • Streaming
Monitoring
  • • Monitoring
  • • Logging
  • • Health Checks
  • • Notifications
Other Services
  • • DNS
  • • Email
  • • Budgets
  • • Limits

Key Execution Flags

FlagDescription
-dtUse delegation token (Cloud Shell)
-ipUse instance principals authentication
-cExtract Compute resources
-dExtract Database resources
-paasExtract all PaaS services
-csvGenerate CSV output files
-jsGenerate JSON output
-rgFilter by region
-cpFilter by compartment
-aniExclude identity services

Installation on OCI VM

  1. Deploy VM Compute instance (Oracle Linux 8 recommended)
  2. Create Dynamic Group with instance OCID
  3. Create policy allowing read access
  4. SSH to instance and install OCI CLI
  5. Install Python 3.9+ and OCI SDK
  6. Clone showoci repository
  7. Run the tool with desired flags

Upgrading SHOWOCI

Upgrade from GitHubbash
cd $HOME/showoci
git pull
pip3 install --upgrade oci oci-cli

💡 Pro Tips

  • Use -dt flag for Cloud Shell sessions
  • For large tenants, run on a dedicated VM to avoid timeouts
  • Combine multiple flags to extract specific resource types
  • Use CSV output for easy import into spreadsheets or databases
  • Schedule periodic runs with cron for ongoing inventory tracking

Use Cases

📊

Inventory Management

Track all OCI resources across compartments and regions

🔍

Resource Auditing

Generate compliance reports for security reviews

💰

Cost Analysis

Identify resource usage patterns and optimization opportunities

📈

Capacity Planning

Understand resource distribution for future planning

📚 Official Resources