From ab5f4af9b63293fba1d25a95fe5c078496b0230a Mon Sep 17 00:00:00 2001 From: Qiang0428 <48435090+Qiang0428@users.noreply.github.com> Date: Fri, 19 Feb 2021 10:12:10 +0800 Subject: [PATCH 1/6] Create VendorListResURI.swagger.json BZ#3478 --- VendorListResURI.swagger.json | 146 ++++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 VendorListResURI.swagger.json diff --git a/VendorListResURI.swagger.json b/VendorListResURI.swagger.json new file mode 100644 index 0000000..b03035a --- /dev/null +++ b/VendorListResURI.swagger.json @@ -0,0 +1,146 @@ +{ + "swagger": "2.0", + "info": { + "title": "Vendor List", + "version": "2021-02-18", + "license": { + "name": "OCF Data Model License", + "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright": "copyright 2016-2017, 2019 Open Connectivity Foundation, Inc. All rights reserved." + }, + "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" + }, + "schemes": ["http"], + "consumes": ["application/json"], + "produces": ["application/json"], + "paths": { + "/VendorListResURI": { + "get": { + "description": "This Resource describes the current vendor and supported vendors in an Air Conditioner Assistant.\nThe current vendor can be read or set, setting indicates a desired vendor.\nA device may reject an attempt to set a vendor that is not found in supported vendors.\nThe Property \"supportedVendors\" is an array of the possible vendor names.\n the value of "\supportedVendors\" is vendor specific."\nThe Property \"currentVendor\" is the vendor indicated by user.", + "parameters": [ + {"$ref": "#/parameters/interface"} + ], + "responses": { + "200": { + "description" : "RETRIEVES the current vendor and supported vendors.", + "x-example": { + "rt": ["oic.r.vendorlist"], + "if": ["oic.if.a", "oic.if.baseline"], + "supportedVendors": ["haier", "gree", "tcl", "lg"], + "currentVendor": "lg" + }, + "schema": { "$ref": "#/definitions/VendorList" } + } + } + }, + "post": { + "description": "Sets the desired vendor.", + "parameters": [ + {"$ref": "#/parameters/interface"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": { "$ref": "#/definitions/VendorListUpdate" }, + "x-example": { + "currentVendor": "lg" + } + } + ], + "responses": { + "200": { + "description" : "", + "x-example": { + "currentVendor": "lg" + }, + "schema": { "$ref": "#/definitions/VendorListUpdate" } + }, + "403": { + "description" : "This response is generated by the OCF Server when the client sends:\n An UPDATE with an value for \"currentVendor\" that is not found in\"supportedvendors\"", + "x-example": { + "supportedVendors": ["haier", "gree", "tcl", "lg"], + "currentVendor": "lg" + }, + "schema": { "$ref": "#/definitions/VendorListUpdate" } + } + } + } + } + }, + "parameters": { + "interface": { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.a", "oic.if.baseline"] + } + }, + "definitions": { + "VendorList" : { + "properties": { + "rt": { + "description": "The Resource Type.", + "items": { + "enum": ["oic.r.vendorlist"], + "maxLength": 64, + "type": "string" + }, + "minItems": 1, + "uniqueItems": true, + "readOnly": true, + "type": "array" + }, + "currentVendor": { + "description": "The current Vendor indicated.", + "type": "string" + }, + "supportedVendors": { + "description": "The array of the possible vendors.", + "items": { + "type": "string" + }, + "readOnly": true, + "type": "array" + }, + "runningTime": { + "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.types-schema.json#/definitions/duration" + }, + "remainingTime": { + "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.types-schema.json#/definitions/duration" + }, + + "n": { + "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/n" + }, + "id": { + "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/id" + }, + "if": { + "description": "The OCF Interface set supported by this Resource.", + "items": { + "enum": [ + "oic.if.a", + "oic.if.baseline" + ], + "type": "string" + }, + "minItems": 2, + "uniqueItems": true, + "readOnly": true, + "type": "array" + } + }, + "type": "object", + "required": ["currentVendor", "supportedVendors"] + }, + "VendorListUpdate" : { + "properties": { + "currentVendor": { + "description": "The current vendor indicated .", + "type": "string" + } + }, + "type": "object" + } + } +} From 8817b1a40046054375e3f05a6ee14b27e20c7e98 Mon Sep 17 00:00:00 2001 From: Qiang0428 <48435090+Qiang0428@users.noreply.github.com> Date: Fri, 19 Feb 2021 10:18:52 +0800 Subject: [PATCH 2/6] Update VendorListResURI.swagger.json --- VendorListResURI.swagger.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VendorListResURI.swagger.json b/VendorListResURI.swagger.json index b03035a..5e59311 100644 --- a/VendorListResURI.swagger.json +++ b/VendorListResURI.swagger.json @@ -16,7 +16,7 @@ "paths": { "/VendorListResURI": { "get": { - "description": "This Resource describes the current vendor and supported vendors in an Air Conditioner Assistant.\nThe current vendor can be read or set, setting indicates a desired vendor.\nA device may reject an attempt to set a vendor that is not found in supported vendors.\nThe Property \"supportedVendors\" is an array of the possible vendor names.\n the value of "\supportedVendors\" is vendor specific."\nThe Property \"currentVendor\" is the vendor indicated by user.", + "description": "This Resource describes the current vendor and supported vendors in an Air Conditioner Assistant.\nThe current vendor can be read or set, setting indicates a desired vendor.\nA device may reject an attempt to set a vendor that is not found in supported vendors.\nThe Property \"supportedVendors\" is an array of the possible vendors.\n the value of \"supportedVendors\" is vendor specific.\n The Property \"currentVendor\" is the vendor indicated by user.", "parameters": [ {"$ref": "#/parameters/interface"} ], From 7fc2c83cfb8927ec745ac7e10bbadd0b9a5603fb Mon Sep 17 00:00:00 2001 From: Qiang0428 <48435090+Qiang0428@users.noreply.github.com> Date: Mon, 15 Mar 2021 11:32:42 +0800 Subject: [PATCH 3/6] Update VendorListResURI.swagger.json --- VendorListResURI.swagger.json | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/VendorListResURI.swagger.json b/VendorListResURI.swagger.json index 5e59311..540a2b7 100644 --- a/VendorListResURI.swagger.json +++ b/VendorListResURI.swagger.json @@ -101,14 +101,7 @@ }, "readOnly": true, "type": "array" - }, - "runningTime": { - "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.types-schema.json#/definitions/duration" - }, - "remainingTime": { - "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.types-schema.json#/definitions/duration" - }, - + }, "n": { "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/n" }, From c9da404e243a9cb7589e3b4b576f5daa280a7e6f Mon Sep 17 00:00:00 2001 From: Qiang0428 <48435090+Qiang0428@users.noreply.github.com> Date: Mon, 15 Mar 2021 11:33:51 +0800 Subject: [PATCH 4/6] Create VendorListResURI.swagger.json From 2fd1923ee3504b76e1f90b39b8f6679f0a3e5172 Mon Sep 17 00:00:00 2001 From: Qiang0428 <48435090+Qiang0428@users.noreply.github.com> Date: Mon, 15 Mar 2021 15:35:42 +0800 Subject: [PATCH 5/6] Update VendorListResURI.swagger.json --- VendorListResURI.swagger.json | 51 ++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/VendorListResURI.swagger.json b/VendorListResURI.swagger.json index 540a2b7..e603b79 100644 --- a/VendorListResURI.swagger.json +++ b/VendorListResURI.swagger.json @@ -2,7 +2,7 @@ "swagger": "2.0", "info": { "title": "Vendor List", - "version": "2021-02-18", + "version": "2021-03-15", "license": { "name": "OCF Data Model License", "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", @@ -16,25 +16,26 @@ "paths": { "/VendorListResURI": { "get": { - "description": "This Resource describes the current vendor and supported vendors in an Air Conditioner Assistant.\nThe current vendor can be read or set, setting indicates a desired vendor.\nA device may reject an attempt to set a vendor that is not found in supported vendors.\nThe Property \"supportedVendors\" is an array of the possible vendors.\n the value of \"supportedVendors\" is vendor specific.\n The Property \"currentVendor\" is the vendor indicated by user.", + "description": "This Resource describes the current vendor and supported vendors in an Air Conditioner Assistant.\nThe current vendor can be read or set, setting indicates a desired vendor.\nA device may reject an attempt to set a vendor that is not found in supported vendors.\nThe Property \"supportedVendors\" is an array of the possible vendor names.\nThe value of \"supportedVendors\" is vendor specific.\nThe Property \"currentVendor\" is one vendor selected from \"supportedVendors\".\nThe Property \"status\" is current operation status related to the \"currentVendor\" or set operation,\n matching : the matching is being processed by attempting to generate and issue Infrared Signals to the Legacy AC ,\n stopped : the matching is stopped", "parameters": [ {"$ref": "#/parameters/interface"} ], "responses": { "200": { - "description" : "RETRIEVES the current vendor and supported vendors.", + "description" : "RETRIEVES the state of vendorList Resource.", "x-example": { "rt": ["oic.r.vendorlist"], - "if": ["oic.if.a", "oic.if.baseline"], - "supportedVendors": ["haier", "gree", "tcl", "lg"], - "currentVendor": "lg" + "if": ["oic.if.rw", "oic.if.baseline"], + "supportedVendors": ["none","haier", "gree", "tcl", "lg"], + "currentVendor": "lg", + "status": "matching" }, "schema": { "$ref": "#/definitions/VendorList" } } } }, "post": { - "description": "Sets the desired vendor.", + "description": "launch and stop Matching the legacy AC to the desired vendor.", "parameters": [ {"$ref": "#/parameters/interface"}, { @@ -43,7 +44,8 @@ "required": true, "schema": { "$ref": "#/definitions/VendorListUpdate" }, "x-example": { - "currentVendor": "lg" + "currentVendor": "lg", + "status": "matching" } } ], @@ -51,15 +53,17 @@ "200": { "description" : "", "x-example": { - "currentVendor": "lg" + "currentVendor": "lg", + "status":"matching" }, "schema": { "$ref": "#/definitions/VendorListUpdate" } }, "403": { - "description" : "This response is generated by the OCF Server when the client sends:\n An UPDATE with an value for \"currentVendor\" that is not found in\"supportedvendors\"", + "description" : "This response is generated by the OCF Server when the client sends:\n An UPDATE with an value for \"currentVendor\" that is not found in\"supportedvendors\" .\n An UPDATW with an invalid value for \"status\" property.\n The server may respond with the current resource representation.", "x-example": { "supportedVendors": ["haier", "gree", "tcl", "lg"], - "currentVendor": "lg" + "currentVendor": "lg", + "status":"matching" }, "schema": { "$ref": "#/definitions/VendorListUpdate" } } @@ -72,7 +76,7 @@ "in": "query", "name": "if", "type": "string", - "enum": ["oic.if.a", "oic.if.baseline"] + "enum": ["oic.if.rw", "oic.if.baseline"] } }, "definitions": { @@ -91,7 +95,7 @@ "type": "array" }, "currentVendor": { - "description": "The current Vendor indicated.", + "description": "The current Vendor selected from \"supportedVendors\".", "type": "string" }, "supportedVendors": { @@ -101,7 +105,12 @@ }, "readOnly": true, "type": "array" - }, + }, + "status": { + "description": "Current operation status based on the selected current Vendor.\n matching : the Device is generating and issuing Matching Infrared Signals based on current vendor's Infrared solution ,\n stopped : the Matching is stopped.", + "enum": ["matching","stopped"], + "type": "string" + }, "n": { "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/n" }, @@ -112,7 +121,7 @@ "description": "The OCF Interface set supported by this Resource.", "items": { "enum": [ - "oic.if.a", + "oic.if.rw", "oic.if.baseline" ], "type": "string" @@ -124,16 +133,22 @@ } }, "type": "object", - "required": ["currentVendor", "supportedVendors"] + "required": ["currentVendor","supportedVendors","status"] }, "VendorListUpdate" : { "properties": { "currentVendor": { - "description": "The current vendor indicated .", + "description": "The current vendor selected from \"supportedVendors\".", "type": "string" + }, + "status": { + "description": "Current operation status", + "enum": ["matching","stopped"], + "type": "string" } }, - "type": "object" + "type": "object", + "required": ["currentVendor","status"] } } } From 94d1d2eed11d23f8c6cf6960d4abff63805867b5 Mon Sep 17 00:00:00 2001 From: Qiang0428 <48435090+Qiang0428@users.noreply.github.com> Date: Mon, 15 Mar 2021 15:35:51 +0800 Subject: [PATCH 6/6] Create VendorListResURI.swagger.json