Skip to content

Instantly share code, notes, and snippets.

View mayur-tendulkar's full-sized avatar
💭
Exploring Status

Mayur Tendulkar mayur-tendulkar

💭
Exploring Status
View GitHub Profile
@mayur-tendulkar
mayur-tendulkar / blog-dyte-rest-create-meeting.cs
Last active January 16, 2023 06:05
blog-dyte-rest-create-meeting
[HttpPost]
public async Task<IActionResult> Create(Meeting meeting)
{
// Check the provided meeting details
if (string.IsNullOrEmpty(meeting.Title))
return StatusCode(400);
var json = JsonSerializer.Serialize(meeting);
var content = new StringContent(json, Encoding.UTF8, "application/json");
@mayur-tendulkar
mayur-tendulkar / blog-dyte-rest-api-04.json
Created January 10, 2023 08:01
blog-dyte-rest-api-04
{
"success": true,
"data": {
"id": "813432c7-3c5a-45e2-9acf-eef7061c7584",
"associated_id": "6bf2b8be-04dd-4191-b602-1128921a306b",
"type": "meeting",
"status": "LIVE",
"live_participants": 1,
"max_concurrent_participants": 2,
"minutes_consumed": 2.3434,
@mayur-tendulkar
mayur-tendulkar / blog-dyte-rest-api-03
Created January 10, 2023 06:18
blog-dyte-rest-api-03
curl --request POST \
--url https://api.cluster.dyte.in/v2/meetings/meeting_id/participants \
--header 'Authorization: Basic ZGJhOWFhZTMtNGU4ZS00MDY3LTgyZjktMWYzMzRkMGQ3YzQwOg==' \
--header 'Content-Type: application/json' \
--data '{
"name": "Mary Sue",
"picture": "https://i.imgur.com/test.jpg",
"preset_name": "string",
"client_specific_id": "string"
}'
@mayur-tendulkar
mayur-tendulkar / blog-dyte-rest-api-02.json
Last active January 10, 2023 06:15
blog-dyte-rest-api-02
{
"success": true,
"data": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"preferred_region": "ap-south-1",
"record_on_start": true,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
}
@mayur-tendulkar
mayur-tendulkar / blog-dyte-rest-api-01
Created January 10, 2023 06:12
blog-dyte-rest-api-01
curl --request POST \
--url https://api.cluster.dyte.in/v2/meetings \
--header 'Authorization: Basic ZGJhOWFhZTMtNGU4ZS00MDY3LTgyZjktMWYzMzRkMGQ3YzQwOg==' \
--header 'Content-Type: application/json' \
--data '{
"title": "title-of-the-meeting",
"preferred_region": "ap-south-1",
"record_on_start": false
}'
@mayur-tendulkar
mayur-tendulkar / CreateVM.cs
Created December 25, 2018 10:59
Create VM using Fluent API
var windowsVM = azure.VirtualMachines.Define("myWindowsVM")
.WithRegion(Region.US_EAST)
.WithNewResourceGroup(rgName)
.WithNewPrimaryNetwork("10.0.0.0/28")
.WithPrimaryPrivateIpAddressDynamic()
.WithNewPrimaryPublicIpAddress("mywindowsvmdns")
.WithPopularWindowsImage(KnownWindowsVirtualMachineImage.WINDOWS_SERVER_2012_R2_DATACENTER)
.WithAdminUserName("tirekicker")
.WithPassword(password)
.WithSize(VirtualMachineSizeTypes.StandardD3V2)
@mayur-tendulkar
mayur-tendulkar / StorageHttpsPolicyFunction.cs
Created December 25, 2018 10:08
Azure Function for Storage Account HTTPs Only Policy
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Azure.Management.Fluent;
using Microsoft.Azure.Management.ResourceManager.Fluent;
@mayur-tendulkar
mayur-tendulkar / AlertFormat.json
Created December 25, 2018 09:32
Activity Log Alert Format
{
"schemaId": "Microsoft.Insights/activityLogs",
"data": {
"status": "Activated",
"context": {
"activityLog": {
"authorization": {
"action": "Microsoft.Storage/storageAccounts/write",
"scope": "/subscriptions/<subcription-id-hidden>/resourceGroups/SubscriptionMonitoring/providers/Microsoft.Storage/storageAccounts/submonstore"
},
@mayur-tendulkar
mayur-tendulkar / AZR-ListAllAzureServicesNew.cs
Created July 11, 2018 09:20
AZR-ListAllAzureServicesNew
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Fetching service listing...");
Console.ReadKey();
Task.Run(async () => FetchRecords());
Console.ReadKey();
}
@mayur-tendulkar
mayur-tendulkar / ARM-Blog-GetUsage.cs
Created February 7, 2016 02:47
ARM-Blog-GetUsage
var requestUrl = String.Format("https://management.azure.com/subscriptions/{0}/providers/Microsoft.Commerce/UsageAggregates?
api-version=2015-06-01-preview&reportedStartTime={1}&reportedEndTime={2}&aggregationGranularity=Daily&showDetails=false",
App.SelectedSubscription.SubscriptionId, startTime, endTime);
var usageData = await client.GetStringAsync (requestUrl);
var data = JsonConvert.DeserializeObject<AzureTracker.Model.UsageResponse> (usageData);