Skip to main content
pshashipreetham
19-Tanzanite
May 25, 2024 9:38 AM UTC
Solved

Get All Services of a Thing

Hi,

 

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

 

Thanks,

pshashipreetham
19-Tanzanite
Jun 4, 2024 10:27 AM UTC

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,

Shashi Preetham || +91 8099838801 || shashi@psptechhub.com

4 replies

19-Tanzanite
May 27, 2024 4:50 AM UTC

Hi @pshashipreetham 

 

You can use GetServiceDefinitions to get services list in a Thing

 

/VR

Translate
Community Moderator
May 30, 2024 5:22 AM UTC

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.

Translate
pshashipreetham
19-Tanzanite
May 30, 2024 6:46 PM UTC

I have another solution, will post soon.

Translate
Shashi Preetham || +91 8099838801 || shashi@psptechhub.com
pshashipreetham
pshashipreetham19-TanzaniteAuthorAnswer
19-Tanzanite
Jun 4, 2024 10:27 AM UTC

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,

Translate
Shashi Preetham || +91 8099838801 || shashi@psptechhub.com