# 🔣 CCP Method Descriptor: method.json Every method in CCP is defined by a structured JSON file called `method.json`. This file fully describes the method’s behavior, interface, and execution context, and is essential for running, sharing, and reproducing the method. You can download it using the **Download** button (![Download Icon](/_static/imgs/method_button_download.png)) in the method list. --- ## Purpose The `method.json` file is the definitive contract for a method’s definition. It: - Specifies inputs, outputs, runtime, and logic - Enables sharing and importing/exporting across VREs - Supports method versioning and provenance tracking --- ## Structure Overview ### `id` (required) ```json "id": "af3e3771-5b1f-402b-89b8-4ecdb121af92" ``` A globally unique identifier for the method. It must remain consistent to ensure traceability of executions and metadata. --- ### `title`, `description`, `version` Basic metadata used for display and documentation. --- ### `metadata` Contains roles like: - `author`: person or group creating the method - `category`: classification in the UI - `context`: VRE or infrastructure where the method is defined --- ### `inputs` Defines the method’s parameters. Each includes: - `id`, `title`, `description` - `schema` with type, format, and MIME type - `minOccurs` / `maxOccurs` #### `ccpimage`: Runtime Docker Image (required) ```json "ccpimage": { "id": "ccpimage", "title": "Runtime", "description": "The image of the runtime to use for method execution.", "schema": { "type": "string", "format": "url", "default": "hub.dev.d4science.org/test/python-gdal:latest" } } ``` This input defines the Docker image used to run the method logic inside the container. It must be compatible with the target infrastructure. --- ### 📦 Output `outputs` Standard and custom outputs, including `stdout`, `stderr`, or generated files. --- ### `additionalParameters` Includes: - `deploy-script`: prepares the environment - `execute-script`: runs the method - `undeploy-script`: optional cleanup - `lifecycle`: timestamps and modifications --- ### `links` → `compatibleWith` (required) ```json "links": [ { "rel": "compatibleWith", "title": "D4Science production Infrastructure", "href": "infrastructures/d4science-prod-swarm" } ] ``` This field is **mandatory** and declares which infrastructure(s) the method is **compatible with**. If not present, the method cannot be scheduled for execution. It ensures that: - The method can run on the selected infrastructure - The Docker image is accessible from that infrastructure - Runtime features (e.g., network, storage) match execution requirements --- ### `keywords` (optional) Used for search and discovery in the CCP interface. --- ## 💡 Note Notes - The `id` and `compatibleWith` fields are **mandatory** - The method is executed only if the infrastructure matches `compatibleWith` - The file can be uploaded again to update, clone, or transfer the method across VREs --- ## 🔗 Related Pages - 🔧 [Method development workflow](./01_method_development_flow.md) - 🐍 [Python-based methods](./03_python_method.md) - 🛠 [Deploy and execute scripts](./06_scripts_and_placeholders.md) - 🐧 [Docker runtime (ccpimage)](./02_defining_ccpimage.md)