From d3c66e8e5ec6f8d222c68e34f6e5c35a4e170f65 Mon Sep 17 00:00:00 2001 From: Samir Solanki Date: Tue, 2 Feb 2021 22:29:25 -0800 Subject: [PATCH] APIM Missing Operations reported in S360 (#12621) * missing operations * swagger linter issues * suppression * add count property * fix swagger model issues --- .../preview/2020-06-01-preview/apimapis.json | 6 ++ .../2020-06-01-preview/apimdeployment.json | 12 +++ .../apimportalsettings.json | 42 ++++++++++ .../2020-06-01-preview/apimreports.json | 48 +++++++++++ .../2020-06-01-preview/apimtenant.json | 6 ++ .../preview/2020-06-01-preview/apimusers.json | 54 +++++++++++++ .../2020-06-01-preview/definitions.json | 79 +++++++++++++++++++ .../ApiManagementGetUserSubscription.json | 26 ++++++ .../examples/ApiManagementListOperations.json | 3 +- .../ApiManagementListPortalSettings.json | 52 ++++++++++++ .../apimanagement/resource-manager/readme.md | 46 +++++++++++ 11 files changed, 372 insertions(+), 2 deletions(-) create mode 100644 specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementGetUserSubscription.json create mode 100644 specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementListPortalSettings.json diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimapis.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimapis.json index 00d996773ed7..631b2680dcb3 100644 --- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimapis.json +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimapis.json @@ -4392,6 +4392,12 @@ "schema": { "$ref": "./definitions.json#/definitions/TagResourceCollection" } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } } }, "x-ms-pageable": { diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimdeployment.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimdeployment.json index bc4aed719518..cb44776bed76 100644 --- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimdeployment.json +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimdeployment.json @@ -57,6 +57,12 @@ "schema": { "$ref": "#/definitions/OperationListResult" } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } } }, "x-ms-pageable": { @@ -528,6 +534,12 @@ "schema": { "$ref": "#/definitions/ApiManagementServiceListResult" } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } } }, "x-ms-pageable": { diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimportalsettings.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimportalsettings.json index 39535195bb23..c5e59db12b2b 100644 --- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimportalsettings.json +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimportalsettings.json @@ -34,6 +34,48 @@ } }, "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings": { + "get": { + "tags": [ + "PortalSettings" + ], + "operationId": "PortalSettings_ListByService", + "description": "Lists a collection of portalsettings defined within a service instance..", + "x-ms-examples": { + "ApiManagementListPortalSettings": { + "$ref": "./examples/ApiManagementListPortalSettings.json" + } + }, + "parameters": [ + { + "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "Lists a collection of Portal Settings entities.", + "schema": { + "$ref": "./definitions.json#/definitions/PortalSettingsCollection" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } + } + } + } + }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin": { "head": { "tags": [ diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimreports.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimreports.json index b354bcfddf3c..9aa78db0fdad 100644 --- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimreports.json +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimreports.json @@ -86,6 +86,12 @@ "schema": { "$ref": "./definitions.json#/definitions/ReportCollection" } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } } }, "x-ms-pageable": { @@ -146,6 +152,12 @@ "schema": { "$ref": "./definitions.json#/definitions/ReportCollection" } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } } }, "x-ms-pageable": { @@ -206,6 +218,12 @@ "schema": { "$ref": "./definitions.json#/definitions/ReportCollection" } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } } }, "x-ms-pageable": { @@ -266,6 +284,12 @@ "schema": { "$ref": "./definitions.json#/definitions/ReportCollection" } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } } }, "x-ms-pageable": { @@ -319,6 +343,12 @@ "schema": { "$ref": "./definitions.json#/definitions/ReportCollection" } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } } }, "x-ms-pageable": { @@ -379,6 +409,12 @@ "schema": { "$ref": "./definitions.json#/definitions/ReportCollection" } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } } }, "x-ms-pageable": { @@ -447,6 +483,12 @@ "schema": { "$ref": "./definitions.json#/definitions/ReportCollection" } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } } }, "x-ms-pageable": { @@ -500,6 +542,12 @@ "schema": { "$ref": "./definitions.json#/definitions/RequestReportCollection" } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } } }, "x-ms-pageable": { diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimtenant.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimtenant.json index c1d6edd49800..2d2116f375ea 100644 --- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimtenant.json +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimtenant.json @@ -751,6 +751,12 @@ "schema": { "$ref": "./definitions.json#/definitions/TenantConfigurationSyncStateContract" } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } } } } diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimusers.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimusers.json index e3898d921ce7..e1091999ab3f 100644 --- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimusers.json +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimusers.json @@ -570,6 +570,60 @@ "x-ms-odata": "./definitions.json#/definitions/SubscriptionContract" } }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions/{sid}": { + "get": { + "tags": [ + "Subscription" + ], + "operationId": "UserSubscription_Get", + "description": "Gets the specified Subscription entity associated with a particular user.", + "x-ms-examples": { + "ApiManagementGetUserSubscription": { + "$ref": "./examples/ApiManagementGetUserSubscription.json" + } + }, + "parameters": [ + { + "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/UserIdParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/SubscriptionEntityIdParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "The response body contains the specified Subscription entity.", + "schema": { + "$ref": "./definitions.json#/definitions/SubscriptionContract" + }, + "headers": { + "ETag": { + "description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.", + "type": "string" + } + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } + } + } + } + }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/identities": { "get": { "tags": [ diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/definitions.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/definitions.json index 85c787fa5466..5f387d609c00 100644 --- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/definitions.json +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/definitions.json @@ -619,6 +619,11 @@ "description": "Page values.", "readOnly": true }, + "count": { + "type": "integer", + "format": "int64", + "description": "Total record count number across all pages." + }, "nextLink": { "type": "string", "description": "Next page link if any.", @@ -3620,6 +3625,11 @@ }, "description": "Policy Contract value." }, + "count": { + "type": "integer", + "format": "int64", + "description": "Total record count number." + }, "nextLink": { "type": "string", "description": "Next page link if any." @@ -3711,6 +3721,7 @@ }, "scope": { "type": "integer", + "format": "int64", "description": "Binary OR value of the Snippet scope.", "readOnly": true } @@ -3771,6 +3782,69 @@ }, "description": "Delegation settings contract properties." }, + "PortalSettingsCollection": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/PortalSettingsContract" + }, + "description": "Descriptions of APIM policies." + }, + "count": { + "type": "integer", + "format": "int64", + "description": "Total record count number." + } + }, + "description": "Descriptions of APIM policies." + }, + "PortalSettingsContract": { + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/PortalSettingsContractProperties", + "description": "Portal Settings contract properties." + } + }, + "allOf": [ + { + "$ref": "./apimanagement.json#/definitions/Resource" + } + ], + "description": "Portal Settings for the Developer Portal." + }, + "PortalSettingsContractProperties": { + "properties": { + "url": { + "type": "string", + "description": "A delegation Url." + }, + "validationKey": { + "x-ms-secret": true, + "type": "string", + "description": "A base64-encoded validation key to validate, that a request is coming from Azure API Management." + }, + "subscriptions": { + "$ref": "#/definitions/SubscriptionsDelegationSettingsProperties", + "description": "Subscriptions delegation settings." + }, + "userRegistration": { + "$ref": "#/definitions/RegistrationDelegationSettingsProperties", + "description": "User registration delegation settings." + }, + "enabled": { + "type": "boolean", + "description": "Redirect Anonymous users to the Sign-In page." + }, + "termsOfService": { + "type": "object", + "$ref": "#/definitions/TermsOfServiceProperties", + "description": "Terms of service contract properties." + } + }, + "description": "Sign-in settings contract properties." + }, "PortalSigninSettingProperties": { "properties": { "enabled": { @@ -5361,6 +5435,11 @@ }, "description": "Page values." }, + "count": { + "type": "integer", + "format": "int64", + "description": "Total record count number across all pages." + }, "nextLink": { "type": "string", "description": "Next page link if any." diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementGetUserSubscription.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementGetUserSubscription.json new file mode 100644 index 000000000000..56b1e65596ae --- /dev/null +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementGetUserSubscription.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "serviceName": "apimService1", + "resourceGroupName": "rg1", + "api-version": "2020-06-01-preview", + "subscriptionId": "subid", + "userId": "1", + "sid": "5fa9b096f3df14003c070001" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1/subscriptions/5fa9b096f3df14003c070001", + "type": "Microsoft.ApiManagement/service/users/subscriptions", + "name": "5fa9b096f3df14003c070001", + "properties": { + "ownerId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1", + "scope": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/starter", + "state": "active", + "createdDate": "2020-11-09T21:11:50.58Z", + "allowTracing": true + } + } + } + } +} diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementListOperations.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementListOperations.json index fcb0daf5b206..626e102fde6f 100644 --- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementListOperations.json +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementListOperations.json @@ -52,8 +52,7 @@ "description": "Get list of operation results or Get result of a specific operation" } } - ], - "count": 5 + ] } } } diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementListPortalSettings.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementListPortalSettings.json new file mode 100644 index 000000000000..6696f2246af5 --- /dev/null +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementListPortalSettings.json @@ -0,0 +1,52 @@ +{ + "parameters": { + "serviceName": "apimService1", + "resourceGroupName": "rg1", + "api-version": "2020-06-01-preview", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/portalsettings/delegation", + "type": "Microsoft.ApiManagement/service/portalsettings", + "name": "delegation", + "properties": { + "subscriptions": { + "enabled": false + }, + "userRegistration": { + "enabled": false + }, + "enabled": false + } + }, + { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/portalsettings/signin", + "type": "Microsoft.ApiManagement/service/portalsettings", + "name": "signin", + "properties": { + "enabled": false + } + }, + { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/portalsettings/signup", + "type": "Microsoft.ApiManagement/service/portalsettings", + "name": "signup", + "properties": { + "enabled": true, + "termsOfService": { + "text": "Terms of service", + "enabled": false, + "consentRequired": false + } + } + } + ], + "count": 3 + } + } + } +} diff --git a/specification/apimanagement/resource-manager/readme.md b/specification/apimanagement/resource-manager/readme.md index 4931f59ff409..083fc7ffe665 100644 --- a/specification/apimanagement/resource-manager/readme.md +++ b/specification/apimanagement/resource-manager/readme.md @@ -426,3 +426,49 @@ See configuration in [readme.java.md](./readme.java.md) See configuration in [readme.azureresourceschema.md](./readme.azureresourceschema.md) + +## Suppression + +``` yaml +directive: + - suppress: R4009 + from: apimapis.json + reason: Warning raised to error while PR was being reviewed. SystemData will implement in next preview version. + - suppress: R4009 + from: apimapiversionsets.json + reason: Warning raised to error while PR was being reviewed. SystemData will implement in next preview version. + - suppress: R4009 + from: apimauthorizationservers.json + reason: Warning raised to error while PR was being reviewed. SystemData will implement in next preview version. + - suppress: R4009 + from: apimbackends.json + reason: Warning raised to error while PR was being reviewed. SystemData will implement in next preview version. + - suppress: R4009 + from: apimbackends.json + reason: Warning raised to error while PR was being reviewed. SystemData will implement in next preview version. + - suppress: R4009 + from: apimcaches.json + reason: Warning raised to error while PR was being reviewed. SystemData will implement in next preview version. + - suppress: R4009 + from: apimcertificates.json + reason: Warning raised to error while PR was being reviewed. SystemData will implement in next preview version. + - suppress: R4009 + from: apimdeployment.json + reason: Warning raised to error while PR was being reviewed. SystemData will implement in next preview version. + - suppress: R4009 + from: apimsubscriptions.json + reason: Warning raised to error while PR was being reviewed. SystemData will implement in next preview version. + - suppress: R4009 + from: apimusers.json + reason: Warning raised to error while PR was being reviewed. SystemData will implement in next preview version. + - suppress: R4009 + from: apimproducts.json + reason: Warning raised to error while PR was being reviewed. SystemData will implement in next preview version. + - suppress: R4009 + from: apimnamedvalues.json + reason: Warning raised to error while PR was being reviewed. SystemData will implement in next preview version. + - suppress: R4009 + from: apimusers.json + reason: Warning raised to error while PR was being reviewed. SystemData will implement in next preview version. +``` +