API PORTAL post installation tasks: error creating the tenant

Document ID : KB000100004
Last Modified Date : 04/06/2018
Show Technical Document Details
Issue:
 The issue is about not being able to create a tenant when running create-tenant.sh script and error show is 
Please check your connection to the servers and/or your json payload Instead If i run the curl in the script i have this error: curl: (56) Received HTTP code 403 from proxy after CONNECT 
Environment:
CA API Developer Portal  4.2.5.2 
Cause:
When running a  curl command without --silent in the create-tenant.sh error seen is
curl: (56) Received HTTP code 403 from proxy after CONNECT
The issue can be related to proxy from error message.
Confirmed that the request is going through proxy by also checking echo $HTTP_PROXY
 
Resolution:
The proxy was configured to allow the traffic from portal server.
Additional Information:
 As a workaround the POST request can be used to create a tenant . 

One can use create-tenant.sh script to form the POST request . For example entry from script has

curl --silent --output ./tenant_info --write-out '%{http_code}' -X POST -k https://xyz:9443/provision/tenants --cert ../certs/apim.pem --key ../certs/apim.pem -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{
"adminEmail": "support@ca.com",
"auditLogLevel": "TRACE",
"multiclusterEnabled": true,
"noReplyEmail":"noreply@ca.com",
"performanceLogLevel": "ERROR",
"portalLogLevel": "ERROR",
"portalName": "supportPortal",
"subdomain": "ca.com",
"tenantId": "apim",
"tenantType": "ON-PREM",
"termOfUse": "Eula"
}'

POST Request would be

url:https://xyz:9443/provision/tenants
Headers: 

Accept: application/json
Content-Type: application/json
Accept-Charset: UTF-8

Body:

{
"adminEmail": "support@ca.com",
"auditLogLevel": "TRACE",
"multiclusterEnabled": true,
"noReplyEmail":"noreply@ca.com",
"performanceLogLevel": "ERROR",
"portalLogLevel": "ERROR",
"portalName": "supportPortal",
"subdomain": "ca.com",
"tenantId": "apim",
"tenantType": "ON-PREM",
"termOfUse": "Eula"
}

Add certificates to the POST request.

Response will be details of tenant created and Status 201 created.