Skip to content

Commit

Permalink
Added Cisco SE Code Sharing Policy
Browse files Browse the repository at this point in the history
  • Loading branch information
pamosima committed Apr 6, 2023
1 parent ead1e04 commit 4d1a883
Show file tree
Hide file tree
Showing 8 changed files with 147 additions and 86 deletions.
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Thank you for taking the time to squash a bug or improve the functionality of this Cisco Sample Code!

The quality of our sample code is import to us. We are building bridges connecting today's people and technologies to tomorrow's possibilities. Thank you for helping us make this bridge a little better!

> **Cisco Sample Code Note:** This project, and the code contained herein, is provided for example or demonstration purposes by Cisco for use by our partners and customers in working with Cisco's products and services. While Cisco's customers and partners are free to use this code according to the terms of the LICENSE associated with this project, this is not an *Open Source* project in as much as we are not seeking to build a community around the project and its capabilities.
45 changes: 45 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as maintainers of this Cisco Sample Code pledge to making participation with our project a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Showing empathy towards other people

Examples of unacceptable behavior include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other interactions with this project that are not aligned to this Code of Conduct, or to ban temporarily or permanently any person for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project. Examples of representing a project include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the Cisco SE GitHub team at ciscose-github@cisco.com. The team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project or Cisco SE Leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Cisco Sample Code

This project, and the code contained herein, is provided for example or demonstration purposes by Cisco for use by our partners and customers in working with Cisco's products and services. While Cisco's customers and partners are free to use this code according to the terms of the [LICENSE](./LICENSE) associated with this project, this is not an *Open Source* project in as much as we are not seeking to build a community around the project and its capabilities.

We do desire to provide functional and high-quality examples and demonstrations. If you should discover some bug, issue, or opportunity for enhancement with the sample code contained in this project, please notify us by creating a new **Issue**.
28 changes: 24 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ This repository contains a Python Flask application that automate the process of

The scripts utilize the webhook notification option of Cisco DNA Center's "unclaimed" process. When a device contacts DNAC, information such as its IP address and serial number is sent via webhook to our Flask application. The application then maps the IP subnet to a configuration file that includes parameter mapping to variables, and claims the device based on its IP address.

To streamline the onboarding process, we have leveraged multiple scripts available on the [CiscoDevNet/DNAC-onboarding-tools GitHub repository](https://github.com/CiscoDevNet/DNAC-onboarding-tools). Our scripts provide an efficient and automated solution to onboard devices in Cisco DNA Center, improving network provisioning time and reducing manual effort.

Feel free to contribute to this repository and enhance the automation process further.

## Requirements
## Usage
```
$ source venv/bin/activate
$ python flaskapp.py
```

## Installation
### Python
Create a virtual environment and install the packages according to the requirements.txt

Expand Down Expand Up @@ -60,7 +64,7 @@ On the Summary page click on **Finish**

Done! Your new notification is complete.

## How to test
## Usage
### 1. Import Test Sites
Choose **Design > Network Hierarchy** and click **Import Sites**
<img width="1396" alt="image" src="https://user-images.githubusercontent.com/16715420/229137139-7f9a62f6-42d6-493e-aa42-7a54b510fff7.png">
Expand Down Expand Up @@ -106,6 +110,22 @@ Webhook AP test payload
}
```

## Authors & Maintainers

Smart people responsible for the creation and maintenance of this project:

- Anna Summerauer <asummera@cisco.com>
- Patrick Mosimann <pamosima@cisco.com>

## Credits

To streamline the onboarding process, we have leveraged multiple scripts available on the [CiscoDevNet/DNAC-onboarding-tools GitHub repository](https://github.com/CiscoDevNet/DNAC-onboarding-tools). Our scripts provide an efficient and automated solution to onboard devices in Cisco DNA Center, improving network provisioning time and reducing manual effort.

## License

This project is licensed to you under the terms of the [Cisco Sample
Code License](./LICENSE).

## Issues/Comments

Please post any issues or comments directly on GitHub.
71 changes: 0 additions & 71 deletions cliapp.py

This file was deleted.

33 changes: 22 additions & 11 deletions flaskapp.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright (c) 2021 Cisco and/or its affiliates.
"""Python Script Console Script.
# This software is licensed to you under the terms of the Cisco Sample
# Code License, Version 1.1 (the "License"). You may obtain a copy of the
# License at
Copyright (c) 2023 Cisco and/or its affiliates.
# https://developer.cisco.com/docs/licenses
This software is licensed to you under the terms of the Cisco Sample
Code License, Version 1.1 (the "License"). You may obtain a copy of the
License at
# All use of the material herein must be in accordance with the terms of
# the License. All rights not expressly granted by the License are
# reserved. Unless required by applicable law or agreed to separately in
# writing, software distributed under the License is distributed on an "AS
# IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied.
https://developer.cisco.com/docs/licenses
All use of the material herein must be in accordance with the terms of
the License. All rights not expressly granted by the License are
reserved. Unless required by applicable law or agreed to separately in
writing, software distributed under the License is distributed on an "AS
IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied.
"""

from flask import Flask, request
from dnacentersdk import DNACenterAPI
import pandas as pd
import ipaddress

__author__ = "Patrick Mosimann"
__email__ = "pamosima@cisco.com"
__version__ = "0.1.0"
__copyright__ = "Copyright (c) 2023 Cisco and/or its affiliates."
__license__ = "Cisco Sample Code License, Version 1.1"

app = Flask(__name__)

file = pd.read_csv("work_files/mapping.csv", sep = ",")
Expand Down

0 comments on commit 4d1a883

Please sign in to comment.