Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,31 @@
</entry>
<entry>
<key>DATE_MODIFICATION</key>
<value>1629460833518</value>
<value>1629735401503</value>
</entry>
<entry>
<key>REPOSITORY</key>
<value>Process</value>
</entry>
<entry>
<key>DATE_CREATION</key>
<value>1629460833518</value>
<value>1629735401496</value>
</entry>
<entry>
<key>MODEL</key>
<value>0</value>
</entry>
<entry>
<key>TAG</key>
</entry>
<entry>
<key>FILE_TYPE</key>
<value>unknown</value>
</entry>
<entry>
<key>MANUFACTURER</key>
<value>0</value>
</entry>
<entry>
<key>TYPE</key>
<value>FILE</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
</entry>
<entry>
<key>DATE_MODIFICATION</key>
<value>1629459738420</value>
<value>1629735343381</value>
</entry>
<entry>
<key>REPOSITORY</key>
<value>Process</value>
</entry>
<entry>
<key>DATE_CREATION</key>
<value>1629459738418</value>
<value>1629735343376</value>
</entry>
<entry>
<key>TAG</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
</entry>
<entry>
<key>DATE_MODIFICATION</key>
<value>1629459762656</value>
<value>1629735208151</value>
</entry>
<entry>
<key>REPOSITORY</key>
<value>Process</value>
</entry>
<entry>
<key>DATE_CREATION</key>
<value>1629459762653</value>
<value>1629735208147</value>
</entry>
<entry>
<key>TAG</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
</entry>
<entry>
<key>DATE_MODIFICATION</key>
<value>1629281393025</value>
<value>1629734951820</value>
</entry>
<entry>
<key>REPOSITORY</key>
<value>Process</value>
</entry>
<entry>
<key>DATE_CREATION</key>
<value>1629281393019</value>
<value>1629734951817</value>
</entry>
<entry>
<key>TAG</key>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
from msa_sdk.variables import Variables
from msa_sdk.msa_api import MSA_API
from msa_sdk.order import Order
from msa_sdk.device import Device


if __name__ == "__main__":

dev_var = Variables()
dev_var.add('device_id', var_type='Device')
dev_var.add('mano_user', var_type='String')
dev_var.add('mano_pass', var_type='Password')
dev_var.add('nfvo_device', var_type='Device')
dev_var.add('vnfm_device', var_type='Device')
context = Variables.task_call(dev_var)

device_short_id = context['device_id'][3:]
mano_me_id = context["nfvo_device"][3:]
mano_ip = Device(device_id=mano_me_id).management_address
mano_var = Device(device_id=mano_me_id).get_configuration_variable("HTTP_PORT")
mano_port = mano_var.get("value")
mano_user = Device(device_id=mano_me_id).login
mano_pass = Device(device_id=mano_me_id).password

context["mano_ip"] = mano_ip
context["mano_port"] = mano_port
context["mano_user"] = mano_user
context["mano_pass"] = mano_pass

order = Order(str(device_short_id))
order = Order(str(mano_me_id))
order.command_synchronize(timeout=60)

ret = MSA_API.process_content('ENDED',
f'Device {context["device_id"]} synchronized', context, True)
f'Device {context["nfvo_device"]} synchronized', context, True)

print(ret)
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
</entry>
<entry>
<key>DATE_MODIFICATION</key>
<value>1629287333403</value>
<value>1629735401023</value>
</entry>
<entry>
<key>REPOSITORY</key>
<value>Process</value>
</entry>
<entry>
<key>DATE_CREATION</key>
<value>1629287333401</value>
<value>1629735401021</value>
</entry>
<entry>
<key>TAG</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
</entry>
<entry>
<key>DATE_MODIFICATION</key>
<value>1629280469614</value>
<value>1629735216323</value>
</entry>
<entry>
<key>REPOSITORY</key>
<value>Process</value>
</entry>
<entry>
<key>DATE_CREATION</key>
<value>1629280469611</value>
<value>1629735216318</value>
</entry>
<entry>
<key>TAG</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
dev_var.add('vim_project', var_type='String')
context = Variables.task_call(dev_var)

nfviVim = NfviVim('10.31.1.245', '8080')
nfviVim = NfviVim(context["mano_ip"], context["mano_port"])
nfviVim.set_parameters(context['mano_user'], context['mano_pass'])

content = {
"vimId": str(uuid.uuid4()),
"vimType": context["vim_type"],
"interfaceInfo": {
"endpoint": context["interface_info"]
"endpoint": context["interface_info"],
"non-strict-ssl": True
},
"accessInfo": {
"username": context["username"],
Expand All @@ -34,7 +35,7 @@
"projectDomain": context["project_domain"],
"userDomain": context["user_domain"],
"vim_project": context["vim_project"],
"device_id": context["device_id"]
"device_id": context["nfvo_device"]
},
"geoloc": {
"lng": 45.75801,
Expand All @@ -44,7 +45,5 @@

r = nfviVim.nfvi_vim_register(content)

# context['vim_id'] = r.json()['id']

ret = MSA_API.process_content('ENDED', f'{r}', context, True)
ret = MSA_API.process_content(nfviVim.state, f'{r}', context, True)
print(ret)
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

dev_var = Variables()
context = Variables.task_call(dev_var)

device_short_id = context['device_id'][3:]
device_short_id = context["nfvo_device"][3:]

order = Order(str(device_short_id))
order.command_synchronize(timeout=60)

ret = MSA_API.process_content('ENDED',
f'Device {context["device_id"]} synchronized', context, True)
f'Device {context["nfvo_device"]} synchronized', context, True)

print(ret)
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,32 @@
<class>nfvi_resources</class>
</classes>
</variable>
<variable displayName="NFVO Device" name="params.device_id" startIncrement="0" type="Device" mandatoryArray="false" visible="true" description="" groupSeparator="" groupDisplayName="" displayOrder="0" increment="0" refServiceURI="" keepOnImport="false" editable="false" onlyDetailView="false" localVarNameMatch="" remoteVarNameMatch="" arrayCanAdd="true" arrayCanRemove="true" arrayCanMove="true" arrayCanEdit="true" displayNameHeader="" fullDisplayName="" default="null" isMandatory="false" isUserLocked="false" isGrouped="false" isSearchable="false" isUniqueGlobal="false"/>
<variable displayName="nfvo_device" name="params.nfvo_device" startIncrement="0" type="Device" mandatoryArray="false" visible="true" description="" groupSeparator="" groupDisplayName="" displayOrder="0" increment="0" refServiceURI="" keepOnImport="false" editable="false" onlyDetailView="false" localVarNameMatch="" remoteVarNameMatch="" arrayCanAdd="true" arrayCanRemove="true" arrayCanMove="true" arrayCanEdit="true" displayNameHeader="" fullDisplayName="" default="null" isMandatory="false" isUserLocked="false" isGrouped="false" isSearchable="false" isUniqueGlobal="false"/>
<variable displayName="vnfm_device" name="params.vnfm_device" startIncrement="0" type="Device" mandatoryArray="false" visible="true" description="" groupSeparator="" groupDisplayName="" displayOrder="0" increment="0" refServiceURI="" keepOnImport="false" editable="false" onlyDetailView="false" localVarNameMatch="" remoteVarNameMatch="" arrayCanAdd="true" arrayCanRemove="true" arrayCanMove="true" arrayCanEdit="true" displayNameHeader="" fullDisplayName="" default="null" isMandatory="false" isUserLocked="false" isGrouped="false" isSearchable="false" isUniqueGlobal="false"/>
</variables>
<example/>
<process name="Process/workflows/_py__NFVI_Resources_Management/Process_New_Service">
<process name="Process/Telekom_Malaysia/_py__NFVI_Resources_Management/Process_New_Service">
<displayName>New Service</displayName>
<type>CREATE</type>
<visibility>5</visibility>
<allowSchedule/>
<task name="Task_Sync_to_NFVO.py">
<processPath>/opt/fmc_repository/Process/workflows/_py__NFVI_Resources_Management/Process_New_Service/Tasks</processPath>
<processPath>/opt/fmc_repository/Process/Telekom_Malaysia/_py__NFVI_Resources_Management/Process_New_Service/Tasks</processPath>
<displayName>Sync to NFVO</displayName>
</task>
</process>
<process name="Process/workflows/_py__NFVI_Resources_Management/Process_Register_VIM">
<process name="Process/Telekom_Malaysia/_py__NFVI_Resources_Management/Process_Register_VIM">
<displayName>Register VIM</displayName>
<type>UPDATE</type>
<visibility>5</visibility>
<allowSchedule/>
<task name="Task_Register_VIM_Resources.py">
<processPath>/opt/fmc_repository/Process/workflows/_py__NFVI_Resources_Management/Process_Register_VIM/Tasks</processPath>
<processPath>/opt/fmc_repository/Process/Telekom_Malaysia/_py__NFVI_Resources_Management/Process_Register_VIM/Tasks</processPath>
<displayName>Register VIM Resources</displayName>
</task>
<task name="Task_Sync_to_NFVO.py">
<processPath>/opt/fmc_repository/Process/workflows/_py__NFVI_Resources_Management/Process_Register_VIM/Tasks</processPath>
<processPath>/opt/fmc_repository/Process/Telekom_Malaysia/_py__NFVI_Resources_Management/Process_Register_VIM/Tasks</processPath>
<displayName>Sync to NFVO</displayName>
</task>
</process>
Expand Down