swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  description: API to Add/Remove/List Guest Diagnostics Settings Association for Azure Resources
  title: Guest Diagnostic Settings Association
  version: 2018-06-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-ms-code-generation-settings:
    name: MonitorManagementClient
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/monitor/resource-manager/Microsoft.Insights/preview/2018-06-01-preview/guestDiagnosticSettingsAssociation_API.json
      version: "2.0"
  x-providerName: azure.com
  x-serviceName: monitor-guestDiagnosticSettingsAssociation_API
  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: Client Api Version.
    in: query
    name: api-version
    required: true
    type: string
  DiagnosticSettingsAssociationNameParameter:
    description: The name of the diagnostic settings association.
    in: path
    name: associationName
    required: true
    type: string
    x-ms-parameter-location: method
  ResourceGroupNameParameter:
    description: The name of the resource group.
    in: path
    name: resourceGroupName
    required: true
    type: string
    x-ms-parameter-location: method
  SubscriptionIdParameter:
    description: The Azure subscription Id.
    in: path
    name: subscriptionId
    required: true
    type: string
paths:
  "/subscriptions/{subscriptionId}/providers/microsoft.insights/guestDiagnosticSettingsAssociations":
    get:
      description: Get a list of all guest diagnostic settings association in a subscription.
      operationId: GuestDiagnosticsSettingsAssociation_List
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: The request succeeded.
          schema:
            $ref: "#/definitions/GuestDiagnosticSettingsAssociationList"
        default:
          description: An error occurred and the list of guest diagnostic settings association could not be retrieved.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-pageable:
        nextLinkName: null
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/guestDiagnosticSettingsAssociations":
    get:
      description: Get a list of all guest diagnostic settings association in a resource group.
      operationId: GuestDiagnosticsSettingsAssociation_ListByResourceGroup
      parameters:
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: The request succeeded.
          schema:
            $ref: "#/definitions/GuestDiagnosticSettingsAssociationList"
        default:
          description: An error occurred and the list of guest diagnostic settings association could not be retrieved.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-pageable:
        nextLinkName: null
  "/{resourceUri}/providers/microsoft.insights/guestDiagnosticSettingsAssociation/{associationName}":
    delete:
      description: Delete guest diagnostics association settings.
      operationId: GuestDiagnosticsSettingsAssociation_Delete
      parameters:
        - description: The fully qualified ID of the resource, including the resource name and resource type.
          in: path
          name: resourceUri
          required: true
          type: string
          x-ms-skip-url-encoding: true
        - $ref: "#/parameters/DiagnosticSettingsAssociationNameParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: The diagnostic settings association was successfully deleted.
        "204":
          description: The diagnostic settings association does not exist. It may have already been deleted.
        default:
          description: An error occurred and the diagnostic settings association could not be deleted.
          schema:
            $ref: "#/definitions/ErrorResponse"
      tags:
        - GuestDiagnosticsSettingsAssociation
      x-ms-examples:
        Create or update an guest diagnostic settings association:
          parameters:
            api-version: 2018-06-01-preview
            associationName: healthSystemMachineConfigAssociation
            resourceUri: subscriptions/8498f01b-8064-4e37-856e-318f3c6c685f/resourceGroups/healthsystem/providers/Microsoft.Compute/virtualMachines/eastussojai
          responses:
            "200": {}
            "204": {}
    get:
      description: Gets guest diagnostics association settings.
      operationId: GuestDiagnosticsSettingsAssociation_Get
      parameters:
        - description: The fully qualified ID of the resource, including the resource name and resource type.
          in: path
          name: resourceUri
          required: true
          type: string
          x-ms-skip-url-encoding: true
        - $ref: "#/parameters/DiagnosticSettingsAssociationNameParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: The request succeeded.
          schema:
            $ref: "#/definitions/GuestDiagnosticSettingsAssociationResource"
        default:
          description: An error occurred and the diagnostic settings association could not be retrieved.
          schema:
            $ref: "#/definitions/ErrorResponse"
      tags:
        - GuestDiagnosticsSettingsAssociation
      x-ms-examples:
        Create or update an guest diagnostic settings association:
          parameters:
            api-version: 2018-06-01-preview
            associationName: healthSystemMachineConfigAssociation
            resourceUri: subscriptions/8498f01b-8064-4e37-856e-318f3c6c685f/resourceGroups/healthsystem/providers/Microsoft.Compute/virtualMachines/eastussojai
          responses:
            "200":
              body:
                id: /subscriptions/8498f01b-8064-4e37-856e-318f3c6c685f/resourceGroups/healthsystem/providers/Microsoft.Compute/virtualMachines/eastussojai/providers/microsoft.insights/guestDiagnosticSettingsAssociation/healthSystemMachineConfigAssociation
                location: Global
                name: healthSystemMachineConfigAssociation
                properties:
                  guestDiagnosticSettingsName: /subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-Association-ResourceGroup/providers/providers/microsoft.insights/guestDiagnosticSettings/SampleDiagnosticSettingsName
                tags: {}
                type: Microsoft.Insights/GuestDiagnosticSettingsAssociation
              headers: {}
    patch:
      description: Updates an existing guestDiagnosticsSettingsAssociation Resource. To update other fields use the CreateOrUpdate method
      operationId: GuestDiagnosticsSettingsAssociation_Update
      parameters:
        - description: The fully qualified ID of the resource, including the resource name and resource type.
          in: path
          name: resourceUri
          required: true
          type: string
          x-ms-skip-url-encoding: true
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/DiagnosticSettingsAssociationNameParameter"
        - description: Parameters supplied to the operation.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/GuestDiagnosticSettingsAssociationResourcePatch"
      responses:
        "200":
          description: An existing guest diagnostics setting resource was successfully updated.
          schema:
            $ref: "#/definitions/GuestDiagnosticSettingsAssociationResource"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Update a service diagnostic setting:
          parameters:
            api-version: 2018-06-01-preview
            associationName: healthSystemMachineConfigAssociation
            parameters:
              properties:
                guestDiagnosticSettingsName: /subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-Association-ResourceGroup/providers/providers/microsoft.insights/guestDiagnosticSettings/vmSettingForSecurity
              tags: null
            resourceUri: subscriptions/8498f01b-8064-4e37-856e-318f3c6c685f/resourceGroups/healthsystem/providers/Microsoft.Compute/virtualMachines/eastussojai
          responses:
            "200":
              body:
                id: /subscriptions/8498f01b-8064-4e37-856e-318f3c6c685f/resourceGroups/healthsystem/providers/Microsoft.Compute/virtualMachines/eastussojai/providers/microsoft.insights/guestDiagnosticSettingsAssociation/healthSystemMachineConfigAssociation
                location: Global
                name: healthSystemMachineConfigAssociation
                properties:
                  guestDiagnosticSettingsName: /subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-Association-ResourceGroup/providers/providers/microsoft.insights/guestDiagnosticSettings/vmSettingForSecurity
                tags: null
                type: Microsoft.Insights/GuestDiagnosticSettingsAssociation
              headers: {}
    put:
      description: Creates or updates guest diagnostics settings association.
      operationId: GuestDiagnosticsSettingsAssociation_CreateOrUpdate
      parameters:
        - description: The fully qualified ID of the resource, including the resource name and resource type.
          in: path
          name: resourceUri
          required: true
          type: string
          x-ms-skip-url-encoding: true
        - $ref: "#/parameters/DiagnosticSettingsAssociationNameParameter"
        - $ref: "#/parameters/ApiVersionParameter"
        - description: The diagnostic settings association to create or update.
          in: body
          name: diagnosticSettingsAssociation
          required: true
          schema:
            $ref: "#/definitions/GuestDiagnosticSettingsAssociationResource"
      responses:
        "200":
          description: An existing guest diagnostic settings association was successfully updated.
          schema:
            $ref: "#/definitions/GuestDiagnosticSettingsAssociationResource"
        "201":
          description: A new guest diagnostic settings association was successfully created.
          schema:
            $ref: "#/definitions/GuestDiagnosticSettingsAssociationResource"
        default:
          description: An error occurred and the guest diagnostic settings association could not be created or updated.
          schema:
            $ref: "#/definitions/ErrorResponse"
      tags:
        - GuestDiagnosticsSettingsAssociation
      x-ms-examples:
        Create or update an guest diagnostic settings association:
          parameters:
            api-version: 2018-06-01-preview
            associationName: healthSystemMachineConfigAssociation
            diagnosticSettingsAssociation:
              location: Global
              properties:
                guestDiagnosticSettingsName: /subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-Association-ResourceGroup/providers/providers/microsoft.insights/guestDiagnosticSettings/vmSettingForSecurity
              tags: {}
            resourceUri: subscriptions/8498f01b-8064-4e37-856e-318f3c6c685f/resourceGroups/healthsystem/providers/Microsoft.Compute/virtualMachines/eastussojai
          responses:
            "200":
              body:
                id: /subscriptions/8498f01b-8064-4e37-856e-318f3c6c685f/resourceGroups/healthsystem/providers/Microsoft.Compute/virtualMachines/eastussojai/providers/microsoft.insights/guestDiagnosticSettingsAssociation/healthSystemMachineConfigAssociation
                location: Global
                name: healthSystemMachineConfigAssociation
                properties:
                  guestDiagnosticSettingsName: /subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-Association-ResourceGroup/providers/providers/microsoft.insights/guestDiagnosticSettings/vmSettingForSecurity
                tags: {}
                type: Microsoft.Insights/GuestDiagnosticSettingsAssociation
              headers: {}
            "201":
              body:
                id: /subscriptions/8498f01b-8064-4e37-856e-318f3c6c685f/resourceGroups/healthsystem/providers/Microsoft.Compute/virtualMachines/eastussojai/providers/microsoft.insights/guestDiagnosticSettingsAssociation/healthSystemMachineConfigAssociation
                location: Global
                name: healthSystemMachineConfigAssociation
                properties:
                  guestDiagnosticSettingsName: /subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-Association-ResourceGroup/providers/providers/microsoft.insights/guestDiagnosticSettings/vmSettingForSecurity
                tags: {}
                type: Microsoft.Insights/GuestDiagnosticSettingsAssociation
              headers: {}
definitions:
  ErrorResponse:
    description: Describes the format of Error response.
    properties:
      code:
        description: Error code
        type: string
      message:
        description: Error message indicating why the operation failed.
        type: string
    type: object
  GuestDiagnosticSettingsAssociation:
    description: A guest diagnostic settings association.
    properties:
      guestDiagnosticSettingsName:
        description: The guest diagnostic settings name.
        type: string
    required:
      - guestDiagnosticSettingsName
  GuestDiagnosticSettingsAssociationList:
    description: A list of guest diagnostic settings association.
    properties:
      nextLink:
        description: Provides the link to retrieve the next set of elements.
        type: string
      value:
        description: The list of guest diagnostic settings association.
        items:
          $ref: "#/definitions/GuestDiagnosticSettingsAssociationResource"
        type: array
  GuestDiagnosticSettingsAssociationResource:
    allOf:
      - $ref: "#/definitions/Resource"
    description: Virtual machine guest diagnostic settings resource.
    properties:
      properties:
        $ref: "#/definitions/GuestDiagnosticSettingsAssociation"
        description: The diagnostics settings associations of the resource.
        x-ms-client-flatten: true
    required:
      - properties
    type: object
  GuestDiagnosticSettingsAssociationResourcePatch:
    description: Guest diagnostic setting resource for patch operations
    properties:
      properties:
        $ref: "#/definitions/GuestDiagnosticSettingsAssociation"
        description: The service diagnostics settings for an update operation.
        x-ms-client-flatten: true
      tags:
        additionalProperties:
          type: string
        description: Resource tags
  Resource:
    description: An azure resource object
    properties:
      id:
        description: Azure resource Id
        readOnly: true
        type: string
      location:
        description: Resource location
        type: string
        x-ms-mutability:
          - create
          - read
      name:
        description: Azure resource name
        readOnly: true
        type: string
      tags:
        additionalProperties:
          type: string
        description: Resource tags
      type:
        description: Azure resource type
        readOnly: true
        type: string
    required:
      - location
    x-ms-azure-resource: true
