Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/c7n_gcp/resources/datafusion.py: 95%

20 statements  

« prev     ^ index     » next       coverage.py v7.3.2, created at 2023-12-08 06:51 +0000

1# Copyright The Cloud Custodian Authors. 

2# SPDX-License-Identifier: Apache-2.0 

3from c7n_gcp.provider import resources 

4from c7n_gcp.query import (QueryResourceManager, TypeInfo) 

5 

6 

7@resources.register('datafusion-instance') 

8class DatafusionInstance(QueryResourceManager): 

9 

10 class resource_type(TypeInfo): 

11 service = 'datafusion' 

12 version = 'v1' 

13 component = 'projects.locations.instances' 

14 enum_spec = ('list', 'instances[]', None) 

15 scope = 'project' 

16 scope_key = 'parent' 

17 scope_template = "projects/{}/locations/-" 

18 name = id = "name" 

19 default_report_fields = ['name', 'updateTime'] 

20 asset_type = "datafusion.googleapis.com/Instance" 

21 urn_component = "instances" 

22 urn_id_segments = (-1,) 

23 

24 @classmethod 

25 def _get_location(cls, resource): 

26 return resource['name'].split('/')[3]