Skip to content

Subscription

A Subscription asks to be notified of registry events, such as new data registrations, metadata registrations or structure changes. The notifications are sent by email or HTTP POST. The document starts with ref: "Subscription=AGENCY:ID(1.0)".

The writer is SubscriptionCanonicalWriter.

Note

There are no golden files for subscriptions. The examples on this page are built from the writer code.

Simple form

format: "fusion-yaml(1.0.0)"
ref: "Subscription=ACY:SUB1(1.0)"
name: "Subscription"
owner: "DataProvider=ACY:DATA_PROVIDERS(1.0).P1"
type: "DATA_REGISTRATION"
mailTo: "data@acy.org"
references: "Dataflow=ACY:DF_EXR(1.0)"

The document starts with the common header. Then come these body fields:

  • owner: the organisation that owns the subscription. It is written as a canonical value (class, =, short URN), because the owner can be any type of organisation (references).
  • type: the subscription type: DATA_REGISTRATION, METADATA_REGISTRATION or STRUCTURE.
  • mailTo: the email addresses to notify.
  • references: the structures the subscription watches, as canonical values.

Complete example

format: "fusion-yaml(1.0.0)"
ref: "Subscription=ACY:SUB1(1.0)"
name: "Subscription"
owner: "DataProvider=ACY:DATA_PROVIDERS(1.0).P1"
type: "STRUCTURE"
mailTo:
- "a@acy.org"
- "b@acy.org"
httpPostTo: "https://acy.org/notify"
references:
- "Codelist=ACY:CL_FREQ(1.0)"
- "DataStructure=ACY:EXR(1.0)"

mailTo, httpPostTo and references are each sorted alphabetically, and each follows the value-or-array rule: one entry is written as a string, several as an array.

Field reference

Field Value Written when
owner canonical value of the owning organisation the subscription has an owner
type DATA_REGISTRATION, METADATA_REGISTRATION or STRUCTURE the subscription has a type
mailTo email address(es), sorted, value or array there is at least one email address
httpPostTo URL(s), sorted, value or array there is at least one HTTP POST address
references canonical value(s), sorted, value or array the subscription references at least one structure

Reading notes

The reader accepts mailTo, httpPostTo and references either as a single value or as an array.