Create a Resource

post

/resource

Creates a resource with the given details. The following fields are mandatory fields for successful creation:

  • name
  • @type
  • resourceSpecification This field isn't mandatory the IPNetwork, IPv4Address, and IPV6Address resource types.

To create a resource relationship, resourceRelationship.type and resourceRelationship.resourceRef are mandatory. ResourceRef should contain the minimum details of id and @type.

The created resource will be shown in the response along with the location URL, except when "fields=none" is provided in the request.

Additional attributes could be required for specific resources and the details are provided in POST PATH of concrete resources. For example, physicalDeviceRef is mandatory for creating physical ports.

Request

Query Parameters
Supported Media Types
Request Body - application/json ()
The Resource to be created
Root Schema : Discriminator: @type
Type: object
A base resource Class.
Show Source
Nested Schema : externalIdentity
Type: object
Read Only: true
The external identity details for the federated resource.
Match All
Show Source
Nested Schema : place
Type: array
The list of associated geographic places.
Show Source
Nested Schema : resourceCharacteristic
Type: array
The list of characteristics for the resource.
Show Source
Nested Schema : resourceRelationship
Type: array
The list of all resources referenced with the current resource. For example, parent resource, associated resource, etc.
Show Source
Nested Schema : Specification
Type: object
A specification.
Show Source
  • Details about the specification.
  • The date and time when the specification ends.
  • 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.
  • The URI for the specification.
  • The ID of the specification, which is the same as the name of the specification.
  • The name of the specification.
  • The date and time when the specification starts.
  • The version of the specification, which is always 1.
Nested Schema : ExternalIdentity
Type: object
An external identity.
Show Source
Nested Schema : PlaceRef
Type: object
A place to associate with the resource/service.
Show Source
Nested Schema : Characteristic
Type: object
A characteristic of an object or entity represented by a name-value pair.
Show Source
Nested Schema : value
Type: object
The value of the characteristic.
Nested Schema : ResourceRelationship
Type: object
A relationship to a resource.
Show Source
Back to Top

Response

Supported Media Types

201 Response

The resource was created successfully.
Body ()
Root Schema : Discriminator: @type
Type: object
A base resource Class.
Show Source
Nested Schema : externalIdentity
Type: object
Read Only: true
The external identity details for the federated resource.
Match All
Show Source
Nested Schema : place
Type: array
The list of associated geographic places.
Show Source
Nested Schema : resourceCharacteristic
Type: array
The list of characteristics for the resource.
Show Source
Nested Schema : resourceRelationship
Type: array
The list of all resources referenced with the current resource. For example, parent resource, associated resource, etc.
Show Source
Nested Schema : Specification
Type: object
A specification.
Show Source
  • Details about the specification.
  • The date and time when the specification ends.
  • 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.
  • The URI for the specification.
  • The ID of the specification, which is the same as the name of the specification.
  • The name of the specification.
  • The date and time when the specification starts.
  • The version of the specification, which is always 1.
Nested Schema : ExternalIdentity
Type: object
An external identity.
Show Source
Nested Schema : PlaceRef
Type: object
A place to associate with the resource/service.
Show Source
Nested Schema : Characteristic
Type: object
A characteristic of an object or entity represented by a name-value pair.
Show Source
Nested Schema : value
Type: object
The value of the characteristic.
Nested Schema : ResourceRelationship
Type: object
A relationship to a resource.
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

This example shows how to create a resource for a given discriminator "@type" and 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/resource -H 'content-type: application/json' -H credentials -d @resourcecreate.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".
  • resourcecreate.json is the JSON file that specifies the resource to create.

Example of Request Body

This shows an example of the contents of the resourcecreate.json file sent as the request body. The discriminator "@type=LogicalDevice" indicates to create a logical device.

{
   "@type": "LogicalDevice",
   "name": "DSL LD",
   "description": "DSL CPE",
   "resourceCharacteristic": [
      {
         "name": "CPE_Type",
         "valueType": "ALPHANUMERIC",
         "value": "Switch"
      },
      {
         "name": "CPE_MAC",
         "valueType": "ALPHANUMERIC",
         "value": "00:A0:C9:14:C8:29"
      },
      {
         "name": "Model",
         "valueType": "ALPHANUMERIC",
         "value": "GSW-2020P"
      },
      {
         "name": "Vendor",
         "valueType": "ALPHANUMERIC",
         "value": "Cisco"
      }
   ],
   "resourceSpecification": {
      "id": "DSL_CPE"
   },
   "networkLocation": {
      "id": "HYD",
      "@referredType": "PropertyLocation"
   },
   "deviceIdentifier": "HYDDISwitch"
}

Example of Response Body

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

{
   "id": "1-825024",
   "href": "http://hostname:port/InventoryRSOpenAPI/resourceInventoryManagement/version/resource/1-825024",
   "@type": "LogicalDevice",
   "@baseType": "LogicalResource",
   "name": "DSL LD",
   "description": "DSL CPE",
   "version": "1",
   "lifecycleState": "INSTALLED",
   "lifecycleSubState": "UNASSIGNED",
   "startDate": "2020-01-10T10:48:54.334Z",
   "endDate": "2038-01-19T08:44:07.000Z",
   "resourceCharacteristic": [
      {
         "name": "Vendor",
         "valueType": "ALPHANUMERIC",
         "value": "Cisco"
      },
      {
         "name": "Model",
         "valueType": "ALPHANUMERIC",
         "value": "GSW-2020P"
      },
      {
         "name": "CPE_MAC",
         "valueType": "ALPHANUMERIC",
         "value": "00:A0:C9:14:C8:29"
      },
      {
         "name": "CPE_Type",
         "valueType": "ALPHANUMERIC",
         "value": "Switch"
      }
   ],
   "resourceSpecification": {
      "id": "DSL_CPE",
      "href": "http://hostname:port/InventoryRSOpenAPI/specification/DSL_CPE",
      "name": "DSL_CPE",
      "version": "1",
      "entityType": "LogicalDevice",
      "startDate": "2019-11-25T00:00:01.000Z",
      "endDate": "2038-01-19T08:44:07.000Z"
   },
   "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": "HYDDISwitch"
}
Back to Top