# Migration to v1
This guide explains how to migrate from v0 to v1, for the affected microservices.
# Changes across the services
# Querying for deleted items
GET endpoints that allow return of deleted items now have the following queries available:
show_active- a boolean flag (defaulttrue) to return non-deleted (i.e. active) items in the response bodyshow_deleted- a boolean flag (defaultfalse) to return deleted items in the response body.
By default, active items will be returned only.
To return deleted items only, request with show_deleted value true and show_active value false.
To return both active and deleted items, request with show_deleted value true.
Note: some endpoints contain the show_deleted query only, but the behaviour is the same.
# Pagination
Pagination has been added to several routes across the services. This is so large responses can be managed reasonably.
Pagination adds new queries to any paginated endpoints:
+ ?page_limit=int
+ ?before=base64
+ ?after=base64
Where not present before, new queries of order and sort_by will also be present on paginated endpoints:
+ ?sort_by=name
+ ?order=desc
Please see the documentation for more information on these queries.
The response bodies for paginated endpoints have also been updated with new keys:
+ paging: {
+ cursors: {
+ before: "MjUxYjYzNzAtNDk1MC1lNzExLTgxMDQtMDA1MDU2YjU3NDU5",
+ after: "OGExMTcxNzAtNDk1MC1lNzExLTgxMDQtMDA1MDU2YjU3NDU5"
+ },
+ previous: "http://ddb.arup.com/api/projects?before=MjUxYjYzNzAtNDk1MC1lNzExLTgxMDQtMDA1MDU2YjU3NDU5",
+ next: "http://ddb.arup.com/api/projects?after=MjUxYjYzNzAtNDk1MC1lNzExLTgxMDQtMDA1MDU2YjU3NDU5"
+ },
+ summary: {
+ estimate_count: 44
+ }
# Error messages
Client error responses no longer include the source key:
{
details: "id \"632f6133-c5c4-4232-bdb6-c1a227a48b8e\" could not be found",
msg: "Route Not Found",
- source: "body"
}
# Parameter Service
Please use these migration notes to help switch from v0 of the parameter-service-api to v1. This section should detail all the changes across the versions.
# Deprecated Endpoints
The following endpoints have been removed from v1:
# **GET /parameters/:parameter_id/revision**
replaced by new endpoint GET /entries/:entry_id/revisions (see below)
# **POST /parameters/:parameter_id/revision**
replaced by new endpoint PUT /entries (see below)
# **PATCH /parameters/:parameter_id/revision**
replaced by new endpoint PATCH /revisions (see below)
# Changes across endpoints
Please see below for the changes to each endpoint. This is structured in a similar way to the API documentation (opens new window) for ease of use.
Note: not all endpoints have had changes.
# Assets
# GET /assets
Pagination added. Please see the beginning section for more information.
Response body now includes
asset_type_idproperty in theasset_sub_typekey:asset_sub_type: { id: "a7154e9a-9dd4-4983-a900-c172a3366544", name: "Domestic Hot Water", + asset_type_id: "577cfd8d-8da0-4d78-b4a4-c81ab728d4bf", parent_asset_sub_type_id: "f2ac4d11-6854-4763-b26e-2b2c664390cb" }The
show_deleted_assetsquery has been replaced. Please see above section for more information- GET /assets?show_deleted_assets=true + GET /assets?show_deleted=true
# POST /assets
This endpoint now accepts one of
asset_type_idORasset_sub_type_idin the request body:- If you are providing
asset_sub_type_idthen thenamefield is optional and if left blank will be populated automatically to match theasset_sub_typename. - If you provide an
asset_type_idonly for an asset that hasasset_sub_typeproperty oftrue, you will receive an error if posting with anameproperty not matching one of the valid sub type names.
- If you are providing
The response body now includes
asset_type_idproperty in theasset_sub_typekey:asset_sub_type: { id: "a7154e9a-9dd4-4983-a900-c172a3366544", name: "Domestic Hot Water", + asset_type_id: "577cfd8d-8da0-4d78-b4a4-c81ab728d4bf", parent_asset_sub_type_id: "f2ac4d11-6854-4763-b26e-2b2c664390cb" }
# GET /assets/{asset_id}
The response body now includes
asset_type_idproperty in theasset_sub_typekey:asset_sub_type: { id: "a7154e9a-9dd4-4983-a900-c172a3366544", name: "Domestic Hot Water", + asset_type_id: "577cfd8d-8da0-4d78-b4a4-c81ab728d4bf", parent_asset_sub_type_id: "f2ac4d11-6854-4763-b26e-2b2c664390cb" }The
show_deleted_assetsquery has been replaced. Please see the above section for more information- GET /assets?show_deleted_assets=true + GET /assets?show_deleted=true
# GET /assets/{asset_ids}/hierarchy
Each
hierarchyobject in the response body now includes anasset_type_idkey:{ hierarchies: [ [ { id: "a3d5c386-9451-495e-9d3c-8ed152b1300f", name: "Wellington Place", + asset_type_id: "a3d5c386-9451-495e-9d3c-8ed152b1300f" } ] ] }
# Entries
An entry represents a value for a parameter. Entries can be revised. Currently, parameters are restricted to maximum of one entry. In future versions, parameters will have the capacity to have multiple entries. Please see the documentation (opens new window) for more information.
There are four new routes relating to entries:
# GET /entries
- This endpoint returns all entries, this is queryable by an array of
parameter_id's.
# PUT /entries
This endpoint replaces
POST /parameters/:parameter_id/revisionand lets you create or update one or more entries.This endpoint accepts an array of
entries. Required fields areentry_id,parameter_id,source_id,values. Currently,valueshas a maximum length of one. Optional additions arecommentandlocation_in_source.
# GET /entries/:entry_id/revisions
- This endpoint replaces
GET /parameters/:parameter_id/revision, and returns all revisions for a specifiedentry_id.
# PATCH /revisions
- This endpoint replaces the
PATCH /parameters/:parameter_id/revisionsendpoint and allows users to update thestatusof multiple revisions related to multiple different entries at once.- Users should only update the latest revision of an entry
- Users are required to specify the
revision_idof the revision to update - If users are updating the revision
statusto QA staterejectedacommentproperty is required.
# Parameter Sets
Note: Parameter Sets are in ALPHA release for testing. It is not recommended to use these routes in production.
The naming conventions for Parameter Sets has been altered from v0 to v1. Changes are as follows:
| v0 naming convention | v1 naming convention |
|---|---|
parameter_set_type | parameter_set_category |
parameter_set | parameter_set_type |
parameter_set_instance | parameter_set |
This has resulted in the update of routes in the following way:
| v0 route | v1 route |
|---|---|
GET /parameter_set_types | GET /parameter_set_categories |
GET /parameter_sets | GET /parameter_set_types |
POST /parameter_sets | POST /parameter_set_types |
DELETE /parameter_sets/:parameter_set_id | DELETE /parameter_set_types/:parameter_set_type_id |
POST /parameter_sets/:parameter_set_id/items | POST /parameter_set_types/:parameter_set_type_id/items |
DELETE //parameter_sets/:parameter_set_id/items/:item_type_id | DELETE /parameter_set_types/:parameter_set_type_id/items/:item_type_id |
GET /parameter_sets/:parameter_set_id/instances | GET /parameter_sets |
GET /parameter_sets/:parameter_set_id/instances/:instance_id | GET /parameter_sets/:parameter_set_id |
GET /parameter_sets/:parameter_set_id/instances/:instance_id/parameters | GET /parameter_sets/:parameter_set_id/parameters |
The keys on the response bodies have been updated in the relevant way. For example a request to GET /parameter_set_categories (previously known as GET /parameter_set_types) will return a response with:
{
- parameter_set_types: [ ... ]
+ parameter_set_categories: [ ... ]
}
All endpoints should behave in a similar way (excluding endpoints detailed below).
# GET /parameter_sets
This endpoint replaces v0 endpoint GET /parameter_sets/:parameter_set_id/instances. To filter parameter sets by the relevant parameter_set_type_id this is passed in through a query on the endpoint:
+ GET /parameter_sets?parameter_set_type_id=uuid
This will return all parameter_sets of the specified parameter_set_type_id.
# GET /parameter_sets/:parameter_set_id/parameters
This endpoint contains a reduced response compared to the v0 version (GET /parameter_sets/:parameter_set_id/instances/:instance_id/parameters):
{
- parameter_set_instance_parameters: [
+ parameter_set_parameters: [
{
...parameter,
parameter_type: {
id,
name,
data_type,
global_parameter,
- unit_type_id,
- created_at,
- deleted_at,
- updated_at
},
parents: [
{
id,
asset_sub_type,
children,
name,
parent,
asset_type: {
id,
name,
parent_id,
- asset_sub_type,
- asset_type_group,
- created_at,
- deleted_at,
},
- project_id,
- deleted_at,
}
]
}
],
... rest
}
# Parameters
# GET /parameters
Pagination added. Please see the beginning section for more information.
The
show_deleted_parametersquery has been replaced. Please see the above section for more information- GET /parameters?show_deleted_parameters=true + GET /assets?show_deleted=trueThe
offsetquery has been removed:- GET /parameters?offset=The
revisionkey in the response body has been renamed toselected_entry:{ parameters: [ { ... parameter, - revision: { ... } + selected_entry: { ... } }, ... ] }The
selected_entry.sourcekey contains a reduced responsesource: { id: "286a550e-00bc-4b1e-8e20-71f96b43e9c6", created_at: "2022-07-18T16:00:53.182Z", - updated_at: "2022-07-18T16:00:53.182Z", - deleted_at: null, - time: null, date_day: "15", date_month: "1", date_year: "2021", reference: "Assumption", - reference_id: "90803033-268a-ea11-8129-005056b50c57", - reference_table: "project", - reference_url: "dev.ddb.arup.com/api/project", - scope: "90803033-268a-ea11-8129-005056b50c57", title: "Assumption", url: "TBA", source_type: { id: "6a1292c7-a245-41cf-8872-46feb9a7fd11", name: "Assumption", - visible: true, - deleted_at: null } }The
selected_entry.created_bykey contains a reduced responsecreated_by: { - staff_id: 12345, staff_name: "Arup Employee Name", email: "[email protected]", - company_centre_arup_unit: "01-462 NOR Digital Services", - location_name: "Edinburgh Office", - grade_level: 3, - my_people_page_url: "https://arup-my.sharepoint.com/PersonImmersive.aspx?accountname=i:0%83.f%7cmembership%[email protected]" },The
selected_entrykey does not have anupdated_at,commentorlocation_in_sourceproperty.
# POST /parameters
- The
revisionkey in the request body has been replaced withentries, which accepts an array.- There is an optional
entry_idkey in theentriespost body:- If you are adding a NEW entry to an unanswered parameter, this can be left empty and will automatically populate with an new uuid.
- If you are wanting to REVISE an answered parameter, you must provide the existing
entry_idto revise.
- There is an optional
This is currently limited to one item in the entries property only.
- The
revisionkey in the POST response body is now renamed toselected_entry- revision: { ... } + selected_entry: { ... }
# GET /parameters/{parameter_id}
The
show_deleted_parametersquery has been replaced. Please see the above section for more information- GET /parameters/:parameter_id?show_deleted_parameters=true + GET /parameters/:parameter_id?show_deleted=trueThe
revisionkey in the response body has been renamed toselected_entry- revision: { ... } + selected_entry: { ... }The
selected_entry.sourcekey contains a reduced responsesource: { id: "286a550e-00bc-4b1e-8e20-71f96b43e9c6", created_at: "2022-07-18T16:00:53.182Z", - updated_at: "2022-07-18T16:00:53.182Z", - deleted_at: null, - time: null, date_day: "15", date_month: "1", date_year: "2021", reference: "Assumption", - reference_id: "90803033-268a-ea11-8129-005056b50c57", - reference_table: "project", - reference_url: "dev.ddb.arup.com/api/project", - scope: "90803033-268a-ea11-8129-005056b50c57", title: "Assumption", url: "TBA", source_type: { id: "6a1292c7-a245-41cf-8872-46feb9a7fd11", name: "Assumption", - visible: true, - deleted_at: null } }The
selected_entry.created_bykey contains a reduced responsecreated_by: { - staff_id: 12345, staff_name: "Arup Employee Name", email: "[email protected]", - company_centre_arup_unit: "01-462 NOR Digital Services", - location_name: "Edinburgh Office", - grade_level: 3, - my_people_page_url: "https://arup-my.sharepoint.com/PersonImmersive.aspx?accountname=i:0%83.f%7cmembership%[email protected]" },The
selected_entrykey does not have anupdated_at,commentorlocation_in_sourceproperty.
# Tree
There are several new endpoint to return tree hierarchies. Please see the documentation (opens new window) for more information on these endpoints.
# GET /asset_tree
- New endpoint that returns an asset tree by
asset_id.
# GET /asset_type_tree
- New endpoint that returns an asset type tree by
asset_type_id.
# Types
# GET /asset_type_groups
- Pagination added. Please see the beginning section for more information.
# GET /asset_types
- Pagination added. Please see the beginning section for more information.
# GET /asset_types/{asset_type_id}/asset_sub_types
- Pagination added. Please see the beginning section for more information.
# GET /parameter_types
Pagination added. Please see the beginning section for more information.
The
namekey on thedefault_unitproperty in the response body has been renamed tosymbol:default_unit: { id: "b39e5bcf-cda6-49ed-8c0c-174d8daf8bc1", - name: "°C", + symbol: "°C", unit_type_id: "5391cd71-08f0-44f8-9dd2-6379a511dd29", unit_system_id: "50115948-140f-48fc-b5f2-c56e96869734" }
# GET /item_types
Pagination added. Please see the beginning section for more information.
The
offsetquery has been removed.
# GET /unit_types
Pagination added. Please see the beginning section for more information.
Each
unit_typeobject has a newunit_systemskey, containing the unit systems and units that are available to that particular typeunit_types: [ { id: "e8c3da00-5c20-45f1-a24c-0d657bcae032", name: "Geotechnics analysis material type", created_at: "2022-06-24T12:26:00.263Z", updated_at: "2022-06-24T12:26:00.263Z", deleted_at: null, + unit_systems: [ + { + id: "5508a780-9f9f-4e6d-bc9c-a84607a5ba87", + name: "Drop-down list", + short_name: "Drop-down", + units: [ + { + id: "892c32c1-808a-440a-8290-e05fdf5457ba", + symbol: "Mohr-coulomb, linear-elastic" + } + ] + } + ] } ]
# POST /unit_types
- The
unit_typesresponse body for the POST method has been updated in the same way as theGET /unit_types- please refer to this section for details.
# GET /unit_types/:unit_type_id
- The
unit_typeobject response body now includescreated_at,updated_atanddeleted_atkeys:
unit_type: {
id: "38f045f3-ce7a-4a38-9fe7-f9d72d07a129",
name: "Area",
+ created_at: "2021-12-22T13:07:17.214Z",
+ updated_at: "2021-12-22T13:07:17.214Z",
+ deleted_at: null,
unit_systems: [ ... ]
}
# Units
# GET /units
Pagination added. Please see the beginning section for more information.
The
namekey in the response body has been renamed tosymbol:{ id: "a3d5c386-9451-495e-9d3c-8ed152b1300f", created_at: "2019-05-10T13:45:08.000Z", deleted_at: "2020-06-18T11:25:21.000Z", - name: "m", + symbol: "m", updated_at: "2020-06-12T13:39:41.000Z", unit_type_id: "7a857f03-a222-405c-bc03-90d6dcaa8e0e", unit_system_id: "50115948-140f-48fc-b5f2-c56e96869734" }
# POST /units
The request body no longer accepts a
namefield. This should now besymbol:{ id: "cdbcb4d1-b6c1-436c-8126-737c29c9b2f4", - name: "°F", + symbol: "°F", unit_type_id: "b68caf97-e537-4ce4-b3bd-7131f0e72e93", unit_system_id: "50115948-140f-48fc-b5f2-c56e96869734" }
# GET /unit_systems
- Pagination added. Please see the beginning section for more information.
# Parameter Metadata Service
Please use these migration notes to help switch from v0 of the parameter-metadata-service-api to v1. This document should detail all the changes across the versions.
# Deprecated Endpoints
Please note that all endpoints in v0 of the API are being deprecated so users must upgrade to the next available version
# Changes across endpoints
Please see below for the changes to each endpoint. This is structured in a similar way to the API documentation (opens new window) for ease of use.
Note: not all endpoints have had changes.
# Allow Custom
allow_customis a new key in the response body for alltag_typeobjects returned endpoints. This property signifies if atag_typeaccepts custom tags or not using a boolean value oftrueorfalse.tag_type: { id: "1e08965a-f116-4a6d-8bba-74290edc8c0a", created_at: "2019-05-10T13:45:08.000Z", deleted_at: "2019-05-10T13:45:08.000Z", name: "Calculation", updated_at: "2019-05-10T13:45:08.000Z", + allow_custom: false }
# Tag
# GET /tags
Pagination added. Please see the beginning section for more information.
New queries added for retrieving deleted tags. Please see above section for more information.
The
item_limitquery has been replaced by thepage_limitquery as part of pagination.There is a new query available for
tag_scope, this can be one or moreproject_id's and will return all tags with the giventag_scope. An empty (null) query string filters for all tags with no scope, i.e. global tags.There is a new query available for
omit_global(bool). If true, this omits all global tags (those withtag_scope = null) from the result. The default value for this query isfalse.The
tag_typeobject in the response body for atagnow includes a new key ofallow_custom. Please see this section for more information.
# POST /tags
- This is a new endpoint that allows users to add a new tag.
- Any user can post a custom tag that is scoped to a project (i.e. a tag that has
tag_typewith propertyallow_custom: trueandtag_scope: your-project-uuid). Posting global tags requires Admin privileges.
# GET /tags/:tag_id
- The
tag_typeobject in the response body now includes a new key ofallow_custom. Please see this section for more information.
# PATCH /tags/:tag_id
- This is a new endpoint that allows you to update a tag
nameproperty. - This endpoint requires Admin privileges.
# DELETE /tags/:tag_id
- This is a new endpoint that allows you to delete a tag by
tag_id. - This endpoint requires Admin privileges.
# Tag Links
# GET /tags/:tag_id/links
Pagination added. Please see the beginning section for more information.
New queries added for retrieving deleted tag links. Please see above section for more information.
# GET /tags/:tag_id/links/:reference_id
- This is a new endpoint for users to get an existing tag link between resources.
# PATCH /tags/{tag_id}/links/{reference_id}
- This is a new endpoint to update a links
reference_tableand/orreference_urlbetween a tag and reference.
# PUT /tag_links
- This is a new endpoint that allows users to put new and/or update existing
tag_link's.
# Tag Type
# GET /tag_types
Pagination added. Please see the beginning section for more information.
New queries added for retrieving deleted tag types. Please see above section for more information.
The
tag_typeobjects in the response body now include a new key ofallow_custom. Please see this section for more information.
# POST /tag_types
- This is a new endpoint that lets you add a new
tag_type. - This endpoint requires Admin privileges.
# GET /tag_types/:tag_type_id
- The
tag_typeobject in the response body now include a new key ofallow_custom. Please see this section for more information.
# PATCH /tag_types/{tag_type_id}
- This is a new endpoint that allows users to updates a single
tag_type.
Note: This endpoint requires admin privileges.
# DELETE /tag_types/{tag_type_id}
- New endpoint that deletes a single tag type using the
tag_type_idas a required query - This endpoint requires Admin privileges.
# Environment Context Service
Please use these migration notes to help switch from v0 of the Environmental-Context-Service-api to v1. This document should detail all the changes across the versions.
# Deprecated Endpoints
Please note that all endpoints in v0 of this API are being deprecated so users must upgrade to the next available version