# `sc_crawler.vendors._gcp`

> Inventory of Google Cloud Platform via its APIs: servers, storages, traffic, IPv4 addresses and managed PostgreSQL (Cloud SQL), with their prices.

# `sc_crawler.vendors._gcp`

**Functions:**

- [**inventory_compliance_frameworks**](#inventory_compliance_frameworks) – Manual list of compliance frameworks known for GCP.
- [**inventory_regions**](#inventory_regions) – List all available GCP regions via API calls.
- [**inventory_zones**](#inventory_zones) – List all available GCP zones via API calls.
- [**inventory_servers**](#inventory_servers) – List all available GCP servers available in all zones.
- [**inventory_server_prices**](#inventory_server_prices) – List all available GCP server ondemand prices in all regions.
- [**inventory_server_prices_spot**](#inventory_server_prices_spot) – List all available GCP server spot prices in all regions.
- [**inventory_storages**](#inventory_storages) – List GCP disk types for the storage catalog.
- [**inventory_storage_prices**](#inventory_storage_prices) – List all available GCP disk storage prices in all regions.
- [**inventory_traffic_prices**](#inventory_traffic_prices) – List inbound and outbound network traffic prices in all GCP regions.
- [**inventory_ipv4_prices**](#inventory_ipv4_prices) – List the price of an attached IPv4 address in all GCP regions.
- [**inventory_databases**](#inventory_databases) – List all available GCP Cloud SQL for PostgreSQL database types via API calls.
- [**inventory_database_prices**](#inventory_database_prices) – List all available GCP Cloud SQL for PostgreSQL on-demand prices in all regions.
- [**inventory_database_storages**](#inventory_database_storages) – List all available GCP Cloud SQL for PostgreSQL storage options.
- [**inventory_database_storage_prices**](#inventory_database_storage_prices) – List all available GCP Cloud SQL for PostgreSQL storage prices in all regions.

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

```python
inventory_compliance_frameworks(vendor)
```

Manual list of compliance frameworks known for GCP.

Resources: <https://cloud.google.com/compliance?hl=en>

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

```python
inventory_regions(vendor)
```

List all available GCP regions via API calls.

Some data sources are not available from APIs, and were collected manually:

- location: <https://cloud.google.com/compute/docs/regions-zones#available> and <https://en.wikipedia.org/wiki/Google_data_centers>,
- lon/lat coordinates: <https://en.wikipedia.org/wiki/Google_data_centers#Locations> and approximation based on the city when no more accurate data was available.
- energy carbon data: <https://cloud.google.com/sustainability/region-carbon#data> and <https://github.com/GoogleCloudPlatform/region-carbon-info>,
- launch dates were collected from [Wikipedia](https://en.wikipedia.org/wiki/Google_Cloud_Platform#Regions_and_zones) and GCP blog posts, such as <https://medium.com/@retomeier/an-annotated-history-of-googles-cloud-platform-90b90f948920> and <https://cloud.google.com/blog/products/infrastructure/introducing-new-google-cloud-regions>.

Note that many GCP regions use more than 90% green energy,
but the related flag in our database is set to `False` as not being 100%.

## func <code class="doc-name">inventory_zones</code> [_gcp.py:2083–2100](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/vendors/_gcp.py#L2083-L2100)

```python
inventory_zones(vendor)
```

List all available GCP zones via API calls.

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

```python
inventory_servers(vendor)
```

List all available GCP servers available in all zones.

Lifecycle (`machineTypes.deprecated.state`): DEPRECATED -> PLANNED_FOR_RETIREMENT,
OBSOLETE / DELETED -> RETIRED, empty / ACTIVE -> ACTIVE.
See `_gcp_machine_type_status`.

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

```python
inventory_server_prices(vendor)
```

List all available GCP server ondemand prices in all regions.

Prices cover the predefined vCPU, memory, attached GPUs, and bundled Local
SSD (from `machineTypes.bundledLocalSsds`).

## func <code class="doc-name">inventory_server_prices_spot</code> [_gcp.py:2141–2146](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/vendors/_gcp.py#L2141-L2146)

```python
inventory_server_prices_spot(vendor)
```

List all available GCP server spot prices in all regions.

Same components as `inventory_server_prices` (including bundled Local SSD).

## func <code class="doc-name">inventory_storages</code> [_gcp.py:2149–2200](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/vendors/_gcp.py#L2149-L2200)

```python
inventory_storages(vendor)
```

List GCP disk types for the storage catalog.

Allowlisted zonal types (PD + Hyperdisk) share the same name/specs in every
zone, so one zone is enough. Hyperdisk Balanced HA is regional-only
(`regionDiskTypes`) and is not a zonal type.
See <https://cloud.google.com/compute/docs/disks#disk-types>
and <https://cloud.google.com/compute/docs/disks/hyperdisks>.

## func <code class="doc-name">inventory_storage_prices</code> [_gcp.py:2203–2238](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/vendors/_gcp.py#L2203-L2238)

```python
inventory_storage_prices(vendor)
```

List all available GCP disk storage prices in all regions.

## func <code class="doc-name">inventory_traffic_prices</code> [_gcp.py:2241–2295](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/vendors/_gcp.py#L2241-L2295)

```python
inventory_traffic_prices(vendor)
```

List inbound and outbound network traffic prices in all GCP regions.

## func <code class="doc-name">inventory_ipv4_prices</code> [_gcp.py:2298–2321](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/vendors/_gcp.py#L2298-L2321)

```python
inventory_ipv4_prices(vendor)
```

List the price of an attached IPv4 address in all GCP regions.

Note that this data was not found using the APIs (only unattached static IPs),
so the values are recorded manually from <https://cloud.google.com/vpc/network-pricing#ipaddress>.

## func <code class="doc-name">inventory_databases</code> [_gcp.py:2760–2967](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/vendors/_gcp.py#L2760-L2967)

```python
inventory_databases(vendor)
```

List all available GCP Cloud SQL for PostgreSQL database types via API calls.

## func <code class="doc-name">inventory_database_prices</code> [_gcp.py:2970–3072](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/vendors/_gcp.py#L2970-L3072)

```python
inventory_database_prices(vendor)
```

List all available GCP Cloud SQL for PostgreSQL on-demand prices in all regions.

## func <code class="doc-name">inventory_database_storages</code> [_gcp.py:3075–3106](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/vendors/_gcp.py#L3075-L3106)

```python
inventory_database_storages(vendor)
```

List all available GCP Cloud SQL for PostgreSQL storage options.

## func <code class="doc-name">inventory_database_storage_prices</code> [_gcp.py:3109–3166](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/vendors/_gcp.py#L3109-L3166)

```python
inventory_database_storage_prices(vendor)
```

List all available GCP Cloud SQL for PostgreSQL storage prices in all regions.
