Skip to content

Commit

Permalink
[MNT-24127] Added Endpoint to Calculate the Folder Size. (#215)
Browse files Browse the repository at this point in the history
[feature/MNT-24127-AddedEndpointToCalculateTheFolderSize] Swagger endpoints to calculate and retrieve folder size details
  • Loading branch information
mohit-singh4 authored Nov 8, 2024
1 parent 7629c5d commit 5f41f6e
Showing 1 changed file with 128 additions and 3 deletions.
131 changes: 128 additions & 3 deletions src/main/webapp/definitions/alfresco-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ parameters:
description: The identifier of a target node.
required: true
type: string
jobIdParam:
name: jobId
in: path
description: The identifier of a job.
required: true
type: string
nodeFolderIdParam:
name: nodeId
in: path
Expand Down Expand Up @@ -2198,6 +2204,83 @@ paths:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/nodes/{nodeId}/size-details':
post:
tags:
- nodes
summary: Accepts request to generate Node Size Details
description: |
This may be executed against a node specified by **nodeId** and this nodeId must be a valid node ID.
Furthermore, this POST endpoint will be executed **asynchronously** with a `202` HTTP response signifying that
the request has been accepted successfully.
The response body will include the ```jobId``` of the pending/completed action.
operationId: getNodeSizeDetailsRequest
produces:
- application/json
parameters:
- $ref: '#/parameters/nodeTargetIdParam'
responses:
'202':
description: Request Accepted
schema:
$ref: '#/definitions/sizeDetailsRequestResultEntry'
'401':
description: Authentication failed
'403':
description: Current user does not have permission for **nodeId**
'404':
description: |
**nodeId** or **folderId** does not exist
'422':
description: |
Invalid parameter: value of **nodeId** is invalid
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/nodes/{nodeId}/size-details/{jobId}':
get:
tags:
- nodes
summary: Get the result of a background job to get the size of a node.
description: |
***Receiving the size***
This endpoint takes ```nodeId``` and ```jobId``` as the path parameters and returns the result after executing above GET request.
The size details job can be in one of three states:
```
NOT-INITIATED: Not Initiated yet.
IN-PROGRESS: Calculation is in progress.
COMPLETED: Calculation has been done.
```
operationId: getNodeSizeDetails
produces:
- application/json
parameters:
- $ref: '#/parameters/nodeTargetIdParam'
- $ref: '#/parameters/jobIdParam'
responses:
'200':
description: Successful Response
schema:
$ref: '#/definitions/getNodeSizeDetailsResponse'
'401':
description: Authentication failed
'403':
description: Current user does not have permission for **nodeId**
'404':
description: |
**nodeId** or **jobId** does not exist
'422':
description: |
Invalid parameter: value of **nodeId** is invalid
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/nodes/{nodeId}/renditions':
post:
x-alfresco-since: "5.2"
Expand Down Expand Up @@ -2484,7 +2567,6 @@ paths:
description: Unexpected error
schema:
$ref: '#/definitions/Error'

'/nodes/{nodeId}/secondary-children':
post:
x-alfresco-since: "5.2"
Expand Down Expand Up @@ -4434,7 +4516,7 @@ paths:
**nodeId** does not exist
'412':
description: |
Content is archived and is inaccessible
Content is archived and is inaccessible
'501':
description: The actual ContentStore implementation can't fulfil this request
default:
Expand Down Expand Up @@ -8582,7 +8664,7 @@ paths:
parameters:
- $ref: '#/parameters/auditApplicationIdParam'
- $ref: '#/parameters/skipCountParam'
- $ref: '#/parameters/omitTotalItemsParam'
- $ref: '#/parameters/omitTotalItemsParam'
- $ref: '#/parameters/orderByParam'
- $ref: '#/parameters/maxItemsParam'
- name: where
Expand Down Expand Up @@ -10690,6 +10772,34 @@ definitions:
$ref: '#/definitions/PermissionsInfo'
definition:
$ref: '#/definitions/Definition'
getNodeSizeDetailsResponse:
type: object
properties:
id:
type: string
description: Provides the nodeId for which POST/size-details has been initiated.
sizeInBytes:
type: string
description: The folder size in bytes.
calculatedAt:
type: string
description: Provides the timestamp when the calculation of folder size is completed.
numberOfFiles:
type: integer
description: Provides the number of files in the folder.
status:
type: string
description: |
Provides a status that signifies the completion of the calculateSize mechanism.
```
NOT-INITIATED: Not Initiated yet.
IN-PROGRESS: Calculation is in progress.
COMPLETED: Calculation has been done.
```
jobId:
type: string
description: Provides the getId for which POST/size-details has been initiated.
ProbeEntry:
type: object
required:
Expand Down Expand Up @@ -11298,6 +11408,21 @@ definitions:
id:
type: string
description: The unique identifier of the action pending execution
sizeDetailsRequestResultEntry:
type: object
required:
- entry
properties:
entry:
$ref: '#/definitions/sizeDetailsRequestExecResult'
sizeDetailsRequestExecResult:
type: object
required:
- jobId
properties:
jobId:
type: string
description: The unique identifier of the size details execution request
Definition:
properties:
properties:
Expand Down

0 comments on commit 5f41f6e

Please sign in to comment.