diff --git a/src/DATA/TOOLS/GetGranules.c b/src/DATA/TOOLS/GetGranules.c
index ba2ec42..a846cce 100644
--- a/src/DATA/TOOLS/GetGranules.c
+++ b/src/DATA/TOOLS/GetGranules.c
@@ -4,7 +4,7 @@
*
* @details GetGranules(string *)
* @arg \c argv[1] Path to VI
-* @arg \c argv[2] Prefix
+* @arg \c argv[2] Times file name
*
*/
@@ -32,7 +32,7 @@ int main(int argc, char *argv[])
int status;
if (argc < 3){
- fprintf(stderr,"Usage: GetGranules path_to_vi prefix\n");
+ fprintf(stderr,"Usage: GetGranules path_to_vi times_file_name\n");
exit(1);
}
@@ -41,7 +41,6 @@ int main(int argc, char *argv[])
strcat(timesPath, argv[1]);
strcat(timesPath, "/");
strcat(timesPath, argv[2]);
- strcat(timesPath, "_times.nc");
// Open VI_times.nc
int DataID;
diff --git a/src/DDSERVICES/REST/getGranules.php b/src/DDSERVICES/REST/getGranules.php
new file mode 100644
index 0000000..4069dd5
--- /dev/null
+++ b/src/DDSERVICES/REST/getGranules.php
@@ -0,0 +1,35 @@
+ "_");
+
+ $dataSet = strtr($_GET['id'], $replace);
+
+ $referXML = baseDir."/DDsys.xml";
+ $DDsys = new DOMDocument("1.0");
+ $DDsys->load($referXML);
+ $xp = new domxpath($DDsys);
+ $VI = $xp->query("//NAME[.='".$dataSet."']");
+
+ if ($VI->item(0)->nodeValue != NULL)
+ {
+ $location = $VI->item(0)->parentNode->getElementsByTagName("LOCATION")->item(0)->nodeValue;
+ $times = $VI->item(0)->parentNode->getElementsByTagName("TIMES")->item(0)->nodeValue;
+ $cmd = "/opt/tools/DDServer/bin/GetGranules ".$location." ".$times;
+ exec($cmd, $output, $result_code);
+ if ($result_code === 0)
+ exit(implode("\n",$output));
+ }
+ exit('ERROR');
+?>
diff --git a/src/DDSERVICES/SOAP/DDserverWeb.php b/src/DDSERVICES/SOAP/DDserverWeb.php
index f4dc4b0..a01c910 100644
--- a/src/DDSERVICES/SOAP/DDserverWeb.php
+++ b/src/DDSERVICES/SOAP/DDserverWeb.php
@@ -492,6 +492,26 @@
return null;
}
+
+ function getGranules($dataset)
+ {
+ $referXML = baseDir."/DDsys.xml";
+ $DDsys = new DOMDocument("1.0");
+ $DDsys->load($referXML);
+ $xp = new domxpath($DDsys);
+ $VI = $xp->query("//NAME[.='".$dataSet."']");
+
+ if ($VI->item(0)->nodeValue != NULL)
+ {
+ $location = $VI->item(0)->parentNode->getElementsByTagName("LOCATION")->item(0)->nodeValue;
+ $times = $VI->item(0)->parentNode->getElementsByTagName("TIMES")->item(0)->nodeValue;
+ $cmd = "/opt/tools/DDServer/bin/GetGranules ".$location." ".$times;
+ exec($cmd, $output, $result_code);
+ if ($result_code === 0)
+ return implode("\n",$output);
+ }
+ return NULL;
+ }
/**
* Returns String Start-Stop for local DataSet in DD Base
diff --git a/src/DDSERVICES/SOAP/dd.wsdl.in b/src/DDSERVICES/SOAP/dd.wsdl.in
index 3bbae57..483a5c1 100644
--- a/src/DDSERVICES/SOAP/dd.wsdl.in
+++ b/src/DDSERVICES/SOAP/dd.wsdl.in
@@ -86,6 +86,12 @@
+
+
+
+
+
+
@@ -193,6 +199,10 @@
+
+
+
+
@@ -316,7 +326,18 @@
-
+
+
+
+
+
+
+
+
--
libgit2 0.21.2