{"basePath":"","definitions":{"Error":{"properties":{"detail":{"type":"string"},"instance":{"type":"string"},"status":{"type":"integer"},"title":{"type":"string"},"type":{"type":"string"}},"type":"object"},"StateChange":{"description":"A change to one or more trees status, suitable for reverting the change.\nSome of the information here is redundant to TreeLog, but is present to\nhelp users determine which change to revert.  The previous state of the\ntree is not exposed in this data type.\n","properties":{"id":{"description":"id of this change","type":"integer"},"reason":{"description":"the reason for the status change","type":"string"},"status":{"description":"the updated (new) status","type":"string"},"trees":{"description":"the names of the affected trees","items":{"properties":{"id":{"type":"integer"},"last_state":{"properties":{"reason":{"type":"string"},"status":{"type":"string"},"tags":{"items":{"type":"string"},"type":"array"}},"required":["status","reason","tags"],"type":"object"},"tree":{"type":"string"}},"required":["id","tree","last_state"],"type":"object"},"type":"array"},"when":{"description":"the time the change occurred","type":"string"},"who":{"description":"the user who made the change","type":"string"}},"required":["id","trees","when","who","status","reason"],"type":"object"},"Tree":{"description":"A representation of a single tree.","properties":{"category":{"description":"Category of the tree.","type":"string"},"message_of_the_day":{"description":"even more information about the status","type":"string"},"reason":{"description":"the reason for the status","type":"string"},"status":{"description":"the current status","type":"string"},"tree":{"description":"the name of the tree","type":"string"}},"required":["tree","status","reason","message_of_the_day","category"],"type":"object"},"TreeLog":{"description":"A recorded change to a trees status or reason, along with a set of tags\nassigned at the time.  This is useful for analysis of tree closures and\ntheir causes.\n","properties":{"id":{"description":"the id of the tree log","type":"integer"},"reason":{"description":"the reason for the status","type":"string"},"status":{"description":"the new status","type":"string"},"tags":{"description":"tags for the change","items":{"type":"string"},"type":"array"},"tree":{"description":"the name of the tree","type":"string"},"when":{"description":"the time the change occurred","type":"string"},"who":{"description":"the user making the change","type":"string"}},"required":["id","tree","when","who","status","reason","tags"],"type":"object"},"TreeUpdate":{"description":"A requested update to one or more trees.  See the corresponding method\nfor information on which fields must be supplied and when.\n","properties":{"message_of_the_day":{"description":"the message of the day for the tree","type":"string"},"reason":{"description":"the reason for the status","type":"string"},"remember":{"description":"if true, add the change to the status and reason to the undo stack.\nNote that updates to the message of the day are not recorded.\n","type":"boolean"},"status":{"description":"the new tree status (for all affected trees)","type":"string"},"tags":{"description":"tags associated with the status update; this is required (including\nat least one tag) if status = 'closed',\n","items":{"type":"string"},"type":"array"},"trees":{"description":"the trees to update","items":{"type":"string"},"type":"array"}},"required":["trees"],"type":"object"},"TreeWithTags":{"description":"A representation of a single tree.","properties":{"message_of_the_day":{"description":"even more information about the status","type":"string"},"reason":{"description":"the reason for the status","type":"string"},"status":{"description":"the current status","type":"string"},"tags":{"description":"tags of the last change","items":{"type":"string"},"type":"array"},"tree":{"description":"the name of the tree","type":"string"}},"required":["tree","status","reason","message_of_the_day","tags"],"type":"object"}},"info":{"description":"An API to get and land Phabricator revisions.","title":"Lando API","version":"3.0.0"},"paths":{"/":{"get":{"responses":{"302":{"description":"Redirect to swagger.json","headers":{"Location":{"description":"Where to redirect to","type":"string"}}}},"summary":"Redirect to the API specification"}},"/log/{id}":{"patch":{"description":"Change log of the tree.\n","operationId":"landoapi.api.treestatus.update_log","parameters":[{"in":"path","name":"id","required":true,"type":"integer"},{"description":"Log update","in":"body","name":"body","required":true,"schema":{"properties":{"reason":{"type":"string"},"tags":{"items":{"type":"string"},"type":"array"}},"type":"object"}}],"responses":{"200":{"description":"Status","schema":{"type":"string"}}}}},"/stack":{"get":{"description":"Get the `undo stack` of changes to trees, most recent first.\n","operationId":"landoapi.api.treestatus.get_stack","responses":{"200":{"description":"List of state changes.","schema":{"properties":{"result":{"items":{"$ref":"#/definitions/StateChange"},"type":"array"}},"required":["result"],"type":"object"}}}}},"/stack/{id}":{"delete":{"description":"Remove the given change from the undo stack.\n\nWith ``?revert=1`` This applies the settings that were\npresent before the change to the affected trees.\n\nWith ``?revert=0`` or omitting the revert keyword, it merely removes\nthe change from the stack without changing the settings on the tree.\n","operationId":"landoapi.api.treestatus.delete_stack","parameters":[{"in":"path","name":"id","required":true,"type":"integer"},{"default":0,"in":"query","name":"revert","required":true,"type":"integer"}],"responses":{"200":{"description":"Status","schema":{"type":"string"}}}},"patch":{"description":"Change (stack) changes to trees.\n","operationId":"landoapi.api.treestatus.update_stack","parameters":[{"in":"path","name":"id","required":true,"type":"integer"},{"description":"Stack update","in":"body","name":"body","required":true,"schema":{"properties":{"reason":{"type":"string"},"tags":{"items":{"type":"string"},"type":"array"}},"type":"object"}}],"responses":{"200":{"description":"Status","schema":{"type":"string"}}}}},"/trees":{"get":{"description":"Get the status of all trees.","operationId":"landoapi.api.treestatus.get_trees","responses":{"200":{"description":"Trees","schema":{"properties":{"result":{"additionalProperties":{"$ref":"#/definitions/TreeWithTags"},"type":"object"}},"required":["result"],"type":"object"}}}},"patch":{"description":"Update trees status.\n\nIf the update indicates that the previous state should be saved, then\na new change will be added to the stack containing the previous status\nand reason.  In this case, both reason and status must be supplied.\n\nThe `tags` property must not be empty if `status` is `closed`.\n","operationId":"landoapi.api.treestatus.update_trees","parameters":[{"description":"Tree update","in":"body","name":"body","required":true,"schema":{"$ref":"#/definitions/TreeUpdate"}}],"responses":{"200":{"description":"Tree","schema":{"items":{"$ref":"#/definitions/Tree"},"type":"array"}}}}},"/trees/{tree}":{"delete":{"description":"Delete a tree.","operationId":"landoapi.api.treestatus.delete_tree","parameters":[{"description":"Tree","in":"path","name":"tree","required":true,"type":"string"}],"responses":{"200":{"description":"Tree","schema":{"type":"string"}}}},"get":{"description":"Get the status of a single tree.\n\nThis endpoint is cached heavily and is safe to call frequently to verify\nthe status of a tree.\n","operationId":"landoapi.api.treestatus.get_tree","parameters":[{"description":"Tree name","in":"path","name":"tree","required":true,"type":"string"}],"responses":{"200":{"description":"Tree","schema":{"properties":{"result":{"$ref":"#/definitions/TreeWithTags"}},"required":["result"],"type":"object"}}}},"put":{"description":"Make a new tree.","operationId":"landoapi.api.treestatus.make_tree","parameters":[{"description":"Tree","in":"path","name":"tree","required":true,"type":"string"},{"description":"Tree","in":"body","name":"body","required":true,"schema":{"$ref":"#/definitions/Tree"}}],"responses":{"201":{"description":"Tree","schema":{"type":"string"}}}}},"/trees/{tree}/logs":{"get":{"consumes":["application/json"],"description":"Get a short log of changes for the given tree.\n","operationId":"landoapi.api.treestatus.get_logs","parameters":[{"description":"Tree","in":"path","name":"tree","required":true,"type":"string"}],"responses":{"200":{"description":"Tree","schema":{"properties":{"result":{"items":{"$ref":"#/definitions/TreeLog"},"type":"array"}},"required":["result"],"type":"object"}}}}},"/trees/{tree}/logs_all":{"get":{"consumes":["application/json"],"description":"Get all log of changes for the given tree.\n","operationId":"landoapi.api.treestatus.get_logs_all","parameters":[{"description":"Tree","in":"path","name":"tree","required":true,"type":"string"}],"responses":{"200":{"description":"Tree","schema":{"properties":{"result":{"items":{"$ref":"#/definitions/TreeLog"},"type":"array"}},"required":["result"],"type":"object"}}}}},"/trees2":{"get":{"description":"Get the status of all trees.","operationId":"landoapi.api.treestatus.get_trees2","responses":{"200":{"description":"Trees","schema":{"properties":{"result":{"items":{"$ref":"#/definitions/TreeWithTags"},"type":"array"}},"required":["result"],"type":"object"}}}}}},"produces":["application/json"],"swagger":"2.0"}
