mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
Merge pull request #485 from JocaPC/master
Updating Create JumpboxVm for Managed Instance
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<!-- PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback -->
|
||||
@@ -6,17 +6,8 @@
|
||||
<AssemblyOriginatorKeyFile>hrkljush.snk</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Remove="Areas\**" />
|
||||
<Compile Remove="SqlServerRestApi\**" />
|
||||
<Compile Remove="wwwroot\public\**" />
|
||||
<Content Remove="Areas\**" />
|
||||
<Content Remove="SqlServerRestApi\**" />
|
||||
<Content Remove="wwwroot\public\**" />
|
||||
<EmbeddedResource Remove="Areas\**" />
|
||||
<EmbeddedResource Remove="SqlServerRestApi\**" />
|
||||
<EmbeddedResource Remove="wwwroot\public\**" />
|
||||
<None Remove="Areas\**" />
|
||||
<None Remove="SqlServerRestApi\**" />
|
||||
<None Remove="wwwroot\public\**" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
<#@ output extension=".yaml"#>
|
||||
<#@ assembly name="Newtonsoft.Json" #>
|
||||
<#@ template language="C#" hostspecific="True" #>
|
||||
<#
|
||||
var o = Newtonsoft.Json.Linq.JObject.Parse(System.IO.File.ReadAllText(this.Host.ResolvePath("..") + "\\appsettings.json"));
|
||||
var json = o["ApiModel"].ToString();
|
||||
TableDef[] config = Newtonsoft.Json.JsonConvert.DeserializeObject<TableDef[]>(json);
|
||||
#>
|
||||
swagger: "2.0"
|
||||
info:
|
||||
description: "OData service exposing information from WideWorldImporters database."
|
||||
version: "1.0.0"
|
||||
title: "Wide World Importers"
|
||||
termsOfService: "http://swagger.io/terms/"
|
||||
contact:
|
||||
email: "sqlserversamples@microsoft.com"
|
||||
license:
|
||||
name: "Apache 2.0"
|
||||
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
|
||||
host: "localhost:64958"
|
||||
basePath: "/OData"
|
||||
tags:
|
||||
<# foreach(var t in config) {#>
|
||||
<# if(string.IsNullOrEmpty(t.ODataColumns)) continue; #>
|
||||
- name: "<#= t.Table #>"
|
||||
description: "Information about <#= t.Table #>"
|
||||
<# } #>
|
||||
schemes:
|
||||
- "https"
|
||||
- "http"
|
||||
paths:
|
||||
<# foreach(var t in config) {#>
|
||||
<# if(string.IsNullOrEmpty(t.ODataColumns)) continue; #>
|
||||
|
||||
/<#= t.Table #>:
|
||||
get:
|
||||
tags:
|
||||
- "<#= t.Table #>"
|
||||
summary: "Find information about <#= t.Table #>"
|
||||
description: "Multiple status values can be provided with comma separated strings"
|
||||
operationId: "<#= t.Table #>"
|
||||
produces:
|
||||
- "application/json"
|
||||
parameters:
|
||||
- name: "$select"
|
||||
in: "query"
|
||||
description: "Selecting the properties that should be returned by service"
|
||||
required: false
|
||||
type: "array"
|
||||
items:
|
||||
type: "string"
|
||||
enum:<# foreach(var c in t.ODataColumns.Split(',')) {#>
|
||||
- "<#= c #>"<# } #>
|
||||
collectionFormat: "multi"
|
||||
- name: "$orderby"
|
||||
in: "query"
|
||||
description: "Ordering results by properties"
|
||||
required: false
|
||||
type: "array"
|
||||
items:
|
||||
type: "string"
|
||||
enum:<# foreach(var c in t.ODataColumns.Split(',')) {#>
|
||||
- "<#= c #>"
|
||||
- "<#= c #> asc"
|
||||
- "<#= c #> desc"<# } #>
|
||||
collectionFormat: "multi"
|
||||
- name: "$top"
|
||||
in: "query"
|
||||
description: "Selecting the properties that should be returned by service"
|
||||
required: false
|
||||
type: "integer"
|
||||
- name: "$skip"
|
||||
in: "query"
|
||||
description: "Selecting the properties that should be returned by service"
|
||||
required: false
|
||||
type: "integer"
|
||||
- name: "$apply"
|
||||
in: "query"
|
||||
description: "aggregation function that should be applied on the results"
|
||||
required: false
|
||||
type: "string"
|
||||
- name: "$filter"
|
||||
in: "query"
|
||||
description: "Condition that returned items must satisfy"
|
||||
required: false
|
||||
type: "string"
|
||||
responses:
|
||||
200:
|
||||
description: "Provided information about <#= t.Table #>."
|
||||
400:
|
||||
description: "The OData request is not valid"
|
||||
500:
|
||||
description: "Cannot process request"<# } #>
|
||||
<#+
|
||||
public class TableDef {
|
||||
public string Schema {get; set;}
|
||||
public string Table {get; set;}
|
||||
public string ODataColumns {get; set;}
|
||||
public bool IsReadOnly {get; set;}
|
||||
}
|
||||
#>
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user