Wednesday, September 27, 2017

VMware Fusion 10 - Introduction - Rest API

VMware released Fusion 10 earlier today, and introduced a new REST API. Unfortunately, they didn't include much of an introduction on how to use it..

I've copied the API docs onto GitHub: https://manouchehri.github.io/VMware-Fusion-REST-API/

mbp:~ dave$ /Applications/VMware\ Fusion.app/Contents/Public/vmrest -h
VMware Fusion REST API
Copyright (C) 2015-2017 VMware Inc.
All Rights Reserved

vmrest 1.0.0 build 6665085
Usage of /Applications/VMware Fusion.app/Contents/Public/vmrest:
  -c, --cert-path <cert-path>
    REST API Server certificate path
  -C, --config
    Configure credential
  -d, --debug
    Enable debug logging
  -h, --help
    Print usage
  -i, --ip <ip>
    REST API Server IP binding (default 127.0.0.1)
  -k, --key-path <key-path>
    REST API Server private key path
  -p, --port <port>
    REST API Server port (default 8697)
  -v, --version
    Print version information

To enable the VMware Fusion REST API, you first need to set a username and password.

mbp:~ dave$ /Applications/VMware\ Fusion.app/Contents/Public/vmrest -d -C
VMware Fusion REST API
Copyright (C) 2015-2017 VMware Inc.
All Rights Reserved

vmrest 1.0.0 build 6665085
Username:dave
New password:
Retype new password:
Processing...
Credential updated successfully

Now launching the service should work.

mbp:~ dave$ /Applications/VMware\ Fusion.app/Contents/Public/vmrest -d
VMware Fusion REST API
Copyright (C) 2015-2017 VMware Inc.
All Rights Reserved

vmrest 1.0.0 build 6665085
-
Using the Fusion UI while API calls are in progress is not recommended and may yield unexpected or unintended results.
-
Serving HTTP on 127.0.0.1:8697

And finally, you can find the actual documentation at http://127.0.0.1:8697. Logging in with your new username and password should work too.











No comments:

Post a Comment