cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Get All Services of a Thing

pshashipreetham
17-Peridot

Get All Services of a Thing

Hi,

 

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

 

Thanks,

Shashi Preetham,
Email: psp316r@outlook.com,
Mobile: +91 8099838001.
1 ACCEPTED SOLUTION

Accepted Solutions

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,
Email: psp316r@outlook.com,
Mobile: +91 8099838001.

View solution in original post

4 REPLIES 4

Hi @pshashipreetham 

 

You can use GetServiceDefinitions to get services list in a Thing

 

/VR

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.

I have another solution, will post soon.

Shashi Preetham,
Email: psp316r@outlook.com,
Mobile: +91 8099838001.

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,
Email: psp316r@outlook.com,
Mobile: +91 8099838001.
Top Tags