got following code and it shows all my storage gateways. I need to get info on only 1 gateway
import boto3
sg = boto3.client('storagegateway', 'us-east-1')
sg.list(gateways)
print (sg.list_gateways)
any idea how to filter out and print only a specific gw?
Try something like this to filter on the specific gateway name...
You can filter on other response elements as well (e.g. ARN, ID, etc.) by updating the IF statement. Also, if you have more than 100 storage gateway instances, you will need to handle the Marker element to retrieve all results. For more information, see Boto3 documentation here:
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/storagegateway.html#StorageGateway.Client.list_gateways