Book Image

Practical Network Automation

By : Abhishek Ratan
Book Image

Practical Network Automation

By: Abhishek Ratan

Overview of this book

Network automation is the use of IT controls to supervise and carry out every-day network management functions. It plays a key role in network virtualization technologies and network functions. The book starts by providing an introduction to network automation, SDN, and its applications, which include integrating DevOps tools to automate the network efficiently. It then guides you through different network automation tasks and covers various data digging and reporting methodologies such as IPv6 migration, DC relocations, and interface parsing, all the while retaining security and improving data center robustness. The book then moves on to the use of Python and the management of SSH keys for machine-to-machine (M2M) communication, all followed by practical use cases. The book also covers the importance of Ansible for network automation including best practices in automation, ways to test automated networks using different tools, and other important techniques. By the end of the book, you will be well acquainted with the various aspects of network automation.
Table of Contents (14 chapters)
Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Creating the backend API in C#


As we move ahead, there are times when as a developer we not only need to consume APIs, but create our own APIs for others to use. Even if we find recurring usage of some functions, keeping in mind web framework strategy, we need to ensure that instead of simply creating functions for that task, we need to convert them to APIs. A big advantage of that is that the usage of our function or task will then not be limited only to Python, but it can be used in any scripting language or web language.

Here we will see a very basic approach to creating a functional API to say Hello World in C#. As a prerequisite, we will need IIS to run the web services, and Visual Studio (Community edition is free to use) to create our own API. Later on, we will see how to consume that API in Python.

Additionally, we will ensure that the return value is in the JSON format, which is the industry standard for API communication, replacing XML.

  1. Invoke the C# Web project in Visual Studio:
  1. Select...