Add the MART IP to your org

About the MART IP configuration

You must add the IP address of the MART endpoint to your Apigee organization. You set this value previously when set the value of the mart.hostAlias property in your overrides file. The management plane needs this address so that it can communicate with the runtime plane over MART.

Add the MART IP to your organization

  1. Check the value you set previously for the mart.hostAlias property in your overrides file. That value must be a qualified domain name.
  2. Locate the service account key with the Apigee Organization Admin role that you downloaded previously, as explained in Add service accounts. You need the path to this JSON key file to complete the following steps.
  3. Use the Apigee Organization Admin service account key to generate an OAuth 2.0 access token using one of the following methods. This token is required to authenticate Apigee Hybrid APIs.

    gcloud

    Use gcloud to obtain an OAuth 2.0 access token, passing the service account credentials JSON file that you downloaded in step 1 using GOOGLE_APPLICATION_CREDENTIALS environment variable:

    export GOOGLE_APPLICATION_CREDENTIALS=your_sa_credentials_file.json
    gcloud auth application-default print-access-token

    An OAuth2.0 token is returned.

    For more information, see gcloud beta auth application-default print-access-token.

    oauth2l utility

    Use oauth2l to obtain an OAuth 2.0 access token, passing the service account credentials JSON file that you downloaded in step 1.

    oauth2l fetch --json your_sa_credentials_file.json cloud-platform
  4. Copy the OAuth 2.0 token returned and store it in a variable, such as TOKEN. For example:
    export TOKEN=ya29....Ts13inj3LrqMJlztwygtM
  5. Call the following management API to update your organization with the MART endpoint:
    curl -v -X POST \
       https://apigee.googleapis.com/v1/organizations/your_org_name \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer $TOKEN" \
      -d '{
      "name" : "your_org_name",
      "properties" : {
        "property" : [ {
          "name" : "features.hybrid.enabled",
          "value" : "true"
        }, {
          "name" : "features.mart.server.endpoint",
          "value" : "https://HOST_ALIAS_DNS"
        } ]
      }
    }'

    The following example adds the DNS name for the MART server endpoint to the org. Be sure to include the protocol prefix, https://:

    curl -v -X POST \
       https://apigee.googleapis.com/v1/organizations/your_org_name \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer $TOKEN" \
      -d '{
      "name" : "your_org_name",
      "properties" : {
        "property" : [ {
          "name" : "features.hybrid.enabled",
          "value" : "true"
        }, {
          "name" : "features.mart.server.endpoint",
          "value" : "https://foo-mart.example.com"
        } ]
      }
    }'

Next steps