VMware {code} Community
ChandraSekhar19
Contributor
Contributor

DiskCreateParams actions request is failing with ERROR code 415 : UnSupportedMediaType

Hello All,

I'm trying REST API to create an Independent disk in an organizations vDC, but the request is failing with error code 415(UnSupported Media Type).

Here is the Complete response( includes Request too )

$VAR1 = bless( {

                 '_protocol' => 'HTTP/1.1',

                 '_content' => '<?xml version="1.0" encoding="UTF-8"?>

<Error xmlns="http://www.vmware.com/vcloud/v1.5" minorErrorCode="UNSUPPORTED_MEDIA_TYPE" message="Unsupported Media Type" majorErrorCode="415" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://10.80.30.100/api/v1.5/schema/master.xsd"></Error>

',

                 '_rc' => '415',

                 '_headers' => bless( {

                                        'connection' => 'close',

                                        'client-response-num' => 1,

                                        'date' => [

                                                    'Wed, 12 Jun 2013 10:48:25 GMT',

                                                    'Wed, 12 Jun 2013 10:48:25 GMT'

                                                  ],

                                        'client-ssl-cert-issuer' => '/C=US/ST=Massachusetts/L=Cambridge/O=VMware Corporation/OU=Engineering/CN=mycloud.localdom',

                                        'client-ssl-cipher' => 'EDH-RSA-DES-CBC3-SHA',

                                        'client-peer' => 'xx.xx.xxx.xxx:443',

                                        'client-date' => 'Wed, 12 Jun 2013 10:43:11 GMT',

                                        'content-type' => 'application/vnd.vmware.vcloud.error+xml;version=5.1',

                                        'client-ssl-warning' => 'Peer certificate not verified',

                                        'client-ssl-cert-subject' => '/C=US/ST=Massachusetts/L=Cambridge/O=VMware Corporation/OU=Engineering/CN=mycloud.localdom'

                                      }, 'HTTP::Headers' ),

                 '_msg' => 'Unsupported Media Type',

                 '_request' => bless( {

                                        '_content' => '<?xml version="1.0" encoding="UTF-8"?>

<DiskCreateParams

xmlns="http://www.vmware.com/vcloud/v1.5">

<Disk

name="iDisk1"

size="1024">

<Description>Independent Disk 1 - 1GB</Description>

</Disk>

</DiskCreateParams>',

                                        '_uri' => bless( do{\(my $o = 'https://xx.xxx.xxx.xx/api/vdc/43de3d30-3e83-46c2-a2ea-a352eae486aa/disk')}, 'URI::https' ),

                                        '_headers' => bless( {

                                                               'user-agent' => 'libwww-perl/5.805',

                                                               'x-vcloud-authorization' => 'xxxxxxxxxxxxxxxx',

                                                               'media-type' => 'application/xml',

                                                               'content-type' => 'application/vnd.vmware.admin.diskCreateParams+xml',

                                                               'accept' => 'application/*+xml;version=5.1',

                                                               'content-length' => 215

                                                             }, 'HTTP::Headers' ),

                                        '_method' => 'POST'

                                      }, 'HTTP::Request' )

               }, 'HTTP::Response' );

Could any one check for error in this request
i have checked the content-type too. which is the general case for error 415.

Regards,

Chandra Sekhar.

Reply
0 Kudos
1 Reply
yonish
Contributor
Contributor

Hello,

I have the same problem.

Did you find the problem,?

Reply
0 Kudos