forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Can now generate fleshed out storage schema
- Loading branch information
Dan Schulte
committed
May 2, 2016
1 parent
c38771d
commit 49cc5e0
Showing
14 changed files
with
1,729 additions
and
303 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/AcceptanceTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
||
using Microsoft.Rest.Generator.AzureResourceSchema; | ||
using Microsoft.Rest.Modeler.Swagger.Tests; | ||
using System.IO; | ||
using Xunit; | ||
|
||
namespace AutoRest.Generator.AzureResourceSchema.Tests | ||
{ | ||
[Collection("AutoRest Azure Resource Schema Tests")] | ||
public static class AcceptanceTests | ||
{ | ||
private static string SwaggerFile(string fileName) | ||
{ | ||
return Path.Combine("Swagger", fileName); | ||
} | ||
|
||
private static string ExpectedFolder(string folderName) | ||
{ | ||
return Path.Combine("Expected", folderName); | ||
} | ||
|
||
[Fact] | ||
public static void Storage() | ||
{ | ||
SwaggerSpecHelper.RunTests<AzureResourceSchemaCodeGenerator>( | ||
SwaggerFile("storage.json"), ExpectedFolder("Storage")); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
158 changes: 158 additions & 0 deletions
158
...ors/AzureResourceSchema/AzureResourceSchema.Tests/Expected/Storage/Microsoft.Storage.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
{ | ||
"id": "http://schema.management.azure.com/schemas/2016-01-01/Microsoft.Storage.json#", | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"title": "Microsoft.Storage", | ||
"description": "Microsoft Storage Resource Types", | ||
"resourceDefinitions": { | ||
"storageAccounts": { | ||
"type": "object", | ||
"properties": { | ||
"type": { | ||
"enum": [ | ||
"Microsoft.Storage/storageAccounts" | ||
] | ||
}, | ||
"apiVersion": { | ||
"enum": [ | ||
"2016-01-01" | ||
] | ||
}, | ||
"sku": { | ||
"$ref": "#/definitions/Sku", | ||
"description": "Required. Gets or sets the sku type." | ||
}, | ||
"kind": { | ||
"type": "string", | ||
"enum": [ | ||
"Storage", | ||
"BlobStorage" | ||
], | ||
"description": "Required. Indicates the type of storage account. Possible values include: 'Storage', 'BlobStorage'" | ||
}, | ||
"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": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"type": "string" | ||
}, | ||
"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": { | ||
"$ref": "#/definitions/StorageAccountPropertiesCreateParameters" | ||
} | ||
}, | ||
"required": [ | ||
"type", | ||
"apiVersion", | ||
"properties", | ||
"sku", | ||
"kind", | ||
"location" | ||
], | ||
"description": "Microsoft.Storage/storageAccounts" | ||
} | ||
}, | ||
"definitions": { | ||
"CustomDomain": { | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string", | ||
"description": "Gets or sets the custom domain name. Name is the CNAME source." | ||
}, | ||
"useSubDomain": { | ||
"type": "boolean", | ||
"description": "Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates" | ||
} | ||
}, | ||
"required": [ | ||
"name" | ||
], | ||
"description": "The custom domain assigned to this storage account. This can be set via Update." | ||
}, | ||
"Encryption": { | ||
"type": "object", | ||
"properties": { | ||
"services": { | ||
"$ref": "#/definitions/EncryptionServices", | ||
"description": "Gets the services which are encrypted." | ||
}, | ||
"keySource": { | ||
"type": "string", | ||
"enum": [ | ||
"Microsoft.Storage" | ||
], | ||
"description": "Gets the encryption keySource(provider). Possible values (case-insensitive): Microsoft.Storage" | ||
} | ||
}, | ||
"required": [ | ||
"keySource" | ||
], | ||
"description": "The encryption settings on the account." | ||
}, | ||
"EncryptionService": { | ||
"type": "object", | ||
"properties": { | ||
"enabled": { | ||
"type": "boolean", | ||
"description": "A boolean indicating whether or not the service is encrypted." | ||
} | ||
}, | ||
"description": "An encrypted service." | ||
}, | ||
"EncryptionServices": { | ||
"type": "object", | ||
"properties": { | ||
"blob": { | ||
"$ref": "#/definitions/EncryptionService", | ||
"description": "The blob service." | ||
} | ||
}, | ||
"description": "The encrypted services." | ||
}, | ||
"Sku": { | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string", | ||
"enum": [ | ||
"Standard_LRS", | ||
"Standard_GRS", | ||
"Standard_RAGRS", | ||
"Standard_ZRS", | ||
"Premium_LRS" | ||
], | ||
"description": "Gets or sets the sku name. Required for account creation, optional for update. Note that in older versions, sku name was called accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS'" | ||
} | ||
}, | ||
"required": [ | ||
"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'" | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.