{
  "swagger": "2.0",
  "schemes": [
    "https"
  ],
  "host": "management.azure.com",
  "info": {
    "description": "API for using the Azure IoT Hub Device Provisioning Service features.",
    "title": "iotDpsClient",
    "version": "2017-08-21-preview",
    "x-apisguru-categories": [
      "cloud"
    ],
    "x-logo": {
      "url": "https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png"
    },
    "x-ms-code-generation-settings": {
      "host": "management.azure.com"
    },
    "x-origin": [
      {
        "format": "swagger",
        "url": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/provisioningservices/resource-manager/Microsoft.Devices/preview/2017-08-21-preview/iotdps.json",
        "version": "2.0"
      }
    ],
    "x-preferred": false,
    "x-providerName": "azure.com",
    "x-serviceName": "provisioningservices-iotdps",
    "x-tags": [
      "Azure",
      "Microsoft"
    ]
  },
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "securityDefinitions": {
    "azure_auth": {
      "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
      "description": "Azure Active Directory OAuth2 Flow.",
      "flow": "implicit",
      "scopes": {
        "user_impersonation": "impersonate your user account"
      },
      "type": "oauth2"
    }
  },
  "security": [
    {
      "azure_auth": [
        "user_impersonation"
      ]
    }
  ],
  "parameters": {
    "api-version": {
      "description": "The version of the API.",
      "in": "query",
      "name": "api-version",
      "required": true,
      "type": "string"
    },
    "subscriptionId": {
      "description": "The subscription identifier.",
      "in": "path",
      "name": "subscriptionId",
      "required": true,
      "type": "string"
    }
  },
  "paths": {
    "/providers/Microsoft.Devices/operations": {
      "get": {
        "description": "Lists all of the available Microsoft.Devices REST API operations.",
        "operationId": "Operations_List",
        "parameters": [
          {
            "$ref": "#/parameters/api-version"
          }
        ],
        "responses": {
          "200": {
            "description": "OK. The request has succeeded.",
            "schema": {
              "$ref": "#/definitions/OperationListResult"
            }
          },
          "default": {
            "description": "Default error response.",
            "schema": {
              "$ref": "#/definitions/ErrorDetails"
            }
          }
        },
        "tags": [
          "Operations"
        ],
        "x-ms-examples": {
          "DPSOperations": {
            "parameters": {
              "api-version": "2017-08-21-preview"
            },
            "responses": {
              "200": {
                "body": {
                  "value": [
                    {
                      "display": {
                        "description": "Register the subscription for the IotHub resource provider and enables the creation of IotHub resources",
                        "operation": "Register Resource Provider",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/register/action"
                    },
                    {
                      "display": {
                        "description": "Gets the diagnostic setting for the resource",
                        "operation": "Get Diagnostic Setting",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/IotHubs/diagnosticSettings/read"
                    },
                    {
                      "display": {
                        "description": "Creates or updates the diagnostic setting for the resource",
                        "operation": "Set Diagnostic Setting",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/IotHubs/diagnosticSettings/write"
                    },
                    {
                      "display": {
                        "description": "Gets the available metrics for the IotHub service",
                        "operation": "Read IotHub service metric definitions",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/IotHubs/metricDefinitions/read"
                    },
                    {
                      "display": {
                        "description": "Gets the available log definitions for the IotHub Service",
                        "operation": "Read IotHub service log definitions",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/IotHubs/logDefinitions/read"
                    },
                    {
                      "display": {
                        "description": "Get All ResourceProvider Operations",
                        "operation": "Get All ResourceProvider Operations",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/operations/Read"
                    },
                    {
                      "display": {
                        "description": "Check If IotHub name is available",
                        "operation": "Check If IotHub name is available",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/checkNameAvailability/Action"
                    },
                    {
                      "display": {
                        "description": "Get subscription usage details for this provider.",
                        "operation": "Get Subscription Usages",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/usages/Read"
                    },
                    {
                      "display": {
                        "description": "Gets the IotHub resource(s)",
                        "operation": "Get IotHub(s)",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/iotHubs/Read"
                    },
                    {
                      "display": {
                        "description": "Create or update IotHub Resource",
                        "operation": "Create or update IotHub Resource",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/iotHubs/Write"
                    },
                    {
                      "display": {
                        "description": "Delete IotHub Resource",
                        "operation": "Delete IotHub Resource",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/iotHubs/Delete"
                    },
                    {
                      "display": {
                        "description": "Get IotHub Statistics",
                        "operation": "Get IotHub Statistics",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/iotHubs/iotHubStats/Read"
                    },
                    {
                      "display": {
                        "description": "Get valid IotHub Skus",
                        "operation": "Get valid IotHub Skus",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/iotHubs/skus/Read"
                    },
                    {
                      "display": {
                        "description": "Get all IotHub Keys",
                        "operation": "Get all IotHub Keys",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/iotHubs/listkeys/Action"
                    },
                    {
                      "display": {
                        "description": "Get IotHub Key for the given name",
                        "operation": "Get IotHub Key for the given name",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/iotHubs/iotHubKeys/listkeys/Action"
                    },
                    {
                      "display": {
                        "description": "Create EventHub Consumer Group",
                        "operation": "Create EventHub Consumer Group",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/iotHubs/eventHubEndpoints/consumerGroups/Write"
                    },
                    {
                      "display": {
                        "description": "Get EventHub Consumer Group(s)",
                        "operation": "Get EventHub Consumer Group(s)",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/iotHubs/eventHubEndpoints/consumerGroups/Read"
                    },
                    {
                      "display": {
                        "description": "Delete EventHub Consumer Group",
                        "operation": "Delete EventHub Consumer Group",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/iotHubs/eventHubEndpoints/consumerGroups/Delete"
                    },
                    {
                      "display": {
                        "description": "Export Devices",
                        "operation": "Export Devices",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/iotHubs/exportDevices/Action"
                    },
                    {
                      "display": {
                        "description": "Import Devices",
                        "operation": "Import Devices",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/iotHubs/importDevices/Action"
                    },
                    {
                      "display": {
                        "description": "Get Job(s) details submitted on given IotHub",
                        "operation": "Get the Job(s) on IotHub",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/iotHubs/jobs/Read"
                    },
                    {
                      "display": {
                        "description": "Get Quota Metrics",
                        "operation": "Get Quota Metrics",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/iotHubs/quotaMetrics/Read"
                    },
                    {
                      "display": {
                        "description": "Test a message against all existing Routes",
                        "operation": "Routing Rule Test All",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/iotHubs/routing/routes/$testall/Action"
                    },
                    {
                      "display": {
                        "description": "Test a message against a provided test Route",
                        "operation": "Routing Rule Test Route",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/iotHubs/routing/routes/$testnew/Action"
                    },
                    {
                      "display": {
                        "description": "Gets the health of all routing Endpoints for an IotHub",
                        "operation": "Get Endpoint Health",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/iotHubs/routingEndpointsHealth/Read"
                    },
                    {
                      "display": {
                        "description": "Gets the diagnostic setting for the resource",
                        "operation": "Get Diagnostic Setting",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/ProvisioningServices/diagnosticSettings/read"
                    },
                    {
                      "display": {
                        "description": "Creates or updates the diagnostic setting for the resource",
                        "operation": "Set Diagnostic Setting",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/ProvisioningServices/diagnosticSettings/write"
                    },
                    {
                      "display": {
                        "description": "Gets the available metrics for the DPS service",
                        "operation": "Read DPS service metric definitions",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/ProvisioningServices/metricDefinitions/read"
                    },
                    {
                      "display": {
                        "description": "Gets the available log definitions for the DPS Service",
                        "operation": "Read DPS service log definitions",
                        "provider": "Microsoft Devices",
                        "resource": "IotHubs"
                      },
                      "name": "Microsoft.Devices/ProvisioningServices/logDefinitions/read"
                    },
                    {
                      "display": {
                        "description": "Check If Provisioning Service name is available",
                        "operation": "Check If Provisioning Service name is available",
                        "provider": "Microsoft Devices",
                        "resource": "ProvisioningServives"
                      },
                      "name": "Microsoft.Devices/checkProvisioningServiceNameAvailability/Action"
                    },
                    {
                      "display": {
                        "description": "Get Provisioning Service resource",
                        "operation": "Get Provisioning Service resource",
                        "provider": "Microsoft Devices",
                        "resource": "ProvisioningServices"
                      },
                      "name": "Microsoft.Devices/provisioningServices/Read"
                    },
                    {
                      "display": {
                        "description": "Create Provisioning Service resource",
                        "operation": "Create Provisioning Service resource",
                        "provider": "Microsoft Devices",
                        "resource": "ProvisioningServices"
                      },
                      "name": "Microsoft.Devices/provisioningServices/Write"
                    },
                    {
                      "display": {
                        "description": "Delete Provisioning Service resource",
                        "operation": "Delete Provisioning Service resource",
                        "provider": "Microsoft Devices",
                        "resource": "ProvisioningServices"
                      },
                      "name": "Microsoft.Devices/provisioningServices/Delete"
                    },
                    {
                      "display": {
                        "description": "Delete Provisioning Service resource",
                        "operation": "Delete Provisioning Service resource",
                        "provider": "Microsoft Devices",
                        "resource": "ProvisioningServices"
                      },
                      "name": "Microsoft.Devices/provisioningServices/skus/Read"
                    },
                    {
                      "display": {
                        "description": "get security related metadata",
                        "operation": "get security related metadata",
                        "provider": "Microsoft Devices",
                        "resource": "ProvisioningServices"
                      },
                      "name": "Microsoft.Devices/provisioningServices/listkeys/Action"
                    }
                  ]
                }
              }
            }
          }
        },
        "x-ms-pageable": {
          "nextLinkName": "nextLink"
        }
      }
    },
    "/subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkProvisioningServiceNameAvailability": {
      "post": {
        "description": "Check if a provisioning service name is available.",
        "operationId": "IotDpsResource_CheckNameAvailability",
        "parameters": [
          {
            "$ref": "#/parameters/subscriptionId"
          },
          {
            "description": "Set the name parameter in the OperationInputs structure to the name of the provisioning service to check.",
            "in": "body",
            "name": "arguments",
            "required": true,
            "schema": {
              "$ref": "#/definitions/OperationInputs"
            }
          },
          {
            "$ref": "#/parameters/api-version"
          }
        ],
        "responses": {
          "200": {
            "description": "This is a synchronous operation. The body contains a JSON-serialized response that specifies whether the provisioning service name is available. If the name is not available, the body contains the reason.",
            "schema": {
              "$ref": "#/definitions/NameAvailabilityInfo"
            }
          },
          "default": {
            "description": "Default error response.",
            "schema": {
              "$ref": "#/definitions/ErrorDetails"
            }
          }
        },
        "summary": "Check if a provisioning service name is available.",
        "tags": [
          "POST"
        ],
        "x-ms-examples": {
          "DPSCheckName": {
            "parameters": {
              "api-version": "2017-08-21-preview",
              "arguments": {
                "name": "test213123"
              },
              "subscriptionId": "91d12660-3dec-467a-be2a-213b5544ddc0"
            },
            "responses": {
              "200": {
                "body": {
                  "message": "name is valid",
                  "nameAvailable": true,
                  "reason": "Invalid"
                }
              }
            }
          }
        }
      }
    },
    "/subscriptions/{subscriptionId}/providers/Microsoft.Devices/provisioningServices": {
      "get": {
        "description": "Get all the provisioning services in a subscription.",
        "operationId": "IotDpsResource_ListBySubscription",
        "parameters": [
          {
            "$ref": "#/parameters/subscriptionId"
          },
          {
            "$ref": "#/parameters/api-version"
          }
        ],
        "responses": {
          "200": {
            "description": "This is a synchronous operation. The body contains a JSON-serialized array of the metadata from all the provisioning services in the subscription.",
            "schema": {
              "$ref": "#/definitions/ProvisioningServiceDescriptionListResult"
            }
          },
          "default": {
            "description": "Default error response.",
            "schema": {
              "$ref": "#/definitions/ErrorDetails"
            }
          }
        },
        "summary": "Get all the provisioning services in a subscription.",
        "tags": [
          "GET"
        ],
        "x-ms-examples": {
          "DPSListBySubscription": {
            "parameters": {
              "api-version": "2017-08-21-preview",
              "subscriptionId": "91d12660-3dec-467a-be2a-213b5544ddc0"
            },
            "responses": {
              "200": {
                "body": {
                  "value": [
                    {
                      "etag": "AAAAAAAADGk=",
                      "id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService",
                      "location": "eastus",
                      "name": "myFirstProvisioningService",
                      "properties": {
                        "allocationPolicy": "Hashed",
                        "deviceProvisioningHostName": "global.azure-devices-provisioning.net",
                        "idScope": "0ne00000012",
                        "serviceOperationsHostName": "myFirstProvisioningService.azure-devices-provisioning.net",
                        "state": "Active"
                      },
                      "sku": {
                        "capacity": 1,
                        "name": "S1",
                        "tier": "Standard"
                      },
                      "tags": {},
                      "type": "Microsoft.Devices/ProvisioningServices"
                    },
                    {
                      "etag": "AAAAAAAADGk=",
                      "id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/ProvisioningServices/mySecondProvisioningService",
                      "location": "eastus",
                      "name": "mySecondProvisioningService",
                      "properties": {
                        "allocationPolicy": "Hashed",
                        "deviceProvisioningHostName": "global.azure-devices-provisioning.net",
                        "idScope": "0ne00000012",
                        "serviceOperationsHostName": "myFirstProvisioningService.azure-devices-provisioning.net",
                        "state": "Active"
                      },
                      "sku": {
                        "capacity": 1,
                        "name": "S1",
                        "tier": "Standard"
                      },
                      "tags": {},
                      "type": "Microsoft.Devices/ProvisioningServices"
                    }
                  ]
                }
              }
            }
          }
        },
        "x-ms-pageable": {
          "nextLinkName": "nextLink"
        }
      }
    },
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices": {
      "get": {
        "consumes": [],
        "description": "Get a list of all provisioning services in the given resource group.",
        "operationId": "IotDpsResource_ListByResourceGroup",
        "parameters": [
          {
            "$ref": "#/parameters/subscriptionId"
          },
          {
            "description": "Resource group identifier.",
            "in": "path",
            "name": "resourceGroupName",
            "required": true,
            "type": "string"
          },
          {
            "$ref": "#/parameters/api-version"
          }
        ],
        "responses": {
          "200": {
            "description": "List of provisioning services in the resource group.",
            "schema": {
              "$ref": "#/definitions/ProvisioningServiceDescriptionListResult"
            }
          },
          "default": {
            "description": "Default error response.",
            "schema": {
              "$ref": "#/definitions/ErrorDetails"
            }
          }
        },
        "tags": [
          "GET"
        ],
        "x-ms-examples": {
          "DPSListByResourceGroup": {
            "parameters": {
              "api-version": "2017-08-21-preview",
              "resourceGroupName": "myResourceGroup",
              "subscriptionId": "91d12660-3dec-467a-be2a-213b5544ddc0"
            },
            "responses": {
              "200": {
                "body": {
                  "value": [
                    {
                      "etag": "AAAAAAAADGk=",
                      "id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService",
                      "location": "eastus",
                      "name": "myFirstProvisioningService",
                      "properties": {
                        "allocationPolicy": "Hashed",
                        "deviceProvisioningHostName": "global.azure-devices-provisioning.net",
                        "idScope": "0ne00000012",
                        "serviceOperationsHostName": "myFirstProvisioningService.azure-devices-provisioning.net",
                        "state": "Active"
                      },
                      "sku": {
                        "capacity": 1,
                        "name": "S1",
                        "tier": "Standard"
                      },
                      "tags": {},
                      "type": "Microsoft.Devices/ProvisioningServices"
                    },
                    {
                      "etag": "AAAAAAAADGk=",
                      "id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/ProvisioningServices/mySecondProvisioningService",
                      "location": "eastus",
                      "name": "mySecondProvisioningService",
                      "properties": {
                        "allocationPolicy": "Hashed",
                        "deviceProvisioningHostName": "global.azure-devices-provisioning.net",
                        "idScope": "0ne00000012",
                        "serviceOperationsHostName": "mySecondProvisioningService.azure-devices-provisioning.net",
                        "state": "Active"
                      },
                      "sku": {
                        "capacity": 1,
                        "name": "S1",
                        "tier": "Standard"
                      },
                      "tags": {},
                      "type": "Microsoft.Devices/ProvisioningServices"
                    }
                  ]
                }
              }
            }
          }
        },
        "x-ms-pageable": {
          "nextLinkName": "nextLink"
        }
      }
    },
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}": {
      "delete": {
        "consumes": [],
        "operationId": "IotDpsResource_Delete",
        "parameters": [
          {
            "description": "Name of provisioning service to delete.",
            "in": "path",
            "name": "provisioningServiceName",
            "required": true,
            "type": "string"
          },
          {
            "$ref": "#/parameters/subscriptionId"
          },
          {
            "description": "Resource group identifier.",
            "in": "path",
            "name": "resourceGroupName",
            "required": true,
            "type": "string"
          },
          {
            "$ref": "#/parameters/api-version"
          }
        ],
        "responses": {
          "200": {
            "description": "This is returned as a response to the status polling request for the delete operation. The body contains the resource representation that indicates a transitional provisioning state."
          },
          "202": {
            "description": "The provisioning service resource provider always returns a 202 Accepted status code with valid Location and Retry-After headers. The resource provider also sets the Azure-AsyncOperation header with a URL that points to the operation resource for this operation. Subsequent GET attempts on the resource after a DELETE operation return a resource representation that indicates a transitional provisioning state (such as Terminating). To retrieve the status of the operation, a client can either poll the URL returned in the Location header after the Retry-After interval, get the provisioning service status directly, or query the operation resource."
          },
          "204": {
            "description": "Once the long running delete operation completes successfully, a 204 No Content status code is returned when the status polling request finds the provisioning service metadata in the service and the status of the delete operation is set to a completed state."
          },
          "404": {
            "description": "After the long running delete operation completes successfully, a 404 Not Found is returned when the status polling request no longer finds the provisioning service metadata in the service."
          },
          "default": {
            "description": "Default error response.",
            "schema": {
              "$ref": "#/definitions/ErrorDetails"
            }
          }
        },
        "tags": [
          "DELETE"
        ],
        "x-ms-examples": {
          "DPSDelete": {
            "parameters": {
              "api-version": "2017-08-21-preview",
              "provisioningServiceName": "myFirstProvisioningService",
              "resourceGroupName": "myResourceGroup",
              "subscriptionId": "91d12660-3dec-467a-be2a-213b5544ddc0"
            },
            "responses": {
              "200": {},
              "202": {},
              "204": {},
              "404": {}
            }
          }
        },
        "x-ms-long-running-operation": true
      },
      "get": {
        "description": "Get the non-security related metadata of the provisioning service.",
        "operationId": "IotDpsResource_Get",
        "parameters": [
          {
            "description": "Name of the provisioning service to retrieve.",
            "in": "path",
            "name": "provisioningServiceName",
            "required": true,
            "type": "string"
          },
          {
            "$ref": "#/parameters/subscriptionId"
          },
          {
            "description": "Resource group name.",
            "in": "path",
            "name": "resourceGroupName",
            "required": true,
            "type": "string"
          },
          {
            "$ref": "#/parameters/api-version"
          }
        ],
        "responses": {
          "200": {
            "description": "Provisioning service description with no keys is included in the response.",
            "schema": {
              "$ref": "#/definitions/ProvisioningServiceDescription"
            }
          },
          "default": {
            "description": "Default error response",
            "schema": {
              "$ref": "#/definitions/ErrorDetails"
            }
          }
        },
        "summary": "Get the non-security related metadata of the provisioning service.",
        "tags": [
          "GET"
        ],
        "x-ms-examples": {
          "DPSGet": {
            "parameters": {
              "api-version": "2017-08-21-preview",
              "provisioningServiceName": "myFirstProvisioningService",
              "resourceGroupName": "myResourceGroup",
              "subscriptionId": "91d12660-3dec-467a-be2a-213b5544ddc0"
            },
            "responses": {
              "200": {
                "body": {
                  "etag": "AAAAAAAADGk=",
                  "id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService",
                  "location": "eastus",
                  "name": "myFirstProvisioningService",
                  "properties": {
                    "allocationPolicy": "Hashed",
                    "authorizationPolicies": [],
                    "deviceProvisioningHostName": "global.azure-devices-provisioning.net",
                    "idScope": "0ne00000012",
                    "serviceOperationsHostName": "myFirstProvisioningService.azure-devices-provisioning.net",
                    "state": "Active"
                  },
                  "sku": {
                    "capacity": 1,
                    "name": "S1",
                    "tier": "Standard"
                  },
                  "tags": {},
                  "type": "Microsoft.Devices/ProvisioningServices"
                }
              }
            }
          }
        }
      },
      "put": {
        "description": "Create or update the metadata of the provisioning service. The usual pattern to modify a property is to retrieve the provisioning service metadata and security metadata, and then combine them with the modified values in a new body to update the provisioning service.",
        "operationId": "IotDpsResource_CreateOrUpdate",
        "parameters": [
          {
            "$ref": "#/parameters/subscriptionId"
          },
          {
            "description": "Resource group identifier.",
            "in": "path",
            "name": "resourceGroupName",
            "required": true,
            "type": "string"
          },
          {
            "description": "Name of provisioning service to create or update.",
            "in": "path",
            "name": "provisioningServiceName",
            "required": true,
            "type": "string"
          },
          {
            "description": "Description of the provisioning service to create or update.",
            "in": "body",
            "name": "iotDpsDescription",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ProvisioningServiceDescription"
            }
          },
          {
            "$ref": "#/parameters/api-version"
          }
        ],
        "responses": {
          "200": {
            "description": "The body contains all the non-security properties of the provisioning service. Security-related properties are set to null.",
            "schema": {
              "$ref": "#/definitions/ProvisioningServiceDescription"
            }
          },
          "201": {
            "description": "This is a long running operation. The operation returns a 201 if the validation is complete. The response includes an Azure-AsyncOperation header that contains a status URL. Clients are expected to poll the status URL for the status of the operation. If successful, the operation returns HTTP status code of 201 (OK).",
            "schema": {
              "$ref": "#/definitions/ProvisioningServiceDescription"
            }
          },
          "default": {
            "description": "Default error response.",
            "schema": {
              "$ref": "#/definitions/ErrorDetails"
            }
          }
        },
        "summary": "Create or update the metadata of the provisioning service.",
        "tags": [
          "PUT"
        ],
        "x-ms-examples": {
          "DPSCreate": {
            "parameters": {
              "api-version": "2017-08-21-preview",
              "iotDpsDescription": {
                "location": "East US",
                "properties": {},
                "sku": {
                  "capacity": 1,
                  "name": "S1",
                  "tier": "Standard"
                },
                "tags": {},
                "type": "Microsoft.Devices/ProvisioningServices"
              },
              "provisioningServiceName": "myFirstProvisioningService",
              "resourceGroupName": "myResourceGroup",
              "subscriptionId": "91d12660-3dec-467a-be2a-213b5544ddc0"
            },
            "responses": {
              "200": {
                "body": {
                  "etag": "AAAAAAAADGk=",
                  "id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups//providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService",
                  "location": "eastus",
                  "name": "myFirstProvisioningService",
                  "properties": {
                    "allocationPolicy": "Hashed",
                    "authorizationPolicies": [],
                    "deviceProvisioningHostName": "global.azure-devices-provisioning.net",
                    "idScope": "0ne00000012",
                    "serviceOperationsHostName": "myFirstProvisioningService.azure-devices-provisioning.net",
                    "state": "Active"
                  },
                  "sku": {
                    "capacity": 1,
                    "name": "S1",
                    "tier": "Standard"
                  },
                  "tags": {},
                  "type": "Microsoft.Devices/ProvisioningServices"
                }
              },
              "201": {
                "body": {
                  "etag": "AAAAAAAADGk=",
                  "id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups//providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService",
                  "location": "eastus",
                  "name": "myFirstProvisioningService",
                  "properties": {
                    "allocationPolicy": "Hashed",
                    "authorizationPolicies": [],
                    "deviceProvisioningHostName": "global.azure-devices-provisioning.net",
                    "idScope": "0ne00000012",
                    "serviceOperationsHostName": "myFirstProvisioningService.azure-devices-provisioning.net",
                    "state": "Active"
                  },
                  "sku": {
                    "capacity": 1,
                    "name": "S1",
                    "tier": "Standard"
                  },
                  "tags": {},
                  "type": "Microsoft.Devices/ProvisioningServices"
                }
              }
            }
          }
        },
        "x-ms-long-running-operation": true
      }
    },
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates": {
      "get": {
        "consumes": [],
        "description": "Get all the certificates tied to the provisioning service.",
        "operationId": "DpsCertificates_List",
        "parameters": [
          {
            "$ref": "#/parameters/subscriptionId"
          },
          {
            "description": "Name of resource group.",
            "in": "path",
            "name": "resourceGroupName",
            "required": true,
            "type": "string"
          },
          {
            "description": "Name of provisioning service to retrieve certificates for.",
            "in": "path",
            "name": "provisioningServiceName",
            "required": true,
            "type": "string"
          },
          {
            "$ref": "#/parameters/api-version"
          }
        ],
        "responses": {
          "200": {
            "description": "List of certificate descriptions in a JSON-serialized array.",
            "schema": {
              "$ref": "#/definitions/CertificateListDescription"
            }
          },
          "default": {
            "description": "Default error response.",
            "schema": {
              "$ref": "#/definitions/ErrorDetails"
            }
          }
        },
        "tags": [
          "GET"
        ],
        "x-ms-examples": {
          "DPSGetCertificates": {
            "parameters": {
              "api-version": "2017-08-21-preview",
              "provisioningServiceName": "myFirstProvisioningService",
              "resourceGroupName": "myResourceGroup",
              "subscriptionId": "91d12660-3dec-467a-be2a-213b5544ddc0"
            },
            "responses": {
              "200": {
                "body": {
                  "value": [
                    {
                      "etag": "AAAAAAExpNs=",
                      "id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/andbuc-hub/certificates/cert",
                      "name": "cert",
                      "properties": {
                        "created": "Thu, 12 Oct 2017 19:23:50 GMT",
                        "expiry": "Sat, 31 Dec 2039 23:59:59 GMT",
                        "isVerified": false,
                        "subject": "CN=testdevice1",
                        "thumbprint": "97388663832D0393C9246CAB4FBA2C8677185A25",
                        "updated": "Thu, 12 Oct 2017 19:23:50 GMT"
                      },
                      "type": "Microsoft.Devices/ProvisioningServices/Certificates"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}": {
      "delete": {
        "consumes": [],
        "operationId": "DpsCertificate_Delete",
        "parameters": [
          {
            "$ref": "#/parameters/subscriptionId"
          },
          {
            "description": "Resource group identifier.",
            "in": "path",
            "name": "resourceGroupName",
            "required": true,
            "type": "string"
          },
          {
            "description": "ETag of the certificate",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "type": "string"
          },
          {
            "description": "The name of the provisioning service.",
            "in": "path",
            "name": "provisioningServiceName",
            "required": true,
            "type": "string"
          },
          {
            "description": "This is a mandatory field, and is the logical name of the certificate that the provisioning service will access by.",
            "in": "path",
            "name": "certificateName",
            "required": true,
            "type": "string"
          },
          {
            "description": "This is optional, and it is the Common Name of the certificate.",
            "in": "query",
            "name": "certificate.name",
            "required": false,
            "type": "string"
          },
          {
            "description": "Raw data within the certificate.",
            "format": "byte",
            "in": "query",
            "name": "certificate.rawBytes",
            "required": false,
            "type": "string"
          },
          {
            "description": "Indicates if certificate has been verified by owner of the private key.",
            "in": "query",
            "name": "certificate.isVerified",
            "required": false,
            "type": "boolean"
          },
          {
            "description": "A description that mentions the purpose of the certificate.",
            "enum": [
              "clientAuthentication",
              "serverAuthentication"
            ],
            "in": "query",
            "name": "certificate.purpose",
            "required": false,
            "type": "string",
            "x-ms-enum": {
              "modelAsString": true,
              "name": "CertificatePurpose"
            }
          },
          {
            "description": "Time the certificate is created.",
            "format": "date-time",
            "in": "query",
            "name": "certificate.created",
            "required": false,
            "type": "string"
          },
          {
            "description": "Time the certificate is last updated.",
            "format": "date-time",
            "in": "query",
            "name": "certificate.lastUpdated",
            "required": false,
            "type": "string"
          },
          {
            "description": "Indicates if the certificate contains a private key.",
            "in": "query",
            "name": "certificate.hasPrivateKey",
            "required": false,
            "type": "boolean"
          },
          {
            "description": "Random number generated to indicate Proof of Possession.",
            "in": "query",
            "name": "certificate.nonce",
            "required": false,
            "type": "string"
          },
          {
            "$ref": "#/parameters/api-version"
          }
        ],
        "responses": {
          "200": {
            "description": "OK."
          },
          "204": {
            "description": "No content."
          },
          "default": {
            "description": "Default error response.",
            "schema": {
              "$ref": "#/definitions/ErrorDetails"
            }
          }
        },
        "tags": [
          "DELETE"
        ],
        "x-ms-examples": {
          "DPSDeleteCertificate": {
            "parameters": {
              "If-Match": "AAAAAAAADGk=",
              "api-version": "2017-08-21-preview",
              "certificateName": "cert",
              "provisioningServiceName": "myFirstProvisioningService",
              "resourceGroupName": "myResourceGroup",
              "subscriptionId": "91d12660-3dec-467a-be2a-213b5544ddc0"
            },
            "responses": {
              "200": {},
              "204": {}
            }
          }
        }
      },
      "get": {
        "consumes": [],
        "description": "Get the certificate from the provisioning service.",
        "operationId": "DpsCertificate_Get",
        "parameters": [
          {
            "description": "Name of the certificate to retrieve.",
            "in": "path",
            "name": "certificateName",
            "required": true,
            "type": "string"
          },
          {
            "$ref": "#/parameters/subscriptionId"
          },
          {
            "description": "Resource group identifier.",
            "in": "path",
            "name": "resourceGroupName",
            "required": true,
            "type": "string"
          },
          {
            "description": "Name of the provisioning service the certificate is associated with.",
            "in": "path",
            "name": "provisioningServiceName",
            "required": true,
            "type": "string"
          },
          {
            "description": "ETag of the certificate.",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "type": "string"
          },
          {
            "$ref": "#/parameters/api-version"
          }
        ],
        "responses": {
          "200": {
            "description": "Metadata for the specified certificate.",
            "schema": {
              "$ref": "#/definitions/CertificateResponse"
            }
          },
          "default": {
            "description": "Default error response.",
            "schema": {
              "$ref": "#/definitions/ErrorDetails"
            }
          }
        },
        "tags": [
          "GET"
        ],
        "x-ms-examples": {
          "DPSGetCertificate": {
            "parameters": {
              "api-version": "2017-08-21-preview",
              "certificateName": "cert",
              "provisioningServiceName": "myFirstProvisioningService",
              "resourceGroupName": "myResourceGroup",
              "subscriptionId": "91d12660-3dec-467a-be2a-213b5544ddc0"
            },
            "responses": {
              "200": {
                "body": {
                  "etag": "AAAAAAExpNs=",
                  "id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/andbuc-hub/certificates/cert",
                  "name": "cert",
                  "properties": {
                    "created": "Thu, 12 Oct 2017 19:23:50 GMT",
                    "expiry": "Sat, 31 Dec 2039 23:59:59 GMT",
                    "isVerified": false,
                    "subject": "CN=testdevice1",
                    "thumbprint": "97388663832D0393C9246CAB4FBA2C8677185A25",
                    "updated": "Thu, 12 Oct 2017 19:23:50 GMT"
                  },
                  "type": "Microsoft.Devices/ProvisioningServices/Certificates"
                }
              }
            }
          }
        }
      },
      "put": {
        "deprecated": false,
        "description": "Add new certificate or update an existing certificate.",
        "operationId": "DpsCertificate_CreateOrUpdate",
        "parameters": [
          {
            "$ref": "#/parameters/api-version"
          },
          {
            "$ref": "#/parameters/subscriptionId"
          },
          {
            "description": "Resource group identifier.",
            "in": "path",
            "name": "resourceGroupName",
            "required": true,
            "type": "string"
          },
          {
            "description": "The name of the provisioning service.",
            "in": "path",
            "name": "provisioningServiceName",
            "required": true,
            "type": "string"
          },
          {
            "description": "The name of the certificate create or update.",
            "in": "path",
            "maxLength": 256,
            "name": "certificateName",
            "required": true,
            "type": "string"
          },
          {
            "description": "The certificate body.",
            "in": "body",
            "name": "certificateDescription",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CertificateBodyDescription"
            }
          },
          {
            "description": "ETag of the certificate. This is required to update an existing certificate, and ignored while creating a brand new certificate.",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "If certificate already exist and update was successful, the operation returns HTTP status code of 201 (OK).",
            "schema": {
              "$ref": "#/definitions/CertificateResponse"
            }
          },
          "default": {
            "description": "Default error response.",
            "schema": {
              "$ref": "#/definitions/ErrorDetails"
            }
          }
        },
        "summary": "Upload the certificate to the provisioning service.",
        "tags": [
          "PUT"
        ],
        "x-ms-examples": {
          "DPSCreateOrUpdateCertificate": {
            "parameters": {
              "api-version": "2017-08-21-preview",
              "certificateDescription": {
                "certificate": "############################################"
              },
              "certificateName": "cert",
              "provisioningServiceName": "myFirstProvisioningService",
              "resourceGroupName": "myResourceGroup",
              "subscriptionId": "91d12660-3dec-467a-be2a-213b5544ddc0"
            },
            "responses": {
              "200": {
                "body": {
                  "etag": "AAAAAAExpNs=",
                  "id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/ProvisioningServives/myFirstProvisioningService/certificates/cert",
                  "name": "cert",
                  "properties": {
                    "created": "Thu, 12 Oct 2017 19:23:50 GMT",
                    "expiry": "Sat, 31 Dec 2039 23:59:59 GMT",
                    "isVerified": false,
                    "subject": "CN=testdevice1",
                    "thumbprint": "97388663832D0393C9246CAB4FBA2C8677185A25",
                    "updated": "Thu, 12 Oct 2017 19:23:50 GMT"
                  },
                  "type": "Microsoft.Devices/ProvisioningServices/Certificates"
                }
              }
            }
          }
        }
      }
    },
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}/generateVerificationCode": {
      "post": {
        "description": "Generate verification code for Proof of Possession.",
        "operationId": "DpsCertificate_GenerateVerificationCode",
        "parameters": [
          {
            "description": "The mandatory logical name of the certificate, that the provisioning service uses to access.",
            "in": "path",
            "name": "certificateName",
            "required": true,
            "type": "string"
          },
          {
            "description": "ETag of the certificate. This is required to update an existing certificate, and ignored while creating a brand new certificate.",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "type": "string"
          },
          {
            "$ref": "#/parameters/subscriptionId"
          },
          {
            "description": "name of resource group.",
            "in": "path",
            "name": "resourceGroupName",
            "required": true,
            "type": "string"
          },
          {
            "description": "Name of provisioning service.",
            "in": "path",
            "name": "provisioningServiceName",
            "required": true,
            "type": "string"
          },
          {
            "description": "Common Name for the certificate.",
            "in": "query",
            "name": "certificate.name",
            "required": false,
            "type": "string"
          },
          {
            "description": "Raw data of certificate.",
            "format": "byte",
            "in": "query",
            "name": "certificate.rawBytes",
            "required": false,
            "type": "string"
          },
          {
            "description": "Indicates if the certificate has been verified by owner of the private key.",
            "in": "query",
            "name": "certificate.isVerified",
            "required": false,
            "type": "boolean"
          },
          {
            "description": "Description mentioning the purpose of the certificate.",
            "enum": [
              "clientAuthentication",
              "serverAuthentication"
            ],
            "in": "query",
            "name": "certificate.purpose",
            "required": false,
            "type": "string",
            "x-ms-enum": {
              "modelAsString": true,
              "name": "CertificatePurpose"
            }
          },
          {
            "description": "Certificate creation time.",
            "format": "date-time",
            "in": "query",
            "name": "certificate.created",
            "required": false,
            "type": "string"
          },
          {
            "description": "Certificate last updated time.",
            "format": "date-time",
            "in": "query",
            "name": "certificate.lastUpdated",
            "required": false,
            "type": "string"
          },
          {
            "description": "Indicates if the certificate contains private key.",
            "in": "query",
            "name": "certificate.hasPrivateKey",
            "required": false,
            "type": "boolean"
          },
          {
            "description": "Random number generated to indicate Proof of Possession.",
            "in": "query",
            "name": "certificate.nonce",
            "required": false,
            "type": "string"
          },
          {
            "$ref": "#/parameters/api-version"
          }
        ],
        "responses": {
          "200": {
            "description": "Generated verification code for that certificate is returned.",
            "schema": {
              "$ref": "#/definitions/VerificationCodeResponse"
            }
          },
          "default": {
            "description": "Default error response.",
            "schema": {
              "$ref": "#/definitions/ErrorDetails"
            }
          }
        },
        "tags": [
          "POST"
        ],
        "x-ms-examples": {
          "DPSGenerateVerificationCode": {
            "parameters": {
              "If-Match": "AAAAAAAADGk=",
              "api-version": "2017-08-21-preview",
              "certificateName": "cert",
              "provisioningServiceName": "myFirstProvisioningService",
              "resourceGroupName": "myResourceGroup",
              "subscriptionId": "91d12660-3dec-467a-be2a-213b5544ddc0"
            },
            "responses": {
              "200": {
                "body": {
                  "created": "Thu, 12 Oct 2017 19:23:50 GMT",
                  "expiry": "Sat, 31 Dec 2039 23:59:59 GMT",
                  "isVerified": false,
                  "name": "cert",
                  "subject": "CN=andbucdevice1",
                  "thumbprint": "##############################",
                  "updated": "Thu, 12 Oct 2017 19:26:56 GMT",
                  "verificationCode": "##################################"
                }
              }
            }
          }
        }
      }
    },
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}/verify": {
      "post": {
        "description": "Verifies certificate for the provisioning service.",
        "operationId": "DpsCertificate_VerifyCertificate",
        "parameters": [
          {
            "description": "The mandatory logical name of the certificate, that the provisioning service uses to access.",
            "in": "path",
            "name": "certificateName",
            "required": true,
            "type": "string"
          },
          {
            "description": "ETag of the certificate.",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "type": "string"
          },
          {
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/VerificationCodeRequest"
            }
          },
          {
            "$ref": "#/parameters/subscriptionId"
          },
          {
            "description": "Resource group name.",
            "in": "path",
            "name": "resourceGroupName",
            "required": true,
            "type": "string"
          },
          {
            "description": "Provisioning service name.",
            "in": "path",
            "name": "provisioningServiceName",
            "required": true,
            "type": "string"
          },
          {
            "description": "Common Name for the certificate.",
            "in": "query",
            "name": "certificate.name",
            "required": false,
            "type": "string"
          },
          {
            "description": "Raw data of certificate.",
            "format": "byte",
            "in": "query",
            "name": "certificate.rawBytes",
            "required": false,
            "type": "string"
          },
          {
            "description": "Indicates if the certificate has been verified by owner of the private key.",
            "in": "query",
            "name": "certificate.isVerified",
            "required": false,
            "type": "boolean"
          },
          {
            "description": "Describe the purpose of the certificate.",
            "enum": [
              "clientAuthentication",
              "serverAuthentication"
            ],
            "in": "query",
            "name": "certificate.purpose",
            "required": false,
            "type": "string",
            "x-ms-enum": {
              "modelAsString": true,
              "name": "CertificatePurpose"
            }
          },
          {
            "description": "Certificate creation time.",
            "format": "date-time",
            "in": "query",
            "name": "certificate.created",
            "required": false,
            "type": "string"
          },
          {
            "description": "Certificate last updated time.",
            "format": "date-time",
            "in": "query",
            "name": "certificate.lastUpdated",
            "required": false,
            "type": "string"
          },
          {
            "description": "Indicates if the certificate contains private key.",
            "in": "query",
            "name": "certificate.hasPrivateKey",
            "required": false,
            "type": "boolean"
          },
          {
            "description": "Random number generated to indicate Proof of Possession.",
            "in": "query",
            "name": "certificate.nonce",
            "required": false,
            "type": "string"
          },
          {
            "$ref": "#/parameters/api-version"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/CertificateResponse"
            }
          },
          "default": {
            "description": "Default error response.",
            "schema": {
              "$ref": "#/definitions/ErrorDetails"
            }
          }
        },
        "tags": [
          "POST"
        ],
        "x-ms-examples": {
          "DPSVerifyCertificate": {
            "parameters": {
              "If-Match": "AAAAAAAADGk=",
              "api-version": "2017-08-21-preview",
              "certificateName": "cert",
              "provisioningServiceName": "myFirstProvisioningService",
              "request": {
                "certificate": "#####################################"
              },
              "resourceGroupName": "myResourceGroup",
              "subscriptionId": "91d12660-3dec-467a-be2a-213b5544ddc0"
            },
            "responses": {
              "200": {
                "body": {
                  "etag": "AAAAAAExpTQ=",
                  "id": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/ProvisioningServices/myFirstProvisioningService/certificates/cert",
                  "name": "cert",
                  "properties": {
                    "created": "Thu, 12 Oct 2017 19:23:50 GMT",
                    "expiry": "Sat, 31 Dec 2039 23:59:59 GMT",
                    "isVerified": true,
                    "subject": "CN=andbucdevice1",
                    "thumbprint": "97388663832D0393C9246CAB4FBA2C8677185A25",
                    "updated": "Thu, 12 Oct 2017 19:26:56 GMT"
                  },
                  "type": "Microsoft.Devices/ProvisioningServices/Certificates"
                }
              }
            }
          }
        }
      }
    },
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/keys/{keyName}/listkeys": {
      "post": {
        "description": "Get a shared access policy by name from a provisioning service.",
        "operationId": "IotDpsResource_GetKeysForKeyName",
        "parameters": [
          {
            "description": "Name of the provisioning service.",
            "in": "path",
            "name": "provisioningServiceName",
            "required": true,
            "type": "string"
          },
          {
            "description": "Logical key name to get key-values for.",
            "in": "path",
            "name": "keyName",
            "required": true,
            "type": "string"
          },
          {
            "$ref": "#/parameters/subscriptionId"
          },
          {
            "description": "The name of the resource group that contains the provisioning service.",
            "in": "path",
            "name": "resourceGroupName",
            "required": true,
            "type": "string"
          },
          {
            "$ref": "#/parameters/api-version"
          }
        ],
        "responses": {
          "200": {
            "description": "This is a synchronous operation. The body contains a JSON-serialized shared access policy, including keys, that you can use to access one or more provisioning service endpoints.",
            "schema": {
              "$ref": "#/definitions/SharedAccessSignatureAuthorizationRule[AccessRightsDescription]"
            }
          },
          "default": {
            "description": "Default error response.",
            "schema": {
              "$ref": "#/definitions/ErrorDetails"
            }
          }
        },
        "summary": "Get a shared access policy by name from a provisioning service.",
        "tags": [
          "POST"
        ],
        "x-ms-examples": {
          "DPSGetKey": {
            "parameters": {
              "api-version": "2017-08-21-preview",
              "keyName": "testKey",
              "provisioningServiceName": "myFirstProvisioningService",
              "resourceGroupName": "myResourceGroup",
              "subscriptionId": "91d12660-3dec-467a-be2a-213b5544ddc0"
            },
            "responses": {
              "200": {
                "body": {
                  "keyName": "testKey",
                  "primaryKey": "##################################",
                  "rights": "RegistrationStatusWrite",
                  "secondaryKey": "################################"
                }
              }
            }
          }
        }
      }
    },
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/listkeys": {
      "post": {
        "description": "Get the security metadata for a provisioning service.",
        "operationId": "IotDpsResource_ListKeys",
        "parameters": [
          {
            "description": "The provisioning service name to get the shared access keys for.",
            "in": "path",
            "name": "provisioningServiceName",
            "required": true,
            "type": "string"
          },
          {
            "$ref": "#/parameters/subscriptionId"
          },
          {
            "description": "resource group name",
            "in": "path",
            "name": "resourceGroupName",
            "required": true,
            "type": "string"
          },
          {
            "$ref": "#/parameters/api-version"
          }
        ],
        "responses": {
          "200": {
            "description": "This is a synchronous operation. The body contains a JSON-serialized array of shared access policies, including keys, that you can use to access the provisioning service endpoints.",
            "schema": {
              "$ref": "#/definitions/SharedAccessSignatureAuthorizationRuleListResult"
            }
          },
          "default": {
            "description": "Default error response.",
            "schema": {
              "$ref": "#/definitions/ErrorDetails"
            }
          }
        },
        "summary": "Get the security metadata for a provisioning service.",
        "tags": [
          "POST"
        ],
        "x-ms-examples": {
          "DPSListKeys": {
            "parameters": {
              "api-version": "2017-08-21-preview",
              "provisioningServiceName": "myFirstProvisioningService",
              "resourceGroupName": "myResourceGroup",
              "subscriptionId": "91d12660-3dec-467a-be2a-213b5544ddc0"
            },
            "responses": {
              "200": {
                "body": {
                  "value": [
                    {
                      "keyName": "key1",
                      "primaryKey": "#####################################",
                      "rights": "ServiceConfig",
                      "secondaryKey": "###################################"
                    },
                    {
                      "keyName": "key2",
                      "primaryKey": "#######################################",
                      "rights": "ServiceConfig",
                      "secondaryKey": "####################################="
                    }
                  ]
                }
              }
            }
          }
        },
        "x-ms-pageable": {
          "nextLinkName": "nextLink"
        }
      }
    },
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/operationresults/{operationId}": {
      "get": {
        "consumes": [],
        "description": "Gets the status of a long running operation, such as create, update or delete a provisioning service.",
        "operationId": "IotDpsResource_GetOperationResult",
        "parameters": [
          {
            "description": "Operation id corresponding to long running operation. Use this to poll for the status.",
            "in": "path",
            "name": "operationId",
            "required": true,
            "type": "string"
          },
          {
            "$ref": "#/parameters/subscriptionId"
          },
          {
            "description": "Resource group identifier.",
            "in": "path",
            "name": "resourceGroupName",
            "required": true,
            "type": "string"
          },
          {
            "description": "Name of provisioning service that the operation is running on.",
            "in": "path",
            "name": "provisioningServiceName",
            "required": true,
            "type": "string"
          },
          {
            "default": "true",
            "description": "Async header used to poll on the status of the operation, obtained while creating the long running operation.",
            "in": "query",
            "name": "asyncinfo",
            "required": true,
            "type": "string"
          },
          {
            "$ref": "#/parameters/api-version"
          }
        ],
        "responses": {
          "200": {
            "description": "The status of the long running operation.",
            "schema": {
              "$ref": "#/definitions/AsyncOperationResult"
            }
          },
          "default": {
            "description": "Default error response.",
            "schema": {
              "$ref": "#/definitions/ErrorDetails"
            }
          }
        },
        "tags": [
          "GET"
        ],
        "x-ms-examples": {
          "DPSGetOperationResult": {
            "parameters": {
              "api-version": "2017-08-21-preview",
              "asyncinfo": "1508265712453",
              "operationId": "MTY5OTNmZDctODI5Yy00N2E2LTkxNDQtMDU1NGIyYzY1ZjRl",
              "provisioningServiceName": "myFirstProvisioningService",
              "resourceGroupName": "myResourceGroup",
              "subscriptionId": "91d12660-3dec-467a-be2a-213b5544ddc0"
            },
            "responses": {
              "200": {
                "body": {
                  "status": "Succeeded"
                }
              }
            }
          }
        }
      }
    },
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/skus": {
      "get": {
        "description": "Get the list of valid SKUs for a provisioning service.",
        "operationId": "IotDpsResource_listValidSkus",
        "parameters": [
          {
            "description": "Name of provisioning service.",
            "in": "path",
            "name": "provisioningServiceName",
            "required": true,
            "type": "string"
          },
          {
            "$ref": "#/parameters/subscriptionId"
          },
          {
            "description": "Name of resource group.",
            "in": "path",
            "name": "resourceGroupName",
            "required": true,
            "type": "string"
          },
          {
            "$ref": "#/parameters/api-version"
          }
        ],
        "responses": {
          "200": {
            "description": "This is a synchronous operation. The body contains a JSON-serialized array of the valid SKUs for this provisioning service.",
            "schema": {
              "$ref": "#/definitions/IotDpsSkuDefinitionListResult"
            }
          },
          "default": {
            "description": "Default error response.",
            "schema": {
              "$ref": "#/definitions/ErrorDetails"
            }
          }
        },
        "summary": "Get the list of valid SKUs for a provisioning service.",
        "tags": [
          "GET"
        ],
        "x-ms-examples": {
          "DPSGetValidSku": {
            "parameters": {
              "api-version": "2017-08-21-preview",
              "provisioningServiceName": "myFirstProvisioningService",
              "resourceGroupName": "myResourceGroup",
              "subscriptionId": "91d12660-3dec-467a-be2a-213b5544ddc0"
            },
            "responses": {
              "200": {
                "body": {
                  "value": [
                    {
                      "name": "S1"
                    }
                  ]
                }
              }
            }
          }
        },
        "x-ms-pageable": {
          "nextLinkName": "nextLink"
        }
      }
    }
  },
  "definitions": {
    "AsyncOperationResult": {
      "description": "Result of a long running operation.",
      "properties": {
        "error": {
          "$ref": "#/definitions/ErrorMesssage"
        },
        "status": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "CertificateBodyDescription": {
      "description": "The JSON-serialized X509 Certificate.",
      "properties": {
        "certificate": {
          "description": "Base-64 representation of the X509 leaf certificate .cer file or just .pem file content.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "CertificateListDescription": {
      "description": "The JSON-serialized array of Certificate objects.",
      "properties": {
        "value": {
          "description": "The array of Certificate objects.",
          "items": {
            "$ref": "#/definitions/CertificateResponse"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "CertificateProperties": {
      "description": "The description of an X509 CA Certificate.",
      "properties": {
        "created": {
          "description": "The certificate's creation date and time.",
          "format": "date-time-rfc1123",
          "readOnly": true,
          "type": "string"
        },
        "expiry": {
          "description": "The certificate's expiration date and time.",
          "format": "date-time-rfc1123",
          "readOnly": true,
          "type": "string"
        },
        "isVerified": {
          "description": "Determines whether certificate has been verified.",
          "readOnly": true,
          "type": "boolean"
        },
        "subject": {
          "description": "The certificate's subject name.",
          "readOnly": true,
          "type": "string"
        },
        "thumbprint": {
          "description": "The certificate's thumbprint.",
          "readOnly": true,
          "type": "string"
        },
        "updated": {
          "description": "The certificate's last update date and time.",
          "format": "date-time-rfc1123",
          "readOnly": true,
          "type": "string"
        }
      },
      "type": "object"
    },
    "CertificateResponse": {
      "description": "The X509 Certificate.",
      "properties": {
        "etag": {
          "description": "The entity tag.",
          "readOnly": true,
          "type": "string"
        },
        "id": {
          "description": "The resource identifier.",
          "readOnly": true,
          "type": "string"
        },
        "name": {
          "description": "The name of the certificate.",
          "readOnly": true,
          "type": "string"
        },
        "properties": {
          "$ref": "#/definitions/CertificateProperties"
        },
        "type": {
          "description": "The resource type.",
          "readOnly": true,
          "type": "string"
        }
      },
      "type": "object",
      "x-ms-azure-resource": true
    },
    "ErrorDetails": {
      "properties": {
        "code": {
          "description": "error code.",
          "readOnly": true,
          "type": "string"
        },
        "details": {
          "type": "string"
        },
        "httpStatusCode": {
          "readOnly": true,
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "ErrorMesssage": {
      "description": "Error response containing message and code.",
      "properties": {
        "code": {
          "type": "string"
        },
        "details": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "IotDpsPropertiesDescription": {
      "properties": {
        "allocationPolicy": {
          "description": "Allocation policy to be used by this provisioning service.",
          "enum": [
            "Hashed",
            "GeoLatency",
            "Static"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": true,
            "name": "AllocationPolicy"
          }
        },
        "authorizationPolicies": {
          "items": {
            "$ref": "#/definitions/SharedAccessSignatureAuthorizationRule[AccessRightsDescription]"
          },
          "type": "array"
        },
        "deviceProvisioningHostName": {
          "description": "Device endpoint for this provisioning service.",
          "readOnly": true,
          "type": "string"
        },
        "idScope": {
          "description": "Unique identifier of this provisioning service.",
          "readOnly": true,
          "type": "string"
        },
        "iotHubs": {
          "description": "List of IoT hubs assosciated with this provisioning service.",
          "items": {
            "$ref": "#/definitions/IotHubDefinitionDescription"
          },
          "type": "array"
        },
        "provisioningState": {
          "description": "The ARM provisioning state of the provisioning service.",
          "type": "string"
        },
        "serviceOperationsHostName": {
          "description": "Service endpoint for provisioning service.",
          "readOnly": true,
          "type": "string"
        },
        "state": {
          "description": "Current state of the provisioning service.",
          "enum": [
            "Activating",
            "Active",
            "Deleting",
            "Deleted",
            "ActivationFailed",
            "DeletionFailed",
            "Transitioning",
            "Suspending",
            "Suspended",
            "Resuming",
            "FailingOver",
            "FailoverFailed"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": true,
            "name": "state"
          }
        }
      },
      "type": "object"
    },
    "IotDpsSkuDefinition": {
      "description": "SKU definition in terms of tier and units.",
      "properties": {
        "name": {
          "enum": [
            "S1"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": true,
            "name": "IotDpsSku"
          }
        }
      },
      "type": "object"
    },
    "IotDpsSkuDefinitionListResult": {
      "description": "List of available SKUs.",
      "properties": {
        "nextLink": {
          "readOnly": true,
          "type": "string"
        },
        "value": {
          "items": {
            "$ref": "#/definitions/IotDpsSkuDefinition"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "IotDpsSkuInfo": {
      "description": "List of possible provisoning service SKUs.",
      "properties": {
        "capacity": {
          "description": "The number of services of the selected tier allowed in the subscription.",
          "format": "int64",
          "type": "integer"
        },
        "name": {
          "enum": [
            "S1"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": true,
            "name": "IotDpsSku"
          }
        },
        "tier": {
          "description": "Pricing tier of the provisioning service.",
          "readOnly": true,
          "type": "string"
        }
      },
      "type": "object"
    },
    "IotHubDefinitionDescription": {
      "description": "Description of the IoT hub.",
      "properties": {
        "allocationWeight": {
          "format": "int32",
          "type": "integer"
        },
        "applyAllocationPolicy": {
          "type": "boolean"
        },
        "connectionString": {
          "description": "Connection string og the IoT hub.",
          "type": "string"
        },
        "location": {
          "description": "ARM region of the IoT hub.",
          "type": "string"
        },
        "name": {
          "description": "Host name of the IoT hub.",
          "readOnly": true,
          "type": "string"
        }
      },
      "required": [
        "connectionString",
        "location"
      ],
      "type": "object"
    },
    "NameAvailabilityInfo": {
      "description": "Description of name availability.",
      "properties": {
        "message": {
          "type": "string"
        },
        "nameAvailable": {
          "type": "boolean"
        },
        "reason": {
          "enum": [
            "Invalid",
            "AlreadyExists"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": true,
            "name": "NameUnavailabilityReason"
          }
        }
      },
      "type": "object"
    },
    "Operation": {
      "description": "IoT Hub REST API operation.",
      "properties": {
        "display": {
          "description": "The object that represents the operation.",
          "properties": {
            "operation": {
              "description": "Name of the operation.",
              "readOnly": true,
              "type": "string"
            },
            "provider": {
              "description": "Service provider: Microsoft Devices.",
              "readOnly": true,
              "type": "string"
            },
            "resource": {
              "description": "Resource Type: ProvisioningServices.",
              "readOnly": true,
              "type": "string"
            }
          }
        },
        "name": {
          "description": "Operation name: {provider}/{resource}/{read | write | action | delete}",
          "readOnly": true,
          "type": "string"
        }
      },
      "type": "object"
    },
    "OperationInputs": {
      "description": "Input values for operation results call.",
      "properties": {
        "name": {
          "description": "The name of the Provisioning Service to check.",
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "type": "object"
    },
    "OperationListResult": {
      "description": "Result of the request to list IoT Hub operations. It contains a list of operations and a URL link to get the next set of results.",
      "properties": {
        "nextLink": {
          "description": "URL to get the next set of operation list results if there are any.",
          "readOnly": true,
          "type": "string"
        },
        "value": {
          "description": "List of IoT Hub operations supported by the Microsoft.Devices resource provider.",
          "items": {
            "$ref": "#/definitions/Operation"
          },
          "readOnly": true,
          "type": "array"
        }
      }
    },
    "ProvisioningServiceDescription": {
      "allOf": [
        {
          "$ref": "#/definitions/Resource"
        }
      ],
      "description": "The description of the provisioning service.",
      "properties": {
        "etag": {
          "description": "The Etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal ETag convention.",
          "type": "string"
        },
        "properties": {
          "$ref": "#/definitions/IotDpsPropertiesDescription"
        },
        "sku": {
          "$ref": "#/definitions/IotDpsSkuInfo"
        }
      },
      "required": [
        "sku",
        "properties"
      ],
      "type": "object"
    },
    "ProvisioningServiceDescriptionListResult": {
      "description": "List of provisioning service descriptions.",
      "properties": {
        "nextLink": {
          "readOnly": true,
          "type": "string"
        },
        "value": {
          "items": {
            "$ref": "#/definitions/ProvisioningServiceDescription"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "Resource": {
      "description": "The common properties of an Azure resource.",
      "properties": {
        "id": {
          "description": "The resource identifier.",
          "readOnly": true,
          "type": "string"
        },
        "location": {
          "description": "The resource location.",
          "type": "string"
        },
        "name": {
          "description": "The resource name.",
          "pattern": "^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$",
          "readOnly": true,
          "type": "string"
        },
        "tags": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "The resource tags.",
          "type": "object"
        },
        "type": {
          "description": "The resource type.",
          "readOnly": true,
          "type": "string"
        }
      },
      "required": [
        "location"
      ],
      "x-ms-azure-resource": true
    },
    "SharedAccessSignatureAuthorizationRuleListResult": {
      "description": "List of shared access keys.",
      "properties": {
        "nextLink": {
          "readOnly": true,
          "type": "string"
        },
        "value": {
          "items": {
            "$ref": "#/definitions/SharedAccessSignatureAuthorizationRule[AccessRightsDescription]"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "SharedAccessSignatureAuthorizationRule[AccessRightsDescription]": {
      "description": "Description of the shared access key.",
      "properties": {
        "keyName": {
          "description": "Name of the key.",
          "type": "string"
        },
        "primaryKey": {
          "description": "Primary SAS key value.",
          "type": "string"
        },
        "rights": {
          "description": "Rights that this key has.",
          "enum": [
            "ServiceConfig",
            "EnrollmentRead",
            "EnrollmentWrite",
            "DeviceConnect",
            "RegistrationStatusRead",
            "RegistrationStatusWrite"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": true,
            "name": "AccessRightsDescription"
          }
        },
        "secondaryKey": {
          "description": "Secondary SAS key value.",
          "type": "string"
        }
      },
      "required": [
        "keyName",
        "rights"
      ],
      "type": "object"
    },
    "VerificationCodeRequest": {
      "description": "Certificate to generate verification code for.",
      "properties": {
        "certificate": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "VerificationCodeResponse": {
      "description": "Description of the response of the verification code.",
      "properties": {
        "created": {
          "description": "Certificate created time.",
          "type": "string"
        },
        "etag": {
          "description": "Request etag.",
          "type": "string"
        },
        "expiry": {
          "description": "Code expiry.",
          "type": "string"
        },
        "isVerified": {
          "description": "Indicate if the certificate is verified by owner of private key.",
          "type": "boolean"
        },
        "name": {
          "description": "Name of certificate.",
          "type": "string"
        },
        "subject": {
          "description": "Certificate subject.",
          "type": "string"
        },
        "thumbprint": {
          "description": "Certificate thumbprint.",
          "type": "string"
        },
        "updated": {
          "description": "Certificate updated time.",
          "type": "string"
        },
        "verificationCode": {
          "description": "Verification code.",
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}