Skip to content

Commit

Permalink
Merge pull request #1924 from grizzlytheodore/onboard_compute
Browse files Browse the repository at this point in the history
Onboard compute for auto-generation
  • Loading branch information
anthony-c-martin authored Oct 10, 2021
2 parents 29ac59e + 6bb024f commit 09fdf2f
Show file tree
Hide file tree
Showing 70 changed files with 62,968 additions and 17,209 deletions.
11 changes: 6 additions & 5 deletions generator/autogenlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { postProcessor as resourcesPostProcessor } from './processors/Microsoft.
import { postProcessor as machineLearningPostProcessor } from './processors/Microsoft.MachineLearning';
import { postProcessor as machineLearningServicesPostProcessor } from './processors/Microsoft.MachineLearningServices';
import { postProcessor as storageProcessor } from './processors/Microsoft.Storage';
import { postProcessor as computeProcessor } from './processors/Microsoft.Compute';
import { postProcessor as policyProcessor } from './processors/Microsoft.Authorization';
import { postProcessor as securityInsightsPostProcessor } from './processors/Microsoft.SecurityInsights';
import { lowerCaseEquals } from './utils';
Expand Down Expand Up @@ -40,11 +41,6 @@ const disabledProviders: AutoGenConfig[] = [
namespace: 'Microsoft.Portal',
disabledForAutogen: true,
},
{
basePath: 'compute/resource-manager',
namespace: 'Microsoft.Compute',
disabledForAutogen: true,
},
{
basePath: 'compute/resource-manager',
namespace: 'Microsoft.ContainerService',
Expand Down Expand Up @@ -866,6 +862,11 @@ const autoGenList: AutoGenConfig[] = [
namespace: 'Microsoft.Storage',
postProcessor: storageProcessor
},
{
basePath: 'compute/resource-manager',
namespace: 'Microsoft.Compute',
postProcessor: computeProcessor
},
{
basePath: 'vmwarecloudsimple/resource-manager',
namespace: 'Microsoft.VMwareCloudSimple',
Expand Down
4 changes: 2 additions & 2 deletions generator/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface SchemaConfiguration {
relativePath: string;
}

interface SchemaReference {
export interface SchemaReference {
scope: ScopeType;
type: string;
reference: string;
Expand Down Expand Up @@ -178,7 +178,7 @@ async function generateSchemaConfig(outputFile: string, namespace: string, apiVe

let output = await readJsonFile(outputFile);
if (autoGenConfig?.postProcessor) {
autoGenConfig?.postProcessor(namespace, apiVersion, output);
await autoGenConfig?.postProcessor(namespace, apiVersion, output);

await writeJsonFile(outputFile, output);
}
Expand Down
2 changes: 1 addition & 1 deletion generator/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface AutoGenResourceConfig {
}

export interface SchemaPostProcessor {
(namespace: string, apiVersion: string, schema: any): void,
(namespace: string, apiVersion: string, schema: any): Promise<void>,
}

export interface Package {
Expand Down
2 changes: 1 addition & 1 deletion generator/processors/Microsoft.Authorization.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SchemaPostProcessor } from '../models';

export const postProcessor: SchemaPostProcessor = (_namespace: string, _apiVersion: string, schema: any) => {
export const postProcessor: SchemaPostProcessor = async (_namespace: string, _apiVersion: string, schema: any) => {
const allowedValues = schema.definitions?.ParameterDefinitionsValue?.properties?.allowedValues;
if (allowedValues && allowedValues.oneOf) {
const allowedValuesItems = allowedValues.oneOf[0]?.items
Expand Down
Loading

0 comments on commit 09fdf2f

Please sign in to comment.