-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* hasoop return response not only body / expect with response hesders not body / add doMethod : get json if true so you can do what you want:1.if you want to get json and throw error when error occur, you can use doMethod / 2.if you want to get all data,you can use hasoop native method. * ci sqoop host * strict test * fix ci test sqoop host * create constant.js for some type / * create constant.js for some type * fix rename * fix import keymirror
- Loading branch information
Showing
12 changed files
with
241 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import keyMirror from 'keymirror' | ||
|
||
/** | ||
* type of all connectors, currently supporting generic (databases) and HDFS. | ||
*/ | ||
export const connectorType = keyMirror({ | ||
generic: null, | ||
hdfs: null | ||
}) | ||
|
||
/** | ||
* specific types within generic types. | ||
*/ | ||
export const genericType = keyMirror({ | ||
mysql: null | ||
}) | ||
|
||
/** | ||
* type of all links, currently supporting mysql and hdfs. | ||
*/ | ||
export const linkType = keyMirror({ | ||
mysql: null, | ||
hdfs: null | ||
}) | ||
|
||
/** | ||
* action of sqoop, used in sqoop rest api querySting / params / body. | ||
*/ | ||
export const sqoopAction = keyMirror({ | ||
start: null, | ||
stop: null, | ||
status: null, | ||
|
||
all: null, | ||
jname: null, | ||
cname: null, | ||
|
||
enable: null, | ||
disable: null | ||
}) | ||
|
||
/** | ||
* type of all hasoop method | ||
*/ | ||
export const hasoopMethod = keyMirror({ | ||
getVersion: null, | ||
getDriver: null, | ||
getConnectorAll: null, | ||
getConnectorByConnectorName: null, | ||
getLinkAll: null, | ||
getLinkByConnectorName: null, | ||
getLinkByLinkName: null, | ||
createLink: null, | ||
updateLinkConfig: null, | ||
updateLinkEnable: null, | ||
updateLinkDisable: null, | ||
deleteLink: null, | ||
deleteLinkAll: null, | ||
getJobAll: null, | ||
getJobByJobName: null, | ||
getJobByConnectorName: null, | ||
createJob: null, | ||
updateJobConfig: null, | ||
updateJobEnable: null, | ||
updateJobDisable: null, | ||
deleteJob: null, | ||
deleteJobAll: null, | ||
startJob: null, | ||
stopJob: null, | ||
jobStatus: null, | ||
getSubmissionAll: null, | ||
getSubmissionByJobName: null | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
/* eslint-env mocha */ | ||
|
||
import { expect } from 'chai' | ||
import _ from 'lodash' | ||
|
||
import { sqoopClient } from './index' | ||
import { expect } from 'chai' | ||
import { sqoopClient, expectSqoopHeaders } from './index' | ||
|
||
suite('connector', () => { | ||
test('getConnectorAll', async () => { | ||
const data = await sqoopClient.getConnectorAll() | ||
expect(data.connectors.length).to.equal(7) | ||
const res = await sqoopClient.getConnectorAll() | ||
const json = await res.json() | ||
expectSqoopHeaders(res) | ||
expect(json.connectors.length).to.equal(7) | ||
}) | ||
|
||
test('getConnectorByConnectorName', async () => { | ||
const connectorName = 'generic-jdbc-connector' | ||
const data = await sqoopClient.getConnectorByConnectorName(connectorName) | ||
expect(_.get(data, 'connectors[0].name')).to.equal('generic-jdbc-connector') | ||
const res = await sqoopClient.getConnectorByConnectorName(connectorName) | ||
const json = await res.json() | ||
expectSqoopHeaders(res) | ||
expect(_.get(json, 'connectors[0].name')).to.equal('generic-jdbc-connector') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
/* eslint-env mocha */ | ||
|
||
import { expect } from 'chai' | ||
import _ from 'lodash' | ||
|
||
import { sqoopClient } from './index' | ||
import { expect } from 'chai' | ||
import { sqoopClient, expectSqoopHeaders } from './index' | ||
|
||
suite('driver', () => { | ||
test('getDriver', async () => { | ||
const data = await sqoopClient.getDriver() | ||
expect(data.version).to.equal('1') | ||
expect(_.get(data, ['all-config-resources', 'jarConfig.label'])).to.equal('Classpath configuration') | ||
const res = await sqoopClient.getDriver() | ||
const json = await res.json() | ||
expectSqoopHeaders(res) | ||
expect(json.version).to.equal('1') | ||
expect(_.get(json, ['all-config-resources', 'jarConfig.label'])).to.equal('Classpath configuration') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.