This chapter contains the following sections:
Structure of an
Under a descriptive
title, each example comprises the following sections:
When you would
use the example.
conditions have to exist for the example to work.
- REST URL
What is the
REST URL to pass the REST API.
and methods are used in the example, and what the input variables represent.
- Sample Input
The input code
implementing the example, including what modifications might be necessary to
- See Also
How to Use the
This document is a
collection of examples-recipes, if you will-for using REST API, a server-side
scripting solution for use with
Cisco IMC Supervisor.
Like a cookbook, you can use this document in at least three ways:
You can follow
the examples as written (substituting your own variables, of course) to
complete tasks without necessarily knowing everything about the steps you are
You can use the
examples as templates and adapt them to similar tasks in your work.
You can study the
examples to figure out “how things are done” in REST API and generalize to
using different methods for other tasks you need to script.
The examples are
chosen to illustrate common use cases and are intended to facilitate all three
of these modes of use.
An API uses either
HTTP POST or GET. In the following examples, all the READ APIs are GET and
others are POST.