Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The WSO2 Governance Registry (G-Reg) is an SOA-integrated registry-repository for storing and managing data or metadata related to services and other artifacts. It consists of two Web-based interfaces: the G-Reg Publisher and G-Reg Store. The  Publisher is used to create and manage assets, while the  Store is used  to search for and subscribe to assets.

...

Introducing the sample

BuyMore is a fictitious supermarket chain with more than 200 retail branches. Given below is a snapshot of the existing services of BuyMore with their lifecycle states:

...

Tip

Before you begin:

  1. Install Oracle Java SE Development Kit (JDK) version 1.6.24 or later or 1.7.* and set the JAVA_HOME environment variable.
  2. Download WSO2 Governance Registry to any location of your server. We call it <G-REG_HOME>.
  3. Start the G-Reg server by navigating to the <G-REG_HOME>/bin/ directory using the command line and executing wso2server.bat (for Windows) or  wso2server.sh (for Linux). 

    Anchor
    deploy
    deploy

Deploying the sample to create assets

...

You now have sample services and other artifacts related to BuyMore along with two users (a developer called Smith and a DevOps engineer called Mark ) deployed in the G-Reg. Next, let's log in to the G-Reg Store as Smith and subscribe to an asset. 

...

Subscribing to an asset

Smith is a developer at BuyMore. Smith comes to the G-Reg Store searching for the asset BuyMoreBillCalculateRESTAPI version 1.0.0 to calculate bill values of the products being purchased at BuyMore. Smith can search for the asset using the following alternative methods.

...

, and subscribes to it to receive notifications regarding any changes that happen to the asset later. 

...

titleSearch using filters

...

  1. Log in to the G-Reg Store (https://localhost:9443/store/) as Smith. Smith's credentials are smith/smith@bm.

...

  1. Click Rest Services in the left menu.
    select rest services in the left menuImage Added
    Notice that many services are shown in the search results. Smith knows that the service he wants (i.e., BuyMoreBillCalculateRESTAPI version 1.0.0

...

  1. ) is owned by the Think Tank team in Boston and is hosted by the Vancouver data center, so he filters the search by those criteria to make sure he finds the right one.
  2. Expand the Teams filter in the Filter by menu, expand the Boston menu, and click the icon with the plus sign next to Think Tank to select it.
    select the team filterImage Modified
  3. Expand the DataCenters filter in the Filter by

...

titleRefining the search results

Smith can follow the steps below to search for the BuyMoreBillCalculateRESTAPI version 1.0.0 asset by refining the search results.

...

  1.  menu, and click the icon with the plus sign next to Vancouver to select it.
    select the data centerImage Modified

...

Tip

For more information, see the tutorial on Searching for Assets Using Filters.

...

  1. Search for the asset by typing "name:BuyMoreBillCalculateRESTAPI" in the search field and clicking the search icon.

...

Tip

For more information, see the tutorial on Searching for Assets using Refinements.

Subscribing to an asset

...

  1. search for the serviceImage Added
  2. The service BuyMoreBillCalculateRESTAPI version 1.0.0

...

  1.  

...

  1. The service BuyMoreBillCalculateRESTAPI appears in the search results. Click it to open it.
    searched asset
  2. The asset openopens. Scroll down to see the following links:

    • Swagger UIVisualize: Opens a Swagger console where you can invoke the REST asset.Download: Downloads the Swagger definition of the REST asset to a given location in your machine
    • Show Dependencies: Opens a diagram displaying all the dependencies this asset has with other assets.
    • Copy URL: Gives you the option to copy the URL of the Swagger definition. 
    Image Removed
    • Download: Downloads the Swagger definition of the REST asset to a given location on your machine.

    view options of an assetImage Added

    Smith has now discovered the REST asset that can be called from other applications to calculate bill values.  Next, Smith subscribes to receive  notifications for this asset. A notification is an alert that you get via email and/or the G-Reg Store regarding an asset's lifecycle and/or information change. 

  3. Click the ->OPTIONS button in the top right-hand corner of the screen to expand the notification settings.

    You can subscribe to receive notifications through emails or through the G-Reg Store.
    You can also opt to receive notifications when an asset is changed and/or when it goes through a lifecycle state change. 

  4. Enable the option to receive notifications related to lifecycle state changes via the G-Reg Store.

...

  1. Log in to the G-Reg Publisher ( https://localhost:9443/publisher/ ) as Mark. Mark's credentials are mark/ mark@bm.
  2. Use the following text to search for the service to be promoted to production, and then click the asset to open it.
    name:BuyMoreBillCalculateRESTAPI version:2.0.0

  3. Once the asset opens in the StorePublisher, go to its LIFECYCLE tab, add a comment to explain why you are changing its lifecycle state, and then click   Promote

  4. Note that the lifecycle state of the service is changed from TESTING to PRODUCTION, and the comment you added appears under history. Any user who goes to the  LIFECYCLE  tab of this service can see the comments history.

    Now that a new version of the asset is in production, Mark deprecates the older version (i.e., version 1). This triggers an alert to Smith, who is subscribed to it to receive notifications.

  5. Click the GOVERNANCE CENTER - PUBLISHER label at the top of the console to go to the publisher's Homepage, search for the term "BuyMoreBillCalculateRESTAPI", and click version 1.0.0 of the asset to open it.  
  6. Once the asset is opened, go to its LIFECYCLE tab and click Deprecate.

  7. Note that the lifecycle state of the asset is updated successfully.

...

  1. Sign in to the G-Reg Store (https://localhost:9443/store/) as Smith (smith/smith@bm).
  2. Click any one of the menus (such as REST Services) and note the new notification icon in the upper right-hand corner of the G-Reg Store.
  3. Click the icon to expand and read the notification.

    Upon seeing the notification, Smith searches for a new version of the asset.In the G-Reg Store, click the BuyMore tag under the Tags section.
  4. Log in to the G-Reg Store (https://localhost:9443/store/) as Smith. Smith's credentials are smith/smith@bm.
  5. Click Rest Services in the left menu.
    select rest services in the left menuImage Added
  6. Search for the asset by typing "name:BuyMoreBillCalculateRESTAPI" in the search field and clicking the search icon.
    Image Added

    Notice that many services are shown in the search results. Smith knows that the service he wants (i.e., BuyMoreBillCalculateRESTAPI version 2.0.0is developed using Java and belongs to the silver throttling tier, so he refines the search by those criteria to make sure he finds the right one.
  7. Select java under Language in the Refine by menu.
    select java refinementImage Added
  8. Select silver under Throttling Tier in the Refine by  menu.
    selecting the throttling tierImage Added
  9. The service BuyMoreBillCalculateRESTAPI version 2.0.0 appears in the search results. Click it to open it.
    Image Added

Expand
titleSearching for the asset using tags

Alternatively, you can search for an asset using

...

tags.

    1. In the G-Reg Store, click the BuyMore tag under the Tags section. 
      Image Modified
    2. All the assets that have been tagged as BuyMore get listed on the console. Click version 2.0.0 of the

...

    1. asset  BuyMoreBillCalculateRESTAPI to open it.
      Image Modified

Reviewing the new version of the asset

In the previous step, Smith opened BuyMoreBillCalculateRESTAPI Version 2.0.0  in the G-Reg Store.

  1. Go to the User Reviews tab of the asset and add a rating (let's say 5). Also add a review comment (such as "This version of the asset is recommended as it implements the company's new loyalty scheme"), and then click Post Review
  2. Note that the review that Smith just added appears on the console, under the NEWEST category. You can filter reviews according to popularity and the date added.

...

  1. Log in to the G-Reg Publisher (https://localhost:9443/publisher/) as Mark (credentials: mark/mark@bm).

  2. Search for the term "BuyMoreBillCalculateRESTAPI" and click version 1.0.0 of the asset to open it.  

  3. C lick   Show Dependencies   to view the asset's dependency graph and the policies.  
  4. The dependency graph opens. Note that you can click the icons to view more information about them.

    Tip

    For more information on viewing dependencies of an asset, go to Dependency Visualization with WSO2 Governance Registry.

    As this asset has no dependencies with other assets, Mark continues to make it obsolete.

  5. Go to the asset's LIFECYCLE tab and click Obsolete.
  6. Note that the lifecycle state of version 1.0.0 is now OBSOLETE.

...

  1. Log in to the G-Reg Store (https://localhost:9443/store/) as Smith if you haven't done so already (credentials: smith/smith@bm).
  2. Click any one of the menus (say the  REST Services  menu) and note that you now have 2 notifications in  the upper right-hand corner of the G-Reg Store.

    Smith reads the notification and notices that version 1.0.0 of the asset has been discontinued by BuyMore. Smith proceeds to make a backup of the asset. 
  3. Search for " BuyMoreBillCalculateRESTAPI" in the G-Reg Store and click version 1.0.0 to open it.
  4. The Swagger-based REST asset opens in the Store. Scroll down and click the Download button to download the content of the Swagger file.
    Image Removed option to download the Swagger sourceImage Added

Smith now has a local copy of the asset that BuyMore has discontinued.

In this Quick Start Guide, you have gone through some of the key functionality of WSO2 G-Reg. For an in-depth understanding of the G-Reg, see the User Guidesee Deep Dive.