Closed Swati365 closed 5 years ago
Hi @Swati365,
Thanks for your request, I'll debug it.
Thanks! Chan Gao
Hi @Swati365,
get users
and get dashboards
, it can work fine on Windows platform.
nr-windows-amd64.exe get users
nr-windows-amd64.exe get dashboards
What's the Windows version you tested on? My platform is Windows7 Professional 64-bit.
For get alertsconditions
, it need policy id
argument, like:
nr-windows-amd64.exe get alertsconditions 340829 -o json
You can use get alertspolicies
to view every id for each alert policy.
For get alertschannels
, it's a problem, the default output data format(table) did not work. You can specify the -o json
, like:
nr-windows-amd64 get alertschannels -o json
Below is the output of get dashbords
:
C:\newrelic-cli>nr-windows-amd64.exe get dashboards
{
"dashboards": [
{
"id": 764400,
"title": "Test dashboard 1",
"description": null,
"icon": "bar-chart",
"created_at": "2018-11-02T03:18:57Z",
"updated_at": "2018-11-02T03:20:38Z",
"visibility": "all",
"editable": "editable_by_all",
"ui_url": "https://insights.newrelic.com/accounts/2098892/dashboards/764400",
"api_url": "https://api.newrelic.com/v2/dashboards/764400",
"owner_email": "bjgchan@cn.ibm.com",
"filter": null
},
{
"id": 764403,
"title": "Test dashboard 2",
"description": null,
"icon": "bar-chart",
"created_at": "2018-11-02T03:21:02Z",
"updated_at": "2018-11-02T03:21:22Z",
"visibility": "all",
"editable": "editable_by_all",
"ui_url": "https://insights.newrelic.com/accounts/2098892/dashboards/764403",
"api_url": "https://api.newrelic.com/v2/dashboards/764403",
"owner_email": "bjgchan@cn.ibm.com",
"filter": null
}
]
}
Thanks!
Chan Gao
Hi Chan, Thank you, I still get same error on windows and mac when calling dashboards
C02TK03SH03Y:IBM_CLI swatijoshi$ ./nr-cli get dashboards Response status code: 401. Get one page dashboards, pageCount ‘1’ Status code is not 2XX calling NewRelic REST
Hi @Swati365 ,
Sorry for late response.
I saw that the error you pasted was "status code: 401". I checked the newrelic REST API guide for dashboards, the 401 means that "Invalid API key", this is the doc link: https://rpm.newrelic.com/api/explore/dashboards/list
Can you please double check if your API key is valid?
How to get NewRelic API key, reference this link: https://docs.newrelic.com/docs/apis/getting-started/intro-apis/understand-new-relic-api-keys
Thanks! Chan Gao
Issues seen with windows version: get Users:
C:\swati\IBM_CLI>nr-windows-amd64.exe get users panic: reflect: call of reflect.Value.Interface on zero Value goroutine 1 [running]: reflect.valueInterface(0x0, 0x0, 0x0, 0x1, 0xc042228280, 0xc0422620c0) /Users/gaochan/Documents/zwork/software/Golang/go/src/reflect/value.go:9 reflect.Value.Interface(0x0, 0x0, 0x0, 0x1, 0x2) /Users/gaochan/Documents/zwork/software/Golang/go/src/reflect/value.go:9 github.com/IBM/newrelic-cli/utils.(*TablePrinter).Print(0xb982c8, 0x840420, 0xc0 /Users/gaochan/Documents/zwork/workspace-go/src/github.com/IBM/newrelic- github.com/IBM/newrelic-cli/cmd/get.glob..func16(0xb71540, 0xb982c8, 0x0, 0x0)
Get Dashboards: C:\swati\IBM_CLI>nr-windows-amd64.exe get dashboards Response status code: 401. Get one page dashboards, pageCount '1' Status code is not 2XX calling NewRelic REST
Get Alert Conditions C:\swati\IBM_CLI>nr-windows-amd64 get alertsconditions -t all -o json length of [flags] should be 1 instead of 0
C:\swati\IBM_CLI>nr-windows-amd64 get alertsconditions -t all length of [flags] should be 1 instead of 0
Get AlertsChannels
C:\swati\IBM_CLI>nr-windows-amd64 get alertschannels [WARNING] unsupported data format.