From c1a39acb658aeb709c76b4a545d1838d2c8135ab Mon Sep 17 00:00:00 2001 From: Greg Dean Date: Thu, 21 Mar 2019 15:25:36 -0400 Subject: [PATCH 1/2] changing some coalesce statements to be 1 instead of -1 --- .../cloud_generic/instance.json | 2 +- .../cloud_generic/staging_event.json | 10 +++++----- .../cloud_openstack/instance.json | 2 +- .../cloud_openstack/staging_event.json | 10 +++++----- .../etl_tables.d/cloud_common/instance.json | 4 ++-- .../cloud_generic/staging_event.json | 20 +++++++++---------- .../cloud_openstack/staging_event.json | 20 +++++++++---------- 7 files changed, 34 insertions(+), 34 deletions(-) diff --git a/configuration/etl/etl_action_defs.d/cloud_generic/instance.json b/configuration/etl/etl_action_defs.d/cloud_generic/instance.json index ccd424136e..46af759010 100644 --- a/configuration/etl/etl_action_defs.d/cloud_generic/instance.json +++ b/configuration/etl/etl_action_defs.d/cloud_generic/instance.json @@ -11,7 +11,7 @@ "source_query": { "records": { "resource_id": "raw.resource_id", - "account_id": "COALESCE(act.account_id, -1)", + "account_id": "COALESCE(act.account_id, 1)", "provider_identifier": "COALESCE(raw.provider_instance_identifier, 'unknown')" }, diff --git a/configuration/etl/etl_action_defs.d/cloud_generic/staging_event.json b/configuration/etl/etl_action_defs.d/cloud_generic/staging_event.json index 8ca3063cee..fa10d94bfe 100644 --- a/configuration/etl/etl_action_defs.d/cloud_generic/staging_event.json +++ b/configuration/etl/etl_action_defs.d/cloud_generic/staging_event.json @@ -23,11 +23,11 @@ "record_type_id": "COALESCE(rtype.record_type_id, -1)", "user_name": "rv.provider_user", "person_id": "sa.person_id", - "account_id": "COALESCE(acct.account_id, -1)", - "host_id": "COALESCE(h.host_id, -1)", - "instance_id": "COALESCE(i.instance_id, -1)", - "instance_type_id": "COALESCE(itype.instance_type_id, -1)", - "image_id": "COALESCE(img.image_id, -1)", + "account_id": "COALESCE(acct.account_id, 1)", + "host_id": "COALESCE(h.host_id, 1)", + "instance_id": "COALESCE(i.instance_id, 1)", + "instance_type_id": "COALESCE(itype.instance_type_id, 1)", + "image_id": "COALESCE(img.image_id, 1)", "event_data": "raw.event_data", "root_volume_type_id": "COALESCE(atype.asset_type_id, -1)" }, diff --git a/configuration/etl/etl_action_defs.d/cloud_openstack/instance.json b/configuration/etl/etl_action_defs.d/cloud_openstack/instance.json index 8a5dcb26fa..6959480943 100644 --- a/configuration/etl/etl_action_defs.d/cloud_openstack/instance.json +++ b/configuration/etl/etl_action_defs.d/cloud_openstack/instance.json @@ -11,7 +11,7 @@ "source_query": { "records": { "resource_id": "raw.resource_id", - "account_id": "COALESCE(act.account_id, -1)", + "account_id": "COALESCE(act.account_id, 1)", "provider_identifier": "COALESCE(raw.provider_instance_identifier, 'unknown')" }, diff --git a/configuration/etl/etl_action_defs.d/cloud_openstack/staging_event.json b/configuration/etl/etl_action_defs.d/cloud_openstack/staging_event.json index 54e78529be..fddf6ca33d 100644 --- a/configuration/etl/etl_action_defs.d/cloud_openstack/staging_event.json +++ b/configuration/etl/etl_action_defs.d/cloud_openstack/staging_event.json @@ -18,11 +18,11 @@ "record_type_id": "COALESCE(rtype.record_type_id, -1)", "user_name": "raw.user_name", "person_id": "sa.person_id", - "account_id": "COALESCE(acct.account_id, -1)", - "host_id": "COALESCE(h.host_id, -1)", - "instance_id": "COALESCE(i.instance_id, -1)", - "image_id": "COALESCE(img.image_id, -1)", - "instance_type_id": "COALESCE(itype.instance_type_id, -1)", + "account_id": "COALESCE(acct.account_id, 1)", + "host_id": "COALESCE(h.host_id, 1)", + "instance_id": "COALESCE(i.instance_id, 1)", + "image_id": "COALESCE(img.image_id, 1)", + "instance_type_id": "COALESCE(itype.instance_type_id, 1)", "event_data": "raw.event_data", "volume_id": "raw.volume_id" }, diff --git a/configuration/etl/etl_tables.d/cloud_common/instance.json b/configuration/etl/etl_tables.d/cloud_common/instance.json index 52e95f9906..8d0b51cc44 100644 --- a/configuration/etl/etl_tables.d/cloud_common/instance.json +++ b/configuration/etl/etl_tables.d/cloud_common/instance.json @@ -16,14 +16,14 @@ "type": "int(11)", "nullable": false, "extra": "auto_increment", - "comment": "Auto-increment relative to resource_id. Unknown = -1" + "comment": "Auto-increment relative to resource_id. Unknown = 1" }, { "name": "account_id", "type": "int(11)", "nullable": false, "default": 1, - "comment": "Unknown = -1" + "comment": "Unknown = 1" }, { "name": "provider_identifier", diff --git a/configuration/etl/etl_tables.d/cloud_generic/staging_event.json b/configuration/etl/etl_tables.d/cloud_generic/staging_event.json index db4e64e33a..ab496d9025 100644 --- a/configuration/etl/etl_tables.d/cloud_generic/staging_event.json +++ b/configuration/etl/etl_tables.d/cloud_generic/staging_event.json @@ -13,8 +13,8 @@ "name": "instance_id", "type": "int(11)", "nullable": false, - "default": -1, - "comment": "Optional instance the event is associated with. Unknown = -1" + "default": 1, + "comment": "Optional instance the event is associated with. Unknown = 1" }, { "name": "event_time_ts", @@ -55,29 +55,29 @@ "name": "account_id", "type": "int(11)", "nullable": false, - "default": -1, - "comment": "Optional account the event is associated with. Unknown = -1" + "default": 1, + "comment": "Optional account the event is associated with. Unknown = 1" }, { "name": "host_id", "type": "int(11)", "nullable": false, - "default": -1, - "comment": "Host where the event occured. Unknown = -1" + "default": 1, + "comment": "Host where the event occured. Unknown = 1" }, { "name": "instance_type_id", "type": "int(11)", "nullable": false, - "default": -1, - "comment": "Instance type for the event. Unknown = -1" + "default": 1, + "comment": "Instance type for the event. Unknown = 1" }, { "name": "image_id", "type": "int(11)", "nullable": false, - "default": -1, - "comment": "Image associated with the event. Unknown = -1" + "default": 1, + "comment": "Image associated with the event. Unknown = 1" }, { "name": "event_data", diff --git a/configuration/etl/etl_tables.d/cloud_openstack/staging_event.json b/configuration/etl/etl_tables.d/cloud_openstack/staging_event.json index bb8059d823..11959df9a8 100644 --- a/configuration/etl/etl_tables.d/cloud_openstack/staging_event.json +++ b/configuration/etl/etl_tables.d/cloud_openstack/staging_event.json @@ -13,8 +13,8 @@ "name": "instance_id", "type": "int(11)", "nullable": false, - "default": -1, - "comment": "Optional instance the event is associated with. Unknown = -1" + "default": 1, + "comment": "Optional instance the event is associated with. Unknown = 1" }, { "name": "event_time_ts", @@ -55,22 +55,22 @@ "name": "account_id", "type": "int(11)", "nullable": false, - "default": -1, - "comment": "Optional account the event is associated with. Unknown = -1" + "default": 1, + "comment": "Optional account the event is associated with. Unknown = 1" }, { "name": "host_id", "type": "int(11)", "nullable": false, - "default": -1, - "comment": "Host where the event occured. Unknown = -1" + "default": 1, + "comment": "Host where the event occured. Unknown = 1" }, { "name": "instance_type_id", "type": "int(11)", "nullable": false, - "default": -1, - "comment": "Instance type for the event. Unknown = -1" + "default": 1, + "comment": "Instance type for the event. Unknown = 1" }, { "name": "event_data", @@ -90,8 +90,8 @@ "name": "image_id", "type": "int(11)", "nullable": false, - "default": -1, - "comment": "Image associated with the event. Unknown = -1" + "default": 1, + "comment": "Image associated with the event. Unknown = 1" }, { "name": "volume_id", From ea5d83b145419f0fa60bea551755afe44e2b2c66 Mon Sep 17 00:00:00 2001 From: Greg Dean Date: Fri, 22 Mar 2019 08:28:15 -0400 Subject: [PATCH 2/2] changing person_id default to -1 on instance table --- configuration/etl/etl_tables.d/cloud_common/account.json | 2 +- configuration/etl/etl_tables.d/cloud_common/instance.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configuration/etl/etl_tables.d/cloud_common/account.json b/configuration/etl/etl_tables.d/cloud_common/account.json index dda57f128f..b89f3f448a 100644 --- a/configuration/etl/etl_tables.d/cloud_common/account.json +++ b/configuration/etl/etl_tables.d/cloud_common/account.json @@ -15,7 +15,7 @@ "type": "int(11)", "nullable": false, "extra": "auto_increment", - "comment": "Unknown = -1" + "comment": "Unknown = 1" }, { "name": "provider_account", diff --git a/configuration/etl/etl_tables.d/cloud_common/instance.json b/configuration/etl/etl_tables.d/cloud_common/instance.json index 8d0b51cc44..f4a2c36205 100644 --- a/configuration/etl/etl_tables.d/cloud_common/instance.json +++ b/configuration/etl/etl_tables.d/cloud_common/instance.json @@ -35,7 +35,7 @@ "name": "person_id", "type": "int(11)", "nullable": false, - "default": 1, + "default": -1, "comment": "Unknown = -1" } ],