cancel
Showing results forĀ 
ShowĀ Ā onlyĀ  | Search instead forĀ 
Did you mean:Ā 
kiangorji
Level 3

How to get list of HOSTIDS for all Cloud License Servers?

Jump to solution

How to get the list of all hostids for all of our servers hosted in the cloud, using the REST API?

The documentation says to use global level "/hostids" which works on local license servers BUT NOT with FNO. The problem is not "authentication" but rather, what's the correct endpoint URL for "global level REST API to FNO", not a specific cloud server?

The following tests should make the problem clear:

https://flexXXXX-uat.compliance.flexnetoperations.com/api/1.0/hostids
(with appropriate ID for 'XXXX')
Fails with "Not found".  In fact this doesn't even seem to be a valid REST endpoint.
http://localserverUrl/api/1.0/hostidsWorks. This validates that "/hostids" works. But I want the same thing for CLOUD SERVERS, not local servers.
https://flexXXXX-uat.compliance.flexnetoperations.com/api/1.0/instances/XYZ10203040/Works. This validates that I have the correct path for a specific cloud server. But I want 'hostids' FOR ALL cloud servers, not a specific one.
https://flexXXXX-uat.compliance.flexnetoperations.com/api/1.0/instances/XYZ10203040/hostids/Fails, which proves the "/hostids" REST command is not supported even for a specific cloud license server, like it is on a local license server.


All my other REST calls work perfectly (authorize, features, etc.) so this is a specific problem for the '/hostids' endpoint only.

Any help appreciated.

0 Kudos
(1) Solution
jberthold
Revenera Moderator Revenera Moderator
Revenera Moderator

Hi @kiangorji ,

You can use the REST API from the "manage-device-service-rest-controller" to obtain a list of all Server IDs.

The link to the Swagger page is here:  https://flexNNNN.flexnetoperations.com/flexnet/swagger-ui.html#/manage45device45service45rest45controller

Send a POST to https://flexNNNN.flexnetoperations.com/flexnet/operations/manageDevice/1.0/devices 

with the following query 

"queryParams": {
    "deviceTypes": {
      "deviceType": [
        "SERVER"
      ]
 
To retrieve all SERVER devices.  Note that this will include LOCAL servers as well.  There is no query parameter in the REST API to distinguish between local and cloud based servers using this API.  Alternatively you could use a SOAP Web Service to get only Cloud Servers via the searchDevices call in the V3 ManageDeviceService wsdl (https://flexNNNN.flexnetoperations.com/flexnet/services/v3/ManageDeviceService?wsdl).  A sample Request body is shown below:
 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:v3.fne.webservices.operations.flexnet.com">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:searchDevicesRequest>
         <!--Optional:-->
         <urn:queryParams>
            <urn:deviceClasses>
               <!--1 or more repetitions:-->
               <!--type: WSDeviceType - enumeration: [CLIENT,SERVER,SERVED_CLIENT]-->
               <urn:deviceClass>SERVER</urn:deviceClass>
            </urn:deviceClasses>
            <urn:hosted>true</urn:hosted>
         </urn:queryParams>
         <!--Optional:-->
         <urn:responseConfig>
            <urn:name>true</urn:name>
         </urn:responseConfig>
         <!--Optional:-->
         <urn:sortBys>
            <urn:sortBy>
               <!--type: deviceSortKey - enumeration: [DEVICE_ID,NAME,LAST_MODIFIED_DATE,SOLD_TO_ACCOUNT_ID,SOLD_TO_ACCOUNT_NAME,DEVICE_ID_TYPE,DEVICE_CLASS,HOST_TYPE_NAME,HOST_TYPE_ALIAS,HOST_SERIES_NAME,SIGNATURE_NAME,STATUS,PARENT_IDENTIFIER,USER,MACHINE_TYPE]-->
               <urn:sortKey>DEVICE_ID</urn:sortKey>
               <!--type: boolean-->
               <urn:ascending>true</urn:ascending>
            </urn:sortBy>
         </urn:sortBys>
         <urn:pageNumber>1</urn:pageNumber>
         <urn:batchSize>100</urn:batchSize>
      </urn:searchDevicesRequest>
   </soapenv:Body>
</soapenv:Envelope>
 
Thanks,
 

View solution in original post

0 Kudos
(1) Reply
jberthold
Revenera Moderator Revenera Moderator
Revenera Moderator

Hi @kiangorji ,

You can use the REST API from the "manage-device-service-rest-controller" to obtain a list of all Server IDs.

The link to the Swagger page is here:  https://flexNNNN.flexnetoperations.com/flexnet/swagger-ui.html#/manage45device45service45rest45controller

Send a POST to https://flexNNNN.flexnetoperations.com/flexnet/operations/manageDevice/1.0/devices 

with the following query 

"queryParams": {
    "deviceTypes": {
      "deviceType": [
        "SERVER"
      ]
 
To retrieve all SERVER devices.  Note that this will include LOCAL servers as well.  There is no query parameter in the REST API to distinguish between local and cloud based servers using this API.  Alternatively you could use a SOAP Web Service to get only Cloud Servers via the searchDevices call in the V3 ManageDeviceService wsdl (https://flexNNNN.flexnetoperations.com/flexnet/services/v3/ManageDeviceService?wsdl).  A sample Request body is shown below:
 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:v3.fne.webservices.operations.flexnet.com">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:searchDevicesRequest>
         <!--Optional:-->
         <urn:queryParams>
            <urn:deviceClasses>
               <!--1 or more repetitions:-->
               <!--type: WSDeviceType - enumeration: [CLIENT,SERVER,SERVED_CLIENT]-->
               <urn:deviceClass>SERVER</urn:deviceClass>
            </urn:deviceClasses>
            <urn:hosted>true</urn:hosted>
         </urn:queryParams>
         <!--Optional:-->
         <urn:responseConfig>
            <urn:name>true</urn:name>
         </urn:responseConfig>
         <!--Optional:-->
         <urn:sortBys>
            <urn:sortBy>
               <!--type: deviceSortKey - enumeration: [DEVICE_ID,NAME,LAST_MODIFIED_DATE,SOLD_TO_ACCOUNT_ID,SOLD_TO_ACCOUNT_NAME,DEVICE_ID_TYPE,DEVICE_CLASS,HOST_TYPE_NAME,HOST_TYPE_ALIAS,HOST_SERIES_NAME,SIGNATURE_NAME,STATUS,PARENT_IDENTIFIER,USER,MACHINE_TYPE]-->
               <urn:sortKey>DEVICE_ID</urn:sortKey>
               <!--type: boolean-->
               <urn:ascending>true</urn:ascending>
            </urn:sortBy>
         </urn:sortBys>
         <urn:pageNumber>1</urn:pageNumber>
         <urn:batchSize>100</urn:batchSize>
      </urn:searchDevicesRequest>
   </soapenv:Body>
</soapenv:Envelope>
 
Thanks,
 
0 Kudos