# `sc_crawler.vendors._oci`

> Inventory of Oracle Cloud Infrastructure via its API and the public price list: servers, storages, traffic, IPv4 addresses and managed PostgreSQL…

# `sc_crawler.vendors._oci`

Inventory of Oracle Cloud Infrastructure via its API and the public price list: servers, storages, traffic, IPv4 addresses and managed PostgreSQL, with their prices.

**Functions:**

- [**inventory_compliance_frameworks**](#inventory_compliance_frameworks) – Manual list of known compliance frameworks at Oracle Cloud Infrastructure.
- [**inventory_regions**](#inventory_regions) – List all regions of the commercial realm.
- [**inventory_zones**](#inventory_zones) – List the availability domains of the subscribed regions as zones.
- [**inventory_servers**](#inventory_servers) – List all shapes of the active zones as servers.
- [**inventory_server_prices**](#inventory_server_prices) – List the on-demand price of the servers in all active zones.
- [**inventory_server_prices_spot**](#inventory_server_prices_spot) – List the preemptible price of the servers in all active zones.
- [**inventory_storages**](#inventory_storages) – List the performance levels of the Block Volume service as storages.
- [**inventory_storage_prices**](#inventory_storage_prices) – List the Block Volume prices in all regions.
- [**inventory_traffic_prices**](#inventory_traffic_prices) – List the inbound and outbound traffic prices in all regions.
- [**inventory_ipv4_prices**](#inventory_ipv4_prices) – Public IPv4 addresses are free of charge at OCI.
- [**inventory_databases**](#inventory_databases) – List the shapes of OCI Database with PostgreSQL as databases.
- [**inventory_database_prices**](#inventory_database_prices) – List the compute prices of the databases in all active regions.
- [**inventory_database_storages**](#inventory_database_storages) – List the performance tiers of the database optimized storage.
- [**inventory_database_storage_prices**](#inventory_database_storage_prices) – List the database storage prices in all active regions.

## func <code class="doc-name">inventory_compliance_frameworks</code> [_oci.py:1366–1381](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/vendors/_oci.py#L1366-L1381)

```python
inventory_compliance_frameworks(vendor)
```

Manual list of known compliance frameworks at Oracle Cloud Infrastructure.

Data sources:

- <https://www.oracle.com/corporate/cloud-compliance/>
- <https://blogs.oracle.com/cloud-infrastructure/fall-2022-compliance-attestations>

## func <code class="doc-name">inventory_regions</code> [_oci.py:1384–1437](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/vendors/_oci.py#L1384-L1437)

```python
inventory_regions(vendor)
```

List all regions of the commercial realm.

The API returns the identifier and key of the regions only, so the
location is looked up from a manual mapping based on
<https://docs.oracle.com/en-us/iaas/Content/General/Concepts/regions.htm>.

Availability domains and shapes can be listed only in the regions the
tenancy is subscribed to, so the other regions are stored as INACTIVE.

## func <code class="doc-name">inventory_zones</code> [_oci.py:1440–1472](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/vendors/_oci.py#L1440-L1472)

```python
inventory_zones(vendor)
```

List the availability domains of the subscribed regions as zones.

The availability domain names (e.g. `Uocm:EU-FRANKFURT-1-AD-1`) are specific
to the tenancy, so the zone id is built from the region and the number of
the availability domain, and the name is stored without the prefix of the
tenancy (see `_availability_domain` for looking up the full name).
Note that the numbers are also mapped to the datacenters per tenancy, so
e.g. AD-1 can be a different datacenter in another tenancy.

Fault domains are not listed as zones.

## func <code class="doc-name">inventory_servers</code> [_oci.py:1475–1504](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/vendors/_oci.py#L1475-L1504)

```python
inventory_servers(vendor)
```

List all shapes of the active zones as servers.

Shapes are listed per availability domain, as the offers differ. Fixed
shapes are stored as a server, while flexible shapes are expanded to a
grid of OCPU and memory configurations, each stored as a separate server
(see `_shape_configs`). Burstable configurations (a baseline of 12.5% or
50% of the OCPUs) are not listed.

Lifecycle: shapes listed in any of the active zones -> ACTIVE, except for
the Always Free micro shape (limited to two instances per tenancy) ->
INACTIVE. There is no lifecycle field or retirement date in the API. The
previous generation shapes are still fully supported and can be ordered
despite being past their "end of orderability" date as per
<https://docs.oracle.com/en-us/iaas/Content/Compute/References/computeshapes.htm#previous-generation-shapes>,
so those are PLANNED_FOR_RETIREMENT with that date, see
`_OCI_RETIREMENT_RULES`.

## func <code class="doc-name">inventory_server_prices</code> [_oci.py:1507–1523](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/vendors/_oci.py#L1507-L1523)

```python
inventory_server_prices(vendor)
```

List the on-demand price of the servers in all active zones.

The availability of the shapes is from the API (per availability domain),
while the prices are from the public price list, which is the same in all
commercial regions and has no reference to the shapes, so the related parts
are looked up from a manual mapping (see `_SHAPE_PRICE_PARTS`). Shapes
without known parts are logged and listed without prices.

Notes:

- The monthly free tier of the Arm-based A1 shapes (3,000 OCPU and 18,000 GB
  hours) is per tenancy, so it is not applied.
- Only Linux prices are listed (no license fee for Oracle Linux and the
  other free images).

## func <code class="doc-name">inventory_server_prices_spot</code> [_oci.py:1526–1534](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/vendors/_oci.py#L1526-L1534)

```python
inventory_server_prices_spot(vendor)
```

List the preemptible price of the servers in all active zones.

There is no spot market at OCI: preemptible capacity has a fixed 50%
discount on the on-demand price in all regions, and is available only for
the VM shapes listed in `_PREEMPTIBLE_SERIES`, as per
<https://docs.oracle.com/en-us/iaas/Content/Compute/Concepts/preemptible.htm>.

## func <code class="doc-name">inventory_storages</code> [_oci.py:1537–1565](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/vendors/_oci.py#L1537-L1565)

```python
inventory_storages(vendor)
```

List the performance levels of the Block Volume service as storages.

There is no API to list the performance levels, so these are from a
manual list (see `_BLOCK_VOLUMES`).

Data sources:

- <https://docs.oracle.com/en-us/iaas/Content/Block/Concepts/blockvolumeperformance.htm>
- <https://www.oracle.com/cloud/storage/block-volumes/faq/>

Sizes are in GB, and throughput values are in MB/s as per the documentation.

## func <code class="doc-name">inventory_storage_prices</code> [_oci.py:1568–1590](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/vendors/_oci.py#L1568-L1590)

```python
inventory_storage_prices(vendor)
```

List the Block Volume prices in all regions.

The monthly price of a GB is the storage price plus the price of the
Volume Performance Units (VPU) of the performance level, both from the
public price list, which is the same in all commercial regions.

## func <code class="doc-name">inventory_traffic_prices</code> [_oci.py:1616–1649](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/vendors/_oci.py#L1616-L1649)

```python
inventory_traffic_prices(vendor)
```

List the inbound and outbound traffic prices in all regions.

Inbound traffic is free. The first 10 TB of outbound traffic is free per
month and tenancy, then priced per GB depending on the location of the
region (see `_EGRESS_PARTS`), as per the public price list.

## func <code class="doc-name">inventory_ipv4_prices</code> [_oci.py:1652–1671](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/vendors/_oci.py#L1652-L1671)

```python
inventory_ipv4_prices(vendor)
```

Public IPv4 addresses are free of charge at OCI.

Neither ephemeral, nor reserved public IP addresses are charged: there is
no related part in the public price list, and "there is no charge to use
this feature" as per the announcement of the reserved public IPs at
<https://blogs.oracle.com/cloud-infrastructure/release-announcement-reserved-public-ips-are-now-available-on-oracle-cloud-infrastructure>.

## func <code class="doc-name">inventory_databases</code> [_oci.py:1891–2017](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/vendors/_oci.py#L1891-L2017)

```python
inventory_databases(vendor)
```

List the shapes of OCI Database with PostgreSQL as databases.

The shapes are listed per region (see `_database_configs` on the sizes), and
the supported PostgreSQL versions are from the active default
configurations of the service. The features are from the documentation.

A database system has a primary node and up to 7 read replica nodes on shared
storage. With multiple nodes, a read replica is promoted on the failure of
the primary node, with the nodes placed in different fault domains of an
availability domain, or in different availability domains (with the storage
replicated across the availability domains). Note that the latter is
available only in the regions with multiple availability domains, see
`inventory_database_prices`.

Lifecycle: shapes listed in any of the active regions -> ACTIVE. There is no
lifecycle field in the API.

Data sources:

- <https://docs.oracle.com/en-us/iaas/Content/postgresql/overview.htm>
- <https://docs.oracle.com/en-us/iaas/Content/postgresql/high-availability.htm>
- <https://docs.oracle.com/en-us/iaas/Content/postgresql/manage-databases.htm>
- <https://docs.oracle.com/en-us/iaas/releasenotes/services/postgresql/>

## func <code class="doc-name">inventory_database_prices</code> [_oci.py:2035–2090](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/vendors/_oci.py#L2035-L2090)

```python
inventory_database_prices(vendor)
```

List the compute prices of the databases in all active regions.

The hourly price of a node is the price of the compute shape (OCPUs and
memory, as for the servers) plus the PostgreSQL fee per OCPU, both from the
public price list, which is the same in all commercial regions. Storage is
billed separately, see `inventory_database_storage_prices`.

Price rows per region:

- no high availability: a single node,
- single-zone readable cluster: a primary and a read replica node in
  different fault domains of an availability domain,
- multi-zone readable cluster: a primary and a read replica node in
  different availability domains, only in the regions with multiple zones.

## func <code class="doc-name">inventory_database_storages</code> [_oci.py:2093–2129](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/vendors/_oci.py#L2093-L2129)

```python
inventory_database_storages(vendor)
```

List the performance tiers of the database optimized storage.

Storage is decoupled from the compute nodes, shared by the nodes of a
database system, and scales automatically up to 32 TB. There is no API to
list the performance tiers, so these are from a manual list (see
`_DATABASE_STORAGE_IOPS`).

Data sources:

- <https://docs.oracle.com/en-us/iaas/Content/postgresql/performance-tiers.htm>
- <https://docs.oracle.com/en-us/iaas/Content/postgresql/manage-databases.htm>

## func <code class="doc-name">inventory_database_storage_prices</code> [_oci.py:2132–2158](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/vendors/_oci.py#L2132-L2158)

```python
inventory_database_storage_prices(vendor)
```

List the database storage prices in all active regions.

The monthly price of a used GB is the Database Optimized Storage price plus
the price of the Volume Performance Units (VPU) of the performance tier (see
`_DATABASE_OCPU_PART`). Both from the public price list, which is the same
in all commercial regions.
