ocm-accessmethods
On this page
Description
Access methods are used to handle the access to the content of artifacts described in a component version. Therefore, an artifact entry contains an access specification describing the access attributes for the dedicated artifact.
The following list describes the supported access methods, their versions
and specification formats.
Typically there is special support for the CLI artifact add commands.
The access method specification can be put below the access
field.
If always requires the field type
describing the kind and version
shown below.
Access type
gitHub
This method implements the access of the content of a git commit stored in a GitHub repository.
The following versions are supported:
Version
v1
The type specific specification fields are:
repoUrl
stringRepository URL with or without scheme.
ref
(optional) stringOriginal ref used to get the commit from
commit
stringThe sha/id of the git commit
Options used to configure fields:
–accessHostname
,–accessRepository
,–commit
Access type
helm
This method implements the access of a Helm chart stored in a Helm repository.
The following versions are supported:
Version
v1
The type specific specification fields are:
helmRepository
stringHelm repository URL.
helmChart
stringThe name of the Helm chart and its version separated by a colon.
version
stringThe version of the Helm chart if not specified as part of the chart name.
caCert
stringAn optional TLS root certificate.
keyring
stringAn optional keyring used to verify the chart.
It uses the consumer identity type HelmChartRepository with the fields for a hostpath identity matcher (see ocm get credentials).
Options used to configure fields:
–accessRepository
,–accessVersion
,–package
Access type
localBlob
This method is used to store a resource blob along with the component descriptor on behalf of the hosting OCM repository.
Its implementation is specific to the implementation of OCM repository used to read the component descriptor. Every repository implementation may decide how and where local blobs are stored, but it MUST provide an implementation for this method.
Regardless of the chosen implementation the attribute specification is defined globally the same.
The following versions are supported:
Version
v1
The type specific specification fields are:
localReference
stringRepository type specific location information as string. The value may encode any deep structure, but typically just an access path is sufficient.
mediaType
stringThe media type of the blob used to store the resource. It may add format information like
+tar
or+gzip
.referenceName
(optional) stringThis optional attribute may contain identity information used by other repositories to restore some global access with an identity related to the original source.
For example, if an OCI artifact originally referenced using the access method
ociArtifact
is stored during some transport step as local artifact, the reference name can be set to its original repository name. An import step into an OCI based OCM repository may then decide to make this artifact available again as regular OCI artifact.globalAccess
(optional) access method specificationIf a resource blob is stored locally, the repository implementation may decide to provide an external access information (independent of the OCM model).
For example, an OCI artifact stored as local blob can be additionally stored as regular OCI artifact in an OCI registry.
This additional external access information can be added using a second external access method specification.
Options used to configure fields:
–globalAccess
,–hint
,–mediaType
,–reference
Access type
maven
This method implements the access of a Maven artifact in a Maven repository.
The following versions are supported:
Version
v1
The type specific specification fields are:
repoUrl
stringURL of the Maven repository
groupId
stringThe groupId of the Maven artifact
artifactId
stringThe artifactId of the Maven artifact
version
stringThe version name of the Maven artifact
classifier
stringThe optional classifier of the Maven artifact
extension
stringThe optional extension of the Maven artifact
Options used to configure fields:
–accessRepository
,–accessVersion
,–artifactId
,–classifier
,–extension
,–groupId
Access type
none
dummy resource with no access
Access type
npm
This method implements the access of an NPM package in an NPM registry.
The following versions are supported:
Version
v1
The type specific specification fields are:
registry
stringBase URL of the NPM registry.
package
stringThe name of the NPM package
version
stringThe version name of the NPM package
Options used to configure fields:
–accessRepository
,–accessVersion
,–package
Access type
ociArtifact
This method implements the access of an OCI artifact stored in an OCI registry.
The following versions are supported:
Version
v1
The type specific specification fields are:
imageReference
stringOCI image/artifact reference following the possible docker schemes:
<repo>/<artifact>:<digest>@<tag>
[<port>]/<repo path>/<artifact>:<version>@<tag>
Options used to configure fields:
–reference
Access type
ociBlob
This method implements the access of an OCI blob stored in an OCI repository.
The following versions are supported:
Version
v1
The type specific specification fields are:
imageReference
stringOCI repository reference (this artifact name used to store the blob).
mediaType
stringThe media type of the blob
digest
stringThe digest of the blob used to access the blob in the OCI repository.
size
integerThe size of the blob
Options used to configure fields:
–digest
,–mediaType
,–reference
,–size
Access type
ocm
This method implements the access of any resource artifact stored in an OCM repository. Only repository types supporting remote access should be used.
The following versions are supported:
Version
v1
The type specific specification fields are:
ocmRepository
jsonThe repository spec for the OCM repository
component
string(Optional) The name of the component. The default is the own component.
version
string(Optional) The version of the component. The default is the own component version.
resourceRef
relative resource refThe resource reference of the denoted resource relative to the given component version.
It uses the consumer identity and credentials for the intermediate repositories and the final resource access.
Options used to configure fields:
–accessComponent
,–accessRepository
,–accessVersion
,–identityPath
Access type
s3
This method implements the access of a blob stored in an S3 bucket.
The following versions are supported:
Version
v1
The type specific specification fields are:
region
(optional) stringOCI repository reference (this artifact name used to store the blob).
bucket
stringThe name of the S3 bucket containing the blob
key
stringThe key of the desired blob
version
(optional) stringThe key of the desired blob
mediaType
(optional) stringThe media type of the content
Version
v2
The type specific specification fields are:
region
(optional) stringOCI repository reference (this artifact name used to store the blob).
bucketName
stringThe name of the S3 bucket containing the blob
objectKey
stringThe key of the desired blob
version
(optional) stringThe key of the desired blob
mediaType
(optional) stringThe media type of the content
Options used to configure fields:
–accessVersion
,–bucket
,–mediaType
,–reference
,–region
Access type
wget
This method implements access to resources stored on an http server.
The following versions are supported:
Version
v1
The
url
is the url pointing to the http endpoint from which a resource is downloaded. ThemimeType
can be used to specify the MIME type of the resource.This blob type specification supports the following fields:
url
string
This REQUIRED property describes the url from which the resource is to be downloaded.
mediaType
string
This OPTIONAL property describes the media type of the resource to be downloaded. If omitted, ocm tries to read the mediaType from the Content-Type header of the http response. If the mediaType cannot be set from the Content-Type header as well, ocm tries to deduct the mediaType from the URL. If that is not possible either, the default media type is defaulted to application/octet-stream.
header
map[string][]string
This OPTIONAL property describes the http headers to be set in the http request to the server.
verb
string
This OPTIONAL property describes the http verb (also known as http request method) for the http request. If omitted, the http verb is defaulted to GET.
body
[]byte
This OPTIONAL property describes the http body to be included in the request.
noredirect
bool
This OPTIONAL property describes whether http redirects should be disabled. If omitted, it is defaulted to false (so, per default, redirects are enabled).
Options used to configure fields:
–body
,–header
,–mediaType
,–noredirect
,–url
,–verb