Create Logical Devices

post

/logicalDevice

Creates one or more logical devices with the given details. To create multiple logical devices, include the quantity parameter set to the number to create. When creating multiple logical devices, they will all have the same details.

The following fields are mandatory fields for successful creation:

  • @type
  • name
  • resourceSpecification

To create a resource relationship, resourceRelationship.type and resourceRelationship.resourceRef are mandatory. ResourceRef should contain the minimum details of id and @type. When creating multiple logical devices, only PARENT and INVOLVE relationship types can be provided. The created logical device will be shown in the response along with the location URL, except when "fields=none" is provided in the request.

Request

Query Parameters
Supported Media Types
Request Body - application/json ()
The logical device to create.
Root Schema : schema
A logical device.
Match All
Show Source
Nested Schema : LogicalResource
Type: object
The base class for logical resources.
Match All
Show Source
Nested Schema : Discriminator: @type
Type: object
A base resource Class.
Show Source
Nested Schema : LogicalResource-allOf[1]
Type: object
Nested Schema : type
Type: object
Show Source
Nested Schema : PlaceRef
Type: object
A place to associate with the resource/service.
Show Source
Nested Schema : roles
Type: array
The list of logical device roles.
Show Source
Nested Schema : Role
Type: object
A role.
Show Source
Back to Top

Response

Supported Media Types

201 Response

The logical devices were created successfully.
Body ()
Root Schema : schema
Type: array
Show Source
Nested Schema : schema
A logical device.
Match All
Show Source
Nested Schema : LogicalResource
Type: object
The base class for logical resources.
Match All
Show Source
Nested Schema : Discriminator: @type
Type: object
A base resource Class.
Show Source
Nested Schema : LogicalResource-allOf[1]
Type: object
Nested Schema : type
Type: object
Show Source
Nested Schema : PlaceRef
Type: object
A place to associate with the resource/service.
Show Source
Nested Schema : roles
Type: array
The list of logical device roles.
Show Source
Nested Schema : Role
Type: object
A role.
Show Source

400 Response

The request isn't valid.
Body ()
Root Schema : Error
Type: object
Used when an API throws an error. This is typically used with HTTP error response codes (3xx, 4xx, 5xx).
Show Source
  • The error code.
  • Allowed Values: [ "CustomObject", "CustomNetworkAddress", "DeviceInterface", "Equipment", "EquipmentHolder", "FlowIdentifier", "GeographicLocation", "GeographicSite", "GeographicAddress", "PropertyLocation", "LogicalDevice", "LogicalDeviceAccount", "MediaStream", "Network", "PhysicalConnector", "PhysicalDevice", "PhysicalPort", "Pipe", "Service", "TelephoneNumber", "IPV4Address", "IPV6Address", "IPSubnet", "NetworkAddressDomain", "Connectivity", "Party" ]
    The list of valid values for an entity class.
  • message
    The text that provides more details about the error as well as corrective actions.
  • The short, user-friendly summary of the problem, which does not change for subsequent occurrences of the problem.
  • The URL pointing to the documentation that describes the error.
  • The HTTP error code extension, such as 400-2.
Nested Schema : message
Type: array
The text that provides more details about the error as well as corrective actions.
Show Source

401 Response

You aren't authorized to make this request.
Body ()
Root Schema : Error
Type: object
Used when an API throws an error. This is typically used with HTTP error response codes (3xx, 4xx, 5xx).
Show Source
  • The error code.
  • Allowed Values: [ "CustomObject", "CustomNetworkAddress", "DeviceInterface", "Equipment", "EquipmentHolder", "FlowIdentifier", "GeographicLocation", "GeographicSite", "GeographicAddress", "PropertyLocation", "LogicalDevice", "LogicalDeviceAccount", "MediaStream", "Network", "PhysicalConnector", "PhysicalDevice", "PhysicalPort", "Pipe", "Service", "TelephoneNumber", "IPV4Address", "IPV6Address", "IPSubnet", "NetworkAddressDomain", "Connectivity", "Party" ]
    The list of valid values for an entity class.
  • message
    The text that provides more details about the error as well as corrective actions.
  • The short, user-friendly summary of the problem, which does not change for subsequent occurrences of the problem.
  • The URL pointing to the documentation that describes the error.
  • The HTTP error code extension, such as 400-2.
Nested Schema : message
Type: array
The text that provides more details about the error as well as corrective actions.
Show Source

403 Response

The request is forbidden.
Body ()
Root Schema : Error
Type: object
Used when an API throws an error. This is typically used with HTTP error response codes (3xx, 4xx, 5xx).
Show Source
  • The error code.
  • Allowed Values: [ "CustomObject", "CustomNetworkAddress", "DeviceInterface", "Equipment", "EquipmentHolder", "FlowIdentifier", "GeographicLocation", "GeographicSite", "GeographicAddress", "PropertyLocation", "LogicalDevice", "LogicalDeviceAccount", "MediaStream", "Network", "PhysicalConnector", "PhysicalDevice", "PhysicalPort", "Pipe", "Service", "TelephoneNumber", "IPV4Address", "IPV6Address", "IPSubnet", "NetworkAddressDomain", "Connectivity", "Party" ]
    The list of valid values for an entity class.
  • message
    The text that provides more details about the error as well as corrective actions.
  • The short, user-friendly summary of the problem, which does not change for subsequent occurrences of the problem.
  • The URL pointing to the documentation that describes the error.
  • The HTTP error code extension, such as 400-2.
Nested Schema : message
Type: array
The text that provides more details about the error as well as corrective actions.
Show Source

500 Response

An internal server error occurred.
Body ()
Root Schema : Error
Type: object
Used when an API throws an error. This is typically used with HTTP error response codes (3xx, 4xx, 5xx).
Show Source
  • The error code.
  • Allowed Values: [ "CustomObject", "CustomNetworkAddress", "DeviceInterface", "Equipment", "EquipmentHolder", "FlowIdentifier", "GeographicLocation", "GeographicSite", "GeographicAddress", "PropertyLocation", "LogicalDevice", "LogicalDeviceAccount", "MediaStream", "Network", "PhysicalConnector", "PhysicalDevice", "PhysicalPort", "Pipe", "Service", "TelephoneNumber", "IPV4Address", "IPV6Address", "IPSubnet", "NetworkAddressDomain", "Connectivity", "Party" ]
    The list of valid values for an entity class.
  • message
    The text that provides more details about the error as well as corrective actions.
  • The short, user-friendly summary of the problem, which does not change for subsequent occurrences of the problem.
  • The URL pointing to the documentation that describes the error.
  • The HTTP error code extension, such as 400-2.
Nested Schema : message
Type: array
The text that provides more details about the error as well as corrective actions.
Show Source
Back to Top

Examples

Create a Single Logical Device

This example shows how to create a single logical device with a given specification by submitting a POST request on the REST resource using cURL. For more information about cURL, see "Install and Use cURL".

cURL Command

curl -X POST "http://hostname:port/InventoryRSOpenAPI/resourceInventoryManagement/version/logicalDevice -H 'content-type: application/json' -H credentials -d @ldcreate.json

where:

  • hostname is the URL for the UIM REST server.
  • port is the port for the UIM REST server.
  • version is the version of the API you're using.
  • credentials is the base64 encoding of the user ID and password joined by a single colon (ID:password). See "Authentication and Authorization".
  • ldcreate.json is the JSON file that specifies the logical device to create.

Example of Request Body

This shows an example of the contents of the ldcreate.json file sent as the request body.

{
   "@type": "LogicalDevice",
      "@baseType": "LogicalResource",
      "name": "IP Phone",
      "resourceRelationship": [
         {
            "type": "INVOLVE",
            "resourceRef": {
               "id": "24-192.168.8.0-29 ? ABC_Inc_Pvt",
               "href": "http://hostname:port/InventoryRSOpenAPI/resourceInventoryManagement/version/resource/24-192.168.8.0-29 - ABC_Inc_Pvt",
               "@type": "IPSubnet"
            }
         }
      ],
      "resourceSpecification": {
         "id": "IP_Phone",
         "href": "http://hostname:port/InventoryRSOpenAPI/specification/IP_Phone",
         "name": "IP_Phone"
      }
}

Example of Response Body

This example shows the contents of the response body in JSON format. The ID is auto-generated and returned in the response, because the input specification indicates auto-generation.

{
   "id": "1-975001",
   "href": "http://hostname:port/InventoryRSOpenAPI/resourceInventoryManagement/version/resource/1-975001",
   "@type": "LogicalDevice",
   "@baseType": "LogicalResource",
   "name": "IP Phone",
   "version": "1",
   "lifecycleState": "INSTALLED",
   "lifecycleSubState": "UNASSIGNED",
   "startDate": "2020-01-09T15:00:39.407Z",
   "endDate": "2038-01-19T08:44:07.000Z",
   "resourceRelationship": [
       {
           "type": "INVOLVE",
           "resourceRef": {
               "id": "24-192.168.8.0-29 ? ABC_Inc_Pvt",
               "href": "http://hostname:port/InventoryRSOpenAPI/resourceInventoryManagement/version/resource/24-192.168.8.0-29 - ABC_Inc_Pvt",
               "@type": "IPSubnet"
           },
           "validFor": {
               "startDate": "2020-01-09T15:00:40.124Z",
               "endDate": "2038-01-19T08:44:07.000Z"
           }
      }        
   ],
   "resourceSpecification": {
      "id": "IP_Phone",
      "href": "http://hostname:port/InventoryRSOpenAPI/specification/IP_Phone",
      "name": "IP_Phone",
      "version": "1",
      "entityType": "LogicalDevice",
      "startDate": "2020-01-07T00:00:01.000Z",
      "endDate": "2038-01-19T08:44:07.000Z"
   }
}

Create Multiple Logical Devices

This example shows how to create multiple logical devices by submitting a POST request on the REST resource using cURL. For more information about cURL, see "Install and Use cURL".

cURL Command

curl -X POST "http://hostname:port/InventoryRSOpenAPI/resourceInventoryManagement/version/logicalDevice?quantity=qty -H 'content-type: application/json' -H credentials -d @ldcreate.json

where:

  • hostname is the URL for the UIM REST server.
  • port is the port for the UIM REST server.
  • version is the version of the API you're using.
  • credentials is the base64 encoding of the user ID and password joined by a single colon (ID:password). See "Authentication and Authorization".
  • qty is the number of logical devices to create.
  • ldcreate.json is the JSON file that specifies the logical device details.

Example of Request Body

This shows an example of the contents of the ldcreate.json file sent as the request body.

{
   "@type": "LogicalDevice",
      "@baseType": "LogicalResource",
      "name": "IP Phone",
      "resourceRelationship": [
         {
            "type": "INVOLVE",
            "resourceRef": {
               "id": "24-192.168.8.0-29 ? ABC_Inc_Pvt",
               "href": "http://hostname:port/InventoryRSOpenAPI/resourceInventoryManagement/version/resource/24-192.168.8.0-29 - ABC_Inc_Pvt",
               "@type": "IPSubnet"
            }
         }
      ],
      "resourceSpecification": {
         "id": "IP_Phone",
         "href": "http://hostname:port/InventoryRSOpenAPI/specification/IP_Phone",
         "name": "IP_Phone"
      }
}

Example of Response Body

This example shows the contents of the response body in JSON format. The ID is auto-generated and returned in the response, because the input specification indicates auto-generation.

[
   {
      "id": "1-975004",
      "href": "http://hostname:port/InventoryRSOpenAPI/resourceInventoryManagement/version/resource/1-975004",
      "@type": "LogicalDevice",
      "@baseType": "LogicalResource",
      "name": "IP Phone",
      "version": "1",
      "lifecycleState": "INSTALLED",
      "lifecycleSubState": "UNASSIGNED",
      "startDate": "2020-01-09T15:19:39.235Z",
      "endDate": "2038-01-19T08:44:07.000Z",
      "resourceRelationship": [
         {
            "type": "INVOLVE",
            "resourceRef": {
               "id": "24-192.168.8.0-29 ? ABC_Inc_Pvt",
               "href": "http://hostname:port/InventoryRSOpenAPI/resourceInventoryManagement/version/resource/24-192.168.8.0-29 - ABC_Inc_Pvt",
               "@type": "IPSubnet"
            },
            "validFor": {
               "startDate": "2020-01-09T15:19:39.365Z",
               "endDate": "2038-01-19T08:44:07.000Z"
            }
         }
      ],
        "resourceSpecification": {
            "id": "IP_Phone",
            "href": "http://hostname:port/InventoryRSOpenAPI/specification/IP_Phone",
            "name": "IP_Phone",
            "version": "1",
            "entityType": "LogicalDevice",
            "startDate": "2020-01-07T00:00:01.000Z",
            "endDate": "2038-01-19T08:44:07.000Z"
        }
    },
    {
        "id": "1-975003",
        "href": "http://hostname:port/InventoryRSOpenAPI/resourceInventoryManagement/version/resource/1-975003",
        "@type": "LogicalDevice",
        "@baseType": "LogicalResource",
        "name": "IP Phone",
        "version": "1",
        "lifecycleState": "INSTALLED",
        "lifecycleSubState": "UNASSIGNED",
        "startDate": "2020-01-09T15:19:39.233Z",
        "endDate": "2038-01-19T08:44:07.000Z",
        "resourceRelationship": [
            {
                "type": "INVOLVE",
                "resourceRef": {
                    "id": "24-192.168.8.0-29 ? ABC_Inc_Pvt",
                    "href": "http://hostname:port/InventoryRSOpenAPI/resourceInventoryManagement/version/resource/24-192.168.8.0-29 - ABC_Inc_Pvt",
                    "@type": "IPSubnet"
                },
                "validFor": {
                    "startDate": "2020-01-09T15:19:39.374Z",
                    "endDate": "2038-01-19T08:44:07.000Z"
                }
            }
        ],
        "resourceSpecification": {
            "id": "IP_Phone",
            "href": "http://hostname:port/InventoryRSOpenAPI/specification/IP_Phone",
            "name": "IP_Phone",
            "version": "1",
            "entityType": "LogicalDevice",
            "startDate": "2020-01-07T00:00:01.000Z",
            "endDate": "2038-01-19T08:44:07.000Z"
        }
    }
]
Back to Top