io.swagger.annotations.ExtensionProperty Java Examples
The following examples show how to use
io.swagger.annotations.ExtensionProperty.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ConnectedCupService.java From product-iots with Apache License 2.0 | 6 votes |
@Path("device/ordercoffee") @POST @ApiOperation( consumes = MediaType.APPLICATION_JSON, httpMethod = "POST", value = "Order Coffee", notes = "", response = Response.class, tags = "connectedcup", extensions = { @Extension(properties = { @ExtensionProperty(name = SCOPE, value = "perm:connectedcup:enroll") }) } ) Response orderCoffee(@QueryParam("deviceId") String deviceId);
Example #2
Source File: BucketResource.java From nifi-registry with Apache License 2.0 | 6 votes |
@POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @ApiOperation( value = "Create bucket", response = Bucket.class, extensions = { @Extension(name = "access-policy", properties = { @ExtensionProperty(name = "action", value = "write"), @ExtensionProperty(name = "resource", value = "/buckets") }) } ) @ApiResponses({ @ApiResponse(code = 400, message = HttpStatusMessages.MESSAGE_400), @ApiResponse(code = 401, message = HttpStatusMessages.MESSAGE_401), @ApiResponse(code = 403, message = HttpStatusMessages.MESSAGE_403) }) public Response createBucket( @ApiParam(value = "The bucket to create", required = true) final Bucket bucket) { final Bucket createdBucket = serviceFacade.createBucket(bucket); publish(EventFactory.bucketCreated(createdBucket)); return Response.status(Response.Status.OK).entity(createdBucket).build(); }
Example #3
Source File: TenantResource.java From nifi-registry with Apache License 2.0 | 6 votes |
/** * Retrieves all the of user groups in this NiFi. * * @return a list of all user groups in this NiFi. */ @GET @Consumes(MediaType.WILDCARD) @Produces(MediaType.APPLICATION_JSON) @Path("user-groups") @ApiOperation( value = "Get user groups", notes = NON_GUARANTEED_ENDPOINT, response = UserGroup.class, responseContainer = "List", extensions = { @Extension(name = "access-policy", properties = { @ExtensionProperty(name = "action", value = "read"), @ExtensionProperty(name = "resource", value = "/tenants") }) } ) @ApiResponses({ @ApiResponse(code = 400, message = HttpStatusMessages.MESSAGE_400), @ApiResponse(code = 401, message = HttpStatusMessages.MESSAGE_401), @ApiResponse(code = 403, message = HttpStatusMessages.MESSAGE_403), @ApiResponse(code = 404, message = HttpStatusMessages.MESSAGE_404), @ApiResponse(code = 409, message = HttpStatusMessages.MESSAGE_409) }) public Response getUserGroups() { final List<UserGroup> userGroups = serviceFacade.getUserGroups(); return generateOkResponse(userGroups).build(); }
Example #4
Source File: AccessPolicyResource.java From nifi-registry with Apache License 2.0 | 6 votes |
/** * Retrieves the specified access policy. * * @param identifier The id of the access policy to retrieve * @return An accessPolicyEntity. */ @GET @Consumes(MediaType.WILDCARD) @Produces(MediaType.APPLICATION_JSON) @Path("{id}") @ApiOperation( value = "Get access policy", response = AccessPolicy.class, extensions = { @Extension(name = "access-policy", properties = { @ExtensionProperty(name = "action", value = "read"), @ExtensionProperty(name = "resource", value = "/policies") }) } ) @ApiResponses({ @ApiResponse(code = 401, message = HttpStatusMessages.MESSAGE_401), @ApiResponse(code = 403, message = HttpStatusMessages.MESSAGE_403), @ApiResponse(code = 404, message = HttpStatusMessages.MESSAGE_404), @ApiResponse(code = 409, message = HttpStatusMessages.MESSAGE_409) }) public Response getAccessPolicy( @ApiParam(value = "The access policy id.", required = true) @PathParam("id") final String identifier) { final AccessPolicy accessPolicy = serviceFacade.getAccessPolicy(identifier); return generateOkResponse(accessPolicy).build(); }
Example #5
Source File: AccessPolicyResource.java From nifi-registry with Apache License 2.0 | 6 votes |
/** * Retrieves all access policies * * @return A list of access policies */ @GET @Consumes(MediaType.WILDCARD) @Produces(MediaType.APPLICATION_JSON) @ApiOperation( value = "Get all access policies", response = AccessPolicy.class, responseContainer = "List", extensions = { @Extension(name = "access-policy", properties = { @ExtensionProperty(name = "action", value = "read"), @ExtensionProperty(name = "resource", value = "/policies") }) } ) @ApiResponses({ @ApiResponse(code = 401, message = HttpStatusMessages.MESSAGE_401), @ApiResponse(code = 403, message = HttpStatusMessages.MESSAGE_403), @ApiResponse(code = 409, message = HttpStatusMessages.MESSAGE_409) }) public Response getAccessPolicies() { List<AccessPolicy> accessPolicies = serviceFacade.getAccessPolicies(); if (accessPolicies == null) { accessPolicies = Collections.emptyList(); } return generateOkResponse(accessPolicies).build(); }
Example #6
Source File: DeviceAgentService.java From carbon-device-mgt with Apache License 2.0 | 5 votes |
@DELETE @Path("/enroll/{type}/{id}") @ApiOperation( httpMethod = "DELETE", value = "Unregistering a Device", notes = "Use this REST API to unregister a device.", tags = "Device Management", extensions = { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:device:disenroll") }) } ) @ApiResponses(value = { @ApiResponse( code = 200, message = "OK. \n Successfully disenrolled the device."), @ApiResponse( code = 404, message = "Not Found. \n The specified resource does not exist."), @ApiResponse( code = 500, message = "Internal Server Error. \n " + "Server error occurred while dis-enrolling the device.") }) Response disEnrollDevice( @ApiParam(name = "type", value = "The unique device identifier.") @PathParam("type") String type, @ApiParam(name = "id", value = "The unique device identifier.") @PathParam("id") String id);
Example #7
Source File: DeviceAgentService.java From carbon-device-mgt with Apache License 2.0 | 5 votes |
@DELETE @Path("/enroll/{type}/{id}") @ApiOperation( httpMethod = "DELETE", value = "Unregistering a Device", notes = "Use this REST API to unregister a device.", tags = "Device Management", extensions = { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:device:disenroll") }) } ) @ApiResponses(value = { @ApiResponse( code = 200, message = "OK. \n Successfully disenrolled the device."), @ApiResponse( code = 404, message = "Not Found. \n The specified resource does not exist."), @ApiResponse( code = 500, message = "Internal Server Error. \n " + "Server error occurred while dis-enrolling the device.") }) Response disEnrollDevice( @ApiParam(name = "type", value = "Define the device type, such as android, ios, or windows.") @PathParam("type") String type, @ApiParam(name = "id", value = "The unique device identifier.") @PathParam("id") String id);
Example #8
Source File: TestOperationGenerator.java From servicecomb-java-chassis with Apache License 2.0 | 5 votes |
@ApiOperation(value = "value1", tags = {"tag1", "tag2"}, responseHeaders = {@ResponseHeader(name = "x-user-name", response = String.class), @ResponseHeader(name = "x-user-id", response = String.class)}, extensions = { @Extension(name = "x-class-name", properties = {@ExtensionProperty(value = "value", name = "key")})}) @ApiResponse(code = 200, message = "200 is ok............", response = String.class, responseHeaders = @ResponseHeader(name = "x-user-domain", response = String.class)) public void apiOperationThenResponse() { }
Example #9
Source File: TenantResource.java From nifi-registry with Apache License 2.0 | 5 votes |
/** * Removes the specified user group. * * @param httpServletRequest request * @param identifier The id of the user group to remove. * @return The deleted user group. */ @DELETE @Consumes(MediaType.WILDCARD) @Produces(MediaType.APPLICATION_JSON) @Path("user-groups/{id}") @ApiOperation( value = "Delete user group", notes = NON_GUARANTEED_ENDPOINT, response = UserGroup.class, extensions = { @Extension(name = "access-policy", properties = { @ExtensionProperty(name = "action", value = "delete"), @ExtensionProperty(name = "resource", value = "/tenants") }) } ) @ApiResponses({ @ApiResponse(code = 400, message = HttpStatusMessages.MESSAGE_400), @ApiResponse(code = 401, message = HttpStatusMessages.MESSAGE_401), @ApiResponse(code = 403, message = HttpStatusMessages.MESSAGE_403), @ApiResponse(code = 404, message = HttpStatusMessages.MESSAGE_404), @ApiResponse(code = 409, message = HttpStatusMessages.MESSAGE_409) }) public Response removeUserGroup( @Context final HttpServletRequest httpServletRequest, @ApiParam(value = "The version is used to verify the client is working with the latest version of the entity.", required = true) @QueryParam(VERSION) final LongParameter version, @ApiParam(value = "If the client id is not specified, new one will be generated. This value (whether specified or generated) is included in the response.") @QueryParam(CLIENT_ID) @DefaultValue(StringUtils.EMPTY) final ClientIdParameter clientId, @ApiParam(value = "The user group id.", required = true) @PathParam("id") final String identifier) { final RevisionInfo revisionInfo = getRevisionInfo(version, clientId); final UserGroup userGroup = serviceFacade.deleteUserGroup(identifier, revisionInfo); publish(EventFactory.userGroupDeleted(userGroup)); return generateOkResponse(userGroup).build(); }
Example #10
Source File: BucketFlowResource.java From nifi-registry with Apache License 2.0 | 5 votes |
@DELETE @Path("{flowId}") @Consumes(MediaType.WILDCARD) @Produces(MediaType.APPLICATION_JSON) @ApiOperation( value = "Delete bucket flow", notes = "Deletes a flow, including all saved versions of that flow.", response = VersionedFlow.class, extensions = { @Extension(name = "access-policy", properties = { @ExtensionProperty(name = "action", value = "delete"), @ExtensionProperty(name = "resource", value = "/buckets/{bucketId}") }) } ) @ApiResponses({ @ApiResponse(code = 401, message = HttpStatusMessages.MESSAGE_401), @ApiResponse(code = 403, message = HttpStatusMessages.MESSAGE_403), @ApiResponse(code = 404, message = HttpStatusMessages.MESSAGE_404), @ApiResponse(code = 409, message = HttpStatusMessages.MESSAGE_409) }) public Response deleteFlow( @ApiParam(value = "The version is used to verify the client is working with the latest version of the entity.", required = true) @QueryParam(VERSION) final LongParameter version, @ApiParam(value = "If the client id is not specified, new one will be generated. This value (whether specified or generated) is included in the response.") @QueryParam(CLIENT_ID) @DefaultValue(StringUtils.EMPTY) final ClientIdParameter clientId, @PathParam("bucketId") @ApiParam("The bucket identifier") final String bucketId, @PathParam("flowId") @ApiParam("The flow identifier") final String flowId) { final RevisionInfo revisionInfo = getRevisionInfo(version, clientId); final VersionedFlow deletedFlow = serviceFacade.deleteFlow(bucketId, flowId, revisionInfo); publish(EventFactory.flowDeleted(deletedFlow)); return Response.status(Response.Status.OK).entity(deletedFlow).build(); }
Example #11
Source File: TestOperationGenerator.java From servicecomb-java-chassis with Apache License 2.0 | 5 votes |
@ApiResponse(code = 200, message = "200 is ok............", response = String.class, responseHeaders = @ResponseHeader(name = "x-user-domain", response = String.class)) @ApiOperation(value = "value1", tags = {"tag1", "tag2"}, responseHeaders = {@ResponseHeader(name = "x-user-name", response = String.class), @ResponseHeader(name = "x-user-id", response = String.class)}, extensions = { @Extension(name = "x-class-name", properties = {@ExtensionProperty(value = "value", name = "key")})}) public void responseThenApiOperation() { }
Example #12
Source File: UserManagementService.java From carbon-device-mgt with Apache License 2.0 | 5 votes |
@GET @Path("/checkUser") @ApiOperation( produces = MediaType.APPLICATION_JSON, httpMethod = "GET", value = "Getting the User existence status", notes = "Check if the user exists in the user store.", tags = "User Management", extensions = { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:users:is-exist") }) } ) @ApiResponses(value = { @ApiResponse( code = 200, message = "OK. \n Successfully fetched user exist status.", response = BasicUserInfoList.class, responseHeaders = { @ResponseHeader( name = "Content-Type", description = "The content type of the body") }), @ApiResponse( code = 406, message = "Not Acceptable.\n The requested media type is not supported", response = ErrorResponse.class), @ApiResponse( code = 500, message = "Internal Server Error. \n Server error occurred while fetching the " + "total user exist status.", response = ErrorResponse.class) }) Response isUserExists(@ApiParam( name = "username", value = "The username of the user.", required = true) @QueryParam("username") String userName);
Example #13
Source File: ExtensionRepoResource.java From nifi-registry with Apache License 2.0 | 5 votes |
@GET @Path("{bucketName}/{groupId}/{artifactId}/{version}/sha256") @Consumes(MediaType.WILDCARD) @Produces(MediaType.TEXT_PLAIN) @ApiOperation( value = "Get extension repo version checksum", notes = "Gets the hex representation of the SHA-256 digest for the binary content of the bundle " + "with the given bucket, group, artifact, and version." + NON_GUARANTEED_ENDPOINT, response = String.class, extensions = { @Extension(name = "access-policy", properties = { @ExtensionProperty(name = "action", value = "read"), @ExtensionProperty(name = "resource", value = "/buckets/{bucketId}") }) } ) @ApiResponses({ @ApiResponse(code = 400, message = HttpStatusMessages.MESSAGE_400), @ApiResponse(code = 401, message = HttpStatusMessages.MESSAGE_401), @ApiResponse(code = 403, message = HttpStatusMessages.MESSAGE_403), @ApiResponse(code = 404, message = HttpStatusMessages.MESSAGE_404), @ApiResponse(code = 409, message = HttpStatusMessages.MESSAGE_409) }) public Response getExtensionRepoVersionSha256( @PathParam("bucketName") @ApiParam("The bucket name") final String bucketName, @PathParam("groupId") @ApiParam("The group identifier") final String groupId, @PathParam("artifactId") @ApiParam("The artifact identifier") final String artifactId, @PathParam("version") @ApiParam("The version") final String version ) { final String sha256Hex = serviceFacade.getExtensionRepoVersionSha256(bucketName, groupId, artifactId, version); return Response.ok(sha256Hex, MediaType.TEXT_PLAIN).build(); }
Example #14
Source File: FlowResource.java From nifi-registry with Apache License 2.0 | 5 votes |
@GET @Path("{flowId}") @Consumes(MediaType.WILDCARD) @Produces(MediaType.APPLICATION_JSON) @ApiOperation( value = "Get flow", notes = "Gets a flow by id.", nickname = "globalGetFlow", response = VersionedFlow.class, extensions = { @Extension(name = "access-policy", properties = { @ExtensionProperty(name = "action", value = "read"), @ExtensionProperty(name = "resource", value = "/buckets/{bucketId}") }) } ) @ApiResponses({ @ApiResponse(code = 400, message = HttpStatusMessages.MESSAGE_400), @ApiResponse(code = 401, message = HttpStatusMessages.MESSAGE_401), @ApiResponse(code = 403, message = HttpStatusMessages.MESSAGE_403), @ApiResponse(code = 404, message = HttpStatusMessages.MESSAGE_404), @ApiResponse(code = 409, message = HttpStatusMessages.MESSAGE_409) }) public Response getFlow( @PathParam("flowId") @ApiParam("The flow identifier") final String flowId) { final VersionedFlow flow = serviceFacade.getFlow(flowId); return Response.status(Response.Status.OK).entity(flow).build(); }
Example #15
Source File: FlowResource.java From nifi-registry with Apache License 2.0 | 5 votes |
@GET @Path("{flowId}/versions/{versionNumber: \\d+}") @Consumes(MediaType.WILDCARD) @Produces(MediaType.APPLICATION_JSON) @ApiOperation( value = "Get flow version", notes = "Gets the given version of a flow, including metadata and flow content.", nickname = "globalGetFlowVersion", response = VersionedFlowSnapshot.class, extensions = { @Extension(name = "access-policy", properties = { @ExtensionProperty(name = "action", value = "read"), @ExtensionProperty(name = "resource", value = "/buckets/{bucketId}") }) } ) @ApiResponses({ @ApiResponse(code = 400, message = HttpStatusMessages.MESSAGE_400), @ApiResponse(code = 401, message = HttpStatusMessages.MESSAGE_401), @ApiResponse(code = 403, message = HttpStatusMessages.MESSAGE_403), @ApiResponse(code = 404, message = HttpStatusMessages.MESSAGE_404), @ApiResponse(code = 409, message = HttpStatusMessages.MESSAGE_409) }) public Response getFlowVersion( @PathParam("flowId") @ApiParam("The flow identifier") final String flowId, @PathParam("versionNumber") @ApiParam("The version number") final Integer versionNumber) { final VersionedFlowSnapshot snapshot = serviceFacade.getFlowSnapshot(flowId, versionNumber); return Response.status(Response.Status.OK).entity(snapshot).build(); }
Example #16
Source File: FlowResource.java From nifi-registry with Apache License 2.0 | 5 votes |
@GET @Path("{flowId}/versions/latest/metadata") @Consumes(MediaType.WILDCARD) @Produces(MediaType.APPLICATION_JSON) @ApiOperation( value = "Get latest flow version metadata", notes = "Gets the metadata for the latest version of a flow.", nickname = "globalGetLatestFlowVersionMetadata", response = VersionedFlowSnapshotMetadata.class, extensions = { @Extension(name = "access-policy", properties = { @ExtensionProperty(name = "action", value = "read"), @ExtensionProperty(name = "resource", value = "/buckets/{bucketId}") }) } ) @ApiResponses({ @ApiResponse(code = 401, message = HttpStatusMessages.MESSAGE_401), @ApiResponse(code = 403, message = HttpStatusMessages.MESSAGE_403), @ApiResponse(code = 404, message = HttpStatusMessages.MESSAGE_404), @ApiResponse(code = 409, message = HttpStatusMessages.MESSAGE_409) }) public Response getLatestFlowVersionMetadata( @PathParam("flowId") @ApiParam("The flow identifier") final String flowId) { final VersionedFlowSnapshotMetadata latestMetadata = serviceFacade.getLatestFlowSnapshotMetadata(flowId); return Response.status(Response.Status.OK).entity(latestMetadata).build(); }
Example #17
Source File: AccessPolicyResource.java From nifi-registry with Apache License 2.0 | 5 votes |
/** * Update an access policy. * * @param httpServletRequest request * @param identifier The id of the access policy to update. * @param requestAccessPolicy An access policy. * @return the updated access policy. */ @PUT @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Path("{id}") @ApiOperation( value = "Update access policy", response = AccessPolicy.class, extensions = { @Extension(name = "access-policy", properties = { @ExtensionProperty(name = "action", value = "write"), @ExtensionProperty(name = "resource", value = "/policies") }) } ) @ApiResponses({ @ApiResponse(code = 400, message = HttpStatusMessages.MESSAGE_400), @ApiResponse(code = 401, message = HttpStatusMessages.MESSAGE_401), @ApiResponse(code = 403, message = HttpStatusMessages.MESSAGE_403), @ApiResponse(code = 404, message = HttpStatusMessages.MESSAGE_404), @ApiResponse(code = 409, message = HttpStatusMessages.MESSAGE_409 + " The NiFi Registry might not be configured to use a ConfigurableAccessPolicyProvider.") }) public Response updateAccessPolicy( @Context final HttpServletRequest httpServletRequest, @ApiParam(value = "The access policy id.", required = true) @PathParam("id") final String identifier, @ApiParam(value = "The access policy configuration details.", required = true) final AccessPolicy requestAccessPolicy) { if (requestAccessPolicy == null) { throw new IllegalArgumentException("Access policy details must be specified when updating a policy."); } if (!identifier.equals(requestAccessPolicy.getIdentifier())) { throw new IllegalArgumentException(String.format("The policy id in the request body (%s) does not equal the " + "policy id of the requested resource (%s).", requestAccessPolicy.getIdentifier(), identifier)); } final AccessPolicy createdPolicy = serviceFacade.updateAccessPolicy(requestAccessPolicy); return generateOkResponse(createdPolicy).build(); }
Example #18
Source File: BucketBundleResource.java From nifi-registry with Apache License 2.0 | 5 votes |
@GET @Consumes(MediaType.WILDCARD) @Produces(MediaType.APPLICATION_JSON) @ApiOperation( value = "Get extension bundles by bucket", notes = NON_GUARANTEED_ENDPOINT, response = Bundle.class, responseContainer = "List", extensions = { @Extension(name = "access-policy", properties = { @ExtensionProperty(name = "action", value = "read"), @ExtensionProperty(name = "resource", value = "/buckets/{bucketId}") }) } ) @ApiResponses({ @ApiResponse(code = 400, message = HttpStatusMessages.MESSAGE_400), @ApiResponse(code = 401, message = HttpStatusMessages.MESSAGE_401), @ApiResponse(code = 403, message = HttpStatusMessages.MESSAGE_403), @ApiResponse(code = 404, message = HttpStatusMessages.MESSAGE_404), @ApiResponse(code = 409, message = HttpStatusMessages.MESSAGE_409) }) public Response getExtensionBundles( @PathParam("bucketId") @ApiParam(value = "The bucket identifier", required = true) final String bucketId) { final List<Bundle> bundles = serviceFacade.getBundlesByBucket(bucketId); return Response.status(Response.Status.OK).entity(bundles).build(); }
Example #19
Source File: BundleResource.java From nifi-registry with Apache License 2.0 | 5 votes |
@GET @Path("{bundleId}/versions") @Consumes(MediaType.WILDCARD) @Produces(MediaType.APPLICATION_JSON) @ApiOperation( value = "Get bundle versions", notes = "Gets the metadata for the versions of the given extension bundle. " + NON_GUARANTEED_ENDPOINT, nickname = "globalGetBundleVersions", response = BundleVersionMetadata.class, responseContainer = "List", extensions = { @Extension(name = "access-policy", properties = { @ExtensionProperty(name = "action", value = "read"), @ExtensionProperty(name = "resource", value = "/buckets/{bucketId}") }) } ) @ApiResponses({ @ApiResponse(code = 400, message = HttpStatusMessages.MESSAGE_400), @ApiResponse(code = 401, message = HttpStatusMessages.MESSAGE_401), @ApiResponse(code = 403, message = HttpStatusMessages.MESSAGE_403), @ApiResponse(code = 404, message = HttpStatusMessages.MESSAGE_404), @ApiResponse(code = 409, message = HttpStatusMessages.MESSAGE_409) }) public Response getBundleVersions( @PathParam("bundleId") @ApiParam("The extension bundle identifier") final String bundleId) { final SortedSet<BundleVersionMetadata> bundleVersions = serviceFacade.getBundleVersions(bundleId); return Response.status(Response.Status.OK).entity(bundleVersions).build(); }
Example #20
Source File: UserManagementService.java From carbon-device-mgt with Apache License 2.0 | 5 votes |
@GET @Path("/count") @ApiOperation( produces = MediaType.APPLICATION_JSON, httpMethod = "GET", value = "Getting the User Count", notes = "Get the number of users in WSO2 IoTS via this REST API.", tags = "User Management", extensions = { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:users:count") }) } ) @ApiResponses(value = { @ApiResponse( code = 200, message = "OK. \n Successfully fetched the user count.", response = BasicUserInfoList.class, responseHeaders = { @ResponseHeader( name = "Content-Type", description = "The content type of the body") }), @ApiResponse( code = 406, message = "Not Acceptable.\n The requested media type is not supported", response = ErrorResponse.class), @ApiResponse( code = 500, message = "Internal Server Error. \n Server error occurred while fetching the total number of users in WSO2 IoTS.", response = ErrorResponse.class) }) Response getUserCount();
Example #21
Source File: ActivityInfoProviderService.java From carbon-device-mgt with Apache License 2.0 | 4 votes |
@GET @Path("/{id}/{devicetype}/{deviceid}") @ApiOperation( produces = MediaType.APPLICATION_JSON, httpMethod = "GET", value = "Getting a Specific Activity Details of a Device", notes = "Retrieve the details of a specific activity/operation, that was sent to a specific device.", tags = "Activity Info Provider", extensions = { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:get-activity") }) } ) @ApiResponses(value = { @ApiResponse( code = 200, message = "OK. \n Successfully fetched the activity details.", response = Activity.class, responseHeaders = { @ResponseHeader( name = "Content-Type", description = "The content type of the body"), @ResponseHeader( name = "ETag", description = "Entity Tag of the response resource.\n" + "Used by caches, or in conditional requests."), @ResponseHeader( name = "Last-Modified", description = "Date and time the resource was last modified.\n" + "Used by caches, or in conditional requests."), }), @ApiResponse( code = 304, message = "Not Modified. \n Empty body because the client already has the latest version of " + "the requested resource."), @ApiResponse( code = 400, message = "Bad Request. \n Invalid request or validation error.", response = ErrorResponse.class), @ApiResponse( code = 401, message = "Unauthorized. \n Unauthorized request."), @ApiResponse( code = 404, message = "Not Found. \n No activity found with the given ID.", response = ErrorResponse.class), @ApiResponse( code = 406, message = "Not Acceptable.\n The requested media type is not supported"), @ApiResponse( code = 500, message = "Internal Server Error. \n Server error occurred while fetching the activity data.", response = ErrorResponse.class) }) Response getActivityByDevice( @ApiParam( name = "id", value = "Activity id of the operation/activity.", required = true, defaultValue = "ACTIVITY_1") @PathParam("id") @Size(max = 45) String id, @ApiParam( name = "devicetype", value = "The device type name, such as ios, android, windows, or fire-alarm.", required = true) @PathParam("devicetype") @Size(max = 45) String type, @ApiParam( name = "deviceid", value = "The device identifier of the device you want ot get details.", required = true) @PathParam("deviceid") @Size(max = 45) String deviceid, @ApiParam( name = "If-Modified-Since", value = "Checks if the requested variant was modified, since the specified date-time\n." + "Provide the value in the Java Date Format: EEE, d MMM yyyy HH:mm:ss Z\n." + "Example: Mon, 05 Jan 2014 15:10:00 +0200", required = false) @HeaderParam("If-Modified-Since") String ifModifiedSince);
Example #22
Source File: UserManagementService.java From carbon-device-mgt with Apache License 2.0 | 4 votes |
@GET @Path("/{username}") @ApiOperation( produces = MediaType.APPLICATION_JSON, httpMethod = "GET", value = "Getting Details of a User", notes = "Get the details of a user registered with WSO2 IoTS using the REST API.", response = BasicUserInfo.class, tags = "User Management", extensions = { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:users:details") }) } ) @ApiResponses(value = { @ApiResponse( code = 200, message = "OK. \n Successfully fetched the details of the specified user.", response = BasicUserInfo.class, responseHeaders = { @ResponseHeader( name = "Content-Type", description = "The content type of the body"), @ResponseHeader( name = "ETag", description = "Entity Tag of the response resource.\n" + "Used by caches, or in conditional requests."), @ResponseHeader( name = "Last-Modified", description = "Date and time the resource was last modified.\n" + "Used by caches, or in conditional requests."), }), @ApiResponse( code = 304, message = "Not Modified. \n Empty body because the client already has the latest version of the requested resource."), @ApiResponse( code = 404, message = "Not Found. \n The specified resource does not exist.", response = ErrorResponse.class), @ApiResponse( code = 406, message = "Not Acceptable.\n The requested media type is not supported", response = ErrorResponse.class), @ApiResponse( code = 500, message = "Internal Server ErrorResponse. \n Server error occurred while" + " fetching the ruser details.", response = ErrorResponse.class) }) Response getUser( @ApiParam( name = "username", value = "Provide the username of the user.", required = true, defaultValue = "admin") @PathParam("username") String username, @ApiParam( name = "domain", value = "The domain name of the user store.", required = false) @QueryParam("domain") String domain, @ApiParam( name = "If-Modified-Since", value = "Checks if the requested variant was modified, since the specified date-time.\n" + "Provide the value in the following format: EEE, d MMM yyyy HH:mm:ss Z.\n" + "Example: Mon, 05 Jan 2014 15:10:00 +0200", required = false) @HeaderParam("If-Modified-Since") String ifModifiedSince);
Example #23
Source File: DeviceEventManagementService.java From carbon-device-mgt with Apache License 2.0 | 4 votes |
@DELETE @Path("/{type}") @ApiOperation( produces = MediaType.APPLICATION_JSON, httpMethod = "DELETE", value = "Delete Event Type Definition", notes = "Delete the event definition of a device.", tags = "Device Event Management", extensions = { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:events") }) } ) @ApiResponses( value = { @ApiResponse( code = 200, message = "OK. \n Successfully deleted the event definition.", responseHeaders = { @ResponseHeader( name = "Content-Type", description = "The content type of the body"), @ResponseHeader( name = "ETag", description = "Entity Tag of the response resource.\n" + "Used by caches, or in conditional requests."), @ResponseHeader( name = "Last-Modified", description = "Date and time the resource was last modified.\n" + "Used by caches, or in conditional requests."), } ), @ApiResponse( code = 400, message = "Bad Request. \n"), @ApiResponse( code = 406, message = "Not Acceptable.\n The requested media type is not supported"), @ApiResponse( code = 500, message = "Internal Server Error. \n Server error occurred while fetching the " + "list of supported device types.", response = ErrorResponse.class) } ) Response deleteDeviceTypeEventDefinitions(@ApiParam(name = "type", value = "The device type, such as android, " + "ios, and windows.", required = false) @PathParam("type")String deviceType);
Example #24
Source File: DeviceManagementService.java From carbon-device-mgt with Apache License 2.0 | 4 votes |
@POST @Path("/type/{device-type}/id/{device-id}/rename") @ApiOperation( produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON, httpMethod = "POST", value = "Update the Displayed Name of the Device", notes = "Use this API to rename a device so that it is easy for you to identify devices.", tags = "Device Management", extensions = { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:devices:update") }) } ) @ApiResponses( value = { @ApiResponse( code = 200, message = "OK. \n Successfully fetched information of the device.", response = Device.class, responseHeaders = { @ResponseHeader( name = "Content-Type", description = "The content type of the body"), @ResponseHeader( name = "ETag", description = "Entity Tag of the response resource.\n" + "Used by caches, or in conditional requests."), @ResponseHeader( name = "Last-Modified", description = "Date and time the resource has been modified the last time.\n" + "Used by caches, or in conditional requests."), }), @ApiResponse( code = 304, message = "Not Modified. Empty body because the client already has the latest " + "version of the requested resource."), @ApiResponse( code = 400, message = "Bad Request. \n Invalid request or validation error.", response = ErrorResponse.class), @ApiResponse( code = 404, message = "Not Found. \n No device is found under the provided type and id.", response = ErrorResponse.class), @ApiResponse( code = 500, message = "Internal Server Error. \n " + "Server error occurred while retrieving information requested device.", response = ErrorResponse.class) }) Response renameDevice( @ApiParam( name = "device", value = "The payload containing the new name of the device.", required = true) Device device, @ApiParam( name = "device-type", value = "The device type, such as ios, android, or windows.", required = true) @PathParam("device-type") @Size(max = 45) String deviceType, @ApiParam( name = "device-id", value = "The device identifier of the device.", required = true) @PathParam("device-id") @Size(max = 45) String deviceId);
Example #25
Source File: CertificateManagementAdminService.java From carbon-device-mgt with Apache License 2.0 | 4 votes |
/** * Get a certificate when the serial number is given. * * @param serialNumber serial of the certificate needed. * @return certificate response. */ @GET @Path("/{serialNumber}") @ApiOperation( consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON, httpMethod = "GET", value = "Getting Details of an SSL Certificate", notes = "Get the client side SSL certificate details.", tags = "Certificate Management", extensions = { @Extension(properties = { @ExtensionProperty(name = SCOPE, value = "perm:admin:certificates:details") }) } ) @ApiResponses(value = { @ApiResponse( code = 200, message = "OK. \n Successfully fetched the certificate details.", response = CertificateResponse.class, responseHeaders = { @ResponseHeader( name = "Content-Type", description = "The content type of the body"), @ResponseHeader( name = "ETag", description = "Entity Tag of the response resource.\n" + "Used by caches, or in conditional requests."), @ResponseHeader( name = "Last-Modified", description = "Date and time the resource was last modified.\n" + "Used by caches, or in conditional requests."), }), @ApiResponse( code = 304, message = "Not Modified. \n " + "Empty body because the client already has the latest version of the requested resource."), @ApiResponse( code = 400, message = "Bad Request. \n Invalid request or validation error.", response = ErrorResponse.class), @ApiResponse( code = 404, message = "Not Found. \n The specified certificate does not exist."), @ApiResponse( code = 500, message = "Internal Server Error. \n " + "Server error occurred while retrieving the requested certificate information.", response = ErrorResponse.class) }) Response getCertificate( @ApiParam(name = "serialNumber", value = "The serial number of the certificate.", required = true, defaultValue = "124380353155528759302") @PathParam("serialNumber") String serialNumber, @ApiParam( name = "If-Modified-Since", value = "Checks if the requested variant was modified, since the specified date-time.\n" + "Provide the value in the following format: EEE, d MMM yyyy HH:mm:ss Z.\n" + "Example: Mon, 05 Jan 2014 15:10:00 +0200", required = false) @HeaderParam("If-Modified-Since") String ifModifiedSince );
Example #26
Source File: UserManagementService.java From carbon-device-mgt with Apache License 2.0 | 4 votes |
@GET @ApiOperation( produces = MediaType.APPLICATION_JSON, httpMethod = "GET", value = "Getting Details of Users", notes = "You are able to manage users in WSO2 IoTS by adding, updating and removing users. If you wish to" + " get the list of users registered with WSO2 IoTS, you can do so " + "using this REST API", tags = "User Management", extensions = { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:users:user-details") }) } ) @ApiResponses(value = { @ApiResponse( code = 200, message = "OK. \n Successfully fetched the list of users registered with WSO2 IoTS.", response = BasicUserInfoList.class, responseHeaders = { @ResponseHeader( name = "Content-Type", description = "The content type of the body"), @ResponseHeader( name = "ETag", description = "Entity Tag of the response resource.\n" + "Used by caches, or in conditional requests."), @ResponseHeader( name = "Last-Modified", description = "Date and time the resource was last modified.\n" + "Used by caches, or in conditional requests."), }), @ApiResponse( code = 304, message = "Not Modified. \n Empty body because the client already has the latest version of " + "the requested resource.\n"), @ApiResponse( code = 406, message = "Not Acceptable.\n The requested media type is not supported", response = ErrorResponse.class), @ApiResponse( code = 500, message = "Internal Server Error. \n Server error occurred while fetching the list of WSO2 IoTS " + "users.", response = ErrorResponse.class) }) Response getUsers( @ApiParam( name = "filter", value = "The username of the user.", required = false) @QueryParam("filter") String filter, @ApiParam( name = "If-Modified-Since", value = "Checks if the requested variant was modified, since the specified date-time\n." + "Provide the value in the Java Date Format: EEE, d MMM yyyy HH:mm:ss Z.\n" + "Example: Mon, 05 Jan 2014 15:10:00 +0200", required = false) @HeaderParam("If-Modified-Since") String timestamp, @ApiParam( name = "offset", value = "The starting pagination index for the complete list of qualified items.", required = false, defaultValue = "0") @QueryParam("offset") int offset, @ApiParam( name = "limit", value = "Provide how many user details you require from the starting pagination index/offset.", required = false, defaultValue = "5") @QueryParam("limit") int limit);
Example #27
Source File: CertificateManagementAdminService.java From carbon-device-mgt with Apache License 2.0 | 4 votes |
/** * Verify Certificate for the API security filter * * @param certificate to be verified as a String * @return Status of the certificate verification. */ @POST @Path("/verify/{type}") @ApiOperation( consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON, httpMethod = "POST", value = "Verify SSL certificate", notes = "Verify Certificate for the API security filter.\n", tags = "Certificate Management", extensions = { @Extension(properties = { @ExtensionProperty(name = SCOPE, value = "perm:admin:certificates:verify") }) } ) @ApiResponses( value = { @ApiResponse( code = 200, message = "Return the status of the certificate verification.", responseHeaders = { @ResponseHeader( name = "Content-Type", description = "The content type of the body")}), @ApiResponse( code = 400, message = "Bad Request. \n Invalid request or validation error.", response = ErrorResponse.class) }) Response verifyCertificate( @ApiParam( name = "type", value = "The device type, such as ios, android or windows.", required = true, allowableValues = "android, ios, windows") @PathParam("type") @Size(max = 45) String type, @ApiParam( name = "certificate", value = "The properties to verify certificate. It includes the following: \n" + "serial: The unique ID of the certificate. (optional) \n" + "pem: pem String of the certificate", required = true) EnrollmentCertificate certificate);
Example #28
Source File: DeviceAgentService.java From carbon-device-mgt with Apache License 2.0 | 4 votes |
@POST @Path("/events/publish/data/{type}/{deviceId}") @ApiOperation( produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON, httpMethod = "POST", value = "Publishing Events data only", notes = "Publish events received by the device client to the WSO2 Data Analytics Server (DAS) using this" + " API.", tags = "Device Agent Management", extensions = { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:device:publish-event") }) } ) @ApiResponses( value = { @ApiResponse(code = 200, message = "OK. \n Successfully published the event", responseHeaders = { @ResponseHeader( name = "Content-Type", description = "The content type of the body"), @ResponseHeader( name = "ETag", description = "Entity Tag of the response resource.\n" + "Used by caches, or in conditional requests."), @ResponseHeader( name = "Last-Modified", description = "Date and time the resource was last modified.\n" + "Used by caches, or in conditional requests.") }), @ApiResponse( code = 303, message = "See Other. \n The source can be retrieved from the URL specified in the " + "location header.", responseHeaders = { @ResponseHeader( name = "Content-Location", description = "The Source URL of the document.")}), @ApiResponse( code = 400, message = "Bad Request. \n Invalid request or validation error."), @ApiResponse( code = 415, message = "Unsupported media type. \n The format of the requested entity was not " + "supported."), @ApiResponse( code = 500, message = "Internal Server Error. \n " + "Server error occurred while publishing events.") }) Response publishEvents( @ApiParam( name = "payloadData", value = "Information of the agent event to be published on DAS.") @Valid List<Object> payloadData, @ApiParam( name = "type", value = "name of the device type") @PathParam("type") String type, @ApiParam( name = "deviceId", value = "deviceId of the device") @PathParam("deviceId") String deviceId);
Example #29
Source File: CertificateManagementAdminService.java From carbon-device-mgt with Apache License 2.0 | 4 votes |
/** * Get a certificate when the serial number is given. * * @param serialNumber serial of the certificate needed. * @return certificate response. */ @GET @Path("/{serialNumber}") @ApiOperation( consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON, httpMethod = "GET", value = "Getting Details of an SSL Certificate", notes = "Get the client side SSL certificate details.", tags = "Certificate Management", extensions = { @Extension(properties = { @ExtensionProperty(name = SCOPE, value = "perm:admin:certificates:details") }) } ) @ApiResponses(value = { @ApiResponse( code = 200, message = "OK. \n Successfully fetched the certificate details.", response = CertificateResponse.class, responseHeaders = { @ResponseHeader( name = "Content-Type", description = "The content type of the body"), @ResponseHeader( name = "ETag", description = "Entity Tag of the response resource.\n" + "Used by caches, or in conditional requests."), @ResponseHeader( name = "Last-Modified", description = "Date and time the resource was last modified.\n" + "Used by caches, or in conditional requests."), }), @ApiResponse( code = 304, message = "Not Modified. \n " + "Empty body because the client already has the latest version of the requested resource."), @ApiResponse( code = 400, message = "Bad Request. \n Invalid request or validation error.", response = ErrorResponse.class), @ApiResponse( code = 404, message = "Not Found. \n The specified certificate does not exist."), @ApiResponse( code = 500, message = "Internal Server Error. \n " + "Server error occurred while retrieving the requested certificate information.", response = ErrorResponse.class) }) Response getCertificate( @ApiParam(name = "serialNumber", value = "The serial number of the certificate.", required = true, defaultValue = "124380353155528759302") @PathParam("serialNumber") String serialNumber, @ApiParam( name = "If-Modified-Since", value = "Checks if the requested variant was modified, since the specified date-time.\n" + "Provide the value in the following format: EEE, d MMM yyyy HH:mm:ss Z.\n" + "Example: Mon, 05 Jan 2014 15:10:00 +0200", required = false) @HeaderParam("If-Modified-Since") String ifModifiedSince );
Example #30
Source File: ConfigurationManagementService.java From carbon-device-mgt with Apache License 2.0 | 4 votes |
@PUT @ApiOperation( consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON, httpMethod = "PUT", value = "Updating General Platform Configurations", notes = "WSO2 EMM monitors policies to verify that the devices comply with the policies enforced on them." + "General platform configurations include the settings on how often the the device need to be " + "monitored. Using this REST API you can update the general platform level configurations.", tags = "Configuration Management", extensions = { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:manage-configuration") }) } ) @ApiResponses( value = { @ApiResponse( code = 200, message = "OK. \n Successfully updated the general platform configurations.", responseHeaders = { @ResponseHeader( name = "Content-Type", description = "The content type of the body"), @ResponseHeader( name = "ETag", description = "Entity Tag of the response resource.\n" + "Used by caches, or in conditional requests."), @ResponseHeader( name = "Last-Modified", description = "Date and time the resource has been modified the last time.\n" + "Used by caches, or in conditional requests.")}), @ApiResponse( code = 400, message = "Bad Request. \n Invalid request or validation error."), @ApiResponse( code = 415, message = "Unsupported media type. \n The format of the requested entity was not supported."), @ApiResponse( code = 500, message = "Internal Server Error. \n " + "Server error occurred while modifying the general platform configurations.", response = ErrorResponse.class) }) Response updateConfiguration( @ApiParam( name = "configuration", value = "The properties required to update the platform configurations.", required = true) PlatformConfiguration configuration);