Search code examples
amazon-web-servicesboto3aws-xray

AWS Xray SDK : I need to extract Service Graph using boto3, observing "TypeError: 'module' object is not callable" error


I am new to AWS (coding as well) and we are using API gateways. As part of our validations, I need extract trace using AWS X-ray service. I have written below code but observing TypeError: 'module' object is not callable error. Kindly help me on this code.

import boto3
import botocore
import aws_xray_sdk
import datetime
import traceback

def retrieve_xray_data():
    session = boto3.Session(
        aws_access_key_id='accesskey',
        aws_secret_access_key='secretaccessKey',
        region_name='us-east-1'
        )
    xrayClient = session.client('xray', region_name='us-east-1')
    specificTestData = xrayClient.get_service_graph(StartTime=datetime(2019, 11, 26), EndTime=datetime(2019, 11, 27))
    return specificTestData

Thank you.


Solution

  • it should be datetime.datetime(2012, 9, 26)