openapi: 3.1.0
info:
  title: Audit Log Events
  version: 1.0.0
webhooks:
  Audit Log Created:
    post:
      description: >-
        Triggered when an audit log event is created.<br><br>**Event
        type—**`com.hpe.greenlake.audit-log.v1.logs.created`
      summary: Audit Log Created Event
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CloudEvent'
components:
  schemas:
    AuditLog:
      type: object
      required:
        - customer_id
        - username
        - category
        - app_slug
        - audit_info
      properties:
        app_slug:
          type: string
          description: A short and unique reference to an application resource.
          example: COM
        customer_id:
          type: string
          description: The platform customer ID or workspace ID.
          example: 1234567190abcdef1234567890abcdef
        username:
          type: string
          description: Username of the user publishing the audit log event.
        app_instance_id:
          type: string
          description: >-
            The unique identifier of a specific application. Generated by HPE
            GreenLake.
          example: 3f8e1b2-1234-5678-90ab-cdef12345678
        application_customer_id:
          type: string
          description: >-
            This is the unique identifier of the customer associated with the
            application.
          example: null
        audit_details:
          type: object
          description: Additional details associated with the audit log.
          example:
            header: value
            body: value
        enable_streaming:
          type: string
          description: Indicates whether streaming is enabled for the audit log.
          example: true or false
        audit_info:
          type: object
          properties:
            username:
              type: string
              description: The username of the user associated with the audit log.
            category:
              type: string
              description: Type of activity that was logged.
              example: User Management
            customer_name:
              type: string
              description: The workspace name or customer name.
              example: Sasha's Workspace
            account_type:
              type: string
              description: >-
                The type of HPE GreenLake account such as standalone, MSP, or
                tenant.
              example: MSP
            msp_id:
              type: string
              description: The unique identifier of a managed service provider (MSP).
              example: 5434567890abcdef1234567890abcdef
            audit_created_at:
              type: string
              description: The date and time the audit log was created.
              example: '2023-10-01T12:00:00Z'
            additional_info:
              type: object
              description: >-
                Additional information related to the audit log event or the
                application.
              example:
                ip_address: 171.217.21.14
            has_details:
              type: boolean
              description: >-
                If set to `true`, the `audit_details` property is available for
                the audit log. This enables the UI to display the audit log
                details in the side panel.
        created_at:
          type: string
          description: >-
            The date and time the audit log was created in [RFC
            3339](https://datatracker.ietf.org/doc/html/rfc3339) format.
    CloudEvent:
      type: object
      required:
        - specversion
        - id
        - source
        - type
        - subject
        - data
      properties:
        specversion:
          type: string
          description: The version of the CloudEvents specification the event adheres to.
          example: 1
        id:
          type: string
          format: uuid
          description: The unique identifier for the event.
          example: 123e4567-e89b-12d3-a456-426614174000
        source:
          type: string
          description: >-
            The source field is a URI-reference that identifies the event
            producer.
          example: Compute
        type:
          type: string
          description: The type of event.
          example: AUDIT_LOGS
        time:
          type: string
          format: date-time
          description: >-
            The date and time the event occurred in [RFC
            3339](https://datatracker.ietf.org/doc/html/rfc3339) format.
          example: '2023-10-01T12:00:00Z'
        subject:
          type: string
        dataschema:
          type: string
          description: A URI pointing to the `data` property schema.
        datacontenttype:
          type: string
          description: >-
            The encoding of the data in the `data` property in [RFC
            2046](https://datatracker.ietf.org/doc/html/rfc2046) format.
        data:
          type: object
          description: The event payload.
          $ref: '#/components/schemas/AuditLog'
