Code Monkey home page Code Monkey logo

openshift-tasks's Introduction

OpenShift Tasks

What is it?

The tasks-rs quickstart demonstrates how to implement a JAX-RS service that uses JPA 2.0 persistence deployed to Red Hat JBoss Enterprise Application Platform.

The application manages User and Task JPA entities. A user represents an authenticated principal and is associated with zero or more Tasks. Service methods validate that there is an authenticated principal and the first time a principal is seen, a JPA User entity is created to correspond to the principal. JAX-RS annotated methods are provided for associating Tasks with this User and for listing and removing Tasks.

Note: This quickstart uses the H2 database included with Red Hat JBoss Enterprise Application Platform 6. It is a lightweight, relational example datasource that is used for examples only. It is not robust or scalable, is not supported, and should NOT be used in a production environment!_

Note: This quickstart uses a *-ds.xml datasource configuration file for convenience and ease of database configuration. These files are deprecated in JBoss EAP 6.4 and should not be used in a production environment. Instead, you should configure the datasource using the Management CLI or Management Console. Datasource configuration is documented in the [Administration and Configuration Guide](https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/) for Red Hat JBoss Enterprise Application Platform._

Users and Passwords

Users and passwords are defined in configuration\application-users.properties and application-roles.properties. Users can be created using the JBoss add-users.sh shell script in a JBoss EAP installation.

Currently the following users are defined:

User Password

tasks

redhat1

redhat

redhat1

gpte

redhat1

REST Endpoints on OpenShift

  • Create a task with name {task_name}

    curl -u tasks:redhat1 -H 'Content-Length: 0' -X POST http://{tasks_route}/ws/tasks/{task_name}
  • Get a task by id

    curl -u 'tasks:redhat1' -H "Accept: application/json" -X GET http://{tasks_route}/ws/tasks/{tasks_id}
  • Get all tasks for user

    curl -u 'tasks:redhat1' -H "Accept: application/json" -X GET http://{tasks_route}/ws/tasks
  • Delete a task by id

    curl -i -u 'tasks:redhat1' -X DELETE http://{tasks_route}/ws/tasks/{tasks_id}
  • Generate CPU load. Last parameter is duration of load in seconds

    # 5 seconds
    curl -X GET http://{tasks_route}/ws/demo/load/5

openshift-tasks's People

Contributors

wkulhanek avatar jeannyil avatar klenkes74 avatar btison avatar

Watchers

Bilel Yahia avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.