Overview
This chapter contains the following sections:
Structure of an Example
Under a descriptive title, each example comprises the following sections:
- Objective
-
When you would use the example.
- Prerequisites
-
What conditions have to exist for the example to work.
- REST URL
-
What is the REST URL to pass the REST API.
- Components
-
Which objects and methods are used in the example, and what the input variables represent.
- Sample Input XML
-
The input code sample.
- Implementation
-
Notes on implementing the example, including what modifications might be necessary to implement it.
- See Also
-
Related examples
How to Use the Examples
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 following.
-
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.
Note | An API uses either HTTP POST or GET. In the following examples, all the READ APIs are GET and others are POST. |