resources.create
POST
/resources
const url = 'https://example.com/api/resources';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"projectId":"example","environmentId":"example","destinationId":"example","name":"example","kind":"application","description":"example","services":[{"name":"example","kind":"web"}],"source":{"kind":"local-folder","locator":"./apps/web","displayName":"Web console","baseDirectory":".","metadata":{"framework":"sveltekit"}},"runtimeProfile":{"strategy":"auto","installCommand":"example","buildCommand":"example","startCommand":"example","runtimeName":"example","publishDirectory":"example","dockerfilePath":"example","dockerComposeFilePath":"example","buildTarget":"example","healthCheckPath":"example","healthCheck":{"enabled":true,"type":"http","intervalSeconds":5,"timeoutSeconds":5,"retries":10,"startPeriodSeconds":5,"http":{"method":"GET","scheme":"http","host":"localhost","port":1,"path":"/","expectedStatusCode":200,"expectedResponseText":"example"}}},"networkProfile":{"internalPort":1,"upstreamProtocol":"http","exposureMode":"none","targetServiceName":"example","hostPort":1}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/resources \ --header 'Content-Type: application/json' \ --data '{ "projectId": "example", "environmentId": "example", "destinationId": "example", "name": "example", "kind": "application", "description": "example", "services": [ { "name": "example", "kind": "web" } ], "source": { "kind": "local-folder", "locator": "./apps/web", "displayName": "Web console", "baseDirectory": ".", "metadata": { "framework": "sveltekit" } }, "runtimeProfile": { "strategy": "auto", "installCommand": "example", "buildCommand": "example", "startCommand": "example", "runtimeName": "example", "publishDirectory": "example", "dockerfilePath": "example", "dockerComposeFilePath": "example", "buildTarget": "example", "healthCheckPath": "example", "healthCheck": { "enabled": true, "type": "http", "intervalSeconds": 5, "timeoutSeconds": 5, "retries": 10, "startPeriodSeconds": 5, "http": { "method": "GET", "scheme": "http", "host": "localhost", "port": 1, "path": "/", "expectedStatusCode": 200, "expectedResponseText": "example" } } }, "networkProfile": { "internalPort": 1, "upstreamProtocol": "http", "exposureMode": "none", "targetServiceName": "example", "hostPort": 1 } }'Request Body required
Section titled “Request Body required ” Media type application/json
object
projectId
required
string
environmentId
required
string
destinationId
string
name
required
string
kind
string
description
string
services
Array<object>
object
name
required
string
kind
required
string
source
object
kind
required
string
locator
required
string
displayName
string
gitRef
string
commitSha
string
baseDirectory
string
originalLocator
string
repositoryId
string
repositoryFullName
string
defaultBranch
string
imageName
string
imageTag
string
imageDigest
string
metadata
object
key
additional properties
string
runtimeProfile
object
strategy
string
installCommand
string
buildCommand
string
startCommand
string
runtimeName
string
publishDirectory
string
dockerfilePath
string
dockerComposeFilePath
string
buildTarget
string
healthCheckPath
string
healthCheck
object
enabled
boolean
type
string
intervalSeconds
integer
timeoutSeconds
integer
retries
integer
startPeriodSeconds
integer
http
object
method
string
scheme
string
host
string
port
integer
path
string
expectedStatusCode
integer
expectedResponseText
string
networkProfile
object
internalPort
required
integer
upstreamProtocol
string
exposureMode
string
targetServiceName
string
hostPort
integer
Responses
Section titled “ Responses ”OK
Media type application/json
object
id
required
string
Example generated
{ "id": "example"}