Anaplan Connect Using Linux Script(Certificate Based Authentication)

New Contributor

Anaplan Connect Using Linux Script(Certificate Based Authentication)

Hi Team,

I am working on Anaplan Connect on Linux Platform tried run with credentials it worked, however, i am unable to run with certificate authentication.

Getting an error" -certificate is unknown token"

 

Please find the below code.

#!/bin/sh
# This example uploads a file and runs an import

WorkspaceId="'8a01b09d5v0b3c1c015a1eca06aa296d'"
ModelId="'77C397ECk35B4A238A5939B42tE098BC'"
Operation="certificate '/home/suk/Downloads/adar/anaplan-connect-1-3-3-5/anaplan.cer' -file 'sales.txt' -put '/home/suk/Downloads/adar/anaplan-connect-1-3-3-5/sales.txt' -import 'sales from sales.txt' -execute -output '/home/suk/Downloads/adar/anaplan-connect-1-3-3-5/Error/error.txt'"

#____________________________ Do not edit below this line ______________________________
if [ "${AnaplanUser}" ]; then
  Credentials="-user ${AnaplanUser}"
fi

echo cd "`dirname "$0"`"
cd "`dirname "$0"`"
if [ ! -f AnaplanClient.sh ]; then
  echo "Please ensure this script is in the same directory as AnaplanClient.sh." >&2
  exit 1
elif [ ! -x AnaplanClient.sh ]; then
  echo "Please ensure you have executable permissions on AnaplanClient.sh." >&2
  exit 1
fi
Command="./AnaplanClient.sh ${Credentials} -workspace ${WorkspaceId} -model ${ModelId} ${Operation}"
/bin/echo "${Command}"
exec /bin/sh -c "${Command}"

3 REPLIES 3
Contributor

Re: Anaplan Connect Using Linux Script(Certificate Based Authentication)

Hi @AdarshMohapatra ,

 

Please refer to this. 

 

looks like you will have to do the similar changes in your shell script. 

 

https://community.anaplan.com/t5/Anaplan-Platform-Discussions/Anaplan-Connect-Use-of-Certificate-in-...

 

Hope it should work.

Thanks,

Sandeep

 

 

Message 2 of 4
Highlighted
Occasional Contributor

Re: Anaplan Connect Using Linux Script(Certificate Based Authentication)

@AdarshMohapatra 

Add -(hyphen) before certificate in operation and use the same action name in command(highlighted in green).

Try the below code or you can also create a variable to initialize the certificate location, it can be used throughout the script.

 

#!/bin/sh
# This example uploads a file and runs an import
WorkspaceId="'8a01b09d5v0b3c1c015a1eca06aa296d'"
ModelId="'77C397ECk35B4A238A5939B42tE098BC'"
Operation="-certificate '/home/suk/Downloads/adar/anaplan-connect-1-3-3-5/anaplan.cer' -file 'sales.txt' -put '/home/suk/Downloads/adar/anaplan-connect-1-3-3-5/sales.txt' -import 'sales from sales.txt' -execute -output '/home/suk/Downloads/adar/anaplan-connect-1-3-3-5/Error/error.txt'"

#____________________________ Do not edit below this line ______________________________

if [ "${AnaplanUser}" ]; then
  Credentials="-user ${AnaplanUser}"
fi//Remove this

echo cd "`dirname "$0"`"
cd "`dirname "$0"`"
if [ ! -f AnaplanClient.sh ]; then
  echo "Please ensure this script is in the same directory as AnaplanClient.sh." >&2
  exit 1
elif [ ! -x AnaplanClient.sh ]; then
  echo "Please ensure you have executable permissions on AnaplanClient.sh." >&2
  exit 1
fi
Command="./AnaplanClient.sh ${certificate} -workspace ${WorkspaceId} -model ${ModelId} ${Operation}"
/bin/echo "${Command}"
exec /bin/sh -c "${Command}"

Message 3 of 4
New Contributor

Re: Anaplan Connect Using Linux Script(Certificate Based Authentication)

Thanks @patilchhaya the solution worked..!!

Message 4 of 4