Skip to content

Usage Prerequisites

Eunsang edited this page Sep 7, 2021 · 7 revisions

Prerequisites

  • Cloud Connection Info. (CB-Spider)
    • Cloud Driver
    • Credential
    • Region
  • Cloud-Barista Namespace (CB-Tumblebug)

Create a "Cloud Connection Info." with "REST-API"

  • Get "Cloud Connection Info." list
$ curl -sX GET -H "Content-Type: application/json" http://localhost:1024/spider/connectionconfig

Create a cloud-driver

  • AWS
$ curl -sX POST  -H "Content-Type: application/json" http://localhost:1024/spider/driver -d @- <<EOF
{
  "DriverName"        : "<Cloud Driver Name>",
  "ProviderName"      : "AWS",
  "DriverLibFileName" : "aws-driver-v1.0.so"
}
EOF
  • GCP
$ curl -sX POST  -H "Content-Type: application/json" http://localhost:1024/spider/driver -d @- <<EOF
{
  "DriverName"        : "<Cloud Driver Name>",
  "ProviderName"      : "GCP",
  "DriverLibFileName" : "gcp-driver-v1.0.so"
}
EOF
  • Azure
$ curl -sX POST  -H "Content-Type: application/json" http://localhost:1024/spider/driver -d @- <<EOF
{
  "DriverName"        : "<Cloud Driver Name>",
  "ProviderName"      : "AZURE",
  "DriverLibFileName" : "azure-driver-v1.0.so"
}
EOF
  • Alibaba
$ curl -sX POST  -H "Content-Type: application/json" http://localhost:1024/spider/driver -d @- <<EOF
{
  "DriverName"        : "<Cloud Driver Name>",
  "ProviderName"      : "ALIBABA",
  "DriverLibFileName" : "alibaba-driver-v1.0.so"
}
EOF

Create a credential

$ curl -sX POST  -H "Content-Type: application/json" http://localhost:1024/spider/credential -d @- <<EOF
{
  "CredentialName"   : "<Credential Name>",
  "ProviderName"     : "AWS",
  "KeyValueInfoList" : [
    {"Key" : "ClientId",       "Value" : "<aws_secret_access_key>"},
    {"Key" : "ClientSecret",   "Value" : "<aws_access_key_id>"}
  ]
}
EOF
$ curl -sX POST  -H "Content-Type: application/json" http://localhost:1024/spider/credential -d @- <<EOF
{
  "CredentialName"   : "<Credential Name>",
  "ProviderName"     : "GCP",
  "KeyValueInfoList" : [
    {"Key" : "ProjectID",   "Value" : "<project_id>"},
    {"Key" : "ClientEmail", "Value" : "<client_email>"},
    {"Key" : "PrivateKey",  "Value" : "<private_key>"}
  ]
}
EOF
$ curl -sX POST  -H "Content-Type: application/json" http://localhost:1024/spider/credential -d @- <<EOF
{
  "CredentialName"   : "<Credential Name>",
  "ProviderName"     : "AZURE",
  "KeyValueInfoList" : [
    {"Key" : "ClientId",        "Value" : "<clientId>"},
    {"Key" : "ClientSecret",    "Value" : "<clientSecret>"},
    {"Key" : "TenantId",        "Value" : "<tenantId>"},
    {"Key" : "SubscriptionId",  "Value" : "<subscriptionId>"}
  ]
}
EOF
$ curl -sX POST  -H "Content-Type: application/json" http://localhost:1024/spider/credential -d @- <<EOF
{
  "CredentialName"   : "<Credential Name>",
  "ProviderName"     : "ALIBABA",
  "KeyValueInfoList" : [
    {"Key" : "ClientId",       "Value" : "<AccessKey ID>"},
    {"Key" : "ClientSecret",   "Value" : "<AccessKey secret>"}
  ]
}
EOF

Create a region

$ curl -sX POST  -H "Content-Type: application/json" http://localhost:1024/spider/region -d @- <<EOF
{
  "RegionName"       : "<Region Name>",
  "ProviderName"     : "AWS", 
  "KeyValueInfoList" : [
    {"Key" : "Region", "Value" : "<region>"},
    {"Key" : "Zone",   "Value" : "<zone>"}
  ]
}
EOF
$ curl -sX POST  -H "Content-Type: application/json" http://localhost:1024/spider/region -d @- <<EOF
{
  "RegionName"       : "<Region Name>",
  "ProviderName"     : "GCP", 
  "KeyValueInfoList" : [
    {"Key" : "Region", "Value" : "<region>"},
    {"Key" : "Zone",   "Value" : "<zone>"}
  ]
}
EOF
$ curl -sX POST  -H "Content-Type: application/json" http://localhost:1024/spider/region -d @- <<EOF
{
  "RegionName"       : "<Region Name>",
  "ProviderName"     : "AZURE", 
  "KeyValueInfoList" : [
    {"Key" : "Region", "Value" : "<region>"},
    {"Key" : "ResourceGroup", "Value" : "<resource group>"}
  ]
}
EOF
$ curl -sX POST  -H "Content-Type: application/json" http://localhost:1024/spider/region -d @- <<EOF
{
  "RegionName"       : "<Region Name>",
  "ProviderName"     : "ALIBABA", 
  "KeyValueInfoList" : [
    {"Key" : "Region", "Value" : "<region>"},
    {"Key" : "Zone",   "Value" : "<zone>"}
  ]
}
EOF

Create a connection info.

$ curl -sX POST  -H "Content-Type: application/json" http://localhost:1024/spider/connectionconfig -d @- <<EOF
{
	"ConfigName"     : "<Connection Info. Name>",
	"ProviderName"   : "<CSP>", 
	"DriverName"     : "<Cloud Driver Name>", 
	"CredentialName" : "<Credential Name>", 
	"RegionName"     : "<Region Name>"
}
EOF

Create a "Cloud-Barista Namespace" with "REST-API"

curl -sX POST   http://localhost:1323/tumblebug/ns -H "${c_AUTH}" -H "${c_CT}" -d @- <<EOF
{
"name"        : "<Cloud-Barista Namespace Name>",
"description" : ""
}