Access denied to get api/cloud/tenants

RESTful knowledge exchange

Access denied to get api/cloud/tenants

Veeam Logoby m.kisselyov » Fri Feb 26, 2016 3:25 am

Hi all!

I'm new to the RESTFul API, and sorry if there was something about my question.
I trying to get api/cloud/tenants url, but server response only
<?xml version="1.0" encoding="utf-8" ?>
<Error StatusCode="403" Message="Access denied." />


Authentication was successful and other api functions such as "LookupSvc" works fine.
I'm using NFR license, Enterprise Plus edition.

Thanks in advice!
m.kisselyov
Influencer
 
Posts: 17
Liked: 2 times
Joined: Fri Feb 26, 2016 3:16 am
Full Name: Mikhail

Re: Access denied to get api/cloud/tenants

Veeam Logoby m.kisselyov » Fri Feb 26, 2016 9:42 am

I think there is was my bad. Am i need service provider license at BR server? :roll:
m.kisselyov
Influencer
 
Posts: 17
Liked: 2 times
Joined: Fri Feb 26, 2016 3:16 am
Full Name: Mikhail

Re: Access denied to get api/cloud/tenants

Veeam Logoby v.Eremin » Fri Feb 26, 2016 11:33 am 1 person likes this post

Am i need service provider license at BR server?

Right. To access cloud entities corresponding license must be in place. Thanks.
v.Eremin
Veeam Software
 
Posts: 13291
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Access denied to get api/cloud/tenants

Veeam Logoby m.kisselyov » Fri Feb 26, 2016 5:14 pm 1 person likes this post

Thanks a lot. And sorry for your time for this similar question.
Love veeam so much.
m.kisselyov
Influencer
 
Posts: 17
Liked: 2 times
Joined: Fri Feb 26, 2016 3:16 am
Full Name: Mikhail

Re: Access denied to get api/cloud/tenants

Veeam Logoby v.Eremin » Mon Feb 29, 2016 11:01 am

You're welcome. Should other help be needed, feel free to contact us. Thanks.
v.Eremin
Veeam Software
 
Posts: 13291
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

[MERGED] REST API Cloud Connect Access denied

Veeam Logoby jle » Tue May 09, 2017 9:38 am

Hello all :-),

I'am trying to use the REST Full API to retrieve some informations about the cloud connect tenants, replicas ...

I'am able to open a logonsession, i can access /api/backupservers etc with no problems, but when i try to access to /api/cloud i get an Access Denied error :

<?xml version="1.0" encoding="utf-8"?><Error Message="Access denied." StatusCode="403" 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"/>

Please note that i have an Enterprise plus licence, the account provided have the Portal Administrator Role

I don't think it is a problem with the account because if i use the https://ENT_ADMIN:9398/web/ url with the same account i have no issue to access the api/cloud

Please find below two logonsessions opened with the same account, one through the /web app and one through my php code. We can see that there are differences in the list of the Links provided by the API :

Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<LogonSessions 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">
  <LogonSession Href="https://*****.******.local:9398/api/logonSessions/014d11f8-c3a7-4c30-a5da-01bce405d6ae" Type="LogonSession">
    <Links>
      <Link Href="https://*****.******.local:9398/api/" Type="EnterpriseManager" Rel="Up"/>
      <Link Href="https://*****.******.local:9398/api/backupServers" Type="BackupServerReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/managedServers" Type="ManagedServerReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/jobs" Type="JobReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/failoverPlans" Type="FailoverPlanReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/hierarchyRoots" Type="HierarchyRootReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/repositories" Type="RepositoryReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/backups" Type="BackupReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/restorePoints" Type="RestorePointReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/vmRestorePoints" Type="VmRestorePointReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/vAppRestorePoints" Type="VAppRestorePointReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/replicas" Type="ReplicaReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/vmReplicaPoints" Type="VmReplicaPointReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/catalog/vms" Type="CatalogVmReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/backupSessions" Type="BackupJobSessionReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/restoreSessions" Type="RestoreSessionReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/replicaSessions" Type="ReplicaJobSessionReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/backupTaskSessions" Type="BackupTaskSessionReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/replicaTaskSessions" Type="ReplicaTaskSessionReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/security" Type="EnterpriseSecuritySettings" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/tasks" Type="TaskList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/querySvc" Type="QueryService" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/lookupSvc" Type="LookupService" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/reports/summary" Name="Summary" Type="Report" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/backupServers?format=Entity" Type="BackupServerList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/managedServers?format=Entity" Type="ManagedServerList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/backupServers?action=create" Rel="Create"/>
      <Link Href="https://*****.******.local:9398/api/jobs?format=Entity" Type="JobList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/failoverPlans?format=Entity" Type="FailoverPlanList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/hierarchyRoots?format=Entity" Type="HierarchyRootList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/repositories?format=Entity" Type="RepositoryList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/backups?format=Entity" Type="BackupList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/restorePoints?format=Entity" Type="RestorePointList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/vmRestorePoints?format=Entity" Type="VmRestorePointList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/vAppRestorePoints?format=Entity" Type="VAppRestorePointList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/replicas?format=Entity" Type="ReplicaList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/vmReplicaPoints?format=Entity" Type="VmReplicaPointList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/catalog/vms?format=Entity" Type="CatalogVmList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/backupSessions?format=Entity" Type="BackupJobSessionList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/restoreSessions?format=Entity" Type="RestoreSessionList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/replicaSessions?format=Entity" Type="ReplicaJobSessionList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/backupTaskSessions?format=Entity" Type="BackupTaskSessionList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/replicaTaskSessions?format=Entity" Type="ReplicaTaskSessionList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/logonSessions/014d11f8-c3a7-4c30-a5da-01bce405d6ae" Rel="Delete"/>
    </Links>
    <UserName>*****\veeamwebsvc</UserName>
    <SessionId>014d11f8-c3a7-4c30-a5da-01bce405d6ae</SessionId>
  </LogonSession>
  <LogonSession Href="https://*****.******.local:9398/api/logonSessions/c497534c-df02-44ce-a3bd-b740c7d89a00" Type="LogonSession">
    <Links>
      <Link Href="https://*****.******.local:9398/api/" Type="EnterpriseManager" Rel="Up"/>
      <Link Href="https://*****.******.local:9398/api/backupServers" Type="BackupServerReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/managedServers" Type="ManagedServerReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/jobs" Type="JobReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/failoverPlans" Type="FailoverPlanReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/hierarchyRoots" Type="HierarchyRootReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/repositories" Type="RepositoryReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/backups" Type="BackupReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/restorePoints" Type="RestorePointReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/vmRestorePoints" Type="VmRestorePointReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/vAppRestorePoints" Type="VAppRestorePointReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/replicas" Type="ReplicaReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/vmReplicaPoints" Type="VmReplicaPointReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/catalog/vms" Type="CatalogVmReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/backupSessions" Type="BackupJobSessionReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/restoreSessions" Type="RestoreSessionReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/replicaSessions" Type="ReplicaJobSessionReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/backupTaskSessions" Type="BackupTaskSessionReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/replicaTaskSessions" Type="ReplicaTaskSessionReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/security" Type="EnterpriseSecuritySettings" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/wanAccelerators" Type="WanAcceleratorReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/backupFiles" Type="BackupFileReferenceList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/tasks" Type="TaskList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/querySvc" Type="QueryService" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/lookupSvc" Type="LookupService" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/reports/summary" Name="Summary" Type="Report" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/backupServers?format=Entity" Type="BackupServerList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/managedServers?format=Entity" Type="ManagedServerList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/backupServers?action=create" Rel="Create"/>
      <Link Href="https://*****.******.local:9398/api/jobs?format=Entity" Type="JobList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/failoverPlans?format=Entity" Type="FailoverPlanList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/hierarchyRoots?format=Entity" Type="HierarchyRootList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/repositories?format=Entity" Type="RepositoryList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/backups?format=Entity" Type="BackupList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/restorePoints?format=Entity" Type="RestorePointList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/vmRestorePoints?format=Entity" Type="VmRestorePointList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/vAppRestorePoints?format=Entity" Type="VAppRestorePointList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/replicas?format=Entity" Type="ReplicaList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/vmReplicaPoints?format=Entity" Type="VmReplicaPointList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/catalog/vms?format=Entity" Type="CatalogVmList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/backupSessions?format=Entity" Type="BackupJobSessionList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/restoreSessions?format=Entity" Type="RestoreSessionList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/replicaSessions?format=Entity" Type="ReplicaJobSessionList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/backupTaskSessions?format=Entity" Type="BackupTaskSessionList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/replicaTaskSessions?format=Entity" Type="ReplicaTaskSessionList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/wanAccelerators?format=Entity" Type="WanAcceleratorList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/vCloud" Type="VCloudService" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/backupFiles?format=Entity" Type="BackupFileList" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/cloud" Type="CloudConnectService" Rel="Down"/>
      <Link Href="https://*****.******.local:9398/api/logonSessions/c497534c-df02-44ce-a3bd-b740c7d89a00" Rel="Delete"/>
    </Links>
    <UserName>*****\veeamwebsvc</UserName>
    <SessionId>c497534c-df02-44ce-a3bd-b740c7d89a00</SessionId>
  </LogonSession>
</LogonSessions>


Have you an idea about the origin of this issue and wich other tests can i do ?
Thanks for your help
jle
Service Provider
 
Posts: 4
Liked: never
Joined: Tue Oct 26, 2010 6:47 am
Full Name: Julien LEMOING

Re: REST API Cloud Connect Access denied

Veeam Logoby v.Eremin » Thu May 11, 2017 1:31 pm

You need to have a Service Provider license to access cloud specific entities, which does not seem to be the case. Thanks.
v.Eremin
Veeam Software
 
Posts: 13291
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Access denied to get api/cloud/tenants

Veeam Logoby jle » Thu May 11, 2017 1:44 pm

Thanks for your answer.

I have the service provider licence, take a look at the log :
Code: Select all
......
[11.05.2017 10:52:34] <106> Info     Validating license..
[11.05.2017 10:52:34] <106> Info     Sql proc: [[usp.License.GetLicensedHostsAll]], args: []
[11.05.2017 10:52:34] <106> Info     Sql query: [SELECT * FROM [dbo].[C.PhysicalHosts]], args: []
[11.05.2017 10:52:34] <106> Info     License is validated. Status: 'Success', Comment: 'License is valid.'
[11.05.2017 10:52:34] <106> Info     Checking the license edition. Current license edition: EnterprisePlus
[11.05.2017 10:52:34] <106> Info     [104791cff3254e7c9de8dcdca0094bbf] Initializing session [104791cf-f325-4e7c-9de8-dcdca0094bbf]
[11.05.2017 10:52:34] <106> Info     Creating RESTful API session for Enterprise Plus license...
[11.05.2017 10:52:34] <106> Info     RestoreTaskTracker thread started.
[11.05.2017 10:52:34] <106> Warning  Query fields already contains the key [ViCloudHardwarePlanDatastoreResource]
[11.05.2017 10:52:34] <106> Warning  Query fields already contains the key [HvCloudHardwarePlanDatastoreResource]
[11.05.2017 10:52:34] <106> Warning  Query fields already contains the key [CloudPublicIpAddress]
[11.05.2017 10:52:34] <106> Info     Adding Service Provider functionality...
[11.05.2017 10:52:34] <106> Info     RESTful API version is 9.x
[11.05.2017 10:52:34] <106> Info     Rest session successfully created. UserSID: [S-1-5-21-497936628-3315531469-3050924384-1110].
[11.05.2017 10:52:34] <106> Info     User [******\veeamwebsvc] was successfully logged on.


Since my first message i made anothers tests and i found that when i access the API from a server in the same AD domain and same network as the Enterprise manager server it works perfectly.
But if i access the API from a server outside the domain i get this error message in the log :
* Please not that i have no problem to access others api entities like /api/backupservers ...

Code: Select all
[11.05.2017 10:52:35] <106> Info     [GET] request to [https://********.local:9398/api/cloud] deserialized. Message: []; Parameters: [].
[11.05.2017 10:52:35] <106> Error    Failed to retrieve CloudConnectSvc.. RequestUri: [https://*********:9398/api/cloud].
[11.05.2017 10:52:35] <106> Error    Access denied. (System.UnauthorizedAccessException)
[11.05.2017 10:52:35] <106> Error       at Veeam.Backup.Enterprise.RestAPIService.CNormalRestSession.get_CloudConnectSvcScope()
[11.05.2017 10:52:35] <106> Error       at Veeam.Backup.Enterprise.RestAPIService.CEnterpriseRestServiceStub.GetCloudConnectService()


Have you an idea why i can't request de cloud connect api outside the Enterprise manager domain ?
jle
Service Provider
 
Posts: 4
Liked: never
Joined: Tue Oct 26, 2010 6:47 am
Full Name: Julien LEMOING


Return to RESTful API



Who is online

Users browsing this forum: No registered users and 2 guests