Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Curl generator : some attributes are not included #52

Closed
cgourdin opened this issue Mar 8, 2016 · 3 comments
Closed

Curl generator : some attributes are not included #52

cgourdin opened this issue Mar 8, 2016 · 3 comments
Assignees

Comments

@cgourdin
Copy link
Member

cgourdin commented Mar 8, 2016

Hello,
When i generate my curl script from my infrastructure configuration, some attributes are not include in the shell script.
For ex : i create a resource like this :

resource "vm1/e00cfdb8-0a74-488c-ae2e-234068337948" : infrastructure.compute
mixins infrastructure.os_tpl {
    state occi.core.id = "e00cfdb8-0a74-488c-ae2e-234068337948"
    state occi.compute.architecture = "x64"
    state occi.compute.hostname = "occiwareInstanceWeb"
    state occi.compute.speed = "3"
    state occi.compute.memory = "4"
    state occi.compute.state = "inactive"

Generated script give me :
curl $CURL_OPTS -X PUT $OCCI_SERVER_URL/compute/vm1/e00cfdb8-0a74-488c-ae2e-234068337948 -H 'Content-Type: text/occi' -H 'Category: compute; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", os_tpl; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="mixin";' -H 'X-OCCI-Attribute: occi.core.id="e00cfdb8-0a74-488c-ae2e-234068337948"'
Only the attributes "occi.core.id" is included. The others have disappear.
infratest.zip

@philippemerle philippemerle self-assigned this Mar 9, 2016
@philippemerle
Copy link
Member

Hi Christophe,

I used the latest cloud designer.
When I generated curl commands for your infrastructure_1.occic then I obtain:

#! /bin/sh

Generated at Wed Mar 09 17:23:59 CET 2016 from platform:/resource/infratest/infrastructure_1.occic by org.occiware.clouddesigner.occi.gen.curl

OCCI_SERVER_URL=$1
CURL_OPTS="-s -v -i"

curl $CURL_OPTS -X PUT $OCCI_SERVER_URL/compute/vm1/e00cfdb8-0a74-488c-ae2e-234068337948 -H 'Content-Type: text/occi' -H 'Category: compute; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", os_tpl; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="mixin";' -H 'X-OCCI-Attribute: occi.core.id="e00cfdb8-0a74-488c-ae2e-234068337948"' -H 'X-OCCI-Attribute: occi.compute.architecture="x64"' -H 'X-OCCI-Attribute: occi.compute.hostname="occiwareInstanceWeb"' -H 'X-OCCI-Attribute: occi.compute.speed=3' -H 'X-OCCI-Attribute: occi.compute.memory=4' -H 'X-OCCI-Attribute: occi.compute.state="inactive"'
curl $CURL_OPTS -X PUT $OCCI_SERVER_URL/compute/vm2/a4d58c55-9e73-41bc-834f-1fad497d6738 -H 'Content-Type: text/occi' -H 'Category: compute; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", os_tpl; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="mixin";' -H 'X-OCCI-Attribute: occi.core.id="a4d58c55-9e73-41bc-834f-1fad497d6738"' -H 'X-OCCI-Attribute: occi.core.summary="Database for occiware test program"' -H 'X-OCCI-Attribute: occi.compute.architecture="i386"' -H 'X-OCCI-Attribute: occi.compute.cores=4' -H 'X-OCCI-Attribute: occi.compute.hostname="dbOcci"' -H 'X-OCCI-Attribute: occi.compute.state="inactive"'
curl $CURL_OPTS -X PUT $OCCI_SERVER_URL/storage/ebs1/7f7f8257-6e88-4ce9-be78-b06028940758 -H 'Content-Type: text/occi' -H 'Category: storage; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind";' -H 'X-OCCI-Attribute: occi.core.id="7f7f8257-6e88-4ce9-be78-b06028940758"' -H 'X-OCCI-Attribute: occi.core.title="Elastic Block Storage 1"' -H 'X-OCCI-Attribute: occi.storage.size=250'
curl $CURL_OPTS -X PUT $OCCI_SERVER_URL/network/network1/1a8fe00b-a95c-4718-b039-e5b19a5e21c4 -H 'Content-Type: text/occi' -H 'Category: network; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", ipnetwork; scheme="http://schemas.ogf.org/occi/infrastructure/network#"; class="mixin";' -H 'X-OCCI-Attribute: occi.core.id="1a8fe00b-a95c-4718-b039-e5b19a5e21c4"' -H 'X-OCCI-Attribute: occi.network.vlan=12' -H 'X-OCCI-Attribute: occi.network.label="private"' -H 'X-OCCI-Attribute: occi.network.address="10.1.0.0/16"' -H 'X-OCCI-Attribute: occi.network.gateway="10.1.255.254"' -H 'X-OCCI-Attribute: occi.core.title="Main private network"'
curl $CURL_OPTS -X PUT $OCCI_SERVER_URL/storage/ebs2/28f50616-f73f-45be-b1d3-269cd77457e6 -H 'Content-Type: text/occi' -H 'Category: storage; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind";' -H 'X-OCCI-Attribute: occi.core.id="28f50616-f73f-45be-b1d3-269cd77457e6"' -H 'X-OCCI-Attribute: occi.core.title="Elastic Block Storage 2"' -H 'X-OCCI-Attribute: occi.storage.size=2000'

curl $CURL_OPTS -X PUT $OCCI_SERVER_URL/storagelink/sl1/0100929d-9e16-4900-aeea-008cdea02f7c -H 'Content-Type: text/occi' -H 'Category: storagelink; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind";' -H 'X-OCCI-Attribute: occi.core.id="0100929d-9e16-4900-aeea-008cdea02f7c"' -H 'X-OCCI-Attribute: occi.storagelink.deviceid="system"' -H 'X-OCCI-Attribute: occi.storagelink.mountpoint="/home/default"' -H 'X-OCCI-Attribute: occi.core.source="/compute/vm1/e00cfdb8-0a74-488c-ae2e-234068337948", occi.core.target="/storage/ebs1/7f7f8257-6e88-4ce9-be78-b06028940758"'
curl $CURL_OPTS -X PUT $OCCI_SERVER_URL/networkinterface/ni1/b1aa9e70-2918-4d14-9382-c674028b4479 -H 'Content-Type: text/occi' -H 'Category: networkinterface; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", ipnetworkinterface; scheme="http://schemas.ogf.org/occi/infrastructure/networkinterface#"; class="mixin";' -H 'X-OCCI-Attribute: occi.core.id="b1aa9e70-2918-4d14-9382-c674028b4479"' -H 'X-OCCI-Attribute: occi.networkinterface.interface="eth0"' -H 'X-OCCI-Attribute: occi.networkinterface.mac="aa:bb:cc:dd:ee:11"' -H 'X-OCCI-Attribute: occi.networkinterface.address="10.1.0.100/16"' -H 'X-OCCI-Attribute: occi.networkinterface.gateway="10.1.255.254"' -H 'X-OCCI-Attribute: occi.networkinterface.allocation="static"' -H 'X-OCCI-Attribute: occi.core.source="/compute/vm1/e00cfdb8-0a74-488c-ae2e-234068337948", occi.core.target="/network/network1/1a8fe00b-a95c-4718-b039-e5b19a5e21c4"'
curl $CURL_OPTS -X PUT $OCCI_SERVER_URL/storagelink/sl2/0b9ec865-44b3-427b-9ce1-770c9720ffe9 -H 'Content-Type: text/occi' -H 'Category: storagelink; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind";' -H 'X-OCCI-Attribute: occi.core.id="0b9ec865-44b3-427b-9ce1-770c9720ffe9"' -H 'X-OCCI-Attribute: occi.storagelink.deviceid="dbsystem"' -H 'X-OCCI-Attribute: occi.storagelink.mountpoint="/home/datas"' -H 'X-OCCI-Attribute: occi.core.source="/compute/vm2/a4d58c55-9e73-41bc-834f-1fad497d6738", occi.core.target="/storage/ebs2/28f50616-f73f-45be-b1d3-269cd77457e6"'
curl $CURL_OPTS -X PUT $OCCI_SERVER_URL/networkinterface/ni2/d763533e-91ff-4382-9579-d97d669c67a5 -H 'Content-Type: text/occi' -H 'Category: networkinterface; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", ipnetworkinterface; scheme="http://schemas.ogf.org/occi/infrastructure/networkinterface#"; class="mixin";' -H 'X-OCCI-Attribute: occi.core.id="d763533e-91ff-4382-9579-d97d669c67a5"' -H 'X-OCCI-Attribute: occi.networkinterface.interface="eth0"' -H 'X-OCCI-Attribute: occi.networkinterface.mac="aa:bb:cc:dd:ee:12"' -H 'X-OCCI-Attribute: occi.networkinterface.address="10.1.0.101/16"' -H 'X-OCCI-Attribute: occi.networkinterface.gateway="10.1.255.254"' -H 'X-OCCI-Attribute: occi.networkinterface.allocation="static"' -H 'X-OCCI-Attribute: occi.core.source="/compute/vm2/a4d58c55-9e73-41bc-834f-1fad497d6738", occi.core.target="/network/network1/1a8fe00b-a95c-4718-b039-e5b19a5e21c4"'

OCCI attributes seem to be generated correctly.

Could you recheck that this does not work in your environment?

@cgourdin
Copy link
Member Author

cgourdin commented Mar 9, 2016

I recheck this and it works, i have the same result as you. I dont really understand why it works now and doesn't a day ago.
Thank you very much.

@cgourdin cgourdin closed this as completed Mar 9, 2016
@philippemerle
Copy link
Member

It works now because you corrected yesterday how the attribute occi.core.id is added.
e0ec2f9
Few code must be put in the constructor of EntityImpl else this breaks studio tools (designer, editor, generator, connector, etc.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants