[[["易于理解","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-08-28。"],[[["\u003cp\u003eThis document explains how to manage API dependencies within Apigee and Apigee hybrid, allowing users to visualize and understand the relationships between different APIs.\u003c/p\u003e\n"],["\u003cp\u003eDependencies, which are defined by a consumer operation relying on a supplier operation, can be created, listed, and managed through the Google Cloud console or via REST APIs.\u003c/p\u003e\n"],["\u003cp\u003eThe API hub UI provides a visual overview of consumer/supplier relationships, and the dependencies can be filtered to focus on specific operations of interest, as well as show details on the consumer and supplier.\u003c/p\u003e\n"],["\u003cp\u003eUsers can also get details about dependencies to look for errors, including information about broken dependencies where the supplier operation is removed, and can delete or edit these dependencies as needed.\u003c/p\u003e\n"],["\u003cp\u003eThe dependency ID must be 4-500 characters long and only contain letters, numbers and hyphens when creating a dependency.\u003c/p\u003e\n"]]],[],null,["# Manage API supply chain dependencies\n\n*This page\napplies to **Apigee** and **Apigee hybrid**.*\n\nThis page explains how to manage API supply chain dependencies in API hub. For an overview of API supply chain in API hub, see [API supply chain](./api-supply-chain).\n\n\u003cbr /\u003e\n\nList dependencies\n-----------------\n\nYou can view or list all the dependencies in your API ecosystem using Google Cloud console or the [List dependencies](/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies/list) API. \n\n### Console\n\nTo list all the dependencies in your API ecosystem from API hub, do the following:\n\n1. In the Google Cloud console, go to **API hub \\\u003e** **API supply chain**.\n\n [Go to API hub](https://console.cloud.google.com/apigee/api-hub/dependencies)\n\n The **API supply chain** page appears displaying all the dependencies in your API ecosystem in [list view](./api-supply-chain#api-supply-chain-list-view).\n2. In the **Filter** field, if needed, specify supplier and/or consumer operations to return relevant dependencies. The filter feature lets you find all dependencies linked with specified operations.\n3. To view the dependencies in [graph view](./api-supply-chain#api-supply-chain-graph-view), click lan **(Open graph view)** beside the consumer or supplier name in the list.\n\n### REST\n\nTo list all the dependencies using the [List dependencies](/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies/list) API, use the following command: \n\n```\n curl \"https://apihub.googleapis.com/v1/projects/HUB_PROJECT/locations/HUB_LOCATION/dependencies\"\n -H \"Authorization: Bearer: $(gcloud auth print-access-token)\" -X GET -H \"Content-Type: application/json\"\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eHUB_PROJECT\u003c/var\u003e: The name of your API hub host project. The host project was selected when API hub was provisioned.\n- \u003cvar translate=\"no\"\u003eHUB_LOCATION\u003c/var\u003e: The location of the host project. The location was chosen when API hub was provisioned.\n\nSample output: \n\n```\n{\n \"dependencies\": [\n {\n \"name\": \"projects/myproject/locations/us-central1/dependencies/user-to-pet\",\n \"consumer\": {\n \"displayName\": \"POST - /v2/user\",\n \"operationResourceName\": \"projects/myproject/locations/us-central1/apis/payments-api/versions/version1/operations/createuser\"\n },\n \"supplier\": {\n \"displayName\": \"POST - /v2/pet\",\n \"operationResourceName\": \"projects/myproject/locations/us-central1/apis/payments-api/versions/version1/operations/addpet\"\n }\n }\n ]\n }\n```\n\nView dependency details\n-----------------------\n\nYou can view the dependency details between API operations using Google Cloud console or the [Get dependency details](/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies/get) API.\n\n\u003cbr /\u003e\n\n### Console\n\nTo view the details of a dependency from the Google Cloud console, do the following:\n\n1. In the Google Cloud console, go to **API hub \\\u003e** **API supply chain**.\n\n [Go to API hub](https://console.cloud.google.com/apigee/api-hub/dependencies)\n\n The **API supply chain** page appears displaying all the dependencies in your API ecosystem in [list view](./api-supply-chain#api-supply-chain-list-view).\n2. In the **Filter** field, if needed, specify supplier and/or consumer operations to return relevant dependencies. The filter feature lets you find all dependencies linked with specified operations.\n3. Locate the desired dependency and click **See Details** .\n\n The **Dependency** pane appears displaying detailed information about the dependency such as the consumer and supplier details, dependency details, and the user defined attributes.\n\nAlternatively, you can also use the API supply chain graph view to view the dependency details. For more information, see [API supply chain graph edge](./api-supply-chain#edges).\n\n### REST\n\nTo view details of a dependency using the [Get dependency details](/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies/get) API, use the following command: \n\n```\n curl \"https://apihub.googleapis.com/v1/projects/HUB_PROJECT/locations/HUB_LOCATION/dependencies/DEPENDENCY_ID\"\n -H \"Authorization: Bearer: $(gcloud auth print-access-token)\" -X GET -H \"Content-Type: application/json\"\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eHUB_PROJECT\u003c/var\u003e: The name of your API hub host project. The host project was selected when API hub was provisioned.\n- \u003cvar translate=\"no\"\u003eHUB_LOCATION\u003c/var\u003e: The location of the host project. The location was chosen when API hub was provisioned.\n- \u003cvar translate=\"no\"\u003eDEPENDENCY_ID\u003c/var\u003e: The unique ID of the dependency.\n\nSample response: \n\n```\n{\n \"name\": \"projects/myproject/locations/us-central1/dependencies/user-to-pet\",\n \"consumer\": {\n \"displayName\": \"POST - /v2/user\",\n \"operationResourceName\": \"projects/myproject/locations/us-central1/apis/payments-api/versions/version1/operations/createuser\"\n },\n \"supplier\": {\n \"displayName\": \"POST - /v2/pet\",\n \"operationResourceName\": \"projects/myproject/locations/us-central1/apis/payments-api/versions/version1/operations/addpet\"\n },\n \"state\": \"VALIDATED\",\n \"description\": \"Dependency from user to pet API\",\n \"discoveryMode\": \"MANUAL\",\n \"createTime\": \"2024-04-17T19:33:31.215978712Z\",\n \"updateTime\": \"2024-04-17T19:33:31.737505297Z\"\n}\n```\n\nHere's a sample response, where the error condition indicates the supplier operation was removed\n(a broken dependency): \n\n```\n{\n \"name\": \"projects/common-dev-15/locations/us-central1/dependencies/user-to-pet\",\n \"consumer\": {\n \"displayName\": \"POST - /v2/user\",\n \"operationResourceName\": \"projects/common-dev-15/locations/us-central1/apis/payments-api/versions/2ff89c88-e8b6-48c4-a1c2-bdbb2a929bde/operations/createuser\"\n },\n \"supplier\": {\n \"displayName\": \"POST - /v2/pet\",\n \"operationResourceName\": \"projects/common-dev-15/locations/us-central1/apis/payments-api/versions/2ff89c88-e8b6-48c4-a1c2-bdbb2a929bde/operations/addpet\"\n },\n \"state\": \"VALIDATED\",\n \"description\": \"Dependency from user to pet API\",\n \"discoveryMode\": \"MANUAL\",\n \"createTime\": \"2024-04-17T19:33:31.215978712Z\",\n \"updateTime\": \"2024-04-17T19:33:31.737505297Z\",\n {\n \"error\": \"SUPPLIER_NOT_FOUND\",\n \"errorTime\": 2024-05-18T20:23:42.465324Z\n }\n}\n```\n\nEdit a dependency\n-----------------\n\nYou can edit a dependency using Google Cloud console or the [Patch dependency](/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies/patch) API.\n**Note:** The only editable attribute is the dependency description. \n\n### Console\n\nTo edit an API dependency from API hub, do the following:\n\n1. In the Google Cloud console, go to **API hub \\\u003e** **API supply chain**.\n\n [Go to API hub](https://console.cloud.google.com/apigee/api-hub/dependencies)\n\n The **API supply chain** page appears displaying all the dependencies in your API ecosystem in [list view](./api-supply-chain#api-supply-chain-list-view).\n2. Locate the dependency that you want to edit and click **See Details** .\n\n The **Dependency** pane appears.\n3. Edit the description of the dependency under **Dependency details**.\n4. Click **Save**.\n\n### REST\n\nTo edit a dependency using the [Patch dependencies](/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies/patch) API, use the following command: \n\n```\n curl \"https://apihub.googleapis.com/v1/projects/HUB_PROJECT/locations/HUB_LOCATION/dependencies/DEPENDENCY_ID\"\n -H \"Authorization: Bearer: $(gcloud auth print-access-token)\" -X PATCH -H \"Content-Type: application/json\"\n '{\n 'description': DESCRIPTION\n }'\n \n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eHUB_PROJECT\u003c/var\u003e: The name of your API hub host project. The host project was selected when API hub was provisioned.\n- \u003cvar translate=\"no\"\u003eHUB_LOCATION\u003c/var\u003e: The location of the host project. The location was chosen when API hub was provisioned.\n- \u003cvar translate=\"no\"\u003eDEPENDENCY_ID\u003c/var\u003e: The ID of the dependency to edit.\n- \u003cvar translate=\"no\"\u003eDESCRIPTION\u003c/var\u003e: The description of the dependency.\n\nDelete a dependency\n-------------------\n\nYou can delete a dependency using Google Cloud console or the [Delete dependency](/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies/delete) API. \n\n### Console\n\nTo delete a dependency from API hub, do the following:\n\n1. In the Google Cloud console, go to **API hub \\\u003e** **API supply chain**.\n\n [Go to API hub](https://console.cloud.google.com/apigee/api-hub/dependencies)\n\n The **API supply chain** page appears displaying all the dependencies in your API ecosystem in [list view](./api-supply-chain#api-supply-chain-list-view).\n2. In the **Filter** field, if needed, specify supplier and/or consumer operations to return relevant dependencies. The filter feature lets you find all dependencies linked with specified operations.\n3. Locate a dependency of interest and click delete **(Delete dependency)** to delete the dependency.\n\n### REST\n\nTo delete a dependency using the [Delete dependency](/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies/delete) API, use the following command: \n\n```\ncurl \"https://apihub.googleapis.com/v1/projects/HUB_PROJECT/locations/HUB_LOCATION/dependencies/DEPENDENCY_ID\"\n -H \"Authorization: Bearer: $(gcloud auth print-access-token)\" -X DELETE -H \"Content-Type: application/json\"\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eHUB_PROJECT\u003c/var\u003e: The name of your API hub host project. The host project was selected when API hub was provisioned.\n- \u003cvar translate=\"no\"\u003eHUB_LOCATION\u003c/var\u003e: The location of the host project. The location was chosen when API hub was provisioned.\n- \u003cvar translate=\"no\"\u003eDEPENDENCY_ID\u003c/var\u003e: The ID of the dependency to delete."]]