artifact_deployment_records
Creates, updates, deletes, gets or lists an artifact_deployment_records resource.
Overview
| Name | artifact_deployment_records |
| Type | Resource |
| Id | github.orgs.artifact_deployment_records |
Fields
The following fields are returned by SELECT queries:
- list_artifact_deployment_records
| Name | Datatype | Description |
|---|---|---|
deployment_records | array | |
total_count | integer | The number of deployment records for this digest and organization |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_artifact_deployment_records | select | org, subject_digest | List deployment records for an artifact metadata associated with an organization. | |
set_cluster_deployment_records | insert | org, cluster, logical_environment, deployments | Set deployment records for a given cluster. If proposed records in the 'deployments' field have identical 'cluster', 'logical_environment', 'physical_environment', and 'deployment_name' values as existing records, the existing records will be updated. If no existing records match, new records will be created. | |
create_artifact_deployment_record | insert | org, name, digest, status, logical_environment, deployment_name | Create or update deployment records for an artifact associated with an organization. This endpoint allows you to record information about a specific artifact, such as its name, digest, environments, cluster, and deployment. The deployment name has to be uniqe within a cluster (i.e a combination of logical, physical environment and cluster) as it identifies unique deployment. Multiple requests for the same combination of logical, physical environment, cluster and deployment name will only create one record, successive request will update the existing record. This allows for a stable tracking of a deployment where the actual deployed artifact can change over time. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
cluster | string | The cluster name. |
org | string | The organization name. The name is not case sensitive. |
subject_digest | string | The SHA256 digest of the artifact, in the form sha256:HEX_DIGEST. |
SELECT examples
- list_artifact_deployment_records
List deployment records for an artifact metadata associated with an organization.
SELECT
deployment_records,
total_count
FROM github.orgs.artifact_deployment_records
WHERE org = '{{ org }}' -- required
AND subject_digest = '{{ subject_digest }}' -- required
;
INSERT examples
- set_cluster_deployment_records
- create_artifact_deployment_record
- Manifest
Set deployment records for a given cluster.
If proposed records in the 'deployments' field have identical 'cluster', 'logical_environment',
'physical_environment', and 'deployment_name' values as existing records, the existing records will be updated.
If no existing records match, new records will be created.
INSERT INTO github.orgs.artifact_deployment_records (
logical_environment,
physical_environment,
deployments,
return_records,
org,
cluster
)
SELECT
'{{ logical_environment }}' /* required */,
'{{ physical_environment }}',
'{{ deployments }}' /* required */,
{{ return_records }},
'{{ org }}',
'{{ cluster }}'
RETURNING
deployment_records,
total_count
;
Create or update deployment records for an artifact associated
with an organization.
This endpoint allows you to record information about a specific
artifact, such as its name, digest, environments, cluster, and
deployment.
The deployment name has to be uniqe within a cluster (i.e a
combination of logical, physical environment and cluster) as it
identifies unique deployment.
Multiple requests for the same combination of logical, physical
environment, cluster and deployment name will only create one
record, successive request will update the existing record.
This allows for a stable tracking of a deployment where the actual
deployed artifact can change over time.
INSERT INTO github.orgs.artifact_deployment_records (
name,
digest,
version,
status,
logical_environment,
physical_environment,
cluster,
deployment_name,
tags,
runtime_risks,
github_repository,
return_records,
org
)
SELECT
'{{ name }}' /* required */,
'{{ digest }}' /* required */,
'{{ version }}',
'{{ status }}' /* required */,
'{{ logical_environment }}' /* required */,
'{{ physical_environment }}',
'{{ cluster }}',
'{{ deployment_name }}' /* required */,
'{{ tags }}',
'{{ runtime_risks }}',
'{{ github_repository }}',
{{ return_records }},
'{{ org }}'
RETURNING
deployment_records,
total_count
;
# Description fields are for documentation purposes
- name: artifact_deployment_records
props:
- name: org
value: "{{ org }}"
description: Required parameter for the artifact_deployment_records resource.
- name: cluster
value: "{{ cluster }}"
description: Required parameter for the artifact_deployment_records resource.
- name: logical_environment
value: "{{ logical_environment }}"
description: |
The stage of the deployment.
- name: physical_environment
value: "{{ physical_environment }}"
description: |
The physical region of the deployment.
- name: deployments
description: |
The list of deployments to record.
value:
- name: "{{ name }}"
digest: "{{ digest }}"
version: "{{ version }}"
status: "{{ status }}"
deployment_name: "{{ deployment_name }}"
github_repository: "{{ github_repository }}"
tags: "{{ tags }}"
runtime_risks: "{{ runtime_risks }}"
- name: return_records
value: {{ return_records }}
description: |
If true, the endpoint will return the created or updated record in the response body.
default: true
- name: name
value: "{{ name }}"
description: |
The name of the artifact.
- name: digest
value: "{{ digest }}"
description: |
The hex encoded digest of the artifact.
- name: version
value: "{{ version }}"
description: |
The artifact version.
- name: status
value: "{{ status }}"
description: |
The status of the artifact. Can be either deployed or decommissioned.
valid_values: ['deployed', 'decommissioned']
- name: cluster
value: "{{ cluster }}"
description: |
The deployment cluster.
- name: deployment_name
value: "{{ deployment_name }}"
description: |
The unique identifier for the deployment represented by the new record. To accommodate differing
containers and namespaces within a cluster, the following format is recommended:
{namespaceName}-{deploymentName}-{containerName}.
- name: tags
value: "{{ tags }}"
description: |
The tags associated with the deployment.
- name: runtime_risks
value:
- "{{ runtime_risks }}"
description: |
A list of runtime risks associated with the deployment.
- name: github_repository
value: "{{ github_repository }}"
description: |
The name of the GitHub repository associated with the artifact. This should be used
when there are no provenance attestations available for the artifact. The repository
must belong to the organization specified in the path parameter.
If a provenance attestation is available for the artifact, the API will use
the repository information from the attestation instead of this parameter.