Skip to content

Commit

Permalink
Improve redis Swagger. (#2969)
Browse files Browse the repository at this point in the history
* Improve redis Swagger. Documenting 'list all patchSchedules' to fix #2968. Documenting the 'CheckNameAvailability.type' property better to address #2967 (and marking properties as required). Also using a more realistic timespan value in the PatchSchedule examples.

* Backport to the Microsoft.cache/redis 2017-10-01 swagger (from 2018-03-01).
  • Loading branch information
TimLovellSmith authored and jianghaolu committed May 3, 2018
1 parent b2da4e6 commit 6b8cb30
Show file tree
Hide file tree
Showing 8 changed files with 246 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{
"dayOfWeek": "Monday",
"startHourUtc": 12,
"maintenanceWindow": "PT3H"
"maintenanceWindow": "PT5H"
},
{
"dayOfWeek": "Tuesday",
Expand All @@ -32,7 +32,7 @@
{
"dayOfWeek": "Monday",
"startHourUtc": 12,
"maintenanceWindow": "PT3H"
"maintenanceWindow": "PT5H"
},
{
"dayOfWeek": "Tuesday",
Expand All @@ -52,7 +52,7 @@
{
"dayOfWeek": "Monday",
"startHourUtc": 12,
"maintenanceWindow": "PT3H"
"maintenanceWindow": "PT5H"
},
{
"dayOfWeek": "Tuesday",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{
"dayOfWeek": "Monday",
"startHourUtc": 12,
"maintenanceWindow": "PT3H"
"maintenanceWindow": "PT5H"
},
{
"dayOfWeek": "Tuesday",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"parameters": {
"cacheName": "cache1",
"resourceGroupName": "rg1",
"api-version": "2017-10-01",
"subscriptionId": "subid"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1/patchSchedules/default",
"name": "default",
"type": "Microsoft.Cache/Redis/patchSchedules",
"properties": {
"scheduleEntries": [
{
"dayOfWeek": "Monday",
"startHourUtc": 12,
"maintenanceWindow": "PT5H"
},
{
"dayOfWeek": "Tuesday",
"startHourUtc": 12
}
]
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"schema": {
"$ref": "#/definitions/CheckNameAvailabilityParameters"
},
"description": "Parameters supplied to the CheckNameAvailability Redis operation."
"description": "Parameters supplied to the CheckNameAvailability Redis operation. The only supported resource type is 'Microsoft.Cache/redis'"
},
{
"$ref": "#/parameters/ApiVersionParameter"
Expand Down Expand Up @@ -861,10 +861,57 @@
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/patchSchedules": {
"get": {
"tags": [
"Redis",
"PatchSchedules"
],
"operationId": "PatchSchedules_ListByRedisResource",
"description": "Gets all patch schedules in the specified redis cache (there is only one).",
"x-ms-examples": {
"RedisCachePatchSchedulesList": { "$ref": "./examples/RedisCachePatchSchedulesList.json" }
},
"parameters": [
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"name": "resourceGroupName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the resource group."
},
{
"name": "cacheName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the Redis cache."
}
],
"responses": {
"200": {
"description": "Successfully got the current patch schedules",
"schema": {
"$ref": "#/definitions/RedisPatchScheduleListResult"
}
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/{default}": {
"put": {
"tags": [
"Redis"
"Redis",
"PatchSchedules"
],
"operationId": "PatchSchedules_CreateOrUpdate",
"x-ms-examples": {
Expand Down Expand Up @@ -933,7 +980,8 @@
},
"delete": {
"tags": [
"Redis"
"Redis",
"PatchSchedules"
],
"operationId": "PatchSchedules_Delete",
"x-ms-examples": {
Expand Down Expand Up @@ -987,7 +1035,8 @@
},
"get": {
"tags": [
"Redis"
"Redis",
"PatchSchedules"
],
"operationId": "PatchSchedules_Get",
"x-ms-examples": {
Expand Down Expand Up @@ -1801,6 +1850,23 @@
],
"description": "Response to put/get patch schedules for Redis cache."
},
"RedisPatchScheduleListResult": {
"properties": {
"value": {
"type": "array",
"items": {
"$ref": "#/definitions/RedisPatchSchedule"
},
"description": "Results of the list patch schedules operation."
},
"nextLink": {
"type": "string",
"readOnly": true,
"description": "Link for next page of results."
}
},
"description": "The response of list patch schedules Redis operation."
},
"RedisForceRebootResponse": {
"properties": {
"message": {
Expand Down Expand Up @@ -1960,17 +2026,21 @@
}
},
"CheckNameAvailabilityParameters": {
"description": "Parameters body to pass for name availability check.",
"description": "Parameters body to pass for name availability check.",
"properties": {
"name": {
"type": "string",
"description": "Resource name."
},
"type": {
"type": "string",
"description": "Resource type."
"description": "Resource type. The only legal value of this property for checking redis cache name availability is 'Microsoft.Cache/redis'."
}
}
},
"required": [
"name",
"type"
]
},
"UpgradeNotification": {
"properties": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{
"dayOfWeek": "Monday",
"startHourUtc": 12,
"maintenanceWindow": "PT3H"
"maintenanceWindow": "PT5H"
},
{
"dayOfWeek": "Tuesday",
Expand All @@ -32,7 +32,7 @@
{
"dayOfWeek": "Monday",
"startHourUtc": 12,
"maintenanceWindow": "PT3H"
"maintenanceWindow": "PT5H"
},
{
"dayOfWeek": "Tuesday",
Expand All @@ -52,7 +52,7 @@
{
"dayOfWeek": "Monday",
"startHourUtc": 12,
"maintenanceWindow": "PT3H"
"maintenanceWindow": "PT5H"
},
{
"dayOfWeek": "Tuesday",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{
"dayOfWeek": "Monday",
"startHourUtc": 12,
"maintenanceWindow": "PT3H"
"maintenanceWindow": "PT5H"
},
{
"dayOfWeek": "Tuesday",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"parameters": {
"cacheName": "cache1",
"resourceGroupName": "rg1",
"api-version": "2018-03-01",
"subscriptionId": "subid"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1/patchSchedules/default",
"name": "default",
"type": "Microsoft.Cache/Redis/patchSchedules",
"properties": {
"scheduleEntries": [
{
"dayOfWeek": "Monday",
"startHourUtc": 12,
"maintenanceWindow": "PT5H"
},
{
"dayOfWeek": "Tuesday",
"startHourUtc": 12
}
]
}
}
]
}
}
}
}
Loading

0 comments on commit 6b8cb30

Please sign in to comment.