Class AppRegistryController
java.lang.Object
org.springframework.cloud.dataflow.server.controller.AppRegistryController
@RestController
@RequestMapping("/apps")
@ExposesResourceFor(AppRegistrationResource.class)
public class AppRegistryController
extends Object
Handles all
DefaultAppRegistryService
related interactions.- Author:
- Glenn Renfro, Mark Fisher, Gunnar Hillert, Eric Bottard, Gary Russell, Patrick Peralta, Thomas Risberg, Chris Schaefer, Corneil du Plessis
-
Constructor Summary
ConstructorDescriptionAppRegistryController
(Optional<StreamDefinitionRepository> streamDefinitionRepository, Optional<StreamService> streamService, AppRegistryService appRegistryService, ApplicationConfigurationMetadataResolver metadataResolver, ForkJoinPool forkJoinPool, StreamDefinitionService streamDefinitionService, AppRegistrationAssemblerProvider<? extends AppRegistrationResource> appRegistrationAssemblerProvider) -
Method Summary
Modifier and TypeMethodDescriptioninfo
(ApplicationType type, String name, boolean exhaustive) info
(ApplicationType type, String name, String version, boolean exhaustive) Retrieve detailed information about a particular application.org.springframework.hateoas.PagedModel<? extends AppRegistrationResource>
list
(org.springframework.data.domain.Pageable pageable, org.springframework.data.web.PagedResourcesAssembler<AppRegistration> pagedResourcesAssembler, ApplicationType type, String search, String version, boolean defaultVersion) List app registrations.void
makeDefault
(ApplicationType type, String name, String version) Set a module version as defaultvoid
register
(ApplicationType type, String name, String bootVersion, String uri, String metadataUri, boolean force) void
register
(ApplicationType type, String name, String version, String bootVersion, String uri, String metadataUri, boolean force) Register a module name and type with its URI.org.springframework.hateoas.PagedModel<? extends AppRegistrationResource>
registerAll
(org.springframework.data.domain.Pageable pageable, org.springframework.data.web.PagedResourcesAssembler<AppRegistration> pagedResourcesAssembler, String uri, String apps, boolean force) Register all applications listed in a properties file or provided as key/value pairs.void
unregister
(ApplicationType type, String name) void
unregister
(ApplicationType type, String name, String version) Unregister an application by name and type.void
-
Constructor Details
-
AppRegistryController
public AppRegistryController(Optional<StreamDefinitionRepository> streamDefinitionRepository, Optional<StreamService> streamService, AppRegistryService appRegistryService, ApplicationConfigurationMetadataResolver metadataResolver, ForkJoinPool forkJoinPool, StreamDefinitionService streamDefinitionService, AppRegistrationAssemblerProvider<? extends AppRegistrationResource> appRegistrationAssemblerProvider)
-
-
Method Details
-
list
@GetMapping @ResponseStatus(OK) public org.springframework.hateoas.PagedModel<? extends AppRegistrationResource> list(org.springframework.data.domain.Pageable pageable, org.springframework.data.web.PagedResourcesAssembler<AppRegistration> pagedResourcesAssembler, @RequestParam(required=false) ApplicationType type, @RequestParam(required=false) String search, @RequestParam(required=false) String version, @RequestParam(required=false) boolean defaultVersion) List app registrations. Optional type and findByTaskNameContains parameters can be passed to do filtering. Search parameter only filters byAppRegistration
name field.- Parameters:
pageable
- Pagination informationpagedResourcesAssembler
- the resource assembler for app registrationstype
- the application type: source, sink, processor, taskversion
- optional application versionsearch
- optional findByTaskNameContains parameterdefaultVersion
- Indicator to use default version.- Returns:
- the list of registered applications
-
info
@GetMapping("/{type}/{name}/{version:.+}") @ResponseStatus(OK) public DetailedAppRegistrationResource info(@PathVariable ApplicationType type, @PathVariable String name, @PathVariable String version, @RequestParam(required=false) boolean exhaustive) Retrieve detailed information about a particular application.- Parameters:
type
- application typename
- application nameversion
- application versionexhaustive
- if set to true all properties are returned- Returns:
- detailed application information
-
info
@GetMapping("/{type}/{name}") @ResponseStatus(OK) public DetailedAppRegistrationResource info(@PathVariable ApplicationType type, @PathVariable String name, @RequestParam(required=false) boolean exhaustive) -
register
@PostMapping("/{type}/{name}/{version:.+}") @ResponseStatus(CREATED) public void register(@PathVariable ApplicationType type, @PathVariable String name, @PathVariable String version, @RequestParam(required=false) @Deprecated String bootVersion, @RequestParam String uri, @RequestParam(name="metadata-uri",required=false) String metadataUri, @RequestParam(defaultValue="false") boolean force) Register a module name and type with its URI.- Parameters:
type
- module typename
- module nameversion
- module versionbootVersion
- module boot version ornull
to use the default. Deprecated: bootVersion parameter is ignored.uri
- URI for the module artifact (e.g. maven://group:artifact:version)metadataUri
- URI for the metadata artifactforce
- iftrue
, overwrites a pre-existing registration
-
register
@PostMapping("/{type}/{name}") @ResponseStatus(CREATED) public void register(@PathVariable ApplicationType type, @PathVariable String name, @RequestParam(required=false) String bootVersion, @RequestParam String uri, @RequestParam(name="metadata-uri",required=false) String metadataUri, @RequestParam(defaultValue="false") boolean force) -
makeDefault
@PutMapping("/{type}/{name}/{version:.+}") @ResponseStatus(ACCEPTED) public void makeDefault(@PathVariable ApplicationType type, @PathVariable String name, @PathVariable String version) Set a module version as default- Parameters:
type
- module typename
- module nameversion
- module version
-
unregister
@DeleteMapping("/{type}/{name}/{version:.+}") @ResponseStatus(OK) public void unregister(@PathVariable ApplicationType type, @PathVariable String name, @PathVariable String version) Unregister an application by name and type. If the application does not exist, aNoSuchAppRegistrationException
will be thrown.- Parameters:
type
- the application typename
- the application nameversion
- application version
-
unregister
@DeleteMapping("/{type}/{name}") @ResponseStatus(OK) public void unregister(@PathVariable ApplicationType type, @PathVariable String name) -
unregisterAll
-
registerAll
@PostMapping @ResponseStatus(CREATED) public org.springframework.hateoas.PagedModel<? extends AppRegistrationResource> registerAll(org.springframework.data.domain.Pageable pageable, org.springframework.data.web.PagedResourcesAssembler<AppRegistration> pagedResourcesAssembler, @RequestParam(required=false) String uri, @RequestParam(required=false) String apps, @RequestParam(defaultValue="false") boolean force) Register all applications listed in a properties file or provided as key/value pairs.- Parameters:
pageable
- Pagination informationpagedResourcesAssembler
- the resource assembly for app registrationsuri
- URI for the properties fileapps
- key/value pairs representing applications, separated by newlinesforce
- iftrue
, overwrites any pre-existing registrations- Returns:
- the collection of registered applications
-