X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=docs%2FMulticloud-Fake_Cloud-Guide.rst;h=52011a5f08e863b6138f448213b586ff0afd2837;hb=b3e79cc6ebba2898e201426b59c1bc8caa347a6a;hp=1df19b753e210fb12905f567bdb277068d0803f7;hpb=abfed00c0697e1593d3c829b9da14faab25ac84f;p=multicloud%2Fframework.git diff --git a/docs/Multicloud-Fake_Cloud-Guide.rst b/docs/Multicloud-Fake_Cloud-Guide.rst index 1df19b7..52011a5 100644 --- a/docs/Multicloud-Fake_Cloud-Guide.rst +++ b/docs/Multicloud-Fake_Cloud-Guide.rst @@ -1,15 +1,22 @@ +.. + This work is licensed under a Creative Commons Attribution 4.0 + International License. + ================================ MultiCloud Fake_Cloud User Case ================================ -multilcoud-vmware server not only provide vio plugin to access real openstack platform,but +multilcoud-vmware server not only provide vio plugin to access real openstack +platform,but also provide fake_cloud plugin which simulate thereal VIO function.The fake -cloud is suitable for testing openstack function if there is not real VIO platform. +cloud is suitable for testing openstack function if there is not real VIO +platform. -Make sure you environment have msb,aai service and multicloud-vmware config file has the right msb_ip and +Make sure you environment have msb,aai service and multicloud-vmware config +file has the right msb_ip and msb_port value,The config file path is vio/vio/pub/config/congfig.py @@ -17,7 +24,8 @@ msb_port value,The config file path is vio/vio/pub/config/congfig.py Register Fake Cloud to AAI ~~~~~~~~~~~~~~~~~~~~~~~~~~ -Register vio information into AAI service with region name "vmware" and region id "fake" +Register vio information into AAI service with region name "vmware" and region +id "fake" .. code-block:: console @@ -49,7 +57,6 @@ Register vio information into AAI service with region name "vmware" and region i } }" - the identity url reprent the fake cloud identity url. @@ -63,46 +70,53 @@ the ${msb_address} = "MSB_IP:MSB_PORT" Get auth token -------------- -# send request to multicloud-framework(broker) service to get token +# send request to multicloud-framework(broker) service to get token of keystone +V3 .. code-block:: console - $ curl -X POST -d @test.json -H 'Content-Type:application/json' ${fake_identiy_url} + $ curl -X POST -d @test.json -H 'Content-Type:application/json' http://MSB_IP:MSB_PORT/api/multicloud/v0/vmware_fake/identity/v3/auth/tokens test.json content example: :: - { + { "auth": { - "scope": {"project": {"id": “”}}, - "identity": - { - "password": {"user": {"domain": {"name": “”}, "password": “”, "name": “”}}, "methods": ["password"] - } + "scope": {"project": {"id": “”}}, + "identity": + { + "password": {"user": {"domain": {"name": “”}, "password": “”, "name": “”}}, "methods": ["password"] + } + } } - } Response: -There are a large amounts of data including service endpoint, user information, etc. -For our testing We take nova and identity service endpoint address and auth token which is in response header named “X-Subject-Token”. +There are a large amounts of data including service endpoint, user information, +etc. +For our testing We take nova and identity service endpoint address and auth +token which is in response header named “X-Subject-Token”. -# you can find the endpoint url namespace is "api/multicloiud-vio/v0/vmware_fake", it represent the multicloud-vio service, So -requests sending to mulitcloud-vio will be forwarded to fake cloud.the ip and port reprenst ${msb_address} +# you can find the endpoint url namespace is +"api/multicloiud-vio/v0/vmware_fake", it represent the multicloud-vio service, +So requests sending to mulitcloud-vio will be forwarded to fake cloud.the ip +and port reprenst ${msb_address} -Identity endpoint: - http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity +Identity endpoint:: -Nova endpoint: - http://$msb_address/api/multicloud-vio/v0/vmware_fake/compute/ + http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity + +Nova endpoint:: + + http://$msb_address/api/multicloud-vio/v0/vmware_fake/compute/ List projects ------------- -Use identity’s endpoint: http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity/ +Use identity’s endpoint: http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity/ .. code-block:: console @@ -207,3 +221,99 @@ you need to input in url path $ curl -X POST -d '{"reboot":{"type":"HARD"}}' -H 'X-Auth-Token: -H 'Content-Type:application/json' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova//servers//action + +list heat stacks +---------------- + +.. code-block:: console + + $ curl -X GET -H 'X-Auth-Token:' http://$msb_address/api/multicloud-vio/v0/vmware_fake/heat//stacks + + +create preview stack +-------------------- + +.. code-block:: console + + $ curl -X POST -H 'X-Auth-Token:' http://$msb_address/api/multicloud-vio/v0/vmware_fake/heat//stacks/preview \ + -d "{ + "files": {}, + "disable_rollback": true, + "parameters": { + "flavor": "m1.heat" + }, + "stack_name": "teststack", + "template": { + "heat_template_version": "2013-05-23", + "description": "Simple template to test heat commands", + "parameters": { + "flavor": { + "default": "m1.tiny", + "type": "string" + } + }, + "resources": { + "hello_world": { + "type": "OS::Nova::Server", + "properties": { + "key_name": "heat_key", + "flavor": { + "get_param": "flavor" + }, + "image": "40be8d1a-3eb9-40de-8abd-43237517384f", + "user_data": "#!/bin/bash -xv\necho \"hello world\" > /root/hello-world.txt\n" + } + } + } + }, + "timeout_mins": 60 + }" + + +create stack +------------- + +.. code-block:: console + + $ curl -X POST -H 'X-Auth-Token:' http://$msb_address/api/multicloud-vio/v0/vmware_fake/heat//stacks \ + -d "{ + "files": {}, + "disable_rollback": true, + "parameters": { + "flavor": "m1.heat" + }, + "stack_name": "teststack", + "template": { + "heat_template_version": "2013-05-23", + "description": "Simple template to test heat commands", + "parameters": { + "flavor": { + "default": "m1.tiny", + "type": "string" + } + }, + "resources": { + "hello_world": { + "type": "OS::Nova::Server", + "properties": { + "key_name": "heat_key", + "flavor": { + "get_param": "flavor" + }, + "image": "40be8d1a-3eb9-40de-8abd-43237517384f", + "user_data": "#!/bin/bash -xv\necho \"hello world\" > /root/hello-world.txt\n" + } + } + } + }, + "timeout_mins": 60 + }" + + +delete stack +------------ + +.. code-block:: console + + $ curl -X DELETE -H 'X-Auth-Token:' http://$msb_address/api/multicloud-vio/v0/vmware_fake/heat//stacks// +