swagger: '2.0'
schemes:
  - https
host: management.azure.com
info:
  description: Use this API to manage the Windows IoT device services in your Azure subscription.
  title: DeviceServices
  version: '2019-06-01'
  x-apisguru-categories:
    - cloud
  x-logo:
    url: 'https://assets.onestore.ms/cdnfiles/onestorerolling-1606-01000/shell/v3/images/logo/microsoft.png'
  x-origin:
    - format: swagger
      url: 'https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/windowsiot/resource-manager/Microsoft.WindowsIoT/stable/2019-06-01/WindowsIotServices.json'
      version: '2.0'
  x-preferred: true
  x-providerName: azure.com
  x-serviceName: windowsiot-WindowsIotServices
  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:
  ApiVersionParameter:
    description: The version of the API.
    in: query
    name: api-version
    required: true
    type: string
  DeviceNameParameter:
    description: The name of the Windows IoT Device Service.
    in: path
    name: deviceName
    required: true
    type: string
    x-ms-parameter-location: method
  ResourceGroupNameParameter:
    description: The name of the resource group that contains the Windows IoT Device Service.
    in: path
    name: resourceGroupName
    required: true
    type: string
    x-ms-parameter-location: method
  SubscriptionIdParameter:
    description: The subscription identifier.
    in: path
    name: subscriptionId
    required: true
    type: string
paths:
  /providers/Microsoft.WindowsIoT/operations:
    get:
      description: Lists all of the available Windows IoT Services REST API operations.
      operationId: Operations_List
      parameters:
        - $ref: '#/parameters/ApiVersionParameter'
      responses:
        '200':
          description: OK. The request has succeeded.
          schema:
            $ref: '#/definitions/OperationListResult'
        default:
          description: DefaultErrorResponse
          schema:
            $ref: '#/definitions/ErrorDetails'
      tags:
        - Operations
      x-ms-examples:
        Operations_List:
          parameters:
            api-version: '2019-06-01'
          responses:
            '200':
              body:
                value:
                  - display:
                      description: Creates a Windows IoT Subscription with the specified parameters or update the properties or tags or adds custom domain for the specified Windows IoT Subscription.
                      operation: Create/Update Windows IoT Subscription
                      provider: Windows IoT
                      resource: Windows IoT Services
                    name: Microsoft.WindowsIoT/Services/write
                  - display:
                      description: Deletes an existing Windows IoT Subscription.
                      operation: Delete Windows IoT Subscription
                      provider: Windows IoT
                      resource: Windows IoT Services
                    name: Microsoft.WindowsIoT/Services/delete
                  - display:
                      description: Checks that account name is valid and is not in use.
                      operation: Check Name Availability
                      provider: Windows IoT
                      resource: Name Availability
                    name: Microsoft.WindowsIoT/checkNameAvailability/read
                  - display:
                      description: Returns the list of Windows IoT Services or gets the properties for the specified Windows IoT Subscription.
                      operation: List/Get Windows IoT Subscription(s)
                      provider: Windows IoT
                      resource: Windows IoT Services
                    name: Microsoft.WindowsIoT/Services/read
                  - display:
                      description: Polls the status of an asynchronous operation.
                      operation: Poll Asynchronous Operation
                      provider: Windows IoT
                      resource: Operations
                    name: Microsoft.WindowsIoT/operations/read
      x-ms-pageable:
        nextLinkName: nextLink
  '/subscriptions/{subscriptionId}/providers/Microsoft.WindowsIoT/checkDeviceServiceNameAvailability':
    post:
      deprecated: false
      description: Check if a Windows IoT Device Service name is available.
      operationId: Services_CheckDeviceServiceNameAvailability
      parameters:
        - $ref: '#/parameters/ApiVersionParameter'
        - $ref: '#/parameters/SubscriptionIdParameter'
        - description: Set the name parameter in the DeviceServiceCheckNameAvailabilityParameters structure to the name of the Windows IoT Device Service to check.
          in: body
          name: deviceServiceCheckNameAvailabilityParameters
          required: true
          schema:
            $ref: '#/definitions/DeviceServiceCheckNameAvailabilityParameters'
      responses:
        '200':
          description: OK. The request has succeeded.
          schema:
            $ref: '#/definitions/DeviceServiceNameAvailabilityInfo'
        default:
          description: DefaultErrorResponse
          schema:
            $ref: '#/definitions/ErrorDetails'
      tags:
        - CheckDeviceServiceNameAvailability
      x-ms-examples:
        Service_CheckNameAvailability:
          parameters:
            api-version: '2019-06-01'
            deviceServiceCheckNameAvailabilityParameters:
              name: service3363
            subscriptionId: 27de630f-e1ee-42de-8849-90def4986454
          responses:
            '200':
              body:
                nameAvailable: true
  '/subscriptions/{subscriptionId}/providers/Microsoft.WindowsIoT/deviceServices':
    get:
      deprecated: false
      description: Get all the IoT hubs in a subscription.
      operationId: Services_List
      parameters:
        - $ref: '#/parameters/ApiVersionParameter'
        - $ref: '#/parameters/SubscriptionIdParameter'
      responses:
        '200':
          description: OK. The request has succeeded.
          schema:
            $ref: '#/definitions/DeviceServiceDescriptionListResult'
        default:
          description: DefaultErrorResponse
          schema:
            $ref: '#/definitions/ErrorDetails'
      tags:
        - DeviceServices
      x-ms-examples:
        Service_List:
          parameters:
            api-version: '2019-06-01'
            subscriptionId: 27de630f-e1ee-42de-8849-90def4986454
          responses:
            '200':
              body:
                value:
                  - id: /subscriptions/27de630f-e1ee-42de-8849-90def4986454/resourceGroups/res2627/providers/Microsoft.WindowsIoT/Services/service1125
                    name: service1125
                    properties:
                      adminDomainName: d.e.f
                      billingDomainName: a.b.c
                      notes: blah
                      quantity: 1000000
                      startDate: '2018-01-01T12:00:00000Z'
                    type: Microsoft.WindowsIoT/Services
                  - id: /subscriptions/27de630f-e1ee-42de-8849-90def4986454/resourceGroups/testcmk3/providers/Microsoft.WindowsIoT/Services/service3699
                    name: service3699
                    properties:
                      adminDomainName: d.e.f
                      billingDomainName: a.b.c
                      notes: blah
                      quantity: 1000000
                      startDate: '2018-01-01T12:00:00000Z'
                    type: Microsoft.WindowsIoT/Services
                  - id: /subscriptions/27de630f-e1ee-42de-8849-90def4986454/resourceGroups/testcmk3/providers/Microsoft.WindowsIoT/Services/service6637
                    name: service6637
                    properties:
                      adminDomainName: d.e.f
                      billingDomainName: a.b.c
                      notes: blah
                      quantity: 1000000
                      startDate: '2018-01-01T12:00:00000Z'
                    type: Microsoft.WindowsIoT/Services
                  - id: /subscriptions/27de630f-e1ee-42de-8849-90def4986454/resourceGroups/res8186/providers/Microsoft.WindowsIoT/Services/service834
                    name: service834
                    properties:
                      adminDomainName: d.e.f
                      billingDomainName: a.b.c
                      notes: blah
                      quantity: 1000000
                      startDate: '2018-01-01T12:00:00000Z'
                    type: Microsoft.WindowsIoT/Services
                  - id: /subscriptions/27de630f-e1ee-42de-8849-90def4986454/resourceGroups/testcmk3/providers/Microsoft.WindowsIoT/Services/service9174
                    name: service9174
                    properties:
                      adminDomainName: d.e.f
                      billingDomainName: a.b.c
                      notes: blah
                      quantity: 1000000
                      startDate: '2018-01-01T12:00:00000Z'
                    type: Microsoft.WindowsIoT/Services
      x-ms-pageable:
        nextLinkName: nextLink
  '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.WindowsIoT/deviceServices':
    get:
      deprecated: false
      description: Get all the IoT hubs in a resource group.
      operationId: Services_ListByResourceGroup
      parameters:
        - $ref: '#/parameters/ApiVersionParameter'
        - $ref: '#/parameters/SubscriptionIdParameter'
        - $ref: '#/parameters/ResourceGroupNameParameter'
      responses:
        '200':
          description: OK. The request has succeeded.
          schema:
            $ref: '#/definitions/DeviceServiceDescriptionListResult'
        default:
          description: DefaultErrorResponse
          schema:
            $ref: '#/definitions/ErrorDetails'
      tags:
        - DeviceServices
      x-ms-examples:
        Service_ListByResourceGroup:
          parameters:
            api-version: '2019-06-01'
            resourceGroupName: res6117
            subscriptionId: 27de630f-e1ee-42de-8849-90def4986454
          responses:
            '200':
              body:
                value:
                  - id: /subscriptions/27de630f-e1ee-42de-8849-90def4986454/resourceGroups/res6117/providers/Microsoft.WindowsIoT/Services/service4036
                    name: service4036
                    properties:
                      adminDomainName: d.e.f
                      billingDomainName: a.b.c
                      notes: blah
                      quantity: 1000000
                      startDate: '2018-01-01T12:00:00000Z'
                    type: Microsoft.WindowsIoT/Services
                  - id: /subscriptions/27de630f-e1ee-42de-8849-90def4986454/resourceGroups/res6117/providers/Microsoft.WindowsIoT/Services/service4452
                    name: service4452
                    properties:
                      adminDomainName: d.e.f
                      billingDomainName: a.b.c
                      notes: blah
                      quantity: 1000000
                      startDate: '2018-01-01T12:00:00000Z'
                    type: Microsoft.WindowsIoT/Services
      x-ms-pageable:
        nextLinkName: nextLink
  '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.WindowsIoT/deviceServices/{deviceName}':
    delete:
      deprecated: false
      description: Delete a Windows IoT Device Service.
      operationId: Services_Delete
      parameters:
        - $ref: '#/parameters/ApiVersionParameter'
        - $ref: '#/parameters/SubscriptionIdParameter'
        - $ref: '#/parameters/ResourceGroupNameParameter'
        - $ref: '#/parameters/DeviceNameParameter'
      responses:
        '200':
          description: OK. The request has succeeded.
          schema:
            $ref: '#/definitions/DeviceService'
        default:
          description: DefaultErrorResponse
          schema:
            $ref: '#/definitions/ErrorDetails'
      tags:
        - DeviceServices
      x-ms-examples:
        Service_Delete:
          parameters:
            api-version: '2019-06-01'
            deviceName: service2434
            resourceGroupName: res4228
            subscriptionId: 27de630f-e1ee-42de-8849-90def4986454
          responses:
            '200':
              body:
                properties:
                  adminDomainName: d.e.f
                  billingDomainName: a.b.c
                  notes: blah
                  quantity: 1000000
                  startDate: '2018-01-01T12:00:00000Z'
                type: Microsoft.WindowsIoT/Services
    get:
      deprecated: false
      description: Get the non-security related metadata of a Windows IoT Device Service.
      operationId: Services_Get
      parameters:
        - $ref: '#/parameters/ApiVersionParameter'
        - $ref: '#/parameters/SubscriptionIdParameter'
        - $ref: '#/parameters/ResourceGroupNameParameter'
        - $ref: '#/parameters/DeviceNameParameter'
      responses:
        '200':
          description: OK. The request has succeeded.
          schema:
            $ref: '#/definitions/DeviceService'
        default:
          description: DefaultErrorResponse
          schema:
            $ref: '#/definitions/ErrorDetails'
      tags:
        - DeviceServices
      x-ms-examples:
        Services_GetProperties:
          parameters:
            api-version: '2019-06-01'
            deviceName: service8596
            resourceGroupName: res9407
            subscriptionId: 45b60d85-fd72-427a-a708-f994d26e593e
          responses:
            '200':
              body:
                id: /subscriptions/45b60d85-fd72-427a-a708-f994d26e593e/resourceGroups/res9407/providers/Microsoft.WindowsIoT/Services/service8596
                location: westus
                name: service8596
                properties:
                  adminDomainName: d.e.f
                  billingDomainName: a.b.c
                  notes: blah
                  quantity: 1000000
                  startDate: '2018-01-01T12:00:00000Z'
                type: Microsoft.WindowsIoT/Services
    patch:
      deprecated: false
      description: 'Updates the metadata of a Windows IoT Device Service. The usual pattern to modify a property is to retrieve the Windows IoT Device Service metadata and security metadata, and then combine them with the modified values in a new body to update the Windows IoT Device Service.'
      operationId: Services_Update
      parameters:
        - $ref: '#/parameters/ApiVersionParameter'
        - $ref: '#/parameters/SubscriptionIdParameter'
        - $ref: '#/parameters/ResourceGroupNameParameter'
        - $ref: '#/parameters/DeviceNameParameter'
        - description: The Windows IoT Device Service metadata and security metadata.
          in: body
          name: deviceService
          required: true
          schema:
            $ref: '#/definitions/DeviceServiceProperties'
        - description: ETag of the Windows IoT Device Service. Do not specify for creating a brand new Windows IoT Device Service. Required to update an existing Windows IoT Device Service.
          in: header
          name: If-Match
          required: false
          type: string
      responses:
        '200':
          description: OK. The request has succeeded.
          schema:
            $ref: '#/definitions/DeviceService'
        default:
          description: DefaultErrorResponse
          schema:
            $ref: '#/definitions/ErrorDetails'
      summary: Updates the metadata of a Windows IoT Device Service.
      tags:
        - DeviceServices
      x-ms-examples:
        Service_Update:
          parameters:
            api-version: '2019-06-01'
            deviceName: service8596
            deviceService:
              adminDomainName: d.e.f
              billingDomainName: a.b.c
              notes: blah
              quantity: 1000000
            monitor: 'true'
            resourceGroupName: res9407
            subscriptionId: 45b60d85-fd72-427a-a708-f994d26e593e
          responses:
            '200':
              body:
                location: westus
                properties:
                  adminDomainName: d.e.f
                  billingDomainName: a.b.c
                  notes: blah
                  quantity: 1000000
                  startDate: '2018-01-01T12:00:00000Z'
                type: Microsoft.WindowsIoT/Services
    put:
      deprecated: false
      description: 'Create or update the metadata of a Windows IoT Device Service. The usual pattern to modify a property is to retrieve the Windows IoT Device Service metadata and security metadata, and then combine them with the modified values in a new body to update the Windows IoT Device Service.'
      operationId: Services_CreateOrUpdate
      parameters:
        - $ref: '#/parameters/ApiVersionParameter'
        - $ref: '#/parameters/SubscriptionIdParameter'
        - $ref: '#/parameters/ResourceGroupNameParameter'
        - $ref: '#/parameters/DeviceNameParameter'
        - description: The Windows IoT Device Service metadata and security metadata.
          in: body
          name: deviceService
          required: true
          schema:
            $ref: '#/definitions/DeviceServiceProperties'
        - description: ETag of the Windows IoT Device Service. Do not specify for creating a new Windows IoT Device Service. Required to update an existing Windows IoT Device Service.
          in: header
          name: If-Match
          required: false
          type: string
      responses:
        '200':
          description: OK. The request has succeeded.
          schema:
            $ref: '#/definitions/DeviceService'
        default:
          description: DefaultErrorResponse
          schema:
            $ref: '#/definitions/ErrorDetails'
      summary: Create or update the metadata of a Windows IoT Device Service.
      tags:
        - DeviceServices
      x-ms-examples:
        Service_Create:
          parameters:
            api-version: '2019-06-01'
            deviceName: service4445
            deviceService:
              adminDomainName: d.e.f
              billingDomainName: a.b.c
              notes: blah
              quantity: 1000000
            resourceGroupName: res9101
            subscriptionId: 27de630f-e1ee-42de-8849-90def4986454
          responses:
            '200':
              body:
                properties:
                  adminDomainName: d.e.f
                  billingDomainName: a.b.c
                  notes: blah
                  quantity: 1000000
                  startDate: '2018-01-01T12:00:00000Z'
                type: Microsoft.WindowsIoT/Services
definitions:
  DeviceService:
    allOf:
      - $ref: '#/definitions/TrackedResource'
    description: The description of the Windows IoT Device 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/DeviceServiceProperties'
        description: The properties of a Windows IoT Device Service.
        x-ms-client-flatten: true
    type: object
  DeviceServiceCheckNameAvailabilityParameters:
    description: Input values.
    properties:
      name:
        description: The name of the Windows IoT Device Service to check.
        type: string
    required:
      - name
    type: object
  DeviceServiceDescriptionListResult:
    description: The JSON-serialized array of DeviceService objects with a next link.
    properties:
      nextLink:
        description: The next link.
        readOnly: true
        type: string
      value:
        description: The array of DeviceService objects.
        items:
          $ref: '#/definitions/DeviceService'
        type: array
    type: object
  DeviceServiceNameAvailabilityInfo:
    description: The properties indicating whether a given Windows IoT Device Service name is available.
    properties:
      message:
        description: The detailed reason message.
        type: string
      nameAvailable:
        description: The value which indicates whether the provided name is available.
        readOnly: true
        type: boolean
      reason:
        description: The reason for unavailability.
        enum:
          - Invalid
          - AlreadyExists
        readOnly: true
        type: string
        x-ms-enum:
          modelAsString: false
          name: serviceNameUnavailabilityReason
    type: object
  DeviceServiceProperties:
    description: The properties of a Windows IoT Device Service.
    properties:
      adminDomainName:
        description: Windows IoT Device Service OEM AAD domain
        type: string
      billingDomainName:
        description: Windows IoT Device Service ODM AAD domain
        type: string
      notes:
        description: Windows IoT Device Service notes.
        type: string
      quantity:
        description: 'Windows IoT Device Service device allocation,'
        format: int64
        type: integer
      startDate:
        description: 'Windows IoT Device Service start date,'
        format: date-time
        readOnly: true
        type: string
    type: object
  ErrorDetails:
    description: The details of the error.
    properties:
      code:
        description: One of a server-defined set of error codes.
        type: string
      details:
        description: A human-readable representation of the error's details.
        type: string
      message:
        description: A human-readable representation of the error.
        type: string
      target:
        description: The target of the particular error.
        type: string
  OperationDisplayInfo:
    description: The operation supported by Azure Data Catalog Service.
    properties:
      description:
        description: The description of the operation.
        type: string
      operation:
        description: 'The action that users can perform, based on their permission level.'
        type: string
      provider:
        description: 'Service provider: Azure Data Catalog Service.'
        type: string
      resource:
        description: Resource on which the operation is performed.
        type: string
    type: object
  OperationEntity:
    description: The operation supported by Azure Data Catalog Service.
    properties:
      display:
        $ref: '#/definitions/OperationDisplayInfo'
        description: The operation supported by Azure Data Catalog Service.
      name:
        description: 'Operation name: {provider}/{resource}/{operation}.'
        type: string
    type: object
  OperationListResult:
    description: Result of the request to list Windows IoT Device Service 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 Windows IoT Device Service operations supported by the Microsoft.WindowsIoT resource provider.
        items:
          $ref: '#/definitions/OperationEntity'
        readOnly: true
        type: array
  ProxyResource:
    allOf:
      - $ref: '#/definitions/Resource'
    description: The resource model definition for a ARM proxy resource. It will have everything other than required location and tags
  Resource:
    description: The core properties of ARM resources
    properties:
      id:
        description: Fully qualified resource Id for the resource
        readOnly: true
        type: string
      name:
        description: The name of the resource
        readOnly: true
        type: string
      type:
        description: The type of the resource.
        readOnly: true
        type: string
    x-ms-azure-resource: true
  TrackedResource:
    allOf:
      - $ref: '#/definitions/Resource'
    description: The resource model definition for a ARM tracked top level resource
    properties:
      location:
        description: The Azure Region where the resource lives
        type: string
        x-ms-mutability:
          - read
          - create
      tags:
        additionalProperties:
          type: string
        description: Resource tags.
        type: object
        x-ms-mutability:
          - read
          - create
          - update
