This documentation is for WSO2 API Manager 1.6.0 View documentation for the latest release.
Integrating with WSO2 Governance Registry Services - API Manager 1.6.0 - WSO2 Documentation
||
Skip to end of metadata
Go to start of metadata

WSO2 Governance Registry is a registry-repository for storing and managing metadata related to services and other artifacts. Services in the Governance Registry are implemented as configurable governance artifacts (RXT files). Usually, APIs are published to the API Store in the API Manager using the API Publisher Web interface. Instead, you can integrate the API Manager with the Governance Registry to directly publish the services deployed in the Governance Registry as APIs to the API Store.

 The steps below explain how to configure the two products to expose services in the Governance Registry as APIs.

  • The following steps apply to WSO2 Governance Registry version 4.6.0 or after.
  • In WSO2 Governance Registry 4.6.0, we do a simple POST to publish to the API to Store. It does not involve registry mounting.

Follow the steps below to publish services on Governance Registry to the API Manager.

  1. Download and run both WSO2 Governance Registry and WSO2 API Manager.

    When running more than one WSO2 products on the same server, change the default port of one product to avoid port conflicts. You can do this by changing the <offset> value of one product in <PRODUCT_HOME>/repository/conf/carbon.xml file. In this example, we set the port offset value of Governance Registry to 1 as follows: <Offset>1</Offset>

    Important: If you offset the default API Manager port, you must also change the default API endpoints and the Thrift port accordingly. See Changing the Default Ports with Offset.

  2. Next, provide the API Manager credentials in <GREG_HOME>/repository/resources/lifecycles/configurations.xml file. For example, the following code block defines an execution element in production state. It provides the API Manager's endpoint, username and password as executor parameters.

    <execution forEvent="Publish" class="org.wso2.carbon.governance.registry.extensions.executors.apistore.ApiStoreExecutor">
       <parameter name="apim.endpoint" value="http://localhost:9763/"/>
       <parameter name="apim.username" value="admin"/>
       <parameter name="apim.password" value="admin"/>
       <parameter name="default.tier" value="Unlimited"/>
       <parameter name="throttlingTier" value="Unlimited,Unlimited,Unlimited,Unlimited,Unlimited"/>
    </execution>
  3. Run the API Manager. If its default port hasn't changed, you can access the server using the following URL: https://<HostName>:9443/carbon.

  4. Run the Governance Registry. Since we change its default port here, you can access the server using the following URL: https://<HostName>:<9443+offset>/carbon.

  5. Log in to the Governance Registry's management console and create a new service in it and attach the default service lifecycle to it. For instructions on how to add a new service and associate a new lifecycle, see http://docs.wso2.org/wiki/display/Governance453/Managing+Services in the Governance Registry documentation.    

  6. Promote the service until it gets to the production state.    

  7. When it is in the production state, publish it using the Publish button. You should get a confirmation message once the API is successfully published.

  8. You have now published a service in the Governance Registry. Open the API Store to see that this service is successfully created as an API.

    Use Secure Vault to secure the API Manager username and Password in a production deployment. See Adding API Manager username and password to secure vault.

Adding API Manager username and password to secure vault

  1. Run ciphertool.sh/.bat with -Dconfigure parameter.
  2. Add apim.username and apim.password as aliases to ciper-text.properties.
  3. Run cipertool.sh (on Linux) or cipertool.bat (on Windows) and encrypt username and password values.
  4. Add the encrypted text to ciper-text.properties file after the other ailas and encrypted pairs and restart the server. For example,

    apim.username=klVWQ32mbNKBxiRp78kK1Et7ZDnLPEsFQTwYjNEzTdpYAISFWJht4cqMjtQ6sXRc7eubuFxBaGVYP6LBA33XjIc855a+kDiJKXjtGhcCejyHrZoKrHb2PCJ2y0TDWtczEfHHFMhn/0u+AJafU47HyOgBXZDLcbfGiC5mdJqEoj4=
    apim.password=klVWQ32mbNKBxiRp78kK1Et7ZDnLPEsFQTwYjNEzTdpYAISFWJht4cqMjtQ6sXRc7eubuFxBaGVYP6LBA33XjIc855a+kDiJKXjtGhcCejyHrZoKrHb2PCJ2y0TDWtczEfHHFMhn/0u+AJafU47HyOgBXZDLcbfGiC5mdJqEoj4=
  • No labels