oraclecloud-cost-tuning

Featured

Track OCI spend with the Usage API and set up budget alerts. Use when monitoring Oracle Cloud costs, creating budgets, analyzing spend by compartment or service, or optimizing Universal Credits consumption. Trigger with "oraclecloud cost", "oci budget", "oci usage api", "oci spending", "oracle cloud cost tuning".

AI & Automation 2,940 stars 439 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Oracle Cloud Cost Tuning ## Overview Track OCI spending programmatically using the Usage API and set up budget alerts before Universal Credits run out unexpectedly. OCI pricing varies by shape, region, and commitment level, and the Cost Analysis tool in the Console is buried and confusing. This skill uses the Usage API to query spend by compartment, service, and shape, creates budgets with alert rules, and covers optimization strategies including Always Free tier resources, preemptible instances, and reserved capacity. **Purpose:** Get visibility into OCI spending through code, set proactive budget alerts, and identify cost optimization opportunities. ## Prerequisites - **OCI tenancy** with an API signing key in `~/.oci/config` - **Python 3.8+** with `pip install oci` - **Tenancy OCID** (root compartment) for tenancy-wide cost queries - **IAM policy** granting `read usage-reports` in the tenancy - **Notification topic OCID** for budget alert delivery (see `oraclecloud-observability`) ## Instructions ### Step 1: Query Usage with the Usage API The Usage API returns cost and usage data broken down by configurable dimensions: ```python import oci from datetime import datetime, timedelta config = oci.config.from_file("~/.oci/config") usage_api = oci.usage_api.UsageapiClient(config) # Query last 30 days of spend by service response = usage_api.request_summarized_usages( oci.usage_api.models.RequestSummarizedUsagesDetails( tenant_id=config["tenancy"], ...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category