{ "schemes": [ "http", "https" ], "swagger": "2.0", "info": { "description": "Cloud-native media hosting \u0026 streaming server for businesses.", "title": "Gilfoyle server", "contact": {}, "license": { "name": "GNU General Public License v3.0", "url": "https://github.com/dreamvo/gilfoyle/blob/master/LICENSE" }, "version": "v1" }, "host": "demo-v1.gilfoyle.dreamvo.com", "basePath": "/", "paths": { "/healthz": { "get": { "description": "Check for the health of the service", "produces": [ "application/json" ], "tags": [ "Instance" ], "summary": "Check service status", "operationId": "checkHealth", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/util.DataResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/api.HealthCheckResponse" } } } ] } } } } }, "/medias": { "get": { "description": "Get latest created medias", "produces": [ "application/json" ], "tags": [ "Medias" ], "summary": "Query medias", "operationId": "getAllMedias", "parameters": [ { "type": "integer", "description": "Max number of results", "name": "limit", "in": "query" }, { "type": "integer", "description": "Number of results to ignore", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/util.DataResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/ent.Media" } }, "metadata": { "$ref": "#/definitions/api.MediasMetadata" } } } ] } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/util.ErrorResponse" } } } }, "post": { "description": "Create a new media", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Medias" ], "summary": "Create a media", "operationId": "createMedia", "parameters": [ { "description": "Media data", "name": "media", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.CreateMedia" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/util.DataResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/ent.Media" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/util.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/util.ErrorResponse" } } } } }, "/medias/{id}": { "get": { "description": "Get one media", "produces": [ "application/json" ], "tags": [ "Medias" ], "summary": "Get a media", "operationId": "getMedia", "parameters": [ { "type": "string", "description": "Media ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/util.DataResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/ent.Media" } } } ] } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/util.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/util.ErrorResponse" } } } }, "delete": { "description": "Delete one media", "produces": [ "application/json" ], "tags": [ "Medias" ], "summary": "Delete a media", "operationId": "deleteMedia", "parameters": [ { "type": "string", "description": "Media ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.DataResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/util.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/util.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/util.ErrorResponse" } } } }, "patch": { "description": "Update an existing media", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Medias" ], "summary": "Update a media", "operationId": "updateMedia", "parameters": [ { "type": "string", "description": "Media ID", "name": "id", "in": "path", "required": true }, { "description": "Media data", "name": "media", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.UpdateMedia" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/util.DataResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/ent.Media" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/util.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/util.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/util.ErrorResponse" } } } } }, "/medias/{id}/upload/audio": { "post": { "description": "Upload a new audio file for a given media ID", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "Medias" ], "summary": "Upload a audio file", "operationId": "uploadAudio", "deprecated": true, "parameters": [ { "type": "string", "description": "Media identifier", "name": "id", "in": "path", "required": true }, { "type": "file", "description": "Audio file", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/util.DataResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/api.FileFormat" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/util.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/util.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/util.ErrorResponse" } } } } }, "/medias/{id}/upload/video": { "post": { "description": "Upload a new video file for a given media ID", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "Medias" ], "summary": "Upload a video file", "operationId": "uploadVideo", "parameters": [ { "type": "string", "description": "Media identifier", "name": "id", "in": "path", "required": true }, { "type": "file", "description": "Video file", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/util.DataResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/api.FileFormat" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/util.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/util.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/util.ErrorResponse" } } } } }, "/medias/{media_id}/attachments": { "get": { "description": "Get attachments of a media", "produces": [ "application/json" ], "tags": [ "Attachments" ], "summary": "Get attachments of a media", "operationId": "getMediaAttachments", "deprecated": true, "parameters": [ { "type": "string", "description": "Media identifier", "name": "media_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.DataResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/util.ErrorResponse" } } } } }, "/medias/{media_id}/attachments/{key}": { "post": { "description": "Add attachment to a media", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "Attachments" ], "summary": "Add attachment to a media", "operationId": "addMediaAttachment", "deprecated": true, "parameters": [ { "type": "string", "description": "Media identifier", "name": "media_id", "in": "path", "required": true }, { "type": "string", "description": "Attachment unique identifier", "name": "key", "in": "path", "required": true }, { "type": "file", "description": "Attachment file", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.DataResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/util.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/util.ErrorResponse" } } } }, "delete": { "description": "Delete attachment of a media", "produces": [ "application/json" ], "tags": [ "Attachments" ], "summary": "Delete attachment of a media", "operationId": "deleteMediaAttachment", "deprecated": true, "parameters": [ { "type": "string", "description": "Media identifier", "name": "media_id", "in": "path", "required": true }, { "type": "string", "description": "Attachment unique identifier", "name": "key", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.DataResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/util.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/util.ErrorResponse" } } } } }, "/medias/{media_id}/stream/{filename}": { "get": { "description": "Get HLS playlist file of a media", "produces": [ "application/octet-stream" ], "tags": [ "Stream" ], "summary": "Get HLS playlist file of a media", "operationId": "getMediaPlaylistFile", "parameters": [ { "type": "string", "description": "Media identifier", "name": "media_id", "in": "path", "required": true }, { "type": "string", "description": "HLS filename", "name": "filename", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" }, "headers": { "Content-Type": { "type": "string", "description": "application/octet-stream" } } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/util.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/util.ErrorResponse" } } } } } }, "definitions": { "api.CreateMedia": { "type": "object", "required": [ "title" ], "properties": { "title": { "type": "string", "example": "Sheep Discovers How To Use A Trampoline" } } }, "api.FileFormat": { "type": "object", "properties": { "bit_rate": { "type": "string" }, "duration": { "type": "string", "example": "0" }, "filename": { "type": "string" }, "format_long_name": { "type": "string" }, "format_name": { "type": "string" }, "nb_programs": { "type": "integer" }, "nb_streams": { "type": "integer" }, "probe_score": { "type": "integer" }, "size": { "type": "string" }, "start_time": { "type": "string", "example": "0" } } }, "api.HealthCheckResponse": { "type": "object", "properties": { "commit": { "type": "string" }, "database_dialect": { "type": "string" }, "debug": { "type": "boolean" }, "max_file_size": { "type": "integer" }, "storage_driver": { "type": "string" }, "tag": { "type": "string" } } }, "api.MediasMetadata": { "type": "object", "properties": { "limit": { "type": "integer" }, "offset": { "type": "integer" }, "total": { "type": "integer" } } }, "api.UpdateMedia": { "type": "object", "required": [ "title" ], "properties": { "title": { "type": "string", "example": "Sheep Discovers How To Use A Trampoline" } } }, "ent.Media": { "type": "object", "properties": { "created_at": { "description": "CreatedAt holds the value of the \"created_at\" field.", "type": "string" }, "edges": { "description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the MediaQuery when eager-loading is set.", "$ref": "#/definitions/ent.MediaEdges" }, "id": { "description": "ID of the ent.", "type": "string" }, "original_filename": { "description": "OriginalFilename holds the value of the \"original_filename\" field.", "type": "string" }, "status": { "description": "Status holds the value of the \"status\" field.", "type": "string" }, "title": { "description": "Title holds the value of the \"title\" field.", "type": "string" }, "updated_at": { "description": "UpdatedAt holds the value of the \"updated_at\" field.", "type": "string" } } }, "ent.MediaEdges": { "type": "object", "properties": { "media_files": { "description": "MediaFiles holds the value of the media_files edge.", "type": "array", "items": { "$ref": "#/definitions/ent.MediaFile" } } } }, "ent.MediaFile": { "type": "object", "properties": { "created_at": { "description": "CreatedAt holds the value of the \"created_at\" field.", "type": "string" }, "duration_seconds": { "description": "DurationSeconds holds the value of the \"duration_seconds\" field.", "type": "number" }, "edges": { "description": "Edges holds the relations/edges for other nodes in the graph.\nThe values are being populated by the MediaFileQuery when eager-loading is set.", "$ref": "#/definitions/ent.MediaFileEdges" }, "format": { "description": "Format holds the value of the \"format\" field.", "type": "string" }, "framerate": { "description": "Framerate holds the value of the \"framerate\" field.", "type": "integer" }, "id": { "description": "ID of the ent.", "type": "string" }, "media_type": { "description": "MediaType holds the value of the \"media_type\" field.", "type": "string" }, "rendition_name": { "description": "RenditionName holds the value of the \"rendition_name\" field.", "type": "string" }, "resolution_height": { "description": "ResolutionHeight holds the value of the \"resolution_height\" field.", "type": "integer" }, "resolution_width": { "description": "ResolutionWidth holds the value of the \"resolution_width\" field.", "type": "integer" }, "target_bandwidth": { "description": "TargetBandwidth holds the value of the \"target_bandwidth\" field.", "type": "integer" }, "updated_at": { "description": "UpdatedAt holds the value of the \"updated_at\" field.", "type": "string" }, "video_bitrate": { "description": "VideoBitrate holds the value of the \"video_bitrate\" field.", "type": "integer" } } }, "ent.MediaFileEdges": { "type": "object", "properties": { "media": { "description": "Media holds the value of the media edge.", "$ref": "#/definitions/ent.Media" } } }, "util.DataResponse": { "type": "object", "properties": { "code": { "type": "integer", "example": 200 }, "data": { "type": "object" }, "metadata": { "type": "object" } } }, "util.ErrorResponse": { "type": "object", "properties": { "code": { "type": "integer", "example": 400 }, "message": { "type": "string", "example": "status bad request" } } } } }