0

Following what says here, I got a connection refused using this curl:

curl -v -H "Content-Type: application/json" -H "Accept: application/xml" -H "X-Auth-Token: 756cfb31e062216544215f54447e2716" -H "Tenant-Id: your-tenant-id" -X POST "http://saggita.lab.fi-ware.org:8080/sdc/rest/vdc/{your-tenant-id}/productInstance"

I changed it to what seems the appropriate URL:

cat test-data | curl --insecure -v -H "Content-Type: application/json" -H "Accept: application/xml" -H "X-Auth-Token: 756cfb31e062216544215f54447e2716" -H "Tenant-Id: your-tenant-id" -X POST "https://saggita.lab.fi-ware.org:8443/sdc/rest/vdc/{your-tenant-id}/productInstance" --data-binary @-

Comment: I used the file test-data as payload, I show later what payload I am using.

With that petition (with the appropriate auth token and specific parameters for my environment) I got:

Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')

Seems is expecting JSON instead of XML, so I rearranged like this:

cat test-data | curl --insecure -v -H "Content-Type: application/xml" -H "Accept: application/xml" -H "X-Auth-Token: 756cfb31e062216544215f54447e2716" -H "Tenant-Id: your-tenant-id" -X POST "https://saggita.lab.fi-ware.org:8443/sdc/rest/vdc/{your-tenant-id}/productInstance" --data-binary @-

And I got this message no matter how I change payload:

{"message":"The entity is not valid","code":42}

I tried this two payloads (with the example of installing apache):

<productInstanceDto>
        <vm>
        <ip>MYIP</ip>
        <fqn>same as hostname, I don't have DNS resolution</fqn>
        <hostname>MYHOSTNAME</hostname>
        </vm>
        <product>
        <productDescription/>
        <name>apache2</name>
        </product>
        <attributes>
                <key>custom_att_02</key>
                <value>default_value_plain</value>
                <type>Plain</type>
        </attributes>
</productInstanceDto>

What I see as a very minimialist and clear payload

<productInstanceDto>
    <vm>
        <ip>MYIP</ip>
    </vm>
    <product>
        <name>apache2</name>
    </product>
</productInstanceDto>

By the way, I see so unfortunate fields like fqdn (could be missing, no dns resolution on that server), version (why I have to know the version of the product I want to install, this does not appear in the Product Catalogue), the missing of VM_ID parameter: available, easy and unique.

What I'm doing wrong? Thanks

1 Answers1

0

You are using the FIWARE Lab infrastructure for using the SDC component. However, they are some requirements to install software inside the VM, for instance, having chef/puppet installed, to have the VM registered in the chef-server (you can have a look at https://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/Software_Deployment_%26_Configuration_-_Installation_and_Administration_Guide). Thus, my suggestion if you want to use SDC in FIWARE Lab infrastructure is that you use the blueprint capabilities in the cloud portal (cloud.lab.fiware.org), which deploy the VMs, prepare the VMs, register the VMs in the chef-server and so on. You can have a look at the video blueprints in http://help.lab.fiware.org/.

henar
  • 1