Skip to content

Commit

Permalink
Added Swagger Doc for Settings API (Azure#13241)
Browse files Browse the repository at this point in the history
  • Loading branch information
omrodrig authored Mar 3, 2021
1 parent 6328731 commit 281b9df
Show file tree
Hide file tree
Showing 6 changed files with 319 additions and 0 deletions.
1 change: 1 addition & 0 deletions custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,7 @@ mypath
mypicture
mypictures
myregistry
myscope
myshopify
mysite
mysquare
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,167 @@
}
},
"paths": {
"/providers/Microsoft.CostManagement/settings": {
"get": {
"tags": [
"Settings"
],
"operationId": "Settings_List",
"description": "Lists all of the settings that have been customized.",
"externalDocs": {
"url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/"
},
"x-ms-examples": {
"SettingList": {
"$ref": "./examples/SettingsList.json"
}
},
"parameters": [
{
"$ref": "#/parameters/apiVersionParameter"
}
],
"responses": {
"200": {
"description": "OK. The request has succeeded.",
"schema": {
"$ref": "#/definitions/SettingsListResult"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
},
"/providers/Microsoft.CostManagement/settings/{settingName}": {
"get": {
"tags": [
"Settings"
],
"operationId": "Settings_Get",
"description": "Retrieves the current value for a specific setting.",
"externalDocs": {
"url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/"
},
"x-ms-examples": {
"Settings": {
"$ref": "./examples/Setting.json"
}
},
"parameters": [
{
"$ref": "#/parameters/apiVersionParameter"
},
{
"$ref": "#/parameters/settingNameParameter"
}
],
"responses": {
"200": {
"description": "OK. The request has succeeded.",
"schema": {
"$ref": "#/definitions/Setting"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
}
},
"put": {
"tags": [
"Settings"
],
"operationId": "Settings_CreateOrUpdate",
"description": "Sets a new value for a specific setting.",
"externalDocs": {
"url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/"
},
"x-ms-examples": {
"CreateOrUpdateSetting": {
"$ref": "./examples/SettingsCreateOrUpdate.json"
}
},
"parameters": [
{
"$ref": "#/parameters/apiVersionParameter"
},
{
"$ref": "#/parameters/settingNameParameter"
},
{
"name": "parameters",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/Setting"
},
"description": "Body supplied to the CreateOrUpdate setting operation."
}
],
"responses": {
"200": {
"description": "OK. The request has succeeded.",
"schema": {
"$ref": "#/definitions/Setting"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
}
},
"delete": {
"tags": [
"Settings"
],
"operationId": "Settings_Delete",
"description": "Remove the current value for a specific setting and reverts back to the default value, if applicable.",
"externalDocs": {
"url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/"
},
"x-ms-examples": {
"DeleteSetting": {
"$ref": "./examples/SettingsDelete.json"
}
},
"parameters": [
{
"$ref": "#/parameters/apiVersionParameter"
},
{
"$ref": "#/parameters/settingNameParameter"
}
],
"responses": {
"200": {
"description": "OK. The request has succeeded."
},
"204": {
"description": "OK. The request has succeeded, no content returned."
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
}
}
},
"/providers/Microsoft.CostManagement/views": {
"get": {
"tags": [
Expand Down Expand Up @@ -1547,6 +1708,42 @@
"values"
]
},
"SettingsListResult": {
"description": "Result of listing settings. It contains a list of available settings.",
"type": "object",
"properties": {
"value": {
"description": "The list of settings.",
"type": "array",
"readOnly": true,
"items": {
"$ref": "#/definitions/Setting"
},
"maxItems": 10
},
"nextLink": {
"description": "The link (url) to the next page of results.",
"type": "string",
"readOnly": true
}
}
},
"Setting": {
"description": "State of Setting",
"type": "object",
"allOf": [
{
"$ref": "#/definitions/ProxySettingResource"
}
],
"properties": {
"properties": {
"x-ms-client-flatten": true,
"$ref": "#/definitions/SettingsProperties",
"title": "Setting properties"
}
}
},
"ViewListResult": {
"description": "Result of listing views. It contains a list of available views.",
"type": "object",
Expand Down Expand Up @@ -1582,6 +1779,16 @@
}
}
},
"SettingsProperties": {
"type": "object",
"description": "The properties of the setting.",
"properties": {
"scope": {
"description": "For the myscope setting, sets the default scope the current user will see when they sign into Azure Cost Management in the Azure portal.",
"type": "string"
}
}
},
"ViewProperties": {
"type": "object",
"description": "The properties of the view.",
Expand Down Expand Up @@ -1780,6 +1987,33 @@
},
"x-ms-azure-resource": true
},
"ProxySettingResource": {
"description": "The Resource model definition.",
"properties": {
"id": {
"readOnly": true,
"type": "string",
"description": "Resource Id"
},
"name": {
"readOnly": true,
"type": "string",
"description": "Resource name"
},
"kind": {
"readOnly": true,
"type": "string",
"description": "Resource kind",
"maxLength": 10
},
"type": {
"readOnly": true,
"type": "string",
"description": "Resource type"
}
},
"x-ms-azure-resource": true
},
"ProxyResource": {
"description": "The Resource model definition.",
"properties": {
Expand Down Expand Up @@ -2620,6 +2854,15 @@
}
},
"parameters": {
"settingNameParameter": {
"name": "settingName",
"in": "path",
"description": "Name of the setting. Allowed values: myscope",
"required": true,
"type": "string",
"x-ms-parameter-location": "method",
"maxLength": 32
},
"viewNameParameter": {
"name": "viewName",
"in": "path",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"parameters": {
"api-version": "2019-11-01",
"settingName": "myscope"
},
"responses": {
"200": {
"body": {
"id": "/providers/Microsoft.CostManagement/settings/myscope",
"name": "myscope",
"kind": "user",
"type": "Microsoft.CostManagement/settings",
"properties": {
"scope": "/subscriptions/00000000-0000-0000-0000-000000000000"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"parameters": {
"api-version": "2019-11-01",
"settingName": "myscope",
"parameters": {
"properties": {
"scope": "/subscriptions/00000000-0000-0000-0000-000000000000"
}
}
},
"responses": {
"200": {
"body": {
"id": "/providers/Microsoft.CostManagement/settings/myscope",
"name": "myscope",
"kind": "user",
"type": "Microsoft.CostManagement/settings",
"properties": {
"scope": "/subscriptions/00000000-0000-0000-0000-000000000000"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"parameters": {
"api-version": "2019-11-01",
"settingName": "TestSettings"
},
"responses": {
"200": {},
"204": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"parameters": {
"api-version": "2019-11-01"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/providers/Microsoft.CostManagement/settings/myscope",
"name": "myscope",
"kind": "user",
"type": "Microsoft.CostManagement/settings",
"properties": {
"scope": "/subscriptions/00000000-0000-0000-0000-000000000000"
}
}
]
}
}
}
}

0 comments on commit 281b9df

Please sign in to comment.