How to use the @f5devcentral/f5-cloud-libs.httpUtil 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 / scripts / failover.js View on Github external
#!/usr/bin/env node

'use strict';

const parser = require('commander');
const fs = require('fs');
const q = require('q');
const ipaddr = require('ipaddr.js');

const Compute = require('@google-cloud/compute');
const f5CloudLibs = require('@f5devcentral/f5-cloud-libs');

const util = f5CloudLibs.util;
const httpUtil = f5CloudLibs.httpUtil;
const Logger = f5CloudLibs.logger;
const compute = new Compute();

// Parse command line arguments

parser
    .version('1.0.0')

    .option('--log-level [type]', 'Specify the log level', 'info')
    .option('--log-file [type]', 'Specify the log file location', '/var/log/cloud/google/failover.log')
    .option('--config-file [type]', 'Specify the log level', '/config/cloud/.deployment')
    .parse(process.argv);

const loggerOptions = { logLevel: parser.logLevel, fileName: parser.logFile, console: true };
const logger = Logger.getLogger(loggerOptions);
const BigIp = f5CloudLibs.bigIp;
github F5Networks / f5-declarative-onboarding / test / unit / src / lib / doUtilTests.js View on Github external
*/

'use strict';

const chai = require('chai');
const chaiAsPromised = require('chai-as-promised');

chai.use(chaiAsPromised);
const assert = chai.assert;

const dns = require('dns');
const netMock = require('net');
const sinon = require('sinon');

const BigIpMock = require('@f5devcentral/f5-cloud-libs').bigIp;
const httpUtilMock = require('@f5devcentral/f5-cloud-libs').httpUtil;
const cloudUtilMock = require('@f5devcentral/f5-cloud-libs').util;

const doUtil = require('../../../../src/lib/doUtil');

describe('doUtil', () => {
    const port = '1234';
    const socket = {
        connectCalls: 0,
        numConnectsToFail: 0,
        on(event, cb) {
            if (event === 'connect') {
                this.connectCalls += 1;
                if (this.connectCalls > this.numConnectsToFail) {
                    cb();
                }
            }
github F5Networks / f5-declarative-onboarding / src / lib / doUtil.js View on Github external
*     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

'use strict';

const net = require('net');
const exec = require('child_process').exec;
const dns = require('dns');
const BigIp = require('@f5devcentral/f5-cloud-libs').bigIp;
const httpUtil = require('@f5devcentral/f5-cloud-libs').httpUtil;
const cloudUtil = require('@f5devcentral/f5-cloud-libs').util;
const PRODUCTS = require('@f5devcentral/f5-cloud-libs').sharedConstants.PRODUCTS;
const Logger = require('./logger');
const ipF5 = require('../schema/latest/formats').f5ip;

const logger = new Logger(module);

/**
 * @module
 */
module.exports = {
    /**
     * The @f5devcentral/f5-cloud-libs/BigIp object
     * @external BigIp
     */
github F5Networks / f5-declarative-onboarding / src / nodejs / restWorker.js View on Github external
* You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

'use strict';

const fs = require('fs');
const EventEmitter = require('events');
const httpUtil = require('@f5devcentral/f5-cloud-libs').httpUtil;
const cloudUtil = require('@f5devcentral/f5-cloud-libs').util;
const PRODUCTS = require('@f5devcentral/f5-cloud-libs').sharedConstants.PRODUCTS;
const doUtil = require('../lib/doUtil');
const cryptoUtil = require('../lib/cryptoUtil');
const ConfigManager = require('../lib/configManager');
const DeclarationHandler = require('../lib/declarationHandler');
const Logger = require('../lib/logger');
const Response = require('../lib/response');
const ConfigResponse = require('../lib/configResponse');
const InfoResponse = require('../lib/infoResponse');
const InspectResponse = require('../lib/inspectResponse');
const TaskResponse = require('../lib/taskResponse');
const State = require('../lib/state');
const SshUtil = require('../lib/sshUtil');
const Validator = require('../lib/validator');