Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Laica-Lunasys committed May 2, 2021
1 parent fef9dcd commit de214a3
Show file tree
Hide file tree
Showing 5 changed files with 248 additions and 54 deletions.
77 changes: 72 additions & 5 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ var doc = `{
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/api/v1/agent": {
"/api/v1/agents": {
"get": {
"produces": [
"application/json"
],
"tags": [
"agent"
],
"summary": "Get Agent entry",
"summary": "Get all agents",
"responses": {
"200": {
"description": "OK",
Expand Down Expand Up @@ -78,20 +78,59 @@ var doc = `{
}
}
},
"/api/v1/agent/sensors": {
"/api/v1/agents/:id": {
"get": {
"produces": [
"application/json"
],
"tags": [
"agent"
],
"summary": "Get Sensors status form agent",
"summary": "Get agent by ID",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/agent.Ambient"
"$ref": "#/definitions/agent.Agent"
}
}
}
},
"delete": {
"tags": [
"agent"
],
"summary": "Delete agent by ID",
"responses": {
"200": {
"description": ""
}
}
},
"patch": {
"produces": [
"application/json"
],
"tags": [
"agent"
],
"summary": "Update agent by ID",
"parameters": [
{
"description": "Update agent",
"name": "entry",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/server.UpdateAgentRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/agent.Agent"
}
}
}
Expand Down Expand Up @@ -369,11 +408,20 @@ var doc = `{
"type": "string",
"example": "localhost:8081"
},
"default": {
"description": "Default - Agent to use by mainly",
"type": "boolean"
},
"id": {
"description": "ID - Agent ID",
"type": "string",
"default": "\u003cUNIQUE_ID\u003e"
},
"label": {
"description": "Label - Name of Agent (ex. ` + "`" + `Bedroom` + "`" + `)",
"type": "string",
"example": "Bedroom"
},
"online": {
"description": "Online - Check online",
"type": "boolean"
Expand Down Expand Up @@ -505,6 +553,11 @@ var doc = `{
"type"
],
"properties": {
"agent_id": {
"description": "AgentID - Use for another agent",
"type": "string",
"example": "\u003cAGENT_ID\u003e"
},
"aircon": {
"description": "Aircon - State of Aircon",
"$ref": "#/definitions/aircon.State"
Expand Down Expand Up @@ -665,6 +718,11 @@ var doc = `{
"type"
],
"properties": {
"agent_id": {
"description": "AgentID - Agent ID (optional)",
"type": "string",
"example": "\u003cAGENT_ID\u003e"
},
"kind": {
"description": "Kind - AIRCON, LIGHT, SWITCHBOT...",
"type": "string",
Expand Down Expand Up @@ -717,6 +775,15 @@ var doc = `{
"description": "Address of Pigent",
"type": "string",
"example": "localhost:8081"
},
"default": {
"description": "Default - Agent to use by mainly",
"type": "boolean"
},
"label": {
"description": "Label - Agent label (optional)",
"type": "string",
"example": "Bedroom"
}
}
},
Expand Down
90 changes: 51 additions & 39 deletions docs/index.html

Large diffs are not rendered by default.

77 changes: 72 additions & 5 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
"version": "1.0"
},
"paths": {
"/api/v1/agent": {
"/api/v1/agents": {
"get": {
"produces": [
"application/json"
],
"tags": [
"agent"
],
"summary": "Get Agent entry",
"summary": "Get all agents",
"responses": {
"200": {
"description": "OK",
Expand Down Expand Up @@ -60,20 +60,59 @@
}
}
},
"/api/v1/agent/sensors": {
"/api/v1/agents/:id": {
"get": {
"produces": [
"application/json"
],
"tags": [
"agent"
],
"summary": "Get Sensors status form agent",
"summary": "Get agent by ID",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/agent.Ambient"
"$ref": "#/definitions/agent.Agent"
}
}
}
},
"delete": {
"tags": [
"agent"
],
"summary": "Delete agent by ID",
"responses": {
"200": {
"description": ""
}
}
},
"patch": {
"produces": [
"application/json"
],
"tags": [
"agent"
],
"summary": "Update agent by ID",
"parameters": [
{
"description": "Update agent",
"name": "entry",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/server.UpdateAgentRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/agent.Agent"
}
}
}
Expand Down Expand Up @@ -351,11 +390,20 @@
"type": "string",
"example": "localhost:8081"
},
"default": {
"description": "Default - Agent to use by mainly",
"type": "boolean"
},
"id": {
"description": "ID - Agent ID",
"type": "string",
"default": "\u003cUNIQUE_ID\u003e"
},
"label": {
"description": "Label - Name of Agent (ex. `Bedroom`)",
"type": "string",
"example": "Bedroom"
},
"online": {
"description": "Online - Check online",
"type": "boolean"
Expand Down Expand Up @@ -487,6 +535,11 @@
"type"
],
"properties": {
"agent_id": {
"description": "AgentID - Use for another agent",
"type": "string",
"example": "\u003cAGENT_ID\u003e"
},
"aircon": {
"description": "Aircon - State of Aircon",
"$ref": "#/definitions/aircon.State"
Expand Down Expand Up @@ -647,6 +700,11 @@
"type"
],
"properties": {
"agent_id": {
"description": "AgentID - Agent ID (optional)",
"type": "string",
"example": "\u003cAGENT_ID\u003e"
},
"kind": {
"description": "Kind - AIRCON, LIGHT, SWITCHBOT...",
"type": "string",
Expand Down Expand Up @@ -699,6 +757,15 @@
"description": "Address of Pigent",
"type": "string",
"example": "localhost:8081"
},
"default": {
"description": "Default - Agent to use by mainly",
"type": "boolean"
},
"label": {
"description": "Label - Agent label (optional)",
"type": "string",
"example": "Bedroom"
}
}
},
Expand Down
Loading

0 comments on commit de214a3

Please sign in to comment.