Quick Start

Set up your environment and make your first REST API call by performing these tasks.

Task 1: Set Up Your REST Client

You can use cURL in the command line, as shown in the examples in this document, or you can set up your REST client to make requests. See "Install and Use cURL" for information about using cURL.

To help create requests in a client, you can download the Oracle Communications Unified Inventory Management (UIM) REST API Swagger file and import it into your client. From the navigation bar at the left of this document, select the Download option and then select Swagger. The Swagger file is in JSON format.

Task 2: Create a User

Create a UIM user that has read, write, or read/write permissions for the UIM REST API endpoints. Users added to the uim-users group in WebLogic Server have authorization to access all UIM REST endpoints.

See Unified Inventory Management Installation Guide for information on creating a new user.

Task 3: Make a Sample Request

To check that your connection works, use cURL or your REST client to make a simple GET request. Use one of the endpoints your assigned role has read access to. For example, try getting the list of logical devices from the UIM environment:

curl -X GET https://hostname:port/InventoryRSOpenAPI/resourceInventoryManagement/version/logicalDevice -H "authorization: Basic credentials"

where:

  • hostname is the URL for the Oracle Communications UIM server.
  • port is the port for the Oracle Communications UIM server.
  • version is the version of the API you're using, such as v1. See Versioning.
  • credentials is the base64 encoding of the user ID and password joined by a single colon (ID:password). See Authentication and Authorization.

If the request is successful, you'll receive a 200 response with a body listing the logical devices:

[    
   {        
      "id": "1-150001",        
      "href": "http://hostname:port/InventoryRSOpenAPI/resourceInventoryManagement/version/resource/1-150001",        
      "@type": "LogicalDevice",        
      "@baseType": "LogicalResource",        
      "name": "TestLD",        
      "description": "LogicalDevice",        
      "version": "1",        
      "lifecycleState": "INSTALLED",        
      "lifecycleSubState": "UNASSIGNED",        
      "startDate": "2019-07-18T11:19:09.221Z",        
      "endDate": "2038-01-19T08:44:07.000Z",        
      "resourceRelationship": [            
         {                
            "type": "ASSIGN",                
            "resourceRef": {                    
               "id": "24-11.0.1.0-32 - Global IP Address Domain",                    
               "href": "http://hostname:port/InventoryRSOpenAPI/resourceInventoryManagement/version/resource/24-11.0.1.0-32 - Global IP Address Domain",
               "@type": "IPSubnet"
            },                
            "validFor": {
               "startDate": "2019-09-03T15:08:19.428Z",
               "endDate": "2038-01-19T08:44:07.000Z"
            }            
         },            
         {                
            "type": "INVOLVE",
            "resourceRef": {
               "id": "29-75001",
               "href": "http://hostname:port/InventoryRSOpenAPI/resourceInventoryManagement/version/resource/29-75001",
               "@type": "CustomNetworkAddress"
            },
            "validFor": {                    
               "startDate": "2019-11-04T20:46:15.030Z",
               "endDate": "2038-01-19T08:44:07.000Z"
            }            
         }        
      ],        
      "resourceSpecification": {            
         "id": "BATLD-DISpec",
         "href": "http://hostname:port/InventoryRSOpenAPI/specification/BATLD-DISpec",
         "name": "BATLD-DISpec",
         "version": "1",            
         "entityType": "LogicalDevice",            
         "startDate": "2019-12-05T00:00:01.000Z",            
         "endDate": "2038-01-19T08:44:07.000Z"        
      },        
      "vendorName": "CISCO",        
      "modelNumber": "Router Model 1905",        
      "networkLocation": {            
         "id": "HYD",            
         "href": "http://hostname:port/InventoryRSOpenAPI/place/HYD",            
         "name": "HYD",            
         "@referredType": "PropertyLocation"        
      },        
      "serviceLocation": {            
         "id": "HYD",            
         "href": "http://hostname:port/InventoryRSOpenAPI/place/HYD",
         "name": "HYD",            
         "@referredType": "PropertyLocation"        
      },        
   "deviceIdentifier": "HYD-DI",        
   "deviceInterfaces": "http://hostname:port/InventoryRSOpenAPI/resourceInventoryManagement/version/logicalDevice/1-150001/deviceInterfaces",        
   "roles": [            
      {                
         "roleName": "LDRole",                
         "roleType": "TECHNOLOGY"            
      }        
   ]
},