
We’ve an vital announcement to make – Utilization Meter and Utilization Report APIs at the moment are a part of the Cloud Supplier Navigator and may be accessed from the Cloud Provider part on developer.vmware.com. Moreover, there’s a new API for registering Utilization Meter with a contract within the VCPP Commerce Portal. Right here is how the Utilization API web page appears like on developer.vmware.com.

On this weblog publish, we are going to exhibit the steps of registering a Utilization Meter occasion, getting info and downloading utilization stories.
Earlier than utilizing the aforementioned APIs, there are a couple of conditions that must be happy.
Conditions
- A refresh token generated from Cloud Associate Navigator/Consumer Profile/API Tokens. Data may be discovered here or scroll to the Producing an Entry Token part on this weblog publish.
- An entry token generated from the Cloud Associate Navigator refresh token. Learn here or scroll to the Producing an Entry Token part on this weblog publish.
Notice: A generated entry token expires after half-hour so you have to regenerate it every now and then.
Producing an Entry Token for Authentication
To execute the API requests described on this weblog publish, you will want to generate a refresh token from Cloud Associate Navigator (CPN) after which execute a POST request to the Cloud Providers Portal gateway to get the entry token with which you’ll authenticate with the CPN service – Utilization Perception.
The Utilization Perception service is the service which can register your Utilization Meter with a contract within the Commerce Portal and generate stories for a Utilization Meter occasion.
Now let’s see tips on how to generate an entry token:
- Log in to Cloud Associate Navigator.
- Change to the group for which you want to register a Utilization Meter or obtain utilization stories.
- Beneath your username, click on My Account.
- Click on on the API Tokens tab.
- Within the API Tokens web page, click on GENERATE TOKEN.
- Copy the token and click on Proceed.

Notice: Save your refresh token someplace as you will want it repeatedly to generate an entry token in your utilization API calls.
- In your API consumer, make the next POST Request to the Cloud Associate Navigator Service Gateway to generate an entry token.
|
POST https://console.cloud.vmware.com/csp/gateway/am/api/auth/api-tokens/authorize |
This entry token you’ll use to authenticate with Utilization Perception when sending the request for registering your Utilization Meter with a contract within the Commerce Portal.
See the pattern request and response:

Pattern cURL Code:
|
curl —location —request POST ‘https://console-.cloud.vmware.com/csp/gateway/am/api/auth/api-tokens/authorize’ —header ‘Content material-Kind: software/x-www-form-urlencoded’ —header ‘Settle for: software/json’ —header ‘Cookie: incap_ses_875_1285679=dI6yChlNDWmSHUSOe6AkDJeH22MAAAAAVl2Twv8diGo4dJ3dWNmwZg==; nlbi_1285679=U7QpOt23TR0lxkHi+iiRRwAAAACv7L8J9/EtUtWlx9vSOrbq’ —information–urlencode ‘refresh_token=7lz-3tDup5w1xGV54iRHyhlEIq5Malq1Ii5ZgoYuCBqq95jbwIvTBLsCxu3RsNyU’ |
Notice: Exchange the refresh token with your personal generated from the CPN API Token web page.
- Copy the entry token from the response. Use it when executing the API requests described on this weblog publish.
Checking if a Utilization Meter occasion is registered
Earlier than registering a Utilization Meter, verify if it has already been registered with Utilization Perception.
Right here is tips on how to do it:
- Execute the next GET registration request:
|
GET https://ums.vmware.com/utilization/api/v1/agent-registrations/um-uuid |
- Use the UUID of your Utilization Meter.
- Use the generated entry token to authenticate to the service.
- In case your registration is profitable, you’re going to get the next response: Standing 200 OK, additionally a contract quantity, and a website title. See the screenshot beneath:

Pattern cURL Code
|
curl —location —request GET ‘https://ums.vmware.com/utilization/api/v1/agent-registrations/9273dc74-2cef-4009-abcc-69fe9ccfde8d’ —header ‘Authorization: Bearer |
Notice: Exchange the Utilization Meter UUID with your personal. You’ll find it in your Utilization Meter internet software, beneath the About tab. Use the entry token you generated for the authorization.
Registering a Utilization Meter within the Commerce Portal
To register your Utilization Meter with a contract within the Commerce Portal utilizing the brand new REST API, you will want to authenticate with the Utilization Perception service to which to ship the registration request.
Listed below are the precise steps:
- Ship POST request to the Utilization Perception service, which can deal with the registration of the Utilization Meter occasion with a contract within the Commerce Portal.
|
POST https://ums.vmware.com/utilization/api/v1/agent-registrations |
- Within the physique of the request, you need to specify the next:
“agentId”: “88531d1c-296e-4b47-8431-c0e8182148e7”, // that is the UM UUID
“connectivityMode”: “ONLINE”, //the mode during which UM will report information
“contractNumber”: “1012345”, // the variety of the VCPP contract with which you’ll register your UM
“label”: “um46-reg-demo”, // the title you’ll give to your Utilization Meter
“meteringMode”: “PRODUCTION”, // the mode during which the information might be reported to the Commerce Portal
“siteName”: “Website A”, // the location of the group with which you’ll register this UM
“model”: “4.6” // The UM model Notice: Don’t use 4.x right here, because the request will return an error.
|
“agentId”: “88531d1c-296e-4b47-8431-c0e8182148e7”, // that is the UM UUID “connectivityMode”: “ONLINE”, //the mode during which UM will report information “contractNumber”: “1012345”, // the variety of the VCPP contract with which you’ll register your UM “label”: “um46-reg-demo”, // the title you’ll give to your Utilization Meter “meteringMode”: “PRODUCTION”, // the mode during which the information might be reported to the Commerce Portal “siteName”: “Website A”, // the location of the group with which you’ll register this UM “model”: “4.6” // The UM model Notice: Don’t use 4.x right here, because the request will return an error.
|
- For the authorization with the Utilization Perception service, use the generated entry token.
- Execute the request. If the Utilization Meter registration is profitable, then you’re going to get code 202. See an instance beneath:

If this Utilization Meter has already been registered, you’re going to get code 201.
- Go to the VMware Commerce portal to confirm if Utilization Meter is registered with the desired contract and org website.
Pattern cURL code
‘
|
curl —location —request POST ‘https://ums.vmware.com/utilization/api/v1/agent-registrations’ —header ‘Content material-Kind: software/json’ —header ‘Authorization: Bearer –data-raw ‘ “agentId”: “88531d1c-296e-4b47-8431-c0e8182148e7”, “connectivityMode”: “ONLINE”, “contractNumber”: “1012345”, “label”: “um46-reg-demo”, “meteringMode”: “PRODUCTION”, “siteName”: “Website A”, “model”: “4.6”
‘ |
Notice: Use your Utilization Meter particulars an present the entry token you generated from the CPN refresh token.
Getting Data on All Utilization Experiences
Utilization report API is now dully documented and is able to be applied in your group. Listed below are the API requests that you need to use to automate your utilization report era:
- Get info on all utilization stories for a selected month and yr for a company
- Obtain a selected utilization report by specifying its reference quantity retrieved from the get info on all utilization stories API request
- Lastly, get info on all stories related by a utilization meter UUID
Get Data on All Utilization Experiences for a Month
To get info on all utilization stories of all Utilization Meters in your CPN group for a selected month and yr, do the next:
- Execute GET https://ums.vmware.com/utilization/api/v1/stories/2023/1 request to the Utilization Perception service endpoint.
- Present the month and yr for which you want to get all utilization stories for all of your registered Utilization Meters.
- Authenticate to Utilization Perception with the generated entry token.
- In case your request is profitable, you’re going to get Standing 200 OK and a listing of all utilization stories related to Utilization Meter UUID. Right here is an instance of the response.

Pattern cURL code
|
curl —location —request GET ‘https://ums.vmware.com/utilization/api/v1/stories/2023/01’ —header ‘Authorization: Bearer
|
Notice: Specify a month and a yr for which to get info on all utilization stories of a CPN group.
Obtain a Particular Utilization Report
To obtain a selected Utilization Meter report, you have to present within the parameters of your API request the reference variety of that report. To seek out it, you want first to set off GET info on all utilization stories request. See the Getting Data on All Utilization Experiences for a Month part.
Right here is tips on how to obtain a selected Utilization Meter report:
1. Make a GET request to https://ums.vmware.com/utilization/api/v1/stories and specify the next:
- Within the parameters of the request enter the reference variety of the report. This worth you need to retrieve from the request defined within the Get Data on All Experiences for a Month part.
- Within the header of the request, you need to specify the Settle for parameter to be the content material kind of the report (once more get this info from the get info on all utilization stories API request)
- Authenticate to the Utilization Perception service by utilizing the generated entry code.
- The response might be Standing 200 OK if the request is profitable, and also you additionally get the textual content of the zipped report. On this instance, the response isn’t decoded as Postman does node decode the content material of zipped information.
- Save the response. In Postman, the way in which to do it’s to click on Save Response. This fashion you’ll obtain the referenced report.

Pattern cURL code
|
curl —location —request GET ‘https://ums.vmware.com/utilization/api/v1/stories?ref=nPrNoRBz9cjia2YSJvUPpBNQY3raKZidg7dGzdAkmpercent2FzNGJFpVEKmccXNchrMZA7tHJKtWuOtbwmj0rB1gXb48PMQx0iSYRpercent2Fl1MYB03sZa7G8A4JGppTBszl6gmVXapXFjO2g’ —header ‘Settle for: textual content/tab-separated-values+gzip’ —header ‘Content material-Kind: software/json’ —header ‘Authorization: Bearer |
Notice: Use the reference variety of the report you want to obtain the your generated entry token.
Get Data on all Experiences of a Utilization Meter Occasion
To get info on all utilization stories of a selected Utilization Meters, do the next:
- Execute a GET request to the Utilization Perception service, specifying the month and yr for which you want to get info and the uuid of the utilization meter with which the stories are related.
- Present the generated entry token with which to authenticate with the Utilization Perception service.
- You’ll get the next response: Standing 200 OK and the main points of all stories associated to this Utilization Meter and their reference numbers.
Notice: Use the reference variety of the stories you want to obtain with the GET / https://ums.vmware.com/utilization/api/v1/stories API request.
Right here is an instance of the request and its response.

Pattern cURL Code
|
curl —location —request GET ‘https://ums.vmware.com/utilization/api/v1/stories/2023/01/9273dc74-2cef-4009-abcc-69fe9ccfde8d’ —header ‘Authorization: Bearer
|
Notice: Specify a month and a yr for which to get info on all utilization stories related to the uuid of your utilization meter. Exchange the Utilization Meter UUID on this instance with your personal.
Conclusion
In a conclusion, you need to use these APIs as a part of your Utilization Meter reporting automation. Now with the registration of the Utilization Meter occasion you may totally automate the set up and configuration of your Utilization Meter situations.
We are going to hold enhancing and increasing our Utilization Meter-related APIs and wish to hear from you about what different APIs we will develop to enhance your reporting expertise.
The remainder of the Utilization Meter API requests may be discovered here. Cloud Associate Navigator and Commerce Portal APIs may be discovered here and here.
For extra questions or queries, go away a remark beneath or ship us an electronic mail to [email protected]. There’s a Slack channel accessible to cloud suppliers the place it’s also possible to ask your questions.