Partner center Get Resource name object level - rest

I am currently working at an Powershell script that will automatically download the billing data from my companies CSP platform. I use following powershell module (https://github.com/Microsoft/Partner-Center-PowerShell)
And use the following api(that the module calls I guess) To get the overall price from the last month of all my subscriptions. https://learn.microsoft.com/en-us/partner-center/develop/get-a-subscriptions-resource-usage-information. With the Powershell module that is wonderfull I've managed to recieve good data from my Azure Resources and print them out in a CSV file for Power BI to create a report of them.
My question now is when I use power BI to create graphs of my cost and usage. I don't see the name of my resources (vm, storage, sql) instead I see names of the types (Read Operations,LRS Write Additional IO, ...) And of course that's also a good indicator. I would love to see the VM (the name of the vm or storage or sql) with the highest cost and usage not which type. The ResourceName in the response of the api is not exactly right. The Resource name ( in Resource URL formatting) however is available with this api: https://learn.microsoft.com/en-us/partner-center/develop/get-a-customer-s-utilization-record-for-azure.
But here I cannot retrieve the cost of my Azure Resource. I tried to combine the 2 api's (one to retrieve the cost and the other one to retrieve the Resource URL with the Resource ID as a combiner) but strangly enough some customers have data in the usage api and not in the utilization api. So that didn't helped out well. My question today is: Is it possible to retrieve the resource name or URL with the response data i got from this api: https://learn.microsoft.com/en-us/partner-center/develop/get-a-subscriptions-resource-usage-information . Or is there another way of providing the name of the object instead of the service.

The resource usage feature will not return the resource name. So, you will need to combine data from Get-PartnerCustomerSubscriptionUtilization and Get-PartnerAzureRateCard to get the resource name and the partner cost associated with each billable meter. Since you are working with Power BI, it might be a good idea to check out Partner-Center-Query. It is another project that allows you query data from the Partner Center API through Power Query.

Related

Where are the methods specified that are needed to analyse an Analytics Data API V1 Beta report?

I have added GTM and GA4 to some website apps to produce tables of detailed stats on click-throughs of ads per advertiser for a date range. I now have suitable reports working successfully using Data Studio, but my attempts to do the same using the PHP implementation of Analytics Data API V1 Beta (in order to do batch runs covering many date ranges) repeatedly hit a brick wall: the methods needed to analyse the response from instantiating BetaAnalyticsDataClient and then invoking runPivotReport or batchRunReports or batchRunPivotReports (and so on) appear not be specified.
The only example that I could work from is the ‘quickstart’ one that does a basic dimension and metric retrieval, and even this employs:
getRows()
getDimensionValues()
getValue()
getMetricValues
that do not appear in the API documentation, at least that I can find.
The JSON response format for each report is of course documented: for example the output from running runPivotReport is documented as an instantiation of runPivotReportResponse.
But nowhere can I find a specification of the methods to be used to traverse the JSON tree (vide getDimensionValues() above) and extract some output data.
Guesswork has taken me part way, but purely for example, when retrieving pivot data, should a
getPivotDimensionHeaders()[0]
be followed by a
getDimensionValues()
or a
getPivotDimensionValues()
I am obviously approaching this all wrong, but what should I do, please?

Filtering certain coins based upon name with CoinMarketCap

I'm currently attempting to use the CoinMarketCap API but finding it frustrating.
I'm wanting to use this URL to query their API:
https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest
However, rather than finding all, or just simply filtering based upon the number, I want to find a certain few coins.
So for example, I want to only find Bitcoin, Ethereum and Cardano.
Looking at their docs, it suggests you can sort by name, but it appears this is only listing them alphabetically, which I don't want to do.
So can anyone suggest how to query their API successfully and find just Bitcoin, Ethereum and Cardano using that GET URL above?
Here's the URL to the specific URL for the API request: https://coinmarketcap.com/api/documentation/v1/#operation/getV1CryptocurrencyListingsLatest
For this purpose, you can use the endpoint Quotes Latest:
https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest
It allows you to pass a list of identifiers in a string as a parameter, like this:
1,1027,328
or a list of slugs:
bitcoin,ethereum,monero
or a list of symbols
BTC,ETH,XMR
If you trying to scrape information about new listings at crypto exchanges, you can be interested in this API:
https://rapidapi.com/Diver44/api/new-cryptocurrencies-listings/
It includes an endpoint with New Listings, New Pairs from the biggest exchanges and a very useful endpoint with information about exchanges where you can buy specific coins and prices for this coin at that exchange. It's a bit paid, but it's worth it!

How to get a SRS/CRS name from geoserver?

I received a list (XML) of SRSes by request:
http://gis1:8080/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities
then parse it and get a list of EPSG codes like "EPSG:1234"
How I can now get a name of specific SRS like "Pulkovo 1942 / Gauss-Kruger zone 13" for "EPSG:28413"?
...or may be I can do it by OpenLayers API?
OGC services do not provide such facilities, they are built under the assumption that you have a EPSG database already available in the client.
You can try using some free online service to get to a name (with the perils of a service that is not guaranteed to be available 24x7 of course), like:
https://www.epsg-registry.org/
http://epsg.io/
http://spatialreference.org/
A better solution production wise, if you are using GeoServer, is probably to create a WPS process in GeoServer that would do the same job (or create a REST service of your own based on other open source libraries).

Dynamically Populating Locations on the basis of Storage Type

I am a beginner in Softlayer and we need to implement block storage functionality provided by softlayer in an Application. We just need to make REST call to fetch the locations on the basis of storage type selected. I need to know relationship between Storage Type and locations. What method I need to call in REST API and object mask required for same.. Thanks in Advance.
If you want to order a new “Network storage” and know what “locations” are available for this item, see these steps:
1. The first that we need to know is the “package id” to use for this order.
The “package id” is very important to valid and verifies what kind of items, what locations are available at the moment to order network storage.
For example:
Storage Type: Endurance, the package to use is “240”
Storage Type: Performance, the package to use is “222”
To get all active packages, please review:
http://sldn.softlayer.com/reference/services/SoftLayer_Product_Package/getAllObjects
2. Once we know what package to use, we need to get the valid “item price ids” according to LOCATION. The following request can help us:
https://[username]:[apikey]#api.softlayer.com/rest/v3/SoftLayer_Product_Package/[package_id]/getItemPrices?objectMask=mask[id,item[keyName,description],pricingLocationGroup[locations[id, name, longName]]]
Method: GET
Where:
A price id with a locationGroupId = null is considered "A standard price" and the API will internally switch the prices for the customer. But we recommend to execute first the verifyOrder in order to see if the wanted order is ok (the fee can vary).
Reference: http://sldn.softlayer.com/blog/cmporter/Location-based-Pricing-and-You
Also, this method can help you to get available locations for a specific package:
http://sldn.softlayer.com/reference/services/SoftLayer_Product_Package/getRegions
3. Then you will able to order a new Network storage, please see:
API for Performance and Endurance storage(Block storage)
Now, if you want to list the network storage of your account, please see:
http://sldn.softlayer.com/reference/services/SoftLayer_Account/getNetworkStorage
This is an example, where the result displays properties like: “location” and “network storage type”.
https://[username]:[apikey]#api.softlayer.com/rest/v3/SoftLayer_Account/getNetworkStorage?objectMask=mask[storageType, billingItem[description,location[id,longName]]]
Using filters:
Filtering by network Storage Type: “Endurance Storage” or “Block Storage (Performance)”
https://[username]:[apikey]#api.softlayer.com/rest/v3/SoftLayer_Account/getNetworkStorage?objectMask=mask[id,username,nasType,storageType, billingItem[description,location[id,longName]]]&objectFilter={"networkStorage":{"nasType":{"operation":"ISCSI"},"billingItem":{"description":{"operation":"Endurance Storage"}}}}
Regards.
You need to use the http://sldn.softlayer.com/reference/services/SoftLayer_Product_Package/getRegions method
It returns the valid locations for a package, each storage type belongs to an specific package (that is the relation you are looking for) to get the packages use http://sldn.softlayer.com/reference/services/SoftLayer_Product_Package/getAllObjects method
see this post for more information
Filter parameters to POST verify and place order request for Performance storage

How to include Cost Method into Facebook Atlas Reporting API?

According to the atlas api reference WebMediaReportColumn, if i can specify a PackageName, there should be a way to specify a cost data
Specifies the name of the package.
For single-placement packages, the package name is the same as the placement name. The
PackageName column should be used in reports that include cost data.enter code here
But how? i cant find any Cost Method within the WebMediaReportColumn
And can someone tag this question with "facebook-atlas-api"? Because "Facebook" is too generalize.
The Atlas reporting API will let you get costing information out in these reports, but only if you've setup costing information using Cost Package objects in the Atlas data model. Cost Packages are a way for you to model how the advertiser and publisher have agreed on pricing for the ad campaign. Atlas lets you model a number of different kinds of agreements, including flat CPM, CPC, CPA, free/bonus, CPM blend, etc. Once this costing information has been setup for your campaign, you can pull reports that will give you the amount that has been spent to date.