This documentation is for WSO2 API Manager 1.10.0 View documentation for the latest release.
Integrating with WSO2 Governance Registry - API Manager 1.10.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 created using the API Publisher Web interface. Instead, you can integrate the API Manager with the Governance Registry to directly create APIs in the API Publisher using the services deployed in the Governance Registry.

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

  • The following steps are applicable for WSO2 API Manager 1.9.x versions and WSO2 Governance Registry version 5.0.0 and above.
  • In WSO2 Governance Registry 4.6.0, we do a simple POST to create APIs in the API Publisher. It does not involve registry mounting.

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

  1. Download both WSO2 Governance Registry (G-Reg) and WSO2 API Manager.

  2. 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.ServiceToAPIExecutor">
       <parameter name="apim.endpoint" value="http://localhost:9763/"/>
       <parameter name="apim.username" value="admin"/>
       <parameter name="apim.password" value="admin"/>
       <parameter name="apim.env" value="Dev"/>
       <parameter name="default.tier" value="Unlimited"/>
       <parameter name="throttlingTier" value="Unlimited,Unlimited,Unlimited,Unlimited,Unlimited"/>
    </execution>

    Note: If you started the G-Reg server at least once before executing step 2, editing the configurations.xml file and restarting the server does not apply the configurations. You need to add the configurations using the G-Reg management console as follows:

    1. Log in to the G-Reg Management console and select Extensions -> Configure -> Lifecycles menu.
    2. Click the Edit link associated with ServiceLifeCycle .
    3. Add the configuration given in step 2 above and Save.
  3. Run the G-Reg and the 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>

    Note: 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.

  4. Access the API Manager server using the following URL: https://<HostName>:9443/carbon. As you changed the default port of G-Reg, you can access the server using the following URL: https://<HostName>:<9443+offset>/carbon.

  5. Log in to the G-Reg 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/governance-registry/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 created an API using a service in the Governance Registry. Open the API Publisher to see that this service is successfully created as an API.

  • No labels