Giter Site home page Giter Site logo

ligoj-api's Introduction

🔗 Ligoj API plugin Maven Central

API framework for Ligoj plugins

Coverage Quality Gate Codacy Badge CodeFactor Maintainability License

Extension points

Plugin definition extension points

IAM extension points

Maven structure

Minimal Maven structure for a plugin:

  • Version, following the semver convention
  • Plugin artifact id
    • Must start with the parent service plugin artifact id. For sample, plugin plugin-id-ldap is a tool plugin for the service plugin-id.
    • Otherwise, Must start with plugin-, without additional hyphen.
  • Parent service plugin artifact as provided dependency.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>org.ligoj.api</groupId>
		<artifactId>plugin-parent</artifactId>
        <version>4.1.8</version> <!-- Version of plugin API -->
		<relativePath />
	</parent>

	<groupId>org.ligoj.plugin</groupId>
	<artifactId>plugin-id-ldap</artifactId> <!-- Tool plugin artifact-id, must start with "plugin-" -->
	<version>1.1.3-SNAPSHOT</version>       <!-- Tool plugin version -->
	<packaging>jar</packaging>

    <!-- Feature dependency -->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.ligoj.plugin</groupId>
                <artifactId>plugin-id</artifactId>        <!-- Service plugin artifact-id -->
                <version>[2.2.0-SNAPSHOT,2.3.0)</version> <!-- Service plugin version range -->
                <scope>provided</scope>                   <!-- Always provided -->
            </dependency>
        </dependencies>
    </dependencyManagement>
</project>

Build a plugin

Produced artifacts for a plugin named plugin-id-ldap are:

  • Main jar file: plugin-id-ldap-1.0.0.jar
  • Javadoc jar file: plugin-id-ldap-1.0.0-javadoc.jar. Optional, but when deployed, contributes to generated OpenAPI JSON file.
  • Sources jar file: plugin-id-ldap-1.0.0-sources.jar. Optional.
  • Test sources jar file: plugin-id-ldap-1.0.0-test-sources.jar. Optional.
  • Jacoco coverage result

The following command generate all artifacts and run UTs and Its

mvn package -Pjavadoc,jacoco,sources

Install a plugin

From the UI

The common steps:

  • Login to application
  • Go to the Administration page
  • Choose the Plugin section

Install a local plugin

The specific steps:

  • Click on Install > Install from file
  • In the modal, fill the inputs accordingly to your plugin
  • Upload it
  • Restart the application

Install a deployed Maven plugin

The specific steps:

  • Click on Install > Install from repository
  • In the modal, type the artifact name
  • Choose one or many plugins
  • Confirm
  • Restart the application

From the Ligoj CLI

The Ligoj CLI is an administration tool for all Ligoj API operations.

See all command options with ligoj plugin

Install a local plugin

The command is:

ligoj plugin upload --id "plugin-id-ldap" --version "1.1.4" --from "/path/to/plugin-id-ldap-1.1.4.jar"

Install a deployed Maven plugin

The command is:

ligoj plugin install --id "plugin-id-ldap" --version "1.1.4"  --repository "central" --javadoc

ligoj-api's People

Contributors

fdaugan avatar haithemsouala avatar ligoj avatar pcieslar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ligoj-api's Issues

Problem with postgreSQL on method NodeResource.findAll

On postgres, error occured when we try to access to the subscription page

2017-09-14 11:40:17.066 ERROR ERREUR: la fonction upper(bytea) n'existe pas
Indice : Aucune fonction ne correspond au nom donné et aux types d'arguments.
Vous devez ajouter des conversions explicites de type.

Query ;
select node0_.id as id1_8_, node0_.name as name2_8_, node0_.mode as mode3_8_, node0_.refined as refined7_8_, node0_.tag as tag4_8_, node0_.tag_ui_classes as tag_ui_c5_8_, node0_.ui_classes as ui_class6_8_ from ligoj_node node0_ left outer join ligoj_node node1_ on node0_.refined=node1_.id left outer join ligoj_node node2_ on node1_.refined=node2_.id where (? is null or ?='service' and (node0_.refined is null) or node0_.refined=?) and (?<0 or ?>1 or ?=0 and (node1_.id is null) or ?=1 and (node2_.id is null)) and (? is null or node0_.mode=? or node0_.mode='ALL') and (? is null or upper(node0_.name) like upper((('%'||?)||'%'))) and (exists (select 1 from s_role_assignment systemrole3_ inner join s_role systemrole4_ on systemrole3_.role=systemrole4_.id where systemrole3_."user"=? and (exists (select 1 from s_authorization systemauth5_ where systemauth5_.role=systemrole4_.id and systemauth5_.pattern='.*' and systemauth5_.type='API'))) or exists (select 1 from ligoj_delegate_node delegateno6_ where (node0_.id like (delegateno6_.name||':%') or delegateno6_.name=node0_.id) and (delegateno6_.receiver_type='USER' and delegateno6_.receiver=? or delegateno6_.receiver_type='GROUP' and (exists (select 1 from ligoj_cache_group cachegroup7_ where receiver=cachegroup7_.id and (exists (select 1 from ligoj_cache_membership cachemembe8_ inner join ligoj_cache_group cachegroup9_ on cachemembe8_."group"=cachegroup9_.id where cachemembe8_."user"=? and (cachegroup9_.description=cachegroup7_.description or cachegroup9_.description like ('%,'||cachegroup7_.description)))))) or delegateno6_.receiver_type='COMPANY' and (exists (select 1 from ligoj_cache_company cachecompa10_ where receiver=cachecompa10_.id and (exists (select 1 from ligoj_cache_user cacheuser11_ inner join ligoj_cache_company cachecompa12_ on cacheuser11_.company=cachecompa12_.id where cacheuser11_.id=? and (cachecompa12_.description=cachecompa10_.description or cachecompa12_.description like ('%,'||cachecompa10_.description))))))))) order by node0_.id limit ?

Coverage merge for API components

Since the split of API components, it is nonsense to reach 100% coverage for each separated component.
The coverage should be merged at the API root level to get the global coverage.

Terminate unfinished long tasks

When a worker node is stopped while processing a task, it shloud be automatically considered as failed in error state when this worker restarts.

Add a multi-subscription status check

Add a multi-subscription status checks contract. Currently, there is only a single subscription status check contract. However, we often need to check several subscriptions related to a same tool, so the same set of parameters.
For some tools, it is possible to group these checks into a single query to the tool, or at least would be faster than single checks.
The SubscriptionResource class should be able to :

  • accept a collection of subscription check requests having nothing in common
  • split a collection of check requests and group them into sub-set of requests for tools supporting this feature and sharing the same node.

This feature brings a huge performance gain.

Fix #14

I've just identified 2 issues in PR #12 :

  • The return is not JAX-RS/Swagger compliant: Must not be "List"
  • Serialization/ Stackoverflow exception / incomplete playload depending on the content because of the direct JPA entity exposition without JSON serialization control.

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.