{
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "schemes": [
    "http",
    "https"
  ],
  "swagger": "2.0",
  "info": {
    "description": "NTP Config Service provides the backend infrastructure for facilitating the configuration of the NTP service running on the on-prem host. The supported configuration options include management of upstream reference time servers; symmetric, key-based encryption for authentication; and access-control lists.",
    "title": "NTP Config Service",
    "version": "v1"
  },
  "basePath": "/api/ntp/v1/",
  "paths": {
    "/account/config": {
      "get": {
        "tags": [
          "NTP Config Service API"
        ],
        "summary": "Retrieves the global default NTP configuration of the account from the database.",
        "operationId": "NTP Config Service APIGetAccountConfig",
        "responses": {
          "200": {
            "description": "Successful response",
            "schema": {
              "$ref": "#/definitions/atlasntpGetAccountConfigResponse"
            }
          },
          "401": {
            "description": "Unauthorized",
            "schema": {}
          },
          "403": {
            "description": "Forbidden",
            "schema": {}
          },
          "404": {
            "description": "Not Found",
            "schema": {}
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {}
          }
        }
      },
      "post": {
        "description": "Validation: ntp_config is required and should specify at least one upstream server.",
        "tags": [
          "NTP Config Service API"
        ],
        "summary": "Creates or updates the global default NTP configuration of the account.",
        "operationId": "NTP Config Service APISetAccountConfig",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/atlasntpSetAccountConfigRequest"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Successful response",
            "schema": {
              "$ref": "#/definitions/atlasntpSetAccountConfigResponse"
            }
          },
          "401": {
            "description": "Unauthorized",
            "schema": {}
          },
          "403": {
            "description": "Forbidden",
            "schema": {}
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {}
          }
        }
      }
    },
    "/service/config": {
      "get": {
        "tags": [
          "NTP Config Service API"
        ],
        "summary": "Lists all NTP service configuration records that belong to an account",
        "operationId": "NTP Config Service APIListServiceConfig",
        "parameters": [
          {
            "type": "string",
            "description": "\n\nA collection of response resources can be filtered by a logical expression string that includes JSON tag references to values in each resource, literal values, and logical operators. If a resource does not have the specified tag, its value is assumed to be null.\n\nLiteral values include numbers (integer and floating-point), and quoted (both single- or double-quoted) literal strings, and 'null'. The following operators are commonly used in filter expressions:\n\n|  Op   |  Description               | \n|  --   |  -----------               | \n|  ==   |  Equal                     | \n|  !=   |  Not Equal                 | \n|  \u003e    |  Greater Than              | \n|   \u003e=  |  Greater Than or Equal To  | \n|  \u003c    |  Less Than                 | \n|  \u003c=   |  Less Than or Equal To     | \n|  and  |  Logical AND               | \n|  ~    |  Matches Regex             | \n|  !~   |  Does Not Match Regex      | \n|  or   |  Logical OR                | \n|  not  |  Logical NOT               | \n|  ()   |  Groupping Operators       |\n\n\t\t\t\t\t\t",
            "name": "_filter",
            "in": "query"
          },
          {
            "type": "string",
            "description": "\n\nA collection of response resources can be sorted by their JSON tags. For a 'flat' resource, the tag name is straightforward. If sorting is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, its value is assumed to be null.)\n\nSpecify this parameter as a comma-separated list of JSON tag names. The sort direction can be specified by a suffix separated by whitespace before the tag name. The suffix 'asc' sorts the data in ascending order. The suffix 'desc' sorts the data in descending order. If no suffix is specified the data is sorted in ascending order.\n\n\t\t\t\t\t\t",
            "name": "_order_by",
            "in": "query"
          },
          {
            "type": "integer",
            "description": "\n\nThe integer index (zero-origin) of the offset into a collection of resources. If omitted or null the value is assumed to be '0'.\n\n\t\t\t\t\t\t\t",
            "name": "_offset",
            "in": "query"
          },
          {
            "type": "integer",
            "description": "\n\nThe integer number of resources to be returned in the response. The service may impose maximum value. If omitted the service may impose a default value.\n\n\t\t\t\t\t\t\t",
            "name": "_limit",
            "in": "query"
          },
          {
            "type": "string",
            "description": "\n\nThe service-defined string used to identify a page of resources. A null value indicates the first page.\n\n\t\t\t\t\t\t\t",
            "name": "_page_token",
            "in": "query"
          },
          {
            "type": "string",
            "description": "\n\nA collection of response resources can be transformed by specifying a set of JSON tags to be returned. For a “flat” resource, the tag name is straightforward. If field selection is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, the tag does not appear in the output resource.\n\nSpecify this parameter as a comma-separated list of JSON tag names.\n\n\t\t\t\t\t\t",
            "name": "_fields",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "schema": {
              "$ref": "#/definitions/atlasntpListServiceConfigResponse"
            }
          },
          "401": {
            "description": "Unauthorized",
            "schema": {}
          },
          "403": {
            "description": "Forbidden",
            "schema": {}
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {}
          }
        }
      }
    },
    "/service/config/{id}": {
      "get": {
        "description": "Validation: id is required.",
        "tags": [
          "NTP Config Service API"
        ],
        "summary": "Retrieves the NTP configuration of the service identified by its unique identifier.",
        "operationId": "NTP Config Service APIGetServiceConfig",
        "parameters": [
          {
            "type": "string",
            "description": "An application specific resource identity of a resource",
            "name": "id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "schema": {
              "$ref": "#/definitions/atlasntpGetServiceConfigResponse"
            }
          },
          "401": {
            "description": "Unauthorized",
            "schema": {}
          },
          "403": {
            "description": "Forbidden",
            "schema": {}
          },
          "404": {
            "description": "Not Found",
            "schema": {}
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {}
          }
        }
      },
      "post": {
        "description": "Validation:\n- \"id\" is required.\n- \"ntp_config\" is required and should specify at least one upstream server.",
        "tags": [
          "NTP Config Service API"
        ],
        "summary": "Creates or updates the NTP configuration of the service identified by its unique identifier.",
        "operationId": "NTP Config Service APISetServiceConfig",
        "parameters": [
          {
            "type": "string",
            "description": "An application specific resource identity of a resource",
            "name": "id",
            "in": "path",
            "required": true
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/atlasntpSetServiceConfigRequest"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Successful response",
            "schema": {
              "$ref": "#/definitions/atlasntpSetServiceConfigResponse"
            }
          },
          "401": {
            "description": "Unauthorized",
            "schema": {}
          },
          "403": {
            "description": "Forbidden",
            "schema": {}
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {}
          }
        }
      },
      "delete": {
        "description": "Validation: id is required.",
        "tags": [
          "NTP Config Service API"
        ],
        "summary": "Deletes the NTP configuration records of the service identified by its unique identifier.",
        "operationId": "NTP Config Service APIDeleteServiceConfig",
        "parameters": [
          {
            "type": "string",
            "description": "An application specific resource identity of a resource",
            "name": "id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "schema": {
              "$ref": "#/definitions/atlasntpDeleteServiceConfigResponse"
            }
          },
          "401": {
            "description": "Unauthorized",
            "schema": {}
          },
          "403": {
            "description": "Forbidden",
            "schema": {}
          },
          "404": {
            "description": "Not Found",
            "schema": {}
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {}
          }
        }
      }
    }
  },
  "definitions": {
    "apiPageInfo": {
      "description": "PageInfo represents both server-driven and client-driven pagination response.\nServer-driven pagination is a model in which the server returns some\namount of data along with an token indicating there is more data\nand where subsequent queries can get the next page of data.\nClient-driven pagination is a model in which rows are addressable by\noffset and page size (limit).",
      "type": "object",
      "properties": {
        "offset": {
          "description": "The service may optionally include the offset of the next page of resources.\nA null value indicates no more pages.",
          "type": "integer",
          "format": "int32"
        },
        "page_token": {
          "description": "The service response should contain a string to indicate\nthe next page of resources.\nA null value indicates no more pages.",
          "type": "string"
        },
        "size": {
          "description": "The service may optionally include the total number of resources being paged.",
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "atlasntpDeleteServiceConfigResponse": {
      "type": "object",
      "title": "Delete Service Config Response",
      "properties": {
        "message": {
          "description": "The message received from the server indicating the status of the service config record deletion.",
          "type": "string",
          "readOnly": true
        }
      }
    },
    "atlasntpGetAccountConfigResponse": {
      "type": "object",
      "title": "Get Account Config Response",
      "properties": {
        "account_config": {
          "$ref": "#/definitions/atlasntpNtpAccountConfig"
        }
      }
    },
    "atlasntpGetServiceConfigResponse": {
      "type": "object",
      "title": "Get Service Config Response",
      "properties": {
        "ntp_service": {
          "$ref": "#/definitions/atlasntpNtpService"
        }
      }
    },
    "atlasntpListServiceConfigResponse": {
      "type": "object",
      "title": "List Service Config Response",
      "properties": {
        "page": {
          "$ref": "#/definitions/apiPageInfo"
        },
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/atlasntpNtpService"
          }
        }
      }
    },
    "atlasntpNtpAccessControlRules": {
      "type": "object",
      "title": "Ntp Access Control Rules",
      "properties": {
        "acl": {
          "description": "The name of the access control list.",
          "type": "string"
        },
        "created_at": {
          "description": "The timestamp of the ACL's creation.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "deleted_at": {
          "description": "The timestamp of the ACL's deletion.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "id": {
          "description": "The unique identifier of the acl db record.",
          "type": "string",
          "format": "int64",
          "readOnly": true
        },
        "kod": {
          "description": "The flag that indicates whether the Kiss-o'-death packet is to be sent to reduce unwanted queries.",
          "type": "boolean",
          "format": "boolean"
        },
        "limited": {
          "description": "The flag that indicates whether service is to be denied if the packet spacing violates the lower limits specified.",
          "type": "boolean",
          "format": "boolean"
        },
        "nomodify": {
          "description": "The flag that indicates whether any changes to the configuration are to be prevented.",
          "type": "boolean",
          "format": "boolean"
        },
        "nopeer": {
          "description": "The flag that indicates whether the formation of a peer association is to be prevented.",
          "type": "boolean",
          "format": "boolean"
        },
        "noquery": {
          "description": "The flag that indicates whether ntpq and ntpdc queries (but not time queries) are to be prevented from being answered.",
          "type": "boolean",
          "format": "boolean"
        },
        "notrap": {
          "description": "The flag that indicates whether ntpdc control message protocol traps are to be prevented.",
          "type": "boolean",
          "format": "boolean"
        },
        "updated_at": {
          "description": "The timestamp of the ACL's most recent update.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        }
      }
    },
    "atlasntpNtpAccountConfig": {
      "type": "object",
      "title": "NTP Account Config",
      "properties": {
        "created_at": {
          "description": "The timestamp of the configuration's creation.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "id": {
          "description": "The resource identifier.",
          "type": "string",
          "readOnly": true
        },
        "identity_account_id": {
          "description": "The unique identifier of the account.",
          "type": "string",
          "readOnly": true
        },
        "ntp_config": {
          "$ref": "#/definitions/atlasntpNtpConfig"
        },
        "updated_at": {
          "description": "The timestamp of the configuration's most recent update.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        }
      }
    },
    "atlasntpNtpConfig": {
      "type": "object",
      "title": "Ntp Config",
      "properties": {
        "avg": {
          "description": "Specifies the minimum average interpacket spacing (minimum average headway time) in log2s with default 3 to protect the server from client abuse.",
          "type": "integer",
          "format": "int32"
        },
        "created_at": {
          "description": "The timestamp of the configuration's creation.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "deleted_at": {
          "description": "The timestamp of the configuration's deletion.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "id": {
          "description": "The resource identifier.",
          "type": "string",
          "readOnly": true
        },
        "min": {
          "description": "Specifies the minimum interpacket spacing (guard time) needed to protect the server from client abuse. In seconds; the default value is 1.",
          "type": "integer",
          "format": "int32"
        },
        "monitor": {
          "description": "Specifies the probability of being recorded for packets that overflow the MRU list size limit to protect the server from client abuse.",
          "type": "integer",
          "format": "int32"
        },
        "ntp_access_control_rules": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/atlasntpNtpAccessControlRules"
          }
        },
        "ntp_config_details": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/atlasntpNtpConfigDetails"
          }
        },
        "ntp_keys": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/atlasntpNtpKeys"
          }
        },
        "previous_config_id": {
          "description": "The resource identifier.",
          "type": "string"
        },
        "updated_at": {
          "description": "The timestamp of the configuration's most recent update.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "version": {
          "description": "The current version of the service configuration.",
          "type": "string",
          "format": "int64",
          "readOnly": true
        }
      }
    },
    "atlasntpNtpConfigDetails": {
      "type": "object",
      "title": "Ntp Config Details",
      "properties": {
        "address": {
          "description": "The FQDN or IP address of the upstream time server.",
          "type": "string"
        },
        "authentication": {
          "description": "The flag that indicates whether to connect to this upstream time server using configured authentication keys.",
          "type": "boolean",
          "format": "boolean"
        },
        "authentication_key_type": {
          "description": "The key type.",
          "type": "string"
        },
        "authentication_key_value": {
          "description": "The key value.",
          "type": "string"
        },
        "burst": {
          "description": "The flag that indicates whether to send a burst of eight packets instead of the usual one to improve timekeeping quality.",
          "type": "boolean",
          "format": "boolean"
        },
        "created_at": {
          "description": "The timestamp of the upstream time server was created.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "deleted_at": {
          "description": "The timestamp of the upstream time server's deletion.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "iburst": {
          "description": "The flag that indicates whether to send a burst of six packets rather than the usual one, to speed up the initial synchronization with the upstream time server.",
          "type": "boolean",
          "format": "boolean"
        },
        "id": {
          "description": "The unique identifier of the upstream server db record.",
          "type": "string",
          "format": "int64",
          "readOnly": true
        },
        "is_pool": {
          "description": "The flag that indicates whether the specified upstream time server is a pool.",
          "type": "boolean",
          "format": "boolean"
        },
        "preferred": {
          "description": "The flag that indicates whether this upstream time server is preferred.",
          "type": "boolean",
          "format": "boolean"
        },
        "updated_at": {
          "description": "The timestamp of the upstream time server's most recent update.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "upstream_key_num": {
          "description": "The key number used to connect to the upstream time server.",
          "type": "integer",
          "format": "int64",
          "readOnly": true
        }
      }
    },
    "atlasntpNtpKeys": {
      "type": "object",
      "title": "Ntp Keys",
      "properties": {
        "comments": {
          "description": "Comments to be associated with the key.",
          "type": "string"
        },
        "created_at": {
          "description": "The timestamp of the key's creation.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "deleted_at": {
          "description": "The timestamp of the key's deletion.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "id": {
          "description": "The unique identifier of the key db record.",
          "type": "string",
          "format": "int64",
          "readOnly": true
        },
        "identity_account_id": {
          "description": "The unique identifier of the account.",
          "type": "string",
          "readOnly": true
        },
        "key_num": {
          "description": "The key number assigned to this key record.",
          "type": "integer",
          "format": "int64",
          "readOnly": true
        },
        "type": {
          "description": "The key type. Currently, only MD5 is supported.",
          "type": "string"
        },
        "updated_at": {
          "description": "The timestamp of the key's most recent update.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "upstream": {
          "description": "The flag that indicates whether this key is an upstream key.",
          "type": "boolean",
          "format": "boolean",
          "readOnly": true
        },
        "value": {
          "description": "The key value.",
          "type": "string"
        }
      }
    },
    "atlasntpNtpService": {
      "type": "object",
      "title": "Ntp Service",
      "properties": {
        "acl_override": {
          "description": "Indicates whether the default global configuration of the acls is overridden.",
          "type": "boolean",
          "format": "boolean"
        },
        "cfg_details_override": {
          "description": "Indicates whether the default global configuration of the upstream servers is overridden.",
          "type": "boolean",
          "format": "boolean"
        },
        "created_at": {
          "description": "The timestamp of the service's creation.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "deleted_at": {
          "description": "The timestamp of the service's deletion.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "id": {
          "description": "The resource identifier.",
          "type": "string",
          "readOnly": true
        },
        "identity_account_id": {
          "description": "The unique identifier of the account.",
          "type": "string",
          "readOnly": true
        },
        "ntp_config": {
          "$ref": "#/definitions/atlasntpNtpConfig"
        },
        "ntp_keys_override": {
          "description": "Indicates whether the default global configuration of the downstream keys is overridden.",
          "type": "boolean",
          "format": "boolean"
        },
        "ophids": {
          "description": "The on-prem hosts that belong to the pool on which this service is deployed.",
          "type": "array",
          "items": {
            "type": "string"
          },
          "readOnly": true
        },
        "pool_id": {
          "description": "The resource identifier.",
          "type": "string"
        },
        "service_id": {
          "description": "The resource identifier.",
          "type": "string"
        },
        "updated_at": {
          "description": "The timestamp of the service's most recent update.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        }
      }
    },
    "atlasntpSetAccountConfigRequest": {
      "type": "object",
      "title": "Set Account Config Request",
      "properties": {
        "ntp_config": {
          "$ref": "#/definitions/atlasntpNtpConfig"
        }
      }
    },
    "atlasntpSetAccountConfigResponse": {
      "type": "object",
      "title": "Set Account Config Response",
      "properties": {
        "account_config": {
          "$ref": "#/definitions/atlasntpNtpAccountConfig"
        }
      }
    },
    "atlasntpSetServiceConfigRequest": {
      "type": "object",
      "title": "Set Service Config Request",
      "properties": {
        "acl_override": {
          "description": "Whether to override the default global configuration of the acls",
          "type": "boolean",
          "format": "boolean"
        },
        "cfg_details_override": {
          "description": "Whether to override the default global configuration of the upstream servers",
          "type": "boolean",
          "format": "boolean"
        },
        "ntp_config": {
          "$ref": "#/definitions/atlasntpNtpConfig"
        },
        "ntp_keys_override": {
          "description": "Whether to override the default global configuration of the downstream keys",
          "type": "boolean",
          "format": "boolean"
        },
        "service_id": {
          "description": "The resource identifier.",
          "type": "string"
        }
      }
    },
    "atlasntpSetServiceConfigResponse": {
      "type": "object",
      "title": "Set Service Config Response",
      "properties": {
        "ntp_service": {
          "$ref": "#/definitions/atlasntpNtpService"
        }
      }
    }
  },
  "securityDefinitions": {
    "BearerAuth": {
      "description": "Format for authorization header: 'Bearer \u003cJWT_token\u003e'",
      "type": "apiKey",
      "name": "Authorization",
      "in": "header"
    }
  },
  "security": [
    {
      "BearerAuth": []
    }
  ]
}