-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1016 from jihoon-seo/220118_Add_registerExistingS…
…SHKey_feature Add `registerExistingSSHKey` feature
- Loading branch information
Showing
9 changed files
with
149 additions
and
30 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
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
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/bash | ||
|
||
function CallTB() { | ||
echo "- Register sshKey in ${MCIRRegionName}" | ||
|
||
curl -H "${AUTH}" -sX POST http://$TumblebugServer/tumblebug/ns/$NSID/resources/sshKey?option=register -H 'Content-Type: application/json' -d \ | ||
'{ | ||
"connectionName": "'${CONN_CONFIG[$INDEX,$REGION]}'", | ||
"name": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'", | ||
"cspSshKeyName": "'${NSID}-${CONN_CONFIG[$INDEX,$REGION]}-${POSTFIX}'", | ||
"fingerprint": "xx:c4:5a:ea:7f:c4:db:d5:80:80:92:47:7e:43:c9:2c:01:d3:ee:xx", | ||
"username": "cb-user", | ||
"publicKey": "", | ||
"privateKey": "-----BEGIN RSA PRIVATE KEY-----\nMIIE....Kplg==\n-----END RSA PRIVATE KEY-----" | ||
}' | jq '.message' | ||
} | ||
|
||
#function register_sshKey() { | ||
|
||
echo "####################################################################" | ||
echo "## 5. sshKey: Register" | ||
echo "####################################################################" | ||
|
||
source ../init.sh | ||
|
||
if [ "${INDEX}" == "0" ]; then | ||
echo "[Parallel execution for all CSP regions]" | ||
INDEXX=${NumCSP} | ||
for ((cspi = 1; cspi <= INDEXX; cspi++)); do | ||
INDEXY=${NumRegion[$cspi]} | ||
CSP=${CSPType[$cspi]} | ||
echo "[$cspi] $CSP details" | ||
for ((cspj = 1; cspj <= INDEXY; cspj++)); do | ||
echo "[$cspi,$cspj] ${RegionName[$cspi,$cspj]}" | ||
|
||
MCIRRegionName=${RegionName[$cspi,$cspj]} | ||
|
||
CallTB | ||
|
||
done | ||
|
||
done | ||
wait | ||
|
||
else | ||
echo "" | ||
|
||
MCIRRegionName=${CONN_CONFIG[$INDEX,$REGION]} | ||
|
||
CallTB | ||
|
||
fi | ||
|
||
#} | ||
|
||
#register_sshKey |