Commit 7fdab74d authored by Anuj Gupta's avatar Anuj Gupta
Browse files

Update ibm_storage.cc

parent 1be288da
Pipeline #40254 passed with stage
in 2 minutes and 2 seconds
...@@ -28,6 +28,7 @@ std::string SUBPROJECT(""); ...@@ -28,6 +28,7 @@ std::string SUBPROJECT("");
std::string DATASET(""); std::string DATASET("");
std::string BUCKET(""); std::string BUCKET("");
std::string FOLDER(""); std::string FOLDER("");
std::string COSURL("");
inline void line() inline void line()
{ {
...@@ -153,10 +154,11 @@ int main(int /*argc*/, char */*argv*/[]) ...@@ -153,10 +154,11 @@ int main(int /*argc*/, char */*argv*/[])
const char *dataset = getenv("DATASET"); const char *dataset = getenv("DATASET");
const char *bucket = getenv("BUCKET"); const char *bucket = getenv("BUCKET");
const char *folder = getenv("FOLDER"); const char *folder = getenv("FOLDER");
const char *cosurl = getenv("IBM_COS_URL");
std::cout << "Before if" ; std::cout << "Before if" ;
if (sdurl == nullptr || sdapikey == nullptr || token == nullptr || if (sdurl == nullptr || sdapikey == nullptr || token == nullptr ||
tenant == nullptr || subproject == nullptr || dataset == nullptr) tenant == nullptr || subproject == nullptr || dataset == nullptr || cosurl == nullptr)
{ {
std::cout << "--------------------------------------------------" << std::endl; std::cout << "--------------------------------------------------" << std::endl;
std::cout << "- Missing environment variables: " << std::endl; std::cout << "- Missing environment variables: " << std::endl;
...@@ -166,6 +168,7 @@ int main(int /*argc*/, char */*argv*/[]) ...@@ -166,6 +168,7 @@ int main(int /*argc*/, char */*argv*/[])
std::cout << "- TENANT" << std::endl; std::cout << "- TENANT" << std::endl;
std::cout << "- SUBPROJECT" << std::endl; std::cout << "- SUBPROJECT" << std::endl;
std::cout << "- DATASET" << std::endl; std::cout << "- DATASET" << std::endl;
std::cout << "- IBM_COS_URL" << std::endl;
std::cout << "--------------------------------------------------" << std::endl; std::cout << "--------------------------------------------------" << std::endl;
exit(1); exit(1);
} }
...@@ -178,6 +181,8 @@ int main(int /*argc*/, char */*argv*/[]) ...@@ -178,6 +181,8 @@ int main(int /*argc*/, char */*argv*/[])
DATASET = dataset; DATASET = dataset;
BUCKET = bucket; BUCKET = bucket;
FOLDER = folder; FOLDER = folder;
COSURL = cosurl;
DirectAuthProvider auth(SDURL, SDAPIKEY, TOKEN); DirectAuthProvider auth(SDURL, SDAPIKEY, TOKEN);
std::string sdresource = "sd://" + TENANT + "/" + SUBPROJECT + "/" + DATASET; std::string sdresource = "sd://" + TENANT + "/" + SUBPROJECT + "/" + DATASET;
...@@ -211,7 +216,7 @@ int main(int /*argc*/, char */*argv*/[]) ...@@ -211,7 +216,7 @@ int main(int /*argc*/, char */*argv*/[])
// Test Single Object Methods // Test Single Object Methods
// -------------------------- // --------------------------
// line(); std::cout<<"TEST SINGLE OBJECT METHODS\n"; line(); std::cout<<"TEST SINGLE OBJECT METHODS\n";
line(); upload(&accessor, objs, data); line(); upload(&accessor, objs, data);
line(); exist(&accessor, objs, true); line(); exist(&accessor, objs, true);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment