From b015760661897065c49b6f0bc561f34baa874da8 Mon Sep 17 00:00:00 2001 From: giorod3 Date: Mon, 5 Aug 2019 15:07:54 -0700 Subject: [PATCH] added instance pool to the Core api, and added list as the call --- services/core.js | 2 ++ services/core/instancePool.js | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 services/core/instancePool.js diff --git a/services/core.js b/services/core.js index 2d380c6..4147bee 100644 --- a/services/core.js +++ b/services/core.js @@ -13,6 +13,7 @@ var drgAttachment = require( './core/drgAttachment.js' ); var fastConnectProviderServices = require( './core/fastConnectProviderServices.js' ); var image = require( './core/image.js' ); var instance = require( './core/instance.js' ); +var instancePool = require( './core/instancePool.js' ); var instanceConsoleConnection = require( './core/instanceConsoleConnection.js' ); var instanceCredential = require( './core/instanceCredential.js' ); var internetGateway = require( './core/internetGateway.js' ); @@ -61,6 +62,7 @@ module.exports = { fastConnectProviderServices: fastConnectProviderServices, image: image, instance: instance, + instancePool: instancePool, instanceConsoleConnection: instanceConsoleConnection, instanceCredential: instanceCredential, internetGateway: internetGateway, diff --git a/services/core/instancePool.js b/services/core/instancePool.js new file mode 100644 index 0000000..c2571f5 --- /dev/null +++ b/services/core/instancePool.js @@ -0,0 +1,21 @@ +var ocirest = require('../../utils/ocirest.js'); +var endpoint = require('../../configs/endpoints.js'); + +function list( auth, parameters, callback ) { + var possibleHeaders = []; + var possibleQueryStrings = ['compartmentId', 'displayName', 'limit', 'page', 'sortBy', 'sortOrder', 'lifecycleState']; + var headers = ocirest.buildHeaders( possibleHeaders, parameters ); + var queryString = ocirest.buildQueryString( possibleQueryStrings, parameters ); + ocirest.process( auth, + { path : auth.RESTversion + '/instancePools/' + queryString, + host : endpoint.service.core[auth.region], + headers : headers, + method : 'GET' }, + callback ); + }; + + + module.exports={ + list: list, + + } \ No newline at end of file