openshift-rest-client
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="1.1.0"></a> | ||
# [1.1.0](https://github.com/bucharest-gold/openshift-rest-client/compare/v1.0.1...v1.1.0) (2018-03-20) | ||
### Features | ||
* **build-configs:** Adding instantiate method to buildconfigs ([#60](https://github.com/bucharest-gold/openshift-rest-client/issues/60)) ([7c86990](https://github.com/bucharest-gold/openshift-rest-client/commit/7c86990)) | ||
<a name="1.0.1"></a> | ||
@@ -7,0 +17,0 @@ ## [1.0.1](https://github.com/bucharest-gold/openshift-rest-client/compare/v1.0.0...v1.0.1) (2018-02-19) |
@@ -57,10 +57,14 @@ 'use strict'; | ||
function instantiateBinary (client) { | ||
return function instantiateBinary (buildName, options = {}) { | ||
return function instantiateBinary (buildConfigName, options = {}) { | ||
const clientConfig = privates.get(client).config; | ||
if (!buildConfigName) { | ||
return Promise.reject(new Error('Build Config Name is required')); | ||
} | ||
const req = { | ||
method: 'POST', | ||
json: false, | ||
url: `${client.apiUrl}/namespaces/${clientConfig.context.namespace}/buildconfigs/${buildName}/instantiatebinary?commit=`, | ||
body: fs.createReadStream(options.dockerArchive) | ||
url: `${client.apiUrl}/namespaces/${clientConfig.context.namespace}/buildconfigs/${buildConfigName}/instantiatebinary`, | ||
body: options.dockerArchive ? fs.createReadStream(options.dockerArchive) : undefined | ||
}; | ||
@@ -74,2 +78,23 @@ | ||
function instantiate (client) { | ||
return function instantiate (buildConfigName, options = {}) { | ||
const clientConfig = privates.get(client).config; | ||
if (!buildConfigName) { | ||
return Promise.reject(new Error('Build Config Name is required')); | ||
} | ||
const req = { | ||
method: 'POST', | ||
json: false, | ||
url: `${client.apiUrl}/namespaces/${clientConfig.context.namespace}/buildconfigs/${buildConfigName}/instantiate`, | ||
body: options.body | ||
}; | ||
return request(client, req).then((body) => { | ||
return JSON.parse(body); | ||
}); | ||
}; | ||
} | ||
function create (client) { | ||
@@ -152,4 +177,5 @@ return function create (buildConfig, options = {}) { | ||
instantiateBinary: instantiateBinary, | ||
instantiate: instantiate, | ||
remove: remove, | ||
removeAll: removeAll | ||
}; |
{ | ||
"name": "openshift-rest-client", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Node.js client for developing with OpenShift", | ||
@@ -49,5 +49,5 @@ "main": "index.js", | ||
"coveralls": "^3.0.0", | ||
"eslint": "^4.3.0", | ||
"eslint": "^4.18.0", | ||
"eslint-config-semistandard": "^12.0.0", | ||
"eslint-config-standard": "^10.2.1", | ||
"eslint-config-standard": "^11.0.0", | ||
"eslint-plugin-import": "^2.2.0", | ||
@@ -62,3 +62,3 @@ "eslint-plugin-node": "^6.0.0", | ||
"nyc": "^11.1.0", | ||
"proxyquire": "^1.8.0", | ||
"proxyquire": "^2.0.0", | ||
"standard-version": "^4.3.0", | ||
@@ -65,0 +65,0 @@ "tap-spec": "^4.1.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
72945
1781