Workloads V2
Bearer authentication
True to perform validations only, without side effects.
falseExample: falseKubernetes YAML manifest encoded in base 64. Mutually exclusive with manifest.
YXBpVmVyc2lvbjogdjEKa2luZDogUG9kCm1ldGFkYXRhOgogIG5hbWU6IG15LXBvZApzcGVjOgogIGNvbnRhaW5lcnM6CiAgLSBuYW1lOiBuZ2lueAogICAgaW1hZ2U6IG5naW54OmxhdGVzdAo=Workload creation request accepted.
The desired phase of the workload.
Bad request.
Unauthorized
Forbidden
The specified resource already exists
unexpected error
unexpected error
POST /api/v2/workloads HTTP/1.1
Host: app.run.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 738
{
"metadata": {
"name": "my-workload-name",
"useGivenNameAsPrefix": true,
"projectId": 1,
"clusterId": "71f69d83-ba66-4822-adf5-55ce55efd210",
"priority": "text",
"category": "text",
"preemptibility": "preemptible",
"configuration": {
"mnnvl": "text",
"userCredentials": {
"sources": [
{
"ref": "my-hf-token-abc1234567"
}
]
}
}
},
"manifest": {
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"name": "my-app"
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "my-app"
}
},
"template": {
"metadata": {
"labels": {
"app": "my-app"
}
},
"spec": {
"containers": [
{
"name": "app",
"image": "nginx:latest"
}
]
}
}
}
},
"manifestBase64Encoded": "YXBpVmVyc2lvbjogdjEKa2luZDogUG9kCm1ldGFkYXRhOgogIG5hbWU6IG15LXBvZApzcGVjOgogIGNvbnRhaW5lcnM6CiAgLSBuYW1lOiBuZ2lueAogICAgaW1hZ2U6IG5naW54OmxhdGVzdAo="
}{
"metadata": {
"name": "my-workload-name",
"projectId": 1,
"priority": "text",
"category": "text",
"preemptibility": "preemptible",
"configuration": {
"mnnvl": "text",
"userCredentials": {
"sources": [
{
"ref": "my-hf-token-abc1234567"
}
]
}
},
"id": "123e4567-e89b-12d3-a456-426614174000",
"gvk": {
"group": "apps",
"version": "v1",
"kind": "Deployment"
},
"projectName": "project-a",
"clusterId": "71f69d83-ba66-4822-adf5-55ce55efd210",
"tenantId": 1001,
"departmentId": 2,
"departmentName": "default",
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "user@run.ai",
"updatedAt": "2024-01-15T10:35:00Z",
"updatedBy": "user@run.ai",
"deletedAt": "2024-01-15T10:35:00Z",
"deletedBy": "user@run.ai"
},
"desiredPhase": "Running",
"workloadManifest": {
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"name": "my-app"
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "my-app"
}
},
"template": {
"metadata": {
"labels": {
"app": "my-app"
}
},
"spec": {
"containers": [
{
"name": "app",
"image": "nginx:latest"
}
]
}
}
}
},
"rawManifest": {
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"name": "my-app"
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "my-app"
}
},
"template": {
"metadata": {
"labels": {
"app": "my-app"
}
},
"spec": {
"containers": [
{
"name": "app",
"image": "nginx:latest"
}
]
}
}
}
}
}Bearer authentication
The ID of the workload.
Successfully retrieved the workload
Unauthorized
Forbidden
The specified resource was not found
unexpected error
unexpected error
GET /api/v2/workloads/{WorkloadV2Id} HTTP/1.1
Host: app.run.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"workload": {
"metadata": {
"name": "my-workload-name",
"projectId": 1,
"priority": "text",
"category": "text",
"preemptibility": "preemptible",
"configuration": {
"mnnvl": "text",
"userCredentials": {
"sources": [
{
"ref": "my-hf-token-abc1234567"
}
]
}
},
"id": "123e4567-e89b-12d3-a456-426614174000",
"gvk": {
"group": "apps",
"version": "v1",
"kind": "Deployment"
},
"projectName": "project-a",
"clusterId": "71f69d83-ba66-4822-adf5-55ce55efd210",
"tenantId": 1001,
"departmentId": 2,
"departmentName": "default",
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "user@run.ai",
"updatedAt": "2024-01-15T10:35:00Z",
"updatedBy": "user@run.ai",
"deletedAt": "2024-01-15T10:35:00Z",
"deletedBy": "user@run.ai"
},
"desiredPhase": "Running",
"workloadManifest": {
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"name": "my-app"
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "my-app"
}
},
"template": {
"metadata": {
"labels": {
"app": "my-app"
}
},
"spec": {
"containers": [
{
"name": "app",
"image": "nginx:latest"
}
]
}
}
}
},
"rawManifest": {
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"name": "my-app"
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "my-app"
}
},
"template": {
"metadata": {
"labels": {
"app": "my-app"
}
},
"spec": {
"containers": [
{
"name": "app",
"image": "nginx:latest"
}
]
}
}
}
}
},
"syncInfo": {
"status": "Queued",
"message": "text"
}
}Bearer authentication
The ID of the workload.
Kubernetes YAML manifest encoded in base 64. Mutually exclusive with manifest.
YXBpVmVyc2lvbjogdjEKa2luZDogUG9kCm1ldGFkYXRhOgogIG5hbWU6IG15LXBvZApzcGVjOgogIGNvbnRhaW5lcnM6CiAgLSBuYW1lOiBuZ2lueAogICAgaW1hZ2U6IG5naW54OmxhdGVzdAo=Workload update request accepted
The desired phase of the workload.
Unauthorized
Forbidden
The specified resource was not found
unexpected error
unexpected error
PUT /api/v2/workloads/{WorkloadV2Id} HTTP/1.1
Host: app.run.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 490
{
"metadata": {
"priority": "text",
"category": "text"
},
"manifest": {
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"name": "my-app"
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "my-app"
}
},
"template": {
"metadata": {
"labels": {
"app": "my-app"
}
},
"spec": {
"containers": [
{
"name": "app",
"image": "nginx:latest"
}
]
}
}
}
},
"manifestBase64Encoded": "YXBpVmVyc2lvbjogdjEKa2luZDogUG9kCm1ldGFkYXRhOgogIG5hbWU6IG15LXBvZApzcGVjOgogIGNvbnRhaW5lcnM6CiAgLSBuYW1lOiBuZ2lueAogICAgaW1hZ2U6IG5naW54OmxhdGVzdAo="
}{
"metadata": {
"name": "my-workload-name",
"projectId": 1,
"priority": "text",
"category": "text",
"preemptibility": "preemptible",
"configuration": {
"mnnvl": "text",
"userCredentials": {
"sources": [
{
"ref": "my-hf-token-abc1234567"
}
]
}
},
"id": "123e4567-e89b-12d3-a456-426614174000",
"gvk": {
"group": "apps",
"version": "v1",
"kind": "Deployment"
},
"projectName": "project-a",
"clusterId": "71f69d83-ba66-4822-adf5-55ce55efd210",
"tenantId": 1001,
"departmentId": 2,
"departmentName": "default",
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "user@run.ai",
"updatedAt": "2024-01-15T10:35:00Z",
"updatedBy": "user@run.ai",
"deletedAt": "2024-01-15T10:35:00Z",
"deletedBy": "user@run.ai"
},
"desiredPhase": "Running",
"workloadManifest": {
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"name": "my-app"
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "my-app"
}
},
"template": {
"metadata": {
"labels": {
"app": "my-app"
}
},
"spec": {
"containers": [
{
"name": "app",
"image": "nginx:latest"
}
]
}
}
}
},
"rawManifest": {
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"name": "my-app"
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "my-app"
}
},
"template": {
"metadata": {
"labels": {
"app": "my-app"
}
},
"spec": {
"containers": [
{
"name": "app",
"image": "nginx:latest"
}
]
}
}
}
}
}Bearer authentication
The ID of the workload.
Deletion request accepted.
The desired phase of the workload.
Unauthorized
Forbidden
The specified resource was not found
unexpected error
unexpected error
DELETE /api/v2/workloads/{WorkloadV2Id} HTTP/1.1
Host: app.run.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"metadata": {
"name": "my-workload-name",
"projectId": 1,
"priority": "text",
"category": "text",
"preemptibility": "preemptible",
"configuration": {
"mnnvl": "text",
"userCredentials": {
"sources": [
{
"ref": "my-hf-token-abc1234567"
}
]
}
},
"id": "123e4567-e89b-12d3-a456-426614174000",
"gvk": {
"group": "apps",
"version": "v1",
"kind": "Deployment"
},
"projectName": "project-a",
"clusterId": "71f69d83-ba66-4822-adf5-55ce55efd210",
"tenantId": 1001,
"departmentId": 2,
"departmentName": "default",
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "user@run.ai",
"updatedAt": "2024-01-15T10:35:00Z",
"updatedBy": "user@run.ai",
"deletedAt": "2024-01-15T10:35:00Z",
"deletedBy": "user@run.ai"
},
"desiredPhase": "Running",
"workloadManifest": {
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"name": "my-app"
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "my-app"
}
},
"template": {
"metadata": {
"labels": {
"app": "my-app"
}
},
"spec": {
"containers": [
{
"name": "app",
"image": "nginx:latest"
}
]
}
}
}
},
"rawManifest": {
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"name": "my-app"
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "my-app"
}
},
"template": {
"metadata": {
"labels": {
"app": "my-app"
}
},
"spec": {
"containers": [
{
"name": "app",
"image": "nginx:latest"
}
]
}
}
}
}
}Last updated