Creating Registration Records in batch
You can create multiple Registration Records in one single HTTP request. This action reduces latency when you create many resources at the cost of more complex requests and responses.
About this task
Creating Registration Records in batch can also simplify the resources and relationships creation.
Only users or groups that are mapped to the RegistryProviderAdminRole and RegistryAdminRole roles can send requests to the batch service, since the operations involve the creation or update of resources in the Resource Registry.
For more information about the users and groups roles, see Authenticated access to resources.
The creation of Registration Records in batch is implemented through the OSLC Automation Specification as an Automation request that contains the collection of Registration Records to be created.
Procedure
Results
The HTTP 200 (OK) status code means that the HTTP POST request was successfully processed, even though there might be failures in individual registrations.
The response body includes an oslc_auto:AutomationResponse payload, and this example shows two successful registrations and one failure:
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dcterms = "http://purl.org/dc/terms/"
xmlns:rdfs = "http://www.w3.org/2000/01/rdf-schema#"
xmlns:rr = "http://jazz.net/ns/ism/registry#"
xmlns:oslc = "http://open-services.net/ns/core#"
xmlns:oslc_auto = "http://open-services.net/ns/auto#">
<oslc_auto:AutomationResult>
<dcterms:title>Registration Record creation result</dcterms:title>
<dcterms:identifier>RegistrationRecordCreateResult</dcterms:identifier>
<oslc_auto:verdict rdf:resource = "http://open-services.net/ns/auto#passed"/>
<oslc_auto:verdict rdf:resource = "http://open-services.net/ns/auto#failed"/>
<oslc_auto:state rdf:resource="http://open-services.net/ns/auto#complete"/>
<oslc_auto:reportsOnAutomationPlan rdf:resource =
"http://jazz.net/ns/ism/registry#CreateRegistrationRecords"/>
<oslc_auto:contribution>
<oslc_auto:ParameterInstance>
<oslc:name>error</oslc:name>
<rdf:value>
<rr:Errors>
<rdfs:member>
<oslc:Error>
<rr:sourceRecord rdf:resource =
"http://itmfvs.ibm.com/devices/computer-b130946"/>
<oslc:statusCode>400</oslc:statusCode>
<oslc:message>CTJFK0010E The incoming request from the IP 9.48.84.42
did not end successfully. The Registry Services application found
an error while processing the request to create a Registration Record
for the given parameters:
"https://oslc-registry/oslc/rr/operations/collection". The specific
reason for this error is: CTJFK0014E The provided Registration Record
definition does not contain the required field:
{http://open-services.net/ns/core#}serviceProvider..
</oslc:message>
<oslc:extendedError>
<oslc:ExtendedError>
<oslc:moreInfo rdf:resource = "https://oslc-registry/oslc/error/messages/CTJFK0001E"/>
</oslc:ExtendedError>
</oslc:extendedError>
</oslc:Error>
</rdfs:member>
</rr:Errors>
</rdf:value>
</oslc_auto:ParameterInstance>
</oslc_auto:contribution>
<oslc_auto:contribution>
<oslc_auto:ParameterInstance>
<oslc:name>registrationResults</oslc:name>
<rdf:value>
<rr:RegistrationResults>
<rdfs:member>
<rr:RegistrationResult>
<oslc:statusCode>201</oslc:statusCode>
<!--this resource did not already exist -->
<rr:sourceRecord rdf:resource =
"http://itmfvs.ibm.com/devices/computer-0269a3a3"/>
<rr:registrationRecord rdf:resource =
"https://oslc-registry/oslc/registration/205"/>
</rr:RegistrationResult>
</rdfs:member>
<rdfs:member>
<rr:RegistrationResult>
<oslc:statusCode>200</oslc:statusCode>
<!--this resource already existed -->
<rr:sourceRecord rdf:resource =
"http://itmfvs.ibm.com/devices/computer-be38967c"/>
<rr:registrationRecord rdf:resource =
"https://oslc-registry/oslc/registration/206"/>
</rr:RegistrationResult>
</rdfs:member>
</rr:RegistrationResults>
</rdf:value>
</oslc_auto:ParameterInstance>
</oslc_auto:contribution>
</oslc_auto:AutomationResult>
</rdf:RDF>
If a failure occurs preventing a Registration Record from being created according to the HTTP request, Registry Services includes an Error record in the results. It also includes a fail verdict to indicate that at least one registration failed.
The Registry Services includes a rr:RegistrationResult record for each registration that is successfully processed and a pass verdict to indicate that at least one registration succeeded.
If an internal error or a parser error occurs preventing the batch operation from being processed, theRegistry Services returns an OSLC error instead of an Automation Result error.
If any other error occurs to your request, the HTTP response contains the appropriate status code and error message. For more information, see Application runtime.