Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change endpoint #20

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions discovery-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ let createOrUpdateDiscoveredApi = async function(workspacePath, apihost, apikey,
const apisArray = apisLocation.split(',');
const isMultiple = apisArray.length > 1;
let resp; let stateUpdateContent;
let curlUrl = `https://discovery-api.${apihost}/discovery/orgs/${porg}/discovered-apis`;
let curlUrl = `https://api.${apihost}/discovery/orgs/${porg}/discovered-apis`;
if (!apikey) {
return { status: 304, message: [ 'Warning: create Or Update Discovered Api not run as apikey is missing' ] };
}
Expand Down Expand Up @@ -119,7 +119,7 @@ let createOrUpdateApiInternal = async function(curlUrl, token, bodyContent, meth

let datasourceStateUpdate = async function(apihost, bodyContent, token, porg, dataSourceLocation) {
try {
await axios.patch(`https://discovery-api.${apihost}/discovery/orgs/${porg}/data-sources/${encodeURIComponent(dataSourceLocation)}`, bodyContent, {
await axios.patch(`https://api.${apihost}/discovery/orgs/${porg}/data-sources/${encodeURIComponent(dataSourceLocation)}`, bodyContent, {
headers: {
Authorization: 'Bearer ' + token,
Accept: 'application/json',
Expand All @@ -135,7 +135,7 @@ let checkAndRegisterDataSource = async function(apihost, token, porg, dataSource
// Use this function to perform the datasource registration. If the dataSource doesn't exist create it
let resp;
try {
resp = await axios.get(`https://discovery-api.${apihost}/discovery/orgs/${porg}/data-sources/${encodeURIComponent(dataSourceLocation)}`, {
resp = await axios.get(`https://api.${apihost}/discovery/orgs/${porg}/data-sources/${encodeURIComponent(dataSourceLocation)}`, {
headers: {
Authorization: 'Bearer ' + token,
Accept: 'application/json',
Expand All @@ -145,7 +145,7 @@ let checkAndRegisterDataSource = async function(apihost, token, porg, dataSource
});
if (resp.status === 404) {
const bodyContent = JSON.stringify({ title: dataSourceLocation, collector_type: COLLECTOR_TYPE });
resp = await axios.post(`https://discovery-api.${apihost}/discovery/orgs/${porg}/data-sources`, bodyContent, {
resp = await axios.post(`https://api.${apihost}/discovery/orgs/${porg}/data-sources`, bodyContent, {
headers: {
Authorization: 'Bearer ' + token,
Accept: 'application/json',
Expand All @@ -165,7 +165,7 @@ let checkAndRegisterDataSource = async function(apihost, token, porg, dataSource
let getAuthToken = async function(apihost, apikey) {

var bodyContent = JSON.stringify({ grant_type: 'api_key', api_key: apikey, realm: 'provider/default-idp-2' });
const token = await axios.post(`https://discovery-api.${apihost}/discovery/token`, bodyContent, {
const token = await axios.post(`https://api.${apihost}/discovery/token`, bodyContent, {
headers: {
Accept: 'application/json',
'Content-Type': 'application/json'
Expand Down
10 changes: 5 additions & 5 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.