Try it now

Overview

Registry contains all functions related to Carbon registry which can be done in Jaggery.

Operations

Operations

Returns

Description

Registry(server, options)

None

Following parameters should be passed to the constructor:

server - carbon server instance which we connect to the registry. This parameter is not mandatory. If we don’t provide the server, it will connect to the local server where the jaggery code will be executed.

options - This is the json object which contain all other options to create the registry object

username - user which will be used in registry operations. Rather than sending user name we can send “system: true” in the options. then it will use the default registry system user. If we pass nothing it will use the default anonymous registry user. domain - tenant domain for the user. This will be used to get the tenant id. tenantId - tenant id of registry user

put(path, resource)

None

Adding a resource parameters:

path - Path for the resource in registry. (resource path)

resource - this is the json object which contains all data related to the resource which will be created.

content - content of the resource. mediaType - type of the resource’s content description - a description about the resource. uuid - properties - properties of the resource. This is a json object which contains property name and its value.

put(path, collection)

None

Adding a collection Collection is also a resource which contains set of resources. Can use put method as below to add a collection. parameters:

path - Path for the resource in registry. (resource path)

collection - this is the json object which contains all data related to the collction which will be created.

collection - boolean value to identify the resource as a collection. description - a description about the resource. uuid - properties - properties of the resource. This is a json object which contains property name and its value.

get(path)

object

Retrieving a resource Retrieve a resource to jaggery as a json object which contains all data about the resource. parameters: