Molti tipi di criteri si basano sulle risorse. Le risorse sono i file che implementano il codice o la configurazione da eseguire da un criterio quando viene collegato a un proxy API o a un flusso condiviso. Per ulteriori informazioni, esempi di risorse e un elenco dei tipi di risorse supportati, vedi Informazioni sulle risorse.
Per creare una risorsa utilizzando Apigee in Cloud Code:
Nello spazio di lavoro Apigee, esegui una delle seguenti azioni in base al livello in cui vuoi archiviare la risorsa. Per saperne di più, consulta Dove vengono archiviate le risorse.
Livello
Passaggio
proxy API
Esegui una delle seguenti azioni:
Posiziona il cursore del mouse su una delle seguenti cartelle, fai clic su e seleziona Crea risorsa:
apiproxy-name proxy bundle
apiproxy-name/apiproxy
Posiziona il cursore sulla cartella apiproxy-name/apiproxy/resources per il proxy API e fai clic su .
Flusso condiviso
Esegui una delle seguenti azioni:
Posiziona il cursore del mouse su una delle seguenti cartelle, fai clic su e seleziona Crea risorsa:
sharedflow-name bundle di flussi condivisi
sharedflow-name/sharedflowbundle
Posiziona il cursore sulla cartella sharedflow-name/sharedflowbundle/resources per il flusso condiviso e fai clic su .
Ambiente
Esegui una delle seguenti azioni:
Posiziona il cursore del mouse sulla cartella dell'ambiente env-name, fai clic su e seleziona Crea risorsa.
Posiziona il cursore sulla cartella env-name/resources per l'ambiente e fai clic su .
Si apre la procedura guidata per la risorsa Crea.
Seleziona dall'elenco il tipo di risorsa che vuoi creare.
Per una descrizione dei tipi di risorse supportati, consulta Tipi di risorse.
Inserisci un nome univoco per la risorsa e premi Invio.
La risorsa viene aggiunta alla cartella resources nella cartella apiproxies, sharedflows o environments nella sezione Apigee e viene aperta per la modifica.
Modifica il file di risorse in base alle esigenze e seleziona File > Salva o ⌘S per salvare le modifiche.
Importazione di una risorsa
Per importare una risorsa utilizzando Apigee in Cloud Code:
Nello spazio di lavoro Apigee, esegui una delle seguenti azioni in base al livello in cui vuoi utilizzare la risorsa. Per saperne di più, consulta Dove vengono archiviate le risorse.
Livello
Passaggio
proxy API
Esegui una delle seguenti azioni:
Posiziona il cursore sulla cartella apiproxy-name/apiproxy e fai clic su .
Posiziona il cursore sulla cartella apiproxy-name/apiproxy/resources per il proxy API e fai clic su
.
Flusso condiviso
Esegui una delle seguenti azioni:
Posiziona il cursore sulla cartella sharedflow-name/sharedflowbundle e fai clic su .
Posiziona il cursore sulla cartella sharedflow-name/sharedflowbundle/resources per il flusso condiviso e fai clic su .
Ambiente
Esegui una delle seguenti azioni:
Posiziona il cursore sulla cartella dell'ambiente env-name e fai clic su .
Posiziona il cursore sulla cartella env-name/resources per l'ambiente e fai clic su .
Viene visualizzata la procedura guidata Importa risorsa.
Seleziona dall'elenco il tipo di risorsa che vuoi importare.
Per una descrizione dei tipi di risorse supportati, consulta Tipi di risorse.
Vai al file nella directory locale e fai clic su Importa.
Inserisci un nome univoco per la risorsa e premi Invio.
La risorsa viene aggiunta alla cartella resources in Apigee Explorer e aperta per la modifica.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 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)."]]