X-Git-Url: https://gerrit.onap.org/r/gitweb?p=multicloud%2Fframework.git;a=blobdiff_plain;f=docs%2FMulticloud-Fake_Cloud-Guide.rst;h=4a2087d720c83223e4847f2ffb70391a9a45598b;hp=58d7a5ab64c93d32cb16834af735b5a38761c470;hb=93e73a8d52e5ae6b261da83884b32fe1e8e2d909;hpb=01ef914a27a68926f8db82f97c6872a0b3e3310d diff --git a/docs/Multicloud-Fake_Cloud-Guide.rst b/docs/Multicloud-Fake_Cloud-Guide.rst index 58d7a5a..4a2087d 100644 --- a/docs/Multicloud-Fake_Cloud-Guide.rst +++ b/docs/Multicloud-Fake_Cloud-Guide.rst @@ -1,3 +1,7 @@ +.. + This work is licensed under a Creative Commons Attribution 4.0 + International License. + ================================ MultiCloud Fake_Cloud User Case ================================ @@ -21,63 +25,59 @@ Register vio information into AAI service with region name "vmware" and region i .. code-block:: console -$ curl -X PUT -H "X-TransactionId":"get_aai_subr" -H "X-FromAppId":"AAI" -H "Accept":"application/json" \ - -H "Content-Type:"application/json" \ - https://aai_ip:aai_port/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/vmware/fake \ - - -d "{ - "cloud-owner": "vmware", - "cloud-region-id": "vio", - "cloud-type": "vmware", - "cloud-region-version": "4.0", - "identity-url": "http://MSB_IP:MSB_PORT/api/multicloud-vio/v0/vmware_fake/identity/v3", - "sriov-automation": false, - "resource-version": "1505892661724", - "esr-system-info-list": { - "esr-system-info": [ - { - "esr-system-info-id": "62e17285-c207-42b0-9d55-b472b274c254", - "system-name": "vim-fake-cloud", - "type": "vim", - "service-url": "http://127.0.0.1:5000/v3", - "user-name": "admin", - "password": "vmware", - "system-type": "vim", - "ssl-insecure": false, - "cloud-domain": "default", - "default-tenant": "admin", - "resource-version": "1505892661819" - } - ] - } - }" - + $ curl -X PUT -H "X-TransactionId":"get_aai_subr" -H "X-FromAppId":"AAI" -H "Accept":"application/json" \ + -H "Content-Type:"application/json" -H "Authorization:Basic QUFJOkFBSQ==" \ + https://aai_ip:aai_port/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/vmware/fake \ + -d "{ + "cloud-owner": "vmware", + "cloud-region-id": "fake", + "cloud-type": "vmware", + "cloud-region-version": "4.0", + "identity-url": "http://MSB_IP:MSB_PORT/api/multicloud/v0/vmware_fake/identity/v3", + "cloud-zone": "cloud zone", + "complex-name": "complex name", + "esr-system-info-list": { + "esr-system-info": [ + { + "system-name": "vmware-fake-cloud", + "type": "vim", + "service-url": "http://127.0.0.1:5000/v3", + "user-name": "admin", + "password": "vmware", + "system-type": "VIM", + "ssl-insecure": true, + "cloud-domain": "default", + "default-tenant": "admin", + } + ] + } + }" the identity url reprent the fake cloud identity url. Test Examples -~~~~~~~~~~~~ +~~~~~~~~~~~~~ -the ${fake_identiy_url}= "http://MSB_IP:MSB_PORT/api/multicloud-vio/v0/vmware_fake/identity/v3" +the ${fake_identiy_url}= "http://MSB_IP:MSB_PORT/api/multicloud/v0/vmware_fake/identity/v3" 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": sudo pip install virtualenv{ + "auth": { "scope": {"project": {"id": “”}}, "identity": { @@ -210,3 +210,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// +