Objectivity REST : Schema Resources : PUT /v1/schema/{class}
PUT /v1/schema/{class}
PUT /v1/schema/{class}
Modifies an existing class, either renaming the class or deleting, renaming, or adding attributes.
Headers 
 
Response Format
Accept:application/json
Body format
Content-Type:application/json
URL Parameters 
fdAlias
Provides the alias of a federated database that is included in the REST server’s configuration file; see Configuring the REST Server in Objectivity/DB Administration.
Body Parameters 
classRename
Class name for the class to rename.
attributesToDelete
Name of one or more attributes to delete from the class description. The shape number of the class is incremented.
The attribute is also removed from objects of that class and those values are lost.
attributesToRename
Old and new name pair for one or more attributes:
originalName
newName
Discussion 
You specify the class to modify by fully qualified class name or class number in double quotes. You cannot rename a class and modify its attributes in the same operation.
Important: Deleting attributes has consequences for existing objects of a modified type; see attributeToDelete below for details.
Sample Body 
The following updates an existing Customer class that is part of the rental fleet example. The rewardPoints attribute is deleted and the userId attribute is renamed.
{
  "attributesToDelete": [
    "rewardPoints"
  ],
  "attributesToRename": 
  [
    {
      "originalName": "userId", 
      "newName": "loginName"
    } 
  ]
}
Curl Example 
For more complex bodies such as schema modifications, you can provide the content in a file and submit it as follows:
curl -X PUT -H "Content-Type:application/json,Accept:application/json" -d @myCustomerSchemaModsFile.txt localhost:8185/v1/schema/FleetData.Customer
Response 
The response includes the class number for updated class definition as well as its URI. The shape number does not change for renaming an attribute, but it does change on deleting an attribute.
 
Status: 201 Created
{
  "classNumber": "1000015",
  "uri": "/v1/schema/1000015"
}
More Samples 
The following renames the Customer class:
{
  "classRename": "FleetData.Consumer"
}
Response 
The response includes the class number for the new or updated class definition as well as its URI. The shape number does not change for a class rename.
See also 
PUT /v1/schema to add an attribute to a class
Objectivity/DB Data Types