$schema: http://support.riverbed.com/apis/service_def/2.2
description: REST API for npm.audit service
id: http://support.riverbed.com/apis/npm.audit/1.1
name: npm.audit
provider: riverbed
resources:
  config:
    additionalProperties: false
    description: Audit subsystem configuration
    links:
      get:
        method: GET
        response:
          $ref: '#/resources/config'
      self:
        path: $/config
      set:
        method: PUT
        request:
          $ref: '#/resources/config'
        response:
          $ref: '#/resources/config'
    properties:
      disabled_types:
        description: Event types that will not be audited. Any subtypes under the
          type namespace will also be disabled.
        items:
          description: Event type to disable
          type: string
        type: array
      retention:
        additionalProperties: false
        description: Audit record retention configuration
        properties:
          period:
            description: Number of days to store records before pruning. 0 to disable
              age-based pruning.
            minimum: 0
            type: integer
          records:
            description: Maximum number of event records to keep. 0 to disable maximum
              record pruning.
            minimum: 0
            type: integer
        required:
        - period
        - records
        type: object
      system:
        additionalProperties: false
        description: Main audit system configuration
        properties:
          enabled:
            description: Globally enable/disable all event auditing
            type: boolean
        required:
        - enabled
        type: object
    required:
    - system
    - retention
    - disabled_types
    type: object
  events:
    additionalProperties: false
    description: Container for event instances
    links:
      get:
        method: GET
        response:
          $ref: '#/resources/events'
      self:
        params:
          action:
            description: When specified events with specified 'action' will be returned.
            type: string
          limit:
            description: When specified events within specified 'limit' will be returned.
              Default/Max value is 100
            type: integer
          offset:
            description: When specified events after specified 'offset' will be returned.
            type: integer
          record_type:
            description: When specified events with specified 'record_type' will be
              returned.
            type: string
          sort:
            description: When specified, events will be ordered in the direction given.
              Default value is 'desc'
            enum:
            - asc
            - desc
            type: string
          sortBy:
            description: When specified, events will be sorted by the specified 'sortBy'
              field. Default value is 'timestamp'
            enum:
            - username
            - record_type
            - action
            - success
            - timestamp
            type: string
          success:
            description: When specified events with 'success' true or false will be
              returned.
            enum:
            - 0
            - 1
            type: integer
          username:
            description: When specified events created by 'username' will be returned.
            type: string
        path: $/events
    properties:
      items:
        description: Array of events within the audit subsystem
        items:
          $ref: '#/types/event'
        type: array
      meta:
        $ref: '#/types/events_meta'
    required:
    - items
    type: object
title: NPM Audit Service
types:
  event:
    description: An event within the audit subsystem
    properties:
      action:
        description: Action that triggered the event (e.g., 'create', 'update').
        type: string
      count:
        description: Number of times the event occurred during a 1-minute window
        type: integer
      details:
        description: Specific details about the event as EventDetails, consisting
          of EventDetail objects field/value - a field, and text about the field field/old/new
          - a field, its original value, and new
        items:
          description: Event details
          properties:
            field:
              description: Detail field
              type: string
            new:
              description: New field value for a change record
              type: string
            old:
              description: Original field value for a change record
              type: string
            value:
              description: Value field
              type: string
          required:
          - field
          type: object
        type: array
      identifier:
        description: Identifier for the record_type object. For example, if action
          is 'delete', and record_type is 'configuration_change.host_group', the identifier
          might be 'Boston'
        type: string
      ipaddr:
        description: IP from which the event was triggered
        type: string
      module:
        description: IP address of the module on a multi-blade system where the event
          occurred
        type: string
      pid:
        description: Process ID from which the event originated
        type: integer
      record_type:
        description: The type of event (e.g. 'authentication.login', 'configuration_change.roles')
        type: string
      sid:
        description: User session from which the event originated
        type: string
      success:
        description: Whether the attempted event succeeded.
        type: integer
      timestamp:
        description: Timestamp of audit event
        type: timestamp
      uid:
        description: Numeric User ID of the user that triggered the event. Value is
          -1 if not set.
        type: integer
      username:
        description: Username of the user that triggered the event.
        type: string
    required:
    - timestamp
    - action
    - record_type
    - identifier
    - uid
    - username
    - ipaddr
    - pid
    - sid
    - module
    - success
    - details
    - count
    type: object
  events_meta:
    additionalProperties: false
    description: Meta data of the data set returned when a list of events are fetched.
    properties:
      count:
        description: The actual number of reports returned for this request.
        type: integer
      limit:
        description: Maximum number report instances to be returned.
        type: integer
      offset:
        description: Start returning report instances from offset specified.
        type: integer
      total:
        description: Total number of reports in the system that match the filter criteria.
        type: integer
    type: object
version: '1.1'
