Questo contenuto non è disponibile nella lingua selezionata.
8.2. Cartridge Event Subscriptions
When OpenShift Enterprise adds a cartridge to an application, it uses entries in the
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
Subscribes
section of the $cartridge_name/metadata/manifest.yml
file in other cartridges to determine what actions to take for those other cartridges. Define subscribe events in the manifest.yml
file using the following format:
Subscribes: <event_name>: Type: "<event type>"
Subscribes:
<event_name>:
Type: "<event type>"
Example 8.2. PHP Cartridge Subscribes Entry
When OpenShift Enterprise processes a cartridge publish script, it inputs the result to subscriber scripts in other cartridges that match the
Type
of the publish event. The input to matching subscriber scripts is prefaced with $cartridge_name/hooks/<event_name> <gear_name> <namespace> <gear_uuid>
.
For each matching
Subscribes
entry, OpenShift Enterprise runs a script named $cartridge_name/hooks/$event_name
. OpenShift Enterprise must send and process entries marked with Required: true
.
The publisher script determines the format of the information input to the subscriber script. Ensure that subscriber script can parse the input correctly.