{"type":"api","title":"Create a download request","meta":{"id":"/apps/pubhub/media/orbital-api/1c9ae58c5602552df6194a1545023fdb0c609c3b/6031b5a0-67fa-3480-bf75-857e24b55963","info":{"description":"Documentation of the Orbital API\n\nTo authenticate:\n\n\nFollow steps 1 through 3 from the SecureX Authorization section of this article to generate a SecureX Token.\nhttps://developer.cisco.com/docs/secure-endpoint/#!authentication\n\n\nclick \"Authorize\" button\nIn \"Value\" - enter token from above, prefixed with \"Bearer \" (no quotes)\nClick \"Authorize\", followed by \"Close\"\n\nNow the \"Try it out\" button can work","title":"Orbital API","version":"0.0.1"},"security":[{"AuthorizationHeader":[]}],"openapi":"3.0.3","servers":[{"description":"North America","url":"https://enterprise.orbital.amp.cisco.com/v0"},{"description":"Asia, Pacific, Japan, and China","url":"https://apjc.orbital.amp.cisco.com/v0"},{"description":"Europe","url":"https://eu.orbital.amp.cisco.com/v0"}],"securitySchemes":{"AuthorizationHeader":{"description":"Ex: Bearer \\\u003ctoken\\\u003e","in":"header","name":"authorization","type":"apiKey"}}},"spec":{"description":"Create a download request","operationId":"idOfDownloadCreate","requestBody":{"content":{"application/json":{"schema":{"properties":{"format":{"description":"CSV or JSON - case matters","type":"string"},"options":{"description":"Options contains options structures for different\ntypes of downloads. Only one of the fields can be set.\nWhichever is set, it is marshaled as json and inserted\nas jsonb in crdb. For reading out of crdb, the reverse:\nthe json is matched to the right struct.\n\nThe actual \"value\" of the options must always be an interior\nfield, as Unmarshal cannot mutate its own receiver pointer,\nonly that of an interior field.\n\nThe alternative to this approach is to have a single interface{}\ninternal field, but that means type assertions everywhere, which\naren't a huge deal performance-wise, but are verbose to type out.\n\nThe \"right way\" here would be sum types (which go doesn't have):\ntype Options = *EndpointOptions | *ResultsOptions","properties":{"endpoints":{"description":"EndpointsOptions is reserved for future use","type":"object","$$ref":"#/components/schemas/EndpointsOptions"},"results":{"description":"ResultsOptions can be set to filter results.\nResults will always be sorted by descending timestamp (latest first).\nNote that Limit can be less than a set value\n\nOptions in the db are stored as jsonb. The download type is used to\ndetermine if the row is a results download request...if so, the\noptions will be unmarshaled back into this type.","properties":{"after":{"format":"date-time","type":"string"},"before":{"description":"Before and After filter by result timestamp.\nBoth must either be nil or non-nil. In the\ncase where they are both not set, then\nthe implicit default will be Before == now...\nand by \"implicit\", the query will sort by descending\nresult reported time","format":"date-time","type":"string"},"limit":{"description":"Limit can be some number smaller than ResultsRowLimit\nbut no higher...0 implies no set limit\n(currently not overridden, wait and see if there is a need...)","format":"int64","type":"integer"},"queryid":{"description":"If QueryID is nonempty, only select results for it.\nNote! there is no error checking here...if you enter a\nQueryID that isn't in the db/s3, you get no results.","type":"string"},"withrows":{"description":"WithRows will, if set to true, only return results with\nrows. Since the default of false induces this option to\nbe ignored, there is no way to only ask for result with no\nrows for downloads.","type":"boolean"}},"title":"Results Options","type":"object","$$ref":"#/components/schemas/ResultsOptions"}},"title":"Download options","type":"object","$$ref":"#/components/schemas/Options"},"type":{"description":"1 for endpoints, 2 for results","type":"string"}},"type":"object","$$ref":"#/components/schemas/PostRequest"}}},"description":"Parameter required to create the download request","x-originalParamName":"Body"},"responses":{"200":{"content":{"application/json":{"schema":{"description":"Public is the info about a download that can be shared with the ui","properties":{"created":{"description":"download request creation timestamp","format":"date-time","type":"string"},"format":{"description":"CSV or JSON - case matters","type":"string"},"id":{"description":"ID of the created download request","type":"string"},"obj":{"description":"url of object storage","type":"string"},"options":{"type":"object"},"url":{"description":"url to use to fetch the download","type":"string"}},"type":"object","$$ref":"#/components/schemas/Public"}}},"description":"create download","$$ref":"#/components/responses/DownloadCreateResponse"},"400":{"content":{"application/json":{"schema":{"properties":{"errors":{"example":["download id not found"],"items":{"type":"string"},"type":"array"}},"type":"object","$$ref":"#/components/schemas/ErrorMsg400DownloadFetch"}}},"description":"Download Error 400 Response","$$ref":"#/components/responses/ErrorMsg400"},"401":{"content":{"application/json":{"schema":{"properties":{"errors":{"example":["authentication required"],"items":{"type":"string"},"type":"array"}},"type":"object","$$ref":"#/components/schemas/ErrorMsg401MissingToken"}}},"description":"Download Error 401 Response","$$ref":"#/components/responses/ErrorMsg401Download"}},"security":[{"AuthorizationHeader":[]}],"summary":"Create a download request","tags":["Misc"],"__originalOperationId":"idOfDownloadCreate","method":"post","path":"/download"}}