Managing the Apigee workspace

You're viewing Apigee X documentation.
View Apigee Edge documentation.

Before you can develop your APIs locally using Apigee in Visual Studio Code (VS Code), you must create a new or open an existing Apigee workspace in Apigee in VS Code. An Apigee workspace contains the directory structure required for local development.

The following sections describe how to create, open, and manage an Apigee workspace.

Creating an Apigee workspace

To create an Apigee workspace:

  1. Perform one of the following actions:

    • Click Create Apigee workspace in the Apigee Explorer if no Apigee workspace is currently open.

      Create Apigee workspace button in UI

    • Position your cursor in the Apigee Explorer title bar, click , and select Create workspace from the drop-down menu.

      Create workspace dropdown in UI

    • Select View > Command Palette to open the Command palette and select Apigee: Create workspace.

  2. Enter a name for the Apigee workspace.

  3. Navigate to the directory where you want to save the Apigee workspace.
    If you are using source control management, select a location in your source control repository.

  4. Click Select workspace folder.

The Apigee workspace is created, stored in the specified local directory, and opened in the Apigee Explorer, as shown below.

Apigee Explorer showing Apigee workspace folders, including apiproxies, sharedflows, environments, and tests.

As shown, a set of folders is created to enable you to develop API proxies and shared flows, configure and deploy environments, and build and export test resources. For more information, see Understanding the structure of an Apigee workspace.

Opening an Apigee workspace

To open an existing Apigee workspace:

  1. Perform one of the following actions:

    • Click Open Apigee workspace in the Apigee Explorer if no Apigee workspace is currently open.

      Open Apigee workspace button in UI

    • Position your cursor in the Apigee Explorer title bar, click and select Open workspace from the drop-down menu.

      Open workspace dropdown in UI

    • Select View > Command Palette to open the Command palette and select Apigee: Open Apigee Workspace.

  2. Navigate to the Apigee workspace in your local environment.
    Select the top level folder of your Apigee workspace that contains the src/main/apigee folder.

  3. Click Select workspace folder.

The Apigee workspace is created and stored at your-workspace-folder/src/main/apigee and opened in the Apigee Explorer, as shown below.

Apigee Explorer showing Apigee workspace folders, including apiproxies, sharedflows, environments, and tests.

As shown, a set of folders is created for you to develop API proxies and shared flows, configure deployment environments, and build test resources. For more information about its structure, see Understanding the structure of an Apigee workspace.

Understanding the structure of an Apigee workspace

When you create an Apigee workspace in Apigee VS Code, a set of folders is created to enable you to develop API proxies and shared flows, configure and deploy environments, and build and export test resources. The Apigee workspace is stored at your-workspace-folder/src/main/apigee in your local environment.

The following table summarizes the structure of an Apigee workspace at a high level.

Folder Description
apiproxies Contains a separate apiproxy-name/apiproxy folder for each API proxy configuration, structured as described in API proxy configuration directory structure.

For example: helloworld/apiproxy

For more information, see Developing API proxies.

environments Defines the runtime execution contexts for the API proxies and shared flows that you want to deploy, including:
  • API proxy and shared flow deployment definitions
  • Environment-level resources
  • Shared flow hooks
  • Target servers

For more information, see Configuring and deploying environments.

sharedflows Contains a separate sharedflow-name/sharedflowbundle folder for each shared flow configuration, structured as described in Shared flow bundle configuration reference.

For example: mysharedflow/sharedflowbundle

For more information, see Developing shared flows.

tests Provides a set of test resources, such as API products or developers, required for testing your APIs locally.

For more information, see Building and exporting test resources.

An example of the structure of an Apigee workspace in your local environment is shown below, where src/main/apigee is the root.

Apigee workspace structure

Managing folders and files in an Apigee workspace

The following sections describe how to manage folders and files in an Apigee workspace.

Editing files in an Apigee workspace

To edit a file in an Apigee workspace:

  1. Click the name of the file that you want to edit in the Apigee Explorer. The contents display in the editor.

  2. Edit the file, as required.

  3. Select File > Save or ⌘S to save your edits.

Copying folders and files in an Apigee workspace

To copy a folder or file in an Apigee workspace:

  1. Right-click the folder or file that you want to copy in the Apigee Explorer and select Copy.

  2. Enter a unique name for the folder or file and press Enter.

The copied folder or file appears in the Apigee workspace.

Renaming folders and files in an Apigee workspace

To rename a folder or file in an Apigee workspace:

  1. Right-click the folder or file that you want to copy in the Apigee Explorer and select Rename.

  2. Enter a unique name for the folder or file and press Enter.

The folder or file is renamed in the Apigee Explorer.

Deleting folders and files from an Apigee workspace

To delete a folder or file from an Apigee workspace, right-click the folder or file that you want to copy in the Apigee Explorer and select Delete. The folder or file is removed from the Apigee workspace.

Refreshing the Apigee workspace view

To refresh the Apigee workspace view and synchronize any recent changes made (possibly outside of Apigee in VS Code), perform one of the following actions:

  • Position your cursor over the Apigee Explorer title bar and click Refresh icon.

  • Select View > Command Palette to open the Command palette and select Apigee: Refresh Explorer view.

Next steps