NetWorker: 명령줄 REST API JSON 응답을 사람이 읽을 수 있도록 하는 방법

Summary: 명령줄 REST API(Application Programming Interface) 응답은 구문 분석하기 어려울 수 있는 형식이 지정되지 않은 JSON으로 되어 있습니다. 이 KB는 REST API 응답을 "사람이 읽을 수 있는" 출력으로 포맷하는 방법을 제공합니다.

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

NetWorker REST(Representational State Transfer) API 호출은 Linux NetWorker 서버의 명령줄에서 curl 명령을 실행합니다. 예:

curl -k -u USERNAME:'PASSWORD' https://localhost:9090/nwrestapi/v3/global/RESTAPI-ENDPOINT
참고: USERNAME을 NetWorker 인증에 사용되는 사용자 계정으로 바꿉니다. PASSWORD를 제공된 사용자 계정의 암호로 바꿉니다. RESTAPI-ENDPOINT를 수행된 REST API 기능으로 바꿉니다. REST API 설명서는 다음을 통해 제공됩니다 . https://developer.dell.com/apis/2378/versions/v3/docs/GettingStarted.md.


GET 작업의 응답 페이로드는 JSON 형식입니다. 기본 응답은 일반적으로 한 번 연속된 라인이므로 구문 분석하기 어려울 수 있습니다. 예:

nve:~ # curl -k -u Administrator:'!Password1' https://localhost:9090/nwrestapi/v3/global
{"links":[{"href":"https://localhost:9090/nwrestapi/v3/global/alerts","title":"List of alert messages"},{"href":"https://localhost:9090/nwrestapi/v3/global/auditlogconfig","title":"Audit log configuration"},{"href":"https://localhost:9090/nwrestapi/v3/global/auditlogconfigs","title":"Audit log configurations"},{"href":"https://localhost:9090/nwrestapi/v3/global/backups","title":"List of backups"},{"href":"https://localhost:9090/nwrestapi/v3/global/clients","title":"List of clients"},{"href":"https://localhost:9090/nwrestapi/v3/global/cloudboostappliances","title":"List of cloudboost appliances"},{"href":"https://localhost:9090/nwrestapi/v3/global/datadomainsystems","title":"List of data domain systems"},{"href":"https://localhost:9090/nwrestapi/v3/global/dddevicereplication","title":"DD device replication"},{"href":"https://localhost:9090/nwrestapi/v3/global/devices","title":"List of storage devices"},{"href":"https://localhost:9090/nwrestapi/v3/global/directives","title":"List of backup directives"},{"href":"https://localhost:9090/nwrestapi/v3/global/inspect","title":"Inspect remote/local server"},{"href":"https://localhost:9090/nwrestapi/v3/global/jobgroups","title":"List of job groups"},{"href":"https://localhost:9090/nwrestapi/v3/global/jobindications","title":"List of job indications"},{"href":"https://localhost:9090/nwrestapi/v3/global/jobs","title":"List of jobs"},{"href":"https://localhost:9090/nwrestapi/v3/global/jukeboxes","title":"List of jukeboxes"},{"href":"https://localhost:9090/nwrestapi/v3/global/labels","title":"List of volume label templates"},{"href":"https://localhost:9090/nwrestapi/v3/global/licenseconfig","title":"Server license configuration"},{"href":"https://localhost:9090/nwrestapi/v3/global/licenses","title":"List of license templates"},{"href":"https://localhost:9090/nwrestapi/v3/global/lockbox","title":"Lockbox resource"},{"href":"https://localhost:9090/nwrestapi/v3/global/mediaconfig","title":"Server media configuration"},{"href":"https://localhost:9090/nwrestapi/v3/global/mobilestorageunits","title":"Mobile storage units"},{"href":"https://localhost:9090/nwrestapi/v3/global/nasdevices","title":"List of NAS devices"},{"href":"https://localhost:9090/nwrestapi/v3/global/notifications","title":"List of notification settings"},{"href":"https://localhost:9090/nwrestapi/v3/global/nsrcloneconfig","title":"NSR Clone Configuration"},{"href":"https://localhost:9090/nwrestapi/v3/global/pools","title":"List of pools"},{"href":"https://localhost:9090/nwrestapi/v3/global/probes","title":"List of probes"},{"href":"https://localhost:9090/nwrestapi/v3/global/protectiongroups","title":"List of protection groups"},{"href":"https://localhost:9090/nwrestapi/v3/global/protectionpolicies","title":"List of protection policies"},{"href":"https://localhost:9090/nwrestapi/v3/global/recoverapps","title":"List of recovery applications"},{"href":"https://localhost:9090/nwrestapi/v3/global/recovers","title":"List of recover resources"},{"href":"https://localhost:9090/nwrestapi/v3/global/rules","title":"List of rules"},{"href":"https://localhost:9090/nwrestapi/v3/global/schedules","title":"List of schedules"},{"href":"https://localhost:9090/nwrestapi/v3/global/securityconfig","title":"Server security configuration"},{"href":"https://localhost:9090/nwrestapi/v3/global/serverconfig","title":"Server configuration"},{"href":"https://localhost:9090/nwrestapi/v3/global/servermessages","title":"List of server messages"},{"href":"https://localhost:9090/nwrestapi/v3/global/serverstatistics","title":"Server statistics"},{"href":"https://localhost:9090/nwrestapi/v3/global/sessions","title":"List of save/recover sessions"},{"href":"https://localhost:9090/nwrestapi/v3/global/storagenodes","title":"List of storage nodes"},{"href":"https://localhost:9090/nwrestapi/v3/global/tenants","title":"Restricted data zone protection"},{"href":"https://localhost:9090/nwrestapi/v3/global/timepolicies","title":"List of Time Policies"},{"href":"https://localhost:9090/nwrestapi/v3/global/unconfiguredlibraries","title":"List of unconfigured libraries"},{"href":"https://localhost:9090/nwrestapi/v3/global/usergroups","title":"List of user groups"},{"href":"https://localhost:9090/nwrestapi/v3/global/vmware","title":"View of VMware objects"},{"href":"https://localhost:9090/nwrestapi/v3/global/volumes","title":"List of volumes"}]}

JSON 출력은 형식이 지정되지 않았으며 구문 분석하기 어려울 수 있습니다. 그러나 출력은 읽기 쉬운 "예쁜 인쇄" 형식으로 형식을 지정할 수 있습니다.

NVE(NetWorker Virtual Edition) 시스템의 경우 다음을 추가할 수 있습니다. python -m json.toolcurl 명령을 실행합니다. 예:

nve:~ # curl -k -u Administrator:'!Password1' https://localhost:9090/nwrestapi/v3/global | python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4374    0  4374    0     0   9751      0 --:--:-- --:--:-- --:--:--  9763
{
    "links": [
        {
            "href": "https://localhost:9090/nwrestapi/v3/global/alerts",
            "title": "List of alert messages"
        },
        {
            "href": "https://localhost:9090/nwrestapi/v3/global/auditlogconfig",
            "title": "Audit log configuration"
        },
        {
            "href": "https://localhost:9090/nwrestapi/v3/global/auditlogconfigs",
            "title": "Audit log configurations"
        },
        {
            "href": "https://localhost:9090/nwrestapi/v3/global/backups",
            "title": "List of backups"
        },
        {
            "href": "https://localhost:9090/nwrestapi/v3/global/clients",
            "title": "List of clients"
        },
        ******* Removed for brevity *******
    ]
}

다른 Linux 시스템의 경우 다음을 추가하여 이 작업을 수행할 수 있습니다. jqcurl 명령을 사용하여 수행됩니다.

[root@nsr ~]# curl -k -u Administrator:'!Password1' https://localhost:9090/nwrestapi/v3/global | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4258    0  4258    0     0   7253      0 --:--:-- --:--:-- --:--:--  7241
{
  "links": [
    {
      "href": "https://localhost:9090/nwrestapi/v3/global/alerts",
      "title": "List of alert messages"
    },
    {
      "href": "https://localhost:9090/nwrestapi/v3/global/auditlogconfig",
      "title": "Audit log configuration"
    },
    {
      "href": "https://localhost:9090/nwrestapi/v3/global/auditlogconfigs",
      "title": "Audit log configurations"
    },
    {
      "href": "https://localhost:9090/nwrestapi/v3/global/backups",
      "title": "List of backups"
    },
    {
      "href": "https://localhost:9090/nwrestapi/v3/global/clients",
      "title": "List of clients"
    },
    ******* Removed for brevity *******
  ]
}
참고: jq 는 NetWorker에 포함되어 있지 않으며 시스템에 설치할 수 있는 타사 유틸리티입니다. 시스템 관리자에게 문의하여 설치하십시오. jq 또는 원하는 대로 다른 JSON 형식 지정 유틸리티를 사용할 수 있습니다.

Windows 호스트의 경우 명령줄을 사용하여 이 작업을 수행하지 않을 수 있습니다. 이 작업은 일반적으로 PowerShell을 통해 수행되며, PowerShell에는 종종 스크립팅과 관련된 추가 기능이 필요합니다. 대부분의 Windows 기반 시스템은 Post-Man과 같은 사용자 인터페이스를 사용하여 REST API GET 요청의 형식을 지정합니다.

Additional Information

Affected Products

NetWorker

Products

NetWorker Family
Article Properties
Article Number: 000356014
Article Type: How To
Last Modified: 12 Aug 2025
Version:  1
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.