# K2K Apps

Kafka 2 Kafka application management

## GET /api/v0/apps/k2k/{name}

> Retrieves a single K2KApp by name.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_K2KAppWithOptionalMetrics":{"description":"Extends a K2KApp with additional metrics, if available.","allOf":[{"$ref":"#/components/schemas/hq_K2KApp"},{"type":"object","properties":{"metrics":{"$ref":"#/components/schemas/hq_K2KAppMetrics"}}}]},"hq_K2KApp":{"description":"Defines a K2KApp (Kafka-to-Kafka application).","allOf":[{"$ref":"#/components/schemas/hq_BaseManifest"},{"type":"object","properties":{"spec":{"$ref":"#/components/schemas/hq_K2KAppSpec"},"status":{"$ref":"#/components/schemas/hq_K2KAppStatus"}},"required":["spec"]}]},"hq_BaseManifest":{"type":"object","description":"Contains common fields shared by HQ manifests.","properties":{"apiVersion":{"type":"string","minLength":1},"kind":{"type":"string","minLength":1},"metadata":{"$ref":"#/components/schemas/hq_BaseManifestMetadata"}},"required":["apiVersion","kind","metadata"]},"hq_BaseManifestMetadata":{"type":"object","description":"Contains the metadata for a BaseManifest.","properties":{"name":{"type":"string","format":"hq-resource-name"},"displayName":{"type":"string","maxLength":150},"description":{"type":"string","description":"Has the description of the object.","maxLength":280},"id":{"type":"string","description":"Is a unique, read-only identifier.","readOnly":true},"lrn":{"type":"string","description":"Holds the LRN. Read-only.","readOnly":true},"creationTimestamp":{"type":"string","format":"date-time","description":"Is set to the time instant of creation. Read-only.","readOnly":true},"generation":{"type":"integer","description":"Is increased everytime the spec is updated. Read-only.","readOnly":true}},"required":["name"]},"hq_K2KAppSpec":{"type":"object","description":"Specifies a K2KApp (Kafka-to-Kafka application).","properties":{"sourceKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the source KafkaConnection LRN to read from."},"targetKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the target KafkaConnection LRN to write to."},"topics":{"type":"array","description":"Sets the topic(s) to replicate.","minItems":1,"items":{"type":"string","format":"kafka-topic","minLength":1}},"deploymentNamespaceLRN":{"type":"string","format":"kubernetes-namespace-lrn","description":"Defines the Kubernetes namespace to deploy to."},"replicas":{"type":"integer"},"kubernetes":{"$ref":"#/components/schemas/hq_K8sDeploymentOverrides"},"replicator":{"$ref":"#/components/schemas/hq_K2KReplicatorSettings"},"paused":{"type":"boolean","description":"Halts replication by scaling down to zero pods."},"configOverrides":{"$ref":"#/components/schemas/hq_K2KConfigOverrides"}},"required":["sourceKafkaLRN","targetKafkaLRN","deploymentNamespaceLRN","topics"]},"hq_K8sDeploymentOverrides":{"type":"object","properties":{"commonMetadata":{"$ref":"#/components/schemas/hq_K8sMetadata"},"securityContext":{"$ref":"#/components/schemas/hq_K8sSecurityContext"},"imagePullSecrets":{"type":"array","description":"Are passed to the Deployment's imagePullSecrets.","items":{"$ref":"#/components/schemas/hq_K8sLocalObjectReference"}},"serviceAccount":{"type":"string","description":"Is the name of the ServiceAccount to use to run pods.","format":"K8sDns1123Subdomain"},"image":{"type":"string","description":"Overrides the default image deployed."},"resources":{"$ref":"#/components/schemas/hq_K8sResourceRequirements"}}},"hq_K8sMetadata":{"type":"object","description":"Bundles K8s labels and annotations.","properties":{"labels":{"$ref":"#/components/schemas/hq_K8sStringMap"},"annotations":{"$ref":"#/components/schemas/hq_K8sStringMap"}}},"hq_K8sStringMap":{"type":"object","description":"Maps string keys to string values. Used for K8s labels and annotations.","additionalProperties":{"type":"string"}},"hq_K8sSecurityContext":{"type":"object","description":"Allows customisation of a deployment's SecurityContext. Partially\nmirrors a K8s core v1 SecurityContext.\n","properties":{"runAsUser":{"type":"integer","format":"int64","description":"Sets the UID to run the entrypoint of the container process."},"runAsGroup":{"type":"integer","format":"int64","description":"Sets the GID to run the entrypoint of the container process."},"runAsNonRoot":{"type":"boolean","description":"Indicates that the container must run as a non-root user."}}},"hq_K8sLocalObjectReference":{"type":"object","description":"Mirrors a K8s core v1 LocalObjectReference.","properties":{"name":{"type":"string","description":"Name of the referent.","format":"K8sDns1123Subdomain"}},"required":["name"]},"hq_K8sResourceRequirements":{"type":"object","description":"Mirrors a K8s core v1 ResourceRequirements.","properties":{"requests":{"$ref":"#/components/schemas/hq_K8sResourceList"},"limits":{"$ref":"#/components/schemas/hq_K8sResourceList"}}},"hq_K8sResourceList":{"type":"object","description":"Mirrors a K8s core v1 ResourceList.","properties":{"cpu":{"type":"string","format":"K8sResourceQuantity"},"memory":{"type":"string","format":"K8sResourceQuantity"}}},"hq_K2KReplicatorSettings":{"type":"object","description":"Provides additional control knobs for the K2K replicator.","properties":{"schemaMapping":{"type":"boolean","description":"Enables schema replication."},"exactlyOnce":{"type":"boolean","description":"Enables exactly-once processing."},"headerReplication":{"type":"boolean","description":"Replicates the record headers."},"autoCreateTopics":{"type":"boolean","description":"Enables auto creation of topics."},"autoCreateControlTopics":{"type":"boolean","description":"Enables auto creation of control topics."},"keepRecordCreationTimestamp":{"type":"boolean","description":"Enables preserving record timestamps."},"errorHandling":{"$ref":"#/components/schemas/hq_K2KErrorHandlingSettings"},"tracingHeaders":{"$ref":"#/components/schemas/hq_K2KTracingHeadersSettings"},"coordination":{"$ref":"#/components/schemas/hq_K2KCoordinationSettings"},"bidirectional":{"$ref":"#/components/schemas/hq_K2KBidirectionalSettings"}}},"hq_K2KErrorHandlingSettings":{"type":"object","description":"Controls K2K error handling behavior.","properties":{"onCommitSyncTimeout":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"},"onControlMessageDeserializationError":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"}}},"hq_K2KErrorHandlingBehavior":{"type":"string","description":"Specifies error handling behavior.","enum":["fail","ignore"]},"hq_K2KTracingHeadersSettings":{"type":"object","description":"Controls which tracing headers are enabled.","properties":{"partition":{"type":"boolean","description":"Enables the partition tracing header."},"offset":{"type":"boolean","description":"Enables the offset tracing header."},"topic":{"type":"boolean","description":"Enables the topic tracing header."},"pipeline":{"type":"boolean","description":"Enables the pipeline tracing header."}}},"hq_K2KCoordinationSettings":{"type":"object","description":"Controls coordination behavior.","properties":{"commit":{"$ref":"#/components/schemas/hq_K2KCommitCoordinationSettings"},"assignment":{"$ref":"#/components/schemas/hq_K2KAssignmentCoordinationSettings"}}},"hq_K2KCommitCoordinationSettings":{"type":"object","description":"Controls commit coordination settings.","properties":{"topic":{"type":"string","description":"Topic for offset commits."},"syncTimeoutSeconds":{"type":"integer","description":"Time limit in seconds to wait for catchup when reading from the offset control topic.","minimum":1},"batchSize":{"type":"integer","description":"Number of records after which an offset is committed.","minimum":1},"batchTimeoutSeconds":{"type":"integer","description":"Time in seconds to wait before injecting a commit record.","minimum":1}}},"hq_K2KAssignmentCoordinationSettings":{"type":"object","description":"Controls assignment coordination settings.","properties":{"topic":{"type":"string","description":"Topic used for assignment coordination."},"graceWindowSeconds":{"type":"integer","description":"Time in seconds to wait before the application actively fences off other applications.","minimum":1},"fencingMaxParallelism":{"type":"integer","description":"Max parallelism when fencing slow/zombie producers.","minimum":1}}},"hq_K2KBidirectionalSettings":{"type":"object","description":"Controls bidirectional replication behavior.","properties":{"enabled":{"type":"boolean","description":"Enables bidirectional replication."},"mode":{"$ref":"#/components/schemas/hq_K2KBidirectionalMode"},"headerName":{"type":"string","description":"Header name for bidirectional replication detection."}}},"hq_K2KBidirectionalMode":{"type":"string","description":"Controls the bidirectional replication detection identifier. This\nprevents records that are already present in both clusters from being\nreplicated. \"cluster\" uses the source broker's ID; \"pipeline\" uses the\npipeline name set in the configuration.\n","enum":["cluster","pipeline"]},"hq_K2KConfigOverrides":{"type":"object","description":"Contains arbitrary data that gets merged into the replicator's config.","additionalProperties":{}},"hq_K2KAppStatus":{"type":"object","description":"Contains the most recently observed status of a K2KApp. Read-only for clients.","properties":{"updatedAt":{"type":"string","format":"date-time","description":"Contains the time instant this object was updated."},"state":{"$ref":"#/components/schemas/hq_K2KAppState"},"statusLastTransitionAt":{"type":"string","format":"date-time","description":"Contains the time instant the status was changed."},"statusMessage":{"type":"string","description":"Is a human-readable message indicating details about last the transition."},"observedGeneration":{"type":"integer","description":"Reflects the generation of the spec that this status corresponds to."},"deployment":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatus"},"kafka":{"$ref":"#/components/schemas/hq_K2KAppKafkaStatus"}},"required":["updatedAt","state","statusLastTransitionAt","statusMessage","observedGeneration","deployment","kafka"]},"hq_K2KAppState":{"type":"string","description":"Enumerates K2KApp state types.","enum":["deploying","starting","running","paused","error","deleting"]},"hq_KubernetesDeploymentStatus":{"type":"object","description":"Provides information about a Kubernetes deployment.","properties":{"inSync":{"type":"boolean"},"managedResources":{"type":"array","items":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatusResource"}},"pods":{"type":"array","items":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatusPod"}}},"required":["inSync","managedResources","pods"]},"hq_KubernetesDeploymentStatusResource":{"type":"object","description":"Provides information about a Kubernetes resource.","properties":{"name":{"type":"string","description":"Holds the resource name."},"namespace":{"type":"string","description":"Is set to the resource's namespace."},"kind":{"type":"string","description":"Is set to the resource's kind, e.g. Deployment, ConfigMap, etc."},"status":{"type":"string","description":"Contains a one-word status of a loosely defined enum: Created, Updated, InSync, Error."},"reason":{"type":"string","description":"Elaborates on the status in a human-readably way."}},"required":["name","namespace","kind","status"]},"hq_KubernetesDeploymentStatusPod":{"type":"object","properties":{"name":{"type":"string","description":"Holds the Pod name."},"namespace":{"type":"string","description":"Is set to the Pod's namespace."},"state":{"type":"string","description":"Contains a one-word status of a loosely defined enum: Terminating, CrashLoopBackOff, Running, etc."},"reason":{"type":"string","description":"Elaborates on the status in a human-readably way, if possible."},"lastTermination":{"$ref":"#/components/schemas/hq_PodTerminationDetails"}},"required":["name","namespace","state"]},"hq_PodTerminationDetails":{"type":"object","properties":{"message":{"type":"string","description":"Last termination message of the pod's container."},"time":{"type":"string","format":"date-time","description":"When the last termination happened for the pod's container."}}},"hq_K2KAppKafkaStatus":{"type":"object","properties":{"consumerGroup":{"type":"string","description":"Holds the name of the consumer group that this K2KApp uses."}},"required":["consumerGroup"]},"hq_K2KAppMetrics":{"type":"object","description":"Tracks metrics for a K2KApp.","properties":{"state":{"$ref":"#/components/schemas/hq_K2KAppMetricsState"},"updated_at":{"format":"date-time","type":"string","description":"Contains the time instant this object as a whole was updated."},"error_message":{"type":"string","description":"Contains the error message if the state is \"error\"."},"source_topics":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KSourceTopic"}},"destination_topics":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KDestinationTopic"}},"errors":{"type":"array","items":{"type":"string"}}},"required":["topic_metrics","updated_at","state","error_message","source_topics","destination_topics","errors"]},"hq_K2KAppMetricsState":{"type":"string","description":"Enumerates K2KApp metrics states.","enum":["unknown","success","error"]},"hq_K2KSourceTopic":{"type":"object","description":"Tracks metrics for K2K source topics.","properties":{"lrn":{"type":"string"},"name":{"type":"string"},"throughput":{"$ref":"#/components/schemas/hq_K2KSourceThroughput"},"offsets":{"$ref":"#/components/schemas/hq_K2KSourceOffsets"}},"required":["lrn","name"]},"hq_K2KSourceThroughput":{"type":"object","description":"Aggregates throughput metrics for a source topic.","properties":{"updated_at":{"type":"string","format":"date-time"},"bytes_per_second":{"type":"number","format":"double"},"records_per_second":{"type":"number","format":"double"}},"required":["updated_at","bytes_per_second","records_per_second"]},"hq_K2KSourceOffsets":{"type":"object","description":"Aggregates offsets data for a source topic.","properties":{"updated_at":{"type":"string","format":"date-time"},"partitions":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KSourcePartitionOffsets"}}},"required":["updated_at","partitions"]},"hq_K2KSourcePartitionOffsets":{"type":"object","description":"Groups log end offsets per source partition.","properties":{"partition":{"type":"integer","format":"int64"},"log_end_offset":{"type":"integer","format":"int64"}},"required":["partition","log_end_offset"]},"hq_K2KDestinationTopic":{"type":"object","description":"Tracks metrics for K2K destination topics.","properties":{"lrn":{"type":"string"},"name":{"type":"string"},"throughput":{"$ref":"#/components/schemas/hq_K2KDestinationThroughput"},"offsets":{"$ref":"#/components/schemas/hq_K2KDestinationOffsets"}},"required":["lrn","name"]},"hq_K2KDestinationThroughput":{"type":"object","description":"Aggregates throughput metrics for a destination topic.","properties":{"updated_at":{"type":"string","format":"date-time"},"bytes_per_second":{"type":"number","format":"double"},"records_per_second":{"type":"number","format":"double"}},"required":["updated_at","bytes_per_second","records_per_second"]},"hq_K2KDestinationOffsets":{"type":"object","description":"Aggregates offsets and lag data for a destination topic.","properties":{"updated_at":{"type":"string","format":"date-time"},"partitions":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KDestinationPartitionOffsets"}}},"required":["updated_at","partitions"]},"hq_K2KDestinationPartitionOffsets":{"type":"object","description":"Groups log end offsets and lag data per destination partition.","properties":{"partition":{"type":"integer"},"log_end_offset":{"type":"integer","format":"int64"},"lag":{"type":"integer","format":"int64"}},"required":["partition","log_end_offset"]},"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","ai_server_unavailable","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v0/apps/k2k/{name}":{"get":{"description":"Retrieves a single K2KApp by name.","operationId":"getK2KAppV0","parameters":[{"in":"path","name":"name","required":true,"schema":{"type":"string"}},{"in":"query","name":"expand_metrics","required":false,"description":"Includes metrics in the response, if available.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Happy response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KAppWithOptionalMetrics"}}}},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}},"tags":["hq_k2kapps"]}}}}
```

## PUT /api/v0/apps/k2k/{name}

> Creates a new K2KApp or updates an existing one.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_K2KAppWithoutStatus":{"description":"Defines a K2KApp (Kafka-to-Kafka application).","allOf":[{"$ref":"#/components/schemas/hq_BaseManifest"},{"type":"object","properties":{"spec":{"$ref":"#/components/schemas/hq_K2KAppSpec"}},"required":["spec"]}]},"hq_BaseManifest":{"type":"object","description":"Contains common fields shared by HQ manifests.","properties":{"apiVersion":{"type":"string","minLength":1},"kind":{"type":"string","minLength":1},"metadata":{"$ref":"#/components/schemas/hq_BaseManifestMetadata"}},"required":["apiVersion","kind","metadata"]},"hq_BaseManifestMetadata":{"type":"object","description":"Contains the metadata for a BaseManifest.","properties":{"name":{"type":"string","format":"hq-resource-name"},"displayName":{"type":"string","maxLength":150},"description":{"type":"string","description":"Has the description of the object.","maxLength":280},"id":{"type":"string","description":"Is a unique, read-only identifier.","readOnly":true},"lrn":{"type":"string","description":"Holds the LRN. Read-only.","readOnly":true},"creationTimestamp":{"type":"string","format":"date-time","description":"Is set to the time instant of creation. Read-only.","readOnly":true},"generation":{"type":"integer","description":"Is increased everytime the spec is updated. Read-only.","readOnly":true}},"required":["name"]},"hq_K2KAppSpec":{"type":"object","description":"Specifies a K2KApp (Kafka-to-Kafka application).","properties":{"sourceKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the source KafkaConnection LRN to read from."},"targetKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the target KafkaConnection LRN to write to."},"topics":{"type":"array","description":"Sets the topic(s) to replicate.","minItems":1,"items":{"type":"string","format":"kafka-topic","minLength":1}},"deploymentNamespaceLRN":{"type":"string","format":"kubernetes-namespace-lrn","description":"Defines the Kubernetes namespace to deploy to."},"replicas":{"type":"integer"},"kubernetes":{"$ref":"#/components/schemas/hq_K8sDeploymentOverrides"},"replicator":{"$ref":"#/components/schemas/hq_K2KReplicatorSettings"},"paused":{"type":"boolean","description":"Halts replication by scaling down to zero pods."},"configOverrides":{"$ref":"#/components/schemas/hq_K2KConfigOverrides"}},"required":["sourceKafkaLRN","targetKafkaLRN","deploymentNamespaceLRN","topics"]},"hq_K8sDeploymentOverrides":{"type":"object","properties":{"commonMetadata":{"$ref":"#/components/schemas/hq_K8sMetadata"},"securityContext":{"$ref":"#/components/schemas/hq_K8sSecurityContext"},"imagePullSecrets":{"type":"array","description":"Are passed to the Deployment's imagePullSecrets.","items":{"$ref":"#/components/schemas/hq_K8sLocalObjectReference"}},"serviceAccount":{"type":"string","description":"Is the name of the ServiceAccount to use to run pods.","format":"K8sDns1123Subdomain"},"image":{"type":"string","description":"Overrides the default image deployed."},"resources":{"$ref":"#/components/schemas/hq_K8sResourceRequirements"}}},"hq_K8sMetadata":{"type":"object","description":"Bundles K8s labels and annotations.","properties":{"labels":{"$ref":"#/components/schemas/hq_K8sStringMap"},"annotations":{"$ref":"#/components/schemas/hq_K8sStringMap"}}},"hq_K8sStringMap":{"type":"object","description":"Maps string keys to string values. Used for K8s labels and annotations.","additionalProperties":{"type":"string"}},"hq_K8sSecurityContext":{"type":"object","description":"Allows customisation of a deployment's SecurityContext. Partially\nmirrors a K8s core v1 SecurityContext.\n","properties":{"runAsUser":{"type":"integer","format":"int64","description":"Sets the UID to run the entrypoint of the container process."},"runAsGroup":{"type":"integer","format":"int64","description":"Sets the GID to run the entrypoint of the container process."},"runAsNonRoot":{"type":"boolean","description":"Indicates that the container must run as a non-root user."}}},"hq_K8sLocalObjectReference":{"type":"object","description":"Mirrors a K8s core v1 LocalObjectReference.","properties":{"name":{"type":"string","description":"Name of the referent.","format":"K8sDns1123Subdomain"}},"required":["name"]},"hq_K8sResourceRequirements":{"type":"object","description":"Mirrors a K8s core v1 ResourceRequirements.","properties":{"requests":{"$ref":"#/components/schemas/hq_K8sResourceList"},"limits":{"$ref":"#/components/schemas/hq_K8sResourceList"}}},"hq_K8sResourceList":{"type":"object","description":"Mirrors a K8s core v1 ResourceList.","properties":{"cpu":{"type":"string","format":"K8sResourceQuantity"},"memory":{"type":"string","format":"K8sResourceQuantity"}}},"hq_K2KReplicatorSettings":{"type":"object","description":"Provides additional control knobs for the K2K replicator.","properties":{"schemaMapping":{"type":"boolean","description":"Enables schema replication."},"exactlyOnce":{"type":"boolean","description":"Enables exactly-once processing."},"headerReplication":{"type":"boolean","description":"Replicates the record headers."},"autoCreateTopics":{"type":"boolean","description":"Enables auto creation of topics."},"autoCreateControlTopics":{"type":"boolean","description":"Enables auto creation of control topics."},"keepRecordCreationTimestamp":{"type":"boolean","description":"Enables preserving record timestamps."},"errorHandling":{"$ref":"#/components/schemas/hq_K2KErrorHandlingSettings"},"tracingHeaders":{"$ref":"#/components/schemas/hq_K2KTracingHeadersSettings"},"coordination":{"$ref":"#/components/schemas/hq_K2KCoordinationSettings"},"bidirectional":{"$ref":"#/components/schemas/hq_K2KBidirectionalSettings"}}},"hq_K2KErrorHandlingSettings":{"type":"object","description":"Controls K2K error handling behavior.","properties":{"onCommitSyncTimeout":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"},"onControlMessageDeserializationError":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"}}},"hq_K2KErrorHandlingBehavior":{"type":"string","description":"Specifies error handling behavior.","enum":["fail","ignore"]},"hq_K2KTracingHeadersSettings":{"type":"object","description":"Controls which tracing headers are enabled.","properties":{"partition":{"type":"boolean","description":"Enables the partition tracing header."},"offset":{"type":"boolean","description":"Enables the offset tracing header."},"topic":{"type":"boolean","description":"Enables the topic tracing header."},"pipeline":{"type":"boolean","description":"Enables the pipeline tracing header."}}},"hq_K2KCoordinationSettings":{"type":"object","description":"Controls coordination behavior.","properties":{"commit":{"$ref":"#/components/schemas/hq_K2KCommitCoordinationSettings"},"assignment":{"$ref":"#/components/schemas/hq_K2KAssignmentCoordinationSettings"}}},"hq_K2KCommitCoordinationSettings":{"type":"object","description":"Controls commit coordination settings.","properties":{"topic":{"type":"string","description":"Topic for offset commits."},"syncTimeoutSeconds":{"type":"integer","description":"Time limit in seconds to wait for catchup when reading from the offset control topic.","minimum":1},"batchSize":{"type":"integer","description":"Number of records after which an offset is committed.","minimum":1},"batchTimeoutSeconds":{"type":"integer","description":"Time in seconds to wait before injecting a commit record.","minimum":1}}},"hq_K2KAssignmentCoordinationSettings":{"type":"object","description":"Controls assignment coordination settings.","properties":{"topic":{"type":"string","description":"Topic used for assignment coordination."},"graceWindowSeconds":{"type":"integer","description":"Time in seconds to wait before the application actively fences off other applications.","minimum":1},"fencingMaxParallelism":{"type":"integer","description":"Max parallelism when fencing slow/zombie producers.","minimum":1}}},"hq_K2KBidirectionalSettings":{"type":"object","description":"Controls bidirectional replication behavior.","properties":{"enabled":{"type":"boolean","description":"Enables bidirectional replication."},"mode":{"$ref":"#/components/schemas/hq_K2KBidirectionalMode"},"headerName":{"type":"string","description":"Header name for bidirectional replication detection."}}},"hq_K2KBidirectionalMode":{"type":"string","description":"Controls the bidirectional replication detection identifier. This\nprevents records that are already present in both clusters from being\nreplicated. \"cluster\" uses the source broker's ID; \"pipeline\" uses the\npipeline name set in the configuration.\n","enum":["cluster","pipeline"]},"hq_K2KConfigOverrides":{"type":"object","description":"Contains arbitrary data that gets merged into the replicator's config.","additionalProperties":{}},"hq_K2KApp":{"description":"Defines a K2KApp (Kafka-to-Kafka application).","allOf":[{"$ref":"#/components/schemas/hq_BaseManifest"},{"type":"object","properties":{"spec":{"$ref":"#/components/schemas/hq_K2KAppSpec"},"status":{"$ref":"#/components/schemas/hq_K2KAppStatus"}},"required":["spec"]}]},"hq_K2KAppStatus":{"type":"object","description":"Contains the most recently observed status of a K2KApp. Read-only for clients.","properties":{"updatedAt":{"type":"string","format":"date-time","description":"Contains the time instant this object was updated."},"state":{"$ref":"#/components/schemas/hq_K2KAppState"},"statusLastTransitionAt":{"type":"string","format":"date-time","description":"Contains the time instant the status was changed."},"statusMessage":{"type":"string","description":"Is a human-readable message indicating details about last the transition."},"observedGeneration":{"type":"integer","description":"Reflects the generation of the spec that this status corresponds to."},"deployment":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatus"},"kafka":{"$ref":"#/components/schemas/hq_K2KAppKafkaStatus"}},"required":["updatedAt","state","statusLastTransitionAt","statusMessage","observedGeneration","deployment","kafka"]},"hq_K2KAppState":{"type":"string","description":"Enumerates K2KApp state types.","enum":["deploying","starting","running","paused","error","deleting"]},"hq_KubernetesDeploymentStatus":{"type":"object","description":"Provides information about a Kubernetes deployment.","properties":{"inSync":{"type":"boolean"},"managedResources":{"type":"array","items":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatusResource"}},"pods":{"type":"array","items":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatusPod"}}},"required":["inSync","managedResources","pods"]},"hq_KubernetesDeploymentStatusResource":{"type":"object","description":"Provides information about a Kubernetes resource.","properties":{"name":{"type":"string","description":"Holds the resource name."},"namespace":{"type":"string","description":"Is set to the resource's namespace."},"kind":{"type":"string","description":"Is set to the resource's kind, e.g. Deployment, ConfigMap, etc."},"status":{"type":"string","description":"Contains a one-word status of a loosely defined enum: Created, Updated, InSync, Error."},"reason":{"type":"string","description":"Elaborates on the status in a human-readably way."}},"required":["name","namespace","kind","status"]},"hq_KubernetesDeploymentStatusPod":{"type":"object","properties":{"name":{"type":"string","description":"Holds the Pod name."},"namespace":{"type":"string","description":"Is set to the Pod's namespace."},"state":{"type":"string","description":"Contains a one-word status of a loosely defined enum: Terminating, CrashLoopBackOff, Running, etc."},"reason":{"type":"string","description":"Elaborates on the status in a human-readably way, if possible."},"lastTermination":{"$ref":"#/components/schemas/hq_PodTerminationDetails"}},"required":["name","namespace","state"]},"hq_PodTerminationDetails":{"type":"object","properties":{"message":{"type":"string","description":"Last termination message of the pod's container."},"time":{"type":"string","format":"date-time","description":"When the last termination happened for the pod's container."}}},"hq_K2KAppKafkaStatus":{"type":"object","properties":{"consumerGroup":{"type":"string","description":"Holds the name of the consumer group that this K2KApp uses."}},"required":["consumerGroup"]},"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","ai_server_unavailable","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v0/apps/k2k/{name}":{"put":{"description":"Creates a new K2KApp or updates an existing one.","operationId":"applyK2KAppV0","parameters":[{"in":"path","name":"name","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/yaml":{"schema":{"$ref":"#/components/schemas/hq_K2KAppWithoutStatus"}},"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KAppWithoutStatus"}}}},"responses":{"201":{"description":"Happy response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KApp"}}}},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}},"tags":["hq_k2kapps"]}}}}
```

## DELETE /api/v0/apps/k2k/{name}

> Deletes a single K2KApp by name.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_K2KApp":{"description":"Defines a K2KApp (Kafka-to-Kafka application).","allOf":[{"$ref":"#/components/schemas/hq_BaseManifest"},{"type":"object","properties":{"spec":{"$ref":"#/components/schemas/hq_K2KAppSpec"},"status":{"$ref":"#/components/schemas/hq_K2KAppStatus"}},"required":["spec"]}]},"hq_BaseManifest":{"type":"object","description":"Contains common fields shared by HQ manifests.","properties":{"apiVersion":{"type":"string","minLength":1},"kind":{"type":"string","minLength":1},"metadata":{"$ref":"#/components/schemas/hq_BaseManifestMetadata"}},"required":["apiVersion","kind","metadata"]},"hq_BaseManifestMetadata":{"type":"object","description":"Contains the metadata for a BaseManifest.","properties":{"name":{"type":"string","format":"hq-resource-name"},"displayName":{"type":"string","maxLength":150},"description":{"type":"string","description":"Has the description of the object.","maxLength":280},"id":{"type":"string","description":"Is a unique, read-only identifier.","readOnly":true},"lrn":{"type":"string","description":"Holds the LRN. Read-only.","readOnly":true},"creationTimestamp":{"type":"string","format":"date-time","description":"Is set to the time instant of creation. Read-only.","readOnly":true},"generation":{"type":"integer","description":"Is increased everytime the spec is updated. Read-only.","readOnly":true}},"required":["name"]},"hq_K2KAppSpec":{"type":"object","description":"Specifies a K2KApp (Kafka-to-Kafka application).","properties":{"sourceKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the source KafkaConnection LRN to read from."},"targetKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the target KafkaConnection LRN to write to."},"topics":{"type":"array","description":"Sets the topic(s) to replicate.","minItems":1,"items":{"type":"string","format":"kafka-topic","minLength":1}},"deploymentNamespaceLRN":{"type":"string","format":"kubernetes-namespace-lrn","description":"Defines the Kubernetes namespace to deploy to."},"replicas":{"type":"integer"},"kubernetes":{"$ref":"#/components/schemas/hq_K8sDeploymentOverrides"},"replicator":{"$ref":"#/components/schemas/hq_K2KReplicatorSettings"},"paused":{"type":"boolean","description":"Halts replication by scaling down to zero pods."},"configOverrides":{"$ref":"#/components/schemas/hq_K2KConfigOverrides"}},"required":["sourceKafkaLRN","targetKafkaLRN","deploymentNamespaceLRN","topics"]},"hq_K8sDeploymentOverrides":{"type":"object","properties":{"commonMetadata":{"$ref":"#/components/schemas/hq_K8sMetadata"},"securityContext":{"$ref":"#/components/schemas/hq_K8sSecurityContext"},"imagePullSecrets":{"type":"array","description":"Are passed to the Deployment's imagePullSecrets.","items":{"$ref":"#/components/schemas/hq_K8sLocalObjectReference"}},"serviceAccount":{"type":"string","description":"Is the name of the ServiceAccount to use to run pods.","format":"K8sDns1123Subdomain"},"image":{"type":"string","description":"Overrides the default image deployed."},"resources":{"$ref":"#/components/schemas/hq_K8sResourceRequirements"}}},"hq_K8sMetadata":{"type":"object","description":"Bundles K8s labels and annotations.","properties":{"labels":{"$ref":"#/components/schemas/hq_K8sStringMap"},"annotations":{"$ref":"#/components/schemas/hq_K8sStringMap"}}},"hq_K8sStringMap":{"type":"object","description":"Maps string keys to string values. Used for K8s labels and annotations.","additionalProperties":{"type":"string"}},"hq_K8sSecurityContext":{"type":"object","description":"Allows customisation of a deployment's SecurityContext. Partially\nmirrors a K8s core v1 SecurityContext.\n","properties":{"runAsUser":{"type":"integer","format":"int64","description":"Sets the UID to run the entrypoint of the container process."},"runAsGroup":{"type":"integer","format":"int64","description":"Sets the GID to run the entrypoint of the container process."},"runAsNonRoot":{"type":"boolean","description":"Indicates that the container must run as a non-root user."}}},"hq_K8sLocalObjectReference":{"type":"object","description":"Mirrors a K8s core v1 LocalObjectReference.","properties":{"name":{"type":"string","description":"Name of the referent.","format":"K8sDns1123Subdomain"}},"required":["name"]},"hq_K8sResourceRequirements":{"type":"object","description":"Mirrors a K8s core v1 ResourceRequirements.","properties":{"requests":{"$ref":"#/components/schemas/hq_K8sResourceList"},"limits":{"$ref":"#/components/schemas/hq_K8sResourceList"}}},"hq_K8sResourceList":{"type":"object","description":"Mirrors a K8s core v1 ResourceList.","properties":{"cpu":{"type":"string","format":"K8sResourceQuantity"},"memory":{"type":"string","format":"K8sResourceQuantity"}}},"hq_K2KReplicatorSettings":{"type":"object","description":"Provides additional control knobs for the K2K replicator.","properties":{"schemaMapping":{"type":"boolean","description":"Enables schema replication."},"exactlyOnce":{"type":"boolean","description":"Enables exactly-once processing."},"headerReplication":{"type":"boolean","description":"Replicates the record headers."},"autoCreateTopics":{"type":"boolean","description":"Enables auto creation of topics."},"autoCreateControlTopics":{"type":"boolean","description":"Enables auto creation of control topics."},"keepRecordCreationTimestamp":{"type":"boolean","description":"Enables preserving record timestamps."},"errorHandling":{"$ref":"#/components/schemas/hq_K2KErrorHandlingSettings"},"tracingHeaders":{"$ref":"#/components/schemas/hq_K2KTracingHeadersSettings"},"coordination":{"$ref":"#/components/schemas/hq_K2KCoordinationSettings"},"bidirectional":{"$ref":"#/components/schemas/hq_K2KBidirectionalSettings"}}},"hq_K2KErrorHandlingSettings":{"type":"object","description":"Controls K2K error handling behavior.","properties":{"onCommitSyncTimeout":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"},"onControlMessageDeserializationError":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"}}},"hq_K2KErrorHandlingBehavior":{"type":"string","description":"Specifies error handling behavior.","enum":["fail","ignore"]},"hq_K2KTracingHeadersSettings":{"type":"object","description":"Controls which tracing headers are enabled.","properties":{"partition":{"type":"boolean","description":"Enables the partition tracing header."},"offset":{"type":"boolean","description":"Enables the offset tracing header."},"topic":{"type":"boolean","description":"Enables the topic tracing header."},"pipeline":{"type":"boolean","description":"Enables the pipeline tracing header."}}},"hq_K2KCoordinationSettings":{"type":"object","description":"Controls coordination behavior.","properties":{"commit":{"$ref":"#/components/schemas/hq_K2KCommitCoordinationSettings"},"assignment":{"$ref":"#/components/schemas/hq_K2KAssignmentCoordinationSettings"}}},"hq_K2KCommitCoordinationSettings":{"type":"object","description":"Controls commit coordination settings.","properties":{"topic":{"type":"string","description":"Topic for offset commits."},"syncTimeoutSeconds":{"type":"integer","description":"Time limit in seconds to wait for catchup when reading from the offset control topic.","minimum":1},"batchSize":{"type":"integer","description":"Number of records after which an offset is committed.","minimum":1},"batchTimeoutSeconds":{"type":"integer","description":"Time in seconds to wait before injecting a commit record.","minimum":1}}},"hq_K2KAssignmentCoordinationSettings":{"type":"object","description":"Controls assignment coordination settings.","properties":{"topic":{"type":"string","description":"Topic used for assignment coordination."},"graceWindowSeconds":{"type":"integer","description":"Time in seconds to wait before the application actively fences off other applications.","minimum":1},"fencingMaxParallelism":{"type":"integer","description":"Max parallelism when fencing slow/zombie producers.","minimum":1}}},"hq_K2KBidirectionalSettings":{"type":"object","description":"Controls bidirectional replication behavior.","properties":{"enabled":{"type":"boolean","description":"Enables bidirectional replication."},"mode":{"$ref":"#/components/schemas/hq_K2KBidirectionalMode"},"headerName":{"type":"string","description":"Header name for bidirectional replication detection."}}},"hq_K2KBidirectionalMode":{"type":"string","description":"Controls the bidirectional replication detection identifier. This\nprevents records that are already present in both clusters from being\nreplicated. \"cluster\" uses the source broker's ID; \"pipeline\" uses the\npipeline name set in the configuration.\n","enum":["cluster","pipeline"]},"hq_K2KConfigOverrides":{"type":"object","description":"Contains arbitrary data that gets merged into the replicator's config.","additionalProperties":{}},"hq_K2KAppStatus":{"type":"object","description":"Contains the most recently observed status of a K2KApp. Read-only for clients.","properties":{"updatedAt":{"type":"string","format":"date-time","description":"Contains the time instant this object was updated."},"state":{"$ref":"#/components/schemas/hq_K2KAppState"},"statusLastTransitionAt":{"type":"string","format":"date-time","description":"Contains the time instant the status was changed."},"statusMessage":{"type":"string","description":"Is a human-readable message indicating details about last the transition."},"observedGeneration":{"type":"integer","description":"Reflects the generation of the spec that this status corresponds to."},"deployment":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatus"},"kafka":{"$ref":"#/components/schemas/hq_K2KAppKafkaStatus"}},"required":["updatedAt","state","statusLastTransitionAt","statusMessage","observedGeneration","deployment","kafka"]},"hq_K2KAppState":{"type":"string","description":"Enumerates K2KApp state types.","enum":["deploying","starting","running","paused","error","deleting"]},"hq_KubernetesDeploymentStatus":{"type":"object","description":"Provides information about a Kubernetes deployment.","properties":{"inSync":{"type":"boolean"},"managedResources":{"type":"array","items":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatusResource"}},"pods":{"type":"array","items":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatusPod"}}},"required":["inSync","managedResources","pods"]},"hq_KubernetesDeploymentStatusResource":{"type":"object","description":"Provides information about a Kubernetes resource.","properties":{"name":{"type":"string","description":"Holds the resource name."},"namespace":{"type":"string","description":"Is set to the resource's namespace."},"kind":{"type":"string","description":"Is set to the resource's kind, e.g. Deployment, ConfigMap, etc."},"status":{"type":"string","description":"Contains a one-word status of a loosely defined enum: Created, Updated, InSync, Error."},"reason":{"type":"string","description":"Elaborates on the status in a human-readably way."}},"required":["name","namespace","kind","status"]},"hq_KubernetesDeploymentStatusPod":{"type":"object","properties":{"name":{"type":"string","description":"Holds the Pod name."},"namespace":{"type":"string","description":"Is set to the Pod's namespace."},"state":{"type":"string","description":"Contains a one-word status of a loosely defined enum: Terminating, CrashLoopBackOff, Running, etc."},"reason":{"type":"string","description":"Elaborates on the status in a human-readably way, if possible."},"lastTermination":{"$ref":"#/components/schemas/hq_PodTerminationDetails"}},"required":["name","namespace","state"]},"hq_PodTerminationDetails":{"type":"object","properties":{"message":{"type":"string","description":"Last termination message of the pod's container."},"time":{"type":"string","format":"date-time","description":"When the last termination happened for the pod's container."}}},"hq_K2KAppKafkaStatus":{"type":"object","properties":{"consumerGroup":{"type":"string","description":"Holds the name of the consumer group that this K2KApp uses."}},"required":["consumerGroup"]},"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","ai_server_unavailable","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v0/apps/k2k/{name}":{"delete":{"description":"Deletes a single K2KApp by name.","operationId":"deleteK2KAppV0","parameters":[{"in":"path","name":"name","required":true,"schema":{"type":"string"}},{"in":"query","name":"force","required":false,"description":"Deletes the K2KApp instantly and skips waiting for deletion of any corresponding K8s resources.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Happy response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KApp"}}}},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}},"tags":["hq_k2kapps"]}}}}
```

## PATCH /api/v0/apps/k2k/{name}

> Updates an existing K2KApp.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_K2KAppWithoutStatus":{"description":"Defines a K2KApp (Kafka-to-Kafka application).","allOf":[{"$ref":"#/components/schemas/hq_BaseManifest"},{"type":"object","properties":{"spec":{"$ref":"#/components/schemas/hq_K2KAppSpec"}},"required":["spec"]}]},"hq_BaseManifest":{"type":"object","description":"Contains common fields shared by HQ manifests.","properties":{"apiVersion":{"type":"string","minLength":1},"kind":{"type":"string","minLength":1},"metadata":{"$ref":"#/components/schemas/hq_BaseManifestMetadata"}},"required":["apiVersion","kind","metadata"]},"hq_BaseManifestMetadata":{"type":"object","description":"Contains the metadata for a BaseManifest.","properties":{"name":{"type":"string","format":"hq-resource-name"},"displayName":{"type":"string","maxLength":150},"description":{"type":"string","description":"Has the description of the object.","maxLength":280},"id":{"type":"string","description":"Is a unique, read-only identifier.","readOnly":true},"lrn":{"type":"string","description":"Holds the LRN. Read-only.","readOnly":true},"creationTimestamp":{"type":"string","format":"date-time","description":"Is set to the time instant of creation. Read-only.","readOnly":true},"generation":{"type":"integer","description":"Is increased everytime the spec is updated. Read-only.","readOnly":true}},"required":["name"]},"hq_K2KAppSpec":{"type":"object","description":"Specifies a K2KApp (Kafka-to-Kafka application).","properties":{"sourceKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the source KafkaConnection LRN to read from."},"targetKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the target KafkaConnection LRN to write to."},"topics":{"type":"array","description":"Sets the topic(s) to replicate.","minItems":1,"items":{"type":"string","format":"kafka-topic","minLength":1}},"deploymentNamespaceLRN":{"type":"string","format":"kubernetes-namespace-lrn","description":"Defines the Kubernetes namespace to deploy to."},"replicas":{"type":"integer"},"kubernetes":{"$ref":"#/components/schemas/hq_K8sDeploymentOverrides"},"replicator":{"$ref":"#/components/schemas/hq_K2KReplicatorSettings"},"paused":{"type":"boolean","description":"Halts replication by scaling down to zero pods."},"configOverrides":{"$ref":"#/components/schemas/hq_K2KConfigOverrides"}},"required":["sourceKafkaLRN","targetKafkaLRN","deploymentNamespaceLRN","topics"]},"hq_K8sDeploymentOverrides":{"type":"object","properties":{"commonMetadata":{"$ref":"#/components/schemas/hq_K8sMetadata"},"securityContext":{"$ref":"#/components/schemas/hq_K8sSecurityContext"},"imagePullSecrets":{"type":"array","description":"Are passed to the Deployment's imagePullSecrets.","items":{"$ref":"#/components/schemas/hq_K8sLocalObjectReference"}},"serviceAccount":{"type":"string","description":"Is the name of the ServiceAccount to use to run pods.","format":"K8sDns1123Subdomain"},"image":{"type":"string","description":"Overrides the default image deployed."},"resources":{"$ref":"#/components/schemas/hq_K8sResourceRequirements"}}},"hq_K8sMetadata":{"type":"object","description":"Bundles K8s labels and annotations.","properties":{"labels":{"$ref":"#/components/schemas/hq_K8sStringMap"},"annotations":{"$ref":"#/components/schemas/hq_K8sStringMap"}}},"hq_K8sStringMap":{"type":"object","description":"Maps string keys to string values. Used for K8s labels and annotations.","additionalProperties":{"type":"string"}},"hq_K8sSecurityContext":{"type":"object","description":"Allows customisation of a deployment's SecurityContext. Partially\nmirrors a K8s core v1 SecurityContext.\n","properties":{"runAsUser":{"type":"integer","format":"int64","description":"Sets the UID to run the entrypoint of the container process."},"runAsGroup":{"type":"integer","format":"int64","description":"Sets the GID to run the entrypoint of the container process."},"runAsNonRoot":{"type":"boolean","description":"Indicates that the container must run as a non-root user."}}},"hq_K8sLocalObjectReference":{"type":"object","description":"Mirrors a K8s core v1 LocalObjectReference.","properties":{"name":{"type":"string","description":"Name of the referent.","format":"K8sDns1123Subdomain"}},"required":["name"]},"hq_K8sResourceRequirements":{"type":"object","description":"Mirrors a K8s core v1 ResourceRequirements.","properties":{"requests":{"$ref":"#/components/schemas/hq_K8sResourceList"},"limits":{"$ref":"#/components/schemas/hq_K8sResourceList"}}},"hq_K8sResourceList":{"type":"object","description":"Mirrors a K8s core v1 ResourceList.","properties":{"cpu":{"type":"string","format":"K8sResourceQuantity"},"memory":{"type":"string","format":"K8sResourceQuantity"}}},"hq_K2KReplicatorSettings":{"type":"object","description":"Provides additional control knobs for the K2K replicator.","properties":{"schemaMapping":{"type":"boolean","description":"Enables schema replication."},"exactlyOnce":{"type":"boolean","description":"Enables exactly-once processing."},"headerReplication":{"type":"boolean","description":"Replicates the record headers."},"autoCreateTopics":{"type":"boolean","description":"Enables auto creation of topics."},"autoCreateControlTopics":{"type":"boolean","description":"Enables auto creation of control topics."},"keepRecordCreationTimestamp":{"type":"boolean","description":"Enables preserving record timestamps."},"errorHandling":{"$ref":"#/components/schemas/hq_K2KErrorHandlingSettings"},"tracingHeaders":{"$ref":"#/components/schemas/hq_K2KTracingHeadersSettings"},"coordination":{"$ref":"#/components/schemas/hq_K2KCoordinationSettings"},"bidirectional":{"$ref":"#/components/schemas/hq_K2KBidirectionalSettings"}}},"hq_K2KErrorHandlingSettings":{"type":"object","description":"Controls K2K error handling behavior.","properties":{"onCommitSyncTimeout":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"},"onControlMessageDeserializationError":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"}}},"hq_K2KErrorHandlingBehavior":{"type":"string","description":"Specifies error handling behavior.","enum":["fail","ignore"]},"hq_K2KTracingHeadersSettings":{"type":"object","description":"Controls which tracing headers are enabled.","properties":{"partition":{"type":"boolean","description":"Enables the partition tracing header."},"offset":{"type":"boolean","description":"Enables the offset tracing header."},"topic":{"type":"boolean","description":"Enables the topic tracing header."},"pipeline":{"type":"boolean","description":"Enables the pipeline tracing header."}}},"hq_K2KCoordinationSettings":{"type":"object","description":"Controls coordination behavior.","properties":{"commit":{"$ref":"#/components/schemas/hq_K2KCommitCoordinationSettings"},"assignment":{"$ref":"#/components/schemas/hq_K2KAssignmentCoordinationSettings"}}},"hq_K2KCommitCoordinationSettings":{"type":"object","description":"Controls commit coordination settings.","properties":{"topic":{"type":"string","description":"Topic for offset commits."},"syncTimeoutSeconds":{"type":"integer","description":"Time limit in seconds to wait for catchup when reading from the offset control topic.","minimum":1},"batchSize":{"type":"integer","description":"Number of records after which an offset is committed.","minimum":1},"batchTimeoutSeconds":{"type":"integer","description":"Time in seconds to wait before injecting a commit record.","minimum":1}}},"hq_K2KAssignmentCoordinationSettings":{"type":"object","description":"Controls assignment coordination settings.","properties":{"topic":{"type":"string","description":"Topic used for assignment coordination."},"graceWindowSeconds":{"type":"integer","description":"Time in seconds to wait before the application actively fences off other applications.","minimum":1},"fencingMaxParallelism":{"type":"integer","description":"Max parallelism when fencing slow/zombie producers.","minimum":1}}},"hq_K2KBidirectionalSettings":{"type":"object","description":"Controls bidirectional replication behavior.","properties":{"enabled":{"type":"boolean","description":"Enables bidirectional replication."},"mode":{"$ref":"#/components/schemas/hq_K2KBidirectionalMode"},"headerName":{"type":"string","description":"Header name for bidirectional replication detection."}}},"hq_K2KBidirectionalMode":{"type":"string","description":"Controls the bidirectional replication detection identifier. This\nprevents records that are already present in both clusters from being\nreplicated. \"cluster\" uses the source broker's ID; \"pipeline\" uses the\npipeline name set in the configuration.\n","enum":["cluster","pipeline"]},"hq_K2KConfigOverrides":{"type":"object","description":"Contains arbitrary data that gets merged into the replicator's config.","additionalProperties":{}},"hq_K2KApp":{"description":"Defines a K2KApp (Kafka-to-Kafka application).","allOf":[{"$ref":"#/components/schemas/hq_BaseManifest"},{"type":"object","properties":{"spec":{"$ref":"#/components/schemas/hq_K2KAppSpec"},"status":{"$ref":"#/components/schemas/hq_K2KAppStatus"}},"required":["spec"]}]},"hq_K2KAppStatus":{"type":"object","description":"Contains the most recently observed status of a K2KApp. Read-only for clients.","properties":{"updatedAt":{"type":"string","format":"date-time","description":"Contains the time instant this object was updated."},"state":{"$ref":"#/components/schemas/hq_K2KAppState"},"statusLastTransitionAt":{"type":"string","format":"date-time","description":"Contains the time instant the status was changed."},"statusMessage":{"type":"string","description":"Is a human-readable message indicating details about last the transition."},"observedGeneration":{"type":"integer","description":"Reflects the generation of the spec that this status corresponds to."},"deployment":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatus"},"kafka":{"$ref":"#/components/schemas/hq_K2KAppKafkaStatus"}},"required":["updatedAt","state","statusLastTransitionAt","statusMessage","observedGeneration","deployment","kafka"]},"hq_K2KAppState":{"type":"string","description":"Enumerates K2KApp state types.","enum":["deploying","starting","running","paused","error","deleting"]},"hq_KubernetesDeploymentStatus":{"type":"object","description":"Provides information about a Kubernetes deployment.","properties":{"inSync":{"type":"boolean"},"managedResources":{"type":"array","items":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatusResource"}},"pods":{"type":"array","items":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatusPod"}}},"required":["inSync","managedResources","pods"]},"hq_KubernetesDeploymentStatusResource":{"type":"object","description":"Provides information about a Kubernetes resource.","properties":{"name":{"type":"string","description":"Holds the resource name."},"namespace":{"type":"string","description":"Is set to the resource's namespace."},"kind":{"type":"string","description":"Is set to the resource's kind, e.g. Deployment, ConfigMap, etc."},"status":{"type":"string","description":"Contains a one-word status of a loosely defined enum: Created, Updated, InSync, Error."},"reason":{"type":"string","description":"Elaborates on the status in a human-readably way."}},"required":["name","namespace","kind","status"]},"hq_KubernetesDeploymentStatusPod":{"type":"object","properties":{"name":{"type":"string","description":"Holds the Pod name."},"namespace":{"type":"string","description":"Is set to the Pod's namespace."},"state":{"type":"string","description":"Contains a one-word status of a loosely defined enum: Terminating, CrashLoopBackOff, Running, etc."},"reason":{"type":"string","description":"Elaborates on the status in a human-readably way, if possible."},"lastTermination":{"$ref":"#/components/schemas/hq_PodTerminationDetails"}},"required":["name","namespace","state"]},"hq_PodTerminationDetails":{"type":"object","properties":{"message":{"type":"string","description":"Last termination message of the pod's container."},"time":{"type":"string","format":"date-time","description":"When the last termination happened for the pod's container."}}},"hq_K2KAppKafkaStatus":{"type":"object","properties":{"consumerGroup":{"type":"string","description":"Holds the name of the consumer group that this K2KApp uses."}},"required":["consumerGroup"]},"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","ai_server_unavailable","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v0/apps/k2k/{name}":{"patch":{"description":"Updates an existing K2KApp.","operationId":"updateK2KAppV0","parameters":[{"in":"path","name":"name","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/yaml":{"schema":{"$ref":"#/components/schemas/hq_K2KAppWithoutStatus"}},"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KAppWithoutStatus"}}}},"responses":{"200":{"description":"Happy response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KApp"}}}},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}},"tags":["hq_k2kapps"]}}}}
```

## GET /api/v0/apps/k2k

> Lists all K2KApps.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_K2KAppWithOptionalMetricsSummaryList":{"type":"object","description":"Contains K2KApps (Kafka-to-Kafka applications).","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KAppWithOptionalMetricsSummary"}}},"required":["items"]},"hq_K2KAppWithOptionalMetricsSummary":{"description":"Extends a K2KApp (Kafka-to-Kafka application) with an optional metrics summary.","allOf":[{"$ref":"#/components/schemas/hq_K2KApp"},{"type":"object","properties":{"metrics_summary":{"$ref":"#/components/schemas/hq_K2KAppMetricsSummary"}}}]},"hq_K2KApp":{"description":"Defines a K2KApp (Kafka-to-Kafka application).","allOf":[{"$ref":"#/components/schemas/hq_BaseManifest"},{"type":"object","properties":{"spec":{"$ref":"#/components/schemas/hq_K2KAppSpec"},"status":{"$ref":"#/components/schemas/hq_K2KAppStatus"}},"required":["spec"]}]},"hq_BaseManifest":{"type":"object","description":"Contains common fields shared by HQ manifests.","properties":{"apiVersion":{"type":"string","minLength":1},"kind":{"type":"string","minLength":1},"metadata":{"$ref":"#/components/schemas/hq_BaseManifestMetadata"}},"required":["apiVersion","kind","metadata"]},"hq_BaseManifestMetadata":{"type":"object","description":"Contains the metadata for a BaseManifest.","properties":{"name":{"type":"string","format":"hq-resource-name"},"displayName":{"type":"string","maxLength":150},"description":{"type":"string","description":"Has the description of the object.","maxLength":280},"id":{"type":"string","description":"Is a unique, read-only identifier.","readOnly":true},"lrn":{"type":"string","description":"Holds the LRN. Read-only.","readOnly":true},"creationTimestamp":{"type":"string","format":"date-time","description":"Is set to the time instant of creation. Read-only.","readOnly":true},"generation":{"type":"integer","description":"Is increased everytime the spec is updated. Read-only.","readOnly":true}},"required":["name"]},"hq_K2KAppSpec":{"type":"object","description":"Specifies a K2KApp (Kafka-to-Kafka application).","properties":{"sourceKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the source KafkaConnection LRN to read from."},"targetKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the target KafkaConnection LRN to write to."},"topics":{"type":"array","description":"Sets the topic(s) to replicate.","minItems":1,"items":{"type":"string","format":"kafka-topic","minLength":1}},"deploymentNamespaceLRN":{"type":"string","format":"kubernetes-namespace-lrn","description":"Defines the Kubernetes namespace to deploy to."},"replicas":{"type":"integer"},"kubernetes":{"$ref":"#/components/schemas/hq_K8sDeploymentOverrides"},"replicator":{"$ref":"#/components/schemas/hq_K2KReplicatorSettings"},"paused":{"type":"boolean","description":"Halts replication by scaling down to zero pods."},"configOverrides":{"$ref":"#/components/schemas/hq_K2KConfigOverrides"}},"required":["sourceKafkaLRN","targetKafkaLRN","deploymentNamespaceLRN","topics"]},"hq_K8sDeploymentOverrides":{"type":"object","properties":{"commonMetadata":{"$ref":"#/components/schemas/hq_K8sMetadata"},"securityContext":{"$ref":"#/components/schemas/hq_K8sSecurityContext"},"imagePullSecrets":{"type":"array","description":"Are passed to the Deployment's imagePullSecrets.","items":{"$ref":"#/components/schemas/hq_K8sLocalObjectReference"}},"serviceAccount":{"type":"string","description":"Is the name of the ServiceAccount to use to run pods.","format":"K8sDns1123Subdomain"},"image":{"type":"string","description":"Overrides the default image deployed."},"resources":{"$ref":"#/components/schemas/hq_K8sResourceRequirements"}}},"hq_K8sMetadata":{"type":"object","description":"Bundles K8s labels and annotations.","properties":{"labels":{"$ref":"#/components/schemas/hq_K8sStringMap"},"annotations":{"$ref":"#/components/schemas/hq_K8sStringMap"}}},"hq_K8sStringMap":{"type":"object","description":"Maps string keys to string values. Used for K8s labels and annotations.","additionalProperties":{"type":"string"}},"hq_K8sSecurityContext":{"type":"object","description":"Allows customisation of a deployment's SecurityContext. Partially\nmirrors a K8s core v1 SecurityContext.\n","properties":{"runAsUser":{"type":"integer","format":"int64","description":"Sets the UID to run the entrypoint of the container process."},"runAsGroup":{"type":"integer","format":"int64","description":"Sets the GID to run the entrypoint of the container process."},"runAsNonRoot":{"type":"boolean","description":"Indicates that the container must run as a non-root user."}}},"hq_K8sLocalObjectReference":{"type":"object","description":"Mirrors a K8s core v1 LocalObjectReference.","properties":{"name":{"type":"string","description":"Name of the referent.","format":"K8sDns1123Subdomain"}},"required":["name"]},"hq_K8sResourceRequirements":{"type":"object","description":"Mirrors a K8s core v1 ResourceRequirements.","properties":{"requests":{"$ref":"#/components/schemas/hq_K8sResourceList"},"limits":{"$ref":"#/components/schemas/hq_K8sResourceList"}}},"hq_K8sResourceList":{"type":"object","description":"Mirrors a K8s core v1 ResourceList.","properties":{"cpu":{"type":"string","format":"K8sResourceQuantity"},"memory":{"type":"string","format":"K8sResourceQuantity"}}},"hq_K2KReplicatorSettings":{"type":"object","description":"Provides additional control knobs for the K2K replicator.","properties":{"schemaMapping":{"type":"boolean","description":"Enables schema replication."},"exactlyOnce":{"type":"boolean","description":"Enables exactly-once processing."},"headerReplication":{"type":"boolean","description":"Replicates the record headers."},"autoCreateTopics":{"type":"boolean","description":"Enables auto creation of topics."},"autoCreateControlTopics":{"type":"boolean","description":"Enables auto creation of control topics."},"keepRecordCreationTimestamp":{"type":"boolean","description":"Enables preserving record timestamps."},"errorHandling":{"$ref":"#/components/schemas/hq_K2KErrorHandlingSettings"},"tracingHeaders":{"$ref":"#/components/schemas/hq_K2KTracingHeadersSettings"},"coordination":{"$ref":"#/components/schemas/hq_K2KCoordinationSettings"},"bidirectional":{"$ref":"#/components/schemas/hq_K2KBidirectionalSettings"}}},"hq_K2KErrorHandlingSettings":{"type":"object","description":"Controls K2K error handling behavior.","properties":{"onCommitSyncTimeout":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"},"onControlMessageDeserializationError":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"}}},"hq_K2KErrorHandlingBehavior":{"type":"string","description":"Specifies error handling behavior.","enum":["fail","ignore"]},"hq_K2KTracingHeadersSettings":{"type":"object","description":"Controls which tracing headers are enabled.","properties":{"partition":{"type":"boolean","description":"Enables the partition tracing header."},"offset":{"type":"boolean","description":"Enables the offset tracing header."},"topic":{"type":"boolean","description":"Enables the topic tracing header."},"pipeline":{"type":"boolean","description":"Enables the pipeline tracing header."}}},"hq_K2KCoordinationSettings":{"type":"object","description":"Controls coordination behavior.","properties":{"commit":{"$ref":"#/components/schemas/hq_K2KCommitCoordinationSettings"},"assignment":{"$ref":"#/components/schemas/hq_K2KAssignmentCoordinationSettings"}}},"hq_K2KCommitCoordinationSettings":{"type":"object","description":"Controls commit coordination settings.","properties":{"topic":{"type":"string","description":"Topic for offset commits."},"syncTimeoutSeconds":{"type":"integer","description":"Time limit in seconds to wait for catchup when reading from the offset control topic.","minimum":1},"batchSize":{"type":"integer","description":"Number of records after which an offset is committed.","minimum":1},"batchTimeoutSeconds":{"type":"integer","description":"Time in seconds to wait before injecting a commit record.","minimum":1}}},"hq_K2KAssignmentCoordinationSettings":{"type":"object","description":"Controls assignment coordination settings.","properties":{"topic":{"type":"string","description":"Topic used for assignment coordination."},"graceWindowSeconds":{"type":"integer","description":"Time in seconds to wait before the application actively fences off other applications.","minimum":1},"fencingMaxParallelism":{"type":"integer","description":"Max parallelism when fencing slow/zombie producers.","minimum":1}}},"hq_K2KBidirectionalSettings":{"type":"object","description":"Controls bidirectional replication behavior.","properties":{"enabled":{"type":"boolean","description":"Enables bidirectional replication."},"mode":{"$ref":"#/components/schemas/hq_K2KBidirectionalMode"},"headerName":{"type":"string","description":"Header name for bidirectional replication detection."}}},"hq_K2KBidirectionalMode":{"type":"string","description":"Controls the bidirectional replication detection identifier. This\nprevents records that are already present in both clusters from being\nreplicated. \"cluster\" uses the source broker's ID; \"pipeline\" uses the\npipeline name set in the configuration.\n","enum":["cluster","pipeline"]},"hq_K2KConfigOverrides":{"type":"object","description":"Contains arbitrary data that gets merged into the replicator's config.","additionalProperties":{}},"hq_K2KAppStatus":{"type":"object","description":"Contains the most recently observed status of a K2KApp. Read-only for clients.","properties":{"updatedAt":{"type":"string","format":"date-time","description":"Contains the time instant this object was updated."},"state":{"$ref":"#/components/schemas/hq_K2KAppState"},"statusLastTransitionAt":{"type":"string","format":"date-time","description":"Contains the time instant the status was changed."},"statusMessage":{"type":"string","description":"Is a human-readable message indicating details about last the transition."},"observedGeneration":{"type":"integer","description":"Reflects the generation of the spec that this status corresponds to."},"deployment":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatus"},"kafka":{"$ref":"#/components/schemas/hq_K2KAppKafkaStatus"}},"required":["updatedAt","state","statusLastTransitionAt","statusMessage","observedGeneration","deployment","kafka"]},"hq_K2KAppState":{"type":"string","description":"Enumerates K2KApp state types.","enum":["deploying","starting","running","paused","error","deleting"]},"hq_KubernetesDeploymentStatus":{"type":"object","description":"Provides information about a Kubernetes deployment.","properties":{"inSync":{"type":"boolean"},"managedResources":{"type":"array","items":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatusResource"}},"pods":{"type":"array","items":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatusPod"}}},"required":["inSync","managedResources","pods"]},"hq_KubernetesDeploymentStatusResource":{"type":"object","description":"Provides information about a Kubernetes resource.","properties":{"name":{"type":"string","description":"Holds the resource name."},"namespace":{"type":"string","description":"Is set to the resource's namespace."},"kind":{"type":"string","description":"Is set to the resource's kind, e.g. Deployment, ConfigMap, etc."},"status":{"type":"string","description":"Contains a one-word status of a loosely defined enum: Created, Updated, InSync, Error."},"reason":{"type":"string","description":"Elaborates on the status in a human-readably way."}},"required":["name","namespace","kind","status"]},"hq_KubernetesDeploymentStatusPod":{"type":"object","properties":{"name":{"type":"string","description":"Holds the Pod name."},"namespace":{"type":"string","description":"Is set to the Pod's namespace."},"state":{"type":"string","description":"Contains a one-word status of a loosely defined enum: Terminating, CrashLoopBackOff, Running, etc."},"reason":{"type":"string","description":"Elaborates on the status in a human-readably way, if possible."},"lastTermination":{"$ref":"#/components/schemas/hq_PodTerminationDetails"}},"required":["name","namespace","state"]},"hq_PodTerminationDetails":{"type":"object","properties":{"message":{"type":"string","description":"Last termination message of the pod's container."},"time":{"type":"string","format":"date-time","description":"When the last termination happened for the pod's container."}}},"hq_K2KAppKafkaStatus":{"type":"object","properties":{"consumerGroup":{"type":"string","description":"Holds the name of the consumer group that this K2KApp uses."}},"required":["consumerGroup"]},"hq_K2KAppMetricsSummary":{"type":"object","description":"Tracks metrics for a K2KApp.","properties":{"topics_count":{"type":"integer","description":"Contains the number of topics."},"partitions_count":{"type":"integer","description":"Contains the number of partitions."},"total_bytes_per_second_read":{"type":"number","format":"double","description":"Total bytes per second read across all topics."},"total_bytes_per_second_written":{"type":"number","format":"double","description":"Total bytes per second written across all topics."},"total_records_per_second_read":{"type":"number","format":"double","description":"Total records per second read across all topics."},"total_records_per_second_written":{"type":"number","format":"double","description":"Total records per second written across all topics."},"state":{"$ref":"#/components/schemas/hq_K2KAppMetricsState"},"updated_at":{"format":"date-time","type":"string","description":"Contains the time instant this object as a whole was updated."},"error_message":{"type":"string","description":"Contains the error message if the state is \"error\"."}},"required":["topics_count","partitions_count","total_bytes_per_second_read","total_bytes_per_second_written","total_records_per_second_read","total_records_per_second_written","updated_at","state","error_message"]},"hq_K2KAppMetricsState":{"type":"string","description":"Enumerates K2KApp metrics states.","enum":["unknown","success","error"]},"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","ai_server_unavailable","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v0/apps/k2k":{"get":{"description":"Lists all K2KApps.","operationId":"listK2KAppsV0","parameters":[{"in":"query","name":"expand_metrics_summary","required":false,"description":"Includes metrics summaries in the response, if available.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Happy response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KAppWithOptionalMetricsSummaryList"}}}},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}},"tags":["hq_k2kapps"]}}}}
```

## POST /api/v0/apps/k2k

> Creates a new K2KApp.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_K2KAppWithoutStatus":{"description":"Defines a K2KApp (Kafka-to-Kafka application).","allOf":[{"$ref":"#/components/schemas/hq_BaseManifest"},{"type":"object","properties":{"spec":{"$ref":"#/components/schemas/hq_K2KAppSpec"}},"required":["spec"]}]},"hq_BaseManifest":{"type":"object","description":"Contains common fields shared by HQ manifests.","properties":{"apiVersion":{"type":"string","minLength":1},"kind":{"type":"string","minLength":1},"metadata":{"$ref":"#/components/schemas/hq_BaseManifestMetadata"}},"required":["apiVersion","kind","metadata"]},"hq_BaseManifestMetadata":{"type":"object","description":"Contains the metadata for a BaseManifest.","properties":{"name":{"type":"string","format":"hq-resource-name"},"displayName":{"type":"string","maxLength":150},"description":{"type":"string","description":"Has the description of the object.","maxLength":280},"id":{"type":"string","description":"Is a unique, read-only identifier.","readOnly":true},"lrn":{"type":"string","description":"Holds the LRN. Read-only.","readOnly":true},"creationTimestamp":{"type":"string","format":"date-time","description":"Is set to the time instant of creation. Read-only.","readOnly":true},"generation":{"type":"integer","description":"Is increased everytime the spec is updated. Read-only.","readOnly":true}},"required":["name"]},"hq_K2KAppSpec":{"type":"object","description":"Specifies a K2KApp (Kafka-to-Kafka application).","properties":{"sourceKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the source KafkaConnection LRN to read from."},"targetKafkaLRN":{"type":"string","format":"environments-kafka-connection-lrn","description":"Sets the target KafkaConnection LRN to write to."},"topics":{"type":"array","description":"Sets the topic(s) to replicate.","minItems":1,"items":{"type":"string","format":"kafka-topic","minLength":1}},"deploymentNamespaceLRN":{"type":"string","format":"kubernetes-namespace-lrn","description":"Defines the Kubernetes namespace to deploy to."},"replicas":{"type":"integer"},"kubernetes":{"$ref":"#/components/schemas/hq_K8sDeploymentOverrides"},"replicator":{"$ref":"#/components/schemas/hq_K2KReplicatorSettings"},"paused":{"type":"boolean","description":"Halts replication by scaling down to zero pods."},"configOverrides":{"$ref":"#/components/schemas/hq_K2KConfigOverrides"}},"required":["sourceKafkaLRN","targetKafkaLRN","deploymentNamespaceLRN","topics"]},"hq_K8sDeploymentOverrides":{"type":"object","properties":{"commonMetadata":{"$ref":"#/components/schemas/hq_K8sMetadata"},"securityContext":{"$ref":"#/components/schemas/hq_K8sSecurityContext"},"imagePullSecrets":{"type":"array","description":"Are passed to the Deployment's imagePullSecrets.","items":{"$ref":"#/components/schemas/hq_K8sLocalObjectReference"}},"serviceAccount":{"type":"string","description":"Is the name of the ServiceAccount to use to run pods.","format":"K8sDns1123Subdomain"},"image":{"type":"string","description":"Overrides the default image deployed."},"resources":{"$ref":"#/components/schemas/hq_K8sResourceRequirements"}}},"hq_K8sMetadata":{"type":"object","description":"Bundles K8s labels and annotations.","properties":{"labels":{"$ref":"#/components/schemas/hq_K8sStringMap"},"annotations":{"$ref":"#/components/schemas/hq_K8sStringMap"}}},"hq_K8sStringMap":{"type":"object","description":"Maps string keys to string values. Used for K8s labels and annotations.","additionalProperties":{"type":"string"}},"hq_K8sSecurityContext":{"type":"object","description":"Allows customisation of a deployment's SecurityContext. Partially\nmirrors a K8s core v1 SecurityContext.\n","properties":{"runAsUser":{"type":"integer","format":"int64","description":"Sets the UID to run the entrypoint of the container process."},"runAsGroup":{"type":"integer","format":"int64","description":"Sets the GID to run the entrypoint of the container process."},"runAsNonRoot":{"type":"boolean","description":"Indicates that the container must run as a non-root user."}}},"hq_K8sLocalObjectReference":{"type":"object","description":"Mirrors a K8s core v1 LocalObjectReference.","properties":{"name":{"type":"string","description":"Name of the referent.","format":"K8sDns1123Subdomain"}},"required":["name"]},"hq_K8sResourceRequirements":{"type":"object","description":"Mirrors a K8s core v1 ResourceRequirements.","properties":{"requests":{"$ref":"#/components/schemas/hq_K8sResourceList"},"limits":{"$ref":"#/components/schemas/hq_K8sResourceList"}}},"hq_K8sResourceList":{"type":"object","description":"Mirrors a K8s core v1 ResourceList.","properties":{"cpu":{"type":"string","format":"K8sResourceQuantity"},"memory":{"type":"string","format":"K8sResourceQuantity"}}},"hq_K2KReplicatorSettings":{"type":"object","description":"Provides additional control knobs for the K2K replicator.","properties":{"schemaMapping":{"type":"boolean","description":"Enables schema replication."},"exactlyOnce":{"type":"boolean","description":"Enables exactly-once processing."},"headerReplication":{"type":"boolean","description":"Replicates the record headers."},"autoCreateTopics":{"type":"boolean","description":"Enables auto creation of topics."},"autoCreateControlTopics":{"type":"boolean","description":"Enables auto creation of control topics."},"keepRecordCreationTimestamp":{"type":"boolean","description":"Enables preserving record timestamps."},"errorHandling":{"$ref":"#/components/schemas/hq_K2KErrorHandlingSettings"},"tracingHeaders":{"$ref":"#/components/schemas/hq_K2KTracingHeadersSettings"},"coordination":{"$ref":"#/components/schemas/hq_K2KCoordinationSettings"},"bidirectional":{"$ref":"#/components/schemas/hq_K2KBidirectionalSettings"}}},"hq_K2KErrorHandlingSettings":{"type":"object","description":"Controls K2K error handling behavior.","properties":{"onCommitSyncTimeout":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"},"onControlMessageDeserializationError":{"$ref":"#/components/schemas/hq_K2KErrorHandlingBehavior"}}},"hq_K2KErrorHandlingBehavior":{"type":"string","description":"Specifies error handling behavior.","enum":["fail","ignore"]},"hq_K2KTracingHeadersSettings":{"type":"object","description":"Controls which tracing headers are enabled.","properties":{"partition":{"type":"boolean","description":"Enables the partition tracing header."},"offset":{"type":"boolean","description":"Enables the offset tracing header."},"topic":{"type":"boolean","description":"Enables the topic tracing header."},"pipeline":{"type":"boolean","description":"Enables the pipeline tracing header."}}},"hq_K2KCoordinationSettings":{"type":"object","description":"Controls coordination behavior.","properties":{"commit":{"$ref":"#/components/schemas/hq_K2KCommitCoordinationSettings"},"assignment":{"$ref":"#/components/schemas/hq_K2KAssignmentCoordinationSettings"}}},"hq_K2KCommitCoordinationSettings":{"type":"object","description":"Controls commit coordination settings.","properties":{"topic":{"type":"string","description":"Topic for offset commits."},"syncTimeoutSeconds":{"type":"integer","description":"Time limit in seconds to wait for catchup when reading from the offset control topic.","minimum":1},"batchSize":{"type":"integer","description":"Number of records after which an offset is committed.","minimum":1},"batchTimeoutSeconds":{"type":"integer","description":"Time in seconds to wait before injecting a commit record.","minimum":1}}},"hq_K2KAssignmentCoordinationSettings":{"type":"object","description":"Controls assignment coordination settings.","properties":{"topic":{"type":"string","description":"Topic used for assignment coordination."},"graceWindowSeconds":{"type":"integer","description":"Time in seconds to wait before the application actively fences off other applications.","minimum":1},"fencingMaxParallelism":{"type":"integer","description":"Max parallelism when fencing slow/zombie producers.","minimum":1}}},"hq_K2KBidirectionalSettings":{"type":"object","description":"Controls bidirectional replication behavior.","properties":{"enabled":{"type":"boolean","description":"Enables bidirectional replication."},"mode":{"$ref":"#/components/schemas/hq_K2KBidirectionalMode"},"headerName":{"type":"string","description":"Header name for bidirectional replication detection."}}},"hq_K2KBidirectionalMode":{"type":"string","description":"Controls the bidirectional replication detection identifier. This\nprevents records that are already present in both clusters from being\nreplicated. \"cluster\" uses the source broker's ID; \"pipeline\" uses the\npipeline name set in the configuration.\n","enum":["cluster","pipeline"]},"hq_K2KConfigOverrides":{"type":"object","description":"Contains arbitrary data that gets merged into the replicator's config.","additionalProperties":{}},"hq_K2KApp":{"description":"Defines a K2KApp (Kafka-to-Kafka application).","allOf":[{"$ref":"#/components/schemas/hq_BaseManifest"},{"type":"object","properties":{"spec":{"$ref":"#/components/schemas/hq_K2KAppSpec"},"status":{"$ref":"#/components/schemas/hq_K2KAppStatus"}},"required":["spec"]}]},"hq_K2KAppStatus":{"type":"object","description":"Contains the most recently observed status of a K2KApp. Read-only for clients.","properties":{"updatedAt":{"type":"string","format":"date-time","description":"Contains the time instant this object was updated."},"state":{"$ref":"#/components/schemas/hq_K2KAppState"},"statusLastTransitionAt":{"type":"string","format":"date-time","description":"Contains the time instant the status was changed."},"statusMessage":{"type":"string","description":"Is a human-readable message indicating details about last the transition."},"observedGeneration":{"type":"integer","description":"Reflects the generation of the spec that this status corresponds to."},"deployment":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatus"},"kafka":{"$ref":"#/components/schemas/hq_K2KAppKafkaStatus"}},"required":["updatedAt","state","statusLastTransitionAt","statusMessage","observedGeneration","deployment","kafka"]},"hq_K2KAppState":{"type":"string","description":"Enumerates K2KApp state types.","enum":["deploying","starting","running","paused","error","deleting"]},"hq_KubernetesDeploymentStatus":{"type":"object","description":"Provides information about a Kubernetes deployment.","properties":{"inSync":{"type":"boolean"},"managedResources":{"type":"array","items":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatusResource"}},"pods":{"type":"array","items":{"$ref":"#/components/schemas/hq_KubernetesDeploymentStatusPod"}}},"required":["inSync","managedResources","pods"]},"hq_KubernetesDeploymentStatusResource":{"type":"object","description":"Provides information about a Kubernetes resource.","properties":{"name":{"type":"string","description":"Holds the resource name."},"namespace":{"type":"string","description":"Is set to the resource's namespace."},"kind":{"type":"string","description":"Is set to the resource's kind, e.g. Deployment, ConfigMap, etc."},"status":{"type":"string","description":"Contains a one-word status of a loosely defined enum: Created, Updated, InSync, Error."},"reason":{"type":"string","description":"Elaborates on the status in a human-readably way."}},"required":["name","namespace","kind","status"]},"hq_KubernetesDeploymentStatusPod":{"type":"object","properties":{"name":{"type":"string","description":"Holds the Pod name."},"namespace":{"type":"string","description":"Is set to the Pod's namespace."},"state":{"type":"string","description":"Contains a one-word status of a loosely defined enum: Terminating, CrashLoopBackOff, Running, etc."},"reason":{"type":"string","description":"Elaborates on the status in a human-readably way, if possible."},"lastTermination":{"$ref":"#/components/schemas/hq_PodTerminationDetails"}},"required":["name","namespace","state"]},"hq_PodTerminationDetails":{"type":"object","properties":{"message":{"type":"string","description":"Last termination message of the pod's container."},"time":{"type":"string","format":"date-time","description":"When the last termination happened for the pod's container."}}},"hq_K2KAppKafkaStatus":{"type":"object","properties":{"consumerGroup":{"type":"string","description":"Holds the name of the consumer group that this K2KApp uses."}},"required":["consumerGroup"]},"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","ai_server_unavailable","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v0/apps/k2k":{"post":{"description":"Creates a new K2KApp.","operationId":"createK2KAppV0","requestBody":{"required":true,"content":{"application/yaml":{"schema":{"$ref":"#/components/schemas/hq_K2KAppWithoutStatus"}},"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KAppWithoutStatus"}}}},"responses":{"201":{"description":"Happy response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KApp"}}}},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}},"tags":["hq_k2kapps"]}}}}
```

## Update Consumer Group Offsets for multiple partitions

> Update the committed offsets for multiple topic partitions for a given K2K application.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_K2KUpdateOffsetsRequest":{"type":"object","description":"Defines the request body for updating K2K offsets, containing an array of topic-partition-offset tuples.","properties":{"offsets":{"type":"array","description":"An array of topic-partition-offset tuples specifying the new offset positions.","items":{"$ref":"#/components/schemas/hq_K2KTopicPartitionOffset"}}},"required":["offsets"]},"hq_K2KTopicPartitionOffset":{"type":"object","description":"A topic-partition-offset tuple specifying the position to update.","properties":{"topic_name":{"type":"string","description":"The name of the Kafka topic."},"partition":{"type":"integer","format":"int32","description":"The partition number for the given topic.","minimum":0},"offset":{"type":"integer","format":"int64","description":"The offset value to set for the given topic-partition.","minimum":0}},"required":["topic_name","partition","offset"]},"hq_K2KUpdateOffsetsResponse":{"type":"object","properties":{"application_name":{"type":"string"},"updated_partitions":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KTopicPartitionOffset"},"description":"List of partitions and their updated offsets."}},"required":["application_name","updated_partitions"]},"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","ai_server_unavailable","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v0/apps/k2k/{name}/position/offsets":{"put":{"tags":["hq_k2kapps"],"summary":"Update Consumer Group Offsets for multiple partitions","description":"Update the committed offsets for multiple topic partitions for a given K2K application.","operationId":"updateK2KAppOffsetsByPosition","parameters":[{"in":"path","name":"name","description":"The unique name for the K2K application.","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"A list of topic-partition-offset tuples to update.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KUpdateOffsetsRequest"}}}},"responses":{"200":{"description":"Offsets successfully updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KUpdateOffsetsResponse"}}}},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}}}}}}
```

## Update Consumer Group Offsets based on timestamp

> Update the committed offsets for multiple topics based on a timestamp. The offsets will be set to the earliest offset whose timestamp is greater than or equal to the given timestamp.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_K2KUpdateOffsetsByTimestampRequest":{"type":"object","description":"Defines the request body for updating K2K offsets based on a timestamp for multiple topics.","properties":{"timestamp":{"type":"string","format":"date-time","description":"RFC3339 timestamp to seek offsets to."},"topics":{"type":"array","description":"List of Kafka topic names to update offsets for.","items":{"type":"string"},"minItems":1}},"required":["timestamp","topics"]},"hq_K2KUpdateOffsetsResponse":{"type":"object","properties":{"application_name":{"type":"string"},"updated_partitions":{"type":"array","items":{"$ref":"#/components/schemas/hq_K2KTopicPartitionOffset"},"description":"List of partitions and their updated offsets."}},"required":["application_name","updated_partitions"]},"hq_K2KTopicPartitionOffset":{"type":"object","description":"A topic-partition-offset tuple specifying the position to update.","properties":{"topic_name":{"type":"string","description":"The name of the Kafka topic."},"partition":{"type":"integer","format":"int32","description":"The partition number for the given topic.","minimum":0},"offset":{"type":"integer","format":"int64","description":"The offset value to set for the given topic-partition.","minimum":0}},"required":["topic_name","partition","offset"]},"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","ai_server_unavailable","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v0/apps/k2k/{name}/position/timestamp":{"put":{"tags":["hq_k2kapps"],"summary":"Update Consumer Group Offsets based on timestamp","description":"Update the committed offsets for multiple topics based on a timestamp. The offsets will be set to the earliest offset whose timestamp is greater than or equal to the given timestamp.","operationId":"updateK2KAppOffsetsByTimestamp","parameters":[{"in":"path","name":"name","description":"The unique name for the K2K application.","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"The timestamp and list of topics to update offsets for.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KUpdateOffsetsByTimestampRequest"}}}},"responses":{"200":{"description":"Offsets successfully updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_K2KUpdateOffsetsResponse"}}}},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}}}}}}
```

## GET /api/v1/apps/k2k/live/sse

> Provides Server-Sent Events (SSE) for K2KApp updates. TODO.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"hq_k2kapps","description":"Kafka 2 Kafka application management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","ai_server_unavailable","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v1/apps/k2k/live/sse":{"get":{"description":"Provides Server-Sent Events (SSE) for K2KApp updates. TODO.","operationId":"observeK2KAppUpdates","responses":{"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}},"tags":["hq_k2kapps"]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lenses.io/latest/api-reference/6.1/reference/k2k-apps.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
