HTTP Configuration for vSphere Automation API Endpoint

You can also modify the vAPI endpoint configuration for vCenter Server to accept HTTP connections in addition to or instead of HTTPS connections. This is useful for clients that interact both with the vSphere Web Services API endpoint and the vSphere Automation API endpoint in a development environment. Use the following procedure.

Procedure

  1. Log in to a shell window or File Explorer with root or administrator privileges.
  2. Change directories to the location of the endpoint configuration file.
    The location differs, depending on the platform.
    • For vCenter Server Appliance:
/etc/vmware-rhttpproxy/endpoints.conf.d
    • For vCenter Server for Windows:
C:\Program Data\VMware\vCenterServer\cfg\vmware-rhttpproxy\endpoints.conf.d
  3. Copy the vapi-endpoint.conf file to a temporary directory for editing.
    • On vCenter Server Appliance:
# cp vapi-endpoint.conf /tmp/vapi-endpoint.conf
    • On vCenter Server for Windows, use File Explorer to copy the file.
  4. Change the permissions on the temporary file to allow editing.
    • On vCenter Server Appliance:
# chmod +w /tmp/vapi-endpoint.conf
    • On vCenter Server for Windows, right click the file in File Explorer and select Properties to change file permissions.
  5. Use a text editor to open the temporary file.
    • On vCenter Server Appliance:
# vi /tmp/vapi-endpoint.conf
    • On vCenter Server for Windows, choose any text editor, such as Notepad, from the Start menu.
  6. Navigate to the line that specifies the endpoint for REST connections, which begins with /rest.

    The line looks similar to this:

    /rest    local    12346               redirect     allow

  7. To enable HTTP connections for REST clients, change the word redirect to allow.

    When configured to allow both HTTP and HTTPS connections, the /rest line looks similar to this:

    /rest    local    12346               allow     allow

  8. (Optional) If you prefer to completely disable HTTPS, change the last word to reject instead of allow.

    When configured to allow only HTTP connections, the /rest line looks similar to this:

    /rest    local    12346               allow     reject

  9. Navigate to the line that specifies the endpoint for clients that use language bindings rather than REST, which begins with /api.

    The line looks similar to this:

    /api    local    12346               redirect     allow

  10. To enable HTTP connections for clients using language bindings rather than REST, change the word redirect to allow.

    When configured to allow both HTTP and HTTPS connections, the /api line looks similar to this:

    /api    local    12346               allow     allow

  11. Save your settings and close the file.
  12. Change the permissions on the temporary file to disable editing.
    • On vCenter Server Appliance:
# chmod -w /tmp/vapi-endpoint.conf
    • On vCenter Server for Windows, right click the file in File Explorer and select Properties to change file permissions.
  13. Copy the original vapi-endpoint.conf file to a backup file.
    • On vCenter Server Appliance:
# cp vapi-endpoint.conf vapi-endpoint.conf.old
    • On vCenter Server for Windows, use File Explorer to copy the file.
  14. Copy the temporary file back, replacing the original vapi-endpoint.conf file.
    • On vCenter Server Appliance:
# cp /tmp/vapi-endpoint.conf vapi-endpoint.conf
    • On vCenter Server for Windows, use File Explorer to copy the file.
  15. Signal the reverse proxy service to update its configuration by entering the following command:
    • On vCenter Server Appliance:

      /etc/init.d/vmware-rhttpproxy restart

    • On vCenter Server for Windows:

      From the Windows menu, choose Control Panel > Administrative Tools > Services, right click the rhttpproxy service, and choose Restart.

Example: A vapi-endpoint.conf File Modified To Support HTTP connections for API and REST

/vapiendpoint/health            local          12346       allow          allow
/vapiendpoint/resourcebundle    local          12346       allow          allow
/rest                           local          12346       allow          allow
/site/api                       local          12346       redirect       allow
/site/rest                      local          12346       redirect       allow
/api/                           local          12346       allow          allow