Skip to content

Commit ceb9734

Browse files
committed
Moved from main learning labs repo
0 parents  commit ceb9734

File tree

154 files changed

+4437
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+4437
-0
lines changed

LICENSE

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
Creative Commons Attribution 4.0 International Public License
2+
3+
By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
4+
5+
Section 1 – Definitions.
6+
7+
Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
8+
Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
9+
Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
10+
Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
11+
Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
12+
Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
13+
Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
14+
Licensor means the individual(s) or entity(ies) granting rights under this Public License.
15+
Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
16+
Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
17+
You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
18+
Section 2 – Scope.
19+
20+
License grant.
21+
Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
22+
reproduce and Share the Licensed Material, in whole or in part; and
23+
produce, reproduce, and Share Adapted Material.
24+
Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
25+
Term. The term of this Public License is specified in Section 6(a).
26+
Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
27+
Downstream recipients.
28+
Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
29+
No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
30+
No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
31+
Other rights.
32+
33+
Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
34+
Patent and trademark rights are not licensed under this Public License.
35+
To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties.
36+
Section 3 – License Conditions.
37+
38+
Your exercise of the Licensed Rights is expressly made subject to the following conditions.
39+
40+
Attribution.
41+
42+
If You Share the Licensed Material (including in modified form), You must:
43+
44+
retain the following if it is supplied by the Licensor with the Licensed Material:
45+
identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
46+
a copyright notice;
47+
a notice that refers to this Public License;
48+
a notice that refers to the disclaimer of warranties;
49+
a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
50+
indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
51+
indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
52+
You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
53+
If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
54+
If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License.
55+
Section 4 – Sui Generis Database Rights.
56+
57+
Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
58+
59+
for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database;
60+
if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and
61+
You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
62+
For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
63+
Section 5 – Disclaimer of Warranties and Limitation of Liability.
64+
65+
Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.
66+
To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.
67+
The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
68+
Section 6 – Term and Termination.
69+
70+
This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
71+
Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
72+
73+
automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
74+
upon express reinstatement by the Licensor.
75+
For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
76+
For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
77+
Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
78+
Section 7 – Other Terms and Conditions.
79+
80+
The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
81+
Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
82+
Section 8 – Interpretation.
83+
84+
For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
85+
To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
86+
No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
87+
Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Cisco DevNet Learning Lab: git-intro
2+
3+
**Description**: This is a tutorial that provides an introduction to coding. It is written to be displayed within the [Cisco DevNet Learning Labs system](https://learninglabs.cisco.com).
4+
5+
- **Technology stack**: Built using Markdown.
6+
- **Status**: Beta status.
7+
8+
## Dependencies
9+
10+
* None
11+
12+
## Installation
13+
14+
1. Clone (or fork then clone) this project
15+
16+
## Configuration
17+
18+
No configuration necessary.
19+
20+
## Usage
21+
22+
* You can view these files using a Markdown editor.
23+
24+
25+
## Known issues
26+
27+
* None
28+
29+
## Getting help
30+
31+
If you have questions, concerns, bug reports, etc, please file an issue in this repository's Issue Tracker.
32+
33+
## License
34+
[LICENSE](LICENSE)
35+
36+
## Getting involved
37+
38+
* If you'd like to make contributions, feel free to make a request in the issue tracker. If you're interested in creating a Cisco DevNet Learning Lab, contact Ashley Roach (asroach at cisco.com).
39+
40+
## Credits and references
41+
42+
* [Cisco DevNet Learning Labs](https://learninglabs.cisco.com)

labs/coding-101-rest-basics-ga/1.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
# Coding 101: REST API Basics #
3+
4+
In this Learning Lab you will learn the basics of consuming a REST API, and how to use POSTMAN to explore a REST API.
5+
6+
7+
## Objective ##
8+
9+
Completion Time: 20 minutes
10+
11+
* Understand the basics of consuming REST APIs
12+
* Learn how to use the POSTMAN REST Client to make API calls
13+
14+
15+
## Prerequisites
16+
17+
In this lab, we are going to use <a href="https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en" target="_blank">POSTMAN</a> which is a Google Chrome Browser application to make the REST API calls.
18+
19+
If you are on a DevNet Zone station, <a href="https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en" target="_blank">POSTMAN</a> is already installed and can be launched either from the Google App Launcher or from Chrome by clicking <a href="https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en" target="_blank">here</a> and hitting Launch App.
20+
21+
**Access to an APIC-EM Controller**
22+
* To run these code samples, you will need access to an APIC-EM controller.
23+
* **If you are not using your own APIC-EM controller**, you can use the [DevNet Sandbox](https://developer.cisco.com/site/devnet/sandbox/) Always-On APIC-EM Lab: [https://sandboxapic.cisco.com](https://sandboxapic.cisco.com).
24+
The login credentials for the always on sandbox are **username:** devnetuser and **password:** Cisco123!
25+
26+
## Step 1. Find the APIC-EM API Resources
27+
28+
We are going to use the APIC-EM API as an example of a REST API in this lab. So before we begin, we need to locate the APIC-EM resources on DevNet.
29+
30+
1. In the browser navigate to <a href="https://developer.cisco.com" target="_blank">DevNet</a>
31+
* If you have not yet created a DevNet userid click "Register" and follow the instructions.
32+
* After registering with DevNet, use your user id to login.
33+
![](/posts/files/coding-101-rest-basics-ga/assets/images/register.png)<br/>
34+
<br/><br/>
35+
36+
2. Use the menu at the top to navigate directly to the APIC-EM developer resources.<br/>
37+
![](/posts/files/coding-101-rest-basics-ga/assets/images/Menu.png)
38+
<br/><br/>
39+
40+
3. You will also want to open the API reference doc in a separate tab while you are working on this lab.<br/>
41+
![](/posts/files/coding-101-rest-basics-ga/assets/images/Ref.png)

labs/coding-101-rest-basics-ga/2.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## Step 2. So what is a REST web service?
2+
3+
### What is a Web Service?###
4+
5+
A web service is a way for two systems to communicate through a defined interface.
6+
There are two major types of Web Services – **REST** or **SOAP**.
7+
8+
### What is a *REST* Web Service? ###
9+
10+
REST is an architecture style for designing networked applications.
11+
A REST web service is a web service that is as easy to call as making an HTTP request.
12+
RESTful interfaces often offer the CRUD (Create, Update, Delete) operations.
13+
If you want to know more about REST in general, this is a great <a href="http://rest.elkstein.org" target="_blank">REST tutorial</a>.
14+
15+
16+
### What is so great about REST? ###
17+
18+
***REST is easy to use on any platform***
19+
20+
![](/posts/files/coding-101-rest-basics-ga/assets/images/RESTisGreat.jpg)
21+
22+
### APIC-EM API is a REST API ###
23+
24+
For this lab, we are going to use the <a href="https://developer.cisco.com/site/apic-em/" target="_blank">APIC-EM APIs</a>.
25+
26+
The Application Policy Infrastructure Control (APIC) Enterprise Module (EM), Application Programming Interface (API), <a href="https://developer.cisco.com/site/apic-em/" target="_blank">APIC-EM APIs</a>, allows the deployment and execution of application policy across your networking infrastructure.
27+
28+
Using the the APIC-EM APIs, we can retrieve information about devices on our network including a list of hosts, list of network devices, a list of users and more. We are going to use these features as examples to learn how to make REST calls from Python.
29+
30+
Take a look at the <a href="http://devnetapic.cisco.com/" target="_blank">APIC-EM Reference Docs</a> to see the details of all of the APIC-EM endpoints.
31+
32+
33+
### How does this work?
34+
35+
![](/posts/files/coding-101-rest-basics-ga/assets/images/howitworks.jpg "How it Works")
36+
37+
REST is centered around the HTTP request and response model. Consuming an API is just as simple as making an HTTP request.
38+
39+
In this example, we request the list of hosts, and that information is returned to us in the response. The data returned in the response is usually json or xml.
40+
41+
(<a href="http://www.json.org/" target="_blank">JSON</a> -- JavaScript Object Notation, is a lightweight text-based open standard designed for human-readable data interchange.)

0 commit comments

Comments
 (0)