Banyak jenis kebijakan bergantung pada resource. Resource adalah file yang menerapkan kode atau konfigurasi yang akan dieksekusi oleh kebijakan saat dilampirkan ke proxy API atau alur bersama. Untuk mengetahui informasi selengkapnya, contoh resource, dan daftar jenis resource yang didukung, lihat Tentang resource.
Buat resource di tingkat proxy API, alur bersama, atau lingkungan, lalu akses dari kebijakan, seperti yang dijelaskan di bagian berikut. Lihat juga Mengelola folder dan file di ruang kerja Apigee.
Membuat resource
Untuk membuat resource menggunakan Apigee di Cloud Code:
Di ruang kerja Apigee, lakukan salah satu tindakan berikut berdasarkan tingkat tempat Anda ingin menyimpan resource. Untuk mengetahui informasi selengkapnya, lihat Tempat penyimpanan resource.
Tingkat
Langkah
Proxy API
Lakukan salah satu tindakan berikut:
Arahkan kursor ke salah satu folder berikut, klik , lalu pilih Buat resource:
Paket proxy apiproxy-name
apiproxy-name/apiproxy
Arahkan kursor ke folder apiproxy-name/apiproxy/resources untuk proxy API, lalu klik .
Alur bersama
Lakukan salah satu tindakan berikut:
Arahkan kursor ke salah satu folder berikut, klik , lalu pilih Buat resource:
sharedflow-name paket alur bersama
sharedflow-name/sharedflowbundle
Arahkan kursor ke folder sharedflow-name/sharedflowbundle/resources untuk alur bersama, lalu klik .
Lingkungan
Lakukan salah satu tindakan berikut:
Arahkan kursor ke folder lingkungan env-name, klik , lalu pilih Create resource.
Arahkan kursor ke folder env-name/resources untuk lingkungan, lalu klik .
Wizard resource Create akan terbuka.
Pilih jenis resource yang ingin Anda buat dari daftar.
Untuk mengetahui deskripsi jenis resource yang didukung, lihat Jenis resource.
Masukkan nama unik untuk resource, lalu tekan Enter.
Resource ditambahkan ke folder resources di folder apiproxies, sharedflows, atau environments di bagian Apigee dan dibuka untuk diedit.
Edit file resource sesuai kebutuhan, lalu pilih File > Simpan atau ⌘S untuk menyimpan hasil edit Anda.
Mengimpor resource
Untuk mengimpor resource menggunakan Apigee di Cloud Code:
Di ruang kerja Apigee, lakukan salah satu tindakan berikut berdasarkan tingkat tempat Anda ingin menggunakan resource. Untuk mengetahui informasi selengkapnya, lihat Tempat penyimpanan resource.
Tingkat
Langkah
Proxy API
Lakukan salah satu tindakan berikut:
Arahkan kursor ke folder apiproxy-name/apiproxy, lalu klik .
Arahkan kursor ke folder apiproxy-name/apiproxy/resources untuk proxy API, lalu klik
.
Alur bersama
Lakukan salah satu tindakan berikut:
Arahkan kursor ke folder sharedflow-name/sharedflowbundle, lalu klik .
Arahkan kursor ke folder sharedflow-name/sharedflowbundle/resources untuk alur bersama, lalu klik .
Lingkungan
Lakukan salah satu tindakan berikut:
Arahkan kursor ke folder lingkungan env-name, lalu klik .
Arahkan kursor ke folder env-name/resources untuk lingkungan, lalu klik .
Wizard Impor resource akan terbuka.
Pilih jenis resource yang ingin Anda impor dari daftar.
Untuk mengetahui deskripsi jenis resource yang didukung, lihat Jenis resource.
Buka file di direktori lokal Anda, lalu klik Impor.
Masukkan nama unik untuk resource, lalu tekan Enter.
Resource ditambahkan ke folder resources di Apigee Explorer dan dibuka untuk diedit.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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)."]]