Highlighted
Valued Contributor.. Valued Contributor..
Valued Contributor..
427 views

UCMDB REST API: How to rename attribute in the JSON response?

Dear UCMDB enthusiasts!

 

Maybe some of you already know if it is possible and how to alter attribute name (set a label?) in JSON response?

 

So, the query like this (at the moment):

 

{
"nodes": [
{
"type": "business_application",
"queryIdentifier": "BusinessApplications",
"visible": true,
"includeSubtypes": true,
"layout": [
"name",
"globalId",
"global_id",
"display_label",
"root_class",
"bla_unique_bla_id",
"bla_portfolio_id",
"bla_operational_status",
"bla_install_status",
"description",
"bla_sox_critical",
"bla_confidentiality_rating",
"bla_integrity_rating",
"bla_availability_rating",
"bla_vendor",
"bla_bia",
"bla_bia_date",
"bla_unique_servicenow_id",
"bla_admin_person",
"bla_asset_number",
"bla_asset_owner",
"bla_business_unit",
"bla_ci_accepted",
"bla_ci_accepted_by",
"bla_ci_alias",
"bla_ci_long_name",
"bla_ci_owner",
"bla_category",
"bla_config_admin_group",
"bla_contact_name",
"bla_cost_center",
"create_time",
"created_by",
"bla_environment",
"bla_externally_accessible",
"bla_last_audited_on_date",
"bla_last_verified_on_date",
"bla_monitored_by",
"bla_used_for"
],
"linkConditions": []
}]
}

 

Gives a response like this:

{
"ucmdbId": "bla",
"globalId": "bla",
"type": "business_application",
"properties": {
"bla_install_status": "In Stock",
"bla_externally_accessible": "no",
"bla_sox_critical": false,
"description": "HP UCMDB Acceptance Application Instance",
"bla_integrity_rating": "2: Standard",
"bla_admin_person": "bla",
"bla_ci_long_name": "HPCUCMDB-ACCeptance Application instance",
"root_class": "business_application",
"bla_portfolio_id": "bla",
"bla_ci_alias": "HPUCMDB-ACC",
"display_label": "HPUCMDB-ACC",
"bla_ci_owner": "bla",
"bla_confidentiality_rating": "3: Confidential",
"bla_contact_name": "bla",
"bla_operational_status": "Non-Operational",
"bla_unique_servicenow_id": "bla",
"create_time": "2018-02-22T10:09:14.138Z",
"bla_environment": "Acceptance",
"global_id": "bla",
"bla_vendor": "Hewlett Packard",
"bla_asset_owner": "bla",
"bla_category": "support application",
"bla_ci_accepted": false,
"bla_availability_rating": "2: Cold stand-by",
"bla_bia_date": "2014-12-17T07:00:00.000Z",
"bla_used_for": "Acceptance",
"name": "HPUCMDB-ACC",
"bla_business_unit": "bla",
"bla_config_admin_group": "bla",
"bla_unique_bla_id": "bla"
}
},

 

What I want is to have in response not UCMDB's class model system/technical name of attributes but to have a label, similarly SQL language AS keyword.

And instead of "bla_unique_bla_id" in the response there would be "Unique Identifier": "value".

 

What we're trying to achieve (the use case) is to have a common data model in our organization which uses many outher vendor and custom tools.

 

So, is this doable, and if yes, then how?

0 Likes
3 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: UCMDB REST API: How to rename attribute in the JSON response?

HI Alex,

the id which comes in the rest response is the CI Type attribute identifier. If you really really need a common attribute ids across the whole enterprise, you can always create a new attribute with "Unique Identifier" as an id and populate its values with an enrichment or through change of the integrations feeding the data into ucmdb. 

Of course I would question the requirement of having unique attribute names across the other vendors and custom tools. If every vendor has it's own API and you want to equalize them, the way to go would be to use a middleware as Tibco/Biztalk/WebMethods, etc istead of changing the API at the source. 

Regards,

Petko

Likes are appreciated!
0 Likes
Highlighted
Valued Contributor.. Valued Contributor..
Valued Contributor..

Re: UCMDB REST API: How to rename attribute in the JSON response?

Thanks Petco,

 

Using Middleware either from vendors or having a sort of a home-made reusable micro-service for that translation of attributes would require time+money for additional development and/or license. And having UCMDB REST API capability to dynamically change "label" of the attributes upon calls would be a real silver bullet in our case. Too pity it's not possible... Or is it, and you are not 100% sure? 🙂

 

Anyway, the other idea with breeding attributes just in sake of having different names is a kind of an abuse/overkill of UCMDB. I would totally avoid that.

 

For now I will wait for other community members to come by.

 

Regards,

Alex.

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: UCMDB REST API: How to rename attribute in the JSON response?

HI Alex,

I am about 99.9999% sure that UCMDB is not able to do what you've requested as you requested it. ServiceNow uses import sets and there can be done easily when submitting data, since the whole platform is made to be integrated easily through REST or SOAP.None of the other vendor systems I've seen is able to do it. 

I wonder how many tools of yours are actually capable of changing their APIs.

Cheers,

Petko

Likes are appreciated!
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.