{ "swagger": "2.0", "info": { "description": "This is the Tagger API.", "title": "Tagger API", "termsOfService": "http://swagger.io/terms/", "contact": { "name": "API Support", "url": "http://www.swagger.io/support", "email": "matthewrich.conf@gmail.com" }, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, "version": "0.31" }, "host": "localhost:8080", "basePath": "/api/v1", "paths": { "/ping": { "get": { "description": "ping alive endpoint", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "ping" ], "summary": "ping endpoint", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/resources": { "get": { "description": "Get resource to tags", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tag resource" ], "summary": "Get resource tags", "parameters": [ { "type": "string", "description": "Resource URL", "name": "resource", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Resource" } } } } }, "/resources/{resource}": { "get": { "description": "Get resource to tags", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tag resource" ], "summary": "Get resource tags", "parameters": [ { "type": "string", "description": "Base64 encoded Resource URL", "name": "resource", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Resource" } } } } }, "/tags": { "post": { "description": "Add a tag for a resource", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tag resource" ], "summary": "Add a tag for a resource", "parameters": [ { "description": "Tag JSON object", "name": "tag", "in": "body", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/main.tag" } } } } }, "/tags/{name}": { "get": { "description": "Get resources associated with a Tag", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Tags" ], "summary": "Get list of resources tagged", "parameters": [ { "type": "string", "description": "Tag name", "name": "name", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "string" } } } } }, "put": { "description": "Updates the resources associated with a tag", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tag resource" ], "summary": "Update a tag", "parameters": [ { "type": "string", "description": "Tag name", "name": "name", "in": "path", "required": true }, { "description": "Tag JSON object", "name": "tag", "in": "body", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/main.tag" } } } } }, "/tags/{tag}": { "post": { "description": "Add a resource to a tag", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tag resource" ], "summary": "Add a resource to a tag", "parameters": [ { "type": "string", "description": "Tag name", "name": "tag", "in": "path", "required": true }, { "description": "Resource JSON object", "name": "resource", "in": "body", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/main.tag" } } } } } }, "definitions": { "main.tag": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "resources": { "type": "array", "items": { "type": "string" } } } }, "models.Resource": { "type": "object", "properties": { "id": { "type": "string" }, "resource": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } } } } }