lxd/db/operations.go
func (c *ClusterTx) OperationAdd(project, uuid string, typ OperationType) (int64, error) {
	var projectID interface{}

	if project != "" {
		var err error
		projectID, err = c.ProjectID(project)
		if err != nil {
			return -1, errors.Wrap(err, "Fetch project ID")
		}
	} else {
		projectID = nil
	}

	columns := []string{"uuid", "node_id", "type", "project_id"}
	values := []interface{}{uuid, c.nodeID, typ, projectID}
	return query.UpsertObject(c.tx, "operations", columns, values)
}
func (c *ClusterTx) OperationAdd(project, uuid string, typ OperationType) (int64, error) {
	var projectID interface{}

	if project != "" {
		var err error
		projectID, err = c.ProjectID(project)
		if err != nil {
			return -1, errors.Wrap(err, "Fetch project ID")
		}
	} else {
		projectID = nil
	}

	columns := []string{"uuid", "node_id", "type", "project_id"}
	values := []interface{}{uuid, c.nodeID, typ, projectID}
	return query.UpsertObject(c.tx, "operations", columns, values)
}
func ( c * ClusterTx ) OperationAdd ( project , uuid string , typ OperationType ) ( int64 , error ) { var projectID interface { } if project != " " { var err error projectID , err = c . ProjectID ( project ) if err != nil { return - 1 , errors . Wrap ( err , " " ) } } else { projectID = nil } columns := [ ] string { " " , " " , " " , " " } values := [ ] interface { } { uuid , c . nodeID , typ , projectID } return query . UpsertObject ( c . tx , " " , columns , values ) }
// OperationAdd adds a new operations to the table.
OperationAdd adds a new operations to the table .