Issue
I'm trying typing
command = "aws ec2 describe-instances --query "Reservations[*].Instances[].{ instance_id: InstanceId, type: InstanceType, stats: State.Name, disks: BlockDeviceMappings[*].Ebs.VolumeId, p_ip: NetworkInterfaces[*].PrivateIpAddresses[].PrivateIpAddress, name: Tags[?Key == `Name`].Value, cpu: CpuOptions.CoreCount, platform: PlatformDetails}" > output.json"
os.system(command)
I got an error when debbuging. Is there anyone correct this syntax.
Solution
You have to escape the double quotes:
command = "aws ec2 describe-instances --query \"Reservations[*].Instances[].{ instance_id: InstanceId, type: InstanceType, stats: State.Name, disks: BlockDeviceMappings[*].Ebs.VolumeId, p_ip: NetworkInterfaces[*].PrivateIpAddresses[].PrivateIpAddress, name: Tags[?Key == `Name`].Value, cpu: CpuOptions.CoreCount, platform: PlatformDetails}\" > out22.json"
os.system(command)
Answered By - Jens Answer Checked By - Marie Seifert (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.