@ -59,8 +59,8 @@ import org.thingsboard.server.dao.exception.IncorrectParameterException;
import org.thingsboard.server.dao.model.ModelConstants ;
import org.thingsboard.server.queue.util.TbCoreComponent ;
import org.thingsboard.server.service.edge.EdgeBulkImportService ;
import org.thingsboard.server.service.edge.instructions.EdgeInstallService ;
import org.thingsboard.server.service.edge.instructions.EdgeUpgradeService ;
import org.thingsboard.server.service.edge.instructions.EdgeInstallInstructions Service ;
import org.thingsboard.server.service.edge.instructions.EdgeUpgradeInstructions Service ;
import org.thingsboard.server.service.edge.rpc.EdgeRpcService ;
import org.thingsboard.server.service.entitiy.edge.TbEdgeService ;
import org.thingsboard.server.service.security.model.SecurityUser ;
@ -102,8 +102,8 @@ public class EdgeController extends BaseController {
private final EdgeBulkImportService edgeBulkImportService ;
private final TbEdgeService tbEdgeService ;
private final Optional < EdgeRpcService > edgeRpcServiceOpt ;
private final Optional < EdgeInstallService > edgeInstallServiceOpt ;
private final Optional < EdgeUpgradeService > edgeUpgradeServiceOpt ;
private final Optional < EdgeInstallInstructions Service > edgeInstallServiceOpt ;
private final Optional < EdgeUpgradeInstructions Service > edgeUpgradeServiceOpt ;
public static final String EDGE_ID = "edgeId" ;
public static final String EDGE_SECURITY_CHECK = "If the user has the authority of 'Tenant Administrator', the server checks that the edge is owned by the same tenant. " +
@ -564,7 +564,7 @@ public class EdgeController extends BaseController {
public EdgeInstructions getEdgeInstallInstructions (
@ApiParam ( value = EDGE_ID_PARAM_DESCRIPTION , required = true )
@PathVariable ( "edgeId" ) String strEdgeId ,
@ApiParam ( value = "Installation method ('docker', 'ubuntu' or 'centos')" , allowableValues = "docker,ubuntu,centos" )
@ApiParam ( value = "Installation method ('docker', 'ubuntu' or 'centos')" , allowableValues = "docker, ubuntu, centos" )
@PathVariable ( "method" ) String installationMethod ,
HttpServletRequest request ) throws ThingsboardException {
if ( isEdgesEnabled ( ) & & edgeInstallServiceOpt . isPresent ( ) ) {
@ -578,7 +578,7 @@ public class EdgeController extends BaseController {
}
@ApiOperation ( value = "Get Edge Upgrade Instructions (getEdgeUpgradeInstructions)" ,
notes = "Get an upgrade instructions for provided edge id ." + TENANT_AUTHORITY_PARAGRAPH ,
notes = "Get an upgrade instructions for provided edge version ." + TENANT_AUTHORITY_PARAGRAPH ,
produces = MediaType . APPLICATION_JSON_VALUE )
@PreAuthorize ( "hasAnyAuthority('TENANT_ADMIN')" )
@RequestMapping ( value = "/edge/instructions/upgrade/{edgeVersion}/{method}" , method = RequestMethod . GET )
@ -586,7 +586,7 @@ public class EdgeController extends BaseController {
public EdgeInstructions getEdgeUpgradeInstructions (
@ApiParam ( value = "Edge version" , required = true )
@PathVariable ( "edgeVersion" ) String edgeVersion ,
@ApiParam ( value = "Installation method ('docker', 'ubuntu' or 'centos')" , allowableValues = "docker,ubuntu,centos" )
@ApiParam ( value = "Upgrade method ('docker', 'ubuntu' or 'centos')" , allowableValues = "docker, ubuntu, centos" )
@PathVariable ( "method" ) String method ) throws Exception {
if ( isEdgesEnabled ( ) & & edgeUpgradeServiceOpt . isPresent ( ) ) {
return checkNotNull ( edgeUpgradeServiceOpt . get ( ) . getUpgradeInstructions ( edgeVersion , method ) ) ;