commitGraphBatch
Apply one atomic graph modification batch.
Writes target the selected branch head as one atomic CDO commit. A batch may create resource folders, resources, and graph objects, then attach and modify them by temporary ID. Resource-node names and uniqueness follow CDO namespace rules; REST names and path segments reject slash, empty, dot, and dot-dot segments. Detaching an object recursively detaches its containment subtree; non-containment references do not cascade. The REST layer enforces configured request and response-processing limits and Ecore upper bounds but does not run an EValidator or impose lower-bound validation. GET /api/cdo/v1/capabilities reports the effective configured limits. A successful commit remains committed even if its HTTP response cannot be delivered.
/api/cdo/v1/repositories/{repository}/commits
Usage and SDK Samples
curl -X POST \
-H "Accept: application/json,application/problem+json" \
-H "Content-Type: application/json" \
"http://localhost/api/cdo/v1/repositories/{repository}/commits?branch=branch_example" \
-d '{
"operations" : [ {
"op" : "",
"type" : {
"package" : "https://openapi-generator.tech",
"name" : "name"
},
"feature" : "feature"
}, {
"op" : "",
"type" : {
"package" : "https://openapi-generator.tech",
"name" : "name"
},
"feature" : "feature"
} ],
"expectedVersions" : {
"key" : 0
}
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CommitsApi;
import java.io.File;
import java.util.*;
public class CommitsApiExample {
public static void main(String[] args) {
// Create an instance of the API class
CommitsApi apiInstance = new CommitsApi();
String repository = repository_example; // String | REST alias configured for one CDO repository.
CommitBatch commitBatch = {"expectedVersions":{"opaque-object-id":7},"operations":[{"op":"set","object":"opaque-object-id","feature":"name","value":"Updated through REST"}]}; // CommitBatch |
String branch = branch_example; // String | Branch path name. Defaults to the main branch.
try {
CommitResult result = apiInstance.commitGraphBatch(repository, commitBatch, branch);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CommitsApi#commitGraphBatch");
e.printStackTrace();
}
}
}
import 'package:openapi/api.dart';
final api_instance = DefaultApi();
final String repository = new String(); // String | REST alias configured for one CDO repository.
final CommitBatch commitBatch = new CommitBatch(); // CommitBatch |
final String branch = new String(); // String | Branch path name. Defaults to the main branch.
try {
final result = await api_instance.commitGraphBatch(repository, commitBatch, branch);
print(result);
} catch (e) {
print('Exception when calling DefaultApi->commitGraphBatch: $e\n');
}
import org.openapitools.client.api.CommitsApi;
public class CommitsApiExample {
public static void main(String[] args) {
CommitsApi apiInstance = new CommitsApi();
String repository = repository_example; // String | REST alias configured for one CDO repository.
CommitBatch commitBatch = {"expectedVersions":{"opaque-object-id":7},"operations":[{"op":"set","object":"opaque-object-id","feature":"name","value":"Updated through REST"}]}; // CommitBatch |
String branch = branch_example; // String | Branch path name. Defaults to the main branch.
try {
CommitResult result = apiInstance.commitGraphBatch(repository, commitBatch, branch);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CommitsApi#commitGraphBatch");
e.printStackTrace();
}
}
}
// Create an instance of the API class
CommitsApi *apiInstance = [[CommitsApi alloc] init];
String *repository = repository_example; // REST alias configured for one CDO repository. (default to null)
CommitBatch *commitBatch = {"expectedVersions":{"opaque-object-id":7},"operations":[{"op":"set","object":"opaque-object-id","feature":"name","value":"Updated through REST"}]}; //
String *branch = branch_example; // Branch path name. Defaults to the main branch. (optional) (default to null)
// Apply one atomic graph modification batch.
[apiInstance commitGraphBatchWith:repository
commitBatch:commitBatch
branch:branch
completionHandler: ^(CommitResult output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var EclipseCdoGraphRestApi = require('eclipse_cdo_graph_rest_api');
// Create an instance of the API class
var api = new EclipseCdoGraphRestApi.CommitsApi()
var repository = repository_example; // {String} REST alias configured for one CDO repository.
var commitBatch = {"expectedVersions":{"opaque-object-id":7},"operations":[{"op":"set","object":"opaque-object-id","feature":"name","value":"Updated through REST"}]}; // {CommitBatch}
var opts = {
'branch': branch_example // {String} Branch path name. Defaults to the main branch.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.commitGraphBatch(repository, commitBatch, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class commitGraphBatchExample
{
public void main()
{
// Create an instance of the API class
var apiInstance = new CommitsApi();
var repository = repository_example; // String | REST alias configured for one CDO repository. (default to null)
var commitBatch = new CommitBatch(); // CommitBatch |
var branch = branch_example; // String | Branch path name. Defaults to the main branch. (optional) (default to null)
try {
// Apply one atomic graph modification batch.
CommitResult result = apiInstance.commitGraphBatch(repository, commitBatch, branch);
Debug.WriteLine(result);
} catch (Exception e) {
Debug.Print("Exception when calling CommitsApi.commitGraphBatch: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CommitsApi();
$repository = repository_example; // String | REST alias configured for one CDO repository.
$commitBatch = {"expectedVersions":{"opaque-object-id":7},"operations":[{"op":"set","object":"opaque-object-id","feature":"name","value":"Updated through REST"}]}; // CommitBatch |
$branch = branch_example; // String | Branch path name. Defaults to the main branch.
try {
$result = $api_instance->commitGraphBatch($repository, $commitBatch, $branch);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CommitsApi->commitGraphBatch: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CommitsApi;
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CommitsApi->new();
my $repository = repository_example; # String | REST alias configured for one CDO repository.
my $commitBatch = WWW::OPenAPIClient::Object::CommitBatch->new(); # CommitBatch |
my $branch = branch_example; # String | Branch path name. Defaults to the main branch.
eval {
my $result = $api_instance->commitGraphBatch(repository => $repository, commitBatch => $commitBatch, branch => $branch);
print Dumper($result);
};
if ($@) {
warn "Exception when calling CommitsApi->commitGraphBatch: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Create an instance of the API class
api_instance = openapi_client.CommitsApi()
repository = repository_example # String | REST alias configured for one CDO repository. (default to null)
commitBatch = {"expectedVersions":{"opaque-object-id":7},"operations":[{"op":"set","object":"opaque-object-id","feature":"name","value":"Updated through REST"}]} # CommitBatch |
branch = branch_example # String | Branch path name. Defaults to the main branch. (optional) (default to null)
try:
# Apply one atomic graph modification batch.
api_response = api_instance.commit_graph_batch(repository, commitBatch, branch=branch)
pprint(api_response)
except ApiException as e:
print("Exception when calling CommitsApi->commitGraphBatch: %s\n" % e)
extern crate CommitsApi;
pub fn main() {
let repository = repository_example; // String
let commitBatch = {"expectedVersions":{"opaque-object-id":7},"operations":[{"op":"set","object":"opaque-object-id","feature":"name","value":"Updated through REST"}]}; // CommitBatch
let branch = branch_example; // String
let mut context = CommitsApi::Context::default();
let result = client.commitGraphBatch(repository, commitBatch, branch, &context).wait();
println!("{:?}", result);
}
Scopes
Parameters
| Name | Description |
|---|---|
| repository* |
String
REST alias configured for one CDO repository.
Required
|
| Name | Description |
|---|---|
| commitBatch * |
| Name | Description |
|---|---|
| branch |
String
Branch path name. Defaults to the main branch.
|
Responses
| Name | Type | Format | Description |
|---|---|---|---|
| WWW-Authenticate | String | Optional challenge supplied by the configured authenticator. |