Skip to content

Commit

Permalink
Merge pull request #13574 from BLasan/sequence-as-backend
Browse files Browse the repository at this point in the history
Add: Sequence Backend Test
  • Loading branch information
Krishanx92 authored Dec 19, 2024
2 parents 3fdc9d9 + 6551797 commit 8676e83
Show file tree
Hide file tree
Showing 8 changed files with 1,226 additions and 78 deletions.
425 changes: 425 additions & 0 deletions modules/integration/tests-common/clients/publisher/api/openapi.yaml

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,194 @@ paths:
- apim:api_create
- apim:api_manage
- apim:api_import_export
/apis/{apiId}/sequence-backend/{type}/content:
get:
tags:
- APIs
summary: Get Sequence of Custom Backend
description: This operation can be used to get Sequence of the Custom Backend
operationId: getSequenceBackendContent
parameters:
- name: type
in: path
description: |
Type of the Endpoint.
SANDBOX or PRODUCTION
required: true
schema:
maxLength: 15
type: string
- $ref: '#/components/parameters/apiId'
responses:
200:
description: |
OK.
Requested API Custom Backend is returned
headers:
Content-Type:
description: |
The content type of the body.
schema:
type: string
content:
application/xml:
schema:
type: string
format: binary
404:
$ref: '#/components/responses/NotFound'
406:
$ref: '#/components/responses/NotAcceptable'
security:
- OAuth2Security:
- apim:api_view
- apim:api_manage
- apim:api_import_export
- apim:api_product_import_export
x-code-samples:
- lang: Curl
source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
"https://127.0.0.1:9443/api/am/publisher/v4/apis/7a2298c4-c905-403f-8fac-38c73301631f/custom-backend/7a2298c4-c915-483f-8fac-38c73301631f/content"'

/apis/{apiId}/sequence-backend/{type}:
delete:
tags:
- APIs
summary: Delete Sequence Backend of the API
description: This operation can be used to remove the Sequence Backend of the API
operationId: sequenceBackendDelete
parameters:
- name: type
in: path
description: |
Type of the Endpoint.
SANDBOX or PRODUCTION
required: true
schema:
maxLength: 15
type: string
- $ref: '#/components/parameters/apiId'
responses:
200:
description: |
OK.
Resource successfully deleted.
content: { }
403:
$ref: '#/components/responses/Forbidden'
404:
$ref: '#/components/responses/NotFound'
409:
$ref: '#/components/responses/Conflict'
412:
$ref: '#/components/responses/PreconditionFailed'
security:
- OAuth2Security:
- apim:api_delete
- apim:api_manage
- apim:api_import_export
x-code-samples:
- lang: Curl
source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
"https://127.0.0.1:9443/api/am/publisher/v4/apis/7a2298c4-c905-403f-8fac-38c73301631f/custom-backend/7a2298c4-c915-483f-8fac-38c73301631f"'

/apis/{apiId}/sequence-backend:
get:
tags:
- APIs
summary: Get Sequence Backends of the API
description: This operation can be used to get Sequence Backend data of the API
operationId: getSequenceBackendData
parameters:
- $ref: '#/components/parameters/apiId'
responses:
200:
description: |
OK.
Requested API Sequence Backend is returned
headers:
Content-Type:
description: |
The content type of the body.
schema:
type: string
content:
application/json:
schema:
$ref: '#/components/schemas/SequenceBackendList'
404:
$ref: '#/components/responses/NotFound'
406:
$ref: '#/components/responses/NotAcceptable'
security:
- OAuth2Security:
- apim:api_view
- apim:api_manage
- apim:api_import_export
- apim:api_product_import_export
x-code-samples:
- lang: Curl
source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
"https://127.0.0.1:9443/api/am/publisher/v4/apis/7a2298c4-c905-403f-8fac-38c73301631f/custom-backend/7a2298c4-c915-483f-8fac-38c73301631f"'
put:
tags:
- APIs
summary: Upload Sequence Sequence as the Endpoint of the API
description: This operation can be used to change the endpoint of the API to Sequence Backend
operationId: sequenceBackendUpdate
parameters:
- $ref: '#/components/parameters/apiId'
requestBody:
content:
multipart/form-data:
schema:
properties:
sequence:
type: string
description: The sequence that needs to be uploaded.
format: binary
type:
type: string
description: Type of the Endpoint
responses:
200:
description: |
OK.
Successful response with updated API object
headers:
Location:
description: |
The URL of the newly created resource.
schema:
type: string
Content-Type:
description: |
The content type of the body.
schema:
type: string
content:
application/json:
schema:
$ref: '#/components/schemas/API'
400:
$ref: '#/components/responses/BadRequest'
403:
$ref: '#/components/responses/Forbidden'
404:
$ref: '#/components/responses/NotFound'
409:
$ref: '#/components/responses/Conflict'
412:
$ref: '#/components/responses/PreconditionFailed'
security:
- OAuth2Security:
- apim:api_create
- apim:api_manage
- apim:api_publish
x-code-samples:
- lang: Curl
source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
-H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v4/apis/7a2298c4-c905-403f-8fac-38c73301631f/custom-backend"'

/apis/{apiId}/reimport-service:
put:
Expand Down Expand Up @@ -9049,6 +9237,39 @@ paths:
operationId: deleteAPIProductLifecycleStatePendingTasks
components:
schemas:
SequenceBackendList:
title: Sequence Backend List
type: object
properties:
count:
type: integer
description: |
Number of Sequence Backends returned.
example: 1
list:
type: array
items:
$ref: '#/components/schemas/SequenceBackend'
SequenceBackend:
title: Sequence Backend
type: object
properties:
sequenceId:
type: string
readOnly: true
example: 943d3002-000c-42d3-a1b9-d6559f8a4d49
sequenceName:
type: string
readOnly: true
example: 943d3002-000c-42d3-a1b9-d6559f8a4d49-SANDBOX
sequenceType:
type: string
readOnly: true
example: SANDBOX
sequence:
type: string
format: binary
readOnly: true
Comment:
title: Comment
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,20 @@ public APIDTO copyAPIWithReturnDTO(String newVersion, String apiId, Boolean isDe
return response.getData();
}

/**
* Add Sequence Backend to the API Endpoint
*
* @param file Sequence Backend file
* @param apiId APIID
* @param type Key Type
* @throws ApiException API Exception if an error occurs
*/

public void addSequenceBackend(File file, String apiId, String type) throws ApiException {
ApiResponse<APIDTO> response = apIsApi.sequenceBackendUpdateWithHttpInfo(apiId, file, type);
Assert.assertEquals(HttpStatus.SC_OK, response.getStatusCode());
}

/**
* Facilitate update API
*
Expand Down
Loading

0 comments on commit 8676e83

Please sign in to comment.