swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  description: Azure Log Analytics API reference
  title: Azure Log Analytics
  version: 2019-08-01-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-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2019-08-01-preview/OperationalInsights.json
      version: "2.0"
  x-preferred: false
  x-providerName: azure.com
  x-serviceName: operationalinsights-OperationalInsights
  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 client API version.
    in: query
    name: api-version
    required: true
    type: string
  ResourceGroupNameParameter:
    description: The workspace's resource group name.
    in: path
    maxLength: 90
    minLength: 1
    name: resourceGroupName
    pattern: ^[-\w\._\(\)]+$
    required: true
    type: string
    x-ms-parameter-location: method
  SubscriptionIdParameter:
    description: The workspace's resource subscription ID.
    in: path
    name: subscriptionId
    required: true
    type: string
  WorkspaceNameParameter:
    description: The Log Analytics workspace name.
    in: path
    name: workspaceName
    required: true
    type: string
    x-ms-parameter-location: method
paths:
  "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports":
    get:
      description: Lists the data export instances within a workspace.
      operationId: DataExport_ListByWorkspace
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - $ref: "#/parameters/WorkspaceNameParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: OK response definition.
          schema:
            $ref: "#/definitions/DataExportListResult"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      tags:
        - DataExport
      x-ms-examples:
        DataExportGet:
          parameters:
            api-version: 2019-08-01-preview
            resourceGroupName: RgTest1
            subscriptionId: 00000000-0000-0000-0000-00000000000
            workspaceName: DeWnTest1234
          responses:
            "200":
              body:
                - id: /subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/RgTest1/providers/microsoft.operationalinsights/workspaces/DeWnTest1234/export/export1
                  name: export1
                  properties:
                    allTables: false
                    createdDate: Sun, 12 Jan 2020 12:51:10 GMT
                    dataExportId: d5233afc-7829-4b89-c594-08d7975e19a5
                    destination:
                      resourceId: /subscriptions/192b9f85-a39a-4276-b96d-d5cd351703f9/resourceGroups/OIAutoRest1234/providers/Microsoft.EventHub/namespaces/test
                      type: EventHub
                    enable: true
                    lastModifiedDate: Sun, 12 Jan 2020 12:51:10 GMT
                    tableNames:
                      - Heartbeat
                  type: Microsoft.OperationalInsights/workspaces/export
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}":
    delete:
      description: Deletes the specified data export in a given workspace..
      operationId: DataExport_Delete
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - $ref: "#/parameters/WorkspaceNameParameter"
        - description: The data export rule name.
          in: path
          name: dataExportName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: OK response definition.
        "404":
          description: Not found the specific data export.
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      tags:
        - DataExport
      x-ms-examples:
        DataExportDelete:
          parameters:
            api-version: 2019-08-01-preview
            dataExportName: export1
            resourceGroupName: RgTest1
            subscriptionId: 00000000-0000-0000-0000-00000000000
            workspaceName: DeWnTest1234
          responses:
            "200": {}
            "404": {}
    get:
      description: Gets a data export instance.
      operationId: DataExport_Get
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - $ref: "#/parameters/WorkspaceNameParameter"
        - description: The data export rule name.
          in: path
          name: dataExportName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: OK response definition.
          schema:
            $ref: "#/definitions/DataExport"
        "404":
          description: Not found the specific data export.
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      tags:
        - DataExport
      x-ms-examples:
        DataExportGet:
          parameters:
            api-version: 2019-08-01-preview
            dataExportName: export1
            resourceGroupName: RgTest1
            subscriptionId: 00000000-0000-0000-0000-00000000000
            workspaceName: DeWnTest1234
          responses:
            "200":
              body:
                id: /subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/RgTest1/providers/microsoft.operationalinsights/workspaces/DeWnTest1234/export/export1
                name: export1
                properties:
                  allTables: false
                  createdDate: Sun, 12 Jan 2020 12:51:10 GMT
                  dataExportId: d5233afc-7829-4b89-c594-08d7975e19a5
                  destination:
                    resourceId: /subscriptions/192b9f85-a39a-4276-b96d-d5cd351703f9/resourceGroups/OIAutoRest1234/providers/Microsoft.EventHub/namespaces/test
                    type: EventHub
                  enable: true
                  lastModifiedDate: Sun, 12 Jan 2020 12:51:10 GMT
                  tableNames:
                    - Heartbeat
                type: Microsoft.OperationalInsights/workspaces/export
            "404": {}
    put:
      description: Create or update a data export.
      operationId: DataExport_CreateOrUpdate
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - $ref: "#/parameters/WorkspaceNameParameter"
        - description: The data export rule name.
          in: path
          maxLength: 63
          minLength: 4
          name: dataExportName
          pattern: ^[A-Za-z][A-Za-z0-9-]+[A-Za-z0-9]$
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
        - description: The parameters required to create or update a data export.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/DataExport"
      responses:
        "200":
          description: OK response definition.
          schema:
            $ref: "#/definitions/DataExport"
        "201":
          description: Created response definition.
          schema:
            $ref: "#/definitions/DataExport"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      tags:
        - DataExport
      x-ms-examples:
        DataExportCreate:
          parameters:
            api-version: 2019-08-01-preview
            dataExportName: export1
            parameters:
              properties:
                destination:
                  resourceId: /subscriptions/192b9f85-a39a-4276-b96d-d5cd351703f9/resourceGroups/OIAutoRest1234/providers/Microsoft.EventHub/namespaces/test
                tableNames:
                  - Heartbeat
            resourceGroupName: RgTest1
            subscriptionId: 00000000-0000-0000-0000-00000000000
            workspaceName: DeWnTest1234
          responses:
            "200":
              body:
                id: /subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/RgTest1/providers/microsoft.operationalinsights/workspaces/DeWnTest1234/export/export1
                name: export1
                properties:
                  allTables: false
                  createdDate: Sun, 12 Jan 2020 12:51:10 GMT
                  dataExportId: d5233afc-7829-4b89-c594-08d7975e19a5
                  destination:
                    resourceId: /subscriptions/192b9f85-a39a-4276-b96d-d5cd351703f9/resourceGroups/OIAutoRest1234/providers/Microsoft.EventHub/namespaces/test
                    type: EventHub
                  enable: true
                  lastModifiedDate: Sun, 12 Jan 2020 12:51:10 GMT
                  tableNames:
                    - Heartbeat
                type: Microsoft.OperationalInsights/workspaces/export
            "201":
              body:
                id: /subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/RgTest1/providers/microsoft.operationalinsights/workspaces/DeWnTest1234/export/export1
                name: export1
                properties:
                  allTables: false
                  createdDate: Sun, 12 Jan 2020 12:51:10 GMT
                  dataExportId: d5233afc-7829-4b89-c594-08d7975e19a5
                  destination:
                    resourceId: /subscriptions/192b9f85-a39a-4276-b96d-d5cd351703f9/resourceGroups/OIAutoRest1234/providers/Microsoft.EventHub/namespaces/test
                    type: EventHub
                  enable: true
                  lastModifiedDate: Sun, 12 Jan 2020 12:51:10 GMT
                  tableNames:
                    - Heartbeat
                type: Microsoft.OperationalInsights/workspaces/export
      x-ms-long-running-operation: true
      x-ms-long-running-operation-options:
        final-state-via: azure-async-operation
definitions:
  DataExport:
    allOf:
      - $ref: "#/definitions/ProxyResource"
    description: The top level data export resource container.
    properties:
      properties:
        $ref: "#/definitions/DataExportProperties"
        description: data export properties.
        x-ms-client-flatten: true
    x-ms-azure-resource: true
  DataExportListResult:
    description: Result of the request to list data exports.
    properties:
      value:
        description: List of data export instances within a workspace..
        items:
          $ref: "#/definitions/DataExport"
        type: array
  DataExportProperties:
    description: Data Export properties.
    properties:
      allTables:
        description: When ‘true’, all workspace's tables are exported.
        type: boolean
      createdDate:
        description: The latest data export rule modification time.
        type: string
      dataExportId:
        description: The data export rule ID.
        type: string
      destination:
        $ref: "#/definitions/Destination"
        description: destination properties.
        x-ms-client-flatten: true
      enable:
        description: Active when enabled.
        type: boolean
      lastModifiedDate:
        description: Date and time when the export was last modified.
        type: string
      tableNames:
        description: "An array of tables to export, for example: [“Heartbeat, SecurityEvent”]."
        items:
          type: string
        type: array
  Destination:
    description: Destination properties.
    properties:
      metaData:
        $ref: "#/definitions/DestinationMetaData"
        description: destination meta data.
        x-ms-client-flatten: true
      resourceId:
        description: The destination resource ID. This can be copied from the Properties entry of the destination resource in Azure.
        type: string
      type:
        description: The type of the destination resource
        enum:
          - StorageAccount
          - EventHub
        readOnly: true
        type: string
    required:
      - resourceId
  DestinationMetaData:
    description: Destination meta data.
    properties:
      eventHubName:
        description: Optional. Allows to define an Event Hub name. Not applicable when destination is Storage Account.
        type: string
  ErrorDetails:
    description: The details of the error.
    properties:
      code:
        description: Error code.
        readOnly: true
        type: string
      message:
        description: Error message indicating why the operation failed.
        readOnly: true
        type: string
      target:
        description: The target of the particular error.
        readOnly: true
        type: string
  ErrorResponse:
    description: Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.
    properties:
      error:
        $ref: "#/definitions/ErrorDetails"
        description: The details of the error.
    type: object
  ProxyResource:
    description: Common properties of proxy resource.
    properties:
      id:
        description: Resource ID.
        readOnly: true
        type: string
      name:
        description: Resource name.
        readOnly: true
        type: string
      type:
        description: Resource type.
        readOnly: true
        type: string
