Giter Club home page Giter Club logo

random.it's Introduction

Contributors Forks Stargazers Issues Pulls LinkedIn


random.IT

random.IT is a system focusing on sharing random or pseudo-random data via API.

Report Bug ยท Request Feature

Table of Contents

About The Project

random.IT is system focused on sharing random or pseudo-random data via API. The application is plan to consist of parts that generate independent data. First, it will be a GUID number generator, and then random IP protocol configurations compliant with the requirements specified in the query. The next parts, and also the next generators, will be added according to the needs or suggestions of users.

Used Technologies

Backend

Getting Started

To get a local copy up and running follow these simple steps:

  • Download the latest stable version from the download tab and unzip it to your folder
  • Open the solution in Visual Studio 2019.
  • Clean solution.
  • Build the solution to install Nuget packages.
  • Run application
  • Fire up your browser and open url https://localhost:44386/ to use a Swagger UI
  • Enjoy ;-)

API Documentation

The API currently contains 2 endpoints: Guid and Network Configurations. When new endpoints are created, they will be successively added to the documentation.

GUID

Command Method Route Description
SingleGuid GET /api/guid Return single GUID generated based on current timedate

API command SingleGuid allows user to retrieve single version 1 GUID. User can parametrize request:

  • isUppercase (optional) - will return GUID in uppercase, i.e. /api/guid?isuppercase=true

Response data will be in the following format:

{
  "statusCode": <int>,
  "message": <string>",
  "result": <string>
}

Example response for /api/guid?isuppercase=true:

{
  "statusCode": 200,
  "message": "GET Request successful.",
  "result": "2E0ACB1C-3B88-11EB-9410-3F26C08F1611"
}
Command Method Route Description
ListGuid GET /api/guid/{guidNumbers} Returns list with number of GUIDs declared in {guidNumbers} parameter

API command ListGuid allows user to retrieve list of version 4 GUIDs. Response is paginated:

  • its default page size is 10 and cannot be higher than 30
  • default page number is 1 and cannot be lower than 1 These can be changed in request.

User can parametrize request:

  • PageNumber (default: 1) - will returns chosen page number, i.e. /api/guid/50?PageNumber=2
  • PageSize (default: 10) - will set size of page of response, i.e. /api/guid/50?PageSize=4
  • isUppercase (optional) - will return list of GUIDs in uppercase, i.e. /api/guid/8?isuppercase=true

Response data will be in the following format:

{
  "statusCode": <int>,
  "message": <string>,
  "result": [
    <string>
    ...
    <string>
  ],
  "pagination": {
    "pageNumber": <int>,
    "pageSize": <int>,
    "totalPages": <int>,
    "totalRecords": <int>,
    "firstPage": <string>,
    "lastPage": <string>,
    "nextPage": <string>,
    "previousPage": <string>
  }
}

Example response for /api/guid/120?PageNumber=3&PageSize=15&isUppercase=true:

{
  "statusCode": 200,
  "message": "GET Request successful.",
  "result": [
    "2BC7C2B0-D254-4272-9166-8369DB9421E5",
    "959754B4-4E69-429C-9166-C7A0E260B8DB",
    "A0F64567-EFCD-450B-9166-576B0FDE3692",
    "F7F0CA44-D458-4497-9166-D01771D590AE",
    "F44826FB-961A-4E6B-9166-733AC731D9EF",
    "8B862CFD-0918-4CBD-9166-B0EA08E34423",
    "F72FDE75-5C5F-40C9-9166-221BC39F2706",
    "2630B557-A7FA-4447-9166-90E5BD87F0FE",
    "36EB5E76-4752-44C8-9166-0BCFD27D26CD",
    "78C86B09-B6E1-4AA5-9166-BAE2E99CDBD1",
    "D73A4A4D-CA6C-44B9-9166-2F8C4DDF3EC3",
    "7D5361AA-7A81-459A-9166-1C44A53A587C",
    "B64D09A4-F76C-4046-9166-94FA115B1344",
    "012B3B3B-E278-494F-9166-8E6C1A613628",
    "3232F62D-3C71-4620-9166-3F9673467CE9"
  ],
  "pagination": {
    "pageNumber": 3,
    "pageSize": 15,
    "totalPages": 8,
    "totalRecords": 120,
    "firstPage": "https://localhost:44386/api/guid/120?pageNumber=1&pageSize=15",
    "lastPage": "https://localhost:44386/api/guid/120?pageNumber=8&pageSize=15",
    "nextPage": "https://localhost:44386/api/guid/120?pageNumber=4&pageSize=15",
    "previousPage": "https://localhost:44386/api/guid/120?pageNumber=2&pageSize=15"
  }
}

NETWORK CONFIGURATIONS

Command Method Route Description
ListNetworkConfigsWithIpTemplate GET /api/networkconfig/{networkConfigsNumber} Return list with number of random network configs declared in parameter. Can be parametrized with use of IP address template or/and subnet mask.

API command ListNetworkConfigsWithIpTemplate allows user to retrieve list of network configs that contains:

  • host IP V4 address,
  • subnet mask,
  • subnet address,
  • subnet broadcast address,
  • number of still free hosts in subnet

Response is paginated:

  • its default page size is 10 and cannot be higher than 30
  • default page number is 1 and cannot be lower than 1 These can be changed in request.

User can parametrize request:

  • PageNumber (default: 1) - will returns chosen page number, i.e. /api/networkconfig/50?PageNumber=2
  • PageSize (default: 10) - will set size of page of response, i.e. /api/networkconfig/50?PageSize=4
  • ipTemplate (optional) - will return list of network confis with ip based on provided template, i.e. /api/networkconfig/8?ipTemplate=192.168.x.x
  • subnetMask (optional) - will return list of network confis with provided subnet mask, i.e. /api/networkconfig/8?subnetMask=255.255.255.0

Response data will be in the following format:

{
  "statusCode": <int>,
  "message": <string>,
  "result": [
    {
      "ipHostAddress": <string>,
      "subnetMask": <string>,
      "subnetAddress": <string>,
      "subnetBroadcastAddress": <string>,
      "freeHostsNumberInSubnet": <int>
    }
    ...
    {
      "ipHostAddress": <string>,
      "subnetMask": <string>,
      "subnetAddress": <string>,
      "subnetBroadcastAddress": <string>,
      "freeHostsNumberInSubnet": <int>
    }
  ],
  "pagination": {
    "pageNumber": <int>,
    "pageSize": <int>,
    "totalPages": <int>,
    "totalRecords": <int>,
    "firstPage": <string>,
    "lastPage": <string>,
    "nextPage": <string>,
    "previousPage": <string>
  }
}

Example response for /api/networkconfig/3?ipTemplate=192.168.x.x&subnetMask=255.255.255.0:

{
  "statusCode": 200,
  "message": "GET Request successful.",
  "result": [
    {
      "ipHostAddress": "192.168.51.1",
      "subnetMask": "255.255.255.0",
      "subnetAddress": "192.168.51.0",
      "subnetBroadcastAddress": "192.168.51.15",
      "freeHostsNumberInSubnet": 251
    },
    {
      "ipHostAddress": "192.168.51.2",
      "subnetMask": "255.255.255.0",
      "subnetAddress": "192.168.51.0",
      "subnetBroadcastAddress": "192.168.51.15",
      "freeHostsNumberInSubnet": 251
    },
    {
      "ipHostAddress": "192.168.51.3",
      "subnetMask": "255.255.255.0",
      "subnetAddress": "192.168.51.0",
      "subnetBroadcastAddress": "192.168.51.15",
      "freeHostsNumberInSubnet": 251
    }
  ],
  "pagination": {
    "pageNumber": 1,
    "pageSize": 10,
    "totalPages": 1,
    "totalRecords": 3,
    "firstPage": "https://localhost:44386/api/networkconfig/3?pageNumber=1&pageSize=10",
    "lastPage": "https://localhost:44386/api/networkconfig/3?pageNumber=1&pageSize=10"
  }
}

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. ๐Ÿด Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. ๐Ÿ”ƒ Open a Pull Request

Contact

Mateusz Donhefner

Project's main contributors:

random.it's People

Contributors

matdon90 avatar

Watchers

 avatar

random.it's Issues

Guid: uppercase option

Add possibility to get guids in uppercase.
i.e. GET /guid?uppercase=true -> 26DE7899-2C01-48C4-A020-64DD7506D4A4

Random network configuration generator

Should be implemented generator of network configuration.

Network config returned should include:

  • IPv4 address
  • Subnet Mask
  • Default Gateway

User can define in GET request:

  • number of configs
  • ipv4 template i.e. GET /ipconfig?iptemplate=192.168.0.x -> all returned configs should have ip compatibile with ip template
  • subnet mask i.e. GET /ipconfig?mask=255.255.255.0 -> all returned configs should have ip from selected subnet

README update

Readme should be updated.
It should contains description, informations about usage and api endpoints documentation.

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.