{"swagger":"2.0","info":{"title":"api","description":"","termsOfService":"","version":"0.0.1"},"host":"api-dev-fota.hylink.io","basePath":"/","schemes":["https"],"paths":{"/firmware":{"get":{"tags":["Firmware"],"description":"Query firmware list from legacy database","operationId":"queryLegacyFirmwareList","deprecated":true,"parameters":[{"name":"mid","description":"Mid.","in":"query","type":"string"},{"name":"part_num","description":"Part number.","in":"query","type":"string"},{"name":"rule_part_num","description":"Part number.","in":"query","type":"string"},{"name":"fw_kernel_ver","description":"FW kernel version.","in":"query","type":"string"},{"name":"fw_ver","description":"FW version.","in":"query","type":"string"},{"name":"min_fw_kernel_ver","description":"Deivce current FW kernel version.","in":"query","type":"string"},{"name":"min_fw_ver","description":"Device current FW version.","in":"query","type":"string"},{"name":"max_fw_ver","description":"The max of fw version","in":"query","type":"string"},{"name":"hw_ver","description":"Hardware version.","in":"query","type":"string"},{"name":"with_deprecated","description":"If true, the qeury will contains deprecated firmware. Default: false.","in":"query","type":"string"},{"name":"target","description":"Release to target system.","in":"query","type":"string"},{"name":"stage","description":"Development stage","in":"query","type":"string"}],"responses":{"200":{"description":"- files:\n  Provide firmware file with different type.\n- releases:\n  It is a firmware release history. A firmware from development to production stage should be released to different phase to ensure product quality.","schema":{"$ref":"#/definitions/FirmwareListResponse"}},"400":{"description":"ex: Validation Error","schema":{"$ref":"#/definitions/BadRequestError"}}}}},"/firmware/{firmware_id}/files":{"get":{"tags":["Firmware"],"description":"Get firmware file from legacy database","operationId":"getLegacyFirmwareFile","deprecated":true,"parameters":[{"name":"firmware_id","description":"firmware id","in":"path","type":"integer","required":true}],"responses":{"200":{"description":"List of firmware files response.","schema":{"$ref":"#/definitions/FirmwareFileListResponse"}},"400":{"description":"ex: Validation Error","schema":{"$ref":"#/definitions/BadRequestError"}},"404":{"description":"Firmware not found","schema":{"$ref":"#/definitions/NotFoundError"}}}}},"/v2/firmware":{"get":{"tags":["Firmware"],"description":"Query firmware list","operationId":"queryFirmwareList","parameters":[{"name":"mid","description":"Mid.","in":"query","type":"string"},{"name":"part_num","description":"Part number.","in":"query","type":"string"},{"name":"rule_part_num","description":"Part Spec Id.","in":"query","type":"string"},{"name":"fw_kernel_ver","description":"FW kernel version.","in":"query","type":"string"},{"name":"fw_ver","description":"FW version.","in":"query","type":"string"},{"name":"min_fw_kernel_ver","description":"Deivce current FW kernel version.","in":"query","type":"string"},{"name":"min_fw_ver","description":"Device current FW version.","in":"query","type":"string"},{"name":"max_fw_ver","description":"The max of fw version","in":"query","type":"string"},{"name":"hw_ver","description":"Hardware version.","in":"query","type":"string"},{"name":"with_deprecated","description":"If true, the qeury will contains deprecated firmware. Default: false.","in":"query","type":"string"},{"name":"target","description":"Release to target system.","in":"query","type":"string"},{"name":"stage","description":"Development stage","in":"query","type":"string"}],"responses":{"200":{"description":"- files:\n  Provide firmware file with different type.\n- releases:\n  It is a firmware release history. A firmware from development to production stage should be released to different phase to ensure product quality.","schema":{"$ref":"#/definitions/FirmwareListResponse"}},"400":{"description":"ex: Validation Error","schema":{"$ref":"#/definitions/BadRequestError"}}}},"post":{"tags":["Firmware"],"description":"Create firmware.","operationId":"createFirmware","parameters":[{"name":"body","schema":{"$ref":"#/definitions/CreateFirmwareRequest"},"description":"Create firmware request.","in":"body"}],"responses":{"200":{"description":"Firmware response.","schema":{"$ref":"#/definitions/FirmwareResponse"}},"400":{"description":"ex: Validation Error","schema":{"$ref":"#/definitions/BadRequestError"}}}}},"/v2/firmware/release_note":{"get":{"tags":["Firmware"],"description":"Query firmware release note list","operationId":"queryFirmwareNoteList","parameters":[{"name":"rule_part_num","description":"Part Spec ID.","in":"query","type":"string"},{"name":"fw_ver","description":"FW version.","in":"query","type":"string"},{"name":"hw_ver","description":"Hardware version.","in":"query","type":"string"},{"name":"release_note_status","description":"Release note Status.","in":"query","type":"string","enum":["na","todo","done"]},{"name":"page","description":"default = 1","in":"query","type":"integer"},{"name":"page_size","description":"default = 20","in":"query","type":"integer"},{"name":"sort","description":"example: sort=release_note_updated_at:asc ; release_note_updated_at:desc","default":"release_note_updated_at:desc","in":"query","type":"string"}],"responses":{"200":{"description":"List of firmware release note and i18n","schema":{"$ref":"#/definitions/FirmwareReleaseNoteListResponse"}},"400":{"description":"ex: Validation Error","schema":{"$ref":"#/definitions/BadRequestError"}}}}},"/v2/firmware/{firmware_id}":{"get":{"tags":["Firmware"],"description":"Get the firmware by firmware id.","operationId":"getFirmware","parameters":[{"name":"firmware_id","description":"Firmware id","in":"path","type":"string","required":true}],"responses":{"200":{"description":"Firmware response.","schema":{"$ref":"#/definitions/FirmwareResponse"}},"404":{"description":"The resource is not found.","schema":{"$ref":"#/definitions/NotFoundError"}}}},"patch":{"tags":["Firmware"],"description":"Update firmware by firmware id.","operationId":"updateFirmware","parameters":[{"name":"firmware_id","description":"Firmware id","in":"path","type":"string"},{"name":"body","schema":{"$ref":"#/definitions/UpdateFirmwareRequest"},"description":"Update firmware info.","in":"body"}],"responses":{"200":{"description":"Firmware response.","schema":{"$ref":"#/definitions/FirmwareResponse"}},"400":{"description":"Validation error or illegal operation","schema":{"$ref":"#/definitions/BadRequestError"}},"404":{"description":"Firmware not found","schema":{"$ref":"#/definitions/NotFoundError"}}}}},"/v2/firmware/{firmware_id}/deprecate":{"put":{"tags":["Firmware"],"description":"Deprecate firmware by firmware id.","operationId":"deprecateFirmware","parameters":[{"name":"firmware_id","description":"Firmware id","in":"path","type":"string"}],"responses":{"200":{"description":"Firmware response.","schema":{"$ref":"#/definitions/FirmwareResponse"}},"400":{"description":"Validation error or illegal operation","schema":{"$ref":"#/definitions/BadRequestError"}},"404":{"description":"Firmware not found","schema":{"$ref":"#/definitions/NotFoundError"}}}}},"/v2/firmware/{firmware_id}/files":{"get":{"tags":["Firmware"],"description":"Get firmware file","operationId":"getFirmwareFile","parameters":[{"name":"firmware_id","description":"firmware id","in":"path","type":"integer","required":true}],"responses":{"200":{"description":"List of firmware files response.","schema":{"$ref":"#/definitions/FirmwareFileListResponse"}},"400":{"description":"ex: Validation Error","schema":{"$ref":"#/definitions/BadRequestError"}},"404":{"description":"Firmware not found","schema":{"$ref":"#/definitions/NotFoundError"}}}},"post":{"tags":["Firmware"],"description":"Create firmware file","operationId":"createFirmwareFile","parameters":[{"name":"firmware_id","description":"firmware id","in":"path","type":"integer","required":true},{"name":"firmware_file","description":"Upload firmware file.","type":"file","in":"formData","required":true},{"name":"type","description":"Firmware file type.","type":"string","enum":["hex","bin","zip","hat","nordic_hat","srec","csv"],"in":"formData","required":true}],"responses":{"200":{"description":"Firmware file response.","schema":{"$ref":"#/definitions/FirmwareFileResponse"}},"400":{"description":"ex: Validation Error","schema":{"$ref":"#/definitions/BadRequestError"}}}}},"/v2/firmware/{firmware_id}/release":{"post":{"tags":["Firmware"],"description":"Release the firmware to target stage and service.","operationId":"releaseFirmware","parameters":[{"name":"firmware_id","description":"firmware id","in":"path","type":"integer","required":true},{"name":"body","in":"body","schema":{"$ref":"#/definitions/CreateFirmwareReleaseRequest"},"description":"Release firmware request."}],"responses":{"200":{"description":"Release firmware response.","schema":{"$ref":"#/definitions/FirmwareReleaseResponse"}},"400":{"description":"ex: Validation Error","schema":{"$ref":"#/definitions/BadRequestError"}}}}},"/v2/firmware/{firmware_id}/release/{release_id}":{"delete":{"tags":["Firmware"],"description":"Remove firmware release.","operationId":"removeFirmwareRelease","parameters":[{"name":"firmware_id","description":"firmware id","in":"path","type":"integer","required":true},{"name":"release_id","description":"Release id","in":"path","type":"integer","required":true}],"responses":{"400":{"description":"ex: Validation Error","schema":{"$ref":"#/definitions/BadRequestError"}},"404":{"description":"Firmware not found","schema":{"$ref":"#/definitions/NotFoundError"}}}}},"/v2/firmware/{firmware_id}/release_note_i18n/{lang}":{"patch":{"tags":["Firmware"],"description":"Update firmware release note i18n","operationId":"updateFirmwareReleaseNoteI18n","parameters":[{"name":"firmware_id","description":"firmware id","in":"path","type":"integer","required":true},{"name":"lang","description":"lang code","in":"path","type":"string","enum":["en-us","de","fr","es","it","nl"],"required":true},{"name":"body","schema":{"$ref":"#/definitions/UpdateFirmwareReleaseNoteI18nRequest"},"description":"Firmware release note i18n request","in":"body"}],"responses":{"200":{"description":"Response of firmware release note i18n.","schema":{"$ref":"#/definitions/FirmwareReleaseNoteI18nResponse"}},"400":{"description":"ex: Validation Error","schema":{"$ref":"#/definitions/BadRequestError"}},"404":{"description":"Firmware not found","schema":{"$ref":"#/definitions/NotFoundError"}}}},"post":{"tags":["Firmware"],"description":"Create firmware release note i18n","operationId":"createFirmwareReleaseNoteI18n","parameters":[{"name":"firmware_id","description":"firmware id","in":"path","type":"integer","required":true},{"name":"lang","description":"lang code","in":"path","type":"string","enum":["en-us","de","fr","es","it","nl"],"required":true},{"name":"body","schema":{"$ref":"#/definitions/CreateFirmwareReleaseNoteI18nRequest"},"description":"Firmware release note i18n request.","in":"body"}],"responses":{"200":{"description":"Response of firmware release note i18n.","schema":{"$ref":"#/definitions/FirmwareReleaseNoteI18nResponse"}},"400":{"description":"ex: Validation Error","schema":{"$ref":"#/definitions/BadRequestError"}},"404":{"description":"Firmware not found","schema":{"$ref":"#/definitions/NotFoundError"}}}}}},"definitions":{"FirmwareListResponse":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#/definitions/Firmware"},"description":"List of firmware"}}},"Firmware":{"type":"object","properties":{"id":{"type":"integer","description":"Firmware id."},"part_num":{"type":"string","maxLength":30,"description":"Manufacture Part Spec ID."},"rule_part_num":{"type":"string","maxLength":30,"description":"Part Spec ID."},"hw_ver":{"type":"string","maxLength":15,"description":"Hardware version."},"fw_partition":{"type":"string","description":"Firmware partition."},"fw_kernel_ver":{"type":"string","maxLength":15,"description":"Firmware kernel version."},"fw_ver":{"type":"string","maxLength":15,"description":"Firmware version."},"param_ver":{"type":"string","maxLength":15,"description":"Parameter version."},"release_note":{"type":"string","description":"Release note."},"marketing_release_note":{"type":"string","description":"Marketing release note."},"files":{"type":"array","items":{"$ref":"#/definitions/FirmwareFile"},"description":"List of firmware files."},"releases":{"type":"array","items":{"$ref":"#/definitions/FirmwareRelease"},"description":"List of firmware release."},"created_at":{"type":"string","format":"date-time","description":"Created date in ISO8601 date format"},"deprecated_at":{"type":"string","format":"date-time","description":"deprecated date in ISO8601 date format"}},"example":{"files":[{"checksum":"b738f5b829952141b7d50f5aa82ef64b","created_at":"2020-07-22T11:13:39+00:00","file_name":"8f4a14dc-d6fe-11ea-87d0-0242ac130003.zip","firmware_id":1025,"meta":{"source_name":"WOW_APP_A01.zip"},"type":"zip"}],"fw_kernel_ver":"A01","fw_ver":"A01","hw_ver":"A01","id":1025,"rule_part_num":"40005C16C","part_num":"40005C16C-1","release_note":"","releases":[{"created_at":"2020-06-02T04:32:35.098670+00:00","firmware_id":1025,"id":12213,"stage":"prod","target":"FTS","updated_at":"2020-06-02T04:32:35.098670+00:00"}],"created_at":"2020-06-02T04:32:35.098670+00:00","deprecated_at":"2020-06-02T04:32:35.098670+00:00"}},"FirmwareFile":{"type":"object","properties":{"firmware_id":{"type":"integer","description":"Firmware id."},"file_name":{"type":"string","maxLength":80,"description":"Firmware file name."},"checksum":{"type":"string","maxLength":32,"description":"It's for verifying data integrity."},"type":{"type":"string","description":"Firmware type.","enum":["hex","bin","zip","hat","nordic_hat","srec","csv"]},"signed_url":{"type":"string","description":"Link of firmware file"},"meta":{"type":"object","additionalProperties":{"type":"string"}},"created_at":{"type":"string","format":"date-time","description":"Created date in ISO8601 date format"}},"required":["firmware_id","type","file_name","created_at"],"example":{"firmware_id":1,"checksum":"47f395eab6526c07d498f39bf0c077d9","file_name":"84f9db85-8ee8-4548-ab9f-f5f08d9ec8ed.hex","type":"hex","meta":{"source_name":"D0002C18B-7_Console_APP_A03_A25_A06.hex"},"created_at":"2020-04-22T00:46:45.380828+00:00"}},"FirmwareRelease":{"type":"object","properties":{"id":{"type":"integer","description":"Release id."},"firmware_id":{"type":"integer","description":"Firmware id."},"stage":{"type":"string","enum":["dev","qa","beta","alpha","preview","prod"],"description":"Service stage."},"target":{"type":"string","enum":["FTS","BTS","HST","HRA"],"description":"Service name."},"created_at":{"type":"string","format":"date-time","description":"Created date in ISO8601 date format"},"updated_at":{"type":"string","format":"date-time","description":"Updated date in ISO8601 date format"}},"required":["id","firmware_id","stage","target","created_at"],"example":{"id":289,"firmware_id":1,"target":"BTS","stage":"dev","created_at":"2020-04-22T00:45:43.313931+00:00","updated_at":"2020-04-22T00:45:43.313931+00:00"}},"BadRequestError":{"title":"Bad Request Error","description":"Bad Request due to validation or sth.","example":{"message":"Validation error","code":"400000"},"properties":{"message":{"type":"string","description":"Error message."},"code":{"type":"string","description":"Error code."}},"required":["message","code"],"type":"object"},"CreateFirmwareRequest":{"type":"object","properties":{"rule_part_num":{"type":"string","maxLength":30,"description":"Part Spec Id."},"hw_ver":{"type":"string","maxLength":15,"description":"Hardware version."},"fw_partition":{"type":"string","description":"Firmware partition."},"fw_kernel_ver":{"type":"string","maxLength":15,"description":"Firmware kernel version."},"fw_ver":{"type":"string","maxLength":15,"description":"Firmware version."},"param_ver":{"type":"string","maxLength":15,"description":"Parameter version."},"release_note":{"type":"string","description":"Release note."}},"required":["rule_part_num","hw_ver","fw_kernel_ver","fw_ver","fw_partition","param_ver"]},"FirmwareResponse":{"type":"object","properties":{"result":{"$ref":"#/definitions/Firmware"}}},"NotFoundError":{"title":"Not Found Error","description":"Resource not found","example":{"message":"Not Found error","code":"404000"},"properties":{"message":{"type":"string","description":"Error message."},"code":{"type":"string","description":"Error code."}},"required":["message","code"],"type":"object"},"UpdateFirmwareRequest":{"type":"object","properties":{"release_note":{"type":"string","description":"Release note."}}},"FirmwareFileListResponse":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#/definitions/FirmwareFile"},"description":"List of firmware file response."}}},"FirmwareFileResponse":{"type":"object","properties":{"result":{"$ref":"#/definitions/FirmwareFile"}}},"CreateFirmwareReleaseRequest":{"type":"object","properties":{"target":{"type":"string","enum":["FTS","BTS","HST","HRA"],"description":"Service name."},"stage":{"type":"string","enum":["dev","qa","beta","alpha","preview","prod"],"description":"Service stage."}}},"FirmwareReleaseResponse":{"type":"object","properties":{"result":{"$ref":"#/definitions/FirmwareRelease"}}},"FirmwareReleaseNoteListResponse":{"type":"object","properties":{"meta":{"total":33},"result":{"type":"array","items":{"$ref":"#/definitions/FirmwareReleaseNote"},"description":"List of firmware"}}},"FirmwareReleaseNote":{"type":"object","properties":{"id":{"type":"integer","description":"Firmware id."},"rule_part_num":{"type":"string","maxLength":30,"description":"Part Spec ID."},"hw_ver":{"type":"string","maxLength":15,"description":"Hardware version."},"fw_ver":{"type":"string","maxLength":15,"description":"Firmware version."},"release_note":{"type":"string","description":"Release note."},"release_note_i18n":{"type":"array","items":{"$ref":"#/definitions/FirmwareReleaseNoteI18n"},"description":"Release note."},"release_note_status":{"type":"string","enum":["na","todo","done"],"description":"Release note Status."},"release_note_updated_at":{"type":"string","format":"date-time","description":"Release note updated date in ISO8601 date format."},"created_at":{"type":"string","format":"date-time","description":"Created date in ISO8601 date format"}},"required":["id","rule_part_num","fw_ver","created_at","release_note_status"],"example":{"fw_ver":"A01","hw_ver":"A01","id":1025,"rule_part_num":"40005C16C","release_note":"version 16 is available","release_note_i18n":[{"created_at":"2022-10-25T01:35:07.612976+00:00","created_by":"00000000-0000-0000-0000-00000000000 ","firmware_id":1025,"lang":"en-us","text":"version 16 is available","updated_at":"2022-10-25T01:35:07.612976+00:00","updated_by":"00000000-0000-0000-0000-00000000000 "}],"release_note_status":"done","release_note_updated_at":"2022-10-25T07:14:39.927009+00:00","created_at":"2020-06-02T04:32:35.098670+00:00"}},"FirmwareReleaseNoteI18n":{"type":"object","properties":{"firmware_id":{"type":"integer","description":"Firmware id."},"lang":{"type":"string","enum":["en-us","de","fr","es","it","nl"],"description":"Release note language code"},"text":{"type":"string","description":"Release note."},"created_at":{"type":"string","format":"date-time","description":"Created date in ISO8601 date format"},"created_by":{"type":"string","description":"Created operator"},"updated_at":{"type":"string","format":"date-time","description":"Updated date in ISO8601 date format"},"updated_by":{"type":"string","description":"Updated operator"}},"required":["firmware_id","lang","text","created_at","created_by","updated_at","updated_by"],"example":{"firmware_id":1,"lang":"en-us","text":"A03 first MP version","created_at":"2020-04-22T00:46:45.380828+00:00","created_by":"00000000-0000-0000-0000-00000000000 ","updated_at":"2020-04-22T00:46:45.380828+00:00","updated_by":"00000000-0000-0000-0000-00000000000 "}},"UpdateFirmwareReleaseNoteI18nRequest":{"type":"object","properties":{"text":{"type":"string","description":"Release note."},"operator":{"type":"string","description":"Updated operator"}},"required":["text","operator"]},"FirmwareReleaseNoteI18nResponse":{"type":"object","properties":{"result":{"$ref":"#/definitions/FirmwareReleaseNoteI18n"}}},"CreateFirmwareReleaseNoteI18nRequest":{"type":"object","properties":{"text":{"type":"string","required":true,"description":"Release note."},"operator":{"type":"string","required":true,"description":"Created operator"}},"required":["text","operator"]}},"securityDefinitions":{"ApiVersion":{"type":"apiKey","in":"header","name":"X-API-Version","description":"All requests must include this header to indicate the api version. (Default:0.0.1)"}},"security":[{"ApiVersion":[]}]}