$schema: http://support.riverbed.com/apis/service_def/2.2
id: http://support.riverbed.com/apis/mgmt.time/1.0
name: mgmt.time
provider: riverbed
resources:
  current_time:
    additionalProperties: false
    description: Current system time
    links:
      get:
        method: GET
        response:
          $ref: '#/resources/current_time'
      self:
        path: $/now
      set:
        method: PUT
        request:
          $ref: '#/resources/current_time'
        response:
          $ref: '#/resources/current_time'
    properties:
      is_dst:
        description: Daylight saving status
        readOnly: true
        type: boolean
      timestamp:
        description: Current system time, in Unix epoch seconds
        type: integer
      tz_name:
        description: Time zone abbreviation, e.g., PST
        readOnly: true
        type: string
      utc_offset:
        description: The UTC offset in seconds
        readOnly: true
        type: integer
    type: object
  ntp_server:
    additionalProperties: false
    description: An NTP server
    links:
      delete:
        method: DELETE
      get:
        method: GET
        response:
          $ref: '#/resources/ntp_server'
      self:
        path: $/ntp/servers/items/{server_id}
      set:
        method: PUT
        request:
          $ref: '#/resources/ntp_server'
        response:
          $ref: '#/resources/ntp_server'
    oneOf:
    - properties:
        encryption:
          enum:
          - none
          type: string
      required:
      - address
      - encryption
      - prefer
      - version
      type: object
    - properties:
        encryption:
          type: string
      required:
      - address
      - encryption
      - key_id
      - secret
      - prefer
      - version
      type: object
    properties:
      address:
        description: NTP server address
        minLength: 1
        type: string
      encryption:
        description: Encryption method to use
        type: string
      key_id:
        description: Encryption key ID
        maximum: 65534
        minimum: 0
        type: integer
      prefer:
        description: Prefer this server
        type: boolean
      secret:
        description: Encryption secret, if encryption is enabled
        minLength: 1
        type: string
      server_id:
        description: Unique NTP server ID
        readOnly: true
        type: integer
      version:
        description: NTP version
        maximum: 4
        minimum: 1
        type: integer
    relations:
      instances:
        description: List of all configured NTP servers
        resource: '#/resources/ntp_servers'
    type: object
  ntp_servers:
    description: Configured NTP servers
    links:
      create:
        method: POST
        request:
          $ref: '#/resources/ntp_server'
        response:
          $ref: '#/resources/ntp_server'
      get:
        method: GET
        response:
          $ref: '#/resources/ntp_servers'
      self:
        path: $/ntp/servers
    properties:
      items:
        description: List of configured NTP servers
        items:
          $merge:
            source:
              $ref: '#/resources/ntp_server'
            with:
              relations:
                full:
                  resource: '#/resources/ntp_server'
        type: array
    type: object
  ntp_status:
    description: Status of configured NTP servers
    items:
      additionalProperties: false
      description: Status of a single NTP server
      properties:
        active_sync:
          description: 'This is the active NTP server.  Only one may be active at
            a time.

            '
          type: boolean
        auth:
          description: This peer has been authenticated
          type: boolean
        conf:
          description: 'True if this peer was configured.  False indicates it was
            learned.

            '
          type: boolean
        delay:
          description: Roundtrip time to source, in milliseconds
          type: number
        jitter:
          description: The difference between two samples, in milliseconds
          type: number
        key_id:
          description: Encryption key id
          maximum: 65534
          minimum: 0
          type: integer
        offset:
          description: Time difference between client and source, in milliseconds
          type: number
        refid:
          description: Remote peer's reference ID
          type: string
        remote_peer:
          description: Hostname/IP address of the remote NTP peer
          type: string
      readOnly: true
      type: object
    links:
      get:
        method: GET
        response:
          $ref: '#/resources/ntp_status'
      self:
        path: $/ntp/status
    type: array
  ptp_config:
    additionalProperties: false
    description: PTP configuration
    links:
      get:
        method: GET
        response:
          $ref: '#/resources/ptp_config'
      self:
        path: $/ptp/config
      set:
        method: PUT
        request:
          $ref: '#/resources/ptp_config'
        response:
          $ref: '#/resources/ptp_config'
    properties:
      interface:
        description: Name of the interface to use for PTP synchronization
        type: string
      transport:
        description: PTP transport type
        enum:
        - ipv4
        - ipv6
        - ethernet
        type: string
    required:
    - interface
    - transport
    type: object
  ptp_status:
    additionalProperties: false
    description: PTP status
    links:
      get:
        method: GET
        response:
          $ref: '#/resources/ptp_status'
      self:
        path: $/ptp/status
    properties:
      active_sync:
        description: PTP is synchronized with the master
        type: boolean
      offset:
        description: PTP offset, in milliseconds, from the master
        type: number
      server:
        description: Server address (IPv4/IPv6/MAC address)
        type: string
    readOnly: true
    type: object
  time_configuration:
    description: Time source configuration
    links:
      get:
        method: GET
        response:
          $ref: '#/resources/time_configuration'
      self:
        path: $/configuration
      set:
        method: PUT
        request:
          $ref: '#/resources/time_configuration'
        response:
          $ref: '#/resources/time_configuration'
    properties:
      mode:
        description: Mode for automatic clock synchronization
        enum:
        - none
        - ntp
        - ptp
        type: string
    type: object
  time_set_event:
    additionalProperties: false
    description: 'The time has been changed. This event will only be sent when the
      system is on local clock.

      '
    links:
      get:
        method: GET
        response:
          $ref: '#/resources/time_set_event'
      self:
        path:
          template: $/event_queues/time_set_events/{id}
          vars:
            id: 0/hdr/id
    properties:
      hdr:
        $ref: /apis/mgmt.types.events/1.0#/types/event_header
      new_timestamp:
        description: New system time, in Unix epoch time
        type: integer
      old_timestamp:
        description: Previous system time, in Unix epoch time
        type: integer
    relations:
      instances:
        resource: '#/resources/time_set_events'
    required:
    - hdr
    - old_timestamp
    - new_timestamp
    type: object
  time_set_events:
    description: All time change events that have occurred
    links:
      get:
        method: GET
        response:
          $ref: '#/resources/time_set_events'
      self:
        path: $/event_queues/time_set_events
    properties:
      queue:
        description: The time change events
        items:
          $ref: '#/resources/time_set_event'
        type: array
    type: object
  timezone:
    description: The configured timezone
    links:
      get:
        method: GET
        response:
          $ref: '#/resources/timezone'
      self:
        path: $/timezone
      set:
        method: PUT
        request:
          $ref: '#/resources/timezone'
        response:
          $ref: '#/resources/timezone'
    type: string
  timezones:
    description: The list of known timezones
    items:
      description: A timezone
      type: string
    links:
      get:
        method: GET
        response:
          $ref: '#/resources/timezones'
      self:
        path: $/timezones
    type: array
title: System Time/NTP/PTP configuration module
version: '1.0'
