-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Swagger changes for new Predict API in Advisor RP #18168
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
...esource-manager/Microsoft.Advisor/preview/2022-02-01-preview/examples/OperationsList.json
This file contains hidden or 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,21 @@ | ||
| { | ||
| "parameters": { | ||
| "api-version": "2022-02-01-preview" | ||
| }, | ||
| "responses": { | ||
| "200": { | ||
| "body": { | ||
| "value": [ | ||
| { | ||
| "name": "Microsoft.Advisor/prediction", | ||
| "display": { | ||
| "provider": "Microsoft Advisor", | ||
| "resource": "Prediction", | ||
| "description": "Predicts a recommendation." | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| } |
46 changes: 46 additions & 0 deletions
46
...visor/resource-manager/Microsoft.Advisor/preview/2022-02-01-preview/examples/Predict.json
This file contains hidden or 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,46 @@ | ||
| { | ||
| "parameters": { | ||
| "subscriptionId": "subscriptionId", | ||
| "predictionRequest": { | ||
| "properties": { | ||
| "predictionType": "PredictiveRightsizing", | ||
| "extendedProperties": { | ||
| "region": "CentralUS", | ||
| "deploymentType": "Linux_IaaS_Software_Store", | ||
| "sku": "Standard_Dv4", | ||
| "type": "iaas", | ||
| "numberOfInstances": 10 | ||
| } | ||
| } | ||
| }, | ||
| "api-version": "2022-02-01-preview" | ||
| }, | ||
| "responses": { | ||
| "200": { | ||
| "body": { | ||
| "properties": { | ||
| "predictionType": "PredictiveRightsizing", | ||
| "extendedProperties": { | ||
| "region": "CentralUS", | ||
| "deploymentType": "Linux_IaaS_Software_Store", | ||
| "sku": "Standard_Dv4", | ||
| "type": "iaas", | ||
| "numberOfInstances": 10, | ||
| "prediction": { | ||
| "recommendedSku": "Standard_Dv2", | ||
| "numberOfInstances": 8, | ||
| "confidence": 0.9 | ||
| } | ||
| }, | ||
| "category": "Cost", | ||
| "impact": "Low", | ||
| "impactedField": "Microsoft.Compute/virtualMachines", | ||
| "lastUpdated": "2022-02-14T14:47:18.436Z", | ||
| "shortDescription": { | ||
| "solution": "We recommend using 8 instances of type Standard_Dv2." | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
297 changes: 297 additions & 0 deletions
297
.../resource-manager/Microsoft.Advisor/preview/2022-02-01-preview/predictRecommendation.json
This file contains hidden or 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,297 @@ | ||
| { | ||
| "swagger": "2.0", | ||
| "info": { | ||
| "version": "2022-02-01-preview", | ||
| "title": "AdvisorManagementClient", | ||
| "description": "REST APIs for Azure Advisor" | ||
| }, | ||
| "host": "management.azure.com", | ||
| "schemes": [ | ||
| "https" | ||
| ], | ||
| "consumes": [ | ||
| "application/json" | ||
| ], | ||
| "produces": [ | ||
| "application/json" | ||
| ], | ||
| "paths": { | ||
| "/providers/Microsoft.Advisor/operations": { | ||
| "get": { | ||
| "tags": [ | ||
| "Operations" | ||
| ], | ||
| "description": "Lists all the available Advisor REST API operations.", | ||
| "operationId": "Operations_List", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "#/parameters/apiVersionParameter" | ||
| } | ||
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "OK. Successfully retrieved operation list.", | ||
| "schema": { | ||
| "$ref": "#/definitions/OperationEntityListResult" | ||
| } | ||
| }, | ||
| "default": { | ||
| "description": "Error response describing why the operation failed.", | ||
| "schema": { | ||
| "$ref": "#/definitions/ArmErrorResponse" | ||
| } | ||
| } | ||
| }, | ||
| "deprecated": false, | ||
| "x-ms-pageable": { | ||
| "nextLinkName": "nextLink" | ||
| }, | ||
| "x-ms-examples": { | ||
| "OperationsList": { | ||
| "$ref": "./examples/OperationsList.json" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/predict": { | ||
| "post": { | ||
| "tags": [ | ||
| "Prediction" | ||
| ], | ||
| "summary": "Predicts a recommendation.", | ||
| "operationId": "Predict", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "#/parameters/subscriptionIdParameter" | ||
| }, | ||
| { | ||
| "name": "predictionRequest", | ||
| "in": "body", | ||
| "description": "Parameters for predict recommendation.", | ||
| "required": true, | ||
| "schema": { | ||
| "$ref": "#/definitions/PredictionRequest" | ||
| } | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/apiVersionParameter" | ||
| } | ||
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "OK. Successfully obtained prediction.", | ||
| "schema": { | ||
| "$ref": "#/definitions/PredictionResponse" | ||
| } | ||
| }, | ||
| "default": { | ||
| "description": "Error response describing why the operation failed.", | ||
| "schema": { | ||
| "$ref": "#/definitions/ArmErrorResponse" | ||
| } | ||
| } | ||
| }, | ||
| "deprecated": false, | ||
| "x-ms-examples": { | ||
| "Predict": { | ||
| "$ref": "./examples/Predict.json" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "definitions": { | ||
| "ArmErrorResponse": { | ||
| "type": "object", | ||
| "properties": { | ||
| "error": { | ||
| "$ref": "#/definitions/ARMErrorResponseBody" | ||
| } | ||
| } | ||
| }, | ||
| "ARMErrorResponseBody": { | ||
| "description": "ARM error response body.", | ||
| "type": "object", | ||
| "properties": { | ||
| "message": { | ||
| "description": "Gets or sets the string that describes the error in detail and provides debugging information.", | ||
| "type": "string" | ||
| }, | ||
| "code": { | ||
| "description": "Gets or sets the string that can be used to programmatically identify the error.", | ||
| "type": "string" | ||
| } | ||
| } | ||
| }, | ||
| "ShortDescription": { | ||
| "description": "A summary of the recommendation.", | ||
| "type": "object", | ||
| "properties": { | ||
| "solution": { | ||
| "description": "The remediation action suggested by the recommendation.", | ||
| "type": "string" | ||
| } | ||
| } | ||
| }, | ||
| "OperationEntityListResult": { | ||
| "description": "The list of Advisor operations.", | ||
| "type": "object", | ||
| "properties": { | ||
| "nextLink": { | ||
| "description": "The link used to get the next page of operations.", | ||
| "type": "string" | ||
| }, | ||
| "value": { | ||
| "description": "The list of operations.", | ||
| "type": "array", | ||
| "items": { | ||
| "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/Operation" | ||
| }, | ||
| "x-ms-identifiers": [ | ||
| "name" | ||
| ] | ||
| } | ||
| } | ||
| }, | ||
| "PredictionRequest": { | ||
| "description": "Parameters for predict recommendation.", | ||
| "type": "object", | ||
| "properties": { | ||
| "properties": { | ||
| "$ref": "#/definitions/PredictionRequestProperties", | ||
| "description": "Request properties for prediction recommendation.", | ||
| "x-ms-client-flatten": true | ||
| } | ||
| } | ||
| }, | ||
| "PredictionRequestProperties": { | ||
| "description": "Properties given for the predictor.", | ||
| "type": "object", | ||
| "properties": { | ||
| "predictionType": { | ||
| "description": "Type of the prediction.", | ||
| "enum": [ | ||
| "PredictiveRightsizing" | ||
| ], | ||
| "type": "string", | ||
| "x-ms-enum": { | ||
| "name": "predictionType", | ||
| "modelAsString": true | ||
| } | ||
| }, | ||
| "extendedProperties": { | ||
| "description": "Extended properties are arguments specific for each prediction type.", | ||
| "type": "object" | ||
| } | ||
| } | ||
| }, | ||
| "PredictionResponse": { | ||
| "description": "Response used by predictions.", | ||
| "type": "object", | ||
| "properties": { | ||
| "properties": { | ||
| "$ref": "#/definitions/PredictionResponseProperties", | ||
| "description": "The properties of the prediction.", | ||
| "x-ms-client-flatten": true | ||
| } | ||
| }, | ||
| "x-ms-azure-resource": true | ||
| }, | ||
| "PredictionResponseProperties": { | ||
| "description": "Properties of the prediction", | ||
| "type": "object", | ||
| "properties": { | ||
| "extendedProperties": { | ||
| "description": "Extended properties", | ||
| "type": "object" | ||
| }, | ||
| "predictionType": { | ||
| "description": "Type of the prediction.", | ||
| "enum": [ | ||
| "PredictiveRightsizing" | ||
| ], | ||
| "type": "string", | ||
| "x-ms-enum": { | ||
| "name": "predictionType", | ||
| "modelAsString": true | ||
| } | ||
| }, | ||
| "category": { | ||
| "description": "The category of the recommendation.", | ||
| "enum": [ | ||
| "HighAvailability", | ||
| "Security", | ||
| "Performance", | ||
| "Cost", | ||
| "OperationalExcellence" | ||
| ], | ||
| "type": "string", | ||
| "x-ms-enum": { | ||
| "name": "category", | ||
| "modelAsString": true | ||
| } | ||
| }, | ||
| "impact": { | ||
| "description": "The business impact of the recommendation.", | ||
| "enum": [ | ||
| "High", | ||
| "Medium", | ||
| "Low" | ||
| ], | ||
| "type": "string", | ||
| "x-ms-enum": { | ||
| "name": "impact", | ||
| "modelAsString": true | ||
| } | ||
| }, | ||
| "impactedField": { | ||
| "description": "The resource type identified by Advisor.", | ||
| "type": "string" | ||
| }, | ||
| "lastUpdated": { | ||
| "format": "date-time", | ||
| "description": "The most recent time that Advisor checked the validity of the recommendation.", | ||
| "type": "string" | ||
| }, | ||
| "shortDescription": { | ||
| "$ref": "#/definitions/ShortDescription", | ||
| "description": "A summary of the recommendation." | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "parameters": { | ||
| "subscriptionIdParameter": { | ||
| "name": "subscriptionId", | ||
| "in": "path", | ||
| "description": "The Azure subscription ID.", | ||
| "required": true, | ||
| "type": "string" | ||
| }, | ||
| "apiVersionParameter": { | ||
| "name": "api-version", | ||
| "in": "query", | ||
| "description": "The version of the API to be used with the client request.", | ||
| "required": true, | ||
| "type": "string" | ||
| } | ||
| }, | ||
| "securityDefinitions": { | ||
| "azure_auth": { | ||
| "type": "oauth2", | ||
| "description": "Azure Active Directory OAuth2 Flow.", | ||
| "flow": "implicit", | ||
| "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", | ||
| "scopes": { | ||
| "user_impersonation": "impersonate your user account" | ||
| } | ||
| } | ||
| }, | ||
| "security": [ | ||
| { | ||
| "azure_auth": [ | ||
| "user_impersonation" | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make these explicit rather than free form object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be a generic API that can be used to make different predictions. Each prediction might require a different set of arguments and, because of that, we are having this free-form object here.