-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Add list usages api for Microsoft.App #24833
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
rkmanda
merged 6 commits into
Azure:release-Microsoft.App-2023-05-02-preview
from
Juliehzl:user/zuh/add-usages
Jul 28, 2023
Merged
Changes from all commits
Commits
Show all changes
6 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
188 changes: 188 additions & 0 deletions
188
specification/app/resource-manager/Microsoft.App/preview/2023-05-02-preview/Usages.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,188 @@ | ||
| { | ||
| "swagger": "2.0", | ||
| "info": { | ||
| "version": "2023-05-02-preview", | ||
| "title": "ContainerApps API Client" | ||
| }, | ||
| "host": "management.azure.com", | ||
| "schemes": [ | ||
| "https" | ||
| ], | ||
| "consumes": [ | ||
| "application/json" | ||
| ], | ||
| "produces": [ | ||
| "application/json" | ||
| ], | ||
| "paths": { | ||
| "/subscriptions/{subscriptionId}/providers/Microsoft.App/locations/{location}/usages": { | ||
| "get": { | ||
| "tags": [ | ||
| "Usages" | ||
| ], | ||
| "operationId": "Usages_List", | ||
| "description": "Gets, for the specified location, the current resource usage information as well as the limits under the subscription.", | ||
| "parameters": [ | ||
| { | ||
| "name": "location", | ||
| "in": "path", | ||
| "required": true, | ||
| "type": "string", | ||
| "description": "The location for which resource usage is queried.", | ||
| "pattern": "^[-\\w\\._]+$" | ||
| }, | ||
| { | ||
| "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" | ||
| }, | ||
| { | ||
| "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" | ||
| } | ||
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "OK", | ||
| "schema": { | ||
| "$ref": "#/definitions/ListUsagesResult" | ||
| } | ||
| }, | ||
| "default": { | ||
| "description": "Common error response.", | ||
| "schema": { | ||
| "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" | ||
| } | ||
| } | ||
| }, | ||
| "x-ms-pageable": { | ||
| "nextLinkName": "nextLink" | ||
| }, | ||
| "x-ms-examples": { | ||
| "List usages": { | ||
| "$ref": "./examples/Usages_List.json" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/usages": { | ||
| "get": { | ||
| "tags": [ | ||
| "Usages" | ||
| ], | ||
| "operationId": "ManagedEnvironmentUsages_List", | ||
| "description": "Gets the current usage information as well as the limits for environment.", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" | ||
| }, | ||
| { | ||
| "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" | ||
| }, | ||
| { | ||
| "name": "environmentName", | ||
| "in": "path", | ||
| "description": "Name of the Environment.", | ||
| "required": true, | ||
| "type": "string", | ||
| "pattern": "^[-\\w\\._]+$" | ||
| }, | ||
| { | ||
| "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" | ||
| } | ||
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "OK", | ||
| "schema": { | ||
| "$ref": "#/definitions/ListUsagesResult" | ||
| } | ||
| }, | ||
| "default": { | ||
| "description": "Common error response.", | ||
| "schema": { | ||
| "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" | ||
| } | ||
| } | ||
| }, | ||
| "x-ms-pageable": { | ||
| "nextLinkName": "nextLink" | ||
| }, | ||
| "x-ms-examples": { | ||
| "List managed environment usages": { | ||
| "$ref": "./examples/ManagedEnvironmentUsages_List.json" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "definitions": { | ||
| "UsageName": { | ||
| "type": "object", | ||
| "properties": { | ||
| "value": { | ||
| "type": "string", | ||
| "description": "The name of the resource." | ||
| }, | ||
| "localizedValue": { | ||
| "type": "string", | ||
| "description": "The localized name of the resource." | ||
| } | ||
| }, | ||
| "description": "The Usage Names." | ||
| }, | ||
| "Usage": { | ||
| "type": "object", | ||
| "properties": { | ||
| "unit": { | ||
| "type": "string", | ||
| "description": "An enum describing the unit of usage measurement.", | ||
| "enum": [ | ||
| "Count" | ||
| ], | ||
| "x-ms-enum": { | ||
| "name": "UsageUnit", | ||
| "modelAsString": false | ||
| } | ||
| }, | ||
| "currentValue": { | ||
| "type": "integer", | ||
| "format": "int32", | ||
| "description": "The current usage of the resource." | ||
| }, | ||
| "limit": { | ||
| "type": "integer", | ||
| "format": "int64", | ||
| "description": "The maximum permitted usage of the resource." | ||
| }, | ||
| "name": { | ||
| "$ref": "#/definitions/UsageName", | ||
| "description": "The name of the type of usage." | ||
| } | ||
| }, | ||
| "required": [ | ||
| "unit", | ||
| "currentValue", | ||
| "limit", | ||
| "name" | ||
| ], | ||
| "description": "Describes Compute Resource Usage." | ||
| }, | ||
| "ListUsagesResult": { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Schema should have a description or title. |
||
| "type": "object", | ||
| "properties": { | ||
| "value": { | ||
| "type": "array", | ||
| "items": { | ||
| "$ref": "#/definitions/Usage" | ||
| }, | ||
| "x-ms-identifiers": [ | ||
| "name" | ||
| ], | ||
| "description": "The list of compute resource usages." | ||
| }, | ||
| "nextLink": { | ||
| "type": "string", | ||
| "description": "The URI to fetch the next page of compute resource usage information. Call ListNext() with this to fetch the next page of compute resource usage information." | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
25 changes: 25 additions & 0 deletions
25
...ager/Microsoft.App/preview/2023-05-02-preview/examples/ManagedEnvironmentUsages_List.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,25 @@ | ||
| { | ||
| "parameters": { | ||
| "api-version": "2023-05-02-preview", | ||
| "subscriptionId": "subid", | ||
| "resourceGroupName": "examplerg", | ||
| "environmentName": "jlaw-demo1" | ||
| }, | ||
| "responses": { | ||
| "200": { | ||
| "body": { | ||
| "value": [ | ||
| { | ||
| "currentValue": 5, | ||
| "limit": 10, | ||
| "name": { | ||
| "localizedValue": "Managed Environment Consumption Cores", | ||
| "value": "ManagedEnvironmentConsumptionCores" | ||
| }, | ||
| "unit": "Count" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| } |
33 changes: 33 additions & 0 deletions
33
...n/app/resource-manager/Microsoft.App/preview/2023-05-02-preview/examples/Usages_List.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,33 @@ | ||
| { | ||
| "parameters": { | ||
| "location": "westus", | ||
| "api-version": "2023-05-02-preview", | ||
| "subscriptionId": "subid" | ||
| }, | ||
| "responses": { | ||
| "200": { | ||
| "body": { | ||
| "value": [ | ||
| { | ||
| "currentValue": 5, | ||
| "limit": 10, | ||
| "name": { | ||
| "localizedValue": "ManagedEnvironmentCount", | ||
| "value": "ManagedEnvironmentCount" | ||
| }, | ||
| "unit": "Count" | ||
| }, | ||
| { | ||
| "currentValue": 3, | ||
| "limit": 20, | ||
| "name": { | ||
| "localizedValue": "ManagedEnvironmentCores", | ||
| "value": "ManagedEnvironmentCores" | ||
| }, | ||
| "unit": "Count" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| } |
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.
Just FYI, location can also be used from common types.