diff options
5 files changed, 114 insertions, 108 deletions
diff --git a/docs/end_to_end_onap_cli_commands.rst b/docs/end_to_end_onap_cli_commands.rst index 1a6a1a29..287f6f66 100644 --- a/docs/end_to_end_onap_cli_commands.rst +++ b/docs/end_to_end_onap_cli_commands.rst @@ -300,7 +300,8 @@ to mark VF certification start and complete. +--------------------------------------+--------------------------------------+--------------------------------------+--------------------------+----------+------------+ |328bd996-5edc-4677-92c4-f50a39411f13 |d4212714-2fd0-4396-bef6-3864e267be06 |b77ac5f7-f524-4076-995b-e3781fda1e7e |e3b2cebf-c72b-4b0f-b6af |1.0 |CERTIFIED | +--------------------------------------+--------------------------------------+--------------------------------------+--------------------------+----------+------------+ - |83e79e9f-f021-4356-ab97-a0f03d926311 |389a8234-23ed-4396-a9b4-ea65669a0d30 |b21eff2e-aa99-4284-a59f-baea1dcf77c6 |fcffa69b-52ce-4139-92ba |1.0 |CERTIFIED |+--------------------------------------+--------------------------------------+--------------------------------------+--------------------------+----------+------------+ + |83e79e9f-f021-4356-ab97-a0f03d926311 |389a8234-23ed-4396-a9b4-ea65669a0d30 |b21eff2e-aa99-4284-a59f-baea1dcf77c6 |fcffa69b-52ce-4139-92ba |1.0 |CERTIFIED | + +--------------------------------------+--------------------------------------+--------------------------------------+--------------------------+----------+------------+ |e4fa86fd-04ab-4faa-8351-3196e6b33c13 |0d9894d8-df48-4245-a52f-9437443908f0 |03f63ce4-dbb0-446c-87dc-fab9c5d09ec9 |cdb3ebd4-0c81-4e60-8184 |1.0 |CERTIFIED | +--------------------------------------+--------------------------------------+--------------------------------------+--------------------------+----------+------------+ |67c96cda-2035-413d-96de-9ea4aa206423 |c933ceb2-d68b-4bc1-962d-5e5073648fe5 |c3daf439-fa2a-4144-add5-9b543083d24e |a146fd50-ed50-4444-a859 |1.0 |CERTIFIED | diff --git a/docs/open_cli_schema_version_1_0.rst b/docs/open_cli_schema_version_1_0.rst index 59d0094e..92e6bab2 100644 --- a/docs/open_cli_schema_version_1_0.rst +++ b/docs/open_cli_schema_version_1_0.rst @@ -68,9 +68,11 @@ a line or a paragraph as given example here. Start the given service. To see the available services in the system use the command *service-list* -version +info ------- -*version* entry allows to tag the command template with the software product +product +~~~~~~~~ +*product* entry allows to tag the command template with the software product name and version, for which command is implemented and is recommended to use the following format: @@ -83,112 +85,12 @@ the following format: For example, to implement a command for Open Network Automation Platform (onap) version amsterdam, set the version as: - **version** : **onap-amsterdam** - -*CAUTION*: version should not have any space character in it. - -service -------- -Whether its information technology(IT) domain or communication technology(CT) -domain, every software product is made of one or more service components. For -example, onap has different components like aai, msb, etc and these components -provides different kind of resources/features and functionalities. - -*service* entry allows to mention the details of the given software product's -service. This is an section and is having entries defined in below sections. - -name -~~~~ -*name* entry allows to configure the service name. For example, to configure -service component 'aai' in onap-amsterdam product, + **product** : **onap-amsterdam** - service: - name: aai +*CAUTION*: product should not have any space character in it. -*CAUTION*: This entry is very signification to discover this service from the -service catalog and name should be matching with the service name registered -in the catalog. - -version -~~~~~~~ -*version* entry allows to mention the particular version of service for which -command is implemented. For example, the service 'aai' in the product -'onap-amsterdam' having versions like v11. - - service: - version: v11 - -*CAUTION*: This entry is very signification to discover this service from the -service catalog and version should be matching with the service version -registered in the catalog. - -mode -~~~~ -Some software product provides catalog service , where all service of that -product could be discovered. While other product does not. OCLIP provides -support for both kind of these products to implement commands and *mode* -entry allows to configure this mode of operation. - -CLIP supports in two different mode. - -In *catalog* mode, OCLIP will discover the service details based on given -*name* and *version* from the configured *host-url* parameter. For example, -the product 'onap-amsterdam' provides the service 'msb' as the catalog service where -all other services will get registered. so OCLIP can discover the given -service such as 'aai' from the catalog service 'msb'. In this mode, *host-url* -will be configured with the *msb* service url. In this case: - - service: - mode: catalog - -*NOTE*: To see the details of *host-url*, refer the section default_parameters - -In *direct* mode, OCLIP will not perform the discovery operation and consider -the given *host-url* as the direct service url. In this case: - - service: - mode: direct - -*NOTE*: To see the details of *host-url*, refer the section default_parameters - --------------------- - -auth -~~~~ -There are different kind of authentication and authorization approach exist and -for OCLIP provides support for following approaches. Based on the approach -configured in the template, OCLIP will login before executing the command and -logout afterwards. - -none -^^^^^ -In this approach, no login and logout will be performed. This is useful during -the development cycle, as well as some services are available in public -without authentication of user. In this approach, OCLIP ignores the given -*host-username* and *host-password*. So the none auth is defined by: - - service: - auth: none - -*NOTE*: To see the details of *host-username* and *host-password*, refer the -section default_parameters - - -basic -^^^^^ -This is HTTP basic authentication approach and given *host-username* and -*host-password* values are used to find the hash and use it as Authentication -value. So the none auth is defined by: - - service: - auth: basic - -*NOTE*: To see the details of *host-username* and *host-password*, refer the -section default_parameters - --------------------- -paramters +parameters --------- Every command has set of arguments to provide the input values and *parameters* section allows to add the required arguments details such as name, description, @@ -696,6 +598,106 @@ OCLIP is enhanced to support REST API based products and *http* section is provided to capture all required details for performing http operation for the given command. +service +------- +Whether its information technology(IT) domain or communication technology(CT) +domain, every software product is made of one or more service components. For +example, onap has different components like aai, msb, etc and these components +provides different kind of resources/features and functionalities. + +*service* entry allows to mention the details of the given software product's +service. This is an section and is having entries defined in below sections. + +name +~~~~ +*name* entry allows to configure the service name. For example, to configure +service component 'aai' in onap-amsterdam product, + + service: + name: aai + +*CAUTION*: This entry is very signification to discover this service from the +service catalog and name should be matching with the service name registered +in the catalog. + +version +~~~~~~~ +*version* entry allows to mention the particular version of service for which +command is implemented. For example, the service 'aai' in the product +'onap-amsterdam' having versions like v11. + + service: + version: v11 + +*CAUTION*: This entry is very signification to discover this service from the +service catalog and version should be matching with the service version +registered in the catalog. + +mode +~~~~ +Some software product provides catalog service , where all service of that +product could be discovered. While other product does not. OCLIP provides +support for both kind of these products to implement commands and *mode* +entry allows to configure this mode of operation. + +CLIP supports in two different mode. + +In *catalog* mode, OCLIP will discover the service details based on given +*name* and *version* from the configured *host-url* parameter. For example, +the product 'onap-amsterdam' provides the service 'msb' as the catalog service where +all other services will get registered. so OCLIP can discover the given +service such as 'aai' from the catalog service 'msb'. In this mode, *host-url* +will be configured with the *msb* service url. In this case: + + service: + mode: catalog + +*NOTE*: To see the details of *host-url*, refer the section default_parameters + +In *direct* mode, OCLIP will not perform the discovery operation and consider +the given *host-url* as the direct service url. In this case: + + service: + mode: direct + +*NOTE*: To see the details of *host-url*, refer the section default_parameters + +-------------------- + +auth +~~~~ +There are different kind of authentication and authorization approach exist and +for OCLIP provides support for following approaches. Based on the approach +configured in the template, OCLIP will login before executing the command and +logout afterwards. + +none +^^^^^ +In this approach, no login and logout will be performed. This is useful during +the development cycle, as well as some services are available in public +without authentication of user. In this approach, OCLIP ignores the given +*host-username* and *host-password*. So the none auth is defined by: + + service: + auth: none + +*NOTE*: To see the details of *host-username* and *host-password*, refer the +section default_parameters + + +basic +^^^^^ +This is HTTP basic authentication approach and given *host-username* and +*host-password* values are used to find the hash and use it as Authentication +value. So the none auth is defined by: + + service: + auth: basic + +*NOTE*: To see the details of *host-username* and *host-password*, refer the +section default_parameters + +-------------------- request ~~~~~~~ *request* section captures all HTTP request information as: diff --git a/products/onap-amsterdam/features/aai/src/main/resources/open-cli-schema/customer/customer-list-schema-1.1.yaml b/products/onap-amsterdam/features/aai/src/main/resources/open-cli-schema/customer/customer-list-schema-1.1.yaml index ca2fd79c..909c10bf 100644 --- a/products/onap-amsterdam/features/aai/src/main/resources/open-cli-schema/customer/customer-list-schema-1.1.yaml +++ b/products/onap-amsterdam/features/aai/src/main/resources/open-cli-schema/customer/customer-list-schema-1.1.yaml @@ -1,6 +1,6 @@ open_cli_schema_version: 1.0 name: customer-list -description: Lists the registetred customers in Onap +description: Lists the registered customers in Onap info: product: onap-amsterdam diff --git a/products/onap-amsterdam/features/aai/src/main/resources/open-cli-schema/customer/customer-show-schema-1.1.yaml b/products/onap-amsterdam/features/aai/src/main/resources/open-cli-schema/customer/customer-show-schema-1.1.yaml index f8cb93d0..67c5bf0f 100644 --- a/products/onap-amsterdam/features/aai/src/main/resources/open-cli-schema/customer/customer-show-schema-1.1.yaml +++ b/products/onap-amsterdam/features/aai/src/main/resources/open-cli-schema/customer/customer-show-schema-1.1.yaml @@ -1,6 +1,6 @@ open_cli_schema_version: 1.0 name: customer-show -description: Lists the registetred customers in Onap +description: Retrieves the given registered customer in Onap info: product: onap-amsterdam diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java b/profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java index 4af591ae..8e01b585 100644 --- a/profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java +++ b/profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java @@ -331,6 +331,9 @@ public class OnapCommandSchemaHttpLoader { List<String> invaliResultMapParams = resultMapParams.stream() .filter(p -> !resultAttNames.contains(p)).collect(Collectors.toList()); + List<String> attributesMissing = resultAttNames.stream() + .filter(p -> !resultMapParams.contains(p)).collect(Collectors.toList()); + invaliResultMapParams.addAll(attributesMissing); if (!invaliResultMapParams.isEmpty()) { OnapCommandUtils.throwOrCollect(new OnapCommandHttpInvalidResultMap(invaliResultMapParams), errorList, true); |