How to use the @f5devcentral/f5-cloud-libs.util.SHORT_RETRY 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-declarative-onboarding / src / lib / configManager.js View on Github external
if (selectProperties.length > 0) {
                            query.$select = selectProperties.join(',');
                        }
                        const encodedQuery = querystring.stringify(query);
                        const options = {};
                        let path = `${configItem.path}?${encodedQuery}`;

                        // do any replacements
                        path = path.replace(hostNameRegex, tokenMap.hostName);
                        path = path.replace(deviceNameRegex, tokenMap.deviceName);

                        if (configItem.silent) {
                            options.silent = configItem.silent;
                        }

                        return this.bigIp.list(path, null, cloudUtil.SHORT_RETRY, options);
                    }));
            })
github F5Networks / f5-declarative-onboarding / src / lib / dscHandler.js View on Github external
function waitForDeviceGroup(deviceGroupName) {
    function checkDeviceGroup() {
        return new Promise((resolve, reject) => {
            this.bigIp.cluster.hasDeviceGroup(deviceGroupName)
                .then((hasDeviceGroup) => {
                    if (hasDeviceGroup) {
                        resolve();
                    } else {
                        reject(new Error(`Device group ${deviceGroupName} does not exist on this device.`));
                    }
                });
        });
    }

    return cloudUtil.tryUntil(this, cloudUtil.SHORT_RETRY, checkDeviceGroup);
}
github F5Networks / f5-declarative-onboarding / src / lib / doUtil.js View on Github external
executeBashCommandRemote(bigIp, command) {
        const commandBody = {
            command: 'run',
            utilCmdArgs: `-c "${command}"`
        };

        return bigIp.create(
            '/tm/util/bash',
            commandBody,
            null,
            cloudUtil.SHORT_RETRY
        )
            .then(result => result.commandResult);
    },
github F5Networks / f5-declarative-onboarding / src / lib / networkHandler.js View on Github external
function findMatchingRoutes(selfIpsToDelete) {
    const matchingRoutes = [];

    if (selfIpsToDelete.length === 0) {
        return Promise.resolve(matchingRoutes);
    }

    return this.bigIp.list(PATHS.Route, null, cloudUtil.SHORT_RETRY)
        .then((routes) => {
            const existingRoutes = routes && Array.isArray(routes) ? routes.slice() : [];

            existingRoutes.forEach((route) => {
                selfIpsToDelete.forEach((selfIp) => {
                    if (isInSubnet(route.gw, selfIp.address)) {
                        if (matchingRoutes.findIndex(elementMatches, route) === -1) {
                            matchingRoutes.push(route);
                        }
                    }
                });
            });

            return Promise.resolve(matchingRoutes);
        })
        .catch((err) => {