Resource files API
Manage files containing executable code or definitions used by API policies to enable custom behavior and extensibility.
Resource files are executable code or other types of assets (for example XSLT) that are used by API proxies at runtime. Resource files can be stored at one of three levels:
- API proxy: Available to any policies in an API proxy.
- Environment: Available to any policies in any API proxy deployed in the environment.
- Organization: Available to any API proxy deployed in any environment in an organization.
Resource files are resolved by name. Apigee Edge resolves resource files from most specific (API proxy) to the most general (organization). This enables you to store generic code that provides utility processing at the organization level. This provides for greater maintainability, since generic code is not repeated across multiple API proxies. A good example of code that might be scoped to the organization is a library to do Base64 encoding.
For more information, see Manage resources.
Resource Types
ResourceFile
Method | Endpoint | Description |
---|---|---|
get | /organizations/{org_name}/apis/{api_name}/revisions/{revision_number}/resourcefiles | Lists resource files in an API proxy revision. For more information, see Manage resources. |
post | /organizations/{org_name}/apis/{api_name}/revisions/{revision_number}/resourcefiles | Imports and creates a resource file for an API proxy revision. Note: Currently, you cannot import a resource file using the Try this API panel. You can import the resource file by passing the contents in the request body or by uploading it from a file on your local machine. For example, the following curl call imports a resource file by passing its contents in the request body. In this case, set the
The following curl call shows how to upload the resources as a file from your local machine. In this case, set the
For more information, see Manage resources. |
delete | /organizations/{org_name}/apis/{api_name}/revisions/{revision_number}/resourcefiles/{resource_type}/{resource_name} | Deletes a resource file from an API proxy revision. For more information, see Manage resources. |
put | /organizations/{org_name}/apis/{api_name}/revisions/{revision_number}/resourcefiles/{resource_type}/{resource_name} | Updates a resource file in an API proxy revision. Note: Currently, you cannot update a resource file using the Try this API panel. You can update the resource file by passing the contents in the request body or by uploading it from a file on your local machine. For example, the following curl call updates a resource file by passing its contents in the request body. In this case, set the
The following curl call shows how to upload the resources as a file from your local machine. In this case, set the
For more information, see Manage resources. |
get | /organizations/{org_name}/environments/{env_name}/resourcefiles | Lists resource files in an environment. For more information, see Manage resources. |
post | /organizations/{org_name}/environments/{env_name}/resourcefiles | Imports and creates a resource file for an environment. Note: Currently, you cannot import a resource file using the Try this API panel. You can import the resource file by passing the contents in the request body or by uploading it from a file on your local machine. For example, the following curl call imports a resource file by passing its contents in the request body. In this case, set the
The following curl call shows how to upload the resources as a file from your local machine. In this case, set the
For more information, see Manage resources. |
delete | /organizations/{org_name}/environments/{env_name}/resourcefiles/{resource_type}/{resource_name} | Deletes a resource file from an environment. For more information, see Manage resources. |
put | /organizations/{org_name}/environments/{env_name}/resourcefiles/{resource_type}/{resource_name} | Updates a resource file in an environment. Note: Currently, you cannot update a resource file using the Try this API panel. You can update the resource file by passing the contents in the request body or by uploading it from a file on your local machine. For example, the following curl call updates a resource file by passing its contents in the request body. In this case, set the
The following curl call shows how to upload the resources as a file from your local machine. In this case, set the
For more information, see Manage resources. |
get | /organizations/{org_name}/resourcefiles | Lists resource files in an organization. For more information, see Manage resources. |
post | /organizations/{org_name}/resourcefiles | Imports and creates a resource file for an organization. Note: Currently, you cannot import a resource file using the Try this API panel. You can import the resource file by passing the contents in the request body or by uploading it from a file on your local machine. For example, the following curl call imports a resource file by passing its contents in the request body. In this case, set the
The following curl call shows how to upload the resources as a file from your local machine. In this case, set the
For more information, see Manage resources. |
delete | /organizations/{org_name}/resourcefiles/{resource_type}/{resource_name} | Deletes a resource file from an organization. For more information, see Manage resources. |
put | /organizations/{org_name}/resourcefiles/{resource_type}/{resource_name} | Updates a resource file in an organization. Note: Currently, you cannot update a resource file using the Try this API panel. You can update the resource file by passing the contents in the request body or by uploading it from a file on your local machine. For example, the following curl call updates a resource file by passing its contents in the request body. In this case, set the
The following curl call shows how to upload the resources as a file from your local machine. In this case, set the
For more information, see Manage resources. |