Skip to content

Commit e5666d7

Browse files
committed
Updated API from documentation release
1 parent d0ab341 commit e5666d7

16 files changed

+273
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"results": [
3+
{
4+
"id": "e41337a0-ea96-4ddc-a9a4-d267976f21e0",
5+
"relevance": 0.9264881
6+
},
7+
{
8+
"id": "05cd5998-015c-4232-8943-ff8a1880bcbc",
9+
"relevance": 0.6989829
10+
},
11+
{
12+
"id": "09c3c5a2-6569-49dd-b021-af5de4cf4b02",
13+
"relevance": 0.6989829
14+
}
15+
],
16+
"limit": 100,
17+
"offset": 0,
18+
"total": 3
19+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"status": "Indexing",
3+
"states": {
4+
"indexed": 43242,
5+
"failed": 0,
6+
"estimatedTotal": 100000
7+
},
8+
"startedAt": "2023-08-15T12:56:07.89Z",
9+
"retryCount": 2,
10+
"lastModifiedAt": "2023-08-15T12:56:07.89Z"
11+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"query": {
3+
"fullText": {
4+
"field": "all",
5+
"value": "plumbing"
6+
}
7+
}
8+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"action": "changeBusinessUnitSearchStatus",
3+
"status": "Activated"
4+
}

api-specs/api/resources/business-units.raml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,44 @@ post:
100100
body:
101101
application/json:
102102
example: !include ../examples/business-unit.example.json
103+
/search:
104+
type: base
105+
displayName: Business Unit Search
106+
description: |
107+
This endpoint provides high-performance search queries over Business Units.
108+
post:
109+
displayName: Search Business Units
110+
securedBy: [oauth_2_0: { scopes: ['view_business_units:{projectKey}'] }]
111+
description: |
112+
If the initial indexing is in progress or the feature is inactive, A [SearchNotReady](ctp:api:type:SearchNotReadyError) error is returned. If inactive, you can [reactivate](/../api/projects/business-unit-search#reactivate) it.
113+
body:
114+
application/json:
115+
type: BusinessUnitSearchRequest
116+
responses:
117+
200:
118+
body:
119+
application/json:
120+
type: BusinessUnitPagedSearchResponse
121+
head:
122+
securedBy: [oauth_2_0: { scopes: ['view_business_units:{projectKey}'] }]
123+
description: |
124+
Checks whether a search index of Business Units exists for a Project.
125+
Returns a `200 OK` if an index exists; otherwise, returns a `409 Conflict`.
126+
responses:
127+
200:
128+
description: A search index exists and the [Search Business Units](ctp:api:endpoint:/{projectKey}/business-units/search:POST) endpoint is fully operational.
129+
409:
130+
description: A search index does not exist and the [Search Business Units](ctp:api:endpoint:/{projectKey}/business-units/search:POST) endpoint returns a 409 error.
131+
/search/indexing-status:
132+
type: base
133+
displayName: Business Unit Search Status
134+
get:
135+
displayName: Business Unit Search Status
136+
description: |
137+
Returns the indexing status of the Business Unit Search for a Project.
138+
securedBy: [oauth_2_0: { scopes: ['view_project_settings:{projectKey}'] }]
139+
responses:
140+
200:
141+
body:
142+
application/json:
143+
type: BusinessUnitSearchIndexingStatusResponse
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#%RAML 1.0 DataType
2+
(package): BusinessUnitSearch
3+
type: object
4+
(beta): true
5+
displayName: BusinessUnitIndexingProgress
6+
properties:
7+
indexed:
8+
type: number
9+
format: int32
10+
description: The number of Business Units successfully indexed.
11+
failed:
12+
type: number
13+
format: int32
14+
description: The number of Business Units that failed to be indexed.
15+
estimatedTotal:
16+
type: number
17+
format: int32
18+
description: The estimated total number of Business Units to be indexed.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#%RAML 1.0 DataType
2+
(package): Project
3+
type: string
4+
(beta): true
5+
displayName: BusinessUnitIndexingStatus
6+
description: |
7+
The current indexing status of Business Unit Search.
8+
(enumDescriptions):
9+
Scheduled: Indexing is scheduled.
10+
Indexing: Indexing is in progress.
11+
Ready: Indexing is complete and the [Search Business Units](ctp:api:endpoint:/{projectKey}/business-units/search:POST) endpoint returns up-to-date results.
12+
Failed: Indexing failed due to an internal error.
13+
enum:
14+
- Scheduled
15+
- Indexing
16+
- Ready
17+
- Failed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#%RAML 1.0 DataType
2+
(package): BusinessUnitSearch
3+
displayName: BusinessUnitPagedSearchResponse
4+
example: !include ../../examples/BusinessUnitSearch/BusinessUnitPagedSearchResponse.json
5+
type: object
6+
(beta): true
7+
properties:
8+
total:
9+
type: number
10+
format: int64
11+
minimum: 0
12+
description: Total number of results matching the query.
13+
limit:
14+
type: number
15+
format: int32
16+
minimum: 0
17+
maximum: 100
18+
description: |
19+
Number of [results requested](/../api/general-concepts#limit).
20+
offset:
21+
type: number
22+
format: int32
23+
minimum: 0
24+
maximum: 9900
25+
description: |
26+
Number of [elements skipped](/../api/general-concepts#offset).
27+
results:
28+
type: BusinessUnitSearchResult[]
29+
description: |
30+
Search result containing the Business Units matching the search query.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#%RAML 1.0 DataType
2+
(package): BusinessUnitSearch
3+
displayName: BusinessUnitSearchIndexingStatusResponse
4+
type: object
5+
(beta): true
6+
example: !include ../../examples/BusinessUnitSearch/BusinessUnitSearchIndexingStatusResponse.json
7+
properties:
8+
status:
9+
type: BusinessUnitIndexingStatus
10+
description: Current status of indexing the Business Unit Search.
11+
states?:
12+
type: BusinessUnitIndexingProgress
13+
description: Progress of indexing. Only available when indexing is in progress.
14+
startedAt?:
15+
type: datetime
16+
description: Date and time (UTC) when the last indexing started.
17+
lastModifiedAt?:
18+
type: datetime
19+
description: Time when the status was last modified.
20+
retryCount?:
21+
type: number
22+
format: int32
23+
description: |
24+
Indicates how many times the system tried to start indexing after failed attempts. The counter is set to null after an indexing finished successfully.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#%RAML 1.0 DataType
2+
(package): BusinessUnitSearch
3+
type: object
4+
(beta): true
5+
example: !include ../../examples/BusinessUnitSearch/BusinessUnitSearchRequest.json
6+
displayName: BusinessUnitSearchRequest
7+
properties:
8+
query?:
9+
type: SearchQuery
10+
description: The Business Unit Search query.
11+
sort?:
12+
type: SearchSorting[]
13+
description: Controls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order.
14+
limit?:
15+
type: number
16+
format: int32
17+
default: 20
18+
maximum: 100
19+
description: The maximum number of search results to be returned.
20+
offset?:
21+
type: number
22+
format: int32
23+
default: 0
24+
maximum: 9900
25+
description: The number of search results to be skipped in the response for pagination.

0 commit comments

Comments
 (0)