Giter Club home page Giter Club logo

module-manager's Introduction

Jahia logo

DX Module Manager

DX module that provides enterprise level module management functionality

Forewords: URL encoding

When using special characters in the URL, such as [ or ], those need to be encoded accordingly or a HTTP Status 400 โ€“ Bad Request error will be returned by tomcat.

For example: http://localhost:8080/modules/api/bundles/%5Barticle/3.0.0,blog/4.0.0%5D/_localInfo will return details about the specified modules, while http://root:root@localhost:8080/modules/api/bundles/[article/3.0.0,blog/4.0.0]/_localInfo will return a 400 error due to non encoded characters.

Install one or multiple bundle(s)

Install the specified bundle(s), optionally starting it/them right after and return the operation result(s).

In case you need to deploy multiple bundles at the same time, you can do it in one call to avoid multiple "refresh" of dependencies, for that you just need one "bundle" parameter for each bundle you want to deploy.

  • URL

    /

  • Method:

    POST

  • Consume:

    multipart/form-data

  • Params

    start=[boolean]: true, if the bundle should be started right after installation

    target=[string]: The group of cluster nodes targeted by the operation, or local to deploy to a node individually using standard non-clustered module deployment

    Required:

    bundle=[file]: a bundle to be deploy, this parameter can be repeat for each bundle that need to be deploy, at least one bundle is required

  • Success Response:

    • Code: 200
      Content: {"bundleInfos":[{"groupId":"org.jahia.modules","symbolicName":"article","version":"2.0.3.SNAPSHOT","key":"org.jahia.modules/article/2.0.3.SNAPSHOT"}],"message":"Operation successful"}

    • Code: 200
      Content: {"bundleInfos":[{"groupId":"org.jahia.modules","symbolicName":"article","version":"3.0.0.SNAPSHOT","key":"org.jahia.modules/article/3.0.0.SNAPSHOT"},{"groupId":"org.jahia.modules","symbolicName":"news","version":"2.0.2.SNAPSHOT","key":"org.jahia.modules/news/2.0.2.SNAPSHOT"}],"message":"Operation successful"}

  • Error Response:

    • Code: 400 BAD REQUEST
      Content: {"status":400,"reasonPhrase":"Bad Request","message":"Unable to install module. Cause: Submitted bundle is either not a valid OSGi bundle or has no required manifest headers Bundle-SymbolicName and Implementation-Version/Bundle-Version"}

    OR

    • Code: 401 UNAUTHORIZED
      Content: user /users/hj/di/ac/bill is not allowed to access Module Manager HTTP API
  • Sample Call:

    curl -s --user jon:password --form bundle=@/Users/jon/Projects/article/target/article-2.0.3-SNAPSHOT.jar --form start=true http://localhost:8080/modules/api/bundles
    curl -s --user jon:password --form bundle=@/Users/jon/Projects/article/target/article-3.0.0-SNAPSHOT.jar --form bundle=@/Users/jon/Projects/news/target/news-2.0.2-SNAPSHOT.jar --form start=true http://localhost:8080/modules/api/bundles

Start bundle

Starts the specified bundle and return the operation result.

  • URL

    /:bundleKey/_start

  • Method:

    POST

  • Params

    target=[string]: The group of cluster nodes targeted by the operation, or local to deploy to a node individually using standard non-clustered module deployment

    Required:

    bundleKey=[string]: the bundle key

  • Success Response:

    • Code: 200
      Content: {"bundleInfos":[{"groupId":"org.jahia.modules","symbolicName":"article","version":"2.0.3.SNAPSHOT","key":"org.jahia.modules/article/2.0.3.SNAPSHOT"}],"message":"Operation successful"}
  • Error Response:

    • Code: 404 NOT FOUND
      Content: {"status":404,"reasonPhrase":"Not Found","message":"Unable to find a module bundle corresponding to the key: org.jahia.modules/article/2.0.3.SPSHOT"}

    OR

    • Code: 401 UNAUTHORIZED
      Content: user /users/hj/di/ac/bill is not allowed to access Module Manager HTTP API
  • Sample Call:

    curl -s --user jon:root1234 --data --request POST http://localhost:8080/modules/api/bundles/org.jahia.modules/article/2.0.3.SNAPSHOT/_start

Stop bundle

Stops the specified bundle and return the operation result.

  • URL

    /:bundleKey/_stop

  • Method:

    POST

  • Params

    target=[string]: The group of cluster nodes targeted by the operation, or local to deploy to a node individually using standard non-clustered module deployment

    Required:

    bundleKey=[string]: the bundle key

  • Success Response:

    • Code: 200
      Content: {"bundleInfos":[{"groupId":"org.jahia.modules","symbolicName":"article","version":"2.0.3.SNAPSHOT","key":"org.jahia.modules/article/2.0.3.SNAPSHOT"}],"message":"Operation successful"}
  • Error Response:

    • Code: 404 NOT FOUND
      Content: {"status":404,"reasonPhrase":"Not Found","message":"Unable to find a module bundle corresponding to the key: org.jahia.modules/article/2.0.3.SPSHOT"}

    OR

    • Code: 401 UNAUTHORIZED
      Content: user /users/hj/di/ac/bill is not allowed to access Module Manager HTTP API
  • Sample Call:

    curl -s --user jon:root1234 --data --request POST http://localhost:8080/modules/api/bundles/org.jahia.modules/article/2.0.3.SNAPSHOT/_stop

Uninstall bundle

Uninstalls the specified bundle and return the operation result.

  • URL

    /:bundleKey/_uninstall

  • Method:

    POST

  • Params

    target=[string]: The group of cluster nodes targeted by the operation, or local to deploy to a node individually using standard non-clustered module deployment

    Required:

    bundleKey=[string]: the bundle key

  • Success Response:

    • Code: 200
      Content: {"bundleInfos":[{"groupId":"org.jahia.modules","symbolicName":"article","version":"2.0.3.SNAPSHOT","key":"org.jahia.modules/article/2.0.3.SNAPSHOT"}],"message":"Operation successful"}
  • Error Response:

    • Code: 404 NOT FOUND
      Content: {"status":404,"reasonPhrase":"Not Found","message":"Unable to find a module bundle corresponding to the key: org.jahia.modules/article/2.0.3.SPSHOT"}

    OR

    • Code: 401 UNAUTHORIZED
      Content: user /users/hj/di/ac/bill is not allowed to access Module Manager HTTP API
  • Sample Call:

    curl -s --user jon:root1234 --data --request POST http://localhost:8080/modules/api/bundles/org.jahia.modules/article/2.0.3.SNAPSHOT/_uninstall

Get cluster wide info about bundle(s) (since DX 7.2.0.2)

Get cluster wide info about one or more installed bundles.

  • URL

    /:bundleSelector/_info

  • Method:

    GET

  • Params

    target=[string]: The group of cluster nodes targeted by the operation, or local to deploy to a node individually using standard non-clustered module deployment

    Required:

    bundleSelector=[string]: one of

    • a bundle key; the version value in the bundle key may be replaced with an asterisk symbol which stands for all installed versions of the bundle (since DX 7.2.3.3/7.3.0.1)
    • a comma separated list of bundle keys wrapped with encoded square brackets (%5B...%5D)
    • an asterisk symbol which stands for all installed bundles (since DX 7.2.3.3/7.3.0.1)
  • Success Response:

    • Code: 200
      Content: {"jahiaNode1":{"type":"MODULE","osgiState":"ACTIVE","moduleState":"STARTED"},"jahiaNode2":{"type":"MODULE","osgiState":"ACTIVE","moduleState":"STARTED"}

    OR

    • Code: 200
      Content: {"jahiaNode1":{"article/2.0.2":{"type":"MODULE","osgiState":"ACTIVE","moduleState":"STARTED"},"news/2.0.3":{"type":"type":"MODULE","osgiState":"ACTIVE","moduleState":"STARTED"}},"jahiaNode2":{"article/2.0.2":{"type":"MODULE","osgiState":"ACTIVE","moduleState":"STARTED"},"news/2.0.3":{"type":"MODULE","osgiState":"ACTIVE","moduleState":"STARTED"}}}
  • Error Response:

    • Code: 200
      Content: {"jahiaNode1":{"message":"Error retrieving bundle info from cluster node jahiaNode1","cause":"org.jahia.services.modulemanager.ModuleNotFoundException: Unable to find a module bundle corresponding to the key: article/2.0.3.SPSHOT"},"jahiaNode2":{"message":"Error retrieving bundle info from cluster node jahiaNode2","cause":"org.jahia.services.modulemanager.ModuleNotFoundException: Unable to find a module bundle corresponding to the key: article/2.0.3.SPSHOT"}

    OR

    • Code: 401 UNAUTHORIZED
      Content: user /users/hj/di/ac/bill is not allowed to access Module Manager HTTP API
  • Sample Calls:

    curl -s --user jon:password --request GET http://localhost:8080/modules/api/bundles/article/2.0.3.SNAPSHOT/_info
    curl -g -s --user jon:password --request GET http://localhost:8080/modules/api/bundles/%5Barticle/2.0.3,news/2.0.4%5D/_info
    curl -s --user jon:password --request GET http://localhost:8080/modules/api/bundles/article/*/_info
    curl -s --user jon:password --request GET http://localhost:8080/modules/api/bundles/org.jahia.modules/*/*/_info
    curl -s --user jon:password --request GET http://localhost:8080/modules/api/bundles/*/_info

Get local info about bundle(s) (since DX 7.2.0.2)

Get local info about one or more installed bundles.

  • URL

    /:bundleSelector/_localInfo

  • Method:

    GET

  • Params

    Required:

    bundleSelector=[string]: one of

    • a bundle key; the version value in the bundle key may be replaced with an asterisk symbol which stands for all installed versions of the bundle (since DX 7.2.3.3/7.3.0.1)
    • a comma separated list of bundle keys wrapped with encoded square brackets (%5B...%5D)
    • an asterisk symbol which stands for all installed bundles (since DX 7.2.3.3/7.3.0.1)
  • Success Response:

    • Code: 200
      Content: {"type":"MODULE","osgiState":"ACTIVE","moduleState":"STARTED"}

    OR

    • Code: 200
      Content: {"article/2.0.3.SNAPSHOT":{"type":"MODULE","osgiState":"ACTIVE","moduleState":"STARTED"},"news/2.0.3":{"type":"MODULE","osgiState":"ACTIVE","moduleState":"STARTED"}}
  • Error Response:

    • Code: 404 NOT FOUND
      Content: {"status":404,"reasonPhrase":"Not Found","message":"Unable to find a module bundle corresponding to the key: article/2.0.3.SPSHOT"}

    OR

    • Code: 401 UNAUTHORIZED
      Content: user /users/hj/di/ac/bill is not allowed to access Module Manager HTTP API
  • Sample Calls:

    curl -s --user jon:password --request GET http://localhost:8080/modules/api/bundles/article/2.0.3.SNAPSHOT/_localInfo
    curl -g -s --user jon:password --request GET http://localhost:8090/modules/api/bundles/%5Barticle/2.0.3.SNAPSHOT,news/2.0.3%5D/_localInfo
    curl -s --user jon:password --request GET http://localhost:8080/modules/api/bundles/article/*/_localInfo
    curl -s --user jon:password --request GET http://localhost:8080/modules/api/bundles/org.jahia.modules/*/*/_localInfo
    curl -s --user jon:password --request GET http://localhost:8080/modules/api/bundles/*/_localInfo

Get local state of bundle(s)

Get current local state of one or more bundles.

  • URL

    /:bundleSelector/_localState

  • Method:

    GET

  • Params

    Required:

    bundleSelector=[string]: one of

    • a bundle key
    • a comma separated list of bundle keys wrapped with encoded square brackets (%5B...%5D)
  • Success Response:

    • Code: 200
      Content: "STATE"
      Possible values: UNINSTALLED, INSTALLED, RESOLVED, STARTING, STOPPING, ACTIVE

    OR

    • Code: 200
      Content: {"article/2.0.3.SNAPSHOT":"ACTIVE","news/2.0.3":"ACTIVE"}
  • Error Response:

    • Code: 404 NOT FOUND
      Content: {"status":404,"reasonPhrase":"Not Found","message":"Unable to find a module bundle corresponding to the key: article/2.0.3.SPSHOT"}

    OR

    • Code: 401 UNAUTHORIZED
      Content: user /users/hj/di/ac/bill is not allowed to access Module Manager HTTP API
  • Sample Calls:

    curl -s --user jon:password --request GET http://localhost:8080/modules/api/bundles/article/2.0.3.SNAPSHOT/_localState
    curl -g -s --user jon:password --request GET http://localhost:8090/modules/api/bundles/%5Barticle/2.0.3.SNAPSHOT,news/2.0.3%5D/_localState

Store local persistent state of all the bundles (since DX 7.3.1.0)

Store the local persistent state of all the bundles in the internal storage for the purpose of restoring that state in the future. The operation can only be performed on the processing DX node.

  • URL

    /_storeAllLocalPersistentStates

  • Method:

    POST

  • Params

    None

  • Success Response:

    • Code: 200
      Content:
      [
        {
          "symbolicName": "org.apache.felix.framework",
          "location": "System Bundle",
          "id": 0,
          "state": 32,
          "version": "5.4.0"
        },
        {
          "symbolicName": "article",
          "location": "dx:org.jahia.modules/article/2.0.3",
          "id": 85,
          "state": 32,
          "version": "2.0.3"
        },
        ...
      ]
      
  • Error Response:

    • Code: 401 UNAUTHORIZED
      Content: user /users/hj/di/ac/bill is not allowed to access Module Manager HTTP API
  • Sample Call:

    curl -s --user jon:root1234 --request POST http://localhost:8080/modules/api/bundles/_storeAllLocalPersistentStates

Refresh bundle

Refreshes the specified bundle and return the operation result.

  • URL

    /:bundleKey/_refresh

  • Method:

    POST

  • Params

    target=[string]: The group of cluster nodes targeted by the operation, or local to deploy to a node individually using standard non-clustered module deployment

    Required:

    bundleKey=[string]: the bundle key

  • Success Response:

    • Code: 200
      Content: {"bundleInfos":[{"groupId":"org.jahia.modules","symbolicName":"article","version":"2.0.3.SNAPSHOT","key":"org.jahia.modules/article/2.0.3.SNAPSHOT"}],"message":"Operation successful"}
  • Error Response:

    • Code: 404 NOT FOUND
      Content: {"status":404,"reasonPhrase":"Not Found","message":"Unable to find a module bundle corresponding to the key: org.jahia.modules/article/2.0.3.SPSHOT"}

    OR

    • Code: 401 UNAUTHORIZED
      Content: user /users/hj/di/ac/bill is not allowed to access Module Manager HTTP API
  • Sample Call:

    curl -s --user jon:root1234 --data --request POST http://localhost:8080/modules/api/bundles/org.jahia.modules/article/2.0.3
    .SNAPSHOT/_refresh

Update bundle

Updates the specified bundle and return the operation result.

  • URL

    /:bundleKey/_update

  • Method:

    POST

  • Params

    target=[string]: The group of cluster nodes targeted by the operation, or local to deploy to a node individually using standard non-clustered module deployment

    Required:

    bundleKey=[string]: the bundle key

  • Success Response:

    • Code: 200
      Content: {"bundleInfos":[{"groupId":"org.jahia.modules","symbolicName":"article","version":"2.0.3.SNAPSHOT","key":"org.jahia.modules/article/2.0.3.SNAPSHOT"}],"message":"Operation successful"}
  • Error Response:

    • Code: 404 NOT FOUND
      Content: {"status":404,"reasonPhrase":"Not Found","message":"Unable to find a module bundle corresponding to the key: org.jahia.modules/article/2.0.3.SPSHOT"}

    OR

    • Code: 401 UNAUTHORIZED
      Content: user /users/hj/di/ac/bill is not allowed to access Module Manager HTTP API
  • Sample Call:

    curl -s --user jon:root1234 --data --request POST http://localhost:8080/modules/api/bundles/org.jahia.modules/article/2.0.3
    .SNAPSHOT/_update

Open-Source

This is an Open-Source module, you can find more details about Open-Source @ Jahia in this repository.

module-manager's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.