How to use the @f5devcentral/f5-cloud-libs.cloudProvider.MESSAGE_SYNC_COMPLETE function in @f5devcentral/f5-cloud-libs

To help you get started, we’ve selected a few @f5devcentral/f5-cloud-libs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github F5Networks / f5-cloud-libs-gce / lib / gceCloudProvider.js View on Github external
GceCloudProvider.prototype.sendMessage = function sendMessage(action, options) {
    const message = {
        action,
        toInstanceId: options.toInstanceId,
        fromInstanceId: options.fromInstanceId,
        data: options.data
    };

    let topic;

    if (action === CloudProvider.MESSAGE_ADD_TO_CLUSTER) {
        topic = getJoinTopicName.call(this);
    } else if (action === CloudProvider.MESSAGE_SYNC_COMPLETE) {
        topic = getSyncTopicName.call(this);
    }

    return this.pubSub.publish(topic, message);
};