initial (#1)
* init * cleanuo * finetune * finetune * finetune * fixed tests
This commit is contained in:
Родитель
c0a94ca8ab
Коммит
4c787deecf
|
@ -286,3 +286,5 @@ __pycache__/
|
|||
*.btm.cs
|
||||
*.odx.cs
|
||||
*.xsd.cs
|
||||
|
||||
package-lock.json
|
|
@ -0,0 +1,489 @@
|
|||
through = require 'through2'
|
||||
util = require 'util'
|
||||
|
||||
|
||||
# place an object into global namespace
|
||||
global['Import'] = (object) ->
|
||||
for key, value of object
|
||||
global[key] = value
|
||||
|
||||
Import
|
||||
# require into the global namespace (modulename = module)
|
||||
Install: (modulename, module) ->
|
||||
global[modulename] = require module or modulename
|
||||
|
||||
# require a gulp-Plugin into the global namespace
|
||||
Plugin: () ->
|
||||
Install module,"gulp-#{module}" for module in arguments
|
||||
|
||||
# require a module, placing exports into global namespace
|
||||
Include: () ->
|
||||
Import require module for module in arguments
|
||||
|
||||
Tasks: () ->
|
||||
require "#{__dirname}/#{module}" for module in arguments
|
||||
|
||||
###############################################
|
||||
# force-global a bunch of stuff.
|
||||
require 'shelljs/global'
|
||||
Install 'marked'
|
||||
Install 'vinyl'
|
||||
Install 'os'
|
||||
Install 'path'
|
||||
Install 'fs'
|
||||
Install 'gulp'
|
||||
Install 'util'
|
||||
Install 'moment'
|
||||
Install 'chalk'
|
||||
Install 'yargs'
|
||||
Install 'semver'
|
||||
|
||||
Install 'eol', 'gulp-line-ending-corrector'
|
||||
Install 'through', 'through2-parallel'
|
||||
Install 'run', 'run-sequence'
|
||||
|
||||
# do a bit of monkeypatching
|
||||
_gulpStart = gulp.Gulp::start
|
||||
_runTask = gulp.Gulp::_runTask
|
||||
|
||||
gulp.Gulp::start = (taskName) ->
|
||||
@currentStartTaskName = taskName
|
||||
_gulpStart.apply this, arguments
|
||||
return
|
||||
|
||||
gulp.Gulp::_runTask = (task) ->
|
||||
@currentRunTaskName = task.name
|
||||
_runTask.apply this, arguments
|
||||
return
|
||||
|
||||
# echo 'this.currentStartTaskName: ' + this.currentStartTaskName
|
||||
# echo 'this.currentRunTaskName: ' + this.currentRunTaskName
|
||||
|
||||
# bring some gulp-Plugins along
|
||||
# Plugin 'filter',
|
||||
# 'zip'
|
||||
#'unzip'
|
||||
#'rename'
|
||||
|
||||
# force this into global namespace
|
||||
global['argv'] = yargs.argv
|
||||
|
||||
fs = require('fs')
|
||||
path = require('path')
|
||||
|
||||
concurrency = 0
|
||||
queue = []
|
||||
global.completed = []
|
||||
vfs = require('vinyl-fs');
|
||||
|
||||
module.exports =
|
||||
# lets us just handle each item in a stream easily.
|
||||
foreach: (delegate) ->
|
||||
through.obj { concurrency: threshold }, ( each, enc, done ) ->
|
||||
delegate each, done, this
|
||||
|
||||
count: (result,passthru) =>
|
||||
foreach (each,done) =>
|
||||
result++
|
||||
done null
|
||||
|
||||
hashCode: (s) ->
|
||||
(s.split('').reduce ((a, b) ->
|
||||
a = (a << 5) - a + b.charCodeAt(0)
|
||||
a & a
|
||||
), 0 ) .toString(16)
|
||||
|
||||
toArray: (result,passthru) =>
|
||||
foreach (each,done) =>
|
||||
result.push(each)
|
||||
if passthru
|
||||
done null, each
|
||||
else
|
||||
done null
|
||||
|
||||
showFiles: () ->
|
||||
foreach (each,done) ->
|
||||
echo info each.path
|
||||
done null, each
|
||||
|
||||
onlyFiles: () ->
|
||||
foreach (each,done) ->
|
||||
return done null, each if fs.statSync(each.path).isFile()
|
||||
done null
|
||||
|
||||
source: (globs, options ) ->
|
||||
options = options or { }
|
||||
options.follow = true
|
||||
vfs.src( globs, options)
|
||||
|
||||
watchFiles: (src,tasks) ->
|
||||
return gulp.watch( src,tasks)
|
||||
|
||||
destination: (globs, options ) ->
|
||||
gulp.dest( globs, options)
|
||||
|
||||
later: (fn) ->
|
||||
setTimeout fn, 10
|
||||
|
||||
mklink: (link,target) ->
|
||||
# unlink link
|
||||
if ! test "-d", link
|
||||
fs.symlinkSync target, link, "junction"
|
||||
|
||||
unlink: (link) ->
|
||||
if test "-d", link
|
||||
fs.unlinkSync link
|
||||
|
||||
erase: (file) ->
|
||||
if test "-f", file
|
||||
fs.unlinkSync file
|
||||
|
||||
task: (name, description, deps, fn) ->
|
||||
throw "Invalid task name " if typeof name isnt 'string'
|
||||
throw "Invalid task description #{name} " if typeof description isnt 'string'
|
||||
|
||||
if typeof deps == 'function'
|
||||
fn = deps
|
||||
deps = []
|
||||
|
||||
# chain the task if it's a repeat
|
||||
if name of gulp.tasks
|
||||
prev = gulp.tasks[name]
|
||||
|
||||
# reset the name of this task to be a 'child'' task
|
||||
name = "#{name}/#{description}"
|
||||
description = ''
|
||||
|
||||
# add this task as a dependency of the original task.
|
||||
prev.dep.unshift name
|
||||
|
||||
# add the new task.
|
||||
# gulp.task name, deps, fn
|
||||
skip = (name.startsWith "init") or (name.startsWith "npm-install") or (name.startsWith "clean") or (name is "copy-dts-files") or (name.startsWith "nuke") or (name.startsWith "reset") or (name.startsWith "autorest") or description.endsWith("!")
|
||||
|
||||
description = '' if description = '!'
|
||||
|
||||
if !skip
|
||||
deps.unshift "init"
|
||||
|
||||
if fn.length # see if the task function has arguments (betcha never saw that before!)
|
||||
gulp.task name, deps, (done)->
|
||||
if not global.completed[name]
|
||||
#echo warning "Running task #{name} #{typeof done}"
|
||||
global.completed[name] = true
|
||||
return fn(done)
|
||||
#echo warning "Skipping completed task #{name}"
|
||||
return done()
|
||||
else
|
||||
gulp.task name, deps, ()->
|
||||
if not global.completed[name]
|
||||
#echo warning "Running task #{name}"
|
||||
global.completed[name] = true
|
||||
return fn()
|
||||
#echo warning "Skipping completed task #{name}"
|
||||
return null
|
||||
|
||||
|
||||
# set the description
|
||||
gulp.tasks[name].description = description
|
||||
|
||||
return
|
||||
|
||||
where: (predicate) ->
|
||||
foreach (each,done) ->
|
||||
#return done null if each?
|
||||
return done null, each if predicate each
|
||||
done null
|
||||
|
||||
splitPath: (path) ->
|
||||
s = path.match /^(.+)[\\\/]([^\/]+)$/ or [path, '',path]
|
||||
f = s[2].match(/^(.*)([\\.].*)$/ ) or [s[2],s[2],'']
|
||||
d = (path.match /^(.:)[\\\/]?(.*)$/ ) or ['','',path]
|
||||
return {
|
||||
fullname : path
|
||||
folder : s[1]
|
||||
filename : s[2]
|
||||
basename : f[1]
|
||||
extension : f[2]
|
||||
drive: d[1] or ''
|
||||
folders: (d[2].split /[\\\/]/ )or path
|
||||
}
|
||||
|
||||
folder: (path) ->
|
||||
return '' if not path
|
||||
return (splitPath path).folder
|
||||
|
||||
split: (path) ->
|
||||
return '' if not path
|
||||
return (splitPath path).folders
|
||||
|
||||
filename: (path) ->
|
||||
return '' if not path
|
||||
p = splitPath path
|
||||
return p.filename
|
||||
|
||||
extension: (path) ->
|
||||
return '' if not path
|
||||
p = splitPath path
|
||||
return p.extension
|
||||
|
||||
basename: (path) ->
|
||||
return '' if not path
|
||||
p = splitPath path
|
||||
return p.basename
|
||||
|
||||
exists: (path) ->
|
||||
return test '-f', path
|
||||
|
||||
fileExists: (path) ->
|
||||
return test '-f', path
|
||||
|
||||
dirExists: (path) ->
|
||||
return test '-d', path
|
||||
|
||||
newer: (first,second) ->
|
||||
return true if (!test "-d", second) and (!test "-f", second)
|
||||
return false if (!test "-d",first) and (!test "-f", first)
|
||||
f = fs.statSync(first).mtime
|
||||
s = fs.statSync(second).mtime
|
||||
return f > s
|
||||
|
||||
flattenEncode: (path) ->
|
||||
path.basename = "#{ path.dirname.replace(/[\/\\]/g, '_') }_#{path.basename}"
|
||||
path.dirname = ""
|
||||
|
||||
flattenDecode: (path) ->
|
||||
f = path.basename.match(/^(.*)_(.*)$/ )
|
||||
path.basename = "#{f[1].replace(/[_]/g, '/') }/#{f[2]}"
|
||||
path.dirname = ""
|
||||
|
||||
except: (match) ->
|
||||
# await through.obj defer file, enc, callback
|
||||
through.obj (file, enc, callback) ->
|
||||
|
||||
# check if the file is an actual file.
|
||||
# if it's not, just skip this tool.
|
||||
if !file or !file.path
|
||||
return callback null, file
|
||||
|
||||
# do something with the file
|
||||
if file.path.match( match )
|
||||
return callback null
|
||||
|
||||
return callback null, file
|
||||
|
||||
|
||||
rmfile: (dir, file, callback) ->
|
||||
p = path.join(dir, file)
|
||||
fs.lstat p, (err, stat) ->
|
||||
if err
|
||||
callback.call null, err
|
||||
else if stat.isDirectory()
|
||||
rmdir p, callback
|
||||
else
|
||||
fs.unlink p, callback
|
||||
return
|
||||
return
|
||||
|
||||
rmdir: (dir, callback) ->
|
||||
#echo "RMDIR #{dir}"
|
||||
fs.readdir dir, (err, files) ->
|
||||
if err
|
||||
callback.call null, err
|
||||
else if files.length
|
||||
i = undefined
|
||||
j = undefined
|
||||
i = j = files.length
|
||||
while i--
|
||||
rmfile dir, files[i], (err) ->
|
||||
if err
|
||||
callback.call null, err
|
||||
else if --j == 0
|
||||
fs.rmdir dir, callback
|
||||
return
|
||||
else
|
||||
fs.rmdir dir, callback
|
||||
return
|
||||
return
|
||||
|
||||
guid: ->
|
||||
x = -> Math.floor((1 + Math.random()) * 0x10000).toString(16).substring 1
|
||||
"#{x()}#{x()}-#{x()}-#{x()}-#{x()}-#{x()}#{x()}#{x()}"
|
||||
|
||||
Fail: (text) ->
|
||||
echo ""
|
||||
echo "#{ error 'Task Failed:' } #{error_message text}"
|
||||
echo ""
|
||||
rm '-rf', workdir
|
||||
process.exit(1)
|
||||
|
||||
execute: (cmdline,options,callback, ondata)->
|
||||
if typeof options == 'function'
|
||||
ondata = callback
|
||||
callback = options
|
||||
options = { }
|
||||
|
||||
# if we're busy, schedule again...
|
||||
if concurrency >= threshold
|
||||
queue.push(->
|
||||
execute cmdline, options, callback, ondata
|
||||
)
|
||||
return
|
||||
|
||||
concurrency++
|
||||
|
||||
options.cwd = options.cwd or basefolder
|
||||
echo " #{quiet_info options.cwd} :: #{info cmdline}" if !options.silent
|
||||
|
||||
options.silent = !verbose
|
||||
|
||||
proc = exec cmdline, options, (code,stdout,stderr)->
|
||||
concurrency--
|
||||
|
||||
if code and (options.retry or 0) > 0
|
||||
echo warning "retrying #{options.retry} #{options.cwd}/#{cmdline}"
|
||||
options.retry--
|
||||
return execute cmdline,options,callback,ondata
|
||||
|
||||
|
||||
# run the next one in the queue
|
||||
if queue.length
|
||||
fn = (queue.shift())
|
||||
fn()
|
||||
|
||||
if code and !options.ignoreexitcode
|
||||
echo error "Exec Failed #{quiet_info options.cwd} :: #{info cmdline}"
|
||||
if( stderr.length )
|
||||
echo error "(stderr)"
|
||||
echo marked ">> #{error stderr}"
|
||||
if( stdout.length )
|
||||
echo warning "(stdout)"
|
||||
echo warning stdout
|
||||
|
||||
Fail "Execute Task failed, fast exit"
|
||||
callback(code,stdout,stderr)
|
||||
|
||||
proc.stdout.on 'data', ondata if ondata
|
||||
return proc
|
||||
|
||||
autorest: (args,done,ignoreexitcode) ->
|
||||
echo info "Queuing up: AutoRest #{args.join(' ')}"
|
||||
execute "autorest \"--use=#{basefolder}\" #{args.map((a) -> "\"#{a}\"").join(' ')}" , {silent:true, ignoreexitcode: ignoreexitcode || false}, (code,stdout,stderr) ->
|
||||
return done(code,stdout,stderr)
|
||||
|
||||
# build task for global build
|
||||
module.exports.task 'build', 'builds project', ->
|
||||
echo "Building project in #{basefolder}"
|
||||
|
||||
module.exports.task 'clean', 'cleans the project files', ->
|
||||
|
||||
module.exports.task 'regenerate', 'regenerates expected files for testing', ->
|
||||
|
||||
|
||||
# task for vs code
|
||||
module.exports.task 'code', 'launches vs code', ->
|
||||
exec "code #{basefolder}"
|
||||
|
||||
module.exports.task 'release-only', '', (done)->
|
||||
Fail( "This command requires --configuration release" ) if configuration isnt "Release"
|
||||
done()
|
||||
|
||||
configString = (s)->
|
||||
"#{s.charAt 0 .toUpperCase()}#{s.slice 1 .toLowerCase() }"
|
||||
|
||||
# bring current module into global namespace.
|
||||
Import module.exports
|
||||
|
||||
###############################################
|
||||
# Global values
|
||||
process.env["autorest.home"] = path.normalize("#{os.tmpdir()}/autorest#{hashCode(basefolder)}")
|
||||
process.env.tmp = process.env.tmp or "#{basefolder}/tmp"
|
||||
|
||||
package_json = require("#{basefolder}/package.json")
|
||||
|
||||
|
||||
Import
|
||||
stable: argv.stable or false
|
||||
configuration: if argv.configuration then configString( argv.configuration) else (if argv.release then 'Release' else 'Debug')
|
||||
github_apikey: argv.github_apikey or process.env.GITHUB_APIKEY or null
|
||||
nuget_apikey: argv.nuget_apikey or process.env.NUGET_APIKEY or null
|
||||
npm_apikey: argv.npm_apikey or process.env.NPM_APIKEY or null
|
||||
autorest_home: process.env["autorest.home"]
|
||||
today: moment().format('YYYYMMDD')
|
||||
now: moment().format('YYYYMMDD-HHmm')
|
||||
force: argv.force or false
|
||||
threshold: argv.threshold or ((os.cpus().length)-1) or 1
|
||||
verbose: argv.verbose or null
|
||||
workdir: "#{process.env.tmp}/gulp/#{module.exports.guid()}"
|
||||
watch: argv.watch or false
|
||||
|
||||
mkdir "-p", workdir if !test "-d", workdir
|
||||
|
||||
###############################################
|
||||
# UI stuff
|
||||
TerminalRenderer = require('marked-terminal')
|
||||
marked.setOptions {
|
||||
renderer: new TerminalRenderer({
|
||||
heading: chalk.green.bold,
|
||||
firstHeading: chalk.green.bold,
|
||||
showSectionPrefix: false,
|
||||
strong: chalk.bold.cyan,
|
||||
em: chalk.cyan,
|
||||
blockquote: chalk.magenta,
|
||||
tab: 2
|
||||
})
|
||||
}
|
||||
|
||||
set '+e'
|
||||
|
||||
Import
|
||||
error: chalk.bold.red
|
||||
error_message: chalk.bold.cyan
|
||||
warning: chalk.bold.yellow
|
||||
info: chalk.bold.green
|
||||
quiet_info: chalk.green
|
||||
|
||||
###############################################
|
||||
task 'default','', ->
|
||||
cmds = ""
|
||||
|
||||
for name, t of gulp.tasks
|
||||
cmds += "\n gulp **#{name}** - #{t.description}" if t.description? and t.description.length
|
||||
switches = ""
|
||||
|
||||
echo marked """
|
||||
|
||||
# Usage
|
||||
|
||||
## gulp commands
|
||||
#{cmds}
|
||||
|
||||
## available switches
|
||||
*--force* specify when you want to force an action (restore, etc)
|
||||
*--configuration* 'debug' or 'release'
|
||||
*--release* same as --configuration=release
|
||||
*--nightly* generate label for package as 'YYYYMMDD-0000-nightly'
|
||||
*--preview* generate label for package as 'YYYYMMDD-HHmm-preview'
|
||||
*--verbose* enable verbose output
|
||||
*--threshold=nn* set parallelism threshold (default = 10)
|
||||
|
||||
#{switches}
|
||||
"""
|
||||
|
||||
task 'test', "Run Tests", ->
|
||||
|
||||
task 'fix-line-endings', 'Fixes line endings to file-type appropriate values.', ->
|
||||
source "**/*.iced"
|
||||
.pipe eol {eolc: 'LF', encoding:'utf8'}
|
||||
.pipe destination '.'
|
||||
|
||||
task 'version-number', '!', (done)->
|
||||
if argv.version
|
||||
global.version = argv.version if argv.version
|
||||
done();
|
||||
else
|
||||
# git rev-list --parents HEAD --count --full-history
|
||||
execute "git rev-list --parents HEAD --count --full-history" , {silent:true}, (c,o,e)->
|
||||
pv = (package_json.version).trim()
|
||||
global.version = "#{semver.major(pv)}.#{semver.minor(pv)}.#{o.trim()}"
|
||||
done();
|
|
@ -0,0 +1,70 @@
|
|||
|
||||
# ==============================================================================
|
||||
# file selections
|
||||
|
||||
Import
|
||||
projects:() ->
|
||||
source '**/*.csproj'
|
||||
.pipe except /preview/ig
|
||||
|
||||
# test projects
|
||||
tests:() ->
|
||||
source '**/*[Tt]est.csproj'
|
||||
|
||||
# ==============================================================================
|
||||
# Functions
|
||||
|
||||
dotnet = (cmd) ->
|
||||
foreach (file, callback) ->
|
||||
# check if the file is an actual file.
|
||||
# if it's not, just skip this tool.
|
||||
if !file or !file.path
|
||||
return callback null, file
|
||||
|
||||
# do something with the file
|
||||
await execute "dotnet #{cmd} #{ file.path } /nologo", defer code,stdout,stderr
|
||||
# Fail "dotnet #{cmd} failed" if code
|
||||
# or just done, no more processing
|
||||
return callback null
|
||||
|
||||
# ==============================================================================
|
||||
# Tasks
|
||||
|
||||
|
||||
task 'build','dotnet',['restore'], (done) ->
|
||||
execute "dotnet build -c #{configuration} #{solution} /nologo /clp:NoSummary", (code, stdout, stderr) ->
|
||||
execute "dotnet publish -c #{configuration} #{sourceFolder} --output #{sourceFolder}/bin/netcoreapp2.0 /nologo /clp:NoSummary ", (code, stdout, stderr) ->
|
||||
done()
|
||||
|
||||
task 'clear-cache-on-force', '', (done)->
|
||||
if global.force
|
||||
execute "dotnet nuget locals http-cache --clear", (c,o,e) ->
|
||||
done()
|
||||
else
|
||||
done()
|
||||
|
||||
task 'restore','restores the dotnet packages for the projects',['clear-cache-on-force'], (done) ->
|
||||
|
||||
if ! test '-d', "#{os.homedir()}/.nuget"
|
||||
global.force = true
|
||||
|
||||
projects()
|
||||
.pipe where (each) -> # check for project.assets.json files are up to date
|
||||
rm "#{folder each.path}/obj/project.assets.json" if (force and test '-f', "#{folder each.path}/obj/project.assets.json")
|
||||
return true if force
|
||||
assets = "#{folder each.path}/obj/project.assets.json"
|
||||
return false if (exists assets) and (newer assets, each.path)
|
||||
return true
|
||||
.pipe foreach (each,done)->
|
||||
execute "dotnet restore #{ each.path } /nologo", {retry:1},(code,stderr,stdout) ->
|
||||
done()
|
||||
|
||||
task 'test', 'dotnet', ['restore'] , (done) ->
|
||||
# run xunit test in parallel with each other.
|
||||
tests()
|
||||
.pipe foreach (each,done)->
|
||||
execute "dotnet test #{ each.path } /nologo",{retry:1}, (code,stderr,stdout) ->
|
||||
done()
|
||||
|
||||
# the dotnet gulp-plugin.
|
||||
module.exports = dotnet
|
|
@ -0,0 +1,24 @@
|
|||
require './common.iced'
|
||||
|
||||
# ==============================================================================
|
||||
# tasks required for this build
|
||||
Tasks "dotnet" # dotnet functions
|
||||
Tasks "regeneration"
|
||||
|
||||
# ==============================================================================
|
||||
# Settings
|
||||
Import
|
||||
initialized: false
|
||||
solution: "#{basefolder}/autorest.azureresourceschema.sln"
|
||||
sourceFolder: "#{basefolder}/src/"
|
||||
|
||||
# ==============================================================================
|
||||
# Tasks
|
||||
|
||||
task 'init', "" ,(done)->
|
||||
Fail "YOU MUST HAVE NODEJS VERSION GREATER THAN 7.10.0" if semver.lt( process.versions.node , "7.10.0" )
|
||||
done()
|
||||
|
||||
# Run language-specific tests:
|
||||
task 'test', "more", [], (done) ->
|
||||
done();
|
|
@ -0,0 +1,76 @@
|
|||
|
||||
###############################################
|
||||
# LEGACY
|
||||
# Instead: have bunch of configuration files sitting in a well-known spot, discover them, feed them to AutoRest, done.
|
||||
|
||||
regenExpected = (opts,done) ->
|
||||
outputDir = if !!opts.outputBaseDir then "#{opts.outputBaseDir}/#{opts.outputDir}" else opts.outputDir
|
||||
keys = Object.getOwnPropertyNames(opts.mappings)
|
||||
instances = keys.length
|
||||
|
||||
for kkey in keys
|
||||
optsMappingsValue = opts.mappings[kkey]
|
||||
key = kkey.trim();
|
||||
|
||||
swaggerFiles = (if optsMappingsValue instanceof Array then optsMappingsValue[0] else optsMappingsValue).split(";")
|
||||
args = [
|
||||
"--#{opts.language}",
|
||||
"--output-folder=#{outputDir}/#{key}",
|
||||
"--license-header=#{if !!opts.header then opts.header else 'MICROSOFT_MIT_NO_VERSION'}"
|
||||
]
|
||||
|
||||
for swaggerFile in swaggerFiles
|
||||
args.push("--input-file=#{if !!opts.inputBaseDir then "#{opts.inputBaseDir}/#{swaggerFile}" else swaggerFile}")
|
||||
|
||||
autorest args,() =>
|
||||
instances--
|
||||
return done() if instances is 0
|
||||
|
||||
task 'regenerate', '', (done) ->
|
||||
regenExpected {
|
||||
'outputBaseDir': 'test',
|
||||
'inputBaseDir': 'test/Resource/Swagger',
|
||||
'mappings': {
|
||||
'ApiManagement':'ApiManagement/2016-07-07/apimanagement.json',
|
||||
'Batch':'Batch/2015-12-01/BatchManagement.json',
|
||||
'CDN':'CDN/2015-06-01/cdn.json',
|
||||
'CDN ':'CDN/2016-04-02/cdn.json',
|
||||
'CognitiveServices':'CognitiveServices/2016-02-01-preview/cognitiveservices.json',
|
||||
'CommitmentPlans':'CommitmentPlans/2016-05-01-preview/commitmentPlans.json',
|
||||
'Compute':'Compute/2015-06-15/compute.json',
|
||||
'Compute ':'Compute/2016-03-30/compute.json',
|
||||
'ContainerService':'ContainerService/2016-03-30/containerService.json',
|
||||
'DataLakeAnalytics':'DataLakeAnalytics/2015-10-01-preview/account.json',
|
||||
'DataLakeStore':'DataLakeStore/2015-10-01-preview/account.json',
|
||||
'DevTestLabs':'DevTestLabs/2015-05-21-preview/DTL.json',
|
||||
'DNS':'DNS/2015-05-04-preview/dns.json',
|
||||
'DNS ':'DNS/2016-04-01/dns.json',
|
||||
'Insights':'Insights/2016-03-01/insightsManagementClient.json',
|
||||
'Logic':'Logic/2015-02-01-preview/logic.json',
|
||||
'Logic ':'Logic/2016-06-01/logic.json',
|
||||
'MachineLearning':'MachineLearning/2016-05-01-preview/webservices.json',
|
||||
'MobileEngagement':'MobileEngagement/2014-12-01/mobile-engagement.json',
|
||||
'Network':'Network/2015-05-01-preview/network.json',
|
||||
'Network ':'Network/2015-06-15/network.json',
|
||||
'Network ':'Network/2016-03-30/network.json',
|
||||
'Network ':'Network/2016-09-01/network.json',
|
||||
'NotificationHubs':'NotificationHubs/2016-03-01/notificationhubs.json',
|
||||
'PowerBIEmbedded':'PowerBIEmbedded/2016-01-29/powerbiembedded.json',
|
||||
'RecoveryServices':'RecoveryServices/2016-06-01/recoveryservices.json',
|
||||
'Redis':'Redis/2016-04-01/redis.json',
|
||||
'Resources/Locks':'Resources/Locks/2016-09-01/locks.json',
|
||||
'Resources/Resources':'Resources/Resources/2016-09-01/resources.json',
|
||||
'Scheduler':'Scheduler/2016-03-01/scheduler.json',
|
||||
'Search':'Search/2015-02-28/search.json',
|
||||
'ServerManagement':'ServerManagement/2016-07-01-preview/servermanagement.json',
|
||||
'ServiceBus':'ServiceBus/2015-08-01/servicebus.json',
|
||||
'Storage':'Storage/2015-05-01-preview/storage.json',
|
||||
'Storage ':'Storage/2015-06-15/storage.json',
|
||||
'Storage ':'Storage/2016-01-01/storage.json',
|
||||
'TrafficManager':'TrafficManager/2015-11-01/trafficmanager.json',
|
||||
'Web':'Web/2015-08-01/web.json'
|
||||
},
|
||||
'outputDir': 'Resource/Expected',
|
||||
'language': 'azureresourceschema'
|
||||
},done
|
||||
return null
|
|
@ -0,0 +1,7 @@
|
|||
.gulp/
|
||||
.vscode/
|
||||
test/
|
||||
gulpfile.js
|
||||
*.sln
|
||||
|
||||
src/obj/
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
// Use IntelliSense to find out which attributes exist for C# debugging
|
||||
// Use hover for the description of the existing attributes
|
||||
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": ".NET Core Attach",
|
||||
"type": "coreclr",
|
||||
"request": "attach",
|
||||
"processId": "${command:pickProcess}"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
// we use gulp. npm is just for show.
|
||||
"npm.autoDetect": "off",
|
||||
"[csharp]": {
|
||||
"editor.tabSize": 4
|
||||
},
|
||||
"[typescript]": {
|
||||
"editor.formatOnSave": true,
|
||||
"editor.formatOnPaste": true,
|
||||
"editor.tabSize": 2,
|
||||
"editor.detectIndentation": false
|
||||
},
|
||||
"[json]": {
|
||||
"editor.formatOnSave": true,
|
||||
"editor.formatOnPaste": true,
|
||||
"editor.tabSize": 2,
|
||||
"editor.detectIndentation": false
|
||||
},
|
||||
"files.associations": {
|
||||
"*.iced": "coffeescript"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||
// for the documentation about the tasks.json format
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"type": "gulp",
|
||||
"task": "test",
|
||||
"problemMatcher": [
|
||||
"$msCompile"
|
||||
],
|
||||
"group": {
|
||||
"kind": "test",
|
||||
"isDefault": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "gulp",
|
||||
"task": "build",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"problemMatcher": [
|
||||
"$msCompile"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
40
README.md
40
README.md
|
@ -12,3 +12,43 @@ provided by the bot. You will only need to do this once across all repos using o
|
|||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
||||
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
|
||||
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
||||
|
||||
# AutoRest extension configuration
|
||||
|
||||
``` yaml
|
||||
use-extension:
|
||||
"@microsoft.azure/autorest.modeler": "1.9.2" # keep in sync with package.json's dev dependency in order to have meaningful tests
|
||||
|
||||
pipeline:
|
||||
azureresourceschema/modeler:
|
||||
input: swagger-document/identity
|
||||
output-artifact: code-model-v1
|
||||
scope: azureresourceschema
|
||||
azureresourceschema/commonmarker:
|
||||
input: modeler
|
||||
output-artifact: code-model-v1
|
||||
azureresourceschema/cm/transform:
|
||||
input: commonmarker
|
||||
output-artifact: code-model-v1
|
||||
azureresourceschema/cm/emitter:
|
||||
input: transform
|
||||
scope: scope-cm/emitter
|
||||
azureresourceschema/generate:
|
||||
plugin: azureresourceschema
|
||||
input: cm/transform
|
||||
output-artifact: source-file-azureresourceschema
|
||||
azureresourceschema/transform:
|
||||
input: generate
|
||||
output-artifact: source-file-azureresourceschema
|
||||
scope: scope-transform-string
|
||||
azureresourceschema/emitter:
|
||||
input: transform
|
||||
scope: scope-azureresourceschema/emitter
|
||||
|
||||
scope-azureresourceschema/emitter:
|
||||
input-artifact: source-file-azureresourceschema
|
||||
output-uri-expr: $key
|
||||
|
||||
output-artifact:
|
||||
- source-file-azureresourceschema
|
||||
```
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26430.16
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "autorest.azureresourceschema", "src\autorest.azureresourceschema.csproj", "{9E857E16-C008-4202-8799-1119D29330B6}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "autorest.azureresourceschema.test", "test\autorest.azureresourceschema.test.csproj", "{98180E61-2D1D-1489-90A2-7B675F82E9D8}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{9E857E16-C008-4202-8799-1119D29330B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9E857E16-C008-4202-8799-1119D29330B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9E857E16-C008-4202-8799-1119D29330B6}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{9E857E16-C008-4202-8799-1119D29330B6}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{9E857E16-C008-4202-8799-1119D29330B6}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{9E857E16-C008-4202-8799-1119D29330B6}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{9E857E16-C008-4202-8799-1119D29330B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9E857E16-C008-4202-8799-1119D29330B6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9E857E16-C008-4202-8799-1119D29330B6}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{9E857E16-C008-4202-8799-1119D29330B6}.Release|x64.Build.0 = Release|Any CPU
|
||||
{9E857E16-C008-4202-8799-1119D29330B6}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{9E857E16-C008-4202-8799-1119D29330B6}.Release|x86.Build.0 = Release|Any CPU
|
||||
{98180E61-2D1D-1489-90A2-7B675F82E9D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{98180E61-2D1D-1489-90A2-7B675F82E9D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{98180E61-2D1D-1489-90A2-7B675F82E9D8}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{98180E61-2D1D-1489-90A2-7B675F82E9D8}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{98180E61-2D1D-1489-90A2-7B675F82E9D8}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{98180E61-2D1D-1489-90A2-7B675F82E9D8}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{98180E61-2D1D-1489-90A2-7B675F82E9D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{98180E61-2D1D-1489-90A2-7B675F82E9D8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{98180E61-2D1D-1489-90A2-7B675F82E9D8}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{98180E61-2D1D-1489-90A2-7B675F82E9D8}.Release|x64.Build.0 = Release|Any CPU
|
||||
{98180E61-2D1D-1489-90A2-7B675F82E9D8}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{98180E61-2D1D-1489-90A2-7B675F82E9D8}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,4 @@
|
|||
// set the base folder of this project
|
||||
global.basefolder = `${__dirname}`
|
||||
require ("rechoir").prepare(require('interpret').extensions, './.gulp/gulpfile.iced');
|
||||
require ('./.gulp/gulpfile.iced')
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"name": "@microsoft.azure/autorest.azureresourceschema",
|
||||
"version": "1.9.3",
|
||||
"description": "The Azure Resource Schema extension for classic generators in AutoRest.",
|
||||
"scripts": {
|
||||
"start": "dotnet src/bin/netcoreapp2.0/autorest.azureresourceschema.dll --server",
|
||||
"test": "gulp test",
|
||||
"build": "gulp build",
|
||||
"prepare": "gulp build",
|
||||
"clean": "gulp clean",
|
||||
"nuke": "git clean -xdf"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Azure/autorest.azureresourceschema"
|
||||
},
|
||||
"readme": "https://github.com/Azure/autorest.azureresourceschema/readme.md",
|
||||
"keywords": [
|
||||
"autorest",
|
||||
"classic-generators",
|
||||
"azureresourceschema"
|
||||
],
|
||||
"author": "Microsoft Corporation",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/Azure/autorest/issues"
|
||||
},
|
||||
"homepage": "https://github.com/Azure/autorest.azureresourceschema/blob/master/README.md",
|
||||
"devDependencies": {
|
||||
"@microsoft.azure/autorest.modeler": "1.9.2",
|
||||
"coffee-script": "^1.11.1",
|
||||
"dotnet-sdk-2.0.0": "^1.1.1",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-filter": "^5.0.0",
|
||||
"gulp-line-ending-corrector": "^1.0.1",
|
||||
"iced-coffee-script": "^108.0.11",
|
||||
"marked": "^0.3.6",
|
||||
"marked-terminal": "^2.0.0",
|
||||
"moment": "^2.17.1",
|
||||
"run-sequence": "*",
|
||||
"shx": "^0.2.2",
|
||||
"through2-parallel": "^0.1.3",
|
||||
"yargs": "^8.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"dotnet-2.0.0": "^1.1.0"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using AutoRest.Core;
|
||||
using AutoRest.Core.Model;
|
||||
using AutoRest.Core.Utilities.Collections;
|
||||
using static AutoRest.Core.Utilities.DependencyInjection;
|
||||
|
||||
namespace AutoRest.AzureResourceSchema
|
||||
{
|
||||
public class CodeGeneratorArs : CodeGenerator
|
||||
{
|
||||
public CodeGeneratorArs()
|
||||
{
|
||||
}
|
||||
|
||||
public override string ImplementationFileExtension => ".json";
|
||||
|
||||
public override string UsageInstructions => $"Your Azure Resource Schema(s) can be found in {Settings.Instance.OutputDirectory}";
|
||||
|
||||
public override async Task Generate(CodeModel serviceClient)
|
||||
{
|
||||
var apiVersions = serviceClient.Methods.Select(method => method.Parameters.FirstOrDefault(p => p.SerializedName == "api-version")?.DefaultValue.Value ).ConcatSingleItem(serviceClient.ApiVersion).Where(each => each!=null).Distinct().ToArray();
|
||||
|
||||
foreach(var version in apiVersions)
|
||||
{
|
||||
IDictionary<string, ResourceSchema> resourceSchemas = ResourceSchemaParser.Parse(serviceClient, version);
|
||||
|
||||
foreach (string resourceProvider in resourceSchemas.Keys)
|
||||
{
|
||||
StringWriter stringWriter = new StringWriter();
|
||||
ResourceSchemaWriter.Write(stringWriter, resourceSchemas[resourceProvider]);
|
||||
await Write(stringWriter.ToString(), Path.Combine(version, resourceProvider + ".json"), true);
|
||||
|
||||
stringWriter = new StringWriter();
|
||||
var md = ResourceMarkdownGenerator.Generate(resourceSchemas[resourceProvider]);
|
||||
|
||||
foreach (var m in md)
|
||||
{
|
||||
var content = m.Content.Replace("\"boolean\"", "boolean");
|
||||
// place nested topics in subdirectories
|
||||
await Write(content, Path.Combine(version, m.Type.Replace('_', Path.DirectorySeparatorChar) + ".md"), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,565 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace AutoRest.AzureResourceSchema
|
||||
{
|
||||
/// <summary>
|
||||
/// An object representing a JSON schema. Each property of a JSON schema ($schema, title, and
|
||||
/// description are metadata, not properties) is also a JSON schema, so the class is recursive.
|
||||
/// </summary>
|
||||
public class JsonSchema
|
||||
{
|
||||
private string resourceType;
|
||||
private IList<string> enumList;
|
||||
private IDictionary<string, JsonSchema> properties;
|
||||
private IList<string> requiredList;
|
||||
private IList<JsonSchema> oneOfList;
|
||||
private IList<JsonSchema> anyOfList;
|
||||
private IList<JsonSchema> allOfList;
|
||||
|
||||
/// <summary>
|
||||
/// A reference to the location in the parent schema where this schema's definition can be
|
||||
/// found.
|
||||
/// </summary>
|
||||
public string Ref { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The JSONSchema that will be applied to the elements of this schema, assuming this
|
||||
/// schema is an array schema type.
|
||||
/// </summary>
|
||||
public JsonSchema Items { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The format of the value that matches this schema. This only applies to string values.
|
||||
/// </summary>
|
||||
public string Format { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The description metadata that describes this schema.
|
||||
/// </summary>
|
||||
public string Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The type metadata of this schema that describes what type matching JSON values must be.
|
||||
/// For example, this value will be either "object", "string", "array", "integer",
|
||||
/// "number", or "boolean".
|
||||
/// </summary>
|
||||
public string JsonType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the resource type of this JsonSchema.
|
||||
/// </summary>
|
||||
public string ResourceType
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceType;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceType = value;
|
||||
if (Properties != null && Properties.ContainsKey("type"))
|
||||
{
|
||||
// update the value of the type enum. we have to be careful though that we don't
|
||||
// stomp over some other enum that happens to have the name "type". this code path
|
||||
// is typically hit when building a child resource definition from a cloned parent.
|
||||
if (Properties["type"].enumList.Count > 1)
|
||||
throw new InvalidOperationException("Attempt to update 'type' enum that contains more than one member (possible collision).");
|
||||
if (!Properties["type"].enumList[0].EndsWith(value))
|
||||
throw new InvalidOperationException($"The updated type value '{value}' is not a child of type value '{Properties["type"].enumList[0]}'");
|
||||
|
||||
Properties["type"].enumList[0] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The minimum value that a numeric value matching this schema can have.
|
||||
/// </summary>
|
||||
public double? Minimum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The maximum value that a numeric value matching this schema can have.
|
||||
/// </summary>
|
||||
public double? Maximum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The regular expression pattern that a string value matching this schema must match.
|
||||
/// </summary>
|
||||
public string Pattern { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The minimum length that a string or an array matching this schema can have.
|
||||
/// </summary>
|
||||
public double? MinLength { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The maximum length that a string or an array matching this schema can have.
|
||||
/// </summary>
|
||||
public double? MaxLength { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The schema that matches additional properties that have not been specified in the
|
||||
/// Properties dictionary.
|
||||
/// </summary>
|
||||
public JsonSchema AdditionalProperties { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// An enumeration of values that will match this JSON schema. Any value not in this
|
||||
/// enumeration will not match this schema.
|
||||
/// </summary>
|
||||
public IList<string> Enum
|
||||
{
|
||||
get { return enumList; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The list of oneOf options that exist for this JSON schema.
|
||||
/// </summary>
|
||||
public IList<JsonSchema> OneOf
|
||||
{
|
||||
get { return oneOfList; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The list of anyOf options that exist for this JSON schema.
|
||||
/// </summary>
|
||||
public IList<JsonSchema> AnyOf
|
||||
{
|
||||
get { return anyOfList; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The list of allOf options that exist for this JSON schema.
|
||||
/// </summary>
|
||||
public IList<JsonSchema> AllOf
|
||||
{
|
||||
get { return allOfList; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The schemas that describe the properties of a matching JSON value.
|
||||
/// </summary>
|
||||
public IDictionary<string,JsonSchema> Properties
|
||||
{
|
||||
get { return properties; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The names of the properties that are required for a matching JSON value.
|
||||
/// </summary>
|
||||
public IList<string> Required
|
||||
{
|
||||
get { return requiredList; }
|
||||
}
|
||||
|
||||
public bool IsEmpty()
|
||||
{
|
||||
return Ref == null &&
|
||||
Items == null &&
|
||||
AdditionalProperties == null &&
|
||||
Minimum == null &&
|
||||
Maximum == null &&
|
||||
Pattern == null &&
|
||||
IsEmpty(enumList) &&
|
||||
IsEmpty(properties) &&
|
||||
IsEmpty(requiredList) &&
|
||||
IsEmpty(oneOfList) &&
|
||||
IsEmpty(anyOfList) &&
|
||||
IsEmpty(allOfList);
|
||||
}
|
||||
|
||||
private static bool IsEmpty<T>(IEnumerable<T> values)
|
||||
{
|
||||
return values == null || !values.Any();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add a new value (or values) to this JsonSchema's enum list. This JsonSchema (with the
|
||||
/// new value(s)) is then returned so that additional changes can be chained together.
|
||||
/// </summary>
|
||||
/// <param name="enumValue"></param>
|
||||
/// <param name="extraEnumValues"></param>
|
||||
/// <returns></returns>
|
||||
public JsonSchema AddEnum(string enumValue, params string[] extraEnumValues)
|
||||
{
|
||||
if (enumList == null)
|
||||
{
|
||||
enumList = new List<string>();
|
||||
}
|
||||
|
||||
if (enumList.Contains(enumValue))
|
||||
{
|
||||
throw new ArgumentException("enumValue (" + enumValue + ") already exists in the list of allowed values.", "enumValue");
|
||||
}
|
||||
enumList.Add(enumValue);
|
||||
|
||||
if (extraEnumValues != null && extraEnumValues.Length > 0)
|
||||
{
|
||||
foreach (string extraEnumValue in extraEnumValues)
|
||||
{
|
||||
if (enumList.Contains(extraEnumValue))
|
||||
{
|
||||
throw new ArgumentException("extraEnumValue (" + extraEnumValue + ") already exists in the list of allowed values.", "extraEnumValues");
|
||||
}
|
||||
enumList.Add(extraEnumValue);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add a new property to this JsonSchema, and then return this JsonSchema so that
|
||||
/// additional changes can be chained together.
|
||||
/// </summary>
|
||||
/// <param name="propertyName">The name of the property to add.</param>
|
||||
/// <param name="propertyDefinition">The JsonSchema definition of the property to add.</param>
|
||||
/// <returns></returns>
|
||||
public JsonSchema AddProperty(string propertyName, JsonSchema propertyDefinition)
|
||||
{
|
||||
return AddProperty(propertyName, propertyDefinition, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add a new property to this JsonSchema, and then return this JsonSchema so that
|
||||
/// additional changes can be chained together.
|
||||
/// </summary>
|
||||
/// <param name="propertyName">The name of the property to add.</param>
|
||||
/// <param name="propertyDefinition">The JsonSchema definition of the property to add.</param>
|
||||
/// <param name="isRequired">Whether this property is required or not.</param>
|
||||
/// <returns></returns>
|
||||
public JsonSchema AddProperty(string propertyName, JsonSchema propertyDefinition, bool isRequired)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(propertyName))
|
||||
{
|
||||
throw new ArgumentException("propertyName cannot be null or whitespace", "propertyName");
|
||||
}
|
||||
if (propertyDefinition == null)
|
||||
{
|
||||
throw new ArgumentNullException("propertyDefinition");
|
||||
}
|
||||
|
||||
if (properties == null)
|
||||
{
|
||||
properties = new Dictionary<string, JsonSchema>();
|
||||
}
|
||||
|
||||
if (properties.ContainsKey(propertyName))
|
||||
{
|
||||
throw new ArgumentException("A property with the name \"" + propertyName + "\" already exists in this JSONSchema", "propertyName");
|
||||
}
|
||||
|
||||
properties[propertyName] = propertyDefinition;
|
||||
|
||||
if (isRequired)
|
||||
{
|
||||
AddRequired(propertyName);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add the provided required property names to this JSON schema's list of required property names.
|
||||
/// </summary>
|
||||
/// <param name="requiredPropertyName"></param>
|
||||
/// <param name="extraRequiredPropertyNames"></param>
|
||||
public JsonSchema AddRequired(string requiredPropertyName, params string[] extraRequiredPropertyNames)
|
||||
{
|
||||
if (Properties == null || !Properties.ContainsKey(requiredPropertyName))
|
||||
{
|
||||
throw new ArgumentException("No property exists with the provided requiredPropertyName (" + requiredPropertyName + ")", nameof(requiredPropertyName));
|
||||
}
|
||||
|
||||
if (requiredList == null)
|
||||
{
|
||||
requiredList = new List<string>();
|
||||
}
|
||||
|
||||
if (requiredList.Contains(requiredPropertyName))
|
||||
{
|
||||
throw new ArgumentException("'" + requiredPropertyName + "' is already a required property.", "requiredPropertyName");
|
||||
}
|
||||
requiredList.Add(requiredPropertyName);
|
||||
|
||||
if (extraRequiredPropertyNames != null)
|
||||
{
|
||||
foreach (string extraRequiredPropertyName in extraRequiredPropertyNames)
|
||||
{
|
||||
if (Properties == null || !Properties.ContainsKey(extraRequiredPropertyName))
|
||||
{
|
||||
throw new ArgumentException("No property exists with the provided extraRequiredPropertyName (" + extraRequiredPropertyName + ")", "extraRequiredPropertyNames");
|
||||
}
|
||||
if (requiredList.Contains(extraRequiredPropertyName))
|
||||
{
|
||||
throw new ArgumentException("'" + extraRequiredPropertyName + "' is already a required property.", "extraRequiredPropertyNames");
|
||||
}
|
||||
requiredList.Add(extraRequiredPropertyName);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add the provided JSON schema as an option for the anyOf property of this JSON schema.
|
||||
/// </summary>
|
||||
/// <param name="anyOfOption"></param>
|
||||
/// <returns></returns>
|
||||
public JsonSchema AddAnyOf(JsonSchema anyOfOption)
|
||||
{
|
||||
if (anyOfOption == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(anyOfOption));
|
||||
}
|
||||
|
||||
if (anyOfList == null)
|
||||
{
|
||||
anyOfList = new List<JsonSchema>();
|
||||
}
|
||||
|
||||
anyOfList.Add(anyOfOption);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add the provided JSON schema as an option for the oneOf property of this JSON schema.
|
||||
/// </summary>
|
||||
/// <param name="oneOfOption"></param>
|
||||
/// <returns></returns>
|
||||
public JsonSchema AddOneOf(JsonSchema oneOfOption)
|
||||
{
|
||||
if (oneOfOption == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(oneOfOption));
|
||||
}
|
||||
|
||||
if (oneOfList == null)
|
||||
{
|
||||
oneOfList = new List<JsonSchema>();
|
||||
}
|
||||
|
||||
oneOfList.Add(oneOfOption);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add the provided JSON schema as an option for the allOf property of this JSON schema.
|
||||
/// </summary>
|
||||
/// <param name="allOfOption"></param>
|
||||
/// <returns></returns>
|
||||
public JsonSchema AddAllOf(JsonSchema allOfOption)
|
||||
{
|
||||
if (allOfOption == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(allOfOption));
|
||||
}
|
||||
|
||||
if (allOfList == null)
|
||||
{
|
||||
allOfList = new List<JsonSchema>();
|
||||
}
|
||||
|
||||
allOfList.Add(allOfOption);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a new JsonSchema that is an exact copy of this one.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public JsonSchema Clone()
|
||||
{
|
||||
JsonSchema result = new JsonSchema();
|
||||
result.Ref = Ref;
|
||||
result.Items = Clone(Items);
|
||||
result.Description = Description;
|
||||
result.JsonType = JsonType;
|
||||
result.AdditionalProperties = Clone(AdditionalProperties);
|
||||
result.Minimum = Minimum;
|
||||
result.Maximum = Maximum;
|
||||
result.Pattern = Pattern;
|
||||
result.enumList = Clone(Enum);
|
||||
result.properties = Clone(Properties);
|
||||
result.requiredList = Clone(Required);
|
||||
result.oneOfList = Clone(OneOf);
|
||||
result.anyOfList = Clone(AnyOf);
|
||||
result.allOfList = Clone(AllOf);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static JsonSchema Clone(JsonSchema toClone)
|
||||
{
|
||||
JsonSchema result = null;
|
||||
|
||||
if (toClone != null)
|
||||
{
|
||||
result = toClone.Clone();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static IList<string> Clone(IList<string> toClone)
|
||||
{
|
||||
IList<string> result = null;
|
||||
|
||||
if (toClone != null)
|
||||
{
|
||||
result = new List<string>(toClone);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static IList<JsonSchema> Clone(IList<JsonSchema> toClone)
|
||||
{
|
||||
IList<JsonSchema> result = null;
|
||||
|
||||
if (toClone != null)
|
||||
{
|
||||
result = new List<JsonSchema>();
|
||||
foreach (JsonSchema schema in toClone)
|
||||
{
|
||||
result.Add(Clone(schema));
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static IDictionary<string,JsonSchema> Clone(IDictionary<string,JsonSchema> toClone)
|
||||
{
|
||||
IDictionary<string, JsonSchema> result = null;
|
||||
|
||||
if (toClone != null)
|
||||
{
|
||||
result = new Dictionary<string, JsonSchema>();
|
||||
foreach (string key in toClone.Keys)
|
||||
{
|
||||
result.Add(key, Clone(toClone[key]));
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
JsonSchema rhs = obj as JsonSchema;
|
||||
if (rhs != null)
|
||||
{
|
||||
result = Equals(Ref, rhs.Ref) &&
|
||||
Equals(Items, rhs.Items) &&
|
||||
Equals(JsonType, rhs.JsonType) &&
|
||||
Equals(AdditionalProperties, rhs.AdditionalProperties) &&
|
||||
Equals(Enum, rhs.Enum) &&
|
||||
Equals(Properties, rhs.Properties) &&
|
||||
Equals(Required, rhs.Required) &&
|
||||
Equals(Description, rhs.Description) &&
|
||||
Equals(Minimum, rhs.Minimum) &&
|
||||
Equals(Maximum, rhs.Maximum) &&
|
||||
Equals(Pattern, rhs.Pattern);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return GetHashCode(GetType()) ^
|
||||
GetHashCode(Ref) ^
|
||||
GetHashCode(Items) ^
|
||||
GetHashCode(Description) ^
|
||||
GetHashCode(JsonType) ^
|
||||
GetHashCode(AdditionalProperties) ^
|
||||
GetHashCode(Enum) ^
|
||||
GetHashCode(Properties) ^
|
||||
GetHashCode(Required) ^
|
||||
GetHashCode(Description) ^
|
||||
GetHashCode(Minimum) ^
|
||||
GetHashCode(Maximum) ^
|
||||
GetHashCode(Pattern);
|
||||
}
|
||||
|
||||
private static int GetHashCode(object value)
|
||||
{
|
||||
return value == null ? 0 : value.GetHashCode();
|
||||
}
|
||||
|
||||
private static bool Equals(IEnumerable<string> lhs, IEnumerable<string> rhs)
|
||||
{
|
||||
bool result = lhs == rhs;
|
||||
|
||||
if (!result &&
|
||||
lhs != null &&
|
||||
rhs != null &&
|
||||
lhs.Count() == rhs.Count())
|
||||
{
|
||||
result = true;
|
||||
|
||||
IEnumerator<string> lhsEnumerator = lhs.GetEnumerator();
|
||||
IEnumerator<string> rhsEnumerator = rhs.GetEnumerator();
|
||||
while (lhsEnumerator.MoveNext() && rhsEnumerator.MoveNext())
|
||||
{
|
||||
if (!Equals(lhsEnumerator.Current, rhsEnumerator.Current))
|
||||
{
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static bool Equals(IDictionary<string, JsonSchema> lhs, IDictionary<string, JsonSchema> rhs)
|
||||
{
|
||||
bool result = lhs == rhs;
|
||||
|
||||
if (!result &&
|
||||
lhs != null &&
|
||||
rhs != null &&
|
||||
lhs.Count == rhs.Count)
|
||||
{
|
||||
result = true;
|
||||
|
||||
foreach (string key in lhs.Keys)
|
||||
{
|
||||
if (rhs.ContainsKey(key) == false ||
|
||||
!Equals(lhs[key], rhs[key]))
|
||||
{
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static JsonSchema CreateStringEnum(string enumValue, params string[] extraEnumValues)
|
||||
{
|
||||
JsonSchema result = new JsonSchema() { JsonType = "string" };
|
||||
result.AddEnum(enumValue);
|
||||
if (extraEnumValues != null)
|
||||
{
|
||||
foreach (string extraEnumValue in extraEnumValues)
|
||||
{
|
||||
result.AddEnum(extraEnumValue);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace AutoRest.AzureResourceSchema.Markdown
|
||||
{
|
||||
public class Anchor : MarkdownElement
|
||||
{
|
||||
private string _id;
|
||||
|
||||
public Anchor(string id)
|
||||
{
|
||||
if (string.IsNullOrEmpty(id))
|
||||
throw new ArgumentException(nameof(id));
|
||||
|
||||
_id = id;
|
||||
}
|
||||
|
||||
public override string ToMarkdown()
|
||||
{
|
||||
return $"<a id=\"{_id}\" />";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace AutoRest.AzureResourceSchema.Markdown
|
||||
{
|
||||
public class BulletList : MarkdownElement
|
||||
{
|
||||
private IEnumerable<string> _items;
|
||||
|
||||
public BulletList(IEnumerable<string> items)
|
||||
{
|
||||
if (items == null)
|
||||
throw new ArgumentNullException(nameof(items));
|
||||
if (!items.Any())
|
||||
throw new ArgumentException("Collection contains no elements.", "items");
|
||||
|
||||
_items = items;
|
||||
}
|
||||
|
||||
public override string ToMarkdown()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
|
||||
foreach (var item in _items)
|
||||
sb.AppendLine(string.Format("- {0}", item));
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace AutoRest.AzureResourceSchema.Markdown
|
||||
{
|
||||
public class Codeblock : MarkdownElement
|
||||
{
|
||||
private string _lang;
|
||||
private string _code;
|
||||
|
||||
public Codeblock(string content)
|
||||
{
|
||||
if (string.IsNullOrEmpty(content))
|
||||
throw new ArgumentException(nameof(content));
|
||||
|
||||
_code = content;
|
||||
}
|
||||
|
||||
public Codeblock(string language, string content) : this(content)
|
||||
{
|
||||
if (string.IsNullOrEmpty(language))
|
||||
throw new ArgumentException(nameof(language));
|
||||
|
||||
_lang = language;
|
||||
}
|
||||
|
||||
public override string ToMarkdown()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_lang))
|
||||
{
|
||||
return string.Format("```{0}{1}{2}{3}```", _lang, Environment.NewLine, _code, Environment.NewLine);
|
||||
}
|
||||
|
||||
return string.Format("```{0}{1}{2}```", Environment.NewLine, _code, Environment.NewLine);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace AutoRest.AzureResourceSchema.Markdown
|
||||
{
|
||||
public class Header : MarkdownElement
|
||||
{
|
||||
private int _level;
|
||||
private string _s;
|
||||
|
||||
public Header(string format, params object[] arg) : this(1, format, arg)
|
||||
{
|
||||
// empty
|
||||
}
|
||||
|
||||
public Header(int level, string format, params object[] arg)
|
||||
{
|
||||
if (level < 1)
|
||||
throw new ArgumentOutOfRangeException("Header level cannot be less than one.");
|
||||
if (string.IsNullOrEmpty(format))
|
||||
throw new ArgumentException(nameof(format));
|
||||
|
||||
_level = level;
|
||||
_s = string.Format(format, arg);
|
||||
}
|
||||
|
||||
public override string ToMarkdown()
|
||||
{
|
||||
var sb = new StringBuilder(_s.Length + _level + 1);
|
||||
for (var i = 0; i < _level; ++i)
|
||||
sb.Append("#");
|
||||
|
||||
sb.Append(" ");
|
||||
sb.Append(_s);
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
namespace AutoRest.AzureResourceSchema.Markdown
|
||||
{
|
||||
public interface IMarkdown
|
||||
{
|
||||
string ToMarkdown();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace AutoRest.AzureResourceSchema.Markdown
|
||||
{
|
||||
public class InlineLink : MarkdownElement
|
||||
{
|
||||
string _s;
|
||||
string _dest;
|
||||
|
||||
public InlineLink(string destination, string format, params object[] arg)
|
||||
{
|
||||
if (string.IsNullOrEmpty(destination))
|
||||
throw new ArgumentException(nameof(destination));
|
||||
if (string.IsNullOrEmpty(format))
|
||||
throw new ArgumentException(nameof(format));
|
||||
|
||||
_s = string.Format(format, arg);
|
||||
_dest = destination;
|
||||
}
|
||||
|
||||
public override string ToMarkdown()
|
||||
{
|
||||
return $"[{_s}]({_dest})";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
namespace AutoRest.AzureResourceSchema.Markdown
|
||||
{
|
||||
public class LineBreak : MarkdownElement
|
||||
{
|
||||
public override string ToMarkdown()
|
||||
{
|
||||
return "<br />";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
namespace AutoRest.AzureResourceSchema.Markdown
|
||||
{
|
||||
public abstract class MarkdownElement : IMarkdown
|
||||
{
|
||||
public abstract string ToMarkdown();
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return ToMarkdown();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace AutoRest.AzureResourceSchema.Markdown
|
||||
{
|
||||
public class MarkdownWriter
|
||||
{
|
||||
private TextWriter _tw;
|
||||
|
||||
public MarkdownWriter(TextWriter textWriter)
|
||||
{
|
||||
if (textWriter == null)
|
||||
throw new ArgumentNullException(nameof(textWriter));
|
||||
|
||||
_tw = textWriter;
|
||||
}
|
||||
|
||||
public void Write(string format, params object[] arg)
|
||||
{
|
||||
_tw.Write(format, arg);
|
||||
}
|
||||
|
||||
public void Write(IMarkdown markdownItem)
|
||||
{
|
||||
_tw.Write(markdownItem);
|
||||
}
|
||||
|
||||
public void Write(IEnumerable<IMarkdown> markdownItems)
|
||||
{
|
||||
foreach (var markdownItem in markdownItems)
|
||||
_tw.Write(markdownItem);
|
||||
}
|
||||
|
||||
public void WriteLine()
|
||||
{
|
||||
_tw.WriteLine();
|
||||
}
|
||||
|
||||
public void WriteLine(IMarkdown markdownItem)
|
||||
{
|
||||
_tw.WriteLine(markdownItem);
|
||||
}
|
||||
|
||||
public void WriteLine(string format, params object[] arg)
|
||||
{
|
||||
_tw.WriteLine(format, arg);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace AutoRest.AzureResourceSchema.Markdown
|
||||
{
|
||||
public class Paragraph : MarkdownElement
|
||||
{
|
||||
private StringBuilder _sb;
|
||||
|
||||
public Paragraph()
|
||||
{
|
||||
_sb = new StringBuilder();
|
||||
_sb.AppendLine();
|
||||
}
|
||||
|
||||
public Paragraph(string content) : this()
|
||||
{
|
||||
Append(content);
|
||||
}
|
||||
|
||||
public Paragraph(string format, params object[] arg) : this()
|
||||
{
|
||||
Append(format, arg);
|
||||
}
|
||||
|
||||
public Paragraph(MarkdownElement md) : this()
|
||||
{
|
||||
Append(md);
|
||||
}
|
||||
|
||||
public void Append(string content)
|
||||
{
|
||||
_sb.Append(content);
|
||||
}
|
||||
|
||||
public void Append(string format, params object[] arg)
|
||||
{
|
||||
_sb.AppendFormat(format, arg);
|
||||
}
|
||||
|
||||
public void Append(MarkdownElement md)
|
||||
{
|
||||
_sb.Append(md.ToString());
|
||||
}
|
||||
|
||||
public override string ToMarkdown()
|
||||
{
|
||||
// TODO: word wrapping?
|
||||
_sb.AppendLine();
|
||||
return _sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace AutoRest.AzureResourceSchema.Markdown
|
||||
{
|
||||
public class Strong : MarkdownElement
|
||||
{
|
||||
private string _s;
|
||||
|
||||
public Strong(string content)
|
||||
{
|
||||
if (string.IsNullOrEmpty(content))
|
||||
throw new ArgumentException(nameof(content));
|
||||
|
||||
_s = content;
|
||||
}
|
||||
|
||||
public Strong(string format, params object[] arg)
|
||||
{
|
||||
if (string.IsNullOrEmpty(format))
|
||||
throw new ArgumentException(nameof(format));
|
||||
|
||||
_s = string.Format(format, arg);
|
||||
}
|
||||
|
||||
public Strong(MarkdownElement md)
|
||||
{
|
||||
if (md == null)
|
||||
throw new ArgumentNullException(nameof(md));
|
||||
|
||||
_s = md.ToString();
|
||||
}
|
||||
|
||||
public override string ToMarkdown()
|
||||
{
|
||||
return string.Format("**{0}**", _s);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace AutoRest.AzureResourceSchema.Markdown
|
||||
{
|
||||
public class Table : MarkdownElement
|
||||
{
|
||||
private IEnumerable<string> _headers;
|
||||
private List<IEnumerable<string>> _rows;
|
||||
|
||||
public Table(IEnumerable<string> headers)
|
||||
{
|
||||
if (headers == null)
|
||||
throw new ArgumentNullException(nameof(headers));
|
||||
if (!headers.Any())
|
||||
throw new ArgumentException("Collection contained no elements.", "headers");
|
||||
|
||||
_headers = headers;
|
||||
_rows = new List<IEnumerable<string>>();
|
||||
}
|
||||
|
||||
public void AddRow(IEnumerable<string> row)
|
||||
{
|
||||
if (row == null)
|
||||
throw new ArgumentNullException(nameof(row));
|
||||
if (!row.Any())
|
||||
throw new ArgumentException("Collection contained no elements.", "row");
|
||||
|
||||
_rows.Add(row);
|
||||
}
|
||||
|
||||
public override string ToMarkdown()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
|
||||
// write table header
|
||||
AppendRow(sb, _headers);
|
||||
|
||||
sb.Append("| ");
|
||||
foreach (var h in _headers)
|
||||
sb.Append(" ---- |");
|
||||
sb.AppendLine();
|
||||
|
||||
foreach (var row in _rows)
|
||||
AppendRow(sb, row);
|
||||
|
||||
// now write the rows
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private void AppendRow(StringBuilder sb, IEnumerable<string> row)
|
||||
{
|
||||
sb.Append("| ");
|
||||
foreach (var r in row)
|
||||
sb.AppendFormat(" {0} |", r);
|
||||
|
||||
sb.AppendLine();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
//
|
||||
|
||||
namespace AutoRest.AzureResourceSchema {
|
||||
using Core;
|
||||
using Core.Extensibility;
|
||||
using Core.Model;
|
||||
|
||||
public sealed class PluginArs : Plugin<IGeneratorSettings, CodeModelTransformer<CodeModel>, CodeGeneratorArs, CodeNamer, CodeModel> {
|
||||
}
|
||||
}
|
|
@ -0,0 +1,171 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using AutoRest.Core;
|
||||
using AutoRest.Core.Extensibility;
|
||||
using AutoRest.Core.Model;
|
||||
using AutoRest.Core.Parsing;
|
||||
using AutoRest.Core.Utilities;
|
||||
using Microsoft.Perks.JsonRPC;
|
||||
|
||||
using IAnyPlugin = AutoRest.Core.Extensibility.IPlugin<AutoRest.Core.Extensibility.IGeneratorSettings, AutoRest.Core.IModelSerializer<AutoRest.Core.Model.CodeModel>, AutoRest.Core.ITransformer<AutoRest.Core.Model.CodeModel>, AutoRest.Core.CodeGenerator, AutoRest.Core.CodeNamer, AutoRest.Core.Model.CodeModel>;
|
||||
|
||||
namespace AutoRest.AzureResourceSchema
|
||||
{
|
||||
public static class ExtensionsLoader
|
||||
{
|
||||
public static IAnyPlugin GetPlugin(string name)
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case "AzureResourceSchema": return new AutoRest.AzureResourceSchema.PluginArs();
|
||||
}
|
||||
throw new Exception("Unknown plugin: " + name);
|
||||
}
|
||||
}
|
||||
|
||||
public class Program : NewPlugin
|
||||
{
|
||||
public static int Main(string[] args )
|
||||
{
|
||||
if(args != null && args.Length > 0 && args[0] == "--server") {
|
||||
var connection = new Connection(Console.Out, Console.OpenStandardInput());
|
||||
connection.Dispatch<IEnumerable<string>>("GetPluginNames", async () => new []{ "azureresourceschema" });
|
||||
connection.Dispatch<string, string, bool>("Process", (plugin, sessionId) => new Program(connection, plugin, sessionId).Process());
|
||||
connection.DispatchNotification("Shutdown", connection.Stop);
|
||||
|
||||
// wait for something to do.
|
||||
connection.GetAwaiter().GetResult();
|
||||
|
||||
Console.Error.WriteLine("Shutting Down");
|
||||
return 0;
|
||||
}
|
||||
Console.WriteLine("This is not an entry point.");
|
||||
Console.WriteLine("Please invoke this extension through AutoRest.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
private string plugin;
|
||||
|
||||
public Program(Connection connection, string plugin, string sessionId) : base(connection, sessionId)
|
||||
{
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
private T GetXmsCodeGenSetting<T>(CodeModel codeModel, string name)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (T)Convert.ChangeType(
|
||||
codeModel.CodeGenExtensions[name],
|
||||
typeof(T).GenericTypeArguments.Length == 0 ? typeof(T) : typeof(T).GenericTypeArguments[0] // un-nullable
|
||||
);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return default(T);
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task<bool> ProcessInternal()
|
||||
{
|
||||
var codeGenerator = this.plugin;
|
||||
|
||||
var files = await ListInputs();
|
||||
if (files.Length != 1)
|
||||
{
|
||||
throw new Exception($"Generator received incorrect number of inputs: {files.Length} : {string.Join(",", files)}");
|
||||
}
|
||||
var modelAsJson = (await ReadFile(files[0])).EnsureYamlIsJson();
|
||||
var codeModelT = new ModelSerializer<CodeModel>().Load(modelAsJson);
|
||||
|
||||
// get internal name
|
||||
var language = new[] {
|
||||
"CSharp",
|
||||
"Ruby",
|
||||
"NodeJS",
|
||||
"Python",
|
||||
"Go",
|
||||
"Php",
|
||||
"Java",
|
||||
"AzureResourceSchema",
|
||||
"JsonRpcClient" }
|
||||
.Where(x => x.ToLowerInvariant() == codeGenerator)
|
||||
.First();
|
||||
|
||||
// build settings
|
||||
var altNamespace = (await GetValue<string[]>("input-file") ?? new[] { "" }).FirstOrDefault()?.Split('/').Last().Split('\\').Last().Split('.').First();
|
||||
|
||||
new Settings
|
||||
{
|
||||
Namespace = await GetValue("namespace"),
|
||||
ClientName = GetXmsCodeGenSetting<string>(codeModelT, "name") ?? await GetValue("override-client-name"),
|
||||
PayloadFlatteningThreshold = GetXmsCodeGenSetting<int?>(codeModelT, "ft") ?? await GetValue<int?>("payload-flattening-threshold") ?? 0,
|
||||
AddCredentials = await GetValue<bool?>("add-credentials") ?? false,
|
||||
Host = this
|
||||
};
|
||||
var header = await GetValue("license-header");
|
||||
if (header != null)
|
||||
{
|
||||
Settings.Instance.Header = header;
|
||||
}
|
||||
Settings.Instance.CustomSettings.Add("InternalConstructors", GetXmsCodeGenSetting<bool?>(codeModelT, "internalConstructors") ?? await GetValue<bool?>("use-internal-constructors") ?? false);
|
||||
Settings.Instance.CustomSettings.Add("SyncMethods", GetXmsCodeGenSetting<string>(codeModelT, "syncMethods") ?? await GetValue("sync-methods") ?? "essential");
|
||||
Settings.Instance.CustomSettings.Add("UseDateTimeOffset", GetXmsCodeGenSetting<bool?>(codeModelT, "useDateTimeOffset") ?? await GetValue<bool?>("use-datetimeoffset") ?? false);
|
||||
Settings.Instance.CustomSettings["ClientSideValidation"] = await GetValue<bool?>("client-side-validation") ?? false;
|
||||
int defaultMaximumCommentColumns = codeGenerator == "go" ? 120 : Settings.DefaultMaximumCommentColumns;
|
||||
Settings.Instance.MaximumCommentColumns = await GetValue<int?>("max-comment-columns") ?? defaultMaximumCommentColumns;
|
||||
Settings.Instance.OutputFileName = await GetValue<string>("output-file");
|
||||
if (codeGenerator == "csharp")
|
||||
{
|
||||
Settings.Instance.Header = $"<auto-generated>\n{Settings.Instance.Header}\n</auto-generated>";
|
||||
}
|
||||
if (codeGenerator == "ruby" || codeGenerator == "python")
|
||||
{
|
||||
// TODO: sort out matters here entirely instead of relying on Input being read somewhere...
|
||||
var inputFile = await GetValue<string[]>("input-file");
|
||||
Settings.Instance.Input = inputFile.FirstOrDefault();
|
||||
Settings.Instance.PackageName = await GetValue("package-name");
|
||||
Settings.Instance.PackageVersion = await GetValue("package-version");
|
||||
}
|
||||
if (codeGenerator == "go")
|
||||
{
|
||||
Settings.Instance.PackageVersion = await GetValue("package-version");
|
||||
}
|
||||
|
||||
// process
|
||||
var plugin = ExtensionsLoader.GetPlugin(
|
||||
(await GetValue<bool?>("azure-arm") ?? false ? "Azure." : "") +
|
||||
language +
|
||||
(await GetValue<bool?>("fluent") ?? false ? ".Fluent" : "") +
|
||||
(await GetValue<bool?>("testgen") ?? false ? ".TestGen" : ""));
|
||||
Settings.PopulateSettings(plugin.Settings, Settings.Instance.CustomSettings);
|
||||
|
||||
using (plugin.Activate())
|
||||
{
|
||||
Settings.Instance.Namespace = Settings.Instance.Namespace ?? CodeNamer.Instance.GetNamespaceName(altNamespace);
|
||||
var codeModel = plugin.Serializer.Load(modelAsJson);
|
||||
codeModel = plugin.Transformer.TransformCodeModel(codeModel);
|
||||
if (await GetValue<bool?>("sample-generation") ?? false)
|
||||
{
|
||||
plugin.CodeGenerator.GenerateSamples(codeModel).GetAwaiter().GetResult();
|
||||
}
|
||||
else
|
||||
{
|
||||
plugin.CodeGenerator.Generate(codeModel).GetAwaiter().GetResult();
|
||||
}
|
||||
}
|
||||
|
||||
// write out files
|
||||
var outFS = Settings.Instance.FileSystemOutput;
|
||||
var outFiles = outFS.GetFiles("", "*", System.IO.SearchOption.AllDirectories);
|
||||
foreach (var outFile in outFiles)
|
||||
{
|
||||
WriteFile(outFile, outFS.ReadAllText(outFile), null);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,518 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
using AutoRest.AzureResourceSchema.Markdown;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using TableQueueEntry = System.Tuple<string, AutoRest.AzureResourceSchema.JsonSchema>;
|
||||
|
||||
namespace AutoRest.AzureResourceSchema
|
||||
{
|
||||
using TableQueue = Queue<TableQueueEntry>;
|
||||
|
||||
public class ResourceMarkdownGenerator
|
||||
{
|
||||
public class Markdown
|
||||
{
|
||||
public Markdown(string type, string md)
|
||||
{
|
||||
Type = type;
|
||||
Content = md;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the type described in the markdown.
|
||||
/// </summary>
|
||||
public string Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the markdown text.
|
||||
/// </summary>
|
||||
public string Content { get; }
|
||||
}
|
||||
|
||||
private const string RequiredFalse = "No";
|
||||
private const string RequiredTrue = "Yes";
|
||||
|
||||
private MarkdownWriter _writer;
|
||||
private ResourceSchema _schema;
|
||||
|
||||
private ResourceMarkdownGenerator(TextWriter writer, ResourceSchema resourceSchema)
|
||||
{
|
||||
_writer = new MarkdownWriter(writer);
|
||||
_schema = resourceSchema;
|
||||
}
|
||||
|
||||
public static Markdown[] Generate(ResourceSchema resourceSchema)
|
||||
{
|
||||
if (resourceSchema == null)
|
||||
{
|
||||
throw new ArgumentNullException("resourceSchema");
|
||||
}
|
||||
|
||||
var mds = new Markdown[resourceSchema.ResourceDefinitions.Keys.Count];
|
||||
int index = 0;
|
||||
|
||||
foreach (var resDefName in resourceSchema.ResourceDefinitions.Keys)
|
||||
{
|
||||
var resDef = resourceSchema.ResourceDefinitions[resDefName];
|
||||
|
||||
var writer = new StringWriter();
|
||||
var mdWriter = new ResourceMarkdownGenerator(writer, resourceSchema);
|
||||
mdWriter.Generate(resDef);
|
||||
|
||||
mds[index] = new Markdown(resDefName, writer.ToString());
|
||||
++index;
|
||||
}
|
||||
|
||||
return mds;
|
||||
}
|
||||
|
||||
private void Generate(JsonSchema schema)
|
||||
{
|
||||
_writer.WriteLine(new Header("{0} template reference", schema.Description));
|
||||
|
||||
if (schema.Properties.Keys.Contains("apiVersion"))
|
||||
{
|
||||
_writer.WriteLine("API Version: {0}", schema.Properties["apiVersion"].Enum[0]);
|
||||
}
|
||||
|
||||
WriteSchemaFormatSection(schema);
|
||||
WriteValuesSection(schema);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generates the "schema format" section.
|
||||
/// </summary>
|
||||
private void WriteSchemaFormatSection(JsonSchema schema)
|
||||
{
|
||||
_writer.WriteLine(new Header(2, "Template format"));
|
||||
_writer.WriteLine(new Paragraph("To create a {0} resource, add the following JSON to the resources section of your template.", schema.Description));
|
||||
|
||||
using (var stringWriter = new StringWriter())
|
||||
{
|
||||
using (var json = new JsonTextWriter(stringWriter))
|
||||
{
|
||||
json.Formatting = Formatting.Indented;
|
||||
var root = new JObject();
|
||||
|
||||
foreach (var prop in schema.Properties)
|
||||
{
|
||||
root.Add(JsonSchemaToJToken(prop.Key, prop.Value));
|
||||
}
|
||||
|
||||
root.WriteTo(json);
|
||||
}
|
||||
|
||||
// put each resource definition into its own code block
|
||||
_writer.WriteLine(new Codeblock("json", stringWriter.ToString()));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generates the "values" section; this contains tables describing all of the JSON types.
|
||||
/// </summary>
|
||||
private void WriteValuesSection(JsonSchema schema)
|
||||
{
|
||||
_writer.WriteLine(new Header(2, "Property values"));
|
||||
_writer.Write(new Paragraph("The following tables describe the values you need to set in the schema."));
|
||||
|
||||
var table = CreateTables(schema.Description, schema);
|
||||
_writer.Write(table);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates one or more markdown tables that describes the specified JSON schema.
|
||||
/// </summary>
|
||||
/// <param name="header">The markdown header to place before the table.</param>
|
||||
/// <param name="jsonSchema">The JSON schema that is to be described by the table.</param>
|
||||
/// <param name="tableQueue">A queue containing the JSON schemas to be converted to table format.</param>
|
||||
/// <returns>A formatted table with sub-header.</returns>
|
||||
private IReadOnlyList<MarkdownElement> CreateTables(string header, JsonSchema jsonSchema)
|
||||
{
|
||||
if (jsonSchema == null)
|
||||
throw new ArgumentNullException(nameof(jsonSchema));
|
||||
|
||||
Debug.Assert(jsonSchema.Properties != null);
|
||||
|
||||
var tables = new List<MarkdownElement>();
|
||||
var schemas = new TableQueue();
|
||||
schemas.Enqueue(new Tuple<string, JsonSchema>(header, jsonSchema));
|
||||
|
||||
var visited = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
while (schemas.Count > 0)
|
||||
{
|
||||
var schema = schemas.Dequeue();
|
||||
|
||||
// write the table header
|
||||
var paragraph = new Paragraph();
|
||||
paragraph.Append(new Anchor(schema.Item1));
|
||||
paragraph.Append(Environment.NewLine);
|
||||
paragraph.Append(new Header(3, "{0} object", schema.Item1));
|
||||
paragraph.Append(Environment.NewLine);
|
||||
|
||||
var table = new Table(new[] { "Name", "Type", "Required", "Value" });
|
||||
|
||||
// add a table row for each property in the schema
|
||||
var props = FlattenProperties(schema.Item2);
|
||||
foreach (var prop in props)
|
||||
{
|
||||
// type name
|
||||
var typeName = GetValueTypeName(prop.Value);
|
||||
|
||||
// required/optional
|
||||
var required = RequiredFalse;
|
||||
if (schema.Item2.Required != null && schema.Item2.Required.Contains(prop.Key))
|
||||
required = RequiredTrue;
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
// description
|
||||
bool hasDescr = false;
|
||||
if (!string.IsNullOrWhiteSpace(prop.Value.Description))
|
||||
{
|
||||
sb.Append(prop.Value.Description.Replace("\n", ""));
|
||||
hasDescr = true;
|
||||
}
|
||||
|
||||
// values
|
||||
var values = GetPossibleValues(prop.Value);
|
||||
if (values.Count > 0)
|
||||
{
|
||||
if (hasDescr)
|
||||
sb.Append(" - ");
|
||||
|
||||
if (values.Count == 1)
|
||||
sb.Append(values[0]);
|
||||
else if (values.Count == 2)
|
||||
sb.Append(string.Join(" or ", values));
|
||||
else
|
||||
sb.Append(string.Join(", ", values));
|
||||
}
|
||||
else if ((values = GetPossibleValueRefs(prop.Value)).Count > 0)
|
||||
{
|
||||
if (hasDescr)
|
||||
sb.Append(" - ");
|
||||
|
||||
for (int i = 0; i < values.Count; ++i)
|
||||
{
|
||||
sb.AppendFormat(CreateInlineLink(values[i]).ToString());
|
||||
if (i + 1 < values.Count)
|
||||
{
|
||||
sb.Append(" ");
|
||||
}
|
||||
|
||||
var refSchema = _schema.Definitions[values[i]];
|
||||
|
||||
// there are a handful of objects with null properties because the properties
|
||||
// are all read-only. for now just skip them to avoid a crash during table creation.
|
||||
// omit tables for child resources as they will be created in their own md file.
|
||||
if (HasAdditionalProps(refSchema) && !visited.Contains(values[i]) && !values[i].EndsWith("_childResource"))
|
||||
{
|
||||
// add type to the queue so a table for the type is generated
|
||||
schemas.Enqueue(new TableQueueEntry(values[i], refSchema));
|
||||
|
||||
// track the types that have already been queued for generation
|
||||
visited.Add(values[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
table.AddRow(new[] { prop.Key, typeName, required, sb.ToString() });
|
||||
}
|
||||
|
||||
paragraph.Append(table);
|
||||
tables.Add(paragraph);
|
||||
}
|
||||
|
||||
return tables;
|
||||
}
|
||||
|
||||
private InlineLink CreateInlineLink(string destination)
|
||||
{
|
||||
if (!destination.EndsWith("_childResource"))
|
||||
{
|
||||
return new InlineLink($"#{destination}", "{0} object", destination);
|
||||
}
|
||||
// construct the child directory
|
||||
destination = destination.Replace("_childResource", "");
|
||||
var parts = destination.Split(new char[] { '_' });
|
||||
if (parts.Length > 2)
|
||||
{
|
||||
// take the last two elements (the subdir and the file name)
|
||||
parts = parts.Skip(parts.Length - 2).Take(2).ToArray();
|
||||
}
|
||||
return new InlineLink($"./{string.Join("/", parts)}.md", $"{parts[parts.Length - 1]}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if a schema contains properties.
|
||||
/// </summary>
|
||||
/// <param name="jsonSchema">The JSON schema.</param>
|
||||
/// <returns>True if the schema contains properties.</returns>
|
||||
private bool HasAdditionalProps(JsonSchema jsonSchema)
|
||||
{
|
||||
return
|
||||
jsonSchema.AllOf != null ||
|
||||
jsonSchema.AnyOf != null ||
|
||||
jsonSchema.Properties != null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the name of the specified JSON type.
|
||||
/// </summary>
|
||||
/// <param name="jsonSchema">The schema object for which to return the type name.</param>
|
||||
/// <returns>The name of the type contained in the specified schema.</returns>
|
||||
private string GetValueTypeName(JsonSchema jsonSchema)
|
||||
{
|
||||
if (jsonSchema == null)
|
||||
throw new ArgumentNullException(nameof(jsonSchema));
|
||||
|
||||
if (jsonSchema.Enum != null)
|
||||
return "enum";
|
||||
else if (jsonSchema.Ref != null)
|
||||
return "object";
|
||||
else
|
||||
return jsonSchema.JsonType;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the list of values for the specified schema.
|
||||
/// E.g. for enums the list would contain all of the enum values.
|
||||
/// The returned list can be empty (typically for integral types).
|
||||
/// </summary>
|
||||
/// <param name="jsonSchema">The schema object for which to return the list of values.</param>
|
||||
/// <returns>A list of possible values; can be an empty list.</returns>
|
||||
private IReadOnlyList<string> GetPossibleValues(JsonSchema jsonSchema)
|
||||
{
|
||||
if (jsonSchema == null)
|
||||
throw new ArgumentNullException(nameof(jsonSchema));
|
||||
|
||||
var values = new List<string>();
|
||||
|
||||
if (jsonSchema.Enum != null)
|
||||
{
|
||||
foreach (var e in jsonSchema.Enum)
|
||||
values.Add(e);
|
||||
}
|
||||
else if (jsonSchema.Items != null && jsonSchema.Items.Ref == null)
|
||||
{
|
||||
if (jsonSchema.Items.Enum != null)
|
||||
{
|
||||
foreach (var e in jsonSchema.Items.Enum)
|
||||
values.Add(e);
|
||||
}
|
||||
else if (jsonSchema.Items.JsonType != null)
|
||||
{
|
||||
values.Add(jsonSchema.Items.JsonType);
|
||||
}
|
||||
}
|
||||
else if (jsonSchema.Format == "uuid")
|
||||
{
|
||||
values.Add("globally unique identifier");
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the list of object type names that can be values for the specified schema.
|
||||
/// The returned list can be empty (i.e. the return values aren't objects).
|
||||
/// </summary>
|
||||
/// <param name="jsonSchema">The schema object for which to return the list of object type names.</param>
|
||||
/// <returns>A list of possible object names; can be an empty list.</returns>
|
||||
private IReadOnlyList<string> GetPossibleValueRefs(JsonSchema jsonSchema)
|
||||
{
|
||||
if (jsonSchema == null)
|
||||
throw new ArgumentNullException(nameof(jsonSchema));
|
||||
|
||||
var values = new List<string>();
|
||||
|
||||
if (jsonSchema.Ref != null)
|
||||
{
|
||||
values.Add(GetDefNameFromPointer(jsonSchema.Ref));
|
||||
}
|
||||
else if (jsonSchema.JsonType == "array" && jsonSchema.Items.Ref != null)
|
||||
{
|
||||
values.Add(GetDefNameFromPointer(jsonSchema.Items.Ref));
|
||||
}
|
||||
else if (jsonSchema.Items != null && jsonSchema.Items.OneOf != null)
|
||||
{
|
||||
foreach (var o in jsonSchema.Items.OneOf)
|
||||
{
|
||||
values.Add(GetDefNameFromPointer(o.Ref));
|
||||
}
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the name of the item referenced in the specified JSON pointer.
|
||||
/// </summary>
|
||||
/// <param name="jsonPointer">A JSON pointer that points to an item in the list of definitions.</param>
|
||||
/// <returns>A string containing the name of the item referenced.</returns>
|
||||
private string GetDefNameFromPointer(string jsonPointer)
|
||||
{
|
||||
if (string.IsNullOrEmpty(jsonPointer))
|
||||
throw new ArgumentException(nameof(jsonPointer));
|
||||
if (jsonPointer[0] != '#')
|
||||
throw new ArgumentException(string.Format("Invalid argument '{0}', value must be a JSON pointer.", jsonPointer));
|
||||
|
||||
return jsonPointer.Substring(jsonPointer.LastIndexOf('/') + 1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a schema object for the specified JSON pointer.
|
||||
/// </summary>
|
||||
/// <param name="jsonPointer">The JSON pointer for which to return a schema object.</param>
|
||||
/// <returns>A JsonSchema object for the specified type.</returns>
|
||||
private JsonSchema ResolveDefinitionRef(string jsonPointer)
|
||||
{
|
||||
if (string.IsNullOrEmpty(jsonPointer))
|
||||
throw new ArgumentException(nameof(jsonPointer));
|
||||
|
||||
var defName = GetDefNameFromPointer(jsonPointer);
|
||||
if (!_schema.Definitions.ContainsKey(defName))
|
||||
throw new InvalidOperationException(string.Format("Didn't find a definition for '{0}'", jsonPointer));
|
||||
|
||||
return _schema.Definitions[defName];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a JToken hierarchy for the specified JsonSchema object.
|
||||
/// </summary>
|
||||
/// <param name="propName">The property name or null if the specified schema object is not a property.</param>
|
||||
/// <param name="jsonSchema">The schema object to transform into a JToken object.</param>
|
||||
/// <returns>A JToken object.</returns>
|
||||
private JToken JsonSchemaToJToken(string propName, JsonSchema jsonSchema)
|
||||
{
|
||||
return JsonSchemaToJTokenImpl(propName, jsonSchema, new Stack<string>());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recursively creates a JToken hierarchy for the specified JsonSchema object (call JsonSchemaToJToken instead of this).
|
||||
/// </summary>
|
||||
/// <param name="propName">The property name or null if the specified schema object is not a property.</param>
|
||||
/// <param name="jsonSchema">The schema object to transform into a JToken object.</param>
|
||||
/// <param name="stack">Stack object used to detect cycles in the graph that would cause infinite recursion.</param>
|
||||
/// <returns>A JToken object.</returns>
|
||||
private JToken JsonSchemaToJTokenImpl(string propName, JsonSchema jsonSchema, Stack<string> stack)
|
||||
{
|
||||
if (jsonSchema == null)
|
||||
throw new ArgumentNullException(nameof(jsonSchema));
|
||||
|
||||
if (jsonSchema.Ref != null)
|
||||
{
|
||||
// some definitions contain cycles which will lead to infinite recursion.
|
||||
// in this case return a JToken object with the referenced definition name.
|
||||
if (!stack.Contains(jsonSchema.Ref))
|
||||
{
|
||||
stack.Push(jsonSchema.Ref);
|
||||
var def = ResolveDefinitionRef(jsonSchema.Ref);
|
||||
var result = JsonSchemaToJTokenImpl(propName, def, stack);
|
||||
var popped = stack.Pop();
|
||||
Debug.Assert(string.Compare(popped, jsonSchema.Ref, StringComparison.OrdinalIgnoreCase) == 0);
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
var defName = GetDefNameFromPointer(jsonSchema.Ref);
|
||||
if (propName != null)
|
||||
return new JProperty(propName, defName);
|
||||
else
|
||||
return new JValue(defName);
|
||||
}
|
||||
}
|
||||
else if (jsonSchema.JsonType == "object")
|
||||
{
|
||||
var jobj = new JObject();
|
||||
var props = FlattenProperties(jsonSchema);
|
||||
foreach (var prop in props)
|
||||
{
|
||||
jobj.Add(JsonSchemaToJTokenImpl(prop.Key, prop.Value, stack));
|
||||
}
|
||||
|
||||
if (propName != null)
|
||||
return new JProperty(propName, jobj);
|
||||
else
|
||||
return jobj;
|
||||
}
|
||||
else if (jsonSchema.JsonType == "array")
|
||||
{
|
||||
Debug.Assert(jsonSchema.Items != null);
|
||||
var jarr = new JArray();
|
||||
|
||||
// special-case the resources element so it always has an empty array
|
||||
if (propName != "resources")
|
||||
{
|
||||
jarr.Add(JsonSchemaToJTokenImpl(null, jsonSchema.Items, stack));
|
||||
}
|
||||
|
||||
return new JProperty(propName, jarr);
|
||||
}
|
||||
else
|
||||
{
|
||||
string val = null;
|
||||
if (jsonSchema.Enum != null && jsonSchema.Enum.Count == 1)
|
||||
val = jsonSchema.Enum[0];
|
||||
else
|
||||
val = jsonSchema.JsonType;
|
||||
|
||||
if (propName != null)
|
||||
return new JProperty(propName, val);
|
||||
else
|
||||
return new JValue(val);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Flattens properties in the AllOf and Properties sections into one list.
|
||||
/// </summary>
|
||||
/// <param name="jsonSchema">The JSON schema.</param>
|
||||
/// <returns>A dictionary of all possible properties.</returns>
|
||||
private IDictionary<string, JsonSchema> FlattenProperties(JsonSchema jsonSchema)
|
||||
{
|
||||
var merged = new Dictionary<string, JsonSchema>();
|
||||
FlattenPropertiesImpl(merged, new[] { jsonSchema });
|
||||
|
||||
return merged;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recursively flattens properties in the AllOf and Properties sections into one list (don't call this one call FlattenProperties).
|
||||
/// </summary>
|
||||
/// <param name="merged">The dictionary to contain the merged content.</param>
|
||||
/// <param name="items">The items to merge into the dictionary.</param>
|
||||
private void FlattenPropertiesImpl(Dictionary<string, JsonSchema> merged, IEnumerable<JsonSchema> items)
|
||||
{
|
||||
foreach (var item in items)
|
||||
{
|
||||
if (item.AllOf != null)
|
||||
{
|
||||
FlattenPropertiesImpl(merged, item.AllOf);
|
||||
}
|
||||
else if (item.Properties != null)
|
||||
{
|
||||
foreach (var prop in item.Properties)
|
||||
{
|
||||
merged.Add(prop.Key, prop.Value);
|
||||
}
|
||||
}
|
||||
else if (item.Ref != null)
|
||||
{
|
||||
var schema = ResolveDefinitionRef(item.Ref);
|
||||
FlattenPropertiesImpl(merged, new[] { schema });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,139 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AutoRest.AzureResourceSchema
|
||||
{
|
||||
/// <summary>
|
||||
/// An object representing an Azure Resource Schema. It is important to note that an Azure
|
||||
/// resource schema is actually not a valid JSON schema by itself. It is part of the
|
||||
/// deploymentTemplate.json schema.
|
||||
/// </summary>
|
||||
public class ResourceSchema
|
||||
{
|
||||
private IDictionary<string, JsonSchema> resourceDefinitions = new Dictionary<string,JsonSchema>();
|
||||
private IDictionary<string, JsonSchema> definitions = new Dictionary<string, JsonSchema>();
|
||||
|
||||
/// <summary>
|
||||
/// The id metadata that uniquely identifies this schema. Usually this will be the URL to
|
||||
/// the permanent location of this schema in schema.management.azure.com/schemas/.
|
||||
/// </summary>
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The JSON schema metadata url that points to the schema that can be used to validate
|
||||
/// this schema.
|
||||
/// </summary>
|
||||
public string Schema { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The title metadata for this schema.
|
||||
/// </summary>
|
||||
public string Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The description metadata that describes this schema.
|
||||
/// </summary>
|
||||
public string Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The named JSON schemas that define the resources of this resource schema.
|
||||
/// </summary>
|
||||
public IDictionary<string, JsonSchema> ResourceDefinitions
|
||||
{
|
||||
get { return resourceDefinitions; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The named reusable JSON schemas that the resource definitions reference. These
|
||||
/// definitions can also reference each other or themselves.
|
||||
/// </summary>
|
||||
public IDictionary<string,JsonSchema> Definitions
|
||||
{
|
||||
get { return definitions; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Search this ResourceSchema for a resource definition that has the provided type.
|
||||
/// </summary>
|
||||
/// <param name="resourceType">The resource type to look for in this ResourceSchema.</param>
|
||||
/// <returns></returns>
|
||||
public JsonSchema GetResourceDefinitionByResourceType(string resourceType)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(resourceType))
|
||||
{
|
||||
throw new ArgumentException("resourceType cannot be null or whitespace.", "resourceType");
|
||||
}
|
||||
|
||||
JsonSchema result = null;
|
||||
|
||||
if (resourceDefinitions != null && resourceDefinitions.Count > 0)
|
||||
{
|
||||
foreach(JsonSchema resourceDefinition in resourceDefinitions.Values)
|
||||
{
|
||||
if (resourceDefinition.ResourceType == resourceType)
|
||||
{
|
||||
result = resourceDefinition;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add the provided resource definition JSON schema to this resourceh schema.
|
||||
/// </summary>
|
||||
/// <param name="resourceName">The name of the resource definition.</param>
|
||||
/// <param name="resourceDefinition">The JSON schema that describes the resource.</param>
|
||||
public ResourceSchema AddResourceDefinition(string resourceName, JsonSchema resourceDefinition)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(resourceName))
|
||||
{
|
||||
throw new ArgumentException("resourceName cannot be null or whitespace", "resourceName");
|
||||
}
|
||||
if (resourceDefinition == null)
|
||||
{
|
||||
throw new ArgumentNullException("resourceDefinition");
|
||||
}
|
||||
|
||||
if (resourceDefinitions.ContainsKey(resourceName))
|
||||
{
|
||||
throw new ArgumentException("A resource definition for \"" + resourceName + "\" already exists in this resource schema.", "resourceName");
|
||||
}
|
||||
|
||||
resourceDefinitions.Add(resourceName, resourceDefinition);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add the provided definition JSON schema to this resourceh schema.
|
||||
/// </summary>
|
||||
/// <param name="definitionName">The name of the resource definition.</param>
|
||||
/// <param name="definition">The JSON schema that describes the resource.</param>
|
||||
public ResourceSchema AddDefinition(string definitionName, JsonSchema definition)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(definitionName))
|
||||
{
|
||||
throw new ArgumentException("definitionName cannot be null or whitespace", "definitionName");
|
||||
}
|
||||
if (definition == null)
|
||||
{
|
||||
throw new ArgumentNullException("definition");
|
||||
}
|
||||
|
||||
if (definitions.ContainsKey(definitionName))
|
||||
{
|
||||
throw new ArgumentException("A definition for \"" + definitionName + "\" already exists in this resource schema.", "definitionName");
|
||||
}
|
||||
|
||||
definitions.Add(definitionName, definition);
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,600 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using AutoRest.Core.Model;
|
||||
using AutoRest.Core.Utilities;
|
||||
|
||||
namespace AutoRest.AzureResourceSchema
|
||||
{
|
||||
/// <summary>
|
||||
/// The ResourceSchemaParser class is responsible for converting a ServiceClient object into a
|
||||
/// ResourceSchemaModel.
|
||||
/// </summary>
|
||||
public static class ResourceSchemaParser
|
||||
{
|
||||
private const string resourceMethodPrefix = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/";
|
||||
|
||||
/// <summary>
|
||||
/// Parse a ResourceSchemaModel from the provided ServiceClient.
|
||||
/// </summary>
|
||||
/// <param name="serviceClient"></param>
|
||||
/// <returns></returns>
|
||||
public static IDictionary<string, ResourceSchema> Parse(CodeModel serviceClient, string version)
|
||||
{
|
||||
if (serviceClient == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(serviceClient));
|
||||
}
|
||||
|
||||
Dictionary<string, ResourceSchema> resourceSchemas = new Dictionary<string, ResourceSchema>();
|
||||
|
||||
foreach (Method method in serviceClient.Methods.Where( method => method.Parameters.FirstOrDefault(p => p.SerializedName == "api-version")?.DefaultValue.Value == version || version == serviceClient.ApiVersion))
|
||||
{
|
||||
if (method.HttpMethod != HttpMethod.Put ||
|
||||
string.IsNullOrWhiteSpace(method.Url) ||
|
||||
!method.Url.StartsWith(resourceMethodPrefix, StringComparison.OrdinalIgnoreCase) ||
|
||||
!method.Url.EndsWith("}", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
string afterPrefix = method.Url.Substring(resourceMethodPrefix.Length);
|
||||
int forwardSlashIndexAfterProvider = afterPrefix.IndexOf('/');
|
||||
string resourceProvider = afterPrefix.Substring(0, forwardSlashIndexAfterProvider);
|
||||
|
||||
if (IsPathVariable(resourceProvider))
|
||||
{
|
||||
// If the resourceProvider is a path variable, such as {someValue}, then this
|
||||
// is not a create resource method. Skip it.
|
||||
continue;
|
||||
}
|
||||
|
||||
// extract API version
|
||||
string apiVersion = serviceClient.ApiVersion.Else(method.Parameters.FirstOrDefault(p => p.SerializedName == "api-version")?.DefaultValue);
|
||||
if (string.IsNullOrWhiteSpace(apiVersion))
|
||||
{
|
||||
throw new ArgumentException("No API version is provided in the swagger document or the method.");
|
||||
}
|
||||
|
||||
ResourceSchema resourceSchema;
|
||||
if (!resourceSchemas.ContainsKey(resourceProvider))
|
||||
{
|
||||
resourceSchema = new ResourceSchema();
|
||||
resourceSchema.Id = string.Format(CultureInfo.InvariantCulture, "https://schema.management.azure.com/schemas/{0}/{1}.json#", apiVersion, resourceProvider);
|
||||
resourceSchema.Title = resourceProvider;
|
||||
resourceSchema.Description = resourceProvider.Replace('.', ' ') + " Resource Types";
|
||||
resourceSchema.Schema = "http://json-schema.org/draft-04/schema#";
|
||||
|
||||
resourceSchemas.Add(resourceProvider, resourceSchema);
|
||||
}
|
||||
else
|
||||
{
|
||||
resourceSchema = resourceSchemas[resourceProvider];
|
||||
}
|
||||
|
||||
string methodUrlPathAfterProvider = afterPrefix.Substring(forwardSlashIndexAfterProvider + 1);
|
||||
string[] resourceTypes = ParseResourceTypes(resourceProvider, methodUrlPathAfterProvider, method);
|
||||
foreach (string resourceType in resourceTypes)
|
||||
{
|
||||
JsonSchema resourceDefinition = new JsonSchema();
|
||||
resourceDefinition.JsonType = "object";
|
||||
resourceDefinition.ResourceType = resourceType;
|
||||
|
||||
// get the resource name parameter, e.g. {fooName}
|
||||
var resNameParam = methodUrlPathAfterProvider.Substring(methodUrlPathAfterProvider.LastIndexOf('/') + 1);
|
||||
if (IsPathVariable(resNameParam))
|
||||
{
|
||||
// strip the enclosing braces
|
||||
resNameParam = resNameParam.Trim(new[] { '{', '}' });
|
||||
|
||||
// look up the type
|
||||
var param = method.Parameters.Where(p => p.SerializedName == resNameParam).FirstOrDefault();
|
||||
if (param != null)
|
||||
{
|
||||
// create a schema for it
|
||||
var nameParamSchema = ParseType(param.ClientProperty, param.ModelType, resourceSchema.Definitions, serviceClient.ModelTypes);
|
||||
nameParamSchema.ResourceType = resNameParam;
|
||||
|
||||
// add it as the name property
|
||||
resourceDefinition.AddProperty("name", nameParamSchema, true);
|
||||
}
|
||||
}
|
||||
|
||||
resourceDefinition.AddProperty("type", JsonSchema.CreateStringEnum(resourceType), true);
|
||||
resourceDefinition.AddProperty("apiVersion", JsonSchema.CreateStringEnum(apiVersion), true);
|
||||
|
||||
if (method.Body != null)
|
||||
{
|
||||
CompositeType body = method.Body.ModelType as CompositeType;
|
||||
// Debug.Assert(body != null, "The create resource method's body must be a CompositeType and cannot be null.");
|
||||
if (body != null)
|
||||
{
|
||||
foreach (Property property in body.ComposedProperties)
|
||||
{
|
||||
if (!resourceDefinition.Properties.Keys.Contains(property.SerializedName))
|
||||
{
|
||||
JsonSchema propertyDefinition = ParseType(property, property.ModelType, resourceSchema.Definitions, serviceClient.ModelTypes);
|
||||
if (propertyDefinition != null)
|
||||
{
|
||||
resourceDefinition.AddProperty(property.SerializedName, propertyDefinition, property.IsRequired || property.SerializedName == "properties");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resourceDefinition.Description = resourceType;
|
||||
|
||||
string resourcePropertyName = resourceType.Substring(resourceProvider.Length + 1).Replace('/', '_');
|
||||
|
||||
Debug.Assert(!resourceSchema.ResourceDefinitions.ContainsKey(resourcePropertyName));
|
||||
resourceSchema.AddResourceDefinition(resourcePropertyName, resourceDefinition);
|
||||
}
|
||||
}
|
||||
|
||||
// This loop adds child resource schemas to their parent resource schemas. We can't do
|
||||
// this until we're done adding all resources as top level resources, though, because
|
||||
// it's possible that we will parse a child resource before we parse the parent
|
||||
// resource.
|
||||
foreach (ResourceSchema resourceSchema in resourceSchemas.Values)
|
||||
{
|
||||
// By iterating over the reverse order of the defined resource definitions, I'm
|
||||
// counting on the resource definitions being in sorted order. That way I'm
|
||||
// guaranteed to visit child resource definitions before I visit their parent
|
||||
// resource definitions. By doing this, I've guaranteed that grandchildren resource
|
||||
// definitions will be added to their grandparent (and beyond) ancestor
|
||||
// resource definitions.
|
||||
foreach (string resourcePropertyName in resourceSchema.ResourceDefinitions.Keys.Reverse())
|
||||
{
|
||||
JsonSchema resourceDefinition = resourceSchema.ResourceDefinitions[resourcePropertyName];
|
||||
|
||||
string resourceType = resourceDefinition.ResourceType;
|
||||
int lastSlashIndex = resourceType.LastIndexOf('/');
|
||||
string parentResourceType = resourceType.Substring(0, lastSlashIndex);
|
||||
JsonSchema parentResourceDefinition = resourceSchema.GetResourceDefinitionByResourceType(parentResourceType);
|
||||
if (parentResourceDefinition != null)
|
||||
{
|
||||
string childResourceType = resourceType.Substring(lastSlashIndex + 1);
|
||||
JsonSchema childResourceDefinition = resourceDefinition.Clone();
|
||||
childResourceDefinition.ResourceType = childResourceType;
|
||||
|
||||
string childResourceDefinitionPropertyName = string.Join("_", resourcePropertyName, "childResource");
|
||||
resourceSchema.AddDefinition(childResourceDefinitionPropertyName, childResourceDefinition);
|
||||
|
||||
JsonSchema childResources;
|
||||
if (parentResourceDefinition.Properties.ContainsKey("resources"))
|
||||
{
|
||||
childResources = parentResourceDefinition.Properties["resources"];
|
||||
}
|
||||
else
|
||||
{
|
||||
childResources = new JsonSchema()
|
||||
{
|
||||
JsonType = "array",
|
||||
Items = new JsonSchema()
|
||||
};
|
||||
parentResourceDefinition.AddProperty("resources", childResources);
|
||||
}
|
||||
|
||||
childResources.Items.AddOneOf(new JsonSchema()
|
||||
{
|
||||
Ref = "#/definitions/" + childResourceDefinitionPropertyName,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return resourceSchemas;
|
||||
}
|
||||
|
||||
private static string[] ParseResourceTypes(string resourceProvider, string methodUrlPathAfterProvider, Method method)
|
||||
{
|
||||
// Gather the list of resource types defined by this method url. Usually this will
|
||||
// result in only one resource type, but if the method url contains an enumerated
|
||||
// resource type parameter, then multiple resource types could be declared from a
|
||||
// single method url.
|
||||
List<string> resourceTypes = new List<string>();
|
||||
resourceTypes.Add(resourceProvider);
|
||||
string[] pathSegments = methodUrlPathAfterProvider.Split(new char[] { '/' });
|
||||
for (int i = 0; i < pathSegments.Length; i += 2)
|
||||
{
|
||||
string pathSegment = pathSegments[i];
|
||||
if (IsPathVariable(pathSegment))
|
||||
{
|
||||
string parameterName = pathSegment.Substring(1, pathSegment.Length - 2);
|
||||
Parameter parameter = method.Parameters.FirstOrDefault(methodParameter => methodParameter.SerializedName == parameterName);
|
||||
if (parameter == null)
|
||||
{
|
||||
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Found undefined parameter reference {0} in create resource method \"{1}/{2}/{3}\".", pathSegment, resourceMethodPrefix, resourceProvider, methodUrlPathAfterProvider));
|
||||
}
|
||||
|
||||
if (parameter.ModelType == null)
|
||||
{
|
||||
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Parameter reference {0} has no defined type.", pathSegment));
|
||||
}
|
||||
|
||||
EnumType parameterType = parameter.ModelType as EnumType;
|
||||
if (parameterType == null)
|
||||
{
|
||||
// If we encounter a parameter in the URL that isn't an enumeration, then
|
||||
// we can't create a resource from this URL.
|
||||
resourceTypes.Clear();
|
||||
break;
|
||||
}
|
||||
|
||||
if (parameterType.Values == null || parameterType.Values.Count == 0)
|
||||
{
|
||||
string errorMessage = string.Format(CultureInfo.CurrentCulture, "Parameter reference {0} is defined as an enum type, but it doesn't have any specified values.", pathSegment);
|
||||
throw new ArgumentException(errorMessage);
|
||||
}
|
||||
|
||||
List<string> newResourceTypes = new List<string>();
|
||||
foreach (string resourceType in resourceTypes)
|
||||
{
|
||||
foreach (EnumValue parameterValue in parameterType.Values)
|
||||
{
|
||||
newResourceTypes.Add(string.Join("/", resourceType, parameterValue.SerializedName));
|
||||
}
|
||||
}
|
||||
|
||||
resourceTypes = newResourceTypes;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int j = 0; j < resourceTypes.Count; ++j)
|
||||
{
|
||||
resourceTypes[j] = string.Join("/", resourceTypes[j], pathSegment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return resourceTypes.ToArray();
|
||||
}
|
||||
|
||||
private static JsonSchema ParseType(Property property, IModelType type, IDictionary<string, JsonSchema> definitions, IEnumerable<CompositeType> modelTypes)
|
||||
{
|
||||
JsonSchema result = null;
|
||||
|
||||
if (property == null || !property.IsReadOnly)
|
||||
{
|
||||
// A schema that matches a JSON object with specific properties, such as
|
||||
// { "name": { "type": "string" }, "age": { "type": "number" } }
|
||||
CompositeType compositeType = type as CompositeType;
|
||||
if (compositeType != null)
|
||||
{
|
||||
result = ParseCompositeType(property, compositeType, true, definitions, modelTypes);
|
||||
}
|
||||
else
|
||||
{
|
||||
// A schema that matches a "dictionary" JSON object, such as
|
||||
// { "additionalProperties": { "type": "string" } }
|
||||
DictionaryType dictionaryType = type as DictionaryType;
|
||||
if (dictionaryType != null)
|
||||
{
|
||||
result = ParseDictionaryType(property, dictionaryType, definitions, modelTypes);
|
||||
}
|
||||
else
|
||||
{
|
||||
// A schema that matches a single value from a given set of values, such as
|
||||
// { "enum": [ "a", "b" ] }
|
||||
EnumType enumType = type as EnumType;
|
||||
if (enumType != null)
|
||||
{
|
||||
result = ParseEnumType(property, enumType);
|
||||
}
|
||||
else
|
||||
{
|
||||
// A schema that matches simple values, such as { "type": "number" }
|
||||
PrimaryType primaryType = type as PrimaryType;
|
||||
if (primaryType != null)
|
||||
{
|
||||
result = ParsePrimaryType(property, primaryType);
|
||||
}
|
||||
else
|
||||
{
|
||||
// A schema that matches an array of values, such as
|
||||
// { "items": { "type": "number" } }
|
||||
SequenceType sequenceType = type as SequenceType;
|
||||
if (sequenceType != null)
|
||||
{
|
||||
result = ParseSequenceType(property, sequenceType, definitions, modelTypes);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Fail("Unrecognized property type: " + type.GetType());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static JsonSchema ParseCompositeType(Property property, CompositeType compositeType, bool includeBaseModelTypeProperties, IDictionary<string, JsonSchema> definitions, IEnumerable<CompositeType> modelTypes)
|
||||
{
|
||||
string definitionName = compositeType.SerializedName;
|
||||
|
||||
if (!definitions.ContainsKey(definitionName))
|
||||
{
|
||||
JsonSchema definition = new JsonSchema()
|
||||
{
|
||||
JsonType = "object",
|
||||
Description = compositeType.Documentation,
|
||||
};
|
||||
|
||||
// This definition must be added to the definition map before we start parsing
|
||||
// its properties because its properties may recursively reference back to this
|
||||
// definition.
|
||||
definitions.Add(definitionName, definition);
|
||||
|
||||
JsonSchema baseTypeDefinition;
|
||||
|
||||
string discriminatorPropertyName = compositeType.PolymorphicDiscriminator;
|
||||
if (string.IsNullOrWhiteSpace(discriminatorPropertyName))
|
||||
{
|
||||
baseTypeDefinition = definition;
|
||||
}
|
||||
else
|
||||
{
|
||||
baseTypeDefinition = new JsonSchema();
|
||||
definition.AddAllOf(baseTypeDefinition);
|
||||
|
||||
JsonSchema derivedTypeDefinitionRefs = new JsonSchema();
|
||||
|
||||
CompositeType[] subTypes = modelTypes.Where(modelType => modelType.BaseModelType == compositeType).ToArray();
|
||||
if (subTypes != null && subTypes.Length > 0)
|
||||
{
|
||||
JsonSchema discriminatorDefinition = new JsonSchema()
|
||||
{
|
||||
JsonType = "string"
|
||||
};
|
||||
|
||||
foreach (CompositeType subType in subTypes)
|
||||
{
|
||||
if (subType != null)
|
||||
{
|
||||
// Sub-types are never referenced directly in the Swagger
|
||||
// discriminator scenario, so they wouldn't be added to the
|
||||
// produced resource schema. By calling ParseCompositeType() on the
|
||||
// sub-type we add the sub-type to the resource schema.
|
||||
ParseCompositeType(null, subType, false, definitions, modelTypes);
|
||||
|
||||
derivedTypeDefinitionRefs.AddAnyOf(new JsonSchema()
|
||||
{
|
||||
Ref = "#/definitions/" + subType.SerializedName,
|
||||
});
|
||||
|
||||
const string discriminatorValueExtensionName = "x-ms-discriminator-value";
|
||||
if (subType.ComposedExtensions.ContainsKey(discriminatorValueExtensionName))
|
||||
{
|
||||
string discriminatorValue = subType.ComposedExtensions[discriminatorValueExtensionName] as string;
|
||||
if (!string.IsNullOrWhiteSpace(discriminatorValue))
|
||||
{
|
||||
discriminatorDefinition.AddEnum(discriminatorValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
baseTypeDefinition.AddProperty(discriminatorPropertyName, discriminatorDefinition);
|
||||
|
||||
definition.AddAllOf(derivedTypeDefinitionRefs);
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerable<Property> compositeTypeProperties = includeBaseModelTypeProperties ? compositeType.ComposedProperties : compositeType.Properties;
|
||||
foreach (Property subProperty in compositeTypeProperties)
|
||||
{
|
||||
JsonSchema subPropertyDefinition = ParseType(subProperty, subProperty.ModelType, definitions, modelTypes);
|
||||
if (subPropertyDefinition != null)
|
||||
{
|
||||
baseTypeDefinition.AddProperty(subProperty.SerializedName.Else(subProperty.Name.RawValue) , subPropertyDefinition, subProperty.IsRequired);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JsonSchema result = new JsonSchema()
|
||||
{
|
||||
Ref = "#/definitions/" + definitionName
|
||||
};
|
||||
|
||||
if (property != null)
|
||||
{
|
||||
result.Description = RemovePossibleValuesFromDescription(property.Documentation);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static JsonSchema ParseDictionaryType(Property property, DictionaryType dictionaryType, IDictionary<string, JsonSchema> definitions, IEnumerable<CompositeType> modelTypes)
|
||||
{
|
||||
JsonSchema result = new JsonSchema()
|
||||
{
|
||||
JsonType = "object",
|
||||
AdditionalProperties = ParseType(null, dictionaryType.ValueType, definitions, modelTypes)
|
||||
};
|
||||
|
||||
if (property != null)
|
||||
{
|
||||
result.Description = RemovePossibleValuesFromDescription(property.Documentation);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static JsonSchema ParseEnumType(Property property, EnumType enumType)
|
||||
{
|
||||
JsonSchema result = new JsonSchema()
|
||||
{
|
||||
JsonType = "string"
|
||||
};
|
||||
|
||||
foreach (EnumValue enumValue in enumType.Values)
|
||||
{
|
||||
result.AddEnum(enumValue.SerializedName);
|
||||
}
|
||||
|
||||
if (property != null)
|
||||
{
|
||||
result.Description = RemovePossibleValuesFromDescription(property.Documentation);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static JsonSchema ParsePrimaryType(Property property, PrimaryType primaryType)
|
||||
{
|
||||
JsonSchema result = new JsonSchema()
|
||||
{
|
||||
Format = primaryType.Format
|
||||
};
|
||||
|
||||
switch (primaryType.KnownPrimaryType)
|
||||
{
|
||||
case KnownPrimaryType.Boolean:
|
||||
result.JsonType = "boolean";
|
||||
break;
|
||||
|
||||
case KnownPrimaryType.Int:
|
||||
case KnownPrimaryType.Long:
|
||||
result.JsonType = "integer";
|
||||
break;
|
||||
|
||||
case KnownPrimaryType.Double:
|
||||
case KnownPrimaryType.Decimal:
|
||||
result.JsonType = "number";
|
||||
break;
|
||||
|
||||
case KnownPrimaryType.Object:
|
||||
result.JsonType = "object";
|
||||
break;
|
||||
|
||||
case KnownPrimaryType.ByteArray:
|
||||
result.JsonType = "array";
|
||||
result.Items = new JsonSchema()
|
||||
{
|
||||
JsonType = "integer"
|
||||
};
|
||||
break;
|
||||
|
||||
case KnownPrimaryType.Base64Url:
|
||||
case KnownPrimaryType.Date:
|
||||
case KnownPrimaryType.DateTime:
|
||||
case KnownPrimaryType.String:
|
||||
case KnownPrimaryType.TimeSpan:
|
||||
result.JsonType = "string";
|
||||
break;
|
||||
|
||||
case KnownPrimaryType.Uuid:
|
||||
result.JsonType = "string";
|
||||
result.Pattern = @"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$";
|
||||
break;
|
||||
|
||||
default:
|
||||
Debug.Assert(false, "Unrecognized known property type: " + primaryType.KnownPrimaryType);
|
||||
break;
|
||||
}
|
||||
|
||||
if (property != null)
|
||||
{
|
||||
result.Description = property.Documentation;
|
||||
|
||||
if (property.DefaultValue != null)
|
||||
{
|
||||
result.AddEnum(property.DefaultValue);
|
||||
}
|
||||
|
||||
if (property.Constraints.Count > 0)
|
||||
{
|
||||
foreach (KeyValuePair<Constraint, string> entry in property.Constraints)
|
||||
{
|
||||
switch (entry.Key)
|
||||
{
|
||||
case Constraint.InclusiveMinimum:
|
||||
Debug.Assert(result.JsonType == "integer" || result.JsonType == "number", "Expected to only find an InclusiveMinimum constraint on an integer or number property.");
|
||||
result.Minimum = Double.Parse(entry.Value, CultureInfo.CurrentCulture);
|
||||
break;
|
||||
|
||||
case Constraint.InclusiveMaximum:
|
||||
Debug.Assert(result.JsonType == "integer" || result.JsonType == "number", "Expected to only find an InclusiveMaximum constraint on an integer or number property.");
|
||||
result.Maximum = Double.Parse(entry.Value, CultureInfo.CurrentCulture);
|
||||
break;
|
||||
|
||||
case Constraint.Pattern:
|
||||
Debug.Assert(result.JsonType == "string", "Expected to only find a Pattern constraint on a string property.");
|
||||
result.Pattern = entry.Value;
|
||||
break;
|
||||
|
||||
case Constraint.MinLength:
|
||||
Debug.Assert(result.JsonType == "string" || result.JsonType == "array", "Expected to only find a MinLength constraint on a string or array property.");
|
||||
result.MinLength = Double.Parse(entry.Value, CultureInfo.CurrentCulture);
|
||||
break;
|
||||
|
||||
case Constraint.MaxLength:
|
||||
Debug.Assert(result.JsonType == "string" || result.JsonType == "array", "Expected to only find a MaxLength constraint on a string or array property.");
|
||||
result.MaxLength = Double.Parse(entry.Value, CultureInfo.CurrentCulture);
|
||||
break;
|
||||
|
||||
default:
|
||||
Debug.Fail("Unrecognized property Constraint: " + entry.Key);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static JsonSchema ParseSequenceType(Property property, SequenceType sequenceType, IDictionary<string, JsonSchema> definitions, IEnumerable<CompositeType> modelTypes)
|
||||
{
|
||||
JsonSchema result = new JsonSchema()
|
||||
{
|
||||
JsonType = "array",
|
||||
Items = ParseType(null, sequenceType.ElementType, definitions, modelTypes)
|
||||
};
|
||||
|
||||
if (property != null)
|
||||
{
|
||||
result.Description = RemovePossibleValuesFromDescription(property.Documentation);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// AutoRest has no way of indicating that you don't want Enum properties to have a
|
||||
/// "Possible values include: ..." string appended at the end of their descriptions. This
|
||||
/// function removes the "Possible values" suffix if it exists.
|
||||
/// </summary>
|
||||
/// <param name="description">The description to remove the "Possible values" suffix from.</param>
|
||||
/// <returns></returns>
|
||||
private static string RemovePossibleValuesFromDescription(string description)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(description))
|
||||
{
|
||||
int possibleValuesIndex = description.IndexOf("Possible values include: ", StringComparison.OrdinalIgnoreCase);
|
||||
if (possibleValuesIndex > -1)
|
||||
{
|
||||
description = description.Substring(0, possibleValuesIndex).TrimEnd();
|
||||
}
|
||||
}
|
||||
return description;
|
||||
}
|
||||
|
||||
private static bool IsPathVariable(string pathSegment)
|
||||
{
|
||||
Debug.Assert(pathSegment != null);
|
||||
|
||||
return pathSegment.StartsWith("{", StringComparison.Ordinal) && pathSegment.EndsWith("}", StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,265 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace AutoRest.AzureResourceSchema
|
||||
{
|
||||
public static class ResourceSchemaWriter
|
||||
{
|
||||
public static void Write(TextWriter writer, ResourceSchema resourceSchema)
|
||||
{
|
||||
if (writer == null)
|
||||
{
|
||||
throw new ArgumentNullException("writer");
|
||||
}
|
||||
if (resourceSchema == null)
|
||||
{
|
||||
throw new ArgumentNullException("resourceSchema");
|
||||
}
|
||||
|
||||
using (JsonTextWriter jsonWriter = new JsonTextWriter(writer))
|
||||
{
|
||||
jsonWriter.Formatting = Formatting.Indented;
|
||||
jsonWriter.Indentation = 2;
|
||||
jsonWriter.IndentChar = ' ';
|
||||
jsonWriter.QuoteChar = '\"';
|
||||
|
||||
Write(jsonWriter, resourceSchema);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Write(JsonWriter writer, ResourceSchema resourceSchema)
|
||||
{
|
||||
if (writer == null)
|
||||
{
|
||||
throw new ArgumentNullException("writer");
|
||||
}
|
||||
if (resourceSchema == null)
|
||||
{
|
||||
throw new ArgumentNullException("resourceSchema");
|
||||
}
|
||||
|
||||
writer.WriteStartObject();
|
||||
|
||||
WriteProperty(writer, "id", resourceSchema.Id);
|
||||
WriteProperty(writer, "$schema", resourceSchema.Schema);
|
||||
WriteProperty(writer, "title", resourceSchema.Title);
|
||||
WriteProperty(writer, "description", resourceSchema.Description);
|
||||
|
||||
WriteDefinitionMap(writer, "resourceDefinitions", resourceSchema.ResourceDefinitions, sortDefinitions: true);
|
||||
|
||||
WriteDefinitionMap(writer, "definitions", resourceSchema.Definitions, sortDefinitions: true);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
|
||||
private static void WriteDefinitionMap(JsonWriter writer, string definitionMapName, IDictionary<string,JsonSchema> definitionMap, bool sortDefinitions = false, bool addExpressionReferences = false)
|
||||
{
|
||||
if (definitionMap != null && definitionMap.Count > 0)
|
||||
{
|
||||
writer.WritePropertyName(definitionMapName);
|
||||
writer.WriteStartObject();
|
||||
|
||||
IEnumerable<string> definitionNames = definitionMap.Keys;
|
||||
if (sortDefinitions)
|
||||
{
|
||||
definitionNames = definitionNames.OrderBy(key => key);
|
||||
}
|
||||
|
||||
foreach (string definitionName in definitionNames)
|
||||
{
|
||||
JsonSchema definition = definitionMap[definitionName];
|
||||
|
||||
bool shouldAddExpressionReference = addExpressionReferences;
|
||||
if (shouldAddExpressionReference)
|
||||
{
|
||||
switch (definition.JsonType)
|
||||
{
|
||||
case "object":
|
||||
shouldAddExpressionReference = !definition.IsEmpty();
|
||||
break;
|
||||
|
||||
case "string":
|
||||
shouldAddExpressionReference = (definition.Enum != null &&
|
||||
definition.Enum.Any() &&
|
||||
definitionName != "type"
|
||||
&& definitionName != "apiVersion" // api versions are templated in some templates. No idea why.
|
||||
) ||
|
||||
definition.Pattern != null;
|
||||
break;
|
||||
|
||||
case "array":
|
||||
shouldAddExpressionReference = definitionName != "resources";
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!shouldAddExpressionReference)
|
||||
{
|
||||
WriteDefinition(writer, definitionName, definition);
|
||||
}
|
||||
else
|
||||
{
|
||||
string definitionDescription = null;
|
||||
|
||||
writer.WritePropertyName(definitionName);
|
||||
writer.WriteStartObject();
|
||||
|
||||
writer.WritePropertyName("oneOf");
|
||||
writer.WriteStartArray();
|
||||
|
||||
if (definition.Description != null)
|
||||
{
|
||||
definitionDescription = definition.Description;
|
||||
|
||||
definition = definition.Clone();
|
||||
definition.Description = null;
|
||||
}
|
||||
WriteDefinition(writer, definition);
|
||||
|
||||
WriteDefinition(writer, new JsonSchema()
|
||||
{
|
||||
Ref = "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
});
|
||||
|
||||
writer.WriteEndArray();
|
||||
|
||||
WriteProperty(writer, "description", definitionDescription);
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
|
||||
public static void WriteDefinition(JsonWriter writer, string resourceName, JsonSchema definition)
|
||||
{
|
||||
if (writer == null)
|
||||
{
|
||||
throw new ArgumentNullException("writer");
|
||||
}
|
||||
|
||||
if (definition != null)
|
||||
{
|
||||
writer.WritePropertyName(resourceName);
|
||||
WriteDefinition(writer, definition);
|
||||
}
|
||||
}
|
||||
|
||||
private static void WriteDefinition(JsonWriter writer, JsonSchema definition)
|
||||
{
|
||||
if (definition == null)
|
||||
{
|
||||
throw new ArgumentNullException("definition");
|
||||
}
|
||||
|
||||
writer.WriteStartObject();
|
||||
|
||||
if (definition.JsonType != "object" || !definition.IsEmpty())
|
||||
{
|
||||
WriteProperty(writer, "type", definition.JsonType);
|
||||
WriteProperty(writer, "minimum", definition.Minimum);
|
||||
WriteProperty(writer, "maximum", definition.Maximum);
|
||||
WriteProperty(writer, "pattern", definition.Pattern);
|
||||
WriteProperty(writer, "minLength", definition.MinLength);
|
||||
WriteProperty(writer, "maxLength", definition.MaxLength);
|
||||
WriteStringArray(writer, "enum", definition.Enum);
|
||||
WriteDefinitionArray(writer, "oneOf", definition.OneOf);
|
||||
WriteDefinitionArray(writer, "anyOf", definition.AnyOf);
|
||||
WriteDefinitionArray(writer, "allOf", definition.AllOf);
|
||||
WriteProperty(writer, "format", definition.Format);
|
||||
WriteProperty(writer, "$ref", definition.Ref);
|
||||
WriteDefinition(writer, "items", definition.Items);
|
||||
WriteDefinition(writer, "additionalProperties", definition.AdditionalProperties);
|
||||
WriteDefinitionMap(writer, "properties", definition.Properties, addExpressionReferences: true);
|
||||
WriteStringArray(writer, "required", definition.Required);
|
||||
}
|
||||
WriteProperty(writer, "description", definition.Description);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
|
||||
private static void WriteStringArray(JsonWriter writer, string arrayName, IEnumerable<string> arrayValues)
|
||||
{
|
||||
if (arrayValues != null && arrayValues.Count() > 0)
|
||||
{
|
||||
writer.WritePropertyName(arrayName);
|
||||
writer.WriteStartArray();
|
||||
foreach (string arrayValue in arrayValues)
|
||||
{
|
||||
writer.WriteValue(arrayValue);
|
||||
}
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
}
|
||||
|
||||
private static void WriteDefinitionArray(JsonWriter writer, string arrayName, IEnumerable<JsonSchema> arrayDefinitions)
|
||||
{
|
||||
if (arrayDefinitions != null && arrayDefinitions.Count() > 0)
|
||||
{
|
||||
writer.WritePropertyName(arrayName);
|
||||
|
||||
writer.WriteStartArray();
|
||||
foreach (JsonSchema definition in arrayDefinitions)
|
||||
{
|
||||
WriteDefinition(writer, definition);
|
||||
}
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
}
|
||||
|
||||
public static void WriteProperty(JsonWriter writer, string propertyName, string propertyValue)
|
||||
{
|
||||
if (writer == null)
|
||||
{
|
||||
throw new ArgumentNullException("writer");
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(propertyName))
|
||||
{
|
||||
throw new ArgumentException("propertyName cannot be null or whitespace", "propertyName");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(propertyValue))
|
||||
{
|
||||
writer.WritePropertyName(propertyName);
|
||||
writer.WriteValue(propertyValue);
|
||||
}
|
||||
}
|
||||
|
||||
public static void WriteProperty(JsonWriter writer, string propertyName, double? propertyValue)
|
||||
{
|
||||
if (writer == null)
|
||||
{
|
||||
throw new ArgumentNullException("writer");
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(propertyName))
|
||||
{
|
||||
throw new ArgumentException("propertyName cannot be null or whitespace", "propertyName");
|
||||
}
|
||||
|
||||
if (propertyValue != null)
|
||||
{
|
||||
writer.WritePropertyName(propertyName);
|
||||
|
||||
double doubleValue = propertyValue.Value;
|
||||
long longValue = (long)doubleValue;
|
||||
if (doubleValue == longValue)
|
||||
{
|
||||
writer.WriteValue(longValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.WriteValue(doubleValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk" >
|
||||
<PropertyGroup><PowerShell># 2>nul || type %~df0|C:\Windows\system32\find.exe /v "setlocal"|C:\Windows\system32\find.exe /v "errorlevel"|powershell.exe -noninteractive -& exit %errorlevel% || #</PowerShell></PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<AssemblyName>autorest.azureresourceschema</AssemblyName>
|
||||
<PackageTags>autorest.extension</PackageTags>
|
||||
<VersionPrefix>1.2.2</VersionPrefix>
|
||||
|
||||
<GenerateFullPaths>true</GenerateFullPaths>
|
||||
<Common>$(MsBuildThisFileDirectory)</Common>
|
||||
<SolutionDir>$(Common)../</SolutionDir>
|
||||
|
||||
<Copyright>Copyright (c) Microsoft Corporation</Copyright>
|
||||
|
||||
<PackageIconUrl>http://go.microsoft.com/fwlink/?LinkID=288890</PackageIconUrl>
|
||||
<PackageProjectUrl>https://github.com/Azure/AutoRest</PackageProjectUrl>
|
||||
<PackageLicenseUrl>https://raw.githubusercontent.com/Microsoft/dotnet/master/LICENSE</PackageLicenseUrl>
|
||||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
||||
|
||||
<!--
|
||||
<DelaySign Condition="$(Configuration) == 'Release'">true</DelaySign>
|
||||
<AssemblyOriginatorKeyFile Condition="$(Configuration) == 'Release'">$(SolutionDir)/tools/MSSharedLibKey.snk</AssemblyOriginatorKeyFile>
|
||||
<SignAssembly Condition="$(Configuration) == 'Release'">true</SignAssembly>
|
||||
<PackageTargetFallback>$(PackageTargetFallback);dotnet;portable-net45+win8;netstandard1.3</PackageTargetFallback>
|
||||
-->
|
||||
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<RootNamespace>AutoRest.AzureResourceSchema</RootNamespace>
|
||||
|
||||
<BaseOutputPath>$(MSBuildProjectDirectory)/bin</BaseOutputPath>
|
||||
<OutputPath>$(BaseOutputPath)</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="Nuke" AfterTargets="clean">
|
||||
<Delete Files="$(BaseOutputPath)**;$(BaseIntermediateOutputPath)razor/**;$(BaseIntermediateOutputPath)Debug/**;$(BaseIntermediateOutputPath)Release/**" />
|
||||
<RemoveDir Directories="$(BaseOutputPath);$(BaseIntermediateOutputPath)/Debug;$(BaseIntermediateOutputPath)/Release" />
|
||||
</Target>
|
||||
|
||||
<Target Name="UpdateResources" BeforeTargets="BeforeBuild">
|
||||
<!-- <Message Text="Ensuring resources .cs files are netframework compatible [$(MSBuildProjectName)]" Importance="high" /> -->
|
||||
<PropertyGroup>
|
||||
<ResGenFix>$(Powershell)
|
||||
#
|
||||
# modify resgen'd designer files for netframework1.4
|
||||
#
|
||||
cmd /c dir /s /b *.designer.cs |% { dir $_ } |% {
|
||||
$content = (Get-Content "$_" -Raw )
|
||||
if ( -not ($content -match "using System.Reflection") -and ($content -match "This class was auto-generated by the StronglyTypedResourceBuilder") ) {
|
||||
write-host -fore green updating $_
|
||||
$content = $content -replace "(using System;)", "`$1`n using System.Reflection;" -replace "(typeof\(.*\)).Assembly", "`$1.GetTypeInfo().Assembly"
|
||||
Set-Content -value $content -path $_
|
||||
}
|
||||
}
|
||||
</ResGenFix>
|
||||
|
||||
</PropertyGroup>
|
||||
<Exec Condition="$(SolutionDir) != '' AND $(OS) =='WINDOWS_NT' " Command="$(ResGenFix)" EchoOff="true" WorkingDirectory="$(MSBuildProjectDirectory)" />
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
|
||||
<PackageReference Include="YamlDotNet.Signed" Version="4.2.1" />
|
||||
<PackageReference Include="autorest.common" Version="2.0.26" />
|
||||
<!-- <ProjectReference Include="../../autorest.common/src/autorest.common.csproj" /> -->
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="UpdateDepsJson" AfterTargets="GenerateBuildDependencyFile;Publish">
|
||||
<Message Text="Fixing deps.json" Importance="high" />
|
||||
<PropertyGroup>
|
||||
<ResGenFix>$(Powershell)
|
||||
$path = "$(BaseOutputPath)/netcoreapp2.0/$(TargetName).deps.json"
|
||||
$content = (Get-Content "$path" -Raw )
|
||||
$content = $content -replace ' "System.ComponentModel.Primitives/', ' "System.ComponentModel.Primitives.Nope/'
|
||||
$content = $content -replace ' "System.Linq/', ' "System.Linq.Nope/'
|
||||
$content = $content -replace ' "System.Net.Http/', ' "System.Net.Http.Nope/'
|
||||
$content = $content -replace ' "System.Text.RegularExpressions/', ' "System.Text.RegularExpressions.Nope/'
|
||||
$content = $content -replace ' "System.Threading.Thread/', ' "System.Threading.Thread.Nope/'
|
||||
$content = $content -replace ' "System.Threading/', ' "System.Threading.Nope/'
|
||||
$content = $content -replace ' "System.Xml.XDocument/', ' "System.Xml.XDocument.Nope/'
|
||||
Set-Content -value $content -path $path
|
||||
</ResGenFix>
|
||||
</PropertyGroup>
|
||||
<Exec Condition="$(SolutionDir) != '' AND $(OS) =='WINDOWS_NT' " Command="$(ResGenFix)" EchoOff="true" WorkingDirectory="$(MSBuildProjectDirectory)" />
|
||||
</Target>
|
||||
</Project>
|
|
@ -0,0 +1,300 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
using System.IO;
|
||||
using Xunit;
|
||||
|
||||
namespace AutoRest.AzureResourceSchema.Tests
|
||||
{
|
||||
[Collection("AutoRest Azure Resource Schema Tests")]
|
||||
public static class AzureResourceSchemaAcceptanceTests
|
||||
{
|
||||
[Fact]
|
||||
public static void ApiManagement_2016_07_07()
|
||||
{
|
||||
RunSwaggerTest("ApiManagement", "2016-07-07", "apimanagement.json");
|
||||
}
|
||||
|
||||
/*
|
||||
[Fact]
|
||||
public static void ApiManagement_2016_07_07b()
|
||||
{
|
||||
RunSwaggerTest("ApiManagement", "2016-07-07b", "apimanagement.json");
|
||||
}
|
||||
*/
|
||||
|
||||
[Fact]
|
||||
public static void Authorization_2015_07_01()
|
||||
{
|
||||
RunSwaggerTest("Authorization", "2015-07-01", "authorization.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void Batch_2015_12_01()
|
||||
{
|
||||
RunSwaggerTest("Batch", "2015-12-01", "BatchManagement.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void Cdn_2015_06_01()
|
||||
{
|
||||
RunSwaggerTest("CDN", "2015-06-01", "cdn.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void Cdn_2016_04_02()
|
||||
{
|
||||
RunSwaggerTest("CDN", "2016-04-02", "cdn.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void CognitiveServices_2016_02_01_preview()
|
||||
{
|
||||
RunSwaggerTest("CognitiveServices", "2016-02-01-preview", "cognitiveservices.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void CommitmentPlans_2016_05_01_preview()
|
||||
{
|
||||
RunSwaggerTest("CommitmentPlans", "2016-05-01-preview", "commitmentPlans.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void Compute_2015_06_15()
|
||||
{
|
||||
RunSwaggerTest("Compute", "2015-06-15", "compute.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void Compute_2016_03_30()
|
||||
{
|
||||
RunSwaggerTest("Compute", "2016-03-30", "compute.json");
|
||||
}
|
||||
|
||||
/*
|
||||
[Fact]
|
||||
public static void Compute_2016_03_30b()
|
||||
{
|
||||
RunSwaggerTest("Compute", "2016-03-30b", "compute.json");
|
||||
}
|
||||
*/
|
||||
[Fact]
|
||||
public static void ContainerService_2016_03_30()
|
||||
{
|
||||
RunSwaggerTest("ContainerService", "2016-03-30", "containerService.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void DataLakeAnalytics_2015_10_01_preview()
|
||||
{
|
||||
RunSwaggerTest("DataLakeAnalytics", "2015-10-01-preview", "account.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void DataLakeStore_2015_10_01_preview()
|
||||
{
|
||||
RunSwaggerTest("DataLakeStore", "2015-10-01-preview", "account.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void DevTestLabs_2015_05_21_preview()
|
||||
{
|
||||
RunSwaggerTest("DevTestLabs", "2015-05-21-preview", "DTL.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void Dns_2015_05_04_preview()
|
||||
{
|
||||
RunSwaggerTest("DNS", "2015-05-04-preview", "dns.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void Dns_2016_04_01()
|
||||
{
|
||||
RunSwaggerTest("DNS", "2016-04-01", "dns.json");
|
||||
}
|
||||
|
||||
[Fact(Skip = "invalid Swagger spec, nowadays AutoRest complains")]
|
||||
public static void Logic_2015_02_01_preview()
|
||||
{
|
||||
RunSwaggerTest("Logic", "2015-02-01-preview", "logic.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void Logic_2016_06_01()
|
||||
{
|
||||
RunSwaggerTest("Logic", "2016-06-01", "logic.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void MachineLearning_2016_05_01_preview()
|
||||
{
|
||||
RunSwaggerTest("MachineLearning", "2016-05-01-preview", "webservices.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void MobileEngagement_2014_12_01()
|
||||
{
|
||||
RunSwaggerTest("MobileEngagement", "2014-12-01", "mobile-engagement.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void Network_2015_05_01_preview()
|
||||
{
|
||||
RunSwaggerTest("Network", "2015-05-01-preview", "network.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void Network_2015_06_15()
|
||||
{
|
||||
RunSwaggerTest("Network", "2015-06-15", "network.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void Network_2016_03_30()
|
||||
{
|
||||
RunSwaggerTest("Network", "2016-03-30", "network.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void Network_2016_09_01()
|
||||
{
|
||||
RunSwaggerTest("Network", "2016-09-01", "network.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void NotificationHubs_2016_03_01()
|
||||
{
|
||||
RunSwaggerTest("NotificationHubs", "2016-03-01", "notificationhubs.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void PowerBIEmbedded_2016_01_29()
|
||||
{
|
||||
RunSwaggerTest("PowerBIEmbedded", "2016-01-29", "powerbiembedded.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void RecoveryServices_2016_06_01()
|
||||
{
|
||||
RunSwaggerTest("RecoveryServices", "2016-06-01", "recoveryservices.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void Redis_2016_04_01()
|
||||
{
|
||||
RunSwaggerTest("Redis", "2016-04-01", "redis.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void Resources_Features_2015_12_01()
|
||||
{
|
||||
RunSwaggerTest("Resources/Features", "2015-12-01", "features.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void Resources_Locks_2016_09_01()
|
||||
{
|
||||
RunSwaggerTest("Resources/Locks", "2016-09-01", "locks.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void Resources_Policy_2016_04_01()
|
||||
{
|
||||
RunSwaggerTest("Resources/Policy", "2016-04-01", "policy.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void Resources_Resources_2016_09_01()
|
||||
{
|
||||
RunSwaggerTest("Resources/Resources", "2016-09-01", "resources.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void Resources_Subscriptions_2016_06_01()
|
||||
{
|
||||
RunSwaggerTest("Resources/Subscriptions", "2016-06-01", "subscriptions.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void Scheduler_2016_03_01()
|
||||
{
|
||||
RunSwaggerTest("Scheduler", "2016-03-01", "scheduler.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void Search_2015_02_28()
|
||||
{
|
||||
RunSwaggerTest("Search", "2015-02-28", "search.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void ServerManagement_2016_07_01()
|
||||
{
|
||||
RunSwaggerTest("ServerManagement", "2016-07-01-preview", "servermanagement.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void ServiceBus_2015_08_01()
|
||||
{
|
||||
RunSwaggerTest("ServiceBus", "2015-08-01", "servicebus.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void ServiceFabric_2016_01_28()
|
||||
{
|
||||
RunSwaggerTest("ServiceFabric", "2016-01-28", "servicefabric.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void SQL_2015_05_01()
|
||||
{
|
||||
RunSwaggerTest("SQL", "2015-05-01", "sql.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void Storage_2015_05_01_preview()
|
||||
{
|
||||
RunSwaggerTest("Storage", "2015-05-01-preview", "storage.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void Storage_2015_06_15()
|
||||
{
|
||||
RunSwaggerTest("Storage", "2015-06-15", "storage.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void Storage_2016_01_01()
|
||||
{
|
||||
RunSwaggerTest("Storage", "2016-01-01", "storage.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void TrafficManager_2015_11_01()
|
||||
{
|
||||
RunSwaggerTest("TrafficManager", "2015-11-01", "trafficmanager.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void Web_2015_08_01()
|
||||
{
|
||||
RunSwaggerTest("Web", "2015-08-01", "web.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void WebYaml_2015_08_01()
|
||||
{
|
||||
// same test as Web(), but converted to YAML
|
||||
RunSwaggerTest("Web", "2015-08-01", "web.yaml");
|
||||
}
|
||||
|
||||
private static void RunSwaggerTest(string resourceType, string apiVersion, string swaggerFileName)
|
||||
{
|
||||
var codeBaseDir = Core.Utilities.Extensions.CodeBaseDirectory(typeof(AzureResourceSchemaAcceptanceTests));
|
||||
SwaggerSpecHelper.RunTests(
|
||||
Path.Combine(codeBaseDir, "Resource", "Swagger", resourceType, apiVersion, swaggerFileName),
|
||||
Path.Combine(codeBaseDir, "Resource", "Expected", resourceType, apiVersion));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using AutoRest.Core;
|
||||
using AutoRest.Core.Model;
|
||||
using AutoRest.Core.Utilities;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Xunit;
|
||||
using static AutoRest.Core.Utilities.DependencyInjection;
|
||||
|
||||
namespace AutoRest.AzureResourceSchema.Tests
|
||||
{
|
||||
[Collection("AutoRest Tests")]
|
||||
public class AzureResourceSchemaCodeGeneratorTests
|
||||
{
|
||||
[Fact]
|
||||
public void ImplementationFileExtension()
|
||||
{
|
||||
Assert.Equal(".json", CreatePlugin().CodeGenerator.ImplementationFileExtension);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void UsageInstructionsWithNoOutputFileSetting()
|
||||
{
|
||||
PluginArs plugin = CreatePlugin();
|
||||
Assert.Equal("Your Azure Resource Schema(s) can be found in " + new Settings().OutputDirectory, plugin.CodeGenerator.UsageInstructions);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void UsageInstructionsWithOutputFileSetting()
|
||||
{
|
||||
using (NewContext) {
|
||||
Settings settings = new Settings() { OutputFileName = "spam.json" };
|
||||
PluginArs plugin = CreatePlugin();
|
||||
Assert.Equal("Your Azure Resource Schema(s) can be found in " + settings.OutputDirectory, plugin.CodeGenerator.UsageInstructions);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static PluginArs CreatePlugin()
|
||||
{
|
||||
return new PluginArs();
|
||||
}
|
||||
|
||||
private static async Task TestGenerate(string apiVersion, string[] methodUrls, string expectedJsonString)
|
||||
{
|
||||
using (NewContext) {
|
||||
MemoryFileSystem fileSystem = new MemoryFileSystem();
|
||||
|
||||
Settings settings = new Settings();
|
||||
settings.FileSystemOutput = fileSystem;
|
||||
|
||||
CodeModel serviceClient = New<CodeModel>();
|
||||
serviceClient.ApiVersion = apiVersion;
|
||||
foreach (string methodUrl in methodUrls) {
|
||||
serviceClient.Add(New<Method>(new {
|
||||
Url = methodUrl,
|
||||
HttpMethod = HttpMethod.Put,
|
||||
}));
|
||||
}
|
||||
await CreatePlugin().CodeGenerator.Generate(serviceClient);
|
||||
|
||||
Assert.Equal(2, fileSystem.VirtualStore.Count);
|
||||
|
||||
string folderPath = fileSystem.VirtualStore.Keys.First();
|
||||
Assert.Equal("Folder", fileSystem.VirtualStore[folderPath].ToString());
|
||||
|
||||
JObject expectedJSON = JObject.Parse(expectedJsonString);
|
||||
|
||||
string fileContents = fileSystem.VirtualStore[fileSystem.VirtualStore.Keys.Skip(1).First()].ToString();
|
||||
JObject actualJson = JObject.Parse(fileContents);
|
||||
|
||||
Assert.Equal(expectedJSON, actualJson);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Xunit;
|
||||
|
||||
namespace AutoRest.AzureResourceSchema.Tests
|
||||
{
|
||||
public class JSONSchemaTests
|
||||
{
|
||||
[Fact]
|
||||
public void AddPropertyWithNullPropertyName()
|
||||
{
|
||||
JsonSchema jsonSchema = new JsonSchema();
|
||||
Assert.Throws<ArgumentException>(() => { jsonSchema.AddProperty(null, null); });
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AddPropertyWithEmptyPropertyName()
|
||||
{
|
||||
JsonSchema jsonSchema = new JsonSchema();
|
||||
Assert.Throws<ArgumentException>(() => { jsonSchema.AddProperty("", null); });
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AddPropertyWithWhitespacePropertyName()
|
||||
{
|
||||
JsonSchema jsonSchema = new JsonSchema();
|
||||
Assert.Throws<ArgumentException>(() => { jsonSchema.AddProperty(" ", null); });
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AddRequiredWithOneValueWhenPropertyDoesntExist()
|
||||
{
|
||||
JsonSchema jsonSchema = new JsonSchema();
|
||||
Assert.Throws<ArgumentException>(() => { jsonSchema.AddRequired("a"); });
|
||||
Assert.Null(jsonSchema.Properties);
|
||||
Assert.Null(jsonSchema.Required);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AddRequiredWithTwoValuesWhenSecondPropertyDoesntExist()
|
||||
{
|
||||
JsonSchema jsonSchema = new JsonSchema();
|
||||
jsonSchema.AddProperty("a", new JsonSchema());
|
||||
Assert.Throws<ArgumentException>(() => { jsonSchema.AddRequired("a", "b"); });
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AddRequiredWithThreeValuesWhenAllPropertiesExist()
|
||||
{
|
||||
JsonSchema jsonSchema = new JsonSchema();
|
||||
jsonSchema.AddProperty("a", new JsonSchema());
|
||||
jsonSchema.AddProperty("b", new JsonSchema());
|
||||
jsonSchema.AddProperty("c", new JsonSchema());
|
||||
|
||||
jsonSchema.AddRequired("a", "b", "c");
|
||||
|
||||
Assert.Equal(new List<string>() { "a", "b", "c" }, jsonSchema.Required);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EqualsWithNull()
|
||||
{
|
||||
JsonSchema lhs = new JsonSchema();
|
||||
Assert.False(lhs.Equals(null));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EqualsWithString()
|
||||
{
|
||||
JsonSchema lhs = new JsonSchema();
|
||||
Assert.False(lhs.Equals("Not Equal"));
|
||||
}
|
||||
}
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,150 @@
|
|||
# Microsoft.ApiManagement/service template reference
|
||||
API Version: 2016-07-07
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.ApiManagement/service resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.ApiManagement/service",
|
||||
"apiVersion": "2016-07-07",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"properties": {
|
||||
"publisherEmail": "string",
|
||||
"publisherName": "string",
|
||||
"provisioningState": "string",
|
||||
"targetProvisioningState": "string",
|
||||
"createdAtUtc": "string",
|
||||
"runtimeUrl": "string",
|
||||
"portalUrl": "string",
|
||||
"managementApiUrl": "string",
|
||||
"scmUrl": "string",
|
||||
"addresserEmail": "string",
|
||||
"hostnameConfigurations": [
|
||||
{
|
||||
"type": "string",
|
||||
"hostname": "string",
|
||||
"certificate": {
|
||||
"expiry": "string",
|
||||
"thumbprint": "string",
|
||||
"subject": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"staticIPs": [
|
||||
"string"
|
||||
],
|
||||
"vpnconfiguration": {
|
||||
"subnetResourceId": "string",
|
||||
"location": "string"
|
||||
},
|
||||
"additionalLocations": [
|
||||
{
|
||||
"location": "string",
|
||||
"skuType": "string",
|
||||
"skuUnitCount": "integer",
|
||||
"staticIPs": [
|
||||
"string"
|
||||
],
|
||||
"vpnconfiguration": {
|
||||
"subnetResourceId": "string",
|
||||
"location": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"customProperties": {},
|
||||
"vpnType": "string"
|
||||
},
|
||||
"sku": {
|
||||
"name": "string",
|
||||
"capacity": "integer"
|
||||
},
|
||||
"resources": []
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.ApiManagement/service" />
|
||||
### Microsoft.ApiManagement/service object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | The name of the Api Management service. |
|
||||
| type | enum | Yes | Microsoft.ApiManagement/service |
|
||||
| apiVersion | enum | Yes | 2016-07-07 |
|
||||
| location | string | Yes | Api Management service data center location. |
|
||||
| tags | object | No | Api Management service tags. A maximum of 10 tags can be provided for a resource, and each tag must have a key no greater than 128 characters (and value no greater than 256 characters) |
|
||||
| properties | object | Yes | Properties of the Api Management service. - [ApiServiceProperties object](#ApiServiceProperties) |
|
||||
| sku | object | Yes | Sku properties of the Api Management service. - [ApiServiceSkuProperties object](#ApiServiceSkuProperties) |
|
||||
| resources | array | No | [openidConnectProviders](./service/openidConnectProviders.md) [properties](./service/properties.md) [loggers](./service/loggers.md) [authorizationServers](./service/authorizationServers.md) [users](./service/users.md) [certificates](./service/certificates.md) [groups](./service/groups.md) [products](./service/products.md) [subscriptions](./service/subscriptions.md) [apis](./service/apis.md) |
|
||||
|
||||
|
||||
<a id="ApiServiceProperties" />
|
||||
### ApiServiceProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| publisherEmail | string | No | Publisher email. |
|
||||
| publisherName | string | No | Publisher name. |
|
||||
| provisioningState | string | No | Provisioning state of the Api Management service. |
|
||||
| targetProvisioningState | string | No | Target provisioning state of the Api Management service.The state that is targeted for the Api Management service by the infrastructure. |
|
||||
| createdAtUtc | string | No | Creation UTC date of the Api Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. |
|
||||
| runtimeUrl | string | No | Proxy endpoint Url of the Api Management service. |
|
||||
| portalUrl | string | No | management portal endpoint Url of the Api Management service. |
|
||||
| managementApiUrl | string | No | management api endpoint Url of the Api Management service. |
|
||||
| scmUrl | string | No | Scm endpoint Url of the Api Management service. |
|
||||
| addresserEmail | string | No | Addresser email. |
|
||||
| hostnameConfigurations | array | No | Custom hostname configuration of the Api Management service. - [HostnameConfiguration object](#HostnameConfiguration) |
|
||||
| staticIPs | array | No | Static ip addresses of the Api Management service virtual machines. Available only for Standard and Premium Sku. - string |
|
||||
| vpnconfiguration | object | No | Virtual network configuration of the Api Management service. - [VirtualNetworkConfiguration object](#VirtualNetworkConfiguration) |
|
||||
| additionalLocations | array | No | Additional datacenter locations description of the Api Management service. - [AdditionalRegion object](#AdditionalRegion) |
|
||||
| customProperties | object | No | Custom properties of the Api Management service. |
|
||||
| vpnType | enum | No | Virtual private network type of the Api Management service. - None, External, Internal |
|
||||
|
||||
|
||||
<a id="ApiServiceSkuProperties" />
|
||||
### ApiServiceSkuProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | enum | No | Name of the Sku. - Developer, Standard, Premium |
|
||||
| capacity | integer | No | Capacity of the Sku (number of deployed units of the Sku). |
|
||||
|
||||
|
||||
<a id="HostnameConfiguration" />
|
||||
### HostnameConfiguration object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| type | enum | Yes | Hostname type. - Proxy, Portal, Management, Scm |
|
||||
| hostname | string | Yes | Hostname. |
|
||||
| certificate | object | Yes | Certificate information. - [CertificateInformation object](#CertificateInformation) |
|
||||
|
||||
|
||||
<a id="VirtualNetworkConfiguration" />
|
||||
### VirtualNetworkConfiguration object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| subnetResourceId | string | No | Subnet Resource Id. |
|
||||
| location | string | No | Virtual network location name. |
|
||||
|
||||
|
||||
<a id="AdditionalRegion" />
|
||||
### AdditionalRegion object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| location | string | No | Location name. |
|
||||
| skuType | enum | No | Sku type in the location. - Developer, Standard, Premium |
|
||||
| skuUnitCount | integer | No | Sku Unit count at the location. |
|
||||
| staticIPs | array | No | Static IP addresses of the location virtual machines. - string |
|
||||
| vpnconfiguration | object | No | Virtual network configuration for the location. - [VirtualNetworkConfiguration object](#VirtualNetworkConfiguration) |
|
||||
|
||||
|
||||
<a id="CertificateInformation" />
|
||||
### CertificateInformation object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| expiry | string | Yes | Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. |
|
||||
| thumbprint | string | Yes | Thumbprint of the certificate. |
|
||||
| subject | string | Yes | Subject of the certificate. |
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
# Microsoft.ApiManagement/service/apis template reference
|
||||
API Version: 2016-07-07
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.ApiManagement/service/apis resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.ApiManagement/service/apis",
|
||||
"apiVersion": "2016-07-07",
|
||||
"ApiContract": {
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"serviceUrl": "string",
|
||||
"path": "string",
|
||||
"protocols": [
|
||||
"string"
|
||||
],
|
||||
"authenticationSettings": {
|
||||
"oAuth2": {
|
||||
"authorizationServerId": "string",
|
||||
"scope": "string"
|
||||
}
|
||||
},
|
||||
"subscriptionKeyParameterNames": {
|
||||
"header": "string",
|
||||
"query": "string"
|
||||
},
|
||||
"type": "string"
|
||||
},
|
||||
"resources": []
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.ApiManagement/service/apis" />
|
||||
### Microsoft.ApiManagement/service/apis object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | API identifier. Must be unique in the current API Management service instance. |
|
||||
| type | enum | Yes | Microsoft.ApiManagement/service/apis |
|
||||
| apiVersion | enum | Yes | 2016-07-07 |
|
||||
| ApiContract | object | Yes | ApiContract. - [ApiContract object](#ApiContract) |
|
||||
| resources | array | No | [operations](./apis/operations.md) |
|
||||
|
||||
|
||||
<a id="ApiContract" />
|
||||
### ApiContract object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | API name. |
|
||||
| description | string | No | Description of the API. May include HTML formatting tags. |
|
||||
| serviceUrl | string | Yes | Absolute URL of the backend service implementing this API. |
|
||||
| path | string | Yes | Path for API requests. |
|
||||
| protocols | array | Yes | Protocols over which API is made available. - Http or Https |
|
||||
| authenticationSettings | object | No | Collection of authentication settings included into this API. - [AuthenticationSettingsContract object](#AuthenticationSettingsContract) |
|
||||
| subscriptionKeyParameterNames | object | No | Protocols over which API is made available. - [SubscriptionKeyParameterNamesContract object](#SubscriptionKeyParameterNamesContract) |
|
||||
| type | enum | No | Type of API. - Http or Soap |
|
||||
|
||||
|
||||
<a id="AuthenticationSettingsContract" />
|
||||
### AuthenticationSettingsContract object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| oAuth2 | object | No | [OAuth2AuthenticationSettingsContract object](#OAuth2AuthenticationSettingsContract) |
|
||||
|
||||
|
||||
<a id="SubscriptionKeyParameterNamesContract" />
|
||||
### SubscriptionKeyParameterNamesContract object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| header | string | No | Subscription key header name. |
|
||||
| query | string | No | Subscription key query string parameter name. |
|
||||
|
||||
|
||||
<a id="OAuth2AuthenticationSettingsContract" />
|
||||
### OAuth2AuthenticationSettingsContract object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| authorizationServerId | string | No | OAuth authorization server identifier. |
|
||||
| scope | string | No | operations scope. |
|
||||
|
|
@ -0,0 +1,143 @@
|
|||
# Microsoft.ApiManagement/service/apis/operations template reference
|
||||
API Version: 2016-07-07
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.ApiManagement/service/apis/operations resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.ApiManagement/service/apis/operations",
|
||||
"apiVersion": "2016-07-07",
|
||||
"OperationContract": {
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"method": "string",
|
||||
"urlTemplate": "string",
|
||||
"templateParameters": [
|
||||
{
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"type": "string",
|
||||
"defaultValue": "string",
|
||||
"required": boolean,
|
||||
"values": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
],
|
||||
"description": "string",
|
||||
"request": {
|
||||
"description": "string",
|
||||
"queryParameters": [
|
||||
{
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"type": "string",
|
||||
"defaultValue": "string",
|
||||
"required": boolean,
|
||||
"values": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
],
|
||||
"headers": [
|
||||
{
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"type": "string",
|
||||
"defaultValue": "string",
|
||||
"required": boolean,
|
||||
"values": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
],
|
||||
"representations": [
|
||||
{
|
||||
"contentType": "string",
|
||||
"sample": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"responses": [
|
||||
{
|
||||
"statusCode": "integer",
|
||||
"description": "string",
|
||||
"representations": [
|
||||
{
|
||||
"contentType": "string",
|
||||
"sample": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.ApiManagement/service/apis/operations" />
|
||||
### Microsoft.ApiManagement/service/apis/operations object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.ApiManagement/service/apis/operations |
|
||||
| apiVersion | enum | Yes | 2016-07-07 |
|
||||
| OperationContract | object | Yes | operation details. - [OperationContract object](#OperationContract) |
|
||||
|
||||
|
||||
<a id="OperationContract" />
|
||||
### OperationContract object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| id | string | No | OperationId path. |
|
||||
| name | string | Yes | Operation Name. |
|
||||
| method | string | Yes | Operation Method (GET, PUT, POST, etc.). |
|
||||
| urlTemplate | string | Yes | Operation URI template. Cannot be more than 400 characters long. |
|
||||
| templateParameters | array | No | Collection of URL template parameters. - [ParameterContract object](#ParameterContract) |
|
||||
| description | string | No | Operation description. |
|
||||
| request | object | No | Operation request. - [RequestContract object](#RequestContract) |
|
||||
| responses | array | No | Array of Operation responses. - [ResultContract object](#ResultContract) |
|
||||
|
||||
|
||||
<a id="ParameterContract" />
|
||||
### ParameterContract object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | Parameter name. |
|
||||
| description | string | No | Parameter description. |
|
||||
| type | string | Yes | Parameter type. |
|
||||
| defaultValue | string | No | Default parameter value. |
|
||||
| required | boolean | No | whether parameter is required or not. |
|
||||
| values | array | No | Parameter values. - string |
|
||||
|
||||
|
||||
<a id="RequestContract" />
|
||||
### RequestContract object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| description | string | No | Operation request description. |
|
||||
| queryParameters | array | No | Collection of operation request query parameters. - [ParameterContract object](#ParameterContract) |
|
||||
| headers | array | No | Collection of operation request headers. - [ParameterContract object](#ParameterContract) |
|
||||
| representations | array | No | Collection of operation request representations. - [RepresentationContract object](#RepresentationContract) |
|
||||
|
||||
|
||||
<a id="ResultContract" />
|
||||
### ResultContract object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| statusCode | integer | Yes | Operation response status code. |
|
||||
| description | string | No | Operation response description. |
|
||||
| representations | array | No | Collection of operation response representations. - [RepresentationContract object](#RepresentationContract) |
|
||||
|
||||
|
||||
<a id="RepresentationContract" />
|
||||
### RepresentationContract object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| contentType | string | Yes | Content type. |
|
||||
| sample | string | No | Content sample. |
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
# Microsoft.ApiManagement/service/authorizationServers template reference
|
||||
API Version: 2016-07-07
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.ApiManagement/service/authorizationServers resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.ApiManagement/service/authorizationServers",
|
||||
"apiVersion": "2016-07-07",
|
||||
"OAuth2AuthorizationServerContract": {
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"clientRegistrationEndpoint": "string",
|
||||
"authorizationEndpoint": "string",
|
||||
"authorizationMethods": [
|
||||
"string"
|
||||
],
|
||||
"clientAuthenticationMethod": [
|
||||
"string"
|
||||
],
|
||||
"tokenBodyParameters": [
|
||||
{
|
||||
"name": "string",
|
||||
"value": "string"
|
||||
}
|
||||
],
|
||||
"tokenEndpoint": "string",
|
||||
"supportState": boolean,
|
||||
"defaultScope": "string",
|
||||
"grantTypes": [
|
||||
"string"
|
||||
],
|
||||
"bearerTokenSendingMethods": [
|
||||
"string"
|
||||
],
|
||||
"clientId": "string",
|
||||
"clientSecret": "string",
|
||||
"resourceOwnerUsername": "string",
|
||||
"resourceOwnerPassword": "string"
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.ApiManagement/service/authorizationServers" />
|
||||
### Microsoft.ApiManagement/service/authorizationServers object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.ApiManagement/service/authorizationServers |
|
||||
| apiVersion | enum | Yes | 2016-07-07 |
|
||||
| OAuth2AuthorizationServerContract | object | Yes | OAuth2 Authorization Server details. - [OAuth2AuthorizationServerContract object](#OAuth2AuthorizationServerContract) |
|
||||
|
||||
|
||||
<a id="OAuth2AuthorizationServerContract" />
|
||||
### OAuth2AuthorizationServerContract object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | No | User-friendly authorization server name. |
|
||||
| description | string | No | User-friendly authorization server name. |
|
||||
| clientRegistrationEndpoint | string | No | Client registration URI that will be shown for developers. |
|
||||
| authorizationEndpoint | string | No | OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. |
|
||||
| authorizationMethods | array | No | Supported methods of authorization. - HEAD, OPTIONS, TRACE, GET, POST, PUT, PATCH, DELETE |
|
||||
| clientAuthenticationMethod | array | No | Supported methods of authorization. - Basic or Body |
|
||||
| tokenBodyParameters | array | No | Token request body parameters. - [TokenBodyParameterContract object](#TokenBodyParameterContract) |
|
||||
| tokenEndpoint | string | No | OAuth token endpoint. See http://tools.ietf.org/html/rfc6749#section-3.1 . |
|
||||
| supportState | boolean | No | whether Auhtorizatoin Server supports client credentials in body or not. See http://tools.ietf.org/html/rfc6749#section-3.1 . |
|
||||
| defaultScope | string | No | Scope that is going to applied by default on the console page. See http://tools.ietf.org/html/rfc6749#section-3.3 . |
|
||||
| grantTypes | array | No | Form of an authorization grant, which the client uses to request the access token. See http://tools.ietf.org/html/rfc6749#section-4 . - authorizationCode, implicit, resourceOwnerPassword, clientCredentials |
|
||||
| bearerTokenSendingMethods | array | No | Form of an authorization grant, which the client uses to request the access token. See http://tools.ietf.org/html/rfc6749#section-4 . - authorizationHeader or query |
|
||||
| clientId | string | No | Client ID of developer console which is the client application. |
|
||||
| clientSecret | string | No | Client Secret of developer console which is the client application. |
|
||||
| resourceOwnerUsername | string | No | Username of the resource owner on behalf of whom developer console will make requests. |
|
||||
| resourceOwnerPassword | string | No | Password of the resource owner on behalf of whom developer console will make requests. |
|
||||
|
||||
|
||||
<a id="TokenBodyParameterContract" />
|
||||
### TokenBodyParameterContract object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | No | body parameter name. |
|
||||
| value | string | No | body parameter value. |
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
# Microsoft.ApiManagement/service/certificates template reference
|
||||
API Version: 2016-07-07
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.ApiManagement/service/certificates resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.ApiManagement/service/certificates",
|
||||
"apiVersion": "2016-07-07",
|
||||
"data": "string",
|
||||
"password": "string"
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.ApiManagement/service/certificates" />
|
||||
### Microsoft.ApiManagement/service/certificates object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.ApiManagement/service/certificates |
|
||||
| apiVersion | enum | Yes | 2016-07-07 |
|
||||
| data | string | No | Base 64 encoded Certificate |
|
||||
| password | string | No | Password for the Certificate |
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
# Microsoft.ApiManagement/service/groups template reference
|
||||
API Version: 2016-07-07
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.ApiManagement/service/groups resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.ApiManagement/service/groups",
|
||||
"apiVersion": "2016-07-07",
|
||||
"description": "string",
|
||||
"externalId": "string",
|
||||
"resources": []
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.ApiManagement/service/groups" />
|
||||
### Microsoft.ApiManagement/service/groups object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | Group identifier. Must be unique in the current API Management service instance. |
|
||||
| type | enum | Yes | Microsoft.ApiManagement/service/groups |
|
||||
| apiVersion | enum | Yes | 2016-07-07 |
|
||||
| description | string | No | Group description. |
|
||||
| externalId | string | No | Identifier for an external group. |
|
||||
| resources | array | No | [users](./groups/users.md) |
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
# Microsoft.ApiManagement/service/groups/users template reference
|
||||
API Version: 2016-07-07
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.ApiManagement/service/groups/users resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.ApiManagement/service/groups/users",
|
||||
"apiVersion": "2016-07-07"
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.ApiManagement/service/groups/users" />
|
||||
### Microsoft.ApiManagement/service/groups/users object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | User identifier. Must be unique in the current API Management service instance. |
|
||||
| type | enum | Yes | Microsoft.ApiManagement/service/groups/users |
|
||||
| apiVersion | enum | Yes | 2016-07-07 |
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
# Microsoft.ApiManagement/service/loggers template reference
|
||||
API Version: 2016-07-07
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.ApiManagement/service/loggers resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.ApiManagement/service/loggers",
|
||||
"apiVersion": "2016-07-07",
|
||||
"description": "string",
|
||||
"credentials": {},
|
||||
"isBuffered": boolean
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.ApiManagement/service/loggers" />
|
||||
### Microsoft.ApiManagement/service/loggers object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.ApiManagement/service/loggers |
|
||||
| apiVersion | enum | Yes | 2016-07-07 |
|
||||
| description | string | No | Logger description. |
|
||||
| credentials | object | Yes | Logger credentials. |
|
||||
| isBuffered | boolean | No | whether records are buffered in the logger before publishing. Default is assumed to be true. |
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
# Microsoft.ApiManagement/service/openidConnectProviders template reference
|
||||
API Version: 2016-07-07
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.ApiManagement/service/openidConnectProviders resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.ApiManagement/service/openidConnectProviders",
|
||||
"apiVersion": "2016-07-07",
|
||||
"description": "string",
|
||||
"metadataEndpoint": "string",
|
||||
"clientId": "string",
|
||||
"clientSecret": "string"
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.ApiManagement/service/openidConnectProviders" />
|
||||
### Microsoft.ApiManagement/service/openidConnectProviders object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.ApiManagement/service/openidConnectProviders |
|
||||
| apiVersion | enum | Yes | 2016-07-07 |
|
||||
| description | string | No | User-friendly description of OpenID Connect Provider. |
|
||||
| metadataEndpoint | string | Yes | Metadata endpoint URI. |
|
||||
| clientId | string | Yes | Client ID of developer console which is the client application. |
|
||||
| clientSecret | string | No | Client Secret of developer console which is the client application. |
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
# Microsoft.ApiManagement/service/products template reference
|
||||
API Version: 2016-07-07
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.ApiManagement/service/products resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.ApiManagement/service/products",
|
||||
"apiVersion": "2016-07-07",
|
||||
"ProductContract": {
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"terms": "string",
|
||||
"subscriptionRequired": boolean,
|
||||
"approvalRequired": boolean,
|
||||
"subscriptionsLimit": "integer",
|
||||
"state": "string"
|
||||
},
|
||||
"resources": []
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.ApiManagement/service/products" />
|
||||
### Microsoft.ApiManagement/service/products object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | Product identifier. Must be unique in the current API Management service instance. |
|
||||
| type | enum | Yes | Microsoft.ApiManagement/service/products |
|
||||
| apiVersion | enum | Yes | 2016-07-07 |
|
||||
| ProductContract | object | Yes | [ProductContract object](#ProductContract) |
|
||||
| resources | array | No | [groups](./products/groups.md) [apis](./products/apis.md) |
|
||||
|
||||
|
||||
<a id="ProductContract" />
|
||||
### ProductContract object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| id | string | No | Product identifier path. |
|
||||
| name | string | Yes | Product name. |
|
||||
| description | string | No | Product description. May be 1 to 500 characters long. |
|
||||
| terms | string | No | Product terms and conditions. Developer will have to accept these terms before he's allowed to call product API. |
|
||||
| subscriptionRequired | boolean | No | Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. |
|
||||
| approvalRequired | boolean | No | whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. |
|
||||
| subscriptionsLimit | integer | No | whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. |
|
||||
| state | enum | No | whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. - NotPublished or Published |
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
# Microsoft.ApiManagement/service/products/apis template reference
|
||||
API Version: 2016-07-07
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.ApiManagement/service/products/apis resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.ApiManagement/service/products/apis",
|
||||
"apiVersion": "2016-07-07"
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.ApiManagement/service/products/apis" />
|
||||
### Microsoft.ApiManagement/service/products/apis object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | API identifier. Must be unique in the current API Management service instance. |
|
||||
| type | enum | Yes | Microsoft.ApiManagement/service/products/apis |
|
||||
| apiVersion | enum | Yes | 2016-07-07 |
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
# Microsoft.ApiManagement/service/products/groups template reference
|
||||
API Version: 2016-07-07
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.ApiManagement/service/products/groups resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.ApiManagement/service/products/groups",
|
||||
"apiVersion": "2016-07-07"
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.ApiManagement/service/products/groups" />
|
||||
### Microsoft.ApiManagement/service/products/groups object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | Group identifier. Must be unique in the current API Management service instance. |
|
||||
| type | enum | Yes | Microsoft.ApiManagement/service/products/groups |
|
||||
| apiVersion | enum | Yes | 2016-07-07 |
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
# Microsoft.ApiManagement/service/properties template reference
|
||||
API Version: 2016-07-07
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.ApiManagement/service/properties resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.ApiManagement/service/properties",
|
||||
"apiVersion": "2016-07-07",
|
||||
"value": "string",
|
||||
"tags": [
|
||||
"string"
|
||||
],
|
||||
"secret": boolean
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.ApiManagement/service/properties" />
|
||||
### Microsoft.ApiManagement/service/properties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.ApiManagement/service/properties |
|
||||
| apiVersion | enum | Yes | 2016-07-07 |
|
||||
| value | string | Yes | The Value of the Property. |
|
||||
| tags | array | No | Collection of tags associated with a property. - string |
|
||||
| secret | boolean | No | The value which determines the value should be encrypted or not. Default value is false. |
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
# Microsoft.ApiManagement/service/subscriptions template reference
|
||||
API Version: 2016-07-07
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.ApiManagement/service/subscriptions resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.ApiManagement/service/subscriptions",
|
||||
"apiVersion": "2016-07-07",
|
||||
"userId": "string",
|
||||
"productId": "string",
|
||||
"primaryKey": "string",
|
||||
"secondaryKey": "string",
|
||||
"state": "string"
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.ApiManagement/service/subscriptions" />
|
||||
### Microsoft.ApiManagement/service/subscriptions object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.ApiManagement/service/subscriptions |
|
||||
| apiVersion | enum | Yes | 2016-07-07 |
|
||||
| userId | string | Yes | User (user id path) for whom subscription is being created in form /users/{uid} |
|
||||
| productId | string | Yes | Product (product id path) for which subscription is being created in form /products/{productid} |
|
||||
| primaryKey | string | No | Primary subscription key. If not specified during request key will be generated automatically. |
|
||||
| secondaryKey | string | No | Secondary subscription key. If not specified during request key will be generated automatically. |
|
||||
| state | enum | No | Initial subscription state. - Suspended, Active, Expired, Submitted, Rejected, Cancelled |
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
# Microsoft.ApiManagement/service/users template reference
|
||||
API Version: 2016-07-07
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.ApiManagement/service/users resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.ApiManagement/service/users",
|
||||
"apiVersion": "2016-07-07",
|
||||
"email": "string",
|
||||
"password": "string",
|
||||
"firstName": "string",
|
||||
"lastName": "string",
|
||||
"state": "string",
|
||||
"note": "string"
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.ApiManagement/service/users" />
|
||||
### Microsoft.ApiManagement/service/users object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | User identifier. Must be unique in the current API Management service instance. |
|
||||
| type | enum | Yes | Microsoft.ApiManagement/service/users |
|
||||
| apiVersion | enum | Yes | 2016-07-07 |
|
||||
| email | string | Yes | Email address. |
|
||||
| password | string | Yes | Password. |
|
||||
| firstName | string | Yes | First name. |
|
||||
| lastName | string | Yes | Last name. |
|
||||
| state | enum | No | Account state. - Active or Blocked |
|
||||
| note | string | No | Note about user. |
|
||||
|
|
@ -0,0 +1,260 @@
|
|||
{
|
||||
"id": "https://schema.management.azure.com/schemas/2015-12-01/Microsoft.Batch.json#",
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "Microsoft.Batch",
|
||||
"description": "Microsoft Batch Resource Types",
|
||||
"resourceDefinitions": {
|
||||
"batchAccounts": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Microsoft.Batch/batchAccounts"
|
||||
]
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"2015-12-01"
|
||||
]
|
||||
},
|
||||
"location": {
|
||||
"type": "string",
|
||||
"description": "The region in which the account is created."
|
||||
},
|
||||
"tags": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "The user specified tags associated with the account."
|
||||
},
|
||||
"properties": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/AccountBaseProperties"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "The properties of the account."
|
||||
},
|
||||
"resources": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/batchAccounts_applications_childResource"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"apiVersion",
|
||||
"properties"
|
||||
],
|
||||
"description": "Microsoft.Batch/batchAccounts"
|
||||
},
|
||||
"batchAccounts_applications": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Microsoft.Batch/batchAccounts/applications"
|
||||
]
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"2015-12-01"
|
||||
]
|
||||
},
|
||||
"allowUpdates": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "A value indicating whether packages within the application may be overwritten using the same version string."
|
||||
},
|
||||
"displayName": {
|
||||
"type": "string",
|
||||
"description": "The display name for the application."
|
||||
},
|
||||
"resources": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/batchAccounts_applications_versions_childResource"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"apiVersion"
|
||||
],
|
||||
"description": "Microsoft.Batch/batchAccounts/applications"
|
||||
},
|
||||
"batchAccounts_applications_versions": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Microsoft.Batch/batchAccounts/applications/versions"
|
||||
]
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"2015-12-01"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"apiVersion"
|
||||
],
|
||||
"description": "Microsoft.Batch/batchAccounts/applications/versions"
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"AccountBaseProperties": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"autoStorage": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/AutoStorageBaseProperties"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "The properties related to auto storage account."
|
||||
}
|
||||
},
|
||||
"description": "The properties of a Batch account."
|
||||
},
|
||||
"AutoStorageBaseProperties": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"storageAccountId": {
|
||||
"type": "string",
|
||||
"description": "The resource id of the storage account to be used for auto storage account."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"storageAccountId"
|
||||
],
|
||||
"description": "The properties related to auto storage account."
|
||||
},
|
||||
"batchAccounts_applications_childResource": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"applications"
|
||||
]
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"2015-12-01"
|
||||
]
|
||||
},
|
||||
"allowUpdates": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "A value indicating whether packages within the application may be overwritten using the same version string."
|
||||
},
|
||||
"displayName": {
|
||||
"type": "string",
|
||||
"description": "The display name for the application."
|
||||
},
|
||||
"resources": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/batchAccounts_applications_versions_childResource"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"apiVersion"
|
||||
],
|
||||
"description": "Microsoft.Batch/batchAccounts/applications"
|
||||
},
|
||||
"batchAccounts_applications_versions_childResource": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"versions"
|
||||
]
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"2015-12-01"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"apiVersion"
|
||||
],
|
||||
"description": "Microsoft.Batch/batchAccounts/applications/versions"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
# Microsoft.Batch/batchAccounts template reference
|
||||
API Version: 2015-12-01
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Batch/batchAccounts resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Batch/batchAccounts",
|
||||
"apiVersion": "2015-12-01",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"properties": {
|
||||
"autoStorage": {
|
||||
"storageAccountId": "string"
|
||||
}
|
||||
},
|
||||
"resources": []
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Batch/batchAccounts" />
|
||||
### Microsoft.Batch/batchAccounts object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Batch/batchAccounts |
|
||||
| apiVersion | enum | Yes | 2015-12-01 |
|
||||
| location | string | No | The region in which the account is created. |
|
||||
| tags | object | No | The user specified tags associated with the account. |
|
||||
| properties | object | Yes | The properties of the account. - [AccountBaseProperties object](#AccountBaseProperties) |
|
||||
| resources | array | No | [applications](./batchAccounts/applications.md) |
|
||||
|
||||
|
||||
<a id="AccountBaseProperties" />
|
||||
### AccountBaseProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| autoStorage | object | No | The properties related to auto storage account. - [AutoStorageBaseProperties object](#AutoStorageBaseProperties) |
|
||||
|
||||
|
||||
<a id="AutoStorageBaseProperties" />
|
||||
### AutoStorageBaseProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| storageAccountId | string | Yes | The resource id of the storage account to be used for auto storage account. |
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
# Microsoft.Batch/batchAccounts/applications template reference
|
||||
API Version: 2015-12-01
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Batch/batchAccounts/applications resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Batch/batchAccounts/applications",
|
||||
"apiVersion": "2015-12-01",
|
||||
"allowUpdates": boolean,
|
||||
"displayName": "string",
|
||||
"resources": []
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Batch/batchAccounts/applications" />
|
||||
### Microsoft.Batch/batchAccounts/applications object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Batch/batchAccounts/applications |
|
||||
| apiVersion | enum | Yes | 2015-12-01 |
|
||||
| allowUpdates | boolean | No | A value indicating whether packages within the application may be overwritten using the same version string. |
|
||||
| displayName | string | No | The display name for the application. |
|
||||
| resources | array | No | [versions](./applications/versions.md) |
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
# Microsoft.Batch/batchAccounts/applications/versions template reference
|
||||
API Version: 2015-12-01
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Batch/batchAccounts/applications/versions resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Batch/batchAccounts/applications/versions",
|
||||
"apiVersion": "2015-12-01"
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Batch/batchAccounts/applications/versions" />
|
||||
### Microsoft.Batch/batchAccounts/applications/versions object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Batch/batchAccounts/applications/versions |
|
||||
| apiVersion | enum | Yes | 2015-12-01 |
|
||||
|
|
@ -0,0 +1,600 @@
|
|||
{
|
||||
"id": "https://schema.management.azure.com/schemas/2015-06-01/Microsoft.Cdn.json#",
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "Microsoft.Cdn",
|
||||
"description": "Microsoft Cdn Resource Types",
|
||||
"resourceDefinitions": {
|
||||
"profiles": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Microsoft.Cdn/profiles"
|
||||
]
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"2015-06-01"
|
||||
]
|
||||
},
|
||||
"location": {
|
||||
"type": "string",
|
||||
"description": "Profile location"
|
||||
},
|
||||
"tags": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Profile tags"
|
||||
},
|
||||
"properties": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/ProfilePropertiesCreateParameters"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
]
|
||||
},
|
||||
"resources": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/profiles_endpoints_childResource"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"apiVersion",
|
||||
"location",
|
||||
"properties"
|
||||
],
|
||||
"description": "Microsoft.Cdn/profiles"
|
||||
},
|
||||
"profiles_endpoints": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Microsoft.Cdn/profiles/endpoints"
|
||||
]
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"2015-06-01"
|
||||
]
|
||||
},
|
||||
"location": {
|
||||
"type": "string",
|
||||
"description": "Endpoint location"
|
||||
},
|
||||
"tags": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Endpoint tags"
|
||||
},
|
||||
"properties": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/EndpointPropertiesCreateParameters"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
]
|
||||
},
|
||||
"resources": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/profiles_endpoints_customDomains_childResource"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/profiles_endpoints_origins_childResource"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"apiVersion",
|
||||
"location",
|
||||
"properties"
|
||||
],
|
||||
"description": "Microsoft.Cdn/profiles/endpoints"
|
||||
},
|
||||
"profiles_endpoints_customDomains": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Microsoft.Cdn/profiles/endpoints/customDomains"
|
||||
]
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"2015-06-01"
|
||||
]
|
||||
},
|
||||
"properties": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/CustomDomainPropertiesParameters"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"apiVersion",
|
||||
"properties"
|
||||
],
|
||||
"description": "Microsoft.Cdn/profiles/endpoints/customDomains"
|
||||
},
|
||||
"profiles_endpoints_origins": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Microsoft.Cdn/profiles/endpoints/origins"
|
||||
]
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"2015-06-01"
|
||||
]
|
||||
},
|
||||
"properties": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/OriginPropertiesParameters"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"apiVersion",
|
||||
"properties"
|
||||
],
|
||||
"description": "Microsoft.Cdn/profiles/endpoints/origins"
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"CustomDomainPropertiesParameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"hostName": {
|
||||
"type": "string",
|
||||
"description": "The host name of the custom domain. Must be a domain name."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"hostName"
|
||||
]
|
||||
},
|
||||
"DeepCreatedOrigin": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Origin name"
|
||||
},
|
||||
"properties": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/DeepCreatedOriginProperties"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name"
|
||||
],
|
||||
"description": "Deep created origins within a CDN endpoint."
|
||||
},
|
||||
"DeepCreatedOriginProperties": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"hostName": {
|
||||
"type": "string",
|
||||
"description": "The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported."
|
||||
},
|
||||
"httpPort": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "The value of the HTTP port. Must be between 1 and 65535"
|
||||
},
|
||||
"httpsPort": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "The value of the HTTPS port. Must be between 1 and 65535"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"hostName"
|
||||
],
|
||||
"description": "Properties of deep created origin on a CDN endpoint."
|
||||
},
|
||||
"EndpointPropertiesCreateParameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"originHostHeader": {
|
||||
"type": "string",
|
||||
"description": "The host header CDN provider will send along with content requests to origins. The default value is the host name of the origin."
|
||||
},
|
||||
"originPath": {
|
||||
"type": "string",
|
||||
"description": "The path used for origin requests."
|
||||
},
|
||||
"contentTypesToCompress": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "List of content types on which compression will be applied. The value for the elements should be a valid MIME type."
|
||||
},
|
||||
"isCompressionEnabled": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Indicates whether content compression is enabled. Default value is false. If compression is enabled, the content transferred from the CDN endpoint to the end user will be compressed. The requested content must be larger than 1 byte and smaller than 1 MB."
|
||||
},
|
||||
"isHttpAllowed": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed."
|
||||
},
|
||||
"isHttpsAllowed": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Indicates whether https traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed."
|
||||
},
|
||||
"queryStringCachingBehavior": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"IgnoreQueryString",
|
||||
"BypassCaching",
|
||||
"UseQueryString",
|
||||
"NotSet"
|
||||
]
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Defines the query string caching behavior."
|
||||
},
|
||||
"origins": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/DeepCreatedOrigin"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "The set of origins for the CDN endpoint. When multiple origins exist, the first origin will be used as primary and rest will be used as failover options."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"origins"
|
||||
]
|
||||
},
|
||||
"OriginPropertiesParameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"hostName": {
|
||||
"type": "string",
|
||||
"description": "The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported."
|
||||
},
|
||||
"httpPort": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "The value of the HTTP port. Must be between 1 and 65535."
|
||||
},
|
||||
"httpsPort": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "The value of the HTTPS port. Must be between 1 and 65535."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"hostName"
|
||||
]
|
||||
},
|
||||
"ProfilePropertiesCreateParameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"sku": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/Sku"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Profile SKU"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"sku"
|
||||
]
|
||||
},
|
||||
"profiles_endpoints_childResource": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"endpoints"
|
||||
]
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"2015-06-01"
|
||||
]
|
||||
},
|
||||
"location": {
|
||||
"type": "string",
|
||||
"description": "Endpoint location"
|
||||
},
|
||||
"tags": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Endpoint tags"
|
||||
},
|
||||
"properties": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/EndpointPropertiesCreateParameters"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
]
|
||||
},
|
||||
"resources": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/profiles_endpoints_customDomains_childResource"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/profiles_endpoints_origins_childResource"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"apiVersion",
|
||||
"location",
|
||||
"properties"
|
||||
],
|
||||
"description": "Microsoft.Cdn/profiles/endpoints"
|
||||
},
|
||||
"profiles_endpoints_customDomains_childResource": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"customDomains"
|
||||
]
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"2015-06-01"
|
||||
]
|
||||
},
|
||||
"properties": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/CustomDomainPropertiesParameters"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"apiVersion",
|
||||
"properties"
|
||||
],
|
||||
"description": "Microsoft.Cdn/profiles/endpoints/customDomains"
|
||||
},
|
||||
"profiles_endpoints_origins_childResource": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"origins"
|
||||
]
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"2015-06-01"
|
||||
]
|
||||
},
|
||||
"properties": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/OriginPropertiesParameters"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"apiVersion",
|
||||
"properties"
|
||||
],
|
||||
"description": "Microsoft.Cdn/profiles/endpoints/origins"
|
||||
},
|
||||
"Sku": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Standard",
|
||||
"Premium"
|
||||
]
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Name of the pricing tier."
|
||||
}
|
||||
},
|
||||
"description": "The SKU (pricing tier) of the CDN profile."
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
# Microsoft.Cdn/profiles template reference
|
||||
API Version: 2015-06-01
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Cdn/profiles resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Cdn/profiles",
|
||||
"apiVersion": "2015-06-01",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"properties": {
|
||||
"sku": {
|
||||
"name": "string"
|
||||
}
|
||||
},
|
||||
"resources": []
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Cdn/profiles" />
|
||||
### Microsoft.Cdn/profiles object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Cdn/profiles |
|
||||
| apiVersion | enum | Yes | 2015-06-01 |
|
||||
| location | string | Yes | Profile location |
|
||||
| tags | object | No | Profile tags |
|
||||
| properties | object | Yes | [ProfilePropertiesCreateParameters object](#ProfilePropertiesCreateParameters) |
|
||||
| resources | array | No | [endpoints](./profiles/endpoints.md) |
|
||||
|
||||
|
||||
<a id="ProfilePropertiesCreateParameters" />
|
||||
### ProfilePropertiesCreateParameters object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| sku | object | Yes | Profile SKU - [Sku object](#Sku) |
|
||||
|
||||
|
||||
<a id="Sku" />
|
||||
### Sku object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | enum | No | Name of the pricing tier. - Standard or Premium |
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
# Microsoft.Cdn/profiles/endpoints template reference
|
||||
API Version: 2015-06-01
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Cdn/profiles/endpoints resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Cdn/profiles/endpoints",
|
||||
"apiVersion": "2015-06-01",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"properties": {
|
||||
"originHostHeader": "string",
|
||||
"originPath": "string",
|
||||
"contentTypesToCompress": [
|
||||
"string"
|
||||
],
|
||||
"isCompressionEnabled": boolean,
|
||||
"isHttpAllowed": boolean,
|
||||
"isHttpsAllowed": boolean,
|
||||
"queryStringCachingBehavior": "string",
|
||||
"origins": [
|
||||
{
|
||||
"name": "string",
|
||||
"properties": {
|
||||
"hostName": "string",
|
||||
"httpPort": "integer",
|
||||
"httpsPort": "integer"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"resources": []
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Cdn/profiles/endpoints" />
|
||||
### Microsoft.Cdn/profiles/endpoints object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Cdn/profiles/endpoints |
|
||||
| apiVersion | enum | Yes | 2015-06-01 |
|
||||
| location | string | Yes | Endpoint location |
|
||||
| tags | object | No | Endpoint tags |
|
||||
| properties | object | Yes | [EndpointPropertiesCreateParameters object](#EndpointPropertiesCreateParameters) |
|
||||
| resources | array | No | [customDomains](./endpoints/customDomains.md) [origins](./endpoints/origins.md) |
|
||||
|
||||
|
||||
<a id="EndpointPropertiesCreateParameters" />
|
||||
### EndpointPropertiesCreateParameters object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| originHostHeader | string | No | The host header CDN provider will send along with content requests to origins. The default value is the host name of the origin. |
|
||||
| originPath | string | No | The path used for origin requests. |
|
||||
| contentTypesToCompress | array | No | List of content types on which compression will be applied. The value for the elements should be a valid MIME type. - string |
|
||||
| isCompressionEnabled | boolean | No | Indicates whether content compression is enabled. Default value is false. If compression is enabled, the content transferred from the CDN endpoint to the end user will be compressed. The requested content must be larger than 1 byte and smaller than 1 MB. |
|
||||
| isHttpAllowed | boolean | No | Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. |
|
||||
| isHttpsAllowed | boolean | No | Indicates whether https traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. |
|
||||
| queryStringCachingBehavior | enum | No | Defines the query string caching behavior. - IgnoreQueryString, BypassCaching, UseQueryString, NotSet |
|
||||
| origins | array | Yes | The set of origins for the CDN endpoint. When multiple origins exist, the first origin will be used as primary and rest will be used as failover options. - [DeepCreatedOrigin object](#DeepCreatedOrigin) |
|
||||
|
||||
|
||||
<a id="DeepCreatedOrigin" />
|
||||
### DeepCreatedOrigin object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | Origin name |
|
||||
| properties | object | No | [DeepCreatedOriginProperties object](#DeepCreatedOriginProperties) |
|
||||
|
||||
|
||||
<a id="DeepCreatedOriginProperties" />
|
||||
### DeepCreatedOriginProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| hostName | string | Yes | The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported. |
|
||||
| httpPort | integer | No | The value of the HTTP port. Must be between 1 and 65535 |
|
||||
| httpsPort | integer | No | The value of the HTTPS port. Must be between 1 and 65535 |
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
# Microsoft.Cdn/profiles/endpoints/customDomains template reference
|
||||
API Version: 2015-06-01
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Cdn/profiles/endpoints/customDomains resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Cdn/profiles/endpoints/customDomains",
|
||||
"apiVersion": "2015-06-01",
|
||||
"properties": {
|
||||
"hostName": "string"
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Cdn/profiles/endpoints/customDomains" />
|
||||
### Microsoft.Cdn/profiles/endpoints/customDomains object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Cdn/profiles/endpoints/customDomains |
|
||||
| apiVersion | enum | Yes | 2015-06-01 |
|
||||
| properties | object | Yes | [CustomDomainPropertiesParameters object](#CustomDomainPropertiesParameters) |
|
||||
|
||||
|
||||
<a id="CustomDomainPropertiesParameters" />
|
||||
### CustomDomainPropertiesParameters object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| hostName | string | Yes | The host name of the custom domain. Must be a domain name. |
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
# Microsoft.Cdn/profiles/endpoints/origins template reference
|
||||
API Version: 2015-06-01
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Cdn/profiles/endpoints/origins resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Cdn/profiles/endpoints/origins",
|
||||
"apiVersion": "2015-06-01",
|
||||
"properties": {
|
||||
"hostName": "string",
|
||||
"httpPort": "integer",
|
||||
"httpsPort": "integer"
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Cdn/profiles/endpoints/origins" />
|
||||
### Microsoft.Cdn/profiles/endpoints/origins object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Cdn/profiles/endpoints/origins |
|
||||
| apiVersion | enum | Yes | 2015-06-01 |
|
||||
| properties | object | Yes | [OriginPropertiesParameters object](#OriginPropertiesParameters) |
|
||||
|
||||
|
||||
<a id="OriginPropertiesParameters" />
|
||||
### OriginPropertiesParameters object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| hostName | string | Yes | The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported. |
|
||||
| httpPort | integer | No | The value of the HTTP port. Must be between 1 and 65535. |
|
||||
| httpsPort | integer | No | The value of the HTTPS port. Must be between 1 and 65535. |
|
||||
|
|
@ -0,0 +1,584 @@
|
|||
{
|
||||
"id": "https://schema.management.azure.com/schemas/2016-04-02/Microsoft.Cdn.json#",
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "Microsoft.Cdn",
|
||||
"description": "Microsoft Cdn Resource Types",
|
||||
"resourceDefinitions": {
|
||||
"profiles": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Microsoft.Cdn/profiles"
|
||||
]
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"2016-04-02"
|
||||
]
|
||||
},
|
||||
"location": {
|
||||
"type": "string",
|
||||
"description": "Profile location"
|
||||
},
|
||||
"tags": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Profile tags"
|
||||
},
|
||||
"sku": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/Sku"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "The SKU (pricing tier) of the CDN profile."
|
||||
},
|
||||
"resources": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/profiles_endpoints_childResource"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"apiVersion",
|
||||
"location",
|
||||
"sku"
|
||||
],
|
||||
"description": "Microsoft.Cdn/profiles"
|
||||
},
|
||||
"profiles_endpoints": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Microsoft.Cdn/profiles/endpoints"
|
||||
]
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"2016-04-02"
|
||||
]
|
||||
},
|
||||
"location": {
|
||||
"type": "string",
|
||||
"description": "Endpoint location"
|
||||
},
|
||||
"tags": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Endpoint tags"
|
||||
},
|
||||
"properties": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/EndpointPropertiesCreateParameters"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
]
|
||||
},
|
||||
"resources": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/profiles_endpoints_customDomains_childResource"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/profiles_endpoints_origins_childResource"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"apiVersion",
|
||||
"location",
|
||||
"properties"
|
||||
],
|
||||
"description": "Microsoft.Cdn/profiles/endpoints"
|
||||
},
|
||||
"profiles_endpoints_customDomains": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Microsoft.Cdn/profiles/endpoints/customDomains"
|
||||
]
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"2016-04-02"
|
||||
]
|
||||
},
|
||||
"properties": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/CustomDomainPropertiesParameters"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"apiVersion",
|
||||
"properties"
|
||||
],
|
||||
"description": "Microsoft.Cdn/profiles/endpoints/customDomains"
|
||||
},
|
||||
"profiles_endpoints_origins": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Microsoft.Cdn/profiles/endpoints/origins"
|
||||
]
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"2016-04-02"
|
||||
]
|
||||
},
|
||||
"properties": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/OriginPropertiesParameters"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"apiVersion",
|
||||
"properties"
|
||||
],
|
||||
"description": "Microsoft.Cdn/profiles/endpoints/origins"
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"CustomDomainPropertiesParameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"hostName": {
|
||||
"type": "string",
|
||||
"description": "The host name of the custom domain. Must be a domain name."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"hostName"
|
||||
]
|
||||
},
|
||||
"DeepCreatedOrigin": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Origin name"
|
||||
},
|
||||
"properties": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/DeepCreatedOriginProperties"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name"
|
||||
],
|
||||
"description": "Deep created origins within a CDN endpoint."
|
||||
},
|
||||
"DeepCreatedOriginProperties": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"hostName": {
|
||||
"type": "string",
|
||||
"description": "The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported."
|
||||
},
|
||||
"httpPort": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "The value of the HTTP port. Must be between 1 and 65535"
|
||||
},
|
||||
"httpsPort": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "The value of the HTTPS port. Must be between 1 and 65535"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"hostName"
|
||||
],
|
||||
"description": "Properties of deep created origin on a CDN endpoint."
|
||||
},
|
||||
"EndpointPropertiesCreateParameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"originHostHeader": {
|
||||
"type": "string",
|
||||
"description": "The host header CDN provider will send along with content requests to origins. The default value is the host name of the origin."
|
||||
},
|
||||
"originPath": {
|
||||
"type": "string",
|
||||
"description": "The path used for origin requests."
|
||||
},
|
||||
"contentTypesToCompress": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "List of content types on which compression will be applied. The value for the elements should be a valid MIME type."
|
||||
},
|
||||
"isCompressionEnabled": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Indicates whether content compression is enabled. Default value is false. If compression is enabled, the content transferred from the CDN endpoint to the end user will be compressed. The requested content must be larger than 1 byte and smaller than 1 MB."
|
||||
},
|
||||
"isHttpAllowed": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed."
|
||||
},
|
||||
"isHttpsAllowed": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Indicates whether https traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed."
|
||||
},
|
||||
"queryStringCachingBehavior": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"IgnoreQueryString",
|
||||
"BypassCaching",
|
||||
"UseQueryString",
|
||||
"NotSet"
|
||||
]
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Defines the query string caching behavior."
|
||||
},
|
||||
"origins": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/DeepCreatedOrigin"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "The set of origins for the CDN endpoint. When multiple origins exist, the first origin will be used as primary and rest will be used as failover options."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"origins"
|
||||
]
|
||||
},
|
||||
"OriginPropertiesParameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"hostName": {
|
||||
"type": "string",
|
||||
"description": "The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported."
|
||||
},
|
||||
"httpPort": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "The value of the HTTP port. Must be between 1 and 65535."
|
||||
},
|
||||
"httpsPort": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "The value of the HTTPS port. Must be between 1 and 65535."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"hostName"
|
||||
]
|
||||
},
|
||||
"profiles_endpoints_childResource": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"endpoints"
|
||||
]
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"2016-04-02"
|
||||
]
|
||||
},
|
||||
"location": {
|
||||
"type": "string",
|
||||
"description": "Endpoint location"
|
||||
},
|
||||
"tags": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Endpoint tags"
|
||||
},
|
||||
"properties": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/EndpointPropertiesCreateParameters"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
]
|
||||
},
|
||||
"resources": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/profiles_endpoints_customDomains_childResource"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/profiles_endpoints_origins_childResource"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"apiVersion",
|
||||
"location",
|
||||
"properties"
|
||||
],
|
||||
"description": "Microsoft.Cdn/profiles/endpoints"
|
||||
},
|
||||
"profiles_endpoints_customDomains_childResource": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"customDomains"
|
||||
]
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"2016-04-02"
|
||||
]
|
||||
},
|
||||
"properties": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/CustomDomainPropertiesParameters"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"apiVersion",
|
||||
"properties"
|
||||
],
|
||||
"description": "Microsoft.Cdn/profiles/endpoints/customDomains"
|
||||
},
|
||||
"profiles_endpoints_origins_childResource": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"origins"
|
||||
]
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"2016-04-02"
|
||||
]
|
||||
},
|
||||
"properties": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/OriginPropertiesParameters"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"apiVersion",
|
||||
"properties"
|
||||
],
|
||||
"description": "Microsoft.Cdn/profiles/endpoints/origins"
|
||||
},
|
||||
"Sku": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Standard_Verizon",
|
||||
"Premium_Verizon",
|
||||
"Custom_Verizon",
|
||||
"Standard_Akamai"
|
||||
]
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Name of the pricing tier."
|
||||
}
|
||||
},
|
||||
"description": "The SKU (pricing tier) of the CDN profile."
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
# Microsoft.Cdn/profiles template reference
|
||||
API Version: 2016-04-02
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Cdn/profiles resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Cdn/profiles",
|
||||
"apiVersion": "2016-04-02",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"sku": {
|
||||
"name": "string"
|
||||
},
|
||||
"resources": []
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Cdn/profiles" />
|
||||
### Microsoft.Cdn/profiles object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Cdn/profiles |
|
||||
| apiVersion | enum | Yes | 2016-04-02 |
|
||||
| location | string | Yes | Profile location |
|
||||
| tags | object | No | Profile tags |
|
||||
| sku | object | Yes | The SKU (pricing tier) of the CDN profile. - [Sku object](#Sku) |
|
||||
| resources | array | No | [endpoints](./profiles/endpoints.md) |
|
||||
|
||||
|
||||
<a id="Sku" />
|
||||
### Sku object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | enum | No | Name of the pricing tier. - Standard_Verizon, Premium_Verizon, Custom_Verizon, Standard_Akamai |
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
# Microsoft.Cdn/profiles/endpoints template reference
|
||||
API Version: 2016-04-02
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Cdn/profiles/endpoints resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Cdn/profiles/endpoints",
|
||||
"apiVersion": "2016-04-02",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"properties": {
|
||||
"originHostHeader": "string",
|
||||
"originPath": "string",
|
||||
"contentTypesToCompress": [
|
||||
"string"
|
||||
],
|
||||
"isCompressionEnabled": boolean,
|
||||
"isHttpAllowed": boolean,
|
||||
"isHttpsAllowed": boolean,
|
||||
"queryStringCachingBehavior": "string",
|
||||
"origins": [
|
||||
{
|
||||
"name": "string",
|
||||
"properties": {
|
||||
"hostName": "string",
|
||||
"httpPort": "integer",
|
||||
"httpsPort": "integer"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"resources": []
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Cdn/profiles/endpoints" />
|
||||
### Microsoft.Cdn/profiles/endpoints object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Cdn/profiles/endpoints |
|
||||
| apiVersion | enum | Yes | 2016-04-02 |
|
||||
| location | string | Yes | Endpoint location |
|
||||
| tags | object | No | Endpoint tags |
|
||||
| properties | object | Yes | [EndpointPropertiesCreateParameters object](#EndpointPropertiesCreateParameters) |
|
||||
| resources | array | No | [customDomains](./endpoints/customDomains.md) [origins](./endpoints/origins.md) |
|
||||
|
||||
|
||||
<a id="EndpointPropertiesCreateParameters" />
|
||||
### EndpointPropertiesCreateParameters object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| originHostHeader | string | No | The host header CDN provider will send along with content requests to origins. The default value is the host name of the origin. |
|
||||
| originPath | string | No | The path used for origin requests. |
|
||||
| contentTypesToCompress | array | No | List of content types on which compression will be applied. The value for the elements should be a valid MIME type. - string |
|
||||
| isCompressionEnabled | boolean | No | Indicates whether content compression is enabled. Default value is false. If compression is enabled, the content transferred from the CDN endpoint to the end user will be compressed. The requested content must be larger than 1 byte and smaller than 1 MB. |
|
||||
| isHttpAllowed | boolean | No | Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. |
|
||||
| isHttpsAllowed | boolean | No | Indicates whether https traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. |
|
||||
| queryStringCachingBehavior | enum | No | Defines the query string caching behavior. - IgnoreQueryString, BypassCaching, UseQueryString, NotSet |
|
||||
| origins | array | Yes | The set of origins for the CDN endpoint. When multiple origins exist, the first origin will be used as primary and rest will be used as failover options. - [DeepCreatedOrigin object](#DeepCreatedOrigin) |
|
||||
|
||||
|
||||
<a id="DeepCreatedOrigin" />
|
||||
### DeepCreatedOrigin object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | Origin name |
|
||||
| properties | object | No | [DeepCreatedOriginProperties object](#DeepCreatedOriginProperties) |
|
||||
|
||||
|
||||
<a id="DeepCreatedOriginProperties" />
|
||||
### DeepCreatedOriginProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| hostName | string | Yes | The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported. |
|
||||
| httpPort | integer | No | The value of the HTTP port. Must be between 1 and 65535 |
|
||||
| httpsPort | integer | No | The value of the HTTPS port. Must be between 1 and 65535 |
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
# Microsoft.Cdn/profiles/endpoints/customDomains template reference
|
||||
API Version: 2016-04-02
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Cdn/profiles/endpoints/customDomains resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Cdn/profiles/endpoints/customDomains",
|
||||
"apiVersion": "2016-04-02",
|
||||
"properties": {
|
||||
"hostName": "string"
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Cdn/profiles/endpoints/customDomains" />
|
||||
### Microsoft.Cdn/profiles/endpoints/customDomains object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Cdn/profiles/endpoints/customDomains |
|
||||
| apiVersion | enum | Yes | 2016-04-02 |
|
||||
| properties | object | Yes | [CustomDomainPropertiesParameters object](#CustomDomainPropertiesParameters) |
|
||||
|
||||
|
||||
<a id="CustomDomainPropertiesParameters" />
|
||||
### CustomDomainPropertiesParameters object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| hostName | string | Yes | The host name of the custom domain. Must be a domain name. |
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
# Microsoft.Cdn/profiles/endpoints/origins template reference
|
||||
API Version: 2016-04-02
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Cdn/profiles/endpoints/origins resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Cdn/profiles/endpoints/origins",
|
||||
"apiVersion": "2016-04-02",
|
||||
"properties": {
|
||||
"hostName": "string",
|
||||
"httpPort": "integer",
|
||||
"httpsPort": "integer"
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Cdn/profiles/endpoints/origins" />
|
||||
### Microsoft.Cdn/profiles/endpoints/origins object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Cdn/profiles/endpoints/origins |
|
||||
| apiVersion | enum | Yes | 2016-04-02 |
|
||||
| properties | object | Yes | [OriginPropertiesParameters object](#OriginPropertiesParameters) |
|
||||
|
||||
|
||||
<a id="OriginPropertiesParameters" />
|
||||
### OriginPropertiesParameters object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| hostName | string | Yes | The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported. |
|
||||
| httpPort | integer | No | The value of the HTTP port. Must be between 1 and 65535. |
|
||||
| httpsPort | integer | No | The value of the HTTPS port. Must be between 1 and 65535. |
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
{
|
||||
"id": "https://schema.management.azure.com/schemas/2016-02-01-preview/Microsoft.CognitiveServices.json#",
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "Microsoft.CognitiveServices",
|
||||
"description": "Microsoft CognitiveServices Resource Types",
|
||||
"resourceDefinitions": {
|
||||
"accounts": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Microsoft.CognitiveServices/accounts"
|
||||
]
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"2016-02-01-preview"
|
||||
]
|
||||
},
|
||||
"sku": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/Sku"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
]
|
||||
},
|
||||
"kind": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"ComputerVision",
|
||||
"Emotion",
|
||||
"Face",
|
||||
"LUIS",
|
||||
"Recommendations",
|
||||
"Speech",
|
||||
"TextAnalytics",
|
||||
"WebLM"
|
||||
]
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Required. Indicates the type of cognitive service account."
|
||||
},
|
||||
"location": {
|
||||
"type": "string",
|
||||
"description": "Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update the request will succeed."
|
||||
},
|
||||
"tags": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters."
|
||||
},
|
||||
"properties": {
|
||||
"description": "Must exist in the request. Must not be null."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"apiVersion",
|
||||
"sku",
|
||||
"kind",
|
||||
"location",
|
||||
"properties"
|
||||
],
|
||||
"description": "Microsoft.CognitiveServices/accounts"
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"Sku": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"F0",
|
||||
"S0",
|
||||
"S1",
|
||||
"S2",
|
||||
"S3",
|
||||
"S4"
|
||||
]
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Gets or sets the sku name. Required for account creation, optional for update."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name"
|
||||
],
|
||||
"description": "The SKU of the cognitive services account."
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
# Microsoft.CognitiveServices/accounts template reference
|
||||
API Version: 2016-02-01-preview
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.CognitiveServices/accounts resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.CognitiveServices/accounts",
|
||||
"apiVersion": "2016-02-01-preview",
|
||||
"sku": {
|
||||
"name": "string"
|
||||
},
|
||||
"kind": "string",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"properties": {}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.CognitiveServices/accounts" />
|
||||
### Microsoft.CognitiveServices/accounts object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.CognitiveServices/accounts |
|
||||
| apiVersion | enum | Yes | 2016-02-01-preview |
|
||||
| sku | object | Yes | [Sku object](#Sku) |
|
||||
| kind | enum | Yes | Required. Indicates the type of cognitive service account. - ComputerVision, Emotion, Face, LUIS, Recommendations, Speech, TextAnalytics, WebLM |
|
||||
| location | string | Yes | Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update the request will succeed. |
|
||||
| tags | object | No | Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. |
|
||||
| properties | object | Yes | Must exist in the request. Must not be null. |
|
||||
|
||||
|
||||
<a id="Sku" />
|
||||
### Sku object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | enum | Yes | Gets or sets the sku name. Required for account creation, optional for update. - F0, S0, S1, S2, S3, S4 |
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
{
|
||||
"id": "https://schema.management.azure.com/schemas/2016-05-01-preview/Microsoft.MachineLearning.json#",
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "Microsoft.MachineLearning",
|
||||
"description": "Microsoft MachineLearning Resource Types",
|
||||
"resourceDefinitions": {
|
||||
"commitmentPlans": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The Azure ML commitment plan name."
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Microsoft.MachineLearning/commitmentPlans"
|
||||
]
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"2016-05-01-preview"
|
||||
]
|
||||
},
|
||||
"location": {
|
||||
"type": "string",
|
||||
"description": "Resource location."
|
||||
},
|
||||
"tags": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "User-defined tags for the resource."
|
||||
},
|
||||
"etag": {
|
||||
"type": "string",
|
||||
"description": "An entity tag used to enforce optimistic concurrency."
|
||||
},
|
||||
"sku": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/ResourceSku"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "The commitment plan SKU."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"apiVersion",
|
||||
"location"
|
||||
],
|
||||
"description": "Microsoft.MachineLearning/commitmentPlans"
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"ResourceSku": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"capacity": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "The scale-out capacity of the resource. 1 is 1x, 2 is 2x, etc. This impacts the quantities and cost of any commitment plan resource."
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The SKU name. Along with tier, uniquely identifies the SKU."
|
||||
},
|
||||
"tier": {
|
||||
"type": "string",
|
||||
"description": "The SKU tier. Along with name, uniquely identifies the SKU."
|
||||
}
|
||||
},
|
||||
"description": "The SKU of a resource."
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
# Microsoft.MachineLearning/commitmentPlans template reference
|
||||
API Version: 2016-05-01-preview
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.MachineLearning/commitmentPlans resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.MachineLearning/commitmentPlans",
|
||||
"apiVersion": "2016-05-01-preview",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"etag": "string",
|
||||
"sku": {
|
||||
"capacity": "integer",
|
||||
"name": "string",
|
||||
"tier": "string"
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.MachineLearning/commitmentPlans" />
|
||||
### Microsoft.MachineLearning/commitmentPlans object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | The Azure ML commitment plan name. |
|
||||
| type | enum | Yes | Microsoft.MachineLearning/commitmentPlans |
|
||||
| apiVersion | enum | Yes | 2016-05-01-preview |
|
||||
| location | string | Yes | Resource location. |
|
||||
| tags | object | No | User-defined tags for the resource. |
|
||||
| etag | string | No | An entity tag used to enforce optimistic concurrency. |
|
||||
| sku | object | No | The commitment plan SKU. - [ResourceSku object](#ResourceSku) |
|
||||
|
||||
|
||||
<a id="ResourceSku" />
|
||||
### ResourceSku object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| capacity | integer | No | The scale-out capacity of the resource. 1 is 1x, 2 is 2x, etc. This impacts the quantities and cost of any commitment plan resource. |
|
||||
| name | string | No | The SKU name. Along with tier, uniquely identifies the SKU. |
|
||||
| tier | string | No | The SKU tier. Along with name, uniquely identifies the SKU. |
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,76 @@
|
|||
# Microsoft.Compute/availabilitySets template reference
|
||||
API Version: 2015-06-15
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Compute/availabilitySets resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Compute/availabilitySets",
|
||||
"apiVersion": "2015-06-15",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"properties": {
|
||||
"platformUpdateDomainCount": "integer",
|
||||
"platformFaultDomainCount": "integer",
|
||||
"virtualMachines": [
|
||||
{
|
||||
"id": "string"
|
||||
}
|
||||
],
|
||||
"statuses": [
|
||||
{
|
||||
"code": "string",
|
||||
"level": "string",
|
||||
"displayStatus": "string",
|
||||
"message": "string",
|
||||
"time": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Compute/availabilitySets" />
|
||||
### Microsoft.Compute/availabilitySets object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Compute/availabilitySets |
|
||||
| apiVersion | enum | Yes | 2015-06-15 |
|
||||
| location | string | Yes | Resource location |
|
||||
| tags | object | No | Resource tags |
|
||||
| properties | object | Yes | [AvailabilitySetProperties object](#AvailabilitySetProperties) |
|
||||
|
||||
|
||||
<a id="AvailabilitySetProperties" />
|
||||
### AvailabilitySetProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| platformUpdateDomainCount | integer | No | Gets or sets Update Domain count. |
|
||||
| platformFaultDomainCount | integer | No | Gets or sets Fault Domain count. |
|
||||
| virtualMachines | array | No | Gets or sets a list containing reference to all Virtual Machines created under this Availability Set. - [SubResource object](#SubResource) |
|
||||
| statuses | array | No | Gets or sets the resource status information. - [InstanceViewStatus object](#InstanceViewStatus) |
|
||||
|
||||
|
||||
<a id="SubResource" />
|
||||
### SubResource object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| id | string | No | Resource Id |
|
||||
|
||||
|
||||
<a id="InstanceViewStatus" />
|
||||
### InstanceViewStatus object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| code | string | No | Gets the status Code. |
|
||||
| level | enum | No | Gets or sets the level Code. - Info, Warning, Error |
|
||||
| displayStatus | string | No | Gets or sets the short localizable label for the status. |
|
||||
| message | string | No | Gets or sets the detailed Message, including for alerts and error messages. |
|
||||
| time | string | No | Gets or sets the time of the status. |
|
||||
|
|
@ -0,0 +1,409 @@
|
|||
# Microsoft.Compute/virtualMachineScaleSets template reference
|
||||
API Version: 2015-06-15
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Compute/virtualMachineScaleSets resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Compute/virtualMachineScaleSets",
|
||||
"apiVersion": "2015-06-15",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"sku": {
|
||||
"name": "string",
|
||||
"tier": "string",
|
||||
"capacity": "integer"
|
||||
},
|
||||
"properties": {
|
||||
"upgradePolicy": {
|
||||
"mode": "string"
|
||||
},
|
||||
"virtualMachineProfile": {
|
||||
"osProfile": {
|
||||
"computerNamePrefix": "string",
|
||||
"adminUsername": "string",
|
||||
"adminPassword": "string",
|
||||
"customData": "string",
|
||||
"windowsConfiguration": {
|
||||
"provisionVMAgent": boolean,
|
||||
"enableAutomaticUpdates": boolean,
|
||||
"timeZone": "string",
|
||||
"additionalUnattendContent": [
|
||||
{
|
||||
"passName": "oobeSystem",
|
||||
"componentName": "Microsoft-Windows-Shell-Setup",
|
||||
"settingName": "string",
|
||||
"content": "string"
|
||||
}
|
||||
],
|
||||
"winRM": {
|
||||
"listeners": [
|
||||
{
|
||||
"protocol": "string",
|
||||
"certificateUrl": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"linuxConfiguration": {
|
||||
"disablePasswordAuthentication": boolean,
|
||||
"ssh": {
|
||||
"publicKeys": [
|
||||
{
|
||||
"path": "string",
|
||||
"keyData": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"secrets": [
|
||||
{
|
||||
"sourceVault": {
|
||||
"id": "string"
|
||||
},
|
||||
"vaultCertificates": [
|
||||
{
|
||||
"certificateUrl": "string",
|
||||
"certificateStore": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"storageProfile": {
|
||||
"imageReference": {
|
||||
"publisher": "string",
|
||||
"offer": "string",
|
||||
"sku": "string",
|
||||
"version": "string"
|
||||
},
|
||||
"osDisk": {
|
||||
"name": "string",
|
||||
"caching": "string",
|
||||
"createOption": "string",
|
||||
"osType": "string",
|
||||
"image": {
|
||||
"uri": "string"
|
||||
},
|
||||
"vhdContainers": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
},
|
||||
"networkProfile": {
|
||||
"networkInterfaceConfigurations": [
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"properties": {
|
||||
"primary": boolean,
|
||||
"ipConfigurations": [
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"properties": {
|
||||
"subnet": {
|
||||
"id": "string"
|
||||
},
|
||||
"loadBalancerBackendAddressPools": [
|
||||
{
|
||||
"id": "string"
|
||||
}
|
||||
],
|
||||
"loadBalancerInboundNatPools": [
|
||||
{
|
||||
"id": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"extensionProfile": {
|
||||
"extensions": [
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"properties": {
|
||||
"publisher": "string",
|
||||
"type": "string",
|
||||
"typeHandlerVersion": "string",
|
||||
"autoUpgradeMinorVersion": boolean,
|
||||
"settings": {},
|
||||
"protectedSettings": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"provisioningState": "string",
|
||||
"overProvision": boolean
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Compute/virtualMachineScaleSets" />
|
||||
### Microsoft.Compute/virtualMachineScaleSets object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Compute/virtualMachineScaleSets |
|
||||
| apiVersion | enum | Yes | 2015-06-15 |
|
||||
| location | string | Yes | Resource location |
|
||||
| tags | object | No | Resource tags |
|
||||
| sku | object | No | Gets or sets the virtual machine scale set sku. - [Sku object](#Sku) |
|
||||
| properties | object | Yes | [VirtualMachineScaleSetProperties object](#VirtualMachineScaleSetProperties) |
|
||||
|
||||
|
||||
<a id="Sku" />
|
||||
### Sku object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | No | Gets or sets the sku name. |
|
||||
| tier | string | No | Gets or sets the sku tier. |
|
||||
| capacity | integer | No | Gets or sets the sku capacity. |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetProperties" />
|
||||
### VirtualMachineScaleSetProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| upgradePolicy | object | No | Gets or sets the upgrade policy. - [UpgradePolicy object](#UpgradePolicy) |
|
||||
| virtualMachineProfile | object | No | Gets or sets the virtual machine profile. - [VirtualMachineScaleSetVMProfile object](#VirtualMachineScaleSetVMProfile) |
|
||||
| provisioningState | string | No | Gets or sets the provisioning state, which only appears in the response. |
|
||||
| overProvision | boolean | No | Specifies whether the Virtual Machine Scale Set should be overprovisioned. |
|
||||
|
||||
|
||||
<a id="UpgradePolicy" />
|
||||
### UpgradePolicy object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| mode | enum | No | Gets or sets the upgrade mode. - Automatic or Manual |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetVMProfile" />
|
||||
### VirtualMachineScaleSetVMProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| osProfile | object | No | Gets or sets the virtual machine scale set OS profile. - [VirtualMachineScaleSetOSProfile object](#VirtualMachineScaleSetOSProfile) |
|
||||
| storageProfile | object | No | Gets or sets the virtual machine scale set storage profile. - [VirtualMachineScaleSetStorageProfile object](#VirtualMachineScaleSetStorageProfile) |
|
||||
| networkProfile | object | No | Gets or sets the virtual machine scale set network profile. - [VirtualMachineScaleSetNetworkProfile object](#VirtualMachineScaleSetNetworkProfile) |
|
||||
| extensionProfile | object | No | Gets the virtual machine scale set extension profile. - [VirtualMachineScaleSetExtensionProfile object](#VirtualMachineScaleSetExtensionProfile) |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetOSProfile" />
|
||||
### VirtualMachineScaleSetOSProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| computerNamePrefix | string | No | Gets or sets the computer name prefix. |
|
||||
| adminUsername | string | No | Gets or sets the admin user name. |
|
||||
| adminPassword | string | No | Gets or sets the admin user password. |
|
||||
| customData | string | No | Gets or sets a base-64 encoded string of custom data. |
|
||||
| windowsConfiguration | object | No | Gets or sets the Windows Configuration of the OS profile. - [WindowsConfiguration object](#WindowsConfiguration) |
|
||||
| linuxConfiguration | object | No | Gets or sets the Linux Configuration of the OS profile. - [LinuxConfiguration object](#LinuxConfiguration) |
|
||||
| secrets | array | No | Gets or sets the List of certificates for addition to the VM. - [VaultSecretGroup object](#VaultSecretGroup) |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetStorageProfile" />
|
||||
### VirtualMachineScaleSetStorageProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| imageReference | object | No | Gets or sets the image reference. - [ImageReference object](#ImageReference) |
|
||||
| osDisk | object | No | Gets or sets the OS disk. - [VirtualMachineScaleSetOSDisk object](#VirtualMachineScaleSetOSDisk) |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetNetworkProfile" />
|
||||
### VirtualMachineScaleSetNetworkProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| networkInterfaceConfigurations | array | No | Gets or sets the list of network configurations. - [VirtualMachineScaleSetNetworkConfiguration object](#VirtualMachineScaleSetNetworkConfiguration) |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetExtensionProfile" />
|
||||
### VirtualMachineScaleSetExtensionProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| extensions | array | No | Gets the virtual machine scale set child extension resources. - [VirtualMachineScaleSetExtension object](#VirtualMachineScaleSetExtension) |
|
||||
|
||||
|
||||
<a id="WindowsConfiguration" />
|
||||
### WindowsConfiguration object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| provisionVMAgent | boolean | No | Gets or sets whether VM Agent should be provisioned on the Virtual Machine. |
|
||||
| enableAutomaticUpdates | boolean | No | Gets or sets whether Windows updates are automatically installed on the VM |
|
||||
| timeZone | string | No | Gets or sets the Time Zone of the VM |
|
||||
| additionalUnattendContent | array | No | Gets or sets the additional base-64 encoded XML formatted information that can be included in the Unattend.xml file. - [AdditionalUnattendContent object](#AdditionalUnattendContent) |
|
||||
| winRM | object | No | Gets or sets the Windows Remote Management configuration of the VM - [WinRMConfiguration object](#WinRMConfiguration) |
|
||||
|
||||
|
||||
<a id="LinuxConfiguration" />
|
||||
### LinuxConfiguration object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| disablePasswordAuthentication | boolean | No | Gets or sets whether Authentication using user name and password is allowed or not |
|
||||
| ssh | object | No | Gets or sets the SSH configuration for linux VMs - [SshConfiguration object](#SshConfiguration) |
|
||||
|
||||
|
||||
<a id="VaultSecretGroup" />
|
||||
### VaultSecretGroup object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| sourceVault | object | No | Gets or sets the Relative URL of the Key Vault containing all of the certificates in VaultCertificates. - [SubResource object](#SubResource) |
|
||||
| vaultCertificates | array | No | Gets or sets the list of key vault references in SourceVault which contain certificates - [VaultCertificate object](#VaultCertificate) |
|
||||
|
||||
|
||||
<a id="ImageReference" />
|
||||
### ImageReference object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| publisher | string | No | Gets or sets the image publisher. |
|
||||
| offer | string | No | Gets or sets the image offer. |
|
||||
| sku | string | No | Gets or sets the image sku. |
|
||||
| version | string | No | Gets or sets the image version. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor and Build being decimal numbers. Specify 'latest' to use the latest version of image. |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetOSDisk" />
|
||||
### VirtualMachineScaleSetOSDisk object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | Gets or sets the disk name. |
|
||||
| caching | enum | No | Gets or sets the caching type. - None, ReadOnly, ReadWrite |
|
||||
| createOption | enum | Yes | Gets or sets the create option. - fromImage, empty, attach |
|
||||
| osType | enum | No | Gets or sets the Operating System type. - Windows or Linux |
|
||||
| image | object | No | Gets or sets the Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using it to attach to the Virtual Machine.If SourceImage is provided, the destination VirtualHardDisk should not exist. - [VirtualHardDisk object](#VirtualHardDisk) |
|
||||
| vhdContainers | array | No | Gets or sets the list of virtual hard disk container uris. - string |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetNetworkConfiguration" />
|
||||
### VirtualMachineScaleSetNetworkConfiguration object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| id | string | No | Resource Id |
|
||||
| name | string | Yes | Gets or sets the network configuration name. |
|
||||
| properties | object | No | [VirtualMachineScaleSetNetworkConfigurationProperties object](#VirtualMachineScaleSetNetworkConfigurationProperties) |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetExtension" />
|
||||
### VirtualMachineScaleSetExtension object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| id | string | No | Resource Id |
|
||||
| name | string | No | Gets or sets the name of the extension. |
|
||||
| properties | object | No | [VirtualMachineScaleSetExtensionProperties object](#VirtualMachineScaleSetExtensionProperties) |
|
||||
|
||||
|
||||
<a id="AdditionalUnattendContent" />
|
||||
### AdditionalUnattendContent object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| passName | enum | No | Gets or sets the pass name. Currently, the only allowable value is oobeSystem. - oobeSystem |
|
||||
| componentName | enum | No | Gets or sets the component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. - Microsoft-Windows-Shell-Setup |
|
||||
| settingName | enum | No | Gets or sets setting name (e.g. FirstLogonCommands, AutoLogon ). - AutoLogon or FirstLogonCommands |
|
||||
| content | string | No | Gets or sets XML formatted content that is added to the unattend.xml file in the specified pass and component.The XML must be less than 4 KB and must include the root element for the setting or feature that is being inserted. |
|
||||
|
||||
|
||||
<a id="WinRMConfiguration" />
|
||||
### WinRMConfiguration object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| listeners | array | No | Gets or sets the list of Windows Remote Management listeners - [WinRMListener object](#WinRMListener) |
|
||||
|
||||
|
||||
<a id="SshConfiguration" />
|
||||
### SshConfiguration object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| publicKeys | array | No | Gets or sets the list of SSH public keys used to authenticate with linux based VMs - [SshPublicKey object](#SshPublicKey) |
|
||||
|
||||
|
||||
<a id="SubResource" />
|
||||
### SubResource object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| id | string | No | Resource Id |
|
||||
|
||||
|
||||
<a id="VaultCertificate" />
|
||||
### VaultCertificate object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| certificateUrl | string | No | Gets or sets the URL referencing a secret in a Key Vault which contains a properly formatted certificate. |
|
||||
| certificateStore | string | No | Gets or sets the Certificate store in LocalMachine to add the certificate to on Windows, leave empty on Linux. |
|
||||
|
||||
|
||||
<a id="VirtualHardDisk" />
|
||||
### VirtualHardDisk object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| uri | string | No | Gets or sets the virtual hard disk's uri. It should be a valid Uri to a virtual hard disk. |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetNetworkConfigurationProperties" />
|
||||
### VirtualMachineScaleSetNetworkConfigurationProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| primary | boolean | No | Gets or sets whether this is a primary NIC on a virtual machine. |
|
||||
| ipConfigurations | array | Yes | Gets or sets the virtual machine scale set IP Configuration. - [VirtualMachineScaleSetIPConfiguration object](#VirtualMachineScaleSetIPConfiguration) |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetExtensionProperties" />
|
||||
### VirtualMachineScaleSetExtensionProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| publisher | string | No | Gets or sets the name of the extension handler publisher. |
|
||||
| type | string | No | Gets or sets the type of the extension handler. |
|
||||
| typeHandlerVersion | string | No | Gets or sets the type version of the extension handler. |
|
||||
| autoUpgradeMinorVersion | boolean | No | Gets or sets whether the extension handler should be automatically upgraded across minor versions. |
|
||||
| settings | object | No | Gets or sets Json formatted public settings for the extension. |
|
||||
| protectedSettings | object | No | Gets or sets Json formatted protected settings for the extension. |
|
||||
|
||||
|
||||
<a id="WinRMListener" />
|
||||
### WinRMListener object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| protocol | enum | No | Gets or sets the Protocol used by WinRM listener. Currently only Http and Https are supported. - Http or Https |
|
||||
| certificateUrl | string | No | Gets or sets the Certificate URL in KMS for Https listeners. Should be null for Http listeners. |
|
||||
|
||||
|
||||
<a id="SshPublicKey" />
|
||||
### SshPublicKey object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| path | string | No | Gets or sets the full path on the created VM where SSH public key is stored. If the file already exists, the specified key is appended to the file. |
|
||||
| keyData | string | No | Gets or sets Certificate public key used to authenticate with VM through SSH.The certificate must be in Pem format with or without headers. |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetIPConfiguration" />
|
||||
### VirtualMachineScaleSetIPConfiguration object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| id | string | No | Resource Id |
|
||||
| name | string | Yes | Gets or sets the IP configuration name. |
|
||||
| properties | object | No | [VirtualMachineScaleSetIPConfigurationProperties object](#VirtualMachineScaleSetIPConfigurationProperties) |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetIPConfigurationProperties" />
|
||||
### VirtualMachineScaleSetIPConfigurationProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| subnet | object | Yes | Gets or sets the subnet. - [ApiEntityReference object](#ApiEntityReference) |
|
||||
| loadBalancerBackendAddressPools | array | No | Gets or sets the load balancer backend address pools. - [SubResource object](#SubResource) |
|
||||
| loadBalancerInboundNatPools | array | No | Gets or sets the load balancer inbound nat pools. - [SubResource object](#SubResource) |
|
||||
|
||||
|
||||
<a id="ApiEntityReference" />
|
||||
### ApiEntityReference object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| id | string | No | Gets or sets ARM resource id in the form of /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... |
|
||||
|
|
@ -0,0 +1,408 @@
|
|||
# Microsoft.Compute/virtualMachines template reference
|
||||
API Version: 2015-06-15
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Compute/virtualMachines resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Compute/virtualMachines",
|
||||
"apiVersion": "2015-06-15",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"plan": {
|
||||
"name": "string",
|
||||
"publisher": "string",
|
||||
"product": "string",
|
||||
"promotionCode": "string"
|
||||
},
|
||||
"properties": {
|
||||
"hardwareProfile": {
|
||||
"vmSize": "string"
|
||||
},
|
||||
"storageProfile": {
|
||||
"imageReference": {
|
||||
"publisher": "string",
|
||||
"offer": "string",
|
||||
"sku": "string",
|
||||
"version": "string"
|
||||
},
|
||||
"osDisk": {
|
||||
"osType": "string",
|
||||
"encryptionSettings": {
|
||||
"diskEncryptionKey": {
|
||||
"secretUrl": "string",
|
||||
"sourceVault": {
|
||||
"id": "string"
|
||||
}
|
||||
},
|
||||
"keyEncryptionKey": {
|
||||
"keyUrl": "string",
|
||||
"sourceVault": {
|
||||
"id": "string"
|
||||
}
|
||||
},
|
||||
"enabled": boolean
|
||||
},
|
||||
"name": "string",
|
||||
"vhd": {
|
||||
"uri": "string"
|
||||
},
|
||||
"image": {
|
||||
"uri": "string"
|
||||
},
|
||||
"caching": "string",
|
||||
"createOption": "string",
|
||||
"diskSizeGB": "integer"
|
||||
},
|
||||
"dataDisks": [
|
||||
{
|
||||
"lun": "integer",
|
||||
"name": "string",
|
||||
"vhd": {
|
||||
"uri": "string"
|
||||
},
|
||||
"image": {
|
||||
"uri": "string"
|
||||
},
|
||||
"caching": "string",
|
||||
"createOption": "string",
|
||||
"diskSizeGB": "integer"
|
||||
}
|
||||
]
|
||||
},
|
||||
"osProfile": {
|
||||
"computerName": "string",
|
||||
"adminUsername": "string",
|
||||
"adminPassword": "string",
|
||||
"customData": "string",
|
||||
"windowsConfiguration": {
|
||||
"provisionVMAgent": boolean,
|
||||
"enableAutomaticUpdates": boolean,
|
||||
"timeZone": "string",
|
||||
"additionalUnattendContent": [
|
||||
{
|
||||
"passName": "oobeSystem",
|
||||
"componentName": "Microsoft-Windows-Shell-Setup",
|
||||
"settingName": "string",
|
||||
"content": "string"
|
||||
}
|
||||
],
|
||||
"winRM": {
|
||||
"listeners": [
|
||||
{
|
||||
"protocol": "string",
|
||||
"certificateUrl": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"linuxConfiguration": {
|
||||
"disablePasswordAuthentication": boolean,
|
||||
"ssh": {
|
||||
"publicKeys": [
|
||||
{
|
||||
"path": "string",
|
||||
"keyData": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"secrets": [
|
||||
{
|
||||
"sourceVault": {
|
||||
"id": "string"
|
||||
},
|
||||
"vaultCertificates": [
|
||||
{
|
||||
"certificateUrl": "string",
|
||||
"certificateStore": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"networkProfile": {
|
||||
"networkInterfaces": [
|
||||
{
|
||||
"id": "string",
|
||||
"properties": {
|
||||
"primary": boolean
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"diagnosticsProfile": {
|
||||
"bootDiagnostics": {
|
||||
"enabled": boolean,
|
||||
"storageUri": "string"
|
||||
}
|
||||
},
|
||||
"availabilitySet": {
|
||||
"id": "string"
|
||||
},
|
||||
"provisioningState": "string",
|
||||
"licenseType": "string"
|
||||
},
|
||||
"resources": []
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Compute/virtualMachines" />
|
||||
### Microsoft.Compute/virtualMachines object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Compute/virtualMachines |
|
||||
| apiVersion | enum | Yes | 2015-06-15 |
|
||||
| location | string | Yes | Resource location |
|
||||
| tags | object | No | Resource tags |
|
||||
| plan | object | No | Gets or sets the purchase plan when deploying virtual machine from VM Marketplace images. - [Plan object](#Plan) |
|
||||
| properties | object | Yes | [VirtualMachineProperties object](#VirtualMachineProperties) |
|
||||
| resources | array | No | [extensions](./virtualMachines/extensions.md) |
|
||||
|
||||
|
||||
<a id="Plan" />
|
||||
### Plan object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | No | Gets or sets the plan ID. |
|
||||
| publisher | string | No | Gets or sets the publisher ID. |
|
||||
| product | string | No | Gets or sets the offer ID. |
|
||||
| promotionCode | string | No | Gets or sets the promotion code. |
|
||||
|
||||
|
||||
<a id="VirtualMachineProperties" />
|
||||
### VirtualMachineProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| hardwareProfile | object | No | Gets or sets the hardware profile. - [HardwareProfile object](#HardwareProfile) |
|
||||
| storageProfile | object | No | Gets or sets the storage profile. - [StorageProfile object](#StorageProfile) |
|
||||
| osProfile | object | No | Gets or sets the OS profile. - [OSProfile object](#OSProfile) |
|
||||
| networkProfile | object | No | Gets or sets the network profile. - [NetworkProfile object](#NetworkProfile) |
|
||||
| diagnosticsProfile | object | No | Gets or sets the diagnostics profile. - [DiagnosticsProfile object](#DiagnosticsProfile) |
|
||||
| availabilitySet | object | No | Gets or sets the reference Id of the availability set to which this virtual machine belongs. - [SubResource object](#SubResource) |
|
||||
| provisioningState | string | No | Gets or sets the provisioning state, which only appears in the response. |
|
||||
| licenseType | string | No | Gets or sets the license type, which is for bring your own license scenario. |
|
||||
|
||||
|
||||
<a id="HardwareProfile" />
|
||||
### HardwareProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| vmSize | enum | No | The virtual machine size name. - Basic_A0, Basic_A1, Basic_A2, Basic_A3, Basic_A4, Standard_A0, Standard_A1, Standard_A2, Standard_A3, Standard_A4, Standard_A5, Standard_A6, Standard_A7, Standard_A8, Standard_A9, Standard_A10, Standard_A11, Standard_D1, Standard_D2, Standard_D3, Standard_D4, Standard_D11, Standard_D12, Standard_D13, Standard_D14, Standard_D1_v2, Standard_D2_v2, Standard_D3_v2, Standard_D4_v2, Standard_D5_v2, Standard_D11_v2, Standard_D12_v2, Standard_D13_v2, Standard_D14_v2, Standard_DS1, Standard_DS2, Standard_DS3, Standard_DS4, Standard_DS11, Standard_DS12, Standard_DS13, Standard_DS14, Standard_G1, Standard_G2, Standard_G3, Standard_G4, Standard_G5, Standard_GS1, Standard_GS2, Standard_GS3, Standard_GS4, Standard_GS5 |
|
||||
|
||||
|
||||
<a id="StorageProfile" />
|
||||
### StorageProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| imageReference | object | No | Gets or sets the image reference. - [ImageReference object](#ImageReference) |
|
||||
| osDisk | object | No | Gets or sets the OS disk. - [OSDisk object](#OSDisk) |
|
||||
| dataDisks | array | No | Gets or sets the data disks. - [DataDisk object](#DataDisk) |
|
||||
|
||||
|
||||
<a id="OSProfile" />
|
||||
### OSProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| computerName | string | No | Gets or sets the computer name. |
|
||||
| adminUsername | string | No | Gets or sets the admin user name. |
|
||||
| adminPassword | string | No | Gets or sets the admin user password. |
|
||||
| customData | string | No | Gets or sets a base-64 encoded string of custom data. |
|
||||
| windowsConfiguration | object | No | Gets or sets the Windows Configuration of the OS profile. - [WindowsConfiguration object](#WindowsConfiguration) |
|
||||
| linuxConfiguration | object | No | Gets or sets the Linux Configuration of the OS profile. - [LinuxConfiguration object](#LinuxConfiguration) |
|
||||
| secrets | array | No | Gets or sets the List of certificates for addition to the VM. - [VaultSecretGroup object](#VaultSecretGroup) |
|
||||
|
||||
|
||||
<a id="NetworkProfile" />
|
||||
### NetworkProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| networkInterfaces | array | No | Gets or sets the network interfaces. - [NetworkInterfaceReference object](#NetworkInterfaceReference) |
|
||||
|
||||
|
||||
<a id="DiagnosticsProfile" />
|
||||
### DiagnosticsProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| bootDiagnostics | object | No | Gets or sets the boot diagnostics. - [BootDiagnostics object](#BootDiagnostics) |
|
||||
|
||||
|
||||
<a id="SubResource" />
|
||||
### SubResource object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| id | string | No | Resource Id |
|
||||
|
||||
|
||||
<a id="ImageReference" />
|
||||
### ImageReference object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| publisher | string | No | Gets or sets the image publisher. |
|
||||
| offer | string | No | Gets or sets the image offer. |
|
||||
| sku | string | No | Gets or sets the image sku. |
|
||||
| version | string | No | Gets or sets the image version. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor and Build being decimal numbers. Specify 'latest' to use the latest version of image. |
|
||||
|
||||
|
||||
<a id="OSDisk" />
|
||||
### OSDisk object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| osType | enum | No | Gets or sets the Operating System type. - Windows or Linux |
|
||||
| encryptionSettings | object | No | Gets or sets the disk encryption settings. - [DiskEncryptionSettings object](#DiskEncryptionSettings) |
|
||||
| name | string | Yes | Gets or sets the disk name. |
|
||||
| vhd | object | Yes | Gets or sets the Virtual Hard Disk. - [VirtualHardDisk object](#VirtualHardDisk) |
|
||||
| image | object | No | Gets or sets the Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using it to attach to the Virtual Machine.If SourceImage is provided, the destination VirtualHardDisk should not exist. - [VirtualHardDisk object](#VirtualHardDisk) |
|
||||
| caching | enum | No | Gets or sets the caching type. - None, ReadOnly, ReadWrite |
|
||||
| createOption | enum | Yes | Gets or sets the create option. - fromImage, empty, attach |
|
||||
| diskSizeGB | integer | No | Gets or sets the initial disk size in GB for blank data disks, and the new desired size for existing OS and Data disks. |
|
||||
|
||||
|
||||
<a id="DataDisk" />
|
||||
### DataDisk object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| lun | integer | Yes | Gets or sets the logical unit number. |
|
||||
| name | string | Yes | Gets or sets the disk name. |
|
||||
| vhd | object | Yes | Gets or sets the Virtual Hard Disk. - [VirtualHardDisk object](#VirtualHardDisk) |
|
||||
| image | object | No | Gets or sets the Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using it to attach to the Virtual Machine.If SourceImage is provided, the destination VirtualHardDisk should not exist. - [VirtualHardDisk object](#VirtualHardDisk) |
|
||||
| caching | enum | No | Gets or sets the caching type. - None, ReadOnly, ReadWrite |
|
||||
| createOption | enum | Yes | Gets or sets the create option. - fromImage, empty, attach |
|
||||
| diskSizeGB | integer | No | Gets or sets the initial disk size in GB for blank data disks, and the new desired size for existing OS and Data disks. |
|
||||
|
||||
|
||||
<a id="WindowsConfiguration" />
|
||||
### WindowsConfiguration object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| provisionVMAgent | boolean | No | Gets or sets whether VM Agent should be provisioned on the Virtual Machine. |
|
||||
| enableAutomaticUpdates | boolean | No | Gets or sets whether Windows updates are automatically installed on the VM |
|
||||
| timeZone | string | No | Gets or sets the Time Zone of the VM |
|
||||
| additionalUnattendContent | array | No | Gets or sets the additional base-64 encoded XML formatted information that can be included in the Unattend.xml file. - [AdditionalUnattendContent object](#AdditionalUnattendContent) |
|
||||
| winRM | object | No | Gets or sets the Windows Remote Management configuration of the VM - [WinRMConfiguration object](#WinRMConfiguration) |
|
||||
|
||||
|
||||
<a id="LinuxConfiguration" />
|
||||
### LinuxConfiguration object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| disablePasswordAuthentication | boolean | No | Gets or sets whether Authentication using user name and password is allowed or not |
|
||||
| ssh | object | No | Gets or sets the SSH configuration for linux VMs - [SshConfiguration object](#SshConfiguration) |
|
||||
|
||||
|
||||
<a id="VaultSecretGroup" />
|
||||
### VaultSecretGroup object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| sourceVault | object | No | Gets or sets the Relative URL of the Key Vault containing all of the certificates in VaultCertificates. - [SubResource object](#SubResource) |
|
||||
| vaultCertificates | array | No | Gets or sets the list of key vault references in SourceVault which contain certificates - [VaultCertificate object](#VaultCertificate) |
|
||||
|
||||
|
||||
<a id="NetworkInterfaceReference" />
|
||||
### NetworkInterfaceReference object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| id | string | No | Resource Id |
|
||||
| properties | object | No | [NetworkInterfaceReferenceProperties object](#NetworkInterfaceReferenceProperties) |
|
||||
|
||||
|
||||
<a id="BootDiagnostics" />
|
||||
### BootDiagnostics object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| enabled | boolean | No | Gets or sets whether boot diagnostics should be enabled on the Virtual Machine. |
|
||||
| storageUri | string | No | Gets or sets the boot diagnostics storage Uri. It should be a valid Uri |
|
||||
|
||||
|
||||
<a id="DiskEncryptionSettings" />
|
||||
### DiskEncryptionSettings object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| diskEncryptionKey | object | Yes | Gets or sets the disk encryption key which is a KeyVault Secret. - [KeyVaultSecretReference object](#KeyVaultSecretReference) |
|
||||
| keyEncryptionKey | object | No | Gets or sets the key encryption key which is KeyVault Key. - [KeyVaultKeyReference object](#KeyVaultKeyReference) |
|
||||
| enabled | boolean | No | Gets or sets whether disk encryption should be enabled on the Virtual Machine. |
|
||||
|
||||
|
||||
<a id="VirtualHardDisk" />
|
||||
### VirtualHardDisk object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| uri | string | No | Gets or sets the virtual hard disk's uri. It should be a valid Uri to a virtual hard disk. |
|
||||
|
||||
|
||||
<a id="AdditionalUnattendContent" />
|
||||
### AdditionalUnattendContent object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| passName | enum | No | Gets or sets the pass name. Currently, the only allowable value is oobeSystem. - oobeSystem |
|
||||
| componentName | enum | No | Gets or sets the component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. - Microsoft-Windows-Shell-Setup |
|
||||
| settingName | enum | No | Gets or sets setting name (e.g. FirstLogonCommands, AutoLogon ). - AutoLogon or FirstLogonCommands |
|
||||
| content | string | No | Gets or sets XML formatted content that is added to the unattend.xml file in the specified pass and component.The XML must be less than 4 KB and must include the root element for the setting or feature that is being inserted. |
|
||||
|
||||
|
||||
<a id="WinRMConfiguration" />
|
||||
### WinRMConfiguration object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| listeners | array | No | Gets or sets the list of Windows Remote Management listeners - [WinRMListener object](#WinRMListener) |
|
||||
|
||||
|
||||
<a id="SshConfiguration" />
|
||||
### SshConfiguration object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| publicKeys | array | No | Gets or sets the list of SSH public keys used to authenticate with linux based VMs - [SshPublicKey object](#SshPublicKey) |
|
||||
|
||||
|
||||
<a id="VaultCertificate" />
|
||||
### VaultCertificate object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| certificateUrl | string | No | Gets or sets the URL referencing a secret in a Key Vault which contains a properly formatted certificate. |
|
||||
| certificateStore | string | No | Gets or sets the Certificate store in LocalMachine to add the certificate to on Windows, leave empty on Linux. |
|
||||
|
||||
|
||||
<a id="NetworkInterfaceReferenceProperties" />
|
||||
### NetworkInterfaceReferenceProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| primary | boolean | No | Gets or sets whether this is a primary NIC on a virtual machine |
|
||||
|
||||
|
||||
<a id="KeyVaultSecretReference" />
|
||||
### KeyVaultSecretReference object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| secretUrl | string | Yes | Gets or sets the URL referencing a secret in a Key Vault. |
|
||||
| sourceVault | object | Yes | Gets or sets the Relative URL of the Key Vault containing the secret. - [SubResource object](#SubResource) |
|
||||
|
||||
|
||||
<a id="KeyVaultKeyReference" />
|
||||
### KeyVaultKeyReference object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| keyUrl | string | Yes | Gets or sets the URL referencing a key in a Key Vault. |
|
||||
| sourceVault | object | Yes | Gets or sets the Relative URL of the Key Vault containing the key - [SubResource object](#SubResource) |
|
||||
|
||||
|
||||
<a id="WinRMListener" />
|
||||
### WinRMListener object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| protocol | enum | No | Gets or sets the Protocol used by WinRM listener. Currently only Http and Https are supported. - Http or Https |
|
||||
| certificateUrl | string | No | Gets or sets the Certificate URL in KMS for Https listeners. Should be null for Http listeners. |
|
||||
|
||||
|
||||
<a id="SshPublicKey" />
|
||||
### SshPublicKey object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| path | string | No | Gets or sets the full path on the created VM where SSH public key is stored. If the file already exists, the specified key is appended to the file. |
|
||||
| keyData | string | No | Gets or sets Certificate public key used to authenticate with VM through SSH.The certificate must be in Pem format with or without headers. |
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
# Microsoft.Compute/virtualMachines/extensions template reference
|
||||
API Version: 2015-06-15
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Compute/virtualMachines/extensions resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Compute/virtualMachines/extensions",
|
||||
"apiVersion": "2015-06-15",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"properties": {
|
||||
"forceUpdateTag": "RerunExtension",
|
||||
"publisher": "string",
|
||||
"type": "string",
|
||||
"typeHandlerVersion": "string",
|
||||
"autoUpgradeMinorVersion": boolean,
|
||||
"settings": {},
|
||||
"protectedSettings": {},
|
||||
"provisioningState": "string",
|
||||
"instanceView": {
|
||||
"name": "string",
|
||||
"type": "string",
|
||||
"typeHandlerVersion": "string",
|
||||
"substatuses": [
|
||||
{
|
||||
"code": "string",
|
||||
"level": "string",
|
||||
"displayStatus": "string",
|
||||
"message": "string",
|
||||
"time": "string"
|
||||
}
|
||||
],
|
||||
"statuses": [
|
||||
{
|
||||
"code": "string",
|
||||
"level": "string",
|
||||
"displayStatus": "string",
|
||||
"message": "string",
|
||||
"time": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Compute/virtualMachines/extensions" />
|
||||
### Microsoft.Compute/virtualMachines/extensions object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Compute/virtualMachines/extensions |
|
||||
| apiVersion | enum | Yes | 2015-06-15 |
|
||||
| location | string | Yes | Resource location |
|
||||
| tags | object | No | Resource tags |
|
||||
| properties | object | Yes | [VirtualMachineExtensionProperties object](#VirtualMachineExtensionProperties) |
|
||||
|
||||
|
||||
<a id="VirtualMachineExtensionProperties" />
|
||||
### VirtualMachineExtensionProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| forceUpdateTag | enum | No | Gets or sets how the extension handler should be forced to update even if the extension configuration has not changed. - RerunExtension |
|
||||
| publisher | string | No | Gets or sets the name of the extension handler publisher. |
|
||||
| type | string | No | Gets or sets the type of the extension handler. |
|
||||
| typeHandlerVersion | string | No | Gets or sets the type version of the extension handler. |
|
||||
| autoUpgradeMinorVersion | boolean | No | Gets or sets whether the extension handler should be automatically upgraded across minor versions. |
|
||||
| settings | object | No | Gets or sets Json formatted public settings for the extension. |
|
||||
| protectedSettings | object | No | Gets or sets Json formatted protected settings for the extension. |
|
||||
| provisioningState | string | No | Gets or sets the provisioning state, which only appears in the response. |
|
||||
| instanceView | object | No | Gets or sets the virtual machine extension instance view. - [VirtualMachineExtensionInstanceView object](#VirtualMachineExtensionInstanceView) |
|
||||
|
||||
|
||||
<a id="VirtualMachineExtensionInstanceView" />
|
||||
### VirtualMachineExtensionInstanceView object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | No | Gets or sets the virtual machine extension name. |
|
||||
| type | string | No | Gets or sets the full type of the extension handler which includes both publisher and type. |
|
||||
| typeHandlerVersion | string | No | Gets or sets the type version of the extension handler. |
|
||||
| substatuses | array | No | Gets or sets the resource status information. - [InstanceViewStatus object](#InstanceViewStatus) |
|
||||
| statuses | array | No | Gets or sets the resource status information. - [InstanceViewStatus object](#InstanceViewStatus) |
|
||||
|
||||
|
||||
<a id="InstanceViewStatus" />
|
||||
### InstanceViewStatus object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| code | string | No | Gets the status Code. |
|
||||
| level | enum | No | Gets or sets the level Code. - Info, Warning, Error |
|
||||
| displayStatus | string | No | Gets or sets the short localizable label for the status. |
|
||||
| message | string | No | Gets or sets the detailed Message, including for alerts and error messages. |
|
||||
| time | string | No | Gets or sets the time of the status. |
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,76 @@
|
|||
# Microsoft.Compute/availabilitySets template reference
|
||||
API Version: 2016-03-30
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Compute/availabilitySets resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Compute/availabilitySets",
|
||||
"apiVersion": "2016-03-30",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"properties": {
|
||||
"platformUpdateDomainCount": "integer",
|
||||
"platformFaultDomainCount": "integer",
|
||||
"virtualMachines": [
|
||||
{
|
||||
"id": "string"
|
||||
}
|
||||
],
|
||||
"statuses": [
|
||||
{
|
||||
"code": "string",
|
||||
"level": "string",
|
||||
"displayStatus": "string",
|
||||
"message": "string",
|
||||
"time": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Compute/availabilitySets" />
|
||||
### Microsoft.Compute/availabilitySets object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Compute/availabilitySets |
|
||||
| apiVersion | enum | Yes | 2016-03-30 |
|
||||
| location | string | Yes | Resource location |
|
||||
| tags | object | No | Resource tags |
|
||||
| properties | object | Yes | [AvailabilitySetProperties object](#AvailabilitySetProperties) |
|
||||
|
||||
|
||||
<a id="AvailabilitySetProperties" />
|
||||
### AvailabilitySetProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| platformUpdateDomainCount | integer | No | Update Domain count. |
|
||||
| platformFaultDomainCount | integer | No | Fault Domain count. |
|
||||
| virtualMachines | array | No | a list containing reference to all Virtual Machines created under this Availability Set. - [SubResource object](#SubResource) |
|
||||
| statuses | array | No | the resource status information. - [InstanceViewStatus object](#InstanceViewStatus) |
|
||||
|
||||
|
||||
<a id="SubResource" />
|
||||
### SubResource object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| id | string | No | Resource Id |
|
||||
|
||||
|
||||
<a id="InstanceViewStatus" />
|
||||
### InstanceViewStatus object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| code | string | No | the status Code. |
|
||||
| level | enum | No | the level Code. - Info, Warning, Error |
|
||||
| displayStatus | string | No | the short localizable label for the status. |
|
||||
| message | string | No | the detailed Message, including for alerts and error messages. |
|
||||
| time | string | No | the time of the status. |
|
||||
|
|
@ -0,0 +1,413 @@
|
|||
# Microsoft.Compute/virtualMachineScaleSets template reference
|
||||
API Version: 2016-03-30
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Compute/virtualMachineScaleSets resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Compute/virtualMachineScaleSets",
|
||||
"apiVersion": "2016-03-30",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"sku": {
|
||||
"name": "string",
|
||||
"tier": "string",
|
||||
"capacity": "integer"
|
||||
},
|
||||
"properties": {
|
||||
"upgradePolicy": {
|
||||
"mode": "string"
|
||||
},
|
||||
"virtualMachineProfile": {
|
||||
"osProfile": {
|
||||
"computerNamePrefix": "string",
|
||||
"adminUsername": "string",
|
||||
"adminPassword": "string",
|
||||
"customData": "string",
|
||||
"windowsConfiguration": {
|
||||
"provisionVMAgent": boolean,
|
||||
"enableAutomaticUpdates": boolean,
|
||||
"timeZone": "string",
|
||||
"additionalUnattendContent": [
|
||||
{
|
||||
"passName": "oobeSystem",
|
||||
"componentName": "Microsoft-Windows-Shell-Setup",
|
||||
"settingName": "string",
|
||||
"content": "string"
|
||||
}
|
||||
],
|
||||
"winRM": {
|
||||
"listeners": [
|
||||
{
|
||||
"protocol": "string",
|
||||
"certificateUrl": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"linuxConfiguration": {
|
||||
"disablePasswordAuthentication": boolean,
|
||||
"ssh": {
|
||||
"publicKeys": [
|
||||
{
|
||||
"path": "string",
|
||||
"keyData": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"secrets": [
|
||||
{
|
||||
"sourceVault": {
|
||||
"id": "string"
|
||||
},
|
||||
"vaultCertificates": [
|
||||
{
|
||||
"certificateUrl": "string",
|
||||
"certificateStore": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"storageProfile": {
|
||||
"imageReference": {
|
||||
"publisher": "string",
|
||||
"offer": "string",
|
||||
"sku": "string",
|
||||
"version": "string"
|
||||
},
|
||||
"osDisk": {
|
||||
"name": "string",
|
||||
"caching": "string",
|
||||
"createOption": "string",
|
||||
"osType": "string",
|
||||
"image": {
|
||||
"uri": "string"
|
||||
},
|
||||
"vhdContainers": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
},
|
||||
"networkProfile": {
|
||||
"networkInterfaceConfigurations": [
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"properties": {
|
||||
"primary": boolean,
|
||||
"ipConfigurations": [
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"properties": {
|
||||
"subnet": {
|
||||
"id": "string"
|
||||
},
|
||||
"applicationGatewayBackendAddressPools": [
|
||||
{
|
||||
"id": "string"
|
||||
}
|
||||
],
|
||||
"loadBalancerBackendAddressPools": [
|
||||
{
|
||||
"id": "string"
|
||||
}
|
||||
],
|
||||
"loadBalancerInboundNatPools": [
|
||||
{
|
||||
"id": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"extensionProfile": {
|
||||
"extensions": [
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"properties": {
|
||||
"publisher": "string",
|
||||
"type": "string",
|
||||
"typeHandlerVersion": "string",
|
||||
"autoUpgradeMinorVersion": boolean,
|
||||
"settings": {},
|
||||
"protectedSettings": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overProvision": boolean
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Compute/virtualMachineScaleSets" />
|
||||
### Microsoft.Compute/virtualMachineScaleSets object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Compute/virtualMachineScaleSets |
|
||||
| apiVersion | enum | Yes | 2016-03-30 |
|
||||
| location | string | Yes | Resource location |
|
||||
| tags | object | No | Resource tags |
|
||||
| sku | object | No | the virtual machine scale set sku. - [Sku object](#Sku) |
|
||||
| properties | object | Yes | [VirtualMachineScaleSetProperties object](#VirtualMachineScaleSetProperties) |
|
||||
|
||||
|
||||
<a id="Sku" />
|
||||
### Sku object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | No | the sku name. |
|
||||
| tier | string | No | the sku tier. |
|
||||
| capacity | integer | No | the sku capacity. |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetProperties" />
|
||||
### VirtualMachineScaleSetProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| upgradePolicy | object | No | the upgrade policy. - [UpgradePolicy object](#UpgradePolicy) |
|
||||
| virtualMachineProfile | object | No | the virtual machine profile. - [VirtualMachineScaleSetVMProfile object](#VirtualMachineScaleSetVMProfile) |
|
||||
| overProvision | boolean | No | Specifies whether the Virtual Machine Scale Set should be overprovisioned. |
|
||||
|
||||
|
||||
<a id="UpgradePolicy" />
|
||||
### UpgradePolicy object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| mode | enum | No | the upgrade mode. - Automatic or Manual |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetVMProfile" />
|
||||
### VirtualMachineScaleSetVMProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| osProfile | object | No | the virtual machine scale set OS profile. - [VirtualMachineScaleSetOSProfile object](#VirtualMachineScaleSetOSProfile) |
|
||||
| storageProfile | object | No | the virtual machine scale set storage profile. - [VirtualMachineScaleSetStorageProfile object](#VirtualMachineScaleSetStorageProfile) |
|
||||
| networkProfile | object | No | the virtual machine scale set network profile. - [VirtualMachineScaleSetNetworkProfile object](#VirtualMachineScaleSetNetworkProfile) |
|
||||
| extensionProfile | object | No | the virtual machine scale set extension profile. - [VirtualMachineScaleSetExtensionProfile object](#VirtualMachineScaleSetExtensionProfile) |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetOSProfile" />
|
||||
### VirtualMachineScaleSetOSProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| computerNamePrefix | string | No | the computer name prefix. |
|
||||
| adminUsername | string | No | the admin user name. |
|
||||
| adminPassword | string | No | the admin user password. |
|
||||
| customData | string | No | a base-64 encoded string of custom data. |
|
||||
| windowsConfiguration | object | No | the Windows Configuration of the OS profile. - [WindowsConfiguration object](#WindowsConfiguration) |
|
||||
| linuxConfiguration | object | No | the Linux Configuration of the OS profile. - [LinuxConfiguration object](#LinuxConfiguration) |
|
||||
| secrets | array | No | the List of certificates for addition to the VM. - [VaultSecretGroup object](#VaultSecretGroup) |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetStorageProfile" />
|
||||
### VirtualMachineScaleSetStorageProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| imageReference | object | No | the image reference. - [ImageReference object](#ImageReference) |
|
||||
| osDisk | object | No | the OS disk. - [VirtualMachineScaleSetOSDisk object](#VirtualMachineScaleSetOSDisk) |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetNetworkProfile" />
|
||||
### VirtualMachineScaleSetNetworkProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| networkInterfaceConfigurations | array | No | the list of network configurations. - [VirtualMachineScaleSetNetworkConfiguration object](#VirtualMachineScaleSetNetworkConfiguration) |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetExtensionProfile" />
|
||||
### VirtualMachineScaleSetExtensionProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| extensions | array | No | the virtual machine scale set child extension resources. - [VirtualMachineScaleSetExtension object](#VirtualMachineScaleSetExtension) |
|
||||
|
||||
|
||||
<a id="WindowsConfiguration" />
|
||||
### WindowsConfiguration object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| provisionVMAgent | boolean | No | whether VM Agent should be provisioned on the Virtual Machine. |
|
||||
| enableAutomaticUpdates | boolean | No | whether Windows updates are automatically installed on the VM |
|
||||
| timeZone | string | No | the Time Zone of the VM |
|
||||
| additionalUnattendContent | array | No | the additional base-64 encoded XML formatted information that can be included in the Unattend.xml file. - [AdditionalUnattendContent object](#AdditionalUnattendContent) |
|
||||
| winRM | object | No | the Windows Remote Management configuration of the VM - [WinRMConfiguration object](#WinRMConfiguration) |
|
||||
|
||||
|
||||
<a id="LinuxConfiguration" />
|
||||
### LinuxConfiguration object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| disablePasswordAuthentication | boolean | No | whether Authentication using user name and password is allowed or not |
|
||||
| ssh | object | No | the SSH configuration for linux VMs - [SshConfiguration object](#SshConfiguration) |
|
||||
|
||||
|
||||
<a id="VaultSecretGroup" />
|
||||
### VaultSecretGroup object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| sourceVault | object | No | the Relative URL of the Key Vault containing all of the certificates in VaultCertificates. - [SubResource object](#SubResource) |
|
||||
| vaultCertificates | array | No | the list of key vault references in SourceVault which contain certificates - [VaultCertificate object](#VaultCertificate) |
|
||||
|
||||
|
||||
<a id="ImageReference" />
|
||||
### ImageReference object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| publisher | string | No | the image publisher. |
|
||||
| offer | string | No | the image offer. |
|
||||
| sku | string | No | the image sku. |
|
||||
| version | string | No | the image version. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor and Build being decimal numbers. Specify 'latest' to use the latest version of image. |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetOSDisk" />
|
||||
### VirtualMachineScaleSetOSDisk object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | the disk name. |
|
||||
| caching | enum | No | the caching type. - None, ReadOnly, ReadWrite |
|
||||
| createOption | enum | Yes | the create option. - fromImage, empty, attach |
|
||||
| osType | enum | No | the Operating System type. - Windows or Linux |
|
||||
| image | object | No | the Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using it to attach to the Virtual Machine.If SourceImage is provided, the destination VirtualHardDisk should not exist. - [VirtualHardDisk object](#VirtualHardDisk) |
|
||||
| vhdContainers | array | No | the list of virtual hard disk container uris. - string |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetNetworkConfiguration" />
|
||||
### VirtualMachineScaleSetNetworkConfiguration object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| id | string | No | Resource Id |
|
||||
| name | string | Yes | the network configuration name. |
|
||||
| properties | object | No | [VirtualMachineScaleSetNetworkConfigurationProperties object](#VirtualMachineScaleSetNetworkConfigurationProperties) |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetExtension" />
|
||||
### VirtualMachineScaleSetExtension object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| id | string | No | Resource Id |
|
||||
| name | string | No | the name of the extension. |
|
||||
| properties | object | No | [VirtualMachineScaleSetExtensionProperties object](#VirtualMachineScaleSetExtensionProperties) |
|
||||
|
||||
|
||||
<a id="AdditionalUnattendContent" />
|
||||
### AdditionalUnattendContent object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| passName | enum | No | the pass name. Currently, the only allowable value is oobeSystem. - oobeSystem |
|
||||
| componentName | enum | No | the component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. - Microsoft-Windows-Shell-Setup |
|
||||
| settingName | enum | No | setting name (e.g. FirstLogonCommands, AutoLogon ). - AutoLogon or FirstLogonCommands |
|
||||
| content | string | No | XML formatted content that is added to the unattend.xml file in the specified pass and component.The XML must be less than 4 KB and must include the root element for the setting or feature that is being inserted. |
|
||||
|
||||
|
||||
<a id="WinRMConfiguration" />
|
||||
### WinRMConfiguration object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| listeners | array | No | the list of Windows Remote Management listeners - [WinRMListener object](#WinRMListener) |
|
||||
|
||||
|
||||
<a id="SshConfiguration" />
|
||||
### SshConfiguration object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| publicKeys | array | No | the list of SSH public keys used to authenticate with linux based VMs - [SshPublicKey object](#SshPublicKey) |
|
||||
|
||||
|
||||
<a id="SubResource" />
|
||||
### SubResource object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| id | string | No | Resource Id |
|
||||
|
||||
|
||||
<a id="VaultCertificate" />
|
||||
### VaultCertificate object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| certificateUrl | string | No | the URL referencing a secret in a Key Vault which contains a properly formatted certificate. |
|
||||
| certificateStore | string | No | the Certificate store in LocalMachine to add the certificate to on Windows, leave empty on Linux. |
|
||||
|
||||
|
||||
<a id="VirtualHardDisk" />
|
||||
### VirtualHardDisk object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| uri | string | No | the virtual hard disk's uri. It should be a valid Uri to a virtual hard disk. |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetNetworkConfigurationProperties" />
|
||||
### VirtualMachineScaleSetNetworkConfigurationProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| primary | boolean | No | whether this is a primary NIC on a virtual machine. |
|
||||
| ipConfigurations | array | Yes | the virtual machine scale set IP Configuration. - [VirtualMachineScaleSetIPConfiguration object](#VirtualMachineScaleSetIPConfiguration) |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetExtensionProperties" />
|
||||
### VirtualMachineScaleSetExtensionProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| publisher | string | No | the name of the extension handler publisher. |
|
||||
| type | string | No | the type of the extension handler. |
|
||||
| typeHandlerVersion | string | No | the type version of the extension handler. |
|
||||
| autoUpgradeMinorVersion | boolean | No | whether the extension handler should be automatically upgraded across minor versions. |
|
||||
| settings | object | No | Json formatted public settings for the extension. |
|
||||
| protectedSettings | object | No | Json formatted protected settings for the extension. |
|
||||
|
||||
|
||||
<a id="WinRMListener" />
|
||||
### WinRMListener object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| protocol | enum | No | the Protocol used by WinRM listener. Currently only Http and Https are supported. - Http or Https |
|
||||
| certificateUrl | string | No | the Certificate URL in KMS for Https listeners. Should be null for Http listeners. |
|
||||
|
||||
|
||||
<a id="SshPublicKey" />
|
||||
### SshPublicKey object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| path | string | No | the full path on the created VM where SSH public key is stored. If the file already exists, the specified key is appended to the file. |
|
||||
| keyData | string | No | Certificate public key used to authenticate with VM through SSH.The certificate must be in Pem format with or without headers. |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetIPConfiguration" />
|
||||
### VirtualMachineScaleSetIPConfiguration object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| id | string | No | Resource Id |
|
||||
| name | string | Yes | the IP configuration name. |
|
||||
| properties | object | No | [VirtualMachineScaleSetIPConfigurationProperties object](#VirtualMachineScaleSetIPConfigurationProperties) |
|
||||
|
||||
|
||||
<a id="VirtualMachineScaleSetIPConfigurationProperties" />
|
||||
### VirtualMachineScaleSetIPConfigurationProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| subnet | object | Yes | the subnet. - [ApiEntityReference object](#ApiEntityReference) |
|
||||
| applicationGatewayBackendAddressPools | array | No | the application gateway backend address pools. - [SubResource object](#SubResource) |
|
||||
| loadBalancerBackendAddressPools | array | No | the load balancer backend address pools. - [SubResource object](#SubResource) |
|
||||
| loadBalancerInboundNatPools | array | No | the load balancer inbound nat pools. - [SubResource object](#SubResource) |
|
||||
|
||||
|
||||
<a id="ApiEntityReference" />
|
||||
### ApiEntityReference object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| id | string | No | the ARM resource id in the form of /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... |
|
||||
|
|
@ -0,0 +1,406 @@
|
|||
# Microsoft.Compute/virtualMachines template reference
|
||||
API Version: 2016-03-30
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Compute/virtualMachines resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Compute/virtualMachines",
|
||||
"apiVersion": "2016-03-30",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"plan": {
|
||||
"name": "string",
|
||||
"publisher": "string",
|
||||
"product": "string",
|
||||
"promotionCode": "string"
|
||||
},
|
||||
"properties": {
|
||||
"hardwareProfile": {
|
||||
"vmSize": "string"
|
||||
},
|
||||
"storageProfile": {
|
||||
"imageReference": {
|
||||
"publisher": "string",
|
||||
"offer": "string",
|
||||
"sku": "string",
|
||||
"version": "string"
|
||||
},
|
||||
"osDisk": {
|
||||
"osType": "string",
|
||||
"encryptionSettings": {
|
||||
"diskEncryptionKey": {
|
||||
"secretUrl": "string",
|
||||
"sourceVault": {
|
||||
"id": "string"
|
||||
}
|
||||
},
|
||||
"keyEncryptionKey": {
|
||||
"keyUrl": "string",
|
||||
"sourceVault": {
|
||||
"id": "string"
|
||||
}
|
||||
},
|
||||
"enabled": boolean
|
||||
},
|
||||
"name": "string",
|
||||
"vhd": {
|
||||
"uri": "string"
|
||||
},
|
||||
"image": {
|
||||
"uri": "string"
|
||||
},
|
||||
"caching": "string",
|
||||
"createOption": "string",
|
||||
"diskSizeGB": "integer"
|
||||
},
|
||||
"dataDisks": [
|
||||
{
|
||||
"lun": "integer",
|
||||
"name": "string",
|
||||
"vhd": {
|
||||
"uri": "string"
|
||||
},
|
||||
"image": {
|
||||
"uri": "string"
|
||||
},
|
||||
"caching": "string",
|
||||
"createOption": "string",
|
||||
"diskSizeGB": "integer"
|
||||
}
|
||||
]
|
||||
},
|
||||
"osProfile": {
|
||||
"computerName": "string",
|
||||
"adminUsername": "string",
|
||||
"adminPassword": "string",
|
||||
"customData": "string",
|
||||
"windowsConfiguration": {
|
||||
"provisionVMAgent": boolean,
|
||||
"enableAutomaticUpdates": boolean,
|
||||
"timeZone": "string",
|
||||
"additionalUnattendContent": [
|
||||
{
|
||||
"passName": "oobeSystem",
|
||||
"componentName": "Microsoft-Windows-Shell-Setup",
|
||||
"settingName": "string",
|
||||
"content": "string"
|
||||
}
|
||||
],
|
||||
"winRM": {
|
||||
"listeners": [
|
||||
{
|
||||
"protocol": "string",
|
||||
"certificateUrl": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"linuxConfiguration": {
|
||||
"disablePasswordAuthentication": boolean,
|
||||
"ssh": {
|
||||
"publicKeys": [
|
||||
{
|
||||
"path": "string",
|
||||
"keyData": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"secrets": [
|
||||
{
|
||||
"sourceVault": {
|
||||
"id": "string"
|
||||
},
|
||||
"vaultCertificates": [
|
||||
{
|
||||
"certificateUrl": "string",
|
||||
"certificateStore": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"networkProfile": {
|
||||
"networkInterfaces": [
|
||||
{
|
||||
"id": "string",
|
||||
"properties": {
|
||||
"primary": boolean
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"diagnosticsProfile": {
|
||||
"bootDiagnostics": {
|
||||
"enabled": boolean,
|
||||
"storageUri": "string"
|
||||
}
|
||||
},
|
||||
"availabilitySet": {
|
||||
"id": "string"
|
||||
},
|
||||
"licenseType": "string"
|
||||
},
|
||||
"resources": []
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Compute/virtualMachines" />
|
||||
### Microsoft.Compute/virtualMachines object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Compute/virtualMachines |
|
||||
| apiVersion | enum | Yes | 2016-03-30 |
|
||||
| location | string | Yes | Resource location |
|
||||
| tags | object | No | Resource tags |
|
||||
| plan | object | No | the purchase plan when deploying virtual machine from VM Marketplace images. - [Plan object](#Plan) |
|
||||
| properties | object | Yes | [VirtualMachineProperties object](#VirtualMachineProperties) |
|
||||
| resources | array | No | [extensions](./virtualMachines/extensions.md) |
|
||||
|
||||
|
||||
<a id="Plan" />
|
||||
### Plan object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | No | the plan ID. |
|
||||
| publisher | string | No | the publisher ID. |
|
||||
| product | string | No | the offer ID. |
|
||||
| promotionCode | string | No | the promotion code. |
|
||||
|
||||
|
||||
<a id="VirtualMachineProperties" />
|
||||
### VirtualMachineProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| hardwareProfile | object | No | the hardware profile. - [HardwareProfile object](#HardwareProfile) |
|
||||
| storageProfile | object | No | the storage profile. - [StorageProfile object](#StorageProfile) |
|
||||
| osProfile | object | No | the OS profile. - [OSProfile object](#OSProfile) |
|
||||
| networkProfile | object | No | the network profile. - [NetworkProfile object](#NetworkProfile) |
|
||||
| diagnosticsProfile | object | No | the diagnostics profile. - [DiagnosticsProfile object](#DiagnosticsProfile) |
|
||||
| availabilitySet | object | No | the reference Id of the availability set to which this virtual machine belongs. - [SubResource object](#SubResource) |
|
||||
| licenseType | string | No | the license type, which is for bring your own license scenario. |
|
||||
|
||||
|
||||
<a id="HardwareProfile" />
|
||||
### HardwareProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| vmSize | enum | No | The virtual machine size name. - Basic_A0, Basic_A1, Basic_A2, Basic_A3, Basic_A4, Standard_A0, Standard_A1, Standard_A2, Standard_A3, Standard_A4, Standard_A5, Standard_A6, Standard_A7, Standard_A8, Standard_A9, Standard_A10, Standard_A11, Standard_D1, Standard_D2, Standard_D3, Standard_D4, Standard_D11, Standard_D12, Standard_D13, Standard_D14, Standard_D1_v2, Standard_D2_v2, Standard_D3_v2, Standard_D4_v2, Standard_D5_v2, Standard_D11_v2, Standard_D12_v2, Standard_D13_v2, Standard_D14_v2, Standard_D15_v2, Standard_DS1, Standard_DS2, Standard_DS3, Standard_DS4, Standard_DS11, Standard_DS12, Standard_DS13, Standard_DS14, Standard_DS1_v2, Standard_DS2_v2, Standard_DS3_v2, Standard_DS4_v2, Standard_DS5_v2, Standard_DS11_v2, Standard_DS12_v2, Standard_DS13_v2, Standard_DS14_v2, Standard_DS15_v2, Standard_G1, Standard_G2, Standard_G3, Standard_G4, Standard_G5, Standard_GS1, Standard_GS2, Standard_GS3, Standard_GS4, Standard_GS5 |
|
||||
|
||||
|
||||
<a id="StorageProfile" />
|
||||
### StorageProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| imageReference | object | No | the image reference. - [ImageReference object](#ImageReference) |
|
||||
| osDisk | object | No | the OS disk. - [OSDisk object](#OSDisk) |
|
||||
| dataDisks | array | No | the data disks. - [DataDisk object](#DataDisk) |
|
||||
|
||||
|
||||
<a id="OSProfile" />
|
||||
### OSProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| computerName | string | No | the computer name. |
|
||||
| adminUsername | string | No | the admin user name. |
|
||||
| adminPassword | string | No | the admin user password. |
|
||||
| customData | string | No | a base-64 encoded string of custom data. |
|
||||
| windowsConfiguration | object | No | the Windows Configuration of the OS profile. - [WindowsConfiguration object](#WindowsConfiguration) |
|
||||
| linuxConfiguration | object | No | the Linux Configuration of the OS profile. - [LinuxConfiguration object](#LinuxConfiguration) |
|
||||
| secrets | array | No | the List of certificates for addition to the VM. - [VaultSecretGroup object](#VaultSecretGroup) |
|
||||
|
||||
|
||||
<a id="NetworkProfile" />
|
||||
### NetworkProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| networkInterfaces | array | No | the network interfaces. - [NetworkInterfaceReference object](#NetworkInterfaceReference) |
|
||||
|
||||
|
||||
<a id="DiagnosticsProfile" />
|
||||
### DiagnosticsProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| bootDiagnostics | object | No | the boot diagnostics. - [BootDiagnostics object](#BootDiagnostics) |
|
||||
|
||||
|
||||
<a id="SubResource" />
|
||||
### SubResource object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| id | string | No | Resource Id |
|
||||
|
||||
|
||||
<a id="ImageReference" />
|
||||
### ImageReference object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| publisher | string | No | the image publisher. |
|
||||
| offer | string | No | the image offer. |
|
||||
| sku | string | No | the image sku. |
|
||||
| version | string | No | the image version. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor and Build being decimal numbers. Specify 'latest' to use the latest version of image. |
|
||||
|
||||
|
||||
<a id="OSDisk" />
|
||||
### OSDisk object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| osType | enum | No | the Operating System type. - Windows or Linux |
|
||||
| encryptionSettings | object | No | the disk encryption settings. - [DiskEncryptionSettings object](#DiskEncryptionSettings) |
|
||||
| name | string | Yes | the disk name. |
|
||||
| vhd | object | Yes | the Virtual Hard Disk. - [VirtualHardDisk object](#VirtualHardDisk) |
|
||||
| image | object | No | the Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using it to attach to the Virtual Machine.If SourceImage is provided, the destination VirtualHardDisk should not exist. - [VirtualHardDisk object](#VirtualHardDisk) |
|
||||
| caching | enum | No | the caching type. - None, ReadOnly, ReadWrite |
|
||||
| createOption | enum | Yes | the create option. - fromImage, empty, attach |
|
||||
| diskSizeGB | integer | No | the initial disk size in GB for blank data disks, and the new desired size for existing OS and Data disks. |
|
||||
|
||||
|
||||
<a id="DataDisk" />
|
||||
### DataDisk object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| lun | integer | Yes | the logical unit number. |
|
||||
| name | string | Yes | the disk name. |
|
||||
| vhd | object | Yes | the Virtual Hard Disk. - [VirtualHardDisk object](#VirtualHardDisk) |
|
||||
| image | object | No | the Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using it to attach to the Virtual Machine.If SourceImage is provided, the destination VirtualHardDisk should not exist. - [VirtualHardDisk object](#VirtualHardDisk) |
|
||||
| caching | enum | No | the caching type. - None, ReadOnly, ReadWrite |
|
||||
| createOption | enum | Yes | the create option. - fromImage, empty, attach |
|
||||
| diskSizeGB | integer | No | the initial disk size in GB for blank data disks, and the new desired size for existing OS and Data disks. |
|
||||
|
||||
|
||||
<a id="WindowsConfiguration" />
|
||||
### WindowsConfiguration object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| provisionVMAgent | boolean | No | whether VM Agent should be provisioned on the Virtual Machine. |
|
||||
| enableAutomaticUpdates | boolean | No | whether Windows updates are automatically installed on the VM |
|
||||
| timeZone | string | No | the Time Zone of the VM |
|
||||
| additionalUnattendContent | array | No | the additional base-64 encoded XML formatted information that can be included in the Unattend.xml file. - [AdditionalUnattendContent object](#AdditionalUnattendContent) |
|
||||
| winRM | object | No | the Windows Remote Management configuration of the VM - [WinRMConfiguration object](#WinRMConfiguration) |
|
||||
|
||||
|
||||
<a id="LinuxConfiguration" />
|
||||
### LinuxConfiguration object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| disablePasswordAuthentication | boolean | No | whether Authentication using user name and password is allowed or not |
|
||||
| ssh | object | No | the SSH configuration for linux VMs - [SshConfiguration object](#SshConfiguration) |
|
||||
|
||||
|
||||
<a id="VaultSecretGroup" />
|
||||
### VaultSecretGroup object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| sourceVault | object | No | the Relative URL of the Key Vault containing all of the certificates in VaultCertificates. - [SubResource object](#SubResource) |
|
||||
| vaultCertificates | array | No | the list of key vault references in SourceVault which contain certificates - [VaultCertificate object](#VaultCertificate) |
|
||||
|
||||
|
||||
<a id="NetworkInterfaceReference" />
|
||||
### NetworkInterfaceReference object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| id | string | No | Resource Id |
|
||||
| properties | object | No | [NetworkInterfaceReferenceProperties object](#NetworkInterfaceReferenceProperties) |
|
||||
|
||||
|
||||
<a id="BootDiagnostics" />
|
||||
### BootDiagnostics object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| enabled | boolean | No | whether boot diagnostics should be enabled on the Virtual Machine. |
|
||||
| storageUri | string | No | the boot diagnostics storage Uri. It should be a valid Uri |
|
||||
|
||||
|
||||
<a id="DiskEncryptionSettings" />
|
||||
### DiskEncryptionSettings object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| diskEncryptionKey | object | No | the disk encryption key which is a KeyVault Secret. - [KeyVaultSecretReference object](#KeyVaultSecretReference) |
|
||||
| keyEncryptionKey | object | No | the key encryption key which is KeyVault Key. - [KeyVaultKeyReference object](#KeyVaultKeyReference) |
|
||||
| enabled | boolean | No | whether disk encryption should be enabled on the Virtual Machine. |
|
||||
|
||||
|
||||
<a id="VirtualHardDisk" />
|
||||
### VirtualHardDisk object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| uri | string | No | the virtual hard disk's uri. It should be a valid Uri to a virtual hard disk. |
|
||||
|
||||
|
||||
<a id="AdditionalUnattendContent" />
|
||||
### AdditionalUnattendContent object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| passName | enum | No | the pass name. Currently, the only allowable value is oobeSystem. - oobeSystem |
|
||||
| componentName | enum | No | the component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. - Microsoft-Windows-Shell-Setup |
|
||||
| settingName | enum | No | setting name (e.g. FirstLogonCommands, AutoLogon ). - AutoLogon or FirstLogonCommands |
|
||||
| content | string | No | XML formatted content that is added to the unattend.xml file in the specified pass and component.The XML must be less than 4 KB and must include the root element for the setting or feature that is being inserted. |
|
||||
|
||||
|
||||
<a id="WinRMConfiguration" />
|
||||
### WinRMConfiguration object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| listeners | array | No | the list of Windows Remote Management listeners - [WinRMListener object](#WinRMListener) |
|
||||
|
||||
|
||||
<a id="SshConfiguration" />
|
||||
### SshConfiguration object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| publicKeys | array | No | the list of SSH public keys used to authenticate with linux based VMs - [SshPublicKey object](#SshPublicKey) |
|
||||
|
||||
|
||||
<a id="VaultCertificate" />
|
||||
### VaultCertificate object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| certificateUrl | string | No | the URL referencing a secret in a Key Vault which contains a properly formatted certificate. |
|
||||
| certificateStore | string | No | the Certificate store in LocalMachine to add the certificate to on Windows, leave empty on Linux. |
|
||||
|
||||
|
||||
<a id="NetworkInterfaceReferenceProperties" />
|
||||
### NetworkInterfaceReferenceProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| primary | boolean | No | whether this is a primary NIC on a virtual machine |
|
||||
|
||||
|
||||
<a id="KeyVaultSecretReference" />
|
||||
### KeyVaultSecretReference object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| secretUrl | string | Yes | the URL referencing a secret in a Key Vault. |
|
||||
| sourceVault | object | Yes | the Relative URL of the Key Vault containing the secret. - [SubResource object](#SubResource) |
|
||||
|
||||
|
||||
<a id="KeyVaultKeyReference" />
|
||||
### KeyVaultKeyReference object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| keyUrl | string | Yes | the URL referencing a key in a Key Vault. |
|
||||
| sourceVault | object | Yes | the Relative URL of the Key Vault containing the key - [SubResource object](#SubResource) |
|
||||
|
||||
|
||||
<a id="WinRMListener" />
|
||||
### WinRMListener object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| protocol | enum | No | the Protocol used by WinRM listener. Currently only Http and Https are supported. - Http or Https |
|
||||
| certificateUrl | string | No | the Certificate URL in KMS for Https listeners. Should be null for Http listeners. |
|
||||
|
||||
|
||||
<a id="SshPublicKey" />
|
||||
### SshPublicKey object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| path | string | No | the full path on the created VM where SSH public key is stored. If the file already exists, the specified key is appended to the file. |
|
||||
| keyData | string | No | Certificate public key used to authenticate with VM through SSH.The certificate must be in Pem format with or without headers. |
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
# Microsoft.Compute/virtualMachines/extensions template reference
|
||||
API Version: 2016-03-30
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Compute/virtualMachines/extensions resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Compute/virtualMachines/extensions",
|
||||
"apiVersion": "2016-03-30",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"properties": {
|
||||
"forceUpdateTag": "string",
|
||||
"publisher": "string",
|
||||
"type": "string",
|
||||
"typeHandlerVersion": "string",
|
||||
"autoUpgradeMinorVersion": boolean,
|
||||
"settings": {},
|
||||
"protectedSettings": {},
|
||||
"instanceView": {
|
||||
"name": "string",
|
||||
"type": "string",
|
||||
"typeHandlerVersion": "string",
|
||||
"substatuses": [
|
||||
{
|
||||
"code": "string",
|
||||
"level": "string",
|
||||
"displayStatus": "string",
|
||||
"message": "string",
|
||||
"time": "string"
|
||||
}
|
||||
],
|
||||
"statuses": [
|
||||
{
|
||||
"code": "string",
|
||||
"level": "string",
|
||||
"displayStatus": "string",
|
||||
"message": "string",
|
||||
"time": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Compute/virtualMachines/extensions" />
|
||||
### Microsoft.Compute/virtualMachines/extensions object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Compute/virtualMachines/extensions |
|
||||
| apiVersion | enum | Yes | 2016-03-30 |
|
||||
| location | string | Yes | Resource location |
|
||||
| tags | object | No | Resource tags |
|
||||
| properties | object | Yes | [VirtualMachineExtensionProperties object](#VirtualMachineExtensionProperties) |
|
||||
|
||||
|
||||
<a id="VirtualMachineExtensionProperties" />
|
||||
### VirtualMachineExtensionProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| forceUpdateTag | string | No | how the extension handler should be forced to update even if the extension configuration has not changed. |
|
||||
| publisher | string | No | the name of the extension handler publisher. |
|
||||
| type | string | No | the type of the extension handler. |
|
||||
| typeHandlerVersion | string | No | the type version of the extension handler. |
|
||||
| autoUpgradeMinorVersion | boolean | No | whether the extension handler should be automatically upgraded across minor versions. |
|
||||
| settings | object | No | Json formatted public settings for the extension. |
|
||||
| protectedSettings | object | No | Json formatted protected settings for the extension. |
|
||||
| instanceView | object | No | the virtual machine extension instance view. - [VirtualMachineExtensionInstanceView object](#VirtualMachineExtensionInstanceView) |
|
||||
|
||||
|
||||
<a id="VirtualMachineExtensionInstanceView" />
|
||||
### VirtualMachineExtensionInstanceView object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | No | the virtual machine extension name. |
|
||||
| type | string | No | the full type of the extension handler which includes both publisher and type. |
|
||||
| typeHandlerVersion | string | No | the type version of the extension handler. |
|
||||
| substatuses | array | No | the resource status information. - [InstanceViewStatus object](#InstanceViewStatus) |
|
||||
| statuses | array | No | the resource status information. - [InstanceViewStatus object](#InstanceViewStatus) |
|
||||
|
||||
|
||||
<a id="InstanceViewStatus" />
|
||||
### InstanceViewStatus object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| code | string | No | the status Code. |
|
||||
| level | enum | No | the level Code. - Info, Warning, Error |
|
||||
| displayStatus | string | No | the short localizable label for the status. |
|
||||
| message | string | No | the detailed Message, including for alerts and error messages. |
|
||||
| time | string | No | the time of the status. |
|
||||
|
|
@ -0,0 +1,391 @@
|
|||
{
|
||||
"id": "https://schema.management.azure.com/schemas/2016-03-30/Microsoft.ContainerService.json#",
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "Microsoft.ContainerService",
|
||||
"description": "Microsoft ContainerService Resource Types",
|
||||
"resourceDefinitions": {
|
||||
"containerServices": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Microsoft.ContainerService/containerServices"
|
||||
]
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"2016-03-30"
|
||||
]
|
||||
},
|
||||
"location": {
|
||||
"type": "string",
|
||||
"description": "Resource location"
|
||||
},
|
||||
"tags": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Resource tags"
|
||||
},
|
||||
"properties": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/ContainerServiceProperties"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"apiVersion",
|
||||
"location",
|
||||
"properties"
|
||||
],
|
||||
"description": "Microsoft.ContainerService/containerServices"
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"ContainerServiceAgentPoolProfile": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Unique name of the agent pool profile within the context of the subscription and resource group"
|
||||
},
|
||||
"count": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 100
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "No. of agents (VMs) that will host docker containers"
|
||||
},
|
||||
"vmSize": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Standard_A0",
|
||||
"Standard_A1",
|
||||
"Standard_A2",
|
||||
"Standard_A3",
|
||||
"Standard_A4",
|
||||
"Standard_A5",
|
||||
"Standard_A6",
|
||||
"Standard_A7",
|
||||
"Standard_A8",
|
||||
"Standard_A9",
|
||||
"Standard_A10",
|
||||
"Standard_A11",
|
||||
"Standard_D1",
|
||||
"Standard_D2",
|
||||
"Standard_D3",
|
||||
"Standard_D4",
|
||||
"Standard_D11",
|
||||
"Standard_D12",
|
||||
"Standard_D13",
|
||||
"Standard_D14",
|
||||
"Standard_D1_v2",
|
||||
"Standard_D2_v2",
|
||||
"Standard_D3_v2",
|
||||
"Standard_D4_v2",
|
||||
"Standard_D5_v2",
|
||||
"Standard_D11_v2",
|
||||
"Standard_D12_v2",
|
||||
"Standard_D13_v2",
|
||||
"Standard_D14_v2",
|
||||
"Standard_G1",
|
||||
"Standard_G2",
|
||||
"Standard_G3",
|
||||
"Standard_G4",
|
||||
"Standard_G5",
|
||||
"Standard_DS1",
|
||||
"Standard_DS2",
|
||||
"Standard_DS3",
|
||||
"Standard_DS4",
|
||||
"Standard_DS11",
|
||||
"Standard_DS12",
|
||||
"Standard_DS13",
|
||||
"Standard_DS14",
|
||||
"Standard_GS1",
|
||||
"Standard_GS2",
|
||||
"Standard_GS3",
|
||||
"Standard_GS4",
|
||||
"Standard_GS5"
|
||||
]
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Size of agent VMs."
|
||||
},
|
||||
"dnsPrefix": {
|
||||
"type": "string",
|
||||
"description": "DNS prefix to be used to create FQDN for this agent pool"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"dnsPrefix"
|
||||
],
|
||||
"description": "Profile for container service agent pool"
|
||||
},
|
||||
"ContainerServiceDiagnosticsProfile": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"vmDiagnostics": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/ContainerServiceVMDiagnostics"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Profile for container service VM diagnostic agent"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ContainerServiceLinuxProfile": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"adminUsername": {
|
||||
"type": "string",
|
||||
"description": "The administrator username to use for all Linux VMs"
|
||||
},
|
||||
"ssh": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/ContainerServiceSshConfiguration"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Specifies the ssh key configuration for Linux VMs"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"adminUsername",
|
||||
"ssh"
|
||||
],
|
||||
"description": "Profile for Linux VMs"
|
||||
},
|
||||
"ContainerServiceMasterProfile": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"count": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Number of masters (VMs) in the container cluster"
|
||||
},
|
||||
"dnsPrefix": {
|
||||
"type": "string",
|
||||
"description": "DNS prefix to be used to create FQDN for master"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"dnsPrefix"
|
||||
],
|
||||
"description": "Profile for container service master"
|
||||
},
|
||||
"ContainerServiceOrchestratorProfile": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"orchestratorType": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Swarm",
|
||||
"DCOS"
|
||||
]
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Specifies what orchestrator will be used to manage container cluster resources."
|
||||
}
|
||||
},
|
||||
"description": "Profile for Orchestrator"
|
||||
},
|
||||
"ContainerServiceProperties": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"orchestratorProfile": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/ContainerServiceOrchestratorProfile"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Properties of orchestrator"
|
||||
},
|
||||
"masterProfile": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/ContainerServiceMasterProfile"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Properties of master agents"
|
||||
},
|
||||
"agentPoolProfiles": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/ContainerServiceAgentPoolProfile"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Properties of agent pools"
|
||||
},
|
||||
"windowsProfile": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/ContainerServiceWindowsProfile"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Properties of Windows VMs"
|
||||
},
|
||||
"linuxProfile": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/ContainerServiceLinuxProfile"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Properties for Linux VMs"
|
||||
},
|
||||
"diagnosticsProfile": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/ContainerServiceDiagnosticsProfile"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "Properties for Diagnostic Agent"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"masterProfile",
|
||||
"agentPoolProfiles",
|
||||
"linuxProfile"
|
||||
],
|
||||
"description": "Properties of container service"
|
||||
},
|
||||
"ContainerServiceSshConfiguration": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"publicKeys": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/ContainerServiceSshPublicKey"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "the list of SSH public keys used to authenticate with Linux based VMs"
|
||||
}
|
||||
},
|
||||
"description": "SSH configuration for Linux based VMs running on Azure"
|
||||
},
|
||||
"ContainerServiceSshPublicKey": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"keyData": {
|
||||
"type": "string",
|
||||
"description": "Certificate public key used to authenticate with VM through SSH. The certificate must be in Pem format with or without headers."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"keyData"
|
||||
],
|
||||
"description": "Contains information about SSH certificate public key data."
|
||||
},
|
||||
"ContainerServiceVMDiagnostics": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
|
||||
}
|
||||
],
|
||||
"description": "whether VM Diagnostic Agent should be provisioned on the Virtual Machine."
|
||||
}
|
||||
},
|
||||
"description": "Describes VM Diagnostics."
|
||||
},
|
||||
"ContainerServiceWindowsProfile": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"adminUsername": {
|
||||
"type": "string",
|
||||
"description": "The administrator username to use for Windows VMs"
|
||||
},
|
||||
"adminPassword": {
|
||||
"type": "string",
|
||||
"description": "The administrator password to use for Windows VMs"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"adminUsername",
|
||||
"adminPassword"
|
||||
],
|
||||
"description": "Profile for Windows VMs"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,147 @@
|
|||
# Microsoft.ContainerService/containerServices template reference
|
||||
API Version: 2016-03-30
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.ContainerService/containerServices resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.ContainerService/containerServices",
|
||||
"apiVersion": "2016-03-30",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"properties": {
|
||||
"orchestratorProfile": {
|
||||
"orchestratorType": "string"
|
||||
},
|
||||
"masterProfile": {
|
||||
"count": "integer",
|
||||
"dnsPrefix": "string"
|
||||
},
|
||||
"agentPoolProfiles": [
|
||||
{
|
||||
"name": "string",
|
||||
"count": "integer",
|
||||
"vmSize": "string",
|
||||
"dnsPrefix": "string"
|
||||
}
|
||||
],
|
||||
"windowsProfile": {
|
||||
"adminUsername": "string",
|
||||
"adminPassword": "string"
|
||||
},
|
||||
"linuxProfile": {
|
||||
"adminUsername": "string",
|
||||
"ssh": {
|
||||
"publicKeys": [
|
||||
{
|
||||
"keyData": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"diagnosticsProfile": {
|
||||
"vmDiagnostics": {
|
||||
"enabled": boolean
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.ContainerService/containerServices" />
|
||||
### Microsoft.ContainerService/containerServices object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.ContainerService/containerServices |
|
||||
| apiVersion | enum | Yes | 2016-03-30 |
|
||||
| location | string | Yes | Resource location |
|
||||
| tags | object | No | Resource tags |
|
||||
| properties | object | Yes | [ContainerServiceProperties object](#ContainerServiceProperties) |
|
||||
|
||||
|
||||
<a id="ContainerServiceProperties" />
|
||||
### ContainerServiceProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| orchestratorProfile | object | No | Properties of orchestrator - [ContainerServiceOrchestratorProfile object](#ContainerServiceOrchestratorProfile) |
|
||||
| masterProfile | object | Yes | Properties of master agents - [ContainerServiceMasterProfile object](#ContainerServiceMasterProfile) |
|
||||
| agentPoolProfiles | array | Yes | Properties of agent pools - [ContainerServiceAgentPoolProfile object](#ContainerServiceAgentPoolProfile) |
|
||||
| windowsProfile | object | No | Properties of Windows VMs - [ContainerServiceWindowsProfile object](#ContainerServiceWindowsProfile) |
|
||||
| linuxProfile | object | Yes | Properties for Linux VMs - [ContainerServiceLinuxProfile object](#ContainerServiceLinuxProfile) |
|
||||
| diagnosticsProfile | object | No | Properties for Diagnostic Agent - [ContainerServiceDiagnosticsProfile object](#ContainerServiceDiagnosticsProfile) |
|
||||
|
||||
|
||||
<a id="ContainerServiceOrchestratorProfile" />
|
||||
### ContainerServiceOrchestratorProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| orchestratorType | enum | No | Specifies what orchestrator will be used to manage container cluster resources. - Swarm or DCOS |
|
||||
|
||||
|
||||
<a id="ContainerServiceMasterProfile" />
|
||||
### ContainerServiceMasterProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| count | integer | No | Number of masters (VMs) in the container cluster |
|
||||
| dnsPrefix | string | Yes | DNS prefix to be used to create FQDN for master |
|
||||
|
||||
|
||||
<a id="ContainerServiceAgentPoolProfile" />
|
||||
### ContainerServiceAgentPoolProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | Unique name of the agent pool profile within the context of the subscription and resource group |
|
||||
| count | integer | No | No. of agents (VMs) that will host docker containers |
|
||||
| vmSize | enum | No | Size of agent VMs. - Standard_A0, Standard_A1, Standard_A2, Standard_A3, Standard_A4, Standard_A5, Standard_A6, Standard_A7, Standard_A8, Standard_A9, Standard_A10, Standard_A11, Standard_D1, Standard_D2, Standard_D3, Standard_D4, Standard_D11, Standard_D12, Standard_D13, Standard_D14, Standard_D1_v2, Standard_D2_v2, Standard_D3_v2, Standard_D4_v2, Standard_D5_v2, Standard_D11_v2, Standard_D12_v2, Standard_D13_v2, Standard_D14_v2, Standard_G1, Standard_G2, Standard_G3, Standard_G4, Standard_G5, Standard_DS1, Standard_DS2, Standard_DS3, Standard_DS4, Standard_DS11, Standard_DS12, Standard_DS13, Standard_DS14, Standard_GS1, Standard_GS2, Standard_GS3, Standard_GS4, Standard_GS5 |
|
||||
| dnsPrefix | string | Yes | DNS prefix to be used to create FQDN for this agent pool |
|
||||
|
||||
|
||||
<a id="ContainerServiceWindowsProfile" />
|
||||
### ContainerServiceWindowsProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| adminUsername | string | Yes | The administrator username to use for Windows VMs |
|
||||
| adminPassword | string | Yes | The administrator password to use for Windows VMs |
|
||||
|
||||
|
||||
<a id="ContainerServiceLinuxProfile" />
|
||||
### ContainerServiceLinuxProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| adminUsername | string | Yes | The administrator username to use for all Linux VMs |
|
||||
| ssh | object | Yes | Specifies the ssh key configuration for Linux VMs - [ContainerServiceSshConfiguration object](#ContainerServiceSshConfiguration) |
|
||||
|
||||
|
||||
<a id="ContainerServiceDiagnosticsProfile" />
|
||||
### ContainerServiceDiagnosticsProfile object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| vmDiagnostics | object | No | Profile for container service VM diagnostic agent - [ContainerServiceVMDiagnostics object](#ContainerServiceVMDiagnostics) |
|
||||
|
||||
|
||||
<a id="ContainerServiceSshConfiguration" />
|
||||
### ContainerServiceSshConfiguration object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| publicKeys | array | No | the list of SSH public keys used to authenticate with Linux based VMs - [ContainerServiceSshPublicKey object](#ContainerServiceSshPublicKey) |
|
||||
|
||||
|
||||
<a id="ContainerServiceVMDiagnostics" />
|
||||
### ContainerServiceVMDiagnostics object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| enabled | boolean | No | whether VM Diagnostic Agent should be provisioned on the Virtual Machine. |
|
||||
|
||||
|
||||
<a id="ContainerServiceSshPublicKey" />
|
||||
### ContainerServiceSshPublicKey object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| keyData | string | Yes | Certificate public key used to authenticate with VM through SSH. The certificate must be in Pem format with or without headers. |
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,46 @@
|
|||
# Microsoft.Network/dnszones template reference
|
||||
API Version: 2015-05-04-preview
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Network/dnszones resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Network/dnszones",
|
||||
"apiVersion": "2015-05-04-preview",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"etag": "string",
|
||||
"properties": {
|
||||
"maxNumberOfRecordSets": "integer",
|
||||
"numberOfRecordSets": "integer"
|
||||
},
|
||||
"resources": []
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Network/dnszones" />
|
||||
### Microsoft.Network/dnszones object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Network/dnszones |
|
||||
| apiVersion | enum | Yes | 2015-05-04-preview |
|
||||
| location | string | Yes | Resource location |
|
||||
| tags | object | No | Resource tags |
|
||||
| etag | string | No | Gets or sets the ETag of the zone that is being updated, as received from a Get operation. |
|
||||
| properties | object | Yes | Gets or sets the properties of the zone. - [ZoneProperties object](#ZoneProperties) |
|
||||
| resources | array | No | [TXT](./dnszones/TXT.md) [SRV](./dnszones/SRV.md) [SOA](./dnszones/SOA.md) [PTR](./dnszones/PTR.md) [NS](./dnszones/NS.md) [MX](./dnszones/MX.md) [CNAME](./dnszones/CNAME.md) [AAAA](./dnszones/AAAA.md) [A](./dnszones/A.md) |
|
||||
|
||||
|
||||
<a id="ZoneProperties" />
|
||||
### ZoneProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| maxNumberOfRecordSets | integer | No | Gets or sets the maximum number of record sets that can be created in this zone. |
|
||||
| numberOfRecordSets | integer | No | Gets or sets the current number of record sets in this zone. |
|
||||
|
|
@ -0,0 +1,177 @@
|
|||
# Microsoft.Network/dnszones/A template reference
|
||||
API Version: 2015-05-04-preview
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Network/dnszones/A resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Network/dnszones/A",
|
||||
"apiVersion": "2015-05-04-preview",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"etag": "string",
|
||||
"properties": {
|
||||
"TTL": "integer",
|
||||
"ARecords": [
|
||||
{
|
||||
"ipv4Address": "string"
|
||||
}
|
||||
],
|
||||
"AAAARecords": [
|
||||
{
|
||||
"ipv6Address": "string"
|
||||
}
|
||||
],
|
||||
"MXRecords": [
|
||||
{
|
||||
"preference": "integer",
|
||||
"exchange": "string"
|
||||
}
|
||||
],
|
||||
"NSRecords": [
|
||||
{
|
||||
"nsdname": "string"
|
||||
}
|
||||
],
|
||||
"PTRRecords": [
|
||||
{
|
||||
"ptrdname": "string"
|
||||
}
|
||||
],
|
||||
"SRVRecords": [
|
||||
{
|
||||
"priority": "integer",
|
||||
"weight": "integer",
|
||||
"port": "integer",
|
||||
"target": "string"
|
||||
}
|
||||
],
|
||||
"TXTRecords": [
|
||||
{
|
||||
"value": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
],
|
||||
"CNAMERecord": {
|
||||
"cname": "string"
|
||||
},
|
||||
"SOARecord": {
|
||||
"host": "string",
|
||||
"email": "string",
|
||||
"serialNumber": "integer",
|
||||
"refreshTime": "integer",
|
||||
"retryTime": "integer",
|
||||
"expireTime": "integer",
|
||||
"minimumTTL": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Network/dnszones/A" />
|
||||
### Microsoft.Network/dnszones/A object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Network/dnszones/A |
|
||||
| apiVersion | enum | Yes | 2015-05-04-preview |
|
||||
| location | string | Yes | Resource location |
|
||||
| tags | object | No | Resource tags |
|
||||
| etag | string | No | Gets or sets the ETag of the RecordSet. |
|
||||
| properties | object | Yes | Gets or sets the properties of the RecordSet. - [RecordSetProperties object](#RecordSetProperties) |
|
||||
|
||||
|
||||
<a id="RecordSetProperties" />
|
||||
### RecordSetProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| TTL | integer | No | Gets or sets the TTL of the records in the RecordSet. |
|
||||
| ARecords | array | No | Gets or sets the list of A records in the RecordSet. - [ARecord object](#ARecord) |
|
||||
| AAAARecords | array | No | Gets or sets the list of AAAA records in the RecordSet. - [AaaaRecord object](#AaaaRecord) |
|
||||
| MXRecords | array | No | Gets or sets the list of MX records in the RecordSet. - [MxRecord object](#MxRecord) |
|
||||
| NSRecords | array | No | Gets or sets the list of NS records in the RecordSet. - [NsRecord object](#NsRecord) |
|
||||
| PTRRecords | array | No | Gets or sets the list of PTR records in the RecordSet. - [PtrRecord object](#PtrRecord) |
|
||||
| SRVRecords | array | No | Gets or sets the list of SRV records in the RecordSet. - [SrvRecord object](#SrvRecord) |
|
||||
| TXTRecords | array | No | Gets or sets the list of TXT records in the RecordSet. - [TxtRecord object](#TxtRecord) |
|
||||
| CNAMERecord | object | No | Gets or sets the CNAME record in the RecordSet. - [CnameRecord object](#CnameRecord) |
|
||||
| SOARecord | object | No | Gets or sets the SOA record in the RecordSet. - [SoaRecord object](#SoaRecord) |
|
||||
|
||||
|
||||
<a id="ARecord" />
|
||||
### ARecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv4Address | string | No | Gets or sets the IPv4 address of this A record in string notation. |
|
||||
|
||||
|
||||
<a id="AaaaRecord" />
|
||||
### AaaaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv6Address | string | No | Gets or sets the IPv6 address of this AAAA record in string notation. |
|
||||
|
||||
|
||||
<a id="MxRecord" />
|
||||
### MxRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| preference | integer | No | Gets or sets the preference metric for this record. |
|
||||
| exchange | string | No | Gets or sets the domain name of the mail host, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="NsRecord" />
|
||||
### NsRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| nsdname | string | No | Gets or sets the name server name for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="PtrRecord" />
|
||||
### PtrRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ptrdname | string | No | Gets or sets the PTR target domain name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SrvRecord" />
|
||||
### SrvRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| priority | integer | No | Gets or sets the priority metric for this record. |
|
||||
| weight | integer | No | Gets or sets the weight metric for this this record. |
|
||||
| port | integer | No | Gets or sets the port of the service for this record. |
|
||||
| target | string | No | Gets or sets the domain name of the target for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="TxtRecord" />
|
||||
### TxtRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| value | array | No | Gets or sets the text value of this record. - string |
|
||||
|
||||
|
||||
<a id="CnameRecord" />
|
||||
### CnameRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| cname | string | No | Gets or sets the canonical name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SoaRecord" />
|
||||
### SoaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| host | string | No | Gets or sets the domain name of the authoritative name server, without a temrinating dot. |
|
||||
| email | string | No | Gets or sets the email for this record. |
|
||||
| serialNumber | integer | No | Gets or sets the serial number for this record. |
|
||||
| refreshTime | integer | No | Gets or sets the refresh value for this record. |
|
||||
| retryTime | integer | No | Gets or sets the retry time for this record. |
|
||||
| expireTime | integer | No | Gets or sets the expire time for this record. |
|
||||
| minimumTTL | integer | No | Gets or sets the minimum TTL value for this record. |
|
||||
|
|
@ -0,0 +1,177 @@
|
|||
# Microsoft.Network/dnszones/AAAA template reference
|
||||
API Version: 2015-05-04-preview
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Network/dnszones/AAAA resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Network/dnszones/AAAA",
|
||||
"apiVersion": "2015-05-04-preview",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"etag": "string",
|
||||
"properties": {
|
||||
"TTL": "integer",
|
||||
"ARecords": [
|
||||
{
|
||||
"ipv4Address": "string"
|
||||
}
|
||||
],
|
||||
"AAAARecords": [
|
||||
{
|
||||
"ipv6Address": "string"
|
||||
}
|
||||
],
|
||||
"MXRecords": [
|
||||
{
|
||||
"preference": "integer",
|
||||
"exchange": "string"
|
||||
}
|
||||
],
|
||||
"NSRecords": [
|
||||
{
|
||||
"nsdname": "string"
|
||||
}
|
||||
],
|
||||
"PTRRecords": [
|
||||
{
|
||||
"ptrdname": "string"
|
||||
}
|
||||
],
|
||||
"SRVRecords": [
|
||||
{
|
||||
"priority": "integer",
|
||||
"weight": "integer",
|
||||
"port": "integer",
|
||||
"target": "string"
|
||||
}
|
||||
],
|
||||
"TXTRecords": [
|
||||
{
|
||||
"value": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
],
|
||||
"CNAMERecord": {
|
||||
"cname": "string"
|
||||
},
|
||||
"SOARecord": {
|
||||
"host": "string",
|
||||
"email": "string",
|
||||
"serialNumber": "integer",
|
||||
"refreshTime": "integer",
|
||||
"retryTime": "integer",
|
||||
"expireTime": "integer",
|
||||
"minimumTTL": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Network/dnszones/AAAA" />
|
||||
### Microsoft.Network/dnszones/AAAA object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Network/dnszones/AAAA |
|
||||
| apiVersion | enum | Yes | 2015-05-04-preview |
|
||||
| location | string | Yes | Resource location |
|
||||
| tags | object | No | Resource tags |
|
||||
| etag | string | No | Gets or sets the ETag of the RecordSet. |
|
||||
| properties | object | Yes | Gets or sets the properties of the RecordSet. - [RecordSetProperties object](#RecordSetProperties) |
|
||||
|
||||
|
||||
<a id="RecordSetProperties" />
|
||||
### RecordSetProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| TTL | integer | No | Gets or sets the TTL of the records in the RecordSet. |
|
||||
| ARecords | array | No | Gets or sets the list of A records in the RecordSet. - [ARecord object](#ARecord) |
|
||||
| AAAARecords | array | No | Gets or sets the list of AAAA records in the RecordSet. - [AaaaRecord object](#AaaaRecord) |
|
||||
| MXRecords | array | No | Gets or sets the list of MX records in the RecordSet. - [MxRecord object](#MxRecord) |
|
||||
| NSRecords | array | No | Gets or sets the list of NS records in the RecordSet. - [NsRecord object](#NsRecord) |
|
||||
| PTRRecords | array | No | Gets or sets the list of PTR records in the RecordSet. - [PtrRecord object](#PtrRecord) |
|
||||
| SRVRecords | array | No | Gets or sets the list of SRV records in the RecordSet. - [SrvRecord object](#SrvRecord) |
|
||||
| TXTRecords | array | No | Gets or sets the list of TXT records in the RecordSet. - [TxtRecord object](#TxtRecord) |
|
||||
| CNAMERecord | object | No | Gets or sets the CNAME record in the RecordSet. - [CnameRecord object](#CnameRecord) |
|
||||
| SOARecord | object | No | Gets or sets the SOA record in the RecordSet. - [SoaRecord object](#SoaRecord) |
|
||||
|
||||
|
||||
<a id="ARecord" />
|
||||
### ARecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv4Address | string | No | Gets or sets the IPv4 address of this A record in string notation. |
|
||||
|
||||
|
||||
<a id="AaaaRecord" />
|
||||
### AaaaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv6Address | string | No | Gets or sets the IPv6 address of this AAAA record in string notation. |
|
||||
|
||||
|
||||
<a id="MxRecord" />
|
||||
### MxRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| preference | integer | No | Gets or sets the preference metric for this record. |
|
||||
| exchange | string | No | Gets or sets the domain name of the mail host, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="NsRecord" />
|
||||
### NsRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| nsdname | string | No | Gets or sets the name server name for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="PtrRecord" />
|
||||
### PtrRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ptrdname | string | No | Gets or sets the PTR target domain name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SrvRecord" />
|
||||
### SrvRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| priority | integer | No | Gets or sets the priority metric for this record. |
|
||||
| weight | integer | No | Gets or sets the weight metric for this this record. |
|
||||
| port | integer | No | Gets or sets the port of the service for this record. |
|
||||
| target | string | No | Gets or sets the domain name of the target for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="TxtRecord" />
|
||||
### TxtRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| value | array | No | Gets or sets the text value of this record. - string |
|
||||
|
||||
|
||||
<a id="CnameRecord" />
|
||||
### CnameRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| cname | string | No | Gets or sets the canonical name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SoaRecord" />
|
||||
### SoaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| host | string | No | Gets or sets the domain name of the authoritative name server, without a temrinating dot. |
|
||||
| email | string | No | Gets or sets the email for this record. |
|
||||
| serialNumber | integer | No | Gets or sets the serial number for this record. |
|
||||
| refreshTime | integer | No | Gets or sets the refresh value for this record. |
|
||||
| retryTime | integer | No | Gets or sets the retry time for this record. |
|
||||
| expireTime | integer | No | Gets or sets the expire time for this record. |
|
||||
| minimumTTL | integer | No | Gets or sets the minimum TTL value for this record. |
|
||||
|
|
@ -0,0 +1,177 @@
|
|||
# Microsoft.Network/dnszones/CNAME template reference
|
||||
API Version: 2015-05-04-preview
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Network/dnszones/CNAME resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Network/dnszones/CNAME",
|
||||
"apiVersion": "2015-05-04-preview",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"etag": "string",
|
||||
"properties": {
|
||||
"TTL": "integer",
|
||||
"ARecords": [
|
||||
{
|
||||
"ipv4Address": "string"
|
||||
}
|
||||
],
|
||||
"AAAARecords": [
|
||||
{
|
||||
"ipv6Address": "string"
|
||||
}
|
||||
],
|
||||
"MXRecords": [
|
||||
{
|
||||
"preference": "integer",
|
||||
"exchange": "string"
|
||||
}
|
||||
],
|
||||
"NSRecords": [
|
||||
{
|
||||
"nsdname": "string"
|
||||
}
|
||||
],
|
||||
"PTRRecords": [
|
||||
{
|
||||
"ptrdname": "string"
|
||||
}
|
||||
],
|
||||
"SRVRecords": [
|
||||
{
|
||||
"priority": "integer",
|
||||
"weight": "integer",
|
||||
"port": "integer",
|
||||
"target": "string"
|
||||
}
|
||||
],
|
||||
"TXTRecords": [
|
||||
{
|
||||
"value": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
],
|
||||
"CNAMERecord": {
|
||||
"cname": "string"
|
||||
},
|
||||
"SOARecord": {
|
||||
"host": "string",
|
||||
"email": "string",
|
||||
"serialNumber": "integer",
|
||||
"refreshTime": "integer",
|
||||
"retryTime": "integer",
|
||||
"expireTime": "integer",
|
||||
"minimumTTL": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Network/dnszones/CNAME" />
|
||||
### Microsoft.Network/dnszones/CNAME object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Network/dnszones/CNAME |
|
||||
| apiVersion | enum | Yes | 2015-05-04-preview |
|
||||
| location | string | Yes | Resource location |
|
||||
| tags | object | No | Resource tags |
|
||||
| etag | string | No | Gets or sets the ETag of the RecordSet. |
|
||||
| properties | object | Yes | Gets or sets the properties of the RecordSet. - [RecordSetProperties object](#RecordSetProperties) |
|
||||
|
||||
|
||||
<a id="RecordSetProperties" />
|
||||
### RecordSetProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| TTL | integer | No | Gets or sets the TTL of the records in the RecordSet. |
|
||||
| ARecords | array | No | Gets or sets the list of A records in the RecordSet. - [ARecord object](#ARecord) |
|
||||
| AAAARecords | array | No | Gets or sets the list of AAAA records in the RecordSet. - [AaaaRecord object](#AaaaRecord) |
|
||||
| MXRecords | array | No | Gets or sets the list of MX records in the RecordSet. - [MxRecord object](#MxRecord) |
|
||||
| NSRecords | array | No | Gets or sets the list of NS records in the RecordSet. - [NsRecord object](#NsRecord) |
|
||||
| PTRRecords | array | No | Gets or sets the list of PTR records in the RecordSet. - [PtrRecord object](#PtrRecord) |
|
||||
| SRVRecords | array | No | Gets or sets the list of SRV records in the RecordSet. - [SrvRecord object](#SrvRecord) |
|
||||
| TXTRecords | array | No | Gets or sets the list of TXT records in the RecordSet. - [TxtRecord object](#TxtRecord) |
|
||||
| CNAMERecord | object | No | Gets or sets the CNAME record in the RecordSet. - [CnameRecord object](#CnameRecord) |
|
||||
| SOARecord | object | No | Gets or sets the SOA record in the RecordSet. - [SoaRecord object](#SoaRecord) |
|
||||
|
||||
|
||||
<a id="ARecord" />
|
||||
### ARecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv4Address | string | No | Gets or sets the IPv4 address of this A record in string notation. |
|
||||
|
||||
|
||||
<a id="AaaaRecord" />
|
||||
### AaaaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv6Address | string | No | Gets or sets the IPv6 address of this AAAA record in string notation. |
|
||||
|
||||
|
||||
<a id="MxRecord" />
|
||||
### MxRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| preference | integer | No | Gets or sets the preference metric for this record. |
|
||||
| exchange | string | No | Gets or sets the domain name of the mail host, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="NsRecord" />
|
||||
### NsRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| nsdname | string | No | Gets or sets the name server name for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="PtrRecord" />
|
||||
### PtrRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ptrdname | string | No | Gets or sets the PTR target domain name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SrvRecord" />
|
||||
### SrvRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| priority | integer | No | Gets or sets the priority metric for this record. |
|
||||
| weight | integer | No | Gets or sets the weight metric for this this record. |
|
||||
| port | integer | No | Gets or sets the port of the service for this record. |
|
||||
| target | string | No | Gets or sets the domain name of the target for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="TxtRecord" />
|
||||
### TxtRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| value | array | No | Gets or sets the text value of this record. - string |
|
||||
|
||||
|
||||
<a id="CnameRecord" />
|
||||
### CnameRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| cname | string | No | Gets or sets the canonical name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SoaRecord" />
|
||||
### SoaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| host | string | No | Gets or sets the domain name of the authoritative name server, without a temrinating dot. |
|
||||
| email | string | No | Gets or sets the email for this record. |
|
||||
| serialNumber | integer | No | Gets or sets the serial number for this record. |
|
||||
| refreshTime | integer | No | Gets or sets the refresh value for this record. |
|
||||
| retryTime | integer | No | Gets or sets the retry time for this record. |
|
||||
| expireTime | integer | No | Gets or sets the expire time for this record. |
|
||||
| minimumTTL | integer | No | Gets or sets the minimum TTL value for this record. |
|
||||
|
|
@ -0,0 +1,177 @@
|
|||
# Microsoft.Network/dnszones/MX template reference
|
||||
API Version: 2015-05-04-preview
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Network/dnszones/MX resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Network/dnszones/MX",
|
||||
"apiVersion": "2015-05-04-preview",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"etag": "string",
|
||||
"properties": {
|
||||
"TTL": "integer",
|
||||
"ARecords": [
|
||||
{
|
||||
"ipv4Address": "string"
|
||||
}
|
||||
],
|
||||
"AAAARecords": [
|
||||
{
|
||||
"ipv6Address": "string"
|
||||
}
|
||||
],
|
||||
"MXRecords": [
|
||||
{
|
||||
"preference": "integer",
|
||||
"exchange": "string"
|
||||
}
|
||||
],
|
||||
"NSRecords": [
|
||||
{
|
||||
"nsdname": "string"
|
||||
}
|
||||
],
|
||||
"PTRRecords": [
|
||||
{
|
||||
"ptrdname": "string"
|
||||
}
|
||||
],
|
||||
"SRVRecords": [
|
||||
{
|
||||
"priority": "integer",
|
||||
"weight": "integer",
|
||||
"port": "integer",
|
||||
"target": "string"
|
||||
}
|
||||
],
|
||||
"TXTRecords": [
|
||||
{
|
||||
"value": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
],
|
||||
"CNAMERecord": {
|
||||
"cname": "string"
|
||||
},
|
||||
"SOARecord": {
|
||||
"host": "string",
|
||||
"email": "string",
|
||||
"serialNumber": "integer",
|
||||
"refreshTime": "integer",
|
||||
"retryTime": "integer",
|
||||
"expireTime": "integer",
|
||||
"minimumTTL": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Network/dnszones/MX" />
|
||||
### Microsoft.Network/dnszones/MX object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Network/dnszones/MX |
|
||||
| apiVersion | enum | Yes | 2015-05-04-preview |
|
||||
| location | string | Yes | Resource location |
|
||||
| tags | object | No | Resource tags |
|
||||
| etag | string | No | Gets or sets the ETag of the RecordSet. |
|
||||
| properties | object | Yes | Gets or sets the properties of the RecordSet. - [RecordSetProperties object](#RecordSetProperties) |
|
||||
|
||||
|
||||
<a id="RecordSetProperties" />
|
||||
### RecordSetProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| TTL | integer | No | Gets or sets the TTL of the records in the RecordSet. |
|
||||
| ARecords | array | No | Gets or sets the list of A records in the RecordSet. - [ARecord object](#ARecord) |
|
||||
| AAAARecords | array | No | Gets or sets the list of AAAA records in the RecordSet. - [AaaaRecord object](#AaaaRecord) |
|
||||
| MXRecords | array | No | Gets or sets the list of MX records in the RecordSet. - [MxRecord object](#MxRecord) |
|
||||
| NSRecords | array | No | Gets or sets the list of NS records in the RecordSet. - [NsRecord object](#NsRecord) |
|
||||
| PTRRecords | array | No | Gets or sets the list of PTR records in the RecordSet. - [PtrRecord object](#PtrRecord) |
|
||||
| SRVRecords | array | No | Gets or sets the list of SRV records in the RecordSet. - [SrvRecord object](#SrvRecord) |
|
||||
| TXTRecords | array | No | Gets or sets the list of TXT records in the RecordSet. - [TxtRecord object](#TxtRecord) |
|
||||
| CNAMERecord | object | No | Gets or sets the CNAME record in the RecordSet. - [CnameRecord object](#CnameRecord) |
|
||||
| SOARecord | object | No | Gets or sets the SOA record in the RecordSet. - [SoaRecord object](#SoaRecord) |
|
||||
|
||||
|
||||
<a id="ARecord" />
|
||||
### ARecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv4Address | string | No | Gets or sets the IPv4 address of this A record in string notation. |
|
||||
|
||||
|
||||
<a id="AaaaRecord" />
|
||||
### AaaaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv6Address | string | No | Gets or sets the IPv6 address of this AAAA record in string notation. |
|
||||
|
||||
|
||||
<a id="MxRecord" />
|
||||
### MxRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| preference | integer | No | Gets or sets the preference metric for this record. |
|
||||
| exchange | string | No | Gets or sets the domain name of the mail host, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="NsRecord" />
|
||||
### NsRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| nsdname | string | No | Gets or sets the name server name for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="PtrRecord" />
|
||||
### PtrRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ptrdname | string | No | Gets or sets the PTR target domain name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SrvRecord" />
|
||||
### SrvRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| priority | integer | No | Gets or sets the priority metric for this record. |
|
||||
| weight | integer | No | Gets or sets the weight metric for this this record. |
|
||||
| port | integer | No | Gets or sets the port of the service for this record. |
|
||||
| target | string | No | Gets or sets the domain name of the target for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="TxtRecord" />
|
||||
### TxtRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| value | array | No | Gets or sets the text value of this record. - string |
|
||||
|
||||
|
||||
<a id="CnameRecord" />
|
||||
### CnameRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| cname | string | No | Gets or sets the canonical name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SoaRecord" />
|
||||
### SoaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| host | string | No | Gets or sets the domain name of the authoritative name server, without a temrinating dot. |
|
||||
| email | string | No | Gets or sets the email for this record. |
|
||||
| serialNumber | integer | No | Gets or sets the serial number for this record. |
|
||||
| refreshTime | integer | No | Gets or sets the refresh value for this record. |
|
||||
| retryTime | integer | No | Gets or sets the retry time for this record. |
|
||||
| expireTime | integer | No | Gets or sets the expire time for this record. |
|
||||
| minimumTTL | integer | No | Gets or sets the minimum TTL value for this record. |
|
||||
|
|
@ -0,0 +1,177 @@
|
|||
# Microsoft.Network/dnszones/NS template reference
|
||||
API Version: 2015-05-04-preview
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Network/dnszones/NS resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Network/dnszones/NS",
|
||||
"apiVersion": "2015-05-04-preview",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"etag": "string",
|
||||
"properties": {
|
||||
"TTL": "integer",
|
||||
"ARecords": [
|
||||
{
|
||||
"ipv4Address": "string"
|
||||
}
|
||||
],
|
||||
"AAAARecords": [
|
||||
{
|
||||
"ipv6Address": "string"
|
||||
}
|
||||
],
|
||||
"MXRecords": [
|
||||
{
|
||||
"preference": "integer",
|
||||
"exchange": "string"
|
||||
}
|
||||
],
|
||||
"NSRecords": [
|
||||
{
|
||||
"nsdname": "string"
|
||||
}
|
||||
],
|
||||
"PTRRecords": [
|
||||
{
|
||||
"ptrdname": "string"
|
||||
}
|
||||
],
|
||||
"SRVRecords": [
|
||||
{
|
||||
"priority": "integer",
|
||||
"weight": "integer",
|
||||
"port": "integer",
|
||||
"target": "string"
|
||||
}
|
||||
],
|
||||
"TXTRecords": [
|
||||
{
|
||||
"value": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
],
|
||||
"CNAMERecord": {
|
||||
"cname": "string"
|
||||
},
|
||||
"SOARecord": {
|
||||
"host": "string",
|
||||
"email": "string",
|
||||
"serialNumber": "integer",
|
||||
"refreshTime": "integer",
|
||||
"retryTime": "integer",
|
||||
"expireTime": "integer",
|
||||
"minimumTTL": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Network/dnszones/NS" />
|
||||
### Microsoft.Network/dnszones/NS object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Network/dnszones/NS |
|
||||
| apiVersion | enum | Yes | 2015-05-04-preview |
|
||||
| location | string | Yes | Resource location |
|
||||
| tags | object | No | Resource tags |
|
||||
| etag | string | No | Gets or sets the ETag of the RecordSet. |
|
||||
| properties | object | Yes | Gets or sets the properties of the RecordSet. - [RecordSetProperties object](#RecordSetProperties) |
|
||||
|
||||
|
||||
<a id="RecordSetProperties" />
|
||||
### RecordSetProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| TTL | integer | No | Gets or sets the TTL of the records in the RecordSet. |
|
||||
| ARecords | array | No | Gets or sets the list of A records in the RecordSet. - [ARecord object](#ARecord) |
|
||||
| AAAARecords | array | No | Gets or sets the list of AAAA records in the RecordSet. - [AaaaRecord object](#AaaaRecord) |
|
||||
| MXRecords | array | No | Gets or sets the list of MX records in the RecordSet. - [MxRecord object](#MxRecord) |
|
||||
| NSRecords | array | No | Gets or sets the list of NS records in the RecordSet. - [NsRecord object](#NsRecord) |
|
||||
| PTRRecords | array | No | Gets or sets the list of PTR records in the RecordSet. - [PtrRecord object](#PtrRecord) |
|
||||
| SRVRecords | array | No | Gets or sets the list of SRV records in the RecordSet. - [SrvRecord object](#SrvRecord) |
|
||||
| TXTRecords | array | No | Gets or sets the list of TXT records in the RecordSet. - [TxtRecord object](#TxtRecord) |
|
||||
| CNAMERecord | object | No | Gets or sets the CNAME record in the RecordSet. - [CnameRecord object](#CnameRecord) |
|
||||
| SOARecord | object | No | Gets or sets the SOA record in the RecordSet. - [SoaRecord object](#SoaRecord) |
|
||||
|
||||
|
||||
<a id="ARecord" />
|
||||
### ARecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv4Address | string | No | Gets or sets the IPv4 address of this A record in string notation. |
|
||||
|
||||
|
||||
<a id="AaaaRecord" />
|
||||
### AaaaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv6Address | string | No | Gets or sets the IPv6 address of this AAAA record in string notation. |
|
||||
|
||||
|
||||
<a id="MxRecord" />
|
||||
### MxRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| preference | integer | No | Gets or sets the preference metric for this record. |
|
||||
| exchange | string | No | Gets or sets the domain name of the mail host, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="NsRecord" />
|
||||
### NsRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| nsdname | string | No | Gets or sets the name server name for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="PtrRecord" />
|
||||
### PtrRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ptrdname | string | No | Gets or sets the PTR target domain name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SrvRecord" />
|
||||
### SrvRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| priority | integer | No | Gets or sets the priority metric for this record. |
|
||||
| weight | integer | No | Gets or sets the weight metric for this this record. |
|
||||
| port | integer | No | Gets or sets the port of the service for this record. |
|
||||
| target | string | No | Gets or sets the domain name of the target for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="TxtRecord" />
|
||||
### TxtRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| value | array | No | Gets or sets the text value of this record. - string |
|
||||
|
||||
|
||||
<a id="CnameRecord" />
|
||||
### CnameRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| cname | string | No | Gets or sets the canonical name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SoaRecord" />
|
||||
### SoaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| host | string | No | Gets or sets the domain name of the authoritative name server, without a temrinating dot. |
|
||||
| email | string | No | Gets or sets the email for this record. |
|
||||
| serialNumber | integer | No | Gets or sets the serial number for this record. |
|
||||
| refreshTime | integer | No | Gets or sets the refresh value for this record. |
|
||||
| retryTime | integer | No | Gets or sets the retry time for this record. |
|
||||
| expireTime | integer | No | Gets or sets the expire time for this record. |
|
||||
| minimumTTL | integer | No | Gets or sets the minimum TTL value for this record. |
|
||||
|
|
@ -0,0 +1,177 @@
|
|||
# Microsoft.Network/dnszones/PTR template reference
|
||||
API Version: 2015-05-04-preview
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Network/dnszones/PTR resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Network/dnszones/PTR",
|
||||
"apiVersion": "2015-05-04-preview",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"etag": "string",
|
||||
"properties": {
|
||||
"TTL": "integer",
|
||||
"ARecords": [
|
||||
{
|
||||
"ipv4Address": "string"
|
||||
}
|
||||
],
|
||||
"AAAARecords": [
|
||||
{
|
||||
"ipv6Address": "string"
|
||||
}
|
||||
],
|
||||
"MXRecords": [
|
||||
{
|
||||
"preference": "integer",
|
||||
"exchange": "string"
|
||||
}
|
||||
],
|
||||
"NSRecords": [
|
||||
{
|
||||
"nsdname": "string"
|
||||
}
|
||||
],
|
||||
"PTRRecords": [
|
||||
{
|
||||
"ptrdname": "string"
|
||||
}
|
||||
],
|
||||
"SRVRecords": [
|
||||
{
|
||||
"priority": "integer",
|
||||
"weight": "integer",
|
||||
"port": "integer",
|
||||
"target": "string"
|
||||
}
|
||||
],
|
||||
"TXTRecords": [
|
||||
{
|
||||
"value": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
],
|
||||
"CNAMERecord": {
|
||||
"cname": "string"
|
||||
},
|
||||
"SOARecord": {
|
||||
"host": "string",
|
||||
"email": "string",
|
||||
"serialNumber": "integer",
|
||||
"refreshTime": "integer",
|
||||
"retryTime": "integer",
|
||||
"expireTime": "integer",
|
||||
"minimumTTL": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Network/dnszones/PTR" />
|
||||
### Microsoft.Network/dnszones/PTR object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Network/dnszones/PTR |
|
||||
| apiVersion | enum | Yes | 2015-05-04-preview |
|
||||
| location | string | Yes | Resource location |
|
||||
| tags | object | No | Resource tags |
|
||||
| etag | string | No | Gets or sets the ETag of the RecordSet. |
|
||||
| properties | object | Yes | Gets or sets the properties of the RecordSet. - [RecordSetProperties object](#RecordSetProperties) |
|
||||
|
||||
|
||||
<a id="RecordSetProperties" />
|
||||
### RecordSetProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| TTL | integer | No | Gets or sets the TTL of the records in the RecordSet. |
|
||||
| ARecords | array | No | Gets or sets the list of A records in the RecordSet. - [ARecord object](#ARecord) |
|
||||
| AAAARecords | array | No | Gets or sets the list of AAAA records in the RecordSet. - [AaaaRecord object](#AaaaRecord) |
|
||||
| MXRecords | array | No | Gets or sets the list of MX records in the RecordSet. - [MxRecord object](#MxRecord) |
|
||||
| NSRecords | array | No | Gets or sets the list of NS records in the RecordSet. - [NsRecord object](#NsRecord) |
|
||||
| PTRRecords | array | No | Gets or sets the list of PTR records in the RecordSet. - [PtrRecord object](#PtrRecord) |
|
||||
| SRVRecords | array | No | Gets or sets the list of SRV records in the RecordSet. - [SrvRecord object](#SrvRecord) |
|
||||
| TXTRecords | array | No | Gets or sets the list of TXT records in the RecordSet. - [TxtRecord object](#TxtRecord) |
|
||||
| CNAMERecord | object | No | Gets or sets the CNAME record in the RecordSet. - [CnameRecord object](#CnameRecord) |
|
||||
| SOARecord | object | No | Gets or sets the SOA record in the RecordSet. - [SoaRecord object](#SoaRecord) |
|
||||
|
||||
|
||||
<a id="ARecord" />
|
||||
### ARecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv4Address | string | No | Gets or sets the IPv4 address of this A record in string notation. |
|
||||
|
||||
|
||||
<a id="AaaaRecord" />
|
||||
### AaaaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv6Address | string | No | Gets or sets the IPv6 address of this AAAA record in string notation. |
|
||||
|
||||
|
||||
<a id="MxRecord" />
|
||||
### MxRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| preference | integer | No | Gets or sets the preference metric for this record. |
|
||||
| exchange | string | No | Gets or sets the domain name of the mail host, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="NsRecord" />
|
||||
### NsRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| nsdname | string | No | Gets or sets the name server name for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="PtrRecord" />
|
||||
### PtrRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ptrdname | string | No | Gets or sets the PTR target domain name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SrvRecord" />
|
||||
### SrvRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| priority | integer | No | Gets or sets the priority metric for this record. |
|
||||
| weight | integer | No | Gets or sets the weight metric for this this record. |
|
||||
| port | integer | No | Gets or sets the port of the service for this record. |
|
||||
| target | string | No | Gets or sets the domain name of the target for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="TxtRecord" />
|
||||
### TxtRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| value | array | No | Gets or sets the text value of this record. - string |
|
||||
|
||||
|
||||
<a id="CnameRecord" />
|
||||
### CnameRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| cname | string | No | Gets or sets the canonical name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SoaRecord" />
|
||||
### SoaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| host | string | No | Gets or sets the domain name of the authoritative name server, without a temrinating dot. |
|
||||
| email | string | No | Gets or sets the email for this record. |
|
||||
| serialNumber | integer | No | Gets or sets the serial number for this record. |
|
||||
| refreshTime | integer | No | Gets or sets the refresh value for this record. |
|
||||
| retryTime | integer | No | Gets or sets the retry time for this record. |
|
||||
| expireTime | integer | No | Gets or sets the expire time for this record. |
|
||||
| minimumTTL | integer | No | Gets or sets the minimum TTL value for this record. |
|
||||
|
|
@ -0,0 +1,177 @@
|
|||
# Microsoft.Network/dnszones/SOA template reference
|
||||
API Version: 2015-05-04-preview
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Network/dnszones/SOA resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Network/dnszones/SOA",
|
||||
"apiVersion": "2015-05-04-preview",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"etag": "string",
|
||||
"properties": {
|
||||
"TTL": "integer",
|
||||
"ARecords": [
|
||||
{
|
||||
"ipv4Address": "string"
|
||||
}
|
||||
],
|
||||
"AAAARecords": [
|
||||
{
|
||||
"ipv6Address": "string"
|
||||
}
|
||||
],
|
||||
"MXRecords": [
|
||||
{
|
||||
"preference": "integer",
|
||||
"exchange": "string"
|
||||
}
|
||||
],
|
||||
"NSRecords": [
|
||||
{
|
||||
"nsdname": "string"
|
||||
}
|
||||
],
|
||||
"PTRRecords": [
|
||||
{
|
||||
"ptrdname": "string"
|
||||
}
|
||||
],
|
||||
"SRVRecords": [
|
||||
{
|
||||
"priority": "integer",
|
||||
"weight": "integer",
|
||||
"port": "integer",
|
||||
"target": "string"
|
||||
}
|
||||
],
|
||||
"TXTRecords": [
|
||||
{
|
||||
"value": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
],
|
||||
"CNAMERecord": {
|
||||
"cname": "string"
|
||||
},
|
||||
"SOARecord": {
|
||||
"host": "string",
|
||||
"email": "string",
|
||||
"serialNumber": "integer",
|
||||
"refreshTime": "integer",
|
||||
"retryTime": "integer",
|
||||
"expireTime": "integer",
|
||||
"minimumTTL": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Network/dnszones/SOA" />
|
||||
### Microsoft.Network/dnszones/SOA object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Network/dnszones/SOA |
|
||||
| apiVersion | enum | Yes | 2015-05-04-preview |
|
||||
| location | string | Yes | Resource location |
|
||||
| tags | object | No | Resource tags |
|
||||
| etag | string | No | Gets or sets the ETag of the RecordSet. |
|
||||
| properties | object | Yes | Gets or sets the properties of the RecordSet. - [RecordSetProperties object](#RecordSetProperties) |
|
||||
|
||||
|
||||
<a id="RecordSetProperties" />
|
||||
### RecordSetProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| TTL | integer | No | Gets or sets the TTL of the records in the RecordSet. |
|
||||
| ARecords | array | No | Gets or sets the list of A records in the RecordSet. - [ARecord object](#ARecord) |
|
||||
| AAAARecords | array | No | Gets or sets the list of AAAA records in the RecordSet. - [AaaaRecord object](#AaaaRecord) |
|
||||
| MXRecords | array | No | Gets or sets the list of MX records in the RecordSet. - [MxRecord object](#MxRecord) |
|
||||
| NSRecords | array | No | Gets or sets the list of NS records in the RecordSet. - [NsRecord object](#NsRecord) |
|
||||
| PTRRecords | array | No | Gets or sets the list of PTR records in the RecordSet. - [PtrRecord object](#PtrRecord) |
|
||||
| SRVRecords | array | No | Gets or sets the list of SRV records in the RecordSet. - [SrvRecord object](#SrvRecord) |
|
||||
| TXTRecords | array | No | Gets or sets the list of TXT records in the RecordSet. - [TxtRecord object](#TxtRecord) |
|
||||
| CNAMERecord | object | No | Gets or sets the CNAME record in the RecordSet. - [CnameRecord object](#CnameRecord) |
|
||||
| SOARecord | object | No | Gets or sets the SOA record in the RecordSet. - [SoaRecord object](#SoaRecord) |
|
||||
|
||||
|
||||
<a id="ARecord" />
|
||||
### ARecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv4Address | string | No | Gets or sets the IPv4 address of this A record in string notation. |
|
||||
|
||||
|
||||
<a id="AaaaRecord" />
|
||||
### AaaaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv6Address | string | No | Gets or sets the IPv6 address of this AAAA record in string notation. |
|
||||
|
||||
|
||||
<a id="MxRecord" />
|
||||
### MxRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| preference | integer | No | Gets or sets the preference metric for this record. |
|
||||
| exchange | string | No | Gets or sets the domain name of the mail host, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="NsRecord" />
|
||||
### NsRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| nsdname | string | No | Gets or sets the name server name for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="PtrRecord" />
|
||||
### PtrRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ptrdname | string | No | Gets or sets the PTR target domain name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SrvRecord" />
|
||||
### SrvRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| priority | integer | No | Gets or sets the priority metric for this record. |
|
||||
| weight | integer | No | Gets or sets the weight metric for this this record. |
|
||||
| port | integer | No | Gets or sets the port of the service for this record. |
|
||||
| target | string | No | Gets or sets the domain name of the target for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="TxtRecord" />
|
||||
### TxtRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| value | array | No | Gets or sets the text value of this record. - string |
|
||||
|
||||
|
||||
<a id="CnameRecord" />
|
||||
### CnameRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| cname | string | No | Gets or sets the canonical name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SoaRecord" />
|
||||
### SoaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| host | string | No | Gets or sets the domain name of the authoritative name server, without a temrinating dot. |
|
||||
| email | string | No | Gets or sets the email for this record. |
|
||||
| serialNumber | integer | No | Gets or sets the serial number for this record. |
|
||||
| refreshTime | integer | No | Gets or sets the refresh value for this record. |
|
||||
| retryTime | integer | No | Gets or sets the retry time for this record. |
|
||||
| expireTime | integer | No | Gets or sets the expire time for this record. |
|
||||
| minimumTTL | integer | No | Gets or sets the minimum TTL value for this record. |
|
||||
|
|
@ -0,0 +1,177 @@
|
|||
# Microsoft.Network/dnszones/SRV template reference
|
||||
API Version: 2015-05-04-preview
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Network/dnszones/SRV resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Network/dnszones/SRV",
|
||||
"apiVersion": "2015-05-04-preview",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"etag": "string",
|
||||
"properties": {
|
||||
"TTL": "integer",
|
||||
"ARecords": [
|
||||
{
|
||||
"ipv4Address": "string"
|
||||
}
|
||||
],
|
||||
"AAAARecords": [
|
||||
{
|
||||
"ipv6Address": "string"
|
||||
}
|
||||
],
|
||||
"MXRecords": [
|
||||
{
|
||||
"preference": "integer",
|
||||
"exchange": "string"
|
||||
}
|
||||
],
|
||||
"NSRecords": [
|
||||
{
|
||||
"nsdname": "string"
|
||||
}
|
||||
],
|
||||
"PTRRecords": [
|
||||
{
|
||||
"ptrdname": "string"
|
||||
}
|
||||
],
|
||||
"SRVRecords": [
|
||||
{
|
||||
"priority": "integer",
|
||||
"weight": "integer",
|
||||
"port": "integer",
|
||||
"target": "string"
|
||||
}
|
||||
],
|
||||
"TXTRecords": [
|
||||
{
|
||||
"value": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
],
|
||||
"CNAMERecord": {
|
||||
"cname": "string"
|
||||
},
|
||||
"SOARecord": {
|
||||
"host": "string",
|
||||
"email": "string",
|
||||
"serialNumber": "integer",
|
||||
"refreshTime": "integer",
|
||||
"retryTime": "integer",
|
||||
"expireTime": "integer",
|
||||
"minimumTTL": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Network/dnszones/SRV" />
|
||||
### Microsoft.Network/dnszones/SRV object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Network/dnszones/SRV |
|
||||
| apiVersion | enum | Yes | 2015-05-04-preview |
|
||||
| location | string | Yes | Resource location |
|
||||
| tags | object | No | Resource tags |
|
||||
| etag | string | No | Gets or sets the ETag of the RecordSet. |
|
||||
| properties | object | Yes | Gets or sets the properties of the RecordSet. - [RecordSetProperties object](#RecordSetProperties) |
|
||||
|
||||
|
||||
<a id="RecordSetProperties" />
|
||||
### RecordSetProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| TTL | integer | No | Gets or sets the TTL of the records in the RecordSet. |
|
||||
| ARecords | array | No | Gets or sets the list of A records in the RecordSet. - [ARecord object](#ARecord) |
|
||||
| AAAARecords | array | No | Gets or sets the list of AAAA records in the RecordSet. - [AaaaRecord object](#AaaaRecord) |
|
||||
| MXRecords | array | No | Gets or sets the list of MX records in the RecordSet. - [MxRecord object](#MxRecord) |
|
||||
| NSRecords | array | No | Gets or sets the list of NS records in the RecordSet. - [NsRecord object](#NsRecord) |
|
||||
| PTRRecords | array | No | Gets or sets the list of PTR records in the RecordSet. - [PtrRecord object](#PtrRecord) |
|
||||
| SRVRecords | array | No | Gets or sets the list of SRV records in the RecordSet. - [SrvRecord object](#SrvRecord) |
|
||||
| TXTRecords | array | No | Gets or sets the list of TXT records in the RecordSet. - [TxtRecord object](#TxtRecord) |
|
||||
| CNAMERecord | object | No | Gets or sets the CNAME record in the RecordSet. - [CnameRecord object](#CnameRecord) |
|
||||
| SOARecord | object | No | Gets or sets the SOA record in the RecordSet. - [SoaRecord object](#SoaRecord) |
|
||||
|
||||
|
||||
<a id="ARecord" />
|
||||
### ARecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv4Address | string | No | Gets or sets the IPv4 address of this A record in string notation. |
|
||||
|
||||
|
||||
<a id="AaaaRecord" />
|
||||
### AaaaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv6Address | string | No | Gets or sets the IPv6 address of this AAAA record in string notation. |
|
||||
|
||||
|
||||
<a id="MxRecord" />
|
||||
### MxRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| preference | integer | No | Gets or sets the preference metric for this record. |
|
||||
| exchange | string | No | Gets or sets the domain name of the mail host, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="NsRecord" />
|
||||
### NsRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| nsdname | string | No | Gets or sets the name server name for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="PtrRecord" />
|
||||
### PtrRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ptrdname | string | No | Gets or sets the PTR target domain name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SrvRecord" />
|
||||
### SrvRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| priority | integer | No | Gets or sets the priority metric for this record. |
|
||||
| weight | integer | No | Gets or sets the weight metric for this this record. |
|
||||
| port | integer | No | Gets or sets the port of the service for this record. |
|
||||
| target | string | No | Gets or sets the domain name of the target for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="TxtRecord" />
|
||||
### TxtRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| value | array | No | Gets or sets the text value of this record. - string |
|
||||
|
||||
|
||||
<a id="CnameRecord" />
|
||||
### CnameRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| cname | string | No | Gets or sets the canonical name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SoaRecord" />
|
||||
### SoaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| host | string | No | Gets or sets the domain name of the authoritative name server, without a temrinating dot. |
|
||||
| email | string | No | Gets or sets the email for this record. |
|
||||
| serialNumber | integer | No | Gets or sets the serial number for this record. |
|
||||
| refreshTime | integer | No | Gets or sets the refresh value for this record. |
|
||||
| retryTime | integer | No | Gets or sets the retry time for this record. |
|
||||
| expireTime | integer | No | Gets or sets the expire time for this record. |
|
||||
| minimumTTL | integer | No | Gets or sets the minimum TTL value for this record. |
|
||||
|
|
@ -0,0 +1,177 @@
|
|||
# Microsoft.Network/dnszones/TXT template reference
|
||||
API Version: 2015-05-04-preview
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Network/dnszones/TXT resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Network/dnszones/TXT",
|
||||
"apiVersion": "2015-05-04-preview",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"etag": "string",
|
||||
"properties": {
|
||||
"TTL": "integer",
|
||||
"ARecords": [
|
||||
{
|
||||
"ipv4Address": "string"
|
||||
}
|
||||
],
|
||||
"AAAARecords": [
|
||||
{
|
||||
"ipv6Address": "string"
|
||||
}
|
||||
],
|
||||
"MXRecords": [
|
||||
{
|
||||
"preference": "integer",
|
||||
"exchange": "string"
|
||||
}
|
||||
],
|
||||
"NSRecords": [
|
||||
{
|
||||
"nsdname": "string"
|
||||
}
|
||||
],
|
||||
"PTRRecords": [
|
||||
{
|
||||
"ptrdname": "string"
|
||||
}
|
||||
],
|
||||
"SRVRecords": [
|
||||
{
|
||||
"priority": "integer",
|
||||
"weight": "integer",
|
||||
"port": "integer",
|
||||
"target": "string"
|
||||
}
|
||||
],
|
||||
"TXTRecords": [
|
||||
{
|
||||
"value": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
],
|
||||
"CNAMERecord": {
|
||||
"cname": "string"
|
||||
},
|
||||
"SOARecord": {
|
||||
"host": "string",
|
||||
"email": "string",
|
||||
"serialNumber": "integer",
|
||||
"refreshTime": "integer",
|
||||
"retryTime": "integer",
|
||||
"expireTime": "integer",
|
||||
"minimumTTL": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Network/dnszones/TXT" />
|
||||
### Microsoft.Network/dnszones/TXT object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Network/dnszones/TXT |
|
||||
| apiVersion | enum | Yes | 2015-05-04-preview |
|
||||
| location | string | Yes | Resource location |
|
||||
| tags | object | No | Resource tags |
|
||||
| etag | string | No | Gets or sets the ETag of the RecordSet. |
|
||||
| properties | object | Yes | Gets or sets the properties of the RecordSet. - [RecordSetProperties object](#RecordSetProperties) |
|
||||
|
||||
|
||||
<a id="RecordSetProperties" />
|
||||
### RecordSetProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| TTL | integer | No | Gets or sets the TTL of the records in the RecordSet. |
|
||||
| ARecords | array | No | Gets or sets the list of A records in the RecordSet. - [ARecord object](#ARecord) |
|
||||
| AAAARecords | array | No | Gets or sets the list of AAAA records in the RecordSet. - [AaaaRecord object](#AaaaRecord) |
|
||||
| MXRecords | array | No | Gets or sets the list of MX records in the RecordSet. - [MxRecord object](#MxRecord) |
|
||||
| NSRecords | array | No | Gets or sets the list of NS records in the RecordSet. - [NsRecord object](#NsRecord) |
|
||||
| PTRRecords | array | No | Gets or sets the list of PTR records in the RecordSet. - [PtrRecord object](#PtrRecord) |
|
||||
| SRVRecords | array | No | Gets or sets the list of SRV records in the RecordSet. - [SrvRecord object](#SrvRecord) |
|
||||
| TXTRecords | array | No | Gets or sets the list of TXT records in the RecordSet. - [TxtRecord object](#TxtRecord) |
|
||||
| CNAMERecord | object | No | Gets or sets the CNAME record in the RecordSet. - [CnameRecord object](#CnameRecord) |
|
||||
| SOARecord | object | No | Gets or sets the SOA record in the RecordSet. - [SoaRecord object](#SoaRecord) |
|
||||
|
||||
|
||||
<a id="ARecord" />
|
||||
### ARecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv4Address | string | No | Gets or sets the IPv4 address of this A record in string notation. |
|
||||
|
||||
|
||||
<a id="AaaaRecord" />
|
||||
### AaaaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv6Address | string | No | Gets or sets the IPv6 address of this AAAA record in string notation. |
|
||||
|
||||
|
||||
<a id="MxRecord" />
|
||||
### MxRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| preference | integer | No | Gets or sets the preference metric for this record. |
|
||||
| exchange | string | No | Gets or sets the domain name of the mail host, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="NsRecord" />
|
||||
### NsRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| nsdname | string | No | Gets or sets the name server name for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="PtrRecord" />
|
||||
### PtrRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ptrdname | string | No | Gets or sets the PTR target domain name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SrvRecord" />
|
||||
### SrvRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| priority | integer | No | Gets or sets the priority metric for this record. |
|
||||
| weight | integer | No | Gets or sets the weight metric for this this record. |
|
||||
| port | integer | No | Gets or sets the port of the service for this record. |
|
||||
| target | string | No | Gets or sets the domain name of the target for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="TxtRecord" />
|
||||
### TxtRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| value | array | No | Gets or sets the text value of this record. - string |
|
||||
|
||||
|
||||
<a id="CnameRecord" />
|
||||
### CnameRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| cname | string | No | Gets or sets the canonical name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SoaRecord" />
|
||||
### SoaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| host | string | No | Gets or sets the domain name of the authoritative name server, without a temrinating dot. |
|
||||
| email | string | No | Gets or sets the email for this record. |
|
||||
| serialNumber | integer | No | Gets or sets the serial number for this record. |
|
||||
| refreshTime | integer | No | Gets or sets the refresh value for this record. |
|
||||
| retryTime | integer | No | Gets or sets the retry time for this record. |
|
||||
| expireTime | integer | No | Gets or sets the expire time for this record. |
|
||||
| minimumTTL | integer | No | Gets or sets the minimum TTL value for this record. |
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,46 @@
|
|||
# Microsoft.Network/dnszones template reference
|
||||
API Version: 2016-04-01
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Network/dnszones resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Network/dnszones",
|
||||
"apiVersion": "2016-04-01",
|
||||
"location": "string",
|
||||
"tags": {},
|
||||
"etag": "string",
|
||||
"properties": {
|
||||
"maxNumberOfRecordSets": "integer",
|
||||
"numberOfRecordSets": "integer"
|
||||
},
|
||||
"resources": []
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Network/dnszones" />
|
||||
### Microsoft.Network/dnszones object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Network/dnszones |
|
||||
| apiVersion | enum | Yes | 2016-04-01 |
|
||||
| location | string | Yes | Resource location |
|
||||
| tags | object | No | Resource tags |
|
||||
| etag | string | No | Gets or sets the ETag of the zone that is being updated, as received from a Get operation. |
|
||||
| properties | object | Yes | Gets or sets the properties of the zone. - [ZoneProperties object](#ZoneProperties) |
|
||||
| resources | array | No | [TXT](./dnszones/TXT.md) [SRV](./dnszones/SRV.md) [SOA](./dnszones/SOA.md) [PTR](./dnszones/PTR.md) [NS](./dnszones/NS.md) [MX](./dnszones/MX.md) [CNAME](./dnszones/CNAME.md) [AAAA](./dnszones/AAAA.md) [A](./dnszones/A.md) |
|
||||
|
||||
|
||||
<a id="ZoneProperties" />
|
||||
### ZoneProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| maxNumberOfRecordSets | integer | No | Gets or sets the maximum number of record sets that can be created in this zone. |
|
||||
| numberOfRecordSets | integer | No | Gets or sets the current number of record sets in this zone. |
|
||||
|
|
@ -0,0 +1,179 @@
|
|||
# Microsoft.Network/dnszones/A template reference
|
||||
API Version: 2016-04-01
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Network/dnszones/A resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Network/dnszones/A",
|
||||
"apiVersion": "2016-04-01",
|
||||
"id": "string",
|
||||
"etag": "string",
|
||||
"location": "string",
|
||||
"properties": {
|
||||
"metadata": {},
|
||||
"TTL": "integer",
|
||||
"ARecords": [
|
||||
{
|
||||
"ipv4Address": "string"
|
||||
}
|
||||
],
|
||||
"AAAARecords": [
|
||||
{
|
||||
"ipv6Address": "string"
|
||||
}
|
||||
],
|
||||
"MXRecords": [
|
||||
{
|
||||
"preference": "integer",
|
||||
"exchange": "string"
|
||||
}
|
||||
],
|
||||
"NSRecords": [
|
||||
{
|
||||
"nsdname": "string"
|
||||
}
|
||||
],
|
||||
"PTRRecords": [
|
||||
{
|
||||
"ptrdname": "string"
|
||||
}
|
||||
],
|
||||
"SRVRecords": [
|
||||
{
|
||||
"priority": "integer",
|
||||
"weight": "integer",
|
||||
"port": "integer",
|
||||
"target": "string"
|
||||
}
|
||||
],
|
||||
"TXTRecords": [
|
||||
{
|
||||
"value": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
],
|
||||
"CNAMERecord": {
|
||||
"cname": "string"
|
||||
},
|
||||
"SOARecord": {
|
||||
"host": "string",
|
||||
"email": "string",
|
||||
"serialNumber": "integer",
|
||||
"refreshTime": "integer",
|
||||
"retryTime": "integer",
|
||||
"expireTime": "integer",
|
||||
"minimumTTL": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Network/dnszones/A" />
|
||||
### Microsoft.Network/dnszones/A object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Network/dnszones/A |
|
||||
| apiVersion | enum | Yes | 2016-04-01 |
|
||||
| id | string | No | Gets or sets the ID of the resource. |
|
||||
| etag | string | No | Gets or sets the ETag of the RecordSet. |
|
||||
| location | string | No | Gets or sets the location of the resource. |
|
||||
| properties | object | Yes | Gets or sets the properties of the RecordSet. - [RecordSetProperties object](#RecordSetProperties) |
|
||||
|
||||
|
||||
<a id="RecordSetProperties" />
|
||||
### RecordSetProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| metadata | object | No | Gets or sets the metadata attached to the resource. |
|
||||
| TTL | integer | No | Gets or sets the TTL of the records in the RecordSet. |
|
||||
| ARecords | array | No | Gets or sets the list of A records in the RecordSet. - [ARecord object](#ARecord) |
|
||||
| AAAARecords | array | No | Gets or sets the list of AAAA records in the RecordSet. - [AaaaRecord object](#AaaaRecord) |
|
||||
| MXRecords | array | No | Gets or sets the list of MX records in the RecordSet. - [MxRecord object](#MxRecord) |
|
||||
| NSRecords | array | No | Gets or sets the list of NS records in the RecordSet. - [NsRecord object](#NsRecord) |
|
||||
| PTRRecords | array | No | Gets or sets the list of PTR records in the RecordSet. - [PtrRecord object](#PtrRecord) |
|
||||
| SRVRecords | array | No | Gets or sets the list of SRV records in the RecordSet. - [SrvRecord object](#SrvRecord) |
|
||||
| TXTRecords | array | No | Gets or sets the list of TXT records in the RecordSet. - [TxtRecord object](#TxtRecord) |
|
||||
| CNAMERecord | object | No | Gets or sets the CNAME record in the RecordSet. - [CnameRecord object](#CnameRecord) |
|
||||
| SOARecord | object | No | Gets or sets the SOA record in the RecordSet. - [SoaRecord object](#SoaRecord) |
|
||||
|
||||
|
||||
<a id="ARecord" />
|
||||
### ARecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv4Address | string | No | Gets or sets the IPv4 address of this A record in string notation. |
|
||||
|
||||
|
||||
<a id="AaaaRecord" />
|
||||
### AaaaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv6Address | string | No | Gets or sets the IPv6 address of this AAAA record in string notation. |
|
||||
|
||||
|
||||
<a id="MxRecord" />
|
||||
### MxRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| preference | integer | No | Gets or sets the preference metric for this record. |
|
||||
| exchange | string | No | Gets or sets the domain name of the mail host, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="NsRecord" />
|
||||
### NsRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| nsdname | string | No | Gets or sets the name server name for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="PtrRecord" />
|
||||
### PtrRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ptrdname | string | No | Gets or sets the PTR target domain name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SrvRecord" />
|
||||
### SrvRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| priority | integer | No | Gets or sets the priority metric for this record. |
|
||||
| weight | integer | No | Gets or sets the weight metric for this this record. |
|
||||
| port | integer | No | Gets or sets the port of the service for this record. |
|
||||
| target | string | No | Gets or sets the domain name of the target for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="TxtRecord" />
|
||||
### TxtRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| value | array | No | Gets or sets the text value of this record. - string |
|
||||
|
||||
|
||||
<a id="CnameRecord" />
|
||||
### CnameRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| cname | string | No | Gets or sets the canonical name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SoaRecord" />
|
||||
### SoaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| host | string | No | Gets or sets the domain name of the authoritative name server, without a temrinating dot. |
|
||||
| email | string | No | Gets or sets the email for this record. |
|
||||
| serialNumber | integer | No | Gets or sets the serial number for this record. |
|
||||
| refreshTime | integer | No | Gets or sets the refresh value for this record. |
|
||||
| retryTime | integer | No | Gets or sets the retry time for this record. |
|
||||
| expireTime | integer | No | Gets or sets the expire time for this record. |
|
||||
| minimumTTL | integer | No | Gets or sets the minimum TTL value for this record. |
|
||||
|
|
@ -0,0 +1,179 @@
|
|||
# Microsoft.Network/dnszones/AAAA template reference
|
||||
API Version: 2016-04-01
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Network/dnszones/AAAA resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Network/dnszones/AAAA",
|
||||
"apiVersion": "2016-04-01",
|
||||
"id": "string",
|
||||
"etag": "string",
|
||||
"location": "string",
|
||||
"properties": {
|
||||
"metadata": {},
|
||||
"TTL": "integer",
|
||||
"ARecords": [
|
||||
{
|
||||
"ipv4Address": "string"
|
||||
}
|
||||
],
|
||||
"AAAARecords": [
|
||||
{
|
||||
"ipv6Address": "string"
|
||||
}
|
||||
],
|
||||
"MXRecords": [
|
||||
{
|
||||
"preference": "integer",
|
||||
"exchange": "string"
|
||||
}
|
||||
],
|
||||
"NSRecords": [
|
||||
{
|
||||
"nsdname": "string"
|
||||
}
|
||||
],
|
||||
"PTRRecords": [
|
||||
{
|
||||
"ptrdname": "string"
|
||||
}
|
||||
],
|
||||
"SRVRecords": [
|
||||
{
|
||||
"priority": "integer",
|
||||
"weight": "integer",
|
||||
"port": "integer",
|
||||
"target": "string"
|
||||
}
|
||||
],
|
||||
"TXTRecords": [
|
||||
{
|
||||
"value": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
],
|
||||
"CNAMERecord": {
|
||||
"cname": "string"
|
||||
},
|
||||
"SOARecord": {
|
||||
"host": "string",
|
||||
"email": "string",
|
||||
"serialNumber": "integer",
|
||||
"refreshTime": "integer",
|
||||
"retryTime": "integer",
|
||||
"expireTime": "integer",
|
||||
"minimumTTL": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Network/dnszones/AAAA" />
|
||||
### Microsoft.Network/dnszones/AAAA object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Network/dnszones/AAAA |
|
||||
| apiVersion | enum | Yes | 2016-04-01 |
|
||||
| id | string | No | Gets or sets the ID of the resource. |
|
||||
| etag | string | No | Gets or sets the ETag of the RecordSet. |
|
||||
| location | string | No | Gets or sets the location of the resource. |
|
||||
| properties | object | Yes | Gets or sets the properties of the RecordSet. - [RecordSetProperties object](#RecordSetProperties) |
|
||||
|
||||
|
||||
<a id="RecordSetProperties" />
|
||||
### RecordSetProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| metadata | object | No | Gets or sets the metadata attached to the resource. |
|
||||
| TTL | integer | No | Gets or sets the TTL of the records in the RecordSet. |
|
||||
| ARecords | array | No | Gets or sets the list of A records in the RecordSet. - [ARecord object](#ARecord) |
|
||||
| AAAARecords | array | No | Gets or sets the list of AAAA records in the RecordSet. - [AaaaRecord object](#AaaaRecord) |
|
||||
| MXRecords | array | No | Gets or sets the list of MX records in the RecordSet. - [MxRecord object](#MxRecord) |
|
||||
| NSRecords | array | No | Gets or sets the list of NS records in the RecordSet. - [NsRecord object](#NsRecord) |
|
||||
| PTRRecords | array | No | Gets or sets the list of PTR records in the RecordSet. - [PtrRecord object](#PtrRecord) |
|
||||
| SRVRecords | array | No | Gets or sets the list of SRV records in the RecordSet. - [SrvRecord object](#SrvRecord) |
|
||||
| TXTRecords | array | No | Gets or sets the list of TXT records in the RecordSet. - [TxtRecord object](#TxtRecord) |
|
||||
| CNAMERecord | object | No | Gets or sets the CNAME record in the RecordSet. - [CnameRecord object](#CnameRecord) |
|
||||
| SOARecord | object | No | Gets or sets the SOA record in the RecordSet. - [SoaRecord object](#SoaRecord) |
|
||||
|
||||
|
||||
<a id="ARecord" />
|
||||
### ARecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv4Address | string | No | Gets or sets the IPv4 address of this A record in string notation. |
|
||||
|
||||
|
||||
<a id="AaaaRecord" />
|
||||
### AaaaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv6Address | string | No | Gets or sets the IPv6 address of this AAAA record in string notation. |
|
||||
|
||||
|
||||
<a id="MxRecord" />
|
||||
### MxRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| preference | integer | No | Gets or sets the preference metric for this record. |
|
||||
| exchange | string | No | Gets or sets the domain name of the mail host, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="NsRecord" />
|
||||
### NsRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| nsdname | string | No | Gets or sets the name server name for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="PtrRecord" />
|
||||
### PtrRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ptrdname | string | No | Gets or sets the PTR target domain name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SrvRecord" />
|
||||
### SrvRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| priority | integer | No | Gets or sets the priority metric for this record. |
|
||||
| weight | integer | No | Gets or sets the weight metric for this this record. |
|
||||
| port | integer | No | Gets or sets the port of the service for this record. |
|
||||
| target | string | No | Gets or sets the domain name of the target for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="TxtRecord" />
|
||||
### TxtRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| value | array | No | Gets or sets the text value of this record. - string |
|
||||
|
||||
|
||||
<a id="CnameRecord" />
|
||||
### CnameRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| cname | string | No | Gets or sets the canonical name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SoaRecord" />
|
||||
### SoaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| host | string | No | Gets or sets the domain name of the authoritative name server, without a temrinating dot. |
|
||||
| email | string | No | Gets or sets the email for this record. |
|
||||
| serialNumber | integer | No | Gets or sets the serial number for this record. |
|
||||
| refreshTime | integer | No | Gets or sets the refresh value for this record. |
|
||||
| retryTime | integer | No | Gets or sets the retry time for this record. |
|
||||
| expireTime | integer | No | Gets or sets the expire time for this record. |
|
||||
| minimumTTL | integer | No | Gets or sets the minimum TTL value for this record. |
|
||||
|
|
@ -0,0 +1,179 @@
|
|||
# Microsoft.Network/dnszones/CNAME template reference
|
||||
API Version: 2016-04-01
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Network/dnszones/CNAME resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Network/dnszones/CNAME",
|
||||
"apiVersion": "2016-04-01",
|
||||
"id": "string",
|
||||
"etag": "string",
|
||||
"location": "string",
|
||||
"properties": {
|
||||
"metadata": {},
|
||||
"TTL": "integer",
|
||||
"ARecords": [
|
||||
{
|
||||
"ipv4Address": "string"
|
||||
}
|
||||
],
|
||||
"AAAARecords": [
|
||||
{
|
||||
"ipv6Address": "string"
|
||||
}
|
||||
],
|
||||
"MXRecords": [
|
||||
{
|
||||
"preference": "integer",
|
||||
"exchange": "string"
|
||||
}
|
||||
],
|
||||
"NSRecords": [
|
||||
{
|
||||
"nsdname": "string"
|
||||
}
|
||||
],
|
||||
"PTRRecords": [
|
||||
{
|
||||
"ptrdname": "string"
|
||||
}
|
||||
],
|
||||
"SRVRecords": [
|
||||
{
|
||||
"priority": "integer",
|
||||
"weight": "integer",
|
||||
"port": "integer",
|
||||
"target": "string"
|
||||
}
|
||||
],
|
||||
"TXTRecords": [
|
||||
{
|
||||
"value": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
],
|
||||
"CNAMERecord": {
|
||||
"cname": "string"
|
||||
},
|
||||
"SOARecord": {
|
||||
"host": "string",
|
||||
"email": "string",
|
||||
"serialNumber": "integer",
|
||||
"refreshTime": "integer",
|
||||
"retryTime": "integer",
|
||||
"expireTime": "integer",
|
||||
"minimumTTL": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Network/dnszones/CNAME" />
|
||||
### Microsoft.Network/dnszones/CNAME object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Network/dnszones/CNAME |
|
||||
| apiVersion | enum | Yes | 2016-04-01 |
|
||||
| id | string | No | Gets or sets the ID of the resource. |
|
||||
| etag | string | No | Gets or sets the ETag of the RecordSet. |
|
||||
| location | string | No | Gets or sets the location of the resource. |
|
||||
| properties | object | Yes | Gets or sets the properties of the RecordSet. - [RecordSetProperties object](#RecordSetProperties) |
|
||||
|
||||
|
||||
<a id="RecordSetProperties" />
|
||||
### RecordSetProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| metadata | object | No | Gets or sets the metadata attached to the resource. |
|
||||
| TTL | integer | No | Gets or sets the TTL of the records in the RecordSet. |
|
||||
| ARecords | array | No | Gets or sets the list of A records in the RecordSet. - [ARecord object](#ARecord) |
|
||||
| AAAARecords | array | No | Gets or sets the list of AAAA records in the RecordSet. - [AaaaRecord object](#AaaaRecord) |
|
||||
| MXRecords | array | No | Gets or sets the list of MX records in the RecordSet. - [MxRecord object](#MxRecord) |
|
||||
| NSRecords | array | No | Gets or sets the list of NS records in the RecordSet. - [NsRecord object](#NsRecord) |
|
||||
| PTRRecords | array | No | Gets or sets the list of PTR records in the RecordSet. - [PtrRecord object](#PtrRecord) |
|
||||
| SRVRecords | array | No | Gets or sets the list of SRV records in the RecordSet. - [SrvRecord object](#SrvRecord) |
|
||||
| TXTRecords | array | No | Gets or sets the list of TXT records in the RecordSet. - [TxtRecord object](#TxtRecord) |
|
||||
| CNAMERecord | object | No | Gets or sets the CNAME record in the RecordSet. - [CnameRecord object](#CnameRecord) |
|
||||
| SOARecord | object | No | Gets or sets the SOA record in the RecordSet. - [SoaRecord object](#SoaRecord) |
|
||||
|
||||
|
||||
<a id="ARecord" />
|
||||
### ARecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv4Address | string | No | Gets or sets the IPv4 address of this A record in string notation. |
|
||||
|
||||
|
||||
<a id="AaaaRecord" />
|
||||
### AaaaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv6Address | string | No | Gets or sets the IPv6 address of this AAAA record in string notation. |
|
||||
|
||||
|
||||
<a id="MxRecord" />
|
||||
### MxRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| preference | integer | No | Gets or sets the preference metric for this record. |
|
||||
| exchange | string | No | Gets or sets the domain name of the mail host, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="NsRecord" />
|
||||
### NsRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| nsdname | string | No | Gets or sets the name server name for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="PtrRecord" />
|
||||
### PtrRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ptrdname | string | No | Gets or sets the PTR target domain name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SrvRecord" />
|
||||
### SrvRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| priority | integer | No | Gets or sets the priority metric for this record. |
|
||||
| weight | integer | No | Gets or sets the weight metric for this this record. |
|
||||
| port | integer | No | Gets or sets the port of the service for this record. |
|
||||
| target | string | No | Gets or sets the domain name of the target for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="TxtRecord" />
|
||||
### TxtRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| value | array | No | Gets or sets the text value of this record. - string |
|
||||
|
||||
|
||||
<a id="CnameRecord" />
|
||||
### CnameRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| cname | string | No | Gets or sets the canonical name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SoaRecord" />
|
||||
### SoaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| host | string | No | Gets or sets the domain name of the authoritative name server, without a temrinating dot. |
|
||||
| email | string | No | Gets or sets the email for this record. |
|
||||
| serialNumber | integer | No | Gets or sets the serial number for this record. |
|
||||
| refreshTime | integer | No | Gets or sets the refresh value for this record. |
|
||||
| retryTime | integer | No | Gets or sets the retry time for this record. |
|
||||
| expireTime | integer | No | Gets or sets the expire time for this record. |
|
||||
| minimumTTL | integer | No | Gets or sets the minimum TTL value for this record. |
|
||||
|
|
@ -0,0 +1,179 @@
|
|||
# Microsoft.Network/dnszones/MX template reference
|
||||
API Version: 2016-04-01
|
||||
## Template format
|
||||
|
||||
To create a Microsoft.Network/dnszones/MX resource, add the following JSON to the resources section of your template.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "string",
|
||||
"type": "Microsoft.Network/dnszones/MX",
|
||||
"apiVersion": "2016-04-01",
|
||||
"id": "string",
|
||||
"etag": "string",
|
||||
"location": "string",
|
||||
"properties": {
|
||||
"metadata": {},
|
||||
"TTL": "integer",
|
||||
"ARecords": [
|
||||
{
|
||||
"ipv4Address": "string"
|
||||
}
|
||||
],
|
||||
"AAAARecords": [
|
||||
{
|
||||
"ipv6Address": "string"
|
||||
}
|
||||
],
|
||||
"MXRecords": [
|
||||
{
|
||||
"preference": "integer",
|
||||
"exchange": "string"
|
||||
}
|
||||
],
|
||||
"NSRecords": [
|
||||
{
|
||||
"nsdname": "string"
|
||||
}
|
||||
],
|
||||
"PTRRecords": [
|
||||
{
|
||||
"ptrdname": "string"
|
||||
}
|
||||
],
|
||||
"SRVRecords": [
|
||||
{
|
||||
"priority": "integer",
|
||||
"weight": "integer",
|
||||
"port": "integer",
|
||||
"target": "string"
|
||||
}
|
||||
],
|
||||
"TXTRecords": [
|
||||
{
|
||||
"value": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
],
|
||||
"CNAMERecord": {
|
||||
"cname": "string"
|
||||
},
|
||||
"SOARecord": {
|
||||
"host": "string",
|
||||
"email": "string",
|
||||
"serialNumber": "integer",
|
||||
"refreshTime": "integer",
|
||||
"retryTime": "integer",
|
||||
"expireTime": "integer",
|
||||
"minimumTTL": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
## Property values
|
||||
|
||||
The following tables describe the values you need to set in the schema.
|
||||
|
||||
<a id="Microsoft.Network/dnszones/MX" />
|
||||
### Microsoft.Network/dnszones/MX object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| name | string | Yes | |
|
||||
| type | enum | Yes | Microsoft.Network/dnszones/MX |
|
||||
| apiVersion | enum | Yes | 2016-04-01 |
|
||||
| id | string | No | Gets or sets the ID of the resource. |
|
||||
| etag | string | No | Gets or sets the ETag of the RecordSet. |
|
||||
| location | string | No | Gets or sets the location of the resource. |
|
||||
| properties | object | Yes | Gets or sets the properties of the RecordSet. - [RecordSetProperties object](#RecordSetProperties) |
|
||||
|
||||
|
||||
<a id="RecordSetProperties" />
|
||||
### RecordSetProperties object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| metadata | object | No | Gets or sets the metadata attached to the resource. |
|
||||
| TTL | integer | No | Gets or sets the TTL of the records in the RecordSet. |
|
||||
| ARecords | array | No | Gets or sets the list of A records in the RecordSet. - [ARecord object](#ARecord) |
|
||||
| AAAARecords | array | No | Gets or sets the list of AAAA records in the RecordSet. - [AaaaRecord object](#AaaaRecord) |
|
||||
| MXRecords | array | No | Gets or sets the list of MX records in the RecordSet. - [MxRecord object](#MxRecord) |
|
||||
| NSRecords | array | No | Gets or sets the list of NS records in the RecordSet. - [NsRecord object](#NsRecord) |
|
||||
| PTRRecords | array | No | Gets or sets the list of PTR records in the RecordSet. - [PtrRecord object](#PtrRecord) |
|
||||
| SRVRecords | array | No | Gets or sets the list of SRV records in the RecordSet. - [SrvRecord object](#SrvRecord) |
|
||||
| TXTRecords | array | No | Gets or sets the list of TXT records in the RecordSet. - [TxtRecord object](#TxtRecord) |
|
||||
| CNAMERecord | object | No | Gets or sets the CNAME record in the RecordSet. - [CnameRecord object](#CnameRecord) |
|
||||
| SOARecord | object | No | Gets or sets the SOA record in the RecordSet. - [SoaRecord object](#SoaRecord) |
|
||||
|
||||
|
||||
<a id="ARecord" />
|
||||
### ARecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv4Address | string | No | Gets or sets the IPv4 address of this A record in string notation. |
|
||||
|
||||
|
||||
<a id="AaaaRecord" />
|
||||
### AaaaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ipv6Address | string | No | Gets or sets the IPv6 address of this AAAA record in string notation. |
|
||||
|
||||
|
||||
<a id="MxRecord" />
|
||||
### MxRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| preference | integer | No | Gets or sets the preference metric for this record. |
|
||||
| exchange | string | No | Gets or sets the domain name of the mail host, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="NsRecord" />
|
||||
### NsRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| nsdname | string | No | Gets or sets the name server name for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="PtrRecord" />
|
||||
### PtrRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| ptrdname | string | No | Gets or sets the PTR target domain name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SrvRecord" />
|
||||
### SrvRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| priority | integer | No | Gets or sets the priority metric for this record. |
|
||||
| weight | integer | No | Gets or sets the weight metric for this this record. |
|
||||
| port | integer | No | Gets or sets the port of the service for this record. |
|
||||
| target | string | No | Gets or sets the domain name of the target for this record, without a terminating dot. |
|
||||
|
||||
|
||||
<a id="TxtRecord" />
|
||||
### TxtRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| value | array | No | Gets or sets the text value of this record. - string |
|
||||
|
||||
|
||||
<a id="CnameRecord" />
|
||||
### CnameRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| cname | string | No | Gets or sets the canonical name for this record without a terminating dot. |
|
||||
|
||||
|
||||
<a id="SoaRecord" />
|
||||
### SoaRecord object
|
||||
| Name | Type | Required | Value |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| host | string | No | Gets or sets the domain name of the authoritative name server, without a temrinating dot. |
|
||||
| email | string | No | Gets or sets the email for this record. |
|
||||
| serialNumber | integer | No | Gets or sets the serial number for this record. |
|
||||
| refreshTime | integer | No | Gets or sets the refresh value for this record. |
|
||||
| retryTime | integer | No | Gets or sets the retry time for this record. |
|
||||
| expireTime | integer | No | Gets or sets the expire time for this record. |
|
||||
| minimumTTL | integer | No | Gets or sets the minimum TTL value for this record. |
|
||||
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче