Salesforce

Controller APIs

« Go Back
Information
Controller APIs
000004021
Public
Product Selection
aiWare - aiWare
Article Details

HTTP methods for RESTful services are discussed below.

  • GET retrieves information or resources.
  • POST can either create, update resources, or take action.
  • PUT is the same as POST for this.
  • DELETE will take action and typically be STOP or DELETE.

Engine authentication

The controller creates an agent by creating a security token upon registration of engine instances. The agent or engine instance will include its token in the "Authorization" request header using the Bearer scheme. The controller then creates an engine instance.

HTTP response codes

Errors will be returned as part of the HTTP response message. The response body will be in JSON format with the following fields:

  • ErrorId, String: The error ID
  • ErrorDescription, String: Information describing the type of error
  • ErrorDetail: Any relevant information as part of the error such as IDs.
HTTP CodeDescription
201 CreatedNode registered correctly. Sent in Body.
400 Bad RequestRequest not in appropriate format or missing information.
401 Not AuthorizedThe APIs are not authenticated.
408 Client TimeoutThe client timed out in sending information. The client can repeat the request.
409 ConflictEngine instance is already registered.
415 Unsupported Media TypeThe request sent a non supported payload type such as XML instead of JSON.
429 Too Many RequestsThe server has too many requests currently. The server will use the Header Retry-After with seconds to try again. This will follow https://tools.ietf.org/html/rfc6585
500 Internal ErrorThere should be no 500 errors.

Engine instance APIs

Engines can be managed through the API. For more details, see the engine and engine_instance endpoints on this page.

Host APIs

HTTP MethodAPIDescription
POST/host/registerThe agent will use this to register a new host with the controller. The agent will send information about the host, the docker containers running and related statistics.
POST/host/{HostId}/updatestatusThe agent will use this to update the controller with current information on the host including how much CPU, RAM, and GPU are available. The controller will respond with here are the containers to launch and containers to terminate. The controller may also tell the agent to terminate the host.
POST/host{HostId}/terminateDirects the controller to mark the host for deletion. This will be communicated to the host on the next update status request.
GET/host/{HostId}/detailProvides information about the host.
GET/host/{HostId}/statusProvides information on the last status update for the host.
POST/host/{HostId}/drainUpdates the host into draining status. No engines running on that host will be given new work.
Additional Technical Documentation Information
Properties
11/21/2023 8:42 PM
12/4/2023 6:33 PM
12/4/2023 6:33 PM
Documentation
Documentation
000004021
Translation Information
English

Powered by