Olu
Olu

Reputation: 11

I need some guidance on an API call that is not returning the expected response

I need some guidance on an API call that is not returning the expected response.

When we call the CreateTenant API, the request creates both a tenant and an admin. We plan to remove the admin using the DeleteAdministrator API call.

However, the response from the CreateTenant API does not return the administrator object as suggested in the 11.3 API reference guide.

Please may you advise on why the Administrator object is not being returned when we make the CreateTenant call?

Upvotes: 1

Views: 116

Answers (1)

ScottBro
ScottBro

Reputation: 309

When the response to the asynchronous request to create the tenant returns before the tenant is in the Active state, the returned Tenant object does not contain the Administrator object.

It takes a certain amount of time for Deep Security Manager to create the tenant, and during that time the tenant is in the Created state. When it is done being created it will be in the Active state and is operational. Once active, you can get the administrator by searching or listing all.

If you make a synchronous call, however, you will receive the response only after the tenant is created an is in the Active state. Therefore, the response will include all of the information that you expect.

Your call would look like this, setting the asynchronous parameter to False(Python SDK):

tenants_api = api.TenantsApi(api.ApiClient(configuration))
returned_tenant = tenants_api.create_tenant(tenant, api_version, confirmation_required=False, asynchronous=False)

I added some content to the guide about this: https://automation.deepsecurity.trendmicro.com/article/12_0/create-tenant?platform=on-premise

Hope that helps -- I'm a content developer for Deep Security, btw.

Upvotes: 1

Related Questions