get ns instance
[vfc/nfvo/lcm.git] / lcm / ns / biz / ns_get.py
index 42ab953..0d1f77c 100644 (file)
 # 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.
+
 import json
 import logging
 
-from lcm.ns.const import OWNER_TYPE
+from lcm.ns.const import OWNER_TYPE, NS_INSTANCE_BASE_URI
 from lcm.pub.utils import restcall
 from lcm.pub.database.models import NSInstModel, NfInstModel, VLInstModel, CPInstModel, VNFFGInstModel
 
@@ -53,6 +54,14 @@ class GetNSInfoService(object):
                 # todo 'vnffgInfo': self.get_vnffg_infos(ns_inst.id, ns_inst.nsd_model),
                 # todo  'sapInfo':{},
                 # todo  nestedNsInstanceId
+                '_links': {
+                    'self': {'href': NS_INSTANCE_BASE_URI % ns_inst.id},
+                    'instantiate': {'href': NS_INSTANCE_BASE_URI + '/instantiate' % ns_inst.id},
+                    'terminate': {'href': NS_INSTANCE_BASE_URI + '/terminate' % ns_inst.id},
+                    'update': {'href': NS_INSTANCE_BASE_URI + '/update' % ns_inst.id},
+                    'scale': {'href': NS_INSTANCE_BASE_URI + '/scale' % ns_inst.id},
+                    'heal': {'href': NS_INSTANCE_BASE_URI + '/heal' % ns_inst.id}
+                }
             }
         return {
             'nsInstanceId': ns_inst.id,