maestro-server/discovery-api

View on GitHub
app/repository/providers/aws/aws_mapper/aws_describe_vpn_gateways.py

Summary

Maintainability
A
0 mins
Test Coverage
F
50%
def rules(conn):
    return {
        'unique_id': {'call': 'switch', 'source': 'VpnGatewayId'},
        'availability_zone': {'call': 'switch', 'source': 'AvailabilityZone'},
        'vpc_attachments': {'call': 'switch', 'source': 'VpcAttachments'},
        'amazon_side_asn': {'call': 'switch', 'source': 'AmazonSideAsn'},
        'family': {'call': 'setV', 'source': 'VpnGateways'},
        'datacenters': {'call': 'fctDcApp',
                        'source': {**conn}},
        'environment': {'call': 'arrCatcher',
                        'source': {'field': 'Tags', 'sKey': 'Key', 's': 'environment', 'catcher': 'Value'}},
        'status': {'call': 'switchCapitalized', 'source': 'State'},
        'tags': {'call': 'fctTags', 'source': 'Tags'},
        'active': {'call': 'switchOptions',
                   'source': {'field': 'State',
                              'options': {'deleted': False, 'deleting': False},
                              'default': True
                              }},
        'owner': {'call': 'fctOwner',
                  'source': {**conn}},
        'accountant': {'call': 'fctAccountant', 'source': {**conn}},
        'roles': {'call': 'fctRoles',
                  'source': {**conn}},
        'checksum': {'call': 'checksum',
                     'source': None}
    }