Skip to content

Commit

Permalink
Salesforce API version is configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
DonDebonair committed Aug 26, 2016
1 parent a1b8cc0 commit 25b7c9d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name := "salesforce2hadoop"

organization := "co.datadudes"

version := "1.0"
version := "1.2"

scalaVersion := "2.11.4"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ object SFImportCLIRunner extends App with LazyLogging {
sfWSDL: File = new File("."),
stateFile: URI = new URI("file://" + System.getProperty("user.home") + "/.sf2hadoop/state"),
apiBaseUrl: String = "https://login.salesforce.com",
apiVersion: String = "37.0",
records: Seq[String] = Seq())

val parser = new scopt.OptionParser[Config]("sf2hadoop") {
Expand All @@ -29,6 +30,7 @@ object SFImportCLIRunner extends App with LazyLogging {
opt[File]('w', "wsdl") required() valueName "<file>" action { (x, c) => c.copy(sfWSDL = x)} text "Path to Salesforce Enterprise WSDL"
opt[URI]('s', "state") optional() valueName "<URI>" action { (x, c) => c.copy(stateFile = x)} text "URI to state file to keep track of last updated timestamps"
opt[String]('a', "api-base-url") optional() valueName "<URL>" action { (x, c) => c.copy(apiBaseUrl = x)} text "Base URL of Salesforce instance"
opt[String]('v', "api-version") optional() valueName "<number>" action { (x, c) => c.copy(apiVersion = x)} text "API version of Salesforce instance"
arg[String]("<record>...") unbounded() action { (x, c) => c.copy(records = c.records :+ x)} text "List of Salesforce record types to import"
help("help") text "prints this usage text"
}
Expand All @@ -44,7 +46,7 @@ object SFImportCLIRunner extends App with LazyLogging {
println("You need to enter a valid command (init|update)")
} else {
val schemas = WSDL2Avro.convert(config.sfWSDL.getCanonicalPath, filterSFInternalFields)
val connection = SalesforceService(config.sfUsername, config.sfPassword, config.apiBaseUrl)
val connection = SalesforceService(config.sfUsername, config.sfPassword, config.apiBaseUrl, config.apiVersion)
val importer = new SFImporter(schemas, config.datasetBasePath, connection)
val state = new ImportState(config)
state.createDirs
Expand Down

2 comments on commit 25b7c9d

@ronniedengCA
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I know if this API support the connection to Keberizied Cluster?

@AmritaKv
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for using Salesforce Partner connection ends point in SalesForceService instead of enterprise one?
config.setAuthEndpoint(s"$apiBaseUrl/services/Soap/u/$apiVersion")

Can it be replaced with Enterprise wsdl end point?
String authEndPoint = "https://login.salesforce.com/services/Soap/c/37.0/"

Please sign in to comment.