Classifying an API Instance into an Environment
After you upgrade to API Manager 2.x your APIs are placed in an unclassified environment. You need to classify unclassified APIs to govern or otherwise manage the APIs.
Even though API Manager supports tracking APIs with both organization and environment credentials, MuleSoft recommends using environment credentials since the permissions associated to them are more restrictive. You need to restart Mule Runtime after changing credentials. Restarting can cause downtime. See Configuring Mule Servers with Environment Credentials (Advanced Classification: Optional) below for details on how to change them. After doing so, you may classify your API to an environment that API Manager will suggest.
Using credentials from one environment does not allow:
-
Tracking APIs from different environment
-
Tracking APIs from different organizations
If you need to track APIs in either of these ways, use organization credentials.
Follow Configuring Organization Credentials in Mule Runtime 4 or Configuring Organization Credentials in Mule Runtime 3 depending on the Mule runtime version you are using.
If you need to track APIs using environment credentials review the advanced section.
Classifying the API Instance on API Manager
-
In API Manager, click the environment control, which is labeled SANDBOX in this example:
If you do not have a suitable environment you want to classify the API into, create the environment in Access Management. See To Create a New Environment and Reviewing Environment Concepts for more information.
-
Select Unclassified.
-
Click Switch.
A list of unclassified APIs appears.
-
Click Classify.
-
For Target environment, select the environment for the API from the list of environments available to you. For example, select Test.
-
For Instance name, optionally type a unique instance name. For example, type
abc-api-1
.For environments, APIs can have more than a single instance. Therefore, an instance name is required to uniquely identify it.
API Analytics Impact
In the Pre-Crowd version of API Manager, all dashboards were organization-wide. In Crowd, each dashboard links to a particular environment.
If you had custom reports for your APIs before migrating, those custom reports would no longer work after you classify all your APIs.
Configuring Mule Servers with Environment Credentials (Advanced Classification: Optional)
You can use this configuration to track APIs that use environment credentials. This configuration requires a server restart.
The sections that follow help you classify your APIs depending on how you deployed proxies before migration.
Managing an API instance by using a Proxy deployed through API Manager
If your API was deployed in Runtime Manager:
-
From API Administration, click the API Name of the API instance.
-
Click Runtime & Endpoint Configuration > Save & Deploy.
-
Select the Runtime version.
-
Click Save & Apply.
If your API was deployed in an on-premises standalone runtime:
-
From API Administration, click the API Name of the API instance.
-
Click Runtime & Endpoint Configuration > Save & Deploy.
-
Specify a runtime version for Mule Agent 1.9 and later.
-
Click Save & Apply.
To update an existing server:
-
Use SSH to access the standalone runtime server.
-
Download the Runtime Agent 1.9 or later.
-
Update the Gateway runtime agent.
-
Restart the Gateway.
Managing an API instance by using a Basic Endpoint or a Proxy deployed through Runtime Manager
If your API was deployed in Runtime Manager:
-
Navigate to Access Manager.
-
Click Environments.
-
Click the environment name you want to use.
-
Copy the Client ID and Client Secret.
To update an application in Runtime Manager:
-
Navigate to the proxy application in Runtime Manager.
-
Click Settings.
-
Click Properties.
-
Change the values of the following properties to the values from the Environment:
-
Anypoint.platform.client_id
-
Anypoint.platform.client_secret
-
-
Click Apply changes.
To update an application deployed in standalone Mule Runtime:
-
Use SSH to access the standalone runtime server where the application is deployed.
-
Download Runtime Agent 1.9.x.
-
Update the Runtime Agent.
-
Restart the Mule Runtime.
Other Deployments
This section explains the manual steps needed to prepare Mule Runtime to use API environments without updating the agent or registering the server with Runtime Manager.
Getting the environment client ID and secret:
-
Navigate to Access Manager.
-
Click Environments.
-
Click the environment name that you want to use.
-
Copy the Client ID and Client Secret.
Updating an application in Runtime Manager:
-
Navigate to the proxy application in Runtime Manager.
-
Click Settings.
-
Click Properties.
-
Change the values of the following properties to the values from the environment:
-
anypoint.platform.client_id
-
anypoint.platform.client_secret
-
Updating standalone runtimes:
-
Use SSH to access the runtime server that you want to update.
-
Edit the
<mule_home>/<conf>/wrapper.conf
file. -
Change the values of the following properties to the values from the environment:
-
anypoint.platform.client_id
-
anypoint.platform.client_secret
-
-
Restart Mule Runtime.