Skip to content

Commit

Permalink
Storage, Batch, and CDN schemas generating
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Schulte committed May 9, 2016
1 parent c4c32d2 commit 42cd603
Show file tree
Hide file tree
Showing 15 changed files with 1,462 additions and 353 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
<Compile Include="AzureResourceSchemaCodeGeneratorTests.cs" />
<Compile Include="JSONSchemaTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ResourceSchemaParserTests.cs" />
<Compile Include="ResourceSchemaWriterTests.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\AutoRest.Core\AutoRest.Core.csproj">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,8 @@ public async void GenerateWithEmptyServiceClient()
{
await TestGenerate(null, new string[0],
@"{
""id"": null,
""$schema"": ""http://json-schema.org/draft-04/schema#"",
""title"": null,
""description"": null,
""resourceDefinitions"": { }
}");
""$schema"": ""http://json-schema.org/draft-04/schema#""
}");
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@
"description": "The user specified tags associated with the account."
},
"properties": {
"autoStorage": {
"$ref": "#/definitions/AutoStorageBaseProperties",
"description": "The properties related to auto storage account."
}
"$ref": "#/definitions/AccountBaseProperties",
"description": "The properties of the account."
}
},
"required": [
Expand All @@ -46,6 +44,16 @@
}
},
"definitions": {
"AccountBaseProperties": {
"type": "object",
"properties": {
"autoStorage": {
"$ref": "#/definitions/AutoStorageBaseProperties",
"description": "The properties related to auto storage account."
}
},
"description": "The properties of a Batch account."
},
"AutoStorageBaseProperties": {
"type": "object",
"properties": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,7 @@
]
},
"properties": {
"type": "object",
"properties": {
"hostName": {
"type": "string",
"description": "The host name of the custom domain. Must be a domain name."
}
},
"required": [
"hostName"
]
"$ref": "#/definitions/CustomDomainPropertiesParameters"
}
},
"required": [
Expand Down Expand Up @@ -66,55 +57,7 @@
"description": "Endpoint tags"
},
"properties": {
"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": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of content types on which compression will be applied. The value for the elements should be a valid MIME type."
},
"isCompressionEnabled": {
"type": "boolean",
"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": {
"type": "boolean",
"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": {
"type": "boolean",
"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": {
"type": "string",
"enum": [
"IgnoreQueryString",
"BypassCaching",
"UseQueryString",
"NotSet"
],
"description": "Defines the query string caching behavior. Possible values include: 'IgnoreQueryString', 'BypassCaching', 'UseQueryString', 'NotSet'"
},
"origins": {
"type": "array",
"items": {
"$ref": "#/definitions/DeepCreatedOrigin"
}
}
},
"required": [
"origins"
]
"$ref": "#/definitions/EndpointPropertiesCreateParameters"
}
},
"required": [
Expand All @@ -141,42 +84,27 @@
]
},
"properties": {
"type": "object",
"properties": {
"hostName": {
"type": "string",
"description": "The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported."
},
"httpPort": {
"type": "integer",
"description": "The value of the HTTP port. Must be between 1 and 65535."
},
"httpsPort": {
"type": "integer",
"description": "The value of the HTTPS port. Must be between 1 and 65535."
}
},
"required": [
"hostName"
]
"$ref": "#/definitions/OriginPropertiesParameters"
}
},
"required": [
"type",
"apiVersion",
"properties"
],
"description": "Microsoft.Cdn/profiles.endpoints/origins"
"description": "Microsoft.Cdn/profiles/endpoints/origins"
},
"profiles": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"Microsoft.Cdn/profiles"
]
},
"apiVersion": {
"type": "string",
"enum": [
"2016-04-02"
]
Expand All @@ -200,21 +128,44 @@
"required": [
"type",
"apiVersion",
"properties",
"location",
"sku"
],
"description": "Microsoft.Cdn/profiles"
}
},
"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": {
"$ref": "#/definitions/DeepCreatedOriginProperties"
}
},
"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."
Expand All @@ -229,10 +180,73 @@
}
},
"required": [
"name",
"hostName"
],
"description": "Deep created origins within a CDN endpoint."
"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": {
"type": "array"
},
"isCompressionEnabled": {
"type": "boolean",
"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": {
"type": "boolean",
"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": {
"type": "boolean",
"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": {
"type": "string",
"enum": [
"IgnoreQueryString",
"BypassCaching",
"UseQueryString",
"NotSet"
],
"description": "Defines the query string caching behavior. Possible values include: 'IgnoreQueryString', 'BypassCaching', 'UseQueryString', 'NotSet'"
},
"origins": {
"type": "array"
}
},
"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": {
"type": "integer",
"description": "The value of the HTTP port. Must be between 1 and 65535."
},
"httpsPort": {
"type": "integer",
"description": "The value of the HTTPS port. Must be between 1 and 65535."
}
},
"required": [
"hostName"
]
},
"Sku": {
"type": "object",
Expand All @@ -245,20 +259,10 @@
"Custom_Verizon",
"Standard_Akamai"
],
"description": "Name of the pricing tier"
"description": "Name of the pricing tier. Possible values include: 'Standard_Verizon', 'Premium_Verizon', 'Custom_Verizon', 'Standard_Akamai'"
}
},
"description": "The SKU (pricing tier) of the CDN profile."
},
"QueryStringCachingBehavior": {
"type": "string",
"enum": [
"IgnoreQueryString",
"BypassCaching",
"UseQueryString",
"NotSet"
],
"description": "Defines the query string caching behavior."
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,7 @@
"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": {
"customDomain": {
"$ref": "#/definitions/CustomDomain",
"description": "User domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property."
},
"encryption": {
"$ref": "#/definitions/Encryption",
"description": "Provides the encryption settings on the account. If left unspecified the account encryption settings will remain. The default setting is unencrypted."
},
"accessTier": {
"type": "string",
"enum": [
"Hot",
"Cool"
],
"description": "Required for StandardBlob accounts. The access tier used for billing. Access tier cannot be changed more than once every 7 days (168 hours). Access tier cannot be set for StandardLRS, StandardGRS, StandardRAGRS, or PremiumLRS account types. Possible values include: 'Hot', 'Cool'"
}
"$ref": "#/definitions/StorageAccountPropertiesCreateParameters"
}
},
"required": [
Expand Down Expand Up @@ -149,6 +134,27 @@
"name"
],
"description": "The SKU of the storage account."
},
"StorageAccountPropertiesCreateParameters": {
"type": "object",
"properties": {
"customDomain": {
"$ref": "#/definitions/CustomDomain",
"description": "User domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property."
},
"encryption": {
"$ref": "#/definitions/Encryption",
"description": "Provides the encryption settings on the account. If left unspecified the account encryption settings will remain. The default setting is unencrypted."
},
"accessTier": {
"type": "string",
"enum": [
"Hot",
"Cool"
],
"description": "Required for StandardBlob accounts. The access tier used for billing. Access tier cannot be changed more than once every 7 days (168 hours). Access tier cannot be set for StandardLRS, StandardGRS, StandardRAGRS, or PremiumLRS account types. Possible values include: 'Hot', 'Cool'"
}
}
}
}
}
Loading

0 comments on commit 42cd603

Please sign in to comment.