Skip to main content
pshashipreetham
18-Opal
18-Opal
May 25, 2024
Solved

Get All Services of a Thing

  • May 25, 2024
  • 3 replies
  • 1699 views

Hi,

 

Is there a service where I can get all the Services in a Thing?

 

Thanks,

Best answer by pshashipreetham

Hi,

 

For my useCase, I have used below code:

let metadata = Things["XYZ"].GetMetadata();

result = metadata.serviceDefinitions;

result.RemoveField("description");
result.RemoveField("aspects");
result.RemoveField("sourceName");
result.RemoveField("category");
result.RemoveField("isLocalOnly");
result.RemoveField("isPrivate");
result.RemoveField("isAllowOverride");
result.RemoveField("resultType");
result.RemoveField("parameterDefinitions");
result.RemoveField("sourceType");

 

Thanks @Velkumar for the response.

 

Thanks,

3 replies

19-Tanzanite
May 27, 2024

Hi @pshashipreetham 

 

You can use GetServiceDefinitions to get services list in a Thing

 

/VR

Community Moderator
May 30, 2024

Hello @pshashipreetham,

 

It looks like you have a response from a community member. If it helped you solve your question please mark the reply as the Accepted Solution. 

Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,
Community Moderation Team.

pshashipreetham
18-Opal
18-Opal
May 30, 2024

I have another solution, will post soon.

pshashipreetham
18-Opal
pshashipreetham18-OpalAuthorAnswer
18-Opal
June 4, 2024

Hi,

 

For my useCase, I have used below code:

let metadata = Things["XYZ"].GetMetadata();

result = metadata.serviceDefinitions;

result.RemoveField("description");
result.RemoveField("aspects");
result.RemoveField("sourceName");
result.RemoveField("category");
result.RemoveField("isLocalOnly");
result.RemoveField("isPrivate");
result.RemoveField("isAllowOverride");
result.RemoveField("resultType");
result.RemoveField("parameterDefinitions");
result.RemoveField("sourceType");

 

Thanks @Velkumar for the response.

 

Thanks,