Table: oci_artifacts_generic_artifact - Query OCI Artifacts Generic Artifacts using SQL
Oracle Cloud Infrastructure Artifacts service provides a highly scalable and distributed artifact repository. It is designed to store and share container images and other software development artifacts, such as JAR files, Python packages, and so on. This service is integrated with Oracle Cloud Infrastructure Registry, which is a Docker v2 compliant registry and supports Docker CLI and Docker Engine for pushing and pulling images.
Table Usage Guide
The oci_artifacts_generic_artifact
table provides insights into generic artifacts within Oracle Cloud Infrastructure Artifacts service. As a software developer or DevOps engineer, explore artifact-specific details through this table, including version, size, and associated metadata. Utilize it to uncover information about artifacts, such as those with specific versions, the state of artifacts, and the verification of artifact metadata.
Examples
Basic info
Analyze the settings to understand the state and size of your artifacts in Oracle Cloud Infrastructure. This allows for better management and organization of your resources.
select id, name, repository_id, artifact_path, version, sha256, size_in_bytes, lifecycle_state as statefrom oci_artifacts_generic_artifact;
select id, name, repository_id, artifact_path, version, sha256, size_in_bytes, lifecycle_state as statefrom oci_artifacts_generic_artifact;
List available generic artifacts
Explore which generic artifacts are currently available. This can be beneficial in managing resources or tracking the lifecycle of various artifacts within your OCI environment.
select name, id, repository_id, artifact_path, version, size_in_bytes, lifecycle_statefrom oci_artifacts_generic_artifactwhere lifecycle_state = 'AVAILABLE';
select name, id, repository_id, artifact_path, version, size_in_bytes, lifecycle_statefrom oci_artifacts_generic_artifactwhere lifecycle_state = 'AVAILABLE';
Count numbers of artifact versions by artifact path
Analyze the settings to understand the distribution of versions across different artifact paths. This can help you identify areas where versions are proliferating, potentially indicating a need for version management or cleanup.
select artifact_path, count(version) as numbers_of_versionsfrom oci_artifacts_generic_artifactgroup by artifact_path;
select artifact_path, count(version) as numbers_of_versionsfrom oci_artifacts_generic_artifactgroup by artifact_path;
List generic artifacts created in the last 30 days
Discover the recently created generic artifacts within the past month. This is useful for tracking recent activities and changes in your environment.
select name, id, sha256, lifecycle_state, artifact_path, time_createdfrom oci_artifacts_generic_artifactwhere time_created >= now() - interval '30' day;
select name, id, sha256, lifecycle_state, artifact_path, time_createdfrom oci_artifacts_generic_artifactwhere time_created >= datetime('now', '-30 day');
Get the largest artifact
Discover the largest artifact within your OCI environment, which can help you manage storage and identify potential data bottlenecks. This is particularly useful for optimizing storage allocation and improving overall system performance.
select name, id, artifact_path, version, size_in_bytesfrom oci_artifacts_generic_artifactorder by size_in_bytes desclimit 1;
select name, id, artifact_path, version, size_in_bytesfrom oci_artifacts_generic_artifactorder by size_in_bytes desclimit 1;
Get repository details for an artifact
Gain insights into the characteristics of a specific artifact by analyzing its associated repository details. This can be particularly useful when you need to understand the repository's immutability and lifecycle state for better artifact management.
select a.id, a.name as artifact_name, r.display_name as repository_display_name, r.is_immutable as is_repository_immutable, r.lifecycle_state as repository_lifecycle_statefrom oci_artifacts_generic_artifact as a, oci_artifacts_repository as rwhere a.repository_id = r.id and a.id = 'ocid1.genericartifact.oc1.ap-mumbai-1.0.amaaaaaa6igdexaaxzyuikdquye6wozpb4rxgkijxe77pfu64zigyqp7o5ua';
select a.id, a.name as artifact_name, r.display_name as repository_display_name, r.is_immutable as is_repository_immutable, r.lifecycle_state as repository_lifecycle_statefrom oci_artifacts_generic_artifact as a, oci_artifacts_repository as rwhere a.repository_id = r.id and a.id = 'ocid1.genericartifact.oc1.ap-mumbai-1.0.amaaaaaa6igdexaaxzyuikdquye6wozpb4rxgkijxe77pfu64zigyqp7o5ua';
Schema for oci_artifacts_generic_artifact
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
artifact_path | text | = | A user-defined path to describe the location of an artifact. Slashes do not create a directory structure, but you can use slashes to organize the repository. An artifact path does not include an artifact version. |
compartment_id | text | = | The OCID of the compartment in Tenant in which the resource is located. |
defined_tags | jsonb | Defined tags for this resource. Each key is predefined and scoped to a | |
freeform_tags | jsonb | Free-form tags for this resource. Each tag is a simple key-value pair with no | |
id | text | = | The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the artifact. |
lifecycle_state | text | = | The current state of the artifact. |
name | text | = | The artifact name with the format of `<artifact-path>:<artifact-version>`. The artifact name is truncated to a maximum length of 255. |
repository_id | text | = | The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the repository. |
sha256 | text | = | The SHA256 digest for the artifact. When you upload an artifact to the repository, a SHA256 digest is calculated and added to the artifact properties. |
size_in_bytes | bigint | The size of the artifact in bytes. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
tags | jsonb | A map of tags for the resource. | |
tenant_id | text | =, !=, ~~, ~~*, !~~, !~~* | The OCID of the Tenant in which the resource is located. |
time_created | timestamp with time zone | Time that Generic Artifact was created. | |
title | text | Title of the resource. | |
version | text | = | A user-defined string to describe the artifact version. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- oci
You can pass the configuration to the command with the --config
argument:
steampipe_export_oci --config '<your_config>' oci_artifacts_generic_artifact