Skip to main content

Manage packages

Package management enables version management and simplifies the upgrade and rollback processes for Functions, Sinks, and Sources. When you use the same function, sink and source in different namespaces, you can upload them to a common package management system.

Package name

A package is identified by five parts: type, tenant, namespace, package name, and version.

PartDescription
typeThe type of the package. The following types are supported: function, sink and source.
nameThe fully qualified name of the package: <tenant>/<namespace>/<package name>.
versionThe version of the package.

The following is a code sample.


class PackageName {
private final PackageType type;
private final String namespace;
private final String tenant;
private final String name;
private final String version;
}

enum PackageType {
FUNCTION("function"), SINK("sink"), SOURCE("source");
}

Package URL

A package is located using a URL. The package URL is written in the following format:


<type>://<tenant>/<namespace>/<package name>@<version>

The following are package URL examples:

sink://public/default/mysql-sink@1.0 function://my-tenant/my-ns/my-function@0.1 source://my-tenant/my-ns/mysql-cdc-source@2.3

The package management system stores the data, versions and metadata of each package. The metadata is shown in the following table.

metadataDescription
descriptionThe description of the package.
contactThe contact information of a package. For example, team email.
create_timeThe time when the package is created.
modification_timeThe time when the package is modified.
propertiesA key/value map that stores your own information.

Permissions

The packages are organized by the tenant and namespace, so you can apply the tenant and namespace permissions to packages directly.

Package resources

You can use the package management with command line tools, REST API and Java client.

Upload a package

You can upload a package to the package management service in the following ways.


bin/pulsar-admin packages upload function://public/default/example@v0.1 --path package-file --description package-description

Download a package

You can download a package to the package management service in the following ways.


bin/pulsar-admin packages download function://public/default/example@v0.1 --path package-file

List all versions of a package

You can get a list of all versions of a package in the following ways.


bin/pulsar-admin packages list --type function public/default

List all the specified type packages under a namespace

You can get a list of all the packages with the given type in a namespace in the following ways.


bin/pulsar-admin packages list --type function public/default

Get the metadata of a package

You can get the metadata of a package in the following ways.


bin/pulsar-admin packages get-metadata function://public/default/test@v1

Update the metadata of a package

You can update the metadata of a package in the following ways.


bin/pulsar-admin packages update-metadata function://public/default/example@v0.1 --description update-description

Delete a specified package

You can delete a specified package with its package name in the following ways.

The following command example deletes a package of version 0.1.


bin/pulsar-admin packages delete function://public/default/example@v0.1