diff --git a/api/design_api.partials.yml b/api/design_api.partials.yml index a40a45e23..8f5cde96f 100644 --- a/api/design_api.partials.yml +++ b/api/design_api.partials.yml @@ -167,6 +167,13 @@ schema: type: string style: simple + - in: header + name: X-API-KEY + schema: + type: string + style: simple + explode: false + required: true responses: '200': description: Deleted @@ -390,11 +397,6 @@ style: simple explode: false required: true - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DesignSchema' responses: "200": description: Null response diff --git a/cmd/controller/app/database/db_interfaces.go b/cmd/controller/app/database/db_interfaces.go index 501551dab..e23fb22cf 100644 --- a/cmd/controller/app/database/db_interfaces.go +++ b/cmd/controller/app/database/db_interfaces.go @@ -35,62 +35,132 @@ type DBService interface { // DatasetService is an interface that defines a collection of APIs related to dataset type DatasetService interface { - CreateDataset(string, openapi.DatasetInfo) (string, error) - GetDatasets(string, int32) ([]openapi.DatasetInfo, error) + // CreateDataset creates a new dataset in the db + CreateDataset(userId string, info openapi.DatasetInfo) (string, error) + + // GetDatasets returns a list of datasets associated with a user + GetDatasets(userId string, limit int32) ([]openapi.DatasetInfo, error) + + // GetDatasetById returns the details of a particular dataset GetDatasetById(string) (openapi.DatasetInfo, error) } // DesignService is an interface that defines a collection of APIs related to design type DesignService interface { + // CreateDesign adds a design to the db CreateDesign(userId string, info openapi.Design) error + + // GetDesign returns a design associated with the given user and design ids GetDesign(userId string, designId string) (openapi.Design, error) + + // DeleteDesign deletes the design from the db DeleteDesign(userId string, designId string) error + + // GetDesigns returns a list of designs associated with a user GetDesigns(userId string, limit int32) ([]openapi.DesignInfo, error) + // CreateDesignSchema adds a schema for a design to the db CreateDesignSchema(userId string, designId string, info openapi.DesignSchema) error + + // GetDesignSchema returns the schema of a design from the db GetDesignSchema(userId string, designId string, version string) (openapi.DesignSchema, error) + + // GetDesignSchemas returns all the schemas associated with the given designId GetDesignSchemas(userId string, designId string) ([]openapi.DesignSchema, error) + + // UpdateDesignSchema updates a schema for a design in the db UpdateDesignSchema(userId string, designId string, version string, info openapi.DesignSchema) error + + // DeleteDesignSchema deletes the schema of a design from the db DeleteDesignSchema(userId string, designId string, version string) error + // CreateDesignCode adds the code of a design to the db CreateDesignCode(userId string, designId string, fileName string, fileVer string, fileData *os.File) error + + // GetDesignCode retrieves the code of a design from the db GetDesignCode(userId string, designId string, version string) ([]byte, error) + + // DeleteDesignCode deletes the code of a design from the db DeleteDesignCode(userId string, designId string, version string) error } // JobService is an interface that defines a collection of APIs related to job type JobService interface { - CreateJob(string, openapi.JobSpec) (openapi.JobStatus, error) - DeleteJob(string, string) error - GetJob(string, string) (openapi.JobSpec, error) - GetJobById(string) (openapi.JobSpec, error) - GetJobStatus(string, string) (openapi.JobStatus, error) - GetJobs(string, int32) ([]openapi.JobStatus, error) - UpdateJob(string, string, openapi.JobSpec) error - UpdateJobStatus(string, string, openapi.JobStatus) error + // CreateJob creates a new job + CreateJob(userId string, spec openapi.JobSpec) (openapi.JobStatus, error) + + // DeleteJob deletes a given job + DeleteJob(userId string, jobId string) error + + // GetJob gets the job associated with the provided jobId + GetJob(userId string, jobId string) (openapi.JobSpec, error) + + // GetJobById gets the job associated with the provided jobId + GetJobById(jobId string) (openapi.JobSpec, error) + + // GetJobStatus get the status of a job + GetJobStatus(userId string, jobId string) (openapi.JobStatus, error) + + // GetJobs returns the list of jobs associated with a user + GetJobs(userId string, limit int32) ([]openapi.JobStatus, error) + + // UpdateJob updates the job with the given jobId + UpdateJob(userId string, jobId string, spec openapi.JobSpec) error + + // UpdateJobStatus updates the status of a job given the user Id, job Id and the openapi.JobStatus + UpdateJobStatus(userId string, jobId string, status openapi.JobStatus) error + + // GetTaskInfo gets the information of a task given the user Id, job Id and task Id GetTaskInfo(string, string, string) (openapi.TaskInfo, error) + + // GetTasksInfo gets the information of tasks given the user Id, job Id and a limit GetTasksInfo(string, string, int32, bool) ([]openapi.TaskInfo, error) + + // GetTasksInfoGeneric gets the information of tasks given the user Id, job Id, limit and an option to include completed tasks GetTasksInfoGeneric(string, string, int32, bool, bool) ([]openapi.TaskInfo, error) } // TaskService is an interface that defines a collection of APIs related to task type TaskService interface { + // CreateTasks creates tasks given a set of objects.Task and a flag CreateTasks([]objects.Task, bool) error + + // DeleteTasks deletes tasks given the job Id and a flag DeleteTasks(string, bool) error + + // GetTask gets the task given the user Id, job Id and task Id GetTask(string, string, string) (map[string][]byte, error) + + // IsOneTaskInState evaluates if one of the task is in a certain state given the job Id IsOneTaskInState(string, openapi.JobState) bool + + // IsOneTaskInStateWithRole evaluates if one of the tasks is in a certain state and with a specific role given the job Id IsOneTaskInStateWithRole(string, openapi.JobState, string) bool + + // MonitorTasks monitors the tasks and returns a TaskInfo channel MonitorTasks(string) (chan openapi.TaskInfo, chan error, context.CancelFunc, error) - SetTaskDirtyFlag(string, bool) error - UpdateTaskStateByFilter(string, openapi.JobState, map[string]interface{}) error - UpdateTaskStatus(string, string, openapi.TaskStatus) error + + // SetTaskDirtyFlag sets the dirty flag for tasks given the job Id and a flag + SetTaskDirtyFlag(jobId string, dirty bool) error + + // UpdateTaskStateByFilter updates the state of the task using a filter + UpdateTaskStateByFilter(jobId string, newState openapi.JobState, userFilter map[string]interface{}) error + + // UpdateTaskStatus updates the status of a task given the user Id, job Id, and openapi.TaskStatus + UpdateTaskStatus(jobId string, taskId string, taskStatus openapi.TaskStatus) error } // ComputeService is an interface that defines a collection of APIs related to computes type ComputeService interface { + // RegisterCompute registers a compute given a openapi.ComputeSpec RegisterCompute(openapi.ComputeSpec) (openapi.ComputeStatus, error) + + // GetComputeIdsByRegion gets all the compute Ids associated with a region GetComputeIdsByRegion(string) ([]string, error) + + // GetComputeById gets the compute info given the compute Id GetComputeById(string) (openapi.ComputeSpec, error) - // UpdateDeploymentStatus call replaces existing agent statuses with received statuses in collection. + + // UpdateDeploymentStatus updates the deployment status given the compute Id, job Id and agentStatuses map UpdateDeploymentStatus(computeId string, jobId string, agentStatuses map[string]openapi.AgentState) error } diff --git a/cmd/deployer/app/resource_handler.go b/cmd/deployer/app/resource_handler.go index 7052d4617..d9784a619 100644 --- a/cmd/deployer/app/resource_handler.go +++ b/cmd/deployer/app/resource_handler.go @@ -35,6 +35,7 @@ import ( "github.com/cisco-open/flame/cmd/deployer/app/deployer" "github.com/cisco-open/flame/pkg/openapi" + "github.com/cisco-open/flame/pkg/openapi/constants" pbNotify "github.com/cisco-open/flame/pkg/proto/notification" "github.com/cisco-open/flame/pkg/restapi" "github.com/cisco-open/flame/pkg/util" @@ -271,8 +272,8 @@ func (r *resourceHandler) postDeploymentStatus(jobId string, taskStatuses map[st taskStatuses, r.spec.ComputeId, jobId) // construct url uriMap := map[string]string{ - "computeId": r.spec.ComputeId, - "jobId": jobId, + constants.ParamComputeID: r.spec.ComputeId, + constants.ParamJobID: jobId, } url := restapi.CreateURL(r.apiserverEp, restapi.PutDeploymentStatusEndpoint, uriMap) @@ -288,8 +289,8 @@ func (r *resourceHandler) getDeploymentConfig(jobId string) (openapi.DeploymentC zap.S().Infof("Sending request to apiserver / controller to get deployment config") // construct url uriMap := map[string]string{ - "computeId": r.spec.ComputeId, - "jobId": jobId, + constants.ParamComputeID: r.spec.ComputeId, + constants.ParamJobID: jobId, } url := restapi.CreateURL(r.apiserverEp, restapi.GetDeploymentConfigEndpoint, uriMap) code, respBody, err := restapi.HTTPGet(url) @@ -346,9 +347,9 @@ func (r *resourceHandler) deployResources(deploymentConfig openapi.DeploymentCon taskKey := deploymentConfig.AgentKVs[taskId] ctx := map[string]string{ - "imageLoc": deploymentConfig.ImageLoc, - "taskId": taskId, - "taskKey": taskKey, + "imageLoc": deploymentConfig.ImageLoc, + constants.ParamTaskID: taskId, + "taskKey": taskKey, } rendered, renderErr := mustache.RenderFile(jobTemplatePath, &ctx) if renderErr != nil { diff --git a/cmd/flamectl/cmd/get_design.go b/cmd/flamectl/cmd/get_design.go index c162bbc30..e34e0c2e9 100644 --- a/cmd/flamectl/cmd/get_design.go +++ b/cmd/flamectl/cmd/get_design.go @@ -20,6 +20,7 @@ import ( "github.com/spf13/cobra" "github.com/cisco-open/flame/cmd/flamectl/resources/design" + "github.com/cisco-open/flame/pkg/openapi/constants" ) var getDesignCmd = &cobra.Command{ @@ -51,7 +52,7 @@ var getDesignsCmd = &cobra.Command{ flags := cmd.Flags() - limit, err := flags.GetString("limit") + limit, err := flags.GetString(constants.ParamLimit) if err != nil { return err } @@ -66,7 +67,7 @@ var getDesignsCmd = &cobra.Command{ } func init() { - getDesignsCmd.Flags().StringP("limit", "l", "100", "List of all the designs by this user") + getDesignsCmd.Flags().StringP(constants.ParamLimit, "l", "100", "List of all the designs by this user") getCmd.AddCommand(getDesignCmd, getDesignsCmd) } diff --git a/cmd/flamectl/resources/code/code.go b/cmd/flamectl/resources/code/code.go index 8d9287f1e..88ac2d120 100644 --- a/cmd/flamectl/resources/code/code.go +++ b/cmd/flamectl/resources/code/code.go @@ -27,6 +27,7 @@ import ( "strings" "github.com/cisco-open/flame/cmd/flamectl/resources" + "github.com/cisco-open/flame/pkg/openapi/constants" "github.com/cisco-open/flame/pkg/restapi" "github.com/cisco-open/flame/pkg/util" ) @@ -42,8 +43,8 @@ type Params struct { func Create(params Params) error { // construct URL uriMap := map[string]string{ - "user": params.User, - "designId": params.DesignId, + constants.ParamUser: params.User, + constants.ParamDesignID: params.DesignId, } url := restapi.CreateURL(params.Endpoint, restapi.CreateDesignCodeEndPoint, uriMap) @@ -87,9 +88,9 @@ func Create(params Params) error { func Get(params Params) error { // construct URL uriMap := map[string]string{ - "user": params.User, - "designId": params.DesignId, - "version": params.CodeVer, + constants.ParamUser: params.User, + constants.ParamDesignID: params.DesignId, + constants.ParamVersion: params.CodeVer, } url := restapi.CreateURL(params.Endpoint, restapi.GetDesignCodeEndPoint, uriMap) @@ -125,9 +126,9 @@ func mustOpen(f string) *os.File { func Remove(params Params) error { // construct URL uriMap := map[string]string{ - "user": params.User, - "designId": params.DesignId, - "version": params.CodeVer, + constants.ParamUser: params.User, + constants.ParamDesignID: params.DesignId, + constants.ParamVersion: params.CodeVer, } url := restapi.CreateURL(params.Endpoint, restapi.DeleteDesignCodeEndPoint, uriMap) diff --git a/cmd/flamectl/resources/dataset/dataset.go b/cmd/flamectl/resources/dataset/dataset.go index f930ac3bd..95d84d3b7 100644 --- a/cmd/flamectl/resources/dataset/dataset.go +++ b/cmd/flamectl/resources/dataset/dataset.go @@ -24,6 +24,7 @@ import ( "github.com/cisco-open/flame/cmd/flamectl/resources" "github.com/cisco-open/flame/pkg/openapi" + "github.com/cisco-open/flame/pkg/openapi/constants" "github.com/cisco-open/flame/pkg/restapi" "github.com/olekukonko/tablewriter" ) @@ -53,7 +54,7 @@ func Create(params Params) error { // construct URL uriMap := map[string]string{ - "user": params.User, + constants.ParamUser: params.User, } url := restapi.CreateURL(params.Endpoint, restapi.CreateDatasetEndPoint, uriMap) @@ -87,8 +88,8 @@ func Get(params Params) error { func GetMany(params Params, flagAll bool) error { // construct URL uriMap := map[string]string{ - "user": params.User, - "limit": params.Limit, + constants.ParamUser: params.User, + constants.ParamLimit: params.Limit, } endpoint := restapi.GetDatasetsEndPoint diff --git a/cmd/flamectl/resources/design/design.go b/cmd/flamectl/resources/design/design.go index 6eaf3b59a..9b4cad5bb 100644 --- a/cmd/flamectl/resources/design/design.go +++ b/cmd/flamectl/resources/design/design.go @@ -25,6 +25,7 @@ import ( "github.com/cisco-open/flame/cmd/flamectl/resources" "github.com/cisco-open/flame/pkg/openapi" + "github.com/cisco-open/flame/pkg/openapi/constants" "github.com/cisco-open/flame/pkg/restapi" "github.com/cisco-open/flame/pkg/util" ) @@ -40,7 +41,7 @@ type Params struct { func Create(params Params) error { // construct URL uriMap := map[string]string{ - "user": params.User, + constants.ParamUser: params.User, } url := restapi.CreateURL(params.Endpoint, restapi.CreateDesignEndPoint, uriMap) @@ -66,8 +67,8 @@ func Create(params Params) error { func Remove(params Params) error { // construct URL uriMap := map[string]string{ - "user": params.User, - "designId": params.DesignId, + constants.ParamUser: params.User, + constants.ParamDesignID: params.DesignId, } url := restapi.CreateURL(params.Endpoint, restapi.DeleteDesignEndPoint, uriMap) @@ -98,8 +99,8 @@ func Remove(params Params) error { func Get(params Params) error { // construct URL uriMap := map[string]string{ - "user": params.User, - "designId": params.DesignId, + constants.ParamUser: params.User, + constants.ParamDesignID: params.DesignId, } url := restapi.CreateURL(params.Endpoint, restapi.GetDesignEndPoint, uriMap) @@ -129,8 +130,8 @@ func Get(params Params) error { func GetMany(params Params) error { // construct URL uriMap := map[string]string{ - "user": params.User, - "limit": params.Limit, + constants.ParamUser: params.User, + constants.ParamLimit: params.Limit, } url := restapi.CreateURL(params.Endpoint, restapi.GetDesignsEndPoint, uriMap) diff --git a/cmd/flamectl/resources/job/job.go b/cmd/flamectl/resources/job/job.go index 8a99ce825..62422a72e 100644 --- a/cmd/flamectl/resources/job/job.go +++ b/cmd/flamectl/resources/job/job.go @@ -25,6 +25,7 @@ import ( "github.com/cisco-open/flame/cmd/flamectl/resources" "github.com/cisco-open/flame/pkg/openapi" + "github.com/cisco-open/flame/pkg/openapi/constants" "github.com/cisco-open/flame/pkg/restapi" "github.com/cisco-open/flame/pkg/util" ) @@ -54,7 +55,7 @@ func Create(params Params) error { // construct URL uriMap := map[string]string{ - "user": params.User, + constants.ParamUser: params.User, } url := restapi.CreateURL(params.Endpoint, restapi.CreateJobEndpoint, uriMap) @@ -84,8 +85,8 @@ func Create(params Params) error { func Get(params Params) error { // construct URL uriMap := map[string]string{ - "user": params.User, - "jobId": params.JobId, + constants.ParamUser: params.User, + constants.ParamJobID: params.JobId, } url := restapi.CreateURL(params.Endpoint, restapi.GetJobEndPoint, uriMap) @@ -127,8 +128,8 @@ func Get(params Params) error { func GetMany(params Params) error { // construct URL uriMap := map[string]string{ - "user": params.User, - "limit": params.Limit, + constants.ParamUser: params.User, + constants.ParamLimit: params.Limit, } url := restapi.CreateURL(params.Endpoint, restapi.GetJobsEndPoint, uriMap) @@ -163,8 +164,8 @@ func GetMany(params Params) error { func GetStatus(params Params) error { // construct URL uriMap := map[string]string{ - "user": params.User, - "jobId": params.JobId, + constants.ParamUser: params.User, + constants.ParamJobID: params.JobId, } url := restapi.CreateURL(params.Endpoint, restapi.GetJobStatusEndPoint, uriMap) @@ -212,8 +213,8 @@ func Update(params Params) error { // construct URL uriMap := map[string]string{ - "user": params.User, - "jobId": params.JobId, + constants.ParamUser: params.User, + constants.ParamJobID: params.JobId, } url := restapi.CreateURL(params.Endpoint, restapi.UpdateJobEndPoint, uriMap) @@ -234,8 +235,8 @@ func Update(params Params) error { func Remove(params Params) error { // construct URL uriMap := map[string]string{ - "user": params.User, - "jobId": params.JobId, + constants.ParamUser: params.User, + constants.ParamJobID: params.JobId, } url := restapi.CreateURL(params.Endpoint, restapi.DeleteJobEndPoint, uriMap) @@ -259,8 +260,8 @@ func Remove(params Params) error { func Start(params Params) error { // construct URL uriMap := map[string]string{ - "user": params.User, - "jobId": params.JobId, + constants.ParamUser: params.User, + constants.ParamJobID: params.JobId, } url := restapi.CreateURL(params.Endpoint, restapi.UpdateJobStatusEndPoint, uriMap) @@ -285,8 +286,8 @@ func Start(params Params) error { func Stop(params Params) error { // construct URL uriMap := map[string]string{ - "user": params.User, - "jobId": params.JobId, + constants.ParamUser: params.User, + constants.ParamJobID: params.JobId, } url := restapi.CreateURL(params.Endpoint, restapi.UpdateJobStatusEndPoint, uriMap) diff --git a/cmd/flamectl/resources/schema/schema.go b/cmd/flamectl/resources/schema/schema.go index 36ce95bdd..a903e8d6e 100644 --- a/cmd/flamectl/resources/schema/schema.go +++ b/cmd/flamectl/resources/schema/schema.go @@ -23,6 +23,7 @@ import ( "github.com/cisco-open/flame/cmd/flamectl/resources" "github.com/cisco-open/flame/pkg/openapi" + "github.com/cisco-open/flame/pkg/openapi/constants" "github.com/cisco-open/flame/pkg/restapi" "github.com/cisco-open/flame/pkg/util" ) @@ -51,8 +52,8 @@ func Create(params Params) error { // construct URL uriMap := map[string]string{ - "user": params.User, - "designId": params.DesignId, + constants.ParamUser: params.User, + constants.ParamDesignID: params.DesignId, } url := restapi.CreateURL(params.Endpoint, restapi.CreateDesignSchemaEndPoint, uriMap) @@ -73,9 +74,9 @@ func Create(params Params) error { func Get(params Params) error { // construct URL uriMap := map[string]string{ - "user": params.User, - "designId": params.DesignId, - "version": params.Version, + constants.ParamUser: params.User, + constants.ParamDesignID: params.DesignId, + constants.ParamVersion: params.Version, } url := restapi.CreateURL(params.Endpoint, restapi.GetDesignSchemaEndPoint, uriMap) @@ -105,8 +106,8 @@ func Get(params Params) error { func GetMany(params Params) error { // construct URL uriMap := map[string]string{ - "user": params.User, - "designId": params.DesignId, + constants.ParamUser: params.User, + constants.ParamDesignID: params.DesignId, } url := restapi.CreateURL(params.Endpoint, restapi.GetDesignSchemasEndPoint, uriMap) @@ -148,9 +149,9 @@ func Update(params Params) error { // construct URL uriMap := map[string]string{ - "user": params.User, - "designId": params.DesignId, - "version": params.Version, + constants.ParamUser: params.User, + constants.ParamDesignID: params.DesignId, + constants.ParamVersion: params.Version, } url := restapi.CreateURL(params.Endpoint, restapi.UpdateDesignSchemaEndPoint, uriMap) @@ -170,9 +171,9 @@ func Update(params Params) error { func Remove(params Params) error { // construct URL uriMap := map[string]string{ - "user": params.User, - "designId": params.DesignId, - "version": params.Version, + constants.ParamUser: params.User, + constants.ParamDesignID: params.DesignId, + constants.ParamVersion: params.Version, } url := restapi.CreateURL(params.Endpoint, restapi.DeleteDesignSchemaEndPoint, uriMap) diff --git a/cmd/flamectl/resources/task/task.go b/cmd/flamectl/resources/task/task.go index 998266bb1..68b025826 100644 --- a/cmd/flamectl/resources/task/task.go +++ b/cmd/flamectl/resources/task/task.go @@ -25,6 +25,7 @@ import ( "github.com/cisco-open/flame/cmd/flamectl/resources" "github.com/cisco-open/flame/pkg/openapi" + "github.com/cisco-open/flame/pkg/openapi/constants" "github.com/cisco-open/flame/pkg/restapi" "github.com/cisco-open/flame/pkg/util" ) @@ -40,9 +41,9 @@ type Params struct { func Get(params Params) error { // construct URL uriMap := map[string]string{ - "user": params.User, - "jobId": params.JobId, - "taskId": params.TaskId, + constants.ParamUser: params.User, + constants.ParamJobID: params.JobId, + constants.ParamTaskID: params.TaskId, } url := restapi.CreateURL(params.Endpoint, restapi.GetTaskInfoEndpoint, uriMap) @@ -68,9 +69,9 @@ func Get(params Params) error { func GetMany(params Params) error { // construct URL uriMap := map[string]string{ - "user": params.User, - "jobId": params.JobId, - "limit": params.Limit, + constants.ParamUser: params.User, + constants.ParamJobID: params.JobId, + constants.ParamLimit: params.Limit, } url := restapi.CreateURL(params.Endpoint, restapi.GetTasksInfoEndpoint, uriMap) diff --git a/cmd/flamelet/app/taskhandler.go b/cmd/flamelet/app/taskhandler.go index 9dca409ed..4531617f1 100644 --- a/cmd/flamelet/app/taskhandler.go +++ b/cmd/flamelet/app/taskhandler.go @@ -36,6 +36,7 @@ import ( "google.golang.org/grpc/credentials/insecure" "github.com/cisco-open/flame/pkg/openapi" + "github.com/cisco-open/flame/pkg/openapi/constants" pbNotify "github.com/cisco-open/flame/pkg/proto/notification" "github.com/cisco-open/flame/pkg/restapi" "github.com/cisco-open/flame/pkg/util" @@ -215,9 +216,9 @@ func (t *taskHandler) startJob(jobId string) { func (t *taskHandler) getTask() ([]string, error) { // construct URL uriMap := map[string]string{ - "jobId": t.jobId, - "taskId": t.taskId, - "key": t.taskKey, + constants.ParamJobID: t.jobId, + constants.ParamTaskID: t.taskId, + constants.ParamKey: t.taskKey, } url := restapi.CreateURL(t.apiserverEp, restapi.GetTaskEndpoint, uriMap) @@ -473,8 +474,8 @@ func (t *taskHandler) updateTaskStatus(state openapi.JobState, log string) { // construct URL uriMap := map[string]string{ - "jobId": t.jobId, - "taskId": t.taskId, + constants.ParamJobID: t.jobId, + constants.ParamTaskID: t.taskId, } url := restapi.CreateURL(t.apiserverEp, restapi.UpdateTaskStatusEndPoint, uriMap) diff --git a/docs/index.html b/docs/index.html index 48dae1365..336b4417f 100644 --- a/docs/index.html +++ b/docs/index.html @@ -31,21 +31,27 @@ }
-user required | string user id + |
limit | integer <int32> How many items to return at one time (max 100) + |
[- {
- "name": "diabete predict",
- "description": "Helps in quick diagnosis and prediction of diabetes among patients.",
- "id": "diabete-predict"
}
]
user required | string user name + |
Collection of node information
+name required | string |
description | string |
id required | string |
userId | string |
{- "name": "diabete predict",
- "description": "Helps in quick diagnosis and prediction of diabetes among patients.",
- "id": "diabete-predict"
}
{- "code": 0,
- "message": "string"
}
user required | string user id + |
designId required | string design id + |
{- "name": "diabete predict",
- "description": "Helps in quick diagnosis and prediction of diabetes among patients.",
- "id": "diabete-predict",
- "schemas": [
- [
- {
- "name": "sample schema 1",
- "description": "Sample schema to demostrate a TAG layout.",
- "roles": [
- {
- "name": "trainer",
- "description": "These are responsible to consume the data and train local model",
- "isDataConsumer": true
}, - {
- "name": "aggregator",
- "description": "These are responsible to aggregate the updates from trainer nodes.",
- "replica": 2
}, - {
- "name": "global_aggregator",
- "description": "It is responsible to aggregate the updates from all the aggregators and make a generic model.",
- "replica": 2
}
], - "channel": [
- {
- "name": "trainer-agg-channel",
- "description": "Model update is sent from trainer to aggregator and vice-versa.",
- "pair": [
- "trainer",
- "aggregator"
], - "groupBy": {
- "type": "tag",
- "value": [
- "us",
- "eu"
]
}
}, - {
- "name": "agg-global-channel",
- "description": "Model update is sent from all aggregators to the global aggregator and vice-versa.",
- "pair": [
- "trainer",
- "aggregator"
], - "groupBy": {
- "type": "tag",
- "value": [
- "us",
- "eu"
]
}
}
]
}
]
]
}
user required | string user id + |
designId required | string design id + |
{- "schemas": [
- [
- {
- "name": "sample schema 1",
- "description": "Sample schema to demostrate a TAG layout.",
- "roles": [
- {
- "name": "trainer",
- "description": "These are responsible to consume the data and train local model",
- "isDataConsumer": true
}, - {
- "name": "aggregator",
- "description": "These are responsible to aggregate the updates from trainer nodes.",
- "replica": 2
}, - {
- "name": "global_aggregator",
- "description": "It is responsible to aggregate the updates from all the aggregators and make a generic model.",
- "replica": 2
}
], - "channel": [
- {
- "name": "trainer-agg-channel",
- "description": "Model update is sent from trainer to aggregator and vice-versa.",
- "pair": [
- "trainer",
- "aggregator"
], - "groupBy": {
- "type": "tag",
- "value": [
- "us",
- "eu"
]
}
}, - {
- "name": "agg-global-channel",
- "description": "Model update is sent from all aggregators to the global aggregator and vice-versa.",
- "pair": [
- "trainer",
- "aggregator"
], - "groupBy": {
- "type": "tag",
- "value": [
- "us",
- "eu"
]
}
}
]
}
]
]
}
user required | string user id + |
designId required | string design id + |
version required | string |
name required | string |
description | string |
required | Array of objects (Role) |
required | Array of objects (Channel) |
Array of objects (Connector) |
[- {
- "name": "sample schema 1",
- "description": "Sample schema to demostrate a TAG layout.",
- "roles": [
- {
- "name": "trainer",
- "description": "These are responsible to consume the data and train local model",
- "isDataConsumer": true
}, - {
- "name": "aggregator",
- "description": "These are responsible to aggregate the updates from trainer nodes.",
- "replica": 2
}, - {
- "name": "global_aggregator",
- "description": "It is responsible to aggregate the updates from all the aggregators and make a generic model.",
- "replica": 2
}
], - "channel": [
- {
- "name": "trainer-agg-channel",
- "description": "Model update is sent from trainer to aggregator and vice-versa.",
- "pair": [
- "trainer",
- "aggregator"
], - "groupBy": {
- "type": "tag",
- "value": [
- "us",
- "eu"
]
}
}, - {
- "name": "agg-global-channel",
- "description": "Model update is sent from all aggregators to the global aggregator and vice-versa.",
- "pair": [
- "trainer",
- "aggregator"
], - "groupBy": {
- "type": "tag",
- "value": [
- "us",
- "eu"
]
}
}
]
}
]
{- "code": 0,
- "message": "string"
}
user required | string user id + |
designId required | string design id + |
version required | string version string + |
[- {
- "name": "sample schema 1",
- "description": "Sample schema to demostrate a TAG layout.",
- "roles": [
- {
- "name": "trainer",
- "description": "These are responsible to consume the data and train local model",
- "isDataConsumer": true
}, - {
- "name": "aggregator",
- "description": "These are responsible to aggregate the updates from trainer nodes.",
- "replica": 2
}, - {
- "name": "global_aggregator",
- "description": "It is responsible to aggregate the updates from all the aggregators and make a generic model.",
- "replica": 2
}
], - "channel": [
- {
- "name": "trainer-agg-channel",
- "description": "Model update is sent from trainer to aggregator and vice-versa.",
- "pair": [
- "trainer",
- "aggregator"
], - "groupBy": {
- "type": "tag",
- "value": [
- "us",
- "eu"
]
}
}, - {
- "name": "agg-global-channel",
- "description": "Model update is sent from all aggregators to the global aggregator and vice-versa.",
- "pair": [
- "trainer",
- "aggregator"
], - "groupBy": {
- "type": "tag",
- "value": [
- "us",
- "eu"
]
}
}
]
}
]
user required | string user id + |
designId required | string design id + |
version required | string version string + |
version required | string |
name required | string |
description | string |
required | Array of objects (Role) |
required | Array of objects (Channel) |
Array of objects (Connector) |
[- {
- "name": "sample schema 1",
- "description": "Sample schema to demostrate a TAG layout.",
- "roles": [
- {
- "name": "trainer",
- "description": "These are responsible to consume the data and train local model",
- "isDataConsumer": true
}, - {
- "name": "aggregator",
- "description": "These are responsible to aggregate the updates from trainer nodes.",
- "replica": 2
}, - {
- "name": "global_aggregator",
- "description": "It is responsible to aggregate the updates from all the aggregators and make a generic model.",
- "replica": 2
}
], - "channel": [
- {
- "name": "trainer-agg-channel",
- "description": "Model update is sent from trainer to aggregator and vice-versa.",
- "pair": [
- "trainer",
- "aggregator"
], - "groupBy": {
- "type": "tag",
- "value": [
- "us",
- "eu"
]
}
}, - {
- "name": "agg-global-channel",
- "description": "Model update is sent from all aggregators to the global aggregator and vice-versa.",
- "pair": [
- "trainer",
- "aggregator"
], - "groupBy": {
- "type": "tag",
- "value": [
- "us",
- "eu"
]
}
}
]
}
]
{- "code": 0,
- "message": "string"
}
user required | string user id + |
designId required | string design id + |
version required | string version string + |
version required | string |
name required | string |
description | string |
required | Array of objects (Role) |
required | Array of objects (Channel) |
Array of objects (Connector) |
[- {
- "name": "sample schema 1",
- "description": "Sample schema to demostrate a TAG layout.",
- "roles": [
- {
- "name": "trainer",
- "description": "These are responsible to consume the data and train local model",
- "isDataConsumer": true
}, - {
- "name": "aggregator",
- "description": "These are responsible to aggregate the updates from trainer nodes.",
- "replica": 2
}, - {
- "name": "global_aggregator",
- "description": "It is responsible to aggregate the updates from all the aggregators and make a generic model.",
- "replica": 2
}
], - "channel": [
- {
- "name": "trainer-agg-channel",
- "description": "Model update is sent from trainer to aggregator and vice-versa.",
- "pair": [
- "trainer",
- "aggregator"
], - "groupBy": {
- "type": "tag",
- "value": [
- "us",
- "eu"
]
}
}, - {
- "name": "agg-global-channel",
- "description": "Model update is sent from all aggregators to the global aggregator and vice-versa.",
- "pair": [
- "trainer",
- "aggregator"
], - "groupBy": {
- "type": "tag",
- "value": [
- "us",
- "eu"
]
}
}
]
}
]
{- "code": 0,
- "message": "string"
}
user required | string user id + |
designId required | string design id + |
fileName required | string |
fileVer required | string |
fileData required | string <binary> <= 10485760 characters |
{- "code": 0,
- "message": "string"
}
user required | string user id + |
designId required | string design id + |
version required | string version string + |
fileName required | string |
fileVer required | string |
fileData required | string <binary> <= 10485760 characters |
{- "code": 0,
- "message": "string"
}
limit | integer <int32> How many items to return at one time (max 100) + |
[- {
- "id": "613157766667387296a5ada4",
- "userId": "",
- "name": "mnist dataset",
- "description": "dataset containing handwritten digits",
- "dataFormat": "npy",
- "realm": "us/west/org1/cluster1",
- "computeId": "cluster1",
- "isPublic": true
}
]
user required | string user id + |
limit | integer <int32> How many items to return at one time (max 100) + |
[- {
- "id": "613157766667387296a5ada4",
- "userId": "",
- "name": "mnist dataset",
- "description": "dataset containing handwritten digits",
- "dataFormat": "npy",
- "realm": "us/west/org1/cluster1",
- "computeId": "cluster1",
- "isPublic": true
}
]
user required | string user id + |
dataset information
+id | string |
userId | string |
name | string |
description | string |
url required | string |
dataFormat required | string |
realm required | string |
computeId | string |
isPublic | boolean |
{- "id": "613157766667387296a5ada4",
- "userId": "",
- "name": "mnist dataset",
- "description": "dataset containing handwritten digits",
- "dataFormat": "npy",
- "realm": "us/west/org1/cluster1",
- "computeId": "cluster1",
- "isPublic": true
}
{- "code": 0,
- "message": "string"
}
user required | string user id + |
datasetId required | string dataset id + |
{- "id": "613157766667387296a5ada4",
- "userId": "",
- "name": "mnist dataset",
- "description": "dataset containing handwritten digits",
- "dataFormat": "npy",
- "realm": "us/west/org1/cluster1",
- "computeId": "cluster1",
- "isPublic": true
}
user required | string user id + |
datasetId required | string dataset id + |
id | string |
userId | string |
name | string |
description | string |
url required | string |
dataFormat required | string |
realm required | string |
computeId | string |
isPublic | boolean |
{- "id": "613157766667387296a5ada4",
- "userId": "",
- "name": "mnist dataset",
- "description": "dataset containing handwritten digits",
- "dataFormat": "npy",
- "realm": "us/west/org1/cluster1",
- "computeId": "cluster1",
- "isPublic": true
}
{- "code": 0,
- "message": "string"
}
user required | string user id + |
id | string |
userId | string |
designId required | string |
schemaVersion required | string |
codeVersion required | string |
object (DataSpec) | |
object (Optimizer) | |
object (Selector) | |
priority | any (JobPriority) Enum: "low" "medium" "high" |
backend | any (CommBackend) Enum: "mqtt" "p2p" |
maxRunTime | integer <int32> Default: 600 |
object (BaseModel) | |
hyperparameters | object |
dependencies | Array of strings |
{- "userId": "john",
- "designId": "60d0d66716af12b787d9ef0a",
- "schemaVersion": "1",
- "codeVersion": "1",
- "selector": {
- "sort": "random",
- "kwargs": {
- "k": 10
}
}, - "prority": "low",
- "backend": "mqtt",
- "maxRunTime": 600,
- "baseModel": {
- "name": "mnist-624d9fc43395791",
- "version": 2
}, - "hyperparameters": [
- {
- "rounds": 5
}, - {
- "runningRate": 0.01
}
], - "dependencies": [
- "numpy >= 1.2.0"
]
}
{- "code": 0,
- "message": "string"
}
user required | string user id + |
limit | integer <int32> How many items to return at one time (max 100) + |
[- {
- "id": "string",
- "state": "ready",
- "createdAt": "2019-08-24T14:15:22Z",
- "startedAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "endedAt": "2019-08-24T14:15:22Z"
}
]
user required | string user id + |
jobId required | string job id + |
{- "userId": "john",
- "designId": "60d0d66716af12b787d9ef0a",
- "schemaVersion": "1",
- "codeVersion": "1",
- "selector": {
- "sort": "random",
- "kwargs": {
- "k": 10
}
}, - "prority": "low",
- "backend": "mqtt",
- "maxRunTime": 600,
- "baseModel": {
- "name": "mnist-624d9fc43395791",
- "version": 2
}, - "hyperparameters": [
- {
- "rounds": 5
}, - {
- "runningRate": 0.01
}
], - "dependencies": [
- "numpy >= 1.2.0"
]
}
user required | string user id + |
jobId required | string job id + |
id | string |
userId | string |
designId required | string |
schemaVersion required | string |
codeVersion required | string |
object (DataSpec) | |
object (Optimizer) | |
object (Selector) | |
priority | any (JobPriority) Enum: "low" "medium" "high" |
backend | any (CommBackend) Enum: "mqtt" "p2p" |
maxRunTime | integer <int32> Default: 600 |
object (BaseModel) | |
hyperparameters | object |
dependencies | Array of strings |
{- "userId": "john",
- "designId": "60d0d66716af12b787d9ef0a",
- "schemaVersion": "1",
- "codeVersion": "1",
- "selector": {
- "sort": "random",
- "kwargs": {
- "k": 10
}
}, - "prority": "low",
- "backend": "mqtt",
- "maxRunTime": 600,
- "baseModel": {
- "name": "mnist-624d9fc43395791",
- "version": 2
}, - "hyperparameters": [
- {
- "rounds": 5
}, - {
- "runningRate": 0.01
}
], - "dependencies": [
- "numpy >= 1.2.0"
]
}
{- "code": 0,
- "message": "string"
}
user required | string user id + |
jobId required | string job id + |
{- "id": "string",
- "state": "ready",
- "createdAt": "2019-08-24T14:15:22Z",
- "startedAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "endedAt": "2019-08-24T14:15:22Z"
}
user required | string user id + |
jobId required | string job id + |
id required | string |
state required | any (JobState) Enum: "ready" "starting" "applying" "deploying" "stopping" "running" "failed" "terminated" "completed" |
createdAt | string <date-time> |
startedAt | string <date-time> |
updatedAt | string <date-time> |
endedAt | string <date-time> |
{- "id": "string",
- "state": "ready",
- "createdAt": "2019-08-24T14:15:22Z",
- "startedAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "endedAt": "2019-08-24T14:15:22Z"
}
{- "code": 0,
- "message": "string"
}
user required | string user id + |
jobId required | string job id + |
taskId required | string task id + |
{- "jobId": "string",
- "taskId": "string",
- "role": "string",
- "type": "user",
- "key": "string",
- "state": "ready",
- "computeId": "string",
- "log": "string",
- "timestamp": "2019-08-24T14:15:22Z"
}
user required | string user id + |
jobId required | string job id + |
limit | integer <int32> How many items to return at one time (max 100) + |
[- {
- "jobId": "string",
- "taskId": "string",
- "role": "string",
- "type": "user",
- "key": "string",
- "state": "ready",
- "computeId": "string",
- "log": "string",
- "timestamp": "2019-08-24T14:15:22Z"
}
]
jobId required | string job id + |
taskId required | string flamelet task Id + |
key required | string A key for task authentication; once the key is recognized by the flame system for the first time, it can't be changed. + |
{- "code": 0,
- "message": "string"
}
jobId required | string job id + |
taskId required | string task id + |
state | any (JobState) Enum: "ready" "starting" "applying" "deploying" "stopping" "running" "failed" "terminated" "completed" |
log | string |
timestamp | string <date-time> |
{- "state": "ready",
- "log": "string",
- "timestamp": "2019-08-24T14:15:22Z"
}
{- "code": 0,
- "message": "string"
}
adminId | string |
region | string |
apiKey | string |
computeId | string |
{- "adminId": "admin-1",
- "region": "us-east",
- "apiKey": "apikey-1",
- "computeId": "compute-1"
}
{- "code": 0,
- "message": "string"
}
computeId required | string compute id of compute cluster + |
X-API-KEY required | string |
{- "computeId": "string",
- "registeredAt": "2019-08-24T14:15:22Z",
- "state": "up",
- "updatedAt": "2019-08-24T14:15:22Z"
}
computeId required | string compute id of compute cluster + |
X-API-KEY required | string |
adminId | string |
region | string |
apiKey | string |
computeId | string |
{- "adminId": "admin-1",
- "region": "us-east",
- "apiKey": "apikey-1",
- "computeId": "compute-1"
}
{- "code": 0,
- "message": "string"
}
computeId required | string compute id of compute cluster + |
X-API-KEY required | string |
{- "adminId": "admin-1",
- "region": "us-east",
- "apiKey": "apikey-1",
- "computeId": "compute-1"
}
computeId required | string compute id of compute cluster + |
jobId required | string job id + |
X-API-KEY required | string |
{- "jobId": "string",
- "imageLoc": "string",
- "agentKVs": {
- "property1": "string",
- "property2": "string"
}
}
computeId required | string compute id of compute cluster + |
jobId required | string job id + |
X-API-KEY required | string |
Status for agents in a job deployment
+property name* additional property | any (AgentState) Enum: "agentDeploySuccess" "agentDeployFailed" "agentRevokeSuccess" "agentRevokeFailed" |
{- "property1": "agentDeploySuccess",
- "property2": "agentDeploySuccess"
}
{- "code": 0,
- "message": "string"
}
computeId required | string compute id of compute cluster + |
jobId required | string job id + |
X-API-KEY required | string |
{- "property1": "agentDeploySuccess",
- "property2": "agentDeploySuccess"
}