Skip to main content
  • Place orders quickly and easily
  • View orders and track your shipping status
  • Enjoy members-only rewards and discounts
  • Create and access a list of your products
  • Manage your Dell EMC sites, products, and product-level contacts using Company Administration.

PowerStore: REST API 세션 관리

Summary: 여러 REST API 쿼리에 전달할 토큰을 얻는 방법

This article may have been automatically translated. If you have any feedback regarding its quality, please let us know using the form at the bottom of this page.

Article Content


Instructions

새 로그인 세션 시작:
curl -k -s -X GET -H "Accept: application/json" -H "Content-type: application/json" -u admin -c mycookie.txt -verbose -L  https://10.20.30.40:443/api/rest/login_session


부분 출력이 여기에 표시됩니다. 비밀번호를 입력하라는 메시지가 표시됩니다.
curl -k -s -X GET -H "Accept: application/json" -H "Content-type: application/json" -u admin -c mycookie.txt -verbose -L  https://10.20.30.40:443/api/rest/login_session
Enter host password for user 'admin':
*   Trying 10.20.30.40...
* TCP_NODELAY set
* Connected to 10.20.30.40 (10.20.30.40) port 443 (#0)

. . . 
. . .

< HTTP/1.1 200 OK
< DELL-EMC-TOKEN: Zbn8/pfw/VhLXc+a9YQqtrp9cC0lUZKBPXKTl68KGNE=
< Content-Type: application/json

. . .
. . . 

* Connection #0 to host 10.20.30.40 left intact
[{"id":"fd406a0e-a82c-46d6-b31b-5bfa31a543ef"}]


또는 비밀번호를 대화형으로 전달할 수 있습니다.
curl -k -s -X GET -H "Accept: application/json" -H "Content-type: application/json" -u admin:password -c mycookie.txt -verbose -L  https://10.20.30.40:443/api/rest/login_session

위에서 얻은 토큰을 사용하여 쿠키 파일 이름을 일관되게 유지하면 이제 REST API 쿼리를 추가 인증 없이 단일 세션으로 실행할 수 있습니다.

 

참고: Windows용 curl을 사용하거나 jq가 설치되지 않은 경우 "| jq"를 이 예제에서 제거할 수 있습니다.
 

어플라이언스 세부 정보 나열

curl -k -s -X GET -H "DELL-EMC-TOKEN: Zbn8/pfw/VhLXc+a9YQqtrp9cC0lUZKBPXKTl68KGNE="  -H "Accept: application/json" -H "Content-type: application/json" -b mycookie.txt -L https://10.20.30.40:443/api/rest/appliance?select=* | jq
[
  {
    "id": "A1",
    "name": "PowerLoki-appliance-1",
    "service_tag": "ABC1234",
    "express_service_code": "123456789",
    "model": "PowerStore 7000T",
    "drive_failure_tolerance_level": "Single",
    "drive_failure_tolerance_level_l10n": "Single"
  }
]
 

로컬 사용자 나열

3개의 특정 열을 선택하려면 ?select=id,name,role_id를 사용합니다.
curl -k -s -X GET -H "accept: application/json" -H "Content-Type: application/json" -H "DELL-EMC-TOKEN: Zbn8/pfw/VhLXc+a9YQqtrp9cC0lUZKBPXKTl68KGNE=" -b mycookie.txt -L  https://10.20.30.40/api/rest/local_user?select=id,name,role_id | jq
 

IP 나열

모든 열을 선택하려면 와일드카드를 사용합니다.
curl -k -s -X GET -H "DELL-EMC-TOKEN: Zbn8/pfw/VhLXc+a9YQqtrp9cC0lUZKBPXKTl68KGNE="  -H "Accept: application/json" -H "Content-type: application/json" -b mycookie.txt -L https://10.20.30.40:443/api/rest/ip_pool_address?select=* | jq
 

메트릭 생성

이 예제는 POST 명령이며 수집할 메트릭을 지정하는 본문이 필요합니다. 다음 형식이 사용됩니다. -d '{ "entity": "performance_metrics_by_appliance", "entity_id": "A1", "interval": "Twenty_Sec"}':
curl -k -s -X POST -H "accept: application/json" -H "Content-Type: application/json" -H "DELL-EMC-TOKEN: Zbn8/pfw/VhLXc+a9YQqtrp9cC0lUZKBPXKTl68KGNE=" -b mycookie.txt -L -d '{ "entity": "performance_metrics_by_appliance", "entity_id": "A1", "interval": "Twenty_Sec"}' https://10.20.30.40/api/rest/metrics/generate

Additional Information

가능한 다른 활용 사례는 다음 문서를 참조하십시오.
Dell EMC PowerStore REST API 참조 가이드:
https://dl.dell.com/content/manual25792673-dell-emc-powerstore-rest-api-reference-guide.pdf

Dell EMC PowerStore REST API 개발자 가이드
https://dl.dell.com/content/manual55475248-dell-emc-powerstore-rest-api-developers-guide.pdf

그리고 swaggerui https://<PowerStore IP>/swaggerui/를 사용하는 기본 제공 문서

Article Properties


Affected Product

PowerStore 1000X, PowerStore 1000T, PowerStore 1200T, PowerStore 3000X, PowerStore 3000T, PowerStore 3200T, PowerStore 5000X, PowerStore 5000T, PowerStore 500T, PowerStore 5200T, PowerStore 7000X, PowerStore 7000T, PowerStore 9000T, PowerStore 9200T

Last Published Date

15 Dec 2022

Version

5

Article Type

How To