From b039682a6805507445139e2b2430144f92724b09 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Thu, 12 Apr 2018 19:13:59 -0400 Subject: Copy LCM interface from APP-C Change-Id: Idc18aa00bcbcee3f51473339b6b4ad90f6b4bffc Issue-ID: CCSDK-219 Signed-off-by: Timoney, Dan (dt5972) --- lcm/model/src/main/yang/lcm.yang | 1309 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 1309 insertions(+) create mode 100644 lcm/model/src/main/yang/lcm.yang (limited to 'lcm/model/src/main/yang/lcm.yang') diff --git a/lcm/model/src/main/yang/lcm.yang b/lcm/model/src/main/yang/lcm.yang new file mode 100644 index 000000000..9976dd9e5 --- /dev/null +++ b/lcm/model/src/main/yang/lcm.yang @@ -0,0 +1,1309 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP : APPC + * ================================================================================ + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Copyright (C) 2017 Amdocs + * ============================================================================= + * 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. + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + * ============LICENSE_END========================================================= + */ + +/* + * Yang model for the Application Controller (APP-C) component of ECOMP + * + * This model is used to define the data and services of the Application Controller + * component of ECOMP. The APP-C controller initiates the processing of directed + * graphs, which define the actual process implementations used. The name of the + * directed graph is set by properties and cannot be changed dynamically. + * + * The services exposed by this provider are: + * + * restart-vnf: + * Used to request a restart of a virtual network function (a VM). + * + * rebuild-vnf: + * Used to request a rebuild of a virtual network function (a VM). + * + */ + +module LCM { + + yang-version 1; + namespace "org:onap:ccsdk:sli:northbound:lcm"; + prefix lcm; + + description + "Defines the services and request/response requirements for the CCSDK LCM component."; + + /* + * Note, the revision changes the package name of the generated java code. Do not + * change the revision unless you also update all references to the bindings. + */ + revision "2018-03-29" { + description + "CCSDK LCM interface version 0.2.1"; + } + + /********************************************************************************** + * Data type definitions + * + * The following data type definitions are used to define common data structures, + * define constraints, or to impart special meanings to data objects related to the + * APP-C controller functions. + **********************************************************************************/ + + typedef ZULU { + description "Define a common definition of a time stamp (expressed as a formatted + string) as follows yyyy-MM-ddTHH:mm:ss.SSSSSSSSZ"; + type string { + length "16..28"; + pattern "[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}T[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}.[0-9]{1,6}Z"; + } + } + + typedef payload { + type string ; + description "The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value"; + } + + typedef action { + type enumeration { + enum "Restart"; + enum "Rebuild"; + enum "Migrate"; + enum "Evacuate"; + enum "Snapshot"; + enum "Rollback"; + enum "Sync"; + enum "Audit"; + enum "Stop"; + enum "Start"; + enum "Terminate"; + enum "SoftwareUpload"; + enum "HealthCheck"; + enum "LiveUpgrade"; + enum "Lock"; + enum "Unlock"; + enum "Test"; + enum "CheckLock"; + enum "Configure"; + enum "ConfigModify"; + enum "ConfigScaleOut"; + enum "ConfigRestore"; + enum "ConfigBackup"; + enum "ConfigBackupDelete"; + enum "ConfigExport"; + enum "StopApplication"; + enum "StartApplication"; + enum "QuiesceTraffic"; + enum "ResumeTraffic"; + enum "UpgradePreCheck"; + enum "UpgradeSoftware"; + enum "UpgradePostCheck"; + enum "UpgradeBackup"; + enum "UpgradeBackout"; + enum "ActionStatus"; + enum "Query"; + enum "Reboot"; + enum "AttachVolume"; + enum "DetachVolume"; + + } + description "The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate"; + } + + typedef vm-state { + description "The state of a VM"; + type enumeration { + enum "active"; + enum "standby"; + enum "inactive"; + enum "unknown"; + } + } + + typedef vm-status { + description "The status of a VM"; + type enumeration { + enum "healthy"; + enum "unhealthy"; + enum "unknown"; + } + } + + + /********************************************************************************** + * Basic manipulation of a VNF (or VM) will typically include querying the current + * state, restarting, rebuilding, stopping, starting, etc. In all of these basic + * "state"-type operations, the services require the identification of the VNF to + * be operated on, and the region or LCP that contains that resource. This + * information is used across all of these services, so it has been defined as a + * common structure here and is referenced in the appropriate RPC definitions. + **********************************************************************************/ + + + /********************************************************************************** + * All requests will include this standard header + * + * The standard request header is used to define a correlation identification for + * the request that is returned on all responses. This correlation identifier + * (called the service-request-id) is meaningful to the caller and is included on + * all responses from the services. + **********************************************************************************/ + + /********************************************************************************** + * All responses will include this standard header + * + * The standard response header includes the time of completion as well as a + * success|failure indication + **********************************************************************************/ + + grouping common-header { + description "A common header for all APP-C requests"; + container common-header { + description "A common header for all APP-C requests"; + leaf timestamp { + description "timestamp is in ISO 8601 timestamp format ZULU offset"; + type ZULU; + mandatory true; + } + + leaf api-ver { + description "api-ver is the API version identifier. A given release of APPC + should support all previous versions of APPC API (correlate with + general requirements)"; + type string { + pattern "[2]\.\d\d" { + error-message "API Version 2.XX is supported at this end point"; + } + } + mandatory true; + } + + leaf originator-id { + description "originator-id an identifier of the calling system which can be + used addressing purposes, i.e. returning asynchronous response + to the proper destination over DMaaP (especially in case of multiple + consumers of APP-C APIs)"; + type string; + mandatory true; + } + + leaf request-id { + description "UUID for the request ID. An OSS/BSS identifier for the request + that caused the current action. Multiple API calls may be made + with the same request-id The request-id shall be recorded throughout + the operations on a single request"; + type string; + mandatory true; + } + + leaf sub-request-id { + description "Uniquely identifies a specific LCM action. It is persistent over + the life-cycle of a single request"; + type string; + mandatory false; + } + + + /********************************************************************************** + * Flags are generic flags that apply to any and all commands, all are optional + * force = TRUE/FALSE - Execute command even if target is in unstable (i.e. locked, transiting, etc) + * state. Specific behaviour of forced commands varies, but implies cancellation + * of previous command and an override by the new command. The FALSE value is + * used by default. + * ttl = <0....N> - The timeout value for command execution, expressed in seconds + * mode = EXCLUSIVE/NORMAL - defines execution mode as follows: + * - EXCLUSIVE ? on encountering an exclusive command, the APP-C will: + * * Cease accepting additional command requests + * * Complete execution of outstanding commands + * * Execute the exclusive command to completion + * * Optionally report the result of the command + * * Optionally resume command acceptance and processing + * - NORMAL - Obverse of EXCLUSIVE, the default one. + **********************************************************************************/ + container flags { + description "Flags are generic flags that apply to any and all commands, all are optional"; + leaf mode { + type enumeration { + enum "EXCLUSIVE"; + enum "NORMAL"; + } + description "EXCLUSIVE (accept no queued requests on this VNF while processing) + or NORMAL (queue other requests until complete)"; + mandatory false; + } + leaf force { + type enumeration { + enum "TRUE"; + enum "FALSE"; + } + description "TRUE/FALSE - Execute action even if target is in unstable (i.e. + locked, transiting, etc.) state"; + mandatory false; + } + leaf ttl { + description "<0....N> - The timeout value (expressed in seconds) for action + execution, between action being received by APPC and action initiation"; + type uint16; + mandatory false; + } + } + } + } + + + grouping action-identifiers { + description "A block containing the action arguments. These are used to specify + the object upon which APP-C LCM command is to operate"; + container action-identifiers { + description "A block containing the action arguments. These are used to specify + the object upon which APP-C LCM command is to operate"; + leaf service-instance-id { + description "identifies a specific service the command refers to. When multiple + APP-C instances are used and applied to a subset of services, + this will become significant . The field is mandatory when the + vnf-id is empty"; + type string; + mandatory false; + } + leaf vnf-id { + description "identifies the VNF to which this action is to be applied(vnf-id + uniquely identifies the service-instance referred to). Note that + some actions are applied to multiple VNFs in the same service. + When this is the case, vnf-id may be left out, but service-instance-id + must appear. The field is mandatory when service-instance-id is + empty"; + type string; + mandatory false; + } + leaf vf-module-id { + description "identifies the VF module to which this action is to be applied."; + type string; + mandatory false; + } + leaf vnfc-name { + description "identifies the VNFC to which this action is to be applied. Some + actions apply only to a component within a VNF (e.g. RESTART is + sometimes applied to on VM only). In such a case, the name of + the VNFC is used to search for the component within the VNF"; + type string; + mandatory false; + } + leaf vserver-id { + description "identifies a specific VM within the given service/vnf to which + this action is to be applied"; + type string; + mandatory false; + } + } + } + + + grouping status { + description "The specific response codes are to be aligned with SDC reference doc + (main table removed to avoid duplication and digression from main table). + See SDC and ECOMP Distribution Consumer Interface Agreement"; + container status { + description "The specific response codes are to be aligned with SDC reference doc + (main table removed to avoid duplication and digression from main table). + See SDC and ECOMP Distribution Consumer Interface Agreement"; + leaf code { + description "Response code"; + type uint16; + mandatory true; + } + leaf message { + description "Response message"; + type string; + mandatory true; + } + } + } + + typedef lcm-action-status { + type enumeration { + enum "IN_PROGRESS"; + enum "SUCCESSFUL"; + enum "FAILED"; + enum "NOT_FOUND"; + enum "ABORTED"; + enum "MULTIPLE_REQUESTS_FOUND"; + } + description "The status of the requested LCM action"; + } + + /********************************************************************************** + * Define the restart service + **********************************************************************************/ + rpc restart { + description "An operation to restart a virtual network function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the rebuild service + **********************************************************************************/ + rpc rebuild { + description "An operation to rebuild a virtual network function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the migrate service + **********************************************************************************/ + rpc migrate { + description "An operation to migrate a virtual network function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the evacuate service + **********************************************************************************/ + rpc evacuate { + description "An operation to evacuate a virtual network function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the snapshot service + **********************************************************************************/ + rpc snapshot { + description "An operation to create a snapshot of a virtual network function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + leaf identity-url { + type string; + mandatory true; + } + } + output { + uses common-header; + uses status; + leaf snapshot-id { + type string; + } + } + } + /********************************************************************************** + * Define the VNF quiesce traffic service + **********************************************************************************/ + rpc quiesce-traffic { + description "An operation to stop traffic gracefully on the VF. + It stops traffic gracefully without stopping the application"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory true; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the VNF resume traffic service + **********************************************************************************/ + rpc resume-traffic { + description "An operation to resume traffic gracefully on the VF. + It resumes traffic gracefully without stopping the application"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory true; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the VNF UpgradePreCheck service + **********************************************************************************/ + rpc upgrade-pre-check { + description "An operation to check that the VNF has the correct software version needed for a software upgrade."; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory true; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the VNF UpgradeSoftware service + **********************************************************************************/ + rpc upgrade-software { + description "An operation to upgrade the target VNF to a new version and expected that the VNF is in a quiesced status ."; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory true; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the VNF UpgradePostCheck service + **********************************************************************************/ + rpc upgrade-post-check { + description "An operation to check the VNF upgrade has been successful completed and all processes are running properly."; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory true; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the VNF UpgradeBackup service + **********************************************************************************/ + rpc upgrade-backup { + description "An operation to do full backup of the VNF data prior to an upgrade."; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory true; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the VNF UpgradeBackout service + **********************************************************************************/ + rpc upgrade-backout { + description "An operation does a backout after an UpgradeSoftware is completed (either successfully or unsuccessfully)."; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory true; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the rollback service + **********************************************************************************/ + rpc rollback { + description "An operation to rollback to particular snapshot of a virtual network function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + leaf identity-url { + type string; + mandatory true; + } + leaf snapshot-id { + type string; + mandatory true; + } + } + output { + uses common-header; + uses status; + } + } + + + /********************************************************************************** + * Additional RPCs added here... + **********************************************************************************/ + + + /********************************************************************************** + * Define the sync service + **********************************************************************************/ + rpc sync { + description "An operation to sync the configurations of a virtual network function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + leaf payload { + type payload; + mandatory false; + } + } + } + + /********************************************************************************** + * Define the terminate service + **********************************************************************************/ + rpc terminate { + description "An operation to terminate the configurations of a virtual network function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + + rpc configure { + description "An operation to configure the configurations of a virtual network + function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + leaf payload { + type payload; + mandatory false; + } + } + } + + rpc config-modify { + description "Use the ModifyConfig command when a full configuration cycle is either not required + or is considered too costly. The ModifyConfig LCM action affects only a subset of the + total configuration data of a VNF. The set of configuration parameters to be affected + is a subset of the total configuration data of the target VNF type. The payload Stop + Application must contain the configuration parameters to be modified and their values. + A successful modify returns a success response. A failed modify returns a failure + response and the specific failure messages in the response payload Stop Application"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + leaf payload { + type payload; + mandatory false; + } + } + } + + rpc config-scale-out { + description "An operation to Modify the configuration or other action to support + a ConfigScaleOut of a VNF."; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + leaf payload { + type payload; + mandatory false; + } + } + } + + rpc config-restore { + description "An operation to restore the configurations of a virtual network + function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + leaf payload { + type payload; + mandatory false; + } + } + } + + /********************************************************************************** + * Define the test service + **********************************************************************************/ + rpc test { + description "An operation to test the configurations of a virtual network function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the stop service + **********************************************************************************/ + rpc stop { + description "An operation to stop the configurations of a virtual network function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + rpc start { + description "An operation to start a virtual network function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the audit service + **********************************************************************************/ + rpc audit { + description "An operation to audit the configurations of a virtual network function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + leaf payload { + type payload; + mandatory false; + } + } + } + + /********************************************************************************** + * Define the SoftwareUpload vSCP service + **********************************************************************************/ + rpc software-upload { + description "An operation to upload a new version of vSCP image to vSCP for updating it"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the PreHealthCheck vSCP service + **********************************************************************************/ + rpc health-check { + description "An operation to perform health check of vSCP prior its upgrading"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + + /********************************************************************************** + * Define the Upgrade vSCP service + **********************************************************************************/ + rpc live-upgrade { + description "An operation to perform upgrade of vSCP"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + + /********************************************************************************** + * Define the VNF lock service + **********************************************************************************/ + rpc lock { + description "An operation to perform VNF lock operation"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the VNF unlock service + **********************************************************************************/ + rpc unlock { + description "An operation to perform VNF unlock operation"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the VNF check lock service + **********************************************************************************/ + rpc check-lock { + description "An operation to check VNF lock status"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + } + output { + uses common-header; + uses status; + leaf locked { + type enumeration { + enum "TRUE"; + enum "FALSE"; + } + description "TRUE/FALSE - returns TRUE when the given VNF was locked, otherwise returns FALSE"; + mandatory false; + } + } + } + + + rpc config-backup { + description "An operation to Backup configurations of a virtual network function + (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + leaf payload { + type payload; + mandatory false; + } + } + } + + rpc config-backup-delete { + description "An operation to Delete backup configurations of a virtual network + function (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + } + output { + uses common-header; + uses status; + leaf payload { + type payload; + mandatory false; + } + } + } + + rpc config-export { + description "An operation to Export configurations of a virtual network function + (or VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + } + output { + uses common-header; + uses status; + } + } + rpc stop-application { + description "An operation to Stop Application traffic to a virtual network function"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the VNF Start Application service + **********************************************************************************/ + rpc start-application { + description "An operation to perform VNF Start Application operation"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + + /********************************************************************************** + * Gets the current state of the previously submitted LCM request + **********************************************************************************/ + rpc action-status { + description "An operation to get the current state of the previously submitted LCM request"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + leaf payload { + type payload; + } + } + } + + /********************************************************************************** + * Define the VNF Query service + **********************************************************************************/ + rpc query { + description "An operation to query the status of a targe VNF. + Returns information on each VM, including state (active or standby) + and status (healthy or unhealthy)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + } + output { + uses common-header; + uses status; + list query-results { + leaf vserver-id { + description "Identifier of a VM"; + type string; + mandatory true; + } + leaf vm-state { + description "The state of the VM"; + type vm-state; + mandatory true; + } + leaf vm-status { + description "the status of the VM"; + type vm-status; + mandatory true; + } + } + } + } + + /********************************************************************************** + * Define the Reboot service + **********************************************************************************/ + rpc reboot { + description "An operation to reboot a specified virtual machine (VM)"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory false; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the VM attach volume service + **********************************************************************************/ + rpc attach-volume { + description "An operation to attach a cinder volume to a VM"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory true; + } + } + output { + uses common-header; + uses status; + } + } + + /********************************************************************************** + * Define the VM detach volume service + **********************************************************************************/ + rpc detach-volume { + description "An operation to detach a cinder volume from a VM"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory true; + } + } + output { + uses common-header; + uses status; + } + } + + + + /********************************************************************************** + * Additional RPCs added here... + **********************************************************************************/ +} -- cgit 1.2.3-korg From 634b640f2aa3779b94ab54ebf959030b563fb072 Mon Sep 17 00:00:00 2001 From: "Agarwal, Ruchira(ra1926)" Date: Mon, 20 Aug 2018 16:13:20 +0000 Subject: add LCM DistributeTraffic LCM API for DistributeTraffic Change-Id: I4b3c323d46bd088421d0d6d66fc23982bf086679 Issue-ID: CCSDK-477 Signed-off-by: Agarwal, Ruchira(ra1926) --- lcm/model/src/main/yang/lcm.yang | 25 +++++++++++++++ .../org/onap/ccsdk/sli/northbound/LcmProvider.java | 21 +++++++++++++ .../onap/ccsdk/sli/northbound/TestLcmProvider.java | 36 ++++++++++++++++++++++ .../graphs/lcm/LCM_distribute-traffic.xml | 30 ++++++++++++++++++ .../src/test/resources/graphs/lcm/graph.versions | 1 + 5 files changed, 113 insertions(+) create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_distribute-traffic.xml (limited to 'lcm/model/src/main/yang/lcm.yang') diff --git a/lcm/model/src/main/yang/lcm.yang b/lcm/model/src/main/yang/lcm.yang index 9976dd9e5..a03fff607 100644 --- a/lcm/model/src/main/yang/lcm.yang +++ b/lcm/model/src/main/yang/lcm.yang @@ -111,6 +111,7 @@ module LCM { enum "StartApplication"; enum "QuiesceTraffic"; enum "ResumeTraffic"; + enum "DistributeTraffic"; enum "UpgradePreCheck"; enum "UpgradeSoftware"; enum "UpgradePostCheck"; @@ -516,6 +517,30 @@ module LCM { } } + /********************************************************************************** + * Define the VNF distribute traffic service + **********************************************************************************/ + rpc distribute-traffic { + description "An operation to distribute traffic gracefully on the VF. + It distributes traffic gracefully without stopping the application"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory true; + } + } + output { + uses common-header; + uses status; + } + } + /********************************************************************************** * Define the VNF UpgradePreCheck service **********************************************************************************/ diff --git a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java index 787a94e2b..939836bed 100644 --- a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java +++ b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java @@ -350,6 +350,27 @@ public class LcmProvider implements AutoCloseable, LCMService { return Futures.immediateFuture(rpcResult); } + @Override + public Future> distributeTraffic(DistributeTrafficInput input) { + DistributeTrafficInputBuilder iBuilder = new DistributeTrafficInputBuilder(input); + DistributeTrafficOutputBuilder oBuilder = new DistributeTrafficOutputBuilder(); + + try { + CommonLcmFields retval = callDG("distribute-traffic", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug("Caught exception", e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + @Override public Future> configure(ConfigureInput input) { ConfigureInputBuilder iBuilder = new ConfigureInputBuilder(input); diff --git a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java index 38920e0ba..234eb615f 100644 --- a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java +++ b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java @@ -73,6 +73,8 @@ import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329. import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigureOutput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DetachVolumeInputBuilder; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DetachVolumeOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DistributeTrafficInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DistributeTrafficOutput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.EvacuateInputBuilder; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.EvacuateOutput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.HealthCheckInputBuilder; @@ -526,6 +528,40 @@ public class TestLcmProvider { } } + @Test + public void testDistributeTraffic() { + DistributeTrafficInputBuilder builder = new DistributeTrafficInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.DistributeTraffic); + builder.setPayload(mock(Payload.class)); + + + try { + DistributeTrafficOutput results = provider.distributeTraffic(builder.build()).get().getResult(); + LOG.info("DistributeTraffic returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("DistributeTraffic threw exception"); + } + } + @Test public void testConfigure() { ConfigureInputBuilder builder = new ConfigureInputBuilder(); diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_distribute-traffic.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_distribute-traffic.xml new file mode 100644 index 000000000..14ff1134c --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_distribute-traffic.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/graph.versions b/lcm/provider/src/test/resources/graphs/lcm/graph.versions index 4ca21daf3..233aa459f 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/graph.versions +++ b/lcm/provider/src/test/resources/graphs/lcm/graph.versions @@ -27,6 +27,7 @@ LCM stop-application 1.0.0 sync LCM start-application 1.0.0 sync LCM quiesce-traffic 1.0.0 sync LCM resume-traffic 1.0.0 sync +LCM distribute-traffic 1.0.0 sync LCM upgrade-pre-check 1.0.0 sync LCM upgrade-software 1.0.0 sync LCM upgrade-post-check 1.0.0 sync -- cgit 1.2.3-korg From cbe2411c3460693a9d1843698c4a4b0d73f65a14 Mon Sep 17 00:00:00 2001 From: Driptaroop Das Date: Thu, 10 Jan 2019 13:50:04 +0530 Subject: merged lcm.yang from app-c Merged differences from lcm.yang from appc to ccsdk. Issue-ID: CCSDK-925 Change-Id: I6b179f5a184408673231b57f8fc5d331bc11f0e7 Signed-off-by: Driptaroop Das --- lcm/model/src/main/yang/lcm.yang | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'lcm/model/src/main/yang/lcm.yang') diff --git a/lcm/model/src/main/yang/lcm.yang b/lcm/model/src/main/yang/lcm.yang index a03fff607..c9ec3ca81 100644 --- a/lcm/model/src/main/yang/lcm.yang +++ b/lcm/model/src/main/yang/lcm.yang @@ -561,6 +561,10 @@ module LCM { output { uses common-header; uses status; + leaf payload { + type payload; + mandatory true; + } } } @@ -607,6 +611,10 @@ module LCM { output { uses common-header; uses status; + leaf payload { + type payload; + mandatory true; + } } } @@ -811,7 +819,7 @@ module LCM { uses action-identifiers; leaf payload { type payload; - mandatory false; + mandatory true; } } output { @@ -985,6 +993,11 @@ module LCM { output { uses common-header; uses status; + leaf payload { + type payload; + mandatory true; + } + } } -- cgit 1.2.3-korg From 602185d0b632359adae3b3eabd8bf8c3234651ad Mon Sep 17 00:00:00 2001 From: Enbo Wang Date: Tue, 19 Mar 2019 08:40:53 +0000 Subject: Update LCM:rollback action for PNF S/W upgrade Change mandatory input fields in rollback action to optional and add optional output payload field. Change-Id: Icc1b479c7fcfaeeb315dadd5762e9443d5dfba1c Issue-ID: SDNC-669 Signed-off-by: Enbo Wang --- lcm/model/src/main/yang/lcm.yang | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lcm/model/src/main/yang/lcm.yang') diff --git a/lcm/model/src/main/yang/lcm.yang b/lcm/model/src/main/yang/lcm.yang index c9ec3ca81..cbb772fb0 100644 --- a/lcm/model/src/main/yang/lcm.yang +++ b/lcm/model/src/main/yang/lcm.yang @@ -682,16 +682,20 @@ module LCM { } leaf identity-url { type string; - mandatory true; + mandatory false; } leaf snapshot-id { type string; - mandatory true; + mandatory false; } } output { uses common-header; uses status; + leaf payload { + type payload; + mandatory false; + } } } -- cgit 1.2.3-korg From 1ee69b1f0a3fde8d77393f541b12ff6daee11600 Mon Sep 17 00:00:00 2001 From: Enbo Wang Date: Wed, 4 Dec 2019 21:14:48 +0800 Subject: Add LCM APIs for DownloadNeSw and ActivateNeSw actions Add two LCM APIs of DownloadNeSw and ActivateNeSw for PNF Software Upgrade. Change-Id: I5a8f143c2d7d54fd96772eeb1d31b2d2e8bfb523 Issue-ID: SDNC-856 Signed-off-by: Enbo Wang --- lcm/model/src/main/resources/lcm.20180329.json | 216 +++++++++++++++++++++ lcm/model/src/main/yang/lcm.yang | 62 ++++++ .../org/onap/ccsdk/sli/northbound/LcmProvider.java | 48 +++++ .../onap/ccsdk/sli/northbound/TestLcmProvider.java | 72 +++++++ .../resources/graphs/lcm/LCM_activate-ne-sw.xml | 30 +++ .../resources/graphs/lcm/LCM_download-ne-sw.xml | 30 +++ .../src/test/resources/graphs/lcm/graph.versions | 2 + 7 files changed, 460 insertions(+) create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_activate-ne-sw.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_download-ne-sw.xml (limited to 'lcm/model/src/main/yang/lcm.yang') diff --git a/lcm/model/src/main/resources/lcm.20180329.json b/lcm/model/src/main/resources/lcm.20180329.json index 291e18fb1..2e9eabe6f 100644 --- a/lcm/model/src/main/resources/lcm.20180329.json +++ b/lcm/model/src/main/resources/lcm.20180329.json @@ -1252,6 +1252,70 @@ "description": "An operation to upgrade the target VNF to a new version and expected that the VNF is in a quiesced status .", "operationId": "upgrade-software" } + }, + "/operations/LCM:download-ne-sw": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(download-ne-sw)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(download-ne-sw)output-TOP" + } + } + }, + "description": "An operation to download NE software.", + "operationId": "download-ne-sw" + } + }, + "/operations/LCM:activate-ne-sw": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/(activate-ne-sw)input-TOP" + } + } + ], + "responses": { + "200": { + "description": "No response was specified", + "schema": { + "$ref": "#/definitions/(activate-ne-sw)output-TOP" + } + } + }, + "description": "An operation to activate NE software.", + "operationId": "activate-ne-sw" + } } }, "definitions": { @@ -4116,6 +4180,158 @@ }, "type": "object" }, + "(download-ne-sw)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action", + "LCM:payload" + ], + "type": "object" + }, + "(download-ne-sw)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(download-ne-sw)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(download-ne-sw)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "required": [ + "LCM:payload" + ], + "type": "object" + }, + "(download-ne-sw)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(download-ne-sw)output" + }, + "type": "object" + } + }, + "type": "object" + }, + "(activate-ne-sw)input": { + "properties": { + "LCM:action": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:action-identifiers": { + "description": "A block containing the action arguments. These are used to specify\\nthe object upon which APP-C LCM command is to operate", + "items": { + "$ref": "#/definitions/LCM(config)action-identifiers" + }, + "type": "object" + }, + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + } + }, + "required": [ + "LCM:action", + "LCM:payload" + ], + "type": "object" + }, + "(activate-ne-sw)input-TOP": { + "properties": { + "LCM:input": { + "items": { + "$ref": "#/definitions/(activate-ne-sw)input" + }, + "type": "object" + } + }, + "type": "object" + }, + "(activate-ne-sw)output": { + "properties": { + "LCM:common-header": { + "description": "A common header for all APP-C requests", + "items": { + "$ref": "#/definitions/LCM(config)common-header" + }, + "type": "object" + }, + "LCM:payload": { + "$ref": "#/definitions/Optional.empty" + }, + "LCM:status": { + "description": "The specific response codes are to be aligned with SDC reference doc\\n(main table removed to avoid duplication and digression from main table).\\nSee SDC and ECOMP Distribution Consumer Interface Agreement", + "items": { + "$ref": "#/definitions/LCM(config)status" + }, + "type": "object" + } + }, + "required": [ + "LCM:payload" + ], + "type": "object" + }, + "(activate-ne-sw)output-TOP": { + "properties": { + "LCM:output": { + "items": { + "$ref": "#/definitions/(activate-ne-sw)output" + }, + "type": "object" + } + }, + "type": "object" + }, "LCM(config)action-identifiers": { "properties": { "LCM:service-instance-id": { diff --git a/lcm/model/src/main/yang/lcm.yang b/lcm/model/src/main/yang/lcm.yang index cbb772fb0..55af1159d 100644 --- a/lcm/model/src/main/yang/lcm.yang +++ b/lcm/model/src/main/yang/lcm.yang @@ -114,6 +114,8 @@ module LCM { enum "DistributeTraffic"; enum "UpgradePreCheck"; enum "UpgradeSoftware"; + enum "DownloadNeSw"; + enum "ActivateNeSw"; enum "UpgradePostCheck"; enum "UpgradeBackup"; enum "UpgradeBackout"; @@ -311,6 +313,12 @@ module LCM { type string; mandatory false; } + leaf pnf-id { + description "identifies the PNF to which this action is to be applied."; + type string; + mandatory false; + } + } } @@ -591,6 +599,60 @@ module LCM { } } + /********************************************************************************** + * Define the downloadNeSw operation + **********************************************************************************/ + rpc download-ne-sw { + description "An operation to download NE software"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory true; + } + } + output { + uses common-header; + uses status; + leaf payload { + type payload; + mandatory true; + } + } + } + + /********************************************************************************** + * Define the activateNeSw operation + **********************************************************************************/ + rpc activate-ne-sw { + description "An operation to activate NE software"; + input { + uses common-header; + leaf action { + type action; + mandatory true; + } + uses action-identifiers; + leaf payload { + type payload; + mandatory true; + } + } + output { + uses common-header; + uses status; + leaf payload { + type payload; + mandatory true; + } + } + } + /********************************************************************************** * Define the VNF UpgradePostCheck service **********************************************************************************/ diff --git a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java index 0074dfc65..6fd494360 100644 --- a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java +++ b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java @@ -760,6 +760,54 @@ public class LcmProvider implements AutoCloseable, LCMService { return Futures.immediateFuture(rpcResult); } + @Override + public ListenableFuture> downloadNeSw(DownloadNeSwInput input) { + DownloadNeSwInputBuilder iBuilder = new DownloadNeSwInputBuilder(input); + DownloadNeSwOutputBuilder oBuilder = new DownloadNeSwOutputBuilder(); + + try { + CommonLcmFields retval = callDG("download-ne-sw", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + if (retval.getPayload() != null) { + oBuilder.setPayload(retval.getPayload()); + } + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture> activateNeSw(ActivateNeSwInput input) { + ActivateNeSwInputBuilder iBuilder = new ActivateNeSwInputBuilder(input); + ActivateNeSwOutputBuilder oBuilder = new ActivateNeSwOutputBuilder(); + + try { + CommonLcmFields retval = callDG("activate-ne-sw", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + if (retval.getPayload() != null) { + oBuilder.setPayload(retval.getPayload()); + } + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + @Override public ListenableFuture> stop(StopInput input) { StopInputBuilder iBuilder = new StopInputBuilder(input); diff --git a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java index 8e82ccadf..e0d8e577e 100644 --- a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java +++ b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java @@ -106,6 +106,10 @@ import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329. import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradePreCheckOutput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradeSoftwareInputBuilder; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradeSoftwareOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DownloadNeSwInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DownloadNeSwOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ActivateNeSwInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ActivateNeSwOutput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ZULU; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.action.identifiers.ActionIdentifiersBuilder; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.common.header.CommonHeaderBuilder; @@ -1150,6 +1154,74 @@ public class TestLcmProvider { } } + @Test + public void testDownloadNeSw() { + DownloadNeSwInputBuilder builder = new DownloadNeSwInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.DownloadNeSw); + builder.setPayload(mock(Payload.class)); + + + try { + DownloadNeSwOutput results = provider.downloadNeSw(builder.build()).get().getResult(); + LOG.info("DownloadNeSw returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("DownloadNeSw threw exception"); + } + } + + @Test + public void testActivateNeSw() { + ActivateNeSwInputBuilder builder = new ActivateNeSwInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.ActivateNeSw); + builder.setPayload(mock(Payload.class)); + + + try { + ActivateNeSwOutput results = provider.activateNeSw(builder.build()).get().getResult(); + LOG.info("ActivateNeSw returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("ActivateNeSw threw exception"); + } + } + @Test public void testStop() { StopInputBuilder builder = new StopInputBuilder(); diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-ne-sw.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-ne-sw.xml new file mode 100644 index 000000000..99f74b6e9 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-ne-sw.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_download-ne-sw.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_download-ne-sw.xml new file mode 100644 index 000000000..fd586cce5 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_download-ne-sw.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/graph.versions b/lcm/provider/src/test/resources/graphs/lcm/graph.versions index 233aa459f..466be55b6 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/graph.versions +++ b/lcm/provider/src/test/resources/graphs/lcm/graph.versions @@ -30,6 +30,8 @@ LCM resume-traffic 1.0.0 sync LCM distribute-traffic 1.0.0 sync LCM upgrade-pre-check 1.0.0 sync LCM upgrade-software 1.0.0 sync +LCM download-ne-sw 1.0.0 sync +LCM activate-ne-sw 1.0.0 sync LCM upgrade-post-check 1.0.0 sync LCM upgrade-backup 1.0.0 sync LCM upgrade-backout 1.0.0 sync -- cgit 1.2.3-korg From 259dc1ff083206ea3a8425c8e9f3c6988d20e524 Mon Sep 17 00:00:00 2001 From: Enbo Wang Date: Tue, 7 Jan 2020 16:32:30 +0800 Subject: Fix action names of DownloadNESw and ActivateNESw Change-Id: I2a7b5ca9554e52f219afe9248d39732c485ab037 Issue-ID: SDNC-856 Signed-off-by: Enbo Wang --- lcm/model/src/main/resources/lcm.20180329.json | 48 +++++++++++++--------- lcm/model/src/main/yang/lcm.yang | 12 +++--- .../org/onap/ccsdk/sli/northbound/LcmProvider.java | 24 +++++------ .../onap/ccsdk/sli/northbound/TestLcmProvider.java | 34 +++++++-------- .../resources/graphs/lcm/LCM_activate-n-e-sw.xml | 30 ++++++++++++++ .../resources/graphs/lcm/LCM_activate-ne-sw.xml | 30 -------------- .../resources/graphs/lcm/LCM_download-n-e-sw.xml | 30 ++++++++++++++ .../resources/graphs/lcm/LCM_download-ne-sw.xml | 30 -------------- .../src/test/resources/graphs/lcm/graph.versions | 4 +- 9 files changed, 126 insertions(+), 116 deletions(-) create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_activate-n-e-sw.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_activate-ne-sw.xml create mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_download-n-e-sw.xml delete mode 100644 lcm/provider/src/test/resources/graphs/lcm/LCM_download-ne-sw.xml (limited to 'lcm/model/src/main/yang/lcm.yang') diff --git a/lcm/model/src/main/resources/lcm.20180329.json b/lcm/model/src/main/resources/lcm.20180329.json index 2e9eabe6f..18512fc35 100644 --- a/lcm/model/src/main/resources/lcm.20180329.json +++ b/lcm/model/src/main/resources/lcm.20180329.json @@ -1253,7 +1253,7 @@ "operationId": "upgrade-software" } }, - "/operations/LCM:download-ne-sw": { + "/operations/LCM:download-n-e-sw": { "post": { "consumes": [ "application/json", @@ -1269,7 +1269,7 @@ "name": "body", "required": false, "schema": { - "$ref": "#/definitions/(download-ne-sw)input-TOP" + "$ref": "#/definitions/(download-n-e-sw)input-TOP" } } ], @@ -1277,15 +1277,15 @@ "200": { "description": "No response was specified", "schema": { - "$ref": "#/definitions/(download-ne-sw)output-TOP" + "$ref": "#/definitions/(download-n-e-sw)output-TOP" } } }, "description": "An operation to download NE software.", - "operationId": "download-ne-sw" + "operationId": "download-n-e-sw" } }, - "/operations/LCM:activate-ne-sw": { + "/operations/LCM:activate-n-e-sw": { "post": { "consumes": [ "application/json", @@ -1301,7 +1301,7 @@ "name": "body", "required": false, "schema": { - "$ref": "#/definitions/(activate-ne-sw)input-TOP" + "$ref": "#/definitions/(activate-n-e-sw)input-TOP" } } ], @@ -1309,12 +1309,12 @@ "200": { "description": "No response was specified", "schema": { - "$ref": "#/definitions/(activate-ne-sw)output-TOP" + "$ref": "#/definitions/(activate-n-e-sw)output-TOP" } } }, "description": "An operation to activate NE software.", - "operationId": "activate-ne-sw" + "operationId": "activate-n-e-sw" } } }, @@ -1627,6 +1627,10 @@ "vserver-id": { "$ref": "#/definitions/Optional.empty", "description": "identifies a specific VM within the given service/vnf to which\\n this action is to be applied" + }, + "pnf-id": { + "$ref": "#/definitions/Optional.empty", + "description": "identifies the PNF to which this action is to be applied." } }, "type": "object" @@ -4180,7 +4184,7 @@ }, "type": "object" }, - "(download-ne-sw)input": { + "(download-n-e-sw)input": { "properties": { "LCM:action": { "$ref": "#/definitions/Optional.empty" @@ -4209,18 +4213,18 @@ ], "type": "object" }, - "(download-ne-sw)input-TOP": { + "(download-n-e-sw)input-TOP": { "properties": { "LCM:input": { "items": { - "$ref": "#/definitions/(download-ne-sw)input" + "$ref": "#/definitions/(download-n-e-sw)input" }, "type": "object" } }, "type": "object" }, - "(download-ne-sw)output": { + "(download-n-e-sw)output": { "properties": { "LCM:common-header": { "description": "A common header for all APP-C requests", @@ -4245,18 +4249,18 @@ ], "type": "object" }, - "(download-ne-sw)output-TOP": { + "(download-n-e-sw)output-TOP": { "properties": { "LCM:output": { "items": { - "$ref": "#/definitions/(download-ne-sw)output" + "$ref": "#/definitions/(download-n-e-sw)output" }, "type": "object" } }, "type": "object" }, - "(activate-ne-sw)input": { + "(activate-n-e-sw)input": { "properties": { "LCM:action": { "$ref": "#/definitions/Optional.empty" @@ -4285,18 +4289,18 @@ ], "type": "object" }, - "(activate-ne-sw)input-TOP": { + "(activate-n-e-sw)input-TOP": { "properties": { "LCM:input": { "items": { - "$ref": "#/definitions/(activate-ne-sw)input" + "$ref": "#/definitions/(activate-n-e-sw)input" }, "type": "object" } }, "type": "object" }, - "(activate-ne-sw)output": { + "(activate-n-e-sw)output": { "properties": { "LCM:common-header": { "description": "A common header for all APP-C requests", @@ -4321,11 +4325,11 @@ ], "type": "object" }, - "(activate-ne-sw)output-TOP": { + "(activate-n-e-sw)output-TOP": { "properties": { "LCM:output": { "items": { - "$ref": "#/definitions/(activate-ne-sw)output" + "$ref": "#/definitions/(activate-n-e-sw)output" }, "type": "object" } @@ -4353,6 +4357,10 @@ "LCM:vserver-id": { "$ref": "#/definitions/Optional.empty", "description": "identifies a specific VM within the given service/vnf to which\\n this action is to be applied" + }, + "LCM:pnf-id": { + "$ref": "#/definitions/Optional.empty", + "description": "identifies the PNF to which this action is to be applied." } }, "type": "object" diff --git a/lcm/model/src/main/yang/lcm.yang b/lcm/model/src/main/yang/lcm.yang index 55af1159d..d2ca5feb5 100644 --- a/lcm/model/src/main/yang/lcm.yang +++ b/lcm/model/src/main/yang/lcm.yang @@ -114,8 +114,8 @@ module LCM { enum "DistributeTraffic"; enum "UpgradePreCheck"; enum "UpgradeSoftware"; - enum "DownloadNeSw"; - enum "ActivateNeSw"; + enum "DownloadNESw"; + enum "ActivateNESw"; enum "UpgradePostCheck"; enum "UpgradeBackup"; enum "UpgradeBackout"; @@ -600,9 +600,9 @@ module LCM { } /********************************************************************************** - * Define the downloadNeSw operation + * Define the downloadNESw operation **********************************************************************************/ - rpc download-ne-sw { + rpc download-n-e-sw { description "An operation to download NE software"; input { uses common-header; @@ -627,9 +627,9 @@ module LCM { } /********************************************************************************** - * Define the activateNeSw operation + * Define the activateNESw operation **********************************************************************************/ - rpc activate-ne-sw { + rpc activate-n-e-sw { description "An operation to activate NE software"; input { uses common-header; diff --git a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java index 6fd494360..100496e39 100644 --- a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java +++ b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java @@ -761,12 +761,12 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public ListenableFuture> downloadNeSw(DownloadNeSwInput input) { - DownloadNeSwInputBuilder iBuilder = new DownloadNeSwInputBuilder(input); - DownloadNeSwOutputBuilder oBuilder = new DownloadNeSwOutputBuilder(); + public ListenableFuture> downloadNESw(DownloadNESwInput input) { + DownloadNESwInputBuilder iBuilder = new DownloadNESwInputBuilder(input); + DownloadNESwOutputBuilder oBuilder = new DownloadNESwOutputBuilder(); try { - CommonLcmFields retval = callDG("download-ne-sw", iBuilder.build()); + CommonLcmFields retval = callDG("download-n-e-sw", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); if (retval.getPayload() != null) { @@ -778,19 +778,19 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(e.getStatus()); } - RpcResult rpcResult = - RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); // return error return Futures.immediateFuture(rpcResult); } @Override - public ListenableFuture> activateNeSw(ActivateNeSwInput input) { - ActivateNeSwInputBuilder iBuilder = new ActivateNeSwInputBuilder(input); - ActivateNeSwOutputBuilder oBuilder = new ActivateNeSwOutputBuilder(); + public ListenableFuture> activateNESw(ActivateNESwInput input) { + ActivateNESwInputBuilder iBuilder = new ActivateNESwInputBuilder(input); + ActivateNESwOutputBuilder oBuilder = new ActivateNESwOutputBuilder(); try { - CommonLcmFields retval = callDG("activate-ne-sw", iBuilder.build()); + CommonLcmFields retval = callDG("activate-n-e-sw", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); if (retval.getPayload() != null) { @@ -802,8 +802,8 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(e.getStatus()); } - RpcResult rpcResult = - RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); // return error return Futures.immediateFuture(rpcResult); } diff --git a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java index e0d8e577e..a7e1e1f2e 100644 --- a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java +++ b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java @@ -106,10 +106,10 @@ import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329. import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradePreCheckOutput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradeSoftwareInputBuilder; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradeSoftwareOutput; -import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DownloadNeSwInputBuilder; -import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DownloadNeSwOutput; -import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ActivateNeSwInputBuilder; -import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ActivateNeSwOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DownloadNESwInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DownloadNESwOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ActivateNESwInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ActivateNESwOutput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ZULU; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.action.identifiers.ActionIdentifiersBuilder; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.common.header.CommonHeaderBuilder; @@ -1155,8 +1155,8 @@ public class TestLcmProvider { } @Test - public void testDownloadNeSw() { - DownloadNeSwInputBuilder builder = new DownloadNeSwInputBuilder(); + public void testDownloadNESw() { + DownloadNESwInputBuilder builder = new DownloadNESwInputBuilder(); CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); hdrBuilder.setApiVer("1"); @@ -1171,26 +1171,27 @@ public class TestLcmProvider { aBuilder.setVfModuleId("vf-module-1"); aBuilder.setVnfcName("my-vnfc"); aBuilder.setVnfId("123"); + aBuilder.setPnfId("456"); aBuilder.setVserverId("123"); builder.setActionIdentifiers(aBuilder.build()); - builder.setAction(Action.DownloadNeSw); + builder.setAction(Action.DownloadNESw); builder.setPayload(mock(Payload.class)); try { - DownloadNeSwOutput results = provider.downloadNeSw(builder.build()).get().getResult(); - LOG.info("DownloadNeSw returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + DownloadNESwOutput results = provider.downloadNESw(builder.build()).get().getResult(); + LOG.info("DownloadNESw returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); assert(results.getStatus().getCode() == 400); } catch (InterruptedException | ExecutionException e) { LOG.error("Caught exception", e); - fail("DownloadNeSw threw exception"); + fail("DownloadNESw threw exception"); } } @Test - public void testActivateNeSw() { - ActivateNeSwInputBuilder builder = new ActivateNeSwInputBuilder(); + public void testActivateNESw() { + ActivateNESwInputBuilder builder = new ActivateNESwInputBuilder(); CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); hdrBuilder.setApiVer("1"); @@ -1205,20 +1206,21 @@ public class TestLcmProvider { aBuilder.setVfModuleId("vf-module-1"); aBuilder.setVnfcName("my-vnfc"); aBuilder.setVnfId("123"); + aBuilder.setPnfId("456"); aBuilder.setVserverId("123"); builder.setActionIdentifiers(aBuilder.build()); - builder.setAction(Action.ActivateNeSw); + builder.setAction(Action.ActivateNESw); builder.setPayload(mock(Payload.class)); try { - ActivateNeSwOutput results = provider.activateNeSw(builder.build()).get().getResult(); - LOG.info("ActivateNeSw returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + ActivateNESwOutput results = provider.activateNESw(builder.build()).get().getResult(); + LOG.info("ActivateNESw returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); assert(results.getStatus().getCode() == 400); } catch (InterruptedException | ExecutionException e) { LOG.error("Caught exception", e); - fail("ActivateNeSw threw exception"); + fail("ActivateNESw threw exception"); } } diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-n-e-sw.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-n-e-sw.xml new file mode 100644 index 000000000..44343dd5f --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-n-e-sw.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-ne-sw.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-ne-sw.xml deleted file mode 100644 index 99f74b6e9..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-ne-sw.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_download-n-e-sw.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_download-n-e-sw.xml new file mode 100644 index 000000000..6bb0e765c --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_download-n-e-sw.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_download-ne-sw.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_download-ne-sw.xml deleted file mode 100644 index fd586cce5..000000000 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_download-ne-sw.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/lcm/provider/src/test/resources/graphs/lcm/graph.versions b/lcm/provider/src/test/resources/graphs/lcm/graph.versions index 466be55b6..420bcf619 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/graph.versions +++ b/lcm/provider/src/test/resources/graphs/lcm/graph.versions @@ -30,8 +30,8 @@ LCM resume-traffic 1.0.0 sync LCM distribute-traffic 1.0.0 sync LCM upgrade-pre-check 1.0.0 sync LCM upgrade-software 1.0.0 sync -LCM download-ne-sw 1.0.0 sync -LCM activate-ne-sw 1.0.0 sync +LCM download-n-e-sw 1.0.0 sync +LCM activate-n-e-sw 1.0.0 sync LCM upgrade-post-check 1.0.0 sync LCM upgrade-backup 1.0.0 sync LCM upgrade-backout 1.0.0 sync -- cgit 1.2.3-korg From 6a90726a7134f16c36ce2aacfaf96e2f88476c4f Mon Sep 17 00:00:00 2001 From: Enbo Wang Date: Mon, 20 Jan 2020 14:51:13 +0800 Subject: Update pnf-id to pnf-name in LCM API In order to be compatible with Pnf entry in A&AI, update pnf-id to pnf-name. Change-Id: Ibb76fd754c4a657a6f4af4453b3c819670fb96c2 Issue-ID: SDNC-856 Signed-off-by: Enbo Wang --- lcm/model/src/main/resources/lcm.20180329.json | 4 ++-- lcm/model/src/main/yang/lcm.yang | 3 +-- .../src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'lcm/model/src/main/yang/lcm.yang') diff --git a/lcm/model/src/main/resources/lcm.20180329.json b/lcm/model/src/main/resources/lcm.20180329.json index 18512fc35..b84189858 100644 --- a/lcm/model/src/main/resources/lcm.20180329.json +++ b/lcm/model/src/main/resources/lcm.20180329.json @@ -1628,7 +1628,7 @@ "$ref": "#/definitions/Optional.empty", "description": "identifies a specific VM within the given service/vnf to which\\n this action is to be applied" }, - "pnf-id": { + "pnf-name": { "$ref": "#/definitions/Optional.empty", "description": "identifies the PNF to which this action is to be applied." } @@ -4358,7 +4358,7 @@ "$ref": "#/definitions/Optional.empty", "description": "identifies a specific VM within the given service/vnf to which\\n this action is to be applied" }, - "LCM:pnf-id": { + "LCM:pnf-name": { "$ref": "#/definitions/Optional.empty", "description": "identifies the PNF to which this action is to be applied." } diff --git a/lcm/model/src/main/yang/lcm.yang b/lcm/model/src/main/yang/lcm.yang index d2ca5feb5..188068a68 100644 --- a/lcm/model/src/main/yang/lcm.yang +++ b/lcm/model/src/main/yang/lcm.yang @@ -313,12 +313,11 @@ module LCM { type string; mandatory false; } - leaf pnf-id { + leaf pnf-name { description "identifies the PNF to which this action is to be applied."; type string; mandatory false; } - } } diff --git a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java index a7e1e1f2e..b73151e8d 100644 --- a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java +++ b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java @@ -1171,7 +1171,7 @@ public class TestLcmProvider { aBuilder.setVfModuleId("vf-module-1"); aBuilder.setVnfcName("my-vnfc"); aBuilder.setVnfId("123"); - aBuilder.setPnfId("456"); + aBuilder.setPnfName("my-pnf"); aBuilder.setVserverId("123"); builder.setActionIdentifiers(aBuilder.build()); @@ -1206,7 +1206,7 @@ public class TestLcmProvider { aBuilder.setVfModuleId("vf-module-1"); aBuilder.setVnfcName("my-vnfc"); aBuilder.setVnfId("123"); - aBuilder.setPnfId("456"); + aBuilder.setPnfName("my-pnf"); aBuilder.setVserverId("123"); builder.setActionIdentifiers(aBuilder.build()); -- cgit 1.2.3-korg