{
  "openapi" : "3.1.0",
  "info" : {
    "title" : "Forward Networks: Network Collection API",
    "description" : "Configure configuration and state collection from network devices",
    "contact" : {
      "email" : "support@forwardnetworks.com"
    },
    "license" : {
      "name" : "MIT",
      "url" : "https://spdx.org/licenses/MIT"
    },
    "version" : "${apiVersion}"
  },
  "servers" : [
    {
      "url" : "/"
    }
  ],
  "tags" : [
    {
      "name" : "Network Collection",
      "description" : "Collection Controller"
    }
  ],
  "paths" : {
    "/api/networks/{networkId}/cancelcollection" : {
      "post" : {
        "tags" : [
          "Network Collection"
        ],
        "summary" : "Cancels an in-progress network collection",
        "operationId" : "cancelCollectUsingPOST",
        "parameters" : [
          {
            "name" : "networkId",
            "in" : "path",
            "description" : "networkId",
            "required" : true,
            "style" : "simple",
            "explode" : false,
            "schema" : {
              "type" : "string"
            }
          }
        ],
        "responses" : {
          "200" : {
            "description" : "OK",
            "content" : {
              "application/json" : {
                "schema" : {
                  "type" : "object"
                }
              }
            }
          }
        },
        "deprecated" : false,
        "security" : [
          {
            "api_token" : [ ]
          }
        ]
      }
    },
    "/api/networks/{networkId}/collection-schedules" : {
      "get" : {
        "tags" : [
          "Network Collection"
        ],
        "summary" : "Gets a network’s collection schedules",
        "operationId" : "getCollectionSchedulesUsingGET",
        "parameters" : [
          {
            "name" : "networkId",
            "in" : "path",
            "description" : "networkId",
            "required" : true,
            "style" : "simple",
            "explode" : false,
            "schema" : {
              "type" : "string"
            }
          }
        ],
        "responses" : {
          "200" : {
            "description" : "OK",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CollectionSchedules"
                }
              }
            }
          }
        },
        "deprecated" : false,
        "security" : [
          {
            "api_token" : [ ]
          }
        ]
      },
      "post" : {
        "tags" : [
          "Network Collection"
        ],
        "summary" : "Adds a network collection schedule",
        "operationId" : "addCollectionScheduleUsingPOST",
        "parameters" : [
          {
            "name" : "networkId",
            "in" : "path",
            "description" : "networkId",
            "required" : true,
            "style" : "simple",
            "explode" : false,
            "schema" : {
              "type" : "string"
            }
          }
        ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CollectionScheduleDefinition"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "description" : "OK",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CollectionSchedule"
                }
              }
            }
          }
        },
        "deprecated" : false,
        "security" : [
          {
            "api_token" : [ ]
          }
        ]
      }
    },
    "/api/networks/{networkId}/collection-schedules/{scheduleId}" : {
      "get" : {
        "tags" : [
          "Network Collection"
        ],
        "summary" : "Gets a network collection schedule",
        "operationId" : "getCollectionScheduleUsingGET",
        "parameters" : [
          {
            "name" : "networkId",
            "in" : "path",
            "description" : "networkId",
            "required" : true,
            "style" : "simple",
            "explode" : false,
            "schema" : {
              "type" : "string"
            }
          },
          {
            "name" : "scheduleId",
            "in" : "path",
            "description" : "scheduleId",
            "required" : true,
            "style" : "simple",
            "explode" : false,
            "schema" : {
              "type" : "string"
            }
          }
        ],
        "responses" : {
          "200" : {
            "description" : "OK",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CollectionSchedule"
                }
              }
            }
          }
        },
        "deprecated" : false,
        "security" : [
          {
            "api_token" : [ ]
          }
        ]
      },
      "put" : {
        "tags" : [
          "Network Collection"
        ],
        "summary" : "Replaces a network collection schedule",
        "operationId" : "replaceCollectionScheduleUsingPUT",
        "parameters" : [
          {
            "name" : "networkId",
            "in" : "path",
            "description" : "networkId",
            "required" : true,
            "style" : "simple",
            "explode" : false,
            "schema" : {
              "type" : "string"
            }
          },
          {
            "name" : "scheduleId",
            "in" : "path",
            "description" : "scheduleId",
            "required" : true,
            "style" : "simple",
            "explode" : false,
            "schema" : {
              "type" : "string"
            }
          }
        ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CollectionSchedule"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "description" : "OK",
            "content" : {
              "application/json" : {
                "schema" : {
                  "type" : "object"
                }
              }
            }
          }
        },
        "deprecated" : false,
        "security" : [
          {
            "api_token" : [ ]
          }
        ]
      },
      "delete" : {
        "tags" : [
          "Network Collection"
        ],
        "summary" : "Deletes a network collection schedule",
        "operationId" : "deleteCollectionScheduleUsingDELETE",
        "parameters" : [
          {
            "name" : "networkId",
            "in" : "path",
            "description" : "networkId",
            "required" : true,
            "style" : "simple",
            "explode" : false,
            "schema" : {
              "type" : "string"
            }
          },
          {
            "name" : "scheduleId",
            "in" : "path",
            "description" : "scheduleId",
            "required" : true,
            "style" : "simple",
            "explode" : false,
            "schema" : {
              "type" : "string"
            }
          }
        ],
        "responses" : {
          "204" : {
            "description" : "No Content",
            "content" : { }
          }
        },
        "deprecated" : false,
        "security" : [
          {
            "api_token" : [ ]
          }
        ]
      }
    },
    "/api/networks/{networkId}/collector/status" : {
      "get" : {
        "tags" : [
          "Network Collection"
        ],
        "summary" : "Gets the status of a network’s collector",
        "operationId" : "getCollectorStateUsingGET",
        "parameters" : [
          {
            "name" : "networkId",
            "in" : "path",
            "description" : "networkId",
            "required" : true,
            "style" : "simple",
            "explode" : false,
            "schema" : {
              "type" : "string"
            }
          }
        ],
        "responses" : {
          "200" : {
            "description" : "OK",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CollectorState"
                }
              }
            }
          }
        },
        "deprecated" : false,
        "security" : [
          {
            "api_token" : [ ]
          }
        ]
      }
    },
    "/api/networks/{networkId}/startcollection" : {
      "post" : {
        "tags" : [
          "Network Collection"
        ],
        "summary" : "Triggers a network collection",
        "operationId" : "collectUsingPOST",
        "parameters" : [
          {
            "name" : "networkId",
            "in" : "path",
            "description" : "networkId",
            "required" : true,
            "style" : "simple",
            "explode" : false,
            "schema" : {
              "type" : "string"
            }
          }
        ],
        "responses" : {
          "200" : {
            "description" : "OK",
            "content" : {
              "application/json" : {
                "schema" : {
                  "type" : "object"
                }
              }
            }
          }
        },
        "deprecated" : false,
        "security" : [
          {
            "api_token" : [ ]
          }
        ]
      }
    }
  },
  "components" : {
    "schemas" : {
      "CollectionSchedule" : {
        "required" : [
          "daysOfTheWeek",
          "enabled",
          "id"
        ],
        "type" : "object",
        "properties" : {
          "id" : {
            "type" : "string",
            "description" : "Network-specific collection schedule identifier",
            "examples" : [
              "1"
            ]
          },
          "enabled" : {
            "type" : "boolean",
            "description" : "Whether the schedule is currently in effect",
            "examples" : [
              true
            ]
          },
          "timeZone" : {
            "type" : "string",
            "description" : "The time zone used to identify day boundaries and to interpret `times`, `startAt`, and `endAt`. Defaults to the organization’s preferred time zone.",
            "examples" : [
              "America/Los_Angeles"
            ],
            "enum" : [
              "UTC",
              "Africa/Accra",
              "Africa/Addis_Ababa",
              "Africa/Algiers",
              "Africa/Cairo",
              "Africa/Dar_es_Salaam",
              "Africa/Johannesburg",
              "Africa/Khartoum",
              "Africa/Kinshasa",
              "Africa/Lagos",
              "Africa/Luanda",
              "Africa/Maputo",
              "America/Argentina/Buenos_Aires",
              "America/Bogota",
              "America/Chicago",
              "America/Denver",
              "America/Lima",
              "America/Los_Angeles",
              "America/Mexico_City",
              "America/New_York",
              "America/Phoenix",
              "America/Santiago",
              "America/Sao_Paulo",
              "America/Toronto",
              "Asia/Amman",
              "Asia/Baghdad",
              "Asia/Bangkok",
              "Asia/Beirut",
              "Asia/Dhaka",
              "Asia/Ho_Chi_Minh",
              "Asia/Hong_Kong",
              "Asia/Jakarta",
              "Asia/Jerusalem",
              "Asia/Karachi",
              "Asia/Kolkata",
              "Asia/Kuala_Lumpur",
              "Asia/Manila",
              "Asia/Riyadh",
              "Asia/Seoul",
              "Asia/Shanghai",
              "Asia/Singapore",
              "Asia/Tehran",
              "Asia/Tokyo",
              "Asia/Yangon",
              "Australia/Adelaide",
              "Australia/Eucla",
              "Australia/Perth",
              "Australia/Sydney",
              "Europe/Belgrade",
              "Europe/Berlin",
              "Europe/Istanbul",
              "Europe/London",
              "Europe/Madrid",
              "Europe/Moscow",
              "Europe/Paris",
              "Europe/Rome"
            ]
          },
          "daysOfTheWeek" : {
            "type" : "array",
            "description" : "The days of the week, Sun (0), Mon (1), …, Sat (6), on which the collection schedule is active. Never empty.",
            "examples" : [
              [
                0,
                2,
                4,
                6
              ]
            ],
            "items" : {
              "type" : "integer",
              "format" : "int32"
            }
          },
          "times" : {
            "type" : "array",
            "description" : "Times of the day (in \"HH:mm\" format) at which network collections should start. Either `times` or `periodInSeconds` must be specified—not both. Never empty if present.",
            "examples" : [
              [
                "01:00",
                "06:00",
                "11:00",
                "16:00",
                "21:00"
              ]
            ],
            "items" : {
              "type" : "string"
            }
          },
          "periodInSeconds" : {
            "type" : "integer",
            "description" : "How many seconds after the start of the most recent collection that the next one should begin. Either `times` or `periodInSeconds` must be specified—not both. Must be positive.\n\n**Note**: A Collector can only perform one network collection at a time. A scheduled collection will be delayed if it cannot start on time due to an earlier collection running long.",
            "format" : "int32",
            "examples" : [
              1800
            ]
          },
          "startAt" : {
            "type" : "string",
            "description" : "The time of day (in \"HH:mm\" format) at which a rate-based collection schedule begins. Must be absent if `times` is specified. Defaults to the start of the day (00:00).",
            "examples" : [
              "05:30"
            ]
          },
          "endAt" : {
            "type" : "string",
            "description" : "The time of day (in \"HH:mm\" format) at which a rate-based collection schedule ends. Must be absent if `times` is specified. Defaults to the end of the day.",
            "examples" : [
              "20:00"
            ]
          }
        }
      },
      "CollectionScheduleDefinition" : {
        "required" : [
          "daysOfTheWeek",
          "enabled"
        ],
        "type" : "object",
        "properties" : {
          "enabled" : {
            "type" : "boolean",
            "description" : "Whether the schedule is currently in effect",
            "examples" : [
              true
            ]
          },
          "timeZone" : {
            "type" : "string",
            "description" : "The time zone used to identify day boundaries and to interpret `times`, `startAt`, and `endAt`. Defaults to the organization’s preferred time zone.",
            "examples" : [
              "America/Los_Angeles"
            ],
            "enum" : [
              "UTC",
              "Africa/Accra",
              "Africa/Addis_Ababa",
              "Africa/Algiers",
              "Africa/Cairo",
              "Africa/Dar_es_Salaam",
              "Africa/Johannesburg",
              "Africa/Khartoum",
              "Africa/Kinshasa",
              "Africa/Lagos",
              "Africa/Luanda",
              "Africa/Maputo",
              "America/Argentina/Buenos_Aires",
              "America/Bogota",
              "America/Chicago",
              "America/Denver",
              "America/Lima",
              "America/Los_Angeles",
              "America/Mexico_City",
              "America/New_York",
              "America/Phoenix",
              "America/Santiago",
              "America/Sao_Paulo",
              "America/Toronto",
              "Asia/Amman",
              "Asia/Baghdad",
              "Asia/Bangkok",
              "Asia/Beirut",
              "Asia/Dhaka",
              "Asia/Ho_Chi_Minh",
              "Asia/Hong_Kong",
              "Asia/Jakarta",
              "Asia/Jerusalem",
              "Asia/Karachi",
              "Asia/Kolkata",
              "Asia/Kuala_Lumpur",
              "Asia/Manila",
              "Asia/Riyadh",
              "Asia/Seoul",
              "Asia/Shanghai",
              "Asia/Singapore",
              "Asia/Tehran",
              "Asia/Tokyo",
              "Asia/Yangon",
              "Australia/Adelaide",
              "Australia/Eucla",
              "Australia/Perth",
              "Australia/Sydney",
              "Europe/Belgrade",
              "Europe/Berlin",
              "Europe/Istanbul",
              "Europe/London",
              "Europe/Madrid",
              "Europe/Moscow",
              "Europe/Paris",
              "Europe/Rome"
            ]
          },
          "daysOfTheWeek" : {
            "type" : "array",
            "description" : "The days of the week, Sun (0), Mon (1), …, Sat (6), on which the collection schedule is active. Never empty.",
            "examples" : [
              [
                0,
                2,
                4,
                6
              ]
            ],
            "items" : {
              "type" : "integer",
              "format" : "int32"
            }
          },
          "times" : {
            "type" : "array",
            "description" : "Times of the day (in \"HH:mm\" format) at which network collections should start. Either `times` or `periodInSeconds` must be specified—not both. Never empty if present.",
            "examples" : [
              [
                "01:00",
                "06:00",
                "11:00",
                "16:00",
                "21:00"
              ]
            ],
            "items" : {
              "type" : "string"
            }
          },
          "periodInSeconds" : {
            "type" : "integer",
            "description" : "How many seconds after the start of the most recent collection that the next one should begin. Either `times` or `periodInSeconds` must be specified—not both. Must be positive.\n\n**Note**: A Collector can only perform one network collection at a time. A scheduled collection will be delayed if it cannot start on time due to an earlier collection running long.",
            "format" : "int32",
            "examples" : [
              1800
            ]
          },
          "startAt" : {
            "type" : "string",
            "description" : "The time of day (in \"HH:mm\" format) at which a rate-based collection schedule begins. Must be absent if `times` is specified. Defaults to the start of the day (00:00).",
            "examples" : [
              "05:30"
            ]
          },
          "endAt" : {
            "type" : "string",
            "description" : "The time of day (in \"HH:mm\" format) at which a rate-based collection schedule ends. Must be absent if `times` is specified. Defaults to the end of the day.",
            "examples" : [
              "20:00"
            ]
          }
        }
      },
      "CollectionSchedules" : {
        "type" : "object",
        "properties" : {
          "schedules" : {
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/CollectionSchedule"
            }
          }
        }
      },
      "CollectorState" : {
        "required" : [
          "isSet"
        ],
        "type" : "object",
        "properties" : {
          "isSet" : {
            "type" : "boolean",
            "description" : "Whether the network has a Collector assigned"
          },
          "busyStatus" : {
            "type" : "string",
            "description" : "Absent if the network has no Collector assigned",
            "enum" : [
              "OFFLINE",
              "IDLE",
              "TESTING",
              "COLLECTING",
              "COLLECTION_QUEUED",
              "DISCOVERING",
              "UPDATING"
            ]
          }
        }
      }
    },
    "securitySchemes" : {
      "api_token" : {
        "type" : "http",
        "scheme" : "basic"
      }
    }
  }
}