RESTful knowledge exchange
Post Reply
jzitny
Lurker
Posts: 2
Liked: never
Joined: Jan 30, 2015 5:41 pm
Contact:

Internal Server Error when editing tenant

Post by jzitny »

Hi,

we're testing the new part of api working with /cloud/tenants. However, when trying to PUT a request to change specific tenant at /cloud/tenants/{id} we're receiving 500 Internal Server Error. The same is happening when trying to POST a request to add storage quota on a resource at /cloud/tenants/{id}/resources.

The response body looks like this:

Code: Select all

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Error xmlns="http://www.veeam.com/ent/v1.0 xmlns:xsd="http://www.w3.org/2001/XMLSchema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance StatusCode="500" Message="Object reference not set to an instance of an object.">
    <FirstChanceExceptionMessage>Object reference not set to an instance of an object.</FirstChanceExceptionMessage>
    <StackTrace>Veeam.Backup.Interaction.RestAPI.CRestAPICommunicationException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object.&#xD;
   at Veeam.Backup.Enterprise.RestAPIService.CRestApiCloudTenantsScope.EditCloudTenant(String tenantIdStr, CloudTenantEntityType entity)&#xD;
   at Veeam.Backup.Enterprise.RestAPIService.CEnterpriseRestServiceStub.EditCloudTenant(String tenantIdOrName, CloudTenantEntityType entity)&#xD;
   at SyncInvokeEditCloudTenant(Object , Object[] , Object[] )&#xD;
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)&#xD;
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)&#xD;
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)&#xD;
   --- End of inner exception stack trace ---</StackTrace>
</Error>
- although object instance id is correct and when GETting it, the response is allright.

Another question, is it possible to create a tenant from API? There is no documentation on creating /cloud/tenant with POST. Is there any other way to create the tenant or is there a plan to add this feature to the API?

Thanks.
agtcovert
Novice
Posts: 3
Liked: 2 times
Joined: Jul 14, 2011 1:28 am
Contact:

Re: Internal Server Error when editing tenant

Post by agtcovert »

I am very also interested in the answer to the question about adding a user via the API. I've been up and down the documentation and don't see anything documented that leads me to believe adding a cloud tenant is supported by the REST API currently. There's a Powershell command to do it--all I've found.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Internal Server Error when editing tenant

Post by veremin »

Can you provide a whole request you're experiencing problems with?

As to tenant's creation, you can issue a POST request to /api/cloud/tenants resources and provide a similar spec:

Code: Select all

<CreateCloudTenantSpec xmlns="http://www.veeam.com/ent/v1.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><BackupServerIdOrName>BackupServerIDorName</BackupServerIdOrName><Name>Tenant's Name</Name><Password>Tenant's Password</Password><Enabled>true</Enabled></CreateCloudTenantSpec>
Thanks.
jzitny
Lurker
Posts: 2
Liked: never
Joined: Jan 30, 2015 5:41 pm
Contact:

Re: Internal Server Error when editing tenant

Post by jzitny »

Hi, thanks for the reply and sorry for late response. The problem was in the request format indeed.

We've found a project for creation of vcc tennants at github and we're extending it — https://github.com/poulpreben/veeam-cloudconnect.

Also the POST entry for API at /cloud/tenants has been added to docs — http://helpcenter.veeam.com/backup/80/r ... nmngr.html.

Thanks.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Internal Server Error when editing tenant

Post by veremin »

Glad to hear you've come across Preben's (our team leader solution architects) project part of which he demonstrated during our session at VeeamON 2014.

As to our online help center, whenever you feel the information provided there is either misleading or incomplete you can use the "send feedback" link at the bottom of the page. Tech writers team behind that resource reacts to such feedback in timely fashion.

Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest