diff options
Diffstat (limited to 'products/onap-dublin')
5 files changed, 261 insertions, 0 deletions
diff --git a/products/onap-dublin/features/policy/src/main/resources/open-cli-sample/policy/policy-list-outdated-schema-dublin-moco.json b/products/onap-dublin/features/policy/src/main/resources/open-cli-sample/policy/policy-list-outdated-schema-dublin-moco.json new file mode 100644 index 00000000..f9b2aaa0 --- /dev/null +++ b/products/onap-dublin/features/policy/src/main/resources/open-cli-sample/policy/policy-list-outdated-schema-dublin-moco.json @@ -0,0 +1,40 @@ +[ { + "request" : { + "method" : "post", + "uri" : "/pdp/api/getConfig", + "headers" : { + "Authorization" : "Basic dGVzdHBkcDphbHBoYTEyMw==", + "X-FromAppId" : "ONAP CLI", + "Accept" : "application/json", + "Environment" : "TEST", + "X-TransactionId" : "req-6daad440-515a-4134-94bb-4fdf99cdc92e", + "ClientAuth" : "cHl0aG9uOnRlc3Q=", + "Content-Type" : "application/json" + }, + "json" : { + "configAttributes" : { }, + "policyName" : ".*" + } + }, + "response" : { + "status" : 200, + "json" : [ { + "policyConfigMessage" : "Config Retrieved! ", + "policyConfigStatus" : "CONFIG_RETRIEVED", + "type" : "JSON", + "config" : "{\"service\":\"distancePolicy\",\"guard\":\"False\",\"content\":{\"policyType\":\"distance_to_location\",\"applicableResources\":\"any\",\"identity\":\"distance-vLB\",\"policyScope\":[\"vlb\",\"us\",\"international\",\"ip\"],\"distanceProperties\":{\"distance\":{\"value\":\"100\",\"unit\":\"km\",\"operator\":\"<\"},\"locationInfo\":\"customer_loc\"},\"resources\":[\"vLB\",\"VlbhpaSriov\"]},\"priority\":\"3\",\"templateVersion\":\"OpenSource.version.1\",\"riskLevel\":\"2\",\"description\":\"Distance Policy for vLB\",\"policyName\":\"OSDF_CASABLANCA.Distance_vLBHPA_SRIOV_1\",\"version\":\"test1\",\"riskType\":\"test\"}", + "policyName" : "OSDF_CASABLANCA.Config_MS_Distance_vLBHPA_SRIOV_1.1.xml", + "policyType" : "MicroService", + "policyVersion" : "1", + "matchingConditions" : { + "ECOMPName" : "SampleDemo", + "ONAPName" : "SampleDemo", + "service" : "distancePolicy", + "policyScope" : "vlb,us,international,ip", + "policyType" : "distance_to_location" + }, + "responseAttributes" : { }, + "property" : null + } ] + } +} ] diff --git a/products/onap-dublin/features/policy/src/main/resources/open-cli-sample/policy/policy-list-outdated-schema-dublin-sample.yaml b/products/onap-dublin/features/policy/src/main/resources/open-cli-sample/policy/policy-list-outdated-schema-dublin-sample.yaml new file mode 100644 index 00000000..176f822e --- /dev/null +++ b/products/onap-dublin/features/policy/src/main/resources/open-cli-sample/policy/policy-list-outdated-schema-dublin-sample.yaml @@ -0,0 +1,25 @@ +open_cli_sample_version: 1.0 +name: policy-list-outdated +version: onap-dublin +samples: + sample1: + name: policy-list-outdated + input: -m https://10.12.6.129:30694 -u testpdp -p alpha123 + moco: policy-list-outdated-schema-dublin-moco.json + output: | + +----------------------------------------------------+--------------+----------------------------------------------------+ + |name |type |config | + +----------------------------------------------------+--------------+----------------------------------------------------+ + |OSDF_CASABLANCA.Config_MS_Distance_vLBHPA_SRIOV_1. |MicroService |{"service":"distancePolicy","guard":"False","conte | + |1.xml | |nt":{"policyType":"distance_to_location","applicab | + | | |leResources":"any","identity":"distance-vLB","poli | + | | |cyScope":["vlb","us","international","ip"],"distan | + | | |ceProperties":{"distance":{"value":"100","unit":"k | + | | |m","operator":"<"},"locationInfo":"customer_loc"}, | + | | |"resources":["vLB","VlbhpaSriov"]},"priority":"3", | + | | |"templateVersion":"OpenSource.version.1","riskLeve | + | | |l":"2","description":"Distance Policy for vLB","po | + | | |licyName":"OSDF_CASABLANCA.Distance_vLBHPA_SRIOV_1 | + | | |","version":"test1","riskType":"test"} | + +----------------------------------------------------+--------------+----------------------------------------------------+ + diff --git a/products/onap-dublin/features/policy/src/main/resources/open-cli-schema/policy/policy-list-outdated-schema-dublin.yaml b/products/onap-dublin/features/policy/src/main/resources/open-cli-schema/policy/policy-list-outdated-schema-dublin.yaml new file mode 100644 index 00000000..17769848 --- /dev/null +++ b/products/onap-dublin/features/policy/src/main/resources/open-cli-schema/policy/policy-list-outdated-schema-dublin.yaml @@ -0,0 +1,88 @@ +# Copyright 2019 Intel Corporation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +open_cli_schema_version: 1.0 +name: policy-list-outdated +description: List policies + +info: + product: onap-dublin + service: policy + author: ONAP HPA Team onap-discuss@lists.onap.org + +parameters: + - name: policy-name + description: ONAP policy name + type: string + long_option: policy-name + short_option: x + is_optional: false + default_value: .* + - name: config-attributes + description: Configuration Attributes + type: json + long_option: config-attributes + short_option: A + is_optional: true + default_value: {} + +results: + direction: landscape + attributes: + - name: name + description: Policy Name + scope: short + type: string + - name: type + description: Policy type + scope: short + type: string + - name: config + description: Policy configuration + scope: short + type: json + - name: version + description: Policy version + scope: long + type: string + - name: rules + description: Policy rules + scope: long + type: json +http: + service: + name: policy + version: v1.0 + auth: basic + mode: direct + request: + uri: /pdp/api/getConfig + method: POST + body: '{"configAttributes": "${config-attributes}", "policyName": "${policy-name}"}' + headers: + Accept: application/json + ClientAuth: cHl0aG9uOnRlc3Q= + Environment: TEST + + + success_codes: + - 200 + + result_map: + name: $b{$.[*].policyName} + type: $b{$.[*].policyType} + version: $b{$.[*].policyVersion} + config: $b{$.[*].config} + rules: $b{$.[*].matchingConditions} + diff --git a/products/onap-dublin/features/policy/src/main/resources/open-cli-schema/policy/policy-type-delete-schema-dublin.yaml b/products/onap-dublin/features/policy/src/main/resources/open-cli-schema/policy/policy-type-delete-schema-dublin.yaml new file mode 100644 index 00000000..50d8d53f --- /dev/null +++ b/products/onap-dublin/features/policy/src/main/resources/open-cli-schema/policy/policy-type-delete-schema-dublin.yaml @@ -0,0 +1,51 @@ +# Copyright © Intel Corporation 2019 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +open_cli_schema_version: 1.0 +name: policy-delete-type +description: Delete all versions of a policy type + +info: + product: onap-dublin + service: policy + author: ONAP CLI Team onap-discuss@lists.onap.org + +parameters: + - name: policy-type-id + description: Policy type ID + type: string + short_option: x + long_option: policy-type-id + is_optional: false + +http: + service: + name: policy + version: v1.0 + auth: basic + mode: direct + request: + uri: /policy/api/v1/policytypes/${policy-type-id} + method: DELETE + context: + remove_empty_node: true + headers: + Content-Type: application/json + Accept: application/json + Environment: TEST + + success_codes: + - 404 + - 204 + diff --git a/products/onap-dublin/features/policy/src/main/resources/open-cli-schema/policy/policy-type-delete-with-version-schema-dublin.yaml b/products/onap-dublin/features/policy/src/main/resources/open-cli-schema/policy/policy-type-delete-with-version-schema-dublin.yaml new file mode 100644 index 00000000..717e2f91 --- /dev/null +++ b/products/onap-dublin/features/policy/src/main/resources/open-cli-schema/policy/policy-type-delete-with-version-schema-dublin.yaml @@ -0,0 +1,57 @@ +# Copyright © Intel Corporation 2019 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +open_cli_schema_version: 1.0 +name: policy-delete-type-with-version +description: Delete one version of a policy type + +info: + product: onap-dublin + service: policy + author: ONAP CLI Team onap-discuss@lists.onap.org + +parameters: + - name: policy-type-id + description: Policy type ID + type: string + short_option: x + long_option: policy-type-id + is_optional: false + - name: version-id + description: Policy type version ID + type: string + short_option: y + long_option: version-id + is_optional: false + +http: + service: + name: policy + version: v1.0 + auth: basic + mode: direct + request: + uri: /policy/api/v1/policytypes/${policy-type-id}/versions/${version-id} + method: DELETE + context: + remove_empty_node: true + headers: + Content-Type: application/json + Accept: application/json + Environment: TEST + + success_codes: + - 404 + - 204 + |