Large enterprise customers want to manage their silo provisioning through the API and to do it in bulk.  This entry helps all customers doing this through the API when/if we perform modifications to those APIs. This article lists the names of different API used, sequence of API and sample requests and responses for multi-tenant silo provisioning.

  • Customer Use Case :
    • Admin user logs in to Multi-Tenant System
    • Creates a Silo and Add a multi-tenant user to the silo
    • Multi-tenant user logs into the system.
    • Delete Multi-tenant user and delete silo

The above use case can be executed using Nexpose APIs. The list of APIs and sequence of execution needed to achieve this user flow is given below:

  • Login

  • SiloprofileCreate

  • SiloprofileListing

  • CreateSilo

  • SiloConfig

  • SiloUpdate

  • MultiTenantUserCreate

  • Login (as new multitenant user)

  • MultiTenantUserDelete

  • DeleteSilo

  • Login: This API is used to login to Nexpose Application.  The user logs in an admin user.

Sample Request & Response:

Request :

<?xml version="1.0" ?>
<LoginRequest password="nxadmin" user-id="nxadmin"/>

Response:

<LoginResponse success="1" session-id="9D10E7D49B37BF7B920C50AEBB99AF72180A59BA"/>
  • SiloProfileCreate : This API is used to create a new Siloprofile.

Sample Request & Response:

Request :

<?xml version="1.0" ?>
<SiloProfileCreateRequest session-id="9D10E7D49B37BF7B920C50AEBB99AF72180A59BA" sync-id="Hackathon2012-08-31T03:47:21Z">

<SiloProfileConfig all-global-engines="1" all-global-report-templates="1" all-global-scan-templates="1" all-licensed-modules="1" description="my description" id="4088ea10-6539-4e19-b492-8fab25e32fd8"name="2012-08-31T03:47:21Z">

<RestrictedReportSections>

<RestrictedReportSection name="BaselineComparison"/>

<RestrictedReportSection name="ScanSettings"/>

<RestrictedReportSection name="SystemOverview"/>

</RestrictedReportSections>

</SiloProfileConfig>

</SiloProfileCreateRequest>

Response:

<LoginResponse success="1" session-id="9D10E7D49B37BF7B920C50AEBB99AF72180A59BA"/>
  • SiloprofileListing :  This API retrieves the silo profile info by passing the silo profile id.

Sample Request & Response:

Request:

<?xml version="1.0" ?>
<SiloProfileConfigRequest session-id="9D10E7D49B37BF7B920C50AEBB99AF72180A59BA" silo-profile-id="4088ea10-6539-4e19-b492-8fab25e32fd8"/>

Response :

<SiloProfileConfigResponse>
<SiloProfileConfig all-global-report-templates="true" all-global-engines="true" all-global-scan-templates="true" all-licensed-modules="true" description="my description" name="2012-08-31T03:47:21Z" id="4088ea10-6539-4e19-b492-8fab25e32fd8">
                     <GlobalReportTemplates/>
<GlobalScanEngines/>
                     <GlobalScanTemplates/>
                     <LicensedModules/>
                     <RestrictedReportFormats/>
                     <RestrictedReportSections>
                    <RestrictedReportSection name="BaselineComparison"/>
                     <RestrictedReportSection name="ScanSettings"/>
                     <RestrictedReportSection name="SystemOverview"/>
                     </RestrictedReportSections>
                       </SiloProfileConfig>
SiloProfileConfigResponse>
  • CreateSilo :  This API is used to create a new silo.

Sample Request & Response:

Request:

<?xml version="1.0" ?>
<SiloCreateRequest session-id="9D10E7D49B37BF7B920C50AEBB99AF72180A59BA" sync-id="Hackathon2012-08-31T03:47:21Z">

<SiloConfig description="silo1" id="silo1346384840873" max-assets="10000" max-users="100"name="-2012-08-31T03:47:21Z" silo-profile-id="4088ea10-6539-4e19-b492-8fab25e32fd8">

<Merchant acquirer-relationship="0" agent-relationship="0" company="dT9wZW51304110026873"ecommerce="true" email-address="rDrMM6GeGE@gVDim.com" first-name="QV9HW3E1304110026889"grocery="1" last-name="QgnTpPh1304110026889" mail-order="0" payment-application="aLgj1Vo1304110026904" payment-version="B3t9qpy1304110026904" petroleum="0" phone-number="7076763526" retail="false" telecommunication="true" title="L0u7Iev1304110026904" travel="false"url="https://RkK9UwR1304110026904.nR5">

<Address city="B6B0upz1304110026873" country="Fuuyzo11304110026873"line1="AH82LQ11304110026873" line2="EVpq0xW1304110026873" state="Ltqxeqg1304110026873"zip="37462"/>

<OtherIndustries>

<Industry name="7rGpubE1304110026904"/>

</OtherIndustries>

<QSA company="vFhSsb11304110026904" email-address="Jwd8YZhbEP@upv7B.com" first-name="jBTLg6t1304110026904" last-name="eSeYwHe1304110026904" phone-number="1007160078"title="7Zmo43I1304110026904" url="http://A0XZOjV1304110026904.Rz4">

<Address city="S7nwpQE1304110026904" country="XbilwGU1304110026904"line1="Ws11OJD1304110026904" line2="NhklMI21304110026904" state="heoMTJB1304110026904"zip="58707"/>

</QSA>

</Merchant>

<Organization company="dSfgmdm1304110026873" email-address="UMpcejzaoa@7fddj.com" first-name="xotsAUS1304110026873" last-name="IitFzPo1304110026873" phone-number="7579414971"title="WdJ28IK1304110026873" url="http://1uPeCU91304110026873.JMk">

<Address city="WwSaxdL1304110026873" country="zshg9JF1304110026873"line1="y8guXrd1304110026873" line2="j5klWPH1304110026873" state="Gv6QixR1304110026873"zip="99561"/>

</Organization>

</SiloConfig>

</SiloCreateRequest>

Response:

<?xml version="1.0" ?>
<SiloCreateResponse id="silo1346384840873" sync-id="Hackathon2012-08-31T03:47:21Z"/>
  • SiloConfig :  This API is used to retrieve the newly created silo info.

Sample Request & Response:

Request:

<?xml version="1.0" ?>
<SiloConfigRequest session-id="9D10E7D49B37BF7B920C50AEBB99AF72180A59BA" silo-id="silo1346384840873"/>
 

Response :

<?xml version="1.0" ?>
<SiloConfigResponse>

<SiloConfig description="silo1" id="silo1346384840873" max-assets="10000" max-hosted-assets="0" max-users="100" name="-2012-08-31T03:47:21Z" silo-profile-id="4088ea10-6539-4e19-b492-8fab25e32fd8">

<Merchant acquirer-relationship="false" agent-relationship="false" company="dT9wZW51304110026873"ecommerce="true" email-address="rDrMM6GeGE@gVDim.com" first-name="QV9HW3E1304110026889"grocery="true" last-name="QgnTpPh1304110026889" mail-order="false" payment-application="aLgj1Vo1304110026904" payment-version="B3t9qpy1304110026904" petroleum="false" phone-number="7076763526" retail="false" telecommunication="true" title="L0u7Iev1304110026904" travel="false"url="https://RkK9UwR1304110026904.nR5">

<Address city="B6B0upz1304110026873" country="Fuuyzo11304110026873"line1="AH82LQ11304110026873" line2="EVpq0xW1304110026873" state="Ltqxeqg1304110026873"zip="37462"/>

<OtherIndustries>

<Industry name="7rGpubE1304110026904"/>

</OtherIndustries>

<QSA company="vFhSsb11304110026904" email-address="Jwd8YZhbEP@upv7B.com" first-name="jBTLg6t1304110026904" last-name="eSeYwHe1304110026904" phone-number="1007160078"title="7Zmo43I1304110026904" url="http://A0XZOjV1304110026904.Rz4">

<Address city="S7nwpQE1304110026904" country="XbilwGU1304110026904"line1="Ws11OJD1304110026904" line2="NhklMI21304110026904" state="heoMTJB1304110026904"zip="58707"/>

</QSA>

</Merchant>

<Organization company="dSfgmdm1304110026873" email-address="UMpcejzaoa@7fddj.com" first-name="xotsAUS1304110026873" last-name="IitFzPo1304110026873" phone-number="7579414971"title="WdJ28IK1304110026873" url="http://1uPeCU91304110026873.JMk">

<Address city="WwSaxdL1304110026873" country="zshg9JF1304110026873"line1="y8guXrd1304110026873" line2="j5klWPH1304110026873" state="Gv6QixR1304110026873"zip="99561"/>

</Organization>

</SiloConfig>

</SiloConfigResponse>
  • SiloUpdate : This API is used to update silo specific info.

Request:

<?xml version="1.0" ?>
<SiloUpdateRequest session-id="9D10E7D49B37BF7B920C50AEBB99AF72180A59BA" sync-id="Hackathon2012-08-31T03:47:21Z">

<SiloConfig description="silo1" id="silo1346384840873" max-assets="100000" max-users="1000"name="-2012-08-31T03:47:39Z" silo-profile-id="4088ea10-6539-4e19-b492-8fab25e32fd8">

<Merchant acquirer-relationship="0" agent-relationship="0" company="dT9wZW51304110026873"ecommerce="true" email-address="rDrMM6GeGE@gVDim.com" first-name="QV9HW3E1304110026889"grocery="1" last-name="QgnTpPh1304110026889" mail-order="0" payment-application="aLgj1Vo1304110026904" payment-version="B3t9qpy1304110026904" petroleum="0" phone-number="7076763526" retail="false" telecommunication="true" title="L0u7Iev1304110026904" travel="false"url="https://RkK9UwR1304110026904.nR5">

<Address city="B6B0upz1304110026873" country="Fuuyzo11304110026873"line1="AH82LQ11304110026873" line2="EVpq0xW1304110026873" state="Ltqxeqg1304110026873"zip="37462"/>

<OtherIndustries>

<Industry name="7rGpubE1304110026904"/>

</OtherIndustries>

<QSA company="vFhSsb11304110026904" email-address="Jwd8YZhbEP@upv7B.com" first-name="jBTLg6t1304110026904" last-name="eSeYwHe1304110026904" phone-number="1007160078"title="7Zmo43I1304110026904" url="http://A0XZOjV1304110026904.Rz4">

<Address city="S7nwpQE1304110026904" country="XbilwGU1304110026904"line1="Ws11OJD1304110026904" line2="NhklMI21304110026904" state="heoMTJB1304110026904"zip="58707"/>

</QSA>

</Merchant>

<Organization company="dSfgmdm1304110026873" email-address="UMpcejzaoa@7fddj.com" first-name="xotsAUS1304110026873" last-name="IitFzPo1304110026873" phone-number="7579414971"title="WdJ28IK1304110026873" url="http://1uPeCU91304110026873.JMk">

<Address city="WwSaxdL1304110026873" country="zshg9JF1304110026873"line1="y8guXrd1304110026873" line2="j5klWPH1304110026873" state="Gv6QixR1304110026873"zip="99561"/>

</Organization>

</SiloConfig>

</SiloUpdateRequest>

Response :

<?xml version="1.0" ?>
<SiloUpdateResponse id="silo1346384840873" sync-id="Hackathon2012-08-31T03:47:21Z"/>
  • MultiTenantUserCreate : This API is used to create a new multi-tenant user in a specific silo.

Sample Request & Response:

Request:

<?xml version="1.0" ?>
<MultiTenantUserCreateRequest session-id="9D10E7D49B37BF7B920C50AEBB99AF72180A59BA">

<MultiTenantUserConfig authsrcid="1" email="jdoe@company.com" enabled="true" full-name="Warriors4088ea10-6539-4e19-b492-8fab25e32fd8" password="password" superuser="true" user-name="Warriorsf98ad0b5-c551-4c95-b21a-8c0ea369388a">

<SiloAccesses>

<SiloAccess all-groups="true" all-sites="false" default-silo="true" role-name="user" silo-id="silo1346384840873">

<AllowedSites>

</AllowedSites>

</SiloAccess>

</SiloAccesses>

</MultiTenantUserConfig>

</MultiTenantUserCreateRequest>

Response :

<?xml version="1.0" ?>
<MultiTenantUserCreateResponse user-id="33"/>
  • Login (new Multi-tenant user): This API is used to login the newly created multi-tenant user to their silo.

Sample Request & Response:

Request:

<?xml version="1.0" ?>
<LoginRequest password="password" silo-id="silo1346384840873" user-id="Warriorsf98ad0b5-c551-4c95-b21a-8c0ea369388a"/>

Response :

<?xml version="1.0" ?>
<LoginResponse session-id="F1E650B7609C81D66262767FC514EEE27E160658" success="1"/>
  • Multi-TenantUserDelete : This API is used to DELETE the newly created multi-tenant user.

Sample Request & Response:

Request:

?xml version="1.0" encoding="utf-8"?>
<MultiTenantUserDeleteRequest session-id="9D10E7D49B37BF7B920C50AEBB99AF72180A59BA" user-name="Warriorsf98ad0b5-c551-4c95-b21a-8c0ea369388a"/>

Response :

<MultiTenantUserDeleteResponse/>
  • DeleteSilo : This API is used to DELETE the Silo.

Sample Request & Response:

Request :

<?xml version="1.0" ?>
<SiloDeleteRequest session-id="9D10E7D49B37BF7B920C50AEBB99AF72180A59BA" silo-id="silo1346384840873"/>

Response:

<SiloDeleteResponse/>