tvaultapi/src/main/java/com/tmobile/cso/vault/api/service/IAMServiceAccountsService.java
public ResponseEntity<String> listAllOnboardedIAMServiceAccounts(String token, UserDetails userDetails) {
		log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder()
				.put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER))
				.put(LogMessage.ACTION, "listAllOnboardedIAMServiceAccounts")
				.put(LogMessage.MESSAGE, "Trying to get all onboaded IAM service accounts")
				.put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).build()));
		if (!isAuthorizedIAMAdminApprole(token)) {
			return ResponseEntity.status(HttpStatus.FORBIDDEN).body(
					"{\"errors\":[\"Access denied. Not authorized to perform this operation.\"]}");
		}
		List<IAMServiceAccountResponse> onboardedlist = getAllIAMSvcFromMetadata(token);
		if (!onboardedlist.isEmpty()) {
			return ResponseEntity.status(HttpStatus.OK).body("{\"keys\":" + JSONUtil.getJSON(onboardedlist) + "}");
		}
		else {
			log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder()
					.put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER))
					.put(LogMessage.ACTION, "listAllOnboardedIAMServiceAccounts")
					.put(LogMessage.MESSAGE, "Empty list of IAM Service accounts from metadata")
					.put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).build()));
			return ResponseEntity.status(HttpStatus.NOT_FOUND).body("{\"keys\":[]}");
		}
	}
/**
	 * To get all IAM service accounts
	 *
	 * @param token
	 * @param userDetails
	 * @return
	 */
To get all IAM service accounts
@param token
@param userDetails
@return
To get all IAM service accounts @param token @param userDetails @return
public ResponseEntity<String> listAllOnboardedIAMServiceAccounts(String token, UserDetails userDetails) {
		log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder()
				.put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER))
				.put(LogMessage.ACTION, "listAllOnboardedIAMServiceAccounts")
				.put(LogMessage.MESSAGE, "Trying to get all onboaded IAM service accounts")
				.put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).build()));
		if (!isAuthorizedIAMAdminApprole(token)) {
			return ResponseEntity.status(HttpStatus.FORBIDDEN).body(
					"{\"errors\":[\"Access denied. Not authorized to perform this operation.\"]}");
		}
		List<IAMServiceAccountResponse> onboardedlist = getAllIAMSvcFromMetadata(token);
		if (!onboardedlist.isEmpty()) {
			return ResponseEntity.status(HttpStatus.OK).body("{\"keys\":" + JSONUtil.getJSON(onboardedlist) + "}");
		}
		else {
			log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder()
					.put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER))
					.put(LogMessage.ACTION, "listAllOnboardedIAMServiceAccounts")
					.put(LogMessage.MESSAGE, "Empty list of IAM Service accounts from metadata")
					.put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).build()));
			return ResponseEntity.status(HttpStatus.NOT_FOUND).body("{\"keys\":[]}");
		}
	}
public ResponseEntity < String > listAllOnboardedIAMServiceAccounts ( String token , UserDetails userDetails ) { log . debug ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , "listAllOnboardedIAMServiceAccounts" ) . put ( LogMessage . MESSAGE , "Trying to get all onboaded IAM service accounts" ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; if ( ! isAuthorizedIAMAdminApprole ( token ) ) { return ResponseEntity . status ( HttpStatus . FORBIDDEN ) . body ( "{\"errors\":[\"Access denied. Not authorized to perform this operation.\"]}" ) ; } List < IAMServiceAccountResponse > onboardedlist = getAllIAMSvcFromMetadata ( token ) ; if ( ! onboardedlist . isEmpty ( ) ) { return ResponseEntity . status ( HttpStatus . OK ) . body ( "{\"keys\":" + JSONUtil . getJSON ( onboardedlist ) + "}" ) ; } else { log . debug ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , "listAllOnboardedIAMServiceAccounts" ) . put ( LogMessage . MESSAGE , "Empty list of IAM Service accounts from metadata" ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; return ResponseEntity . status ( HttpStatus . NOT_FOUND ) . body ( "{\"keys\":[]}" ) ; } }
To get all IAM service accounts
 @param token
 @param userDetails
 @return
To get all IAM service accounts @param token @param userDetails @return