Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-8838

[fiware-stackoverflow] SDC from the CLI. Cannot install a product on VM

    Details

      Description

      Created question in FIWARE Q/A platform on 01-06-2016 at 13:06
      Please, ANSWER this question AT https://stackoverflow.com/questions/37566773/sdc-from-the-cli-cannot-install-a-product-on-vm

      Question:
      SDC from the CLI. Cannot install a product on VM

      Description:
      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

        Activity

        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]
        fla Fernando Lopez made changes -
        HD-Enabler Sagitta [ 10866 ]
        Description
        Created question in FIWARE Q/A platform on 01-06-2016 at 13:06
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/37566773/sdc-from-the-cli-cannot-install-a-product-on-vm


        +Question:+
        SDC from the CLI. Cannot install a product on VM

        +Description:+
        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 ('&lt;' (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):

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


        What I see as a very minimialist and clear payload

        &lt;productInstanceDto&gt;
            &lt;vm&gt;
                &lt;ip&gt;MYIP&lt;/ip&gt;
            &lt;/vm&gt;
            &lt;product&gt;
                &lt;name&gt;apache2&lt;/name&gt;
            &lt;/product&gt;
        &lt;/productInstanceDto&gt;


        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
        Created question in FIWARE Q/A platform on 01-06-2016 at 13:06
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/37566773/sdc-from-the-cli-cannot-install-a-product-on-vm


        +Question:+
        SDC from the CLI. Cannot install a product on VM

        +Description:+
        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 ('&lt;' (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):

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


        What I see as a very minimialist and clear payload

        &lt;productInstanceDto&gt;
            &lt;vm&gt;
                &lt;ip&gt;MYIP&lt;/ip&gt;
            &lt;/vm&gt;
            &lt;product&gt;
                &lt;name&gt;apache2&lt;/name&gt;
            &lt;/product&gt;
        &lt;/productInstanceDto&gt;


        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
        jicg José Ignacio Carretero Guarde made changes -
        Resolution Done [ 10000 ]
        Status Answered [ 10104 ] Closed [ 6 ]
        jicg José Ignacio Carretero Guarde made changes -
        Assignee Henar Muñoz [ henar ]
        backlogmanager Backlog Manager made changes -
        Status In Progress [ 3 ] Answered [ 10104 ]
        backlogmanager Backlog Manager made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        backlogmanager Backlog Manager created issue -

          People

          • Assignee:
            henar Henar Muñoz
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: