Manage APIs

View detailed information about an API

Perform this task to view basic information, API request information, and back-end request information about an API.

  1. On the top navigation bar, click Cloud Services, and then select Service Gateways from the App Service menu.

  1. From the left navigation pane, select Service Release > API Group Management.

  1. Select a service gateway from the service gateway filter list.

  1. Click the name of a service gateway.

  1. Click the name of an API to view detailed API information.

Manage API versions

Add an API version

Load balancing policies for different APIs do not affect each other.

 

  1. On the top navigation bar, click Cloud Services, and then select Service Gateways from the App Service menu.

  1. From the left navigation pane, select Service Release > API Management.

  1. Select a service gateway from the service gateway filter list.

  1. Click Version Management in the Actions column for an API. Alternatively, click the name of an API, and then click the Version Info tab.

  1. Click Add Version, and then configure the parameters as needed.

Parameter

Description

Back-End Service (Default)

  • Service Address—Specify the IP address/domain name and port number of the service provider, in the format of host:port number. If you do not specify a port number, the default port number is used. The default port number is 80 for HTTP and 443 for HTTPS. To add multiple backend services for load balancing, click . To add multiple services in bulk, click Quick Add, enter service addresses, and then click OK.
    Format: host IP address or domain name:port number. If you do not specify a port number, the default port is used. The default port for HTTP is 80. The default port for HTTPS is 443. Separate multiple addresses by spaces or line breaks, for example:
    192.135.12.0:9000
    192.135.12.1:9000

  • Weight—Specify a weight for backend service load balancing, in the range of 0 to 1000. For example, if you set the weight for backend services a and b to 500 and 200, respectively, the ratio of requests to these two services are 5/7 and 2/7, respectively.

  • Load Balancing Algorithm

  • Round—Forward requests to each server in turn.

  • Least Connections—Sends requests to a backend service with the least connections.

  • Consistent Hashing—The system generates a hash value automatically for load balancing. You must configure the hash type and parameter. Hash types include Header, Cookie, and IP.

Custom Rule

Enter a custom request, which is used to direct requests to the back-end service address. You can add multiple custom rules. The match is successful as long as any rule is matched. If no match is found for a rule, the request is directed to the default back-end service. If you enable this feature, you must specify the following parameters:

  • Type—Options include Body and Header.

  • Match Expressions—Expressions are in the key:value format. The match is successful if all key:value expressions are matched.

 

  1. Click OK.

Configure a version as the default version

If you configure a version as the default version, the request where the header does not contain an API version will be forwarded to the back-end service address specified in that version.

  1. On the top navigation bar, click Cloud Services, and then select Service Gateways from the App Service menu.

  1. From the left navigation pane, select Service Release > API Management.

  1. Select a service gateway from the service gateway filter list.

  1. Click Version Management in the Actions column for an API. Alternatively, click the name of an API, and then click the Version Info tab.

  1. Click Set as Default Version in the Actions column for a version.

  1. In the dialog box that opens, click OK.

Edit a version

  1. On the top navigation bar, click Cloud Services, and then select Service Gateways from the App Service menu.

  1. From the left navigation pane, select Service Release > API Management.

  1. Select a service gateway from the service gateway filter list.

  1. Click Version Management in the Actions column for an API. Alternatively, click the name of an API, and then click the Version Info tab.

  1. Click Edit in the Actions column for a version.

  1. Click OK.

Delete a version

A default version cannot be deleted.

 

  1. On the top navigation bar, click Cloud Services, and then select Service Gateways from the App Service menu.

  1. From the left navigation pane, select Service Release > API Management.

  1. Select a service gateway from the service gateway filter list.

  1. Click Version Management in the Actions column for an API. Alternatively, click the name of an API, and then click the Version Info tab.

  1. Click Delete in the Actions column for a version.

  1. In the dialog box that opens, click OK.

Freeze or unfreeze a credential for an API

If an API has been subscribed by a consumer, the API publisher can freeze or unfreeze a credential to control access of the consumer to the API.

  1. On the top navigation bar, click Cloud Services, and then select Service Gateways from the App Service menu.

  1. From the left navigation pane, select Service Release > API Management.

  1. Select a service gateway from the service gateway filter list.

  1. Click the name of an API, and then click the Authentication Info tab.

  1. Click Freeze in the Actions column for a credential.

  1. To unfreeze the credential, click Unfreeze.

Enable or disable an API

A disabled API will not be available to any applications or users. When you disable an API, make sure you fully understand the impact of the action on services.

 

  1. On the top navigation bar, click Cloud Services, and then select Service Gateways from the App Service menu.

  1. From the left navigation pane, select Service Release > API Management.

  1. Select a service gateway from the service gateway filter list.

  1. Click Enable or Disable in the Actions column for an API to enable or disable it.

  1. In the dialog box that opens, click OK.

Edit an API

Perform this task to edit API information, including basic information, back-end service, API request parameters, and policies.

  1. On the top navigation bar, click Cloud Services, and then select Service Gateways from the App Service menu.

  1. From the left navigation pane, select Service Release > API Management.

  1. Select a service gateway from the service gateway filter list.

  1. Click Edit in the Actions column for an API.

  1. Edit API parameters. For information about API parameters, see "Publish an API."

  1. To change a policy, click Unbind for that policy, select a new policy, and then click Bind.

  1. Click OK.

Delete an API

Perform this task to delete an API permanently.

When you delete an API, make sure you fully understand the impact of the action on services. The API will be unavailable after it is deleted. In addition, all its data will also be automatically deleted and cannot be recovered.

 

  1. On the top navigation bar, click Cloud Services, and then select Service Gateways from the App Service menu.

  1. From the left navigation pane, select Service Release > API Management.

  1. Select a service gateway from the service gateway filter list.

  1. Click Delete in the Actions column for an API.

  1. Click OK.

Edit an API

Perform this task to edit API information, including basic information, back-end service, API request parameters, and policies.

  1. On the top navigation bar, click Cloud Services, and then select Service Gateways from the App Service menu.

  1. From the left navigation pane, select Service Release > API Management.

  1. Select a service gateway from the service gateway filter list.

  1. Click Edit in the Actions column for an API.

  1. Edit API parameters. For information about API parameters, see "Publish an API."

  1. To change a policy, click Unbind for that policy, select a new policy, and then click Bind.

  1. Click OK.

Export published APIs

  1. On the top navigation bar, click Cloud Services, and then select Service Gateways from the App Service menu.

  1. From the left navigation pane, select Service Release > API Management.

  1. Select a service gateway from the service gateway filter list.

  1. Click the Export Published APIs icon  in the upper right corner of the page.

  1. Select an API group to which the APIs belong, and then click OK.