Create CPU Pod through GraphQL
The API seems to expect a gpuTypeId even when you specify gpuCount: 0. Is there currently any way of creating a cpu only pod with GraphQL or any other programmatic way? Thanks
6 Replies
Solution
Hmm yeah try to reverse engineer it from your browser for now
Should work
I didn't even think of that, thanks
For anyone searching for this in the future, the GraphQL documentation doesn't seem to be up to date. There is a mutation called deployCpuPod that I couldn't find in the docs and the usual podFindAndDeployOnDemand won't work for CPU-only pods.
No worries, I'm sure runpod is fixing their graphql API too so it's more complete for all actions
Yes
Its like incomplete for now
I'd imagine it will be more of a priority for them now that they've added CPU endpoints too
For now this works great
Example of the mutation:
{
"query": "mutation { deployCpuPod( input: { cloudType: SECURE, containerDiskInGb: 15, dataCenterId: null, deployCost: 0.06, instanceId: "cpu3c-2-4", networkVolumeId: null, ports: "8888/http", startJupyter: true, startSsh: true, templateId: "your template id", volumeKey: null } ) { id }"
}
Nice!