summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
6fb6f77)
Get endpoint only accepts application/json.
Issue-ID: CPS-957
Signed-off-by: puthuparambil.aditya <aditya.puthuparambil@bell.ca>
Change-Id: Ifc7426fbcd6073a39554014dc18b2107b6343b16
15 files changed:
# ============LICENSE_START=======================================================
# Copyright (C) 2021-2022 Nordix Foundation
# Modifications Copyright (C) 2021 Pantheon.tech
# ============LICENSE_START=======================================================
# Copyright (C) 2021-2022 Nordix Foundation
# Modifications Copyright (C) 2021 Pantheon.tech
+# Modifications Copyright (C) 2022 Bell Canada
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
sample 3:
value:
resourceIdentifier: parent=shops,child=bookstore
sample 3:
value:
resourceIdentifier: parent=shops,child=bookstore
- acceptParamInHeader:
- name: Accept
- in: header
- required: false
- description: Accept parameter for response, if accept parameter is null, that means client can accept any format.
- schema:
- type: string
- enum: [ application/json, application/yang-data+json ]
optionsParamInQuery:
name: options
in: query
optionsParamInQuery:
name: options
in: query
# ============LICENSE_START=======================================================
# Copyright (C) 2021-2022 Nordix Foundation
# Modifications Copyright (C) 2021 Pantheon.tech
# ============LICENSE_START=======================================================
# Copyright (C) 2021-2022 Nordix Foundation
# Modifications Copyright (C) 2021 Pantheon.tech
-# Modifications Copyright (C) 2021 Bell Canada
+# Modifications Copyright (C) 2021-2022 Bell Canada
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
parameters:
- $ref: 'components.yaml#/components/parameters/cmHandleInPath'
- $ref: 'components.yaml#/components/parameters/resourceIdentifierInQuery'
parameters:
- $ref: 'components.yaml#/components/parameters/cmHandleInPath'
- $ref: 'components.yaml#/components/parameters/resourceIdentifierInQuery'
- - $ref: 'components.yaml#/components/parameters/acceptParamInHeader'
- $ref: 'components.yaml#/components/parameters/optionsParamInQuery'
- $ref: 'components.yaml#/components/parameters/topicParamInQuery'
responses:
- $ref: 'components.yaml#/components/parameters/optionsParamInQuery'
- $ref: 'components.yaml#/components/parameters/topicParamInQuery'
responses:
parameters:
- $ref: 'components.yaml#/components/parameters/cmHandleInPath'
- $ref: 'components.yaml#/components/parameters/resourceIdentifierInQuery'
parameters:
- $ref: 'components.yaml#/components/parameters/cmHandleInPath'
- $ref: 'components.yaml#/components/parameters/resourceIdentifierInQuery'
- - $ref: 'components.yaml#/components/parameters/acceptParamInHeader'
- $ref: 'components.yaml#/components/parameters/optionsParamInQuery'
- $ref: 'components.yaml#/components/parameters/topicParamInQuery'
responses:
- $ref: 'components.yaml#/components/parameters/optionsParamInQuery'
- $ref: 'components.yaml#/components/parameters/topicParamInQuery'
responses:
* Copyright (C) 2021 Pantheon.tech
* Modifications Copyright (C) 2021-2022 Nordix Foundation
* Modification Copyright (C) 2021 highstreet technologies GmbH
* Copyright (C) 2021 Pantheon.tech
* Modifications Copyright (C) 2021-2022 Nordix Foundation
* Modification Copyright (C) 2021 highstreet technologies GmbH
- * Modifications (C) 2021 Bell Canada
+ * Modifications (C) 2021-2022 Bell Canada
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* @param cmHandle cm handle identifier
* @param resourceIdentifier resource identifier
*
* @param cmHandle cm handle identifier
* @param resourceIdentifier resource identifier
- * @param acceptParamInHeader accept header parameter
* @param optionsParamInQuery options query parameter
* @param topicParamInQuery topic query parameter
* @return {@code ResponseEntity} response from dmi plugin
* @param optionsParamInQuery options query parameter
* @param topicParamInQuery topic query parameter
* @return {@code ResponseEntity} response from dmi plugin
@Override
public ResponseEntity<Object> getResourceDataOperationalForCmHandle(final String cmHandle,
final @NotNull @Valid String resourceIdentifier,
@Override
public ResponseEntity<Object> getResourceDataOperationalForCmHandle(final String cmHandle,
final @NotNull @Valid String resourceIdentifier,
- final String acceptParamInHeader,
final @Valid String optionsParamInQuery,
final @Valid String topicParamInQuery) {
final Object responseObject = networkCmProxyDataService.getResourceDataOperationalForCmHandle(cmHandle,
resourceIdentifier,
final @Valid String optionsParamInQuery,
final @Valid String topicParamInQuery) {
final Object responseObject = networkCmProxyDataService.getResourceDataOperationalForCmHandle(cmHandle,
resourceIdentifier,
optionsParamInQuery,
topicParamInQuery);
return ResponseEntity.ok(responseObject);
optionsParamInQuery,
topicParamInQuery);
return ResponseEntity.ok(responseObject);
*
* @param cmHandle cm handle identifier
* @param resourceIdentifier resource identifier
*
* @param cmHandle cm handle identifier
* @param resourceIdentifier resource identifier
- * @param acceptParamInHeader accept header parameter
* @param optionsParamInQuery options query parameter
* @param topicParamInQuery topic query parameter
* @return {@code ResponseEntity} response from dmi plugin
* @param optionsParamInQuery options query parameter
* @param topicParamInQuery topic query parameter
* @return {@code ResponseEntity} response from dmi plugin
@Override
public ResponseEntity<Object> getResourceDataRunningForCmHandle(final String cmHandle,
final @NotNull @Valid String resourceIdentifier,
@Override
public ResponseEntity<Object> getResourceDataRunningForCmHandle(final String cmHandle,
final @NotNull @Valid String resourceIdentifier,
- final String acceptParamInHeader,
final @Valid String optionsParamInQuery,
final @Valid String topicParamInQuery) {
final Object responseObject = networkCmProxyDataService.getResourceDataPassThroughRunningForCmHandle(cmHandle,
resourceIdentifier,
final @Valid String optionsParamInQuery,
final @Valid String topicParamInQuery) {
final Object responseObject = networkCmProxyDataService.getResourceDataPassThroughRunningForCmHandle(cmHandle,
resourceIdentifier,
optionsParamInQuery,
topicParamInQuery);
return ResponseEntity.ok(responseObject);
optionsParamInQuery,
topicParamInQuery);
return ResponseEntity.ok(responseObject);
* Copyright (C) 2021 Pantheon.tech
* Modification Copyright (C) 2021 highstreet technologies GmbH
* Modification Copyright (C) 2021-2022 Nordix Foundation
* Copyright (C) 2021 Pantheon.tech
* Modification Copyright (C) 2021 highstreet technologies GmbH
* Modification Copyright (C) 2021-2022 Nordix Foundation
- * Modification Copyright (C) 2021 Bell Canada.
+ * Modification Copyright (C) 2021-2022 Bell Canada.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
def response = mvc.perform(
get(getUrl)
.contentType(MediaType.APPLICATION_JSON)
def response = mvc.perform(
get(getUrl)
.contentType(MediaType.APPLICATION_JSON)
- .accept(MediaType.APPLICATION_JSON_VALUE)
).andReturn().response
then: 'the NCMP data service is called with getResourceDataOperationalForCmHandle'
1 * mockNetworkCmProxyDataService.getResourceDataOperationalForCmHandle('testCmHandle',
'parent/child',
).andReturn().response
then: 'the NCMP data service is called with getResourceDataOperationalForCmHandle'
1 * mockNetworkCmProxyDataService.getResourceDataOperationalForCmHandle('testCmHandle',
'parent/child',
'(a=1,b=2)',
NO_TOPIC)
and: 'response status is Ok'
'(a=1,b=2)',
NO_TOPIC)
and: 'response status is Ok'
def response = mvc.perform(
get(getUrl)
.contentType(MediaType.APPLICATION_JSON)
def response = mvc.perform(
get(getUrl)
.contentType(MediaType.APPLICATION_JSON)
- .accept(MediaType.APPLICATION_JSON_VALUE)
).andReturn().response
then: 'the NCMP data service is called with operational data for cm handle'
1 * mockNetworkCmProxyDataService.getResourceDataOperationalForCmHandle('testCmHandle',
'parent/child',
).andReturn().response
then: 'the NCMP data service is called with operational data for cm handle'
1 * mockNetworkCmProxyDataService.getResourceDataOperationalForCmHandle('testCmHandle',
'parent/child',
'(a=1,b=2)',
expectedTopicName)
and: 'response status is Ok'
'(a=1,b=2)',
expectedTopicName)
and: 'response status is Ok'
and: 'ncmp service returns json object'
mockNetworkCmProxyDataService.getResourceDataPassThroughRunningForCmHandle('testCmHandle',
resourceIdentifier,
and: 'ncmp service returns json object'
mockNetworkCmProxyDataService.getResourceDataPassThroughRunningForCmHandle('testCmHandle',
resourceIdentifier,
'(a=1,b=2)',
NO_TOPIC) >> '{valid-json}'
when: 'get data resource request is performed'
def response = mvc.perform(
get(getUrl)
.contentType(MediaType.APPLICATION_JSON)
'(a=1,b=2)',
NO_TOPIC) >> '{valid-json}'
when: 'get data resource request is performed'
def response = mvc.perform(
get(getUrl)
.contentType(MediaType.APPLICATION_JSON)
- .accept(MediaType.APPLICATION_JSON_VALUE)
).andReturn().response
then: 'response status is Ok'
response.status == HttpStatus.OK.value()
).andReturn().response
then: 'response status is Ok'
response.status == HttpStatus.OK.value()
when: 'update data resource request is performed'
def response = mvc.perform(
put(updateUrl)
when: 'update data resource request is performed'
def response = mvc.perform(
put(updateUrl)
- .contentType(MediaType.APPLICATION_JSON_VALUE)
- .accept(MediaType.APPLICATION_JSON_VALUE).content(requestBody)
+ .contentType(MediaType.APPLICATION_JSON_VALUE).content(requestBody)
).andReturn().response
then: 'ncmp service method to update resource is called'
1 * mockNetworkCmProxyDataService.writeResourceDataPassThroughRunningForCmHandle('testCmHandle',
).andReturn().response
then: 'ncmp service method to update resource is called'
1 * mockNetworkCmProxyDataService.writeResourceDataPassThroughRunningForCmHandle('testCmHandle',
when: 'create resource request is performed'
def response = mvc.perform(
post(url)
when: 'create resource request is performed'
def response = mvc.perform(
post(url)
- .contentType(MediaType.APPLICATION_JSON_VALUE)
- .accept(MediaType.APPLICATION_JSON_VALUE).content(requestBody)
+ .contentType(MediaType.APPLICATION_JSON_VALUE).content(requestBody)
).andReturn().response
then: 'ncmp service method to create resource called'
1 * mockNetworkCmProxyDataService.writeResourceDataPassThroughRunningForCmHandle('testCmHandle',
).andReturn().response
then: 'ncmp service method to create resource called'
1 * mockNetworkCmProxyDataService.writeResourceDataPassThroughRunningForCmHandle('testCmHandle',
*
* @param cmHandleId cm handle identifier
* @param resourceIdentifier resource identifier
*
* @param cmHandleId cm handle identifier
* @param resourceIdentifier resource identifier
- * @param acceptParamInHeader accept param
* @param optionsParamInQuery options query
* @param topicParamInQuery topic name for (triggering) async responses
* @return {@code Object} resource data
*/
Object getResourceDataOperationalForCmHandle(String cmHandleId,
String resourceIdentifier,
* @param optionsParamInQuery options query
* @param topicParamInQuery topic name for (triggering) async responses
* @return {@code Object} resource data
*/
Object getResourceDataOperationalForCmHandle(String cmHandleId,
String resourceIdentifier,
- String acceptParamInHeader,
String optionsParamInQuery,
String topicParamInQuery);
String optionsParamInQuery,
String topicParamInQuery);
*
* @param cmHandleId cm handle identifier
* @param resourceIdentifier resource identifier
*
* @param cmHandleId cm handle identifier
* @param resourceIdentifier resource identifier
- * @param acceptParamInHeader accept param
* @param optionsParamInQuery options query
* @param topicParamInQuery topic query
* @return {@code Object} resource data
*/
Object getResourceDataPassThroughRunningForCmHandle(String cmHandleId,
String resourceIdentifier,
* @param optionsParamInQuery options query
* @param topicParamInQuery topic query
* @return {@code Object} resource data
*/
Object getResourceDataPassThroughRunningForCmHandle(String cmHandleId,
String resourceIdentifier,
- String acceptParamInHeader,
String optionsParamInQuery,
String topicParamInQuery);
String optionsParamInQuery,
String topicParamInQuery);
@Override
public Object getResourceDataOperationalForCmHandle(final String cmHandleId,
final String resourceIdentifier,
@Override
public Object getResourceDataOperationalForCmHandle(final String cmHandleId,
final String resourceIdentifier,
- final String acceptParamInHeader,
final String optionsParamInQuery,
final String topicParamInQuery) {
CpsValidator.validateNameCharacters(cmHandleId);
final String optionsParamInQuery,
final String topicParamInQuery) {
CpsValidator.validateNameCharacters(cmHandleId);
- return validateTopicNameAndGetResourceData(cmHandleId, resourceIdentifier, acceptParamInHeader,
+ return validateTopicNameAndGetResourceData(cmHandleId, resourceIdentifier,
DmiOperations.DataStoreEnum.PASSTHROUGH_OPERATIONAL, optionsParamInQuery, topicParamInQuery);
}
@Override
public Object getResourceDataPassThroughRunningForCmHandle(final String cmHandleId,
final String resourceIdentifier,
DmiOperations.DataStoreEnum.PASSTHROUGH_OPERATIONAL, optionsParamInQuery, topicParamInQuery);
}
@Override
public Object getResourceDataPassThroughRunningForCmHandle(final String cmHandleId,
final String resourceIdentifier,
- final String acceptParamInHeader,
final String optionsParamInQuery,
final String topicParamInQuery) {
CpsValidator.validateNameCharacters(cmHandleId);
final String optionsParamInQuery,
final String topicParamInQuery) {
CpsValidator.validateNameCharacters(cmHandleId);
- return validateTopicNameAndGetResourceData(cmHandleId, resourceIdentifier, acceptParamInHeader,
+ return validateTopicNameAndGetResourceData(cmHandleId, resourceIdentifier,
DmiOperations.DataStoreEnum.PASSTHROUGH_RUNNING, optionsParamInQuery, topicParamInQuery);
}
DmiOperations.DataStoreEnum.PASSTHROUGH_RUNNING, optionsParamInQuery, topicParamInQuery);
}
private Object validateTopicNameAndGetResourceData(final String cmHandleId,
final String resourceIdentifier,
private Object validateTopicNameAndGetResourceData(final String cmHandleId,
final String resourceIdentifier,
- final String acceptParamInHeader,
final DmiOperations.DataStoreEnum dataStore,
final String optionsParamInQuery,
final String topicParamInQuery) {
final DmiOperations.DataStoreEnum dataStore,
final String optionsParamInQuery,
final String topicParamInQuery) {
.body(buildDmiResponse(resourceDataRequestId));
}
final ResponseEntity<?> responseEntity = dmiDataOperations.getResourceDataFromDmi(
.body(buildDmiResponse(resourceDataRequestId));
}
final ResponseEntity<?> responseEntity = dmiDataOperations.getResourceDataFromDmi(
- cmHandleId, resourceIdentifier, optionsParamInQuery, acceptParamInHeader,
- dataStore, NO_REQUEST_ID, NO_TOPIC);
+ cmHandleId, resourceIdentifier, optionsParamInQuery, dataStore, NO_REQUEST_ID, NO_TOPIC);
return handleResponse(responseEntity, OperationEnum.READ);
}
}
\ No newline at end of file
return handleResponse(responseEntity, OperationEnum.READ);
}
}
\ No newline at end of file
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2021 Nordix Foundation
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2021 Nordix Foundation
+ * Modifications Copyright (C) 2022 Bell Canada
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.onap.cps.ncmp.api.impl.client;
package org.onap.cps.ncmp.api.impl.client;
+import lombok.AllArgsConstructor;
import org.onap.cps.ncmp.api.impl.config.NcmpConfiguration.DmiProperties;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.onap.cps.ncmp.api.impl.config.NcmpConfiguration.DmiProperties;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
@Component
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
@Component
public class DmiRestClient {
private RestTemplate restTemplate;
private DmiProperties dmiProperties;
public class DmiRestClient {
private RestTemplate restTemplate;
private DmiProperties dmiProperties;
- /**
- * Constructor injection for DmiRestClient objects.
- *
- * @param restTemplate the rest template
- * @param dmiProperties the DMI properties
- */
- public DmiRestClient(final RestTemplate restTemplate, final DmiProperties dmiProperties) {
- this.restTemplate = restTemplate;
- this.dmiProperties = dmiProperties;
- }
/**
* Sends POST operation to DMI with json body containing module references.
* @param dmiResourceUrl dmi resource url
* @param jsonData json data body
/**
* Sends POST operation to DMI with json body containing module references.
* @param dmiResourceUrl dmi resource url
* @param jsonData json data body
- * @param httpHeaders http headers
* @return response entity of type String
*/
public ResponseEntity<Object> postOperationWithJsonData(final String dmiResourceUrl,
* @return response entity of type String
*/
public ResponseEntity<Object> postOperationWithJsonData(final String dmiResourceUrl,
- final String jsonData,
- final HttpHeaders httpHeaders) {
- final var httpEntity = new HttpEntity<>(jsonData, configureHttpHeaders(httpHeaders));
+ final String jsonData) {
+ final var httpEntity = new HttpEntity<>(jsonData, configureHttpHeaders(new HttpHeaders()));
return restTemplate.postForEntity(dmiResourceUrl, httpEntity, Object.class);
}
return restTemplate.postForEntity(dmiResourceUrl, httpEntity, Object.class);
}
httpHeaders.setContentType(MediaType.APPLICATION_JSON);
return httpHeaders;
}
httpHeaders.setContentType(MediaType.APPLICATION_JSON);
return httpHeaders;
}
-
- /**
- * Sends POST operation to DMI.
- * @param dmiResourceUrl dmi resource url
- * @param httpHeaders http headers
- * @return response entity of type String
- */
- public ResponseEntity<Object> postOperation(final String dmiResourceUrl, final HttpHeaders httpHeaders) {
- final var httpEntity = new HttpEntity<>(configureHttpHeaders(httpHeaders));
- return restTemplate.exchange(dmiResourceUrl, HttpMethod.POST, httpEntity, Object.class);
- }
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2021-2022 Nordix Foundation
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2021-2022 Nordix Foundation
+ * Modifications Copyright (C) 2022 Bell Canada
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import org.onap.cps.ncmp.api.impl.utils.DmiServiceUrlBuilder;
import org.onap.cps.ncmp.api.impl.yangmodels.YangModelCmHandle;
import org.onap.cps.utils.JsonObjectMapper;
import org.onap.cps.ncmp.api.impl.utils.DmiServiceUrlBuilder;
import org.onap.cps.ncmp.api.impl.yangmodels.YangModelCmHandle;
import org.onap.cps.utils.JsonObjectMapper;
-import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
* @param cmHandleId network resource identifier
* @param resourceId resource identifier
* @param optionsParamInQuery options query
* @param cmHandleId network resource identifier
* @param resourceId resource identifier
* @param optionsParamInQuery options query
- * @param acceptParamInHeader accept parameter
* @param dataStore data store enum
* @param requestId requestId for async responses
* @param topicParamInQuery topic name for (triggering) async responses
* @param dataStore data store enum
* @param requestId requestId for async responses
* @param topicParamInQuery topic name for (triggering) async responses
public ResponseEntity<Object> getResourceDataFromDmi(final String cmHandleId,
final String resourceId,
final String optionsParamInQuery,
public ResponseEntity<Object> getResourceDataFromDmi(final String cmHandleId,
final String resourceId,
final String optionsParamInQuery,
- final String acceptParamInHeader,
final DataStoreEnum dataStore,
final String requestId,
final String topicParamInQuery) {
final DataStoreEnum dataStore,
final String requestId,
final String topicParamInQuery) {
.build();
dmiRequestBody.asDmiProperties(yangModelCmHandle.getDmiProperties());
final String jsonBody = jsonObjectMapper.asJsonString(dmiRequestBody);
.build();
dmiRequestBody.asDmiProperties(yangModelCmHandle.getDmiProperties());
final String jsonBody = jsonObjectMapper.asJsonString(dmiRequestBody);
final var dmiResourceDataUrl = dmiServiceUrlBuilder.getDmiDatastoreUrl(
dmiServiceUrlBuilder.populateQueryParams(resourceId, optionsParamInQuery,
topicParamInQuery), dmiServiceUrlBuilder.populateUriVariables(
yangModelCmHandle, cmHandleId, dataStore));
final var dmiResourceDataUrl = dmiServiceUrlBuilder.getDmiDatastoreUrl(
dmiServiceUrlBuilder.populateQueryParams(resourceId, optionsParamInQuery,
topicParamInQuery), dmiServiceUrlBuilder.populateUriVariables(
yangModelCmHandle, cmHandleId, dataStore));
- final var httpHeaders = prepareHeader(acceptParamInHeader);
- return dmiRestClient.postOperationWithJsonData(dmiResourceDataUrl, jsonBody, httpHeaders);
+ return dmiRestClient.postOperationWithJsonData(dmiResourceDataUrl, jsonBody);
dmiServiceUrlBuilder.getDmiDatastoreUrl(dmiServiceUrlBuilder.populateQueryParams(resourceId,
null, null),
dmiServiceUrlBuilder.populateUriVariables(yangModelCmHandle, cmHandleId, PASSTHROUGH_RUNNING));
dmiServiceUrlBuilder.getDmiDatastoreUrl(dmiServiceUrlBuilder.populateQueryParams(resourceId,
null, null),
dmiServiceUrlBuilder.populateUriVariables(yangModelCmHandle, cmHandleId, PASSTHROUGH_RUNNING));
- return dmiRestClient.postOperationWithJsonData(dmiUrl, jsonBody, new HttpHeaders());
+ return dmiRestClient.postOperationWithJsonData(dmiUrl, jsonBody);
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2021-2022 Nordix Foundation
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2021-2022 Nordix Foundation
+ * Modifications Copyright (C) 2022 Bell Canada
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import org.onap.cps.ncmp.api.models.YangResource;
import org.onap.cps.spi.model.ModuleReference;
import org.onap.cps.utils.JsonObjectMapper;
import org.onap.cps.ncmp.api.models.YangResource;
import org.onap.cps.spi.model.ModuleReference;
import org.onap.cps.utils.JsonObjectMapper;
-import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
final String cmHandle,
final String resourceName) {
final String dmiResourceDataUrl = getDmiResourceUrl(dmiServiceName, cmHandle, resourceName);
final String cmHandle,
final String resourceName) {
final String dmiResourceDataUrl = getDmiResourceUrl(dmiServiceName, cmHandle, resourceName);
- return dmiRestClient.postOperationWithJsonData(dmiResourceDataUrl, jsonData, new HttpHeaders());
+ return dmiRestClient.postOperationWithJsonData(dmiResourceDataUrl, jsonData);
}
private static String getRequestBodyToFetchYangResources(final Collection<ModuleReference> newModuleReferences,
}
private static String getRequestBodyToFetchYangResources(final Collection<ModuleReference> newModuleReferences,
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2021-2022 Nordix Foundation
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2021-2022 Nordix Foundation
+ * Modifications Copyright (C) 2022 Bell Canada
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import org.onap.cps.ncmp.api.impl.config.NcmpConfiguration;
import org.onap.cps.ncmp.api.impl.utils.DmiServiceUrlBuilder;
import org.onap.cps.utils.JsonObjectMapper;
import org.onap.cps.ncmp.api.impl.config.NcmpConfiguration;
import org.onap.cps.ncmp.api.impl.utils.DmiServiceUrlBuilder;
import org.onap.cps.utils.JsonObjectMapper;
-import org.springframework.http.HttpHeaders;
import org.springframework.stereotype.Service;
@RequiredArgsConstructor
import org.springframework.stereotype.Service;
@RequiredArgsConstructor
.buildAndExpand(dmiServiceName, dmiProperties.getDmiBasePath(), cmHandle, resourceName).toUriString();
}
.buildAndExpand(dmiServiceName, dmiProperties.getDmiBasePath(), cmHandle, resourceName).toUriString();
}
- static HttpHeaders prepareHeader(final String acceptParam) {
- final var httpHeaders = new HttpHeaders();
- httpHeaders.set(HttpHeaders.ACCEPT, acceptParam);
- return httpHeaders;
- }
* ============LICENSE_START=======================================================
* Copyright (C) 2021-2022 Nordix Foundation
* Modifications Copyright (C) 2021 Pantheon.tech
* ============LICENSE_START=======================================================
* Copyright (C) 2021-2022 Nordix Foundation
* Modifications Copyright (C) 2021 Pantheon.tech
- * Modifications Copyright (C) 2021 Bell Canada
+ * Modifications Copyright (C) 2021-2022 Bell Canada
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
'testCmHandle',
'testResourceId',
OPTIONS_PARAM,
'testCmHandle',
'testResourceId',
OPTIONS_PARAM,
PASSTHROUGH_OPERATIONAL,
NO_REQUEST_ID,
NO_TOPIC) >> new ResponseEntity<>('dmi-response', HttpStatus.OK)
when: 'get resource data operational for cm-handle is called'
def response = objectUnderTest.getResourceDataOperationalForCmHandle('testCmHandle',
'testResourceId',
PASSTHROUGH_OPERATIONAL,
NO_REQUEST_ID,
NO_TOPIC) >> new ResponseEntity<>('dmi-response', HttpStatus.OK)
when: 'get resource data operational for cm-handle is called'
def response = objectUnderTest.getResourceDataOperationalForCmHandle('testCmHandle',
'testResourceId',
OPTIONS_PARAM,
NO_TOPIC)
then: 'DMI returns a json response'
OPTIONS_PARAM,
NO_TOPIC)
then: 'DMI returns a json response'
when: 'get resource data is called'
objectUnderTest.getResourceDataOperationalForCmHandle('testCmHandle',
'testResourceId',
when: 'get resource data is called'
objectUnderTest.getResourceDataOperationalForCmHandle('testCmHandle',
'testResourceId',
OPTIONS_PARAM,
NO_TOPIC)
then: 'exception is thrown with the expected response code and details'
OPTIONS_PARAM,
NO_TOPIC)
then: 'exception is thrown with the expected response code and details'
mockDmiDataOperations.getResourceDataFromDmi('testCmHandle',
'testResourceId',
OPTIONS_PARAM,
mockDmiDataOperations.getResourceDataFromDmi('testCmHandle',
'testResourceId',
OPTIONS_PARAM,
PASSTHROUGH_OPERATIONAL,
NO_REQUEST_ID,
NO_TOPIC)
PASSTHROUGH_OPERATIONAL,
NO_REQUEST_ID,
NO_TOPIC)
when: 'get resource data is called'
objectUnderTest.getResourceDataOperationalForCmHandle('testCmHandle',
'testResourceId',
when: 'get resource data is called'
objectUnderTest.getResourceDataOperationalForCmHandle('testCmHandle',
'testResourceId',
OPTIONS_PARAM,
NO_TOPIC)
then: 'exception is thrown'
OPTIONS_PARAM,
NO_TOPIC)
then: 'exception is thrown'
mockDmiDataOperations.getResourceDataFromDmi('testCmHandle',
'testResourceId',
OPTIONS_PARAM,
mockDmiDataOperations.getResourceDataFromDmi('testCmHandle',
'testResourceId',
OPTIONS_PARAM,
PASSTHROUGH_RUNNING,
NO_REQUEST_ID,
NO_TOPIC) >> new ResponseEntity<>('{dmi-response}', HttpStatus.OK)
when: 'get resource data is called'
def response = objectUnderTest.getResourceDataPassThroughRunningForCmHandle('testCmHandle',
'testResourceId',
PASSTHROUGH_RUNNING,
NO_REQUEST_ID,
NO_TOPIC) >> new ResponseEntity<>('{dmi-response}', HttpStatus.OK)
when: 'get resource data is called'
def response = objectUnderTest.getResourceDataPassThroughRunningForCmHandle('testCmHandle',
'testResourceId',
OPTIONS_PARAM,
NO_TOPIC)
then: 'get resource data returns expected response'
OPTIONS_PARAM,
NO_TOPIC)
then: 'get resource data returns expected response'
mockDmiDataOperations.getResourceDataFromDmi('testCmHandle',
'testResourceId',
OPTIONS_PARAM,
mockDmiDataOperations.getResourceDataFromDmi('testCmHandle',
'testResourceId',
OPTIONS_PARAM,
PASSTHROUGH_RUNNING,
NO_REQUEST_ID,
NO_TOPIC)
PASSTHROUGH_RUNNING,
NO_REQUEST_ID,
NO_TOPIC)
when: 'get resource data is called'
objectUnderTest.getResourceDataPassThroughRunningForCmHandle('testCmHandle',
'testResourceId',
when: 'get resource data is called'
objectUnderTest.getResourceDataPassThroughRunningForCmHandle('testCmHandle',
'testResourceId',
OPTIONS_PARAM,
NO_TOPIC)
then: 'exception is thrown'
OPTIONS_PARAM,
NO_TOPIC)
then: 'exception is thrown'
>> new ResponseEntity<>('{dmi-response}', HttpStatus.OK)
when: 'get resource data is called data operational with blank topic'
def responseData = objectUnderTest.getResourceDataOperationalForCmHandle('', '',
>> new ResponseEntity<>('{dmi-response}', HttpStatus.OK)
when: 'get resource data is called data operational with blank topic'
def responseData = objectUnderTest.getResourceDataOperationalForCmHandle('', '',
then: 'a invalid topic exception is thrown'
thrown(InvalidTopicException)
where: 'the following parameters are used'
then: 'a invalid topic exception is thrown'
thrown(InvalidTopicException)
where: 'the following parameters are used'
given: 'cps data service returns valid data node'
mockCpsDataService.getDataNode(*_) >> dataNode
and: 'dmi data operation returns valid response and data'
given: 'cps data service returns valid data node'
mockCpsDataService.getDataNode(*_) >> dataNode
and: 'dmi data operation returns valid response and data'
- mockDmiDataOperations.getResourceDataFromDmi(_, _, _, _, _, _, 'my-topic-name')
+ mockDmiDataOperations.getResourceDataFromDmi(_, _, _, _, _, 'my-topic-name')
>> new ResponseEntity<>('{dmi-response}', HttpStatus.OK)
when: 'get resource data is called for data operational with valid topic'
>> new ResponseEntity<>('{dmi-response}', HttpStatus.OK)
when: 'get resource data is called for data operational with valid topic'
- def responseData = objectUnderTest.getResourceDataOperationalForCmHandle('', '', '', '', 'my-topic-name')
+ def responseData = objectUnderTest.getResourceDataOperationalForCmHandle('', '', '', 'my-topic-name')
then: 'non empty request id is generated'
assert responseData.body.requestId.length() > 0
}
then: 'non empty request id is generated'
assert responseData.body.requestId.length() > 0
}
mockCpsDataService.getDataNode('NCMP-Admin', 'ncmp-dmi-registry',
cmHandleXPath, FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS) >> dataNode
and: 'dmi data operation returns valid response and data'
mockCpsDataService.getDataNode('NCMP-Admin', 'ncmp-dmi-registry',
cmHandleXPath, FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS) >> dataNode
and: 'dmi data operation returns valid response and data'
- mockDmiDataOperations.getResourceDataFromDmi(_, _, _, _, _, _, 'my-topic-name')
+ mockDmiDataOperations.getResourceDataFromDmi(_, _, _, _, _, 'my-topic-name')
>> new ResponseEntity<>('{dmi-response}', HttpStatus.OK)
when: 'get resource data is called for data operational with valid topic'
def responseData = objectUnderTest.getResourceDataPassThroughRunningForCmHandle('',
>> new ResponseEntity<>('{dmi-response}', HttpStatus.OK)
when: 'get resource data is called for data operational with valid topic'
def responseData = objectUnderTest.getResourceDataPassThroughRunningForCmHandle('',
- '', '', OPTIONS_PARAM, 'my-topic-name')
+ '', OPTIONS_PARAM, 'my-topic-name')
then: 'non empty request id is generated'
assert responseData.body.requestId.length() > 0
}
then: 'non empty request id is generated'
assert responseData.body.requestId.length() > 0
}
mockCpsDataService.getDataNode('NCMP-Admin', 'ncmp-dmi-registry',
cmHandleXPath, FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS) >> dataNode
and: 'dmi data operation returns valid response and data'
mockCpsDataService.getDataNode('NCMP-Admin', 'ncmp-dmi-registry',
cmHandleXPath, FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS) >> dataNode
and: 'dmi data operation returns valid response and data'
- mockDmiDataOperations.getResourceDataFromDmi(_, _, _, _, _, NO_REQUEST_ID, NO_TOPIC)
+ mockDmiDataOperations.getResourceDataFromDmi(_, _, _, _, NO_REQUEST_ID, NO_TOPIC)
>> new ResponseEntity<>('{dmi-response}', HttpStatus.OK)
when: 'get resource data is called for data operational with valid topic'
def responseData = objectUnderTest.getResourceDataPassThroughRunningForCmHandle('',
>> new ResponseEntity<>('{dmi-response}', HttpStatus.OK)
when: 'get resource data is called for data operational with valid topic'
def responseData = objectUnderTest.getResourceDataPassThroughRunningForCmHandle('',
- '', '', '', emptyTopic)
then: 'a invalid topic exception is thrown'
thrown(InvalidTopicException)
where: 'the following parameters are used'
then: 'a invalid topic exception is thrown'
thrown(InvalidTopicException)
where: 'the following parameters are used'
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2021 Nordix Foundation
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2021 Nordix Foundation
+ * Modifications Copyright (C) 2022 Bell Canada
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
DmiRestClient objectUnderTest
def resourceUrl = 'some url'
DmiRestClient objectUnderTest
def resourceUrl = 'some url'
- def 'DMI POST operation'() {
- given: 'the rest template returns a valid response entity'
- def mockResponseEntity = Mock(ResponseEntity)
- mockRestTemplate.exchange(resourceUrl, HttpMethod.POST, _ as HttpEntity, Object.class) >> mockResponseEntity
- when: 'POST operation is invoked'
- def result = objectUnderTest.postOperation(resourceUrl, new HttpHeaders())
- then: 'the output of the method is equal to the output from the rest template'
- result == mockResponseEntity
- }
-
def 'DMI POST operation with JSON.'() {
given: 'the rest template returns a valid response entity'
def mockResponseEntity = Mock(ResponseEntity)
mockRestTemplate.postForEntity(resourceUrl, _ as HttpEntity, Object.class) >> mockResponseEntity
when: 'POST operation is invoked'
def 'DMI POST operation with JSON.'() {
given: 'the rest template returns a valid response entity'
def mockResponseEntity = Mock(ResponseEntity)
mockRestTemplate.postForEntity(resourceUrl, _ as HttpEntity, Object.class) >> mockResponseEntity
when: 'POST operation is invoked'
- def result = objectUnderTest.postOperationWithJsonData(resourceUrl, 'json-data', new HttpHeaders())
+ def result = objectUnderTest.postOperationWithJsonData(resourceUrl, 'json-data')
then: 'the output of the method is equal to the output from the test template'
result == mockResponseEntity
}
then: 'the output of the method is equal to the output from the test template'
result == mockResponseEntity
}
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2021-2022 Nordix Foundation
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2021-2022 Nordix Foundation
+ * Modifications Copyright (C) 2022 Bell Canada
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
and: 'a positive response from DMI service when it is called with the expected parameters'
def responseFromDmi = new ResponseEntity<Object>(HttpStatus.OK)
def expectedUrl = dmiServiceBaseUrl + "${expectedDatastoreInUrl}?resourceIdentifier=${resourceIdentifier}${expectedOptionsInUrl}"
and: 'a positive response from DMI service when it is called with the expected parameters'
def responseFromDmi = new ResponseEntity<Object>(HttpStatus.OK)
def expectedUrl = dmiServiceBaseUrl + "${expectedDatastoreInUrl}?resourceIdentifier=${resourceIdentifier}${expectedOptionsInUrl}"
- mockDmiRestClient.postOperationWithJsonData(expectedUrl,
- expectedJson, [Accept: ['sample accept header']]) >> responseFromDmi
+ mockDmiRestClient.postOperationWithJsonData(expectedUrl, expectedJson) >> responseFromDmi
dmiServiceUrlBuilder.getDmiDatastoreUrl(_, _) >> expectedUrl
when: 'get resource data is invoked'
def result = objectUnderTest.getResourceDataFromDmi(cmHandleId, resourceIdentifier,
dmiServiceUrlBuilder.getDmiDatastoreUrl(_, _) >> expectedUrl
when: 'get resource data is invoked'
def result = objectUnderTest.getResourceDataFromDmi(cmHandleId, resourceIdentifier,
- options, 'sample accept header', dataStore, NO_REQUEST_ID, NO_TOPIC)
+ options, dataStore, NO_REQUEST_ID, NO_TOPIC)
then: 'the result is the response from the DMI service'
assert result == responseFromDmi
where: 'the following parameters are used'
then: 'the result is the response from the DMI service'
assert result == responseFromDmi
where: 'the following parameters are used'
def expectedJson = '{"operation":"' + expectedOperationInUrl + '","dataType":"some data type","data":"requestData","cmHandleProperties":{"prop1":"val1"}}'
def responseFromDmi = new ResponseEntity<Object>(HttpStatus.OK)
dmiServiceUrlBuilder.getDmiDatastoreUrl(_, _) >> expectedUrl
def expectedJson = '{"operation":"' + expectedOperationInUrl + '","dataType":"some data type","data":"requestData","cmHandleProperties":{"prop1":"val1"}}'
def responseFromDmi = new ResponseEntity<Object>(HttpStatus.OK)
dmiServiceUrlBuilder.getDmiDatastoreUrl(_, _) >> expectedUrl
- mockDmiRestClient.postOperationWithJsonData(expectedUrl, expectedJson, [:]) >> responseFromDmi
+ mockDmiRestClient.postOperationWithJsonData(expectedUrl, expectedJson) >> responseFromDmi
when: 'write resource method is invoked'
def result = objectUnderTest.writeResourceDataPassThroughRunningFromDmi(cmHandleId, 'parent/child', operation, 'requestData', 'some data type')
then: 'the result is the response from the DMI service'
when: 'write resource method is invoked'
def result = objectUnderTest.writeResourceDataPassThroughRunningFromDmi(cmHandleId, 'parent/child', operation, 'requestData', 'some data type')
then: 'the result is the response from the DMI service'
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2021-2022 Nordix Foundation
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2021-2022 Nordix Foundation
+ * Modifications Copyright (C) 2022 Bell Canada
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
def moduleReferencesAsLisOfMaps = [[moduleName: 'mod1', revision: 'A'], [moduleName: 'mod2', revision: 'X']]
def expectedUrl = "${dmiServiceName}/dmi/v1/ch/${cmHandleId}/modules"
def responseFromDmi = new ResponseEntity([schemas: moduleReferencesAsLisOfMaps], HttpStatus.OK)
def moduleReferencesAsLisOfMaps = [[moduleName: 'mod1', revision: 'A'], [moduleName: 'mod2', revision: 'X']]
def expectedUrl = "${dmiServiceName}/dmi/v1/ch/${cmHandleId}/modules"
def responseFromDmi = new ResponseEntity([schemas: moduleReferencesAsLisOfMaps], HttpStatus.OK)
- mockDmiRestClient.postOperationWithJsonData(expectedUrl, '{"cmHandleProperties":{}}', [:])
+ mockDmiRestClient.postOperationWithJsonData(expectedUrl, '{"cmHandleProperties":{}}')
>> responseFromDmi
when: 'get module references is called'
def result = objectUnderTest.getModuleReferences(yangModelCmHandle)
>> responseFromDmi
when: 'get module references is called'
def result = objectUnderTest.getModuleReferences(yangModelCmHandle)
and: 'a positive response from DMI service when it is called with tha expected parameters'
def responseFromDmi = new ResponseEntity<String>(HttpStatus.OK)
mockDmiRestClient.postOperationWithJsonData("${dmiServiceName}/dmi/v1/ch/${cmHandleId}/modules",
and: 'a positive response from DMI service when it is called with tha expected parameters'
def responseFromDmi = new ResponseEntity<String>(HttpStatus.OK)
mockDmiRestClient.postOperationWithJsonData("${dmiServiceName}/dmi/v1/ch/${cmHandleId}/modules",
- '{"cmHandleProperties":' + expectedAdditionalPropertiesInRequest + '}', [:]) >> responseFromDmi
+ '{"cmHandleProperties":' + expectedAdditionalPropertiesInRequest + '}') >> responseFromDmi
when: 'a get module references is called'
def result = objectUnderTest.getModuleReferences(yangModelCmHandle)
then: 'the result is the response from DMI service'
when: 'a get module references is called'
def result = objectUnderTest.getModuleReferences(yangModelCmHandle)
then: 'the result is the response from DMI service'
[moduleName: 'mod2', revision: 'C', yangSource: 'other yang source']], HttpStatus.OK)
def expectedModuleReferencesInRequest = '{"name":"mod1","revision":"A"},{"name":"mod2","revision":"X"}'
mockDmiRestClient.postOperationWithJsonData("${dmiServiceName}/dmi/v1/ch/${cmHandleId}/moduleResources",
[moduleName: 'mod2', revision: 'C', yangSource: 'other yang source']], HttpStatus.OK)
def expectedModuleReferencesInRequest = '{"name":"mod1","revision":"A"},{"name":"mod2","revision":"X"}'
mockDmiRestClient.postOperationWithJsonData("${dmiServiceName}/dmi/v1/ch/${cmHandleId}/moduleResources",
- '{"data":{"modules":[' + expectedModuleReferencesInRequest + ']},"cmHandleProperties":{}}', [:]) >> responseFromDmi
+ '{"data":{"modules":[' + expectedModuleReferencesInRequest + ']},"cmHandleProperties":{}}') >> responseFromDmi
when: 'get new yang resources from DMI service'
def result = objectUnderTest.getNewYangResourcesFromDmi(yangModelCmHandle, newModuleReferences)
then: 'the result has the 2 expected yang (re)sources (order is not guaranteed)'
when: 'get new yang resources from DMI service'
def result = objectUnderTest.getNewYangResourcesFromDmi(yangModelCmHandle, newModuleReferences)
then: 'the result has the 2 expected yang (re)sources (order is not guaranteed)'
and: 'a positive response from DMI service when it is called with the expected parameters'
def responseFromDmi = new ResponseEntity<>([[moduleName: 'mod1', revision: 'A', yangSource: 'some yang source']], HttpStatus.OK)
mockDmiRestClient.postOperationWithJsonData("${dmiServiceName}/dmi/v1/ch/${cmHandleId}/moduleResources",
and: 'a positive response from DMI service when it is called with the expected parameters'
def responseFromDmi = new ResponseEntity<>([[moduleName: 'mod1', revision: 'A', yangSource: 'some yang source']], HttpStatus.OK)
mockDmiRestClient.postOperationWithJsonData("${dmiServiceName}/dmi/v1/ch/${cmHandleId}/moduleResources",
- '{"data":{"modules":[' + expectedModuleReferencesInRequest + ']},"cmHandleProperties":'+expectedAdditionalPropertiesInRequest+'}',
- [:]) >> responseFromDmi
+ '{"data":{"modules":[' + expectedModuleReferencesInRequest + ']},"cmHandleProperties":'+expectedAdditionalPropertiesInRequest+'}') >> responseFromDmi
when: 'get new yang resources from DMI service'
def result = objectUnderTest.getNewYangResourcesFromDmi(yangModelCmHandle, unknownModuleReferences)
then: 'the result is the response from DMI service'
when: 'get new yang resources from DMI service'
def result = objectUnderTest.getNewYangResourcesFromDmi(yangModelCmHandle, unknownModuleReferences)
then: 'the result is the response from DMI service'
sample 3:
value:
resourceIdentifier: "parent=shops,child=bookstore"
sample 3:
value:
resourceIdentifier: "parent=shops,child=bookstore"
- - name: Accept
- in: header
- description: "Accept parameter for response, if accept parameter is null,\
- \ that means client can accept any format."
- required: false
- schema:
- type: string
- enum:
- - application/json
- - application/yang-data+json
- name: options
in: query
description: "options parameter in query, it is mandatory to wrap key(s)=value(s)\
- name: options
in: query
description: "options parameter in query, it is mandatory to wrap key(s)=value(s)\
sample 3:
value:
resourceIdentifier: "parent=shops,child=bookstore"
sample 3:
value:
resourceIdentifier: "parent=shops,child=bookstore"
- - name: Accept
- in: header
- description: "Accept parameter for response, if accept parameter is null,\
- \ that means client can accept any format."
- required: false
- schema:
- type: string
- enum:
- - application/json
- - application/yang-data+json
- name: options
in: query
description: "options parameter in query, it is mandatory to wrap key(s)=value(s)\
- name: options
in: query
description: "options parameter in query, it is mandatory to wrap key(s)=value(s)\