You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2016/12/13 19:55:25 UTC
[1/6] airavata git commit: AIRAVATA-1792 Filter stats by username,
app name, hostname
Repository: airavata
Updated Branches:
refs/heads/develop 9eede35ba -> a42ccd728
AIRAVATA-1792 Filter stats by username, app name, hostname
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/465f766e
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/465f766e
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/465f766e
Branch: refs/heads/develop
Commit: 465f766e3555f7287e4593ea67cd50b4312d0bbd
Parents: 84f756d
Author: Marcus Christie <ma...@iu.edu>
Authored: Mon Dec 12 14:06:53 2016 -0500
Committer: Marcus Christie <ma...@iu.edu>
Committed: Mon Dec 12 14:06:53 2016 -0500
----------------------------------------------------------------------
.../server/handler/AiravataServerHandler.java | 5 +-
.../java/org/apache/airavata/api/Airavata.java | 357 ++++++++++++++++++-
.../resources/lib/Airavata/API/Airavata.php | 84 ++++-
.../catalog/impl/ExperimentRegistry.java | 5 +-
.../catalog/resources/WorkerResource.java | 37 +-
.../airavata/registry/cpi/utils/Constants.java | 1 +
.../service/handler/RegistryServerHandler.java | 11 +-
.../airavata/registry/api/RegistryService.java | 357 ++++++++++++++++++-
.../airavata-apis/airavata_api.thrift | 6 +-
.../component-cpis/registry-api.thrift | 6 +-
10 files changed, 822 insertions(+), 47 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/465f766e/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index 10d2217..89be995 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -940,10 +940,11 @@ public class AiravataServerHandler implements Airavata.Iface {
*/
@Override
@SecurityCheck
- public ExperimentStatistics getExperimentStatistics(AuthzToken authzToken, String gatewayId, long fromTime, long toTime)
+ public ExperimentStatistics getExperimentStatistics(AuthzToken authzToken, String gatewayId, long fromTime, long toTime,
+ String userName, String applicationName, String resourceHostName)
throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
try {
- return getRegistryServiceClient().getExperimentStatistics(gatewayId, fromTime, toTime);
+ return getRegistryServiceClient().getExperimentStatistics(gatewayId, fromTime, toTime, userName, applicationName, resourceHostName);
}catch (Exception e) {
logger.error("Error while retrieving experiments", e);
AiravataSystemException exception = new AiravataSystemException();
http://git-wip-us.apache.org/repos/asf/airavata/blob/465f766e/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java b/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
index 78d2810..c997dfa 100644
--- a/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
+++ b/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
@@ -556,8 +556,11 @@ public class Airavata {
* @param gatewayId
* @param fromTime
* @param toTime
+ * @param userName
+ * @param applicationName
+ * @param resourceHostName
*/
- public org.apache.airavata.model.experiment.ExperimentStatistics getExperimentStatistics(org.apache.airavata.model.security.AuthzToken authzToken, String gatewayId, long fromTime, long toTime) throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException;
+ public org.apache.airavata.model.experiment.ExperimentStatistics getExperimentStatistics(org.apache.airavata.model.security.AuthzToken authzToken, String gatewayId, long fromTime, long toTime, String userName, String applicationName, String resourceHostName) throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException;
/**
*
@@ -3065,7 +3068,7 @@ public class Airavata {
public void searchExperiments(org.apache.airavata.model.security.AuthzToken authzToken, String gatewayId, String userName, Map<org.apache.airavata.model.experiment.ExperimentSearchFields,String> filters, int limit, int offset, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
- public void getExperimentStatistics(org.apache.airavata.model.security.AuthzToken authzToken, String gatewayId, long fromTime, long toTime, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void getExperimentStatistics(org.apache.airavata.model.security.AuthzToken authzToken, String gatewayId, long fromTime, long toTime, String userName, String applicationName, String resourceHostName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void getExperimentsInProject(org.apache.airavata.model.security.AuthzToken authzToken, String projectId, int limit, int offset, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
@@ -4450,19 +4453,22 @@ public class Airavata {
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "searchExperiments failed: unknown result");
}
- public org.apache.airavata.model.experiment.ExperimentStatistics getExperimentStatistics(org.apache.airavata.model.security.AuthzToken authzToken, String gatewayId, long fromTime, long toTime) throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException
+ public org.apache.airavata.model.experiment.ExperimentStatistics getExperimentStatistics(org.apache.airavata.model.security.AuthzToken authzToken, String gatewayId, long fromTime, long toTime, String userName, String applicationName, String resourceHostName) throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException
{
- send_getExperimentStatistics(authzToken, gatewayId, fromTime, toTime);
+ send_getExperimentStatistics(authzToken, gatewayId, fromTime, toTime, userName, applicationName, resourceHostName);
return recv_getExperimentStatistics();
}
- public void send_getExperimentStatistics(org.apache.airavata.model.security.AuthzToken authzToken, String gatewayId, long fromTime, long toTime) throws org.apache.thrift.TException
+ public void send_getExperimentStatistics(org.apache.airavata.model.security.AuthzToken authzToken, String gatewayId, long fromTime, long toTime, String userName, String applicationName, String resourceHostName) throws org.apache.thrift.TException
{
getExperimentStatistics_args args = new getExperimentStatistics_args();
args.setAuthzToken(authzToken);
args.setGatewayId(gatewayId);
args.setFromTime(fromTime);
args.setToTime(toTime);
+ args.setUserName(userName);
+ args.setApplicationName(applicationName);
+ args.setResourceHostName(resourceHostName);
sendBase("getExperimentStatistics", args);
}
@@ -10721,9 +10727,9 @@ public class Airavata {
}
}
- public void getExperimentStatistics(org.apache.airavata.model.security.AuthzToken authzToken, String gatewayId, long fromTime, long toTime, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ public void getExperimentStatistics(org.apache.airavata.model.security.AuthzToken authzToken, String gatewayId, long fromTime, long toTime, String userName, String applicationName, String resourceHostName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
- getExperimentStatistics_call method_call = new getExperimentStatistics_call(authzToken, gatewayId, fromTime, toTime, resultHandler, this, ___protocolFactory, ___transport);
+ getExperimentStatistics_call method_call = new getExperimentStatistics_call(authzToken, gatewayId, fromTime, toTime, userName, applicationName, resourceHostName, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
@@ -10733,12 +10739,18 @@ public class Airavata {
private String gatewayId;
private long fromTime;
private long toTime;
- public getExperimentStatistics_call(org.apache.airavata.model.security.AuthzToken authzToken, String gatewayId, long fromTime, long toTime, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ private String userName;
+ private String applicationName;
+ private String resourceHostName;
+ public getExperimentStatistics_call(org.apache.airavata.model.security.AuthzToken authzToken, String gatewayId, long fromTime, long toTime, String userName, String applicationName, String resourceHostName, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.authzToken = authzToken;
this.gatewayId = gatewayId;
this.fromTime = fromTime;
this.toTime = toTime;
+ this.userName = userName;
+ this.applicationName = applicationName;
+ this.resourceHostName = resourceHostName;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
@@ -10748,6 +10760,9 @@ public class Airavata {
args.setGatewayId(gatewayId);
args.setFromTime(fromTime);
args.setToTime(toTime);
+ args.setUserName(userName);
+ args.setApplicationName(applicationName);
+ args.setResourceHostName(resourceHostName);
args.write(prot);
prot.writeMessageEnd();
}
@@ -17011,7 +17026,7 @@ public class Airavata {
public getExperimentStatistics_result getResult(I iface, getExperimentStatistics_args args) throws org.apache.thrift.TException {
getExperimentStatistics_result result = new getExperimentStatistics_result();
try {
- result.success = iface.getExperimentStatistics(args.authzToken, args.gatewayId, args.fromTime, args.toTime);
+ result.success = iface.getExperimentStatistics(args.authzToken, args.gatewayId, args.fromTime, args.toTime, args.userName, args.applicationName, args.resourceHostName);
} catch (org.apache.airavata.model.error.InvalidRequestException ire) {
result.ire = ire;
} catch (org.apache.airavata.model.error.AiravataClientException ace) {
@@ -23629,7 +23644,7 @@ public class Airavata {
}
public void start(I iface, getExperimentStatistics_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.model.experiment.ExperimentStatistics> resultHandler) throws TException {
- iface.getExperimentStatistics(args.authzToken, args.gatewayId, args.fromTime, args.toTime,resultHandler);
+ iface.getExperimentStatistics(args.authzToken, args.gatewayId, args.fromTime, args.toTime, args.userName, args.applicationName, args.resourceHostName,resultHandler);
}
}
@@ -73751,6 +73766,9 @@ public class Airavata {
private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField FROM_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("fromTime", org.apache.thrift.protocol.TType.I64, (short)3);
private static final org.apache.thrift.protocol.TField TO_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("toTime", org.apache.thrift.protocol.TType.I64, (short)4);
+ private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)5);
+ private static final org.apache.thrift.protocol.TField APPLICATION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("applicationName", org.apache.thrift.protocol.TType.STRING, (short)6);
+ private static final org.apache.thrift.protocol.TField RESOURCE_HOST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("resourceHostName", org.apache.thrift.protocol.TType.STRING, (short)7);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -73762,13 +73780,19 @@ public class Airavata {
public String gatewayId; // required
public long fromTime; // required
public long toTime; // required
+ public String userName; // required
+ public String applicationName; // required
+ public String resourceHostName; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
AUTHZ_TOKEN((short)1, "authzToken"),
GATEWAY_ID((short)2, "gatewayId"),
FROM_TIME((short)3, "fromTime"),
- TO_TIME((short)4, "toTime");
+ TO_TIME((short)4, "toTime"),
+ USER_NAME((short)5, "userName"),
+ APPLICATION_NAME((short)6, "applicationName"),
+ RESOURCE_HOST_NAME((short)7, "resourceHostName");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -73791,6 +73815,12 @@ public class Airavata {
return FROM_TIME;
case 4: // TO_TIME
return TO_TIME;
+ case 5: // USER_NAME
+ return USER_NAME;
+ case 6: // APPLICATION_NAME
+ return APPLICATION_NAME;
+ case 7: // RESOURCE_HOST_NAME
+ return RESOURCE_HOST_NAME;
default:
return null;
}
@@ -73845,6 +73875,12 @@ public class Airavata {
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.TO_TIME, new org.apache.thrift.meta_data.FieldMetaData("toTime", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+ tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.APPLICATION_NAME, new org.apache.thrift.meta_data.FieldMetaData("applicationName", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.RESOURCE_HOST_NAME, new org.apache.thrift.meta_data.FieldMetaData("resourceHostName", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getExperimentStatistics_args.class, metaDataMap);
}
@@ -73856,7 +73892,10 @@ public class Airavata {
org.apache.airavata.model.security.AuthzToken authzToken,
String gatewayId,
long fromTime,
- long toTime)
+ long toTime,
+ String userName,
+ String applicationName,
+ String resourceHostName)
{
this();
this.authzToken = authzToken;
@@ -73865,6 +73904,9 @@ public class Airavata {
setFromTimeIsSet(true);
this.toTime = toTime;
setToTimeIsSet(true);
+ this.userName = userName;
+ this.applicationName = applicationName;
+ this.resourceHostName = resourceHostName;
}
/**
@@ -73880,6 +73922,15 @@ public class Airavata {
}
this.fromTime = other.fromTime;
this.toTime = other.toTime;
+ if (other.isSetUserName()) {
+ this.userName = other.userName;
+ }
+ if (other.isSetApplicationName()) {
+ this.applicationName = other.applicationName;
+ }
+ if (other.isSetResourceHostName()) {
+ this.resourceHostName = other.resourceHostName;
+ }
}
public getExperimentStatistics_args deepCopy() {
@@ -73894,6 +73945,9 @@ public class Airavata {
this.fromTime = 0;
setToTimeIsSet(false);
this.toTime = 0;
+ this.userName = null;
+ this.applicationName = null;
+ this.resourceHostName = null;
}
public org.apache.airavata.model.security.AuthzToken getAuthzToken() {
@@ -73990,6 +74044,78 @@ public class Airavata {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TOTIME_ISSET_ID, value);
}
+ public String getUserName() {
+ return this.userName;
+ }
+
+ public getExperimentStatistics_args setUserName(String userName) {
+ this.userName = userName;
+ return this;
+ }
+
+ public void unsetUserName() {
+ this.userName = null;
+ }
+
+ /** Returns true if field userName is set (has been assigned a value) and false otherwise */
+ public boolean isSetUserName() {
+ return this.userName != null;
+ }
+
+ public void setUserNameIsSet(boolean value) {
+ if (!value) {
+ this.userName = null;
+ }
+ }
+
+ public String getApplicationName() {
+ return this.applicationName;
+ }
+
+ public getExperimentStatistics_args setApplicationName(String applicationName) {
+ this.applicationName = applicationName;
+ return this;
+ }
+
+ public void unsetApplicationName() {
+ this.applicationName = null;
+ }
+
+ /** Returns true if field applicationName is set (has been assigned a value) and false otherwise */
+ public boolean isSetApplicationName() {
+ return this.applicationName != null;
+ }
+
+ public void setApplicationNameIsSet(boolean value) {
+ if (!value) {
+ this.applicationName = null;
+ }
+ }
+
+ public String getResourceHostName() {
+ return this.resourceHostName;
+ }
+
+ public getExperimentStatistics_args setResourceHostName(String resourceHostName) {
+ this.resourceHostName = resourceHostName;
+ return this;
+ }
+
+ public void unsetResourceHostName() {
+ this.resourceHostName = null;
+ }
+
+ /** Returns true if field resourceHostName is set (has been assigned a value) and false otherwise */
+ public boolean isSetResourceHostName() {
+ return this.resourceHostName != null;
+ }
+
+ public void setResourceHostNameIsSet(boolean value) {
+ if (!value) {
+ this.resourceHostName = null;
+ }
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case AUTHZ_TOKEN:
@@ -74024,6 +74150,30 @@ public class Airavata {
}
break;
+ case USER_NAME:
+ if (value == null) {
+ unsetUserName();
+ } else {
+ setUserName((String)value);
+ }
+ break;
+
+ case APPLICATION_NAME:
+ if (value == null) {
+ unsetApplicationName();
+ } else {
+ setApplicationName((String)value);
+ }
+ break;
+
+ case RESOURCE_HOST_NAME:
+ if (value == null) {
+ unsetResourceHostName();
+ } else {
+ setResourceHostName((String)value);
+ }
+ break;
+
}
}
@@ -74041,6 +74191,15 @@ public class Airavata {
case TO_TIME:
return getToTime();
+ case USER_NAME:
+ return getUserName();
+
+ case APPLICATION_NAME:
+ return getApplicationName();
+
+ case RESOURCE_HOST_NAME:
+ return getResourceHostName();
+
}
throw new IllegalStateException();
}
@@ -74060,6 +74219,12 @@ public class Airavata {
return isSetFromTime();
case TO_TIME:
return isSetToTime();
+ case USER_NAME:
+ return isSetUserName();
+ case APPLICATION_NAME:
+ return isSetApplicationName();
+ case RESOURCE_HOST_NAME:
+ return isSetResourceHostName();
}
throw new IllegalStateException();
}
@@ -74113,6 +74278,33 @@ public class Airavata {
return false;
}
+ boolean this_present_userName = true && this.isSetUserName();
+ boolean that_present_userName = true && that.isSetUserName();
+ if (this_present_userName || that_present_userName) {
+ if (!(this_present_userName && that_present_userName))
+ return false;
+ if (!this.userName.equals(that.userName))
+ return false;
+ }
+
+ boolean this_present_applicationName = true && this.isSetApplicationName();
+ boolean that_present_applicationName = true && that.isSetApplicationName();
+ if (this_present_applicationName || that_present_applicationName) {
+ if (!(this_present_applicationName && that_present_applicationName))
+ return false;
+ if (!this.applicationName.equals(that.applicationName))
+ return false;
+ }
+
+ boolean this_present_resourceHostName = true && this.isSetResourceHostName();
+ boolean that_present_resourceHostName = true && that.isSetResourceHostName();
+ if (this_present_resourceHostName || that_present_resourceHostName) {
+ if (!(this_present_resourceHostName && that_present_resourceHostName))
+ return false;
+ if (!this.resourceHostName.equals(that.resourceHostName))
+ return false;
+ }
+
return true;
}
@@ -74140,6 +74332,21 @@ public class Airavata {
if (present_toTime)
list.add(toTime);
+ boolean present_userName = true && (isSetUserName());
+ list.add(present_userName);
+ if (present_userName)
+ list.add(userName);
+
+ boolean present_applicationName = true && (isSetApplicationName());
+ list.add(present_applicationName);
+ if (present_applicationName)
+ list.add(applicationName);
+
+ boolean present_resourceHostName = true && (isSetResourceHostName());
+ list.add(present_resourceHostName);
+ if (present_resourceHostName)
+ list.add(resourceHostName);
+
return list.hashCode();
}
@@ -74191,6 +74398,36 @@ public class Airavata {
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetUserName()).compareTo(other.isSetUserName());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetUserName()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userName, other.userName);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetApplicationName()).compareTo(other.isSetApplicationName());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetApplicationName()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.applicationName, other.applicationName);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetResourceHostName()).compareTo(other.isSetResourceHostName());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetResourceHostName()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.resourceHostName, other.resourceHostName);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
@@ -74234,6 +74471,30 @@ public class Airavata {
sb.append("toTime:");
sb.append(this.toTime);
first = false;
+ if (!first) sb.append(", ");
+ sb.append("userName:");
+ if (this.userName == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.userName);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("applicationName:");
+ if (this.applicationName == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.applicationName);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("resourceHostName:");
+ if (this.resourceHostName == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.resourceHostName);
+ }
+ first = false;
sb.append(")");
return sb.toString();
}
@@ -74323,6 +74584,30 @@ public class Airavata {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case 5: // USER_NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.userName = iprot.readString();
+ struct.setUserNameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 6: // APPLICATION_NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.applicationName = iprot.readString();
+ struct.setApplicationNameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 7: // RESOURCE_HOST_NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.resourceHostName = iprot.readString();
+ struct.setResourceHostNameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -74360,6 +74645,21 @@ public class Airavata {
oprot.writeFieldBegin(TO_TIME_FIELD_DESC);
oprot.writeI64(struct.toTime);
oprot.writeFieldEnd();
+ if (struct.userName != null) {
+ oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
+ oprot.writeString(struct.userName);
+ oprot.writeFieldEnd();
+ }
+ if (struct.applicationName != null) {
+ oprot.writeFieldBegin(APPLICATION_NAME_FIELD_DESC);
+ oprot.writeString(struct.applicationName);
+ oprot.writeFieldEnd();
+ }
+ if (struct.resourceHostName != null) {
+ oprot.writeFieldBegin(RESOURCE_HOST_NAME_FIELD_DESC);
+ oprot.writeString(struct.resourceHostName);
+ oprot.writeFieldEnd();
+ }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@@ -74381,6 +74681,26 @@ public class Airavata {
oprot.writeString(struct.gatewayId);
oprot.writeI64(struct.fromTime);
oprot.writeI64(struct.toTime);
+ BitSet optionals = new BitSet();
+ if (struct.isSetUserName()) {
+ optionals.set(0);
+ }
+ if (struct.isSetApplicationName()) {
+ optionals.set(1);
+ }
+ if (struct.isSetResourceHostName()) {
+ optionals.set(2);
+ }
+ oprot.writeBitSet(optionals, 3);
+ if (struct.isSetUserName()) {
+ oprot.writeString(struct.userName);
+ }
+ if (struct.isSetApplicationName()) {
+ oprot.writeString(struct.applicationName);
+ }
+ if (struct.isSetResourceHostName()) {
+ oprot.writeString(struct.resourceHostName);
+ }
}
@Override
@@ -74395,6 +74715,19 @@ public class Airavata {
struct.setFromTimeIsSet(true);
struct.toTime = iprot.readI64();
struct.setToTimeIsSet(true);
+ BitSet incoming = iprot.readBitSet(3);
+ if (incoming.get(0)) {
+ struct.userName = iprot.readString();
+ struct.setUserNameIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.applicationName = iprot.readString();
+ struct.setApplicationNameIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.resourceHostName = iprot.readString();
+ struct.setResourceHostNameIsSet(true);
+ }
}
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/465f766e/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
index f235e48..cc90cc6 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
@@ -651,19 +651,23 @@ interface AiravataIf {
* @param toTime
* Ending data time.
*
+ * TODO update docs
*
*
* @param \Airavata\Model\Security\AuthzToken $authzToken
* @param string $gatewayId
* @param int $fromTime
* @param int $toTime
+ * @param string $userName
+ * @param string $applicationName
+ * @param string $resourceHostName
* @return \Airavata\Model\Experiment\ExperimentStatistics
* @throws \Airavata\API\Error\InvalidRequestException
* @throws \Airavata\API\Error\AiravataClientException
* @throws \Airavata\API\Error\AiravataSystemException
* @throws \Airavata\API\Error\AuthorizationException
*/
- public function getExperimentStatistics(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId, $fromTime, $toTime);
+ public function getExperimentStatistics(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId, $fromTime, $toTime, $userName, $applicationName, $resourceHostName);
/**
*
* Get All Experiments of the Project
@@ -6013,19 +6017,22 @@ class AiravataClient implements \Airavata\API\AiravataIf {
throw new \Exception("searchExperiments failed: unknown result");
}
- public function getExperimentStatistics(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId, $fromTime, $toTime)
+ public function getExperimentStatistics(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId, $fromTime, $toTime, $userName, $applicationName, $resourceHostName)
{
- $this->send_getExperimentStatistics($authzToken, $gatewayId, $fromTime, $toTime);
+ $this->send_getExperimentStatistics($authzToken, $gatewayId, $fromTime, $toTime, $userName, $applicationName, $resourceHostName);
return $this->recv_getExperimentStatistics();
}
- public function send_getExperimentStatistics(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId, $fromTime, $toTime)
+ public function send_getExperimentStatistics(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId, $fromTime, $toTime, $userName, $applicationName, $resourceHostName)
{
$args = new \Airavata\API\Airavata_getExperimentStatistics_args();
$args->authzToken = $authzToken;
$args->gatewayId = $gatewayId;
$args->fromTime = $fromTime;
$args->toTime = $toTime;
+ $args->userName = $userName;
+ $args->applicationName = $applicationName;
+ $args->resourceHostName = $resourceHostName;
$bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
if ($bin_accel)
{
@@ -24221,6 +24228,18 @@ class Airavata_getExperimentStatistics_args {
* @var int
*/
public $toTime = null;
+ /**
+ * @var string
+ */
+ public $userName = null;
+ /**
+ * @var string
+ */
+ public $applicationName = null;
+ /**
+ * @var string
+ */
+ public $resourceHostName = null;
public function __construct($vals=null) {
if (!isset(self::$_TSPEC)) {
@@ -24242,6 +24261,18 @@ class Airavata_getExperimentStatistics_args {
'var' => 'toTime',
'type' => TType::I64,
),
+ 5 => array(
+ 'var' => 'userName',
+ 'type' => TType::STRING,
+ ),
+ 6 => array(
+ 'var' => 'applicationName',
+ 'type' => TType::STRING,
+ ),
+ 7 => array(
+ 'var' => 'resourceHostName',
+ 'type' => TType::STRING,
+ ),
);
}
if (is_array($vals)) {
@@ -24257,6 +24288,15 @@ class Airavata_getExperimentStatistics_args {
if (isset($vals['toTime'])) {
$this->toTime = $vals['toTime'];
}
+ if (isset($vals['userName'])) {
+ $this->userName = $vals['userName'];
+ }
+ if (isset($vals['applicationName'])) {
+ $this->applicationName = $vals['applicationName'];
+ }
+ if (isset($vals['resourceHostName'])) {
+ $this->resourceHostName = $vals['resourceHostName'];
+ }
}
}
@@ -24308,6 +24348,27 @@ class Airavata_getExperimentStatistics_args {
$xfer += $input->skip($ftype);
}
break;
+ case 5:
+ if ($ftype == TType::STRING) {
+ $xfer += $input->readString($this->userName);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 6:
+ if ($ftype == TType::STRING) {
+ $xfer += $input->readString($this->applicationName);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 7:
+ if ($ftype == TType::STRING) {
+ $xfer += $input->readString($this->resourceHostName);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
default:
$xfer += $input->skip($ftype);
break;
@@ -24344,6 +24405,21 @@ class Airavata_getExperimentStatistics_args {
$xfer += $output->writeI64($this->toTime);
$xfer += $output->writeFieldEnd();
}
+ if ($this->userName !== null) {
+ $xfer += $output->writeFieldBegin('userName', TType::STRING, 5);
+ $xfer += $output->writeString($this->userName);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->applicationName !== null) {
+ $xfer += $output->writeFieldBegin('applicationName', TType::STRING, 6);
+ $xfer += $output->writeString($this->applicationName);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->resourceHostName !== null) {
+ $xfer += $output->writeFieldBegin('resourceHostName', TType::STRING, 7);
+ $xfer += $output->writeString($this->resourceHostName);
+ $xfer += $output->writeFieldEnd();
+ }
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
http://git-wip-us.apache.org/repos/asf/airavata/blob/465f766e/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
index 9b8ab09..0301399 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
@@ -1444,7 +1444,10 @@ public class ExperimentRegistry {
ExperimentStatisticsResource experimentStatisticsResource = workerResource.getExperimentStatistics(
filters.get(Constants.FieldConstants.ExperimentConstants.GATEWAY_ID),
new Timestamp(Long.parseLong(filters.get(Constants.FieldConstants.ExperimentConstants.FROM_DATE))),
- new Timestamp(Long.parseLong(filters.get(Constants.FieldConstants.ExperimentConstants.TO_DATE)))
+ new Timestamp(Long.parseLong(filters.get(Constants.FieldConstants.ExperimentConstants.TO_DATE))),
+ filters.get(Constants.FieldConstants.ExperimentConstants.USER_NAME),
+ filters.get(Constants.FieldConstants.ExperimentConstants.EXECUTION_ID),
+ filters.get(Constants.FieldConstants.ExperimentConstants.RESOURCE_HOST_ID)
);
experimentStatistics.setAllExperimentCount(experimentStatisticsResource.getAllExperimentCount());
http://git-wip-us.apache.org/repos/asf/airavata/blob/465f766e/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java
index 16f28e1..50ca874 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java
@@ -37,6 +37,7 @@ import javax.persistence.EntityManager;
import javax.persistence.Query;
import java.sql.Timestamp;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -696,33 +697,33 @@ public class WorkerResource extends AbstractExpCatResource {
* @return
* @throws org.apache.airavata.registry.cpi.RegistryException
*/
- public ExperimentStatisticsResource getExperimentStatistics(String gatewayId, Timestamp fromTime, Timestamp toTime) throws RegistryException {
+ public ExperimentStatisticsResource getExperimentStatistics(String gatewayId, Timestamp fromTime, Timestamp toTime, String userName, String applicationName, String resourceHostName) throws RegistryException {
ExperimentStatisticsResource experimentStatisticsResource = new ExperimentStatisticsResource();
- List<ExperimentSummaryResource> allExperiments = getExperimentStatisticsForState(null, gatewayId, fromTime, toTime);
+ List<ExperimentSummaryResource> allExperiments = getExperimentStatisticsForState(null, gatewayId, fromTime, toTime, userName, applicationName, resourceHostName);
experimentStatisticsResource.setAllExperimentCount(allExperiments.size());
experimentStatisticsResource.setAllExperiments(allExperiments);
- List<ExperimentSummaryResource> createdExperiments = getExperimentStatisticsForState(ExperimentState.CREATED, gatewayId, fromTime, toTime);
- createdExperiments.addAll(getExperimentStatisticsForState(ExperimentState.VALIDATED, gatewayId, fromTime, toTime));
+ List<ExperimentSummaryResource> createdExperiments = getExperimentStatisticsForState(ExperimentState.CREATED, gatewayId, fromTime, toTime, userName, applicationName, resourceHostName);
+ createdExperiments.addAll(getExperimentStatisticsForState(ExperimentState.VALIDATED, gatewayId, fromTime, toTime, userName, applicationName, resourceHostName));
experimentStatisticsResource.setCreatedExperimentCount(createdExperiments.size());
experimentStatisticsResource.setCreatedExperiments(createdExperiments);
- List<ExperimentSummaryResource> runningExperiments = getExperimentStatisticsForState(ExperimentState.EXECUTING, gatewayId, fromTime, toTime);
- runningExperiments.addAll(getExperimentStatisticsForState(ExperimentState.SCHEDULED, gatewayId, fromTime, toTime));
- runningExperiments.addAll(getExperimentStatisticsForState(ExperimentState.LAUNCHED, gatewayId, fromTime, toTime));
+ List<ExperimentSummaryResource> runningExperiments = getExperimentStatisticsForState(ExperimentState.EXECUTING, gatewayId, fromTime, toTime, userName, applicationName, resourceHostName);
+ runningExperiments.addAll(getExperimentStatisticsForState(ExperimentState.SCHEDULED, gatewayId, fromTime, toTime, userName, applicationName, resourceHostName));
+ runningExperiments.addAll(getExperimentStatisticsForState(ExperimentState.LAUNCHED, gatewayId, fromTime, toTime, userName, applicationName, resourceHostName));
experimentStatisticsResource.setRunningExperimentCount(runningExperiments.size());
experimentStatisticsResource.setRunningExperiments(runningExperiments);
- List<ExperimentSummaryResource> completedExperiments = getExperimentStatisticsForState(ExperimentState.COMPLETED, gatewayId, fromTime, toTime);
+ List<ExperimentSummaryResource> completedExperiments = getExperimentStatisticsForState(ExperimentState.COMPLETED, gatewayId, fromTime, toTime, userName, applicationName, resourceHostName);
experimentStatisticsResource.setCompletedExperimentCount(completedExperiments.size());
experimentStatisticsResource.setCompletedExperiments(completedExperiments);
- List<ExperimentSummaryResource> failedExperiments = getExperimentStatisticsForState(ExperimentState.FAILED, gatewayId, fromTime, toTime);
+ List<ExperimentSummaryResource> failedExperiments = getExperimentStatisticsForState(ExperimentState.FAILED, gatewayId, fromTime, toTime, userName, applicationName, resourceHostName);
experimentStatisticsResource.setFailedExperimentCount(failedExperiments.size());
experimentStatisticsResource.setFailedExperiments(failedExperiments);
- List<ExperimentSummaryResource> cancelledExperiments = getExperimentStatisticsForState(ExperimentState.CANCELED, gatewayId, fromTime, toTime);
- cancelledExperiments.addAll(getExperimentStatisticsForState(ExperimentState.CANCELING, gatewayId, fromTime, toTime));
+ List<ExperimentSummaryResource> cancelledExperiments = getExperimentStatisticsForState(ExperimentState.CANCELED, gatewayId, fromTime, toTime, userName, applicationName, resourceHostName);
+ cancelledExperiments.addAll(getExperimentStatisticsForState(ExperimentState.CANCELING, gatewayId, fromTime, toTime, userName, applicationName, resourceHostName));
experimentStatisticsResource.setCancelledExperimentCount(cancelledExperiments.size());
experimentStatisticsResource.setCancelledExperiments(cancelledExperiments);
@@ -730,21 +731,31 @@ public class WorkerResource extends AbstractExpCatResource {
}
private List<ExperimentSummaryResource> getExperimentStatisticsForState(
- ExperimentState expState, String gatewayId, Timestamp fromTime, Timestamp toTime) throws RegistryException {
+ ExperimentState expState, String gatewayId, Timestamp fromTime, Timestamp toTime,
+ String userName, String applicationName, String resourceHostName) throws RegistryException {
EntityManager em = null;
List<ExperimentSummaryResource> result = new ArrayList();
try {
+ Map<String, Object> queryParameters = new HashMap<>();
String query = "SELECT e FROM ExperimentSummary e " +
"WHERE ";
if (expState != null) {
query += "e.state='" + expState.toString() + "' AND ";
}
query += "e.creationTime > '" + fromTime + "' " + "AND e.creationTime <'" + toTime + "' AND ";
- query += "e." + ExperimentConstants.GATEWAY_ID + "= '" + gatewayId + "' ORDER BY e.creationTime DESC";
+ query += "e." + ExperimentConstants.GATEWAY_ID + "= '" + gatewayId + "' ";
+ if (userName != null) {
+ query += "AND e.userName = :userName ";
+ queryParameters.put("userName", userName);
+ }
+ query += "ORDER BY e.creationTime DESC";
em = ExpCatResourceUtils.getEntityManager();
em.getTransaction().begin();
Query q = em.createQuery(query);
+ for (String parameterName : queryParameters.keySet()) {
+ q.setParameter(parameterName, queryParameters.get(parameterName));
+ }
List resultList = q.getResultList();
for (Object o : resultList) {
http://git-wip-us.apache.org/repos/asf/airavata/blob/465f766e/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/utils/Constants.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/utils/Constants.java b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/utils/Constants.java
index 581cdae..10bf408 100644
--- a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/utils/Constants.java
+++ b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/utils/Constants.java
@@ -52,6 +52,7 @@ public class Constants {
public static final String USER_CONFIGURATION_DATA = "userConfigurationData";
public static final String FROM_DATE = "fromDate";
public static final String TO_DATE = "toDate";
+ public static final String RESOURCE_HOST_ID = "resourceHostId";
}
public final class UserConfigurationDataConstants {
http://git-wip-us.apache.org/repos/asf/airavata/blob/465f766e/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
index 535b265..44a71a9 100644
--- a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
+++ b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
@@ -385,7 +385,7 @@ public class RegistryServerHandler implements RegistryService.Iface {
* @param toTime Ending data time.
*/
@Override
- public ExperimentStatistics getExperimentStatistics(String gatewayId, long fromTime, long toTime) throws RegistryServiceException, TException {
+ public ExperimentStatistics getExperimentStatistics(String gatewayId, long fromTime, long toTime, String userName, String applicationName, String resourceHostName) throws RegistryServiceException, TException {
if (!isGatewayExistInternal(gatewayId)){
logger.error("Gateway does not exist.Please provide a valid gateway id...");
throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
@@ -395,6 +395,15 @@ public class RegistryServerHandler implements RegistryService.Iface {
filters.put(Constants.FieldConstants.ExperimentConstants.GATEWAY_ID, gatewayId);
filters.put(Constants.FieldConstants.ExperimentConstants.FROM_DATE, fromTime+"");
filters.put(Constants.FieldConstants.ExperimentConstants.TO_DATE, toTime+"");
+ if (userName != null) {
+ filters.put(Constants.FieldConstants.ExperimentConstants.USER_NAME, userName);
+ }
+ if (applicationName != null) {
+ filters.put(Constants.FieldConstants.ExperimentConstants.EXECUTION_ID, applicationName);
+ }
+ if (resourceHostName != null) {
+ filters.put(Constants.FieldConstants.ExperimentConstants.RESOURCE_HOST_ID, resourceHostName);
+ }
List<Object> results = experimentCatalog.search(ExperimentCatalogModelType.EXPERIMENT_STATISTICS, filters);
logger.debug("Airavata retrieved experiments for gateway id : " + gatewayId + " between : " + AiravataUtils.getTime(fromTime) + " and " + AiravataUtils.getTime(toTime));
http://git-wip-us.apache.org/repos/asf/airavata/blob/465f766e/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java b/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java
index 9c4ad05..e5d6d4f 100644
--- a/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java
+++ b/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java
@@ -376,8 +376,11 @@ public class RegistryService {
* @param gatewayId
* @param fromTime
* @param toTime
+ * @param userName
+ * @param applicationName
+ * @param resourceHostName
*/
- public org.apache.airavata.model.experiment.ExperimentStatistics getExperimentStatistics(String gatewayId, long fromTime, long toTime) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+ public org.apache.airavata.model.experiment.ExperimentStatistics getExperimentStatistics(String gatewayId, long fromTime, long toTime, String userName, String applicationName, String resourceHostName) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
/**
*
@@ -2460,7 +2463,7 @@ public class RegistryService {
public void searchExperiments(String gatewayId, String userName, List<String> accessibleExpIds, Map<org.apache.airavata.model.experiment.ExperimentSearchFields,String> filters, int limit, int offset, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
- public void getExperimentStatistics(String gatewayId, long fromTime, long toTime, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void getExperimentStatistics(String gatewayId, long fromTime, long toTime, String userName, String applicationName, String resourceHostName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void getExperimentsInProject(String projectId, int limit, int offset, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
@@ -3292,18 +3295,21 @@ public class RegistryService {
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "searchExperiments failed: unknown result");
}
- public org.apache.airavata.model.experiment.ExperimentStatistics getExperimentStatistics(String gatewayId, long fromTime, long toTime) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException
+ public org.apache.airavata.model.experiment.ExperimentStatistics getExperimentStatistics(String gatewayId, long fromTime, long toTime, String userName, String applicationName, String resourceHostName) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException
{
- send_getExperimentStatistics(gatewayId, fromTime, toTime);
+ send_getExperimentStatistics(gatewayId, fromTime, toTime, userName, applicationName, resourceHostName);
return recv_getExperimentStatistics();
}
- public void send_getExperimentStatistics(String gatewayId, long fromTime, long toTime) throws org.apache.thrift.TException
+ public void send_getExperimentStatistics(String gatewayId, long fromTime, long toTime, String userName, String applicationName, String resourceHostName) throws org.apache.thrift.TException
{
getExperimentStatistics_args args = new getExperimentStatistics_args();
args.setGatewayId(gatewayId);
args.setFromTime(fromTime);
args.setToTime(toTime);
+ args.setUserName(userName);
+ args.setApplicationName(applicationName);
+ args.setResourceHostName(resourceHostName);
sendBase("getExperimentStatistics", args);
}
@@ -7357,9 +7363,9 @@ public class RegistryService {
}
}
- public void getExperimentStatistics(String gatewayId, long fromTime, long toTime, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ public void getExperimentStatistics(String gatewayId, long fromTime, long toTime, String userName, String applicationName, String resourceHostName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
- getExperimentStatistics_call method_call = new getExperimentStatistics_call(gatewayId, fromTime, toTime, resultHandler, this, ___protocolFactory, ___transport);
+ getExperimentStatistics_call method_call = new getExperimentStatistics_call(gatewayId, fromTime, toTime, userName, applicationName, resourceHostName, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
@@ -7368,11 +7374,17 @@ public class RegistryService {
private String gatewayId;
private long fromTime;
private long toTime;
- public getExperimentStatistics_call(String gatewayId, long fromTime, long toTime, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ private String userName;
+ private String applicationName;
+ private String resourceHostName;
+ public getExperimentStatistics_call(String gatewayId, long fromTime, long toTime, String userName, String applicationName, String resourceHostName, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.gatewayId = gatewayId;
this.fromTime = fromTime;
this.toTime = toTime;
+ this.userName = userName;
+ this.applicationName = applicationName;
+ this.resourceHostName = resourceHostName;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
@@ -7381,6 +7393,9 @@ public class RegistryService {
args.setGatewayId(gatewayId);
args.setFromTime(fromTime);
args.setToTime(toTime);
+ args.setUserName(userName);
+ args.setApplicationName(applicationName);
+ args.setResourceHostName(resourceHostName);
args.write(prot);
prot.writeMessageEnd();
}
@@ -12322,7 +12337,7 @@ public class RegistryService {
public getExperimentStatistics_result getResult(I iface, getExperimentStatistics_args args) throws org.apache.thrift.TException {
getExperimentStatistics_result result = new getExperimentStatistics_result();
try {
- result.success = iface.getExperimentStatistics(args.gatewayId, args.fromTime, args.toTime);
+ result.success = iface.getExperimentStatistics(args.gatewayId, args.fromTime, args.toTime, args.userName, args.applicationName, args.resourceHostName);
} catch (org.apache.airavata.registry.api.exception.RegistryServiceException rse) {
result.rse = rse;
}
@@ -16769,7 +16784,7 @@ public class RegistryService {
}
public void start(I iface, getExperimentStatistics_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.model.experiment.ExperimentStatistics> resultHandler) throws TException {
- iface.getExperimentStatistics(args.gatewayId, args.fromTime, args.toTime,resultHandler);
+ iface.getExperimentStatistics(args.gatewayId, args.fromTime, args.toTime, args.userName, args.applicationName, args.resourceHostName,resultHandler);
}
}
@@ -43336,6 +43351,9 @@ public class RegistryService {
private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField FROM_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("fromTime", org.apache.thrift.protocol.TType.I64, (short)2);
private static final org.apache.thrift.protocol.TField TO_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("toTime", org.apache.thrift.protocol.TType.I64, (short)3);
+ private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)4);
+ private static final org.apache.thrift.protocol.TField APPLICATION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("applicationName", org.apache.thrift.protocol.TType.STRING, (short)5);
+ private static final org.apache.thrift.protocol.TField RESOURCE_HOST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("resourceHostName", org.apache.thrift.protocol.TType.STRING, (short)6);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -43346,12 +43364,18 @@ public class RegistryService {
public String gatewayId; // required
public long fromTime; // required
public long toTime; // required
+ public String userName; // required
+ public String applicationName; // required
+ public String resourceHostName; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
GATEWAY_ID((short)1, "gatewayId"),
FROM_TIME((short)2, "fromTime"),
- TO_TIME((short)3, "toTime");
+ TO_TIME((short)3, "toTime"),
+ USER_NAME((short)4, "userName"),
+ APPLICATION_NAME((short)5, "applicationName"),
+ RESOURCE_HOST_NAME((short)6, "resourceHostName");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -43372,6 +43396,12 @@ public class RegistryService {
return FROM_TIME;
case 3: // TO_TIME
return TO_TIME;
+ case 4: // USER_NAME
+ return USER_NAME;
+ case 5: // APPLICATION_NAME
+ return APPLICATION_NAME;
+ case 6: // RESOURCE_HOST_NAME
+ return RESOURCE_HOST_NAME;
default:
return null;
}
@@ -43424,6 +43454,12 @@ public class RegistryService {
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.TO_TIME, new org.apache.thrift.meta_data.FieldMetaData("toTime", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+ tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.APPLICATION_NAME, new org.apache.thrift.meta_data.FieldMetaData("applicationName", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.RESOURCE_HOST_NAME, new org.apache.thrift.meta_data.FieldMetaData("resourceHostName", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getExperimentStatistics_args.class, metaDataMap);
}
@@ -43434,7 +43470,10 @@ public class RegistryService {
public getExperimentStatistics_args(
String gatewayId,
long fromTime,
- long toTime)
+ long toTime,
+ String userName,
+ String applicationName,
+ String resourceHostName)
{
this();
this.gatewayId = gatewayId;
@@ -43442,6 +43481,9 @@ public class RegistryService {
setFromTimeIsSet(true);
this.toTime = toTime;
setToTimeIsSet(true);
+ this.userName = userName;
+ this.applicationName = applicationName;
+ this.resourceHostName = resourceHostName;
}
/**
@@ -43454,6 +43496,15 @@ public class RegistryService {
}
this.fromTime = other.fromTime;
this.toTime = other.toTime;
+ if (other.isSetUserName()) {
+ this.userName = other.userName;
+ }
+ if (other.isSetApplicationName()) {
+ this.applicationName = other.applicationName;
+ }
+ if (other.isSetResourceHostName()) {
+ this.resourceHostName = other.resourceHostName;
+ }
}
public getExperimentStatistics_args deepCopy() {
@@ -43467,6 +43518,9 @@ public class RegistryService {
this.fromTime = 0;
setToTimeIsSet(false);
this.toTime = 0;
+ this.userName = null;
+ this.applicationName = null;
+ this.resourceHostName = null;
}
public String getGatewayId() {
@@ -43539,6 +43593,78 @@ public class RegistryService {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TOTIME_ISSET_ID, value);
}
+ public String getUserName() {
+ return this.userName;
+ }
+
+ public getExperimentStatistics_args setUserName(String userName) {
+ this.userName = userName;
+ return this;
+ }
+
+ public void unsetUserName() {
+ this.userName = null;
+ }
+
+ /** Returns true if field userName is set (has been assigned a value) and false otherwise */
+ public boolean isSetUserName() {
+ return this.userName != null;
+ }
+
+ public void setUserNameIsSet(boolean value) {
+ if (!value) {
+ this.userName = null;
+ }
+ }
+
+ public String getApplicationName() {
+ return this.applicationName;
+ }
+
+ public getExperimentStatistics_args setApplicationName(String applicationName) {
+ this.applicationName = applicationName;
+ return this;
+ }
+
+ public void unsetApplicationName() {
+ this.applicationName = null;
+ }
+
+ /** Returns true if field applicationName is set (has been assigned a value) and false otherwise */
+ public boolean isSetApplicationName() {
+ return this.applicationName != null;
+ }
+
+ public void setApplicationNameIsSet(boolean value) {
+ if (!value) {
+ this.applicationName = null;
+ }
+ }
+
+ public String getResourceHostName() {
+ return this.resourceHostName;
+ }
+
+ public getExperimentStatistics_args setResourceHostName(String resourceHostName) {
+ this.resourceHostName = resourceHostName;
+ return this;
+ }
+
+ public void unsetResourceHostName() {
+ this.resourceHostName = null;
+ }
+
+ /** Returns true if field resourceHostName is set (has been assigned a value) and false otherwise */
+ public boolean isSetResourceHostName() {
+ return this.resourceHostName != null;
+ }
+
+ public void setResourceHostNameIsSet(boolean value) {
+ if (!value) {
+ this.resourceHostName = null;
+ }
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case GATEWAY_ID:
@@ -43565,6 +43691,30 @@ public class RegistryService {
}
break;
+ case USER_NAME:
+ if (value == null) {
+ unsetUserName();
+ } else {
+ setUserName((String)value);
+ }
+ break;
+
+ case APPLICATION_NAME:
+ if (value == null) {
+ unsetApplicationName();
+ } else {
+ setApplicationName((String)value);
+ }
+ break;
+
+ case RESOURCE_HOST_NAME:
+ if (value == null) {
+ unsetResourceHostName();
+ } else {
+ setResourceHostName((String)value);
+ }
+ break;
+
}
}
@@ -43579,6 +43729,15 @@ public class RegistryService {
case TO_TIME:
return getToTime();
+ case USER_NAME:
+ return getUserName();
+
+ case APPLICATION_NAME:
+ return getApplicationName();
+
+ case RESOURCE_HOST_NAME:
+ return getResourceHostName();
+
}
throw new IllegalStateException();
}
@@ -43596,6 +43755,12 @@ public class RegistryService {
return isSetFromTime();
case TO_TIME:
return isSetToTime();
+ case USER_NAME:
+ return isSetUserName();
+ case APPLICATION_NAME:
+ return isSetApplicationName();
+ case RESOURCE_HOST_NAME:
+ return isSetResourceHostName();
}
throw new IllegalStateException();
}
@@ -43640,6 +43805,33 @@ public class RegistryService {
return false;
}
+ boolean this_present_userName = true && this.isSetUserName();
+ boolean that_present_userName = true && that.isSetUserName();
+ if (this_present_userName || that_present_userName) {
+ if (!(this_present_userName && that_present_userName))
+ return false;
+ if (!this.userName.equals(that.userName))
+ return false;
+ }
+
+ boolean this_present_applicationName = true && this.isSetApplicationName();
+ boolean that_present_applicationName = true && that.isSetApplicationName();
+ if (this_present_applicationName || that_present_applicationName) {
+ if (!(this_present_applicationName && that_present_applicationName))
+ return false;
+ if (!this.applicationName.equals(that.applicationName))
+ return false;
+ }
+
+ boolean this_present_resourceHostName = true && this.isSetResourceHostName();
+ boolean that_present_resourceHostName = true && that.isSetResourceHostName();
+ if (this_present_resourceHostName || that_present_resourceHostName) {
+ if (!(this_present_resourceHostName && that_present_resourceHostName))
+ return false;
+ if (!this.resourceHostName.equals(that.resourceHostName))
+ return false;
+ }
+
return true;
}
@@ -43662,6 +43854,21 @@ public class RegistryService {
if (present_toTime)
list.add(toTime);
+ boolean present_userName = true && (isSetUserName());
+ list.add(present_userName);
+ if (present_userName)
+ list.add(userName);
+
+ boolean present_applicationName = true && (isSetApplicationName());
+ list.add(present_applicationName);
+ if (present_applicationName)
+ list.add(applicationName);
+
+ boolean present_resourceHostName = true && (isSetResourceHostName());
+ list.add(present_resourceHostName);
+ if (present_resourceHostName)
+ list.add(resourceHostName);
+
return list.hashCode();
}
@@ -43703,6 +43910,36 @@ public class RegistryService {
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetUserName()).compareTo(other.isSetUserName());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetUserName()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userName, other.userName);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetApplicationName()).compareTo(other.isSetApplicationName());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetApplicationName()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.applicationName, other.applicationName);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetResourceHostName()).compareTo(other.isSetResourceHostName());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetResourceHostName()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.resourceHostName, other.resourceHostName);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
@@ -43738,6 +43975,30 @@ public class RegistryService {
sb.append("toTime:");
sb.append(this.toTime);
first = false;
+ if (!first) sb.append(", ");
+ sb.append("userName:");
+ if (this.userName == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.userName);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("applicationName:");
+ if (this.applicationName == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.applicationName);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("resourceHostName:");
+ if (this.resourceHostName == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.resourceHostName);
+ }
+ first = false;
sb.append(")");
return sb.toString();
}
@@ -43812,6 +44073,30 @@ public class RegistryService {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case 4: // USER_NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.userName = iprot.readString();
+ struct.setUserNameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 5: // APPLICATION_NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.applicationName = iprot.readString();
+ struct.setApplicationNameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 6: // RESOURCE_HOST_NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.resourceHostName = iprot.readString();
+ struct.setResourceHostNameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -43844,6 +44129,21 @@ public class RegistryService {
oprot.writeFieldBegin(TO_TIME_FIELD_DESC);
oprot.writeI64(struct.toTime);
oprot.writeFieldEnd();
+ if (struct.userName != null) {
+ oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
+ oprot.writeString(struct.userName);
+ oprot.writeFieldEnd();
+ }
+ if (struct.applicationName != null) {
+ oprot.writeFieldBegin(APPLICATION_NAME_FIELD_DESC);
+ oprot.writeString(struct.applicationName);
+ oprot.writeFieldEnd();
+ }
+ if (struct.resourceHostName != null) {
+ oprot.writeFieldBegin(RESOURCE_HOST_NAME_FIELD_DESC);
+ oprot.writeString(struct.resourceHostName);
+ oprot.writeFieldEnd();
+ }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@@ -43864,6 +44164,26 @@ public class RegistryService {
oprot.writeString(struct.gatewayId);
oprot.writeI64(struct.fromTime);
oprot.writeI64(struct.toTime);
+ BitSet optionals = new BitSet();
+ if (struct.isSetUserName()) {
+ optionals.set(0);
+ }
+ if (struct.isSetApplicationName()) {
+ optionals.set(1);
+ }
+ if (struct.isSetResourceHostName()) {
+ optionals.set(2);
+ }
+ oprot.writeBitSet(optionals, 3);
+ if (struct.isSetUserName()) {
+ oprot.writeString(struct.userName);
+ }
+ if (struct.isSetApplicationName()) {
+ oprot.writeString(struct.applicationName);
+ }
+ if (struct.isSetResourceHostName()) {
+ oprot.writeString(struct.resourceHostName);
+ }
}
@Override
@@ -43875,6 +44195,19 @@ public class RegistryService {
struct.setFromTimeIsSet(true);
struct.toTime = iprot.readI64();
struct.setToTimeIsSet(true);
+ BitSet incoming = iprot.readBitSet(3);
+ if (incoming.get(0)) {
+ struct.userName = iprot.readString();
+ struct.setUserNameIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.applicationName = iprot.readString();
+ struct.setApplicationNameIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.resourceHostName = iprot.readString();
+ struct.setResourceHostNameIsSet(true);
+ }
}
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/465f766e/thrift-interface-descriptions/airavata-apis/airavata_api.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/airavata-apis/airavata_api.thrift b/thrift-interface-descriptions/airavata-apis/airavata_api.thrift
index 36b6fda..70d10ff 100644
--- a/thrift-interface-descriptions/airavata-apis/airavata_api.thrift
+++ b/thrift-interface-descriptions/airavata-apis/airavata_api.thrift
@@ -620,11 +620,15 @@ service Airavata {
* @param toTime
* Ending data time.
*
+ * TODO update docs
**/
experiment_model.ExperimentStatistics getExperimentStatistics(1: required security_model.AuthzToken authzToken,
2: required string gatewayId,
3: required i64 fromTime,
- 4: required i64 toTime)
+ 4: required i64 toTime,
+ 5: string userName,
+ 6: string applicationName,
+ 7: string resourceHostName)
throws (1: airavata_errors.InvalidRequestException ire,
2: airavata_errors.AiravataClientException ace,
3: airavata_errors.AiravataSystemException ase,
http://git-wip-us.apache.org/repos/asf/airavata/blob/465f766e/thrift-interface-descriptions/component-cpis/registry-api.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/component-cpis/registry-api.thrift b/thrift-interface-descriptions/component-cpis/registry-api.thrift
index a6cc2e1..24cb0bf 100644
--- a/thrift-interface-descriptions/component-cpis/registry-api.thrift
+++ b/thrift-interface-descriptions/component-cpis/registry-api.thrift
@@ -347,11 +347,15 @@ service RegistryService {
*
* @param toTime
* Ending data time.
+ * TODO update docs
*
**/
experiment_model.ExperimentStatistics getExperimentStatistics(1: required string gatewayId,
2: required i64 fromTime,
- 3: required i64 toTime)
+ 3: required i64 toTime,
+ 4: string userName,
+ 5: string applicationName,
+ 6: string resourceHostName)
throws (1: registry_api_errors.RegistryServiceException rse)
[4/6] airavata git commit: AIRAVATA-2163 Setting type on
CredentialSummary
Posted by sc...@apache.org.
AIRAVATA-2163 Setting type on CredentialSummary
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/9865e7e2
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/9865e7e2
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/9865e7e2
Branch: refs/heads/develop
Commit: 9865e7e2404c8ce4d3554f563b8cb987e8211325
Parents: a94a7ca
Author: Marcus Christie <ma...@iu.edu>
Authored: Tue Dec 13 12:21:40 2016 -0500
Committer: Marcus Christie <ma...@iu.edu>
Committed: Tue Dec 13 12:21:40 2016 -0500
----------------------------------------------------------------------
.../resources/lib/Airavata/API/Airavata.php | 160 +++++++++++++------
.../Airavata/Model/Credential/Store/Types.php | 76 ++++++---
.../server/CredentialStoreServerHandler.java | 3 +
3 files changed, 168 insertions(+), 71 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/9865e7e2/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
index f235e48..a521d5a 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
@@ -354,33 +354,40 @@ interface AiravataIf {
public function getAllGatewaySSHPubKeys(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId);
/**
*
- * Get all Public Keys of the Gateway
+ * Get all Credential summaries for the Gateway
*
* @param CredStoreToken
* Credential Store Token which you want to find the Public Key for.
*
+ * @param credential_store_data_models.SummaryType
+ * Summary type : SSH,PASSWD or CERT
+ *
* @param gatewayId
* This is the unique identifier of your gateway where the token and public key was generated from.
*
- * @return publicKey
+ * @return List of Credential Summary Objects
*
*
*
* @param \Airavata\Model\Security\AuthzToken $authzToken
+ * @param int $type
* @param string $gatewayId
- * @return \Airavata\Model\AppCatalog\CredetialSummary\CredentialSummary[]
+ * @return \Airavata\Model\Credential\Store\CredentialSummary[]
* @throws \Airavata\API\Error\InvalidRequestException
* @throws \Airavata\API\Error\AiravataClientException
* @throws \Airavata\API\Error\AiravataSystemException
*/
- public function getAllGatewaySSHPubKeysSummary(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId);
+ public function getAllCredentialSummaryForGateway(\Airavata\Model\Security\AuthzToken $authzToken, $type, $gatewayId);
/**
*
- * Get all Public Key summaries for user in a Gateway
+ * Get all Credential summaries for user in a Gateway
*
* @param CredStoreToken
* Credential Store Token which you want to find the Public Key for.
*
+ * @param credential_store_data_models.SummaryType
+ * Summary type : SSH,PASSWD or CERT
+ *
* @param gatewayId
* This is the unique identifier of your gateway where the token and public key was generated from.
*
@@ -392,14 +399,15 @@ interface AiravataIf {
*
*
* @param \Airavata\Model\Security\AuthzToken $authzToken
+ * @param int $type
* @param string $gatewayId
* @param string $userId
- * @return \Airavata\Model\AppCatalog\CredetialSummary\CredentialSummary[]
+ * @return \Airavata\Model\Credential\Store\CredentialSummary[]
* @throws \Airavata\API\Error\InvalidRequestException
* @throws \Airavata\API\Error\AiravataClientException
* @throws \Airavata\API\Error\AiravataSystemException
*/
- public function getAllSSHPubKeysSummaryForUserInGateway(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId, $userId);
+ public function getAllCredentialSummaryForUsersInGateway(\Airavata\Model\Security\AuthzToken $authzToken, $type, $gatewayId, $userId);
/**
* @param \Airavata\Model\Security\AuthzToken $authzToken
* @param string $gatewayId
@@ -5238,35 +5246,36 @@ class AiravataClient implements \Airavata\API\AiravataIf {
throw new \Exception("getAllGatewaySSHPubKeys failed: unknown result");
}
- public function getAllGatewaySSHPubKeysSummary(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId)
+ public function getAllCredentialSummaryForGateway(\Airavata\Model\Security\AuthzToken $authzToken, $type, $gatewayId)
{
- $this->send_getAllGatewaySSHPubKeysSummary($authzToken, $gatewayId);
- return $this->recv_getAllGatewaySSHPubKeysSummary();
+ $this->send_getAllCredentialSummaryForGateway($authzToken, $type, $gatewayId);
+ return $this->recv_getAllCredentialSummaryForGateway();
}
- public function send_getAllGatewaySSHPubKeysSummary(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId)
+ public function send_getAllCredentialSummaryForGateway(\Airavata\Model\Security\AuthzToken $authzToken, $type, $gatewayId)
{
- $args = new \Airavata\API\Airavata_getAllGatewaySSHPubKeysSummary_args();
+ $args = new \Airavata\API\Airavata_getAllCredentialSummaryForGateway_args();
$args->authzToken = $authzToken;
+ $args->type = $type;
$args->gatewayId = $gatewayId;
$bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
if ($bin_accel)
{
- thrift_protocol_write_binary($this->output_, 'getAllGatewaySSHPubKeysSummary', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
+ thrift_protocol_write_binary($this->output_, 'getAllCredentialSummaryForGateway', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
}
else
{
- $this->output_->writeMessageBegin('getAllGatewaySSHPubKeysSummary', TMessageType::CALL, $this->seqid_);
+ $this->output_->writeMessageBegin('getAllCredentialSummaryForGateway', TMessageType::CALL, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}
- public function recv_getAllGatewaySSHPubKeysSummary()
+ public function recv_getAllCredentialSummaryForGateway()
{
$bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
- if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Airavata\API\Airavata_getAllGatewaySSHPubKeysSummary_result', $this->input_->isStrictRead());
+ if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Airavata\API\Airavata_getAllCredentialSummaryForGateway_result', $this->input_->isStrictRead());
else
{
$rseqid = 0;
@@ -5280,7 +5289,7 @@ class AiravataClient implements \Airavata\API\AiravataIf {
$this->input_->readMessageEnd();
throw $x;
}
- $result = new \Airavata\API\Airavata_getAllGatewaySSHPubKeysSummary_result();
+ $result = new \Airavata\API\Airavata_getAllCredentialSummaryForGateway_result();
$result->read($this->input_);
$this->input_->readMessageEnd();
}
@@ -5296,39 +5305,40 @@ class AiravataClient implements \Airavata\API\AiravataIf {
if ($result->ase !== null) {
throw $result->ase;
}
- throw new \Exception("getAllGatewaySSHPubKeysSummary failed: unknown result");
+ throw new \Exception("getAllCredentialSummaryForGateway failed: unknown result");
}
- public function getAllSSHPubKeysSummaryForUserInGateway(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId, $userId)
+ public function getAllCredentialSummaryForUsersInGateway(\Airavata\Model\Security\AuthzToken $authzToken, $type, $gatewayId, $userId)
{
- $this->send_getAllSSHPubKeysSummaryForUserInGateway($authzToken, $gatewayId, $userId);
- return $this->recv_getAllSSHPubKeysSummaryForUserInGateway();
+ $this->send_getAllCredentialSummaryForUsersInGateway($authzToken, $type, $gatewayId, $userId);
+ return $this->recv_getAllCredentialSummaryForUsersInGateway();
}
- public function send_getAllSSHPubKeysSummaryForUserInGateway(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId, $userId)
+ public function send_getAllCredentialSummaryForUsersInGateway(\Airavata\Model\Security\AuthzToken $authzToken, $type, $gatewayId, $userId)
{
- $args = new \Airavata\API\Airavata_getAllSSHPubKeysSummaryForUserInGateway_args();
+ $args = new \Airavata\API\Airavata_getAllCredentialSummaryForUsersInGateway_args();
$args->authzToken = $authzToken;
+ $args->type = $type;
$args->gatewayId = $gatewayId;
$args->userId = $userId;
$bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
if ($bin_accel)
{
- thrift_protocol_write_binary($this->output_, 'getAllSSHPubKeysSummaryForUserInGateway', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
+ thrift_protocol_write_binary($this->output_, 'getAllCredentialSummaryForUsersInGateway', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
}
else
{
- $this->output_->writeMessageBegin('getAllSSHPubKeysSummaryForUserInGateway', TMessageType::CALL, $this->seqid_);
+ $this->output_->writeMessageBegin('getAllCredentialSummaryForUsersInGateway', TMessageType::CALL, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}
- public function recv_getAllSSHPubKeysSummaryForUserInGateway()
+ public function recv_getAllCredentialSummaryForUsersInGateway()
{
$bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
- if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Airavata\API\Airavata_getAllSSHPubKeysSummaryForUserInGateway_result', $this->input_->isStrictRead());
+ if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Airavata\API\Airavata_getAllCredentialSummaryForUsersInGateway_result', $this->input_->isStrictRead());
else
{
$rseqid = 0;
@@ -5342,7 +5352,7 @@ class AiravataClient implements \Airavata\API\AiravataIf {
$this->input_->readMessageEnd();
throw $x;
}
- $result = new \Airavata\API\Airavata_getAllSSHPubKeysSummaryForUserInGateway_result();
+ $result = new \Airavata\API\Airavata_getAllCredentialSummaryForUsersInGateway_result();
$result->read($this->input_);
$this->input_->readMessageEnd();
}
@@ -5358,7 +5368,7 @@ class AiravataClient implements \Airavata\API\AiravataIf {
if ($result->ase !== null) {
throw $result->ase;
}
- throw new \Exception("getAllSSHPubKeysSummaryForUserInGateway failed: unknown result");
+ throw new \Exception("getAllCredentialSummaryForUsersInGateway failed: unknown result");
}
public function getAllGatewayPWDCredentials(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId)
@@ -20314,7 +20324,7 @@ class Airavata_getAllGatewaySSHPubKeys_result {
}
-class Airavata_getAllGatewaySSHPubKeysSummary_args {
+class Airavata_getAllCredentialSummaryForGateway_args {
static $_TSPEC;
/**
@@ -20322,6 +20332,10 @@ class Airavata_getAllGatewaySSHPubKeysSummary_args {
*/
public $authzToken = null;
/**
+ * @var int
+ */
+ public $type = null;
+ /**
* @var string
*/
public $gatewayId = null;
@@ -20335,6 +20349,10 @@ class Airavata_getAllGatewaySSHPubKeysSummary_args {
'class' => '\Airavata\Model\Security\AuthzToken',
),
2 => array(
+ 'var' => 'type',
+ 'type' => TType::I32,
+ ),
+ 3 => array(
'var' => 'gatewayId',
'type' => TType::STRING,
),
@@ -20344,6 +20362,9 @@ class Airavata_getAllGatewaySSHPubKeysSummary_args {
if (isset($vals['authzToken'])) {
$this->authzToken = $vals['authzToken'];
}
+ if (isset($vals['type'])) {
+ $this->type = $vals['type'];
+ }
if (isset($vals['gatewayId'])) {
$this->gatewayId = $vals['gatewayId'];
}
@@ -20351,7 +20372,7 @@ class Airavata_getAllGatewaySSHPubKeysSummary_args {
}
public function getName() {
- return 'Airavata_getAllGatewaySSHPubKeysSummary_args';
+ return 'Airavata_getAllCredentialSummaryForGateway_args';
}
public function read($input)
@@ -20378,6 +20399,13 @@ class Airavata_getAllGatewaySSHPubKeysSummary_args {
}
break;
case 2:
+ if ($ftype == TType::I32) {
+ $xfer += $input->readI32($this->type);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 3:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->gatewayId);
} else {
@@ -20396,7 +20424,7 @@ class Airavata_getAllGatewaySSHPubKeysSummary_args {
public function write($output) {
$xfer = 0;
- $xfer += $output->writeStructBegin('Airavata_getAllGatewaySSHPubKeysSummary_args');
+ $xfer += $output->writeStructBegin('Airavata_getAllCredentialSummaryForGateway_args');
if ($this->authzToken !== null) {
if (!is_object($this->authzToken)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
@@ -20405,8 +20433,13 @@ class Airavata_getAllGatewaySSHPubKeysSummary_args {
$xfer += $this->authzToken->write($output);
$xfer += $output->writeFieldEnd();
}
+ if ($this->type !== null) {
+ $xfer += $output->writeFieldBegin('type', TType::I32, 2);
+ $xfer += $output->writeI32($this->type);
+ $xfer += $output->writeFieldEnd();
+ }
if ($this->gatewayId !== null) {
- $xfer += $output->writeFieldBegin('gatewayId', TType::STRING, 2);
+ $xfer += $output->writeFieldBegin('gatewayId', TType::STRING, 3);
$xfer += $output->writeString($this->gatewayId);
$xfer += $output->writeFieldEnd();
}
@@ -20417,11 +20450,11 @@ class Airavata_getAllGatewaySSHPubKeysSummary_args {
}
-class Airavata_getAllGatewaySSHPubKeysSummary_result {
+class Airavata_getAllCredentialSummaryForGateway_result {
static $_TSPEC;
/**
- * @var \Airavata\Model\AppCatalog\CredetialSummary\CredentialSummary[]
+ * @var \Airavata\Model\Credential\Store\CredentialSummary[]
*/
public $success = null;
/**
@@ -20446,7 +20479,7 @@ class Airavata_getAllGatewaySSHPubKeysSummary_result {
'etype' => TType::STRUCT,
'elem' => array(
'type' => TType::STRUCT,
- 'class' => '\Airavata\Model\AppCatalog\CredetialSummary\CredentialSummary',
+ 'class' => '\Airavata\Model\Credential\Store\CredentialSummary',
),
),
1 => array(
@@ -20483,7 +20516,7 @@ class Airavata_getAllGatewaySSHPubKeysSummary_result {
}
public function getName() {
- return 'Airavata_getAllGatewaySSHPubKeysSummary_result';
+ return 'Airavata_getAllCredentialSummaryForGateway_result';
}
public function read($input)
@@ -20510,7 +20543,7 @@ class Airavata_getAllGatewaySSHPubKeysSummary_result {
for ($_i34 = 0; $_i34 < $_size30; ++$_i34)
{
$elem35 = null;
- $elem35 = new \Airavata\Model\AppCatalog\CredetialSummary\CredentialSummary();
+ $elem35 = new \Airavata\Model\Credential\Store\CredentialSummary();
$xfer += $elem35->read($input);
$this->success []= $elem35;
}
@@ -20555,7 +20588,7 @@ class Airavata_getAllGatewaySSHPubKeysSummary_result {
public function write($output) {
$xfer = 0;
- $xfer += $output->writeStructBegin('Airavata_getAllGatewaySSHPubKeysSummary_result');
+ $xfer += $output->writeStructBegin('Airavata_getAllCredentialSummaryForGateway_result');
if ($this->success !== null) {
if (!is_array($this->success)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
@@ -20595,7 +20628,7 @@ class Airavata_getAllGatewaySSHPubKeysSummary_result {
}
-class Airavata_getAllSSHPubKeysSummaryForUserInGateway_args {
+class Airavata_getAllCredentialSummaryForUsersInGateway_args {
static $_TSPEC;
/**
@@ -20603,6 +20636,10 @@ class Airavata_getAllSSHPubKeysSummaryForUserInGateway_args {
*/
public $authzToken = null;
/**
+ * @var int
+ */
+ public $type = null;
+ /**
* @var string
*/
public $gatewayId = null;
@@ -20620,10 +20657,14 @@ class Airavata_getAllSSHPubKeysSummaryForUserInGateway_args {
'class' => '\Airavata\Model\Security\AuthzToken',
),
2 => array(
+ 'var' => 'type',
+ 'type' => TType::I32,
+ ),
+ 3 => array(
'var' => 'gatewayId',
'type' => TType::STRING,
),
- 3 => array(
+ 4 => array(
'var' => 'userId',
'type' => TType::STRING,
),
@@ -20633,6 +20674,9 @@ class Airavata_getAllSSHPubKeysSummaryForUserInGateway_args {
if (isset($vals['authzToken'])) {
$this->authzToken = $vals['authzToken'];
}
+ if (isset($vals['type'])) {
+ $this->type = $vals['type'];
+ }
if (isset($vals['gatewayId'])) {
$this->gatewayId = $vals['gatewayId'];
}
@@ -20643,7 +20687,7 @@ class Airavata_getAllSSHPubKeysSummaryForUserInGateway_args {
}
public function getName() {
- return 'Airavata_getAllSSHPubKeysSummaryForUserInGateway_args';
+ return 'Airavata_getAllCredentialSummaryForUsersInGateway_args';
}
public function read($input)
@@ -20670,13 +20714,20 @@ class Airavata_getAllSSHPubKeysSummaryForUserInGateway_args {
}
break;
case 2:
+ if ($ftype == TType::I32) {
+ $xfer += $input->readI32($this->type);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 3:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->gatewayId);
} else {
$xfer += $input->skip($ftype);
}
break;
- case 3:
+ case 4:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->userId);
} else {
@@ -20695,7 +20746,7 @@ class Airavata_getAllSSHPubKeysSummaryForUserInGateway_args {
public function write($output) {
$xfer = 0;
- $xfer += $output->writeStructBegin('Airavata_getAllSSHPubKeysSummaryForUserInGateway_args');
+ $xfer += $output->writeStructBegin('Airavata_getAllCredentialSummaryForUsersInGateway_args');
if ($this->authzToken !== null) {
if (!is_object($this->authzToken)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
@@ -20704,13 +20755,18 @@ class Airavata_getAllSSHPubKeysSummaryForUserInGateway_args {
$xfer += $this->authzToken->write($output);
$xfer += $output->writeFieldEnd();
}
+ if ($this->type !== null) {
+ $xfer += $output->writeFieldBegin('type', TType::I32, 2);
+ $xfer += $output->writeI32($this->type);
+ $xfer += $output->writeFieldEnd();
+ }
if ($this->gatewayId !== null) {
- $xfer += $output->writeFieldBegin('gatewayId', TType::STRING, 2);
+ $xfer += $output->writeFieldBegin('gatewayId', TType::STRING, 3);
$xfer += $output->writeString($this->gatewayId);
$xfer += $output->writeFieldEnd();
}
if ($this->userId !== null) {
- $xfer += $output->writeFieldBegin('userId', TType::STRING, 3);
+ $xfer += $output->writeFieldBegin('userId', TType::STRING, 4);
$xfer += $output->writeString($this->userId);
$xfer += $output->writeFieldEnd();
}
@@ -20721,11 +20777,11 @@ class Airavata_getAllSSHPubKeysSummaryForUserInGateway_args {
}
-class Airavata_getAllSSHPubKeysSummaryForUserInGateway_result {
+class Airavata_getAllCredentialSummaryForUsersInGateway_result {
static $_TSPEC;
/**
- * @var \Airavata\Model\AppCatalog\CredetialSummary\CredentialSummary[]
+ * @var \Airavata\Model\Credential\Store\CredentialSummary[]
*/
public $success = null;
/**
@@ -20750,7 +20806,7 @@ class Airavata_getAllSSHPubKeysSummaryForUserInGateway_result {
'etype' => TType::STRUCT,
'elem' => array(
'type' => TType::STRUCT,
- 'class' => '\Airavata\Model\AppCatalog\CredetialSummary\CredentialSummary',
+ 'class' => '\Airavata\Model\Credential\Store\CredentialSummary',
),
),
1 => array(
@@ -20787,7 +20843,7 @@ class Airavata_getAllSSHPubKeysSummaryForUserInGateway_result {
}
public function getName() {
- return 'Airavata_getAllSSHPubKeysSummaryForUserInGateway_result';
+ return 'Airavata_getAllCredentialSummaryForUsersInGateway_result';
}
public function read($input)
@@ -20814,7 +20870,7 @@ class Airavata_getAllSSHPubKeysSummaryForUserInGateway_result {
for ($_i41 = 0; $_i41 < $_size37; ++$_i41)
{
$elem42 = null;
- $elem42 = new \Airavata\Model\AppCatalog\CredetialSummary\CredentialSummary();
+ $elem42 = new \Airavata\Model\Credential\Store\CredentialSummary();
$xfer += $elem42->read($input);
$this->success []= $elem42;
}
@@ -20859,7 +20915,7 @@ class Airavata_getAllSSHPubKeysSummaryForUserInGateway_result {
public function write($output) {
$xfer = 0;
- $xfer += $output->writeStructBegin('Airavata_getAllSSHPubKeysSummaryForUserInGateway_result');
+ $xfer += $output->writeStructBegin('Airavata_getAllCredentialSummaryForUsersInGateway_result');
if ($this->success !== null) {
if (!is_array($this->success)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
http://git-wip-us.apache.org/repos/asf/airavata/blob/9865e7e2/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Credential/Store/Types.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Credential/Store/Types.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Credential/Store/Types.php
index d8e3f13..861403d 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Credential/Store/Types.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Credential/Store/Types.php
@@ -26,6 +26,21 @@ final class CredentialOwnerType {
);
}
+/**
+ * Data Types supported in Airavata. The primitive data types
+ *
+ */
+final class SummaryType {
+ const SSH = 0;
+ const PASSWD = 1;
+ const CERT = 2;
+ static public $__names = array(
+ 0 => 'SSH',
+ 1 => 'PASSWD',
+ 2 => 'CERT',
+ );
+}
+
class SSHCredential {
static $_TSPEC;
@@ -285,10 +300,14 @@ class SSHCredential {
}
-class SSHCredentialSummary {
+class CredentialSummary {
static $_TSPEC;
/**
+ * @var int
+ */
+ public $type = null;
+ /**
* @var string
*/
public $gatewayId = null;
@@ -317,32 +336,39 @@ class SSHCredentialSummary {
if (!isset(self::$_TSPEC)) {
self::$_TSPEC = array(
1 => array(
+ 'var' => 'type',
+ 'type' => TType::I32,
+ ),
+ 2 => array(
'var' => 'gatewayId',
'type' => TType::STRING,
),
- 2 => array(
+ 3 => array(
'var' => 'username',
'type' => TType::STRING,
),
- 3 => array(
+ 4 => array(
'var' => 'publicKey',
'type' => TType::STRING,
),
- 4 => array(
+ 5 => array(
'var' => 'persistedTime',
'type' => TType::I64,
),
- 5 => array(
+ 6 => array(
'var' => 'token',
'type' => TType::STRING,
),
- 6 => array(
+ 7 => array(
'var' => 'description',
'type' => TType::STRING,
),
);
}
if (is_array($vals)) {
+ if (isset($vals['type'])) {
+ $this->type = $vals['type'];
+ }
if (isset($vals['gatewayId'])) {
$this->gatewayId = $vals['gatewayId'];
}
@@ -365,7 +391,7 @@ class SSHCredentialSummary {
}
public function getName() {
- return 'SSHCredentialSummary';
+ return 'CredentialSummary';
}
public function read($input)
@@ -384,41 +410,48 @@ class SSHCredentialSummary {
switch ($fid)
{
case 1:
+ if ($ftype == TType::I32) {
+ $xfer += $input->readI32($this->type);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->gatewayId);
} else {
$xfer += $input->skip($ftype);
}
break;
- case 2:
+ case 3:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->username);
} else {
$xfer += $input->skip($ftype);
}
break;
- case 3:
+ case 4:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->publicKey);
} else {
$xfer += $input->skip($ftype);
}
break;
- case 4:
+ case 5:
if ($ftype == TType::I64) {
$xfer += $input->readI64($this->persistedTime);
} else {
$xfer += $input->skip($ftype);
}
break;
- case 5:
+ case 6:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->token);
} else {
$xfer += $input->skip($ftype);
}
break;
- case 6:
+ case 7:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->description);
} else {
@@ -437,34 +470,39 @@ class SSHCredentialSummary {
public function write($output) {
$xfer = 0;
- $xfer += $output->writeStructBegin('SSHCredentialSummary');
+ $xfer += $output->writeStructBegin('CredentialSummary');
+ if ($this->type !== null) {
+ $xfer += $output->writeFieldBegin('type', TType::I32, 1);
+ $xfer += $output->writeI32($this->type);
+ $xfer += $output->writeFieldEnd();
+ }
if ($this->gatewayId !== null) {
- $xfer += $output->writeFieldBegin('gatewayId', TType::STRING, 1);
+ $xfer += $output->writeFieldBegin('gatewayId', TType::STRING, 2);
$xfer += $output->writeString($this->gatewayId);
$xfer += $output->writeFieldEnd();
}
if ($this->username !== null) {
- $xfer += $output->writeFieldBegin('username', TType::STRING, 2);
+ $xfer += $output->writeFieldBegin('username', TType::STRING, 3);
$xfer += $output->writeString($this->username);
$xfer += $output->writeFieldEnd();
}
if ($this->publicKey !== null) {
- $xfer += $output->writeFieldBegin('publicKey', TType::STRING, 3);
+ $xfer += $output->writeFieldBegin('publicKey', TType::STRING, 4);
$xfer += $output->writeString($this->publicKey);
$xfer += $output->writeFieldEnd();
}
if ($this->persistedTime !== null) {
- $xfer += $output->writeFieldBegin('persistedTime', TType::I64, 4);
+ $xfer += $output->writeFieldBegin('persistedTime', TType::I64, 5);
$xfer += $output->writeI64($this->persistedTime);
$xfer += $output->writeFieldEnd();
}
if ($this->token !== null) {
- $xfer += $output->writeFieldBegin('token', TType::STRING, 5);
+ $xfer += $output->writeFieldBegin('token', TType::STRING, 6);
$xfer += $output->writeString($this->token);
$xfer += $output->writeFieldEnd();
}
if ($this->description !== null) {
- $xfer += $output->writeFieldBegin('description', TType::STRING, 6);
+ $xfer += $output->writeFieldBegin('description', TType::STRING, 7);
$xfer += $output->writeString($this->description);
$xfer += $output->writeFieldEnd();
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/9865e7e2/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
index f384756..c8d1cf0 100644
--- a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
@@ -196,6 +196,7 @@ public class CredentialStoreServerHandler implements CredentialStoreService.Ifac
if (credential instanceof org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential) {
org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential credential1 = (org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential) credential;
CredentialSummary sshCredentialSummary = new CredentialSummary();
+ sshCredentialSummary.setType(SummaryType.SSH);
sshCredentialSummary.setUsername(credential1.getPortalUserName());
sshCredentialSummary.setGatewayId(credential1.getGateway());
sshCredentialSummary.setPublicKey(new String(credential1.getPublicKey()));
@@ -344,6 +345,7 @@ public class CredentialStoreServerHandler implements CredentialStoreService.Ifac
if (credential instanceof org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential) {
org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential sshCredential = (org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential) credential;
CredentialSummary sshCredentialSummary = new CredentialSummary();
+ sshCredentialSummary.setType(SummaryType.SSH);
sshCredentialSummary.setToken(sshCredential.getToken());
sshCredentialSummary.setUsername(sshCredential.getPortalUserName());
sshCredentialSummary.setGatewayId(sshCredential.getGateway());
@@ -381,6 +383,7 @@ public class CredentialStoreServerHandler implements CredentialStoreService.Ifac
if (portalUserName.equals(userId) && gateway.equals(gatewayId)) {
org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential sshCredentialKey = (org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential) credential;
CredentialSummary sshCredentialSummary = new CredentialSummary();
+ sshCredentialSummary.setType(SummaryType.SSH);
sshCredentialSummary.setToken(sshCredentialKey.getToken());
sshCredentialSummary.setUsername(sshCredentialKey.getPortalUserName());
sshCredentialSummary.setGatewayId(sshCredentialKey.getGateway());
[3/6] airavata git commit: AIRAVATA-1792 Thrift docs for new
parameters
Posted by sc...@apache.org.
AIRAVATA-1792 Thrift docs for new parameters
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/a6c8c275
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/a6c8c275
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/a6c8c275
Branch: refs/heads/develop
Commit: a6c8c27576072c59d1f643122fd36dd833a26479
Parents: 7b7bb53
Author: Marcus Christie <ma...@iu.edu>
Authored: Tue Dec 13 11:11:02 2016 -0500
Committer: Marcus Christie <ma...@iu.edu>
Committed: Tue Dec 13 11:11:02 2016 -0500
----------------------------------------------------------------------
.../src/main/java/org/apache/airavata/api/Airavata.java | 9 +++++++++
.../src/main/resources/lib/Airavata/API/Airavata.php | 10 +++++++++-
.../org/apache/airavata/registry/api/RegistryService.java | 9 +++++++++
.../airavata-apis/airavata_api.thrift | 10 +++++++++-
.../component-cpis/registry-api.thrift | 10 +++++++++-
5 files changed, 45 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/a6c8c275/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java b/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
index c997dfa..540911f 100644
--- a/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
+++ b/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
@@ -550,6 +550,15 @@ public class Airavata {
* @param toTime
* Ending data time.
*
+ * @param userName
+ * Gateway username substring with which to further filter statistics.
+ *
+ * @param applicationName
+ * Application id substring with which to further filter statistics.
+ *
+ * @param resourceHostName
+ * Hostname id substring with which to further filter statistics.
+ *
*
*
* @param authzToken
http://git-wip-us.apache.org/repos/asf/airavata/blob/a6c8c275/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
index cc90cc6..37c76dd 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
@@ -651,7 +651,15 @@ interface AiravataIf {
* @param toTime
* Ending data time.
*
- * TODO update docs
+ * @param userName
+ * Gateway username substring with which to further filter statistics.
+ *
+ * @param applicationName
+ * Application id substring with which to further filter statistics.
+ *
+ * @param resourceHostName
+ * Hostname id substring with which to further filter statistics.
+ *
*
*
* @param \Airavata\Model\Security\AuthzToken $authzToken
http://git-wip-us.apache.org/repos/asf/airavata/blob/a6c8c275/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java b/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java
index e5d6d4f..690b1c6 100644
--- a/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java
+++ b/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java
@@ -371,6 +371,15 @@ public class RegistryService {
* @param toTime
* Ending data time.
*
+ * @param userName
+ * Gateway username substring with which to further filter statistics.
+ *
+ * @param applicationName
+ * Application id substring with which to further filter statistics.
+ *
+ * @param resourceHostName
+ * Hostname id substring with which to further filter statistics.
+ *
*
*
* @param gatewayId
http://git-wip-us.apache.org/repos/asf/airavata/blob/a6c8c275/thrift-interface-descriptions/airavata-apis/airavata_api.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/airavata-apis/airavata_api.thrift b/thrift-interface-descriptions/airavata-apis/airavata_api.thrift
index 70d10ff..01afc20 100644
--- a/thrift-interface-descriptions/airavata-apis/airavata_api.thrift
+++ b/thrift-interface-descriptions/airavata-apis/airavata_api.thrift
@@ -620,7 +620,15 @@ service Airavata {
* @param toTime
* Ending data time.
*
- * TODO update docs
+ * @param userName
+ * Gateway username substring with which to further filter statistics.
+ *
+ * @param applicationName
+ * Application id substring with which to further filter statistics.
+ *
+ * @param resourceHostName
+ * Hostname id substring with which to further filter statistics.
+ *
**/
experiment_model.ExperimentStatistics getExperimentStatistics(1: required security_model.AuthzToken authzToken,
2: required string gatewayId,
http://git-wip-us.apache.org/repos/asf/airavata/blob/a6c8c275/thrift-interface-descriptions/component-cpis/registry-api.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/component-cpis/registry-api.thrift b/thrift-interface-descriptions/component-cpis/registry-api.thrift
index 24cb0bf..97942a8 100644
--- a/thrift-interface-descriptions/component-cpis/registry-api.thrift
+++ b/thrift-interface-descriptions/component-cpis/registry-api.thrift
@@ -347,7 +347,15 @@ service RegistryService {
*
* @param toTime
* Ending data time.
- * TODO update docs
+ *
+ * @param userName
+ * Gateway username substring with which to further filter statistics.
+ *
+ * @param applicationName
+ * Application id substring with which to further filter statistics.
+ *
+ * @param resourceHostName
+ * Hostname id substring with which to further filter statistics.
*
**/
experiment_model.ExperimentStatistics getExperimentStatistics(1: required string gatewayId,
[2/6] airavata git commit: AIRAVATA-1792 Appname/hostname filtering
Posted by sc...@apache.org.
AIRAVATA-1792 Appname/hostname filtering
Username, appname and hostname filtering are implemented as substring
matching instead of exact matching.
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/7b7bb532
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/7b7bb532
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/7b7bb532
Branch: refs/heads/develop
Commit: 7b7bb532cbf940e6d028c44cef0758a7a9c56e29
Parents: 465f766
Author: Marcus Christie <ma...@iu.edu>
Authored: Tue Dec 13 10:54:05 2016 -0500
Committer: Marcus Christie <ma...@iu.edu>
Committed: Tue Dec 13 10:54:05 2016 -0500
----------------------------------------------------------------------
.../experiment/catalog/resources/WorkerResource.java | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/7b7bb532/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java
index 50ca874..762829f 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java
@@ -745,8 +745,16 @@ public class WorkerResource extends AbstractExpCatResource {
query += "e.creationTime > '" + fromTime + "' " + "AND e.creationTime <'" + toTime + "' AND ";
query += "e." + ExperimentConstants.GATEWAY_ID + "= '" + gatewayId + "' ";
if (userName != null) {
- query += "AND e.userName = :userName ";
- queryParameters.put("userName", userName);
+ query += "AND e.userName LIKE :userName ";
+ queryParameters.put("userName", "%" + userName + "%");
+ }
+ if (applicationName != null) {
+ query += "AND e.executionId LIKE :applicationName ";
+ queryParameters.put("applicationName", "%" + applicationName + "%");
+ }
+ if (resourceHostName != null) {
+ query += "AND e.resourceHostId LIKE :resourceHostName ";
+ queryParameters.put("resourceHostName", "%" + resourceHostName + "%");
}
query += "ORDER BY e.creationTime DESC";
[6/6] airavata git commit: merging pull request for AIRAVATA 1792
Posted by sc...@apache.org.
merging pull request for AIRAVATA 1792
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/a42ccd72
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/a42ccd72
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/a42ccd72
Branch: refs/heads/develop
Commit: a42ccd7286e2499c033c06688be5aac11f353cea
Parents: 6867673 a6c8c27
Author: scnakandala <su...@gmail.com>
Authored: Tue Dec 13 14:55:15 2016 -0500
Committer: scnakandala <su...@gmail.com>
Committed: Tue Dec 13 14:55:15 2016 -0500
----------------------------------------------------------------------
.../server/handler/AiravataServerHandler.java | 5 +-
.../java/org/apache/airavata/api/Airavata.java | 366 ++++++++++++++++++-
.../resources/lib/Airavata/API/Airavata.php | 92 ++++-
.../catalog/impl/ExperimentRegistry.java | 5 +-
.../catalog/resources/WorkerResource.java | 45 ++-
.../airavata/registry/cpi/utils/Constants.java | 1 +
.../service/handler/RegistryServerHandler.java | 11 +-
.../airavata/registry/api/RegistryService.java | 366 ++++++++++++++++++-
.../airavata-apis/airavata_api.thrift | 14 +-
.../component-cpis/registry-api.thrift | 14 +-
10 files changed, 872 insertions(+), 47 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/a42ccd72/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/a42ccd72/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/a42ccd72/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/a42ccd72/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/a42ccd72/thrift-interface-descriptions/airavata-apis/airavata_api.thrift
----------------------------------------------------------------------
[5/6] airavata git commit: merging pull request for AIRAVATA-2163
Posted by sc...@apache.org.
merging pull request for AIRAVATA-2163
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/6867673f
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/6867673f
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/6867673f
Branch: refs/heads/develop
Commit: 6867673ff75fc0d486d870e66a0e00c92a1c4f1b
Parents: 9eede35 9865e7e
Author: scnakandala <su...@gmail.com>
Authored: Tue Dec 13 14:52:44 2016 -0500
Committer: scnakandala <su...@gmail.com>
Committed: Tue Dec 13 14:52:44 2016 -0500
----------------------------------------------------------------------
.../resources/lib/Airavata/API/Airavata.php | 160 +++++++++++++------
.../Airavata/Model/Credential/Store/Types.php | 76 ++++++---
.../server/CredentialStoreServerHandler.java | 3 +
3 files changed, 168 insertions(+), 71 deletions(-)
----------------------------------------------------------------------