> This page is for version v2026.01.16-dev.
> For other versions, use one of these documentation indexes:
> - latest (default): https://docs.machanirobotics.dev/latest/llms.txt
> - v2026.01.16-dev: https://docs.machanirobotics.dev/v-2026-01-16-dev/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.machanirobotics.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.machanirobotics.dev/_mcp/server.

# Deployed Resource State Stream

POST https://api.machanirobotics.com/v1/management/deployment/state:deployedResourceStateStream
Content-Type: application/json

Streams status of deployed resources

Reference: https://docs.machanirobotics.dev/v-2026-01-16-dev/2026-01-16-dev/latest/deployment-service/deployedresourcestatestream

## Request

### Body (application/json)

This endpoint expects a DeployedResourceStateStreamRequest.

- `kubernetesResources` (list of string, optional) — The kind names of the kubernetes resources whose state is required. If empty, the states of all supported resources will be streamed.

## Response

### 200

OK

- `resources` (DeployedResource, optional) — Resources that were deployed

## Errors

### 400 Bad Request Error

Bad Request

- `code` (integer, optional) — The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
- `message` (string, optional) — A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
- `details` (list of GoogleProtobufAny, optional) — A list of messages that carry the error details. There is a common set of message types for APIs to use.

## Types

### DeployedResource

Deployed resources

- `kubernetes` (list of KubernetesResource, optional) — Kubernetes resources associated with the deployment

### GoogleProtobufAny

Contains an arbitrary serialized message along with a @type that describes the type of the serialized message.

- `@type` (string, optional) — The type of the serialized message.

### KubernetesResource

Kubernetes resources in a deployment

- `namespace` (string, optional) — The namespace name
- `pods` (list of Pod, optional) — The pods in the namespace
- `services` (list of Service, optional) — The services in the namespace
- `deployments` (list of Deployment, optional) — The deployments in the namespace

### Pod

Kubernetes pod

- `status` (PodStatus, optional) — Status of the pod

### Service

Kubernetes service

- `spec` (ServiceSpec, optional) — Spec defines the behavior of a service.

### Deployment

Kubernetes deployment

- `status` (DeploymentStatus, optional) — Status of the deployment

### PodStatus

PodStatus represents information about the status of a pod. Status may trail the actual state of a system, especially if the node that hosts the pod cannot contact the control plane.

- `phase` (string, optional) — The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle. The conditions array, the reason and message fields, and the individual container status arrays contain more detail about the pod's status. There are five possible phase values: Pending: The pod has been accepted by the Kubernetes system, but one or more of the container images has not been created. This includes time before being scheduled as well as time spent downloading images over the network, which could take a while. Running: The pod has been bound to a node, and all of the containers have been created. At least one container is still running, or is in the process of starting or restarting. Succeeded: All containers in the pod have terminated in success, and will not be restarted. Failed: All containers in the pod have terminated, and at least one container has terminated in failure. The container either exited with non-zero status or was terminated by the system. Unknown: For some reason the state of the pod could not be obtained, typically due to an error in communicating with the host of the pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-phase
- `conditions` (list of PodCondition, optional) — Current service state of pod.
- `message` (string, optional) — A human readable message indicating details about why the pod is in this condition.
- `reason` (string, optional) — A brief CamelCase message indicating details about why the pod is in this state. e.g. 'Evicted'
- `initContainerStatuses` (list of ContainerStatus, optional) — Statuses of init containers in this pod. The most recent successful non-restartable init container will have ready = true, the most recently started container will have startTime set. Each init container in the pod should have at most one status in this list, and all statuses should be for containers in the pod. However this is not enforced. If a status for a non-existent container is present in the list, or the list has duplicate names, the behavior of various Kubernetes components is not defined and those statuses might be ignored. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-and-container-status
- `containerStatuses` (list of ContainerStatus, optional) — Statuses of containers in this pod. Each container in the pod should have at most one status in this list, and all statuses should be for containers in the pod. However this is not enforced. If a status for a non-existent container is present in the list, or the list has duplicate names, the behavior of various Kubernetes components is not defined and those statuses might be ignored. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status

### ServiceSpec

ServiceSpec describes the attributes that a user creates on a service.

- `ports` (list of ServicePort, optional) — The list of ports that are exposed by this service. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies
- `clusterIp` (string, optional) — cluster_ip is the IP address of the service and is usually assigned randomly. If an address is specified manually, is in-range (as per system configuration), and is not in use, it will be allocated to the service; otherwise creation of the service will fail. This field may not be changed through updates unless the type field is also being changed to ExternalName (which requires this field to be blank) or the type field is being changed from ExternalName (in which case this field may optionally be specified, as describe above). Valid values are "None", empty string (""), or a valid IP address. Setting this to "None" makes a "headless service" (no virtual IP), which is useful when direct endpoint connections are preferred and proxying is not required. Only applies to types ClusterIP, NodePort, and LoadBalancer. If this field is specified when creating a Service of type ExternalName, creation will fail. This field will be wiped when updating a Service to type ExternalName. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies
- `type` (integer, optional) — type determines how the Service is exposed. Defaults to ClusterIP. Valid options are ExternalName, ClusterIP, NodePort, and LoadBalancer. "ClusterIP" allocates a cluster-internal IP address for load-balancing to endpoints. Endpoints are determined by the selector or if that is not specified, by manual construction of an Endpoints object or EndpointSlice objects. If clusterIP is "None", no virtual IP is allocated and the endpoints are published as a set of endpoints rather than a virtual IP. "NodePort" builds on ClusterIP and allocates a port on every node which routes to the same endpoints as the clusterIP. "LoadBalancer" builds on NodePort and creates an external load-balancer (if supported in the current cloud) which routes to the same endpoints as the clusterIP. "ExternalName" aliases this service to the specified externalName. Several other fields do not apply to ExternalName services. More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
- `externalIps` (list of string, optional) — external_ips is a list of IP addresses for which nodes in the cluster will also accept traffic for this service. These IPs are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this IP. A common example is external load-balancers that are not part of the Kubernetes system.
- `externalReference` (string, optional) — external_reference is the external reference that discovery mechanisms will return as an alias for this service (e.g. a DNS CNAME record). No proxying will be involved. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) and requires `type` to be "ExternalName".

### DeploymentStatus

DeploymentStatus is the most recently observed status of the Deployment.

- `replicas` (integer, optional) — Total number of non-terminating pods targeted by this deployment (their labels match the selector).
- `updatedReplicas` (integer, optional) — Total number of non-terminating pods targeted by this deployment that have the desired template spec.
- `readyReplicas` (integer, optional) — Total number of non-terminating pods targeted by this Deployment with a Ready Condition.
- `availableReplicas` (integer, optional) — Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment.
- `unavailableReplicas` (integer, optional) — Total number of unavailable pods targeted by this deployment. This is the total number of pods that are still required for the deployment to have 100% available capacity. They may either be pods that are running but not yet available or pods that still have not been created.
- `conditions` (list of DeploymentCondition, optional) — Represents the latest available observations of a deployment's current state.

### PodCondition

PodCondition contains details for the current condition of this pod.

- `type` (integer, optional) — Type is the type of the condition. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions
- `status` (integer, optional) — Status is the status of the condition. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions
- `lastProbeTime` (datetime, optional) — Last time we probed the condition.
- `lastTransitionTime` (datetime, optional) — Last time the condition transitioned from one status to another.
- `reason` (string, optional) — Unique, one-word, CamelCase reason for the condition's last transition.
- `message` (string, optional) — Human-readable message indicating details about last transition.

### ContainerStatus

ContainerStatus contains details for the current status of this container.

- `dnsLabel` (string, optional) — Name is a DNS_LABEL representing the unique name of the container. Each container in a pod must have a unique name across all container types. Cannot be updated.
- `state` (ContainerState, optional) — State holds details about the container's current condition.
- `lastState` (ContainerState, optional) — LastTerminationState holds the last termination state of the container to help debug container crashes and restarts. This field is not populated if the container is still running and RestartCount is 0.
- `ready` (boolean, optional) — Ready specifies whether the container is currently passing its readiness check. The value will change as readiness probes keep executing. If no readiness probes are specified, this field defaults to true once the container is fully started (see Started field). The value is typically used to determine whether a container is ready to accept traffic.
- `restartCount` (integer, optional) — RestartCount holds the number of times the container has been restarted. Kubelet makes an effort to always increment the value, but there are cases when the state may be lost due to node restarts and then the value may be reset to 0. The value is never negative.
- `image` (string, optional) — Image is the name of container image that the container is running. The container image may not match the image used in the PodSpec, as it may have been resolved by the runtime. More info: https://kubernetes.io/docs/concepts/containers/images.
- `started` (boolean, optional) — Started indicates whether the container has finished its postStart lifecycle hook and passed its startup probe. Initialized as false, becomes true after startupProbe is considered successful. Resets to false when the container is restarted, or if kubelet loses state temporarily. In both cases, startup probes will run again. Is always true when no startupProbe is defined and container is running and has passed the postStart lifecycle hook. The null value must be treated the same as false.

### ServicePort

ServicePort contains information on service's port.

- `dnsLabel` (string, optional) — The name of this port within the service. This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. When considering the endpoints for a Service, this must match the 'name' field in the EndpointPort. Optional if only one ServicePort is defined on this service.
- `protocol` (string, optional) — The IP protocol for this port. Supports "TCP", "UDP", and "SCTP". Default is TCP.
- `port` (integer, optional) — The port that will be exposed by this service.
- `targetPort` (integer, optional) — Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. If this is a string, it will be looked up as a named port in the target Pod's container ports. If this is not specified, the value of the 'port' field is used (an identity map). This field is ignored for services with clusterIP=None, and should be omitted or set equal to the 'port' field. More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service
- `nodePort` (integer, optional) — The port on each node on which this service is exposed when type is NodePort or LoadBalancer. Usually assigned by the system. If a value is specified, in-range, and not in use it will be used, otherwise the operation will fail. If not specified, a port will be allocated if this Service requires one. If this field is specified when creating a Service which does not need it, creation will fail. This field will be wiped when updating a Service to no longer need it (e.g. changing type from NodePort to ClusterIP). More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport

### DeploymentCondition

DeploymentCondition describes the state of a deployment at a certain point.

- `type` (integer, optional) — Type of deployment condition.
- `status` (integer, optional) — Status of the condition.
- `lastUpdateTime` (datetime, optional) — The last time this condition was updated.
- `lastTransitionTime` (datetime, optional) — Last time the condition transitioned from one status to another.
- `reason` (string, optional) — The reason for the condition's last transition.
- `message` (string, optional) — A human readable message indicating details about the transition.

### ContainerState

ContainerState holds a possible state of container. Only one of its members may be specified. If none of them is specified, the default one is ContainerStateWaiting.

- `waiting` (ContainerStateWaiting, optional) — Details about a waiting container
- `running` (ContainerStateRunning, optional) — Details about a running container
- `terminated` (ContainerStateTerminated, optional) — Details about a terminated container

### ContainerStateWaiting

ContainerStateWaiting is a waiting state of a container.

- `reason` (string, optional) — (brief) reason the container is not yet running.
- `message` (string, optional) — Message regarding why the container is not yet running.

### ContainerStateRunning

ContainerStateRunning is a running state of a container.

- `startTime` (datetime, optional) — Time at which the container was last (re-)started

### ContainerStateTerminated

ContainerStateTerminated is a terminated state of a container.

- `exitCode` (integer, optional) — Exit status from the last termination of the container
- `signal` (integer, optional) — Signal from the last termination of the container
- `reason` (string, optional) — (brief) reason from the last termination of the container
- `message` (string, optional) — Message regarding the last termination of the container
- `startTime` (datetime, optional) — Time at which previous execution of the container started
- `finishTime` (datetime, optional) — Time at which the container last terminated

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "resources": {
    "kubernetes": [
      {
        "namespace": "production",
        "pods": [
          {
            "status": {
              "phase": "Running",
              "conditions": [
                {
                  "type": 1,
                  "status": 1,
                  "lastProbeTime": "2024-04-20T10:15:00Z",
                  "lastTransitionTime": "2024-04-20T10:10:00Z",
                  "reason": "ContainersReady",
                  "message": "All containers are ready"
                }
              ],
              "message": "Pod is running smoothly",
              "reason": "Running",
              "initContainerStatuses": [
                {
                  "dnsLabel": "init-db-migration",
                  "state": {
                    "waiting": {
                      "reason": "ImagePullBackOff",
                      "message": "Back-off pulling image"
                    },
                    "running": {
                      "startTime": "2024-04-20T09:50:00Z"
                    },
                    "terminated": {
                      "exitCode": 0,
                      "signal": 0,
                      "reason": "Completed",
                      "message": "Init container completed successfully",
                      "startTime": "2024-04-20T09:45:00Z",
                      "finishTime": "2024-04-20T09:50:00Z"
                    }
                  },
                  "lastState": {
                    "waiting": {
                      "reason": "CrashLoopBackOff",
                      "message": "Back-off restarting failed container"
                    },
                    "running": {
                      "startTime": "2024-04-20T09:40:00Z"
                    },
                    "terminated": {
                      "exitCode": 1,
                      "signal": 0,
                      "reason": "Error",
                      "message": "Init container crashed",
                      "startTime": "2024-04-20T09:35:00Z",
                      "finishTime": "2024-04-20T09:40:00Z"
                    }
                  },
                  "ready": true,
                  "restartCount": 2,
                  "image": "docker.io/machani/init-db:1.0.0",
                  "started": true
                }
              ],
              "containerStatuses": [
                {
                  "dnsLabel": "app-server",
                  "state": {
                    "waiting": {
                      "reason": "ContainerCreating",
                      "message": "Waiting for container to start"
                    },
                    "running": {
                      "startTime": "2024-04-20T10:00:00Z"
                    },
                    "terminated": {
                      "exitCode": 0,
                      "signal": 0,
                      "reason": "Completed",
                      "message": "Container terminated normally",
                      "startTime": "2024-04-20T09:00:00Z",
                      "finishTime": "2024-04-20T09:30:00Z"
                    }
                  },
                  "lastState": {
                    "waiting": {
                      "reason": "CrashLoopBackOff",
                      "message": "Back-off restarting failed container"
                    },
                    "running": {
                      "startTime": "2024-04-20T08:50:00Z"
                    },
                    "terminated": {
                      "exitCode": 1,
                      "signal": 0,
                      "reason": "Error",
                      "message": "Container crashed due to OOM",
                      "startTime": "2024-04-20T08:45:00Z",
                      "finishTime": "2024-04-20T08:50:00Z"
                    }
                  },
                  "ready": true,
                  "restartCount": 3,
                  "image": "docker.io/machani/app-server:2.3.1",
                  "started": true
                }
              ]
            }
          }
        ],
        "services": [
          {
            "spec": {
              "ports": [
                {
                  "dnsLabel": "http",
                  "protocol": "TCP",
                  "port": 80,
                  "targetPort": 8080,
                  "nodePort": 30080
                }
              ],
              "clusterIp": "10.96.0.1",
              "type": 2,
              "externalIps": [
                "192.168.1.100"
              ],
              "externalReference": ""
            }
          }
        ],
        "deployments": [
          {
            "status": {
              "replicas": 5,
              "updatedReplicas": 5,
              "readyReplicas": 5,
              "availableReplicas": 5,
              "unavailableReplicas": 0,
              "conditions": [
                {
                  "type": 1,
                  "status": 1,
                  "lastUpdateTime": "2024-04-20T10:00:00Z",
                  "lastTransitionTime": "2024-04-20T09:55:00Z",
                  "reason": "NewReplicaSetAvailable",
                  "message": "ReplicaSet \"app-server-12345\" has successfully progressed."
                }
              ]
            }
          }
        ]
      }
    ]
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.machanirobotics.com/v1/management/deployment/state:deployedResourceStateStream"

payload = {}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.machanirobotics.com/v1/management/deployment/state:deployedResourceStateStream';
const options = {method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{}'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.machanirobotics.com/v1/management/deployment/state:deployedResourceStateStream"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.machanirobotics.com/v1/management/deployment/state:deployedResourceStateStream")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.machanirobotics.com/v1/management/deployment/state:deployedResourceStateStream")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.machanirobotics.com/v1/management/deployment/state:deployedResourceStateStream', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.machanirobotics.com/v1/management/deployment/state:deployedResourceStateStream");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.machanirobotics.com/v1/management/deployment/state:deployedResourceStateStream")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```