Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swagger change for listing virtual machines in a subscription by location #3958

Closed
wants to merge 10 commits into from
  •  
  •  
  •  
25 changes: 7 additions & 18 deletions scripts/momentOfTruthPostProcessing.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

const fs = require('fs'),
utils = require('../test/util/utils'),
path = require('path'),
gitHubPost = require('./postToGitHub');
path = require('path');

let pullRequestNumber = utils.getPullRequestNumber();
let targetBranch = utils.getTargetBranch();
Expand All @@ -32,7 +31,7 @@ let githubFooter = `[AutoRest Linter Guidelines](https://github.com/Azure/azure-
`\n\nThanks for your co-operation.`;

let fileSummaryHeader = (file_name, file_href) => `## Config file: [${file_name}](${file_href})\n`;
let fileSummaryNewTemplate = (issue_type, issue_count, issue_table) => `<details><summary><h3 style="display: inline"><a name="${issue_type.replace(/\s/g, "-")}s"></a>${iconFor(issue_type)} ${issue_count} new ${pluralize(issue_type, issue_count)}</h3></summary><br>\n\n${issue_table}\n</details>`;
let fileSummaryNewTemplate = (issue_type, issue_count, issue_table) => `### <a name="${issue_type.replace(/\s/g, "-")}s"></a>${iconFor(issue_type)} ${issue_count} new ${pluralize(issue_type, issue_count)}\n\n${issue_table}\n`;
let fileSummaryExistingTemplate = (issue_type, issue_count, issue_table) => `<details><summary>${iconFor(issue_type)} ${issue_count} existing ${pluralize(issue_type, issue_count)}</summary><br>\n\n${issue_table}\n</details>\n\n`;

let potentialNewWarningErrorSummaryHeader = `
Expand Down Expand Up @@ -66,10 +65,7 @@ try {
}

function compareJsonRef(beforeJsonRef, afterJsonRef) {
beforeJsonRef = beforeJsonRef.replace(/.*\.json:\d+:\d+/, '')
afterJsonRef = afterJsonRef.replace(/.*\.json:\d+:\d+/, '')

return (beforeJsonRef == afterJsonRef);
return (beforeJsonRef.replace(/json:\d+:\d+/, '') == afterJsonRef.replace(/json:\d+:\d+/, ''));
}

function getOutputMessages(newSDKErrorsCount, newARMErrorsCount, newSDKWarningsCount, newARMWarningsCount) {
Expand Down Expand Up @@ -300,15 +296,15 @@ function postProcessing() {

let beforeErrorsAndWarningsArray = jsonData['files'][fileName]['before'];
beforeErrorsAndWarningsArray.forEach(beforeErrorOrWarning => {
if(beforeErrorOrWarning.type != undefined && beforeErrorOrWarning.type.toLowerCase() == 'warning'){
if(beforeErrorOrWarning.type.toLowerCase() == 'warning'){
if(beforeErrorOrWarning.validationCategory.toLowerCase() == 'sdkviolation') {
beforeWarningsSDKArray.push(beforeErrorOrWarning);
} else {
beforeWarningsARMArray.push(beforeErrorOrWarning);
}
}

if(beforeErrorOrWarning.type != undefined && beforeErrorOrWarning.type.toLowerCase() == 'error'){
if(beforeErrorOrWarning.type.toLowerCase() == 'error'){
if(beforeErrorOrWarning.validationCategory.toLowerCase() == 'sdkviolation') {
beforeErrorsSDKArray.push(beforeErrorOrWarning);
} else {
Expand All @@ -319,15 +315,15 @@ function postProcessing() {

let afterErrorsAndWarningsArray = jsonData['files'][fileName]['after'];
afterErrorsAndWarningsArray.forEach(afterErrorOrWarning => {
if(afterErrorOrWarning.type != undefined && afterErrorOrWarning.type.toLowerCase() == 'warning'){
if(afterErrorOrWarning.type.toLowerCase() == 'warning'){
if(afterErrorOrWarning.validationCategory.toLowerCase() == 'sdkviolation') {
afterWarningsSDKArray.push(afterErrorOrWarning);
} else {
afterWarningsARMArray.push(afterErrorOrWarning);
}
}

if(afterErrorOrWarning.type != undefined && afterErrorOrWarning.type.toLowerCase() == 'error'){
if(afterErrorOrWarning.type.toLowerCase() == 'error'){
if(afterErrorOrWarning.validationCategory.toLowerCase() == 'sdkviolation') {
afterErrorsSDKArray.push(afterErrorOrWarning);
} else {
Expand Down Expand Up @@ -360,7 +356,6 @@ function postProcessing() {
console.log("Existing ARM Errors: ", existingARMErrors.length);
console.log("Existing ARM Warnings: ", existingARMWarnings.length);
console.log();

if (newSDKErrors.length > 0) {
console.log(`Potential new SDK errors`)
console.log("========================");
Expand Down Expand Up @@ -408,12 +403,6 @@ function postProcessing() {
console.log(JSON.stringify(output, null, 2));
console.log("---");

if(process.env.TRAVIS_REPO_SLUG != undefined && process.env.TRAVIS_REPO_SLUG.endsWith("-pr")) {
let slug = process.env.TRAVIS_REPO_SLUG;
slug = slug.split("/")[1];
gitHubPost.postGithubComment("Azure", slug, pullRequestNumber, output.text);
}

if (newSDKErrorsCount > 0 || newARMErrorsCount > 0) {
process.exitCode = 1;
}
Expand Down
29 changes: 0 additions & 29 deletions scripts/postToGitHub.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,6 @@
"schema": {
"$ref": "#/definitions/ApiManagementServiceResource"
}
},
"202": {
"description": "Accepted",
"schema": {
"$ref": "#/definitions/ApiManagementServiceResource"
}
}
},
"x-ms-long-running-operation": true
Expand Down Expand Up @@ -1395,4 +1389,4 @@
}
},
"parameters": {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"resourceGroupName": "rg1",
"api-version": "2017-03-01",
"subscriptionId": "subid",
"parameters": {
"parameters": {
"location": "Central US",
"sku": {
"name": "Premium",
Expand Down Expand Up @@ -206,85 +206,6 @@
"capacity": 1
}
}
},
"202": {
"body": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
"name": "apimService1",
"type": "Microsoft.ApiManagement/service",
"tags": {},
"location": "Central US",
"etag": "AAAAAAAXXwI=",
"properties": {
"publisherEmail": "admin@live.com",
"publisherName": "contoso",
"provisioningState": "Succeeded",
"targetProvisioningState": "",
"createdAtUtc": "2017-05-30T19:00:47.1121713Z",
"gatewayUrl": "https://apimService1.azure-api.net",
"portalUrl": "https://apimService1.portal.azure-api.net",
"managementApiUrl": "https://apimService1.management.azure-api.net",
"scmUrl": "https://apimService1.scm.azure-api.net",
"hostnameConfigurations": [
{
"type": "Proxy",
"hostName": "proxyhostname1.contoso.com",
"negotiateClientCertificate": false,
"certificate": {
"expiry": "2018-03-17T21:55:07+00:00",
"thumbprint": "918D7785B926AC5AEE66322778A147BCE7237CF3",
"subject": "CN=proxyhostname1.contoso.com"
}
},
{
"type": "Proxy",
"hostName": "proxyhostname2.contoso.com",
"negotiateClientCertificate": true,
"certificate": {
"expiry": "2018-03-17T21:55:07+00:00",
"thumbprint": "918D7785B926AC5AEE66322778A147BCE7237CF3",
"subject": "CN=proxyhostname2.contoso.com"
}
},
{
"type": "Portal",
"hostName": "portalhostname1.contoso.com",
"negotiateClientCertificate": false,
"certificate": {
"expiry": "2018-03-17T21:55:07+00:00",
"thumbprint": "918D7785B926AC5AEE66322778A147BCE7237CF3",
"subject": "CN=portalhostname1.contoso.com"
}
}
],
"staticIps": [
"52.173.193.207"
],
"additionalLocations": [
{
"location": "West US",
"sku": {
"name": "Premium",
"capacity": 1
},
"staticIps": [
"104.210.41.234"
],
"virtualNetworkConfiguration": {
"subnetResourceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/westUsVirtualNetwork/subnets/apimSubnet"
}
}
],
"virtualNetworkConfiguration": {
"subnetResourceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/centralUsVirtualNetwork/subnets/apimSubnet"
},
"virtualNetworkType": "External"
},
"sku": {
"name": "Premium",
"capacity": 1
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,35 +72,6 @@
"capacity": 1
}
}
},
"202": {
"body": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
"name": "apimService1",
"type": "Microsoft.ApiManagement/service",
"tags": {},
"location": "West US",
"etag": "AAAAAAAV8XM=",
"properties": {
"publisherEmail": "admin@live.com",
"publisherName": "Contoso",
"provisioningState": "Succeeded",
"targetProvisioningState": "",
"createdAtUtc": "2015-09-22T01:52:02.4307221Z",
"gatewayUrl": "https://apimService1.azure-api.net",
"portalUrl": "https://apimService1.portal.azure-api.net",
"managementApiUrl": "https://apimService1.management.azure-api.net",
"scmUrl": "https://apimService1.scm.azure-api.net",
"staticIps": [
"xx.xx.250.222"
],
"virtualNetworkType": "None"
},
"sku": {
"name": "Premium",
"capacity": 1
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,35 +81,6 @@
"tenantId": "72f988bf-xxxx-41af-xxxx-2d7cd011db47"
}
}
},
"202": {
"headers": {
"location": "https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/dGVjaGVkX01hbmFnZVJvbGVfNWRiNGI3Ng==?api-version=2017-03-01"
},
"body": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
"name": "apimService1",
"type": "Microsoft.ApiManagement/service",
"location": "Japan East",
"etag": "AAAAAAC268k=",
"properties": {
"publisherEmail": "admin@contoso.com",
"publisherName": "Contoso",
"notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
"provisioningState": "Created",
"targetProvisioningState": "Activating",
"createdAtUtc": "2017-10-27T23:41:41.7231779Z"
},
"sku": {
"name": "Developer",
"capacity": 1
},
"identity": {
"type": "SystemAssigned",
"principalId": "f4b0f1c2-xxxx-43db-xxxx-ccd99e1afd22",
"tenantId": "72f988bf-xxxx-41af-xxxx-2d7cd011db47"
}
}
}
}
}
}
1 change: 0 additions & 1 deletion specification/authorization/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ swagger-to-sdk:
- repo: azure-sdk-for-java
- repo: azure-sdk-for-go
- repo: azure-sdk-for-node
- repo: azure-sdk-for-js
- repo: azure-sdk-for-ruby
after_scripts:
- bundle install && rake arm:regen_all_profiles['azure_mgmt_authorization']
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"200": {
"description": "OK",
"schema": {
"type": "file"
"type": "string"
}
},
"default": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
"parameters": {
"subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23",
"location": "local",
"api-version": "2016-05-01"
"api-version": "2016-05-01",
"reportedStartTime": "2017-08-01T00:00:00.00Z",
"reportedEndTime": "2017-08-02T00:00:00.00Z",
"aggregationGranularity": "",
"subscriberId": "",
"continuationToken": ""
},
"responses": {
"200": {
Expand Down
Loading