Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Add missing storage tiers to pi_instances and fix product family value to match db #194

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions internal/resources/ibm/pi_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (r *PiInstance) piInstanceAIXOperatingSystemCostComponent() *schema.CostCom
ProductFilter: &schema.ProductFilter{
VendorName: strPtr("ibm"),
Region: strPtr(r.Region),
ProductFamily: strPtr("service"),
ProductFamily: strPtr("composite"),
Service: strPtr("power-iaas"),
AttributeFilters: []*schema.AttributeFilter{
{Key: "planName", Value: strPtr("power-virtual-server-group")},
Expand Down Expand Up @@ -165,7 +165,7 @@ func (r *PiInstance) piInstanceIBMiLPPPOperatingSystemCostComponent() *schema.Co
ProductFilter: &schema.ProductFilter{
VendorName: strPtr("ibm"),
Region: strPtr(r.Region),
ProductFamily: strPtr("service"),
ProductFamily: strPtr("composite"),
Service: strPtr("power-iaas"),
AttributeFilters: []*schema.AttributeFilter{
{Key: "planName", Value: strPtr("power-virtual-server-group")},
Expand Down Expand Up @@ -202,7 +202,7 @@ func (r *PiInstance) piInstanceIBMiOSOperatingSystemCostComponent() *schema.Cost
ProductFilter: &schema.ProductFilter{
VendorName: strPtr("ibm"),
Region: strPtr(r.Region),
ProductFamily: strPtr("service"),
ProductFamily: strPtr("composite"),
Service: strPtr("power-iaas"),
AttributeFilters: []*schema.AttributeFilter{
{Key: "planName", Value: strPtr("power-virtual-server-group")},
Expand Down Expand Up @@ -237,7 +237,7 @@ func (r *PiInstance) piInstanceIBMiOperatingSystemServiceExtensionCostComponent(
ProductFilter: &schema.ProductFilter{
VendorName: strPtr("ibm"),
Region: strPtr(r.Region),
ProductFamily: strPtr("service"),
ProductFamily: strPtr("composite"),
Service: strPtr("power-iaas"),
AttributeFilters: []*schema.AttributeFilter{
{Key: "planName", Value: strPtr("power-virtual-server-group")},
Expand Down Expand Up @@ -279,7 +279,7 @@ func (r *PiInstance) piInstanceMemoryHanaProfileCostComponent() *schema.CostComp
ProductFilter: &schema.ProductFilter{
VendorName: strPtr("ibm"),
Region: strPtr(r.Region),
ProductFamily: strPtr("service"),
ProductFamily: strPtr("composite"),
Service: strPtr("power-iaas"),
AttributeFilters: []*schema.AttributeFilter{
{Key: "planName", Value: strPtr("power-virtual-server-group")},
Expand Down Expand Up @@ -321,7 +321,7 @@ func (r *PiInstance) piInstanceCoresHanaProfileCostComponent() *schema.CostCompo
ProductFilter: &schema.ProductFilter{
VendorName: strPtr("ibm"),
Region: strPtr(r.Region),
ProductFamily: strPtr("service"),
ProductFamily: strPtr("composite"),
Service: strPtr("power-iaas"),
AttributeFilters: []*schema.AttributeFilter{
{Key: "planName", Value: strPtr("power-virtual-server-group")},
Expand Down Expand Up @@ -357,7 +357,7 @@ func (r *PiInstance) piInstanceCloudStorageSolutionCostComponent() *schema.CostC
ProductFilter: &schema.ProductFilter{
VendorName: strPtr("ibm"),
Region: strPtr(r.Region),
ProductFamily: strPtr("service"),
ProductFamily: strPtr("composite"),
Service: strPtr("power-iaas"),
AttributeFilters: []*schema.AttributeFilter{
{Key: "planName", Value: strPtr("power-virtual-server-group")},
Expand Down Expand Up @@ -391,7 +391,7 @@ func (r *PiInstance) piInstanceHighAvailabilityCostComponent() *schema.CostCompo
ProductFilter: &schema.ProductFilter{
VendorName: strPtr("ibm"),
Region: strPtr(r.Region),
ProductFamily: strPtr("service"),
ProductFamily: strPtr("composite"),
Service: strPtr("power-iaas"),
AttributeFilters: []*schema.AttributeFilter{
{Key: "planName", Value: strPtr("power-virtual-server-group")},
Expand Down Expand Up @@ -424,7 +424,7 @@ func (r *PiInstance) piInstanceDB2WebQueryCostComponent() *schema.CostComponent
ProductFilter: &schema.ProductFilter{
VendorName: strPtr("ibm"),
Region: strPtr(r.Region),
ProductFamily: strPtr("service"),
ProductFamily: strPtr("composite"),
Service: strPtr("power-iaas"),
AttributeFilters: []*schema.AttributeFilter{
{Key: "planName", Value: strPtr("power-virtual-server-group")},
Expand Down Expand Up @@ -457,7 +457,7 @@ func (r *PiInstance) piInstanceRationalDevStudioLicensesCostComponent() *schema.
ProductFilter: &schema.ProductFilter{
VendorName: strPtr("ibm"),
Region: strPtr(r.Region),
ProductFamily: strPtr("service"),
ProductFamily: strPtr("composite"),
Service: strPtr("power-iaas"),
AttributeFilters: []*schema.AttributeFilter{
{Key: "planName", Value: strPtr("power-virtual-server-group")},
Expand Down Expand Up @@ -530,7 +530,7 @@ func (r *PiInstance) piInstanceCoresCostComponent() *schema.CostComponent {
ProductFilter: &schema.ProductFilter{
VendorName: strPtr("ibm"),
Region: strPtr(r.Region),
ProductFamily: strPtr("service"),
ProductFamily: strPtr("composite"),
Service: strPtr("power-iaas"),
AttributeFilters: []*schema.AttributeFilter{
{Key: "planName", Value: strPtr("power-virtual-server-group")},
Expand Down Expand Up @@ -565,7 +565,7 @@ func (r *PiInstance) piInstanceMemoryCostComponent() *schema.CostComponent {
ProductFilter: &schema.ProductFilter{
VendorName: strPtr("ibm"),
Region: strPtr(r.Region),
ProductFamily: strPtr("service"),
ProductFamily: strPtr("composite"),
Service: strPtr("power-iaas"),
AttributeFilters: []*schema.AttributeFilter{
{Key: "planName", Value: strPtr("power-virtual-server-group")},
Expand All @@ -592,8 +592,11 @@ func (r *PiInstance) piInstanceStorageCostComponent() *schema.CostComponent {
unit = "TIER_ONE_STORAGE_GIGABYTE_HOURS"
} else if r.StorageType == "tier3" {
unit = "TIER_THREE_STORAGE_GIGABYTE_HOURS"
} else if r.StorageType == "tier0" {
unit = "TIER_ZERO_STORAGE_GIGABYTE_HOURS"
} else if r.StorageType == "tier5k" {
unit = "FIXED_5K_OPS_GIGABYTE_HOURS"
}

return &schema.CostComponent{
Name: fmt.Sprintf("Storage - %s", r.StorageType),
Unit: "GB hours",
Expand All @@ -602,7 +605,7 @@ func (r *PiInstance) piInstanceStorageCostComponent() *schema.CostComponent {
ProductFilter: &schema.ProductFilter{
VendorName: strPtr("ibm"),
Region: strPtr(r.Region),
ProductFamily: strPtr("service"),
ProductFamily: strPtr("composite"),
Service: strPtr("power-iaas"),
AttributeFilters: []*schema.AttributeFilter{
{Key: "planName", Value: strPtr("power-virtual-server-group")},
Expand Down
Loading