PUT
/
cloud
/
v2
/
inference
/
deployments
/
{instance_id}
curl --request PUT \
  --url https://api.gcore.com/cloud/v2/inference/deployments/{instance_id} \
  --header 'APIKey: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "api_key_ids": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ],
  "auth_enabled": false,
  "command": [
    "nginx",
    "-g",
    "daemon off;"
  ],
  "containers": [
    {
      "region_id": 7,
      "scale": {
        "cooldown_period": 60,
        "max": 3,
        "min": 1,
        "triggers": {
          "cpu": {
            "threshold": 80
          },
          "memory": {
            "threshold": 70
          }
        }
      }
    }
  ],
  "description": "My first instance",
  "envs": {
    "DEBUG_MODE": "False",
    "KEY": "12345"
  },
  "flavor_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "image": "nginx:latest",
  "image_registry_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "listening_port": 8080,
  "name": "my-instance",
  "probes": {
    "liveness_probe": {
      "enabled": true,
      "probe": {
        "exec": {
          "command": [
            "ls",
            "-l"
          ]
        },
        "failure_threshold": 3,
        "http_get": {
          "headers": {
            "Authorization": "Bearer token 123"
          },
          "host": "127.0.0.1",
          "path": "/healthz",
          "port": 80,
          "schema": "HTTP"
        },
        "initial_delay_seconds": 0,
        "period_seconds": 5,
        "success_threshold": 1,
        "tcp_socket": {
          "port": 80
        },
        "timeout_seconds": 1
      }
    },
    "readiness_probe": {
      "enabled": true,
      "probe": {
        "exec": {
          "command": [
            "ls",
            "-l"
          ]
        },
        "failure_threshold": 3,
        "http_get": {
          "headers": {
            "Authorization": "Bearer token 123"
          },
          "host": "127.0.0.1",
          "path": "/healthz",
          "port": 80,
          "schema": "HTTP"
        },
        "initial_delay_seconds": 0,
        "period_seconds": 5,
        "success_threshold": 1,
        "tcp_socket": {
          "port": 80
        },
        "timeout_seconds": 1
      }
    },
    "startup_probe": {
      "enabled": true,
      "probe": {
        "exec": {
          "command": [
            "ls",
            "-l"
          ]
        },
        "failure_threshold": 3,
        "http_get": {
          "headers": {
            "Authorization": "Bearer token 123"
          },
          "host": "127.0.0.1",
          "path": "/healthz",
          "port": 80,
          "schema": "HTTP"
        },
        "initial_delay_seconds": 0,
        "period_seconds": 5,
        "success_threshold": 1,
        "tcp_socket": {
          "port": 80
        },
        "timeout_seconds": 1
      }
    }
  },
  "project_id": 1,
  "timeout": 120
}'
{
  "address": "https://example.com",
  "api_key_ids": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ],
  "auth_enabled": false,
  "command": [
    "nginx",
    "-g",
    "daemon off;"
  ],
  "containers": [
    {
      "deploy_status": {
        "ready": 1,
        "total": 3
      },
      "region_id": 7,
      "scale": {
        "cooldown_period": 60,
        "max": 3,
        "min": 1,
        "triggers": {
          "cpu": {
            "threshold": 80
          },
          "memory": {
            "threshold": 70
          }
        }
      }
    }
  ],
  "created_at": "2023-08-22T11:21:00Z",
  "description": "My first instance",
  "envs": {
    "DEBUG_MODE": "False",
    "KEY": "12345"
  },
  "flavor_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "image": "nginx:latest",
  "image_registry_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "listening_port": 8080,
  "name": "my-instance",
  "probes": {
    "liveness_probe": {
      "enabled": true,
      "probe": {
        "exec": {
          "command": [
            "ls",
            "-l"
          ]
        },
        "failure_threshold": 3,
        "http_get": {
          "headers": {
            "Authorization": "Bearer token 123"
          },
          "host": "127.0.0.1",
          "path": "/healthz",
          "port": 80,
          "schema": "HTTP"
        },
        "initial_delay_seconds": 0,
        "period_seconds": 5,
        "success_threshold": 1,
        "tcp_socket": {
          "port": 80
        },
        "timeout_seconds": 1
      }
    },
    "readiness_probe": {
      "enabled": true,
      "probe": {
        "exec": {
          "command": [
            "ls",
            "-l"
          ]
        },
        "failure_threshold": 3,
        "http_get": {
          "headers": {
            "Authorization": "Bearer token 123"
          },
          "host": "127.0.0.1",
          "path": "/healthz",
          "port": 80,
          "schema": "HTTP"
        },
        "initial_delay_seconds": 0,
        "period_seconds": 5,
        "success_threshold": 1,
        "tcp_socket": {
          "port": 80
        },
        "timeout_seconds": 1
      }
    },
    "startup_probe": {
      "enabled": true,
      "probe": {
        "exec": {
          "command": [
            "ls",
            "-l"
          ]
        },
        "failure_threshold": 3,
        "http_get": {
          "headers": {
            "Authorization": "Bearer token 123"
          },
          "host": "127.0.0.1",
          "path": "/healthz",
          "port": 80,
          "schema": "HTTP"
        },
        "initial_delay_seconds": 0,
        "period_seconds": 5,
        "success_threshold": 1,
        "tcp_socket": {
          "port": 80
        },
        "timeout_seconds": 1
      }
    }
  },
  "status": "ACTIVE",
  "timeout": 120
}

Authorizations

APIKey
string
header
required

API key for authentication.

Path Parameters

instance_id
string
required

Inference Instance ID

Body

application/json

Response

200
application/json

Inference instance

The response is of type object.