swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  description: API spec for Microsoft.Security (Azure Security Center) resource provider
  title: Security Center
  version: 2017-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/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/workspaceSettings.json
      version: "2.0"
  x-providerName: azure.com
  x-serviceName: security-workspaceSettings
  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:
  WorkspaceSetting:
    description: Security data setting object
    in: body
    name: workspaceSetting
    required: true
    schema:
      $ref: "#/definitions/WorkspaceSetting"
    x-ms-parameter-location: method
  WorkspaceSettingName:
    description: Name of the security setting
    in: path
    name: workspaceSettingName
    required: true
    type: string
    x-ms-parameter-location: method
paths:
  "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings":
    get:
      description: Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set
      operationId: WorkspaceSettings_List
      parameters:
        - description: API version for the operation
          in: query
          name: api-version
          required: true
          type: string
        - description: Azure subscription ID
          in: path
          name: subscriptionId
          pattern: ^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$
          required: true
          type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/WorkspaceSettingList"
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error response structure.
            properties:
              error:
                description: Error details.
                properties:
                  code:
                    description: An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
                    readOnly: true
                    type: string
                  message:
                    description: A message describing the error, intended to be suitable for display in a user interface.
                    readOnly: true
                    type: string
                type: object
                x-ms-external: true
            type: object
            x-ms-external: true
      tags:
        - Workspace Settings
      x-ms-examples:
        Get workspace settings on subscription:
          parameters:
            api-version: 2017-08-01-preview
            subscriptionId: 20ff7fc3-e762-44dd-bd96-b71116dcdc23
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/workspaceSettings/default
                    name: default
                    properties:
                      scope: /subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23
                      workspaceId: /subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1
                    type: Microsoft.Security/workspaceSettings
                  - id: /subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Security/workspaceSettings/myRg
                    name: myRg
                    properties:
                      scope: /subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg
                      workspaceId: /subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myOtherRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace2
                    type: Microsoft.Security/workspaceSettings
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}":
    delete:
      description: Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace
      operationId: WorkspaceSettings_Delete
      parameters:
        - description: API version for the operation
          in: query
          name: api-version
          required: true
          type: string
        - description: Azure subscription ID
          in: path
          name: subscriptionId
          pattern: ^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$
          required: true
          type: string
        - $ref: "#/parameters/WorkspaceSettingName"
      responses:
        "204":
          description: No Content
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error response structure.
            properties:
              error:
                description: Error details.
                properties:
                  code:
                    description: An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
                    readOnly: true
                    type: string
                  message:
                    description: A message describing the error, intended to be suitable for display in a user interface.
                    readOnly: true
                    type: string
                type: object
                x-ms-external: true
            type: object
            x-ms-external: true
      tags:
        - Workspace Settings
      x-ms-examples:
        Delete a workspace setting data for resource group:
          parameters:
            api-version: 2017-08-01-preview
            subscriptionId: 20ff7fc3-e762-44dd-bd96-b71116dcdc23
            workspaceSettingName: default
          responses:
            "204": {}
    get:
      description: Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set
      operationId: WorkspaceSettings_Get
      parameters:
        - description: API version for the operation
          in: query
          name: api-version
          required: true
          type: string
        - description: Azure subscription ID
          in: path
          name: subscriptionId
          pattern: ^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$
          required: true
          type: string
        - $ref: "#/parameters/WorkspaceSettingName"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/WorkspaceSetting"
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error response structure.
            properties:
              error:
                description: Error details.
                properties:
                  code:
                    description: An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
                    readOnly: true
                    type: string
                  message:
                    description: A message describing the error, intended to be suitable for display in a user interface.
                    readOnly: true
                    type: string
                type: object
                x-ms-external: true
            type: object
            x-ms-external: true
      tags:
        - Workspace Settings
      x-ms-examples:
        Get a workspace setting on subscription:
          parameters:
            api-version: 2017-08-01-preview
            subscriptionId: 20ff7fc3-e762-44dd-bd96-b71116dcdc23
            workspaceSettingName: default
          responses:
            "200":
              body:
                id: /subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/workspaceSettings/default
                name: default
                properties:
                  scope: /subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23
                  workspaceId: /subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace
                type: Microsoft.Security/workspaceSettings
    patch:
      description: Settings about where we should store your security data and logs
      operationId: WorkspaceSettings_Update
      parameters:
        - description: API version for the operation
          in: query
          name: api-version
          required: true
          type: string
        - description: Azure subscription ID
          in: path
          name: subscriptionId
          pattern: ^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$
          required: true
          type: string
        - $ref: "#/parameters/WorkspaceSettingName"
        - $ref: "#/parameters/WorkspaceSetting"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/WorkspaceSetting"
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error response structure.
            properties:
              error:
                description: Error details.
                properties:
                  code:
                    description: An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
                    readOnly: true
                    type: string
                  message:
                    description: A message describing the error, intended to be suitable for display in a user interface.
                    readOnly: true
                    type: string
                type: object
                x-ms-external: true
            type: object
            x-ms-external: true
      tags:
        - Workspace Settings
      x-ms-examples:
        Update a workspace setting data for subscription:
          parameters:
            api-version: 2017-08-01-preview
            subscriptionId: 20ff7fc3-e762-44dd-bd96-b71116dcdc23
            workspaceSetting:
              id: /subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/workspaceSettings/default
              name: default
              properties:
                workspaceId: /subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace
              type: Microsoft.Security/workspaceSettings
            workspaceSettingName: default
          responses:
            "200":
              body:
                id: /subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/workspaceSettings/default
                name: default
                properties:
                  scope: /subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23
                  workspaceId: /subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace
                type: Microsoft.Security/workspaceSettings
    put:
      description: creating settings about where we should store your security data and logs
      operationId: WorkspaceSettings_Create
      parameters:
        - description: API version for the operation
          in: query
          name: api-version
          required: true
          type: string
        - description: Azure subscription ID
          in: path
          name: subscriptionId
          pattern: ^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$
          required: true
          type: string
        - $ref: "#/parameters/WorkspaceSettingName"
        - $ref: "#/parameters/WorkspaceSetting"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/WorkspaceSetting"
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error response structure.
            properties:
              error:
                description: Error details.
                properties:
                  code:
                    description: An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
                    readOnly: true
                    type: string
                  message:
                    description: A message describing the error, intended to be suitable for display in a user interface.
                    readOnly: true
                    type: string
                type: object
                x-ms-external: true
            type: object
            x-ms-external: true
      tags:
        - Workspace Settings
      x-ms-examples:
        Create a workspace setting data for subscription:
          parameters:
            api-version: 2017-08-01-preview
            subscriptionId: 20ff7fc3-e762-44dd-bd96-b71116dcdc23
            workspaceSetting:
              id: /subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/workspaceSettings/default
              name: default
              properties:
                scope: /subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23
                workspaceId: /subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace
              type: Microsoft.Security/workspaceSettings
            workspaceSettingName: default
          responses:
            "200":
              body:
                id: /subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/workspaceSettings/default
                name: default
                properties:
                  scope: /subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23
                  workspaceId: /subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace
                type: Microsoft.Security/workspaceSettings
definitions:
  WorkspaceSetting:
    allOf:
      - description: Describes an Azure 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
        type: object
        x-ms-azure-resource: true
    description: Configures where to store the OMS agent data for workspaces under a scope
    properties:
      properties:
        $ref: "#/definitions/WorkspaceSettingProperties"
        description: Workspace setting data
        x-ms-client-flatten: true
    type: object
  WorkspaceSettingList:
    description: List of workspace settings response
    properties:
      nextLink:
        description: The URI to fetch the next page.
        readOnly: true
        type: string
      value:
        description: List of workspace settings
        items:
          $ref: "#/definitions/WorkspaceSetting"
        type: array
    required:
      - value
  WorkspaceSettingProperties:
    description: Workspace setting data
    properties:
      scope:
        description: All the VMs in this scope will send their security data to the mentioned workspace unless overridden by a setting with more specific scope
        type: string
      workspaceId:
        description: The full Azure ID of the workspace to save the data in
        type: string
    required:
      - workspaceId
      - scope
    type: object
