Create/update Profileset
/v1/profileset
Create or update Profileset
Maintain Profilesets
Example for calling:
http://server/v1/profileset
http://server/v1/profileset?owner=SAFRANSA
Request Body = {...} see request fields below
| Name | Type | Description | Notes |
|---|---|---|---|
| owner | string | Owner of the profileset to be updated | Related to Application Settings in Application Settings |
Allowed Methods:
[POST]
API Controller: Profileset
Description:
Create or update profileset is done in on single Web Service call with an indicator to specify Create or Update.
Request Fields:
| Name | Type | Description | Notes |
|---|---|---|---|
| create_profileset | create_profileset[] | collection of profileset to be created/updated | Head element not specified – see example |
create_profileset
| Name | Type | Description |
|---|---|---|
| RowID | integer | Identifying a row in this request that lines up with the response |
| ProfilesetAction | string | Specification of action: “C”reate, “U”pdate |
| UpdateIfExists | boolean | UpdateIfExists flag for Create |
| Profileset | Profileset | Profileset object (almost the same structure as GET object. The profile part consist of create_profile object) |
create_profile
| Name | Type | Description | Notes |
|---|---|---|---|
| Id | integer | Unique profile Id | |
| Name | string | The profile name | |
| ProfileInterval | object[] | See profileinterval | |
| RowID | integer | Identifying a row in this request that lines up with the response |
- When creating a new profileset, the following fields should be set:
- "ProfilesetAction" = Create
- "RowID" = 1
- "UpdateIfExists" = false
- "Name" = <Your Profileset name>
- "Owner" = <Owner of the Profileset>
- "Profile" = List of Profiles, or empty
- "Update if exists”
- When a create request is sent to the system, it checks whether the specified "Profileset" already exists..
- If the "Profileset" does not exist, it will be created.
- If "Profileset" does exist and "UpdateIfExists" = false, the system will return an error.
- If "Profileset" already exists and "UpdateIfExists" = true and the system will update the existing record.
- Update of existing records.
- When updating an existing record, the API checks whether the "Profileset" and "Profile" are currently in use:
- If not in use, the details will be updated.
- If in use and you are updating only the "Profileset", the update is blocked and an error is returned.
- If in use and you attempt to update an existing in use Profile, the update is blocked and an error is returned.
- If in use and you insert a new "Profile", the new "Profile" and any associated "Profile Interval" entries will be added.
- "Profile Interval"
- It is not permitted to add new interval to an in use profile, such will result in an error.
- It is possible to update value_y on existing profile intervals, identified by the Profileset_Id, Profile_Id and value_x.
- Other entries will always be attempted to be added. If a "Profile Interval" already exists, an error will be returned.
- When updating an existing record, the API checks whether the "Profileset" and "Profile" are currently in use:
Note
A profile is considered ‘In use’ if it is linked to one or more historical records.
Response Fields:
Create_Profileset_response[]
Collection of Create_Profileset_response objects
| Name | Type | Description | Notes |
|---|---|---|---|
| RowID | integer | Corresponds to the RowID in the request | |
| Result | byte | S(uccess) or F(ail) indicating if the requested action was successfully executed | |
| Message | string | Empty if success; error message if the requested action failed. | |
| MessageId | integer | MessageId: Identifies error message | |
| Profileset_Id | integer | Safran Profileset ID | |
| Profileset_Name | string | Safran Profileset Name | |
| Profile_Id | object[] | List of new or updated Profiles, see Create_Profile_Response |
Create_Profile_Response
| Name | Type | Description | Notes |
|---|---|---|---|
| RowID | integer | Corresponds to the RowID in the request | |
| Profile_Id | integer | New or updated Profile ID |
Sample Create Call and Response
Show Call Sample
json result
[
{
"rowid": 1,
"ProfilesetAction": "C",
"UpdateIfExists": false,
"name": "API Test Engine Maintenance",
"owner": "SAFRANSA",
"profile": [
{
"name": "Profile Test 1",
"rowid": 2,
"Profileinterval": [
{
"value_x": 1,
"value_y": 2
}
]
}
]
}
]
Show Response Sample
json result
[
{
"profileset_Id": 154,
"profileset_Name": "API Test Engine Maintenance 001",
"profile": [
{
"profile_Id": 1,
"rowid": 2
}
],
"rowid": 1,
"result": "S",
"message": "",
"messageId": 0
}
]