wooden-smartphone-11475
07/15/2023, 5:18 PMproductName
values I can pass in this query:
query {
products(
filter: {
vendorName: "azure",
service: "Virtual Machines",
productFamily: "Compute",
region: "centralus",
attributeFilters: [
{ key: "skuName", value: "DS2 v2" }
{ key: "productName", value:"Virtual Machines DSv2 Series Windows"}
]
},
) {
prices(
filter: {
purchaseOption: "Consumption",
unit: "1 Hour"
},
) { USD }
}
}
I can get the skuName
by running the az cli:
az vm list-sizes -l <location>
and then I get this list where I can see the name but no mention of `productName`:
{
'maxDataDiskCount': 64,
'memoryInMb': 5836800,
'name': 'Standard_M208ms_v2',
'numberOfCores': 208,
'osDiskSizeInMb': 1047552,
'resourceDiskSizeInMb': 4194304
}
Thanks a lot!!white-airport-8778
wooden-smartphone-11475
07/18/2023, 7:34 AMwhite-airport-8778
wooden-smartphone-11475
07/18/2023, 6:49 PMquery {
products(
filter: {
vendorName: "azure",
service: "Virtual Machines",
productFamily: "Compute",
region: "centralus",
attributeFilters: [
{ key: "skuName", value: "DS2 v2" }
]
},
) {
prices(
filter: {
purchaseOption: "Consumption",
unit: "1 Hour"
},
) { USD }
}
}
I get 3 different values as opposed to this:
query {
products(
filter: {
vendorName: "azure",
service: "Virtual Machines",
productFamily: "Compute",
region: "centralus",
attributeFilters: [
{ key: "skuName", value: "DS2 v2" }
{ key: "productName", value:"Virtual Machines DSv2 Series Windows"}
]
},
) {
prices(
filter: {
purchaseOption: "Consumption",
unit: "1 Hour"
},
) { USD }
}
}
with the productName
key.
I'd like to find in the code/db the source of these values for Azure. I just cannot find them.
I will continue looking for it, thanksERROR: column "productName" does not exist
LINE 1: SELECT DISTINCT "service", "productName" FROM products WHERE...
^
HINT: Perhaps you meant to reference the column "products.productHash".
SQL state: 42703
Character: 28Query returned successfully in 160 msec.
When I am trying to run:
SELECT DISTINCT "service", "productName" FROM products WHERE "vendorName" = 'azure';
white-airport-8778
attributes
, try something like this
SELECT DISTINCT "service", "productFamily", "attributes"->>'productName' AS productName, "attributes"->>'skuName' AS skuName FROM products WHERE "vendorName" = 'azure'
wooden-smartphone-11475
07/18/2023, 6:54 PMwhite-airport-8778
Much better! Instead of hundreds of records, we reduced the search to four possibilities. But it is still unclear what exactly represents the service. The guess would be the last two rows, but it is uncertain. We need more information, and including the attributes column in the output may help.
.....
SELECT DISTINCT "service", "productFamily", "attributes" FROM products WHERE "vendorName" = 'aws' AND "service" = 'AWSTransfer' AND region = 'us-east-1';
wooden-smartphone-11475
07/18/2023, 7:28 PMSELECT DISTINCT "service", "productFamily", "attributes"->>'productName' AS productName, "attributes"->>'skuName' AS skuName, "prices"
FROM products
WHERE "vendorName" = 'azure' AND "attributes"->>'skuName' = 'DS2 v2';
And I am getting a lot of different prices responses (165)
Is there a way to shorten them to 4 in accordance to the productNames I see in the DB?white-airport-8778
SELECT DISTINCT "attributes"
FROM products
WHERE "vendorName" = 'azure' AND "attributes"->>'skuName' = 'DS2 v2';