The Developer Center is a single point of entry for developers that provides tools to manage API structure and to capture user actions to translate them into executable code.

The vSphere Client Developer Center provides tools for automation experts, devops engineers, and developers to find the resources to manage API structures and to capture vSphere Client actions to translate them into PowerCLI.

What Is vSphere API Explorer

The API Explorer allows you to browse and invoke vSphere REST APIs supported by the system and provides information and context around the API calls.

With the API Explorer, you can choose an API endpoint from your environment and retrieve a list of vSphere REST APIs. You can review details like available parameters, expected responses, and response status codes, and you can invoke the APIs against the live environment. The available APIs depend on the role of the selected endpoint.

How Do You Retrieve APIs Using vSphere API Explorer

You can use the API Explorer to retrieve available vSphere REST APIs from a selected endpoint and receive information and context around API calls.

Procedure

  1. On the vSphere Client home page, click Developer Center and select the API Explorer tab.
  2. From the Select Endpoint drop-down menu, select an endpoint from the environment.
  3. From the Select API drop-down menu, select an API. The listed APIs are the ones publicly provided by the API explorer in vCenter Server.
  4. (Optional) You can use the filter text box to filter your results. For example, enter health to view a list of methods related to monitoring the health of the selected API.
  5. Select an API category from the list.
  6. Select a method from the list.
    You can review deprecated APIs by using the toggle button next to each method from the list. Avoid using deprecated APIs. Deprecated APIs might become unresponsive in the future and cause unexpected failures in your automation scripts.
    Detailed information about the method appears.
  7. If a section about parameter details appears for the selected method, enter a method parameter value in the Value text box.
  8. (Optional) To invoke the method against the live environment, click Execute.
    1. If a warning dialog box appears, click Yes.
    The result for the invoked method appears in the response box.
  9. (Optional) To copy the result for the invoked method to your clipboard, click Copy Response.
  10. (Optional) To download the result for the invoked method, click Download.

What Is vSphere Code Capture

Code Capture records user actions and translates them into executable code.

Code Capture gives you the ability to record actions taken in the vSphere Client and output them as usable PowerCLI code. You can then copy the code or download it as a script and use it in a PowerShell session to execute the task.
Note: Only vCenter Server calls are recorded. Calls made on operations regarding roles, privileges, tags, content libraries, and storage policies are not recorded.

How Do You Record Actions by Using vSphere Code Capture

You can use Code Capture to record actions taken in the vSphere Client to produce a PowerCLI code output.

Note: Calls made on operations regarding roles, privileges, tags, content libraries, and storage policies are not recorded. Sensitive data such as passwords is not recorded.

Prerequisites

To use Code Capture to record a session, you must first enable Code Capture.

Procedure

  1. From the home sidebar menu, click Developer Center and go to the Code Capture tab.
  2. (Optional) If Code Capture is not enabled, click the toggle to enable Code Capture.
  3. To start a recording, navigate to your desired pane and click the red record button in the top pane. To start recording immediately, click Start Recording.
    While a recording is in progress, the red record button in the top pane blinks.
  4. (Optional) To clear the code captured in a previous session and start a new session, click Clear and Start Another.
  5. To stop a recording, click the red record button in the top pane, or navigate to the Code Capture tab in the Developer Center and click Stop Recording.
    The recorded code appears in the code pane.
  6. (Optional) Click Copy to copy the code or Download to download it as a PowerCLI script.
  7. To clear the current code and start another recording, click Clear and Start Another or navigate to your desired pane and click the red record button in the top pane.

Results

The recorded code appears in the code pane. You can copy the code, download it, or clear the code to start another recording.