REST API Getting Started Guide - REST API Getting Started... · REST API Getting Started Guide vCommander

  • View
    230

  • Download
    0

Embed Size (px)

Text of REST API Getting Started Guide - REST API Getting Started... · REST API Getting Started Guide...

  • REST API Getting Started Guide

    vCommander version 5.2

    REST API version 2.3

  • P a g e | 1

    vCommander REST API Getting Started Guide 2015 Embotics Corporation

    Contents Introduction ............................................................................................................................................ 3

    Version compatibility ........................................................................................................................... 3

    Changes in this release ........................................................................................................................ 3

    REST API capabilities ................................................................................................................................ 3

    Cloud automation ................................................................................................................................ 3

    System configuration and status .......................................................................................................... 3

    VM and infrastructure inventory management .................................................................................... 4

    Costing ................................................................................................................................................ 4

    User management ............................................................................................................................... 4

    Where to find reference information ....................................................................................................... 4

    How does the REST API work? ................................................................................................................. 4

    Security ............................................................................................................................................... 5

    Exception and error handling ............................................................................................................... 5

    Data model .......................................................................................................................................... 6

    Installation .............................................................................................................................................. 6

    Where to install the PowerShell client ................................................................................................. 6

    1. Download the REST PowerShell client .............................................................................................. 6

    2. Install the PowerShell Module ......................................................................................................... 6

    3. Verify the installation ....................................................................................................................... 7

    4. Set permissions on folders ............................................................................................................... 7

    Create a user account for the REST API .................................................................................................... 8

    If your use of the API affects service request automation ........................................................................ 8

    Using the REST API .................................................................................................................................. 8

    Base Service URL ................................................................................................................................. 8

    Restricting REST API access to a specific host name or IP address ........................................................ 9

    Using the REST API PowerShell client ................................................................................................... 9

    Other custom clients ......................................................................................................................... 15

    Examples ............................................................................................................................................... 16

    Example 1: Connect your automated build machine to the vCommander Service Catalog .................. 16

    Example 2: Initiate a service request from an external system ........................................................... 17

    Example 3: Approve and deploy a service request from an external system ....................................... 18

    Example 4: Add a datastore to automated deployment destinations ................................................. 19

    Example 5: Create an organization and assign cost quota .................................................................. 19

  • P a g e | 2

    vCommander REST API Getting Started Guide 2015 Embotics Corporation

    Example 6: Create an organization and assign resource quota ........................................................... 20

    Example 7: Set a VMs compliance state ............................................................................................ 21

    Example 8: Set VM ownership ........................................................................................................... 21

    Example 9: Create an IP pool without specifying networks................................................................. 22

    Example 10: Create an IP pool and specify networks .......................................................................... 23

    Example 11: Create a deployment destination for vCenter ................................................................ 23

    Example 12: Create a deployment destination for SCVMM ................................................................ 29

    Example 13: Create a deployment destination for Amazon EC2 ......................................................... 31

    Example 14: Create a deployment destination for HP Public Cloud .................................................... 32

    Example 15: Create a Compliance Policy ............................................................................................ 34

    Example 16: Create a Default Attributes Policy .................................................................................. 34

    Example 17: Create an Expired VM Policy .......................................................................................... 36

    Example 18: Create a Default Ownership Policy ................................................................................. 37

    Example 19: Create an Unapproved VM Policy................................................................................... 39

    Example 20: Create a Suspect VM Policy ............................................................................................ 40

    Example 21: Create an End of Life VM Policy ..................................................................................... 40

    Example 22: Create a Cost Model ...................................................................................................... 41

    Example 23: Create an Approval Workflow ........................................................................................ 41

    Example 24: Create a Completion Workflow ...................................................................................... 43

    Example 25: Create a Service Workflow ............................................................................................. 44

    Troubleshooting .................................................................................................................................... 44

    Could not load file or assembly error when attempting to run Import-module VCommander ......... 44

    Module file not found error when attempting to run Import-Module ............................................ 45

    Content is not allowed in prolog error when attempting to call an API ........................................... 46

    Error: JAXBException occurred : The reference to entity "{0}" must end with the ';' delimiter ............ 48

    Appendix: PowerShell script credential encryption ................................................................................ 48

    To encrypt your credentials ............................................................................................................... 48

    To decrypt your credentials ............................................................................................................... 49

    The encryption process ...................................................................................................................... 49

    Appendix: vCommander REST API security and authentication reference .............................................. 50

    Client authentication ......................................................................................................................... 50

    Session overview ............................................................................................................................... 52

  • P a g e | 3

    vCommander REST API Getting Started Guide 2015 Embotics Corporation

    Introduction This guide provides information on installing and using the Embotics vCommander REST API.

    Version compatibility

    REST API version Compatible vCommander versions

    2.3 5.2 and higher

    2.2 5.1.4 and higher

    2.1 5.1.3 and higher

    2.0