Add the MART IP to your org

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.

Follow these steps to add the MART IP to your organization:

  1. Get the value you set previously in your overrides file for the mart.hostAlias property. For MART to function, the host alias must be a fully 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. Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path where the service account key is located:

    export GOOGLE_APPLICATION_CREDENTIALS=your_sa_credentials_file.json
  4. Call the following Apigee API to update your organization with the MART endpoint:
    curl -v -X PUT \
       https://apigee.googleapis.com/v1/organizations/your_org_name \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
      -d '{
      "name" : "your_org_name",
      "properties" : {
        "property" : [ {
          "name" : "features.hybrid.enabled",
          "value" : "true"
        }, {
          "name" : "features.mart.server.endpoint",
          "value" : "https://HOST_ALIAS_DNS"
        } ]
      }
    }'

    Here is an example. Be sure to add the prefix "https://" to the domain name.

    curl -v -X PUT \
       https://apigee.googleapis.com/v1/organizations/my_organization \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
      -d '{
      "name" : "my_organization",
      "properties" : {
        "property" : [ {
          "name" : "features.hybrid.enabled",
          "value" : "true"
        }, {
          "name" : "features.mart.server.endpoint",
          "value" : "https://foo-mart.example.com"
        } ]
      }
    }'