Muchos tipos de políticas dependen de los recursos. Los recursos son los archivos que implementan el código o la configuración que debe ejecutar una política cuando se adjunta a un proxy de API o a un flujo compartido. Para obtener más información, ejemplos de recursos y una lista de los tipos de recursos admitidos, consulta Acerca de los recursos.
Para crear un recurso mediante Apigee en Cloud Code, haz lo siguiente:
En tu espacio de trabajo de Apigee, realiza una de las siguientes acciones según el nivel en el que deseas almacenar el recurso. Para obtener más información, consulta Dónde se almacenan los recursos.
Nivel
Paso
proxy de API
Realiza una de las siguientes acciones:
Coloca el cursor sobre una de las siguientes carpetas, haz clic en y selecciona Crear recurso:
Paquete del proxy apiproxy-name
apiproxy-name/apiproxy
Coloca el cursor sobre la carpeta apiproxy-name/apiproxy/resources del proxy de API y haz clic en .
Flujo compartido
Realiza una de las siguientes acciones:
Coloca el cursor sobre una de las siguientes carpetas, haz clic en y selecciona Crear recurso:
sharedflow-name paquete de flujo compartido
sharedflow-name/sharedflowbundle
Coloca el cursor sobre la carpeta sharedflow-name/sharedflowbundle/resources para el flujo compartido y haz clic en .
Entorno
Realiza una de las siguientes acciones:
Coloca el cursor sobre la carpeta del entorno env-name, haz clic en y selecciona Crear recurso.
Coloca el cursor sobre la carpeta env-name/resources del entorno y haz clic en .
Se abrirá el asistente para crear recursos.
Selecciona el tipo de recurso que deseas crear de la lista.
Para obtener una descripción de los tipos de recursos admitidos, consulta Tipos de recursos.
Ingresa un nombre único para el recurso y presiona Intro.
El recurso se agrega a la carpeta resources en las carpetas apiproxies, sharedflows o environments en la sección de Apigee y se abre para editarlo.
Edita el archivo de recursos, según sea necesario, y selecciona Archivo > Guardar o ⌘S para guardar las ediciones.
Importa un recurso
Para importar un recurso con Apigee en Cloud Code, haz lo siguiente:
En tu espacio de trabajo de Apigee, realiza una de las siguientes acciones según el nivel en el que deseas usar el recurso. Para obtener más información, consulta Dónde se almacenan los recursos.
Nivel
Paso
proxy de API
Realiza una de las siguientes acciones:
Coloca el cursor sobre la carpeta apiproxy-name/apiproxy y haz clic en .
Coloca el cursor sobre la carpeta apiproxy-name/apiproxy/resources del proxy de API y haz clic en .
Flujo compartido
Realiza una de las siguientes acciones:
Coloca el cursor sobre la carpeta sharedflow-name/sharedflowbundle y haz clic en .
Coloca el cursor sobre la carpeta sharedflow-name/sharedflowbundle/resources para el flujo compartido y haz clic en .
Entorno
Realiza una de las siguientes acciones:
Coloca el cursor sobre la carpeta del entorno env-name y haz clic en .
Coloca el cursor sobre la carpeta env-name/resources del entorno y haz clic en .
Se abrirá el asistente Importar recurso.
Selecciona el tipo de recurso que deseas importar de la lista.
Para obtener una descripción de los tipos de recursos admitidos, consulta Tipos de recursos.
Navega al archivo en tu directorio local y haz clic en Importar.
Ingresa un nombre único para el recurso y presiona Intro.
El recurso se agrega a la carpeta resources en Apigee Explorer y se abre para editar.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-05 (UTC)"],[[["\u003cp\u003eThis guide provides instructions for creating and importing resources in Apigee and Apigee hybrid, which are files used by policies in API proxies or shared flows.\u003c/p\u003e\n"],["\u003cp\u003eResources can be created or imported at the API proxy, shared flow, or environment level within the Apigee workspace using the "Create resource" or "Import resource" wizards.\u003c/p\u003e\n"],["\u003cp\u003eWhen creating or importing resources, you must select the appropriate resource type, and the file extension is automatically appended based on the type selected.\u003c/p\u003e\n"],["\u003cp\u003eResources are stored in the \u003ccode\u003eresources\u003c/code\u003e folder within the respective \u003ccode\u003eapiproxies\u003c/code\u003e, \u003ccode\u003esharedflows\u003c/code\u003e, or \u003ccode\u003eenvironments\u003c/code\u003e folder in the Apigee section, and the method of accessing them from a policy varies depending on the resource type.\u003c/p\u003e\n"]]],[],null,["# Managing resources\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\nMany policy types rely on resources. Resources are the files that implement the code or configuration to be executed by a policy when attached to an API proxy or shared flow. For more information, examples of resources, and a list of supported resource types, see [About resources](/apigee/docs/api-platform/develop/resource-files#about).\n\nCreate resources at the API proxy, shared flow, or environment level and then access them from the policy, as described in the following sections. See also [Managing folders and files in an Apigee workspace](/apigee/docs/api-platform/local-development/vscode/manage-apigee-workspace#managing_folders_and_files_in_an_apigee_workspace).\n\nCreating a resource\n-------------------\n\nTo create a resource using Apigee in Cloud Code:\n\n1. In your Apigee workspace, perform one of the following actions based on the level at which you want to store the resource. For more information, see [Where resources are stored](/apigee/docs/api-platform/develop/resource-files#stored).\n\n The **Create** resource wizard opens.\n2. Select the resource type that you want to create from the list.\n For a description of the resource types supported, see [Resource types](/apigee/docs/api-platform/develop/resource-files#resourcetypes).\n\n | **Note:** You must [import](#import-resource) JAR files.\n3. Enter a unique name for the resource and press **\u003ckbd\u003eEnter\u003c/kbd\u003e**.\n\n | **Note:** Don't specify the file extension. An extension will be appended automatically based on the resource type.\n\n \u003cbr /\u003e\n\n The resource is added to the `resources` folder in the `apiproxies`, `sharedflows`, or `environments` folder in the Apigee section and opened for editing.\n4. Edit the resource file, as required, and select **File \\\u003e Save** or ⌘S to save your edits.\n\nImporting a resource\n--------------------\n\nTo import a resource using Apigee in Cloud Code:\n\n1. In your Apigee workspace, perform one of the following actions based on the level at which you want to use the resource. For more information, see [Where resources are stored](/apigee/docs/api-platform/develop/resource-files#stored).\n\n The **Import resource** wizard opens.\n2. Select the resource type that you want to import from the list.\n For a description of the resource types supported, see [Resource types](/apigee/docs/api-platform/develop/resource-files#resourcetypes).\n\n | **Note:** For JAR files, select **javacallout jar**.\n3. Navigate to the file in your local directory and click **Import**.\n\n4. Enter a unique name for the resource and press **\u003ckbd\u003eEnter\u003c/kbd\u003e**.\n\n | **Note:** Don't specify the file extension. An extension will be appended automatically based on the resource type.\n\n \u003cbr /\u003e\n\n The resource is added to the `resources` folder in the Apigee Explorer and opened for editing.\n\nAccessing the resource from a policy\n------------------------------------\n\nHow you access the resource from a policy depends on the [resource type](/apigee/docs/api-platform/develop/resource-files#resourcetypes). For more information, refer to the [Policy reference overview](/apigee/docs/api-platform/reference/policies/reference-overview-policy). For an example of accessing the resource from a policy, see [Accessing the resource](/apigee/docs/api-platform/develop/resource-files#access-resource)."]]