* Refresh external schema.
*
*/
-@OnapCommandSchema(name = "schema-refresh", version="0.0", schema = "schema-refresh.yaml")
+@OnapCommandSchema(name = "schema-refresh", version="cli-1.0", schema = "schema-refresh.yaml")
public class OnapSchemaRefreshCommand extends OnapCommand {
@Override
List<String> cmdNames = new ArrayList<>();
List<String> cmdFiles = new ArrayList<>();
List<String> versions = new ArrayList<>();
+ List<String> cmdVersions = new ArrayList<>();
for (int i = 0; i < schemas.size(); i++) {
ExternalSchema schema = schemas.get(i);
cmdNames.add(schema.getCmdName());
cmdFiles.add(schema.getSchemaName());
versions.add(schema.getVersion());
+ cmdVersions.add(schema.getCmdVersion());
}
for (OnapCommandResultAttribute attribute : this.getResult().getRecords()) {
if ("sl-no".equals(attribute.getName())) {
attribute.setValues(slNumbers);
} else if ("command".equals(attribute.getName())) {
attribute.setValues(cmdNames);
+ } else if ("product-version".equals(attribute.getName())) {
+ attribute.setValues(cmdVersions);
} else if ("schema".equals(attribute.getName())) {
attribute.setValues(cmdFiles);
} else if ("version".equals(attribute.getName())) {
/**
* Validate schema command.
*/
-@OnapCommandSchema(name = "schema-validate", version="0.0", schema = "schema-validate.yaml")
+@OnapCommandSchema(name = "schema-validate", version="cli-1.0", schema = "schema-validate.yaml")
public class OnapSchemaValidateCommand extends OnapCommand {
@Override
onap_cmd_schema_version: 1.0
name: schema-refresh
description: Onap command to refresh schemas stored in onap_cli_schema folders.
-version: 0.0
+version: cli-1.0
service:
auth: none
name: onap-cli
description: Command name
scope: short
type: string
+ - name: product-version
+ description: Command product version
+ scope: short
+ type: string
- name: schema
description: Schema name
scope: short
String s1Number = onapCommandResultAttribute.get(0).getValues().get(0);
String cmdName = onapCommandResultAttribute.get(1).getValues().get(0);
- String cmdFile = onapCommandResultAttribute.get(2).getValues().get(0);
- String version = onapCommandResultAttribute.get(3).getValues().get(0);
+ String cmdVer = onapCommandResultAttribute.get(2).getValues().get(0);
+ String cmdFile = onapCommandResultAttribute.get(3).getValues().get(0);
+ String version = onapCommandResultAttribute.get(4).getValues().get(0);
assertTrue(s1Number.equalsIgnoreCase("1"));
assertTrue(cmdName.equalsIgnoreCase("sample-test1"));
assertTrue(cmdFile.equalsIgnoreCase("sample-test1-schema-http.yaml"));
assertTrue(version.equalsIgnoreCase("1.0"));
+ assertTrue(cmdVer.equalsIgnoreCase("cli-1.0"));
}
}