Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Airavata 3594 admin dashboard additions #433

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2486,6 +2486,37 @@ public void terminateExperiment(AuthzToken authzToken, String airavataExperiment

}

/**
* Get Cpu Hours used by experiments within a specific time period by sending the gateway id and the time period interested in.
* This method will return List of CpuUsage object which contains the cpu hours, experimentId etc.
* @param gatewayId
* @param fromTime
* @param toTime
* @return
* @throws InvalidRequestException
* @throws AiravataClientException
* @throws AiravataSystemException
* @throws TException
*/
@Override
@SecurityCheck
public List<CpuUsage> getCpuUsages(AuthzToken authToken, String gatewayId, long fromTime, long toTime)
throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
RegistryService.Client regClient = registryClientPool.getResource();
try {
List<CpuUsage> result = regClient.getCpuUsages(gatewayId, fromTime, toTime);
registryClientPool.returnResource(regClient);
return result;
}catch (Exception e) {
logger.error("Error while retrieving cpu usages", e);
AiravataSystemException exception = new AiravataSystemException();
exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
exception.setMessage("Error while retrieving cpu usages. More info : " + e.getMessage());
registryClientPool.returnBrokenResource(regClient);
throw exception;
}
}

/**
* Register a Application Module.
*
Expand Down
4,706 changes: 3,233 additions & 1,473 deletions airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help':
print(' string cloneExperiment(AuthzToken authzToken, string existingExperimentID, string newExperimentName, string newExperimentProjectId)')
print(' string cloneExperimentByAdmin(AuthzToken authzToken, string existingExperimentID, string newExperimentName, string newExperimentProjectId)')
print(' void terminateExperiment(AuthzToken authzToken, string airavataExperimentId, string gatewayId)')
print(' getCpuUsages(AuthzToken authzToken, string gatewayId, i64 fromTime, i64 toTime)')
print(' string registerApplicationModule(AuthzToken authzToken, string gatewayId, ApplicationModule applicationModule)')
print(' ApplicationModule getApplicationModule(AuthzToken authzToken, string appModuleId)')
print(' bool updateApplicationModule(AuthzToken authzToken, string appModuleId, ApplicationModule applicationModule)')
Expand Down Expand Up @@ -591,6 +592,12 @@ elif cmd == 'terminateExperiment':
sys.exit(1)
pp.pprint(client.terminateExperiment(eval(args[0]), args[1], args[2],))

elif cmd == 'getCpuUsages':
if len(args) != 4:
print('getCpuUsages requires 4 args')
sys.exit(1)
pp.pprint(client.getCpuUsages(eval(args[0]), args[1], eval(args[2]), eval(args[3]),))

elif cmd == 'registerApplicationModule':
if len(args) != 3:
print('registerApplicationModule requires 3 args')
Expand Down
Loading