# Migration to v1
This guide explains how to migrate from v0 to v1, for the affected microservices.
# Thay đổi trên các dịch vụ
# Truy vấn cho các mục đã xóa
Nhận các điểm cuối cho phép trả về các mục đã xóa hiện có sẵn các truy vấn sau:
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.
Theo mặc định, các mục hoạt động sẽ chỉ được trả lại.
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.
# Phân trang
Phân trang đã được thêm vào một số tuyến đường trên các dịch vụ. Đây là những phản hồi lớn có thể được quản lý một cách hợp lý.
Phân phân thêm các truy vấn mới vào bất kỳ điểm cuối được phân trang nào:
+ ?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
Vui lòng xem tài liệu để biết thêm thông tin về các truy vấn này.
Các cơ quan phản hồi cho các điểm cuối được phân trang cũng đã được cập nhật với các khóa mới:
+ 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
+ }
# Thông báo lỗi
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"
}
# Dịch vụ tham số
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.
# Điểm cuối không dùng nữa
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)
# Thay đổi trên các điểm cuối
Vui lòng xem bên dưới để biết các thay đổi cho mỗi điểm cuối. Điều này được cấu trúc theo cách tương tự như Tài liệu API (opens new window) Để dễ sử dụng.
Lưu ý: Không phải tất cả các điểm cuối đã có thay đổi.
# Tài sản
# GET /assets
- Phân phân thêm. Vui lòng xem phần bắt đầu để biết thêm thông tin.
- Response body now includes
asset_type_id
property in theasset_sub_type
key:
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_assets
query has been replaced. Please see phần trên for more information
- GET assets?show_deleted_assets=true
+ GET assets?show_deleted=true
# POST /assets
- This endpoint now accepts one of
asset_type_id
ORasset_sub_type_id
in the request body: - If you are providing
asset_sub_type_id
then thename
field is optional and if left blank will be populated automatically to match theasset_sub_type
name. - If you provide an
asset_type_id
only for an asset that hasasset_sub_type
property oftrue
, you will receive an error if posting with aname
property not matching one of the valid sub type names. - The response body now includes
asset_type_id
property in theasset_sub_type
key:
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_id
property in theasset_sub_type
key:
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_assets
query has been replaced. Please see the phần trên for more information
- GET assets?show_deleted_assets=true
+ GET assets?show_deleted=true
# GET /assets/{asset_ids}/hierarchy
- Each
hierarchy
object in the response body now includes anasset_type_id
key:
{
hierarchies: [
[
{
id: "a3d5c386-9451-495e-9d3c-8ed152b1300f",
name: "Wellington Place",
+ asset_type_id: "a3d5c386-9451-495e-9d3c-8ed152b1300f"
}
]
]
}
# Mục
Một mục biểu thị một giá trị cho một tham số. Mục nhập có thể được sửa đổi. Hiện tại, các tham số được giới hạn ở mức tối đa của một mục. Trong các phiên bản trong tương lai, các tham số sẽ có khả năng có nhiều mục. Vui lòng xem tài liệu (opens new window) để biết thêm thông tin.
Có bốn tuyến đường mới liên quan đến các mục:
# 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/revision
and 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,values
has a maximum length of one. Optional additions arecomment
andlocation_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/revisions
endpoint and allows users to update thestatus
of multiple revisions related to multiple different entries at once. - Người dùng chỉ nên cập nhậtmuộn nhấtSửa đổi một mục nhập
- Users are required to specify the
revision_id
of the revision to update - If users are updating the revision
status
to QA staterejected
acomment
property is required.
# Bộ tham số
LƯU Ý: Các bộ tham số đang trong bản phát hành alpha để kiểm tra. Không nên sử dụng các tuyến đường này trong sản xuất.
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 |
Điều này đã dẫn đến việc cập nhật các tuyến theo cách sau:
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: [ ... ]
}
Tất cả các điểm cuối nên hoạt động theo cách tương tự (không bao gồm các điểm cuối chi tiết bên dưới).
# 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
}
# Thông số
# GET /parameters
- Phân phân thêm. Vui lòng xem phần bắt đầu để biết thêm thông tin.
- The
show_deleted_parameters
query has been replaced. Please see the phần trên để biết thêm thông tin
- GET /parameters?show_deleted_parameters=true
+ GET /assets?show_deleted=true
- The
offset
query has been removed:
- GET /parameters?offset=
- The
revision
key in the response body has been renamed toselected_entry
:
{
parameters: [
{
... parameter,
- revision: { ... }
+ selected_entry: { ... }
},
...
]
}
- The
selected_entry.source
key contains a reduced response
source: {
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_by
key contains a reduced response
created_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_entry
key does not have anupdated_at
,comment
orlocation_in_source
property.
# POST /parameters
- The
revision
key in the request body has been replaced withentries
, which accepts an array. - There is an optional
entry_id
key in theentries
post body:- Nếu bạn đang thêm một mục nhập mới vào mộtchưa được trả lờiTham số, điều này có thể bị bỏ trống và sẽ tự động điền với UUID mới.
- Nếu bạn đang muốn sửa đổi mộttrả lời parameter, you must provide the existing
entry_id
to revise.
This is currently limited to one item in the entries
property only.
- The
revision
key in the POST response body is now renamed toselected_entry
- revision: { ... }
+ selected_entry: { ... }
# GET /parameters/{parameter_id}
- The
show_deleted_parameters
query has been replaced. Please see the phần trên để biết thêm thông tin
- GET /parameters/:parameter_id?show_deleted_parameters=true
+ GET /parameters/:parameter_id?show_deleted=true
- The
revision
key in the response body has been renamed toselected_entry
- revision: { ... }
+ selected_entry: { ... }`
- The
selected_entry.source
key contains a reduced response
source: {
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_by
key contains a reduced response
created_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_entry
key does not have anupdated_at
,comment
orlocation_in_source
property.
# Cây
Có một số điểm cuối mới để trả lại hệ thống phân cấp cây. Vui lòng xem tài liệu (opens new window) Để biết thêm thông tin về các điểm cuối này.
# 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
.
# Loại
# GET /asset_type_groups
- Phân phân thêm. Vui lòng xem phần bắt đầu để biết thêm thông tin.
# GET /asset_types
- Phân phân thêm. Vui lòng xem phần bắt đầu để biết thêm thông tin.
# GET /asset_types/{asset_type_id}/asset_sub_types
- Phân phân thêm. Vui lòng xem phần bắt đầu để biết thêm thông tin.
# GET /parameter_types
- Phân phân thêm. Vui lòng xem phần bắt đầu để biết thêm thông tin.
- The
name
key on thedefault_unit
property 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
- Phân phân thêm. Vui lòng xem phần bắt đầu để biết thêm thông tin.
- The
offset
query has been removed.
# GET /unit_types
- Phân phân thêm. Vui lòng xem phần bắt đầu để biết thêm thông tin.
- Each
unit_type
object has a newunit_systems
key, containing the unit systems and units that are available to that particular type
unit_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_types
response 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_type
object response body now includescreated_at
,updated_at
anddeleted_at
keys:
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: [ ... ]
}
# Các đơn vị
# GET /units
- Phân phân thêm. Vui lòng xem phần bắt đầu để biết thêm thông tin.
- The
name
key 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
name
field. 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
- Phân phân thêm. Vui lòng xem phần bắt đầu để biết thêm thông tin.
# Dịch vụ siêu dữ liệu tham số
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.
# Điểm cuối không dùng nữa
Please note that all endpoints in v0 of the API are being deprecated so users must upgrade to the next available version
# Thay đổi trên các điểm cuối
Vui lòng xem bên dưới để biết các thay đổi cho mỗi điểm cuối. Điều này được cấu trúc theo cách tương tự như Tài liệu API (opens new window) Để dễ sử dụng.
Lưu ý: Không phải tất cả các điểm cuối đã có thay đổi.
# Allow Custom
allow_custom
is a new key in the response body for alltag_type
objects returned endpoints. This property signifies if atag_type
accepts custom tags or not using a boolean value oftrue
orfalse
.
{
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
}
# Nhãn
# GET /tags
- Phân phân thêm. Vui lòng xem phần bắt đầu để biết thêm thông tin.
- Các truy vấn mới được thêm vào để truy xuất các thẻ đã xóa. Vui lòng xem phần trên để biết thêm thông tin.
- The
item_limit
query has been replaced by thepage_limit
query 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_type
object in the response body for atag
now includes a new key ofallow_custom
. Please see Phần này để biết thêm thông tin.
# POST /tags
- Đây là điểm cuối mới cho phép người dùng thêm một thẻ mới.
- Any user can post a custom tag that is scoped to a project (i.e. a tag that has
tag_type
with propertyallow_custom: true
andtag_scope: your-project-uuid
). Posting global tags requires Admin privileges.
# GET /tags/:tag_id
- The
tag_type
object in the response body now includes a new key ofallow_custom
. Please see Phần này để biết thêm thông tin.
# PATCH /tags/:tag_id
- This is a new endpoint that allows you to update a tag
name
property. - Điểm cuối này yêu cầu các đặc quyền quản trị viên.
# DELETE /tags/:tag_id
- This is a new endpoint that allows you to delete a tag by
tag_id
. - Điểm cuối này yêu cầu các đặc quyền quản trị viên.
# Liên kết thẻ
# GET /tags/:tag_id/links
- Phân phân thêm. Vui lòng xem phần bắt đầu để biết thêm thông tin.
- Các truy vấn mới được thêm vào để truy xuất các liên kết thẻ đã xóa. Vui lòng xem phần trên để biết thêm thông tin.
# GET /tags/:tag_id/links/:reference_id
- Đây là điểm cuối mới để người dùng có được liên kết thẻ hiện có giữa các tài nguyên.
# PATCH /tags/{tag_id}/links/{reference_id}
- This is a new endpoint to update a links
reference_table
and/orreference_url
between 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.
# Loại thẻ
# GET /tag_types
- Phân phân thêm. Vui lòng xem phần bắt đầu để biết thêm thông tin.
- Các truy vấn mới được thêm vào để truy xuất các loại thẻ đã xóa. Vui lòng xem phần trên để biết thêm thông tin.
- The
tag_type
objects in the response body now include a new key ofallow_custom
. Please see Phần này để biết thêm thông tin.
# POST /tag_types
- This is a new endpoint that lets you add a new
tag_type
. - Điểm cuối này yêu cầu các đặc quyền quản trị viên.
# GET /tag_types/:tag_type_id
- The
tag_type
object in the response body now include a new key ofallow_custom
. Please see Phần này để biết thêm thông tin.
# PATCH /tag_types/{tag_type_id}
- This is a new endpoint that allows users to updates a single
tag_type
.
*Lưu ý: Điểm cuối này yêu cầu các đặc quyền quản trị viên. *
# DELETE /tag_types/{tag_type_id}
- New endpoint that deletes a single tag type using the
tag_type_id
as a required query - Điểm cuối này yêu cầu các đặc quyền quản trị viên.
# Dịch vụ bối cảnh môi trường
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.
# Điểm cuối không dùng nữa
Please note that all endpoints in v0 of this API are being deprecated so users must upgrade to the next available version