diff options
author | Daniel Hanrahan <daniel.hanrahan@est.tech> | 2024-07-31 12:30:21 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2024-07-31 12:30:21 +0000 |
commit | b66c993cc2ab670db0f62afe22bb0b5020e5dc40 (patch) | |
tree | 348d380b7e451db8273c9a302cfff8e0961dfb2a /k6-tests/ncmp/common/passthrough-crud.js | |
parent | 9d8e6852b2ebfffca8204557a005aba27c1fc581 (diff) | |
parent | 65b870baf15ceaa336c1290a8bb920b48875a3a0 (diff) |
Merge "Add k6 for legacy async batch passthrough read operation"
Diffstat (limited to 'k6-tests/ncmp/common/passthrough-crud.js')
-rw-r--r-- | k6-tests/ncmp/common/passthrough-crud.js | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/k6-tests/ncmp/common/passthrough-crud.js b/k6-tests/ncmp/common/passthrough-crud.js index 43a215fdf8..76bda4e1bd 100644 --- a/k6-tests/ncmp/common/passthrough-crud.js +++ b/k6-tests/ncmp/common/passthrough-crud.js @@ -19,7 +19,12 @@ */ import http from 'k6/http'; -import { NCMP_BASE_URL, CONTENT_TYPE_JSON_PARAM, getRandomCmHandleId } from './utils.js'; +import { + CONTENT_TYPE_JSON_PARAM, + getRandomCmHandleId, + NCMP_BASE_URL, + TOPIC_DATA_OPERATIONS_BATCH_READ +} from './utils.js'; export function passthroughRead() { const cmHandleId = getRandomCmHandleId(); @@ -40,3 +45,21 @@ export function passthroughWrite() { const response = http.post(url, JSON.stringify(body), CONTENT_TYPE_JSON_PARAM); return response; } + +export function batchRead(cmHandleIds) { + const url = `${NCMP_BASE_URL}/ncmp/v1/data?topic=${TOPIC_DATA_OPERATIONS_BATCH_READ}` + const payload = { + "operations": [ + { + "resourceIdentifier": "parent/child", + "targetIds": cmHandleIds, + "datastore": "ncmp-datastore:passthrough-operational", + "options": "(fields=schemas/schema)", + "operationId": "12", + "operation": "read" + } + ] + }; + const response = http.post(url, JSON.stringify(payload), CONTENT_TYPE_JSON_PARAM); + return response; +}
\ No newline at end of file |