—Rate this article—
 

Beta Release of SmartDocs

1. In the Resource URL, replace any values enclosed in "{}", such as your organization name.
2. Set the Basic Authentication credentials. These are your Edge credentials (user must be in the Org Admin role).
3. Tweak the Request Body as needed (if a body is needed).
4. Send the live request to Edge and view the response! You can also view Request data.

Create a TargetServer

Resource Summary

Auth Type

BASICAUTH,

Content Type

application/json, text/xml

Category

Target Server,

createTargetServer

POST

Create a TargetServer

Create a TargetServer in the specified environment. TargetServers are used to decouple TargetEndpoint HTTPTargetConnections from concrete URLs for backend services.

To do so, an HTTPConnection can be configured to use a LoadBalancer that lists one or more 'named' TargetSevers. Using TargetServers, you can create an HTTPTargetConnection that calls a different backend server based on the environment where the API proxy is deployed.

For example, instead of the following configuration:

<TargetEndpoint name="default">
  <HTTPTargetConnection>
    <URL>http://s1.mybackendservice.com</URL>
  </HTTPTargetConnection>
</TargetEndpoint>

You can reference a TargetServer as follows:

<TargetEndpoint name="default">
    <HTTPTargetConnection>
        <LoadBalancer>
            <Server name="target1" />
        </LoadBalancer>
  </HTTPTargetConnection>
</TargetEndpoint>

You can then set up a TargetServer called target1 in the 'test' environment that points to a test backend service, and a different TargetServer called target1 in the 'prod' environment that points to a production backend. When you 'promote' the API proxy with this configuration from the test to the prod environment, the TargetEndpoint will use the appropriate backend service, without requiring any changes in the API proxy configuration.

Note: Characters you can use in the name are restricted to: A-Z0-9._\-$ %.

Resource URL

https://api.enterprise.apigee.com/v1 /organizations/{org_name}/environments/{env_name}/targetservers

    Header Parameters

  • Name
    Value
    Description
  • Content-Type
    (required)
    Specify the content type as application/json or text/xml.

Request Body

Name Description Default Required?
Name The name of the target server. You can choose anything you like. N/A Yes
Host The DNS name or IP address of the machine that this TargetServer will refer to. N/A Yes
Port The port on which the backend service is configured to listen. If you don't specify a port, it defaults to zero, which is invalid. If you're not sure, try port 80. 0 Yes
IsEnabled A boolean (true/false) that determines whether this TargetServer is enabled or not. You can use this setting to take TargetServers out of rotation, without requiring you to delete the TargetServer definition. false No

org_name Mention the organization name true

env_name Mention the environment name true

Basic Auth

OAuth 2

Custom Token

Reset

Make a request and see the response.

Make a request and see the response.

Working...

Help or comments?

  • Something's not working: See Apigee Support
  • Something's wrong with the docs: Click Send Feedback in the lower right.
    (Incorrect? Unclear? Broken link? Typo?)