diff --git a/specification/iothub/resource-manager/Microsoft.Devices/2017-07-01/iothub.json b/specification/iothub/resource-manager/Microsoft.Devices/2017-07-01/iothub.json index 2fbe20a24164..5257ce40cb5e 100644 --- a/specification/iothub/resource-manager/Microsoft.Devices/2017-07-01/iothub.json +++ b/specification/iothub/resource-manager/Microsoft.Devices/2017-07-01/iothub.json @@ -76,18 +76,10 @@ "$ref": "#/parameters/subscriptionId" }, { - "name": "resourceGroupName", - "description": "The name of the resource group that contains the IoT hub.", - "in": "path", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceGroupName" }, { - "name": "resourceName", - "in": "path", - "description": "The name of the IoT hub.", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceName" } ], "responses": { @@ -120,18 +112,10 @@ "$ref": "#/parameters/subscriptionId" }, { - "name": "resourceGroupName", - "in": "path", - "description": "The name of the resource group that contains the IoT hub.", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceGroupName" }, { - "name": "resourceName", - "in": "path", - "description": "The name of the IoT hub to create or update.", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceName" }, { "name": "iotHubDescription", @@ -179,18 +163,10 @@ "$ref": "#/parameters/subscriptionId" }, { - "name": "resourceGroupName", - "description": "The name of the resource group that contains the IoT hub.", - "in": "path", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceGroupName" }, { - "name": "resourceName", - "in": "path", - "description": "The name of the IoT hub to delete.", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceName" } ], "responses": { @@ -273,11 +249,7 @@ "$ref": "#/parameters/subscriptionId" }, { - "name": "resourceGroupName", - "in": "path", - "description": "The name of the resource group that contains the IoT hubs.", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceGroupName" } ], "responses": { @@ -314,18 +286,10 @@ "$ref": "#/parameters/subscriptionId" }, { - "name": "resourceGroupName", - "description": "The name of the resource group that contains the IoT hub.", - "in": "path", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceGroupName" }, { - "name": "resourceName", - "in": "path", - "description": "The name of the IoT hub.", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceName" } ], "responses": { @@ -359,18 +323,10 @@ "$ref": "#/parameters/subscriptionId" }, { - "name": "resourceGroupName", - "description": "The name of the resource group that contains the IoT hub.", - "in": "path", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceGroupName" }, { - "name": "resourceName", - "in": "path", - "description": "The name of the IoT hub.", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceName" } ], "responses": { @@ -407,18 +363,10 @@ "$ref": "#/parameters/subscriptionId" }, { - "name": "resourceGroupName", - "description": "The name of the resource group that contains the IoT hub.", - "in": "path", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceGroupName" }, { - "name": "resourceName", - "in": "path", - "description": "The name of the IoT hub.", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceName" }, { "name": "eventHubEndpointName", @@ -462,18 +410,10 @@ "$ref": "#/parameters/subscriptionId" }, { - "name": "resourceGroupName", - "description": "The name of the resource group that contains the IoT hub.", - "in": "path", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceGroupName" }, { - "name": "resourceName", - "in": "path", - "description": "The name of the IoT hub.", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceName" }, { "name": "eventHubEndpointName", @@ -519,18 +459,10 @@ "$ref": "#/parameters/subscriptionId" }, { - "name": "resourceGroupName", - "description": "The name of the resource group that contains the IoT hub.", - "in": "path", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceGroupName" }, { - "name": "resourceName", - "in": "path", - "description": "The name of the IoT hub.", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceName" }, { "name": "eventHubEndpointName", @@ -576,18 +508,10 @@ "$ref": "#/parameters/subscriptionId" }, { - "name": "resourceGroupName", - "description": "The name of the resource group that contains the IoT hub.", - "in": "path", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceGroupName" }, { - "name": "resourceName", - "in": "path", - "description": "The name of the IoT hub.", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceName" }, { "name": "eventHubEndpointName", @@ -632,18 +556,10 @@ "$ref": "#/parameters/subscriptionId" }, { - "name": "resourceGroupName", - "description": "The name of the resource group that contains the IoT hub.", - "in": "path", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceGroupName" }, { - "name": "resourceName", - "in": "path", - "description": "The name of the IoT hub.", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceName" } ], "responses": { @@ -680,18 +596,10 @@ "$ref": "#/parameters/subscriptionId" }, { - "name": "resourceGroupName", - "description": "The name of the resource group that contains the IoT hub.", - "in": "path", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceGroupName" }, { - "name": "resourceName", - "in": "path", - "description": "The name of the IoT hub.", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceName" }, { "name": "jobId", @@ -732,18 +640,10 @@ "$ref": "#/parameters/subscriptionId" }, { - "name": "resourceGroupName", - "description": "The name of the resource group that contains the IoT hub.", - "in": "path", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceGroupName" }, { - "name": "resourceName", - "in": "path", - "description": "The name of the IoT hub.", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceName" } ], "responses": { @@ -820,18 +720,10 @@ "$ref": "#/parameters/subscriptionId" }, { - "name": "resourceGroupName", - "description": "The name of the resource group that contains the IoT hub.", - "in": "path", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceGroupName" }, { - "name": "resourceName", - "in": "path", - "description": "The name of the IoT hub.", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceName" } ], "responses": { @@ -868,18 +760,10 @@ "$ref": "#/parameters/subscriptionId" }, { - "name": "resourceGroupName", - "description": "The name of the resource group that contains the IoT hub.", - "in": "path", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceGroupName" }, { - "name": "resourceName", - "in": "path", - "description": "The name of the IoT hub.", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceName" }, { "name": "keyName", @@ -920,18 +804,10 @@ "$ref": "#/parameters/subscriptionId" }, { - "name": "resourceGroupName", - "description": "The name of the resource group that contains the IoT hub.", - "in": "path", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceGroupName" }, { - "name": "resourceName", - "in": "path", - "description": "The name of the IoT hub.", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceName" }, { "name": "exportDevicesParameters", @@ -974,18 +850,10 @@ "$ref": "#/parameters/subscriptionId" }, { - "name": "resourceGroupName", - "description": "The name of the resource group that contains the IoT hub.", - "in": "path", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceGroupName" }, { - "name": "resourceName", - "in": "path", - "description": "The name of the IoT hub.", - "required": true, - "type": "string" + "$ref": "#/parameters/resourceName" }, { "name": "importDevicesParameters", @@ -1013,9 +881,359 @@ }, "deprecated": false } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates": { + "get": { + "tags": [ "Certificates" ], + "summary": "Get the certificate list.", + "description": "Returns the list of certificates.", + "operationId": "Certificates_ListByIoTHub", + "parameters": [ + { + "$ref": "#/parameters/api-version" + }, + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/resourceGroupName" + }, + { + "$ref": "#/parameters/resourceName" + } + ], + "responses": { + "200": { + "description": "The body contains all the certificate list.", + "schema": { + "$ref": "#/definitions/CertificateListDescription" + } + }, + "default": { + "description": "DefaultErrorResponse", + "schema": { + "$ref": "#/definitions/ErrorDetails" + } + } + }, + "deprecated": false + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}": { + "get": { + "tags": [ "Certificates" ], + "summary": "Get the certificate.", + "description": "Returns the certificate.", + "operationId": "Certificates_Get", + "parameters": [ + { + "$ref": "#/parameters/api-version" + }, + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/resourceGroupName" + }, + { + "$ref": "#/parameters/resourceName" + }, + { + "$ref": "#/parameters/certificateName" + } + ], + "responses": { + "200": { + "description": "The body contains the certificate.", + "schema": { + "$ref": "#/definitions/CertificateDescription" + } + }, + "default": { + "description": "DefaultErrorResponse", + "schema": { + "$ref": "#/definitions/ErrorDetails" + } + } + }, + "deprecated": false + }, + "put": { + "tags": [ "Certificates" ], + "summary": "Upload the certificate to the IoT hub.", + "description": "Adds new or replaces existing certificate.", + "operationId": "Certificates_CreateOrUpdate", + "parameters": [ + { + "$ref": "#/parameters/api-version" + }, + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/resourceGroupName" + }, + { + "$ref": "#/parameters/resourceName" + }, + { + "$ref": "#/parameters/certificateName" + }, + { + "name": "certificateDescription", + "in": "body", + "description": "The certificate body.", + "required": true, + "schema": { + "$ref": "#/definitions/CertificateBodyDescription" + } + } + ], + "responses": { + "201": { + "description": "If certificate didn't exist creation was successful, the operation returns HTTP status code of 201 (OK).", + "schema": { + "$ref": "#/definitions/CertificateDescription" + } + }, + "200": { + "description": "If certificate already exist and update was successful, the operation returns HTTP status code of 201 (OK).", + "schema": { + "$ref": "#/definitions/CertificateDescription" + } + }, + "default": { + "description": "DefaultErrorResponse", + "schema": { + "$ref": "#/definitions/ErrorDetails" + } + } + }, + "deprecated": false + }, + "delete": { + "tags": [ "Certificates" ], + "summary": "Delete an X509 certificate.", + "description": "Deletes an existing X509 certificate or does nothing if it does not exist.", + "operationId": "Certificates_Delete", + "parameters": [ + { + "$ref": "#/parameters/api-version" + }, + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/resourceGroupName" + }, + { + "$ref": "#/parameters/resourceName" + }, + { + "$ref": "#/parameters/certificateName" + } + ], + "responses": { + "200": { + "description": "Certificate has been deleted." + }, + "204": { + "description": "Certificate does not exist." + }, + "default": { + "description": "DefaultErrorResponse", + "schema": { + "$ref": "#/definitions/ErrorDetails" + } + } + }, + "deprecated": false + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/generateVerificationCode": { + "post": { + "tags": [ "Certificates" ], + "summary": "Generate verification code for proof of posession flow.", + "description": "Generates verification code for proof of posession flow. The verifification code will be used to generate a leaf certificate.", + "operationId": "Certificates_GenerateVerificationCode", + "parameters": [ + { + "$ref": "#/parameters/api-version" + }, + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/resourceGroupName" + }, + { + "$ref": "#/parameters/resourceName" + }, + { + "$ref": "#/parameters/certificateName" + } + ], + "responses": { + "200": { + "description": "The body contains the certificate.", + "schema": { + "$ref": "#/definitions/CertificateWithNonceDescription" + } + }, + "default": { + "description": "DefaultErrorResponse", + "schema": { + "$ref": "#/definitions/ErrorDetails" + } + } + }, + "deprecated": false + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/verify": { + "post": { + "tags": [ "Certificates" ], + "summary": "Verify certificate's private key posession.", + "description": "Verifies the certificate's private key posession by providing the leaf cert issued by the verifying pre uploaded certificate.", + "operationId": "Certificates_Verify", + "parameters": [ + { + "$ref": "#/parameters/api-version" + }, + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/resourceGroupName" + }, + { + "$ref": "#/parameters/resourceName" + }, + { + "$ref": "#/parameters/certificateName" + }, + { + "name": "certificateVerificationBody", + "in":"body", + "description":"The name of the certificate", + "required":true, + "schema": { + "$ref": "#/definitions/CertificateVerificationDescription" + } + } + ], + "responses": { + "200": { + "description": "The body contains the certificate.", + "schema": { + "$ref": "#/definitions/CertificateDescription" + } + }, + "default": { + "description": "DefaultErrorResponse", + "schema": { + "$ref": "#/definitions/ErrorDetails" + } + } + }, + "deprecated": false + } } }, "definitions": { + "CertificateVerificationDescription":{ + "description": "The JSON-serialized leaf certificate", + "type": "object", + "properties": { + "certificate": { + "description": "base-64 representation of X509 certificate .cer file or just .pem file content.", + "type": "string" + } + } + }, + "CertificateBodyDescription":{ + "description": "The JSON-serialized X509 Certificate.", + "type": "object", + "properties": { + "certificate": { + "description": "base-64 representation of the X509 leaf certificate .cer file or just .pem file content.", + "type": "string" + } + } + }, + "CertificateListDescription": { + "description": "The JSON-serialized array of Certificate objects.", + "type": "object", + "properties": { + "value": { + "description": "The array of Certificate objects.", + "type": "array", + "items": { + "$ref": "#/definitions/CertificateDescription" + } + } + } + }, + "CertificateDescription": { + "description": "The X509 Certificate.", + "type": "object", + "properties": { + "properties" : { + "$ref": "#/definitions/CertificateProperties" + }, + "id": { + "readOnly": true, + "type": "string", + "description": "The resource identifier." + }, + "name": { + "description": "The name of the certificate.", + "type": "string", + "readOnly": true + }, + "etag": { + "description": "The entity tag.", + "type": "string", + "readOnly": true + }, + "type": { + "readOnly": true, + "type": "string", + "description": "The resource type." + } + }, + "x-ms-azure-resource": true + }, + "CertificateWithNonceDescription": { + "description": "The X509 Certificate.", + "type": "object", + "properties": { + "properties" : { + "$ref": "#/definitions/CertificatePropertiesWithNonce" + }, + "id": { + "readOnly": true, + "type": "string", + "description": "The resource identifier." + }, + "name": { + "description": "The name of the certificate.", + "type": "string", + "readOnly": true + }, + "etag": { + "description": "The entity tag.", + "type": "string", + "readOnly": true + }, + "type": { + "readOnly": true, + "type": "string", + "description": "The resource type." + } + }, + "x-ms-azure-resource": true + }, "SharedAccessSignatureAuthorizationRule": { "description": "The properties of an IoT hub shared access policy.", "type": "object", @@ -1063,6 +1281,91 @@ "rights" ] }, + "CertificateProperties": + { + "description": "The description of an X509 CA Certificate.", + "type": "object", + "properties": { + "subject": { + "description": "The certificate's subject name.", + "type": "string", + "readOnly": true + }, + "expiry": { + "description": "The certificate's expiration date and time.", + "type": "string", + "format": "date-time-rfc1123", + "readOnly": true + }, + "thumbprint": { + "description": "The certificate's thumbprint.", + "type": "string", + "readOnly": true + }, + "isVerified": { + "description": "Determines wether certificate has been verified.", + "type": "boolean", + "readOnly": true + }, + "created": { + "description": "The certificate's create date and time.", + "type": "string", + "format": "date-time-rfc1123", + "readOnly": true + }, + "updated": { + "description": "The certificate's last update date and time.", + "type": "string", + "format": "date-time-rfc1123", + "readOnly": true + } + } + }, + "CertificatePropertiesWithNonce": + { + "description": "The description of an X509 CA Certificate including the challenge nonce issued for the Proof-Of-Possession flow.", + "type": "object", + "properties": { + "subject": { + "description": "The certificate's subject name.", + "type": "string", + "readOnly": true + }, + "expiry": { + "description": "The certificate's expiration date and time.", + "type": "string", + "format": "date-time-rfc1123", + "readOnly": true + }, + "thumbprint": { + "description": "The certificate's thumbprint.", + "type": "string", + "readOnly": true + }, + "isVerified": { + "description": "Determines wether certificate has been verified.", + "type": "boolean", + "readOnly": true + }, + "created": { + "description": "The certificate's create date and time.", + "type": "string", + "format": "date-time-rfc1123", + "readOnly": true + }, + "updated": { + "description": "The certificate's last update date and time.", + "type": "string", + "format": "date-time-rfc1123", + "readOnly": true + }, + "verificationCode": { + "description": "The certificate's verification code that will be used for proof of posession.", + "type": "string", + "readOnly": true + } + } + }, "IotHubProperties": { "description": "The properties of an IoT hub.", "type": "object", @@ -2138,6 +2441,28 @@ "description": "The version of the API.", "required": true, "type": "string" + }, + "resourceGroupName": { + "name": "resourceGroupName", + "description": "The name of the resource group that contains the IoT hub.", + "in": "path", + "required": true, + "type": "string" + }, + "resourceName":{ + "name": "resourceName", + "in": "path", + "description": "The name of the IoT hub.", + "required": true, + "type": "string" + }, + "certificateName":{ + "name": "certificateName", + "in":"path", + "description":"The name of the certificate", + "required":true, + "type":"string", + "pattern":"^[A-Za-z0-9-._]{1,64}$" } } } \ No newline at end of file