Skip to content

Instantly share code, notes, and snippets.

View PradeepLoganathan's full-sized avatar

Pradeep Loganathan PradeepLoganathan

View GitHub Profile
@PradeepLoganathan
PradeepLoganathan / orderapi-spec-path.json
Last active June 21, 2020 10:11
Openapi sample path object
"paths": {
"/api/candidates": {
"post": {
"tags": [
"Candidates"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
@PradeepLoganathan
PradeepLoganathan / orderapi-spec-servers.json
Created June 20, 2020 09:21
Openapi sample server object
{
"servers": [
{
"url": "https://development.thetalenbot.com/v1",
"description": "Development environment"
},
{
"url": "https://staging.thetalenbot.com/v1",
"description": "Staging server"
},
@PradeepLoganathan
PradeepLoganathan / orderapi-spec-info.json
Last active June 21, 2020 04:13
OpenAPI 3.0 spec JSON sample
"openapi": "3.0.1",
"info": {
"title": "theta-CandidateAPI",
"description": "Candidate API for thetalentbot",
"contact": {
"name": "thetalentbot",
"url": "https://thetalentbot.com/developers/contact"
},
"license": {
"name": "Not for any public or commercial use",
public void ConfigureServices(IServiceCollection services)
{
var loggingConfig = new LoggingConfig();
Configuration.Bind("loggingSettings", loggingConfig); // binding here
services.AddSingleton(loggingConfig);
}
@PradeepLoganathan
PradeepLoganathan / main.tf
Created May 18, 2020 21:51
Creating a windows virtual machine using Terraform. Part of the blog post
provider "azurerm" {
version = "=2.8.0"
features {}
}
#create the resource group
resource "azurerm_resource_group" "rg" {
name = "ateam-resource-group"
location = "australiaeast"
}
@PradeepLoganathan
PradeepLoganathan / install.ps1
Created May 18, 2020 02:40
nuget package for dependency injection
Install-Package Microsoft.Extensions.DependencyInjection
@PradeepLoganathan
PradeepLoganathan / LoggingConfig.cs
Last active June 3, 2020 07:06
logging config class
class LoggingConfig
{
public string LogPath {get;set;}
public LogLevel Level {get;set;}
}
terraform apply -var="location=australiaeast" -var "vnet_address_space=[`"10.0.0.0/16`"]"
##create the network interface for the VM
resource "azurerm_public_ip" "pub_ip" {
name = "vmpubip"
location = "australiaeast"
resource_group_name = azurerm_resource_group.rg.name
allocation_method = "Dynamic"
}
output "pip" {
description = "Public IP Address of Virtual Machine"
#create the resource group
resource "azurerm_resource_group" "rg" {
name = "ateam-resource-group"
location = var.location
}
#create the virtual network
resource "azurerm_virtual_network" "vnet1" {
resource_group_name = azurerm_resource_group.rg.name
location = var.location