Code Monkey home page Code Monkey logo

dns_manager's Introduction

README

A test App that complies with this specification:

build an API with two endpoints.

The first endpoint will be used to create DNS records and their associated hostnames. A DNS record may have many hostnames, and a hostname may have many DNS records.

The second endpoint will be used to retrieve those records.

API Endpoint #1 Endpoint #1 creates a DNS record and its associated hostnames. This endpoint should accept an IPv4 IP address and a list of hostnames. The response should return the ID of the DNS record created.

API Endpoint #2 Endpoint #2 returns DNS records and their hostnames. This endpoint should accept:

A list of hostnames the results should include (optional parameter)

A list of hostnames the results should exclude (optional parameter)

A page number (required)

The result must contain all DNS records that have all the hostnames it should include, but none of the hostnames it should exclude.

The response body must have:

The total number of matching DNS records

An array of matching DNS records, where each record contains:

The ID of the matching DNS record

The IP address of the matching DNS record

An array of hostnames associated with the matching DNS records, except for those hostnames excluded by the query, where each hostname record contains:

The hostname

The number of DNS records associated with the hostname

Examples Assuming the following DNS records and hostnames are stored in the database:

DNS Record 1

IP: 1.1.1.1

Hostnames: lorem.com, ipsum.com, dolor.com, amet.com

DNS Record 2

IP: 2.2.2.2

Hostnames: ipsum.com

DNS Record 3

IP: 3.3.3.3

Hostnames: ipsum.com, dolor.com, amet.com

DNS Record 4

IP: 4.4.4.4

Hostnames: ipsum.com, dolor.com, sit.com, amet.com

DNS Record 5

IP: 5.5.5.5

Hostnames: dolor.com, sit.com

When API endpoint #2 receives the following query:

List of hostnames to be included: ipsum.com, dolor.com

List of hostnames to be excluded: sit.com

Page: 1

Then the response should have:

The total number of matching DNS records: 2

An array of matching DNS records

ID: 1, IP: 1.1.1.1

ID: 3, IP: 3.3.3.3

An array of hostnames associated with the DNS records (lorem.com, ipsum.com, dolor.com, amet.com), excluding any hostnames specified in the query (hostnames to be included: ipsum.com, dolor.com; hostnames to be excluded: sit.com)

Hostname: lorem.com, Number of matching DNS records: 1

Hostname: amet.com, Number of matching DNS records: 2

dns_manager's People

Contributors

brunoqcx avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.