Versions

Create artifact version

Changed on

Creates a new version of the artifact by uploading new content. The configured rules for the artifact are applied, and if they all pass, the new content is added as the most recent version of the artifact. If any of the rules fail, an error is returned.

The body of the request can be the raw content of the new artifact version, or the raw content and a set of references pointing to other artifacts, and the type of that content should match the artifact's type (for example if the artifact type is AVRO then the content of the request should be an Apache Avro document).

This operation can fail for the following reasons:

  • Provided content (request body) was empty (HTTP error 400)
  • No artifact with this artifactId exists (HTTP error 404)
  • The new content violates one of the rules configured for the artifact (HTTP error 409)
  • A server error occurred (HTTP error 500)
post/groups/{groupId}/artifacts/{artifactId}/versions

Request

  • The document declares no server URL.
  • Auth
    none declared

Headers

X-Registry-Versionstring

A single version of an artifact. Can be provided by the client when creating a new version, or it can be server-generated. The value can be any string unique to the artifact, but it is recommended to use a simple integer or a semver value.

Example:"3.1.6"

Specifies the version number of this new version of the artifact content. This would typically be a simple integer or a SemVer value. It must be unique within the artifact. If this is not provided, the server will generate a new, unique version number for this new updated content.

X-Registry-Namestring

Name of the artifact.

Example:"Artifact name"

Specifies the artifact name of this new version of the artifact content. Name must be ASCII-only string. If this is not provided, the server will extract the name from the artifact content.

X-Registry-Descriptionstring

Description of the artifact.

Example:"Artifact description"

Specifies the artifact description of this new version of the artifact content. Description must be ASCII-only string. If this is not provided, the server will extract the description from the artifact content.

X-Registry-Description-Encodedstring

Base64 encoded description of the artifact.

Example:"QXJ0aWZhY3QgZGVzY3JpcHRpb24K"

Specifies the artifact description of this new version of the artifact content. Value of this must be Base64 encoded string. If this is not provided, the server will extract the description from the artifact content.

X-Registry-Name-Encodedstring

Base64 encoded name of the artifact.

Example:"QXJ0aWZhY3QgbmFtZQo="

Specifies the artifact name of this new version of the artifact content. Value of this must be Base64 encoded string. If this is not provided, the server will extract the name from the artifact content.

Request body

contentstring required

Raw content of the artifact or a valid (and accessible) URL where the content can be found.

Example request

{
  "references": [
    {
      "groupId": "mygroup",
      "artifactId": "13842090-2ce3-11ec-8d3d-0242ac130003",
      "version": "2",
      "name": "foo.bar.Open"
    }
  ]
}

Response

The artifact version was successfully created.

versionstring required
namestring
descriptionstring
createdBystring required
createdOnstring date-time required
typestring required
globalIdinteger required
state'ENABLED' | 'DISABLED' | 'DEPRECATED'

Describes the state of an artifact or artifact version. The following states are possible:

  • ENABLED
  • DISABLED
  • DEPRECATED
idstring required

The ID of a single artifact.

labelsstring[]
propertiesProperties

User-defined name-value pairs. Name and value must be strings.

groupIdstring

An ID of a single artifact group.

contentIdinteger required

Example response

{
  "groupId": "My-Group",
  "id": "my-artifact-id",
  "version": 1221432,
  "type": "PROTOBUF",
  "name": "Artifact Name",
  "description": "The description of the artifact",
  "createdBy": "user1",
  "createdOn": "2019-05-17T12:00:00Z",
  "globalId": 183282932983,
  "contentId": 12347,
  "labels": [
    "label-1",
    "label-2"
  ],
  "properties": {
    "custom-1": "foo",
    "custom-2": "bar"
  },
  "references": [
    {
      "groupId": "mygroup",
      "artifactId": "13842090-2ce3-11ec-8d3d-0242ac130003",
      "version": 2,
      "name": "foo.bar.Open"
    }
  ]
}

Changes

    • info

      added the media type application/vnd.create.extended+json to the request body

    • info

      the request's body type was generalized from no type to string, and format from no format to binary

    • info

      removed the ASYNCAPI enum value from the response property for the response status

    • info

      removed the AVRO enum value from the response property for the response status

    • info

      removed the GRAPHQL enum value from the response property for the response status

    • info

      removed the JSON enum value from the response property for the response status

    • info

      removed the KCONNECT enum value from the response property for the response status

    • info

      removed the OPENAPI enum value from the response property for the response status

    • info

      removed the PROTOBUF enum value from the response property for the response status

    • info

      removed the WSDL enum value from the response property for the response status

    • info

      removed the XML enum value from the response property for the response status

    • info

      removed the XSD enum value from the response property for the response status