ocm-accessmethods

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 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) string

        OCI repository reference (this artifact name used to store the blob).

      • bucket string

        The name of the S3 bucket containing the blob

      • key string

        The key of the desired blob

      • version (optional) string

        The key of the desired blob

      • mediaType (optional) string

        The media type of the content

    • Version v2

      The type specific specification fields are:

      • region (optional) string

        OCI repository reference (this artifact name used to store the blob).

      • bucketName string

        The name of the S3 bucket containing the blob

      • objectKey string

        The key of the desired blob

      • version (optional) string

        The key of the desired blob

      • mediaType (optional) string

        The media type of the content

  • 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 string

        Repository URL with or without scheme.

      • ref (optional) string

        Original ref used to get the commit from

      • commit string

        The 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 string

        Helm repository URL.

      • helmChart string

        The name of the Helm chart and its version separated by a colon.

      • version string

        The version of the Helm chart if not specified as part of the chart name.

      • caCert string

        An optional TLS root certificate.

      • keyring string

        An 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: –accessPackage, –accessRepository, –accessVersion

  • 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 string

        Repository type specific location information as string. The value may encode any deep structure, but typically just an access path is sufficient.

      • mediaType string

        The media type of the blob used to store the resource. It may add format information like +tar or +gzip.

      • referenceName (optional) string

        This 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 specification

        If 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 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 string

        Base URL of the NPM registry.

      • package string

        The name of the NPM package

      • version string

        The version name of the NPM package

    Options used to configure fields: –accessPackage, –accessRegistry, –accessVersion

  • 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 string

        OCI 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 string

        OCI repository reference (this artifact name used to store the blob).

      • mediaType string

        The media type of the blob

      • digest string

        The digest of the blob used to access the blob in the OCI repository.

      • size integer

        The size of the blob

    Options used to configure fields: –digest, –mediaType, –reference, –size

  • 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) string

        OCI repository reference (this artifact name used to store the blob).

      • bucket string

        The name of the S3 bucket containing the blob

      • key string

        The key of the desired blob

      • version (optional) string

        The key of the desired blob

      • mediaType (optional) string

        The media type of the content

    • Version v2

      The type specific specification fields are:

      • region (optional) string

        OCI repository reference (this artifact name used to store the blob).

      • bucketName string

        The name of the S3 bucket containing the blob

      • objectKey string

        The key of the desired blob

      • version (optional) string

        The key of the desired blob

      • mediaType (optional) string

        The 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. The mimeType 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

See Also