Resource technologies as code
2 minute read
Custom resource technologies are those built with an AI client. You can push one to a repository, preview the changes, and refresh it from the repository. You can also create a technology from one already in a repository, for example to copy it to another CMP instance. This requires a repository linked to Cloud Management Platform (CMP) and repository credentials on your profile so commits are attributed to you. See Integrate a remote source code repository.
What CMP stores in the repository
Each technology gets its own folder, resource_technologies/<global ID>/, holding:
<global ID>_metadata.json: the technology’s global ID, name, slug, contract version, and definition.<global ID>_wrapper.py: the technology’s Python code.<global ID>_icon.pngor<global ID>_icon.svg: the icon, if the technology has one.
Resource handler endpoints and credentials are stored on the handlers, so they never reach the repository.
Push and refresh a resource technology
Go to Admin > Resource Technologies, select the Custom tab, open the technology, then select its Repository tab.
Push to Remote Source opens a form for a Repository, Branch, and Commit Message. For Branch, select an existing branch or enter the name of a new one. If the technology has been pushed before, select Preview to see what changed.
Refresh from Remote Source appears once the technology has been pushed or created from a repository. It prompts for a Repository and Branch, then updates the technology in CMP. Resource handlers use the refreshed code from their next call.
The tab also shows the repository, the remote source URL, and when the technology was last refreshed.
Nothing is pushed or refreshed automatically.
A technology linked to a repository is read-only unless Remote Content Mode in Miscellaneous Settings allows editing. While it is read-only, the Code tab can’t be saved, Push to Remote Source is disabled, and an AI client can’t change the technology. Change it in the repository, then refresh it in CMP.
Create a resource technology from a repository
- Go to Admin > Resource Technologies and select the Custom tab.
- Select Create from Repository.
- Provide a Repository, Branch, and Resource Technology JSON File. The list shows the
_metadata.jsonfiles in the repository’sresource_technologies/folder. - Select Create.
Creating a technology doesn’t create a resource handler for it. See Add a resource handler for the new technology.
Related
- Integrate a remote source code repository: Linking a repository and setting credentials for your commits.
- AI-built resource handlers: Building, testing, and managing custom technologies.