{
    "definitions": {
        "app": {
            "$schema": "http://json-schema.org/draft-04/schema",
            "definitions": {
                "created_at": {
                    "description": "when app was created",
                    "example": "2012-01-01T12:00:00Z",
                    "format": "date-time",
                    "type": [
                        "string"
                    ]
                },
                "id": {
                    "description": "unique identifier of app",
                    "example": "01234567-89ab-cdef-0123-456789abcdef",
                    "format": "uuid",
                    "readOnly": true,
                    "type": [
                        "string"
                    ]
                },
                "identity": {
                    "anyOf": [
                        {
                            "$ref": "#/definitions/app/definitions/id"
                        },
                        {
                            "$ref": "#/definitions/app/definitions/name"
                        }
                    ]
                },
                "name": {
                    "description": "unique name of app",
                    "example": "example",
                    "readOnly": false,
                    "type": [
                        "string"
                    ]
                },
                "updated_at": {
                    "description": "when app was updated",
                    "example": "2012-01-01T12:00:00Z",
                    "format": "date-time",
                    "type": [
                        "string"
                    ]
                },
                "web_url": {
                    "description": "web URL of app",
                    "example": "https://example.irukaapp.com/",
                    "readOnly": true,
                    "type": [
                        "string"
                    ]
                }
            },
            "description": "An app represents the program that you would like to deploy and run on iruka",
            "links": [
                {
                    "description": "Create a new app.",
                    "href": "/apps",
                    "method": "POST",
                    "rel": "create",
                    "schema": {
                        "properties": {
                            "name": {
                                "$ref": "#/definitions/app/definitions/name"
                            }
                        },
                        "type": [
                            "object"
                        ]
                    },
                    "title": "Create"
                },
                {
                    "description": "Delete an existing app.",
                    "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}",
                    "method": "DELETE",
                    "rel": "destroy",
                    "title": "Delete"
                },
                {
                    "description": "Info for existing app.",
                    "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}",
                    "method": "GET",
                    "rel": "self",
                    "title": "Info"
                },
                {
                    "description": "List existing apps.",
                    "href": "/apps",
                    "method": "GET",
                    "rel": "instances",
                    "title": "List"
                },
                {
                    "description": "Update an existing app.",
                    "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}",
                    "method": "PATCH",
                    "rel": "update",
                    "schema": {
                        "properties": {
                            "name": {
                                "$ref": "#/definitions/app/definitions/name"
                            }
                        },
                        "type": [
                            "object"
                        ]
                    },
                    "title": "Update"
                }
            ],
            "properties": {
                "created_at": {
                    "$ref": "#/definitions/app/definitions/created_at"
                },
                "id": {
                    "$ref": "#/definitions/app/definitions/id"
                },
                "name": {
                    "$ref": "#/definitions/app/definitions/name"
                },
                "updated_at": {
                    "$ref": "#/definitions/app/definitions/updated_at"
                },
                "web_url": {
                    "$ref": "#/definitions/app/definitions/web_url"
                }
            },
            "stability": "prototype",
            "strictProperties": true,
            "title": "App",
            "type": [
                "object"
            ]
        },
        "config-vars": {
            "$schema": "http://json-schema.org/draft-04/schema",
            "definitions": {
                "baz": {
                    "description": "an example key-value",
                    "example": "qux",
                    "readOnly": false,
                    "type": [
                        "string"
                    ]
                },
                "foo": {
                    "description": "an example key-value",
                    "example": "bar",
                    "readOnly": false,
                    "type": [
                        "string"
                    ]
                }
            },
            "description": "Config Vars allow you to manage the configuration information provided to an app on iruka.",
            "links": [
                {
                    "description": "Get config-vars for app.",
                    "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/config-vars",
                    "method": "GET",
                    "rel": "self",
                    "title": "Info"
                },
                {
                    "description": "Update config-vars for app. You can update existing config-vars by setting them again, and remove by setting it to \"\".",
                    "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/config-vars",
                    "method": "PATCH",
                    "rel": "update",
                    "schema": {
                        "properties": {
                            "BAZ": {
                                "$ref": "#/definitions/config-vars/definitions/baz"
                            },
                            "FOO": {
                                "$ref": "#/definitions/config-vars/definitions/foo"
                            }
                        },
                        "type": [
                            "object"
                        ]
                    },
                    "title": "Update"
                }
            ],
            "properties": {
                "BAZ": {
                    "$ref": "#/definitions/config-vars/definitions/baz"
                },
                "FOO": {
                    "$ref": "#/definitions/config-vars/definitions/foo"
                }
            },
            "stability": "prototype",
            "strictProperties": true,
            "title": "Config Vars",
            "type": [
                "object"
            ]
        },
        "container": {
            "$schema": "http://json-schema.org/draft-04/schema",
            "definitions": {
                "app_id": {
                    "description": "unique identifier of app the container is belong to",
                    "example": "01234567-89ab-cdef-0123-456789abcdef",
                    "format": "uuid",
                    "readOnly": true,
                    "type": [
                        "string"
                    ]
                },
                "command": {
                    "description": "command used to start this process",
                    "example": "bundle exec rails server",
                    "readOnly": false,
                    "type": [
                        "string"
                    ]
                },
                "created_at": {
                    "description": "when container was created",
                    "example": "2012-01-01T12:00:00Z",
                    "format": "date-time",
                    "type": [
                        "string"
                    ]
                },
                "desired_state": {
                    "description": "desired state of process (either exited or up)",
                    "example": "up",
                    "readOnly": false,
                    "type": [
                        "string"
                    ]
                },
                "id": {
                    "description": "unique identifier of container",
                    "example": "01234567-89ab-cdef-0123-456789abcdef",
                    "format": "uuid",
                    "readOnly": true,
                    "type": [
                        "string"
                    ]
                },
                "identity": {
                    "anyOf": [
                        {
                            "$ref": "#/definitions/container/definitions/id"
                        },
                        {
                            "$ref": "#/definitions/container/definitions/name"
                        }
                    ]
                },
                "image": {
                    "description": "resource URI of the Docker image (including tag) of the container",
                    "example": "quay.io/spesnova/example:latest",
                    "readOnly": false,
                    "type": [
                        "string"
                    ]
                },
                "machine": {
                    "description": "where this container is running",
                    "example": "172.17.8.102",
                    "readOnly": true,
                    "type": [
                        "string"
                    ]
                },
                "name": {
                    "description": "unique name of container",
                    "example": "example.web.1",
                    "readOnly": true,
                    "type": [
                        "string"
                    ]
                },
                "port": {
                    "description": "expose port",
                    "example": 80,
                    "readOnly": false,
                    "type": [
                        "integer"
                    ]
                },
                "published_port": {
                    "description": "published port",
                    "example": 49153,
                    "readOnly": true,
                    "type": [
                        "integer"
                    ]
                },
                "size": {
                    "description": "container size (default “1X”)",
                    "example": "2X",
                    "readOnly": false,
                    "type": [
                        "string"
                    ]
                },
                "state": {
                    "description": "current state of process (either exited or up)",
                    "example": "up",
                    "readOnly": true,
                    "type": [
                        "string"
                    ]
                },
                "type": {
                    "description": "type of process (either \"web\", \"worker\", \"timer\", or \"run\")",
                    "example": "web",
                    "readOnly": false,
                    "type": [
                        "string"
                    ]
                },
                "updated_at": {
                    "description": "when container was updated",
                    "example": "2012-01-01T12:00:00Z",
                    "format": "date-time",
                    "type": [
                        "string"
                    ]
                }
            },
            "description": "Container encapsulate running processes of an app on iruka.",
            "links": [
                {
                    "description": "Create and run a new container.",
                    "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/containers",
                    "method": "POST",
                    "rel": "create",
                    "schema": {
                        "properties": {
                            "command": {
                                "$ref": "#/definitions/container/definitions/command"
                            },
                            "image": {
                                "$ref": "#/definitions/container/definitions/image"
                            },
                            "port": {
                                "$ref": "#/definitions/container/definitions/port"
                            },
                            "size": {
                                "$ref": "#/definitions/container/definitions/size"
                            },
                            "type": {
                                "$ref": "#/definitions/container/definitions/type"
                            }
                        },
                        "type": [
                            "object"
                        ]
                    },
                    "title": "Create"
                },
                {
                    "description": "Delete an existing container.",
                    "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/containers/{(%23%2Fdefinitions%2Fcontainer%2Fdefinitions%2Fidentity)}",
                    "method": "DELETE",
                    "rel": "destroy",
                    "title": "Delete"
                },
                {
                    "description": "Info for existing container.",
                    "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/containers/{(%23%2Fdefinitions%2Fcontainer%2Fdefinitions%2Fidentity)}",
                    "method": "GET",
                    "rel": "self",
                    "title": "Info"
                },
                {
                    "description": "List existing containers.",
                    "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/containers",
                    "method": "GET",
                    "rel": "instances",
                    "title": "List"
                },
                {
                    "description": "Update options and restart an existing container.",
                    "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/containers/{(%23%2Fdefinitions%2Fcontainer%2Fdefinitions%2Fidentity)}",
                    "method": "PATCH",
                    "rel": "update",
                    "schema": {
                        "properties": {
                            "command": {
                                "$ref": "#/definitions/container/definitions/command"
                            },
                            "image": {
                                "$ref": "#/definitions/container/definitions/image"
                            },
                            "port": {
                                "$ref": "#/definitions/container/definitions/port"
                            },
                            "size": {
                                "$ref": "#/definitions/container/definitions/size"
                            },
                            "type": {
                                "$ref": "#/definitions/container/definitions/type"
                            }
                        },
                        "type": [
                            "object"
                        ]
                    },
                    "title": "Update"
                }
            ],
            "properties": {
                "app_id": {
                    "$ref": "#/definitions/container/definitions/app_id"
                },
                "command": {
                    "$ref": "#/definitions/container/definitions/command"
                },
                "created_at": {
                    "$ref": "#/definitions/container/definitions/created_at"
                },
                "desired_state": {
                    "$ref": "#/definitions/container/definitions/desired_state"
                },
                "id": {
                    "$ref": "#/definitions/container/definitions/id"
                },
                "image": {
                    "$ref": "#/definitions/container/definitions/image"
                },
                "machine": {
                    "$ref": "#/definitions/container/definitions/machine"
                },
                "name": {
                    "$ref": "#/definitions/container/definitions/name"
                },
                "port": {
                    "$ref": "#/definitions/container/definitions/port"
                },
                "published_port": {
                    "$ref": "#/definitions/container/definitions/published_port"
                },
                "size": {
                    "$ref": "#/definitions/container/definitions/size"
                },
                "state": {
                    "$ref": "#/definitions/container/definitions/state"
                },
                "type": {
                    "$ref": "#/definitions/container/definitions/type"
                },
                "updated_at": {
                    "$ref": "#/definitions/container/definitions/updated_at"
                }
            },
            "stability": "prototype",
            "strictProperties": true,
            "title": "Container",
            "type": [
                "object"
            ]
        },
        "error": {
            "$schema": "http://json-schema.org/draft-04/schema",
            "definitions": {
                "id": {
                    "description": "id of error railsed",
                    "example": "bad_request",
                    "readOnly": true,
                    "type": [
                        "string"
                    ]
                },
                "identity": {
                    "anyOf": [
                        {
                            "$ref": "#/definitions/error/definitions/id"
                        }
                    ]
                },
                "message": {
                    "description": "end user message of error raised",
                    "example": "request invalid, validate usage and try again",
                    "readOnly": true,
                    "type": [
                        "string"
                    ]
                },
                "url": {
                    "description": "reference url with more information about the error",
                    "example": "https://github.com/spesnova/iruka/blob/master/docs/errors.md",
                    "type": [
                        "string"
                    ]
                }
            },
            "description": "Failing responses will have an appropriate status and a JSON body containing more details about a particular error.",
            "properties": {
                "id": {
                    "$ref": "#/definitions/error/definitions/id"
                },
                "message": {
                    "$ref": "#/definitions/error/definitions/message"
                },
                "url": {
                    "$ref": "#/definitions/error/definitions/url"
                }
            },
            "stability": "prototype",
            "strictProperties": true,
            "title": "Errors",
            "type": [
                "object"
            ]
        }
    },
    "description": "Iruka API v1 Alpha Document",
    "links": [
        {
            "href": "https://<your-iruka-server>.com/api/v1-alpha",
            "rel": "self"
        }
    ],
    "properties": {
        "app": {
            "$ref": "#/definitions/app"
        },
        "config-vars": {
            "$ref": "#/definitions/config-vars"
        },
        "container": {
            "$ref": "#/definitions/container"
        },
        "error": {
            "$ref": "#/definitions/error"
        }
    },
    "title": "Iruka API v1 Alpha",
    "type": [
        "object"
    ]
}