From 2aef11b9b4affa3add0e9b65dd27efc581ab326b Mon Sep 17 00:00:00 2001 From: Jon Payne Date: Fri, 1 Sep 2017 08:12:09 -0700 Subject: [PATCH 1/3] Formatting updates to Microsoft.Media Swagger - Adding /providers/Microsoft.Media/operations that was previously missing from the Swagger file. - Adding and updating various descriptions. --- .../Microsoft.Media/2015-10-01/media.json | 72 ++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/media.json b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/media.json index 30433b37a5a1..27d56dd5d458 100644 --- a/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/media.json +++ b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/media.json @@ -34,6 +34,25 @@ } }, "paths": { + "/providers/Microsoft.Media/operations": { + "get": { + "operationId": "Operations_List", + "description": "Lists all of the available Media Services REST API operations.", + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success. Returns a list of operations.", + "schema": { + "$ref": "#/definitions/OperationListResult" + } + } + } + } + }, "/subscriptions/{subscriptionId}/providers/Microsoft.Media/CheckNameAvailability": { "post": { "operationId": "MediaService_CheckNameAvailability", @@ -645,6 +664,7 @@ }, "properties": { "properties": { + "description": "The additional properties of a Media Service resource.", "x-ms-client-flatten": true, "$ref": "#/definitions/MediaServiceProperties" } @@ -659,6 +679,7 @@ "description": "The collection of Media Service resources.", "properties": { "value": { + "description": "The collection of Media Service resources.", "type": "array", "items": { "$ref": "#/definitions/MediaService" @@ -820,6 +841,55 @@ "type": "string" } } + }, + "OperationListResult": { + "description": "Result of the request to list Media Services operations.", + "properties": { + "value": { + "description": "List of Media Services operations supported by the Microsoft.Media resource provider.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/Operation" + } + }, + "nextLink": { + "description": "URL to get the next set of operation list results if there are any.", + "type": "string", + "readOnly": true + } + } + }, + "Operation": { + "description": "A Media Services REST API operation", + "type": "object", + "properties": { + "name": { + "description": "Operation name: {provider}/{resource}/{operation}", + "type": "string", + "readOnly": true + }, + "display": { + "description": "The object that represents the operation.", + "properties": { + "provider": { + "description": "Service provider: Microsoft.Media", + "type": "string", + "readOnly": true + }, + "resource": { + "description": "Resource on which the operation is performed: Invoice, etc.", + "type": "string", + "readOnly": true + }, + "operation": { + "description": "Operation type: Read, write, delete, etc.", + "type": "string", + "readOnly": true + } + } + } + } } }, "parameters": { @@ -851,7 +921,7 @@ }, "apiVersionParameter": { "name": "api-version", - "description": "Version of the API to be used with the client request. Current version is 2015-10-01", + "description": "Version of the API to be used with the client request. The current version is 2015-10-01.", "in": "query", "required": true, "type": "string" From d9fce83ef969070c18f972c642812e33631fac24 Mon Sep 17 00:00:00 2001 From: Jon Payne Date: Fri, 8 Sep 2017 16:38:10 -0700 Subject: [PATCH 2/3] Adding examples for the Microsoft.Media Resource Provider --- .../MediaServiceCheckNameAvailability.json | 19 +++ .../examples/MediaServiceCreate.json | 35 +++++ .../examples/MediaServiceDelete.json | 17 +++ .../2015-10-01/examples/MediaServiceGet.json | 33 +++++ .../MediaServiceListByResourceGroup.json | 57 ++++++++ .../examples/MediaServiceListKeys.json | 19 +++ .../examples/MediaServiceRegenerateKey.json | 19 +++ .../examples/MediaServiceSyncStorageKeys.json | 17 +++ .../examples/MediaServiceUpdate.json | 35 +++++ .../2015-10-01/examples/OperationsList.json | 61 +++++++++ .../Microsoft.Media/2015-10-01/media.json | 127 +++++++++++------- 11 files changed, 391 insertions(+), 48 deletions(-) create mode 100644 specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceCheckNameAvailability.json create mode 100644 specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceCreate.json create mode 100644 specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceDelete.json create mode 100644 specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceGet.json create mode 100644 specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceListByResourceGroup.json create mode 100644 specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceListKeys.json create mode 100644 specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceRegenerateKey.json create mode 100644 specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceSyncStorageKeys.json create mode 100644 specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceUpdate.json create mode 100644 specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/OperationsList.json diff --git a/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceCheckNameAvailability.json b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceCheckNameAvailability.json new file mode 100644 index 000000000000..fd1064c21bc5 --- /dev/null +++ b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceCheckNameAvailability.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "api-version": "2015-10-01", + "parameters": { + "name": "contosomedia", + "type": "mediaservices" + } + }, + "responses": { + "200": { + "body": { + "nameAvailable": true, + "reason": "None", + "message": "" + } + } + } +} \ No newline at end of file diff --git a/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceCreate.json b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceCreate.json new file mode 100644 index 000000000000..b859bba032f3 --- /dev/null +++ b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceCreate.json @@ -0,0 +1,35 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "contosoresources", + "mediaServiceName": "contosmedia", + "api-version": "2015-10-01", + "parameters": { + "location": "West US", + "properties": { + "storageAccounts": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosoresources/providers/Microsoft.Storage/storageAccounts/contosostore", + "isPrimary": true + } + ] + } + } + }, + "responses": { + "201": { + "body": { + "location": "West US", + "properties": { + "storageAccounts": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosoresources/providers/Microsoft.Storage/storageAccounts/contosostore", + "isPrimary": true + } + ] + } + } + } + } +} + diff --git a/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceDelete.json b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceDelete.json new file mode 100644 index 000000000000..29e5ea14f3d3 --- /dev/null +++ b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceDelete.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "contosoresources", + "mediaServiceName": "contosmedia", + "api-version": "2015-10-01" + }, + "responses": { + "200": { + "body": "" + }, + "204": { + "body": "" + } + } +} + diff --git a/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceGet.json b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceGet.json new file mode 100644 index 000000000000..589d3618bc9f --- /dev/null +++ b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceGet.json @@ -0,0 +1,33 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "contosoresources", + "mediaServiceName": "contosmedia", + "api-version": "2015-10-01" + }, + "responses": { + "200": { + "body": { + "name": "contosmedia", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/contosoresources/providers/Microsoft.Media/mediaservices/contosmedia", + "type": "Microsoft.Media/mediaservices", + "tags": [], + "location": "East US", + "properties": { + "apiEndpoints": [ + { + "endpoint": "https://contosmedia.restv2.eastus.media.azure.net/api/", + "majorVersion": "2" + } + ], + "storageAccounts": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosoresources/providers/Microsoft.Storage/storageAccounts/contosostore", + "isPrimary": true + } + ] + } + } + } + } +} \ No newline at end of file diff --git a/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceListByResourceGroup.json b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceListByResourceGroup.json new file mode 100644 index 000000000000..5f1f3b9a468e --- /dev/null +++ b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceListByResourceGroup.json @@ -0,0 +1,57 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "contosoresources", + "api-version": "2015-10-01" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "contosmedia", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/contosoresources/providers/Microsoft.Media/mediaservices/contosmedia", + "type": "Microsoft.Media/mediaservices", + "tags": [], + "location": "East US", + "properties": { + "apiEndpoints": [ + { + "endpoint": "https://contosmedia.restv2.eastus.media.azure.net/api/", + "majorVersion": "2" + } + ], + "storageAccounts": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosoresources/providers/Microsoft.Storage/storageAccounts/contosostore", + "isPrimary": true + } + ] + } + }, + { + "name": "contosmedia2", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/contosoresources/providers/Microsoft.Media/mediaservices/contosmedia2", + "type": "Microsoft.Media/mediaservices", + "tags": [], + "location": "West US", + "properties": { + "apiEndpoints": [ + { + "endpoint": "https://contosmedia2.restv2.westus.media.azure.net/api/", + "majorVersion": "2" + } + ], + "storageAccounts": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosoresources/providers/microsoft.storage/storageAccounts/contosostore2", + "isPrimary": true + } + ] + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceListKeys.json b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceListKeys.json new file mode 100644 index 000000000000..111b60e1d127 --- /dev/null +++ b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceListKeys.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "contosoresources", + "mediaServiceName": "contosmedia", + "api-version": "2015-10-01" + }, + "responses": { + "200": { + "body": { + "primaryAuthEndpoint": "https://wamsprodglobal001acs.accesscontrol.windows.net/", + "secondaryAuthEndpoint": "https://wamsprodglobal002acs.accesscontrol.windows.net/", + "primaryKey": "", + "secondaryKey": "", + "scope": "urn:windowsazuremediaservices" + } + } + } +} \ No newline at end of file diff --git a/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceRegenerateKey.json b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceRegenerateKey.json new file mode 100644 index 000000000000..65e2f4ef9fe5 --- /dev/null +++ b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceRegenerateKey.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "contosoresources", + "mediaServiceName": "contosmedia", + "api-version": "2015-10-01", + "parameters": { + "keyType": "Primary" + } + }, + "responses": { + "200": { + "body": { + "key":"" + } + } + } +} + diff --git a/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceSyncStorageKeys.json b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceSyncStorageKeys.json new file mode 100644 index 000000000000..1e8d17789fc8 --- /dev/null +++ b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceSyncStorageKeys.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "contosoresources", + "mediaServiceName": "contosmedia", + "api-version": "2015-10-01", + "parameters": { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosoresources/providers/Microsoft.Storage/storageAccounts/contosostore" + } + }, + "responses": { + "200": { + "body": "" + } + } +} + diff --git a/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceUpdate.json b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceUpdate.json new file mode 100644 index 000000000000..225fc4e84743 --- /dev/null +++ b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/MediaServiceUpdate.json @@ -0,0 +1,35 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "contosoresources", + "mediaServiceName": "contosmedia", + "api-version": "2015-10-01", + "parameters": { + "location": "West US", + "properties": { + "storageAccounts": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosoresources/providers/Microsoft.Storage/storageAccounts/contosostore", + "isPrimary": true + } + ] + } + } + }, + "responses": { + "200": { + "body": { + "location": "West US", + "properties": { + "storageAccounts": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosoresources/providers/Microsoft.Storage/storageAccounts/contosostore", + "isPrimary": true + } + ] + } + } + } + } +} + diff --git a/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/OperationsList.json b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/OperationsList.json new file mode 100644 index 000000000000..275347bc21bc --- /dev/null +++ b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/examples/OperationsList.json @@ -0,0 +1,61 @@ +{ + "parameters": { + "api-version": "2015-10-01" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "Microsoft.Media/mediaservices/read", + "display": { + "provider": "Microsoft.Media", + "resource": "MediaService", + "operation": "read" + } + }, + { + "name": "Microsoft.Media/mediaservices/write", + "display": { + "provider": "Microsoft.Media", + "resource": "MediaService", + "operation": "write" + } + }, + { + "name": "Microsoft.Media/mediaservices/delete", + "display": { + "provider": "Microsoft.Media", + "resource": "MediaService", + "operation": "delete" + } + }, + { + "name": "Microsoft.Media/mediaservices/regenerateKey/action", + "display": { + "provider": "Microsoft.Media", + "resource": "MediaService", + "operation": "regenerateKey" + } + }, + { + "name": "Microsoft.Media/mediaservices/listKeys/action", + "display": { + "provider": "Microsoft.Media", + "resource": "MediaService", + "operation": "listKeys" + } + }, + { + "name": "Microsoft.Media/mediaservices/syncStorageKeys/action", + "display": { + "provider": "Microsoft.Media", + "resource": "MediaService", + "operation": "syncStorageKeys" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/media.json b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/media.json index 27d56dd5d458..d3e98eee9d0e 100644 --- a/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/media.json +++ b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/media.json @@ -38,6 +38,12 @@ "get": { "operationId": "Operations_List", "description": "Lists all of the available Media Services REST API operations.", + "externalDocs": { + "url": "https://aka.ms/media-manage" + }, + "x-ms-examples": { + "OperationsList": { "$ref": "./examples/OperationsList.json" } + }, "parameters": [ { "$ref": "#/parameters/apiVersionParameter" @@ -60,6 +66,9 @@ "externalDocs": { "url": "https://aka.ms/media-manage" }, + "x-ms-examples": { + "MediaServiceCheckNameAvailability": { "$ref": "./examples/MediaServiceCheckNameAvailability.json" } + }, "parameters": [ { "$ref": "#/parameters/subscriptionIdParameter" @@ -68,14 +77,14 @@ "$ref": "#/parameters/apiVersionParameter" }, { - "name": "CheckNameAvailabilityInput", + "name": "parameters", "description": "Properties needed to check the availability of a name.", "in": "body", "required": true, "schema": { "$ref": "#/definitions/CheckNameAvailabilityInput" } - } + } ], "responses": { "200": { @@ -85,13 +94,9 @@ }, "examples": { "application/json": { - "value": [ - { - "nameAvailable": false, - "reason": "AlreadyExists", - "message": "Already in use by another Media Service instance. Please try again with a name that is not likely to be in use." - } - ] + "nameAvailable": false, + "reason": "AlreadyExists", + "message": "Already in use by another Media Service instance. Please try again with a name that is not likely to be in use." } } }, @@ -111,6 +116,9 @@ "externalDocs": { "url": "https://aka.ms/media-manage" }, + "x-ms-examples": { + "MediaServiceListByResourceGroup": { "$ref": "./examples/MediaServiceListByResourceGroup.json" } + }, "parameters": [ { "$ref": "#/parameters/subscriptionIdParameter" @@ -133,7 +141,7 @@ "value": [ { "name": "contosomedia", - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-media/providers/Microsoft.Media/mediaservices/contosomedia", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosoresources/providers/Microsoft.Media/mediaservices/contosomedia", "type": "Microsoft.Media/mediaservices", "location": "West US", "properties":{ @@ -145,7 +153,7 @@ ], "storageAccounts":[ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-media/providers/Microsoft.Storage/storageAccounts/contosomedia", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosoresources/providers/Microsoft.Storage/storageAccounts/contosomedia", "isPrimary": true } ] @@ -174,6 +182,9 @@ "externalDocs": { "url": "https://aka.ms/media-manage" }, + "x-ms-examples": { + "MediaServiceGet": { "$ref": "./examples/MediaServiceGet.json" } + }, "parameters": [ { "$ref": "#/parameters/subscriptionIdParameter" @@ -197,7 +208,7 @@ "examples" : { "application/json": { "name": "contosomedia", - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-media/providers/Microsoft.Media/mediaservices/contosomedia", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosoresources/providers/Microsoft.Media/mediaservices/contosomedia", "type": "Microsoft.Media/mediaservices", "location": "West US", "properties":{ @@ -209,7 +220,7 @@ ], "storageAccounts":[ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-media/providers/Microsoft.Storage/storageAccounts/contosomedia", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosoresources/providers/Microsoft.Storage/storageAccounts/contosomedia", "isPrimary": true } ] @@ -226,11 +237,14 @@ } }, "put": { - "description": "Creates a Media Service.", "operationId": "MediaService_Create", + "description": "Creates a Media Service.", "externalDocs": { "url": "https://aka.ms/media-manage" }, + "x-ms-examples": { + "MediaServiceCreate": { "$ref": "./examples/MediaServiceCreate.json" } + }, "parameters": [ { "$ref": "#/parameters/subscriptionIdParameter" @@ -245,7 +259,7 @@ "$ref": "#/parameters/mediaResourceNameParameter" }, { - "name": "MediaService", + "name": "parameters", "description": "Media Service properties needed for creation.", "in": "body", "required": true, @@ -263,7 +277,7 @@ "examples" : { "application/json": { "name": "contosomedia", - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-media/providers/Microsoft.Media/mediaservices/contosomedia", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosoresources/providers/Microsoft.Media/mediaservices/contosomedia", "type": "Microsoft.Media/mediaservices", "location": "West US", "properties":{ @@ -275,7 +289,7 @@ ], "storageAccounts":[ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-media/providers/Microsoft.Storage/storageAccounts/contosomedia", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosoresources/providers/Microsoft.Storage/storageAccounts/contosomedia", "isPrimary": true } ] @@ -297,6 +311,9 @@ "externalDocs": { "url": "https://aka.ms/media-manage" }, + "x-ms-examples": { + "MediaServiceDelete": { "$ref": "./examples/MediaServiceDelete.json" } + }, "parameters": [ { "$ref": "#/parameters/subscriptionIdParameter" @@ -332,6 +349,9 @@ "externalDocs": { "url": "https://aka.ms/media-manage" }, + "x-ms-examples": { + "MediaServiceUpdate": { "$ref": "./examples/MediaServiceUpdate.json" } + }, "parameters": [ { "$ref": "#/parameters/subscriptionIdParameter" @@ -346,7 +366,7 @@ "$ref": "#/parameters/mediaResourceNameParameter" }, { - "name": "MediaService", + "name": "parameters", "description": "Media Service properties needed for update.", "in": "body", "required": true, @@ -364,7 +384,7 @@ "examples" : { "application/json": { "name": "contosomedia", - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-media/providers/Microsoft.Media/mediaservices/contosomedia", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosoresources/providers/Microsoft.Media/mediaservices/contosomedia", "type": "Microsoft.Media/mediaservices", "location": "West US", "properties":{ @@ -376,7 +396,7 @@ ], "storageAccounts":[ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-media/providers/Microsoft.Storage/storageAccounts/contosomedia", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosoresources/providers/Microsoft.Storage/storageAccounts/contosomedia", "isPrimary": true } ] @@ -400,6 +420,9 @@ "externalDocs": { "url": "https://aka.ms/media-manage" }, + "x-ms-examples": { + "MediaServiceRegenerateKey": { "$ref": "./examples/MediaServiceRegenerateKey.json" } + }, "parameters": [ { "$ref": "#/parameters/subscriptionIdParameter" @@ -414,7 +437,7 @@ "$ref": "#/parameters/mediaResourceNameParameter" }, { - "name": "RegenerateKeyInput", + "name": "parameters", "description": "Properties needed to regenerate the Media Service key.", "in": "body", "required": true, @@ -451,6 +474,9 @@ "externalDocs": { "url": "https://aka.ms/media-manage" }, + "x-ms-examples": { + "MediaServiceListKeys": { "$ref": "./examples/MediaServiceListKeys.json" } + }, "parameters": [ { "$ref": "#/parameters/subscriptionIdParameter" @@ -497,6 +523,9 @@ "externalDocs": { "url": "https://aka.ms/media-manage" }, + "x-ms-examples": { + "MediaServiceSyncStorageKeys": { "$ref": "./examples/MediaServiceSyncStorageKeys.json" } + }, "parameters": [ { "$ref": "#/parameters/subscriptionIdParameter" @@ -511,7 +540,7 @@ "$ref": "#/parameters/mediaResourceNameParameter" }, { - "name": "SyncStorageKeysInput", + "name": "parameters", "description": "Properties needed to synchronize the keys for a storage account to the Media Service.", "in": "body", "required": true, @@ -585,7 +614,7 @@ "name": { "description": "The name of the resource. A name must be globally unique.", "type": "string", - "pattern": "^[a-z0-9]", + "pattern": "^[a-z0-9]{3,24}$", "minLength": 3, "maxLength": 24 }, @@ -608,29 +637,31 @@ }, "CheckNameAvailabilityOutput": { "description": "The response body for CheckNameAvailability API.", - "example": { - "value": [ - { - "NameAvailable": true - }, - { - "NameAvailable": false, - "Reason": "AlreadyExists", - "Message": "Already in use by another Media Service instance. Please try again with a name that is not likely to be in use." - }, - { - "NameAvailable": false, - "Reason": "Invalid", - "Message": "The media service name should be between 3 and 24 characters and may contain only lowercase letters and numbers." - } - ] - }, + "examples": { + "application/json": { + "value": [ + { + "nameAvailable": true + }, + { + "nameAvailable": false, + "reason": "AlreadyExists", + "message": "Already in use by another Media Service instance. Please try again with a name that is not likely to be in use." + }, + { + "nameAvailable": false, + "reason": "Invalid", + "message": "The media service name should be between 3 and 24 characters and may contain only lowercase letters and numbers." + } + ] + } + }, "properties": { - "NameAvailable": { + "nameAvailable": { "description": "Specifies if the name is available.", "type": "boolean" }, - "Reason": { + "reason": { "description": "Specifies the reason if the name is not available.", "type": "string", "enum": [ @@ -643,7 +674,7 @@ "modelAsString": false } }, - "Message": { + "message": { "description": "Specifies the detailed reason if the name is not available.", "type": "string" } @@ -656,8 +687,8 @@ "properties": { "storageAccounts": [ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-media/providers/Microsoft.Storage/storageAccounts/contosomedia", - "isPrimary": true + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosoresources/providers/Microsoft.Storage/storageAccounts/contosomedia", + "isPrimary": true } ] } @@ -809,7 +840,7 @@ "StorageAccount": { "description": "The properties of a storage account associated with this resource.", "example": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-media/providers/Microsoft.Storage/storageAccounts/contosomedia", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosoresources/providers/Microsoft.Storage/storageAccounts/contosomedia", "isPrimary": true }, "required": [ @@ -830,7 +861,7 @@ "SyncStorageKeysInput": { "description": "The request body for a SyncStorageKeys API.", "example": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-media/providers/Microsoft.Storage/storageAccounts/contosomedia" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosoresources/providers/Microsoft.Storage/storageAccounts/contosomedia" }, "required": [ "id" @@ -914,7 +945,7 @@ "in": "path", "required": true, "type": "string", - "pattern": "^[a-z0-9]", + "pattern": "^[a-z0-9]{3,24}$", "minLength": 3, "maxLength": 24, "x-ms-parameter-location": "method" From 849c37a25cf3a1ea5e204d5bc81fd077e571d207 Mon Sep 17 00:00:00 2001 From: Jon Payne Date: Mon, 11 Sep 2017 12:14:59 -0700 Subject: [PATCH 3/3] Fixing validation errors for Microsoft.Media Swagger file --- .../Microsoft.Media/2015-10-01/media.json | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/media.json b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/media.json index d3e98eee9d0e..300c66244063 100644 --- a/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/media.json +++ b/specification/mediaservices/resource-manager/Microsoft.Media/2015-10-01/media.json @@ -637,25 +637,6 @@ }, "CheckNameAvailabilityOutput": { "description": "The response body for CheckNameAvailability API.", - "examples": { - "application/json": { - "value": [ - { - "nameAvailable": true - }, - { - "nameAvailable": false, - "reason": "AlreadyExists", - "message": "Already in use by another Media Service instance. Please try again with a name that is not likely to be in use." - }, - { - "nameAvailable": false, - "reason": "Invalid", - "message": "The media service name should be between 3 and 24 characters and may contain only lowercase letters and numbers." - } - ] - } - }, "properties": { "nameAvailable": { "description": "Specifies if the name is available.",