Feb-20-2018, 12:54 PM
(This post was last modified: Feb-20-2018, 12:54 PM by onenessboy.)
sorry i did not post entire response..
While conn is environment variable which is having connecting details
here it is
Traceback (most recent call last):
File "/home/user/script/ABSlack1.py", line 43, in <module>
req = Request(HOOK_URL, json.dumps(response))
File "/usr/lib64/python2.7/json/__init__.py", line 244, in dumps
return _default_encoder.encode(obj)
File "/usr/lib64/python2.7/json/encoder.py", line 207, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib64/python2.7/json/encoder.py", line 270, in iterencode
return _iterencode(o, 0)
File "/usr/lib64/python2.7/json/encoder.py", line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: Reservation:r-00000f4510a2551 "not JSON serializable
While conn is environment variable which is having connecting details
here it is
{ "Reservations": [ { "Instances": [ { "Monitoring": { "State": "disabled" }, "PublicDnsName": "", "StateReason": { "Message": "Client.UserInitiatedShutdown: User initiated shutdown", "Code": "Client.UserInitiatedShutdown" }, "State": { "Code": 80, "Name": "stopped" }, "EbsOptimized": false, "LaunchTime": "2018-02-08T10:37:36.000Z", "PrivateIpAddress": "xx.xx.x.xxx", "ProductCodes": [], "VpcId": "xx-xxxx", "StateTransitionReason": "User initiated (2018-02-08 11:13:34 GMT)", "InstanceId": "xxxxxxxx", "EnaSupport": true, "ImageId": "xx-xxxxx", "PrivateDnsName": "xxxxxxx", "KeyName": "xxxxx", "SecurityGroups": [ { "GroupName": "xxxxxx", "GroupId": "xxxxxxx" } ], "ClientToken": "", "SubnetId": "xxxx-xxxx", "InstanceType": "t2.micro", "NetworkInterfaces": [ { "Status": "in-use", "MacAddress": "xxxxxxx", "SourceDestCheck": true, "VpcId": "xxxxx", "Description": "Primary network interface", "NetworkInterfaceId": "xxxx", "PrivateIpAddresses": [ { "PrivateDnsName": "xxxxxxx", "Primary": true, "PrivateIpAddress": "xx.xx.xx.xxx" } ], "PrivateDnsName": "xxxxxx", "Attachment": { "Status": "xxx", "DeviceIndex": 0, "DeleteOnTermination": true, "AttachmentId": "xxxxxx", "AttachTime": "2017-12-28T17:24:50.000Z" }, "Groups": [ { "GroupName": "xx", "GroupId": "xx-xxxx" } ], "Ipv6Addresses": [], "OwnerId": "xxxxxxx", "SubnetId": "subnet-xxxxx", "PrivateIpAddress": "xx.xx.x.x" } ], "SourceDestCheck": true, "Placement": { "Tenancy": "default", "GroupName": "", "AvailabilityZone": "xx-xx-xx" }, "Hypervisor": "xen", "BlockDeviceMappings": [ { "DeviceName": "/xx/xx", "Ebs": { "Status": "attached", "DeleteOnTermination": true, "VolumeId": "vol-xxxxxxxx", "AttachTime": "2017-12-28T17:24:51.000Z" } } ], "Architecture": "x86_64", "RootDeviceType": "ebs", "RootDeviceName": "/dev/xvda", "VirtualizationType": "hvm", "Tags": [ { "Value": "xxxx", "Key": "Name" } ], "AmiLaunchIndex": 0 } ], "ReservationId": "00000f4510a2551", "Groups": [], "OwnerId": "xxxxxxxx" } }This is the traceback
Traceback (most recent call last):
File "/home/user/script/ABSlack1.py", line 43, in <module>
req = Request(HOOK_URL, json.dumps(response))
File "/usr/lib64/python2.7/json/__init__.py", line 244, in dumps
return _default_encoder.encode(obj)
File "/usr/lib64/python2.7/json/encoder.py", line 207, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib64/python2.7/json/encoder.py", line 270, in iterencode
return _iterencode(o, 0)
File "/usr/lib64/python2.7/json/encoder.py", line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: Reservation:r-00000f4510a2551 "not JSON serializable