Library Entity¶
/api/repositories/{repository}/library/entities/{libraryID}
Parameter | Type | Purpose |
---|---|---|
repository | string | The name of the repository |
libraryID | int | The ID of the library entity |
Get/Post¶
-
GET
/api/repositories/
(string: repository)/library/entities/
(int: libraryID)¶ Gets the metadata for a library entity The GET request supports page and pageSize parameters on the URL. If you require a subset of this data (filtering, sorting, or columns), POST to this url with the standard request body.
GET /api/repositories/jupiter/library/entities/2 HTTP/1.1
Accept: application/json
Response Code | Reason |
---|---|
200 | No error |
500 | Server error |
The response will be a Standard Response. The columns
array has three elements:
Human Name | Column Name | Description |
---|---|---|
Metadata | _col0 | The name of the metadata statistic |
Value | _col1 | The value of the statistic |
Description | _col2 | A description of the statistic. |
The rows
array has an element for each statistic available for the entity.
{
"rows": [
{
"dataRow": [
"ID",
"2",
"Internal entity reference"
],
"metadata": {
"url": ""
}
},
{
"dataRow": [
"Name",
"LibInput",
"The schema name for the library entity"
],
"metadata": {
"url": ""
}
},
{
"dataRow": [
"Description",
"Test Library Entity",
"Business Description"
],
"metadata": {
"url": ""
}
},
{
"dataRow": [
"Attributes",
"1",
"The number of attributes"
],
"metadata": {
"url": "/api/repositories/jupiter/library/entities/2/attributes"
}
},
{
"dataRow": [
"Business Rules",
"2",
"The number of business rules defined for this library"
],
"metadata": {
"url": "/api/repositories/jupiter/library/entities/2/businessrules"
}
},
{
"dataRow": [
"Created By",
"bob",
"User who created the library"
],
"metadata": {
"url": ""
}
},
{
"dataRow": [
"Date Created",
"2014/11/06 12:25:12",
"When the library was created"
],
"metadata": {
"url": ""
}
},
{
"dataRow": [
"Edited By",
"bob",
"The user who last edited the library"
],
"metadata": {
"url": ""
}
},
{
"dataRow": [
"Edited Date",
"2014/11/13 11:55:02",
"When the library was last edited"
],
"metadata": {
"url": ""
}
}
]
}
The metadata shown in the sample response could be represented as follows:
Metadata | Value | Description |
---|---|---|
ID | 2 | Internal entity reference |
Name | LibInput | The schema name for the library entity |
Description | Test Library Entity | Business Description |
Attributes | 1 | The number of attributes |
Business Rules | 2 | The number of business rules defined for this library |
Created By | bob | User who created the library |
Date Created | 2014/11/06 12:25:12 | When the library was created |
Edited By | bob | The user who last edited the library |
Edited Date | 2014/11/13 11:55:02 | When the library was last edited |
Commands¶
-
POST
/api/repositories/
(string: repository)/library/entities/
(int: libraryID)¶ Edit, associate or disassociate a library entity
JSON Parameters: - body – The request body
POST /api/repositories/jupiter/library/entities/2 HTTP/1.1
Content-Type: application/json
{
"command": "edit",
"data": {
"name": "Just one more change",
"description": "It's wafer thin..."
}
}
Response Code | Reason |
---|---|
204 | No error |
400 | Invalid request body |
400 | Invalid command |
400 | Invalid data passed with request |
400 | Error converting data to Tcl List |
500 | Server error |
The request requires a Standard Request packet. Available commands are:
Command | Description |
---|---|
edit | Edit a business rule |
disassociate | Disassociate a library entity from one or more real entities |
associate | Associate a library entity from one or more real entities |
promote | Promote rules from a real entity to a library entity |
import | Import one or more library entity business rules |
export | Export one or more library entities |
The request packet must contain the command
and data
elements. The options
element is not required.
See the Library Entity Commands for the contents of the request for each command.
Delete¶
-
DELETE
/api/repositories/
(string: repository)/library/entities/
(int: libraryID)¶ Delete a library entity
JSON Parameters: - body – The request body (optional)
DELETE /api/repositories/jupiter/library/entities/2 HTTP/1.1
Content-Type: application/json
{
"disassociate": ["2 1", "2 4"]
}
Response Code | Reason |
---|---|
204 | No error |
A delete request may have a body containing key-value pair identifying which entities are to be disassociated before the library entity is deleted. The value is an array; each element is a string containing the library entity ID and the entity ID to disassociate.
If a library entity is deleted without disassociating the entities, the business rules in each entity will also be deleted.
If the entities are disassociated, the business rules will not be deleted from the entities.
A list of entities that are associated with a library entity can be obtained using the Library Entity Associated Entities endpoint.