diff --git a/src/spaceone/inventory_v2/connector/collector_plugin_connector/collector_plugin_v1_connector.py b/src/spaceone/inventory_v2/connector/collector_plugin_connector/collector_plugin_v1_connector.py index 21ff8c5..fca82a5 100644 --- a/src/spaceone/inventory_v2/connector/collector_plugin_connector/collector_plugin_v1_connector.py +++ b/src/spaceone/inventory_v2/connector/collector_plugin_connector/collector_plugin_v1_connector.py @@ -87,7 +87,10 @@ def _convert_resource_in_resource_data(resource_data: dict) -> dict: if _resource := resource_data.get("resource"): resource_type = resource_data.get("resource_type") if resource_type == "inventory.Region": - pass + _resource["region_id"] = ( + f"{_resource['provider']}-{_resource['region_code']}" + ) + elif resource_type == "inventory.Metric": metric_resource_type = _resource.get("resource_type") _resource["resource_type"] = metric_resource_type.replace( diff --git a/src/spaceone/inventory_v2/manager/__init__.py b/src/spaceone/inventory_v2/manager/__init__.py index 783fdf6..083af3e 100644 --- a/src/spaceone/inventory_v2/manager/__init__.py +++ b/src/spaceone/inventory_v2/manager/__init__.py @@ -1,6 +1,5 @@ from spaceone.inventory_v2.manager.asset_manager import AssetManager from spaceone.inventory_v2.manager.asset_type_manager import AssetTypeManager -from spaceone.inventory_v2.lib.resource_manager import ResourceManager from spaceone.inventory_v2.manager.region_manager import RegionManager from spaceone.inventory_v2.manager.collecting_manager import CollectingManager from spaceone.inventory_v2.manager.namespace_group_manager import NamespaceGroupManager diff --git a/src/spaceone/inventory_v2/manager/region_manager.py b/src/spaceone/inventory_v2/manager/region_manager.py index 82de5a9..cb2bf2b 100644 --- a/src/spaceone/inventory_v2/manager/region_manager.py +++ b/src/spaceone/inventory_v2/manager/region_manager.py @@ -12,6 +12,9 @@ class RegionManager(BaseManager, ResourceManager): + resource_keys = ["region_id"] + query_method = "list_regions" + def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.region_model = Region() diff --git a/src/spaceone/inventory_v2/service/asset_service.py b/src/spaceone/inventory_v2/service/asset_service.py index a3a945a..86bdaa7 100644 --- a/src/spaceone/inventory_v2/service/asset_service.py +++ b/src/spaceone/inventory_v2/service/asset_service.py @@ -374,9 +374,6 @@ def list(self, params: AssetSearchQueryRequest) -> Union[AssetsResponse, dict]: ) assets_info = [asset_vo.to_dict() for asset_vo in asset_vos] - - for asset_info in assets_info: - print(asset_info) return AssetsResponse(results=assets_info, total_count=total_count) @transaction(