Unable to edit or delete customer rules that contain special characters like # & + symbols in Usage Meter
search cancel

Unable to edit or delete customer rules that contain special characters like # & + symbols in Usage Meter

book

Article ID: 407137

calendar_today

Updated On:

Products

VMware Usage Meter

Issue/Introduction

Unable to edit or delete customer rules that contain special characters from the Usage Meter API request using CURL.

Environment

VCF usage meter 9.0

Cause

When executed the command below, getting an error: HTTP/2 401

curl -k -X POST  -H 'Authorization: <Bearer TOKEN>' -H 'Content-Type: application/json' https://UMIP:8443/api/v1/login

Because Access token is different from the bearer token.

Resolution

Before proceeding, take a snapshot of the affected virtual appliance.

  1. SSH to Usage Meter using root user

  2. Run below command to obtain the bearer token
    curl -v -X POST  -k -u 'usagemeter: <usagemeter_password' https://UMIP/api/v1/login
  3. Replace the <value> with the bearer token obtained from the above command and {api_host} with usage meter IP/FQDN.
    curl -H 'Authorization: <value>' https://{api_host}/api/v1/rules
  4. Delete the customer rule appropriately using the command below.

    curl -X DELETE -H 'Authorization: <value>' https://{api_host}/api/v1/rules?name=v