1

1

stream = datastream_v1alpha1.Stream(
    display_name='MySQL to gcs Stream',
    source_config = source_config,
    destination_config = destination_config,backfill_all=datastream_v1alpha1.Stream.BackfillAllStrategy(),
)

req=datastream_v1alpha1.CreateStreamRequest(parent=parent,stream_id=stream_id,stream=stream,force=True)

stream_response = client.create_stream(request=req)

operation = client.start_stream(name=stream.name)

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Input In [25], in <cell line: 1>()
----> 1 operation = client.start_stream(name=stream.name)

AttributeError: 'DatastreamClient' object has no attribute 'start_stream'


i am getting this error while using library datastream_v1alpha1, there is no function like start_stream in datastream_v1alpha1 client . so i tried different approach's by updating the stream State to running to start and run the stream, but those approach's are not working. please help me in this issue

vimuth
  • 5,064
  • 33
  • 79
  • 116
  • 1
    Based on the documentation, it looks like you are on the right track. There does not appear to be any "start_stream()" method in the DatastreamClient, as the error states, but your suggestion of updating the "state" to "RUNNING" should be the correct approach. What errors do you get when you remove the line "operation = client.start_stream(name=stream.name)" and replace it with the update code? https://cloud.google.com/datastream/docs/using-datastream-apis#manage_the_stream – lukwam Mar 11 '23 at 01:07
  • thank you lukwam, i am able to run the stream. but now i am thinking how to do CDC from mysql to big query using python. is this library 'datastream_v1alpha1' has an option to do cdc from mysql to bigquery..? – Varun Kumar Mar 16 '23 at 11:03
  • Hi @VarunKumar Glad to hear the issue is resolved. Can you post that as an answer so that it will help other community members in their research work? Please create a new thread for the new question. – kiran mathew Mar 17 '23 at 15:00

0 Answers0