RIFT 15576 Support for copying descriptors with assets, with new rpc and yang data...
[osm/SO.git] / rwlaunchpad / plugins / yang / rw-pkg-mgmt.yang
index de56e55..5fbd621 100644 (file)
@@ -182,6 +182,14 @@ module rw-pkg-mgmt
     }
   }
 
+  grouping copy-task-status {
+    leaf status {
+      description "The status of the copy task";
+      type task-status;
+      default QUEUED;
+    }
+  }
+
   container download-jobs {
     rwpb:msg-new DownloadJobs;
     description "Download jobs";
@@ -206,6 +214,24 @@ module rw-pkg-mgmt
     }
   }
 
+  container copy-jobs {
+    rwpb:msg-new CopyJobs;
+    description "Copy jobs";
+    config false;
+
+    list job {
+      rwpb:msg-new CopyJob;
+      key "transaction-id";
+
+      leaf transaction-id {
+        description "Unique UUID";
+        type string;
+      }
+
+      uses copy-task-status;
+    }
+  }
+
   rpc get-package-endpoint {
     description "Retrieves the endpoint for the descriptor";
 
@@ -221,6 +247,28 @@ module rw-pkg-mgmt
     }
   }
 
+  rpc package-copy {
+    description "Copies the package specified in input and returns the copied package id";
+
+    input {
+      uses package-identifer;
+
+      leaf package-name {
+        description "Name of destination package";
+        type string;
+      }
+    }
+
+    output {
+     leaf transaction-id {
+        description "Valid ID to track the status of the task";
+        type string;
+      }
+
+     uses package-identifer;
+    }
+  }
+
   rpc get-package-schema {
     description "Retrieves the schema for the package type";