Lenovo XClarity Administrator REST API Guide · Summary of changes in the REST API The following...

908
Lenovo XClarity Administrator REST API Guide Version 1.3.2

Transcript of Lenovo XClarity Administrator REST API Guide · Summary of changes in the REST API The following...

  • Lenovo XClarity Administrator REST API Guide

    Version 1.3.2

  • Note

    Before using this information and the product it supports, read the general notices in the Lenovo XClarity Administrator online documentation.

    Twelfth Edition (August 2017)

    © Copyright Lenovo 2015, 2017. LIMITED AND RESTRICTED RIGHTS NOTICE: If data or software is delivered pursuant a General Services Administration “GSA” contract, use, reproduction, or disclosure is subject to restrictions set forth in Contract No. GS-35F-05925.

    http://sysmgt.lenovofiles.com/help/topic/com.lenovo.lxca.doc/notices.htmlhttp://sysmgt.lenovofiles.com/help/topic/com.lenovo.lxca.doc/notices.html

  • Contents

    Summary of changes in the REST API . . . . . . . . . . . . . . . . . . . vii

    Chapter 1. Lenovo XClarity Administrator REST APIs . . . . . . . . 1REST API authorization and authentication . . . . . 1REST API response codes . . . . . . . . . . . 1

    Chapter 2. Virtual appliance management . . . . . . . . . . . . . . . 3/aicc . . . . . . . . . . . . . . . . . . . . 3

    GET /aicc . . . . . . . . . . . . . . . . 3PUT /aicc . . . . . . . . . . . . . . . . 8

    /aicc/network/ipdisable . . . . . . . . . . . . 12GET /aicc/network/ipdisable . . . . . . . . 12PUT /aicc/network/ipdisable . . . . . . . . 13

    /aicc/network/host . . . . . . . . . . . . . 14GET /aicc/network/host . . . . . . . . . . 14PUT /aicc/network/host . . . . . . . . . . 15

    /aicc/network/interfaces/ . . . . . . 17GET /aicc/network/interfaces/ . . . 17PUT /aicc/network/interfaces/ . . . 19

    /aicc/network/routes . . . . . . . . . . . . . 21GET /aicc/network/routes . . . . . . . . . 21PUT /aicc/network/routes . . . . . . . . . 22

    /aicc/subscriptions . . . . . . . . . . . . . 24GET /aicc/subscriptions. . . . . . . . . . 24POST /aicc/subscriptions . . . . . . . . . 26

    /aicc/subscriptions/ . . . . . . . . . . . 29DELETE /aicc/subscriptions/ . . . . . . 29GET /aicc/subscriptions/ . . . . . . . 30

    Chapter 3. Discovery resources. . . . 33/csvRequest . . . . . . . . . . . . . . . . 33

    POST /csvRequest. . . . . . . . . . . . 33/csvRequest/jobs/ . . . . . . . . . . 35

    GET /csvRequest/jobs/ . . . . . . 35/discovery . . . . . . . . . . . . . . . . . 41

    GET /discovery . . . . . . . . . . . . . 42/discoverRequest . . . . . . . . . . . . . . 53

    POST /discoverRequest. . . . . . . . . . 53/discoverRequest/jobs/ . . . . . . . . 54

    GET /discoverRequest/jobs/ . . . . 54/manageRequest . . . . . . . . . . . . . . 61

    POST /manageRequest . . . . . . . . . . 61/manageRequest/jobs/ . . . . . . . . 65

    GET /manageRequest/jobs/. . . . . 65/unmanageRequest . . . . . . . . . . . . . 68

    POST /unmanageRequest . . . . . . . . . 68/unmanageRequest/jobs/ . . . . . . . 70

    GET /unmanageRequest/jobs/. . . . 70

    Chapter 4. Inventory resources . . . . 75/canisters . . . . . . . . . . . . . . . . . 75

    GET /canisters . . . . . . . . . . . . . 75/canisters/. . . . . . . . . . . . . . 78

    GET /canisters/ . . . . . . . . . . 79PUT /canisters/ . . . . . . . . . . 87

    /chassis . . . . . . . . . . . . . . . . . . 91GET /chassis . . . . . . . . . . . . . . 91

    /chassis/ . . . . . . . . . . . . . . 117GET /chassis/ . . . . . . . . . 117PUT /chassis/ . . . . . . . . . . 148

    /cmms . . . . . . . . . . . . . . . . . . 153GET /cmms . . . . . . . . . . . . . . 153

    /cmms/ . . . . . . . . . . . . . . . 156GET /cmms/ . . . . . . . . . . . 156PUT /cmms/ . . . . . . . . . . . 163

    /fans . . . . . . . . . . . . . . . . . . . 166GET /fans . . . . . . . . . . . . . . . 166

    /fans/ . . . . . . . . . . . . . . . 168GET /fans/ . . . . . . . . . . . . 168

    /fanMuxes . . . . . . . . . . . . . . . . . 172GET /fanMuxes . . . . . . . . . . . . . 172

    /fanMuxes/ . . . . . . . . . . . . . 174GET /fanMuxes/ . . . . . . . . . 174

    /nodes . . . . . . . . . . . . . . . . . . 177GET /nodes . . . . . . . . . . . . . . 177

    /nodes/ . . . . . . . . . . . . . . . 193GET /nodes/ . . . . . . . . . 193PUT /nodes/ . . . . . . . . . . . 229

    /nodes//bmc. . . . . . . . . . . . . 237PUT /nodes//bmc . . . . . . . . . 237

    /powerSupplies . . . . . . . . . . . . . . . 238GET /powerSupplies . . . . . . . . . . . 239

    /powerSupplies/ . . . . . . . . . . . 240GET /powerSupplies/ . . . . . . . 241

    /scalableComplex . . . . . . . . . . . . . . 244GET /scalableComplex . . . . . . . . . . 244

    /scalableComplex/ . . . . . . . . . . 256GET /scalableComplex/ . . . . . . 256

    /storage . . . . . . . . . . . . . . . . . . 268GET /storage . . . . . . . . . . . . . . 268

    © Copyright Lenovo 2015, 2017 i

  • /storage/ . . . . . . . . . . . . . . 275GET /storage/ . . . . . . . . . 275PUT /storage/ . . . . . . . . . . 287

    /storage// . . . . . . . . . 289PUT /storage// . . . . . 289

    /switch . . . . . . . . . . . . . . . . . . 291GET /switch . . . . . . . . . . . . . . 291

    /switch/. . . . . . . . . . . . . . . 295GET /switch/ . . . . . . . . . . . 295PUT /switch/ . . . . . . . . . . . 304

    /switches . . . . . . . . . . . . . . . . . 308GET /switches . . . . . . . . . . . . . 309

    /switches/ . . . . . . . . . . . . . . 312GET /switches/ . . . . . . . . 312PUT /switches/ . . . . . . . . . . 321

    /switches//ports . . . . . . . . . . . 326GET /switches//ports . . . . . . . 326

    Chapter 5. Configuration Patterns resources . . . . . . . . . . . . . . . 333/config/target/ . . . . . . . . . . . . . 333

    GET /config/target/ . . . . . . . . . . 333/patterns . . . . . . . . . . . . . . . . . 337

    GET /patterns . . . . . . . . . . . . . . 337POST /patterns . . . . . . . . . . . . . 338

    /patterns/ . . . . . . . . . . . . . . . 364GET /patterns/. . . . . . . . . . . . 364POST /patterns/ . . . . . . . . . . . 366

    /patterns//includeSettings . . . . . . . . . 369GET /patterns//includeSettings . . . . . 369

    /profiles . . . . . . . . . . . . . . . . . . 378GET /profiles . . . . . . . . . . . . . . 378

    /profiles/ . . . . . . . . . . . . . . . . 380GET /profiles/ . . . . . . . . . . . . 380PUT /profiles/ . . . . . . . . . . . . 382POST /profiles/ . . . . . . . . . . . 383DELETE /profiles/ . . . . . . . . . . 384

    /profiles/unassign/ . . . . . . . . . . . . 385POST /profiles/unassign/ . . . . . . . 385

    Chapter 6. Operating-system deployment resources . . . . . . . . . 389/hostPlatforms . . . . . . . . . . . . . . . 389

    GET /hostPlatforms . . . . . . . . . . . 389PUT /hostPlatforms . . . . . . . . . . . 407

    /osdeployment/globalSettings . . . . . . . . . 411GET /osdeployment/globalSettings . . . . . 411PUT /osdeployment/globalSettings . . . . . 414

    /osImages . . . . . . . . . . . . . . . . . 417GET /osImages . . . . . . . . . . . . . 418

    POST /osImages . . . . . . . . . . . . 425/osImages/ . . . . . . . . . . . . 427

    GET /osImages/ . . . . . . . . 428/osImages/ . . . . . . . . . . . . . . . 428

    GET /osImages/ . . . . . . . . . . . 428PUT /osImages/ . . . . . . . . . . . 430POST /osImages/ . . . . . . . . . . 434DELETE /osImages/,,... . . . . 436

    /osImages?jobId= . . . . . . . . . . 437POST /osImages?jobId= . . . . . . 437

    /osImages/remoteFileServers . . . . . . . . . 440GET /osImages/remoteFileServers . . . . . 440POST /osImages/remoteFileServers . . . . . 442

    /osImages/remoteFileServers/ . . . . . . . 444GET /osImages/remoteFileServers/ . . . 445DELETE /osImages/remoteFileServers/ . . . . . . . . . . . . . . . . . 446PUT /osImages/remoteFileServers/ . . . 447

    Chapter 7. Firmware update resources . . . . . . . . . . . . . . . 451/compliancePolicies . . . . . . . . . . . . . 451

    GET /compliancePolicies . . . . . . . . . 451DELETE /compliancePolicies . . . . . . . . 455

    /compliancePolicies/applicableFirmware . . . . . 457GET /compliancePolicies/ applicableFirmware . . . . . . . . . . . 457

    /compliancePolicies/compareResult. . . . . . . 459GET /compliancePolicies/compareResult . . . 459POST /compliancePolicies/compareResult . . 461

    /compliancePolicies/persistedResult . . . . . . 463GET /compliancePolicies/persistedResult . . . 463

    /updateRepositories/firmware . . . . . . . . . 470GET /updateRepositories/firmware . . . . . 470PUT /updateRepositories/firmware . . . . . 476

    /updatableComponents . . . . . . . . . . . 479GET /updatableComponents . . . . . . . . 479PUT /updatableComponents . . . . . . . . 490

    Chapter 8. Management-server update resources . . . . . . . . . . . 497/managementServer/updates . . . . . . . . . 497

    GET /managementServer/updates. . . . . . 497PUT /managementServer/updates. . . . . . 500POST /managementServer/updates . . . . . 502

    /managementServer/updates?action= import&jobid={id} . . . . . . . . . . . . . . 504

    POST /managementServer/updates?action= import&jobid= . . . . . . . . . . 504

    /managementServer/updates/ . . . . . . 506

    ii Lenovo XClarity Administrator REST API Guide

  • GET /managementServer/updates/, ,… . . . . . . . . . . . . 507DELETE /managementServer/updates/,,… . . . . . . . . . . 511

    Chapter 9. Monitoring and event resources . . . . . . . . . . . . . . . 515Filtering events . . . . . . . . . . . . . . . 515/events . . . . . . . . . . . . . . . . . . 518

    GET /events . . . . . . . . . . . . . . 518/events/audit . . . . . . . . . . . . . . . . 524

    GET /events/audit . . . . . . . . . . . . 524/events/actions . . . . . . . . . . . . . . . 530

    GET /events/actions . . . . . . . . . . . 530POST /events/actions . . . . . . . . . . 531

    /events/actions/ . . . . . . . . 533DELETE /events/actions/ . . . 533GET /events/actions/ . . . . . 533

    /events/activeAlerts . . . . . . . . . . . . . 535GET /events/activeAlerts . . . . . . . . . 535

    /events/activeAlerts/. . . . . . . . . . 537GET /events/activeAlerts/ . . . . . . 537

    /events/activeAlerts/status . . . . . . . . . . 540GET /events/activeAlerts/status. . . . . . . 540

    /events/activeAlerts/status/ . . . . . . . 542GET /events/activeAlerts/status/ . . . 542

    /events/activeAlerts/summary . . . . . . . . . 543GET /events/activeAlerts/summary . . . . . 543

    /events/activeAlerts/summary/. . . . . . 545GET /events/activeAlerts/summary/ . . . . . . . . . . . . . . . . 545

    /events/config . . . . . . . . . . . . . . . 546GET /events/config. . . . . . . . . . . . 546PUT /events/config. . . . . . . . . . . . 547

    /events/csv/auditLog. . . . . . . . . . . . . 548GET /events/csv/auditLog . . . . . . . . . 548

    /events/csv/eventLog . . . . . . . . . . . . 553GET /events/csv/eventLog. . . . . . . . . 553

    /events/csv/eventsLogs . . . . . . . . . . . 557GET /events/csv/eventsLogs . . . . . . . . 557

    /events/exclusionfilters . . . . . . . . . . . . 561GET /events/exclusionfilters . . . . . . . . 561POST /events/exclusionfilters . . . . . . . 563PUT /events/exclusionfilters . . . . . . . . 564

    /events/exclusionfilters/ . . . . . . . 565DELETE /events/exclusionfilters/ . . 566

    /events/helptext/ . . . . . . 566GET /events/helptext/ . . . . . . . . . . . . . . . . 566

    /events/monitors . . . . . . . . . . . . . . 567GET /events/monitors . . . . . . . . . . 567

    POST /events/monitors . . . . . . . . . . 571PUT /events/monitors . . . . . . . . . . 575

    /events/monitors/ . . . . . . . . . 576DELETE /events/monitors/ . . . 576

    /events/notifications . . . . . . . . . . . . . 577GET /events/notifications . . . . . . . . . 577POST /events/notifications . . . . . . . . 581

    /events/notifications/. . . . . . . 583GET /events/notifications/ . . . 583

    /events/notifications// subscriptions . . . . . . . . . . . . . . . . 584

    GET /events/notifications// subscriptions . . . . . . . . . . . . . . 584POST /events/notifications// subscriptions . . . . . . . . . . . . . . 588DELETE /events/notifications// subscriptions . . . . . . . . . . . . . . 591

    /events/notifications// subscriptions/ . . . . . . . . 591

    GET /events/notifications// subscriptions/ . . . . . . 592DELETE /events/notifications// subscriptions/ . . . . . . 595

    /events/notifications// subscriptions//filters. . . . . . 596

    GET /events/notifications// subscriptions//filters . . . . 596POST /events/notifications// subscriptions//filters . . . . 598DELETE /events/notifications// subscriptions//filters . . . . 600

    /events/notifications// subscriptions//filters/ . . . . . . . . . . . . . . . . . . 601

    GET /events/notifications// subscriptions//filters/ . . . . . . . . . . . . . . . . 602DELETE /events/notifications// subscriptions//filters/. . . . . . . . . . . . . . . . . . 604

    /events/notifications/subscriptions . . . . . . . 605GET /events/notifications/subscriptions . . . 605PUT /events/notifications/subscriptions . . . 609DELETE /events/notifications/ subscriptions . . . . . . . . . . . . . . 611

    /events/notifications/subscriptions/ . . . . . . . . . . . . . . . . . . . . 612

    GET /events/notifications/subscriptions/ . . . . . . . . . . . . 612DELETE /events/notifications/subscriptions/ . . . . . . . . . . . . 615

    /events/notifications/subscriptions//filters . . . . . . . . . . . . . . . . . 616

    GET /events/notifications/subscriptions/ /filters . . . . . . . . . 616

    © Copyright Lenovo 2015, 2017 iii

  • PUT /events/notifications/subscriptions/ /filters . . . . . . . . . 618DELETE /events/notifications/subscriptions/ /filters . . . . . . . . . 620

    /events/notifications/subscriptions//filters/ . . . . . . . . . . . 621

    GET /events/notifications/subscriptions/ /filters/ . . . . 621DELETE /events/notifications/subscriptions/ /filters/ . . . . . 623

    /events/predefinedFilters . . . . . . . . . . . 624GET /events/predefinedFilters . . . . . . . 624PUT /events/predefinedFilters . . . . . . . 626POST /events/predefinedFilters . . . . . . . 628DELETE /events/predefinedFilters . . . . . . 630

    /events/predefinedFilters/ . . . . . . 630DELETE /events/predefinedFilters/. . . . . . . . . . . . . . . . . . 630

    /events/snmp/mib . . . . . . . . . . . . . . 631GET /events/snmp/mib . . . . . . . . . . 631

    Chapter 10. Job management resources . . . . . . . . . . . . . . . 633/tasks. . . . . . . . . . . . . . . . . . . 633

    GET /tasks . . . . . . . . . . . . . . . 633PUT /tasks . . . . . . . . . . . . . . . 640

    /tasks/ . . . . . . . . . . . . . . 641GET /tasks/ . . . . . . . . . . . 641PUT /tasks/ . . . . . . . . . . . 649DELETE /tasks/ . . . . . . . . . 650

    /tasks/detail . . . . . . . . . . . . . . . . 651GET /tasks/detail . . . . . . . . . . . . 651

    /actions . . . . . . . . . . . . . . . . . . 657GET /actions . . . . . . . . . . . . . . 657

    /actions/ . . . . . . . . . . . . . . 660GET /actions/ . . . . . . . . . . 660

    /jobs . . . . . . . . . . . . . . . . . . . 663GET /jobs . . . . . . . . . . . . . . . 663

    /jobs/ . . . . . . . . . . . . . . . 668GET /jobs/ . . . . . . . . . . . 668DELETE /jobs/ . . . . . . . . . . 676PUT /jobs/ . . . . . . . . . . . 676

    /jobs/lock . . . . . . . . . . . . . . . . . 677GET /jobs/lock . . . . . . . . . . . . . 677

    Chapter 11. Security resources . . . . 679/certificateRevocationList . . . . . . . . . . . 679

    GET /certificateRevocationList . . . . . . . 679POST /certificateRevocationList . . . . . . 681

    /certificateRevocationList/ . . . . . . 682GET /certificateRevocationList/CRL_id> . . . 682

    DELETE /certificateRevocationList/ . . . . . . . . . . . . . . . . . . 684

    /certificateSettings . . . . . . . . . . . . . 685GET /certificateSettings . . . . . . . . . . 685

    /certificateSigningRequest . . . . . . . . . . 687GET /certificateSigningRequest . . . . . . . 687POST /certificateSigningRequest . . . . . . 689DELETE /certificateSigningRequest . . . . . 691

    /cryptoSettings . . . . . . . . . . . . . . . 693GET /cryptoSettings . . . . . . . . . . . 693PUT /cryptoSettings . . . . . . . . . . . 695

    /cryptoSettings/jobs . . . . . . . . . . . . . 699GET /cryptoSettings/jobs . . . . . . . . . 699

    /cryptoSettings/jobs/ . . . . . . . . . 704GET /cryptoSettings/jobs/ . . . . . 704

    /encapsulationSettings . . . . . . . . . . . . 708GET /encapsulationSettings . . . . . . . . 709PUT /encapsulationSettings . . . . . . . . 710

    /endpoint/signingCertificate// . . . 711GET /endpoint/signingCertificate// . . . . . . . . . . . . . . . 711PUT /endpoint/signingCertificate// . . . . . . . . . . . . . . . 716

    /ldapClientSettings . . . . . . . . . . . . . 718GET /ldapClientSettings. . . . . . . . . . 718PUT /ldapClientSettings. . . . . . . . . . 722

    /roles . . . . . . . . . . . . . . . . . . . 727GET /roles . . . . . . . . . . . . . . . 727

    /roles/ . . . . . . . . . . . . . . . 729GET /roles/ . . . . . . . . . . . 729

    /roleGroups . . . . . . . . . . . . . . . . 731GET /roleGroups . . . . . . . . . . . . 731POST /roleGroups . . . . . . . . . . . . 734

    /roleGroups/ . . . . . . . . . . . . . . 737PUT /roleGroups/ . . . . . . . . . . 737

    /roleGroups/ . . . . . . . . . . . . . 738GET /roleGroups/ . . . . . . . . . 738DELETE /roleGroups/ . . . . . . . 741

    /ssoSettings . . . . . . . . . . . . . . . . 742GET /ssoSettings . . . . . . . . . . . . 743PUT /ssoSettings . . . . . . . . . . . . 744

    /serverCertificate . . . . . . . . . . . . . . 746GET /serverCertificate . . . . . . . . . . 747POST /serverCertificate . . . . . . . . . . 748PUT /serverCertificate . . . . . . . . . . 752

    /serverCertificate/details . . . . . . . . . . . 754GET /serverCertificate/details . . . . . . . 754

    /serverCertificate/jobs . . . . . . . . . . . . 757GET /serverCertificate/jobs . . . . . . . . 757

    /serverCertificate/jobs/ . . . . . . . . 760

    iv Lenovo XClarity Administrator REST API Guide

  • GET /serverCertificate/jobs/. . . . . 760/sessions . . . . . . . . . . . . . . . . . 763

    GET /sessions . . . . . . . . . . . . . 763POST /sessions . . . . . . . . . . . . . 765DELETE /sessions . . . . . . . . . . . . 766

    /sessions/ . . . . . . . . . . . . . . 768DELETE /sessions/ . . . . . . . . 768

    /signingCertificate . . . . . . . . . . . . . . 769GET /signingCertificate . . . . . . . . . . 769PUT /signingCertificate . . . . . . . . . . 770

    /signingCertificate/details . . . . . . . . . . . 772GET /signingCertificate/details . . . . . . . 772

    /signingCertificate/jobs . . . . . . . . . . . . 774GET /signingCertificate/jobs . . . . . . . . 774

    /signingCertificate/jobs/ . . . . . . . . 777GET /signingCertificate/jobs/ . . . . 777

    /trustedCertificates . . . . . . . . . . . . . 780GET /trustedCertificates. . . . . . . . . . 781POST /trustedCertificates . . . . . . . . . 782

    /trustedCertificates/ . . . . . . . . . . . 784GET /trustedCertificates/ . . . . . . . 784DELETE /trustedCertificates/ . . . . . . 785

    /trustedCertificates/details . . . . . . . . . . 787GET /trustedCertificates/details . . . . . . . 787

    /trustedCertificates/details/ . . . . . . . . 789GET /trustedCertificates/details/ . . . . 789

    /userAccounts . . . . . . . . . . . . . . . 791GET /userAccounts . . . . . . . . . . . 791POST /userAccounts . . . . . . . . . . . 794

    /userAccounts/ . . . . . . . . . . . . . 799GET /userAccounts/ . . . . . . . . . 799PUT /userAccounts/ . . . . . . . . . 802DELETE /userAccounts/ . . . . . . . . 804

    /userAccounts/passwordChange . . . . . . . . 805PUT /userAccounts// passwordChange . . . . . . . . . . . . 805

    /userAccountSettings . . . . . . . . . . . . 807GET /userAccountSettings. . . . . . . . . 807PUT /userAccountSettings. . . . . . . . . 809

    Chapter 12. Service and support resources . . . . . . . . . . . . . . . 815/callhome/endpoints . . . . . . . . . . . . . 815

    GET /callhome/endpoints . . . . . . . . . 815/callhome/endPointContact/ . . . . . . 816

    GET /callhome/endPointContact/ . . . 816POST /callhome/endPointContact/ . . . . . . . . . . . . . . . . 817DELETE /callhome/endPointContact/ . . . . . . . . . . . . . . . . 818

    /callhome/endPointsPMR . . . . . . . . . . . 819

    GET /callhome/endPointsPMR . . . . . . . 819DELETE /callhome/endPointsPMR . . . . . 820

    /callhome/endPointsPMR/ . . . . . . 822GET /callhome/endPointsPMR/ . . . . . . . . . . . . . . . . . 822

    /callhome/endPointsPMRStatus . . . . . . . . 823GET /callhome/endPointsPMRStatus . . . . 823

    /callhome/endPoints/list . . . . . . . . . . . 827GET /callhome/endPoints/list. . . . . . . . 827

    /callhome/pmrattach/ . . . . . . . . 828POST /callhome/pmrattach/ . . . . 828

    /ffdc/endpoint/ . . . . . . . . . . . . 830GET /ffdc/endpoint/ . . . . . . . . 830

    /warranty . . . . . . . . . . . . . . . . . 832GET /warranty . . . . . . . . . . . . . 832PUT /warranty . . . . . . . . . . . . . 832

    Chapter 13. Energy metrics . . . . . . 835/canisters/metrics . . . . . . . . . . . . . . 835

    GET /canisters/metrics . . . . . . . . . . 835/canisters/metrics/ . . . . . . . . . . 839

    GET /canisters/metrics/ . . . . . . 839/chassis/metrics . . . . . . . . . . . . . . 843

    GET /chassis/metrics . . . . . . . . . . . 843/chassis/metrics/ . . . . . . . . . . . 846

    GET /chassis/metrics/ . . . . . . . 847/fans/metrics . . . . . . . . . . . . . . . . 850

    GET /fans/metrics . . . . . . . . . . . . 851/fans/metrics/ . . . . . . . . . . . . 852

    GET /fans/metrics/ . . . . . . . . 852/nodes/metrics . . . . . . . . . . . . . . . 854

    GET /nodes/metrics . . . . . . . . . . . 855/nodes/metrics/ . . . . . . . . . . . 862

    GET /nodes/metrics/ . . . . . . . . 862/powerSupplies/metrics . . . . . . . . . . . 868

    GET /powerSupplies/metrics . . . . . . . . 868/powerSupplies/metrics/ . . . . . . . . 870

    GET /powerSupplies/metrics/ . . . . 870/switch/metrics . . . . . . . . . . . . . . . 873

    GET /switch/metrics . . . . . . . . . . . 873/switch/metrics/ . . . . . . . . . . . 875

    GET /switch/metrics/. . . . . . . . 875/switches/metrics . . . . . . . . . . . . . . 877

    GET /switches/metrics . . . . . . . . . . 877/switches/metrics/ . . . . . . . . . . 879

    GET /switches/metrics/ . . . . . . . 879

    Appendix A. Notices. . . . . . . . . . 883Trademarks . . . . . . . . . . . . . . . . 884

    Index . . . . . . . . . . . . . . . . . . 885

    © Copyright Lenovo 2015, 2017 v

  • vi Lenovo XClarity Administrator REST API Guide

  • Summary of changes in the REST API

    The following REST APIs were added or updated in follow-on releases of Lenovo XClarity Administrator.

    Version 1.3.2

    The are no enhancements to the Open REST API in this version.

    Version 1.3.1

    This version supports the following enhancements to the Open REST API.

    • Inventory resources

    – “GET /nodes” on page 177 and “GET /nodes/” on page 193. Added the FeaturesOnDemand response parameter to return information about tier levels and features. Added the m2Presence response parameters to return information about whether the node contains M.2 storage.

    Note: Support for Flex System storage devices will be deprecated from these APIs at a future date. Use the “GET /storage” on page 268 method instead.

    • Operating-system deployment resources

    – “GET /hostPlatforms” on page 389. Added the mgmtProcType response parameter to identify the type of baseboard management controller in the node. Add the remoteControl response parameter to indicate the remote control enablement status. Added “M.2drives” as a new value for the storageSetting > label and the storageSetting > value response parameters to support deploying operating systems on M.2 drives.

    – “PUT /hostPlatforms” on page 407. Added “M.2drives” as a new value for the storageSetting targetDevice request parameter to support deploying operating systems on M.2 drives. Added the windowsDomainBlob to specify the Active Directory Computer Account Metadata (in Base-64 encoded blob format) that can be used to join the Active Directory domain for any Windows operating system.

    • Firmware update resources

    – “PUT /updateRepositories/firmware” on page 476. Added the filetypes=all query parameter to delete the selected update packages (payload, change history, readme, and metadata files) instead of only the payload (image) files.

    • Security resources

    – “GET /ldapClientSettings” on page 718. Added the useServersAsGlobalCatalogs response parameter to indicate whether domain controllers are treated as global catalogs

    – “PUT /ldapClientSettings” on page 722. Added the useServersAsGlobalCatalogs request parameter to specify whether to treat domain controllers as global catalogs.

    Version 1.3.0

    This version supports the following enhancements to the Open REST API.• The following methods were added or updated:

    – Discovery resources– “POST /manageRequest” on page 61. Supports specifying a fully-qualified domain name in the

    ipAddresses request parameter.– Inventory resources

    – “GET /nodes” on page 177 and “GET /nodes/” on page 193. Added the FeaturesOnDemand response parameter to return information about tier levels and features.

    © Copyright Lenovo 2015, 2017 vii

  • – (New) “PUT /nodes//bmc” on page 237. Restarts the baseboard management controller for a specific managed server.

    – “GET /switches” on page 309 and “GET /switches/” on page 312. Added the OS response parameter to return information about the operating system that is installed on the RackSwitch switch (ENOS or CNOS).

    – “GET /switches/” on page 312. Added the ntp response parameter to identify the NTP settings .

    – Monitoring and event resources– (New) “GET /events/notifications” on page 577. Retrieves configuration and subscription

    information for all push notification services.– (New) “POST /events/notifications” on page 581. Generates a test event that pushes to a specific

    push notification service or subscription.– (New) “GET /events/notifications/” on page 583. Retrieves information about a

    specific push notification service.– (New) “GET /events/notifications//subscriptions” on page 584. Retrieves information

    about all subscriptions for a specific push notification service.– (New) “POST /events/notifications//subscriptions” on page 588. Modifies a

    subscription that is used to forward events to mobile devices or WebSocket service.– (New) “DELETE /events/notifications//subscriptions” on page 591. Deletes all

    subscriptions for a specific push notification service.– (New) “GET /events/notifications//subscriptions/” on page 592.

    Retrieves information about a specific subscription for a specific push notification service.– (New) “DELETE /events/notifications//subscriptions/” on page 595.

    Deletes a specific subscription.– (New) “GET /events/notifications//subscriptions//filters” on page

    596. Retrieves information about all event filters that are associated with a specific push notification service.

    – (New) “POST /events/notifications//subscriptions//filters” on page 598. Creates an event filter for a specific subscription.

    – (New) “DELETE /events/notifications//subscriptions//filters” on page 600. Deletes all event filters for a specific subscription.

    – (New) “GET /events/notifications//subscriptions//filters/” on page 602. Retrieves information about a specific event filter that is associated with a specific subscription.

    – “DELETE /events/notifications//subscriptions//filters/” on page 604. Deletes one or more event filters from a specific subscription.

    – (New) “GET /events/notifications/subscriptions” on page 605. Retrieve information about all subscriptions.

    – (New) “DELETE /events/notifications/subscriptions” on page 611. Deletes all subscriptions for all push notification services.

    – (New) “GET /events/notifications/subscriptions/” on page 612. Retrieves information about a specific subscription.

    – (New) “DELETE /events/notifications/subscriptions/” on page 615. Deletes a specific subscription.

    – (New) “GET /events/notifications/subscriptions//filters” on page 616. Retrieves information about all event filters that are associated with a specific subscription.

    – (New) “DELETE /events/notifications/subscriptions//filters” on page 620. Deletes all event filters for a specific subscription.

    – (New) “GET /events/notifications/subscriptions//filters/” on page 621. Retrieves information about a specific event filter that is associated with a specific subscription .

    – (New) “DELETE /events/notifications/subscriptions//filters/” on page 623. Deletes one or more event filters from a specific subscription.

    – (New) “POST /events/predefinedFilters” on page 628. Creates a predefined event filter.– (New) “DELETE /events/predefinedFilters” on page 630. Deletes all predefined event filters.

    viii Lenovo XClarity Administrator REST API Guide

  • – (New) “DELETE /events/predefinedFilters/” on page 630. Deletes one or more predefined event filters.

    – (New) “GET /events/snmp/mib” on page 631. Download the management information base (MIB) file, whicih describes the SNMP traps that Lenovo XClarity Administrator generates.

    – Job management resources– “GET /tasks” on page 633. Added the following states to the stateIconKey and status response

    parameters: Complete_With_Errors, Unknown, Uploading, and Validating.– (New) “GET /tasks/” on page 641. Retrieves information about one or more jobs (tasks).

    You can specify multiple job IDs, separated by a comma, in the URL.– (New) “PUT /tasks/” on page 649. Cancels one or more jobs (tasks). You can specify

    multiple job IDs, separated by a comma, in the URL.– “DELETE /tasks/” on page 650. Deletes one or more jobs (tasks). You can specify

    multiple job IDs, separated by a comma, in the URL.– Configuration Pattern resources

    – (New) “PUT /profiles/” on page 382. Modifies the name of an existing server profile.– Operating-system deployment resources

    – “GET /hostPlatforms” on page 389. Added the mgmtProcType response parameter to identify the type of baseboard management controller in the node. Add the remoteControl response parameter to indicate the remote control enablement status.

    – “GET /osdeployment/globalSettings” on page 411. Added the “staticv6” as a new value for the ipAssignment response parameter to support static IPv6 addresses for the host network setting option for OS deployment.

    – “PUT /osdeployment/globalSettings” on page 414. Added the “staticv6” as a new value for the ipAssignment response parameter to support static IPv6 addresses for the host network setting option for OS deployment.

    – “GET /osImages” on page 418. Added the lastRefreshed, response parameter to return the timestamp of the last predefined OS-image repository refresh. Added the bootFiles, driverFiles, customizationOptions, and unattendFiles response parameters to return information about custom OS image profiles. Added the bootFileDiskUsage response parameter to return information about the disk space that is used by the boot files (such as WinPE).

    Attention: The drivers response body parameter and its child parameters are deprecated in this release.

    – “POST /osImages” on page 425. Changed the fileSize request parameter to be required. Added the imageType=DUD query parameter to import a device driver. Added the imageType=BOOT query parameter to import a boot-options file (such as a Windows .WIM file). Added the imageType=OSPROFILE query parameter to import a customized OS image profile.

    – (New) “GET /osImages/” on page 428. Exports (downloads) a customized OS-image profile to a remote image server or local system.

    – (New) “GET /osImages/” on page 428. Creates a downloadable tar.gz file that contains a customized OS-image profile.

    – (New) “PUT /osImages/” on page 430. Modifies a base operating system or customized OS image profile.

    – (New) “POST /osImages/” on page 434. Creates a customized OS-image profile from a base operating system.

    – “DELETE /osImages/,,...” on page 436. Supports removing boot-option files, device drivers, and customized OS-image profiles

    – “POST /osImages?jobId=” on page 437. Added the imageType=DUD query parameter to import a device driver. Added the imageType=BOOT query parameter to import a boot-options file (such as a Windows .WIM file). Added the imageType=OSPROFILE query parameter to import a customized OS-image profile.

    Attention: The imageName query parameter is deprecated in this release.– (New) “GET /osImages/remoteFileServers” on page 440. Retrieves information about all remote file-

    server profiles.

    © Copyright Lenovo 2015, 2017 ix

  • – (New) “POST /osImages/remoteFileServers” on page 442. Creates or modifies a remote file-server profile.

    – (New) “GET /osImages/remoteFileServers/” on page 445. Retrieves information about a specific remote file-server profile.

    – (New) “DELETE /osImages/remoteFileServers/” on page 446. Deletes a specific remote file- server profile.

    – Firmware update resources:– “POST /compliancePolicies/compareResult” on page 461. The “xITE” value for the type request

    parameter is deprecated. Use “Server” instead.– “GET /compliancePolicies/persistedResult” on page 463. The “xITE” value for the type query

    parameter is deprecated. Use “Server” instead.– “PUT /updatableComponents” on page 490. Added the action=powerState query parameter to

    modify the power state for a device, and the powerState request parameter to specify which power operation to perform.

    – “GET /updateRepositories/firmware” on page 470. Added the key=isUpdating query parameter and isUpdating response parameter to return the whether the firmware repository is being updated.

    – Security resources– “GET /cryptoSettings” on page 693. Added the minTlsVersionClient response parameter to set

    the minimum TLS protocol version to use for client connections to other servers (such as the LDAP client). Added the minTlsVersionOsDeployquery response parameter to set the minimum TLS protocol version for the Lenovo XClarity Administrator OS deployment server. Added the minTlsVersionServer response parameter to set the minimum TLS protocol version to use for server connections to other servers (such as the web server).

    The cipherSuite response parameter will be deprecated in a future release.

    The “nist800-131a-flexcat” value for the nistMode response parameter will be deprecated in a future release.

    – “PUT /cryptoSettings” on page 695. Added the minTlsVersionClient request parameter to set the minimum TLS protocol version to use for client connections to other servers (such as the LDAP client). Added the minTlsVersionOsDeployqueryrequest parameter to set the minimum TLS protocol version to for the Lenovo XClarity Administrator OS deployment server. Added the minTlsVersionServer request parameter to set the minimum TLS protocol version to use for server connections to other servers (such as the web server).

    Attention: • The cipherSuite request parameter will be deprecated in a future release. • The “nist800-131a-flexcat” value for the nistMode request parameter will be deprecated in a

    future release.– Service and support resources

    – (New) “GET /warranty” on page 832. Refreshes the warranty information on the management server.– (New) “PUT /warranty” on page 832. Downloads the warranty data as a .JSON or .CSV file.

    Version 1.2.2

    This version supports the following enhancements to the Open REST API.• The following REST APIs were added or updated:

    – Operating-system deployment resources– “GET /osImages” on page 418. Added the diskUsage response parameter to return the space that

    is used by the operating-system image, device drivers, and boot files. – Inventory resources

    – “GET /nodes/” on page 193. Added physicalPorts object under the portInfo response parameter, which provides firmware information for about the physical ports. Added logicalPortIndex and physicalPortIndex integers under the physicalPorts response parameter, which provides the number of logical and physical ports.

    – Management-server update resources

    x Lenovo XClarity Administrator REST API Guide

  • – (New) “GET /managementServer/updates” on page 497. Retrieves information about all updates in the management-server updates repository.

    – (New) “PUT /managementServer/updates” on page 500. Installs an update to the management server.

    – (New) “POST /managementServer/updates” on page 502. Manages management-server updates in the updates repository.

    – (New) “GET /managementServer/updates/,,…” on page 507. Retrieves information or the readme or change history file for a specific update in the management-server updates repository.

    – (New) “DELETE /managementServer/updates/,,…” on page 511. Deletes update packages and metadata from the management-server updates repository.

    Version 1.2.1

    The are no enhancements to the Open REST API in this version.

    Version 1.2.0

    This version supports the following enhancements to the Open REST API.• The following methods were added or updated:

    – Discovery resources– (New) “POST /csvRequest” on page 33. Manages devices using a bulk-import CSV file.– (New) “GET /discovery” on page 42. Retrieves a list of devices discovered by SLP discovery.

    – Inventory resources– (New) “GET /storage” on page 268. Retrieves properties for all Lenovo Storage and Flex System

    storage devices.– (New) “GET /storage/” on page 275. Retrieves properties for a specific Lenovo Storage

    or System storage devices.– (New) “PUT /storage/” on page 287. Modifies properties or performs management actions

    on a specific the Lenovo Storage and System storage devices.– (New) “PUT /storage//” on page 289. Powers on or off a specific Lenovo

    Storage and Flex storage controller.– (New) “GET /switches//ports” on page 326. Retrieves port information for a specific

    RackSwitch or Flex switch.– Configuration Patterns resources

    – “POST /profiles/unassign/” on page 385. Added the force request parameter under items to force profile deactivation.

    – Firmware update resources:– “DELETE /compliancePolicies” on page 455. Add the removePackage request parameter to

    delete the firmware-update packages that are associated with the specified compliance policies if the packages are not associated with another compliance policy.

    – (New) “GET /compliancePolicies/applicableFirmware ” on page 457. Retrieves information about firmware that is applicable to each managed device.

    – GET /updateRepositories/firmware. Added the “export” value to the key query parameter to return a ZIP file that contains the firmware-compliance policy, added the exportRepoFilename query parameter to specify the name of the ZIP file, and added the supportDownload response parameter to indicate whether the update is downloaded form the Lenovo Support website.

    – PUT /updateRepositories/firmware. Added the export value to the key query parameter to return a ZIP file that contains the firmware-compliance policy.

    – GET /updatableComponents. Added the query query parameter to identify whether to return a list of devices and components that can be updated or the status and progress of firmware updates, and added the storageList and switchList response parameters.

    – PUT /updatableComponents. Added the Component Fixid request parameter to specify the ID of the target package to be applied to the CMM, server, and switch, and added the storageList request parameter to identify switches to act upon

    – Monitoring and event resources:

    © Copyright Lenovo 2015, 2017 xi

  • – GET /events/monitors. Added SNMPv1 as another value for the protocol field. Added the communicationProtocol response field to identify the type of protocol that the syslog monitor uses to send messages. Added the community response field to define the community password that is sent with every SNMPv1 request to the device. Added the version response field to define the SNMP version.

    – POST /events/monitors. Added SNMPv1 as another value for the protocol field. Added the communicationProtocol response field to identify the type of protocol that the syslog monitor uses to send messages. Added the community response field to define the community password that is sent with every SNMPv1 request to the device. Added the version response field to define the SNMP version.

    – PUT /events/monitors. Added SNMPv1 as another value for the protocol field. Added the communicationProtocol response field to identify the type of protocol that the syslog monitor uses to send messages. Added the community response field to define the community password that is sent with every SNMPv1 request to the device. Added the version response field to define the SNMP version.

    – Job management resources:– (New) GET /tasks. Retrieves information about all jobs (tasks) and their subtasks.– (New) GET /tasks/{UID}. Retrieves information about all jobs (tasks) and their subtasks.– (New) PUT /tasks. Cancels a job (task).– (New) DELETE /tasks/{UID}. Deletes a specific job (task).

    – Security resources:– (New) GET /deviceTrustedCertificates. Retrieve information about the trusted certificates that are

    currently installed on managed devices.– (New) DELETE /deviceTrustedCertificates. Deletes a trusted certificates that are currently installed

    on managed devices.– GET /ldapClientSettings. Added more response fields, including bindingMethod,

    groupSearchAttribName, and userSearchAttribName. Added new values for userAuthenticationMethod, including ldap_local and local_ldap.

    – PUT /ldapClientSettings. Added more request fields, including bindingMethod, groupSearchAttribName, and userSearchAttribName. Added new values for the userAuthenticationMethod field, including ldap_local and local_ldap.

    – GET /roleGroups. Added lxc-recovery as a new value for the roles field.– POST /roleGroups. Added lxc-recovery as a new value for the roles field.– GET /roleGroups/{name}. Added lxc-recovery as a new value for the roles field.– POST /serverCertificate. After uploading the new signed server certificate, this method provisions

    the certificate to all managed devices. The jobPath response field is returned with the URI of the created job.

    – (New) GET /serverCertificate/jobs. Retrieves information about all known jobs for provisioning signed server certificates to all managed devices.

    – (New) GET /serverCertificate/jobs/{job_ID}. Retrieves information about a specific job for provisioning a signed server certificates to all managed devices.

    – GET /sessions. Added more response fields, including authenticationServer, created, id, idleFor, and lastAccessed.

    – (New) DELETE /sessions/{UUID}. Logs off (disconnects) an active user session from Lenovo XClarity Administrator.

    – POST /signedCertificate. After uploading the new CA root certificate, this method provisions the certificate to all managed devices. The jobPath response field is returned with the URI of the created job.

    – (New) GET /signingCertificate/jobs. Retrieves information about all known jobs for provisioning signing certificates to managed devices.

    – (New) GET /signingCertificate/jobs/{job_ID}. Retrieves information about a specific job for provisioning a signing certificate to managed devices.

    – Service and support resources:– GET /ffdc/device/{UUID}. Added support for collect and export the first failure data capture (FFDC)

    data for a specific storage device.

    xii Lenovo XClarity Administrator REST API Guide

  • • The following APIs will be deprecated in a future release: – /actions– /actions/{job_ID}– /jobs– /jobs/{job_ID}– /jobs/lock– /jobs/lock/{job_ID}

    Version 1.1.1

    The are no enhancements to the Open REST API in this version.

    Version 1.1.0

    This version supports the following enhancements to the Open REST API.• The following methods were added:

    – GET /ssoSettings. Returns information about the client settings when an external SAML 2.0 identity provider is used for authentication.

    – PUT /ssoSettings. Modifies the client settings when an external SAML 2.0 identity provider is used for authentication.

    • The following methods were updated: – GET /chassis. Added the formatType query parameter to return information in JSON, CSV, or XML

    types. Returns the encapsulation object with information about firewall settings.– GET /chassis/{UUID},{UUID},...{UUID}. Accepts more than one UUID in the request URL. Added the

    formatType query parameter to return information in JSON or CSV types. Returns the encapsulation object with information about firewall settings.

    – PUT /chassis/{UUID}. Added the encapsulation request parameter to modify information about firewall settings.

    – GET /nodes. Added the formatType query parameter to return information in JSON, CSV, or XML types. Returns the encapsulation object with information about firewall settings.

    – GET /nodes/{UUID},{UUID},...{UUID}. Accepts more than one UUID in the request URL. Added the formatType query parameter to return information in JSON, CSV, or XML types. Returns the encapsulation object with information about firewall settings, and thinkServerFru objects and additional drive parameters for ThinkServer servers.

    – PUT /nodes/{UUID}. Added the encapsulation request parameter to modify information about firewall settings.

    – GET /switches. Added the formatTypequery parameter to return information in JSON, CSV, or XML types.

    – GET /switches/{UUID},{UUID},...{UUID}. Accepts more than one UUID in the request URL. Added the formatTypequery parameter to return information in JSON, CSV, or XML types.

    – GET /hostPlatforms. Returns the vlanId string with information about VLAN ID for operating-system VLAN tagging.

    – PUT /hostPlatforms. Added the vlanId request parameter to modify VLAN ID for operating-system VLAN tagging.

    – GET /osdeployment/globalSettings. Returns the isVLANMode string, which indicates whether VLAN mode is used.

    – PUT /osdeployment/globalSettings. Added the isVLANMode request parameter to modify whether VLAN mode is used. Added ESXi and LINUX operating-system values for the type request parameter.

    Version 1.0.3

    The are no enhancements to the REST API in this version.

    Version 1.0.2

    This version supports the following enhancements to the REST API.• The following methods were added:

    – GET /cryptoSettings/jobs

    © Copyright Lenovo 2015, 2017 xiii

  • – GET /cryptoSettings/jobs/{job_ID}• The following methods were updated:

    – PUT /cryptoSettings. The optional returnJobInfo parameter in the request body of the PPUUTT //ccrryyppttooSSeettttiinnggss method indicates whether to return job information as a result of changing the cryptographic settings

    Version 1.0.1

    This version supports the following enhancements to the Open REST API.• The following methods were added:

    – POST /config/profile/unassign/{id}– PUT /jobs/{job_ID}– POST /patterns– GET /patterns/{id}/includeSettings– GET /switches– GET /switches/{UUID},{UUID},...{UUID}– PUT /switches/{UUID}

    • The singular form //sswwiittcchh and //sswwiittcchh//{{UUUUIIDD}} will be deprecated at a future date. Use the plural form //sswwiittcchheess and //sswwiittcchheess//{{UUUUIIDD}} instead.

    xiv Lenovo XClarity Administrator REST API Guide

  • Chapter 1. Lenovo XClarity Administrator REST APIs

    Lenovo XClarity Administrator provides a set of easy-to-use APIs that can be used to access Lenovo XClarity Administrator data and services from applications running outside of the Lenovo XClarity Administrator framework.

    This allows for easy integration of Lenovo XClarity Administrator capabilities into other software, whether the software is running on the same system as the Lenovo XClarity Administrator server, or on a remote system within the same network. These APIs are based on the REST architecture and are accessed via the HTTPS protocol.

    For the latest REST API reference, see the Lenovo XClarity Administrator REST APIs reference in the Lenovo XClarity Administrator online documentation.

    REST API authorization and authenticationWhen programming with the Lenovo XClarity Administrator REST APIs, you must authenticate using a user ID and password. The user ID must have the correct authorization to perform the intended task.

    You can use Lenovo XClarity Administrator web interface or CLI to configure the authorizations that provide access to Lenovo XClarity Administrator tasks and resources (see Managing user accounts in the Lenovo XClarity Administrator online documentation).

    Note: If you encounter a temporary HTTP connection error, attempt to log in to Lenovo XClarity Administrator again.

    REST API response codesThe Lenovo XClarity Administrator REST APIs use the HTTP protocol for sending and retrieving data. Client code using the REST APIs makes an HTTP request to the Lenovo XClarity Administrator server and processes the HTTP response accordingly. Included with the HTTP response data is the HTTP response code. The response code provides some indication as to the success of the HTTP request and can provide information on how to handle the included response data.

    The following table lists some of the most common response codes.

    Response code Description

    200 OK. The request completed successfully.

    400 Bad Request. An argument is missing or not valid. A descriptive error message will be returned in the body.

    401 Unauthorized. The user could not be authenticated. Authentication has not been provided or has failed.

    403 Forbidden. The management server was prevented from fulfilling the request.

    404 Not found. A specified resource could not be found.

    409 Conflict. The request could not be completed due to a conflict with the current state of the resource.

    © Copyright Lenovo 2015, 2017 1

    http://sysmgt.lenovofiles.com/help/topic/com.lenovo.lxca_restapis.doc/rest_apis.htmlhttp://sysmgt.lenovofiles.com/help/topic/com.lenovo.lxca.doc/users_manage.html

  • Response code Description

    413 Request Entity Too Large. Clients might impose limitations on the length of the request URL, and the request URL is too long to be handled.

    500 Internal server error. An internal error occurred. A descriptive error message will be returned in the body.

    2 Lenovo XClarity Administrator REST API Guide

  • Chapter 2. Virtual appliance management

    The following resources are available for managing the Lenovo XClarity Administrator virtual appliance.

    /aiccUse this REST API to retrieve and configure information about the Lenovo XClarity Administrator virtual appliance.

    HTTP methods

    GET, PUT

    GET /aiccUse the GET method to retrieve information about the Lenovo XClarity Administrator, such as NTP server settings, date and time settings, services that are currently running, and the build level.

    Authentication

    Authentication with user name and password is required.

    Request URL

    GET https:///aicc

    Query parameters

    None

    Response codes

    Code Description

    200 OK

    Response body

    The response is a JSON object that contains the following fields:

    Field Type Description

    appliance Object Information about the current instance of the Lenovo XClarity Administrator virtual appliance.

    build String The current build level.

    date String The current date and time.

    name String The current appliance name.

    runlevel Integer The current state of the appliance. This can be one of the following values: • 0. The appliance is halted.• 3. The appliance is operating normally.• 6. The appliance is restarting.

    status String The current status of the appliance. The value is always “Normal.”

    uuid String The UUID of the appliance.

    © Copyright Lenovo 2015, 2017 3

  • Field Type Description

    version String The current version number.

    appliance_states Object A list of all available appliance states.

    description String The appliance-state description.

    runlevel Integer The appliance-state value.

    date Object Information about the current date on the Lenovo XClarity Administrator.

    date_time String The date and time.

    parts Array Information about the current time.

    yyyy Integer Year

    mm Integer Month

    dd Integer Day

    hours Integer Hour

    mins Integer Minute

    secs Integer Second

    timezone String The current time zone.

    timezones Object Information about all available time zones.

    daylight_saves Integer The amount of time to be added to local standard time to get the current time. This can be one of the following values: • 3600000. If use_daylight is true, adds 3600000 milliseconds (one

    hour).• 0. f use_daylight is false, adds 0 milliseconds.

    display_name String The time zone name

    id String The time zone ID.

    offset Integer The Coordinated Universal Time (UTC) offset (for example, -5 or +4).

    uses_daylight Boolean Identifies whether daylight saving time is used. This can be one of the following values. • true. Daylight saving time is used.• false. Daylight saving time is not used.

    utc_offset_raw Integer The UTC offset (for example, -5 or +4).

    utc_offset_w_dst Integer The UTC offset adjusted for daylight saving time, if applicable (for example, -5 or +4).

    timezone_id String The time zone ID.

    uses_daylight Boolean Identifies whether daylight saving time is used. This can be one of the following values. • true. Daylight saving time is used.• false. Daylight saving time is not used.

    utc_offset Integer The UTC offset (for example, -5 or +4).

    utc_offset_raw Integer The UTC offset (for example, -5 or +4).

    utc_offset_w_dst Integer The UTC offset adjusted for daylight saving time, if applicable (for example, -5 or +4).

    4 Lenovo XClarity Administrator REST API Guide

  • Field Type Description

    network_interfaces Array A list of Lenovo XClarity Administrator network interfaces.

    id String The network ID (such as “eth0” or “eth1”).

    ip_addresses Array The IPv4 and IPv6 addresses for this interface.

    assign_method String The assignment method used for this IP address. This can be one of the following values. • static• dhcp• auto

    ip String The IPv4 or IPv6 address.

    ip_linklocal Boolean Identifies whether this address is an IPv6 link local address. This can be one of the following values. • true. This address is an IPv6 link local address.• false. This address is not an IPv6 link local address.

    prefix_length Integer The prefix length (in bits) for this IP address.

    version Integer The IP version of this address. This value is either “4” or “6.”

    mac_address String The MAC address.

    role Array of strings

    The roles that are performed by this interface. This can be one or more of the following values. • data• management• osdeployment

    ntp Object Information about the NTP server that is associated with Lenovo XClarity Administrator.

    servers Array A list of NTP servers.

    authenticated Boolean Indicates whether the Lenovo XClarity Administrator is authenticated with the NTP server. This can be one of the following values. • true. Lenovo XClarity Administrator is authenticated with the NTP

    server.• false. Lenovo XClarity Administrator is not authenticated with the

    NTP server.

    server String The IP address or hostname of the NTP server.

    version Integer The version of the NTP server.

    v3_key String The key value specified in /etc/ntp/keys.

    v3_key_index Integer The key-index value specified in /etc/ntp/keys.

    v3_key_type String The key-type value specified in /etc/ntp/keys.

    services Array A list of the Lenovo XClarity Administrator services.

    id String The service ID.

    initd String The service name.

    pid Integer The process ID.

    Chapter 2. Virtual appliance management 5

  • Field Type Description

    state Integer The current state of the service. This can be one of the following values: • 0. The service is running.• 1. The service is stopped but PID file exists.• 2. The service is stopped but lock file exists.• 3. The service is not running.• 4. The current state of the service is unknown.

    service_states Object A list of all available service states.

    description String The service-state description.

    state Integer The service-state value.

    subscriptions Array A list of subscriptions.

    id Integer The subscription ID.

    monitor_uri String The network-related resource that is to be monitored by Lenovo XClarity Administrator.

    If monitor_uri is set to “/aicc” or “”, every /aicc URI is monitored.

    If monitor_uri is set to “”, IP change notifications are received through DHCP.

    uri String The resource to which Lenovo XClarity Administrator writes a POST when Lenovo XClarity Administrator detects a change in monitored resource.

    The specified URI must be able to accept POST requests, where the body of the POST matches the JSON PUT to monitor_uri.

    Response example

    When the request is successful, a message body similar to the following is returned:

    { "appliance": {

    "build": "110", "date": "2015-09-15_10-25-16", "name": "LXCA - 192.0.2.0", "runlevel": 3, "status": "Normal", "uuid": "bef3e2c3-a689-4734-aa79-2a21f21e8b97", "version": "1.1.0"

    }, "appliance_states": [{

    "description": "Halt the appliance", "runlevel": 0

    }, ..., {

    "description": "Reboot the appliance", "runlevel": 6

    }], "date": {

    "date_time": "September 18, 2015 8:45:54 AM EST", "parts": {

    "yyyy": 2015, "mm": 9,

    6 Lenovo XClarity Administrator REST API Guide

  • "dd": 18, "hours": 8, "mins": 45 "secs": 54,

    }, "timezone": "Eastern Standard Time", "timezones": [{

    "daylight_saves": 0, "display_name": "GMT-12:00", "id": "Etc/GMT+12", "offset": -43200000, "uses_daylight": false, "utc_offset_raw": -43200000, "utc_offset_w_dst": -43200000

    }, ..., {

    "daylight_saves": 0, "display_name": "Eastern Standard Time", "id": "America/Grand_Turk", "offset": -14400000, "uses_daylight": false, "utc_offset_raw": -18000000, "utc_offset_w_dst": -14400000

    }], "timezone_id": "America/Cayman", "uses_daylight": true, "utc_offset": -18000000, "utc_offset_raw": -18000000, "utc_offset_w_dst": -18000000

    } "network_interfaces": [{

    "id": "eth0", "ip_addresses": [{

    "assign_method": "static", "ip": "fe80:0:0:0:200:ff:fe00:10%2", "ip_linklocal": "true", "prefix_length": 64, "version": 6

    }, {

    "assign_method": "static", "ip": "192.0.2.0", "ip_linklocal": "false", "prefix_length": 22, "version": 4

    }], "mac_address": "00:00:00:00:00:10", "role": ["management", "osdeployment"]

    }], "ntp": {

    "servers": [{ "authenticated": false, "server": "us.pool.ntp.org", "version": 1, "v3_key": "", "v3_key_index": 0, "v3_key_type": ""

    }] }, "services": [{

    Chapter 2. Virtual appliance management 7

  • "id": "core", "initd": "xhmc-core", "pid": 52706, "state": 0

    }, ..., {

    "id": "watchdog", "initd": "sympl-watchdog", "pid": 52517, "state": 0

    }], "service_states": [{

    "description": "Service is running", "state": 0

    }, ..., {

    "description": "Special purpose state used to trigger restart through REST", "state": 191

    }], "subscriptions": [{

    "id": 1, "monitor_uri": "/aicc", "uri": "/ntpNotification"

    }, ..., {

    "id": 3, "monitor_uri": "", "uri": "/osdeployment/rest/internal/event/aicc"

    }], }

    PUT /aiccUse the PUT method to configure Lenovo XClarity Administrator settings (such as NTP server settings, date and time settings, and services that are currently running), change the virtual appliance name, and restart or shutdown the virtual appliance.

    Note: Restarting or shutting down the virtual appliance causes any outstanding jobs to be interrupted and stopped. Before calling PUT /aicc to shutdown or restart the virtual appliance, use “GET /jobs” on page 663to check for any outstanding jobs.

    Authentication

    Authentication with user name and password is required.

    Request URL

    PUT https:///aicc

    Query parameters

    None

    8 Lenovo XClarity Administrator REST API Guide

  • Request body

    Field

    Re-quired / Optional Type Description

    appliance Optional Object Information about the current instance of the Lenovo XClarity Administrator virtual appliance

    name Optional String The name of the virtual appliance.

    runlevel Optional Integer The appliance run level. This can be one of the following values: • 0. Shut down• 6. Restart

    date Optional Object Information about the current date and time on Lenovo XClarity Administrator.

    parts Optional Array The current date and time.

    yyyy Optional Integer Year.

    mm Optional Integer Month.

    dd Optional Integer Day.

    hours Optional Integer Hour.

    mins Optional Integer Minute.

    secs Optional Integer Second.

    timezone_id Optional String The time zone ID.

    ntp Optional Object Information about the NTP server that is associated with Lenovo XClarity Administrator.

    servers Optional Array A list of NTP servers.

    server Required String The IP address or hostname of the NTP server.

    sync Required Boolean Indicates whether Lenovo XClarity Administrator synchronizes with the NTP server specified with the server parameter.

    version Optional Integer The version of the NTP server. You can specify one of the following values:

    • 1. No key authentication is required.

    • 3. NTPv3 is used, and key authentication is required. You must specify the authentication key and index for the NTP server for M-MD5 or SHA1 or both using the v3_key, v3_key_type, and v3_key_index parameters.

    v3_key Optional String The authentication key. • For the M-MD5 key, specify an ASCII string.• For the SHA1 key, specify a 40-character ASCII string,

    including only 0–9 and a-f.Note: The key index and authentication key must match the key ID and password values set on the NTP server. See the documentation for your NTP server for information about setting the key ID and key index.

    Chapter 2. Virtual appliance management 9

  • Field

    Re-quired / Optional Type Description

    v3_key_type Optional String The authentication key-type. You can specify one of the following values: • M. M-MD5 authentication.• SHA1. SHA1 authentication

    v3_key_index Optional String The authentication key index. Note: The key index and authentication key must match the key ID and password values set on the NTP server. See the documentation for your NTP server for information about setting the key ID and password.

    services Optional Array A list of the Lenovo XClarity Administrator services.

    id Optional String The service ID.

    To obtain the service IDs, use “GET /aicc” on page 3.

    state Optional Integer The current state of the service. This can be one of the following values: • 191. Restart the service.

    Request example

    The following example sets an NTPv1 server.

    { "ntp": {

    "servers": [{ "server": "1.1.1.2", "version": 1

    }] }

    }

    The following example sets an NTPv3 server using both M-MD5 and SHA1 authentication:

    { "ntp": {

    "servers": [{ "server": "time-a.nist.gov", "version": 3 "v3_key": "123456789012345678901234567890abcdefabcd", "v3_key_index": 3, "v3_key_type": "M",

    }, {

    "server": "us.pool.ntp.org", "version": 3, "v3_key": "123456789012345678901234567890abcdefabcd" "v3_key_index": 1, "v3_key_type": "SHA1",

    }] }

    }

    The following example synchronizes Lenovo XClarity Administrator with the NTP server.

    {

    10 Lenovo XClarity Administrator REST API Guide

  • "ntp": { "servers": [{

    "server": "time-a.nist.gov", "sync": "true"

    }] }

    }

    The following example sets the time zone. {

    "date": { "timezone_id": "America/ New_York"

    } }

    The following example sets the date and time. {

    "date": { "parts": {

    "yyyy": 2014, "dd": 7, "mm": 5, "hours": 2, "mins": 10, "secs": 24

    } }

    }

    The following example restarts network services. {

    "services": [{ "id": "network", "state": 191

    }] }

    The following example shuts down the virtual appliance. {

    "appliance": { "runlevel": 0

    } }

    The following example restarts the virtual appliance. {

    "appliance": { "runlevel": 6

    } }

    The following example changes the virtual appliance name. {

    "appliance": { "name" : "myAppliance"

    } }

    Chapter 2. Virtual appliance management 11

  • Response codes

    Code Description

    200 OK

    400 Bad request

    Response body

    None

    /aicc/network/ipdisableUse this REST API to retrieve or modify the IP address enablement state.

    HTTP methods

    GET, PUT

    GET /aicc/network/ipdisableUse the GET method to retrieve the enablement state of IPv4 and IPv6 addresses.

    Authentication

    Authentication with user name and password is required.

    Request URL

    GET https:///aicc/network/ipdisable

    Query parameters

    None

    Request body

    None

    Response codes

    Code Description

    200 OK

    404 Not Found

    Response body

    Field Type Description

    ip_status Array of objects

    Information about the enablement state for IPv4 and IPv6 addresses.

    ip_version Integer The type of IP address. This can be one of the following values: • 4. IPv4 addresses• 6. IPv6 addresses

    ip_disable Integer Indicates whether the IP addresses are enabled or disabled. This can be one of the following values: • 0. Enable the specified addresses.• 1. Disable the specified addresses.

    12 Lenovo XClarity Administrator REST API Guide

  • Response example

    { "ip_status": [{

    "ip_disable": 0, "ip_version": 4

    }, {

    "ip_disable": 0, "ip_version": 6

    }] }

    PUT /aicc/network/ipdisableUse the PUT method to enable or disable IPv4 or IPv6 addresses. You must enable or disable the IP addresses one at a time.

    Authentication

    Authentication with user name and password is required.

    Request URL

    PUT https:///aicc/network/ipdisable

    Query parameters

    None

    Request body

    Field

    Re-quired / Optional Type Description

    ip_version Required Integer The type of IP address. This can be one of the following values: • 4. IPv4 addresses• 6. IPv6 addresses

    ip_disable Required Integer Indicates whether the IP addresses are enabled or disabled. This can be one of the following values: • 0. Enable the specified addresses.• 1. Disable the specified addresses.

    Request example

    The following example enables IPv4 addresses: {

    "ip_version" : 4, "ip_disable" : 0

    }

    The following example disables IPv4 addresses: {

    "ip_version" : 4, "ip_disable" : 1

    }

    Chapter 2. Virtual appliance management 13

  • Response codes

    Code Description

    200 OK

    400 Bad request

    Response body

    None

    /aicc/network/hostUse this REST API to retrieve or configure information about the Lenovo XClarity Administrator host.

    HTTP methods

    GET, PUT

    GET /aicc/network/hostUse the GET method to retrieve the Lenovo XClarity Administrator host settings.

    Authentication

    Authentication with user name and password is required.

    Request URL

    GET https:///aicc/network/host

    Query parameters

    None

    Response codes

    Code Description

    200 OK

    Response body

    Field Type Description

    domain_name String The domain name of the virtual appliance.

    dns_servers Array The IP addresses that is used to resolve DNS queries.

    ip String The IP address of the DNS entry.

    priority Integer The relative priority of the DNS entry.

    hostname String The host name of the virtual appliance.

    proxy Array Information about the proxy server.

    enabled Boolean Indicates whether the proxy server is enabled. This can be one of the following values. • true. The proxy server is enabled.• false. The proxy server is disabled.

    ip String The IPv4 or IPv6 address of the proxy server.

    14 Lenovo XClarity Administrator REST API Guide

  • Field Type Description

    isPasswordSet Boolean Indicates whether the password is set for the proxy server. This can be one of the following values. • true. The password is set.• false. The password is not set.

    password String This field is always empty.

    port Integer The port number of the proxy server.

    userid String The user ID used to access the proxy server.

    Response example

    { "domain_name": "(none)," "dns_servers": [{

    "ip": "192.168.3.1", "priority": 1

    }, ..., {

    "ip": "192.168.129.1", "priority": 4

    }], "hostname": "localhost", "proxy": {

    "enabled": true, "ip": "1.1.1.1", "password": "password", "port": 11, "userid": "userid"

    } }

    PUT /aicc/network/hostUse the PUT method to configure the Lenovo XClarity Administrator host settings.

    Authentication

    Authentication with user name and password is required.

    Request URL

    PUT https:///aicc/network/host

    Query parameters

    None

    Request body

    The request is a JSON object (routes) that contains the following fields:

    Chapter 2. Virtual appliance management 15

  • Parameters

    Re-quired / Optional Type Description

    domain_name Optional String The domain name of the virtual appliance.

    dns_servers Required Array The IP addresses to be used to resolve DNS queries.

    ip Required String The IP address of the DNS entry.

    priority Integer String The relative priority of the DNS entry.

    hostname Optional String The hostname of the virtual appliance.

    proxy Array Array Information about the proxy server.

    enabled Boolean Boolean Indicates whether the proxy server is enabled. This can be one of the following values. • true. The proxy server is enabled.• false. The proxy server is disabled.

    ip String String The IPv4 or IPv6 address of the proxy server.

    password String String The password for the user ID.

    port Integer Integer The port number of the proxy server.

    userid String String The user ID used to access the proxy server.

    Request example

    This example request sets the hostname.

    { "hostname": "my_host"

    }

    This example request sets the domain name.

    { "domain_name": "my_domain"

    }

    This example request configures the DNS servers.

    { "dns_servers": [{

    "ip": "1.1.1.10", "priority": 1

    }, {

    "ip": "2.2.2.20", "priority": 2

    }, ...

    { "ip": "3.3.3.30", "priority": 3

    }] }

    This example request configures the proxy server:

    16 Lenovo XClarity Administrator REST API Guide

  • { "proxy": {

    "enabled": true, "ip": "1.1.1.1", "password": "password", "port": 11, "userid": "userid"

    } }

    Response codes

    Code Description

    200 OK

    400 Bad request

    Response body

    None

    /aicc/network/interfaces/Use this REST API to retrieve and configure information about the Lenovo XClarity Administrator network interfaces.

    HTTP methods

    GET, PUT

    GET /aicc/network/interfaces/Use the GET method to retrieve the information about a specific Lenovo XClarity Administrator network interface.

    Authentication

    Authentication with user name and password is required.

    Request URL

    GET https:///aicc/network/interfaces/

    where is the network interface, such as eth0 or eth1.

    Query parameters

    None

    Response codes

    Code Description

    200 OK

    404 Not found

    Response body

    The response is a JSON object that contains the following fields:

    Chapter 2. Virtual appliance management 17

  • Field Type Description

    id String The network ID (such as “eth0” or “eth1”).

    ip_addresses Array of objects

    Information about the IP addresses.

    assign_method String The assignment method used for this IP address. This can be one of the following values: • static• dhcp• auto

    ip String The IPv4 or IPv6 address.

    ip_linklocal String Identifies whether this address is an IPv6 link local address. This can be one of the following values. • true. This address is an IPv6 link local address• false. This address is not an IPv6 link local address

    prefix_length Integer The prefix length (in bits) for this IP address.

    version Integer The type of IP address. This can be one of the following values: • 4. IPv4 addresses• 6. IPv6 addresses

    mac_address String The MAC address.

    role Array of strings

    The roles that are performed by this interface. This can be one or more of the following values. • data• management• osdeployment

    rpf String The reverse path forwarding settings on the network interface. This can be one of the following values: • Disabled. Reverse path forwarding is disabled.• RFC3704Strict. Checks the source address of the incoming

    packet against the Forwarding Information Base (FIB). If packet is received on the interface that would be use to forward the traffic to the source of the packet, then the packets are allowed to pass through. Otherwise, the packages are discarded.

    • RFC3704Loose. Checks the source address of the incoming packet against the Forwarding Information Base (FIB). If the source address is reachable from any interface on that route, the packets are allowed to pass through. Otherwise, the packages are discarded.

    Response example

    When the request is successful, a message body similar to the following is returned:

    [{ "id": "eth0", "ip_addresses": [{

    "assign_method": "static", "ip": "fe80:0:0:0:5054:ff:fe03:4da9%2", "ip_linklocal": "true", "prefix_length": 64, "version": 6

    }, {

    "assign_method": "static", "ip": "10.243.2.189",

    18 Lenovo XClarity Administrator REST API Guide

  • "ip_linklocal": "false", "prefix_length": 20, "version": 4

    }, {

    "assign_method": "dhcp", "ip": "0::0%0", "ip_linklocal": "false", "prefix_length": 64, "version": 6

    }], "mac_address": "52:54:00:03:4D:A9", "role": ["management"], "rpf": "RFC3704Strict"

    }]

    PUT /aicc/network/interfaces/Use the PUT method to configure the settings for a specific network interface.

    Authentication

    Authentication with user name and password is required.

    Request URL

    GET https:///aicc/network/interfaces/

    where is the network interface, such as eth0 or eth1.

    Query parameters

    None

    Request body

    Field

    Re-quired / Optional Type Description

    id Required String The network ID (such as “eth0” or “eth1”)

    ip_address Required Array Information about the IP addresses

    assign_method Required String The assignment method used for this IP address. This can be one of the following values: • static• dhcp• auto

    ip Required String The IPv4 or IPv6 address

    prefix_length Required Integer The prefix length (in bits) for this IP address

    version Required Integer The IP version of this address. This value is either “4” or “6.”

    Request example

    This example request sets a static IPv4 address and a static IPv6 address. {

    "id": "eth0", "ip_addresses": [{

    Chapter 2. Virtual appliance management 19

  • "assign_method": "static", "ip": "1.1.1.1", "prefix_length": 24, "version": 4

    }, {

    "assign_method": "static", "ip": "2002:97b:c2bb:83d:5054:ff:feed:face", "prefix_length": 64, "version": 6

    }] }

    This example request sets an IPv4 address using DHCP. {

    "id": "eth0", "ip_addresses": [{

    "assign_method": "dhcp" "version": 4,

    }] }

    This example request sets an IPv6 address using DHCP.

    { "id": "eth0", "ip_addresses": [{

    "assign_method": "dhcp", "version": 6

    }, {

    ... }]

    }

    This example request sets an IPv6 address using auto configuration. {

    "id": "eth0", "ip_addresses": [{

    "assign_method": "auto", "version": 6

    }, {

    ... }]

    }

    Response codes

    Code Description

    200 OK

    400 Bad request

    401 Unauthorized

    403 Forbidden

    404 Not found

    20 Lenovo XClarity Administrator REST API Guide

  • Code Description

    409 Conflict

    500 Internal server error

    Response body

    None

    /aicc/network/routesUse this REST API to retrieve and configure information about Lenovo XClarity Administrator routes.

    HTTP methods

    GET, PUT

    GET /aicc/network/routesUse the GET method to retrieve information about all Lenovo XClarity Administrator routes.

    Authentication

    Authentication with user name and password is required.

    Request URL

    GET https:///aicc/network/routes

    Query parameters

    None

    Response codes

    Code Description

    200 OK

    Response body

    The response is a JSON object (routes) that contains the following fields:

    Field Type Description

    routes Array Information about network routes.

    destination String The destination IPv4 or IPv6 address for this route. This field is not returned for default routes.

    dev String The device that is used to connect to the device that is specified by nexthop (either “eth0” or “eth1”). This field is not returned for default routes.

    ip_version Integer The IP version of this route. This value is either “4” or “6.”

    Chapter 2. Virtual appliance management 21

  • Field Type Description

    nexthop String The IP address of the router that is used to forward packets to the address that is specified by destination.

    prefix_len Integer The number of bits in the network mask, or the prefix that is to be applied to the device that is specified by destination to get the subnet. This can be one of the following values: • 0. Default route.• 32. If the value of ip_version is 4, this indicates a host route.• 128. If the value of ip_version if 6, this indicates a host route.

    All other values are network routes.

    Response example

    When the request is successful, a message body similar to the following is returned:

    { "routes": [{

    "dev": "eth0", "destination": "100.10.10.10", "ip_version": 4, "nexthop": "192.168.56.1", "prefix_len": 32

    }, {

    "dev": "eth0", "destination": "10.10.10.0", "ip_version": 4, "nexthop": "192.168.56.1", "prefix_len": 24

    }, {

    "ip_version": 4, "nexthop": "10.0.3.2", "prefix_len": 0

    }, {

    "dev": "eth1", "destination": "2001:db7:1::", "ip_version": 6, "nexthop": "2002:97b:c2bb:83d:5054:ff:fe2c:eefe", "prefix_len": 64

    }, {

    "dev": "eth1", "destination": "2002:97b:face:83d:5054:ff:fe2c:eefe", "ip_version": 6, "nexthop": "2002:97b:c2bb:83d:5054:ff:fe2c:eefe", "prefix_len": 128

    }] }

    PUT /aicc/network/routesUse the PUT method to configure the Lenovo XClarity Administrator route settings.

    Authentication

    Authentication with user name and password is required.

    22 Lenovo XClarity Administrator REST API Guide

  • Request URL

    PUT https:///aicc/network/routes

    Query parameters

    None

    Request body

    Field

    Re-quired / Optional Type Description

    routes Required Array Information about network routes.

    destination Optional String The destination IPv4 or IPv6 address for this route.

    dev Required String The interface to be used to connect to the device that is specified by nexthop (either “eth0” or “eth1”).

    ip_version Required Integer The IP version of this route. This value is either “4” or “6.”

    nexthop Required String The IP address of the router to be used to forward packets to the address that is specified by destination.

    prefix_len Optional Integer The number of bits in the network mask, or the prefix that is to be applied to the device that is specified by destination to get the subnet. This can be one of the following values: • 0. Default route.• 32. If the value of ip_version is 4, this indicates a host

    route.• 128. If the value of ip_version if 6, this indicates a host

    route.

    All other values are network routes.

    Request example

    This example request sets the IPv4 default route. {

    "routes": [{ "ip_version": 4, "nexthop": "192.168.56.1", "prefix_len": 0

    }, {

    ... }]

    }

    This example request sets an IPv4 route. {

    "routes": [{ "destination": "100.10.10.10", "dev": "eth0", "ip_version": 4, "nexthop": "192.168.56.1", "prefix_len": 32

    }, {

    ...

    Chapter 2. Virtual appliance management 23

  • }] }

    This example request sets the default IPv6 route. {

    "routes": [{ "ip_version": 6, "nexthop": "2002:97b:c2bb:83d:5054:ff:fe2c:eefe", "prefix_len": 0

    }, {

    ... }]

    }

    This example request sets an IPv6 route. {

    "routes": [{ "destination": "2002:97b:c2bb:83d::", "dev": "eth1", "ip_version": 6, "nexthop": "2002:97b:c2bb:83d:5054:ff:fe2c:eefe", "prefix_len": 64

    }], {

    ... }]

    }

    Response codes

    Code Description

    200 OK

    400 Bad request

    Response body

    None

    /aicc/subscriptionsUse this REST API to retrieve or add a Lenovo XClarity Administrator subscriptions. When you add a subscription, you will receive notifications for all network related changes.

    HTTP methods

    GET, POST

    GET /aicc/subscriptionsUse the GET method to retrieve information about all Lenovo XClarity Administrator subscriptions.

    Authentication

    Authentication with user name and password is required.

    24 Lenovo XClarity Administrator REST API Guide

  • Request URL

    GET https:///aicc/subscriptions

    Query parameters

    None

    Response codes

    Code Description

    200 OK

    400 Bad request

    Response body

    Field Type Description

    id Integer The subscription ID.

    monitor_uri String The network-related resource that is to be monitored by Lenovo XClarity Administrator.

    If monitor_uri is set to “/aicc” or “”, every /aicc URI is monitored.

    If monitor_uri is set to “”, IP change notifications are received through DHCP.

    submonitor_uri String The subresource to be monitored by Lenovo XClarity Administrator. You will receive notifications for only this resource.

    uri String The resource to which Lenovo XClarity Administrator writes a POST when Lenovo XClarity Administrator detects a change in monitored resource.

    The specified URI must be able to accept POST requests, where the body of the POST matches the JSON PUT to monitor_uri.

    Response example

    When the request is successful, a message body similar to the following is returned:

    [{ "id": 1, "monitor_uri": "/aicc/network/interfaces", "submonitor_uri": "", "uri": "/osdeployment/rest/internal/event/aicc"

    }, {

    "id": 2, "monitor_uri": "/aicc", "submonitor_uri": "/ntp", "uri": "/ntpNotification"

    }, {

    "id": 3, "monitor_uri": "/aicc/network/interfaces", "submonitor_uri": "", "uri": "/netchangenotsec"

    }]

    Chapter 2. Virtual appliance management 25

  • POST /aicc/subscriptionsUse the POST method to add a subscription to Lenovo XClarity Administrator.

    Authentication

    Authentication with user name and password is required.

    Request URL

    POST https:///aicc/subscriptions

    Query parameters

    None

    26 Lenovo XClarity Administrator REST API Guide

  • Request body

    Field

    Re-quired / Optional Type Description

    monitor_uri= Optional String The network-related resource that is to be monitored by Lenovo XClarity Administrator.

    If monitor_uri is set to “/aicc” or “”, every /aicc URI is monitored.

    If monitor_uri is set to “”, IP change notifications are received through DHCP.

    submonitor_uri= Optional String The subresource to be monitored by Lenovo XClarity Administrator. You will receive notifications for only this resource.

    This can be one of the following values: • address• DDNSenabled• DNSenabled• dnsHostnames• domainName• embeddedHypervisorPresence• gateway• globalIPv6enabled• hostConfig• hostMacAddresses• hostname• id• ipInterfaces• ipv4Addresses• IPv4assignments• IPv4DHCPmode• IPv4enabled• ipv4ServiceAddress• ipv6Addresses• IPv6assignments• IPv6DHCPenabled• IPv6enabled• ipv6ServiceAddress• IPv6statelessEnabled• IPv6staticEnabled• IPversionPriority• isConnectionTrusted• isRemotePresenceEnabled• label• macAddresses• mgmtProcIPaddress• name• prefix• priIPv4userDNSserver• priIPv6user