From 67c3cb067240dfeb759e3fa2f374ae835c7f5616 Mon Sep 17 00:00:00 2001 From: Alexandre Catarino Date: Thu, 27 Jul 2023 18:25:54 +0100 Subject: [PATCH] Updates Create Live Algorithm --- .../01 Create Live Algorithm/02 Request.html | 61 +++++++----------- .../03 Responses.html | 49 ++++----------- QuantConnect-Platform-2.0.0.yaml | 62 ++++++++++++++----- 3 files changed, 80 insertions(+), 92 deletions(-) diff --git a/01 Cloud Platform/99 API Reference/07 Live Management/01 Create Live Algorithm/02 Request.html b/01 Cloud Platform/99 API Reference/07 Live Management/01 Create Live Algorithm/02 Request.html index 0c705f5ffe..bcba5b7d76 100644 --- a/01 Cloud Platform/99 API Reference/07 Live Management/01 Create Live Algorithm/02 Request.html +++ b/01 Cloud Platform/99 API Reference/07 Live Management/01 Create Live Algorithm/02 Request.html @@ -9,36 +9,36 @@ -projectId integer
Project Id. +versionId string
example: -1

The version of the Lean used to run the algorithm. -1 is master, however, sometimes this can create problems with live deployments. If you experience problems using, try specifying the version of Lean you would like to use. -compileId string
Compile Id. +projectId integer
Project Id. -serverType string
Type of server instance that will run the algorithm. +compileId string
Compile Id. -baseLiveAlgorithmSettings BaseLiveAlgorithmSettings object
Base class for settings that must be configured per Brokerage to create new algorithms via the API. +nodeId string
Id of the node that will run the algorithm. -versionId string
example: -1

The version of the Lean used to run the algorithm. -1 is master, however, sometimes this can create problems with live deployments. If you experience problems using, try specifying the version of Lean you would like to use. +brokerage BaseLiveAlgorithmSettings object
Base class for settings that must be configured per Brokerage to create new algorithms via the API. Example
 {
+  "versionId": "-1",
   "projectId": 0,
   "compileId": "string",
-  "serverType": "string",
-  "baseLiveAlgorithmSettings": {
-    "id": "string",
-    "user": "string",
-    "password": "string",
+  "nodeId": "string",
+  "brokerage": {
+    "id": "Default",
+    "user": "",
+    "password": "",
     "environment": "live",
-    "account": "string"
-  },
-  "versionId": "-1"
+    "account": ""
+  }
 }
@@ -50,49 +50,30 @@ -id string
'Interactive' / 'FXCM' / 'Oanda' / 'Tradier' /'PaperTrading'. +id string
example: Default

'Interactive' / 'FXCM' / 'Oanda' / 'Tradier' /'PaperTrading'. -user string
Username associated with brokerage. +user string
example:

Username associated with brokerage. -password string
Password associated with brokerage. +password string
example:

Password associated with brokerage. environment string Enum
Represents the types of environments supported by brokerages for trading. Options : ['live', 'paper'] -account string
Account of the associated brokerage. +account string
example:

Account of the associated brokerage. Example
 {
-  "id": "string",
-  "user": "string",
-  "password": "string",
+  "id": "Default",
+  "user": "",
+  "password": "",
   "environment": "live",
-  "account": "string"
-}
-
- - - - - - - - - - - - - - diff --git a/01 Cloud Platform/99 API Reference/07 Live Management/01 Create Live Algorithm/03 Responses.html b/01 Cloud Platform/99 API Reference/07 Live Management/01 Create Live Algorithm/03 Responses.html index 986f9c1059..edbd33c1f6 100644 --- a/01 Cloud Platform/99 API Reference/07 Live Management/01 Create Live Algorithm/03 Responses.html +++ b/01 Cloud Platform/99 API Reference/07 Live Management/01 Create Live Algorithm/03 Responses.html @@ -7,32 +7,26 @@

200 Success

BrokerageEnvironment Model - Represents the types of environments supported by brokerages for trading.
BrokerageEnvironment string Enum
Represents the types of environments supported by brokerages for trading. Options : ['live', 'paper']
Example -
-{
-  "BrokerageEnvironment": "live"
+  "account": ""
 }
- + - + - + - + - + - + - - - - - - - + @@ -45,14 +39,12 @@

200 Success

-
LiveAlgorithm Model - Live algorithm instance result from the QuantConnect Rest API.CreateLiveAlgorithmResponse Model - Response received when deploying a live algorithm.
projectId integer
Project Id for the live instance.
responseCode string
example: 200 OK

Response code.
deployId string
Unique live algorithm deployment identifier (similar to a backtest id).
versionId string
example: 15753

The version of the Lean used to run the algorithm.
status string Enum
States of a live deployment. Options : ['DeployError', 'InQueue', 'Running', 'Stopped', 'Liquidated', 'Deleted', 'Completed', 'RuntimeError', 'Invalid', 'LoggingIn', 'Initializing', 'History']
projectId integer
Project Id.
launched string($date-time)
Datetime the algorithm was launched in UTC.
deployId string
Deployment Id.
stopped string($date-time)
Datetime the algorithm was stopped in UTC, null if its still running.
source string
example: api-v2

Id of the node that will run the algorithm.
brokerage string Enum
Brokerage. Options : ['Interactive', 'FXCM', 'Oanda', 'Tradier', 'PaperTrading', 'Alpaca', 'Bitfinex', 'Binance', 'GDAX']
subscription string
Chart we're subscribed to.
error string
Live algorithm error message from a crash or algorithm runtime error.
queueHandler string
/.
success boolean
Indicate if the API request was successful.
 {
+  "responseCode": "200 OK",
+  "versionId": "15753",
   "projectId": 0,
   "deployId": "string",
-  "status": "DeployError",
-  "launched": "2021-11-26T15:18:27.693Z",
-  "stopped": "2021-11-26T15:18:27.693Z",
-  "brokerage": "Interactive",
-  "subscription": "string",
-  "error": "string",
+  "source": "api-v2",
+  "queueHandler": "string",
   "success": true,
   "errors": [
     "string"
@@ -61,25 +53,6 @@ 

200 Success

- - - - - - - - - - - -
AlgorithmStatus Model - States of a live deployment.
AlgorithmStatus string Enum
States of a live deployment. Options : ['DeployError', 'InQueue', 'Running', 'Stopped', 'Liquidated', 'Deleted', 'Completed', 'RuntimeError', 'Invalid', 'LoggingIn', 'Initializing', 'History']
Example -
-{
-  "AlgorithmStatus": "DeployError"
-}
-
-

401 Authentication Error

diff --git a/QuantConnect-Platform-2.0.0.yaml b/QuantConnect-Platform-2.0.0.yaml index 4156320b87..d3dfbac41a 100644 --- a/QuantConnect-Platform-2.0.0.yaml +++ b/QuantConnect-Platform-2.0.0.yaml @@ -609,7 +609,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/LiveAlgorithm' + $ref: '#/components/schemas/CreateLiveAlgorithmResponse' "401": description: Unauthorized response from the API. Key is missing, invalid, or timestamp is too old for hash. headers: @@ -1112,24 +1112,26 @@ components: id: type: string description: '''Interactive'' / ''FXCM'' / ''Oanda'' / ''Tradier'' /''PaperTrading''' + example: "Default" user: type: string description: Username associated with brokerage. + example: "" password: type: string description: Password associated with brokerage. + example: "" environment: - $ref: '#/components/schemas/BrokerageEnvironment' + type: string + description: Represents the types of environments supported by brokerages for trading. + enum: + - live + - paper account: type: string description: Account of the associated brokerage. + example: "" description: Base class for settings that must be configured per Brokerage to create new algorithms via the API. - BrokerageEnvironment: - type: string - description: Represents the types of environments supported by brokerages for trading. - enum: - - live - - paper Cash: type: object properties: @@ -1253,22 +1255,54 @@ components: CreateLiveAlgorithmRequest: type: object properties: + versionId: + type: string + description: The version of the Lean used to run the algorithm. -1 is master, however, sometimes this can create problems with live deployments. If you experience problems using, try specifying the version of Lean you would like to use. + example: "-1" projectId: type: integer description: Project Id. compileId: type: string description: Compile Id. - serverType: + nodeId: type: string - description: Type of server instance that will run the algorithm. - baseLiveAlgorithmSettings: + description: Id of the node that will run the algorithm. + brokerage: $ref: '#/components/schemas/BaseLiveAlgorithmSettings' + description: Request to create a live algorithm. + CreateLiveAlgorithmResponse: + type: object + properties: + responseCode: + type: string + description: Response code + example: "200 OK" versionId: type: string - description: The version of the Lean used to run the algorithm. -1 is master, however, sometimes this can create problems with live deployments. If you experience problems using, try specifying the version of Lean you would like to use. - example: "-1" - description: Request to create a live algorithm. + description: The version of the Lean used to run the algorithm. + example: "15753" + projectId: + type: integer + description: Project Id. + deployId: + type: string + description: Deployment Id. + source: + type: string + description: Id of the node that will run the algorithm. + example: "api-v2" + queueHandler: + type: string + success: + type: boolean + description: Indicate if the API request was successful. + errors: + type: array + description: List of errors with the API call. + items: + type: string + description: Response received when deploying a live algorithm. CreateProjectRequest: type: object properties: