how to start with network volume through graphql api

curl --request POST \
--header 'content-type: application/json' \
--url 'https://api.runpod.io/graphql?api_key=${YOUR_API_KEY}' \
--data '{"query": "mutation { podFindAndDeployOnDemand( input: { cloudType: ALL, gpuCount: 1, volumeInGb: 40, containerDiskInGb: 40, minVcpuCount: 2, minMemoryInGb: 15, gpuTypeId: \"NVIDIA RTX A6000\", name: \"Runpod Tensorflow\", imageName: \"runpod/tensorflow\", dockerArgs: \"\", ports: \"8888/http\", volumeMountPath: \"/workspace\", env: [{ key: \"JUPYTER_PASSWORD\", value: \"rn51hunbpgtltcpac3ol\" }] } ) { id imageName env machineId machine { podHostId } } }"}'
curl --request POST \
--header 'content-type: application/json' \
--url 'https://api.runpod.io/graphql?api_key=${YOUR_API_KEY}' \
--data '{"query": "mutation { podFindAndDeployOnDemand( input: { cloudType: ALL, gpuCount: 1, volumeInGb: 40, containerDiskInGb: 40, minVcpuCount: 2, minMemoryInGb: 15, gpuTypeId: \"NVIDIA RTX A6000\", name: \"Runpod Tensorflow\", imageName: \"runpod/tensorflow\", dockerArgs: \"\", ports: \"8888/http\", volumeMountPath: \"/workspace\", env: [{ key: \"JUPYTER_PASSWORD\", value: \"rn51hunbpgtltcpac3ol\" }] } ) { id imageName env machineId machine { podHostId } } }"}'
Found this in the api documentation. https://docs.runpod.io/sdks/graphql/manage-pods#create-on-demand-pod How would I go about attaching a network volume to this using the api?
2 Replies
Dj
Dj3mo ago
You should use the REST API it's a little easier to understand. https://docs.runpod.io/api-reference/pods/POST/pods#body-network-volume-id
Runpod Documentation
Create a new Pod - Runpod Documentation
Creates a new Pod and optionally deploys it.
J.
J.3mo ago
@blabbercrab I got my own little personal solution if you want to take a look: https://github.com/justinwlin/Runpod-Network-Volume-Storage-Tool
GitHub
GitHub - justinwlin/Runpod-Network-Volume-Storage-Tool: CLI / Funct...
CLI / Function call / API server to manager Runpod Network Volume Storage - justinwlin/Runpod-Network-Volume-Storage-Tool

Did you find this page helpful?