[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-03。"],[[["\u003cp\u003eThis page outlines how to create, open, and manage Apigee workspaces in Cloud Code for both Apigee and Apigee hybrid environments.\u003c/p\u003e\n"],["\u003cp\u003eAn Apigee workspace is essential for local API development using Cloud Code, containing the necessary directory structure.\u003c/p\u003e\n"],["\u003cp\u003eYou can create either a single-repository workspace with a structured folder system or a multi-repository workspace allowing flexible storage of artifacts with a \u003ccode\u003e.code-workspace\u003c/code\u003e JSON file.\u003c/p\u003e\n"],["\u003cp\u003eThe structure of a single-repository workspace includes folders for \u003ccode\u003eapiproxies\u003c/code\u003e, \u003ccode\u003eenvironments\u003c/code\u003e, \u003ccode\u003esharedflows\u003c/code\u003e, and \u003ccode\u003etests\u003c/code\u003e, whereas the multi-repository allows for customized folder locations defined in the workspace JSON file.\u003c/p\u003e\n"],["\u003cp\u003eYou can edit, copy, rename, delete folders and files within the Apigee workspace, or refresh the workspace view to sync changes.\u003c/p\u003e\n"]]],[],null,["# Managing the Apigee workspace\n\n*This page\napplies to **Apigee** and **Apigee hybrid**.*\n\n\n*View [Apigee Edge](https://docs.apigee.com/api-platform/get-started/what-apigee-edge) documentation.*\n\n\u003cbr /\u003e\n\nBefore you can develop your Apigee APIs locally using Cloud Code, you must create a new or open an existing **Apigee workspace** in Cloud Code. An Apigee workspace contains the directory structure required for local development.\n\nThe following sections describe how to create, open, and manage an Apigee workspace.\n\nCreating an Apigee workspace\n----------------------------\n\nTo create an Apigee workspace:\n\n1. Perform one of the following actions:\n\n - Click **Create Apigee workspace** in the **Apigee** section if no Apigee workspace is open.\n\n - Select **View \\\u003e Command Palette** to open the Command palette and select **Cloud Code: Create Apigee workspace**.\n\n2. Select the workspace type that matches your preferred development style. You can choose between a [single-repository workspace](#apigee-workspace-structure) or a [multi-repository workspace](#apigee-multiroot-workspace-structure).\n\n3. Enter a name for the Apigee workspace.\n\n4. Navigate to the directory where you want to save the Apigee workspace.\n If you are using source control management, select a location in your source control repository.\n\n5. Click **Select workspace folder**.\n The Apigee workspace is created, stored in the specified local directory, and opened in the VS Code Explorer.\n\n6. Click the Cloud Code icon in the Activity Bar.\n\nThe Apigee workspace displays in the **Apigee** section:\n\nBased on the type of workspace selected, the following content is created:\n\n- For a single-repository workspace, a set of folders is created under \u003cvar translate=\"no\"\u003eyour-workspace-location\u003c/var\u003e. For more information, see [Understanding the structure of an Apigee single-repository workspace](#apigee-workspace-structure).\n- For a multi-repository workspace, a file named \u003cvar translate=\"no\"\u003eyour-workspace-location\u003c/var\u003e`.code-workspace` is created with the required JSON content. For more information, see [Understanding the structure of an Apigee multi-repository workspace](#apigee-multiroot-workspace-structure).\n\nOpening an Apigee workspace\n---------------------------\n\n| **Note:** When you open an Apigee workspace the structure will be validated. For more information, see [Understanding the structure of an Apigee workspace](#apigee-workspace-structure).\n\nTo open an existing Apigee workspace:\n\n1. Perform one of the following actions:\n\n - Click **Open Apigee workspace** on the Apigee Explorer **Local development** node if no Apigee workspace is open.\n\n - Select **View \\\u003e Command Palette** to open the Command palette and select **Cloud Code: Open Apigee Workspace**.\n\n2. Navigate to the Apigee workspace in your local environment.\n\n - If you are opening a single-repository workspace, select the top level folder of your Apigee workspace that *contains* the `src/main/apigee` folder.\n - If you are opening a multi-repository workspace, select the workspace file with the extension `.code-workspace`.\n3. Click **Select workspace folder or multi-repository workspace file**.\n The Apigee workspace is opened in Cloud Code where you are able to explore the workspace contents.\n\n4. Click the Cloud Code icon in the Activity Bar.\n\nThe Apigee workspace displays in the Apigee Explorer:\n\nUnderstanding the structure of an Apigee single-repository workspace\n--------------------------------------------------------------------\n\nWhen you [create a single-repository Apigee workspace](#create) in Apigee in Google Cloud, 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 \u003cvar translate=\"no\"\u003eyour-workspace-folder\u003c/var\u003e`/src/main/apigee` in your local environment.\n\nThe following table summarizes the structure of an Apigee workspace at a high level.\n| **Note:** When managing an Apigee workspace outside of Apigee in Cloud Code, ensure you maintain the following structure to avoid validation errors.\n\nSee this example of the structure of an Apigee workspace in your local environment, where\n`src/main/apigee` is the root:\n\nUnderstanding the structure of an Apigee multi-repository workspace\n-------------------------------------------------------------------\n\nA multi-repository workspace works similarly to a [multi-root workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces) in Cloud Code. It provides users with flexibility to choose individual storage locations for their artifacts yet develop them together using a single workspace. For example when user prefers one source code management repository per proxy.\n\nA multi-repository workspace is JSON text file with a `.code-workspace` extension.\n\nThis is an example content of a multi-repository workspace which contains two API proxies (authentication-proxy, products-proxy), one shared flow (SF-threat-protection), two environments (dev, test) and one test bundle (test-products): \n\n```\n{\n \"folders\": [\n {\n \"name\": \"authentication-proxy\",\n \"type\": \"proxy\",\n \"path\": \"/work/quickdemo/multi/authentication-proxy\"\n },\n {\n \"name\": \"products-proxy\",\n \"type\": \"proxy\",\n \"path\": \"/work/quickdemo/multi/products-proxy\"\n },\n {\n \"name\": \"SF-threat-protection\",\n \"type\": \"sharedflow\",\n \"path\": \"/work/quickdemo/multi/SF-threat-protection\"\n },\n {\n \"name\": \"dev\",\n \"type\": \"environment\",\n \"path\": \"/work/quickdemo/multi/dev\"\n },\n {\n \"name\": \"test\",\n \"type\": \"environment\",\n \"path\": \"/work/quickdemo/multi/test\"\n },\n {\n \"name\": \"test-products\",\n \"type\": \"test\",\n \"path\": \"/work/quickdemo/multi/test-products\"\n }\n ]\n}\n```\n\nThese requirements are for each type of folder that can be added to a multi-repository workspace:\n\nEditing an Apigee multi-repository workspace\n--------------------------------------------\n\nEdit a multi-repository workspace by opening the \u003cvar translate=\"no\"\u003eyour-workspace\u003c/var\u003e`.code-workspace` file in Cloud Code or your preferred editor.\n\nTo open the file from the Apigee extension in Cloud Code:\n\n- Click **Edit workspace** on the Apigee Explorer **Local development** node.\n\n- Select **View \\\u003e Command Palette** to open the Command palette and select **Cloud Code: Edit Workspace**.\n\nManaging folders and files in an Apigee workspace\n-------------------------------------------------\n\nThe following sections describe how to manage folders and files in an Apigee workspace.\n\n### Editing files in an Apigee workspace\n\nTo edit a file in an Apigee workspace:\n\n1. Click the name of the file that you want to edit in the Apigee Explorer.\n The contents display in the editor.\n\n2. Edit the file, as required.\n\n3. Select **File \\\u003e Save** or ⌘S to save your edits.\n\n### Copying folders and files in an Apigee workspace\n\nTo copy a folder or file in an Apigee workspace:\n\n1. Right-click the folder or file that you want to copy in the Apigee Explorer and select **Copy**.\n\n2. Enter a unique name for the folder or file and press **\u003ckbd\u003eEnter\u003c/kbd\u003e**.\n\nThe copied folder or file appears in the Apigee workspace.\n\n### Renaming folders and files in an Apigee workspace\n\nTo rename a folder or file in an Apigee workspace:\n\n1. Right-click the folder or file that you want to copy in the Apigee Explorer and select **Rename**.\n\n2. Enter a unique name for the folder or file and press **\u003ckbd\u003eEnter\u003c/kbd\u003e**.\n\nThe folder or file is renamed in the Apigee Explorer.\n\n### Deleting folders and files from an Apigee workspace\n\nTo 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**.\nThe folder or file is removed from the Apigee workspace.\n\nRefreshing the Apigee workspace view\n------------------------------------\n\nTo refresh the Apigee workspace view and synchronize any recent changes made (possibly outside of Cloud Code), perform one of the following actions:\n\n- Position your cursor over the **Apigee Explorer** title bar and click .\n\n- Select **View \\\u003e Command Palette** to open the Command palette and select **Cloud Code: Refresh Apigee Explorer view**."]]