Class RemoteAPIAjaxController
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.ria.web.BaseController
-
- ca.corefacility.bioinformatics.irida.ria.web.ajax.RemoteAPIAjaxController
-
@RestController @RequestMapping("/ajax/remote_api") public class RemoteAPIAjaxController extends BaseController
Controller for asynchronous requests for remote api functionality.
-
-
Field Summary
-
Fields inherited from class ca.corefacility.bioinformatics.irida.ria.web.BaseController
MODEL_ERROR_ATTR
-
-
Constructor Summary
Constructors Constructor Description RemoteAPIAjaxController(RemoteAPIService remoteAPIService, UIRemoteAPIService service, org.springframework.context.MessageSource messageSource, UserService userService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<java.util.Date>
checkAPIStatus(java.lang.Long apiId)
Check the currently logged in user's OAuth2 connection status to a given APIorg.springframework.http.ResponseEntity<AjaxResponse>
createSynchronizedProject(CreateRemoteProjectRequest request)
Create a new synchronized remote projectvoid
deleteRemoteAPI(long remoteId)
Delete a Remote API ConnectionTableResponse<RemoteAPITableModel>
getAjaxAPIList(TableRequest tableRequest)
Get a list of the current page for the Remote API Tableorg.springframework.http.ResponseEntity<java.util.List<RemoteAPIModel>>
getListOfRemoteApis()
Get a list of all available remote API forg.springframework.http.ResponseEntity<java.util.List<RemoteProjectModel>>
getProjectsForAPI(long remoteId)
Get a list of project available at a remote APIorg.springframework.http.ResponseEntity<AjaxResponse>
postCreateRemoteAPI(RemoteAPI client, java.util.Locale locale)
Create a new client-
Methods inherited from class ca.corefacility.bioinformatics.irida.ria.web.BaseController
getErrorsFromDataIntegrityViolationException, getErrorsFromViolationException
-
-
-
-
Constructor Detail
-
RemoteAPIAjaxController
@Autowired public RemoteAPIAjaxController(RemoteAPIService remoteAPIService, UIRemoteAPIService service, org.springframework.context.MessageSource messageSource, UserService userService)
-
-
Method Detail
-
getAjaxAPIList
@RequestMapping(value="/list", produces="application/json") public TableResponse<RemoteAPITableModel> getAjaxAPIList(@RequestBody TableRequest tableRequest)
Get a list of the current page for the Remote API Table- Parameters:
tableRequest
- - the details for the current page of the Table- Returns:
TableResponse
-
checkAPIStatus
@RequestMapping("/status/{apiId}") public org.springframework.http.ResponseEntity<java.util.Date> checkAPIStatus(@PathVariable java.lang.Long apiId)
Check the currently logged in user's OAuth2 connection status to a given API- Parameters:
apiId
- The ID of the api- Returns:
- "valid" or "invalid_token" message
-
deleteRemoteAPI
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @DeleteMapping("/{remoteId}/delete") public void deleteRemoteAPI(@PathVariable long remoteId)
Delete a Remote API Connection- Parameters:
remoteId
- Identifier for a Remote API.
-
getListOfRemoteApis
@GetMapping("/apis") public org.springframework.http.ResponseEntity<java.util.List<RemoteAPIModel>> getListOfRemoteApis()
Get a list of all available remote API f- Returns:
- List of
RemoteAPIModel
-
getProjectsForAPI
@GetMapping("/{remoteId}/projects") public org.springframework.http.ResponseEntity<java.util.List<RemoteProjectModel>> getProjectsForAPI(@PathVariable long remoteId)
Get a list of project available at a remote API- Parameters:
remoteId
- identifier for a remote API- Returns:
- list of project
-
createSynchronizedProject
@PostMapping("/project") public org.springframework.http.ResponseEntity<AjaxResponse> createSynchronizedProject(@RequestBody CreateRemoteProjectRequest request)
Create a new synchronized remote project- Parameters:
request
- details about the remote project- Returns:
- status of created the new remote project
-
postCreateRemoteAPI
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PostMapping("/create") public org.springframework.http.ResponseEntity<AjaxResponse> postCreateRemoteAPI(RemoteAPI client, java.util.Locale locale)
Create a new client- Parameters:
client
- The client to addlocale
- Locale of the current user session- Returns:
- result of creating the remote api
-
-