use of io.hops.hopsworks.common.featurestore.FeaturestoreDTO in project hopsworks by logicalclocks.
the class FeaturestoreService method getFeaturestoreByName.
/**
* Endpoint for getting a featurestore by name.
*
* @param name
* the name of the featurestore
* @return JSON representation of the featurestore
*/
@GET
// Anything else that is not just number should use this endpoint
@Path("/{name: [a-z0-9_]*(?=[a-z])[a-z0-9_]+}")
@Produces(MediaType.APPLICATION_JSON)
@AllowedProjectRoles({ AllowedProjectRoles.DATA_OWNER, AllowedProjectRoles.DATA_SCIENTIST })
@JWTRequired(acceptedTokens = { Audience.API, Audience.JOB }, allowedUserRoles = { "HOPS_ADMIN", "HOPS_USER" })
@ApiKeyRequired(acceptedScopes = { ApiScope.FEATURESTORE }, allowedUserRoles = { "HOPS_ADMIN", "HOPS_USER" })
@ApiOperation(value = "Get featurestore with a specific name", response = FeaturestoreDTO.class)
public Response getFeaturestoreByName(@ApiParam(value = "Id of the featurestore", required = true) @PathParam("name") String name, @Context SecurityContext sc) throws FeaturestoreException {
verifyNameProvided(name);
FeaturestoreDTO featurestoreDTO = featurestoreController.getFeaturestoreForProjectWithName(project, name);
GenericEntity<FeaturestoreDTO> featurestoreDTOGeneric = new GenericEntity<FeaturestoreDTO>(featurestoreDTO) {
};
return noCacheResponse.getNoCacheResponseBuilder(Response.Status.OK).entity(featurestoreDTOGeneric).build();
}
use of io.hops.hopsworks.common.featurestore.FeaturestoreDTO in project hopsworks by logicalclocks.
the class FeaturestoreService method getFeaturestore.
/**
* Endpoint for getting a featurestore with a particular Id
*
* @param featurestoreId the id of the featurestore
* @return JSON representation of the featurestore
*/
@GET
@Path("/{featurestoreId: [0-9]+}")
@Produces(MediaType.APPLICATION_JSON)
@AllowedProjectRoles({ AllowedProjectRoles.DATA_OWNER, AllowedProjectRoles.DATA_SCIENTIST })
@JWTRequired(acceptedTokens = { Audience.API }, allowedUserRoles = { "HOPS_ADMIN", "HOPS_USER" })
@ApiKeyRequired(acceptedScopes = { ApiScope.FEATURESTORE }, allowedUserRoles = { "HOPS_ADMIN", "HOPS_USER" })
@ApiOperation(value = "Get featurestore with specific Id", response = FeaturestoreDTO.class)
public Response getFeaturestore(@ApiParam(value = "Id of the featurestore", required = true) @PathParam("featurestoreId") Integer featurestoreId, @Context SecurityContext sc) throws FeaturestoreException {
if (featurestoreId == null) {
throw new IllegalArgumentException(RESTCodes.FeaturestoreErrorCode.FEATURESTORE_ID_NOT_PROVIDED.getMessage());
}
FeaturestoreDTO featurestoreDTO = featurestoreController.getFeaturestoreForProjectWithId(project, featurestoreId);
GenericEntity<FeaturestoreDTO> featurestoreDTOGeneric = new GenericEntity<FeaturestoreDTO>(featurestoreDTO) {
};
return noCacheResponse.getNoCacheResponseBuilder(Response.Status.OK).entity(featurestoreDTOGeneric).build();
}
use of io.hops.hopsworks.common.featurestore.FeaturestoreDTO in project hopsworks by logicalclocks.
the class FeatureStoreExpectationsResource method setFeaturestoreId.
/**
* Sets the featurestore of the featuregroups (provided by parent resource)
*
* @param featurestoreId id of the featurestore
* @throws FeaturestoreException FeaturestoreException
*/
public void setFeaturestoreId(Integer featurestoreId) throws FeaturestoreException {
// This call verifies that the project have access to the featurestoreId provided
FeaturestoreDTO featurestoreDTO = featurestoreController.getFeaturestoreForProjectWithId(project, featurestoreId);
this.featurestore = featurestoreController.getFeaturestoreWithId(featurestoreDTO.getFeaturestoreId());
}
use of io.hops.hopsworks.common.featurestore.FeaturestoreDTO in project hopsworks by logicalclocks.
the class FeaturestoreStorageConnectorService method setFeaturestoreId.
/**
* Sets the featurestore of the featuregroups (provided by parent resource)
*
* @param featurestoreId
* id of the featurestore
* @throws FeaturestoreException
*/
public void setFeaturestoreId(Integer featurestoreId) throws FeaturestoreException {
// This call verifies that the project have access to the featurestoreId provided
FeaturestoreDTO featurestoreDTO = featurestoreController.getFeaturestoreForProjectWithId(project, featurestoreId);
this.featurestore = featurestoreController.getFeaturestoreWithId(featurestoreDTO.getFeaturestoreId());
}
use of io.hops.hopsworks.common.featurestore.FeaturestoreDTO in project hopsworks by logicalclocks.
the class TrainingDatasetService method setFeaturestoreId.
/**
* Sets the featurestore of the training datasets (provided by parent resource)
*
* @param featurestoreId id of the featurestore
* @throws FeaturestoreException
*/
public void setFeaturestoreId(Integer featurestoreId) throws FeaturestoreException {
// This call verifies that the project have access to the featurestoreId provided
FeaturestoreDTO featurestoreDTO = featurestoreController.getFeaturestoreForProjectWithId(project, featurestoreId);
this.featurestore = featurestoreController.getFeaturestoreWithId(featurestoreDTO.getFeaturestoreId());
}
Aggregations