Source Update - Teradata Listener

Teradata® Listener™ User Guide

Product
Teradata Listener
Release Number
2.06
Published
August 2019
Language
English (United States)
Last Update
2019-08-30
dita:mapPath
yng1555531055816.ditamap
dita:ditavalPath
boe1555608925945.ditaval
dita:id
B035-2910
Product Category
Analytical Ecosystem

To update a source, send a JSON object with updated values for one or more of the writable source properties. Read-only properties are ignored. All property values from the previous version of this source are carried over by default, if not included in the hash.

Definition

PATCH https://CLUSTER.DOMAIN/listener/appservices/sources/{source_id} HTTP/1.1

Example REST Source Request

curl \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer TOKEN" \
  -X PATCH \
  -d '{
    "owner": ["jd123456"],
    "created_at": "2015-07-04T10:20:00Z",
    "created_by": "av012345",
    "updated_at": "2015-12-20T10:20:00Z",
    "updated_by": "jd123456",
    "secret": "f8a9f620-e0e6-470b-a6b8-1f16b003c034",
    "name": "My source",
    "description": "A superb source",
    "state": 1,
    "production": false,
    "source_type": "REST"
  }' \
  -i \
  https://CLUSTER.DOMAIN/listener/appservices/sources/758fbda4-accc-4f90-8f09-cc0a164c8c28

Example MQTT Source Request

curl \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer TOKEN" \
  -X PATCH \
  -d '{
    "owner": ["jd123456"],
    "created_at": "2015-07-04T10:20:00Z",
    "created_by": "av012345",
    "updated_at": "2015-12-20T10:20:00Z",
    "updated_by": "jd123456",
    "secret": "",
    "name": "My source",
    "description": "A superb source",
    "state": 1,
    "production": false,
    "source_type": "MQTT",
    "subscription_info": {
      "broker": "http://localhost:1234",
      "topic": "My MQTT topic"
    }
  }' \
  -i \
  https://CLUSTER.DOMAIN/listener/appservices/sources/758fbda4-accc-4f90-8f09-cc0a164c8c28

Example Kafka Source Request

curl \
  -H "Content-Type: application/json" {{}}
  -H "Authorization: Bearer TOKEN" {{}}
  
-X PATCH 
}
  -d '{
    "name": "My source",
    "description": "A superb source",
    "source_type": "KAFKA",
    "subscription_info": {
      "broker": "mybroker:9092",
      "zookeeper": "myzookeeperhost:port",
      "topic": "listener",
{ {      }
}}
  {{}' }}
  
  -i 
  https://listener-app-services.teradata.com/v1/sources

Example REST Source Response

HTTP/1.1 200 OK
Content-Type: application/json
{
  "source_id": "758fbda4-accc-4f90-8f09-cc0a164c8c28",
  "owner": ["jd123456"],
  "created_at": "2015-07-04T10:20:00Z",
  "created_by": "av012345",
  "updated_at": "2015-12-20T10:20:00Z",
  "updated_by": "jd123456",
  "secret": "f8a9f620-e0e6-470b-a6b8-1f16b003c034",
  "name": "My source",
  "description": "A superb source",
  "state": 1,
  "production": false,
  "source_type": "REST"
}

Example MQTT Source Response

HTTP/1.1 200 OK
Content-Type: application/json
{
  "source_id": "758fbda4-accc-4f90-8f09-cc0a164c8c28",
  "owner": ["jd123456"],
  "created_at": "2015-07-04T10:20:00Z",
  "created_by": "av012345",
  "updated_at": "2015-12-20T10:20:00Z",
  "updated_by": "jd123456",
  "secret": "",
  "name": "My source",
  "description": "A superb source",
  "state": 1,
  "production": false,
  "source_type": "MQTT",
  "subscription_info": {
    "broker": "http://localhost:1234",
    "topic": "My MQTT topic"
  }
}

Example Kafka Source Response

{
  "source_id": "22b05fee-80a1-486d-9d1e-95e650a16cc7",
  "owner": [
    "listener"
  ],
  "collaborators": null,
  "created_at": "2019-08-02T16:55:21Z",
  "created_by": "listener",
  "updated_at": "2019-08-02T16:55:21Z",
  "updated_by": "listener",
  "name": "customerkafka",
  "description": "test",
  "secret": "",
  "size": 2,
  "state": "1",
  "production": false,
  "source_type": "KAFKA",
  "subscription_info": {
    "broker": "broker_host:broker_port",
    "topic": "listener",
    "zookeeper": "zookeeper_host:zookeeper_port:/{path}"
  }
}

Response Codes

Code Description
200 Source successfully updated.
400 Bad request or invalid data.
400 Data validation error. Topic does not exist.
401 Authorization header not found.
404 Resource not found.