VMware Cloud Community
EdSp
Enthusiast
Enthusiast
Jump to solution

Can't add resource category to package with vRO 7.1 REST API

I am trying to add a Resource Element category to a package in Orchestrator 7.1, using the REST API.

The call:

/vco/api/packages/{packageName}/resource_category/System%20Config

always fails with the message that the given folder name doesn't exist:

{"status":404,"message":"Resource category with name System Config doesn't exist"}

I can’t get the call to find anything but top level resource categories. So, it works for “Library” but not for any other “folder” below that top level?!?!

Any tips appreciated.

Thanks,

Ed

0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi Ed,

When the error says id instead of name, this is just a typo in the error message. It is category name.

Here are some example URLs:

(1) Add the whole top level Library category:

/vco/api/packages/{packagename}/resource_category/Library/

(2) Add the second level System Config category (which is a child of Library category)

/vco/api/packages/{packagename}/resource_category/Library.System%20Config/

So, the rules are:

  • You need to specify the whole category path from the to-level Library to the desired category. Path segments are separated by dot '.' characters.
  • If the full category path contains dot '.' (meaning you are not importing the top-level Library category but some lower-level category), the URL should end up with slash '/' character (otherwise Spring will interpret the last part of the URL differently).

View solution in original post

0 Kudos
4 Replies
EdSp
Enthusiast
Enthusiast
Jump to solution

I just noticed the exact same behavior for adding a configuration category to a package, using the vRO 7.1 REST API.

I can’t get the call to find anything but top level configuration categories. So, it works for “Library” but not for any other “folder” below that top level?!?!

The call:

/vco/api/packages/{packageName}/configuration_category/{configCategoryName}

always fails with the message that the given folder id (not name?!) doesn't exist:

{"status":404,"message":"Configuration category with id myConfigs doesn't exist"}

Note that the error message refers to a configuration category id, while the swagger UI specifies a category name?!?!


To check, I ran the call passing in the id of the category, but same result.


Again, any info appreciated. It would seem a limitation if we could only add the highest level category (i.e. Library) to the package?


Thanks,

Ed

0 Kudos
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi Ed,

When the error says id instead of name, this is just a typo in the error message. It is category name.

Here are some example URLs:

(1) Add the whole top level Library category:

/vco/api/packages/{packagename}/resource_category/Library/

(2) Add the second level System Config category (which is a child of Library category)

/vco/api/packages/{packagename}/resource_category/Library.System%20Config/

So, the rules are:

  • You need to specify the whole category path from the to-level Library to the desired category. Path segments are separated by dot '.' characters.
  • If the full category path contains dot '.' (meaning you are not importing the top-level Library category but some lower-level category), the URL should end up with slash '/' character (otherwise Spring will interpret the last part of the URL differently).
0 Kudos
EdSp
Enthusiast
Enthusiast
Jump to solution

Thank you! Smiley Happy That makes sense.

One last question. I have some dots in the name of a configuration element category that I want to add to the package. So the dots would interfere with the dot being used as a separation character.

I tried replacing the dots that are part of the folder name by %2E (just like space is replaced by %20) however that does not succeed.

Trying to add configuration element category path: Library/com.app.config/

{"status":404,"message":"Configuration category with id Library.com.app.config doesn't exist"}

(I have a trailing slash at the end in the call.)

Thanks,

Ed

0 Kudos
iiliev
VMware Employee
VMware Employee
Jump to solution

I have to double check it, but there is a good chance that having dots in category name will cause problems.

0 Kudos